/* One column, phone first: the conversation scrolls, the composer stays at the bottom. */
:root {
  --bg: #eef3f0;
  --surface: #ffffff;
  --ink: #142019;
  --muted: #586a61;
  --line: #d3dfd8;
  --accent: #0a7556;
  --accent-ink: #ffffff;
  --customer: #d7ede2;
  --customer-ink: #10291e;
  --amber: #8a5300;
  --amber-bg: #fbecd2;
  --red: #a3262a;
  --red-bg: #f8dfdf;
  --green-bg: #d9f0e5;
  --font:
    'Mukta', 'Noto Sans Kannada', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI',
    sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1411;
    --surface: #16201b;
    --ink: #e4eee8;
    --muted: #94a69d;
    --line: #2a3a33;
    --accent: #43c79a;
    --accent-ink: #06231a;
    --customer: #1d3a2e;
    --customer-ink: #dff3e9;
    --amber: #f2b45b;
    --amber-bg: #3a2a10;
    --red: #f0989a;
    --red-bg: #3a1a1b;
    --green-bg: #173528;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}
button,
input,
select {
  font: inherit;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.panel {
  max-width: 440px;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: grid;
  gap: 8px;
}
.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}
.lede {
  margin: 0 0 8px;
  color: var(--muted);
}
#consent-text {
  white-space: pre-line;
}
label {
  font-weight: 600;
  font-size: 15px;
  margin-top: 6px;
}
input[type='text'],
input[type='password'],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
.error {
  color: var(--red);
  margin: 4px 0 0;
  min-height: 1.5em;
}

button {
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 14px;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
  padding: 8px 14px;
  display: inline-block;
}
.quiet {
  background: transparent;
}
.wide {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
}

#chat {
  height: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px
    max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.bar-title {
  display: grid;
  min-width: 0;
}
.bar-title span {
  font-size: 13px;
  color: var(--muted);
}
.voice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  font-size: 14px;
  color: var(--muted);
}
.voice label {
  margin: 0;
  font-weight: 500;
  font-size: 14px;
}
.voice select {
  width: auto;
  padding: 4px 8px;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.thread {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
}
/* Items keep their full height; the thread scrolls instead of squeezing them. */
.thread > * {
  flex-shrink: 0;
}
.row {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.row.customer {
  align-items: flex-end;
}
.row.assistant {
  align-items: flex-start;
}
.bubble {
  margin: 0;
  max-width: 86%;
  padding: 8px 12px;
  border-radius: 16px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.customer .bubble {
  background: var(--customer);
  color: var(--customer-ink);
  border-bottom-right-radius: 4px;
}
.assistant .bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.choices,
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.suggestions {
  padding: 0 max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
}
.choice {
  border-color: var(--accent);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 15px;
  text-align: left;
}

.card {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
.card-head {
  margin: 0;
  padding: 10px 14px 0;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-body {
  padding: 4px 14px 12px;
  display: grid;
  gap: 4px;
}
.card-item {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}
.card-meta {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}
.price {
  font-weight: 600;
}
.card ul,
.steps {
  margin: 4px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 15px;
}
.steps {
  color: var(--ink);
  display: grid;
  gap: 6px;
}
.steps .detail {
  display: block;
  color: var(--muted);
  font-size: 14.5px;
}
.live {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--amber);
  background: var(--amber-bg);
  border-radius: 6px;
  padding: 0 6px;
  margin-left: 6px;
}
.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}

.status {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}
.pill {
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 999px;
  padding: 1px 9px;
  background: var(--line);
  white-space: nowrap;
}
.pill.good {
  background: var(--green-bg);
  color: var(--accent);
}
.pill.wait {
  background: var(--amber-bg);
  color: var(--amber);
}
.pill.bad {
  background: var(--red-bg);
  color: var(--red);
}
.note {
  margin: 0;
  align-self: center;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
.note.bad {
  color: var(--red);
}
.busy {
  margin: 0;
  padding: 0 16px 6px;
  font-size: 14px;
  color: var(--muted);
}

.composer {
  display: flex;
  gap: 8px;
  padding: 10px max(16px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.composer input {
  flex: 1;
  min-width: 0;
}
.mic {
  width: 44px;
  padding: 0;
  display: grid;
  place-items: center;
}
.mic svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.mic.listening {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    transform: scale(1.08);
  }
}
@media (prefers-reduced-motion: reduce) {
  .mic.listening {
    animation: none;
  }
}
