/* Speak Labs design tokens.
   Calm teal for trust. Coral only for the mic and the main call to action.
   Amber for tips. No red anywhere in the learning flow. */
:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #ebe6de;
  --primary: #0f766e;
  --primary-ink: #ffffff;
  --primary-soft: #ccfbf1;
  --primary-tint: #f0fdfa;
  --mic: #e8553f;
  --mic-ink: #ffffff;
  --mic-glow: #fde2dc;
  --success: #15803d;
  --success-soft: #dcfce7;
  --tip: #d97706;
  --tip-text: #92400e;
  --tip-bg: #fef3c7;
  --shadow: 0 1px 2px rgba(31, 41, 55, 0.04), 0 8px 24px rgba(31, 41, 55, 0.06);
  --radius: 20px;
  --head: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --tab-h: 72px;
  /* Scenario icon tints */
  --t-amber-bg: #fef3c7; --t-amber: #92400e;
  --t-teal-bg: #ccfbf1;  --t-teal: #0f766e;
  --t-blue-bg: #dbeafe;  --t-blue: #1d4ed8;
  --t-pink-bg: #fce7f3;  --t-pink: #9d174d;
  --t-violet-bg: #ede9fe; --t-violet: #6d28d9;
  --t-sky-bg: #e0f2fe;   --t-sky: #0369a1;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --line: #334155;
    --primary: #2dd4bf;
    --primary-ink: #042f2e;
    --primary-soft: #134e4a;
    --primary-tint: #112f3a;
    --mic: #fb8a7a;
    --mic-ink: #1f1310;
    --mic-glow: #4a2723;
    --success: #4ade80;
    --success-soft: #14532d;
    --tip: #fbbf24;
    --tip-text: #fcd34d;
    --tip-bg: #422006;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --t-amber-bg: #422006; --t-amber: #fcd34d;
    --t-teal-bg: #134e4a;  --t-teal: #5eead4;
    --t-blue-bg: #1e3a8a;  --t-blue: #bfdbfe;
    --t-pink-bg: #500724;  --t-pink: #fbcfe8;
    --t-violet-bg: #2e1065; --t-violet: #ddd6fe;
    --t-sky-bg: #0c4a6e;   --t-sky: #bae6fd;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--body); font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--head); font-weight: 900; letter-spacing: -0.01em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(1.9rem, 7vw, 2.25rem); }
h2 { font-size: 1.5rem; font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 800; }
p { margin: 0; }
small { font-size: 0.875rem; }
svg { display: block; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.fine { font-size: 0.875rem; color: var(--muted); }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 6px; }
.section-gap { margin-top: 24px; }
.stack { display: grid; gap: 10px; }

#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; }
.view { display: none; }
.view.active { display: block; }
.tab-view { padding: 24px 20px calc(var(--tab-h) + 32px + env(safe-area-inset-bottom, 0px)); }
.page-pad { padding: 20px 20px 24px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 14px 24px; font-weight: 700; font-size: 1rem; border: 2px solid transparent;
  text-decoration: none; transition: transform 0.1s, background 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-cta { background: var(--mic); color: var(--mic-ink); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-light { background: var(--surface); color: var(--primary); }
.btn-sm { padding: 9px 18px; font-size: 0.95rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; }
.link-btn {
  border: 0; background: none; padding: 4px 0; font-weight: 700; color: var(--primary);
  text-decoration: underline; text-underline-offset: 3px;
}
.link-btn.quiet { color: var(--muted); font-weight: 600; }
.round-btn {
  width: 48px; height: 48px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.round-btn.plain { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.round-btn.say { background: var(--mic); color: var(--mic-ink); }
.round-btn svg { width: 20px; height: 20px; }
.round-btn.recording { animation: glow 1.4s ease-out infinite; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 10px 18px; font-weight: 700; min-height: 48px;
}
.pill-btn svg { width: 18px; height: 18px; }
.pill-btn:disabled { opacity: 0.45; }

/* The mic: the only coral control in the app. */
.mic-btn {
  width: 64px; height: 64px; border-radius: 50%; border: 0; display: grid; place-items: center; margin: 8px auto;
  background: var(--mic); color: var(--mic-ink); box-shadow: 0 0 0 8px var(--mic-glow);
}
.mic-btn svg { width: 28px; height: 28px; }
.mic-btn.big { width: 88px; height: 88px; margin: 0; box-shadow: 0 0 0 10px var(--mic-glow); }
.mic-btn.big svg { width: 34px; height: 34px; }
.mic-btn:disabled { opacity: 0.45; box-shadow: none; }
.mic-btn.recording { animation: glow 1.4s ease-out infinite; }
.mic-btn.recording .mic-icon svg { display: none; }
.mic-btn.recording .mic-icon::before { content: ''; display: block; width: 26px; height: 26px; border-radius: 6px; background: currentColor; }
.mic-btn.listening { animation: glow 2.4s ease-out infinite; }

/* ---------- Cards ---------- */
.card {
  display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
button.card:hover { border-color: var(--primary); }
.card + .card { margin-top: 12px; }
.row-card { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.row-text { flex: 1; display: grid; min-width: 0; }
.row-text small { color: var(--muted); }
.chev { color: var(--muted); }
.chev svg { width: 20px; height: 20px; }
.tile-icon {
  width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center;
  background: var(--t-teal-bg); color: var(--t-teal);
}
.tile-icon svg { width: 24px; height: 24px; }
.tile-icon.big { width: 72px; height: 72px; border-radius: 18px; }
.tile-icon.big svg { width: 34px; height: 34px; }
.tint-amber { background: var(--t-amber-bg); color: var(--t-amber); }
.tint-teal { background: var(--t-teal-bg); color: var(--t-teal); }
.tint-blue { background: var(--t-blue-bg); color: var(--t-blue); }
.tint-pink { background: var(--t-pink-bg); color: var(--t-pink); }
.tint-violet { background: var(--t-violet-bg); color: var(--t-violet); }
.tint-sky { background: var(--t-sky-bg); color: var(--t-sky); }
.avatar {
  width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-family: var(--head); font-weight: 900; font-size: 1.15rem;
}
.avatar.big { width: 56px; height: 56px; font-size: 1.4rem; }

/* ---------- Home ---------- */
.hello { color: var(--muted); font-weight: 500; }
.streak {
  display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow);
}
.streak svg { width: 18px; height: 18px; color: var(--mic); }
.goal-card { display: flex; align-items: center; gap: 18px; }
.goal-text { display: grid; gap: 2px; }
.goal-text strong { font-family: var(--head); font-size: 1.2rem; font-weight: 800; }
.goal-text span { color: var(--muted); }
.ring { position: relative; width: 76px; height: 76px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--primary-soft); }
.ring .value { stroke: var(--primary); transition: stroke-dashoffset 1s ease; }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.today-card {
  margin-top: 14px; background: var(--primary); color: var(--primary-ink); border-radius: var(--radius); padding: 22px;
}
.today-card .eyebrow { opacity: 0.85; }
.today-card h2 { margin: 4px 0 8px; }
.today-card p { opacity: 0.92; }
.today-card .btn { margin-top: 16px; }
.phrase-card {
  margin-top: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between;
  background: var(--tip-bg); color: var(--tip-text); border-radius: var(--radius); padding: 18px;
}
.phrase-card .eyebrow { color: var(--tip-text); }
.phrase-big { font-weight: 700; color: var(--text); font-size: 1.05rem; }
.phrase-from { font-size: 0.9rem; margin-top: 4px; }
.phrase-card-actions { display: grid; gap: 8px; }
.phrase-card .round-btn:not(.say) { background: var(--surface); color: var(--tip-text); }
.say-result { font-size: 0.92rem; font-weight: 600; margin-top: 6px; }
.say-result:empty { display: none; }
.say-result.good { color: var(--success); }
.say-result.close { color: var(--tip-text); }

/* ---------- Practice ---------- */
.search {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 0 16px; box-shadow: var(--shadow);
}
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: 14px 0; outline: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 4px; margin: 0 -20px 10px; padding-left: 20px; padding-right: 20px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 8px 16px; font-weight: 600; font-size: 0.95rem; white-space: nowrap;
}
.chip[aria-checked='true'] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.list { display: grid; gap: 12px; }
.scene-card { display: flex; align-items: center; gap: 14px; }
.scene-card .row-text strong { font-size: 1.05rem; }
.done-chip { background: var(--success-soft); color: var(--success); border-radius: 999px; padding: 3px 10px; font-size: 0.8rem; font-weight: 700; }

/* ---------- Brief ---------- */
.brief-head { display: flex; align-items: center; gap: 16px; margin: 20px 0; }
.brief-head h1 { font-size: 1.6rem; }
#brief .card p:not(.eyebrow) { margin-bottom: 14px; }
.dots-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.dots-list li { position: relative; padding-left: 20px; }
.dots-list li::before { content: ''; position: absolute; left: 2px; top: 0.6em; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.phrase-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: 10px 10px 10px 18px;
}
.bottom-bar {
  position: sticky; bottom: 0; padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg) 70%, transparent); display: grid; gap: 8px;
}
.bottom-bar.two { grid-template-columns: 1fr 1fr; }
.bottom-bar .btn { padding-left: 12px; padding-right: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bottom-bar.two:empty { display: none; }

/* ---------- Talk ---------- */
#talk.active { display: flex; flex-direction: column; height: 100dvh; }
.talk-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent); padding-top: calc(12px + env(safe-area-inset-top, 0px));
}
.talk-who { flex: 1; display: grid; min-width: 0; line-height: 1.3; }
.talk-who small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.talk-dots { display: flex; gap: 4px; }
.talk-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-soft); }
.talk-dots i.on { background: var(--primary); }
.chat { flex: 1; overflow-y: auto; padding: 20px 16px 12px; display: flex; flex-direction: column; gap: 12px; }
.bubble {
  max-width: 85%; padding: 12px 16px; border-radius: 20px; position: relative; animation: rise 0.25s ease both;
  overflow-wrap: anywhere;
}
.bubble.ai { align-self: flex-start; background: var(--primary-soft); color: var(--text); border-bottom-left-radius: 6px; }
.bubble.ai.has-play { padding-right: 48px; }
.bubble.user { align-self: flex-end; background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 6px; }
.bubble.hint {
  align-self: flex-end; background: transparent; color: var(--text); border: 2px dashed var(--primary);
  display: flex; gap: 10px; align-items: center; border-bottom-right-radius: 6px;
}
.bubble.hint small { display: block; color: var(--muted); font-weight: 600; }
.replay {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--primary); display: grid; place-items: center;
}
.replay svg, .mini-play svg { width: 14px; height: 14px; }
.mini-play {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.typing { align-self: flex-start; display: flex; gap: 5px; padding: 16px 18px; background: var(--primary-soft); border-radius: 20px; border-bottom-left-radius: 6px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); opacity: 0.5; animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
.controls {
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line);
  background: var(--bg); display: grid; gap: 8px;
}
.status { min-height: 0; text-align: center; font-size: 0.92rem; color: var(--muted); }
.status:empty { display: none; }
.mic-label { text-align: center; font-size: 0.92rem; color: var(--muted); font-weight: 600; min-height: 1.4em; }
.mic-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 6px 0; }
.mic-row .pill-btn:first-child { justify-self: start; }
.mic-row .pill-btn:last-child { justify-self: end; }
.talk-links { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.type-row { display: flex; gap: 8px; }
.type-row input {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 12px 18px; outline: none;
}
.type-row input:focus { border-color: var(--primary); }
.send-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; }
.send-btn svg { width: 20px; height: 20px; }
.send-btn:disabled { opacity: 0.45; }

/* ---------- Review ---------- */
.review-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
#review .page-pad, #past .page-pad { padding-bottom: 8px; }
.review-hero h1 { margin-bottom: 6px; }
.review-hero p { color: var(--muted); }
.well-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.well-list li { display: flex; gap: 10px; }
.well-list svg { width: 20px; height: 20px; color: var(--success); flex: none; margin-top: 2px; }
.card-title { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; }
.card-title.good { color: var(--success); }
.skill { display: grid; gap: 6px; }
.skill + .skill { margin-top: 14px; }
.skill-top { display: flex; justify-content: space-between; font-weight: 700; }
.skill-top span:last-child { color: var(--primary); }
.bar { height: 10px; border-radius: 99px; background: var(--primary-soft); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 99px; background: var(--primary); width: 0; transition: width 0.9s ease; }
.section-title { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 26px 0 10px; }
.tip-card { background: var(--tip-bg); border-radius: var(--radius); padding: 18px; color: var(--tip-text); }
.tip-card + .tip-card { margin-top: 12px; }
.tip-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.tip-said { font-size: 0.95rem; color: color-mix(in srgb, var(--text) 75%, var(--tip-bg)); }
.tip-better { font-weight: 700; font-size: 1.1rem; color: var(--text); margin: 4px 0; }
.tip-why { font-size: 0.95rem; }
.tip-row { display: flex; gap: 12px; align-items: center; }
.tip-row > div { flex: 1; min-width: 0; }
.plain-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.phrase-line { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.phrase-line:last-child { border-bottom: 0; padding-bottom: 0; }
.phrase-line:first-child { padding-top: 0; }
.phrase-line > span:not(.fix-tag) { flex: 1; display: grid; }
.phrase-line small { color: var(--muted); }
.fix-tag { font-size: 0.75rem; font-weight: 700; color: var(--tip-text); background: var(--tip-bg); border-radius: 999px; padding: 2px 10px; flex: none; }
.save-note { margin-top: 20px; padding: 14px 16px; border-radius: 16px; background: var(--primary-tint); color: var(--text); font-size: 0.95rem; }
.loading { text-align: center; padding: 80px 20px; color: var(--muted); display: grid; justify-items: center; gap: 16px; }
.empty-note { color: var(--muted); }
.transcript { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Progress ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.tile b { display: block; font-family: var(--head); font-size: 1.7rem; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 0.85rem; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.chart-head strong { font-family: var(--head); font-weight: 800; font-size: 1.1rem; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--body); }
.chart .axis.today { fill: var(--text); font-weight: 700; }
.chart .trend { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.chart .dot.on { r: 6; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .day-bar { fill: var(--primary); }
.chart .day-bar.zero { fill: var(--primary-soft); }
.chart .day-bar.on { fill: color-mix(in srgb, var(--primary) 80%, var(--text)); }
.chart .bar-hit { fill: transparent; cursor: pointer; }
.chart .value-label { fill: var(--text); font-size: 12px; font-weight: 700; font-family: var(--body); }
.chart-tip {
  position: absolute; top: -6px; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  background: var(--text); color: var(--bg); border-radius: 10px; padding: 6px 10px; font-size: 0.85rem;
}
.chart-tip b { margin-right: 4px; }
.chart-tip small { display: block; opacity: 0.75; }
.skill-row { display: grid; grid-template-columns: 110px 1fr 64px; align-items: center; gap: 10px; font-weight: 600; font-size: 0.95rem; }
.skill-row + .skill-row { margin-top: 12px; }
.skill-row b { text-align: right; font-variant-numeric: tabular-nums; }
.skill-row em { font-style: normal; font-size: 0.78rem; margin-left: 4px; color: var(--muted); }
.skill-row em.up { color: var(--success); }
.skill-row em.down { color: var(--tip-text); }
.count { font-size: 0.8rem; background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.past-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.past-list button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; }
.past-list small { display: block; color: var(--muted); }
.score-pill { border-radius: 999px; padding: 3px 12px; font-weight: 700; font-size: 0.9rem; background: var(--primary-soft); color: var(--primary); font-variant-numeric: tabular-nums; }
.score-pill.mid { background: var(--tip-bg); color: var(--tip-text); }
.danger-link { color: var(--muted); }

/* ---------- Me ---------- */
.profile { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.profile span:last-child { display: grid; min-width: 0; }
.profile small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px; }
.segmented button { border: 0; background: transparent; border-radius: 12px; padding: 11px 6px; font-weight: 600; font-size: 0.95rem; color: var(--muted); }
.segmented button[aria-checked='true'] { background: var(--primary); color: var(--primary-ink); }
.choice {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: left; width: 100%;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.choice span:first-child { display: grid; gap: 2px; }
.choice small { color: var(--muted); font-size: 0.92rem; }
.choice[aria-checked='true'] { border-color: var(--primary); background: var(--primary-tint); }
.radio { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; }
.choice[aria-checked='true'] .radio { border-color: var(--primary); }
.choice[aria-checked='true'] .radio::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); }
.note { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 12px 14px; background: var(--surface); border-radius: 16px; color: var(--muted); font-size: 0.92rem; }
.note svg { width: 18px; height: 18px; color: var(--primary); flex: none; margin-top: 2px; }
.voice-row { display: flex; gap: 10px; align-items: center; }
.voice-row select {
  flex: 1; min-width: 0; font-weight: 600; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 13px 14px;
}
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch-row span { display: grid; gap: 2px; }
.switch-row small { color: var(--muted); }
.switch-row input {
  appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 32px; border-radius: 999px;
  background: var(--line); position: relative; cursor: pointer; transition: background 0.2s; margin: 0;
}
.switch-row input::after {
  content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s;
}
.switch-row input:checked { background: var(--primary); }
.switch-row input:checked::after { transform: translateX(20px); }

/* ---------- Sign in ---------- */
.auth-body { display: grid; gap: 14px; }
.auth-body h1 { margin-top: 8px; }
.auth-intro { padding: 14px 16px; border-radius: 16px; background: var(--primary-tint); font-weight: 600; }
.google-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 14px; box-shadow: var(--shadow);
}
.google-btn svg { width: 20px; height: 20px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.875rem; margin: 18px 0 4px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#authForm { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; font-weight: 600; font-size: 0.95rem; }
.field input { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 13px 16px; width: 100%; outline: none; }
.field input:focus { border-color: var(--primary); }
.auth-msg { min-height: 1.5em; color: var(--muted); font-size: 0.95rem; }
.auth-msg.error { color: var(--tip-text); font-weight: 600; }
.auth-msg.ok { color: var(--success); font-weight: 600; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0 auto; max-width: 560px;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); padding: 0 6px env(safe-area-inset-bottom, 0px);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar button {
  border: 0; background: none; display: grid; justify-items: center; gap: 2px; padding: 10px 0 12px;
  color: var(--muted); font-size: 0.78rem; font-weight: 600;
}
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button[aria-current='page'] { color: var(--primary); font-weight: 700; }
.tabbar .tab-mic {
  width: 68px; height: 68px; border-radius: 50%; justify-self: center; align-self: start; margin-top: -22px; padding: 0;
  display: grid; place-items: center; background: var(--mic); color: var(--mic-ink);
  box-shadow: 0 0 0 6px var(--bg), 0 8px 20px color-mix(in srgb, var(--mic) 35%, transparent);
}
.tabbar .tab-mic svg { width: 30px; height: 30px; }

/* ---------- Landing ---------- */
#app:has(#landing.active) { max-width: none; }
.landing { padding: 0; }
.site-head, .hero, .band > *, .site-foot { max-width: 1040px; margin-left: auto; margin-right: auto; }
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--head); font-weight: 900; font-size: 1.15rem; }
.logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); }
.logo svg { width: 18px; height: 18px; }
.site-nav { display: flex; align-items: center; gap: 18px; }
.nav-link { border: 0; background: none; padding: 0; color: var(--text); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav-link.strong { color: var(--primary); font-weight: 700; }
.hero { display: grid; gap: 32px; padding: 24px 20px 48px; align-items: center; }
.hero-text { display: grid; gap: 18px; justify-items: start; }
.hero h1 { font-size: clamp(2.2rem, 8vw, 3.2rem); line-height: 1.08; }
.chip-soft { background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 4px 12px; font-size: 0.85rem; font-weight: 600; }
.lede { color: var(--muted); font-size: 1.08rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.demo { background: var(--surface); border-radius: 24px; padding: 20px; box-shadow: 0 20px 50px rgba(31, 41, 55, 0.1); border: 1px solid var(--line); }
.demo-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.demo-head span:last-child { display: grid; }
.demo-head small { color: var(--muted); }
.demo-chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.demo .mic-btn { margin-top: 18px; }
.demo .fine { margin-top: 10px; }
.band { padding: 56px 20px; }
.band-tint { background: color-mix(in srgb, var(--surface) 55%, var(--bg)); }
.band h2 { margin-bottom: 14px; font-size: clamp(1.6rem, 5vw, 2rem); font-weight: 900; }
.band .lede.center { max-width: 560px; margin: 0 auto 28px; }
.steps { display: grid; gap: 14px; margin-top: 28px; }
.step { background: var(--surface); border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); }
.step-num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font-weight: 800; margin-bottom: 14px; }
.step p { color: var(--muted); margin-top: 8px; font-size: 0.95rem; }
.split { display: grid; gap: 24px; align-items: center; }
.well-card { display: flex; gap: 12px; align-items: flex-start; }
.well-card span:last-child { display: grid; }
.well-card small { color: var(--muted); }
.check { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.check svg { width: 16px; height: 16px; }
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.scene-tile { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.scene-tile .tile-icon { width: 44px; height: 44px; border-radius: 12px; }
.scene-tile span:last-child { display: grid; }
.scene-tile small { color: var(--muted); }
.banner { background: var(--primary); color: var(--primary-ink); border-radius: 28px; padding: 32px 28px; display: grid; gap: 20px; align-items: center; }
.banner h2 { margin-bottom: 8px; }
.banner p { opacity: 0.92; }
.faq { display: grid; gap: 10px; max-width: 680px; margin: 24px auto 0; }
.faq details { background: var(--surface); border-radius: 16px; padding: 16px 18px; border: 1px solid var(--line); }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { margin-top: 10px; color: var(--muted); }
.final { text-align: center; display: grid; justify-items: center; gap: 20px; }
.site-foot { padding: 24px 20px 40px; color: var(--muted); font-size: 0.875rem; }

@media (min-width: 860px) {
  .hero { grid-template-columns: 1.1fr 1fr; padding-top: 48px; padding-bottom: 72px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .split { grid-template-columns: 1fr 1fr; gap: 48px; }
  .banner { grid-template-columns: 1fr auto; padding: 40px; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .site-nav { gap: 14px; }
}

/* ---------- Privacy and terms ---------- */
/* Same header, bands and footer as the landing page, with the text in a card. */
.fine a, .doc a, .doc-foot a { color: var(--primary); font-weight: 600; text-underline-offset: 3px; }
.doc-brand { color: var(--text); text-decoration: none; }
.doc-hero { text-align: center; padding-top: 48px; padding-bottom: 48px; }
.doc-hero > div { display: grid; justify-items: center; gap: 12px; }
.doc-hero h1 { font-size: clamp(2.2rem, 8vw, 3rem); }
.doc-date { color: var(--muted); font-size: 0.95rem; }
.doc-band { padding-top: 40px; }
.band > .doc {
  max-width: 760px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  padding: 28px 22px; box-shadow: var(--shadow);
}
.doc-lede { font-size: 1.1rem; }
.doc h2 { font-size: 1.35rem; margin: 36px 0 10px; padding-top: 28px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 1.05rem; margin: 22px 0 8px; }
.doc p { margin: 0 0 14px; }
.doc p:last-child { margin-bottom: 0; }
.doc ul { margin: 0 0 14px; padding-left: 22px; display: grid; gap: 8px; }
.doc-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
@media (min-width: 860px) {
  .band > .doc { padding: 44px 48px; }
}

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 0.9; } }
@keyframes glow {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mic) 45%, transparent), 0 0 0 10px var(--mic-glow); }
  100% { box-shadow: 0 0 0 22px color-mix(in srgb, var(--mic) 0%, transparent), 0 0 0 10px var(--mic-glow); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
