/* Calm, capable, a little dry. The same tinted-neutral family as Lift, with
   more air and one cool accent. Colour is a state signal and is never the only
   one: priority, lateness and research state are also said in words.

   Two themes, because the screen lives on a car mount: light in low morning
   sun, dark in a dark cabin, following the phone's own setting.

   Every size, space, radius and colour below the token block is a token. */
:root {
  color-scheme: light dark;

  /* light: read in glare */
  --bg:        oklch(97.5% 0.004 260);
  --panel:     oklch(99.2% 0.003 260);
  --panel-2:   oklch(94% 0.006 260);
  --line:      oklch(87% 0.008 260);
  --text:      oklch(24% 0.015 260);
  --dim:       oklch(45% 0.020 260);
  --accent:    oklch(48% 0.150 250);
  --on-accent: oklch(98.5% 0.010 250);
  --good:      oklch(45% 0.130 152);
  --warn:      oklch(48% 0.120 70);
  --hot:       oklch(50% 0.190 25);
  --veil:      oklch(24% 0.015 260 / 0.35);

  --s1: 2px; --s2: 4px; --s3: 8px; --s4: 12px; --s5: 16px; --s6: 20px; --s7: 24px; --s8: 32px; --s9: 48px;
  --t-sm: 14px; --t-base: 17px; --t-md: 19px; --t-lg: 24px;
  --r-md: 12px; --r-lg: 16px; --r-pill: 999px;
  --tap: 48px;
  --ease: cubic-bezier(0.25, 1, 0.5, 1); /* ease-out-quart */
  --fast: 120ms;
  --base: 180ms;
  --nav: calc(var(--tap) + var(--s3) * 2);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    /* dark: the only lit thing in a dark cabin should not be a torch */
    --bg:        oklch(17% 0.008 260);
    --panel:     oklch(21% 0.009 260);
    --panel-2:   oklch(25% 0.010 260);
    --line:      oklch(31% 0.012 260);
    --text:      oklch(94% 0.006 260);
    --dim:       oklch(72% 0.014 260);
    --accent:    oklch(80% 0.110 245);
    --on-accent: oklch(20% 0.040 245);
    --good:      oklch(80% 0.150 152);
    --warn:      oklch(84% 0.130 85);
    --hot:       oklch(76% 0.150 22);
    --veil:      oklch(10% 0.010 260 / 0.6);
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: var(--t-base)/1.45 var(--sans); overscroll-behavior-y: contain; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
button:disabled { opacity: 0.5; cursor: default; }
a { color: var(--accent); }
h1, h2, h3, p, ul, ol { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--s3); }
.dim { color: var(--dim); }
.error { color: var(--hot); }

/* ── buttons: one vocabulary everywhere ── */
.primary, .ghost, .act, .pill { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); border-radius: var(--r-md); font-weight: 600; text-decoration: none; transition: background var(--fast) var(--ease), opacity var(--fast) var(--ease), transform var(--fast) var(--ease); }
.primary { background: var(--accent); color: var(--on-accent); padding: 0 var(--s6); }
.ghost { color: var(--accent); padding: 0 var(--s4); }
.ghost.danger { color: var(--hot); }
.act { padding: 0 var(--s5); border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--accent); background: var(--panel); font-size: var(--t-sm); max-width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: calc(var(--tap) - 2px); flex: none; align-self: center; }
.pill { padding: 0 var(--s5); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--panel); font-weight: 500; font-size: var(--t-sm); }
.pill[aria-pressed="true"], .pill[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
@media (hover: hover) {
  .ghost:hover, .pill:hover, .act:hover { background: var(--panel-2); }
  .pill[aria-pressed="true"]:hover, .pill[aria-selected="true"]:hover, .primary:hover { background: var(--accent); opacity: 0.9; }
}
.primary:active, .ghost:active, .act:active, .pill:active, .mic:active { transform: scale(0.97); opacity: 0.85; }

/* ── sign in ── */
.login { max-width: 380px; margin: 0 auto; padding: var(--s9) var(--s6); display: grid; gap: var(--s5); }
.login .brand { font-size: var(--t-lg); }
.login label { display: grid; gap: var(--s2); color: var(--dim); font-size: var(--t-sm); }
input[type="text"], input[type="password"], input[type="datetime-local"], input:not([type]), select, textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); min-height: var(--tap); padding: 0 var(--s4); width: 100%; color: var(--text);
}
textarea { padding: var(--s4); min-height: 88px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--dim); opacity: 1; }

/* ── frame ── */
#app { max-width: 640px; margin: 0 auto; min-height: 100dvh; padding: 0 var(--s6) calc(var(--nav) + 96px + env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; gap: var(--s4); padding: var(--s3) 0; }
.brand { font-size: var(--t-md); font-weight: 650; letter-spacing: 0.01em; flex: 1; }
.pc { font-size: var(--t-sm); color: var(--dim); }
.pc.off { color: var(--warn); font-weight: 600; }
.banner { background: var(--panel-2); border-radius: var(--r-md); padding: var(--s4) var(--s5); font-size: var(--t-sm); margin-bottom: var(--s5); }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: var(--s2); background: var(--panel); border-top: 1px solid var(--line); padding: var(--s3) var(--s6) calc(var(--s3) + env(safe-area-inset-bottom)); z-index: 2; }
.tabs button { flex: 1; max-width: 200px; min-height: var(--tap); border-radius: var(--r-md); color: var(--dim); font-weight: 600; transition: background var(--fast) var(--ease), color var(--fast) var(--ease); }
.tabs button[aria-current="page"] { color: var(--text); background: var(--panel-2); }

/* The microphone is the product, so it is the largest thing you can press. */
.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--nav) + env(safe-area-inset-bottom)); z-index: 2; background: linear-gradient(to top, var(--bg) 78%, transparent); padding: var(--s5) var(--s6) var(--s4); }
.composer-in { max-width: 600px; margin: 0 auto; display: flex; align-items: center; gap: var(--s3); }
.composer input { flex: 1; min-width: 0; min-height: 56px; border-radius: var(--r-pill); padding: 0 var(--s6); }
.mic { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; flex: none; transition: transform var(--fast) var(--ease), background var(--base) var(--ease); }
.mic svg { width: 28px; height: 28px; fill: var(--on-accent); }
.mic.live { background: var(--hot); animation: breathe 1.4s var(--ease) infinite alternate; }
@keyframes breathe { to { transform: scale(1.07); } }
#send { border-radius: var(--r-pill); min-height: 56px; }

/* ── today ── */
.hello { padding: var(--s6) 0 var(--s7); }
.hello-line { font-size: var(--t-lg); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
.hello .ghost { margin: var(--s2) 0 0 calc(-1 * var(--s4)); }
.group { margin-bottom: var(--s8); }
.group > h2 { font-size: var(--t-sm); letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); font-weight: 600; padding-bottom: var(--s3); }
.empty { color: var(--dim); padding: var(--s8) 0; max-width: 34ch; }
.skeleton { height: 56px; border-radius: var(--r-md); background: var(--panel-2); margin-bottom: var(--s3); }
.skeleton.short { width: 60%; height: 28px; margin: var(--s6) 0 var(--s7); }

/* ── items: rows on the page, not boxes ── */
.rows { border-top: 1px solid var(--line); }
.item { display: flex; align-items: flex-start; gap: var(--s2); border-bottom: 1px solid var(--line); padding: var(--s3) 0; }
.item.step { padding-left: var(--s8); }
.check { width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; margin-left: calc(-1 * var(--s3)); border-radius: 50%; }
.check::before { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--dim); transition: background var(--base) var(--ease), border-color var(--base) var(--ease); }
.item.done .check::before { background: var(--good); border-color: var(--good); }
.check::after { content: ""; position: absolute; width: 11px; height: 6px; border-left: 2.5px solid var(--bg); border-bottom: 2.5px solid var(--bg); transform: translateY(-2px) rotate(-45deg) scale(0); transition: transform var(--base) var(--ease); }
.item.done .check::after { transform: translateY(-2px) rotate(-45deg) scale(1); }
.check { position: relative; }
.item-body { flex: 1; min-width: 0; text-align: left; padding: var(--s3) 0; min-height: var(--tap); border-radius: var(--s3); }
.title { line-height: 1.3; overflow-wrap: anywhere; }
.item.step .title { font-size: var(--t-sm); line-height: 1.4; }
.item.done .title { color: var(--dim); text-decoration: line-through; }
.meta { font-size: var(--t-sm); color: var(--dim); margin-top: var(--s1); }
.tag { font-weight: 650; color: var(--accent); }
.late { color: var(--hot); font-weight: 600; }
.soon { color: var(--warn); font-weight: 600; }
.status { font-size: var(--t-sm); margin-top: var(--s2); color: var(--accent); display: flex; gap: var(--s3); align-items: center; }
.status.busy::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.9s linear infinite; flex: none; }
.status.ready { color: var(--good); font-weight: 600; }
.status.failed { color: var(--hot); }
@keyframes spin { to { transform: rotate(360deg); } }

.chips { display: flex; gap: var(--s3); overflow-x: auto; padding: var(--s5) var(--s6) var(--s5); margin: 0 calc(-1 * var(--s6)); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips .pill { white-space: nowrap; flex: none; }

/* ── talk: a transcript, not bubbles ── */
.talk { display: grid; gap: var(--s6); padding-top: var(--s5); }
.line .who { font-size: var(--t-sm); font-weight: 600; letter-spacing: 0.04em; color: var(--dim); }
.line.her .who { color: var(--accent); }
.line p { overflow-wrap: anywhere; max-width: 60ch; }
.line.you p { color: var(--dim); }
.line.her p { font-size: var(--t-md); line-height: 1.5; }
.line.wait p { color: var(--dim); }
.did { list-style: none; padding: 0; margin-top: var(--s3); font-size: var(--t-sm); color: var(--good); display: grid; gap: var(--s1); }
.did li::before { content: "\2713\00a0\00a0"; font-weight: 700; }

/* ── a page that slides over: one item, or settings ── */
.page { position: fixed; inset: 0; z-index: 10; background: var(--bg); overflow-y: auto; animation: arrive var(--base) var(--ease); }
@keyframes arrive { from { opacity: 0; transform: translateY(12px); } }
.page-in { max-width: 640px; margin: 0 auto; padding: 0 var(--s6) calc(var(--s9) + env(safe-area-inset-bottom)); display: grid; gap: var(--s7); }
.page-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--bg); padding: var(--s3) 0; z-index: 1; margin: 0 calc(-1 * var(--s4)) calc(-1 * var(--s4)); }
.page-head .primary { margin-right: var(--s4); }
.d-title { font-size: var(--t-lg); font-weight: 600; line-height: 1.25; border: none !important; background: transparent !important; padding: 0 !important; min-height: 0 !important; resize: none; overflow: hidden; }
.said { font-size: var(--t-sm); color: var(--dim); margin-top: calc(-1 * var(--s5)); }
.page .act.wide { max-width: none; display: flex; background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-size: var(--t-base); border-radius: var(--r-md); }
.field { display: grid; gap: var(--s3); }
.label { font-size: var(--t-sm); letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.seg { display: flex; gap: var(--s3); flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: var(--s4); min-height: var(--tap); }
.row input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--accent); flex: none; }
.row select { flex: 1; }
details.more { border-top: 1px solid var(--line); }
details.more > summary { min-height: var(--tap); display: flex; align-items: center; font-weight: 600; color: var(--accent); cursor: pointer; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "+"; margin-left: auto; font-size: var(--t-md); }
details.more[open] > summary::after { content: "\2212"; }
details.more > .inner { display: grid; gap: var(--s7); padding: var(--s4) 0 var(--s5); }

/* What she found is set apart from what you said: its own panel, its source
   and time stated at the top, and what is unconfirmed called out by name. */
.brief { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); display: grid; gap: var(--s5); }
.brief .by { font-size: var(--t-sm); color: var(--dim); }
.brief .summary { line-height: 1.5; max-width: 62ch; }
.next { background: color-mix(in oklch, var(--accent) 12%, transparent); border-radius: var(--r-md); padding: var(--s4); }
.next .label { color: var(--accent); display: block; margin-bottom: var(--s1); }
.next p { font-weight: 600; }
.brief h3 { font-size: var(--t-sm); letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.option { border-top: 1px solid var(--line); padding-top: var(--s4); display: grid; gap: var(--s1); }
.option .name { font-weight: 600; }
.option .price { color: var(--good); font-weight: 650; }
.option .where, .option .note, .sec p { font-size: var(--t-sm); line-height: 1.5; }
.option .where { color: var(--dim); }
.brief a { font-size: var(--t-sm); overflow-wrap: anywhere; display: inline-block; padding: var(--s3) 0; }
.check-list { color: var(--warn); font-size: var(--t-sm); padding-left: var(--s6); display: grid; gap: var(--s2); }
.check-list li::marker { content: "?  "; font-weight: 700; }
.sources { padding-left: var(--s6); font-size: var(--t-sm); }
.events { font-size: var(--t-sm); color: var(--dim); display: grid; gap: var(--s2); }
.events .status { margin: 0; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav) + 104px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: var(--bg); border-radius: var(--r-pill); padding: var(--s3) var(--s3) var(--s3) var(--s6); z-index: 20; max-width: min(92vw, 560px); display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); font-size: var(--t-sm); animation: arrive var(--base) var(--ease); }
.toast span { padding: var(--s2) var(--s4) var(--s2) 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.toast button { color: inherit; font-weight: 700; text-decoration: underline; min-height: 40px; padding: 0 var(--s4); flex: none; }

/* the opened item: one column with the same rhythm as the rest of the app */
#d-body { display: grid; gap: var(--s7); padding-top: var(--s4); }
.said { margin-top: calc(-1 * var(--s5)); }
.events .earlier { color: var(--dim); }
