/* WATCHER by OTT Ventures: design tokens and components.
   Restraint first: neutral surfaces, one brand accent (OTT green), type and spacing do the work.
   Evidence is drawn with a solid rule; anything inferred (rules, AI) carries a dashed amber rule.

   Theme: <html data-theme="light|dark|system"> is rendered by the server from the person's saved
   choice, so there is no flash and no inline script (strict CSP). "system" follows the device. */

:root {
  --brand: #39ff14;           /* OTT green, from the supplied logo; accents only, never body text */
  --paper: #f7f8f6;
  --surface: #ffffff;
  --raised: #f0f2ef;
  --ink: #101513;
  --ink-2: #3a4340;
  --ink-3: #5c6661;
  --line: #e3e6e2;
  --line-strong: #c9cfca;
  --hover: rgba(16, 21, 19, 0.05);
  --nav-bg: #0d1411; --nav-ink: #d3dcd7; --nav-ink-2: #93a39b; --nav-hover: rgba(255, 255, 255, 0.07); --nav-line: #222c27;
  --cobalt-tint: #e9effd;
  --spruce: #15803d;          /* accessible green for text, success and "done" */
  --spruce-2: #166534;
  --spruce-tint: #ecfdf0;
  --on-spruce: #ffffff;
  --cobalt: #1d4ed8;          /* links */
  --saffron: #b45309;         /* inferred / interpretation */
  --saffron-tint: #fff7e6;
  --danger: #b42318;
  --danger-tint: #fdecea;
  --ok: #15803d;
  --warn: #92400e;
  --warn-tint: #fef3d7;
  --primary: #0f3d2e;
  --on-primary: #ffffff;
  --focus: #1d4ed8;
  --chart-1: #15803d; --chart-2: #1d4ed8; --chart-3: #b45309; --chart-4: #6d28d9; --chart-5: #0f766e;
  --radius-s: 6px;
  --radius-m: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
/* Dark tokens, applied for an explicit "dark" choice ... */
:root[data-theme="dark"] {
  --paper: #0b0f0d; --surface: #121815; --raised: #1a211d;
  --ink: #ededef; --ink-2: #b4b4bb; --ink-3: #8e8e96;
  --line: #232b27; --line-strong: #38423d; --hover: rgba(255, 255, 255, 0.06);
  --spruce: #4ade80; --spruce-2: #86efac; --spruce-tint: #0f2417; --on-spruce: #052e12;
  --cobalt: #7aa7ff; --saffron: #f5b545; --saffron-tint: #2a1f0b;
  --danger: #ff8a80; --danger-tint: #33140f; --ok: #4ade80; --warn: #f5b545; --warn-tint: #2a1f0b;
  --primary: #4ade80; --on-primary: #06210f; --focus: #7aa7ff; --cobalt-tint: #14213d; --nav-bg: #080b0a;
  --chart-1: #4ade80; --chart-2: #7aa7ff; --chart-3: #f5b545; --chart-4: #b79cff; --chart-5: #2dd4bf;
  color-scheme: dark;
}
/* ... and for "system" when the device is in dark mode. Keep both blocks identical. */
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --paper: #0b0f0d; --surface: #121815; --raised: #1a211d;
    --ink: #ededef; --ink-2: #b4b4bb; --ink-3: #8e8e96;
    --line: #232b27; --line-strong: #38423d; --hover: rgba(255, 255, 255, 0.06);
    --spruce: #4ade80; --spruce-2: #86efac; --spruce-tint: #0f2417; --on-spruce: #052e12;
    --cobalt: #7aa7ff; --saffron: #f5b545; --saffron-tint: #2a1f0b;
    --danger: #ff8a80; --danger-tint: #33140f; --ok: #4ade80; --warn: #f5b545; --warn-tint: #2a1f0b;
    --primary: #4ade80; --on-primary: #06210f; --focus: #7aa7ff; --cobalt-tint: #14213d; --nav-bg: #080b0a;
    --chart-1: #4ade80; --chart-2: #7aa7ff; --chart-3: #f5b545; --chart-4: #b79cff; --chart-5: #2dd4bf;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font);
  line-height: 1.55; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
a { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); margin: 0; }
h1 { font-size: 1.8rem; font-weight: 650; letter-spacing: -0.022em; line-height: 1.2; }
h2 { font-size: 1.12rem; font-weight: 620; letter-spacing: -0.01em; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 0.75rem; max-width: 72ch; }
small, .muted { color: var(--ink-3); }
.lead { color: var(--ink-2); font-size: 1.02rem; margin-top: 0.4rem; }
.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 { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: var(--radius-s); border: 1px solid var(--line-strong); }
.skip:focus { left: 8px; }
fieldset { border: 0; margin: 0; padding: 0; }

/* Shell ------------------------------------------------------------------ */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.nav { background: var(--surface); border-right: 1px solid var(--line); color: var(--ink-2); display: flex; flex-direction: column; gap: 1px; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 6px 10px 22px; color: var(--ink); }
.nav a.brand:hover { background: none; text-decoration: none; }
.brand-mark { height: 22px; width: auto; display: block; flex: none; }
.brand-name { font-weight: 750; letter-spacing: 0.14em; font-size: 0.92rem; line-height: 1.2; color: var(--ink); }
.brand-name span { display: block; color: var(--ink-3); font-weight: 450; font-size: 0.74rem; letter-spacing: 0.01em; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--ink-2); padding: 7px 10px; border-radius: var(--radius-s); font-size: 0.93rem; position: relative; }
.nav a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--hover); color: var(--ink); font-weight: 560; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav .icon { width: 16px; height: 16px; flex: none; opacity: 0.8; }
.nav-gap { flex: 1; }
.nav-dev { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.nav-user { padding: 10px; font-size: 0.8rem; color: var(--ink-3); }
.nav-email { display: block; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user form { margin-top: 6px; }
.nav-user button { background: none; border: 0; color: var(--ink-2); padding: 0; cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }
main { padding: 36px 44px 72px; max-width: 1240px; width: 100%; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.crumb { font-size: 0.85rem; color: var(--ink-3); margin-bottom: 6px; }
.crumb a { color: var(--ink-3); }

/* Appearance: compact switch in the sidebar, full choice in Settings */
.theme-switch { display: inline-flex; gap: 2px; margin: 12px 10px 0; padding: 2px; border: 1px solid var(--line); border-radius: 999px; align-self: flex-start; }
.theme-switch button { width: 28px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 999px; background: none; color: var(--ink-3); cursor: pointer; padding: 0; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--raised); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); }
.theme-switch svg { width: 14px; height: 14px; }
.theme-choice fieldset { display: grid; grid-template-columns: repeat(3, minmax(0, 180px)); gap: 14px; }
.theme-option { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); cursor: pointer; font-weight: 400; margin: 0; }
.theme-option:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.theme-option input { position: absolute; opacity: 0; }
.theme-option:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.theme-option small { display: block; }
.theme-swatch { height: 64px; border-radius: var(--radius-s); border: 1px solid var(--line-strong); }
.theme-swatch.light { background: linear-gradient(#ffffff 0 30%, #f4f4f5 30%); }
.theme-swatch.dark { background: linear-gradient(#18181b 0 30%, #0a0a0b 30%); }
.theme-swatch.system { background: linear-gradient(105deg, #ffffff 0 50%, #0a0a0b 50%); }

/* Blocks ------------------------------------------------------------------ */
.section { margin-top: 32px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.section-head p { margin: 0; color: var(--ink-3); font-size: 0.88rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.stack > * + * { margin-top: 12px; }

/* Headline figures: a single ruled row, not a set of cards */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.figure { padding: 16px 18px 18px 0; }
.figure + .figure { padding-left: 18px; border-left: 1px solid var(--line); }
.figure .value { font-family: var(--font-display); font-size: 2rem; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; }
.figure .label { color: var(--ink-2); font-size: 0.85rem; margin-top: 4px; }
.figure .note { color: var(--ink-3); font-size: 0.78rem; }

/* Tables --------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th { text-align: left; font-weight: 560; color: var(--ink-3); font-size: 0.8rem; padding: 8px 10px; border-bottom: 1px solid var(--line-strong); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.table-wrap { overflow-x: auto; }
.empty { padding: 28px; text-align: center; color: var(--ink-2); border: 1px dashed var(--line-strong); border-radius: var(--radius-m); background: var(--surface); }
.empty p { margin: 0 auto 12px; }

/* Status words: text with a small marker, used sparingly */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.86rem; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.status.ok::before { background: var(--ok); }
.status.warn::before { background: var(--saffron); }
.status.bad::before { background: var(--danger); }
.trend-up { color: var(--ok); }
.trend-down { color: var(--danger); }

/* Evidence vs interpretation: the core visual idea */
.evidence { border-left: 2px solid var(--ink); padding-left: 14px; }
.inferred { border-left: 2px dashed var(--saffron); padding-left: 14px; }
.layer-label { font-size: 0.8rem; color: var(--ink-3); margin-bottom: 8px; }
.layer-label strong { color: var(--ink-2); font-weight: 600; }
.finding { padding: 12px 0; border-bottom: 1px solid var(--line); }
.finding:last-child { border-bottom: 0; }
.finding .kind { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.finding .kind.recommendation { color: var(--spruce); }
.finding .kind.hypothesis, .finding .kind.interpretation { color: var(--saffron); }
.finding .meta { font-size: 0.8rem; color: var(--ink-3); margin-top: 4px; }
.verdict { font-size: 0.8rem; font-weight: 600; }
.verdict.supported { color: var(--ok); }
.verdict.contradicted, .verdict.unsupported { color: var(--danger); }
.verdict.partially_supported, .verdict.insufficient_evidence { color: var(--warn); }
.demo-banner { background: var(--saffron-tint); border: 1px dashed var(--saffron); color: var(--ink); padding: 10px 14px; border-radius: var(--radius-s); font-size: 0.9rem; margin-bottom: 14px; }

/* Charts ------------------------------------------------------------------- */
.chart { height: 300px; width: 100%; }
.chart.tall { height: 380px; }
.chart-caption { font-size: 0.8rem; color: var(--ink-3); margin-top: 8px; }

/* Forms and buttons ---------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 7px 14px; border-radius: var(--radius-s); font: inherit; font-size: 0.92rem; font-weight: 520; cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--ink-3); background: var(--raised); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { opacity: 0.88; background: var(--primary); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 0.84rem; }
.btn.block { width: 100%; padding: 10px 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--cobalt); cursor: pointer; font: inherit; font-size: 0.88rem; }
.link-btn.danger { color: var(--danger); }
form.inline { display: inline; }
label { display: block; font-weight: 520; font-size: 0.9rem; margin-bottom: 4px; }
.field { margin-bottom: 16px; }
.field .help, .helptext { display: block; font-size: 0.82rem; color: var(--ink-3); margin-top: 4px; }
input[type=text], input[type=email], input[type=url], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; max-width: 520px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 0.93rem;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--focus); }
textarea { max-width: 100%; }
input.compact, select.compact { width: auto; padding: 5px 8px; font-size: 0.88rem; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; }
.errorlist { color: var(--danger); font-size: 0.85rem; margin: 4px 0 0; padding: 0; list-style: none; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Toggle switch (AI Analysis) */
.toggle-row { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 13px; cursor: pointer; transition: background .15s; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--spruce); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 2px 22px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tabs a { padding: 8px 0 10px; color: var(--ink-3); font-size: 0.93rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.subnav { display: flex; flex-direction: column; gap: 2px; }
.subnav a { padding: 7px 10px; border-radius: var(--radius-s); color: var(--ink-2); font-size: 0.92rem; }
.subnav a:hover { background: var(--hover); text-decoration: none; }
.subnav a[aria-current="page"] { background: var(--hover); color: var(--ink); font-weight: 600; }
.with-subnav { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 36px; align-items: start; }

/* Messages and notices */
.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.messages li { padding: 10px 14px; border-radius: var(--radius-s); margin-bottom: 8px; font-size: 0.92rem; background: var(--spruce-tint); border: 1px solid transparent; }
.messages li.error { background: var(--danger-tint); }
.messages li.warning { background: var(--warn-tint); }
.notice { padding: 12px 14px; border-radius: var(--radius-s); background: var(--warn-tint); font-size: 0.92rem; margin-bottom: 14px; }
.notice.calm { background: var(--spruce-tint); }
.notice.bad { background: var(--danger-tint); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }

/* Confirmation of a paid action */
.confirm { border: 1px solid var(--line-strong); border-radius: var(--radius-m); background: var(--surface); overflow: hidden; }
.confirm dl { display: grid; grid-template-columns: 180px 1fr; margin: 0; }
.confirm dt, .confirm dd { padding: 10px 18px; border-bottom: 1px solid var(--line); margin: 0; }
.confirm dt { color: var(--ink-2); font-size: 0.88rem; }
.confirm dd { font-weight: 500; }
.confirm .action-text { padding: 14px 18px; background: var(--raised); font-size: 0.93rem; }
.confirm .actions { padding: 14px 18px; }

.kv { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; font-size: 0.92rem; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.source-row { display: flex; justify-content: space-between; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
details summary { cursor: pointer; color: var(--cobalt); font-size: 0.9rem; }
.kw-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
code { font-family: var(--font-mono); font-size: 0.86em; background: var(--raised); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; word-break: break-word; }

/* Sign-in ---------------------------------------------------------------- */
.auth-body { background: var(--paper); }
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand .brand-mark { height: 24px; margin: 0 auto 22px; }
.auth-category { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin: 0 auto 6px; }
.wordmark { font-size: 2.6rem; font-weight: 800; letter-spacing: 0.16em; margin-right: -0.16em; line-height: 1.05; }
.tagline { color: var(--ink-2); font-size: 1.02rem; margin: 10px auto 0; }
.auth-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 28px; }
.auth-panel h2 { margin-bottom: 12px; }
.auth-panel p:last-child { margin-bottom: 0; }
.auth-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--ink-3); text-align: center; }
.auth-foot .logo { height: 24px; width: auto; }
/* Show the logo version made for the current background */
.logo-on-dark { display: none; }
:root[data-theme="dark"] .logo-on-light { display: none; }
:root[data-theme="dark"] .logo-on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .logo-on-light { display: none; }
  :root[data-theme="system"] .logo-on-dark { display: block; }
}

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; gap: 2px; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav a { padding: 6px 8px; font-size: 0.88rem; }
  .nav a[aria-current="page"]::before { display: none; }
  .nav .icon { display: none; }
  .nav-user { width: 100%; padding: 6px 8px 0; }
  .brand { padding-bottom: 8px; width: 100%; }
  .nav-gap { display: none; }
  .nav-dev { border: 0; padding: 0; margin: 0; }
  .theme-switch { margin: 4px 8px 0; }
  main { padding: 24px 16px 48px; }
  .grid-2, .grid-3, .split, .with-subnav { grid-template-columns: minmax(0, 1fr); }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figure .value { font-size: 1.5rem; }
  .figure:nth-child(3) { border-left: 0; padding-left: 0; }
  .page-head { flex-direction: column; }
  .confirm dl, .kv { grid-template-columns: 1fr; }
  .theme-choice fieldset { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .wordmark { font-size: 2.1rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Research journey: a real sequence, so it is numbered */
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0 0 24px; padding: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps li { counter-increment: step; padding: 12px 14px 12px 42px; position: relative; color: var(--ink-3); }
.steps li + li { border-left: 1px solid var(--line); }
.steps li::before { content: counter(step); position: absolute; left: 13px; top: 13px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 0.72rem; display: grid; place-items: center; color: var(--ink-3); }
.steps li strong { display: block; color: var(--ink-2); font-weight: 600; font-size: 0.9rem; }
.steps li span { font-size: 0.82rem; }
.steps li.done::before { content: "✓"; background: var(--spruce); border-color: var(--spruce); color: var(--on-spruce); }
.steps li.current strong { color: var(--ink); }
.steps li.current::before { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.capabilities { display: grid; gap: 14px; font-size: 0.9rem; }
.capabilities ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }
.capabilities li { margin-bottom: 4px; }
.glossary { display: grid; grid-template-columns: 170px 1fr; gap: 8px 18px; margin: 0; font-size: 0.88rem; }
.glossary dt { font-weight: 600; color: var(--ink-2); }
.glossary dd { margin: 0; color: var(--ink-2); max-width: 80ch; }
.next-steps { margin: 0; padding-left: 20px; }
.next-steps li { margin-bottom: 8px; }
.single-signal { font-size: 0.84rem; color: var(--ink-3); }
@media (max-width: 1180px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } .steps li:nth-child(4) { border-left: 0; } .steps li:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 960px) { .steps { grid-template-columns: 1fr; } .steps li + li { border-left: 0; border-top: 1px solid var(--line); } .glossary { grid-template-columns: 1fr; } }

/* ==========================================================================
   Design system, 2026-11. Later rules refine the ones above, so every page shares them.
   Solid green = measured or checked. Grey = reported or unconfirmed. Dashed amber = AI.
   ========================================================================== */
h1 { font-size: 1.65rem; letter-spacing: -0.02em; }
h2 { font-size: 1.05rem; }
h3 { font-size: 0.95rem; }
main { padding: 32px 40px 64px; max-width: 1280px; }
.page-head { margin-bottom: 22px; }
.lead { max-width: 68ch; font-size: 0.98rem; }
.crumb { font-size: 0.82rem; margin-bottom: 4px; }
.section { margin-top: 28px; }
.section-head { align-items: center; padding-bottom: 8px; margin-bottom: 10px; }
.section-head .more { font-size: 0.85rem; }
h3.sub { margin: 16px 0 6px; font-weight: 600; color: var(--ink-2); }
.panel { box-shadow: none; }
.split { grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; }
aside { min-width: 0; }

/* Shell */
.shell { grid-template-columns: 244px minmax(0, 1fr); }
.shell-setup .nav { gap: 12px; }
.topbar { display: none; }
.nav { background: var(--nav-bg); border-right: 0; color: var(--nav-ink); padding: 16px 12px 10px; position: sticky; top: 0; height: 100vh; }
.nav a { color: var(--nav-ink); }
.nav a:hover { background: var(--nav-hover); color: #fff; }
.nav a[aria-current="page"] { background: var(--nav-hover); color: #fff; }
.nav .icon { opacity: 0.75; }
.brand { padding: 4px 10px 14px; color: #fff; }
.brand-name { color: #fff; }
.brand-name span { color: var(--nav-ink-2); }
.nav :focus-visible { outline-color: var(--brand); }
.nav-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; margin: 0 -4px; padding: 0 4px; }
.nav-heading { margin: 14px 10px 4px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--nav-ink-2); }
.nav-modules { display: flex; flex-direction: column; gap: 1px; }
.nav-modules a { font-size: 0.89rem; padding: 5px 10px; }
.project-switch { padding: 0 10px 8px; }
.project-switch label { font-size: 0.72rem; color: var(--nav-ink-2); margin-bottom: 3px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.project-switch select { width: 100%; background: var(--nav-hover); color: #fff; border-color: var(--nav-line); padding: 6px 8px; font-size: 0.88rem; }
.project-switch select option { color: #101513; background: #fff; }
.setup-note { color: var(--nav-ink-2); font-size: 0.85rem; padding: 0 10px; }
.nav-user, .nav-email, .nav-user button { color: var(--nav-ink); }

/* Profile menu */
.user-menu { border-top: 1px solid var(--nav-line); margin-top: 8px; padding-top: 8px; position: relative; }
.user-menu summary { list-style: none; cursor: pointer; padding: 6px 10px; border-radius: var(--radius-s); color: var(--nav-ink); font-size: 0.84rem; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--nav-hover); }
.user-email { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { display: block; color: var(--nav-ink-2); font-size: 0.78rem; }
.user-menu-body { position: absolute; bottom: 100%; left: 0; right: 0; background: #17201c; border: 1px solid var(--nav-line); border-radius: var(--radius-m); padding: 6px; display: flex; flex-direction: column; gap: 1px; margin-bottom: 6px; z-index: 20; }
.user-menu-body a { font-size: 0.87rem; padding: 6px 8px; }
.user-signout { background: none; border: 0; color: var(--nav-ink); width: 100%; text-align: left; padding: 6px 8px; border-radius: var(--radius-s); cursor: pointer; font: inherit; font-size: 0.87rem; }
.user-signout:hover { background: var(--nav-hover); color: #fff; }
.theme-switch { margin: 6px 8px; border-color: var(--nav-line); }
.theme-switch button { color: var(--nav-ink-2); }
.theme-switch button:hover { color: #fff; }
.theme-switch button[aria-pressed="true"] { background: var(--nav-hover); color: #fff; box-shadow: 0 0 0 1px var(--nav-line); }

/* Buttons and fields */
.btn { border-radius: var(--radius-s); font-weight: 520; }
.btn.primary:hover { opacity: 1; filter: brightness(1.15); }
.btn[data-busy]:disabled { cursor: progress; }
input:not([type=checkbox]):not([type=radio]):hover, select:hover, textarea:hover { border-color: var(--ink-3); }
.form-page { max-width: 560px; }
.form-page input, .form-page select, .form-page textarea { max-width: 100%; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; padding: 10px 0 14px; }
.filters label { font-size: 0.78rem; color: var(--ink-3); font-weight: 500; margin-bottom: 2px; }
.filters select, .filters input { width: auto; max-width: 180px; padding: 5px 8px; font-size: 0.87rem; }
.filters .check { align-self: center; color: var(--ink-2); font-size: 0.85rem; margin: 0; }

/* Chips: what kind of thing this is */
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.74rem; font-weight: 560; line-height: 1.5; white-space: nowrap; border: 1px solid transparent; vertical-align: 1px; }
.chip.fact { background: var(--spruce-tint); color: var(--spruce-2); }
.chip.source, .chip.claim { background: var(--raised); color: var(--ink-2); }
.chip.ai { background: var(--saffron-tint); color: var(--warn); border: 1px dashed var(--saffron); }
.chip.act { background: var(--cobalt-tint); color: var(--cobalt); border: 1px dashed var(--cobalt); }
.chip.bad { background: var(--danger-tint); color: var(--danger); }
.chip.sample { background: var(--warn-tint); color: var(--warn); }
.chip.live { background: var(--spruce-tint); color: var(--spruce-2); }
.legend { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.8rem; color: var(--ink-3); }

/* Scope line and steps */
.context-line { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 0.88rem; }
.context-line span { color: var(--ink-3); margin-right: 6px; font-size: 0.8rem; }
.flow { list-style: none; counter-reset: flow; margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 0.84rem; color: var(--ink-3); border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.flow li { counter-increment: flow; display: flex; align-items: center; gap: 7px; }
.flow li::before { content: counter(flow); width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 0.72rem; }
.flow li.done { color: var(--ink-2); }
.flow li.done::before { content: "\2713"; background: var(--spruce); border-color: var(--spruce); color: var(--on-spruce); }
.flow li.current { color: var(--ink); font-weight: 600; }
.flow li.current::before { border-color: var(--ink); color: var(--ink); }

/* Research form */
.research-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 20px; }
.research-form > summary { color: var(--ink); cursor: pointer; }
.research-form > summary h2 { display: inline; }
.research-form form { margin-top: 14px; }
.research-form input[type=text] { max-width: 100%; font-size: 1rem; padding: 10px 12px; }
.plan { margin: 0 0 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; font-size: 0.86rem; }
.plan dt { color: var(--ink-3); font-size: 0.78rem; }
.plan dd { margin: 0; }
.more-options { margin: 0 0 14px; }
.more-options > summary { font-size: 0.87rem; }
.more-options[open] > summary { margin-bottom: 10px; }
.more-options .check { margin-bottom: 4px; font-size: 0.88rem; }
.note { font-size: 0.87rem; color: var(--ink-2); background: var(--raised); padding: 9px 12px; border-radius: var(--radius-s); margin: 14px 0; max-width: none; }
aside .note { margin: 10px 0 0; }
.figure .note { background: none; padding: 0; margin: 2px 0 0; font-size: 0.78rem; color: var(--ink-3); }
.source-form { border-top: 1px solid var(--line); padding: 12px 0; }
.source-form input, .source-form select { max-width: 100%; }

/* Lists instead of heavy tables and cards */
.signal-list, .evidence-list, .plain-list, .area-list, .module-list { list-style: none; margin: 0; padding: 0; }
.signal-list li, .evidence-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.signal-list li:last-child, .evidence-list li:last-child { border-bottom: 0; }
.signal-list.compact li { padding: 7px 0; }
.signal-title { margin: 0; font-weight: 520; max-width: none; color: var(--ink); overflow-wrap: anywhere; }
.signal-title a { color: var(--ink); }
.signal-title a:hover { color: var(--cobalt); }
.signal-meta { margin: 2px 0 0; font-size: 0.8rem; color: var(--ink-3); max-width: none; overflow-wrap: anywhere; }
.evidence-excerpt { margin: 3px 0 0; font-size: 0.89rem; color: var(--ink-2); max-width: 90ch; overflow-wrap: anywhere; }
.signal-group { margin-top: 16px; }
.signal-group h3 a { color: var(--ink); }
.plain-list li { padding: 3px 0; font-size: 0.9rem; }
.area-list li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 0.89rem; border-bottom: 1px solid var(--line); }
.area-list li:last-child { border-bottom: 0; }
.area-list .muted { font-size: 0.8rem; white-space: nowrap; }
.module-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.module-state { text-align: right; font-size: 0.85rem; white-space: nowrap; }

/* Research runs */
.run { border-bottom: 1px solid var(--line); padding: 8px 0; }
.run > summary { display: flex; justify-content: space-between; gap: 10px; color: var(--ink); align-items: baseline; list-style: none; }
.run > summary::-webkit-details-marker { display: none; }
.run-query { font-weight: 560; font-size: 0.89rem; overflow-wrap: anywhere; }
.run .status { font-size: 0.78rem; white-space: normal; }
.run-source { padding: 8px 0 6px; font-size: 0.86rem; }
.run-source p { margin: 0 0 3px; }
.run-source .btn { margin-top: 4px; }
.run-source .check { font-size: 0.82rem; margin: 4px 0 0; }

/* Findings */
.finding-groups { display: grid; gap: 20px; }
.finding-group:not(:has(.finding-card)) { display: none; }
.group-title { color: var(--ink-3); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 600; margin-bottom: 8px; }
.finding-card { border-left: 3px solid var(--line-strong); padding: 2px 0 2px 14px; margin-bottom: 16px; }
.finding-card.fact { border-left: 3px solid var(--spruce); }
.finding-card.bad { border-left: 3px solid var(--danger); }
.finding-card.ai { border-left: 3px dashed var(--saffron); }
.finding-card.act { border-left: 3px dashed var(--cobalt); }
.finding-card h3 { margin: 5px 0 2px; }
.finding-card p { margin: 3px 0; max-width: 80ch; }
.finding-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.finding-confidence { font-size: 0.78rem; }
.finding-save { margin-left: auto; }
.finding-more { margin-top: 4px; }
.finding-more > summary { font-size: 0.84rem; }
.finding-more[open] > summary { margin-bottom: 6px; }

/* Getting started and empty states */
.welcome { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 24px 28px; margin-bottom: 8px; }
.getting-started { list-style: none; counter-reset: gs; margin: 16px 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.getting-started li { counter-increment: gs; position: relative; padding-left: 32px; color: var(--ink-3); font-size: 0.88rem; }
.getting-started li::before { content: counter(gs); position: absolute; left: 0; top: 0; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 0.78rem; }
.getting-started li.current::before { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.getting-started li.done::before { content: "\2713"; background: var(--spruce); border-color: var(--spruce); color: var(--on-spruce); }
.getting-started strong { display: block; color: var(--ink); font-weight: 600; }
.empty { padding: 28px 24px; border-style: dashed; }
.empty h2, .empty h3 { margin-bottom: 6px; }

/* Dialog */
.dialog { border: 1px solid var(--line-strong); border-radius: var(--radius-m); background: var(--surface); color: var(--ink); padding: 20px 22px; max-width: 440px; width: calc(100% - 32px); }
.dialog::backdrop { background: rgba(8, 12, 10, 0.55); }

/* Sign-in and setup */
.auth-note { font-size: 0.82rem; margin-top: 14px; }
.messages li { border-radius: var(--radius-s); }

/* Tablet and small laptop */
@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; }
  main { padding: 28px 28px 56px; }
}
@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .topbar { display: flex; align-items: center; gap: 12px; background: var(--nav-bg); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 30; }
  .topbar-brand { color: #fff; font-weight: 750; letter-spacing: 0.14em; font-size: 0.9rem; }
  .topbar-brand:hover { text-decoration: none; }
  .topbar-project { margin-left: auto; color: var(--nav-ink); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-toggle { background: none; border: 0; color: #fff; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; border-radius: var(--radius-s); }
  .nav-toggle:hover { background: var(--nav-hover); }
  .nav-toggle svg { width: 18px; height: 18px; }
  .js .nav { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; height: 100vh; z-index: 50; transform: translateX(-100%); visibility: hidden; }
  .js .nav-animate .nav { transition: transform .18s ease, visibility .18s; }
  .js .nav-open .nav { transform: none; visibility: visible; }
  html:not(.js) .nav { position: static; height: auto; }
  .nav-scrim { position: fixed; inset: 0; background: rgba(8, 12, 10, 0.5); z-index: 40; }
  .nav { flex-direction: column; flex-wrap: nowrap; gap: 1px; padding: 16px 12px 10px; border: 0; }
  .nav .icon { display: block; }
  .nav a { padding: 7px 10px; font-size: 0.93rem; }
  .brand { width: auto; }
  .theme-switch { margin: 6px 8px; }
  main { padding: 24px 24px 56px; }
  .grid-2, .grid-3, .with-subnav { grid-template-columns: minmax(0, 1fr); }
  .page-head { flex-direction: row; }
}
@media (max-width: 860px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .getting-started { grid-template-columns: 1fr; gap: 12px; }
  .plan { grid-template-columns: minmax(0, 1fr); }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { flex-direction: column; }
  main { padding: 20px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) { .js .nav-animate .nav { transition: none; } }
.nav { color-scheme: dark; }
