:root {
  --wa-green-dark: #075e54;
  --wa-green-header: #128c7e;
  --wa-bubble-out: #dcf8c6;
  --wa-bubble-in: #ffffff;
  --wa-bg: #e5ddd5;
  --wa-text: #111b21;
  --wa-muted: #667781;
}

* { box-sizing: border-box; }

html {
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b141a;
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
}

.phone {
  width: clamp(360px, 34vw, 480px);
  height: clamp(600px, 88vh, 860px);
  display: flex;
  flex-direction: column;
  background: var(--wa-bg);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

/* En pantallas de celular real: ocupa todo, sin marco tipo mockup */
@media (max-width: 600px) {
  .phone {
    width: 100vw;
    height: 100vh;
    box-shadow: none;
  }
}

.header {
  background: var(--wa-green-header);
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  flex-shrink: 0;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--wa-green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.name { font-weight: 600; font-size: 16px; }
.status { font-size: 12px; opacity: 0.85; }

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-image: linear-gradient(rgba(229,221,213,0.9), rgba(229,221,213,0.9));
}

.bubble {
  max-width: 78%;
  padding: 7px 10px 9px;
  border-radius: 8px;
  font-size: 14.5px;
  line-height: 1.35;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.bubble.in {
  background: var(--wa-bubble-in);
  color: var(--wa-text);
  align-self: flex-start;
  border-top-left-radius: 2px;
}

.bubble.out {
  background: var(--wa-bubble-out);
  color: var(--wa-text);
  align-self: flex-end;
  border-top-right-radius: 2px;
}

.bubble .time {
  display: block;
  text-align: right;
  font-size: 10.5px;
  color: var(--wa-muted);
  margin-top: 2px;
}

.bubble.typing {
  color: var(--wa-muted);
  font-style: italic;
}

.composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f0f0f0;
  flex-shrink: 0;
}

.composer input {
  flex: 1;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14.5px;
  outline: none;
}

.composer button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--wa-green-header);
  color: white;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.composer button:disabled {
  opacity: 0.5;
  cursor: default;
}
