/* Neri Cash — design tokens follow design/polish-pass-1.md (Neri brand). Amber is reserved for
   the one thing that needs attention: the low point. Red only means below zero. */

:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --sunken: #f3f4f9;
  --ink: #1a2035;
  --ink-soft: #4a5170;
  --ink-faint: #646b88;
  --rule: #e4e7f0;
  --accent: #4a5fd9;
  --accent-ink: #3a4dc4;
  --accent-wash: rgba(74, 95, 217, 0.09);
  --on-accent: #ffffff;
  --sun: #f5a93f;
  --sun-ink: #8f5300;
  --sun-wash: #fff4e2;
  --below: #c2412d;
  --below-wash: rgba(194, 65, 45, 0.08);
  --good: #2f7d5b;
  --shadow: 0 1px 2px rgba(26, 32, 53, 0.04), 0 8px 24px rgba(26, 32, 53, 0.06);
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060b26;
    --surface: #0d1433;
    --sunken: #131b40;
    --ink: #eceef6;
    --ink-soft: #b0b6cc;
    --ink-faint: #8a91b3;
    --rule: #222b55;
    --accent: #8d9cff;
    --accent-ink: #a9b4ff;
    --accent-wash: rgba(141, 156, 255, 0.13);
  --on-accent: #060b26;
    --sun: #f5b354;
    --sun-ink: #f7c47a;
    --sun-wash: rgba(245, 179, 84, 0.12);
    --below: #ff8a73;
    --below-wash: rgba(255, 138, 115, 0.1);
    --good: #6fcf9f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #060b26;
  --surface: #0d1433;
  --sunken: #131b40;
  --ink: #eceef6;
  --ink-soft: #b0b6cc;
  --ink-faint: #8a91b3;
  --rule: #222b55;
  --accent: #8d9cff;
  --accent-ink: #a9b4ff;
  --accent-wash: rgba(141, 156, 255, 0.13);
  --on-accent: #060b26;
  --sun: #f5b354;
  --sun-ink: #f7c47a;
  --sun-wash: rgba(245, 179, 84, 0.12);
  --below: #ff8a73;
  --below-wash: rgba(255, 138, 115, 0.1);
  --good: #6fcf9f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.below { color: var(--below); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.top-inner {
  max-width: 1180px; margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px));
  height: 64px; display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand .mark { width: 30px; height: 30px; }
.brand b { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.brand span { color: var(--ink-faint); font-weight: 500; }
.tabs { display: flex; gap: 2px; margin-left: 12px; }
.tab {
  border: 0; background: none; padding: 8px 12px; border-radius: 999px;
  color: var(--ink-soft); font-weight: 550; font-size: 14px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--ink); background: var(--sunken); }
.tab[aria-current="page"] { color: var(--ink); background: var(--accent-wash); }
.tab .count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--sun); color: #3a2400; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center;
}
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.biz {
  border: 1px solid var(--rule); background: var(--surface); border-radius: 999px;
  padding: 6px 30px 6px 12px; font-size: 13px; font-weight: 550; color: var(--ink);
  appearance: none; max-width: 210px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%237d84a0' stroke-width='1.6'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--surface); display: grid; place-items: center; color: var(--ink-soft);
}
.icon-btn:hover { color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

.preview-note {
  max-width: 1180px; margin: 0 auto; padding: 10px 24px 0;
  font-size: 12.5px; color: var(--ink-faint);
}

main {
  max-width: 1180px; margin: 0 auto; padding-block: 20px 120px;
  padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 25; background: var(--bg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.btn:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--rule)); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-ink); }
.btn.quiet { border-color: transparent; background: none; color: var(--ink-soft); padding: 0 10px; }
.btn.quiet:hover { color: var(--ink); background: var(--sunken); }
.btn.small { height: 32px; font-size: 13px; padding: 0 12px; }
.btn[disabled] { opacity: 0.5; cursor: default; }

/* ---------- Today ---------- */
.today { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 56px; align-items: start; }
.day-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--ink-soft); font-size: 14px; margin: 8px 0 14px; }
.day-line b { color: var(--ink); font-weight: 600; }

.listen {
  display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px 0 6px;
  border-radius: 999px; border: 1px solid var(--rule); background: var(--surface);
  font-weight: 600; font-size: 14px; color: var(--ink);
}
.listen .disc {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
}
.listen .disc svg { width: 14px; height: 14px; }
.listen[aria-pressed="true"] .disc { background: var(--sun); color: #3a2400; }
.listen small { color: var(--ink-faint); font-weight: 500; }

.headline {
  font-size: clamp(28px, 3.6vw, 42px); line-height: 1.12; letter-spacing: -0.028em;
  font-weight: 600; margin: 0 0 8px; max-width: 22ch; text-wrap: balance;
}
.headline .amt { font-variant-numeric: tabular-nums; }
.subhead { color: var(--ink-soft); font-size: 17px; margin: 0 0 32px; max-width: 54ch; }

.section-title { font-size: 15px; font-weight: 650; margin: 0 0 4px; letter-spacing: -0.01em; }
.section-note { color: var(--ink-faint); font-size: 13.5px; margin: 0 0 14px; }

.things { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.thing {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 4px 14px;
  padding: 20px 0; border-bottom: 1px solid var(--rule);
}
.thing.fresh { animation: settle 1.2s ease-out; }
@keyframes settle { from { background: var(--sun-wash); } to { background: transparent; } }
.check {
  width: 28px; height: 28px; margin-top: 1px; border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--ink-faint) 70%, transparent); background: none;
  display: grid; place-items: center; color: transparent; padding: 0;
}
.check:hover { border-color: var(--accent); color: var(--accent); }
.check svg { width: 14px; height: 14px; }
.thing.done .check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.thing h3 { margin: 0; font-size: 17.5px; line-height: 1.35; font-weight: 600; letter-spacing: -0.012em; }
.thing.done h3 { color: var(--ink-faint); text-decoration: line-through; text-decoration-thickness: 1px; }
.thing p { margin: 6px 0 0; color: var(--ink-soft); font-size: 14.5px; max-width: 60ch; }
.thing.done p, .thing.done .thing-actions { display: none; }
.effect { text-align: right; padding-top: 1px; }
.effect b { display: block; font-size: 22px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.effect span { font-size: 12px; color: var(--ink-faint); }
.thing.done .effect b { color: var(--ink-faint); }
.thing-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.by { font-size: 13px; color: var(--ink-faint); margin-right: 4px; }
.by b { color: var(--ink-soft); font-weight: 600; }
.src {
  border: 0; background: var(--sunken); color: var(--ink-soft); border-radius: 6px;
  font-size: 12.5px; font-weight: 600; padding: 3px 8px; font-variant-numeric: tabular-nums;
}
.src:hover { color: var(--accent); }

.together {
  margin: 18px 0 0; padding: 14px 16px; border-radius: var(--radius);
  background: var(--accent-wash); color: var(--ink); font-size: 14.5px;
}
.together b { font-variant-numeric: tabular-nums; }

.shortfall {
  margin-top: 14px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--rule);
  background: var(--surface);
}
.shortfall h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.shortfall p { margin: 0 0 12px; color: var(--ink-soft); font-size: 14px; }
.sample-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--radius-sm);
  border: 1px dashed color-mix(in srgb, var(--ink-faint) 55%, transparent);
}
.sample-card .tag { font-size: 11.5px; font-weight: 700; color: var(--ink-faint); border: 1px solid var(--rule); border-radius: 5px; padding: 1px 6px; flex-shrink: 0; }
.sample-card div { font-size: 13.5px; }
.sample-card small { display: block; color: var(--ink-faint); margin-top: 3px; font-size: 12.5px; }

.watch { margin-top: 40px; }
.watch-item { padding: 14px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; }
.watch-item:first-of-type { border-top: 1px solid var(--rule); }
.watch-item h4 { margin: 0; font-size: 15px; font-weight: 600; }
.watch-item p { margin: 2px 0 0; color: var(--ink-soft); font-size: 13.5px; grid-column: 1 / -1; max-width: 70ch; }

.empty-three { padding: 24px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); color: var(--ink-soft); }

/* ask bar */
.askbar {
  display: flex; align-items: center; gap: 8px; margin-top: 36px;
  border: 1px solid var(--rule); background: var(--surface); border-radius: 999px;
  padding: 6px 6px 6px 18px; box-shadow: var(--shadow);
}
.askbar input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 15px; padding: 8px 0; }
.askbar input::placeholder { color: var(--ink-faint); }
.mic, .send {
  width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; flex-shrink: 0;
}
.mic { background: var(--sunken); color: var(--ink-soft); }
.mic[aria-pressed="true"] { background: var(--sun); color: #3a2400; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--sun) 25%, transparent); } }
.send { background: var(--accent); color: var(--on-accent); }
.mic svg, .send svg { width: 17px; height: 17px; }
.ask-hints { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hint {
  border: 1px solid var(--rule); background: none; border-radius: 999px; padding: 5px 12px;
  font-size: 13px; color: var(--ink-soft);
}
.hint:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 20%, var(--rule)); }

/* side panel */
.side { display: grid; gap: 16px; position: sticky; top: 84px; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 20px; }
.panel h2 { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin: 0 0 14px; }
.forecast-review { border-inline-start: 3px solid var(--sun); margin-block: 20px; }
.forecast-review h2 { color: var(--ink); }
.forecast-review p, .forecast-review li { font-size: 14px; line-height: 1.5; }
.forecast-review ul { padding-inline-start: 20px; }
.forecast-review-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.fig small { display: block; font-size: 12.5px; color: var(--ink-faint); }
.fig b { display: block; font-size: 24px; font-weight: 650; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; }
.fig span { font-size: 12.5px; color: var(--ink-soft); }
.fig button.link { border: 0; background: none; padding: 0; color: var(--accent); font-size: 12.5px; font-weight: 600; }
.mini { margin-top: 16px; }
.panel .more { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }

.inbox-item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; padding: 12px 0; border-top: 1px solid var(--rule); }
.inbox-item:first-of-type { border-top: 0; padding-top: 0; }
.inbox-item .ico { width: 30px; height: 30px; border-radius: 8px; background: var(--sunken); display: grid; place-items: center; color: var(--ink-soft); }
.inbox-item .ico svg { width: 15px; height: 15px; }
.inbox-item b { font-size: 14px; font-weight: 600; display: block; }
.inbox-item span { font-size: 13px; color: var(--ink-soft); }

.source-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 5px 0; color: var(--ink-soft); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex-shrink: 0; }
.dot.warn { background: var(--sun); }
.dot.off { background: var(--ink-faint); opacity: 0.5; }
.source-row time { margin-left: auto; color: var(--ink-faint); font-size: 12px; }

/* ---------- chart ---------- */
.chart { width: 100%; display: block; overflow: visible; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .axis { fill: var(--ink-faint); font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linejoin: round; }
.chart .line.ghost { stroke: var(--ink-faint); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: 0.8; }
.chart .line.whatif { stroke: var(--sun); stroke-width: 2.25; }
.chart .area { fill: var(--accent); opacity: 0.08; }
.chart .belowfill { fill: var(--sun); opacity: 0.22; }
.chart .safety { stroke: var(--sun-ink); stroke-width: 1.25; stroke-dasharray: 5 4; opacity: 0.7; }
.chart .zero { stroke: var(--below); stroke-width: 1; opacity: 0.45; }
.chart .label { font-size: 11.5px; font-family: var(--font); fill: var(--sun-ink); font-weight: 600; }
.chart .sun { fill: var(--sun); stroke: var(--surface); stroke-width: 3; }
.chart .sun-halo { fill: var(--sun); opacity: 0.18; }
.chart .low-label { font-size: 12.5px; font-weight: 650; fill: var(--ink); font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover { fill: var(--accent); opacity: 0.06; }
.chart .sel { fill: var(--accent); opacity: 0.08; }

/* ---------- Forecast view ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 20px; }
.page-head h1 { font-size: 30px; letter-spacing: -0.025em; font-weight: 650; margin: 0; line-height: 1.15; }
.page-head p { margin: 4px 0 0; color: var(--ink-soft); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--sunken); }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.chart-panel { padding: 24px 24px 16px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--ink-soft); margin-top: 10px; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--accent); vertical-align: middle; margin-right: 6px; }
.legend i.safety { border-top: 1.5px dashed var(--sun-ink); }
.legend i.ghost { border-top: 1.5px dashed var(--ink-faint); }
.legend i.whatif { border-top-color: var(--sun); }
.legend i.dip { border: 0; height: 10px; width: 14px; background: var(--sun); opacity: 0.35; border-radius: 2px; }

.weeks { width: 100%; border-collapse: collapse; margin-top: 24px; font-size: 14px; }
.weeks th { text-align: right; font-weight: 600; color: var(--ink-faint); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.weeks th:first-child, .weeks td:first-child { text-align: left; }
.weeks td { padding: 12px 10px; border-bottom: 1px solid var(--rule); text-align: right; font-variant-numeric: tabular-nums; }
.weeks tr.row { cursor: pointer; }
.weeks tr.row:hover td { background: var(--sunken); }
.weeks tr.low td { background: var(--sun-wash); }
.weeks td.in { color: var(--good); }
.weeks td .mark { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); margin-right: 8px; vertical-align: 1px; }

/* ---------- Notes (parked thoughts) ---------- */
.notes { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
.capture {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow);
}
.capture textarea {
  width: 100%; min-height: 88px; border: 0; outline: none; resize: vertical; background: none;
  font-size: 17px; line-height: 1.45;
}
.capture textarea::placeholder { color: var(--ink-faint); }
.capture-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.capture-row .grow { flex: 1; }
.kinds { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 8px; }
.kind-filter { border: 1px solid var(--rule); background: none; border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--ink-soft); font-weight: 550; }
.kind-filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.note { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.note blockquote { margin: 0; font-size: 17px; line-height: 1.45; letter-spacing: -0.008em; }
.note .meta { margin-top: 6px; font-size: 12.5px; color: var(--ink-faint); display: flex; gap: 10px; align-items: center; }
.kind-chip { font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 6px; background: var(--sunken); color: var(--ink-soft); }
.kind-chip.spend, .kind-chip.investment { background: var(--below-wash); color: var(--below); }
.kind-chip.collection, .kind-chip.new_business { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); }
.reading {
  margin-top: 12px; border-radius: var(--radius); background: var(--sunken); padding: 14px 16px;
}
.reading h5 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.reading dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px 16px; margin: 0; }
.reading dt { font-size: 12px; color: var(--ink-faint); }
.reading dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.reading dd input, .reading dd select {
  width: 100%; border: 1px solid var(--rule); background: var(--surface); border-radius: 6px; padding: 4px 8px; font-weight: 600; font-size: 14px;
}
.reading .dir-switch { display: flex; margin-top: 2px; font-size: 12.5px; }
.reading .impact { margin: 12px 0 0; font-size: 14px; color: var(--ink); }
.reading .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.note.settled .reading { display: none; }
.settled-tag { font-size: 12.5px; color: var(--good); font-weight: 600; }

/* ---------- Review ---------- */
.review-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 16px; }
.review-card header { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.review-card header .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-wash); color: var(--accent); display: grid; place-items: center; }
.review-card header .ico svg { width: 18px; height: 18px; }
.review-card header b { display: block; font-size: 15px; }
.review-card header span { font-size: 13px; color: var(--ink-faint); }
.message {
  background: var(--sunken); border-radius: var(--radius); padding: 14px 16px; font-size: 14.5px; white-space: pre-wrap;
  color: var(--ink-soft); max-height: 220px; overflow: auto;
}
.message mark { background: var(--sun-wash); color: var(--ink); border-bottom: 2px solid var(--sun); padding: 0 1px; border-radius: 2px; }
.change { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.change > div { border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px; }
.change small { display: block; font-size: 12px; color: var(--ink-faint); }
.change b { font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: -0.015em; }
.change .arrow { color: var(--ink-faint); margin: 0 6px; }
.review-card footer { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.review-card footer .conf { margin-left: auto; font-size: 12.5px; color: var(--ink-faint); }

/* ---------- Sources ---------- */
.cat { margin-top: 32px; }
.cat h2 { font-size: 17px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.cat > p { margin: 2px 0 12px; color: var(--ink-soft); font-size: 14px; }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.conn {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 2px 12px; align-items: center;
  padding: 14px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface);
}
.conn .logo {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff; grid-column: 1; grid-row: 1 / span 2;
}
.conn b { font-size: 14.5px; font-weight: 600; grid-column: 2; grid-row: 1; line-height: 1.3; }
.conn .reads { margin: 0; font-size: 12.5px; color: var(--ink-faint); grid-column: 2; grid-row: 2; line-height: 1.35; }
.conn .state { grid-column: 3; grid-row: 1 / span 2; font-size: 12.5px; font-weight: 600; }
.conn .state .dot { display: inline-block; }
/* Connected tiles: status and Reconnect get their own row, so they fit even in narrow tiles */
.conn.is-on .reads { grid-column: 2 / span 2; }
.conn .state.on {
  grid-column: 1 / -1; grid-row: 3; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule);
}
.conn-status { display: inline-flex; align-items: center; gap: 6px; color: var(--good); white-space: nowrap; }
.conn-status:has(.dot.warn) { color: var(--sun); }
.conn-status:has(.dot.bad) { color: var(--bad, #e5484d); }
.dot.bad { background: var(--bad, #e5484d); }
.conn .reconnect { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.conn .reconnect svg { width: 14px; height: 14px; }
.conn .reconnect[disabled] svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.conn .synced { color: var(--ink-faint); white-space: nowrap; }
.conn .state .btn { height: 30px; font-size: 12.5px; padding: 0 12px; }
.avail { font-size: 11.5px; font-weight: 600; color: var(--ink-faint); }
.upload-band {
  margin-top: 8px; padding: 18px; border: 1px dashed color-mix(in srgb, var(--ink-faint) 50%, transparent);
  border-radius: var(--radius-lg); display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.upload-band p { margin: 0; flex: 1; min-width: 220px; color: var(--ink-soft); font-size: 14px; }
.upload-band b { color: var(--ink); }

/* ---------- Ask ---------- */
.convo { max-width: 760px; }
.turn { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.turn .q { font-weight: 600; font-size: 16px; }
.turn .a { margin-top: 8px; font-size: 16px; color: var(--ink); max-width: 64ch; }
.turn .a.missing { color: var(--ink-soft); }
.cites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.turn .scenario { margin-top: 12px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--surface); }
.turn .scenario header { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; flex-wrap: wrap; }

/* ---------- Settings ---------- */
.settings { max-width: 720px; }
.setting { padding: 18px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; align-items: center; }
.setting h3 { margin: 0; font-size: 15px; font-weight: 600; }
.setting p { margin: 0; color: var(--ink-soft); font-size: 13.5px; grid-column: 1; }
.setting .control { grid-row: span 2; grid-column: 2; }
.money-input { display: flex; align-items: center; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); padding: 0 10px; }
.money-input span { color: var(--ink-faint); }
.money-input input { width: 110px; border: 0; outline: none; background: none; padding: 8px 4px; font-weight: 600; font-variant-numeric: tabular-nums; }
.switch { width: 44px; height: 26px; border-radius: 13px; background: var(--rule); border: 0; position: relative; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.rule-item { padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.rule-item q { font-weight: 600; }
.rule-item div { color: var(--ink-faint); font-size: 12.5px; margin-top: 2px; }

/* ---------- sheet (drawer / bottom sheet) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(14, 18, 32, 0.32); z-index: 50; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 51; top: 0; right: 0; bottom: 0; width: min(480px, 100vw);
  background: var(--surface); border-left: 1px solid var(--rule); overflow: auto;
  padding: 22px 24px 32px; animation: slide 0.2s ease-out; box-shadow: -12px 0 40px rgba(14, 18, 32, 0.12);
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.sheet-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; line-height: 1.25; flex: 1; }
.sheet-head p { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; font-size: 14px; margin: 0 0 18px; }
.kv dt { color: var(--ink-faint); }
.kv dd { margin: 0; font-weight: 550; font-variant-numeric: tabular-nums; }
.event { padding: 12px 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.event b { font-size: 14.5px; }
.event .amt { font-weight: 650; font-variant-numeric: tabular-nums; }
.event .amt.in { color: var(--good); }
.event p { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--ink-soft); }
.event .src { grid-column: 1 / -1; justify-self: start; margin-top: 4px; }
.status { font-size: 11.5px; font-weight: 650; color: var(--ink-faint); margin-left: 6px; }
.draft-field { display: grid; gap: 4px; margin-bottom: 12px; }
.draft-field label { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; }
.draft-field input, .draft-field textarea {
  width: 100%; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg); padding: 10px 12px; font-size: 14.5px;
}
.draft-field textarea { min-height: 260px; line-height: 1.5; resize: vertical; }
.fineprint { font-size: 12.5px; color: var(--ink-faint); margin-top: 12px; }

/* ---------- toast / change alert ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60;
  width: min(560px, calc(100vw - 24px)); background: var(--ink); color: var(--bg);
  border-radius: 14px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start;
  box-shadow: 0 12px 32px rgba(14, 18, 32, 0.25); animation: rise 0.25s ease-out;
}
@keyframes rise { from { transform: translate(-50%, 12px); opacity: 0; } }
.toast b { display: block; font-size: 14.5px; }
.toast span { font-size: 13.5px; opacity: 0.8; }
.toast .sunmark { width: 10px; height: 10px; border-radius: 50%; background: var(--sun); margin-top: 6px; flex-shrink: 0; }
.toast button { margin-left: auto; border: 0; background: none; color: inherit; opacity: 0.7; font-weight: 600; font-size: 13px; white-space: nowrap; }

/* ---------- Drive mode ---------- */
.drive {
  position: fixed; inset: 0; z-index: 80; background: #0b1020; color: #f2f3f8;
  display: flex; flex-direction: column; padding: max(24px, env(safe-area-inset-top)) 28px max(24px, env(safe-area-inset-bottom));
}
.drive-top { display: flex; align-items: center; justify-content: space-between; color: #9aa1bd; font-size: 15px; }
.drive-top button { border: 1px solid #2b3352; background: none; color: #f2f3f8; border-radius: 999px; padding: 10px 18px; font-weight: 600; font-size: 15px; }
.drive-body { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 900px; margin: 0 auto; width: 100%; }
.drive-line { font-size: clamp(30px, 5.4vw, 56px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 600; margin: 0 0 36px; text-wrap: balance; }
.drive-line .amt { color: #f7c47a; }
.drive-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.drive-list li { display: grid; grid-template-columns: 48px 1fr; align-items: baseline; font-size: clamp(20px, 3vw, 30px); line-height: 1.3; font-weight: 550; color: #c9cde0; transition: color 0.2s; }
.drive-list li span { font-size: 0.8em; color: #6e7698; font-variant-numeric: tabular-nums; }
.drive-list li.speaking { color: #fff; }
.drive-list li.speaking span { color: #f7c47a; }
.drive-controls { display: flex; justify-content: center; gap: 20px; padding-top: 16px; }
/* Play and mic are a matched pair: same size, same soft tinted disc, each in its own colour */
.drive-btn {
  width: 92px; height: 92px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: #1d2440; color: #fff; transition: background .15s, color .15s;
}
.drive-btn.main { background: #1c2556; color: #aeb8ff; }
.drive-btn.main[aria-label="Stop"] { background: #8d9cff; color: #060b26; }
.drive-btn.main svg { transform: translateX(2px); }
.drive-btn.main[aria-label="Stop"] svg { transform: none; }
.drive-btn.rec { background: #3a2a10; color: #f7c47a; }
.drive-btn.rec[aria-pressed="true"] { background: #f5a93f; color: #2a1800; animation: pulse 1.4s infinite; }
.drive-btn svg { width: 46px; height: 46px; }
.drive-btn.main svg { width: 66px; height: 66px; }
.drive-caption { text-align: center; color: #8a91ad; font-size: 15px; margin-top: 12px; min-height: 22px; }

/* ---------- mobile nav ---------- */
.bottom-nav { display: none; }

@media (max-width: 1024px) {
  .today, .notes { grid-template-columns: 1fr; gap: 36px; }
  .side { position: static; }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .top-inner { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); height: 56px; gap: 10px; }
  .tabs { display: none; }
  .brand b { font-size: 17px; }
  .biz { max-width: 150px; font-size: 12.5px; }
  main { padding-block: 12px calc(var(--nav-h) + 72px); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .preview-note { padding: 8px 16px 0; }
  .headline { font-size: 30px; }
  .subhead { font-size: 16px; margin-bottom: 24px; }
  .thing { grid-template-columns: 32px minmax(0, 1fr); padding: 18px 0; }
  .effect { grid-column: 2; text-align: left; display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
  .effect b { display: inline; font-size: 18px; }
  .thing-actions { grid-column: 2; }
  .thing h3 { font-size: 16.5px; }
  .figures { grid-template-columns: 1fr 1fr; }
  .change { grid-template-columns: 1fr; }
  .sheet { top: auto; left: 0; width: 100vw; max-height: 88vh; border-radius: 20px 20px 0 0; border-left: 0; animation: up 0.22s ease-out; }
  @keyframes up { from { transform: translateY(30px); opacity: 0; } }
  .weeks .hide-sm { display: none; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--rule);
  }
  .bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 11px; font-weight: 600; color: var(--ink-faint); text-decoration: none; position: relative;
  }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a[aria-current="page"] { color: var(--accent); }
  .bottom-nav .count { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--sun); color: #3a2400; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
  .toast { bottom: calc(var(--nav-h) + 16px); }
  .drive-list li { grid-template-columns: 36px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Home: one sentence, today's things, and the bar ---------- */
.home { max-width: 680px; margin: 0 auto; padding-top: clamp(8px, 3vh, 40px); }
.home-top { display: grid; gap: 14px; }
.hello { margin: 0; color: var(--ink-soft); font-size: 15px; }
.home .headline { max-width: none; font-size: clamp(32px, 4.6vw, 48px); margin: 0; }
.home .subhead { margin: 0; font-size: 18px; max-width: 58ch; }
.home-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.today-list { margin-top: clamp(32px, 5vh, 56px); }
.today-list .section-title { margin-bottom: 12px; }
.calm { color: var(--ink-soft); font-size: 16px; margin: 0; padding: 18px 0; border-top: 1px solid var(--rule); }
.home-row { grid-template-columns: 36px minmax(0, 1fr); padding: 18px 0; }
.home-row details { min-width: 0; }
.home-row summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline;
  border-radius: 6px;
}
.home-row summary::-webkit-details-marker { display: none; }
.home-row summary .t { font-size: 18px; font-weight: 600; line-height: 1.35; letter-spacing: -0.012em; }
.home-row summary .e { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.015em; color: var(--ink); white-space: nowrap; }
.home-row details p { margin: 10px 0 0; color: var(--ink-soft); font-size: 15px; max-width: 60ch; }
.home-row details .thing-actions { margin-top: 12px; }
.home-row details[open] summary .t { color: var(--ink); }
.home-row.done summary .t { color: var(--ink-faint); text-decoration: line-through; text-decoration-thickness: 1px; }
.home-row.done summary .e { color: var(--ink-faint); }
.home-row.done details p, .home-row.done details .thing-actions { display: none; }
.waiting {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 14px; font-weight: 600;
  color: var(--ink-soft); text-decoration: none;
}
.waiting:hover { color: var(--ink); }
.waiting .sunmark { width: 8px; height: 8px; border-radius: 50%; background: var(--sun); }

.home .convo { max-width: none; margin-top: 40px; }
.home .convo:empty { display: none; }
.home .turn:first-child { border-top: 1px solid var(--rule); }
.note.inline { padding: 0; border: 0; margin-top: 10px; }
.note.inline blockquote, .note.inline .meta { display: none; }

.dock { margin-top: 28px; }
.dock.stick {
  position: sticky; bottom: 0; z-index: 10; margin-top: 32px;
  padding-block: 20px max(16px, env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to bottom, transparent, var(--bg) 22px);
}
.dock .askbar { margin-top: 0; padding: 8px 8px 8px 22px; }
.dock .askbar input { font-size: 16.5px; padding: 10px 0; }

/* Ask Neri: the main way in, so it reads as the brightest thing at the bottom of the page */
.askbar.branded {
  padding-left: 10px; gap: 10px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 55%, var(--rule));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent), var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.askbar.branded:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent), var(--shadow);
}
.askbar.branded input { font-weight: 500; }
.askbar.branded input::placeholder { color: var(--ink-soft); font-weight: 450; }
.attach-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; cursor: pointer;
  color: var(--ink-soft); background: var(--sunken); transition: background .15s, color .15s;
}
.attach-btn:hover { color: var(--ink); background: color-mix(in srgb, var(--accent) 14%, var(--sunken)); }
.attach-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.attach-btn svg { width: 20px; height: 20px; stroke-width: 2; }
.attach-list { list-style: none; display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; margin: 0 0 8px; padding: 0 4px; }
.attach-list::-webkit-scrollbar { display: none; }
.attach-chip {
  display: inline-flex; flex-shrink: 0; align-items: center; gap: 4px; max-width: 240px; padding: 2px 2px 2px 12px; border-radius: 999px;
  font-size: 13px; background: var(--surface); border: 1px solid var(--rule); color: var(--ink);
}
.attach-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip button { border: 0; background: none; color: var(--ink-faint); font-size: 18px; line-height: 1; width: 32px; height: 32px; border-radius: 50%; }
.attach-chip button:hover { background: var(--sunken); color: var(--ink); }

/* Suggested questions sit in one row right on top of the bar; the row scrolls sideways when it runs long */
.dock-hints {
  display: flex; gap: 8px; margin: 0 0 10px; padding: 2px 2px 2px 6px; overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.dock-hints::-webkit-scrollbar { display: none; }
@media (min-width: 761px) { .dock-hints { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; } }
.dock-hints .hint {
  flex-shrink: 0; white-space: nowrap; font-size: 13.5px; padding: 6px 13px; color: var(--ink);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 22%, var(--rule));
}
.dock-hints .hint:hover { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 40%, var(--rule)); }

/* ---------- Details: the dashboard ---------- */
.kpis {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-bottom: 20px;
  background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden;
}
.kpis .fig { background: var(--surface); padding: 16px 18px; }
.kpis .fig .link { font-size: 12.5px; font-weight: 600; text-decoration: none; }
.page-head.sub { margin: 28px 0 12px; align-items: center; }
.details-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; margin-top: 36px; align-items: start; }

@media (max-width: 1024px) {
  .details-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 760px) {
  .home { padding-top: 8px; }
  .home .headline { font-size: 32px; }
  .home .subhead { font-size: 16.5px; }
  .home-row summary .t, .home-row summary .e { font-size: 16.5px; }
  .home-row summary { grid-template-columns: 1fr; gap: 2px; }
  .home { padding-bottom: 72px; }
  .dock, .dock.stick {
    position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); z-index: 25; margin: 0;
    padding-block: 8px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px));
    background: var(--bg); border-top: 1px solid var(--rule);
  }
  .dock .askbar { box-shadow: none; padding: 4px 4px 4px 16px; }
  .dock .askbar.branded { padding-left: 6px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
  .attach-btn { width: 34px; height: 34px; }
  .dock-hints { margin-bottom: 8px; }
  .dock-hints .hint { font-size: 13px; padding: 5px 11px; }
  .home:has(.dock-hints) { padding-bottom: 116px; }
  .home:has(.attach-list) { padding-bottom: 160px; }
  .dock .askbar input { font-size: 16px; padding: 8px 0; }
  .wide-only { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
}

/* ---------- Neri's take (CFO read) ---------- */
.take {
  margin: 4px 0 0; display: grid; grid-template-columns: 10px 1fr; gap: 12px; align-items: baseline;
  font-size: 17px; line-height: 1.5; color: var(--ink); max-width: 60ch;
}
.take .sunmark { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe1a8, var(--sun)); transform: translateY(-1px); }

/* ---------- connection dots in the header ---------- */
.dots {
  display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 12px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); text-decoration: none;
}
.dots .d, .app-tile .d { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: inline-block; }
.dots .d.amber, .app-tile .d.amber { background: var(--sun); }
.dots .d.red { background: var(--below); }
.dots small { font-size: 11.5px; color: var(--ink-faint); font-weight: 600; margin-left: 2px; }
.dots:hover { border-color: color-mix(in srgb, var(--ink) 20%, var(--rule)); }

/* ---------- the big mic ---------- */
.talk {
  position: fixed; z-index: 40; right: max(28px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%);
  width: 76px; height: 76px; border-radius: 50%; border: 0; padding: 0;
  background: radial-gradient(circle at 30% 28%, #6f80ec, var(--accent) 60%, #3a4dc4);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(74, 95, 217, 0.35), 0 2px 6px rgba(26, 32, 53, 0.15);
}
.talk svg { width: 30px; height: 30px; position: relative; }
.talk .talk-ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--sun) 70%, transparent); opacity: 0.9; }
.talk .talk-label {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 12.5px; font-weight: 650; color: var(--ink-soft);
}
.talk:hover { filter: brightness(1.05); }
.talk:focus-visible { outline: 3px solid var(--sun); outline-offset: 4px; }

.voice {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px;
  background: color-mix(in srgb, var(--bg) 70%, rgba(14, 18, 32, 0.55)); backdrop-filter: blur(10px);
  animation: fade 0.15s;
}
.voice-card { width: min(520px, 100%); text-align: center; display: grid; gap: 16px; justify-items: center; }
.orb {
  width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 32% 30%, #ffe1a8, var(--sun) 55%, #e08a1e);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--sun) 40%, transparent);
}
.orb svg { width: 44px; height: 44px; }
.orb.live { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 22px color-mix(in srgb, var(--sun) 0%, transparent); transform: scale(1.04); } 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sun) 45%, transparent); } }
.voice-heard { margin: 8px 0 0; font-size: clamp(20px, 3vw, 26px); line-height: 1.35; letter-spacing: -0.015em; font-weight: 600; color: var(--ink); min-height: 2.7em; text-wrap: balance; }
.voice-status { margin: 0; color: var(--ink-soft); font-size: 14px; }
.voice-actions { display: flex; gap: 10px; }
.voice .askbar { width: 100%; margin: 0; }

/* ---------- portal: sign up + set up ---------- */
body.portal {
  background:
    radial-gradient(1100px 520px at 12% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(700px 420px at 92% 0%, color-mix(in srgb, var(--sun) 16%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
body.portal .top { background: transparent; border-bottom-color: transparent; backdrop-filter: none; }
body.portal::before { background: transparent; }
.portal-wrap { max-width: 440px; margin: clamp(24px, 10vh, 120px) auto 0; }
.portal-title { font-size: clamp(32px, 4.4vw, 44px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 650; margin: 0 0 12px; text-wrap: balance; }
.portal-sub { margin: 0 0 28px; color: var(--ink-soft); font-size: 17px; max-width: 46ch; }
.portal-form { display: grid; gap: 8px; }
.portal-form label { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-top: 6px; }
.portal-form input {
  height: 52px; border-radius: 14px; border: 1px solid var(--rule); background: var(--surface); padding: 0 16px; font-size: 17px;
  box-shadow: 0 1px 2px rgba(26, 32, 53, 0.04);
}
.portal-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.code-input { letter-spacing: 0.4em; font-variant-numeric: tabular-nums; font-weight: 650; }
.btn.big { height: 52px; font-size: 16px; padding: 0 24px; margin-top: 12px; }
.portal-fine { color: var(--ink-faint); font-size: 13.5px; margin: 14px 0 0; }
.form-error { margin: 4px 0 0; color: var(--below); font-size: 14px; font-weight: 550; }
.linklike { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; font-size: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.linklike svg { width: 16px; height: 16px; }

.setup { max-width: 980px; margin: clamp(8px, 4vh, 48px) auto 0; padding-bottom: 120px; }
.setup .portal-sub { margin-bottom: 22px; }
.kind-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.kind-pill {
  height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface);
  font-weight: 600; font-size: 14px; color: var(--ink-soft);
}
.kind-pill[aria-checked="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.rail { margin-bottom: 22px; }
.rail h2 { margin: 0 0 10px; font-size: 13.5px; font-weight: 650; color: var(--ink-soft); }
.rail-track {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 10px; margin: 0 -2px;
  scrollbar-width: thin;
}
.app-tile {
  position: relative; flex: 0 0 112px; scroll-snap-align: start; display: grid; justify-items: center; gap: 10px;
  padding: 18px 8px 14px; border-radius: 18px; border: 1px solid var(--rule); background: var(--surface);
  text-align: center; transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.app-tile:not(:disabled):hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.app-tile .logo { width: 48px; height: 48px; border-radius: 13px; font-size: 15px; font-weight: 700; color: #fff; display: grid; place-items: center; }
.app-name { font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--ink); min-height: 2.5em; display: grid; align-items: start; }
.tick {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--rule); background: var(--surface); display: grid; place-items: center; color: transparent;
}
.tick svg { width: 12px; height: 12px; }
.app-tile.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.app-tile.on .tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.soon { font-size: 11px; color: var(--ink-faint); font-weight: 600; margin-top: -4px; }
.reserve-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 30px 0 0; font-size: 15px; }
.reserve-row label { font-weight: 600; }
.reserve-note { color: var(--ink-faint); font-size: 13.5px; }
.connect-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 14px max(14px, env(safe-area-inset-bottom, 0px));
  padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--rule);
}
.connect-bar .btn.big { margin-top: 0; min-width: 200px; }

/* bottom nav: the center slot holds the mic on phones */
.nav-slot { display: block; }

@media (max-width: 1100px) {
  .talk { top: auto; bottom: max(28px, env(safe-area-inset-bottom, 0px)); transform: none; }
  .talk .talk-label { display: none; }
}
@media (max-width: 760px) {
  .talk {
    left: 50%; right: auto; transform: translateX(-50%); width: 64px; height: 64px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); z-index: 35;
  }
  .talk svg { width: 26px; height: 26px; }
  .talk .talk-ring { inset: -5px; border-color: var(--bg); border-width: 4px; }
  .dots { padding: 0 9px; gap: 4px; }
  .home .dock, .home .dock.stick { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }
  .portal-wrap { margin-top: 24px; }
  .app-tile { flex-basis: 100px; }
  .connect-bar { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .connect-bar .btn.big { width: 100%; }
  .connect-bar .linklike { justify-content: center; }
  .setup { padding-bottom: 170px; }
  .take { font-size: 16px; }
}
.talk[hidden], .voice[hidden] { display: none; }

.bar-note { color: var(--ink-soft); font-size: 13.5px; }
.app-tile .logo { letter-spacing: -0.02em; }

/* ---------- idle lock ---------- */
body.locked #view, body.locked .preview-note { filter: blur(14px); pointer-events: none; user-select: none; }
.lock {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
}
.lock-card { text-align: center; display: grid; gap: 10px; justify-items: center; max-width: 340px; }
.lock-card svg { width: 44px; height: 44px; }
.lock-card h2 { margin: 6px 0 0; font-size: 26px; letter-spacing: -0.02em; }
.lock-card p { margin: 0 0 8px; color: var(--ink-soft); }
.linklike[disabled] { color: var(--ink-faint); cursor: default; }
body.locked .talk { display: none; }

/* ---------- today's things: horizontal cards, one in focus, the next peeking in ---------- */
.deck-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.deck-head .section-title { margin: 0; }
.deck-nav { display: flex; gap: 6px; }
.deck-arrow {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--rule); background: var(--surface);
  display: grid; place-items: center; color: var(--ink-soft); padding: 0;
}
.deck-arrow svg { width: 16px; height: 16px; }
.deck-arrow:hover:not([disabled]) { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 25%, var(--rule)); }
.deck-arrow[disabled] { opacity: 0.35; cursor: default; }

.deck {
  list-style: none; margin: 0; padding: 4px 2px 18px; display: flex; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: 2px; scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.deck::-webkit-scrollbar { display: none; }
.deck:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 20px; }
.card {
  flex: 0 0 84%; scroll-snap-align: start; scroll-snap-stop: always; min-width: 0;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 20px; padding: 22px 22px 18px;
  box-shadow: var(--shadow); transition: opacity 0.2s, transform 0.2s;
  opacity: 0.55; transform: scale(0.985);
}
.deck.single .card { flex-basis: 100%; }
.card.focus, .deck.single .card { opacity: 1; transform: none; }
.card.fresh { animation: settle 1.2s ease-out; }
.card-top { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--ink-faint); }
.card-by { color: var(--ink-soft); }
.card-effect { margin: 2px 0 0; display: flex; align-items: baseline; gap: 8px; }
.card-effect b { font-size: clamp(30px, 4.2vw, 40px); font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1; }
.card-effect span { font-size: 13px; color: var(--ink-faint); }
.card-title { margin: 0; font-size: 19px; line-height: 1.32; font-weight: 600; letter-spacing: -0.014em; text-wrap: balance; }
.card-why { margin: 0; color: var(--ink-soft); font-size: 14.5px; line-height: 1.5; }
.card-actions { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card.done { box-shadow: none; }
.card.done .card-title, .card.done .card-effect b { color: var(--ink-faint); }
.card.done .card-why { display: none; }
.card.done .card-by { color: var(--good); }
.deck-dots { display: flex; justify-content: center; gap: 6px; margin-top: -4px; }
.deck-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--rule); transition: width 0.2s, background 0.2s; }
.deck-dots i.on { width: 18px; background: var(--accent); }

@media (max-width: 760px) {
  .card { flex-basis: 86%; padding: 18px 18px 16px; }
  .card-title { font-size: 17px; }
  .deck-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}


/* ---------- brand mark (the Neri artwork as a square tile) ---------- */
.mark { display: block; width: 32px; height: 32px; border-radius: 8px; object-fit: cover; box-shadow: 0 0 0 1px var(--rule), 0 1px 2px rgba(6, 11, 38, 0.25); }
.mark-lg { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 0 0 1px var(--rule), 0 10px 30px rgba(6, 11, 38, 0.28), 0 2px 6px rgba(6, 11, 38, 0.18); }
.portal-mark { margin-bottom: 22px; }
.lock-card .mark-lg { margin-bottom: 4px; }
.drive-brand { display: inline-flex; align-items: center; gap: 12px; }
.drive-brand .mark { width: 28px; height: 28px; }
.drive { background: #030a2c; }

/* the act-by date now sits with the actions, not above the card */
.card-actions .card-by { font-size: 13px; color: var(--ink-soft); margin-right: 4px; }
.card-actions .card-by b { color: var(--ink); font-weight: 600; }
.card.done .card-actions .card-by { color: var(--good); }
.card { gap: 12px; }

/* ---------- browser surfaces in the brand ---------- */
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--ink); }
input, textarea { caret-color: var(--accent); }
html { scrollbar-color: color-mix(in srgb, var(--ink-faint) 45%, transparent) transparent; }
a { text-underline-offset: 0.18em; }

.source-paste label { display: block; font-weight: 600; margin-bottom: 10px; }
.source-paste textarea { display: block; width: 100%; min-height: 120px; margin-bottom: 12px; }

.bank-balance label { display: block; margin-top: 12px; margin-bottom: 6px; }
.bank-balance input { display: block; width: 100%; max-width: 360px; margin-bottom: 14px; }

.source-paste textarea, .bank-balance input { border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--surface); padding: 12px; line-height: 1.5; }
.source-paste textarea::placeholder, .bank-balance input::placeholder { color: var(--ink-faint); }

.bank-balance select { display: block; width: 100%; max-width: 360px; margin-bottom: 14px; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--surface); padding: 12px; }

/* Keep unavailable providers visible without suggesting they can connect. */
.conn.is-unavailable { background: var(--sunken); border-style: dashed; }
.conn.is-unavailable > .logo, .app-tile.is-unavailable > .logo { filter: grayscale(1); }
.conn.is-unavailable > b, .app-tile.is-unavailable .app-name { color: var(--ink-faint); }
.conn > .state { grid-column: 2 / -1; grid-row: 3; margin-top: 6px; }
.conn > .btn { grid-column: 2 / -1; justify-self: start; margin-top: 8px; }
.conn .conn-fallback { grid-column: 2 / -1; margin: 4px 0 0; font-size: 12px; color: var(--ink-faint); }
.app-tile:disabled { cursor: not-allowed; background: var(--bg); border-style: dashed; opacity: 1; }
.conn .btn:disabled { cursor: not-allowed; }

/* Home: forecast checks fold into one quiet line under today's things */
.checks { margin-top: 14px; }
.checks summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none;
  font-size: 15px; font-weight: 600; color: var(--ink-soft); padding: 6px 0;
}
.checks summary::-webkit-details-marker { display: none; }
.checks summary:hover { color: var(--ink); }
.checks .sunmark { width: 8px; height: 8px; border-radius: 50%; background: var(--sun); flex-shrink: 0; }
.checks-more { font-weight: 500; font-size: 13.5px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.checks[open] .checks-more { font-size: 0; }
.checks[open] .checks-more::after { content: "Hide"; font-size: 13.5px; }
.checks-body {
  margin-top: 8px; padding: 14px 18px; border: 1px solid var(--rule); border-left: 3px solid var(--sun);
  border-radius: var(--radius); background: var(--surface); max-height: 320px; overflow: auto;
}
.checks-body p { margin: 0 0 8px; color: var(--ink-soft); font-size: 14px; }
.checks-body ul { margin: 0 0 12px; padding-left: 18px; font-size: 13.5px; color: var(--ink-soft); display: grid; gap: 6px; }

/* Sales moves fill today's list after the cash actions */
.card-tag { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); align-self: center; }
.card.sales .card-effect b { color: var(--ink-soft); }
.forecast-review.quiet { border-inline-start-color: var(--line, #ddd); }
.assumed-paid { margin-top: 12px; font-size: 14px; }
.assumed-paid summary { cursor: pointer; color: var(--ink); }
.overdue-actions { display: inline-flex; gap: 6px; margin-inline-start: 8px; vertical-align: middle; }
.linklike { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
