/* Roast Ladder — hand-authored light-polarity component overrides.
   ARCHITECTURE: companion overrides the mechanical adapter (build_roast_adapter.py)
   canNOT derive: components authored outside the Black Label palette entirely.
   The generated roast-ladder.css only recolors Black Label palette values by
   role; anything styled in foreign palettes (stellar-era slate/indigo) needs a
   judgment call per polarity, which lives here, scoped to the light companion.
   Loaded only by the shared Roast Ladder head bootstrap — flag-off surfaces
   stay byte-identical.

   Currently covers: the feature-hint / welcome hint cards (feature-hints.js →
   .feature-hint in note-input-v2.css), authored as light slate ink on translucent
   indigo — unreadable over Cold Brew's parchment canvas. */

/* ── Light-polarity elevation shadows ─────────────────────────────────────
   Black Label carries depth in glows and near-black shadow stacks tuned for
   OLED; on parchment those read as nothing. Light polarity carries depth in
   soft warm umbra shadows (espresso-ink tinted, low alpha) + the widened
   surface ramp (dark-roast-theme@5.3.0). These override the shadow tokens the
   adapter deliberately leaves cascading. */
:root[data-roast-theme="cold-brew"] .tc-page,
:root[data-roast-theme="cold-brew"] .aw-page {
  --term-shadow-card: 0 1px 3px rgba(48, 38, 30, 0.20), 0 4px 14px rgba(48, 38, 30, 0.12);
  --term-shadow-card-hover: 0 3px 8px rgba(48, 38, 30, 0.26), 0 10px 28px rgba(48, 38, 30, 0.14);
  --term-shadow-modal: 0 16px 48px rgba(48, 38, 30, 0.34), 0 3px 10px rgba(48, 38, 30, 0.18);
}

:root[data-roast-theme="cold-brew"] {
  /* Transfer Center elevation ladder (--tc-shadow-* live at :root in
     transfer-center.css; the attribute selector out-specifies them). White
     inset hairlines become stronger on light — they're the paper sheen. */
  --tc-shadow-1: 0 1px 3px rgba(48, 38, 30, 0.20), 0 5px 16px rgba(48, 38, 30, 0.12);
  --tc-shadow-2: 0 3px 10px rgba(48, 38, 30, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.40);
  --tc-shadow-3: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  --tc-shadow-well: inset 0 2px 10px rgba(48, 38, 30, 0.22);
}

/* ── Course Tapestry: kill the OLED instrument texture ────────────────────
   .nev-tap-wv-texture screen-blends scanlines + a gold radial over the whole
   weave. On dark it's a faint instrument glow; on a light canvas screen-blend
   LIGHTENS everything under it — fogging the card and shimmering text edges
   ("blurry"). Light polarity gets clean paper: no texture. */
:root[data-roast-theme="cold-brew"] .nev-tap-wv-texture {
  display: none;
}

/* ── Paper-lift interactive chrome ────────────────────────────────────────
   On dark, buttons read through outline + glow. On light, interactive chrome
   pops by sitting LIGHTER than the canvas with a soft umbra — paper lift.
   Near-white lift + structural border + shadow for the patient action row
   and shared button chrome. */
:root[data-roast-theme="cold-brew"] .sol-patient-action-btn,
:root[data-roast-theme="cold-brew"] .sol-btn,
:root[data-roast-theme="cold-brew"] .sol-empty-actions button {
  background: #F0EAE1;
  border-color: rgba(90, 73, 59, 0.45);
  box-shadow: 0 1px 2px rgba(48, 38, 30, 0.16), 0 2px 6px rgba(48, 38, 30, 0.08);
}

:root[data-roast-theme="cold-brew"] .sol-patient-action-btn:hover,
:root[data-roast-theme="cold-brew"] .sol-btn:hover,
:root[data-roast-theme="cold-brew"] .sol-empty-actions button:hover {
  background: #F7F2EA;
  border-color: rgba(90, 73, 59, 0.65);
  box-shadow: 0 2px 5px rgba(48, 38, 30, 0.22), 0 4px 12px rgba(48, 38, 30, 0.10);
}

/* ── Census welcome / empty-state hero ────────────────────────────────────
   sol-layout.css hardcodes stellar-era slate inks (#e5e7eb title,
   rgba(148,163,184,.9) lede) — near-invisible ghost text on parchment. */
:root[data-roast-theme="cold-brew"] .sol-empty-state h3 {
  color: var(--sol-text-primary, #342920);
}

:root[data-roast-theme="cold-brew"] .sol-empty-lede {
  color: var(--sol-text-secondary, #625445);
}

:root[data-roast-theme="cold-brew"] .sol-empty-icon {
  color: #625445;
  opacity: 0.75;
}

/* Elevated light card, dark ink, indigo accents kept but deepened for contrast. */
:root[data-roast-theme="cold-brew"] .feature-hint {
  background:
    linear-gradient(135deg, rgba(99, 102, 241, 0.10), rgba(139, 92, 246, 0.06)),
    var(--sol-bg-elevated, #D1C5B7);
  border-color: rgba(79, 70, 229, 0.35);
  box-shadow: 0 4px 20px rgba(59, 49, 41, 0.22);
}

:root[data-roast-theme="cold-brew"] .feature-hint-title {
  color: var(--sol-text-primary, #3B3129);
}

:root[data-roast-theme="cold-brew"] .feature-hint-body {
  color: var(--sol-text-secondary, #625445);
}

:root[data-roast-theme="cold-brew"] .feature-hint-body strong {
  color: #4338CA;
}

:root[data-roast-theme="cold-brew"] .feature-hint-badge {
  background: rgba(99, 102, 241, 0.14);
  color: #4338CA;
}

/* Warm neutral literals here: --sol-text-muted resolves to Cold Brew's green
   (#405634), which reads as a status hue, not chrome, on this card. */
:root[data-roast-theme="cold-brew"] .feature-hint-step {
  color: #7A6A58;
}

:root[data-roast-theme="cold-brew"] .feature-hint-dismiss {
  color: #7A6A58;
}

:root[data-roast-theme="cold-brew"] .feature-hint-dismiss:hover {
  background: rgba(59, 49, 41, 0.10);
  color: var(--sol-text-primary, #3B3129);
}

:root[data-roast-theme="cold-brew"] .feature-hint-footer {
  border-top-color: rgba(59, 49, 41, 0.14);
}

:root[data-roast-theme="cold-brew"] .feature-hint-action {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(79, 70, 229, 0.35);
  color: #4338CA;
}

:root[data-roast-theme="cold-brew"] .feature-hint-action:hover {
  background: rgba(99, 102, 241, 0.20);
  border-color: rgba(79, 70, 229, 0.55);
}

/* ═══════════════════════════════════════════════════════════════════════
   COURSE TAPESTRY — designed Cold Brew face (2026-07-16 design pass)
   The light-polarity equivalent of the 14a "clinical calm" dark craft pass:
   a paper instrument on a desk, not a recolored OLED panel. Grammar:
   - the instrument is LIFTED paper (lighter card + umbra, not a dark island)
   - hierarchy = manila band group headers + crisp seams + ink weight
   - secondary metadata is READABLE warm-mid ink (14a's #B9A88F was authored
     for dark and passes through the adapter unmapped — invisible on cream)
   - chrome (tabs/filters/actions) uses paper-lift; the ACTIVE state is a
     dark-roast fill, the one truly dark element on the sheet
   ═══════════════════════════════════════════════════════════════════════ */

/* Card = lifted paper on the desk, with real structure. */
:root[data-roast-theme="cold-brew"] .nev-tap-wv {
  --wv-hair: rgba(90, 73, 59, 0.28);
  --wv-seam: rgba(74, 58, 45, 0.52);
  --wv-warmmid: #6E5B49; /* 14a warm-mid, re-inked for light */
  background: #E9E2D6;
  border: 1px solid rgba(90, 73, 59, 0.45);
  box-shadow: 0 1px 3px rgba(48, 38, 30, 0.14), 0 10px 34px rgba(48, 38, 30, 0.12);
}

/* Header: paper masthead — lighter than the body, dark ink, decisive seam. */
:root[data-roast-theme="cold-brew"] .nev-tap-wv-header {
  background: linear-gradient(180deg, #F1EBE0, #E9E2D6);
  border-bottom: 2px solid rgba(74, 58, 45, 0.5);
}

:root[data-roast-theme="cold-brew"] .nev-tap-wv-dayblk .n {
  color: #8A5200; /* deep amber day anchor — saturated ink, not a glow */
}

/* Group headers: manila folder-tab bands — the strongest hierarchy cue on
   paper. Inverted: warm dark band, cream small-caps. */
:root[data-roast-theme="cold-brew"] .nev-tap-wv-section {
  background: #6E5B49;
  color: #F2ECE1;
  border-bottom: 0;
}

/* Ledger / open-end rail: a side tray, one step below the sheet, seamed in. */
:root[data-roast-theme="cold-brew"] .nev-tap-wv-rail {
  background: #DDD4C5;
  box-shadow: inset 12px 0 16px -14px rgba(48, 38, 30, 0.30);
}

:root[data-roast-theme="cold-brew"] .nev-tap-oe-head .hd {
  color: #4A3A2D;
}

/* Toolbar tabs + filter pills: paper-lift at rest, dark-roast fill when
   active — selection is the single dark element on the sheet. */
:root[data-roast-theme="cold-brew"] .nev-tap-wv .nev-tap-fbtn,
:root[data-roast-theme="cold-brew"] .nev-tap-wv .nev-tap-tabbtn {
  color: #5C4B3B;
}

:root[data-roast-theme="cold-brew"] .nev-tap-wv .nev-tap-fbtn.active,
:root[data-roast-theme="cold-brew"] .nev-tap-wv .nev-tap-fbtn[aria-pressed="true"],
:root[data-roast-theme="cold-brew"] .nev-tap-wv .nev-tap-tabbtn.active,
:root[data-roast-theme="cold-brew"] .nev-tap-wv .nev-tap-tabbtn[aria-pressed="true"] {
  background: #4A3A2D;
  color: #F2ECE1;
  border-color: #4A3A2D;
}

/* Problem names: near-black ink; the lifeline sheet is a document. */
:root[data-roast-theme="cold-brew"] .nev-tap-lane-nm,
:root[data-roast-theme="cold-brew"] .nev-tap-wv-label .nm .nev-tap-lane-nm {
  color: #29201A;
}

/* Compile CTA: the instrument's one action gets full paper-lift + amber ink. */
:root[data-roast-theme="cold-brew"] .nev-tap-wv .nev-tap-compile,
:root[data-roast-theme="cold-brew"] .nev-tap-wv button[class*="compile"] {
  background: #F1EBE0;
  color: #8A5200;
  border: 1px solid rgba(138, 82, 0, 0.45);
  box-shadow: 0 1px 2px rgba(48, 38, 30, 0.16), 0 2px 8px rgba(48, 38, 30, 0.08);
}

/* Day scrubber headers (doctor, round 5: "D1 with date at the top is
   STUPIDLY SMALL"). 14a sized these for quiet OLED chrome (12px/9.5px/9px);
   on paper they are the timeline's column headers — reading text, not
   chrome. Sized to read, inked to read. Light-scoped; say the word and the
   same sizes can apply to the dark face. */
:root[data-roast-theme="cold-brew"] .nev-tap-wv-day .d {
  font: 700 15px/1 var(--wv-sans);
  color: #4A3A2D;
}

:root[data-roast-theme="cold-brew"] .nev-tap-wv-day .dt {
  font: 500 12px/1 var(--wv-mono);
  color: #6E5B49;
}

:root[data-roast-theme="cold-brew"] .nev-tap-wv-day .ev {
  font: 500 11px/1 var(--wv-mono);
}

:root[data-roast-theme="cold-brew"] .nev-tap-wv-day {
  gap: 4px;
  padding: 8px 2px 10px;
}

/* ── CRITICAL: Note Rail reading surface (production daily driver) ────────
   note-rail-terminal.css pins --rail-note-fg to pure #FFFFFF (2026-04-24
   "brighter note text" fix, authored for the dark void). Under Cold Brew the
   rail surfaces remap to parchment but the note body/streaming text stayed
   white — an unreadable generated note in the most-used feature. Same
   near-black reading ink as the tapestry problem names. */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] {
  --rail-note-fg: #29201A;
}

/* ── Census architecture-promo band (first screen after login) ────────────
   sol-layout.css .sol-arch-promo title/deck are near-white warm inks on what
   is now a light band — illegible. Amber kicker/CTA hold contrast, kept. */
:root[data-roast-theme="cold-brew"] .sol-arch-promo-title {
  color: #342920;
}

:root[data-roast-theme="cold-brew"] .sol-arch-promo-deck {
  color: #5C4B3B;
}

/* ── NE Workspace v2 takeover: the same dark-authored #B9A88F metadata ink
   already re-inked for the tapestry — identical literal, different component
   (#noteEvolutionTakeover legend/note chrome + controls). */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-legend,
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-note-head,
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-note-foot,
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-ol-plan,
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-was,
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-no-prior,
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-pane-notice[data-kind="empty"],
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-ol-row[data-loop-state="open"] .nev2-ol-result,
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-note-controls button {
  color: #6E5B49;
}

/* ── Prior Notes Panel (holdout sweep #2) ─────────────────────────────────
   Stellar-era Tailwind pastel-on-dark-tint pairs (300/400-range text) wash
   out on cream; re-inked to 700-range on the same translucent tints, which
   read as proper light chips here. Plus a real cross-theme bug scoped-fixed
   for light: --sol-bg-surface is never defined anywhere, so its #0f1219
   fallback always won — a permanently dark-navy search box and preview pane
   that under Cold Brew held dark-on-dark text. */
:root[data-roast-theme="cold-brew"] .pnp-search-input,
:root[data-roast-theme="cold-brew"] .pnp-preview-column {
  background: #EDE7DC;
}

:root[data-roast-theme="cold-brew"] .pnp-search-input {
  border-color: rgba(90, 73, 59, 0.40);
}

:root[data-roast-theme="cold-brew"] .pnp-filter-tab.active {
  color: #1D4ED8;
}

:root[data-roast-theme="cold-brew"] .pnp-mode-toggle.active {
  color: #6D28D9;
}

:root[data-roast-theme="cold-brew"] .pnp-type-badge.type-progress { color: #15803D; }
:root[data-roast-theme="cold-brew"] .pnp-type-badge.type-hp { color: #1D4ED8; }
:root[data-roast-theme="cold-brew"] .pnp-type-badge.type-discharge { color: #6D28D9; }
:root[data-roast-theme="cold-brew"] .pnp-type-badge.type-cheatsheet { color: #A16207; }
:root[data-roast-theme="cold-brew"] .pnp-type-badge.type-brief { color: #BE185D; }
:root[data-roast-theme="cold-brew"] .pnp-type-badge.type-transfer { color: #0F766E; }

:root[data-roast-theme="cold-brew"] .pnp-source-badge.cross-patient {
  color: #B91C1C;
}

:root[data-roast-theme="cold-brew"] .pnp-cross-patient-warning {
  color: #92400E;
}

:root[data-roast-theme="cold-brew"] .pnp-cross-patient-warning strong {
  color: #78350F;
}

:root[data-roast-theme="cold-brew"] .pnp-use-btn {
  background: linear-gradient(135deg, #2563eb, #1D4ED8);
}

/* ── Holdout batch round 2 (sweep queue: conflict modal, import modal,
   kanban pills, problem-space grays, renal scanline) ──────────────────────
   Same failure class as the Prior Notes Panel: Tailwind 300/400 pastel text
   on translucent tints, authored for dark. Re-inked to 600/700-depth. */
:root[data-roast-theme="cold-brew"] .ap-diff-footer #apDiffEdit {
  color: #4338CA;
}

:root[data-roast-theme="cold-brew"] .ap-diff-footer #apDiffEdit:hover {
  color: #3730A3;
}

:root[data-roast-theme="cold-brew"] .inm-badge-handp { color: #1D4ED8; }
:root[data-roast-theme="cold-brew"] .inm-badge-progress { color: #15803D; }
:root[data-roast-theme="cold-brew"] .inm-badge-discharge { color: #6D28D9; }
:root[data-roast-theme="cold-brew"] .inm-badge-unknown { color: #475569; }

:root[data-roast-theme="cold-brew"] .kanban-card-severity.critical { color: #B91C1C; }
:root[data-roast-theme="cold-brew"] .kanban-card-severity.severe { color: #DC2626; }
:root[data-roast-theme="cold-brew"] .kanban-card-severity.moderate { color: #A16207; }
:root[data-roast-theme="cold-brew"] .kanban-card-severity.mild { color: #15803D; }

/* Problem-space raw muted grays (slate-400/500 on light = ghost text). */
:root[data-roast-theme="cold-brew"] .card-role-badge.role-gray {
  color: #475569;
}

:root[data-roast-theme="cold-brew"] .unscored-card-trajectory,
:root[data-roast-theme="cold-brew"] .card-trajectory-flat {
  color: #64604F;
}

/* Renal cockpit: same screen-blend scanline pattern killed on the tapestry —
   low alpha, but screen-blend still lightens/fogs a light canvas. */
:root[data-roast-theme="cold-brew"] #renalCockpitTakeover::before {
  display: none;
}

/* ── NE Workspace v2 takeover: the SURFACE RAMP (the real "not covered") ───
   ROOT CAUSE: the takeover SHELL (note-evolution-takeover.css) paints from
   --dr-* role tokens (--dr-void/-obsidian/-dark-cacao…), which the mechanical
   adapter already remaps to parchment under Cold Brew — so shell chrome flips
   for free. But the v2 LAYER defines its own ramp, --nev2-surface-0..5, as
   hard dark literals inside #noteEvolutionTakeover[data-nev-v2]. Those are NOT
   --dr-* role tokens, so the adapter never touches them (0 hits in
   roast-ladder.css) and every v2 plane painted from them — the two context
   columns, the primary note plane, the tapestry board, cards, wells, the
   finalize bar — stayed dark espresso: a dark cockpit floating in the
   parchment app. This remaps the ramp to a paper ladder, harmonized with the
   tapestry sheet values above and the adapter's --dr-* parchment ramp.

   DEPTH INVERTS on paper: in the dark ramp raised == lighter; here recessed ==
   the one shadowed sheet and raised == the brightest. surface-1 is the working
   NOTE plane (the 07-13/14 doctor correction made the note the hero that "owns
   every pixel"), so it gets the brightest, cleanest sheet; the context columns
   (surface-2) sit one step down as the desk. Literal first pass tuned to the
   tapestry palette — say the word on any step and it moves. */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] {
  /* Whole ramp lives in the warm parchment band the rest of the app uses
     (#E2DBD0 canvas … #F1EBE0 masthead). NO near-white: a note sheet brighter
     than the app glares and washes out the warm body ink (doctor, round 1:
     "note sheet is too bright, can't read the text"). The note is the primary
     plane by SIZE and position, not by being the brightest — it's a clean warm
     sheet, one gentle step up from the desk, never a spotlight. */
  --nev2-surface-0: #CDC1AC;   /* recessed wells / settled history — shadowed paper */
  --nev2-surface-1: #F1EADE;   /* note column + finalize bar — clean warm sheet     */
  --nev2-surface-2: #D9CEBC;   /* context columns / tapestry board — the desk       */
  --nev2-surface-3: #ECE5D9;   /* card base                                         */
  --nev2-surface-4: #F2EBDF;   /* raised plane low — masthead paper                 */
  --nev2-surface-5: #F7F1E7;   /* raised plane high / identity strip                */
}

/* Two v2 surfaces paint from RAW dark literals, bypassing the ramp — the
   adapter and the ramp remap above both miss them. Re-paper both. */

/* Today's Update input surface — was linear-gradient(#211510, #170E09). */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev-living-update {
  background: linear-gradient(170deg, #EEE7DB, #E4DBCC);
}

/* Takeover header masthead — was linear-gradient(surface-5, #130D08); the raw
   dark endpoint survives even after the ramp remap. Same masthead gradient the
   tapestry header uses. */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev-takeover-header {
  background: linear-gradient(180deg, #F1EBE0, #E9E2D6);
  border-bottom: 2px solid rgba(74, 58, 45, 0.5);
}

/* ── Base-note READING INK: --dr-fg-body / --dr-fg-muted (adapter gap) ──────
   The A&P-prose "cream on parchment" bug: consumers (.nev-base-note-doc etc.)
   reference --dr-fg-body/--dr-fg-muted, which the generated roast-ladder.css
   never emits, so both fall to dark-theme literals (#E8E0D6 / #8E8074) —
   cream-on-cream on the note sheet. Now ported into the canonical role system
   (dark-roast-theme@cdf470a: roles body→bone, muted→mocha + build-tokens fg
   loop; dark-roast-tokens.css carries the base def). This companion override
   defines them for the census cascade until roast-ladder.css is regenerated
   from a full re-vendor — using the SAME canonical primitives, so under Cold
   Brew --dr-bone/--dr-mocha recolor them dark automatically. */
:root[data-roast-theme="cold-brew"] {
  --dr-fg-body: var(--dr-bone);    /* #50453C on Cold Brew — workhorse reading ink */
  --dr-fg-muted: var(--dr-mocha);  /* #625445 on Cold Brew — readable muted */
}

/* .nev-base-note itself is color: var(--rail-note-fg, #fff); the takeover is
   NOT a .note-rail, so that token is undefined here and the white fallback
   wins. Pin it to the base-note reading ink, scoped to the takeover so the
   real note rail keeps its own (already-fixed) value. */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover {
  --rail-note-fg: #29201A;
}

/* ═══════════════════════════════════════════════════════════════════════════
   COLD BREW — DEPTH & HIERARCHY (doctor, round 3: "readable, but no depth /
   hierarchy vs Dark Roast")
   Dark Roast carries depth in OLED glows + near-black shadow wells; on paper
   those render as nothing and the takeover collapses to one flat tone. Rebuild
   depth the way paper actually does it:
     • warm espresso-ink UMBRA shadows (not black) for lift
     • a widened tonal ramp (done above) so plane / card / well truly separate
     • decisive warm SEAMS at structural divisions
     • manila folder-tab BANDS for group headers (strongest hierarchy cue)
     • ONE primary sheet; problems are cards ON it; the open card lifts most
   Scoped to #noteEvolutionTakeover so the flag-off / dark faces stay identical.
   ═══════════════════════════════════════════════════════════════════════════ */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover {
  --nev-umbra-sheet: 0 1px 3px rgba(48, 38, 30, 0.16), 0 16px 40px -10px rgba(48, 38, 30, 0.22);
  --nev-umbra-card:  0 1px 2px rgba(48, 38, 30, 0.13), 0 6px 18px -5px rgba(48, 38, 30, 0.20);
  --nev-umbra-lift:  0 3px 8px rgba(48, 38, 30, 0.22), 0 18px 40px -12px rgba(48, 38, 30, 0.28);
  --nev-seam: rgba(74, 58, 45, 0.48);
  --nev-seam-strong: rgba(63, 50, 39, 0.72);
}

/* The note pane is the DESK — it holds a stack of problem cards, so it recedes;
   the cards lift off it. Cut from the context rail by a decisive seam. */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev-column[data-column="right"] {
  background: #D4C8B4;
  border-left: 1px solid var(--nev-seam-strong);
  box-shadow: -12px 0 28px -18px rgba(48, 38, 30, 0.38);
}

/* Each A&P problem = a card lifted off the desk: bright warm sheet-face, a paper
   edge that catches light (top-inset sheen), hairline seam, warm umbra below.
   The value spread desk(#D4C8B4)→card(#F8F3EA) does the depth work paper can. */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover .nev-bn-problem-body,
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-section {
  background: #F8F3EA;
  border: 1px solid var(--nev-seam);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 253, 248, 0.7), var(--nev-umbra-card);
}

/* The lit / open / proposed card lifts most — the one card in focus. */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-section.is-lit,
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-section[data-state="proposed"] {
  background: #FDFAF3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 252, 0.8), var(--nev-umbra-lift);
}

/* Problem TITLE: near-black, decisive — the reading eye lands here first. */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover .nev-bn-problem-title,
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-section-title {
  color: #211812;
}

/* Group / course headers → manila folder-tab bands, same cue as the tapestry:
   warm dark band, cream small-caps. The single strongest hierarchy signal.
   Reserved for true GROUP headers — NOT the status strip below. */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover .nev-bhc-review-eyebrow,
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover .nev-bn-group-header {
  background: linear-gradient(180deg, #5E4B3A, #503F30);
  color: #F4EEE3;
  border-radius: 3px 3px 0 0;
  box-shadow: 0 2px 6px -2px rgba(48, 38, 30, 0.30);
}

/* Note status strip (PRIOR NOTE → TODAY · accepted/rejected/pending) is chrome,
   not a group header — a light masthead with a decisive seam, dark ink kept. */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-note-head {
  background: linear-gradient(180deg, #EFE8DC, #E6DDCE);
  border-bottom: 2px solid var(--nev-seam-strong);
}

/* The base-note document is the sheet: lift it off the plane with a real umbra
   and a clean warm face, so the note reads as one lifted page. */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover .nev-base-note-doc {
  background: var(--nev2-surface-1, #EFE8DC);
  box-shadow: var(--nev-umbra-sheet);
  border: 1px solid var(--nev-seam);
  border-radius: 5px;
}

/* Settled-history / empty wells recess into the desk — inset shadow, darker
   paper, quiet ink. Depth reads both up (cards) and down (wells). */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover .nev-problem-band-note-empty,
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-note-foot {
  background: var(--nev2-surface-0, #D2C7B5);
  box-shadow: inset 0 1px 4px rgba(48, 38, 30, 0.14);
  border-radius: 3px;
}

/* ── LEFT CONTEXT RAIL — same card language as the note pane, pushed further ──
   (doctor, round 4: "same card treatment left rail, if not more"). The rail is
   the deepest desk in the workspace; its contents — Today's Update, the open-
   loop ledger — lift off it as bright filed cards. Context should read as a
   physical tray of cards beside the working sheet. */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev-column[data-column="left"] {
  background: #D4C8B4;
  border-right: 1px solid var(--nev-seam-strong);
}

/* Today's Update — a lifted input card (was a black-shadowed dark gradient). */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev-living-update {
  background: linear-gradient(170deg, #F8F3EA, #F1EADE);
  border: 1px solid var(--nev-seam);
  border-radius: 5px;
  box-shadow: inset 0 1px 0 rgba(255, 253, 248, 0.7), var(--nev-umbra-card);
}

/* Open-loop ledger = a recessed tray sunk into the rail; its rows lift out. */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-open-loops {
  background: var(--nev2-surface-0, #CDC1AC);
  border: 1px solid var(--nev-seam);
  border-radius: 5px;
  box-shadow: inset 0 2px 8px rgba(48, 38, 30, 0.16);
}

/* "OPEN LOOPS" header → small manila folder-tab band. */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-ol-head {
  background: linear-gradient(180deg, #5E4B3A, #503F30);
  color: #F4EEE3;
  border-radius: 3px;
}

/* Each open loop = a filed card lifted out of the tray. */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-ol-row {
  background: #F6F0E6;
  border: 1px solid var(--nev-seam);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 253, 248, 0.6), var(--nev-umbra-card);
}

/* The lit loop lifts most — the one the doctor is acting on. */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-ol-row.is-lit {
  background: #FDFAF3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 252, 0.8), var(--nev-umbra-lift);
}

/* Zebra on even rows fought the card faces — neutralize it under Cold Brew. */
:root[data-roast-theme="cold-brew"] #noteEvolutionTakeover[data-nev-v2] .nev2-ol-row:nth-child(even):not(.is-lit) {
  background: #F6F0E6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CENSUS LIST — designed Cold Brew face (2026-07-17 design pass)
   The patient-list sidebar never got the "paper instrument on a desk" grammar
   the tapestry + takeover did — it still rendered the dark terminal recipe on
   parchment: cards SUNK into the canvas (#D5CABB on #E2DBD0, both mid-tone),
   carried a BLACK shadow (muddy on paper — umbra is espresso-ink, low alpha),
   and glowed OLED teal on hover. Same failures the takeover pass fixed.

   Grammar (matches the takeover):
     • canvas recedes; CARDS LIFT as bright warm sheets off it
     • depth = warm espresso UMBRA (never black) + a top-inset paper sheen
     • severity = a soft tonal WASH + an inked room pill (not a hard neon bar)
     • chips (room / diagnosis / day) = light filed paper, not recessed dark
     • selection = the ONE decisive dark fill on the sheet (tapestry's rule)
   Scoped to [data-roast-theme=cold-brew] .sol-sidebar so flag-off / dark faces
   stay byte-identical.
   ═══════════════════════════════════════════════════════════════════════════ */

:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] {
  /* Local umbra ladder for the list (espresso ink, low alpha). */
  --cb-umbra-card: 0 1px 2px rgba(48, 38, 30, 0.14), 0 5px 14px -4px rgba(48, 38, 30, 0.16);
  --cb-umbra-lift: 0 3px 7px rgba(48, 38, 30, 0.20), 0 14px 30px -12px rgba(48, 38, 30, 0.24);
  --cb-seam: rgba(120, 93, 71, 0.38);
  --cb-seam-soft: rgba(120, 93, 71, 0.22);
  --cb-sheen: inset 0 1px 0 rgba(255, 253, 248, 0.65);
  /* Canvas recedes a touch so the bright cards read as lifted sheets. */
  background: #DBD2C3;
  border-right-color: var(--cb-seam);
}

/* Collapsed strip: warm seam instead of the teal glow-edge. */
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"].collapsed {
  border-right: 2px solid var(--cb-seam);
  box-shadow: none;
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"].collapsed:hover {
  border-right-color: #4A3A2D;
  box-shadow: inset -6px 0 18px -10px rgba(48, 38, 30, 0.30);
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"].hover-peek {
  box-shadow: 18px 0 40px -12px rgba(48, 38, 30, 0.40);
  border-right-color: var(--cb-seam);
}

/* Sidebar masthead + filter bar: quiet paper, decisive bottom seam. */
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-filter-controls {
  background: transparent;
  border-bottom: 1px solid var(--cb-seam-soft);
}

/* Sort select + "Today changed" chip = paper-lift chrome (no neon glow). */
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-input {
  background: #EFE8DC;
  border: 1px solid var(--cb-seam-soft);
  border-bottom: 1px solid var(--cb-seam-soft);
  border-radius: 3px;
  box-shadow: var(--cb-sheen), 0 1px 2px rgba(48, 38, 30, 0.10);
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-input:focus {
  border-color: #4A3A2D;
  box-shadow: var(--cb-sheen), 0 1px 2px rgba(48, 38, 30, 0.14);
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-filter-chip {
  background: #EFE8DC;
  border: 1px solid var(--cb-seam-soft);
  border-radius: 3px;
  color: #5C4B3B;
  box-shadow: var(--cb-sheen), 0 1px 2px rgba(48, 38, 30, 0.08);
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-filter-chip:hover,
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-filter-chip[aria-pressed="true"] {
  background: #4A3A2D;
  border-color: #4A3A2D;
  color: #F2ECE1;
  box-shadow: 0 1px 3px rgba(48, 38, 30, 0.20);
}

/* ── Patient cards: LIFTED bright sheets off the receded canvas ────────────
   The single biggest fix: cards go BRIGHTER than the canvas with warm umbra,
   replacing the sunken mid-tone + black shadow. Radius softened to read as
   paper; the L-bracket corners (dark-theme ornament) are dropped. */
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card {
  background: #F1EAE0;
  border: 1px solid var(--cb-seam-soft);
  border-radius: 5px;
  box-shadow: var(--cb-sheen), var(--cb-umbra-card);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card::before,
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card::after {
  content: none; /* drop the dark-theme L-bracket ornament + radial glow overlay */
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card:hover {
  transform: translateY(-1px);
  background: #F6F1E8;
  border-color: var(--cb-seam);
  box-shadow: var(--cb-sheen), var(--cb-umbra-lift);
}

/* Severity = soft tonal wash (preserved hue) + the left seam stays as a thin
   inked edge. Clinical color meaning is unchanged — only the surface treatment. */
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.critical,
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card--critical,
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.high,
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card--high {
  background: linear-gradient(180deg, #F5E3DF, #F1DDD8);
  border-left: 3px solid var(--term-status-critical);
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.worsening,
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card--worsening,
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.moderate {
  background: linear-gradient(180deg, #F4E3EC, #F0DCE6);
  border-left: 3px solid var(--term-status-worsening);
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.stable,
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card--stable {
  background: linear-gradient(180deg, #ECEDDD, #E7E9D6);
  border-left: 3px solid var(--term-status-stable);
}

/* Selected = the ONE decisive dark element on the sheet (tapestry's rule).
   Replaces the teal glow + dashed-into-solid border. Dark fill, cream ink. */
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.selected {
  background: #3A2E24;
  background-image: none;
  border: 1px solid #2A2018;
  border-left: 3px solid var(--term-accent);
  box-shadow: 0 4px 10px rgba(48, 38, 30, 0.28), 0 14px 30px -12px rgba(48, 38, 30, 0.30);
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.selected .sol-card-name {
  color: #F5EFE5;
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.selected .sol-card-meta,
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.selected .sol-card-room {
  color: #D8CCB9;
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.selected .sol-card-room {
  background: rgba(245, 239, 229, 0.10);
  border-color: rgba(245, 239, 229, 0.28);
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.selected .sol-diagnosis,
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.selected .sol-hospital-day-pill {
  background: rgba(245, 239, 229, 0.10);
  border-color: rgba(245, 239, 229, 0.24);
  color: #D8CCB9;
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.selected:focus-visible {
  outline-color: var(--term-accent);
}

/* Chips: light filed paper — recessed-dark chips (#BBA994) read as holes in
   the card. Room pill keeps its severity INK (the clinical cue) on a light face. */
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card .sol-card-room {
  background: #FBF7F0;
  border: 1px solid var(--cb-seam-soft);
  border-radius: 3px;
  box-shadow: 0 1px 1px rgba(48, 38, 30, 0.08);
  color: #4A3A2D;
}
/* Severity room-pill ink (kept saturated — the one place hue lives on a card). */
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.critical .sol-card-room,
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card--critical .sol-card-room,
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.high .sol-card-room,
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card--high .sol-card-room {
  color: var(--term-status-critical);
  border-color: rgba(207, 88, 88, 0.45);
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.worsening .sol-card-room,
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card--worsening .sol-card-room {
  color: var(--term-status-worsening);
  border-color: rgba(141, 0, 87, 0.35);
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card.stable .sol-card-room,
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-patient-card--stable .sol-card-room {
  color: var(--term-status-stable);
  border-color: rgba(64, 94, 0, 0.35);
}

:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-diagnosis,
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-hospital-day-pill {
  background: #F6F0E6;
  border: 1px solid var(--cb-seam-soft);
  border-radius: 3px;
  color: #5C4B3B;
}

/* Meta text: the green --term-fg-muted reads as a status hue on paper; re-ink
   to warm-mid so the census secondary line stops looking "all-ok". */
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-card-meta {
  color: #6E5B49;
}

/* Worsening / pending pills on cards: keep hue, soften to a light chip. */
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-pill--worsening {
  background: rgba(141, 0, 87, 0.10);
  border-color: rgba(141, 0, 87, 0.35);
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-pill--pending {
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.30);
  color: #1D4ED8;
}

/* Signal badge: teal-on-paper accent, softened to a light chip (was neon ghost). */
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-signal-badge {
  background: rgba(0, 93, 92, 0.08);
  border-color: rgba(0, 93, 92, 0.28);
  color: var(--term-accent);
}

/* Add / Prep buttons: paper-lift chrome, dark hover (no teal glow). */
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-add-patient-btn {
  background: #EFE8DC;
  border: 1px solid var(--cb-seam-soft);
  border-radius: 3px;
  color: #5C4B3B;
  box-shadow: var(--cb-sheen), 0 1px 2px rgba(48, 38, 30, 0.08);
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-add-patient-btn:hover {
  background: #4A3A2D;
  border-color: #4A3A2D;
  color: #F2ECE1;
  box-shadow: 0 1px 3px rgba(48, 38, 30, 0.20);
}

/* Card dropdown menu: paper, warm umbra (was hard black). */
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-card-dropdown {
  background: #F4EEE3;
  border: 1px solid var(--cb-seam);
  border-radius: 4px;
  box-shadow: 0 6px 20px -4px rgba(48, 38, 30, 0.30);
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-dropdown-item {
  color: #5C4B3B;
  border-bottom-color: var(--cb-seam-soft);
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-dropdown-item:hover {
  background: rgba(74, 58, 45, 0.10);
  color: #342920;
}
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-dropdown-item--danger:hover {
  background: rgba(207, 88, 88, 0.12);
  color: var(--term-status-critical);
}

/* Loading skeleton: warm shimmer on the paper ladder. */
:root[data-roast-theme="cold-brew"] .sol-sidebar[data-theme="terminal"] .sol-skeleton-card {
  background: linear-gradient(90deg, #E6DDCE 0%, #F1EAE0 50%, #E6DDCE 100%);
  background-size: 200% 100%;
  border: 1px solid var(--cb-seam-soft);
  border-radius: 5px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GLOBAL CHROME — Cold Brew pass (2026-07-17 sweep)
   The census-list pass proved the recipe; the same "muddy box on parchment"
   failure is systemic across the app's chrome. Every surface below shipped the
   dark-terminal recipe onto the light canvas:
     • BLACK shadows (rgba(0,0,0,…)) — mud on paper; umbra is espresso ink
     • NEON glows (teal rgba(0,255,208,…), blue rgba(59,130,246,…)) — OLED grammar
     • surface-on-surface mid-tones (#D5CABB on #E2DBD0) — zero depth hierarchy
     • saturated mid-teal --term-accent (#005D5C) glows — low contrast on paper
   Shared tokens, then per-surface overrides. All scoped to cold-brew so the
   dark faces + flag-off stay byte-identical.
   ═══════════════════════════════════════════════════════════════════════════ */

:root[data-roast-theme="cold-brew"] {
  /* Espresso-ink umbra ladder (shared across all chrome). */
  --cb-u1: 0 1px 2px rgba(48, 38, 30, 0.14), 0 4px 12px -3px rgba(48, 38, 30, 0.14);
  --cb-u2: 0 2px 6px rgba(48, 38, 30, 0.18), 0 12px 28px -10px rgba(48, 38, 30, 0.22);
  --cb-u3: 0 6px 16px rgba(48, 38, 30, 0.24), 0 24px 48px -16px rgba(48, 38, 30, 0.28);
  --cb-well: inset 0 2px 6px rgba(48, 38, 30, 0.12);
  --cb-sheen2: inset 0 1px 0 rgba(255, 253, 248, 0.6);
  --cb-edge: rgba(120, 93, 71, 0.35);
  --cb-edge-soft: rgba(120, 93, 71, 0.20);
  --cb-paper-hi: #F6F1E8;   /* brightest card sheet */
  --cb-paper: #F1EAE0;      /* standard card sheet */
  --cb-paper-lo: #E9E1D5;   /* recessed / header band */
  --cb-ink: #342920;        /* primary reading ink */
  --cb-ink-2: #5C4B3B;      /* secondary ink */
  --cb-ink-3: #6E5B49;      /* muted warm ink (replaces status-green chrome) */
  --cb-dark: #3A2E24;       /* the ONE decisive dark element (active/selected) */
  --cb-dark-ink: #F2ECE1;
}

/* ── TOP NAV ───────────────────────────────────────────────────────────────
   Bar sat on the canvas tone with a hard dark bottom border + neon tabs. Make
   it a quiet masthead: one step lighter than canvas, a decisive warm seam, and
   tabs that read as paper chrome with a dark active state. */
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] {
  background: #E7DFD2;
  border-bottom: 1px solid var(--cb-edge);
  box-shadow: 0 1px 3px rgba(48, 38, 30, 0.10);
}
:root[data-roast-theme="cold-brew"] .sol-top-nav .sol-nav-tab {
  color: var(--cb-ink-2);
}
:root[data-roast-theme="cold-brew"] .sol-top-nav .sol-nav-tab:hover {
  background: rgba(74, 58, 45, 0.08);
  color: var(--cb-ink);
}
:root[data-roast-theme="cold-brew"] .sol-top-nav .sol-nav-tab.active {
  background: var(--cb-dark);
  color: var(--cb-dark-ink);
  box-shadow: 0 1px 3px rgba(48, 38, 30, 0.20);
}

/* ── PATIENT HEADER ────────────────────────────────────────────────────────
   Every interactive element glowed --term-accent teal. On paper, hover/active
   becomes paper-lift + a dark decisive state; the identity block becomes a
   clean masthead sheet. Glow box-shadows are stripped throughout. */
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] {
  background: var(--cb-paper-lo) !important;
  border: 1px solid var(--cb-edge) !important;
  border-radius: 6px !important;
  box-shadow: var(--cb-sheen2), var(--cb-u1) !important;
}
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"]::after {
  content: none; /* drop the L-bracket ornament */
}
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] .sol-patient-avatar {
  background: var(--cb-paper) !important;
  border: 1px solid var(--cb-edge);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u1) !important;
}
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] .sol-patient-avatar:hover {
  border-color: var(--cb-dark);
  box-shadow: var(--cb-sheen2), var(--cb-u2) !important;
}
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] .sol-patient-actions {
  background: var(--cb-paper);
  border: 1px solid var(--cb-edge-soft);
  border-radius: 5px;
  box-shadow: var(--cb-sheen2);
}
/* All header action buttons: paper-lift, dark hover, NO teal glow. */
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] .sol-patient-action-btn,
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] #addNoteBtn,
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] #addClinicalDataBtn,
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] #headerVoiceBtn,
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] #approveProblemsBtn {
  background: var(--cb-paper-hi);
  border: 1px solid var(--cb-edge-soft);
  border-radius: 4px;
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2), 0 1px 2px rgba(48, 38, 30, 0.08);
}
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] .sol-patient-action-btn:hover,
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] #addNoteBtn:hover,
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] #addClinicalDataBtn:hover,
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] #headerVoiceBtn:hover,
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] #approveProblemsBtn:hover {
  background: var(--cb-dark);
  border-color: var(--cb-dark);
  color: var(--cb-dark-ink);
  box-shadow: 0 1px 3px rgba(48, 38, 30, 0.20);
}
/* Primary "Create Note": teal-outline → decisive dark CTA. */
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] #showNotePanelBtn,
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] .sol-patient-action-btn.primary {
  background: var(--cb-dark);
  border: 1px solid #2A2018;
  color: var(--cb-dark-ink);
  box-shadow: 0 2px 5px rgba(48, 38, 30, 0.24), var(--cb-sheen2);
}
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] #showNotePanelBtn span {
  -webkit-text-fill-color: var(--cb-dark-ink);
}
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] #showNotePanelBtn:hover,
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] .sol-patient-action-btn.primary:hover {
  background: #2E2419;
  box-shadow: 0 3px 8px rgba(48, 38, 30, 0.30);
}
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] #showNotePanelBtn:hover span {
  -webkit-text-fill-color: var(--cb-dark-ink);
}
/* Severity badges keep their clinical hue (border + ink) — soften the hover glow. */
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] .sol-severity-badge:hover,
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] .sol-severity-badge[data-severity]:hover {
  box-shadow: 0 1px 3px rgba(48, 38, 30, 0.18);
}
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] .sol-severity-badge .sol-severity-dot {
  box-shadow: none;
}
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] .sol-trajectory-bar {
  background: transparent;
  border-top: 1px solid var(--cb-edge-soft);
}
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] .sol-trajectory-bar::after {
  content: none;
}
:root[data-roast-theme="cold-brew"] .sol-patient-header[data-theme="terminal"] .sol-trajectory-segment:hover {
  background: rgba(74, 58, 45, 0.07);
  border-left-color: var(--cb-dark);
}

/* ── NOTE RAIL (production daily driver) ───────────────────────────────────
   Collapsed edge = blue neon gradient + glow; inputs glow teal on focus; every
   button is an outlined neon chip. Rebuild as a paper side-tray: warm seams,
   paper-lift buttons, a dark primary CTA, and umbra instead of glow. */
:root[data-roast-theme="cold-brew"] .note-rail:not(.expanded) {
  background: linear-gradient(180deg, #E9E1D5 0%, #EFE8DC 100%);
  border-left: 2px solid var(--cb-edge);
  box-shadow: -8px 0 24px -14px rgba(48, 38, 30, 0.30);
}
:root[data-roast-theme="cold-brew"] .note-rail:not(.expanded):hover {
  background: linear-gradient(180deg, #EFE8DC 0%, #F4EEE2 100%);
  border-left-color: var(--cb-dark);
  box-shadow: -10px 0 28px -14px rgba(48, 38, 30, 0.36);
}
:root[data-roast-theme="cold-brew"] .note-rail.expanded {
  border-left-color: var(--cb-edge);
}
/* Rail inputs: recessed paper well (inset), teal focus → warm seam focus. */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] textarea,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] input[type="text"],
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-input,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] #clinicalUpdateInput {
  background: #EDE6D9;
  border: 1px solid var(--cb-edge-soft);
  border-radius: 4px;
  color: var(--cb-ink);
  box-shadow: var(--cb-well);
}
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] textarea:focus,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] input[type="text"]:focus,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] #clinicalUpdateInput:focus {
  border-color: var(--cb-dark);
  outline: none;
  box-shadow: var(--cb-well), 0 0 0 2px rgba(74, 58, 45, 0.20);
}
/* Rail buttons: paper-lift chrome; hover goes dark, not neon. */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] button {
  box-shadow: none;
}
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-type-card,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-type {
  background: var(--cb-paper);
  border: 1px solid var(--cb-edge-soft);
  border-radius: 4px;
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2), 0 1px 2px rgba(48, 38, 30, 0.08);
}
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-btn:hover,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-type-card:hover,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-type:hover {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}
/* Selected note-type / generate CTA = the dark decisive element. */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-type-card.selected,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-type.selected,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-type.active {
  background: var(--cb-dark);
  border-color: var(--cb-dark);
  color: var(--cb-dark-ink);
  box-shadow: 0 2px 6px rgba(48, 38, 30, 0.22);
}
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-generate-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] button[class*="generate"],
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] button[class*="compile"] {
  background: var(--cb-dark);
  border: 1px solid #2A2018;
  color: var(--cb-dark-ink);
  box-shadow: 0 2px 5px rgba(48, 38, 30, 0.24);
}
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-generate-btn:hover,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] button[class*="generate"]:hover {
  background: #2E2419;
  box-shadow: 0 3px 8px rgba(48, 38, 30, 0.30);
}
/* Kill the rail's residual neon/gold glow utilities on the light face. */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] *[style*="box-shadow"],
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-status-pill {
  text-shadow: none;
}

/* ── NOTE RAIL interior components (real classes, from DOM sweep 2026-07-17) ──
   The generic button reset above doesn't reach these — each component carries
   its own background. Recolor per class so the rail reads as one paper tray. */

/* Note-type picker cards: rgba(255,255,255,0.03) is near-invisible on paper —
   a ghost box. Give them a real sheet face + umbra; selected goes dark. */
:root[data-roast-theme="cold-brew"] .note-rail .rail-picker-card {
  background: var(--cb-paper);
  border: 1px solid var(--cb-edge-soft);
  border-radius: 5px;
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}
:root[data-roast-theme="cold-brew"] .note-rail .rail-picker-card:hover {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  box-shadow: var(--cb-sheen2), var(--cb-u2);
}
:root[data-roast-theme="cold-brew"] .note-rail .rail-picker-card.selected,
:root[data-roast-theme="cold-brew"] .note-rail .rail-picker-card.active,
:root[data-roast-theme="cold-brew"] .note-rail .rail-picker-card[aria-pressed="true"] {
  background: var(--cb-dark);
  border-color: var(--cb-dark);
  color: var(--cb-dark-ink);
  box-shadow: 0 2px 6px rgba(48, 38, 30, 0.22);
}

/* Prior-notes filter tabs: active tab sat on a mid recessed tone (#BBA994).
   Tabs become paper chips; the ACTIVE tab is the dark decisive element. */
:root[data-roast-theme="cold-brew"] .note-rail .rail-viewing-filter-tab {
  background: var(--cb-paper);
  border: 1px solid var(--cb-edge-soft);
  border-radius: 3px;
  color: var(--cb-ink-2);
}
:root[data-roast-theme="cold-brew"] .note-rail .rail-viewing-filter-tab:hover {
  background: var(--cb-paper-hi);
  color: var(--cb-ink);
}
:root[data-roast-theme="cold-brew"] .note-rail .rail-viewing-filter-tab.active {
  background: var(--cb-dark);
  border-color: var(--cb-dark);
  color: var(--cb-dark-ink);
}

/* Search / text inputs inside the rail: recessed paper well. */
:root[data-roast-theme="cold-brew"] .note-rail .rail-viewing-search-input,
:root[data-roast-theme="cold-brew"] .note-rail .nev-update-textarea,
:root[data-roast-theme="cold-brew"] .note-rail .nev-hrm-reason,
:root[data-roast-theme="cold-brew"] .note-rail input[type="text"],
:root[data-roast-theme="cold-brew"] .note-rail textarea {
  background: #EDE6D9;
  border: 1px solid var(--cb-edge-soft);
  border-radius: 4px;
  color: var(--cb-ink);
  box-shadow: var(--cb-well);
}
:root[data-roast-theme="cold-brew"] .note-rail input:focus,
:root[data-roast-theme="cold-brew"] .note-rail textarea:focus {
  border-color: var(--cb-dark);
  outline: none;
  box-shadow: var(--cb-well), 0 0 0 2px rgba(74, 58, 45, 0.18);
}

/* Rail header / toggle / ghost buttons: quiet warm ink, paper hover. */
:root[data-roast-theme="cold-brew"] .note-rail .note-rail-toggle,
:root[data-roast-theme="cold-brew"] .note-rail .note-rail-theme-toggle,
:root[data-roast-theme="cold-brew"] .note-rail .rail-viewing-close-btn,
:root[data-roast-theme="cold-brew"] .note-rail .note-rail-offline-retry {
  color: var(--cb-ink-2);
  border-color: var(--cb-edge-soft);
}
:root[data-roast-theme="cold-brew"] .note-rail .note-rail-toggle:hover,
:root[data-roast-theme="cold-brew"] .note-rail .note-rail-theme-toggle:hover,
:root[data-roast-theme="cold-brew"] .note-rail .rail-viewing-close-btn:hover,
:root[data-roast-theme="cold-brew"] .note-rail .note-rail-offline-retry:hover {
  background: var(--cb-paper);
  color: var(--cb-ink);
}

/* Teal action buttons → warm dark CTA (the "one decisive dark element" rule).
   Covers .nev-propose-btn + .sol-action-btn.primary (teal gradient). */
:root[data-roast-theme="cold-brew"] .note-rail .nev-propose-btn,
:root[data-roast-theme="cold-brew"] .note-rail .sol-action-btn.primary,
:root[data-roast-theme="cold-brew"] .note-rail .rail-retry-btn {
  background: var(--cb-dark);
  background-image: none;
  border: 1px solid #2A2018;
  color: var(--cb-dark-ink);
  box-shadow: 0 2px 5px rgba(48, 38, 30, 0.24), var(--cb-sheen2);
}
:root[data-roast-theme="cold-brew"] .note-rail .nev-propose-btn:hover,
:root[data-roast-theme="cold-brew"] .note-rail .sol-action-btn.primary:hover,
:root[data-roast-theme="cold-brew"] .note-rail .rail-retry-btn:hover {
  background: #2E2419;
  box-shadow: 0 3px 8px rgba(48, 38, 30, 0.30);
}

/* Secondary / ghost rail actions: paper chips, dark hover. */
:root[data-roast-theme="cold-brew"] .note-rail .nev-cancel-btn,
:root[data-roast-theme="cold-brew"] .note-rail .sol-action-btn.ghost,
:root[data-roast-theme="cold-brew"] .note-rail .sol-action-btn.sign-finalize,
:root[data-roast-theme="cold-brew"] .note-rail .nev-hrm-change-target,
:root[data-roast-theme="cold-brew"] .note-rail .nev-hrm-cancel {
  background: var(--cb-paper);
  border: 1px solid var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2), 0 1px 2px rgba(48, 38, 30, 0.08);
}
:root[data-roast-theme="cold-brew"] .note-rail .nev-cancel-btn:hover,
:root[data-roast-theme="cold-brew"] .note-rail .sol-action-btn.ghost:hover,
:root[data-roast-theme="cold-brew"] .note-rail .sol-action-btn.sign-finalize:hover,
:root[data-roast-theme="cold-brew"] .note-rail .nev-hrm-change-target:hover,
:root[data-roast-theme="cold-brew"] .note-rail .nev-hrm-cancel:hover {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  color: var(--cb-ink);
}

/* High-risk accept keeps its warning hue but reads as a light chip, not neon. */
:root[data-roast-theme="cold-brew"] .note-rail .nev-hrm-accept {
  background: rgba(138, 82, 0, 0.12);
  border: 1px solid rgba(138, 82, 0, 0.40);
  color: #8A5200;
}

/* ── NOTE READING SURFACE (.nev-base-note) — the daily-driver note body ────
   THE core muddy box: --dr-obsidian → a mid parchment tone under Cold Brew,
   with a hard BLACK inset shadow (rgba(0,0,0,0.55)) = a dark well the note
   text sits in. The note is the primary reading surface — it must be the
   brightest, cleanest sheet on the desk with a warm umbra, not a sunken well. */
:root[data-roast-theme="cold-brew"] .nev-base-note,
:root[data-roast-theme="cold-brew"] .nev-right-shell .nev-base-note {
  background: var(--cb-paper-hi);
  border: 1px solid var(--cb-edge);
  border-radius: 5px;
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}
:root[data-roast-theme="cold-brew"] .nev-base-note-doc,
:root[data-roast-theme="cold-brew"] .nev-right-shell .nev-base-note-doc {
  background: var(--cb-paper-hi);
  border: 1px solid var(--cb-edge-soft);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}
/* Amendment hover glow halos → warm outline, no neon halo. */
:root[data-roast-theme="cold-brew"] .nev-amendment:hover {
  box-shadow: 0 0 0 1px currentColor;
}
:root[data-roast-theme="cold-brew"] .nev-amendment.nev-text-focus {
  outline-color: #8A5200;
  box-shadow: 0 0 0 2px rgba(138, 82, 0, 0.25);
}

/* ── ALERTS view cards ─────────────────────────────────────────────────────
   .sol-alert-item sat on --sol-bg-tertiary (mid-tone) with a colored left bar
   and no real lift — flat mud rows. Lift as paper sheets with a warm umbra and
   keep the clinical severity hue on the edge + type label. */
:root[data-roast-theme="cold-brew"] .sol-alert-item {
  background: var(--cb-paper);
  border: 1px solid var(--cb-edge-soft);
  border-left: 3px solid var(--term-status-critical);
  border-radius: 5px;
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}
:root[data-roast-theme="cold-brew"] .sol-alert-item.warning {
  border-left-color: var(--term-status-worsening);
}
:root[data-roast-theme="cold-brew"] .sol-alert-item.info {
  border-left-color: var(--term-accent);
}
:root[data-roast-theme="cold-brew"] .sol-alert-item:hover {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  box-shadow: var(--cb-sheen2), var(--cb-u2);
}
:root[data-roast-theme="cold-brew"] .sol-alert-patient {
  color: var(--cb-ink);
}
:root[data-roast-theme="cold-brew"] .sol-alert-message {
  color: var(--cb-ink-2);
}
:root[data-roast-theme="cold-brew"] .sol-alert-time {
  color: var(--cb-ink-3);
}

/* ── TOP NAV neon-glow neutralization ──────────────────────────────────────
   The terminal header carries mint text-shadows + glows everywhere (logo mark,
   section links, status chip, EKG, transfer badge). On parchment these read as
   fuzzy dark-teal smears. Strip the glows, keep the warm ink + a decisive seam
   for the active section. */
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-logo-mark,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-logo-text,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-logo-accent,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-status-text,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-section-prefix,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-section-link,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-nav-tab,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-quick-action-btn,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-voice-btn,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-settings-btn {
  text-shadow: none;
}
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-section-link--active,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-section-link.sol-section-link--active {
  color: var(--cb-ink);
  border-bottom-color: var(--cb-dark);
  text-shadow: none;
}
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-logo-mark,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-logo-accent {
  color: var(--cb-dark);
}
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-section-prefix {
  color: var(--cb-dark);
  text-shadow: none;
}
/* Status chip + EKG: quiet warm chrome; the green EKG stroke stays (clinical). */
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-nav-status-chip {
  box-shadow: none;
  border-color: var(--cb-edge-soft);
}
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-status-text {
  color: var(--cb-ink-2);
}
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-transfer-badge {
  box-shadow: none;
}
/* Nav icon buttons (search / refresh / settings / voice): paper-lift, dark hover. */
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-search-box input,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-refresh-btn,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-settings-btn,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-voice-btn,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-quick-action-btn {
  background: var(--cb-paper);
  border: 1px solid var(--cb-edge-soft);
  border-radius: 4px;
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2), 0 1px 2px rgba(48, 38, 30, 0.08);
}
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-refresh-btn:hover,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-settings-btn:hover,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-voice-btn:hover,
:root[data-roast-theme="cold-brew"] .sol-top-nav[data-theme="terminal"] .sol-quick-action-btn:hover {
  background: var(--cb-dark);
  border-color: var(--cb-dark);
  color: var(--cb-dark-ink);
  box-shadow: 0 1px 3px rgba(48, 38, 30, 0.20);
}

/* ── TOAST NOTIFICATIONS ───────────────────────────────────────────────────
   --sol-bg-elevated + a hard black shadow = a floating mud box. Toasts become
   bright lifted sheets with warm umbra; the severity edge hue is kept. */
:root[data-roast-theme="cold-brew"] .sol-toast,
:root[data-roast-theme="cold-brew"] .census-toast,
:root[data-roast-theme="cold-brew"] .sol-toast-container .sol-toast {
  background: var(--cb-paper-hi);
  border: 1px solid var(--cb-edge);
  border-radius: 6px;
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u3);
}
:root[data-roast-theme="cold-brew"] .sol-toast.success,
:root[data-roast-theme="cold-brew"] .census-toast.success {
  border-left: 3px solid var(--term-status-stable);
}
:root[data-roast-theme="cold-brew"] .sol-toast.error,
:root[data-roast-theme="cold-brew"] .census-toast.error {
  border-left: 3px solid var(--term-status-critical);
}
:root[data-roast-theme="cold-brew"] .sol-toast.warning,
:root[data-roast-theme="cold-brew"] .census-toast.warning {
  border-left: 3px solid var(--term-status-worsening);
}
:root[data-roast-theme="cold-brew"] .sol-toast.info,
:root[data-roast-theme="cold-brew"] .census-toast.info {
  border-left: 3px solid var(--term-accent);
}
:root[data-roast-theme="cold-brew"] .sol-toast-message,
:root[data-roast-theme="cold-brew"] .census-toast-message {
  color: var(--cb-ink);
}
:root[data-roast-theme="cold-brew"] .sol-toast-close,
:root[data-roast-theme="cold-brew"] .census-toast-close {
  color: var(--cb-ink-2);
}
:root[data-roast-theme="cold-brew"] .sol-toast-close:hover,
:root[data-roast-theme="cold-brew"] .census-toast-close:hover {
  background: rgba(74, 58, 45, 0.10);
  color: var(--cb-ink);
}

/* ── DROPDOWN MENUS (user menu, voice mode, quick-gen, header notes) ───────
   Every floating menu carried a hard black shadow (rgba(0,0,0,0.4)) and a dark
   surface. Menus become bright sheets with warm umbra. */
:root[data-roast-theme="cold-brew"] .user-menu-dropdown,
:root[data-roast-theme="cold-brew"] .voice-mode-menu,
:root[data-roast-theme="cold-brew"] .sol-quickgen-menu,
:root[data-roast-theme="cold-brew"] .dropdown-menu,
:root[data-roast-theme="cold-brew"] .sol-user-menu .dropdown-menu {
  background: var(--cb-paper-hi);
  border: 1px solid var(--cb-edge);
  border-radius: 6px;
  box-shadow: var(--cb-sheen2), var(--cb-u3);
}
:root[data-roast-theme="cold-brew"] .user-menu-dropdown .dropdown-item,
:root[data-roast-theme="cold-brew"] .voice-mode-menu button,
:root[data-roast-theme="cold-brew"] .sol-quickgen-menu button,
:root[data-roast-theme="cold-brew"] .dropdown-menu .dropdown-item,
:root[data-roast-theme="cold-brew"] .dropdown-menu a,
:root[data-roast-theme="cold-brew"] .dropdown-menu button {
  color: var(--cb-ink-2);
}
:root[data-roast-theme="cold-brew"] .user-menu-dropdown .dropdown-item:hover,
:root[data-roast-theme="cold-brew"] .voice-mode-menu button:hover,
:root[data-roast-theme="cold-brew"] .sol-quickgen-menu button:hover,
:root[data-roast-theme="cold-brew"] .dropdown-menu .dropdown-item:hover,
:root[data-roast-theme="cold-brew"] .dropdown-menu a:hover,
:root[data-roast-theme="cold-brew"] .dropdown-menu button:hover {
  background: rgba(74, 58, 45, 0.08);
  color: var(--cb-ink);
}

/* ── MODALS / DIALOGS ──────────────────────────────────────────────────────
   Overlay was rgba(0,0,0,.7) (void); content sat on --sol-bg-secondary (mid)
   with a black shadow. Overlay → warm espresso veil; content → bright sheet. */
:root[data-roast-theme="cold-brew"] .sol-modal-overlay {
  background: rgba(58, 46, 36, 0.45);
  backdrop-filter: blur(3px);
}
:root[data-roast-theme="cold-brew"] .sol-modal-content,
:root[data-roast-theme="cold-brew"] .sol-modal,
:root[data-roast-theme="cold-brew"] [role="dialog"] {
  background: var(--cb-paper-hi);
  border: 1px solid var(--cb-edge);
  box-shadow: var(--cb-sheen2), var(--cb-u3);
}
:root[data-roast-theme="cold-brew"] .sol-modal-header {
  border-bottom: 1px solid var(--cb-edge-soft);
}
:root[data-roast-theme="cold-brew"] .sol-modal-footer {
  border-top: 1px solid var(--cb-edge-soft);
}
:root[data-roast-theme="cold-brew"] .sol-modal-btn.secondary {
  background: var(--cb-paper);
  border: 1px solid var(--cb-edge-soft);
  color: var(--cb-ink-2);
}
:root[data-roast-theme="cold-brew"] .sol-modal-btn.secondary:hover {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  color: var(--cb-ink);
}

/* ── CENSUS EMPTY STATE ────────────────────────────────────────────────────
   Dark radial-glow card + ghost slate text on the light canvas. Rebuild as a
   single lifted sheet with warm ink (indigo accents kept, deepened for paper). */
:root[data-roast-theme="cold-brew"] .sol-empty-card {
  background: var(--cb-paper-hi);
  border: 1px solid var(--cb-edge);
  border-radius: 10px;
  box-shadow: var(--cb-sheen2), var(--cb-u2);
  backdrop-filter: none;
}
:root[data-roast-theme="cold-brew"] .sol-empty-state h3 {
  color: var(--cb-ink);
}
:root[data-roast-theme="cold-brew"] .sol-empty-lede {
  color: var(--cb-ink-2);
}
:root[data-roast-theme="cold-brew"] .sol-empty-icon {
  color: var(--cb-ink-3);
  opacity: 0.7;
}

/* ── GENERIC PANELS / SECTION CARDS in the detail column ───────────────────
   Any .sol-card / panel body still on a mid-tone with a black shadow gets the
   same lifted-sheet treatment so the detail column stops reading as flat mud. */
:root[data-roast-theme="cold-brew"] .sol-card,
:root[data-roast-theme="cold-brew"] .sol-panel,
:root[data-roast-theme="cold-brew"] .sol-detail-section,
:root[data-roast-theme="cold-brew"] .sol-panel-content {
  background: var(--cb-paper);
  border-color: var(--cb-edge-soft);
}
:root[data-roast-theme="cold-brew"] .sol-card,
:root[data-roast-theme="cold-brew"] .sol-panel {
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}
:root[data-roast-theme="cold-brew"] .sol-panel-header {
  border-bottom-color: var(--cb-edge-soft);
}

/* ── HINT POPUPS / FLOATING CHROME ───────────────────────────────────────── */
:root[data-roast-theme="cold-brew"] .sol-hint-popup {
  background: var(--cb-paper-hi);
  border: 1px solid var(--cb-edge);
  box-shadow: var(--cb-sheen2), var(--cb-u2);
}

/* ── SCROLLBARS in the light app (thin warm thumb, not neon) ─────────────── */
:root[data-roast-theme="cold-brew"] *::-webkit-scrollbar-thumb {
  background: rgba(120, 93, 71, 0.40);
  border-radius: 4px;
}
:root[data-roast-theme="cold-brew"] *::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 93, 71, 0.60);
}
:root[data-roast-theme="cold-brew"] *::-webkit-scrollbar-track {
  background: transparent;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NOTE RAIL — complete Cold Brew stage contract (2026-07-19)
   The first light pass covered the picker and a handful of shared controls,
   but later stages were authored by separate terminal-era sheets loaded after
   this file. Saved Notes therefore reopened a #0f1219 preview well, Review
   reopened an rgba(0,0,0,.3) editor well, and working states restored blue /
   teal OLED glows. Census now loads this hand-authored sheet last; this final
   rail layer supplies the light-polarity surface contract for every stage.

   Scope is deliberately exact: Cold Brew + terminal note rail. Black Label,
   House Blend, flag-off markup, clinical status hues, and rail behavior are
   unchanged. Light grammar: paper planes, warm seams, espresso umbra, one
   decisive espresso active/CTA state, and semantic color as ink/edge only.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Local token bridge. Some rail components consume terminal tokens, others
   SOL tokens, and older stages still carry literal dark fallbacks. Re-emitting
   both token families here gives the entire subtree one coherent polarity. */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] {
  box-sizing: border-box;
  --rail-bg: var(--cb-paper-lo);
  --rail-bg-header: var(--cb-paper);
  --rail-input-bg: #EDE6D9;
  --rail-border: var(--cb-edge);
  --rail-muted: var(--cb-ink-3);
  --rail-note-fg: var(--cb-ink);

  --term-bg-void: var(--cb-paper-lo);
  --term-bg-header: var(--cb-paper);
  --term-bg-surface: var(--cb-paper-hi);
  --term-bg-elevated: var(--cb-paper-hi);
  --term-bg-input: #EDE6D9;
  --term-fg-primary: var(--cb-ink);
  --term-fg-secondary: var(--cb-ink-2);
  --term-fg-tertiary: var(--cb-ink-3);
  --term-fg-muted: var(--cb-ink-3);
  --term-border-subtle: var(--cb-edge-soft);
  --term-border-default: var(--cb-edge);
  --term-border-strong: rgba(120, 93, 71, 0.58);
  --term-shadow-card: var(--cb-u1);
  --term-shadow-card-hover: var(--cb-u2);
  --term-shadow-modal: var(--cb-u3);
  --term-glow-accent: var(--cb-u1);
  --term-glow-accent-intense: var(--cb-u2);
  --term-glow-blue: none;
  --term-glow-gold: var(--cb-u1);

  --sol-bg-primary: var(--cb-paper-lo);
  --sol-bg-secondary: var(--cb-paper);
  --sol-bg-tertiary: var(--cb-paper-hi);
  --sol-bg-surface: var(--cb-paper-hi);
  --sol-bg-hover: rgba(74, 58, 45, 0.08);
  --sol-surface: var(--cb-paper);
  --sol-surface-elevated: var(--cb-paper-hi);
  --sol-text-primary: var(--cb-ink);
  --sol-text-secondary: var(--cb-ink-2);
  --sol-text-tertiary: var(--cb-ink-3);
  --sol-border: var(--cb-edge-soft);
  --sol-border-subtle: var(--cb-edge-soft);
  --sol-border-strong: var(--cb-edge);

  --input-surface: var(--cb-paper);
  --input-surface-elevated: var(--cb-paper-hi);
  --input-border: var(--cb-edge-soft);
  --input-border-focus: var(--cb-dark);
  --textarea-bg: #EDE6D9;
  --textarea-border: var(--cb-edge-soft);
  --textarea-focus-glow: 0 0 0 2px rgba(74, 58, 45, 0.18);
  --action-ghost-bg: var(--cb-paper);
  --action-ghost-border: var(--cb-edge-soft);
  --action-primary-bg: var(--cb-dark);
  --action-primary-color: var(--cb-dark-ink);

  background: var(--cb-paper-lo);
  color: var(--cb-ink);
  border-left: 1px solid var(--cb-edge);
  box-shadow: -8px 0 28px -16px rgba(48, 38, 30, 0.36);
}

/* Film grain is an OLED texture; on light paper it fogs type edges. */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"]::before {
  background: none;
  background-image: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"].expanded {
  background:
    linear-gradient(90deg, rgba(120, 93, 71, 0.05), transparent 18px),
    var(--cb-paper-lo);
  border-left-color: var(--cb-edge) !important;
  box-shadow:
    -1px 0 0 rgba(255, 253, 248, 0.55),
    -12px 0 30px -18px rgba(48, 38, 30, 0.38);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-header,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-footer,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-status-bar,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-stage-header,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-stage-footer {
  background: var(--cb-paper);
  border-color: var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-header::after {
  background: linear-gradient(to right, transparent, var(--cb-edge), transparent);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-stage,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-stage-body,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-stage-content,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-body,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-content {
  background-color: transparent;
  color: var(--cb-ink);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-stage-title,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-picker-header h3,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-approval-title,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-title,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-error-title {
  color: var(--cb-ink);
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-picker-header p,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-selection-count,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-word-count,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-save-status,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-meta,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-word-count,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-error-message,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-shortcut {
  color: var(--cb-ink-3);
}

/* ── Collapsed rail: paper spine, not a neon status blade ─────────────── */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"]:not(.expanded) {
  background: linear-gradient(180deg, var(--cb-paper-hi), var(--cb-paper-lo));
  border-left: 2px solid var(--cb-edge);
  box-shadow: -8px 0 24px -14px rgba(48, 38, 30, 0.30);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"]:not(.expanded):hover,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"]:not(.expanded):focus-visible {
  background: linear-gradient(180deg, #FBF7EF, var(--cb-paper));
  border-left-color: var(--cb-dark);
  box-shadow: -10px 0 28px -14px rgba(48, 38, 30, 0.36);
  outline: 2px solid rgba(74, 58, 45, 0.22);
  outline-offset: -2px;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-edge {
  background: var(--cb-edge-soft);
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-collapsed-content {
  color: var(--cb-ink-2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-collapsed-type {
  background: var(--cb-paper);
  border: 1px solid var(--cb-edge);
  color: var(--cb-ink);
  text-shadow: none;
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"][data-note-type="progress"] .rail-collapsed-type {
  background: #E6EBEF;
  border-color: rgba(49, 95, 145, 0.38);
  color: #315F91;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"][data-note-type="handp"] .rail-collapsed-type {
  background: #E3ECE3;
  border-color: rgba(47, 106, 69, 0.36);
  color: #2F6A45;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"][data-note-type="discharge"] .rail-collapsed-type {
  background: #F3E6D6;
  border-color: rgba(138, 82, 0, 0.36);
  color: #8A5200;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-collapsed-type[data-idle="true"] {
  background: var(--cb-paper);
  border-color: var(--cb-edge-soft);
  color: var(--cb-ink-3);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-collapsed-patient,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-collapsed-draft,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-collapsed-words,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-collapsed-expand-hint {
  color: var(--cb-ink-2);
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-collapsed-expand-hint {
  background: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-collapsed-status {
  border-color: var(--cb-edge-soft);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-collapsed-status .status-dot,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-status-pill .status-dot,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-status-dot,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-stream-dot {
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-collapsed-expand-hint::before {
  color: var(--cb-ink-3);
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"].ready-pulse:not(.expanded),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"].draft-ready-pulse {
  animation: none;
  border-color: var(--cb-edge);
  box-shadow: -8px 0 24px -14px rgba(48, 38, 30, 0.30);
}

/* Status keeps its semantic hue as a quiet dot/ink/border, never a halo. */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-status-pill {
  background: var(--cb-paper-hi);
  border: 1px solid var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-status-pill .status-label,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-footer .status-active {
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"][data-status="generating"] .note-rail-status-pill {
  background: #E6EBEF;
  border-color: rgba(49, 95, 145, 0.35);
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"][data-status="ready"] .note-rail-status-pill {
  background: #E3ECE3;
  border-color: rgba(47, 106, 69, 0.32);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"][data-status="editing"] .note-rail-status-pill {
  background: #F3E6D6;
  border-color: rgba(138, 82, 0, 0.32);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"][data-status="error"] .note-rail-status-pill {
  background: #F3E2DF;
  border-color: rgba(162, 61, 57, 0.34);
}

/* ── Shared controls: recessed entry wells, lifted secondary controls ─── */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] input:not([type="checkbox"]):not([type="radio"]),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] select,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] textarea {
  background: #EDE6D9;
  border: 1px solid var(--cb-edge-soft);
  color: var(--cb-ink);
  box-shadow: var(--cb-well);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] input::placeholder,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] textarea::placeholder {
  color: var(--cb-ink-3);
  opacity: 0.78;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] input:focus,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] select:focus,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] textarea:focus {
  border-color: var(--cb-dark);
  outline: none;
  box-shadow: var(--cb-well), 0 0 0 2px rgba(74, 58, 45, 0.18);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] button:not(:disabled) {
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-action-btn.ghost,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-action-btn.sign-finalize,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-back-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-detail-back-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-detail-action-btn.secondary,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-close-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-toggle-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-card-action,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-refine-cancel,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-cancel-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-cancel-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-approval-cancel,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-accept-all-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-add-problem-submit {
  background: var(--cb-paper);
  border-color: var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-btn:hover:not(:disabled),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-action-btn.ghost:hover:not(:disabled),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-action-btn.sign-finalize:hover:not(:disabled),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-back-btn:hover:not(:disabled),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-detail-back-btn:hover:not(:disabled),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-detail-action-btn.secondary:hover:not(:disabled),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-close-btn:hover:not(:disabled),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-toggle-btn:hover:not(:disabled),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-card-action:hover:not(:disabled) {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] button:focus-visible,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] [tabindex]:focus-visible {
  outline: 2px solid rgba(74, 58, 45, 0.52);
  outline-offset: 2px;
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] button:disabled,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] button[disabled] {
  background: var(--cb-paper-lo) !important;
  border-color: var(--cb-edge-soft) !important;
  color: rgba(92, 75, 59, 0.58) !important;
  box-shadow: none !important;
}

/* Primary actions must beat terminal's !important mint gradient. */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] #generateNoteBtn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-action-btn.primary,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-btn-primary,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-generate-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-retry-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-detail-action-btn.primary,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-refine-submit,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-propose-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-finalize-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .drf-finalize-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .edit-selection-btn {
  background: var(--cb-dark) !important;
  background-image: none !important;
  border: 1px solid #2A2018 !important;
  color: var(--cb-dark-ink) !important;
  text-shadow: none !important;
  box-shadow: 0 2px 5px rgba(48, 38, 30, 0.24), var(--cb-sheen2) !important;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] #generateNoteBtn:hover:not(:disabled),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-action-btn.primary:hover:not(:disabled),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-btn-primary:hover:not(:disabled),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-generate-btn:hover:not(:disabled),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-retry-btn:hover:not(:disabled),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-detail-action-btn.primary:hover:not(:disabled),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-refine-submit:hover:not(:disabled),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-propose-btn:hover:not(:disabled),
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-finalize-btn:hover:not(:disabled) {
  background: #2E2419 !important;
  border-color: #2A2018 !important;
  color: var(--cb-dark-ink) !important;
  transform: none;
  box-shadow: 0 3px 8px rgba(48, 38, 30, 0.30) !important;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-btn--companion-active,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-action-btn.rail-btn--companion-active {
  outline-color: var(--cb-dark);
  border-color: var(--cb-edge);
  box-shadow: 0 0 0 2px rgba(74, 58, 45, 0.16);
}

/* ── Picker + Input: paper cards, editor sheet, quiet utility trays ───── */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-picker-card {
  background: var(--cb-paper);
  border: 1px solid var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-picker-card:hover {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rpc-icon {
  background: var(--cb-paper-lo);
  border: 1px solid var(--cb-edge-soft);
  box-shadow: var(--cb-well);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rpc-title {
  color: var(--cb-ink);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rpc-desc {
  color: var(--cb-ink-3);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-header,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-note-input-section,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .ai-data-summary,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-secondary-actions,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .snapshot-selector-group {
  background: var(--cb-paper);
  border-color: var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-note-input-section::before {
  background: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-note-type-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-note-type-dropdown,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-note-type-dropdown-item,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .prompt-chip,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .prompt-chip-toggle,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .prompt-chips-menu {
  background: var(--cb-paper);
  border-color: var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-note-type-btn:hover,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-note-type-dropdown-item:hover,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .prompt-chip:hover,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .prompt-chip-toggle:hover {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .clinical-update-counter,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .ai-data-chip,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .template-indicator,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .draft-version-chip {
  background: var(--cb-paper-lo);
  border-color: var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .feature-hint {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2), var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .feature-hint-badge,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .feature-hint-action {
  background: var(--cb-paper-lo);
  border-color: var(--cb-edge-soft);
  color: var(--cb-ink-2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-note-editor-wrapper,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-editor-container,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-editor,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-display-wrapper,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-note-output-section {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-toolbar,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .pm-toolbar,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-editor-toolbar {
  background: var(--cb-paper);
  border-color: var(--cb-edge-soft);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-note-content,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-note-content .ProseMirror,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-editor-content {
  background: var(--cb-paper-hi);
  color: var(--cb-ink);
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .editor-expand-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .pm-toolbar-button,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-toolbar button {
  background: var(--cb-paper);
  border-color: transparent;
  color: var(--cb-ink-3);
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .editor-expand-btn:hover,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .pm-toolbar-button:hover,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .pm-toolbar-button.active,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-toolbar button:hover,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .sol-toolbar button.active {
  background: var(--cb-paper-lo);
  border-color: var(--cb-edge-soft);
  color: var(--cb-ink);
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rag-knowledge-panel,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rag-knowledge-header,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rag-knowledge-body,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rag-knowledge-content {
  background: var(--cb-paper);
  border-color: var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: none;
}

/* ── Saved Notes: the split viewer is a recessed index + bright note sheet ─ */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-container {
  background: var(--cb-paper-lo);
  color: var(--cb-ink);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-header,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-meta,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-search-row,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-footer,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-detail-header,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-detail-actions {
  background: var(--cb-paper);
  border-color: var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-header-title,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-detail-title,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-selected-title {
  color: var(--cb-ink);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-patient-label,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-note-count,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-detail-meta,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-hint,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-selected-label {
  background: transparent;
  color: var(--cb-ink-3);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-filter-tab,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-mode-toggle {
  background: var(--cb-paper);
  border: 1px solid var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-filter-tab:hover,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-mode-toggle:hover {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-filter-tab.active,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-mode-toggle.active {
  background: var(--cb-dark);
  border-color: var(--cb-dark);
  color: var(--cb-dark-ink);
  box-shadow: 0 2px 5px rgba(48, 38, 30, 0.22);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-notes-column {
  background: #E7DED0;
  border-right: 1px solid var(--cb-edge);
  box-shadow: inset -6px 0 16px -12px rgba(48, 38, 30, 0.34);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-preview-column,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-detail-content {
  background: var(--cb-paper-hi);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-card {
  background: var(--cb-paper);
  border: 1px solid var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-card:hover {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  box-shadow: var(--cb-sheen2), var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-card:focus {
  outline: 2px solid rgba(74, 58, 45, 0.52);
  outline-offset: -2px;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-card.selected {
  background: #F8F3EA;
  border-color: var(--cb-dark);
  box-shadow: var(--cb-sheen2), var(--cb-u2), inset 3px 0 0 var(--cb-dark);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-preview,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-date,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-meta,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-patient,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-preview-empty,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-preview-patient,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-preview-date {
  color: var(--cb-ink-3);
  border-color: var(--cb-edge-soft);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-preview-header {
  border-color: var(--cb-edge-soft);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-preview-body {
  color: var(--cb-ink);
}

/* Clinical document types remain color-coded, but the tones are ink-on-paper
   rather than luminous text on translucent OLED chips. */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-type-badge,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-preview-type {
  background: var(--cb-paper-lo);
  border: 1px solid var(--cb-edge-soft);
  color: var(--cb-ink-2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-type-progress {
  background: #E4EBF1;
  color: #315F91;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-type-handp {
  background: #E1EBE2;
  color: #2F6A45;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-type-discharge {
  background: #F2E4D2;
  color: #8A5200;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-type-consult {
  background: #EBE2EF;
  color: #684178;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-cross-patient-warning,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-cross-patient-badge {
  background: #F4E8D6;
  border-color: rgba(138, 82, 0, 0.32);
  color: #8A5200;
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-ehr-final-badge {
  background: #DDEBEA;
  border-color: rgba(0, 93, 92, 0.30);
  color: #005D5C;
}

/* ── Detecting: semantic motion on a calm paper pipeline ─────────────── */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-pipeline,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-detection-count {
  background: var(--cb-paper);
  border: 1px solid var(--cb-edge-soft);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-step {
  color: var(--cb-ink-2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-step.active {
  background: #E6EBEF;
  border: 1px solid rgba(49, 95, 145, 0.24);
  color: var(--cb-ink);
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-step-label,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-step.active .detect-step-label,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-problem-title,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-detection-number {
  color: var(--cb-ink);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-step-time,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-problem-evidence,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-merges-status,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-detection-label,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-detect-timer {
  color: var(--cb-ink-3);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-section-header {
  color: var(--cb-ink-2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-problem-card {
  background: var(--cb-paper-hi);
  border: 1px solid var(--cb-edge-soft);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-problem-count,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-merge-count {
  background: var(--cb-dark);
  color: var(--cb-dark-ink);
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-spinner,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-merges-status::before {
  border-color: rgba(49, 95, 145, 0.24);
  border-top-color: #315F91;
  box-shadow: none;
}

/* ── Approval: lifted problem cards; selection is a warm anchored edge ── */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-approval-body,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-tier-section,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-consolidations {
  background: transparent;
  color: var(--cb-ink);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-tier-header,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-consolidations-header {
  color: var(--cb-ink-2);
  border-color: var(--cb-edge-soft);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-tier-label {
  color: var(--cb-ink-2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-tier-count,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-consolidations-badge,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-cons-confidence,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-cons-pill {
  background: var(--cb-paper-lo);
  border: 1px solid var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-card,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-core-card,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-peripheral-row,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-consolidation-card {
  background: var(--cb-paper);
  border-color: var(--cb-edge-soft);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-card:hover,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-core-card:hover,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-peripheral-row:hover,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-consolidation-card:hover {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  box-shadow: var(--cb-sheen2), var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-card.selected,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-card[data-selected="true"],
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-core-card.selected,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-peripheral-row.selected {
  background: #F8F3EA;
  border-color: var(--cb-dark);
  box-shadow: var(--cb-sheen2), var(--cb-u2), inset 3px 0 0 var(--cb-dark);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-card::before,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-card::after {
  border-color: var(--cb-edge);
  opacity: 0.5;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-title,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-card .problem-name,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-card .card-title {
  color: var(--cb-ink);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-evidence,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-core-evidence,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-core-prior,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-peripheral-qualifier,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-card .problem-meta,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-card .card-meta,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-card .problem-evidence,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-card .rail-problem-evidence,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-card .card-body {
  color: var(--cb-ink-3);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-card .icd-code {
  color: #005D5C;
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-cons-apply {
  background: var(--cb-dark);
  border-color: var(--cb-dark);
  color: var(--cb-dark-ink);
  box-shadow: none;
}

/* ── Generating: bright streaming sheet, calm status chrome ──────────── */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-generating-body {
  background: var(--cb-paper-lo);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-streaming-output {
  min-height: 100%;
  padding: 16px;
  background: var(--cb-paper-hi);
  border: 1px solid var(--cb-edge);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-problem-chip,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-chip,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-tag {
  background: var(--cb-paper);
  border: 1px solid var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-stream-status {
  color: var(--cb-ink-3);
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .streaming-skeleton-line {
  background: linear-gradient(90deg, #E7DED0, #F7F2EA, #E7DED0);
  background-size: 200% 100%;
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .streaming-resume-indicator {
  background: var(--cb-dark);
  color: var(--cb-dark-ink);
  box-shadow: var(--cb-u2);
}

/* ── Review + Ready: generated prose stays on the brightest paper plane ─ */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-header,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-footer {
  background: var(--cb-paper);
  border-color: var(--cb-edge-soft);
  box-shadow: var(--cb-sheen2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-cards,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-fullnote {
  background: var(--cb-paper-lo);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-card {
  margin: 8px 10px;
  background: var(--cb-paper);
  border: 1px solid var(--cb-edge-soft);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-card-header {
  background: var(--cb-paper);
  color: var(--cb-ink);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-card-header:hover {
  background: var(--cb-paper-hi);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-card-title {
  color: var(--cb-ink);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-card-content {
  background: var(--cb-paper-hi);
  border: 1px solid var(--cb-edge-soft);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-well);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-card-content[contenteditable="true"] {
  background: #FBF7EF;
  border-color: var(--cb-dark);
  color: var(--cb-ink);
  box-shadow: 0 0 0 2px rgba(74, 58, 45, 0.16), var(--cb-well);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-card-badge {
  background: var(--cb-paper-lo);
  border: 1px solid var(--cb-edge-soft);
  color: var(--cb-ink-2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-card-badge.has-changes {
  background: #E4EBF1;
  border-color: rgba(49, 95, 145, 0.28);
  color: #315F91;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-toggle-btn[aria-pressed="false"],
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-card-action.editing {
  background: var(--cb-dark);
  border-color: var(--cb-dark);
  color: var(--cb-dark-ink);
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .provenance-legend,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .provenance-legend-header,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .provenance-legend-items {
  background: var(--cb-paper);
  border-color: var(--cb-edge-soft);
  color: var(--cb-ink);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .provenance-legend-scope,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .provenance-legend-label {
  color: var(--cb-ink-2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .provenance-legend-count {
  color: var(--cb-ink);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .provenance-legend-toggle:hover,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .provenance-legend-toggle:focus-visible {
  background: var(--cb-paper-hi);
  color: var(--cb-ink);
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-refine-area,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .diff-review-toolbar,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .diff-review-footer,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .diff-analyzing-indicator {
  background: var(--cb-paper);
  border-color: var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-refine-input {
  background: #EDE6D9;
  border-color: var(--cb-edge-soft);
  color: var(--cb-ink);
  box-shadow: var(--cb-well);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-diff-btn.accept {
  background: #E3ECE3;
  color: #2F6A45;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-diff-btn.reject {
  background: #F3E2DF;
  color: #A23D39;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-ready-body {
  margin: 12px;
  padding: 0;
  background: var(--cb-paper-hi);
  border: 1px solid var(--cb-edge);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-note-output {
  background: var(--cb-paper-hi);
  color: var(--cb-ink);
}

/* ── Evolution stage: rail-local split workspace, kept separate from the
   full-screen Note Evolution takeover but using the same paper grammar. ── */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-evolution-workspace,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-left-pane,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-right-pane {
  background: var(--cb-paper-lo);
  border-color: var(--cb-edge);
  color: var(--cb-ink);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-left-header,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-right-header,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-pane-header,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-finalize-bar,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-action-bar {
  background: var(--cb-paper);
  border-color: var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-base-note,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-review-queue,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-timeline-drawer {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-hrm-backdrop {
  background: rgba(58, 46, 36, 0.45);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-hrm-card,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-hrm-evidence,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .nev-hrm-diff-row {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u2);
}

/* ── Error, offline, draft, and stall states: visible without black alarms ─ */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-error-body {
  margin: 16px;
  background: var(--cb-paper-hi);
  border: 1px solid rgba(162, 61, 57, 0.32);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-error-icon {
  color: #A23D39;
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-offline-banner,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-stall-indicator,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .draft-banner,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .clinical-input-draft-banner {
  background: #F4E8D6;
  border-color: rgba(138, 82, 0, 0.30);
  color: #71460B;
  box-shadow: none;
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-offline-dot,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .unsaved-dot {
  box-shadow: none;
}

/* Rail-owned tooltip is portaled outside the aside, so it needs root scope
   instead of descendant scope. It remains specific to the rail diff guide. */
:root[data-roast-theme="cold-brew"] .dg-tooltip {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  color: var(--cb-ink);
  box-shadow: var(--cb-sheen2), var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .dg-title,
:root[data-roast-theme="cold-brew"] .dg-link {
  color: var(--cb-ink);
}

:root[data-roast-theme="cold-brew"] .dg-body,
:root[data-roast-theme="cold-brew"] .dg-step {
  color: var(--cb-ink-2);
}

:root[data-roast-theme="cold-brew"] .dg-footer {
  border-color: var(--cb-edge-soft);
}

/* ═══════════════════════════════════════════════════════════════════════════
   NOTE RAIL — second-pass interaction + responsive polish (2026-07-19)
   Keep the paper surface calm while making its structure and controls read
   immediately: one compact title treatment, anchored chrome, visible focus,
   legible disabled actions, and a warm veil when the rail becomes an overlay.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Terminal's title component authors its own prompt; detecting also contains a
   legacy prompt span. Hide that duplicate and reset the terminal-era display
   padding so every stage header uses the same compact vertical rhythm. */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-stage-title {
  flex: 1;
  min-width: 0;
  padding: 0;
  gap: 8px;
  color: var(--cb-ink-2);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-stage-title > .term-prompt {
  display: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-stage-title::before,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-header-title::before {
  color: var(--cb-dark);
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-stage-title::after {
  margin-left: 6px;
  background: linear-gradient(90deg, var(--cb-edge), transparent 88%);
}

/* Header and action trays remain in the same flex chain, but get a clear
   paper-to-paper seam so long clinical bodies never visually swallow them. */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-stage-header,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-header,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-header {
  min-height: 52px;
  padding: 9px 16px;
  background: linear-gradient(180deg, #FBF7EF 0%, var(--cb-paper) 100%);
  border-bottom: 1px solid var(--cb-edge);
  box-shadow:
    inset 0 1px 0 rgba(255, 253, 248, 0.72),
    0 8px 18px -18px rgba(48, 38, 30, 0.55);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-stage-footer,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-footer,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-footer {
  min-height: 54px;
  background: linear-gradient(180deg, var(--cb-paper) 0%, #EDE6D9 100%);
  border-top: 1px solid var(--cb-edge);
  box-shadow:
    inset 0 1px 0 rgba(255, 253, 248, 0.64),
    0 -9px 20px -19px rgba(48, 38, 30, 0.58);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-picker-header {
  padding: 18px 16px 12px;
  background: linear-gradient(180deg, #FBF7EF 0%, var(--cb-paper) 100%);
  border-bottom-color: var(--cb-edge);
  box-shadow: 0 8px 18px -18px rgba(48, 38, 30, 0.52);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-header-info,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-header-left,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-footer-info {
  min-width: 0;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-header-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Wheel/touch scrolling belongs to the rail while it is open; do not chain a
   completed inner scroll into the underlying census workspace. */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-stage-body,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-notes-column,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-preview-column,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-cards {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/* Utility targets were visually polished but still inherited terminal-era
   24–28px boxes. Preserve the compact desktop density with reliable targets. */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-toggle,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .note-rail-theme-toggle,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-close-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  background: var(--cb-paper);
  border: 1px solid var(--cb-edge-soft);
  color: var(--cb-ink-2);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-close-btn svg {
  stroke: currentColor;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-filter-tab,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-mode-toggle,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-detail-action-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-toggle-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .detect-cancel-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-cancel-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-approval-cancel,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-accept-all-btn,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-add-problem-submit {
  min-height: 36px;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-card-action,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-diff-btn {
  min-height: 32px;
  padding-inline: 10px;
}

/* A focus ring should add certainty, not erase the component's paper lift. */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] button:not(:disabled):focus-visible,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] [role="button"]:focus-visible {
  outline: 2px solid var(--cb-dark) !important;
  outline-offset: 2px;
  box-shadow:
    var(--cb-sheen2),
    var(--cb-u1),
    0 0 0 3px rgba(74, 58, 45, 0.16) !important;
}

:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] button:not(:disabled):active {
  transform: translateY(1px);
  box-shadow: var(--cb-sheen2), var(--cb-well) !important;
}

/* Disabled is a state, not disappearing copy. Use solid muted ink with AA
   contrast and remove the base viewer's extra opacity reduction. */
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] button:disabled,
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] button[disabled],
:root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-detail-action-btn.disabled {
  opacity: 1 !important;
  background: #E7DED0 !important;
  border-color: rgba(120, 93, 71, 0.34) !important;
  color: #6F5B49 !important;
  cursor: not-allowed !important;
  box-shadow: inset 0 1px 0 rgba(255, 253, 248, 0.46) !important;
  filter: none !important;
}

/* At tablet widths the terminal selector's position:relative out-specifics the
   base responsive rule. Reassert the fixed side sheet and restore the warm veil
   that the desktop film-grain reset intentionally removed. */
@media (max-width: 1024px) {
  :root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"].expanded {
    position: fixed;
    top: var(--sol-nav-height, 88px);
    right: 0;
    bottom: 0;
    left: auto;
    width: 100%;
    max-width: 520px;
    height: auto;
    z-index: 100;
  }

  :root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"].expanded::before {
    content: "";
    position: fixed;
    inset: var(--sol-nav-height, 88px) 0 0;
    z-index: -1;
    pointer-events: none;
    background: rgba(58, 46, 36, 0.42);
    background-image: none;
    backdrop-filter: blur(1.5px) saturate(0.78);
    -webkit-backdrop-filter: blur(1.5px) saturate(0.78);
  }

  :root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-footer,
  :root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-footer {
    flex-direction: column;
    align-items: stretch;
  }

  :root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-footer-actions,
  :root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-footer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  :root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-footer-actions .rail-detail-action-btn,
  :root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-review-footer-actions .rail-review-action {
    min-width: 0;
    width: 100%;
    justify-content: center;
    white-space: normal;
  }
}

/* The single-column viewer keeps every action reachable without horizontal
   clipping. Filters may scroll as one row; footer actions reflow as a grid. */
@media (max-width: 700px) {
  :root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-meta,
  :root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-search-row {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 8px;
  }

  :root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-meta .rail-viewing-filters {
    width: 100%;
    min-width: 0;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  :root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-mode-toggle {
    width: 100%;
    justify-content: center;
  }

  :root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-footer {
    flex-direction: column;
    align-items: stretch;
  }

  :root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-footer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  :root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"] .rail-viewing-footer-actions .rail-detail-action-btn {
    min-width: 0;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  :root[data-roast-theme="cold-brew"] .note-rail[data-theme="terminal"].expanded {
    right: 0;
    left: 0;
    max-width: 100%;
    border-left: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   COLD BREW — whole-app polish pass (2026-07-19)
   The account theme now follows the doctor outside the census trio. These
   additions finish the remaining foreign-palette surfaces and establish the
   responsive document grammar for standalone note workspaces.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Shared app chrome + voice layer ────────────────────────────────────── */
:root[data-roast-theme="cold-brew"] {
  --voice-primary: #005D5C;
  --voice-primary-hover: #004B4A;
  --voice-success: #405E00;
  --voice-danger: #A73232;
  --voice-warning: #734400;
  --voice-bg: var(--cb-paper);
  --voice-bg-light: var(--cb-paper-hi);
  --voice-text: var(--cb-ink);
  --voice-text-muted: var(--cb-ink-2);
  --voice-border: var(--cb-edge);
  --voice-recording: #A73232;
  --voice-shadow: var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .sn-mode-chip {
  color: var(--cb-ink);
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .sn-mode-chip__label {
  color: var(--cb-ink);
}

:root[data-roast-theme="cold-brew"] .sn-mode-chip__detail {
  color: var(--cb-ink-2);
}

:root[data-roast-theme="cold-brew"] .voice-command-bar {
  color: var(--cb-ink);
  background: rgba(241, 234, 224, 0.96);
  border-color: var(--cb-edge);
  box-shadow: var(--cb-sheen2), var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .voice-mode-btn,
:root[data-roast-theme="cold-brew"] .voice-mode-btn:hover,
:root[data-roast-theme="cold-brew"] .voice-mode-btn.open,
:root[data-roast-theme="cold-brew"] .voice-bar-provider,
:root[data-roast-theme="cold-brew"] .voice-bar-mode {
  color: var(--cb-ink);
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
}

:root[data-roast-theme="cold-brew"] .voice-bar-provider .provider-label,
:root[data-roast-theme="cold-brew"] .transcript-placeholder,
:root[data-roast-theme="cold-brew"] .transcript-partial {
  color: var(--cb-ink-2);
}

:root[data-roast-theme="cold-brew"] .voice-mode-menu {
  color: var(--cb-ink);
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  box-shadow: var(--cb-u3);
}

/* ── Census holdouts visible on the default landing screen ─────────────── */
:root[data-roast-theme="cold-brew"] .sol-arch-promo-kicker,
:root[data-roast-theme="cold-brew"] .sol-arch-promo-title em,
:root[data-roast-theme="cold-brew"] .sol-arch-promo-cta {
  color: #734400;
}

:root[data-roast-theme="cold-brew"] .sol-arch-promo-dot {
  background: #734400;
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .sol-card-demo {
  color: #005D5C;
}

:root[data-roast-theme="cold-brew"] .v14-debug-panel {
  color: var(--cb-ink);
  background: var(--cb-paper);
  border-color: var(--cb-edge);
  box-shadow: var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .v14-debug-panel .debug-panel-toggle {
  color: var(--cb-ink);
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
}

:root[data-roast-theme="cold-brew"] .v14-debug-panel .debug-panel-content,
:root[data-roast-theme="cold-brew"] .v14-debug-panel .debug-log {
  color: var(--cb-ink-2);
  background: var(--cb-paper-lo);
  border-color: var(--cb-edge-soft);
}

:root[data-roast-theme="cold-brew"] .v14-debug-panel .debug-label {
  color: var(--cb-ink-2);
}

:root[data-roast-theme="cold-brew"] .v14-debug-panel .debug-value {
  color: var(--cb-ink);
}

/* ── Transfer Center first-run guide: lifted paper, not a dark island ──── */
:root[data-roast-theme="cold-brew"] .tc-empty-guide {
  --tc-guide-fg: var(--cb-ink);
  --tc-guide-muted: var(--cb-ink-2);
  --tc-guide-dim: var(--cb-ink-3);
  --tc-guide-gold: #734400;
  --tc-guide-green: #405E00;
  --tc-guide-edge: var(--cb-edge);
  color: var(--cb-ink);
  background:
    radial-gradient(circle at 90% 12%, rgba(115, 68, 0, 0.08), transparent 22rem),
    linear-gradient(145deg, var(--cb-paper-hi), var(--cb-paper));
  border-color: var(--cb-edge);
  box-shadow: var(--cb-sheen2), var(--cb-u3);
}

:root[data-roast-theme="cold-brew"] .tc-empty-guide-mark {
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .tc-empty-guide-time {
  color: var(--cb-ink-2);
  background: rgba(255, 253, 248, 0.46);
  border-color: var(--cb-edge);
}

:root[data-roast-theme="cold-brew"] .tc-empty-guide-open {
  color: var(--cb-dark-ink);
  background: #734400;
  border-color: #734400;
  box-shadow: var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .tc-empty-guide-open:hover {
  background: #5F3800;
  box-shadow: var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .tc-empty-guide-new {
  color: var(--cb-dark-ink);
  background: var(--cb-dark);
  border-color: var(--cb-dark);
  box-shadow: var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .tc-empty-guide-new:hover {
  color: var(--cb-dark-ink);
  background: #4A3A2D;
  border-color: #4A3A2D;
}

:root[data-roast-theme="cold-brew"] .tc-empty-guide-path {
  background: var(--cb-paper-lo);
  border-color: var(--cb-edge);
}

:root[data-roast-theme="cold-brew"] .tc-empty-guide-path li {
  border-color: var(--cb-edge-soft);
}

/* ── Admissions empty state + Manuscript paper hierarchy ──────────────── */
:root[data-roast-theme="cold-brew"] .aw-empty-state {
  color: var(--cb-ink);
}

:root[data-roast-theme="cold-brew"] .aw-empty-icon {
  color: var(--cb-ink-2);
  opacity: 0.82;
}

:root[data-roast-theme="cold-brew"] .aw-empty-title {
  color: var(--cb-ink);
  font-weight: 500;
}

:root[data-roast-theme="cold-brew"] .aw-empty-subtitle,
:root[data-roast-theme="cold-brew"] .aw-empty-steps li {
  color: var(--cb-ink-2);
}

:root[data-roast-theme="cold-brew"] .aw-empty-steps li {
  font-size: 0.825rem;
  line-height: 1.55;
}

:root[data-roast-theme="cold-brew"] .aw-empty-steps li::before {
  color: #005D5C;
}

:root[data-roast-theme="cold-brew"] .aw-workspace .aw-empty-state::before {
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(120, 93, 71, 0.12),
    transparent 70%
  );
}

:root[data-roast-theme="cold-brew"] #awNewAdmissionBtnEmpty {
  color: var(--cb-dark-ink);
  background: var(--cb-dark);
  border-color: var(--cb-dark);
  box-shadow: var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .awm-intake {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  border-left-color: var(--cb-dark);
  box-shadow: var(--cb-sheen2), var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .awm-intake:focus-within {
  border-color: var(--cb-dark);
  box-shadow: 0 0 0 3px rgba(58, 46, 36, 0.14), var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .awm-counter {
  color: var(--cb-ink-2);
  background: var(--cb-paper-lo);
  border-color: var(--cb-edge-soft);
}

:root[data-roast-theme="cold-brew"] .awm-sheet {
  background: var(--cb-paper);
}

:root[data-roast-theme="cold-brew"] .awm-preamble {
  color: var(--cb-ink-2);
  background: var(--cb-paper-hi);
  border-left-color: var(--cb-edge);
}

:root[data-roast-theme="cold-brew"] .awm-row {
  border-bottom-color: var(--cb-edge-soft);
}

:root[data-roast-theme="cold-brew"] .awm-row--primary {
  color: var(--cb-ink);
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .awm-body:focus,
:root[data-roast-theme="cold-brew"] .awm-med:hover,
:root[data-roast-theme="cold-brew"] .awm-med-text:focus,
:root[data-roast-theme="cold-brew"] .awm-chip {
  color: var(--cb-ink);
  background: var(--cb-paper-hi);
}

:root[data-roast-theme="cold-brew"] .awm-rail {
  color: var(--cb-ink-2);
  background: var(--cb-paper-lo);
  border-color: var(--cb-edge);
  box-shadow: var(--cb-well);
}

:root[data-roast-theme="cold-brew"] .awm-mtb {
  color: var(--cb-ink);
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  box-shadow: var(--cb-u2);
}

/* ── Quick Gen + Quick D/C: warm document desk ─────────────────────────── */
:root[data-roast-theme="cold-brew"] .pn-page {
  --pn-bg-void: #E2DBD0;
  --pn-bg-surface: var(--cb-paper-hi);
  --pn-bg-elevated: var(--cb-paper);
  --pn-bg-header: var(--cb-paper);
  --pn-bg-input: #FBF7EF;
  --pn-fg-primary: var(--cb-ink);
  --pn-fg-secondary: var(--cb-ink-2);
  --pn-fg-muted: var(--cb-ink-3);
  --pn-fg-inverse: var(--cb-dark-ink);
  --pn-border-subtle: var(--cb-edge-soft);
  --pn-border-default: var(--cb-edge);
  --pn-border-strong: rgba(120, 93, 71, 0.58);
  --pn-accent: var(--cb-dark);
  --pn-accent-dim: rgba(58, 46, 36, 0.42);
  --pn-accent-subtle: rgba(58, 46, 36, 0.12);
  --pn-accent-ghost: rgba(58, 46, 36, 0.07);
  --pn-magenta: #8D0057;
  --pn-magenta-dim: rgba(141, 0, 87, 0.28);
  --pn-warning: #734400;
  --pn-success: #405E00;
  --pn-error: #A73232;
  --pn-glow-accent: 0 0 0 3px rgba(58, 46, 36, 0.14);
  --pn-glow-accent-intense: var(--cb-u2);
  background: #E2DBD0;
  color: var(--cb-ink);
}

:root[data-roast-theme="cold-brew"] .pn-page::before {
  background: none;
  background-image: none;
}

:root[data-roast-theme="cold-brew"] .pn-header {
  background: linear-gradient(180deg, var(--cb-paper-hi), var(--cb-paper));
  border-color: var(--cb-edge);
  box-shadow: 0 1px 3px rgba(48, 38, 30, 0.12);
}

:root[data-roast-theme="cold-brew"] .pn-header::after {
  background: linear-gradient(to right, transparent, var(--cb-edge), transparent);
}

:root[data-roast-theme="cold-brew"] .pn-logo-mark,
:root[data-roast-theme="cold-brew"] .pn-nav-prefix,
:root[data-roast-theme="cold-brew"] .pn-section-title::before {
  color: var(--cb-dark);
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .pn-nav-link.active {
  color: var(--cb-ink);
  border-bottom-color: var(--cb-dark);
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .pn-input-panel {
  background: var(--cb-paper-lo);
  border-color: var(--cb-edge);
}

:root[data-roast-theme="cold-brew"] .pn-output-panel {
  background: var(--cb-paper-hi);
}

:root[data-roast-theme="cold-brew"] .pn-output-header {
  background: var(--cb-paper);
  border-color: var(--cb-edge-soft);
}

:root[data-roast-theme="cold-brew"] .pn-date-input,
:root[data-roast-theme="cold-brew"] .pn-textarea,
:root[data-roast-theme="cold-brew"] .qd-text-input,
:root[data-roast-theme="cold-brew"] .qd-select-input,
:root[data-roast-theme="cold-brew"] .qd-selection-toolbar .qd-rewrite-input {
  color: var(--cb-ink);
  color-scheme: light;
  background: #FBF7EF;
  border-color: var(--cb-edge);
  box-shadow: var(--cb-well);
}

:root[data-roast-theme="cold-brew"] .pn-textarea::placeholder,
:root[data-roast-theme="cold-brew"] .qd-text-input::placeholder,
:root[data-roast-theme="cold-brew"] .qd-selection-toolbar .qd-rewrite-input::placeholder {
  color: var(--cb-ink-3);
  opacity: 1;
}

:root[data-roast-theme="cold-brew"] .pn-field-label {
  color: var(--cb-ink-2);
  opacity: 1;
}

:root[data-roast-theme="cold-brew"] .pn-keyboard-hint,
:root[data-roast-theme="cold-brew"] .pn-empty-subtext {
  color: var(--cb-ink-2);
  opacity: 1;
}

:root[data-roast-theme="cold-brew"] .pn-empty-icon {
  color: var(--cb-ink-2);
  opacity: 0.72;
}

:root[data-roast-theme="cold-brew"] .pn-empty-text {
  color: var(--cb-ink-2);
}

:root[data-roast-theme="cold-brew"] .pn-btn-generate {
  color: var(--cb-dark-ink);
  background: var(--cb-dark);
  box-shadow: var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .pn-btn-generate:hover {
  background: #4A3A2D;
  box-shadow: var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .pn-btn-generate:disabled {
  color: #F4EEE5;
  background: #75695D;
  opacity: 1;
}

:root[data-roast-theme="cold-brew"] .pn-spinner {
  border-color: rgba(242, 236, 225, 0.35);
  border-top-color: var(--cb-dark-ink);
}

:root[data-roast-theme="cold-brew"] .qd-saved-notes {
  background: var(--cb-paper);
  border-color: var(--cb-edge);
}

:root[data-roast-theme="cold-brew"] .qd-saved-note {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge-soft);
  box-shadow: var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .qd-selection-toolbar {
  color: var(--cb-ink);
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  box-shadow: var(--cb-u3);
}

@media (max-width: 900px) {
  :root[data-roast-theme="cold-brew"]:has(body.pn-page),
  :root[data-roast-theme="cold-brew"] body.pn-page {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  :root[data-roast-theme="cold-brew"] .pn-page {
    display: block;
    height: auto;
    min-height: 100vh;
  }

  :root[data-roast-theme="cold-brew"] .pn-header {
    position: sticky;
    top: 0;
    flex-wrap: wrap;
    gap: 8px 16px;
  }

  :root[data-roast-theme="cold-brew"] .pn-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 20px;
    overflow-x: auto;
    white-space: nowrap;
  }

  :root[data-roast-theme="cold-brew"] .pn-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    overflow: visible;
  }

  :root[data-roast-theme="cold-brew"] .pn-input-panel,
  :root[data-roast-theme="cold-brew"] .pn-output-panel {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-width: 0;
    overflow: visible;
  }

  :root[data-roast-theme="cold-brew"] .pn-input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--cb-edge);
  }

  :root[data-roast-theme="cold-brew"] .pn-textarea {
    min-height: 340px;
    max-height: none;
  }

  :root[data-roast-theme="cold-brew"] .pn-output-panel {
    min-height: 560px;
  }
}

@media (max-width: 600px) {
  :root[data-roast-theme="cold-brew"] .pn-header,
  :root[data-roast-theme="cold-brew"] .pn-input-panel,
  :root[data-roast-theme="cold-brew"] .pn-output-body {
    padding-right: 16px;
    padding-left: 16px;
  }

  :root[data-roast-theme="cold-brew"] .pn-output-header,
  :root[data-roast-theme="cold-brew"] .pn-output-actions,
  :root[data-roast-theme="cold-brew"] .qd-field-row {
    align-items: stretch;
    flex-wrap: wrap;
  }

  :root[data-roast-theme="cold-brew"] .qd-field-row {
    grid-template-columns: 1fr;
  }

  :root[data-roast-theme="cold-brew"] .qd-selection-toolbar {
    right: 12px;
    left: 12px;
    min-width: 0;
    max-width: none;
    flex-wrap: wrap;
  }
}

/* ── Help hub: paper reference manual ──────────────────────────────────── */
:root[data-roast-theme="cold-brew"] .help-page {
  --bg: #E2DBD0;
  --bg-card: var(--cb-paper);
  --bg-card-2: var(--cb-paper-hi);
  --border: var(--cb-edge-soft);
  --border-2: var(--cb-edge);
  --accent: #005D5C;
  --accent-d: rgba(0, 93, 92, 0.22);
  --amber: #734400;
  --amber-d: rgba(115, 68, 0, 0.12);
  --magenta: #8D0057;
  --magenta-d: rgba(141, 0, 87, 0.10);
  --cyan: #005D5C;
  --cyan-d: rgba(0, 93, 92, 0.10);
  --fg: var(--cb-ink);
  --fg-2: var(--cb-ink-2);
  --fg-3: var(--cb-ink-3);
  color: var(--cb-ink);
  background:
    radial-gradient(ellipse 1100px 700px at 15% -10%, rgba(115, 68, 0, 0.10), transparent 70%),
    #E2DBD0;
}

:root[data-roast-theme="cold-brew"] .help-page .arch-card,
:root[data-roast-theme="cold-brew"] .help-page .corpus-card,
:root[data-roast-theme="cold-brew"] .help-page .flow-card,
:root[data-roast-theme="cold-brew"] .help-page .voice-card,
:root[data-roast-theme="cold-brew"] .help-page .change-card,
:root[data-roast-theme="cold-brew"] .help-page .res-link {
  box-shadow: var(--cb-sheen2), var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .help-page .arch-card:hover,
:root[data-roast-theme="cold-brew"] .help-page .res-link:hover {
  box-shadow: var(--cb-sheen2), var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .help-page .arch-kicker .dot,
:root[data-roast-theme="cold-brew"] .help-page .corpus-kicker .dot {
  box-shadow: none;
}

:root[data-roast-theme="cold-brew"] .help-page .ehr-primary {
  color: var(--cb-dark-ink);
  background: var(--cb-dark);
  border-color: var(--cb-dark);
  box-shadow: var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .help-page .change-badge--fix {
  color: #405E00;
  background: rgba(64, 94, 0, 0.10);
  border-color: rgba(64, 94, 0, 0.34);
}

/* ── Login: the same paper desk before authentication ──────────────────── */
:root[data-roast-theme="cold-brew"] .login-page {
  --dr-teal: #005D5C;
  --dr-crema: var(--cb-ink);
  --dr-mocha: var(--cb-ink-2);
  --dr-crater: var(--cb-edge);
  --bg-primary: #E2DBD0;
  --bg-secondary: rgba(246, 241, 232, 0.94);
  --bg-tertiary: #FBF7EF;
  --text-primary: var(--cb-ink);
  --text-secondary: var(--cb-ink-2);
  --text-muted: var(--cb-ink-3);
  --border-color: var(--cb-edge);
  --primary-color: var(--cb-dark);
  --primary-hover: #4A3A2D;
  --error-color: #A73232;
  --success-color: #405E00;
  color: var(--cb-ink);
  background:
    radial-gradient(circle at 72% 22%, rgba(0, 93, 92, 0.08), transparent 24rem),
    radial-gradient(circle at 18% 82%, rgba(115, 68, 0, 0.09), transparent 28rem),
    #E2DBD0;
}

:root[data-roast-theme="cold-brew"] .login-page #matrix-canvas {
  opacity: 0.48;
}

:root[data-roast-theme="cold-brew"] .login-page .login-card,
:root[data-roast-theme="cold-brew"] .login-page .emoji-container {
  color: var(--cb-ink);
  background: rgba(246, 241, 232, 0.90);
  border-color: var(--cb-edge);
  box-shadow: var(--cb-sheen2), var(--cb-u3);
}

:root[data-roast-theme="cold-brew"] .login-page .agent-face {
  filter: drop-shadow(0 5px 12px rgba(48, 38, 30, 0.20));
}

:root[data-roast-theme="cold-brew"] .login-page .glitch-text,
:root[data-roast-theme="cold-brew"] .login-page .login-logo {
  color: #005D5C;
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .login-page .form-input {
  color: var(--cb-ink);
  background: #FBF7EF;
  border-color: var(--cb-edge);
  box-shadow: var(--cb-well);
}

:root[data-roast-theme="cold-brew"] .login-page .form-input:focus {
  border-color: var(--cb-dark);
  box-shadow: 0 0 0 3px rgba(58, 46, 36, 0.14);
}

:root[data-roast-theme="cold-brew"] .login-page .login-btn {
  color: var(--cb-dark-ink);
  background: var(--cb-dark);
  box-shadow: var(--cb-u1);
}

:root[data-roast-theme="cold-brew"] .login-page .login-btn:hover:not(:disabled) {
  background: #4A3A2D;
  box-shadow: var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .login-page .login-btn .spinner {
  border-color: rgba(242, 236, 225, 0.34);
  border-top-color: var(--cb-dark-ink);
}

:root[data-roast-theme="cold-brew"] .login-page .demo-credentials {
  color: var(--cb-ink-2);
  background: var(--cb-paper-lo);
  border-color: var(--cb-edge-soft);
}

:root[data-roast-theme="cold-brew"] .login-page .demo-credentials strong {
  color: var(--cb-ink);
}

@media (max-width: 768px) {
  :root[data-roast-theme="cold-brew"] .login-page {
    gap: 24px;
  }

  :root[data-roast-theme="cold-brew"] .login-page .emoji-container {
    margin-top: 0;
    padding: 1.5rem;
  }
}

/* ── Flag-gated IR workspace: paper clinical instrument ────────────────── */
:root[data-roast-theme="cold-brew"] .ir-page {
  --term-bg-void: #E2DBD0;
  --term-bg-surface: var(--cb-paper);
  --term-bg-elevated: var(--cb-paper-hi);
  --term-bg-header: var(--cb-paper);
  --term-bg-input: #FBF7EF;
  --term-fg-primary: var(--cb-ink);
  --term-fg-secondary: var(--cb-ink-2);
  --term-fg-muted: var(--cb-ink-3);
  --term-fg-inverse: var(--cb-dark-ink);
  --term-border-subtle: var(--cb-edge-soft);
  --term-border-default: var(--cb-edge);
  --term-border-strong: rgba(120, 93, 71, 0.58);
  --term-accent: #005D5C;
  --term-accent-dim: rgba(0, 93, 92, 0.38);
  --term-accent-subtle: rgba(0, 93, 92, 0.10);
  --term-accent-ghost: rgba(0, 93, 92, 0.06);
  --term-gold: #734400;
  --term-gold-dim: rgba(115, 68, 0, 0.34);
  --term-gold-subtle: rgba(115, 68, 0, 0.10);
  --term-gold-ghost: rgba(115, 68, 0, 0.06);
  --term-status-idle: var(--cb-ink-3);
  --term-status-generating: #005D5C;
  --term-status-ready: #405E00;
  --term-status-editing: #734400;
  --term-status-error: #A73232;
  --term-status-critical: #A73232;
  --term-status-worsening: #8D0057;
  --term-status-stable: #405E00;
  --term-glow-accent: var(--cb-u1);
  --term-glow-accent-intense: var(--cb-u2);
  --term-glow-gold: var(--cb-u1);
  --term-text-glow-accent: none;
  --term-text-glow-gold: none;
  color: var(--cb-ink);
  background: #E2DBD0;
}

:root[data-roast-theme="cold-brew"] .ir-page::before {
  background: none;
  background-image: none;
}

:root[data-roast-theme="cold-brew"] .ir-header {
  background: linear-gradient(180deg, var(--cb-paper-hi), var(--cb-paper));
  border-color: var(--cb-edge);
  box-shadow: 0 1px 3px rgba(48, 38, 30, 0.12);
}

:root[data-roast-theme="cold-brew"] .ir-logo-mark,
:root[data-roast-theme="cold-brew"] .ir-section-link.active,
:root[data-roast-theme="cold-brew"] .ir-section-prefix {
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .ir-panel {
  background: var(--cb-paper-hi);
  border-color: var(--cb-edge);
  box-shadow: var(--cb-sheen2), var(--cb-u2);
}

:root[data-roast-theme="cold-brew"] .ir-panel-title {
  text-shadow: none;
}

:root[data-roast-theme="cold-brew"] .ir-select,
:root[data-roast-theme="cold-brew"] .ir-textarea,
:root[data-roast-theme="cold-brew"] .ir-page input {
  color: var(--cb-ink);
  color-scheme: light;
  background: #FBF7EF;
  border-color: var(--cb-edge);
  box-shadow: var(--cb-well);
}

:root[data-roast-theme="cold-brew"] .ir-page .ir-btn-primary {
  color: var(--cb-dark-ink);
  background: var(--cb-dark);
  border-color: var(--cb-dark);
  box-shadow: var(--cb-u1);
}

@media (max-width: 900px) {
  :root[data-roast-theme="cold-brew"] .ir-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "brand chip controls"
      "nav nav nav";
    gap: 8px 16px;
    padding: 10px 20px 8px;
  }

  :root[data-roast-theme="cold-brew"] .ir-header-brand {
    grid-area: brand;
  }

  :root[data-roast-theme="cold-brew"] .ir-header > .sn-mode-chip {
    grid-area: chip;
    justify-self: end;
    min-width: 0;
  }

  :root[data-roast-theme="cold-brew"] .ir-header-controls {
    grid-area: controls;
    margin-left: 0;
  }

  :root[data-roast-theme="cold-brew"] .ir-section-switcher {
    grid-area: nav;
    flex-wrap: nowrap;
    gap: 18px;
    width: 100%;
    min-width: 0;
    padding: 0 0 2px;
    overflow-x: auto;
    scrollbar-width: thin;
  }
}
