:root {
  --bg: #F4F5F7; --surface: #FFFFFF; --surface-2: #F3F4F6; --ink: #111827; --muted: #4B5563; --line: #E5E7EB;
  --accent: #1D4ED8; --accent-soft: #EFF6FF; --accent-ink: #1E3A8A;
  --decision: #9A3412; --decision-soft: #FFEDD5; --ok: #166534; --ok-soft: #DCFCE7; --danger: #B91C1C;
  --hero: #111827; --hero-ink: #F9FAFB; --hero-muted: #D1D5DB; --hero-2: #1F2937;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0F17; --surface: #151B26; --surface-2: #1E2533; --ink: #F3F4F6; --muted: #A7B0BE; --line: #2A3242;
    --accent: #60A5FA; --accent-soft: #172554; --accent-ink: #BFDBFE;
    --decision: #FDBA74; --decision-soft: #431407; --ok: #86EFAC; --ok-soft: #052E16; --danger: #FCA5A5;
    --hero: #1E2533; --hero-ink: #F9FAFB; --hero-muted: #CBD5E1; --hero-2: #2A3242;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
main { min-height: 100%; padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px calc(env(safe-area-inset-bottom, 0px) + 96px); max-width: 640px; margin: 0 auto; }
h1 { font-size: 30px; line-height: 1.15; margin: 0; letter-spacing: -0.5px; }
h2 { font-size: 21px; line-height: 1.25; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; padding-top: 30vh; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.card { background: var(--surface); border-radius: 18px; padding: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.hero { background: var(--hero); color: var(--hero-ink); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.hero .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--hero-muted); }
.hero button.wide { background: var(--hero-2); color: var(--hero-ink); }
.hero .link { color: var(--hero-muted); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--surface); border-radius: 16px; padding: 12px; }
.stat b { display: block; font-size: 24px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 4px 0 -6px; }
button, .button { font: inherit; border: 0; border-radius: 14px; min-height: 44px; padding: 0 16px; cursor: pointer; background: var(--surface-2); color: var(--ink); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
button.primary, .button.primary { background: var(--accent); color: #fff; }
button.dark { background: var(--ink); color: var(--bg); }
button.danger { color: var(--danger); }
button.wide { width: 100%; justify-content: flex-start; }
button.full { width: 100%; }
button.link, .link { background: none; padding: 0; min-height: 44px; color: var(--accent); font-weight: 500; }
button:disabled { opacity: .5; cursor: default; }
button.round { width: 56px; height: 56px; border-radius: 28px; padding: 0; flex: none; background: var(--accent); color: #fff; }
button.round.recording { background: #C2410C; }
.list-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 0; border-bottom: 1px solid var(--line); background: none; width: 100%; text-align: left; border-radius: 0; font-weight: 400; min-height: 64px; justify-content: flex-start; }
.list-item:last-child { border-bottom: 0; }
.icon-box { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--muted); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 8px; padding: 3px 8px; }
.badge.decision { background: var(--decision-soft); color: var(--decision); }
.badge.draft { background: var(--accent-soft); color: var(--accent-ink); }
.badge.fyi { background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.suggest { background: var(--accent-soft); border-radius: 14px; padding: 12px; }
.suggest .label { font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.draft-box { background: var(--surface-2); border-radius: 14px; padding: 12px; white-space: pre-wrap; }
.error { background: var(--decision-soft); color: var(--decision); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.note { background: var(--accent-soft); color: var(--accent-ink); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
textarea, input[type=text], input[type=number], input[type=time], select { font: inherit; width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface); color: var(--ink); min-height: 44px; }
textarea { resize: vertical; min-height: 56px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); font-weight: 500; }
.toggle:last-child { border-bottom: 0; }
.toggle input { width: 24px; height: 24px; accent-color: var(--accent); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span:last-child { color: var(--muted); text-align: right; }
.bubble { padding: 12px 14px; border-radius: 18px; max-width: 88%; white-space: pre-wrap; }
.bubble.me { background: var(--ink); color: var(--bg); align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble.ai { background: var(--surface); align-self: flex-start; border-bottom-left-radius: 4px; }
.trace { font-size: 12px; color: var(--muted); }
.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); }
.dots { display: flex; gap: 4px; }
.dots span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.dots span.done { background: var(--ink); }
.dots span.now { background: var(--accent); }
.att { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.att button { min-height: 44px; min-width: 44px; padding: 0; background: none; color: var(--muted); }
.file-label { position: relative; }
.file-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px 8px calc(env(safe-area-inset-bottom, 0px) + 6px); z-index: 10; }
nav.tabs button { background: none; flex-direction: column; gap: 2px; font-size: 11px; font-weight: 500; color: var(--muted); padding: 4px 0; min-height: 48px; border-radius: 10px; position: relative; }
nav.tabs button[aria-current="page"] { color: var(--accent); font-weight: 600; }
nav.tabs .count { position: absolute; top: 2px; left: calc(50% + 6px); background: #C2410C; color: #fff; font-size: 11px; border-radius: 9px; padding: 0 6px; line-height: 18px; }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.topbar { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.walk { background: var(--hero); color: var(--hero-ink); margin: calc(-16px - env(safe-area-inset-top, 0px)) -20px 0; padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 24px; min-height: 100vh; }
.walk .card { color: var(--ink); }
.walk button.link { color: var(--hero-muted); }
