/* Dark mode for the app (2026-10-28). gate.js puts class "dark" on <html>
   while the app shows and the owner's choice (Light, Dark, or Auto, which
   follows their Mac or phone) says dark. The public site never goes dark.
   Most of the app reads the color tokens, so swapping them does most of the
   work; the rest are the light washes and whites written straight in
   style.css. The rail and sample bar stay black, a shade darker than the
   page. */
html.dark {
  --page: #18181B;
  --card: #0E0E10;
  --ink: #F2F1EE;
  --on-ink: #141416;
  --night: #0B0B0C;
  --body: #C9C7C2;
  --muted: #8E8C87;
  --line: #2E2E32;
  --line-strong: #45454A;
  --sky-wash: #1C2740;
  --sky-soft: #22314F;
  --red-wash: #3A1D1F;
  --wash: #28282C;
  --ok-wash: #15301F;
  --ok-ink: #5FD394;
  --warn-wash: #352A10;
  --warn-ink: #F0C75E;
  --blue-wash: #1C2740;
  --blue-ink: #8FB0FF;
}

/* Black surfaces stay black. */
html.dark .rail, html.dark .sample-bar, html.dark .phone-bar, html.dark .rail-label, html.dark .wf-rail, html.dark .wf-bar { background: var(--night); color: #fff; }
html.dark .rail { border-right: 1px solid var(--line); }
html.dark .sample-bar { border-bottom: 1px solid var(--line); }
html.dark .rail.open .rail-label, html.dark .rail.drawer .rail-label { background: none; color: inherit; }
html.dark .rail-btn.on { background: #fff; color: #111111; }
html.dark .sample-bar button.sample-go { color: #111111; }
html.dark .rail-badge, html.dark .rail-sample { color: #fff; }
html.dark .rail-mark { background: #fff; }

/* Controls. */
html.dark button:hover { background: var(--wash); }
html.dark button.primary:hover, html.dark .fx-next:not(.primary):hover, html.dark .ld-pill:hover { background: #fff; }
html.dark input::placeholder, html.dark textarea::placeholder { color: #6E6C68; }
html.dark input, html.dark textarea, html.dark select { background: var(--card); color: var(--ink); }
html.dark .dim { color: #6E6C68; }

/* Neutral washes. */
html.dark .pill, html.dark .pill.off, html.dark .step, html.dark .ht-img, html.dark .fx-bar,
html.dark .wz-bar, html.dark .wz-soon, html.dark .cn-old, html.dark .vt-tag { background: var(--wash); }
html.dark .wz-opt .wz-rec, html.dark .wz-rec { background: var(--wash) !important; }
html.dark .act-line.open, html.dark .vt-fact, html.dark .vt-rc, html.dark .td-ex { background: #19191C; }
html.dark .act-bars button:hover { background: var(--wash); }
html.dark .wz-l-stopped .wz-l-dot { background: #4A4A4F; }
html.dark .tm-in, html.dark .tm-role, html.dark .tm-role:hover, html.dark .tm-av-nimbus, html.dark .sg-to select,
html.dark .au-every, html.dark .au-tell select, html.dark .cx-icon.cx-logo, html.dark .pf-dot-ok { background: var(--card); }
html.dark .cx-icon.cx-logo { background: #fff; }

/* Green: done, fresh, yours. */
html.dark .pill.ok, html.dark span.cx-btn.on, html.dark .wz-linked-card, html.dark .pf-fresh.new,
html.dark .pf-health.good .pf-health-score, html.dark .cx-on, html.dark .note-toast-ico, html.dark .pf-pt-ico,
html.dark mark.jb-yours, html.dark .jb-chip, html.dark .jb-chip:hover { background: var(--ok-wash); color: var(--ok-ink); }
html.dark .pf-task-box:hover { background: var(--ok-wash); }

/* Yellow: waiting, needs a look. */
html.dark .pf-fresh.mid, html.dark .pf-health.mid .pf-health-score, html.dark .tm-note, html.dark .tm-pending,
html.dark .tm-lv-agency, html.dark .jb-err, html.dark .jb-warn, html.dark .mt-warn, html.dark .vt-tag.changed,
html.dark .td-tag, html.dark .jb-chip.jb-blank, html.dark .pill.you { background: var(--warn-wash); color: var(--warn-ink); }
html.dark .cn-needs { background: var(--warn-wash); border-color: #5A4614; }
html.dark button.cn-fix:hover { background: #4A3A12; }
html.dark mark, html.dark .act-what mark { background: #5A4A12; color: inherit; }

/* Blue: info, offers, picked. */
html.dark .pill.wait, html.dark .pill.read, html.dark .pair.off, html.dark .chat-offer, html.dark .wz-opt.on,
html.dark .tm-lv-attester { background: var(--blue-wash); color: var(--blue-ink); }
html.dark .chat-offer { color: var(--body); }

/* Colored words with no wash behind them. */
html.dark .cc-done, html.dark .checked, html.dark .timeline .t-datum .who, html.dark .typing-dots .chat-step.done,
html.dark .cn-ai-when.on, html.dark .act-ok, html.dark .jb-added, html.dark .jb-ok span { color: var(--ok-ink); }
html.dark .tm-wait, html.dark .cn-sum, html.dark .im-state.im-out, html.dark .cx-acct.warn .cx-acct-sub { color: var(--warn-ink); }
html.dark .pf-old, html.dark .cn-dot.bad, html.dark .im-off { color: #FF8A8A; }
html.dark .pf-fresh.old, html.dark .pf-health.low .pf-health-score { color: #FF8A8A; }
html.dark .act-num.read b, html.dark .lane-review .count { color: var(--blue-ink); }
html.dark .timeline .t-ai .who, html.dark .cx-need { color: #FB923C; }

/* Settings, Colors: a ring so the black swatch still shows. */
html.dark .st-dot, html.dark .colors-box .sw button { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28); }
