/* Main site: talk to the AI agent (voice or text), live progress page.
   Mobile-first; light/dark from the system setting; no external assets (CSP: style-src 'self'). */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/web/fonts/inter-var-latin.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/static/web/fonts/manrope-var-latin.woff2") format("woff2"); }

:root {
  /* Shastra Solutions brand system (Guidelines.md): Deep Indigo #13005A, AI Green #03C988,
     Soft Mint #E6FFF4, Light Indigo Tint #E9E6F5, Charcoal #2B2B2B. Inter for UI/body, Manrope for headlines.
     Green as text on light backgrounds uses a darker shade so it meets WCAG AA. */
  --bg: #fbfaff;
  --bg-2: #f3f1fa;
  --surface: #ffffff;
  --surface-2: #f8f7fd;
  --ink: #2b2b2b;
  --muted: #5f5f6b;
  --line: #e9e6f5;
  --accent: #13005a;
  --accent-ink: #ffffff;
  --accent-soft: #e9e6f5;
  --highlight: #007a52;
  --warm: #007a52;
  --warm-soft: #e6fff4;
  --brand-green: #03c988;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #007a52;
  --shadow: 0 1px 2px rgba(19, 0, 90, .06), 0 12px 32px -12px rgba(19, 0, 90, .18);
  --shadow-lg: 0 30px 80px -30px rgba(19, 0, 90, .35);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --font-display: "Manrope", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --level: 0;
  --topbar-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0820;
    --bg-2: #110c2c;
    --surface: #161135;
    --surface-2: #1c163f;
    --ink: #eeedf6;
    --muted: #aaa7c0;
    --line: #2b2552;
    --accent: #03c988;
    --accent-ink: #13005a;
    --accent-soft: #1d1748;
    --highlight: #03c988;
    --warm: #03c988;
    --warm-soft: #0f2c2a;
    --brand-green: #03c988;
    --danger: #ff8a80;
    --danger-soft: #3a1a18;
    --ok: #03c988;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 36px -14px rgba(0, 0, 0, .7);
    --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, .9);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font: 16px/1.55 var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 110% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(900px 500px at -20% 110%, var(--warm-soft), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
svg { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.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; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); text-decoration: none; }
.skip-link:focus { top: 10px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650; letter-spacing: -.01em; min-width: 0; }
.brand-logo { display: block; height: 40px; width: auto; }
@media (prefers-color-scheme: dark) {
  /* The logo is navy on transparent: give it a light plate so it stays legible on dark backgrounds. */
  .brand-logo, .footer-logo { background: #ffffff; border-radius: 10px; padding: 4px 8px; box-sizing: content-box; }
  .brand-logo { height: 32px; }
  .footer-logo { padding: 6px 10px; border-radius: 10px; }
}
.topbar-right { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.toplink { color: var(--muted); text-decoration: none; }
.toplink:hover { color: var(--ink); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.pill-warn { background: var(--warm-soft); color: var(--warm); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); animation: live 1.8s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

main { flex: 1; display: flex; flex-direction: column; width: 100%; }
.screen { display: none; flex: 1; animation: rise .45s cubic-bezier(.2, .7, .2, 1); }
.screen.active { display: flex; flex-direction: column; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Footer: full logo at >= 120px wide with clear space (brand guidelines), text centred beside it. */
.site-footer { padding: 24px 16px calc(24px + var(--safe-b)); border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.footer-inner { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.footer-logo { display: block; height: 44px; width: auto; }
.footer-text { margin: 0; line-height: 1.5; }
.footer-text strong { color: var(--ink); font-weight: 600; }
@media (min-width: 640px) { .footer-inner { flex-direction: row; gap: 20px; text-align: left; } }
body[data-screen="chat"] .site-footer { display: none; }

/* ---------------------------------------------------------------- buttons */
.btn {
  --b-bg: var(--surface); --b-ink: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--b-bg); color: var(--b-ink); font-weight: 650; text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .65; pointer-events: none; }
.btn-primary { --b-bg: var(--accent); --b-ink: var(--accent-ink); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn-end { min-height: 40px; padding: 0 14px; color: var(--danger); background: var(--danger-soft); border-color: transparent; font-size: .9rem; }
.spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-label { opacity: .75; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: background .2s, transform .15s, color .2s;
}
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.icon-btn:hover { transform: scale(1.05); }
.icon-btn.send { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ---------------------------------------------------------------- start */
.start {
  width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 16px 8px;
  display: grid; gap: 28px; align-content: start;
}
.eyebrow { margin: 0 0 10px; color: var(--highlight); font-weight: 700; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }
.start h1 {
  margin: 0; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 7.2vw, 3.6rem); line-height: 1.05; letter-spacing: -.02em;
}
.start h1 em { font-style: normal; color: var(--highlight); }
.lead { margin: 14px 0 0; color: var(--muted); font-size: clamp(1rem, 2.6vw, 1.15rem); max-width: 34em; }
.how { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.how li { display: flex; gap: 14px; align-items: flex-start; }
.how-num {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); font-weight: 700; color: var(--accent);
}
.how strong { display: block; }
.how span:not(.how-num) { color: var(--muted); font-size: .92rem; }

.start-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 20px;
  box-shadow: var(--shadow-lg); display: grid; gap: 14px; align-self: start;
}
.card-title { margin: 0; font-size: 1.05rem; }
.modes { display: grid; gap: 10px; }
.mode {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  padding: 14px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface-2);
  transition: border-color .2s, background .2s, transform .15s;
}
.mode:hover { transform: translateY(-1px); }
.mode.selected { border-color: var(--accent); background: var(--accent-soft); }
.mode-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--surface); }
.mode-icon svg { width: 22px; height: 22px; fill: var(--accent); }
.mode-text { flex: 1; display: grid; }
.mode-text span { color: var(--muted); font-size: .88rem; }
.mode-check { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--line); transition: all .2s; }
.mode.selected .mode-check { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 4px var(--accent-soft); }
.field-label { font-weight: 600; font-size: .9rem; margin-bottom: -6px; }
.input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); }
.fineprint { margin: 0; color: var(--muted); font-size: .82rem; text-align: center; }
.error { margin: 0; color: var(--danger); font-size: .9rem; min-height: 0; }
.error:empty { display: none; }

/* ---------------------------------------------------------------- chat */
.chat {
  position: relative; flex: 0 0 auto; display: flex; width: 100%; max-width: 1240px; margin: 0 auto;
  height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); min-height: 0;
}
body[data-screen="chat"] { height: 100vh; height: 100dvh; overflow: hidden; }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 0; }

.stepper { list-style: none; display: flex; align-items: center; gap: 6px; margin: 0; padding: 2px 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.stepper li {
  flex: none; display: flex; align-items: center; gap: 6px; white-space: nowrap; height: 30px;
  padding: 0 10px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  color: var(--muted); background: var(--surface); border: 1px solid var(--line); transition: all .3s;
}
.stepper li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background .3s; }
.stepper li.current { color: var(--ink); border-color: var(--accent); }
.stepper li.current::before { background: var(--accent); animation: pulse-dot 1.6s infinite; }
.stepper li.done { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.stepper li.done::before { background: var(--accent); }
@keyframes pulse-dot { 50% { transform: scale(1.6); opacity: .6; } }
.stepper li:not(.current):not(.done) span { display: none; }
@media (min-width: 520px) { .stepper li:not(.current):not(.done) span { display: inline; } }

.profile-toggle {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .85rem; font-weight: 600;
}
.profile-toggle .count { min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .75rem; }
.profile-toggle.bump .count { animation: bump .5s; }
@keyframes bump { 40% { transform: scale(1.35); } }

/* voice stage + orb */
.voice-stage { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0 4px; }
body.text-mode .voice-stage { display: none; }
.orb { position: relative; width: 104px; height: 104px; display: grid; place-items: center; --c: var(--accent); }
.orb .halo {
  position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--c); opacity: .18;
  transform: scale(calc(1 + var(--level) * .45)); transition: transform .12s linear, opacity .3s;
}
.orb .h2 { inset: -14px; opacity: .1; transform: scale(calc(1 + var(--level) * .7)); }
.orb .h3 { inset: -28px; opacity: .05; transform: scale(calc(1 + var(--level) * .95)); }
.orb .core {
  position: relative; width: 72%; height: 72%; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c) 55%, white), var(--c) 60%, color-mix(in srgb, var(--c) 70%, black));
  box-shadow: 0 18px 40px -12px color-mix(in srgb, var(--c) 70%, transparent), inset 0 -6px 16px rgba(0, 0, 0, .18);
  transform: scale(calc(1 + var(--level) * .12)); transition: transform .1s linear, background .4s;
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe { 50% { filter: brightness(1.08); } }
.bars { display: flex; gap: 4px; align-items: center; height: 30%; }
.bars i { width: 4px; height: 30%; border-radius: 4px; background: rgba(255, 255, 255, .9); transition: height .1s; }
.orb.speaking { --c: var(--warm); }
.orb.speaking .bars i { animation: eq .9s ease-in-out infinite; }
.orb.speaking .bars i:nth-child(2) { animation-delay: -.2s; }
.orb.speaking .bars i:nth-child(3) { animation-delay: -.45s; }
.orb.speaking .bars i:nth-child(4) { animation-delay: -.65s; }
.orb.speaking .bars i:nth-child(5) { animation-delay: -.3s; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.orb.listening .halo { opacity: .45; }
.orb.listening .bars i { height: calc(25% + var(--level) * 75%); }
.orb.thinking .core::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 3px solid transparent; border-top-color: var(--c); border-right-color: var(--c); animation: spin 1s linear infinite;
}
.orb-label { margin: 0; min-height: 1.4em; color: var(--muted); font-size: .9rem; font-weight: 600; text-align: center; }

/* transcript */
.messages {
  flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 12px 14px 8px;
  display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; overscroll-behavior: contain;
}
.msg {
  max-width: min(84%, 640px); padding: 10px 14px; border-radius: 18px; line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word; animation: pop .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.msg.agent { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.msg.system { align-self: center; max-width: 92%; background: var(--warm-soft); color: var(--ink); font-size: .88rem; border-radius: 12px; }
.msg.streaming::after { content: "▍"; margin-left: 2px; color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.msg.interrupted { opacity: .62; }
.msg.interrupted::after { content: " — interrupted"; font-size: .78rem; color: var(--muted); }
.msg.user.pending { opacity: .7; letter-spacing: .2em; animation: pop .25s, fade 1.2s ease-in-out infinite; }
@keyframes fade { 50% { opacity: .35; } }
.msg.typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1.2s infinite; }
.msg.typing i:nth-child(2) { animation-delay: .15s; }
.msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* dock: chips + composer */
.dock { position: relative; padding: 6px 12px calc(12px + var(--safe-b)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 2px 8px; }
.chips:empty { display: none; }
.chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--accent); background: var(--surface);
  color: var(--accent); font-weight: 600; font-size: .9rem; animation: pop .25s; transition: background .2s, color .2s;
}
.chip:hover { background: var(--accent); color: var(--accent-ink); }
.composer {
  display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.composer-input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; padding: 0 8px; outline: none; font-size: 16px; }
.composer:focus-within { border-color: var(--accent); }
body.text-mode .mic { display: none; }
.mic .i-off { display: none; }
.mic[aria-pressed="true"] { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.mic[aria-pressed="true"] .i-on { display: none; }
.mic[aria-pressed="true"] .i-off { display: block; }
.tool-toast {
  position: absolute; left: 50%; top: -30px; transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  padding: 6px 12px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: .8rem; font-weight: 600;
  white-space: nowrap; transition: opacity .25s, transform .25s;
}
.tool-toast.show { opacity: .92; transform: translate(-50%, 0); }

/* profile: bottom sheet on phones, side panel on desktop */
.profile {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; max-height: 82dvh; overflow-y: auto;
  padding: 18px 16px calc(20px + var(--safe-b)); background: var(--surface);
  border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg); border-top: 1px solid var(--line);
  transform: translateY(105%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); visibility: hidden;
}
.profile.open { transform: none; visibility: visible; }
.profile::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: -6px auto 12px; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(10, 12, 16, .45); animation: fadein .25s; }
@keyframes fadein { from { opacity: 0; } }
.profile-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.profile h2 { margin: 0; font-size: 1.1rem; }
.profile-head p { margin: 4px 0 0; }
.meter { display: flex; align-items: center; gap: 14px; margin: 16px 0; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.meter > div { display: grid; }
.meter-ring { width: 52px; height: 52px; flex: none; transform: rotate(-90deg); }
.meter-ring circle { fill: none; stroke-width: 3.6; }
.meter-ring .track { stroke: var(--line); }
.meter-ring .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .6s cubic-bezier(.2, .8, .2, 1); }
.fields .empty { margin: 8px 0; font-size: .92rem; }
.group { margin-bottom: 14px; animation: pop .3s; }
.group h3 { margin: 0 0 6px; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.group dl { margin: 0; display: grid; gap: 2px; }
.field { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.field:nth-child(odd) { background: var(--surface-2); }
.field dt { color: var(--muted); font-size: .85rem; }
.field dd { margin: 0; font-size: .92rem; overflow-wrap: anywhere; }
.field.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background: var(--warm-soft); box-shadow: inset 3px 0 0 var(--warm); } 100% { box-shadow: inset 3px 0 0 transparent; } }
.swatch { display: inline-block; width: 14px; height: 14px; margin-right: 6px; border-radius: 4px; vertical-align: -2px; border: 1px solid var(--line); }
.crm-link { display: inline-block; margin-top: 10px; font-weight: 600; font-size: .9rem; }
.close-sheet { width: 38px; height: 38px; }

/* ---------------------------------------------------------------- done + track */
.finish {
  width: calc(100% - 32px); max-width: 560px; margin: 28px auto; padding: 28px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow-lg);
  display: grid; gap: 14px; justify-items: center; text-align: center;
}
.finish h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 6vw, 2.2rem); line-height: 1.15; letter-spacing: -.01em; }
.finish .lead { margin: 0; }
.done-badge { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); animation: pop .5s; }
.done-badge svg { width: 32px; height: 32px; fill: var(--accent); }
.maintenance-card p { margin: 0 0 14px; line-height: 1.55; }
.notify-form { display: grid; gap: 10px; }
.maintenance-staff-note { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #fff4d6; color: #5c4400; font-weight: 600; font-size: .92rem; }
.status-panel { display: flex; align-items: flex-start; gap: 12px; width: 100%; box-sizing: border-box; margin: 4px 0; padding: 16px 18px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent); text-align: left; }
.status-panel[hidden] { display: none; }
.status-panel-icon { flex: none; width: 24px; height: 24px; fill: var(--accent); margin-top: 1px; }
.status-panel-text { margin: 0; font-weight: 600; font-size: clamp(1rem, 2.8vw, 1.1rem); line-height: 1.45; overflow-wrap: anywhere; min-width: 0; }
.timeline { list-style: none; margin: 8px 0; padding: 0; width: 100%; display: grid; gap: 0; text-align: left; }
.timeline li { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 6px; color: var(--muted); font-weight: 600; transition: color .3s; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 36px; bottom: -10px; width: 2px; background: var(--line); }
.timeline li.done:not(:last-child)::after { background: var(--accent); }
.timeline .dot { position: relative; z-index: 1; width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; transition: all .3s; }
.timeline li.active { color: var(--ink); }
.timeline li.active .dot { border-color: var(--accent); }
.timeline li.active .dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse-dot 1.4s infinite; }
.timeline li.done { color: var(--ink); }
.timeline li.done .dot { background: var(--accent); border-color: var(--accent); }
.timeline li.done .dot::after { content: ""; width: 10px; height: 5px; margin-top: -2px; border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(-45deg); }
.timeline li.failed { color: var(--danger); }
.timeline li.failed .dot { border-color: var(--danger); background: var(--danger-soft); }
.done-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.track-updated { margin: 0; color: var(--muted); font-size: .8rem; }

/* ---------------------------------------------------------------- larger screens */
@media (min-width: 640px) {
  .start { padding-top: 48px; }
  .start-card { padding: 26px; }
  .modes { grid-template-columns: 1fr 1fr; }
  .mode { flex-direction: column; align-items: flex-start; position: relative; }
  .mode-check { position: absolute; top: 14px; right: 14px; }
  .orb { width: 132px; height: 132px; }
  .finish { padding: 40px 36px; }
}

@media (min-width: 960px) {
  :root { --topbar-h: 72px; }
  .brand-logo { height: 48px; }
  .topbar { padding: 0 28px; }
  .start { grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; padding: 72px 28px 24px; min-height: calc(100dvh - var(--topbar-h) - 70px); }
  .how { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .how li { flex-direction: column; gap: 10px; }
  .chat { padding: 16px 20px 0; gap: 20px; }
  .chat-main { background: color-mix(in srgb, var(--surface) 55%, transparent); border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0; }
  .chat-head { padding: 14px 18px 0; }
  .profile-toggle, .close-sheet, .profile::before, .sheet-backdrop { display: none !important; }
  .profile {
    position: static; transform: none; visibility: visible; width: 360px; flex: none; max-height: none;
    border-radius: 26px 26px 0 0; border: 1px solid var(--line); border-bottom: 0; box-shadow: none; padding: 22px 20px;
  }
  .voice-stage { padding: 22px 0 6px; }
  .orb { width: 156px; height: 156px; }
  .messages { padding: 16px 22px 10px; }
  .dock { padding: 8px 18px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
