:root {
  --wa-green-dark: #075e54;
  --wa-green: #128c7e;
  --wa-green-light: #25d366;
  --wa-bg: #e5ddd5;
  --wa-bubble-in: #ffffff;
  --wa-bubble-out: #dcf8c6;
  --ink-900: #111827;
  --ink-600: #4b5563;
  --ink-400: #9ca3af;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--wa-bg);
  color: var(--ink-900);
}

.chat-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--wa-bg);
  display: flex;
  flex-direction: column;
}

.chat-header {
  background: var(--wa-green-dark);
  color: #fff;
  padding: .9rem 1rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  position: sticky;
  top: 0;
  z-index: 5;
}

.chat-header .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--wa-green-light);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

.chat-header .name { font-weight: 600; font-size: .95rem; }
.chat-header .sub { font-size: .72rem; opacity: .85; }

.chat-body {
  flex: 1;
  padding: 1rem .75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  overflow-y: auto;
}

.bubble-row { display: flex; }
.bubble-row.out { justify-content: flex-end; }

.bubble {
  max-width: 82%;
  padding: .55rem .75rem;
  border-radius: var(--radius);
  font-size: .88rem;
  line-height: 1.42;
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
  white-space: pre-line;
}

.bubble-row.in .bubble { background: var(--wa-bubble-in); border-top-left-radius: 3px; }
.bubble-row.out .bubble { background: var(--wa-bubble-out); border-top-right-radius: 3px; }

.bubble .time { display: block; font-size: .66rem; color: var(--ink-400); margin-top: .25rem; text-align: right; }

.choice-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  max-width: 82%;
}

.choice-btn {
  background: #fff;
  border: 1px solid #d7dbd6;
  border-radius: 999px;
  padding: .5rem .9rem;
  font-size: .85rem;
  text-align: left;
  cursor: pointer;
  color: var(--wa-green-dark);
  font-weight: 600;
}

.choice-btn:hover { background: #f0fdf4; }
.choice-btn:disabled { opacity: .45; cursor: not-allowed; }

.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; max-width: 100%; }

.chip-btn {
  background: #fff;
  border: 1px solid #d7dbd6;
  border-radius: 8px;
  padding: .4rem .65rem;
  font-size: .8rem;
  cursor: pointer;
  color: var(--ink-900);
}

.chip-btn.selected, .chip-btn:hover { background: var(--wa-green-light); color: #fff; border-color: var(--wa-green-light); }
.chip-btn:disabled { opacity: .35; cursor: not-allowed; }

.mini-form {
  background: #fff;
  border-radius: var(--radius);
  padding: .8rem;
  max-width: 88%;
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
}

.mini-form .form-group { margin-bottom: .6rem; }
.mini-form label { display: block; font-size: .78rem; font-weight: 600; color: var(--ink-600); margin-bottom: .2rem; }
.mini-form input, .mini-form textarea {
  width: 100%;
  padding: .5rem .6rem;
  border: 1px solid #d7dbd6;
  border-radius: 8px;
  font-size: .85rem;
  font-family: inherit;
}

.send-btn {
  background: var(--wa-green);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: .55rem 1.1rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.send-btn:hover { background: var(--wa-green-dark); }
.send-btn:disabled { opacity: .5; cursor: not-allowed; }

.typing {
  display: inline-flex;
  gap: 3px;
  padding: .6rem .8rem;
  background: var(--wa-bubble-in);
  border-radius: var(--radius);
  border-top-left-radius: 3px;
  width: fit-content;
}
.typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink-400);
  animation: blink 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.summary-card {
  background: #fff;
  border-radius: var(--radius);
  padding: .8rem;
  max-width: 88%;
  font-size: .85rem;
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
}
.summary-card dt { color: var(--ink-600); font-size: .74rem; margin-top: .35rem; }
.summary-card dd { margin: 0; font-weight: 600; }

/* Standalone status / reschedule pages reuse the same chat visual language */
.status-page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
}
.status-header {
  background: var(--wa-green-dark);
  color: #fff;
  padding: 1.1rem 1rem;
}
.status-header h1 { margin: 0; font-size: 1.05rem; }
.status-body { padding: 1rem; }
.status-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.queue-number-big {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--wa-green-dark);
  text-align: center;
}
.wait-banner {
  background: #fff7ed;
  color: #9a3412;
  border-radius: 8px;
  padding: .6rem .8rem;
  font-size: .85rem;
  text-align: center;
  margin: .75rem 0;
}
