/* ==========================================================================
   note-evolution-takeover.css — Three-Substrate Workspace shell
   ─────────────────────────────────────────────────────────────────
   Wave 1 (2026-05-07) — Dark Roast Black Label v4 visual contract.
   Tokens consumed from `static/css/dark-roast-tokens.css` only.
   No --term-* references. No Tailwind admin colors. No rounded-corner
   bling, no drop shadows, no backdrop-filter.

   Geometry:
     The original static mockup used a 1360 px internal canvas. The live
     census shell often gives the takeover less room after the patient list,
     so the production layout uses tighter floors and only stacks on genuinely
     small screens.

   Visual contract:
     1 px hairline borders, 2 px max border-radius, monospace data,
     warm-coffee scanline overlay, two-tier severity (burnt-sienna
     recoverable, scarlet hard-block).

   Patch queue grid:
     24 px row grid, content-derived min-height per validation state.
     Container-owned scroll on .nev-review-queue.
     Push-down drawer (sibling tiles shift, no overlay).

   REF: docs/plans/2026-05-06-001-note-evolution-remediation-plan.md Wave 1
   REF: .handoffs/three-substrate-mockups-v1/INDEX.md (binding visual contract)
   ========================================================================== */

/* ----------------------------------------------------------------- *
 * Takeover host — sibling of .sol-clinical-grid-container, same     *
 * parent (.sol-workspace-main). Activates only when                 *
 * .sol-workspace-main has data-takeover="active".                   *
 * ----------------------------------------------------------------- */

#noteEvolutionTakeover {
    /* Default OFF: invisible until takeover-active flips it.
       The display:none here matches the inline style on the mount
       point so the takeover does not flash on page load. */
    display: none;
}

.sol-workspace-main[data-takeover="active"] #noteEvolutionTakeover {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    background: var(--dr-void, #120C06);
    color: var(--dr-bone, #EBE1D7);
    font-family: var(--dr-font-body, 'DM Sans', system-ui, sans-serif);
    /* 2026-08-19: --nev-surface was never defined; its #14181d fallback is a
       blue-grey from another palette. Pin the orphan to the roast ramp. */
    --nev-surface: var(--dr-espresso, #2A1C13);
    /* Container-owned scroll: the takeover never lets the browser
       scroll the underlying chart. The 3-column grid below decides
       which column scrolls. */
    overflow: hidden;
    position: relative;
    /* Account for global Voice Dictation bar at bottom of viewport */
    padding-bottom: 80px;
}

/* Hide the chart-center (clinical grid) when takeover is active.
   The census strip above and rail beside remain visible. */
.sol-workspace-main[data-takeover="active"] .sol-clinical-grid-container,
.sol-workspace-main[data-takeover="active"] #dataDrawer {
    display: none !important;
}

/* FIX (2026-05-14): defense-in-depth hide for chart panels that
   somehow leak past the parent rule. Doctor reported the LABS panel
   (and tabs) showing above the takeover work surface, eating ~30% of
   vertical real estate. The takeover IS the workspace — nothing from
   the chart center should be visible simultaneously. Body-level
   attribute set by NoteEvolutionTakeover.enter() catches the panel
   regardless of which ancestor it sits under. */
body[data-takeover-active="true"] .sol-clinical-grid-container,
body[data-takeover-active="true"] .sol-clinical-grid,
body[data-takeover-active="true"] .sol-labs-panel,
body[data-takeover-active="true"] .sol-vitals-panel,
body[data-takeover-active="true"] .sol-meds-panel,
body[data-takeover-active="true"] .sol-cultures-panel,
body[data-takeover-active="true"] .sol-timeline-prominent,
body[data-takeover-active="true"] .sol-data-timeline-panel,
body[data-takeover-active="true"] .sol-problems-panel,
body[data-takeover-active="true"] .ai-overnight-summary,
body[data-takeover-active="true"] .reasoning-tree-panel,
body[data-takeover-active="true"] .pb-panel,
body[data-takeover-active="true"] #dataDrawer,
body[data-takeover-active="true"] .data-drawer {
    display: none !important;
}

/* The global first-use voice coach covers the working note and decision row
   when the Shift Workspace owns the screen. Dictation itself remains fully
   available through the shared floating bar; only the redundant onboarding
   overlay is suppressed for the takeover lifecycle. */
body[data-takeover-active="true"] #voiceDictationHint {
    display: none !important;
}

/* Keep the unified voice control, but dock its visual footprint to the
   update-composer scale while Note Evolution owns the workspace. The v2
   left column reserves matching vertical clearance for its action row. */
body[data-takeover-active="true"] .voice-command-bar {
    max-width: 440px;
}

/* Phase A / A-2 (2026-05-09): hide the rail (#noteRail) while the takeover
   is the active surface. The takeover IS the workspace at this point —
   leaving the rail beside it produced two competing UIs in UAT.

   Why a body-level attribute (not .sol-workspace-main): #noteRail is a
   sibling of .sol-workspace-main, not a descendant, so the existing
   .sol-workspace-main[data-takeover="active"] selectors can't reach it.
   The body attribute is set/cleared by NoteEvolutionTakeover.enter() /
   exit() / resetForPatientSwitch() (search "takeoverActive" in
   note-evolution-takeover.js).

   Why !important: the rail's own visibility logic is opinionated — it
   can re-show itself via expand() or stage transitions independent of
   the takeover. The takeover-active state must be a hard override; the
   rail must stay hidden until exit() clears the attribute. */
body[data-takeover-active="true"] #noteRail {
    display: none !important;
}

/* Phase B-2 (2026-05-09): defense-in-depth selector for the in-rail
   substrate's clinical-update textarea. The Phase A-2 rule above already
   hides #nevClinicalUpdateInput by parent-cascade — the textarea lives
   inside #railStageEvolution inside #noteRail (template structure verified
   2026-05-09 at templates/census.html lines 1558, 2493, 2500). CSS
   `display: none` on a parent hides every descendant.

   Why an explicit rule anyway: Phase B unifies the dual-textarea so that
   LivingUpdateColumn._draftText is the canonical input source. If a
   future refactor lifts the textarea out of #railStageEvolution (e.g., a
   floating composer overlay), the parent-cascade hide breaks silently
   and the doctor sees two competing input surfaces again. The explicit
   selector pins the contract: "this textarea is hidden whenever takeover
   is active, regardless of where in the DOM it lives." Cheap insurance.

   Verification: parent-cascade hide is already effective. This selector
   adds zero behavior change today; it's a future-refactor safeguard. */
body[data-takeover-active="true"] #nevClinicalUpdateInput {
    display: none !important;
}

/* Warm-coffee scanline overlay (replaces the cool-teal terminal
   register). Pinned to the takeover surface, not the body, so it
   doesn't bleed onto the rail. */
#noteEvolutionTakeover::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(230, 154, 76, 0.012) 0,
            rgba(230, 154, 76, 0.012) 1px,
            transparent 1px,
            transparent 3px
        );
    z-index: 1;
}

/* ----------------------------------------------------------------- *
 * Header strip — identity tuple + close affordance                  *
 * ----------------------------------------------------------------- */

.nev-takeover-header {
    display: flex;
    align-items: center;
    gap: 12px;
    /* Tightened 2026-05-14: 8/12 -> 4/10. Recovers ~10px of vertical
       chrome above the columns. The sub-header was eating ~38px while
       only carrying eyebrow + title + identity tuple + close. */
    padding: 4px 10px;
    border-bottom: 1px solid var(--dr-crater-deep, #3C2A21);
    background: var(--dr-obsidian, #160E08);
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
}

.nev-takeover-header-title {
    font-family: var(--dr-font-heading, 'Instrument Sans', sans-serif);
    font-size: var(--dr-text-base, 0.875rem);
    font-weight: 600;
    color: var(--dr-bone, #EBE1D7);
    letter-spacing: var(--dr-tracking-wide, 0.05em);
    margin-right: auto;
    min-width: 0;
    white-space: nowrap;
}

.nev-takeover-header-title .nev-takeover-marker {
    /* "EVOLUTION" eyebrow, dim mono. */
    display: inline-block;
    margin-right: 8px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    color: var(--dr-amber, #E69A4C);
    letter-spacing: var(--dr-tracking-widest, 0.20em);
    text-transform: uppercase;
}

/* v7 state chip — derived from queue + entry state by
   NoteEvolutionWorkspace._renderQueueSummary. Five lifecycle phases:
   idle / capture / streaming / review / finalize-ready. Color codes
   the phase so the doctor reads the workspace state without inferring
   from button enable/disable. */
.nev-state-chip {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    padding: 2px 8px;
    border-radius: 3px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    border: 1px solid transparent;
    transition: color 200ms, background-color 200ms, border-color 200ms;
}
.nev-state-chip[data-nev-state="idle"] {
    color: var(--dr-stone, #6B5D54);
    border-color: rgba(107, 93, 84, 0.40);
    background: rgba(107, 93, 84, 0.06);
}
.nev-state-chip[data-nev-state="capture"] {
    color: var(--dr-teal, #4CC4B4);
    border-color: rgba(76, 196, 180, 0.45);
    background: rgba(76, 196, 180, 0.06);
}
.nev-state-chip[data-nev-state="streaming"] {
    color: var(--dr-amber, #E69A4C);
    border-color: rgba(230, 154, 76, 0.55);
    background: rgba(230, 154, 76, 0.08);
    animation: nev-state-pulse 1.6s ease-in-out infinite;
}
.nev-state-chip[data-nev-state="review"] {
    color: var(--dr-honey, #E0B870);
    border-color: rgba(224, 184, 112, 0.45);
    background: rgba(224, 184, 112, 0.08);
}
.nev-state-chip[data-nev-state="finalize-ready"] {
    color: var(--dr-gold, #DAA520);
    border-color: rgba(218, 165, 32, 0.55);
    background: rgba(218, 165, 32, 0.10);
}
@keyframes nev-state-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

/* v7 taxonomy chip row — surfaced below the queue summary when patches
   exist. Zero-suppressed: a clean queue renders no row. Each chip
   color-codes its dimension (validation / risk / category) so the
   doctor scans the queue's blocker profile without reading text. */
.nev-taxonomy-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0;
}
.nev-tax-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--dr-crater, #5A453A);
    background: var(--dr-espresso, #2A1C13);
    color: var(--dr-mocha, #8B7355);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.nev-tax-chip[data-tax="valid"] {
    color: var(--dr-gold, #DAA520);
    border-color: rgba(218, 165, 32, 0.45);
}
.nev-tax-chip[data-tax="conflict"],
.nev-tax-chip[data-tax="ambiguous_target"] {
    color: var(--dr-amber, #E69A4C);
    border-color: rgba(230, 154, 76, 0.45);
}
.nev-tax-chip[data-tax="unsupported"],
.nev-tax-chip[data-tax="awaiting_confirm"] {
    color: var(--dr-mocha, #8B7355);
    border-color: rgba(139, 115, 85, 0.50);
}
.nev-tax-chip[data-tax="stale_anchor"],
.nev-tax-chip[data-tax="stale_content_warning"] {
    color: var(--dr-brass, #BFA162);
    border-color: rgba(191, 161, 98, 0.50);
}
.nev-tax-chip[data-tax="apply_failed"],
.nev-tax-chip[data-tax="risk_high"] {
    color: var(--dr-scarlet, #C44C4C);
    border-color: rgba(196, 76, 76, 0.55);
}
.nev-tax-chip[data-tax="new_problem"] {
    color: var(--dr-burnt-sienna, #C75B39);
    border-color: rgba(199, 91, 57, 0.55);
}
.nev-tax-chip[data-tax="risk_medium"] {
    color: var(--dr-honey, #E0B870);
    border-color: rgba(224, 184, 112, 0.45);
}
.nev-tax-chip[data-tax="risk_low"] {
    color: var(--dr-sage, #A8C4A0);
    border-color: rgba(168, 196, 160, 0.45);
}

.nev-takeover-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    color: var(--dr-mocha, #8B7355);
    user-select: text;
    min-width: 0;
    overflow: hidden;
}

.nev-takeover-identity .nev-id-field {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
}

.nev-takeover-identity .nev-id-label {
    color: var(--dr-asparagus, #6E8068);
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wider, 0.10em);
}

.nev-takeover-identity .nev-id-value {
    color: var(--dr-bone, #EBE1D7);
    max-width: 9ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 2026-08-11 declutter: enc/mrn/base/gen hashes are stream-identity telemetry
   for debugging, not clinical orientation — four truncated pills of prime
   header space the doctor never reads. Collapsed to one quiet "ids" chip;
   hover or keyboard focus reveals the full set (values stay in the DOM for
   tests/tools either way). Placed AFTER the .nev-id-field base rule — source
   order decides this tie. */
.nev-takeover-identity::before {
    content: "ids";
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wider, 0.10em);
    font-size: 0.5625rem;
    color: var(--dr-asparagus, #6E8068);
    border: 1px dotted rgba(110, 128, 104, 0.5);
    border-radius: 2px;
    padding: 2px 7px;
    cursor: help;
}
.nev-takeover-identity .nev-id-field { display: none; }
.nev-takeover-identity:hover .nev-id-field,
.nev-takeover-identity:focus-within .nev-id-field {
    display: inline-flex;
}

.nev-takeover-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.nev-takeover-help {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    flex: 0 0 auto;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: 2px;
    color: var(--dr-teal, #4CC4B4);
    font: 700 var(--dr-text-xs, 0.625rem)/1 var(--dr-font-mono, 'Fira Code', monospace);
    text-decoration: none;
    transition: border-color 120ms var(--dr-easing, cubic-bezier(0.4, 0, 0.2, 1)),
                color 120ms var(--dr-easing, cubic-bezier(0.4, 0, 0.2, 1));
}

.nev-takeover-help:visited {
    color: var(--dr-teal, #4CC4B4);
}

.nev-takeover-help:hover {
    border-color: var(--dr-teal-deep, #2E8A7E);
    color: var(--dr-crema, #FFF7EE);
}

.nev-takeover-help:focus-visible {
    color: var(--dr-crema, #FFF7EE);
    outline: 2px solid var(--dr-teal, #4CC4B4);
    outline-offset: 2px;
}

.nev-takeover-close {
    background: transparent;
    border: 1px solid var(--dr-crater-deep, #3C2A21);
    color: var(--dr-bone, #EBE1D7);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-sm, 0.75rem);
    padding: 4px 12px;
    border-radius: 2px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: border-color 120ms var(--dr-easing, cubic-bezier(0.4, 0, 0.2, 1)),
                color 120ms var(--dr-easing, cubic-bezier(0.4, 0, 0.2, 1));
}

.nev-takeover-close:hover {
    border-color: var(--dr-amber, #E69A4C);
    color: var(--dr-crema, #FFF7EE);
}

.nev-takeover-close:focus-visible {
    border-color: var(--dr-amber, #E69A4C);
    color: var(--dr-crema, #FFF7EE);
    outline: 2px solid var(--dr-amber, #E69A4C);
    outline-offset: 2px;
}

.nev-takeover-close .nev-close-key {
    font-size: 0.5625rem;
    color: var(--dr-mocha, #8B7355);
    letter-spacing: var(--dr-tracking-wider, 0.10em);
}

/* ----------------------------------------------------------------- *
 * 3-column body — percent-with-floors                               *
 * ----------------------------------------------------------------- */

.nev-takeover-body {
    /* CSS Grid: three named columns + drawer area as siblings.
       The drawer columns animate from 0fr to var(--drawer-width) when
       open; that's what makes them push, not overlay.

       Column weights (REBALANCED 2026-07-01):
       - Today's Note (right) is the doctor's primary output surface;
         it grows to the majority of available width so the composed
         note is the dominant reading axis and doesn't feel too narrow.
       - Today's Update (left) holds dense fragment cards; needs
         enough room to read entries without truncation but not at the
         cost of the note.
       - Hospital Course (middle) mounts EpisodeTapestryColumn when
         __ENABLE_EPISODE_TAPESTRY (the prod default) — the embedded
         Course Tapestry whose own CSS needs at least
         --wv-label-w + --wv-now-w + one readable day cell to render a single
         hospital day without clipping. The prior 260px floor (sized
         for the legacy plain-snippet LongitudinalColumn) was ~120px
         narrower than that minimum, so the tapestry silently
         overflowed into an easy-to-miss horizontal scrollbar on every
         patient (header/pills/lane text cut off at the column edge).
         360px matches label(150) + day(~190) + chrome; day-w's own
         floor was also lowered in episode-tapestry.css to keep this
         column from eating too much of the note's width. */
    display: grid;
    grid-template-columns:
        minmax(240px, 0.60fr)           /* left  — Today Update Journal */
        minmax(360px, 0.85fr)           /* middle — Hospital Course    */
        minmax(460px, 1.65fr)           /* right — Today Working Note   */
        var(--nev-evidence-drawer-width, 0fr)
        var(--nev-audit-drawer-width, 0fr);
    gap: 8px;
    padding: 8px;
    flex: 1 1 auto;
    min-height: 0;
    background: var(--dr-void, #120C06);
    position: relative;
    z-index: 2;
    transition: grid-template-columns 320ms var(--dr-easing-ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}

/* Single-column fallback only on genuinely narrow viewports. Normal laptop
   widths should keep the three-substrate relationship visible.

   Threshold (RAISED 2026-07-01, was 980px): the 3-column floor sum is
   240+360+460=1060px content + 4*8px gaps + 16px body padding (border-box)
   = 1092px. 980px predates the middle column's 260->360px floor bump
   (episode-tapestry.css) and left a ~110px dead zone where the grid's hard
   minmax() floors exceeded the container but #noteEvolutionTakeover's
   overflow:hidden clipped instead of scrolling — content silently cut off
   rather than falling back to the (already-built, already-tested)
   single-column stack. 1120px clears the 1092px floor with margin. */
@media (max-width: 1120px) {
    .nev-takeover-body {
        grid-template-columns: 1fr;
        grid-auto-rows: minmax(320px, auto);
        overflow-y: auto;
    }
}

/* Drawer-open behavior below 1480px — OVERLAY, not track (E2 2026-07-18).
   The drawers each add a minmax(360px, 0.45fr) track (~1460px total floor
   with the 3 columns), so the previous rule collapsed the ENTIRE
   three-substrate layout to a single-column stack the moment the doctor
   opened evidence on a normal laptop — the exact "open evidence, lose the
   whole workspace" complaint. Below 1480px an OPEN drawer now leaves the
   grid alone (its track var stays 0fr) and paints as a fixed right-side
   panel instead. Push-down "drawer-not-modal" geometry is PRESERVED at
   ≥1480px where the track genuinely fits. The provenance-overlay JS gutter
   (middle-column getBoundingClientRect) works BETTER here than the old
   stack — the middle column stays laid out. */
@media (max-width: 1480px) {
    /* Doubled attribute selector ON PURPOSE: the base open-state setters
       (minmax(360px, .45fr)) live LATER in this file with equal specificity,
       and @media adds no cascade weight — without the bump these 0fr
       overrides lose at every width and the sub-1480 fix is dead CSS. */
    .nev-takeover-body[data-evidence-open="true"][data-evidence-open] {
        --nev-evidence-drawer-width: 0fr;
    }
    .nev-takeover-body[data-audit-open="true"][data-audit-open] {
        --nev-audit-drawer-width: 0fr;
    }
    .nev-takeover-body[data-evidence-open="true"] > .nev-evidence-drawer,
    .nev-takeover-body[data-audit-open="true"] > .nev-audit-drawer {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(440px, 92vw);
        z-index: 60;
        border-left: 1px solid var(--dr-crater-deep, #3C2A21);
        background: var(--dr-obsidian, #160E08);
        box-shadow: -12px 0 32px rgba(0, 0, 0, .45);
        overflow-y: auto;
    }
}

/* ----------------------------------------------------------------- *
 * Column shells                                                      *
 * ----------------------------------------------------------------- */

.nev-column {
    display: flex;
    flex-direction: column;
    background: var(--dr-obsidian, #160E08);
    border: 1px solid var(--dr-crater-deep, #3C2A21);
    border-radius: 2px;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    /* Provenance Overlay v2 (2026-05-12): host for absolutely-positioned
       .nev-provenance-dock pills that surface off-viewport linked artifacts.
       Pills sit on top of the column-body scroll without participating in
       its scroll, so they stay visible regardless of body scroll position. */
    position: relative;
}

.nev-column-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--dr-crater, #5A453A);
    background: var(--dr-dark-cacao, #1E140E);
    flex: 0 0 auto;
}

.nev-column-eyebrow {
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: 0.5625rem;
    color: var(--dr-amber, #E69A4C);
    letter-spacing: var(--dr-tracking-widest, 0.20em);
    text-transform: uppercase;
    flex: 0 0 auto;
}

.nev-column-title {
    font-family: var(--dr-font-heading, 'Instrument Sans', sans-serif);
    font-size: var(--dr-text-base, 0.875rem);
    font-weight: 600;
    color: var(--dr-bone, #EBE1D7);
    letter-spacing: 0;
    margin-right: auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nev-column-counter {
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    color: var(--dr-mocha, #8B7355);
}

.nev-column-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
}

/* The selected-patient Course Tapestry normally owns a full Problems panel
   (220px label + 120px NOW tracks). Its embedded Note Evolution profile keeps
   the same clinical renderer inside a 360px-floor middle column. Preserve the
   220px problem-name lane, compact only NOW, and use a 28px-per-day
   track minimum; longer stays scroll horizontally instead of collapsing dates
   and knots into overlapping slivers. The auxiliary Tapestry rail is omitted
   by JS; Today's Note remains the adjacent action/output column. */
.nev-column[data-column="middle"] .nev-tap-wv {
    --wv-label-w: 220px;
    --wv-now-w: 84px;
    width: 100%;
    min-width: calc(304px + var(--wv-track-min, 28px));
    max-width: none;
    border-radius: 2px;
    box-shadow: none;
}

/* Owner-directed declutter (2026-08-08): inside the takeover the tapestry is
   a CALIBRATION strip — the doctor glances at it to re-orient, then works in
   the Update composer and Today's Note. The full-surface chrome (Tapestry|
   Ledger view toggle, All/Main/Background/Resolved/Patient-level filters,
   compact toggle, count caption) belongs to the census Episode Tapestry view
   only. Hiding the toolbar leaves _viewMode at its 'lifelines' default and
   the row filter at 'all' — no JS depends on the controls existing. */
.nev-column[data-column="middle"] .nev-tap-wv .nev-tap-toolbar {
    display: none;
}

/* The "problem ↓ salience" corner label is chrome too, but its cell must
   KEEP its grid slot — the spine is a 3-column grid and display:none would
   shift the day headers into the label column. visibility keeps geometry;
   the time-range "overview" reset stays reachable (it is the only way back
   after a day-range expand). */
.nev-column[data-column="middle"] .nev-tap-wv-corner {
    visibility: hidden;
}
.nev-column[data-column="middle"] .nev-tap-wv-corner .nev-tap-wv-time-reset {
    visibility: visible;
}

/* Header telemetry is census-surface chrome, not calibration signal:
   the CURRENT STATE / TIER pill, the tier·counts·data-quality meta line,
   and the LIVE · STATE Vn pill all go. What survives is the title and the
   hospital-day block — the two things the doctor actually orients by. */
.nev-column[data-column="middle"] .nev-tap-wv-grounded,
.nev-column[data-column="middle"] .nev-tap-wv-hd-meta,
.nev-column[data-column="middle"] .nev-tap-wv-live {
    display: none;
}
.nev-column[data-column="middle"] .nev-tap-wv-header .nev-tap-header-title {
    font-size: 15px;
}
/* Day block inline: numeral and caption on one baseline instead of the
   stacked display block the full surface uses. */
.nev-column[data-column="middle"] .nev-tap-wv-dayblk {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding-left: 12px;
}
.nev-column[data-column="middle"] .nev-tap-wv-dayblk .n {
    font-size: 16px;
}

/* Course warnings: keep every message and the Retry action, but one slim
   ellipsized line each — the full text lives on the Hospital Course
   overlay, and three stacked boxes were eating the lane area the strip
   exists to show. */
.nev-column[data-column="middle"] .nev-tap-course-warnings {
    gap: 2px;
    padding: 4px 8px;
}
.nev-column[data-column="middle"] .nev-tap-course-warning {
    min-height: 0;
    padding: 3px 6px;
    font-size: 10px;
    line-height: 1.3;
}
/* 2026-08-18 polish: nowrap+ellipsis was the mitigation for banners riding
   the 700px weave scroll. The component root now clamps to the column, so
   the message wraps fully — a clinical warning is never elided. */
.nev-column[data-column="middle"] .nev-tap-course-warning .message {
    white-space: normal;
    overflow-wrap: anywhere;
}

.nev-column[data-column="middle"] > .nev-column-body {
    overflow: auto;
}

.nev-column[data-column="middle"] .nev-tap-wv-header {
    flex-wrap: wrap;
    padding: 12px 14px;
}

/* Declutter pass 2 (2026-08-08): with the meta line and telemetry pills
   hidden (below), identity + day block fit ONE row even at the 360px column
   floor — the width:100% stacking that used to force a 4-row header is
   retired. flex-wrap on the header remains the graceful fallback. */
.nev-column[data-column="middle"] .nev-tap-wv-hd-id {
    min-width: 0;
}

.nev-column[data-column="middle"] .nev-tap-wv-hd-id .tr {
    min-width: 0;
    flex-wrap: wrap;
}

.nev-column[data-column="middle"] .nev-tap-wv-src {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ----------------------------------------------------------------- *
 * Cohesive Problem Review — one row, one scroll, one decision surface *
 * ----------------------------------------------------------------- */

.nev-view-switch {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--dr-crater-deep, #3C2A21);
    border-radius: 3px;
    overflow: hidden;
}
#noteEvolutionTakeover:not([data-review-mode]) .nev-view-switch { display: none; }

.nev-view-switch-btn {
    min-height: 36px;
    padding: 6px 10px;
    border: 0;
    border-right: 1px solid var(--dr-crater-deep, #3C2A21);
    background: transparent;
    color: var(--dr-fg-secondary, #B8A99A);
    font: 700 10px/1 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .04em;
    cursor: pointer;
}

.nev-view-switch-btn:last-child { border-right: 0; }
.nev-view-switch-btn[aria-selected="true"] {
    background: rgba(76, 196, 180, .10);
    color: var(--dr-teal, #4CC4B4);
}
.nev-view-switch-btn:focus-visible {
    outline: 2px solid var(--dr-teal, #4CC4B4);
    outline-offset: -2px;
}
.nev-view-switch-btn:disabled { opacity: .42; cursor: not-allowed; }

.nev-problem-review {
    display: none;
    grid-column: 2 / 4;
    grid-row: 1;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--dr-crater-deep, #3C2A21);
    border-radius: 2px;
    background: var(--dr-obsidian, #160E08);
}

#noteEvolutionTakeover[data-review-mode="problem-review"]
    .nev-column[data-column="middle"],
#noteEvolutionTakeover[data-review-mode="problem-review"]
    .nev-column[data-column="right"] {
    display: none;
}

#noteEvolutionTakeover[data-review-mode="problem-review"] .nev-problem-review {
    display: flex;
}

#noteEvolutionTakeover[data-review-mode="full-note"] .nev-problem-review,
#noteEvolutionTakeover[data-review-mode="full-note"]
    .nev-column[data-column="middle"] {
    display: none;
}

#noteEvolutionTakeover[data-review-mode="full-note"]
    .nev-column[data-column="right"] {
    display: flex;
    grid-column: 2 / 4;
    grid-row: 1;
}

#noteEvolutionTakeover[data-review-mode="full-note"] .nev-right-shell {
    grid-template-rows: minmax(0, 1fr) 0 auto;
}
#noteEvolutionTakeover[data-review-mode="full-note"] .nev-review-queue-host {
    display: none;
}

.nev-problem-review-header,
.nev-problem-review-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 0 0 auto;
    padding: 8px 12px;
    border-bottom: 1px solid var(--dr-crater-deep, #3C2A21);
    background: var(--dr-dark-cacao, #1E140E);
}
.nev-problem-review-header > div { min-width: 0; }
.nev-problem-review-header .nev-column-title { margin: 2px 0 0; }
.nev-problem-review-summary,
.nev-problem-review-footer {
    color: var(--dr-fg-muted, #8E8074);
    font: 600 10px/1.35 var(--dr-font-mono, 'Fira Code', monospace);
}

.nev-problem-review-footer {
    border-top: 1px solid var(--dr-crater-deep, #3C2A21);
    border-bottom: 0;
}
.nev-problem-review-full-btn,
.nev-full-note-problem-return {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--dr-teal-deep, #2E8A7E);
    border-radius: 3px;
    background: transparent;
    color: var(--dr-teal, #4CC4B4);
    font: 700 9px/1 var(--dr-font-mono, 'Fira Code', monospace);
    cursor: pointer;
}
.nev-problem-review-full-btn:focus-visible,
.nev-full-note-problem-return:focus-visible {
    outline: 2px solid var(--dr-teal, #4CC4B4);
    outline-offset: 2px;
}

.nev-problem-review-days {
    flex: 0 0 auto;
    min-width: 0;
    border-bottom: 1px solid var(--dr-crater-deep, #3C2A21);
    background: rgba(30, 20, 14, .72);
}
.nev-problem-day-spine {
    display: flex;
    align-items: stretch;
    min-width: 0;
}
.nev-problem-day-spine-label {
    display: flex;
    align-items: center;
    flex: 0 0 112px;
    padding: 6px 10px;
    border-right: 1px solid var(--dr-crater-deep, #3C2A21);
    color: var(--dr-brass, #BFA162);
    font: 700 9px/1.2 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .05em;
    text-transform: uppercase;
}
.nev-problem-day-spine-controls {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}
.nev-problem-day-spine-btn {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    align-items: center;
    justify-content: center;
    column-gap: 5px;
    flex: 1 0 72px;
    min-height: 42px;
    padding: 4px 7px;
    border: 0;
    border-right: 1px solid var(--dr-crater-deep, #3C2A21);
    background: transparent;
    color: var(--dr-mocha, #8B7355);
    font: 700 10px/1.1 var(--dr-font-mono, 'Fira Code', monospace);
    cursor: pointer;
}
.nev-problem-day-spine.is-adaptive .nev-problem-day-spine-btn {
    flex-basis: 52px;
}
.nev-problem-day-spine-btn.is-admission {
    flex-basis: 88px;
    background: rgba(191, 161, 98, .08);
    box-shadow: inset 2px 0 0 var(--dr-brass, #BFA162);
    color: var(--dr-bone, #EBE1D7);
}
.nev-problem-day-spine-btn.is-range {
    position: relative;
    grid-template-columns: 1fr auto;
    flex-basis: 92px;
    background: rgba(191, 161, 98, .035);
    color: var(--dr-brass, #BFA162);
    cursor: zoom-in;
}
.nev-problem-day-spine-btn.is-range small { grid-column: 1 / -1; }
.nev-problem-day-spine-btn.is-range em {
    position: absolute;
    align-self: start;
    justify-self: end;
    padding: 2px 3px;
}
.nev-problem-day-spine-btn small,
.nev-problem-day-spine-btn em {
    color: var(--dr-mocha, #8B7355);
    font: 600 8px/1 var(--dr-font-mono, 'Fira Code', monospace);
    font-style: normal;
}
.nev-problem-day-spine-btn small { grid-column: 1 / -1; }
.nev-problem-day-spine-btn.is-selected {
    background: rgba(76, 196, 180, .10);
    box-shadow: inset 0 -2px 0 var(--dr-teal, #4CC4B4);
    color: var(--dr-teal, #4CC4B4);
}
.nev-problem-day-spine-btn.is-selected em { color: var(--dr-teal, #4CC4B4); }
.nev-problem-day-spine-btn:focus-visible {
    outline: 2px solid var(--dr-teal, #4CC4B4);
    outline-offset: -2px;
}

.nev-problem-band-head {
    display: grid;
    grid-template-columns: minmax(330px, .92fr) minmax(400px, 1.08fr);
    flex: 0 0 auto;
    border-bottom: 1px solid var(--dr-crater-deep, #3C2A21);
    color: var(--dr-brass, #BFA162);
    font: 700 9px/1 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.nev-problem-band-head > span { padding: 7px 12px; }
.nev-problem-band-head > span + span {
    border-left: 1px solid var(--dr-crater-deep, #3C2A21);
}

.nev-problem-band-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 8px;
    scrollbar-gutter: stable;
}

/* Note Evolution BHC roll-forward: one note-level decision, intentionally
 * outside the problem roster so it can never be mistaken for Unlinked. */
.nev-bhc-review-band {
    margin: 0 0 10px;
    padding: 12px;
    border: 1px solid rgba(76, 196, 180, .46);
    border-left: 3px solid var(--dr-teal, #4CC4B4);
    background: linear-gradient(135deg, rgba(76, 196, 180, .075), rgba(18, 12, 6, .96));
    color: var(--dr-bone, #EBE1D7);
}
.nev-bhc-review-band.is-loading,
.nev-bhc-review-band.is-unchanged {
    padding: 8px 10px;
    border-color: rgba(139, 115, 85, .38);
    border-left-color: var(--dr-mocha, #8B7355);
    background: rgba(30, 20, 14, .48);
}
.nev-bhc-review-band.is-failed,
.nev-bhc-review-band.is-unavailable {
    border-color: rgba(230, 154, 76, .46);
    border-left-color: var(--dr-amber, #E69A4C);
    background: rgba(230, 154, 76, .045);
}
.nev-bhc-review-heading,
.nev-bhc-unchanged summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.nev-bhc-unchanged summary { cursor: pointer; }
.nev-bhc-review-heading h4 {
    margin: 2px 0 0;
    color: var(--dr-crema, #FFF7EE);
    font: 750 15px/1.2 var(--dr-font-heading, 'Instrument Sans', sans-serif);
}
.nev-bhc-review-eyebrow,
.nev-bhc-edit-label {
    color: var(--dr-teal, #4CC4B4);
    font: 700 9px/1.2 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.nev-bhc-review-quiet {
    color: var(--dr-fg-muted, #8E8074);
    font: 600 10px/1.4 var(--dr-font-mono, 'Fira Code', monospace);
}
.nev-bhc-review-band > p,
.nev-bhc-unchanged > p {
    margin: 8px 0;
    color: var(--dr-brass, #BFA162);
    font-size: 12px;
}
.nev-bhc-review-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(230px, .6fr);
    gap: 10px;
    margin-top: 10px;
}
.nev-bhc-proposal,
.nev-bhc-evidence {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(191, 161, 98, .30);
    background: rgba(18, 12, 6, .62);
}
.nev-bhc-proposal h5,
.nev-bhc-evidence h5 {
    margin: 0 0 7px;
    color: var(--dr-brass, #BFA162);
    font: 700 9px/1.2 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .06em;
    text-transform: uppercase;
}
.nev-bhc-copy {
    color: var(--dr-bone, #EBE1D7);
    font: 500 12px/1.55 var(--dr-font-body, 'DM Sans', system-ui, sans-serif);
    white-space: pre-wrap;
}
/* Today's addition to the course (2026-09-06): tinted so the new interval
 * reads apart from the carried prior course; the date stamp is the anchor. */
.nev-bhc-copy-added {
    background: color-mix(in srgb, var(--dr-harvest, #C8963E) 14%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--dr-harvest, #C8963E) 14%, transparent);
    border-radius: 3px;
    color: var(--dr-bone, #EBE1D7);
}
.nev-bhc-copy-stamp {
    color: var(--dr-harvest, #C8963E);
    font-weight: 700;
    letter-spacing: 0.02em;
}
/* Advisory badges (2026-09-01): former fail-closed contract codes.
 * Amber, not red — they never block Finalize. */
.nev-bhc-advisories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}
.nev-bhc-advisory {
    display: inline-block;
    padding: 2px 7px;
    border: 1px solid rgba(230, 154, 76, .46);
    border-radius: 999px;
    background: rgba(230, 154, 76, .12);
    color: var(--dr-amber, #E69A4C);
    font: 700 9px/1.4 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .04em;
}
.nev-bhc-milestones {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 17px;
    color: var(--dr-bone, #EBE1D7);
    font-size: 11px;
    line-height: 1.45;
}
.nev-bhc-prior { margin-top: 9px; }
.nev-bhc-prior summary {
    color: var(--dr-mocha, #8B7355);
    font: 650 9px/1.2 var(--dr-font-mono, 'Fira Code', monospace);
    cursor: pointer;
}
.nev-bhc-prior[open] .nev-bhc-copy,
.nev-bhc-unchanged[open] .nev-bhc-copy {
    margin-top: 8px;
    padding: 8px;
    border-left: 2px solid rgba(139, 115, 85, .48);
    color: var(--dr-brass, #BFA162);
}
.nev-bhc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 11px;
}
.nev-bhc-btn {
    min-height: 30px;
    padding: 5px 11px;
    border: 1px solid var(--dr-crater, #5A453A);
    border-radius: 3px;
    background: transparent;
    color: var(--dr-bone, #EBE1D7);
    font: 700 9px/1 var(--dr-font-mono, 'Fira Code', monospace);
    cursor: pointer;
}
.nev-bhc-btn.accept { border-color: var(--dr-teal, #4CC4B4); color: var(--dr-teal, #4CC4B4); }
.nev-bhc-btn.keep { border-color: var(--dr-amber, #E69A4C); color: var(--dr-amber, #E69A4C); }
.nev-bhc-btn:hover { background: rgba(255, 247, 238, .07); }
.nev-bhc-btn:focus-visible {
    background: rgba(255, 247, 238, .07);
    outline: 2px solid var(--dr-teal, #4CC4B4);
    outline-offset: 2px;
}
.nev-bhc-edit-label { display: block; margin-top: 10px; }
.nev-bhc-edit-draft {
    width: 100%;
    min-height: 150px;
    margin-top: 6px;
    padding: 9px;
    resize: vertical;
    border: 1px solid var(--dr-teal-deep, #2E8A7E);
    border-radius: 3px;
    background: var(--dr-void, #120C06);
    color: var(--dr-crema, #FFF7EE);
    font: 500 12px/1.5 var(--dr-font-body, 'DM Sans', system-ui, sans-serif);
}
.nev-bhc-decision-status {
    display: inline-flex;
    margin-top: 10px;
    padding: 5px 8px;
    border: 1px solid rgba(76, 196, 180, .42);
    color: var(--dr-teal, #4CC4B4);
    font: 700 9px/1.2 var(--dr-font-mono, 'Fira Code', monospace);
}
.nev-bhc-decision-status.is-rejected {
    border-color: rgba(230, 154, 76, .44);
    color: var(--dr-amber, #E69A4C);
}
.nev-bhc-section-replacement {
    display: grid;
    gap: 8px;
    padding: 8px 0;
}
.nev-bhc-section-replacement .nev-patch-pending-badge {
    justify-self: start;
}

@media (max-width: 900px) {
    .nev-bhc-review-grid { grid-template-columns: 1fr; }
}

.nev-problem-band {
    margin-bottom: 7px;
    border: 1px solid var(--dr-crater-deep, #3C2A21);
    border-left: 3px solid var(--dr-crater, #5A453A);
    background: var(--dr-void, #120C06);
}
.nev-problem-band.is-selected {
    border-left-color: var(--dr-teal, #4CC4B4);
    box-shadow: inset 0 0 0 1px rgba(76, 196, 180, .20);
}
.nev-problem-band.is-unlinked {
    border-left-color: var(--dr-amber, #E69A4C);
    border-style: dashed;
}
.nev-problem-band.is-note-only { border-left-color: var(--dr-brass, #BFA162); }
.nev-problem-band.is-provisional { border-left-color: var(--dr-gold, #DAA520); }

.nev-problem-band-toggle {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 7px 10px;
    border: 0;
    border-bottom: 1px solid transparent;
    background: var(--dr-espresso, #2A1C13);
    color: var(--dr-bone, #EBE1D7);
    text-align: left;
    cursor: pointer;
}
.nev-problem-band.is-expanded .nev-problem-band-toggle {
    border-bottom-color: var(--dr-crater-deep, #3C2A21);
}
.nev-problem-band-toggle:focus-visible {
    outline: 2px solid var(--dr-teal, #4CC4B4);
    outline-offset: -2px;
}
.nev-problem-band-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: 750 13px/1.25 var(--dr-font-heading, 'Instrument Sans', sans-serif);
}
.nev-problem-band-chevron,
.nev-problem-band-status,
.nev-problem-band-count {
    color: var(--dr-brass, #BFA162);
    font: 650 9px/1.2 var(--dr-font-mono, 'Fira Code', monospace);
    white-space: nowrap;
}
.nev-problem-band-count.quiet { color: var(--dr-fg-muted, #8E8074); }

.nev-problem-band-body {
    display: grid;
    grid-template-columns: minmax(330px, .92fr) minmax(400px, 1.08fr);
    min-width: 0;
    align-items: stretch;
}
.nev-problem-band-body[hidden] { display: none; }
.nev-problem-band-course,
.nev-problem-band-note {
    min-width: 0;
    padding: 10px;
}
.nev-problem-band-note {
    border-left: 1px solid var(--dr-crater-deep, #3C2A21);
    background: rgba(255, 247, 238, .012);
}
.nev-problem-band-local-label {
    display: none;
    margin: 0 0 8px;
    color: var(--dr-brass, #BFA162);
    font: 700 9px/1 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.nev-problem-band-course-empty,
.nev-problem-band-note-empty,
.nev-problem-band-note-only-note,
.nev-problem-band-unlinked-note {
    margin: 0;
    padding: 4px 10px;
    border: 1px dashed rgba(139, 115, 85, .55);
    background: rgba(0, 0, 0, .22); /* recessed well — transparent + .40 dash measured near-invisible on the dark planes */
    color: var(--dr-mocha, #8B7355); /* --dr-fg-muted resolves ~#504540 on this page (~1.9:1) — below reading threshold */
    font: 600 10px/1.4 var(--dr-font-mono, 'Fira Code', monospace);
}
.nev-problem-band-note-only-note {
    margin-bottom: 8px;
    border-style: solid;
    color: var(--dr-brass, #BFA162);
}
.nev-problem-band-unlinked-note { margin-bottom: 8px; color: var(--dr-amber, #E69A4C); }

.nev-problem-review-empty {
    margin: 12px;
    padding: 18px;
    border: 1px dashed rgba(139, 115, 85, .55);
    border-left: 3px solid var(--dr-brass, #BFA162);
    background: rgba(30, 20, 14, .58);
}
.nev-problem-review-empty.is-unavailable {
    border-left-color: var(--dr-amber, #E69A4C);
    background: rgba(230, 154, 76, .045);
}
.nev-problem-review-empty-title {
    margin: 0 0 6px;
    color: var(--dr-bone, #EBE1D7);
    font: 700 14px/1.25 var(--dr-font-heading, 'Instrument Sans', sans-serif);
}
.nev-problem-review-empty-copy {
    margin: 0;
    color: var(--dr-brass, #BFA162);
    font: 600 11px/1.5 var(--dr-font-mono, 'Fira Code', monospace);
}
.nev-problem-review-retry,
.nev-entry-retry-btn {
    margin-top: 12px;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid var(--dr-amber, #E69A4C);
    border-radius: 3px;
    background: transparent;
    color: var(--dr-amber, #E69A4C);
    font: 700 9px/1 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
}
.nev-problem-review-retry:hover,
.nev-problem-review-retry:focus-visible,
.nev-entry-retry-btn:hover,
.nev-entry-retry-btn:focus-visible {
    border-color: var(--dr-amber-hot, #D2691E);
    color: var(--dr-crema, #FFF7EE);
    outline: none;
}

.nev-problem-band-note-projection > .nev-bn-problem {
    margin: 0;
    box-shadow: none;
}
.nev-problem-band-note-projection > .nev-bn-problem + .nev-bn-problem {
    margin-top: 8px;
}
.nev-problem-band-decisions {
    display: grid;
    gap: 7px;
    margin-top: 9px;
}
.nev-problem-band-decision {
    padding: 8px;
    border: 1px solid rgba(191, 161, 98, .36);
    border-left: 3px solid var(--dr-amber, #E69A4C);
    background: rgba(230, 154, 76, .045);
}
.nev-problem-band-decision[data-status="accepted"],
.nev-problem-band-decision[data-status="edited"] {
    border-left-color: var(--dr-teal, #4CC4B4);
}
.nev-problem-band-decision[data-status="rejected"] {
    border-left-color: var(--dr-mocha, #8B7355);
    opacity: .78;
}
.nev-problem-band.has-state-conflict {
    border-color: rgba(230, 154, 76, .72);
    box-shadow: inset 3px 0 0 var(--dr-amber, #E69A4C);
}
.nev-problem-band-count.needs-rereview {
    padding: 3px 6px;
    border: 1px solid rgba(230, 154, 76, .62);
    border-radius: 999px;
    color: var(--dr-crema, #FFF7EE);
    background: rgba(230, 154, 76, .18);
}
.nev-finalize-state-conflict {
    display: grid;
    gap: 5px;
    margin: 0 0 8px;
    padding: 9px 10px;
    border: 1px solid rgba(230, 154, 76, .62);
    border-left: 3px solid var(--dr-amber, #E69A4C);
    border-radius: 3px;
    background: rgba(230, 154, 76, .10);
    color: var(--dr-crema, #FFF7EE);
    font-size: 11px;
    line-height: 1.42;
}
.nev-finalize-state-conflict strong {
    color: var(--dr-amber, #E69A4C);
    font: 700 10px/1.3 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .035em;
    text-transform: uppercase;
}
.nev-detached-state-conflicts {
    display: grid;
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px;
    border: 1px solid rgba(230, 154, 76, .48);
    border-radius: 3px;
    background: rgba(230, 154, 76, .06);
}
.nev-detached-state-conflicts > h3,
.nev-detached-state-conflicts > p {
    margin: 0;
}
.nev-detached-state-conflicts > h3 {
    color: var(--dr-amber, #E69A4C);
    font: 700 11px/1.3 var(--dr-font-mono, 'Fira Code', monospace);
    text-transform: uppercase;
}
.nev-detached-state-conflicts > p {
    color: var(--dr-sand, #C7B299);
    font-size: 11px;
    line-height: 1.4;
}
.nev-state-rereview-btn {
    justify-self: start;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid var(--dr-amber, #E69A4C);
    border-radius: 3px;
    background: rgba(18, 12, 6, .72);
    color: var(--dr-crema, #FFF7EE);
    font: 700 10px/1.25 var(--dr-font-mono, 'Fira Code', monospace);
    cursor: pointer;
}
.nev-state-rereview-btn:hover {
    background: rgba(230, 154, 76, .18);
}
.nev-state-rereview-btn:focus-visible {
    outline: 2px solid var(--dr-crema, #FFF7EE);
    outline-offset: 2px;
}
.nev-problem-band-decision-copy {
    display: grid;
    gap: 6px;
    margin-bottom: 7px;
}
.nev-problem-band-decision-kind {
    color: var(--dr-brass, #BFA162);
    font: 700 10.5px/1.35 var(--dr-font-mono, 'Fira Code', monospace);
    text-transform: uppercase;
}
/* Retain the legacy one-line projection style for cached/static fixtures. */
.nev-problem-band-decision-text {
    color: var(--dr-bone, #EBE1D7);
    font-size: 12px;
    line-height: 1.45;
}
.nev-problem-band-fact-cues {
    display: grid;
    gap: 0;
    min-width: 0;
    margin: 0;
}
.nev-problem-band-fact-row {
    display: grid;
    grid-template-columns: minmax(82px, 108px) minmax(0, 1fr);
    gap: 8px;
    padding: 5px 0;
    border-top: 1px solid rgba(191, 161, 98, .14);
}
.nev-problem-band-fact-row:first-child {
    border-top: 0;
}
.nev-problem-band-fact-row dt {
    color: var(--dr-brass, #BFA162);
    font: 700 11px/1.45 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .015em;
}
.nev-problem-band-fact-row dd {
    min-width: 0;
    margin: 0;
    color: var(--dr-bone, #EBE1D7);
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.nev-problem-band-fact-row dd.is-muted {
    color: var(--dr-brass, #BFA162);
    font-style: italic;
}
.nev-problem-band-fact-row[data-cue="soma"] dt {
    color: var(--dr-amber, #E69A4C);
}
.nev-problem-band-fact-row[data-cue="update"] dt {
    color: var(--dr-olive, #879A39);
}
.nev-problem-band-fact-row[data-cue="state"] dt {
    color: var(--dr-amber, #E69A4C);
}
.nev-problem-band-fact-row[data-cue="physician"] dt {
    color: var(--dr-gold, #F5C24A);
}
.nev-problem-band-decision[data-status="accepted"]
    .nev-problem-band-fact-row[data-cue="state"] dt,
.nev-problem-band-decision[data-status="edited"]
    .nev-problem-band-fact-row[data-cue="state"] dt {
    color: var(--dr-teal, #4CC4B4);
}
.nev-problem-band-decision[data-status="rejected"]
    .nev-problem-band-fact-row[data-cue="state"] dt {
    color: var(--dr-brass, #BFA162);
}
.nev-problem-band-status-note {
    color: var(--dr-brass, #BFA162);
    font: 600 10.5px/1.35 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .015em;
}

@media (max-width: 520px) {
    .nev-problem-band-fact-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    .nev-state-rereview-btn {
        width: 100%;
        min-height: 40px;
    }
}

/* Reuse the real Tapestry lane renderer inside the Course half. */
.nev-problem-band-course .nev-problem-band-course-adapter {
    --wv-label-w: 210px;
    --wv-now-w: 82px;
    width: 100%;
    min-width: 0;
    border: 0;
    box-shadow: none;
}
.nev-problem-band-course .nev-tap-wv-lane {
    width: 100%;
    min-height: 46px;
    height: auto;
}

.nev-full-note-problem-return { margin-left: auto; }

@media (max-width: 1120px) {
    .nev-problem-review,
    #noteEvolutionTakeover[data-review-mode="full-note"]
        .nev-column[data-column="right"] {
        grid-column: 1;
        grid-row: auto;
        min-height: 620px;
    }
    .nev-problem-band-head,
    .nev-problem-band-body {
        grid-template-columns: 1fr;
    }
    .nev-problem-band-head > span + span,
    .nev-problem-band-note {
        border-left: 0;
        border-top: 1px solid var(--dr-crater-deep, #3C2A21);
    }
    .nev-problem-band-head { display: none; }
    .nev-problem-band-local-label { display: block; }
}

@media (max-width: 760px) {
    .nev-takeover-header { flex-wrap: wrap; gap: 6px 8px; }
    .nev-takeover-header-title {
        flex: 1 1 180px;
        margin-right: 0;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        line-height: 1.2;
    }
    .nev-takeover-actions {
        order: 2;
        flex: 1 0 100%;
        justify-content: flex-end;
    }
    .nev-takeover-help,
    .nev-takeover-close {
        min-height: 40px;
    }
    .nev-takeover-identity { order: 3; flex: 1 1 100%; }
    .nev-view-switch { order: 4; flex: 1 0 100%; width: 100%; }
    .nev-view-switch-btn { flex: 1 1 50%; }
    #noteEvolutionTakeover[data-review-mode="problem-review"]
        .nev-takeover-body {
        /* The 1120px fallback gives every legacy substrate a 320px floor.
           Problem Review hides those legacy middle/right rows, so retaining
           that floor leaves a false blank shelf beneath the compact update
           inbox. Let the visible update row size to its own capped content. */
        grid-auto-rows: auto;
    }
    #noteEvolutionTakeover[data-review-mode="problem-review"]
        .nev-column[data-column="left"] {
        max-height: none;
    }
    #noteEvolutionTakeover[data-review-mode="problem-review"]
        .nev-column[data-column="left"] .nev-living-update {
        /* Keep the real textarea, voice state, and action row on-screen while
           leaving the entry thread as the one bounded internal scroll lane. */
        height: clamp(300px, 45vh, 380px);
    }
    .nev-problem-review-header,
    .nev-problem-review-footer { align-items: flex-start; flex-direction: column; }
    .nev-problem-band-toggle {
        grid-template-columns: 16px minmax(0, 1fr) auto;
    }
    .nev-problem-band-status { display: none; }
    .nev-problem-band-course .nev-problem-band-course-adapter {
        --wv-label-w: 175px;
        --wv-now-w: 0px;
        overflow-x: auto;
    }
    .nev-problem-band-course .nev-tap-wv-now {
        display: none;
    }
    .nev-problem-band-course
        .nev-tap-wv-lane.is-provisional .nev-tap-wv-label .nm {
        flex-wrap: wrap;
        align-content: center;
        row-gap: 2px;
    }
    .nev-problem-band-course
        .nev-tap-wv-lane.is-provisional .nev-tap-lane-nm {
        flex-basis: 100%;
    }
    .nev-problem-band-course .nev-tap-wv-provisional-mobile {
        display: inline-flex;
        flex: 1 0 100%;
        color: var(--dr-brass, #BFA162);
        font: 700 9px/1.2 var(--dr-font-mono, 'Fira Code', monospace);
        letter-spacing: .01em;
        white-space: normal;
    }
}

/* ----------------------------------------------------------------- *
 * Left — Today Update Journal                                        *
 * Voice-strip anchor coupling: textarea 240 min, voice 72 anchored   *
 * bottom 16, total floor 380.                                        *
 * ----------------------------------------------------------------- */

.nev-living-update {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    min-height: 0;
}

.nev-entry-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

.nev-entry-thread-empty {
    /* 12px vertical (2026-08-11, was 24px): in the v2 full-note rail the
       composer competes for ~340px; a fat hint card pushed Add Entry /
       Propose below the fold. */
    padding: 12px 8px;
    text-align: center;
    color: var(--dr-mocha, #8B7355);
    font-size: var(--dr-text-sm, 0.75rem);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: var(--dr-tracking-wide, 0.05em);
}
.nev-entry-error-note {
    max-width: 44ch;
    margin: 8px auto 0;
    color: var(--dr-brass, #BFA162);
    line-height: 1.45;
    letter-spacing: 0;
}

/* Empty-thread space handoff (2026-08-11): with no entries yet, the thread's
   flex:1 stretched a one-line placeholder to ~430px while the composer
   textarea sat at its 96px v2 minimum below it — the doctor's primary typing
   surface was the smallest thing in the column. When the thread holds ONLY
   the empty/loading/error card, collapse it to natural height and hand the
   freed space to the composer. The #noteEvolutionTakeover prefix is
   load-bearing: the v2 skin sets min-height:96px at ID specificity
   (note-evolution-workspace-v2.css), and a class-only override loses. */
#noteEvolutionTakeover .nev-entry-thread:has(> .nev-entry-thread-empty:only-child) {
    flex: 0 0 auto;
}
#noteEvolutionTakeover
    .nev-living-update:has(> .nev-entry-thread > .nev-entry-thread-empty:only-child)
    .nev-entry-composer {
    flex: 1 1 auto;
}
#noteEvolutionTakeover
    .nev-living-update:has(> .nev-entry-thread > .nev-entry-thread-empty:only-child)
    .nev-entry-textarea {
    flex: 1 1 auto;
    /* Floor stays at the v2 skin's 96px (2026-08-11): flex-grow does the
       real work — in a tall column the textarea absorbs all freed space; in
       the short v2 full-note rail a taller floor just forced the action row
       below the fold. The floor only binds when space is scarce, and when
       space is scarce shrinking is the right answer. */
    min-height: 96px;
    max-height: none;
}

.nev-entry-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    background: var(--dr-espresso, #2A1C13);
    border: 1px solid var(--dr-crater, #5A453A);
    border-left: 2px solid var(--dr-amber, #E69A4C);
    border-radius: 2px;
}

.nev-entry-card[data-source="voice_final"] {
    border-left-color: var(--dr-teal, #4CC4B4);
}

.nev-entry-card[data-source="paste"] {
    border-left-color: var(--dr-brass, #BFA162);
}

.nev-entry-card[data-source="system"] {
    border-left-color: var(--dr-asparagus, #6E8068);
}

.nev-entry-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: 9px;
    color: var(--dr-mocha, #8B7355);
    letter-spacing: var(--dr-tracking-wide, 0.05em);
}

.nev-entry-meta .nev-entry-time {
    color: var(--dr-bone, #EBE1D7);
}

.nev-entry-meta .nev-entry-source {
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wider, 0.10em);
    color: var(--dr-amber, #E69A4C);
}

/* effective_at (2026-07-10): asserted clinical event date ("for Jul 9").
   Distinct hue from source/status so "when it happened" reads apart from
   "when it was entered". Absent when the date is unresolved. */
.nev-entry-meta .nev-entry-effective {
    color: var(--dr-teal, #7FA8A0);
    font-style: italic;
}

.nev-entry-meta .nev-entry-status {
    margin-left: auto;
    color: var(--dr-asparagus, #6E8068);
}

.nev-entry-card[data-status="draft"] .nev-entry-status {
    color: var(--dr-amber, #E69A4C);
    font-weight: 700;
}

.nev-entry-card[data-status="processed"] .nev-entry-status {
    color: var(--dr-asparagus, #6E8068);
    opacity: .78;
}

.nev-entry-text {
    font-size: 11.5px;
    color: var(--dr-bone, #EBE1D7);
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.nev-entry-routing {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.nev-entry-routing .nev-routing-chip {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--dr-crater, #5A453A);
    border-radius: 2px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: 0.5625rem;
    color: var(--dr-mocha, #8B7355);
    letter-spacing: var(--dr-tracking-wide, 0.05em);
}

/* New-entry composer */
.nev-entry-composer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 auto;
    min-height: 0;
}

.nev-entry-textarea {
    min-height: 132px;
    max-height: min(32vh, 240px);
    background: var(--dr-espresso, #2A1C13);
    border: 1px solid var(--dr-crater, #5A453A);
    border-radius: 2px;
    padding: 10px 12px;
    color: var(--dr-bone, #EBE1D7);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-sm, 0.75rem);
    line-height: 1.55;
    resize: vertical;
}

.nev-entry-textarea::placeholder {
    color: var(--dr-mocha, #8B7355);
    font-style: italic;
}

.nev-entry-textarea:focus {
    outline: none;
    border-color: var(--dr-amber, #E69A4C);
}

/* Optional clinical event time. Kept collapsed during routine entry so the
   fast path stays one textarea + two actions; expanded only when the doctor
   needs to say "entered today, happened earlier." */
.nev-entry-timing {
    align-self: flex-start;
    max-width: 100%;
}

.nev-entry-timing-toggle {
    min-height: 34px;
    padding: 5px 9px;
    border: 1px solid var(--dr-crater-deep, #3C2A21);
    border-radius: 2px;
    background: transparent;
    color: var(--dr-fg-secondary, #B8A99A);
    font: 600 var(--dr-text-xs, 0.625rem)/1.35 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: var(--dr-tracking-wide, 0.05em);
    text-transform: uppercase;
    cursor: pointer;
}

.nev-entry-timing.has-value .nev-entry-timing-toggle {
    border-color: var(--dr-teal, #7FA8A0);
    color: var(--dr-teal, #7FA8A0);
}

.nev-entry-timing-toggle:hover,
.nev-entry-timing-toggle:focus-visible,
.nev-entry-effective-input:focus-visible,
.nev-entry-effective-clear:focus-visible {
    border-color: var(--dr-amber, #E69A4C);
    outline: 2px solid color-mix(in srgb, var(--dr-amber, #E69A4C) 45%, transparent);
    outline-offset: 2px;
}

.nev-entry-timing-fields {
    display: grid;
    gap: 6px;
    width: min(100%, 300px);
    margin-top: 6px;
    padding: 9px;
    border: 1px solid var(--dr-crater-deep, #3C2A21);
    border-radius: 2px;
    background: var(--dr-dark-cacao, #1E140E);
}

.nev-entry-timing-fields[hidden] {
    display: none;
}

.nev-entry-timing-fields > label {
    color: var(--dr-bone, #EBE1D7);
    font: 600 var(--dr-text-xs, 0.625rem)/1.35 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: var(--dr-tracking-wide, 0.05em);
    text-transform: uppercase;
}

.nev-entry-timing-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
}

.nev-entry-effective-input,
.nev-entry-effective-clear {
    min-height: 36px;
    border: 1px solid var(--dr-crater, #5A453A);
    border-radius: 2px;
    background: var(--dr-page, #0C0B0A);
    color: var(--dr-bone, #EBE1D7);
    font: var(--dr-text-sm, 0.75rem)/1.35 var(--dr-font-mono, 'Fira Code', monospace);
}

.nev-entry-effective-input {
    min-width: 0;
    padding: 5px 7px;
    color-scheme: dark;
}

.nev-entry-effective-clear {
    padding: 5px 9px;
    cursor: pointer;
}

.nev-entry-effective-clear:disabled {
    color: var(--dr-fg-muted, #8E8074);
    cursor: not-allowed;
    opacity: .7;
}

.nev-entry-timing-fields > small {
    color: var(--dr-fg-secondary, #B8A99A);
    font-size: var(--dr-text-xs, 0.625rem);
    line-height: 1.45;
}

.nev-voice-strip {
    min-height: 52px;
    margin-bottom: 0;
    background: var(--dr-espresso, #2A1C13);
    border: 1px solid var(--dr-crater, #5A453A);
    border-radius: 2px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    color: var(--dr-mocha, #8B7355);
}

.nev-voice-strip .nev-voice-status {
    flex: 1;
    color: var(--dr-asparagus, #6E8068);
}

/* Wave 2 / 2f — voice interim ghost text. Renders BELOW the textarea,
   above the voice strip. Italic, --dr-mocha (secondary text), display
   only — never persisted. Per CONTRACT.md §3 and INDEX.md voice flow. */
.nev-voice-ghost {
    /* sits between textarea and voice strip; minimum vertical space so
       the layout doesn't jitter when ghost appears/disappears */
    min-height: 24px;
    padding: 4px 12px;
    margin: 0;
    color: var(--dr-mocha, #8B7355);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    font-style: italic;
    line-height: 1.55;
    overflow: hidden;
    text-overflow: ellipsis;
    /* hidden by default; the JS adds .is-active when interim text exists */
    visibility: hidden;
}

.nev-voice-ghost.is-active {
    visibility: visible;
}

.nev-entry-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.nev-entry-actions button {
    background: transparent;
    border: 1px solid var(--dr-crater, #5A453A);
    color: var(--dr-bone, #EBE1D7);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    padding: 6px 10px;
    border-radius: 2px;
    cursor: pointer;
    letter-spacing: var(--dr-tracking-wide, 0.05em);
    text-transform: uppercase;
    transition: border-color 120ms, color 120ms;
}

.nev-entry-actions button:hover,
.nev-entry-actions button:focus-visible {
    border-color: var(--dr-amber, #E69A4C);
    color: var(--dr-crema, #FFF7EE);
    outline: none;
}

.nev-entry-actions button.primary {
    border-color: var(--dr-amber, #E69A4C);
    color: var(--dr-amber, #E69A4C);
}

.nev-entry-actions button.primary:hover,
.nev-entry-actions button.primary:focus-visible {
    color: var(--dr-crema, #FFF7EE);
    border-color: var(--dr-amber-hot, #D2691E);
}
.nev-entry-actions button:disabled,
.nev-entry-actions button:disabled:hover {
    border-color: var(--dr-crater, #5A453A);
    color: var(--dr-fg-muted, #8E8074);
    cursor: not-allowed;
    opacity: .7;
}

/* ----------------------------------------------------------------- *
 * Middle — Hospital Course / legacy longitudinal hierarchy board   *
 * ----------------------------------------------------------------- */


.nev-longitudinal-card[data-status="active"] { 
    border-left-color: var(--dr-amber, #E69A4C); 
    background: rgba(230, 154, 76, 0.05);
}
.nev-longitudinal-card[data-status="worsening"] { 
    border-left-color: var(--severity-worsening, #C25F90);
    background: color-mix(in srgb, var(--severity-worsening, #C25F90) 16%, transparent); /* 8-10% wash over obsidian measured invisible; hue stays theme-derived */
}
.nev-longitudinal-card[data-status="worsening"] .nev-longitudinal-name {
    color: var(--severity-worsening, #C25F90);
}
.nev-longitudinal-card[data-status="improving"] { 
    border-left-color: var(--severity-improving, #D4A040);
}
.nev-longitudinal-card[data-status="stable"] { 
    border-left-color: var(--severity-stable, #879A39);
}
.nev-longitudinal-card[data-status="monitoring"] { 
    border-left-color: var(--dr-brass, #BFA162); 
}
.nev-longitudinal-card[data-status="resolved"],
.nev-longitudinal-card[data-status="resolving"] { 
    border-left-color: var(--dr-crater, #5A453A); 
    opacity: 0.6;
    background: transparent;
}

/* Wave 1 visual nicety: pulse border-left when LS problem is "consulted"
   during an active generation. Reduced-motion safe via the body rule
   in dark-roast-tokens.css. */
.nev-longitudinal-card[data-consulted="true"] {
    border-left-color: var(--dr-teal, #4CC4B4);
    box-shadow: var(--dr-glow-teal-ghost,
        0 0 4px rgba(76, 196, 180, 0.08),
        0 0 12px rgba(76, 196, 180, 0.03));
}

.nev-longitudinal-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.nev-longitudinal-name {
    font-family: var(--dr-font-heading, 'Instrument Sans', sans-serif);
    font-size: var(--dr-text-sm, 0.75rem);
    font-weight: 600;
    color: var(--dr-bone, #EBE1D7);
    margin-right: auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.nev-longitudinal-card--hero .nev-longitudinal-name {
    font-size: 0.875rem;
    font-weight: 700;
}

.nev-longitudinal-card--compact .nev-longitudinal-name,
.nev-longitudinal-card--ghost .nev-longitudinal-name {
    font-size: 0.6875rem;
}

.nev-status-pill {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid currentColor;
    border-radius: 2px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wider, 0.10em);
    color: var(--dr-asparagus, #6E8068);
}

.nev-status-pill[data-status="active"] { color: var(--dr-amber, #E69A4C); }
.nev-status-pill[data-status="worsening"] { color: var(--severity-worsening, #C25F90); border-color: var(--severity-worsening, #C25F90); }
.nev-status-pill[data-status="improving"] { color: var(--severity-improving, #D4A040); }
.nev-status-pill[data-status="stable"] { color: var(--severity-stable, #879A39); }
.nev-status-pill[data-status="monitoring"] { color: var(--dr-brass, #BFA162); }
.nev-status-pill[data-status="resolved"],
.nev-status-pill[data-status="resolving"] { color: var(--severity-resolved, #4CC4B4); }

.nev-longitudinal-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: 0.5625rem;
    color: var(--dr-mocha, #8B7355);
    letter-spacing: var(--dr-tracking-wide, 0.05em);
}

.nev-longitudinal-meta .nev-history-count {
    color: var(--dr-bone, #EBE1D7);
}

.nev-longitudinal-meta .nev-delta-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dr-amber, #E69A4C);
    display: inline-block;
}

.nev-longitudinal-card--hero .nev-longitudinal-meta .nev-delta-dot {
    width: 8px;
    height: 8px;
    box-shadow: 0 0 6px rgba(230, 154, 76, 0.55);
}

/* Tier 1 fragment-bridge — count badge + freshness dot on the longitudinal
 * card header. WHY: surfaces fragment activity routed by LivingUpdateColumn
 * onto the takeover's middle column, mirroring the rail's problem-card
 * fragment indicators. Painted by LongitudinalColumn._paintFragmentIndicator
 * in response to fragment:routed / fragments:loaded / fragment:rerouted
 * CustomEvents. */
.nev-longitudinal-fragment-count {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--dr-teal, #4CC4B4);
    border-radius: 2px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: 0.5625rem;
    color: var(--dr-teal, #4CC4B4);
    letter-spacing: var(--dr-tracking-wide, 0.05em);
    line-height: 1;
}

.nev-longitudinal-fragment-fresh {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dr-teal, #4CC4B4);
    box-shadow: 0 0 4px rgba(76, 196, 180, 0.55);
    display: inline-block;
    align-self: center;
}

.nev-longitudinal-fragment-fresh--stale {
    background: var(--dr-mocha, #8B7355);
    box-shadow: none;
    opacity: 0.6;
}

.nev-longitudinal-meta .nev-consulted-marker {
    margin-left: auto;
    color: var(--dr-teal, #4CC4B4);
    text-transform: uppercase;
}

.nev-longitudinal-snippet {
    font-size: var(--dr-text-xs, 0.625rem);
    color: var(--dr-mocha, #8B7355);
    line-height: 1.55;
    white-space: pre-wrap;
    word-wrap: break-word;
    /* Wave 1: collapsed snippet, expand to latest APHistoryEntry on click */
    max-height: 4.4em;  /* 2 lines */
    overflow: hidden;
    transition: max-height 240ms var(--dr-easing, cubic-bezier(0.4, 0, 0.2, 1));
}

.nev-longitudinal-card--hero .nev-longitudinal-snippet {
    font-size: 0.6875rem;
    max-height: 6.2em;
    color: var(--dr-bone, #EBE1D7);
}

.nev-longitudinal-card--compact .nev-longitudinal-snippet,
.nev-longitudinal-card--ghost .nev-longitudinal-snippet {
    max-height: 3.1em;
}

.nev-longitudinal-card.expanded .nev-longitudinal-snippet {
    max-height: 600px;
    color: var(--dr-bone, #EBE1D7);
}

/* Snippet attribution row — tier badge + source chip + HD anchor. Makes
   the doctor's trust signal visible: silent fallback from accepted to
   in-flight to draft prose was hiding what kind of text was on screen. */
.nev-snippet-attribution {
    display: flex;
    gap: 6px;
    align-items: center;
    margin: 4px 0 2px;
    flex-wrap: wrap;
}

.nev-snippet-tier {
    font-size: var(--dr-text-xs, 0.625rem);
    line-height: 1;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    border: 1px solid transparent;
}
.nev-snippet-tier[data-tier="accepted"] {
    color: var(--dr-sage, #A8C4A0);
    border-color: rgba(168, 196, 160, 0.35);
    background: rgba(168, 196, 160, 0.08);
}
.nev-snippet-tier[data-tier="in_flight"] {
    color: var(--dr-honey, #E0B870);
    border-color: rgba(224, 184, 112, 0.35);
    background: rgba(224, 184, 112, 0.08);
}
.nev-snippet-tier[data-tier="draft"] {
    color: var(--dr-mocha, #8B7355);
    border-color: rgba(139, 115, 85, 0.40);
    background: rgba(139, 115, 85, 0.06);
    font-style: italic;
}
.nev-snippet-tier[data-tier="empty"] {
    color: var(--dr-stone, #6B5D54);
    border-color: rgba(107, 93, 84, 0.40);
    background: transparent;
}

.nev-snippet-source,
.nev-snippet-hd {
    font-size: var(--dr-text-xs, 0.625rem);
    color: var(--dr-stone, #6B5D54);
    opacity: 0.85;
}
.nev-snippet-hd {
    font-variant-numeric: tabular-nums;
}

/* Non-canonical tiers get a subtle de-emphasis on the snippet body. The
   tier badge does the loud signaling; the body just dims slightly so the
   eye reads "this is provisional" without losing the prose. */
.nev-longitudinal-snippet[data-tier="in_flight"],
.nev-longitudinal-snippet[data-tier="draft"] {
    opacity: 0.78;
}
.nev-longitudinal-snippet[data-tier="empty"] {
    opacity: 0.55;
    font-style: italic;
}

.nev-snippet-empty-placeholder {
    color: var(--dr-stone, #6B5D54);
}

/* Empty-history HX label — replaces the numeric count badge entirely
   when ap_history is empty, so "HX 0" never reads as "we have data". */
.nev-history-count-empty {
    color: var(--dr-stone, #6B5D54);
    font-style: italic;
    font-size: var(--dr-text-xs, 0.625rem);
}

/* Wave 3 / 3e Tier A — "SINCE PRIOR NOTE" inline section            */
/* Visible only on expanded cards. Render-LESS: empty problems get   */
/* the muted "No notable changes" line; never boilerplate filler.    */

.nev-longitudinal-deltas {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--dr-crater-deep, #3C2A21);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nev-longitudinal-deltas-header {
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: 0.5625rem;
    color: var(--dr-mocha, #8B7355);
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wider, 0.10em);
}

.nev-longitudinal-deltas-empty {
    margin: 0;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    color: var(--dr-mocha, #8B7355);
    font-style: italic;
}

.nev-longitudinal-deltas-loading {
    margin: 0;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    color: var(--dr-mocha, #8B7355);
}

.nev-longitudinal-deltas-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nev-delta-item {
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    color: var(--dr-bone, #EBE1D7);
    line-height: 1.55;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

/* Label — for lab/vital this is the abbreviated name (Cr, K),     */
/* for treatment / consult this is the full action ("Started X").  */
.nev-delta-label {
    color: var(--dr-bone, #EBE1D7);
}

/* Old value is de-emphasized so the eye lands on the new value.   */
.nev-delta-old {
    color: var(--dr-mocha, #8B7355);
    text-decoration: line-through;
    text-decoration-color: var(--dr-mocha, #8B7355);
}

.nev-delta-arrow {
    color: var(--dr-mocha, #8B7355);
}

/* New value: per-direction accent. Mirrors Wave 3 / 3c diff arrow */
/* color logic — improving=harvest, worsening=magenta, neutral=bone. */
.nev-delta-new {
    color: var(--dr-bone, #EBE1D7);
    font-weight: 600;
}

.nev-delta-item[data-direction="improving"] .nev-delta-new {
    color: var(--severity-improving, #D4A040);
}

.nev-delta-item[data-direction="worsening"] .nev-delta-new {
    color: var(--severity-worsening, #C25F90);
}

/* Treatment/consult items have no old/new pair — accent the label */
/* directly so worsening "Started cefepime" still renders magenta. */
.nev-delta-item:not(:has(.nev-delta-new))[data-direction="improving"] .nev-delta-label {
    color: var(--severity-improving, #D4A040);
}

.nev-delta-item:not(:has(.nev-delta-new))[data-direction="worsening"] .nev-delta-label {
    color: var(--severity-worsening, #C25F90);
}

/* Note line (e.g. "crossed AKI threshold") sits to the right in   */
/* mocha so it never competes with the value.                       */
.nev-delta-note {
    color: var(--dr-mocha, #8B7355);
    font-style: italic;
    font-size: 0.5625rem;
}

/* ----------------------------------------------------------------- *
 * Wave 3 / 3f — Note inclusion band controls                         *
 * Per-card 4-button row: [Pin] [Brief] [Omit] [Auto]. Renders as    *
 * a single line with hairline borders. Active state = filled        *
 * background in the role color. Render-LESS contract: no popovers, *
 * no dropdowns, no "edit band" affordance — buttons ARE the surface.*
 * ----------------------------------------------------------------- */

.nev-band-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    align-items: center;
}

.nev-band-controls-label {
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wider, 0.10em);
    color: var(--dr-mocha, #8B7355);
    margin-right: 4px;
}

.nev-band-button {
    flex: 0 0 auto;
    background: transparent;
    border: 1px solid var(--dr-crater-deep, #3C2A21);
    border-radius: 2px;
    padding: 2px 8px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wide, 0.05em);
    color: var(--dr-mocha, #8B7355);
    cursor: pointer;
    transition: border-color 120ms var(--dr-easing, cubic-bezier(0.4, 0, 0.2, 1)),
                color 120ms var(--dr-easing, cubic-bezier(0.4, 0, 0.2, 1)),
                background 120ms var(--dr-easing, cubic-bezier(0.4, 0, 0.2, 1));
}

.nev-band-button:hover:not(:disabled) {
    color: var(--dr-bone, #EBE1D7);
    border-color: var(--dr-mocha, #8B7355);
}

.nev-band-button:focus-visible {
    outline: 1px solid var(--dr-amber, #E69A4C);
    outline-offset: 1px;
}

.nev-band-button:disabled {
    opacity: 0.5;
    cursor: progress;
}

/* ── Per-band role colors (outline) ──                              */
.nev-band-button[data-band="doctor_pinned"] {
    color: var(--dr-gold, #DAA520);
    border-color: var(--dr-gold, #DAA520);
}

.nev-band-button[data-band="doctor_brief"] {
    color: var(--dr-amber, #E69A4C);
    border-color: var(--dr-amber, #E69A4C);
}

.nev-band-button[data-band="doctor_suppressed"] {
    color: var(--dr-mocha, #8B7355);
    border-color: var(--dr-mocha, #8B7355);
}

.nev-band-button[data-band="auto"] {
    color: var(--dr-mocha, #8B7355);
    border-color: var(--dr-crater-deep, #3C2A21);
}

/* ── Active state: subtle filled background. Hairline only.   ──    */
.nev-band-button[aria-pressed="true"][data-band="doctor_pinned"] {
    background: rgba(218, 165, 32, 0.10);
    color: var(--dr-gold, #DAA520);
    border-color: var(--dr-gold, #DAA520);
}

.nev-band-button[aria-pressed="true"][data-band="doctor_brief"] {
    background: rgba(230, 154, 76, 0.10);
    color: var(--dr-amber, #E69A4C);
    border-color: var(--dr-amber, #E69A4C);
}

.nev-band-button[aria-pressed="true"][data-band="doctor_suppressed"] {
    background: rgba(139, 115, 85, 0.10);
    color: var(--dr-bone, #EBE1D7);
    border-color: var(--dr-mocha, #8B7355);
}

.nev-band-button[aria-pressed="true"][data-band="auto"] {
    background: rgba(139, 115, 85, 0.05);
    color: var(--dr-bone, #EBE1D7);
    border-color: var(--dr-mocha, #8B7355);
}

/* ----------------------------------------------------------------- *
 * Right — Today Working Note + Patch Queue                          *
 * Container-owned scroll on the queue. Finalize bar pinned bottom.   *
 * ----------------------------------------------------------------- */

.nev-right-shell {
    /* FIX (2026-05-15): The right pane is a viewport manager, not a stack
       of legacy rail scrollers. Grid rows own the available height: note
       gets all remaining space, queue gets a clamped review lane, finalize
       stays pinned. Direct hosts scroll; migrated children are neutralized
       below so the doctor never lands in scroll-within-scroll. */
    --nev-queue-row: 18px;
    --nev-queue-min: calc(8 * var(--nev-queue-row));   /* 144px */
    --nev-queue-target: 34%;
    --nev-queue-max: calc(18 * var(--nev-queue-row));  /* 324px */
    --nev-row-grid: var(--nev-queue-row);
    display: grid;
    grid-template-areas:
        "note"
        "queue"
        "finalize";
    grid-template-rows:
        minmax(0, 1fr)
        minmax(
            var(--nev-queue-min),
            clamp(var(--nev-queue-min), var(--nev-queue-target), var(--nev-queue-max))
        )
        auto;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.nev-right-shell .nev-base-note-host {
    grid-area: note;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0;
    border-bottom: 1px solid var(--dr-crater-deep, #3C2A21);
    background:
        linear-gradient(180deg, rgba(255, 247, 238, 0.018), transparent 42px),
        var(--dr-void, #120C06);
}

/* Strip legacy rail styles after #nevBaseNote is migrated into takeover.
   The host above owns note scrolling; the child document just contributes
   content height. */
.nev-right-shell .nev-base-note {
    min-height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.nev-right-shell .nev-base-note-doc {
    height: auto;
    min-height: 100%;
    max-height: none;
    overflow: visible;
    padding: 12px 18px 20px;
}

/* Shared temporal focus: historical A&P replaces only the right-note
   projection. The retained Today DOM stays detached and is restored intact;
   queue/finalize remain mounted but inert and visually absent. */
.nev-right-shell[data-nev-temporal-mode="historical"] {
    grid-template-rows: minmax(0, 1fr) 0 0;
}

.nev-right-shell[data-nev-temporal-mode="historical"] .nev-review-queue-host,
.nev-right-shell[data-nev-temporal-mode="historical"] .nev-finalize-host {
    display: none;
}

.nev-history-review {
    --nev-history-marker-w: 126px;
}

.nev-history-head {
    position: sticky;
    top: -12px;
    z-index: 6;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 12px;
    align-items: center;
    margin: -12px -18px 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--dr-divider, #2A2018);
    background: var(--dr-obsidian, #160E08);
    background: color-mix(in srgb, var(--dr-obsidian, #160E08) 96%, transparent);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .22);
}

.nev-history-identity {
    color: var(--dr-bone, #EBE1D7);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .06em;
}

.nev-history-back {
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid var(--dr-teal-deep, #2E8A7E);
    border-radius: 3px;
    background: transparent;
    color: var(--dr-teal, #4CC4B4);
    font: 700 10px/1 var(--dr-font-mono, 'Fira Code', monospace);
    cursor: pointer;
}

.nev-history-back:hover,
.nev-history-back:focus-visible {
    background: rgba(76, 196, 180, .10);
    outline: 2px solid rgba(76, 196, 180, .28);
    outline-offset: 1px;
}

.nev-history-coverage {
    grid-column: 1 / -1;
    color: var(--dr-fg-muted, #8E8074);
    font: 600 10px/1.3 var(--dr-font-mono, 'Fira Code', monospace);
}

.nev-history-boundary {
    margin: 0 0 12px;
    padding: 7px 10px;
    border-left: 2px solid var(--dr-brass, #BFA162);
    color: var(--dr-fg-muted, #8E8074);
    font-size: 12px;
    line-height: 1.45;
}

.nev-history-problems {
    gap: 8px;
}

.nev-history-problem {
    margin-bottom: 0;
    box-shadow: none;
}

.nev-history-problem .nev-bn-problem-header {
    min-height: 35px;
    flex-wrap: nowrap;
}

.nev-history-problem .nev-bn-problem-title {
    min-width: 0;
    font-size: 15px;
}

.nev-history-diff-gutter {
    display: inline-flex;
    justify-content: flex-end;
    width: var(--nev-history-marker-w);
    min-width: var(--nev-history-marker-w);
}

.nev-history-diff-toggle {
    max-width: 100%;
    padding: 3px 5px;
    border: 1px solid rgba(191, 161, 98, .30);
    border-radius: 2px;
    background: transparent;
    color: var(--dr-brass, #BFA162);
    font: 650 9px/1.2 var(--dr-font-mono, 'Fira Code', monospace);
    white-space: nowrap;
    cursor: pointer;
    min-height: 24px;
}

.nev-history-diff-toggle:hover,
.nev-history-diff-toggle:focus-visible {
    border-color: var(--dr-brass, #BFA162);
}

.nev-history-diff-toggle:focus-visible {
    outline: 2px solid rgba(76, 196, 180, .55);
    outline-offset: 1px;
}

.nev-takeover[data-temporal-mode="historical"]
    .nev-column[data-column="right"] .nev-column-counter {
    color: var(--dr-fg-muted, #8E8074);
}

.nev-history-problem-body {
    display: grid;
    gap: 8px;
}

.nev-history-entry-meta,
.nev-history-field-label,
.nev-history-diff-label {
    color: var(--dr-fg-muted, #8E8074);
    font: 700 9px/1.25 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .09em;
    text-transform: uppercase;
}

.nev-history-field-content {
    margin-top: 3px;
    color: var(--dr-fg-body, #E8E0D6);
}

.nev-history-field-content .nev-bn-para,
.nev-history-field-content .nev-bn-list {
    margin-bottom: 0;
    font-size: 13px;
    line-height: 1.5;
}

.nev-history-missing,
.nev-history-empty {
    padding: 8px 10px;
    border: 1px dashed rgba(142, 128, 116, .34);
    color: var(--dr-fg-muted, #8E8074);
    font: 600 11px/1.4 var(--dr-font-mono, 'Fira Code', monospace);
}

.nev-history-empty {
    margin-top: 8px;
}

.nev-history-diff {
    order: 20;
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px dashed rgba(191, 161, 98, .24);
}

.nev-history-diff[hidden] {
    display: none;
}

.nev-history-diff-legend {
    margin-bottom: 7px;
    color: var(--dr-fg-muted, #8E8074);
    font-size: 10px;
    line-height: 1.4;
}

.nev-history-diff-row {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 8px;
    padding: 4px 0;
}

.nev-history-diff-text {
    color: var(--dr-fg-body, #E8E0D6);
    font-size: 12px;
    line-height: 1.5;
}

.nev-history-diff-text .diff-added {
    color: var(--dr-teal, #4CC4B4);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.nev-history-diff-text .diff-added::before {
    content: "+";
    margin-right: 1px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
}

.nev-history-diff-text .diff-removed {
    color: #ECA0C4;
    text-decoration: line-through;
    opacity: 1;
}

.nev-history-diff-text .diff-removed::before {
    content: "−";
    margin-right: 1px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
}

.nev-history-unlinked-title {
    margin: 16px 0 8px;
    color: var(--dr-fg-muted, #8E8074);
    font: 750 10px/1.2 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .10em;
    text-transform: uppercase;
}

.nev-history-unlinked {
    border-left-color: var(--dr-brass, #BFA162);
}

.nev-history-unlinked-badge {
    color: var(--dr-brass, #BFA162);
    font: 750 9px/1 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .08em;
}

.nev-history-unlinked-note {
    color: var(--dr-brass, #BFA162);
    font-size: 11px;
    line-height: 1.4;
}

@media (max-width: 1100px) {
    .nev-history-review {
        --nev-history-marker-w: 108px;
    }
    .nev-history-diff-toggle {
        white-space: normal;
    }
    .nev-history-diff-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}

.nev-right-shell .nev-review-queue-host {
    grid-area: queue;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--dr-obsidian, #160E08);
    padding: 7px 7px 6px;
    border-top: 1px solid rgba(191, 161, 98, 0.16);
}

.nev-right-shell .nev-review-queue-host::before {
    content: "Review Queue";
    position: sticky;
    top: -7px;
    z-index: 3;
    display: flex;
    align-items: center;
    min-height: 22px;
    margin: -7px -7px 6px;
    padding: 3px 7px;
    border-bottom: 1px solid var(--dr-crater-deep, #3C2A21);
    background: linear-gradient(180deg, var(--dr-dark-cacao, #1E140E), var(--dr-obsidian, #160E08));
    color: var(--dr-amber, #E69A4C);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: var(--dr-tracking-widest, 0.20em);
    text-transform: uppercase;
}

/* Neutralize rail-tenant queue geometry after migration. The host above is
   the only queue scroller in takeover mode. */
.nev-right-shell .nev-review-queue {
    max-height: none;
    min-height: 0;
    overflow: visible;
    padding: 0;
    margin: 0;
}

/* Apply min-heights to existing .nev-review-card by validation state.
   This sits ON TOP of note-evolution.css so the takeover container
   can re-shape tile rhythm without forking the renderer. */
.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-review-card {
    /* Wave 3 / 3b safety-stripe baseline (mint = safe):
       low-risk + valid + proposed/accepted patches get the mint stripe. */
    min-height: calc(6 * var(--nev-row-grid));  /* 108 px compact baseline */
    height: auto;
    background: var(--dr-espresso, #2A1C13);
    border: 1px solid var(--dr-crater, #5A453A);
    border-left: 3px solid var(--dr-teal, #4CC4B4);
    border-radius: 2px;
    margin-bottom: 5px;
    padding: 5px 7px;
}

.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-review-card-header {
    gap: 4px;
    margin-bottom: 4px;
}

/* Status-only amendments are metadata decisions, never replacement prose.
   Keep the transition compact and visually distinct from red/green text diffs. */
.sol-workspace-main[data-takeover="active"] .nev-review-status-transition {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 2px 9px;
    margin: 2px 0 5px;
    padding: 5px 7px;
    border: 1px solid rgba(76, 196, 180, .24);
    border-left: 3px solid var(--dr-teal, #4CC4B4);
    border-radius: 2px;
    background: rgba(76, 196, 180, .055);
}

.sol-workspace-main[data-takeover="active"] .nev-review-status-transition-label {
    color: var(--dr-brass, #BFA162);
    font: 700 9px/1.3 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sol-workspace-main[data-takeover="active"] .nev-review-status-transition strong {
    color: var(--dr-bone, #EBE1D7);
    font: 700 11px/1.35 var(--dr-font-mono, 'Fira Code', monospace);
}

.sol-workspace-main[data-takeover="active"] .nev-review-status-transition-note {
    grid-column: 1 / -1;
    color: var(--dr-mocha, #8B7355);
    font: 600 9px/1.35 var(--dr-font-mono, 'Fira Code', monospace);
}

.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-category-badge,
.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-risk-badge,
.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-evidence-state,
.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-validation-badge,
.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-op-chip {
    min-height: 16px;
    padding: 1px 5px;
    font-size: 0.5625rem;
    line-height: 1.2;
}

.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-assertion-item {
    grid-template-columns: minmax(46px, auto) minmax(0, 1fr);
    gap: 2px 6px;
    padding: 2px 0;
    font-size: 0.625rem;
    line-height: 1.28;
}

.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-assertion-action {
    font-size: 0.5625rem;
}

.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-review-evidence-line {
    margin-top: 4px;
    font-size: 0.5625rem;
    line-height: 1.32;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-review-card-actions {
    gap: 4px;
    margin-top: 6px;
}

.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-card-btn {
    min-height: 22px;
    padding: 3px 6px;
    font-size: 0.5625rem;
}

/* Wave 3 / 3b safety-stripe ladder (locked):
     mint    --dr-teal      safe   (low-risk valid)
     amber   --dr-amber     soft   (medium-risk / unsupported / conflict / ambiguous)
     gold    --dr-gold      hi     (high-risk acceptable)
     scarlet --dr-scarlet   block  (apply_failed) */

.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-review-card[data-validation="apply_failed"] {
    min-height: calc(5 * var(--nev-row-grid));  /* 90 px */
    border-left-color: var(--dr-scarlet, #C44C4C);  /* block — hard-stop */
}

.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-review-card[data-validation="unsupported"] {
    min-height: calc(6 * var(--nev-row-grid));  /* 108 px */
    border-left-color: var(--dr-amber, #E69A4C);   /* soft — recoverable */
}

.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-review-card[data-validation="conflict"] {
    min-height: calc(9 * var(--nev-row-grid));  /* 162 px */
    border-left-color: var(--dr-amber, #E69A4C);   /* soft — needs resolution */
}

.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-review-card[data-validation="ambiguous_target"] {
    min-height: calc(10 * var(--nev-row-grid));  /* 180 px */
    border-left-color: var(--dr-amber, #E69A4C);   /* soft — needs picker */
}

.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-review-card[data-validation="stale_anchor"] {
    /* Same as baseline + STALE banner above body. Soft severity (recoverable
       via re-run / remap), so amber stripe. */
    min-height: calc(7 * var(--nev-row-grid));
    border-left-color: var(--dr-amber, #E69A4C);
}

.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-review-card[data-category="new_problem"] {
    min-height: calc(10 * var(--nev-row-grid));  /* 180 px */
    border-left-color: var(--dr-gold, #DAA520);
}

.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-review-card[data-risk="high"] {
    /* High-risk valid = hi (gold). High-risk + apply_failed escalates to
       scarlet via the more-specific apply_failed selector above. */
    border-left-color: var(--dr-gold, #DAA520);
}

/* High-risk + apply_failed = block (scarlet beats gold). Specificity wins
   because we're stacking two attribute selectors. */
.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-review-card[data-risk="high"][data-validation="apply_failed"] {
    border-left-color: var(--dr-scarlet, #C44C4C);
}

/* High-risk drawer-open state: push-down (sibling tiles shift, no
   overlay). When .high-risk-confirm-open class is set, the tile
   grows to 14 compact rows (252 px). Sibling tiles below shift
   automatically because they are flow siblings, not absolutely
   positioned. */
.sol-workspace-main[data-takeover="active"] .nev-review-queue-host .nev-review-card.high-risk-confirm-open {
    min-height: calc(14 * var(--nev-row-grid));  /* 252 px */
}

/* Paired BLOCKED / READY finalize bar — pinned to bottom of right
   column at all queue scroll positions. Always-visible action contract. */

.nev-right-shell .nev-finalize-host {
    grid-area: finalize;
    border-top: 1px solid var(--dr-crater-deep, #3C2A21);
    background: var(--dr-obsidian, #160E08);
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 42px;
    min-width: 0;
}

.nev-finalize-status {
    flex: 1;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    color: var(--dr-fg-muted, #8E8074);
    line-height: 1.55;
}

.nev-finalize-status .nev-finalize-helper {
    display: block;
    margin-top: 2px;
    color: var(--dr-asparagus, #6E8068);
}

.nev-finalize-bar-cta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nev-jump-blocker-btn {
    background: transparent;
    border: 1px solid var(--dr-burnt-sienna, #C75B39);
    color: var(--dr-burnt-sienna, #C75B39);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    padding: 6px 12px;
    border-radius: 2px;
    cursor: pointer;
    letter-spacing: var(--dr-tracking-wide, 0.05em);
    text-transform: uppercase;
}

.nev-jump-blocker-btn:hover {
    border-color: var(--dr-scarlet, #C44C4C);
    color: var(--dr-scarlet, #C44C4C);
}

.nev-finalize-cta-btn {
    background: transparent;
    border: 1px solid var(--dr-mocha, #8B7355);
    color: var(--dr-mocha, #8B7355);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-sm, 0.75rem);
    padding: 8px 16px;
    border-radius: 2px;
    cursor: not-allowed;
    letter-spacing: var(--dr-tracking-wide, 0.05em);
    text-transform: uppercase;
    font-weight: 600;
    transition: border-color 240ms, color 240ms;
}

.nev-finalize-host[data-state="ready"] .nev-finalize-cta-btn {
    /* READY: button color shifts to teal, becomes clickable */
    border-color: var(--dr-teal, #4CC4B4);
    color: var(--dr-teal, #4CC4B4);
    cursor: pointer;
}

.nev-finalize-host[data-state="ready"] .nev-finalize-cta-btn:hover,
.nev-finalize-host[data-state="ready"] .nev-finalize-cta-btn:focus-visible {
    color: var(--dr-crema, #FFF7EE);
    border-color: var(--dr-teal, #4CC4B4);
    box-shadow: var(--dr-glow-teal-ghost,
        0 0 4px rgba(76, 196, 180, 0.08),
        0 0 12px rgba(76, 196, 180, 0.03));
    outline: none;
}

.nev-finalize-host[data-state="blocked"] .nev-finalize-cta-btn {
    /* BLOCKED: dim mocha, not clickable */
    border-color: var(--dr-mocha, #8B7355);
    color: var(--dr-mocha, #8B7355);
}

/* Hide jump-blocker button unless the bar is in BLOCKED state */
.nev-finalize-host[data-state="ready"] .nev-jump-blocker-btn {
    display: none;
}

/* ────────────── Wave 3 / 3a — six validation badges (takeover) ──────────────
   Takeover overlays / overrides for the six validation states. The card-level
   severity stripe (border-left) is already wired above per data-validation;
   this block adds the in-card chrome (badge pill, warning/error strip,
   target picker) so the takeover surface matches the legacy rail-tenant CSS.
   Tokens come from --dr-* in dark-roast-tokens.css. */

.sol-workspace-main[data-takeover="active"] .nev-validation-badge {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 1px 6px;
    border-radius: 2px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wide, 0.05em);
    color: var(--dr-burnt-sienna, #C75B39);
    background: rgba(199,91,57,.08);
    border: 1px solid rgba(199,91,57,.34);
}

.sol-workspace-main[data-takeover="active"] .nev-validation-badge[data-validation="apply_failed"] {
    color: var(--dr-scarlet, #C44C4C);
    background: rgba(196,76,76,.10);
    border-color: rgba(196,76,76,.45);
}

.sol-workspace-main[data-takeover="active"] .nev-validation-badge[data-validation="conflict"] {
    color: var(--dr-amber, #E69A4C);
    background: rgba(230,154,76,.08);
    border-color: rgba(230,154,76,.45);
}

.sol-workspace-main[data-takeover="active"] .nev-validation-badge[data-validation="stale_anchor"],
.sol-workspace-main[data-takeover="active"] .nev-validation-badge[data-validation="unsupported"],
.sol-workspace-main[data-takeover="active"] .nev-validation-badge[data-validation="ambiguous_target"] {
    color: var(--dr-burnt-sienna, #C75B39);
    background: rgba(199,91,57,.08);
    border-color: rgba(199,91,57,.34);
}

/* ────────────── Wave 3 / 3b — op chip (takeover) ──────────────
   Renders inline with the category badge in the review-card header.
   Reads `op:replace` / `op:insert_before` / `op:new_problem` etc.
   Color is dim mocha (structural metadata, not severity); the
   category badge owns category color and the validation badge
   owns severity color, so the op chip stays neutral. */
.sol-workspace-main[data-takeover="active"] .nev-op-chip,
.note-evolution-workspace .nev-op-chip {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 1px 6px;
    border-radius: 2px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    font-weight: 600;
    letter-spacing: var(--dr-tracking-tight, 0.01em);
    text-transform: lowercase;
    color: var(--dr-mocha, #8B7355);
    background: rgba(139,115,85,.06);
    border: 1px solid rgba(139,115,85,.28);
}

/* new_problem / delete carry the category gold/burnt-sienna into the
   op chip so the structural shape is visually distinct on the rare
   ops that are themselves clinically high-stakes. */
.sol-workspace-main[data-takeover="active"] .nev-op-chip[data-op="new_problem"],
.note-evolution-workspace .nev-op-chip[data-op="new_problem"] {
    color: var(--dr-gold, #DAA520);
    border-color: rgba(218,165,32,.34);
    background: rgba(218,165,32,.06);
}
.sol-workspace-main[data-takeover="active"] .nev-op-chip[data-op="delete"],
.note-evolution-workspace .nev-op-chip[data-op="delete"] {
    color: var(--dr-burnt-sienna, #C75B39);
    border-color: rgba(199,91,57,.30);
    background: rgba(199,91,57,.06);
}

/* Recommendation semantics (2026-07-10) — kind badges in both the default
   problem-band decision and legacy review-card header. Types what the patch
   asserts (observed / assessment / already ordered-done / suggested next)
   at a glance. Chip geometry mirrors the op chip; each type gets a
   distinct hue but the differentiator is the TEXT (never color alone).
   Absent stamp = no chip. */
.sol-workspace-main[data-takeover="active"] .nev-rec-badges,
.note-evolution-workspace .nev-rec-badges {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    max-width: 100%;
}

.sol-workspace-main[data-takeover="active"] .nev-rec-origin-badges,
.note-evolution-workspace .nev-rec-origin-badges {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    max-width: 100%;
}

.sol-workspace-main[data-takeover="active"] .nev-rec-origin-badge,
.note-evolution-workspace .nev-rec-origin-badge {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 1px 6px;
    border: 1px dashed rgba(191, 161, 98, .48);
    border-radius: 2px;
    color: var(--dr-brass, #BFA162);
    background: rgba(191, 161, 98, .05);
    font: 600 var(--dr-text-xs, .625rem)/1.35 var(--dr-font-mono, 'Fira Code', monospace);
}
.sol-workspace-main[data-takeover="active"] .nev-rec-origin-badge[data-rec-origin="soma_generated"],
.note-evolution-workspace .nev-rec-origin-badge[data-rec-origin="soma_generated"] {
    color: var(--dr-amber, #E69A4C);
    border-color: rgba(230, 154, 76, .62);
}
.sol-workspace-main[data-takeover="active"] .nev-rec-origin-badge[data-rec-origin="physician_adopted"],
.sol-workspace-main[data-takeover="active"] .nev-rec-origin-badge[data-rec-origin="physician_edited"],
.note-evolution-workspace .nev-rec-origin-badge[data-rec-origin="physician_adopted"],
.note-evolution-workspace .nev-rec-origin-badge[data-rec-origin="physician_edited"] {
    color: var(--dr-teal, #7FA8A0);
    border-color: rgba(127, 168, 160, .58);
}
.sol-workspace-main[data-takeover="active"] .nev-rec-origin-badge[data-rec-origin="unresolved"],
.note-evolution-workspace .nev-rec-origin-badge[data-rec-origin="unresolved"] {
    color: var(--dr-crema, #FFF7EE);
    border-color: var(--dr-amber, #E69A4C);
    background: rgba(230, 154, 76, .12);
}
.sol-workspace-main[data-takeover="active"] .nev-rec-origin-badge:focus-visible,
.note-evolution-workspace .nev-rec-origin-badge:focus-visible {
    outline: 2px solid var(--dr-crema, #FFF7EE);
    outline-offset: 2px;
}

.sol-workspace-main[data-takeover="active"] .nev-rec-badge,
.note-evolution-workspace .nev-rec-badge {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 1px 6px;
    border-radius: 2px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    font-weight: 600;
    letter-spacing: var(--dr-tracking-tight, 0.01em);
    color: var(--dr-bone, #EBE1D7);
    background: rgba(235,225,215,.05);
    border: 1px solid rgba(235,225,215,.22);
}
.sol-workspace-main[data-takeover="active"] .nev-rec-badge[data-rec-type="plan_suggestion"],
.note-evolution-workspace .nev-rec-badge[data-rec-type="plan_suggestion"] {
    color: var(--dr-amber, #E69A4C);
    border-color: rgba(230,154,76,.34);
    background: rgba(230,154,76,.06);
}
.sol-workspace-main[data-takeover="active"] .nev-rec-badge[data-rec-type="inferred_state"],
.note-evolution-workspace .nev-rec-badge[data-rec-type="inferred_state"] {
    color: var(--dr-teal, #7FA8A0);
    border-color: rgba(127,168,160,.32);
    background: rgba(127,168,160,.06);
}
.sol-workspace-main[data-takeover="active"] .nev-rec-badge[data-rec-type="documented_action"],
.note-evolution-workspace .nev-rec-badge[data-rec-type="documented_action"] {
    color: var(--dr-sage, #A8C4A0);
    border-color: rgba(168,196,160,.42);
    background: rgba(168,196,160,.07);
}
.sol-workspace-main[data-takeover="active"] .nev-rec-badge:focus-visible,
.note-evolution-workspace .nev-rec-badge:focus-visible {
    outline: 2px solid var(--dr-teal, #4CC4B4);
    outline-offset: 2px;
}

/* Accept-meaning note for plan suggestions: one line above the action
   row stating the contract — Accept adopts into the working plan, it
   does not mark the order executed. Only rendered while proposed. */
.sol-workspace-main[data-takeover="active"] .nev-rec-accept-note,
.note-evolution-workspace .nev-rec-accept-note {
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    color: var(--dr-amber, #E69A4C);
    opacity: .85;
    padding: 2px 0;
}
.sol-workspace-main[data-takeover="active"] .nev-rec-accept-note.is-unresolved,
.note-evolution-workspace .nev-rec-accept-note.is-unresolved {
    color: var(--dr-crema, #FFF7EE);
    padding: 6px 8px;
    border-left: 2px solid var(--dr-amber, #E69A4C);
    background: rgba(230, 154, 76, .10);
}

/* Only mixed semantics expand. A normal single-purpose patch stays one chip;
   "completed Augmentin; broaden coverage" becomes two exact, scannable rows. */
.sol-workspace-main[data-takeover="active"] .nev-rec-breakdown,
.note-evolution-workspace .nev-rec-breakdown {
    display: grid;
    gap: 5px;
    margin-top: 7px;
    padding: 7px 8px;
    border-left: 2px solid var(--dr-amber, #E69A4C);
    background: color-mix(in srgb, var(--dr-amber, #E69A4C) 5%, transparent);
}

.sol-workspace-main[data-takeover="active"] .nev-rec-breakdown-title,
.note-evolution-workspace .nev-rec-breakdown-title {
    color: var(--dr-bone, #EBE1D7);
    font: 700 var(--dr-text-xs, 0.625rem)/1.35 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: var(--dr-tracking-wide, 0.05em);
    text-transform: uppercase;
}

.sol-workspace-main[data-takeover="active"] .nev-rec-segment,
.note-evolution-workspace .nev-rec-segment {
    display: grid;
    grid-template-columns: minmax(112px, auto) minmax(0, 1fr);
    gap: 8px;
    align-items: baseline;
}

.sol-workspace-main[data-takeover="active"] .nev-rec-segment-kind,
.note-evolution-workspace .nev-rec-segment-kind {
    color: var(--dr-amber, #E69A4C);
    font: 600 var(--dr-text-xs, 0.625rem)/1.4 var(--dr-font-mono, 'Fira Code', monospace);
}

.sol-workspace-main[data-takeover="active"] .nev-rec-segment-text,
.note-evolution-workspace .nev-rec-segment-text {
    min-width: 0;
    color: var(--dr-fg-secondary, #B8A99A);
    font-size: var(--dr-text-sm, 0.75rem);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

@media (max-width: 520px) {
    .sol-workspace-main[data-takeover="active"] .nev-rec-segment,
    .note-evolution-workspace .nev-rec-segment {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .nev-entry-timing-toggle,
    .nev-entry-effective-input,
    .nev-entry-effective-clear {
        min-height: 40px;
    }
}

/* Banners above the body — mirror iter4 mockup §04 warning-strip / error-strip.
   Aligned to the 24 px row grid: 24 px tall total (4 px padding + 16 px line). */
.sol-workspace-main[data-takeover="active"] .nev-validation-strip {
    display: block;
    box-sizing: border-box;
    min-height: var(--nev-row-grid, 18px);
    padding: 3px 7px;
    margin: -5px -7px 6px -7px;
    border-radius: 2px 2px 0 0;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wide, 0.05em);
    line-height: 1.4;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sol-workspace-main[data-takeover="active"] .nev-stale-anchor-strip {
    background: rgba(230,154,76,.08);
    color: var(--dr-amber, #E69A4C);
    border-bottom: 1px solid rgba(230,154,76,.34);
}

.sol-workspace-main[data-takeover="active"] .nev-apply-failed-strip {
    background: rgba(196,76,76,.10);
    color: var(--dr-scarlet, #C44C4C);
    border-bottom: 1px solid rgba(196,76,76,.45);
}

/* Claim-support degrade (2026-07-11): amber verify register; wraps so the
   clause count + instruction stay readable inside the band. */
.sol-workspace-main[data-takeover="active"] .nev-claim-partial-strip {
    background: rgba(230,154,76,.08);
    color: var(--dr-amber, #E69A4C);
    border-bottom: 1px solid rgba(230,154,76,.34);
    white-space: normal;
    text-transform: none;
    letter-spacing: normal;
}

/* Disabled Accept on unsupported/ambiguous_target — affordance visible but
   locked. Doctor sees "this is intended, but locked", not "this is missing". */
.sol-workspace-main[data-takeover="active"] .nev-card-btn.accept[disabled],
.sol-workspace-main[data-takeover="active"] .nev-card-btn.accept[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: auto; /* keep tooltip reachable */
}

/* Target picker — inline radio group on ambiguous_target cards. The picker
   sits between the assertion list and the action row. */
.sol-workspace-main[data-takeover="active"] .nev-target-picker {
    margin: 6px 0;
    padding: 5px 7px;
    border-radius: 2px;
    background: rgba(199,91,57,.04);
    border: 1px solid rgba(199,91,57,.20);
    border-left: 2px solid var(--dr-burnt-sienna, #C75B39);
}

.sol-workspace-main[data-takeover="active"] .nev-target-picker-label {
    color: var(--dr-fg-muted, #8E8074);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wide, 0.05em);
    margin-bottom: 4px;
}

.sol-workspace-main[data-takeover="active"] .nev-target-picker-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.sol-workspace-main[data-takeover="active"] .nev-target-radio {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 30px;
    padding: 4px 8px;
    border-radius: 2px;
    background: transparent;
    border: 1px solid rgba(199,91,57,.24);
    color: var(--dr-bone, #DDD);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.sol-workspace-main[data-takeover="active"] .nev-target-radio:focus-visible {
    outline: 2px solid var(--dr-teal, #55F3AA);
    outline-offset: 2px;
}

.sol-workspace-main[data-takeover="active"] .nev-target-radio:hover {
    border-color: rgba(199,91,57,.55);
    background: rgba(199,91,57,.06);
}

.sol-workspace-main[data-takeover="active"] .nev-target-radio.selected {
    border-color: var(--dr-burnt-sienna, #C75B39);
    background: rgba(199,91,57,.10);
    color: var(--dr-burnt-sienna, #C75B39);
}

.sol-workspace-main[data-takeover="active"] .nev-target-radio-marker {
    color: var(--dr-burnt-sienna, #C75B39);
    font-weight: 700;
}

.sol-workspace-main[data-takeover="active"] .nev-target-picker-helper {
    margin-top: 6px;
    color: var(--dr-fg-muted, #8E8074);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    line-height: 1.5;
}

.sol-workspace-main[data-takeover="active"] .nev-target-picker[data-state="selected"] .nev-target-picker-helper {
    color: var(--dr-teal, #55F3AA);
}

/* stale_anchor "Accept anyway" gets a subtle amber outline so the doctor
   sees the warning context. */
.sol-workspace-main[data-takeover="active"] .nev-card-btn.accept[data-stale-warn="true"] {
    border-color: var(--dr-amber, #E69A4C);
    color: var(--dr-amber, #E69A4C);
}

/* ----------------------------------------------------------------- *
 * Drawer host — siblings of 3-column grid                           *
 * Animated 0fr -> Nfr to push, not overlay.                          *
 * ----------------------------------------------------------------- */

.nev-evidence-drawer,
.nev-audit-drawer {
    background: var(--dr-dark-cacao, #1E140E);
    border: 1px solid var(--dr-crater-deep, #3C2A21);
    border-radius: 2px;
    overflow: hidden;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.nev-evidence-drawer:focus-visible {
    outline: 2px solid var(--dr-teal, #4CC4B4);
    outline-offset: -2px;
}

.nev-takeover-body[data-evidence-open="true"] {
    --nev-evidence-drawer-width: minmax(360px, 0.45fr);
}

.nev-takeover-body[data-audit-open="true"] {
    --nev-audit-drawer-width: minmax(360px, 0.45fr);
}

.nev-drawer-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--dr-crater-deep, #3C2A21);
    background: var(--dr-obsidian, #160E08);
    flex: 0 0 auto;
}

.nev-drawer-title {
    font-family: var(--dr-font-heading, 'Instrument Sans', sans-serif);
    font-size: var(--dr-text-sm, 0.75rem);
    font-weight: 600;
    color: var(--dr-bone, #EBE1D7);
    margin-right: auto;
}

.nev-drawer-close {
    background: transparent;
    border: 1px solid var(--dr-crater-deep, #3C2A21);
    color: var(--dr-mocha, #8B7355);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    padding: 2px 8px;
    border-radius: 2px;
    cursor: pointer;
}

.nev-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px;
    color: var(--dr-bone, #EBE1D7);
    font-size: var(--dr-text-xs, 0.625rem);
    line-height: 1.55;
}

.nev-drawer-stub {
    color: var(--dr-mocha, #8B7355);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-style: italic;
}

/* ----------------------------------------------------------------- *
 * Evidence drawer content (Wave 2 / 2c) — location-bearing citations *
 * ----------------------------------------------------------------- */

.nev-evidence-drawer-header-section {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--dr-crater-deep, #3C2A21);
    margin-bottom: 10px;
}

.nev-evidence-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    line-height: 1.45;
}

.nev-evidence-eyebrow {
    color: var(--dr-amber, #E69A4C);
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-widest, 0.20em);
    font-size: 0.5625rem;
}

.nev-evidence-problem {
    color: var(--dr-bone, #EBE1D7);
    font-weight: 600;
}

.nev-evidence-cat {
    color: var(--dr-mocha, #8B7355);
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wider, 0.10em);
    font-size: 0.5625rem;
}

.nev-evidence-risk {
    padding: 1px 6px;
    border: 1px solid var(--dr-crater-deep, #3C2A21);
    border-radius: 2px;
    text-transform: uppercase;
    font-size: 0.5625rem;
    letter-spacing: var(--dr-tracking-wide, 0.05em);
}

.nev-evidence-risk-high {
    color: var(--dr-gold, #DAA520);
    border-color: var(--dr-gold, #DAA520);
}
.nev-evidence-risk-medium {
    color: var(--dr-amber, #E69A4C);
    border-color: var(--dr-amber, #E69A4C);
}
.nev-evidence-risk-low {
    color: var(--dr-teal, #4CC4B4);
    border-color: var(--dr-teal, #4CC4B4);
}

.nev-evidence-validation {
    color: var(--dr-mocha, #8B7355);
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wider, 0.10em);
}

.nev-evidence-risk-diag {
    display: block;
    color: var(--dr-mocha, #8B7355);
    font-size: 0.5625rem;
    margin-top: 2px;
    font-style: italic;
}

.nev-evidence-section-title {
    color: var(--dr-amber, #E69A4C);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-widest, 0.20em);
    margin: 12px 0 6px 0;
}

.nev-evidence-drawer-change {
    border-bottom: 1px solid var(--dr-crater-deep, #3C2A21);
    padding-bottom: 12px;
    margin-bottom: 4px;
}

.nev-evidence-old,
.nev-evidence-new {
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    line-height: 1.55;
    padding: 4px 8px;
    border-left: 2px solid var(--dr-crater-deep, #3C2A21);
    margin: 4px 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.nev-evidence-old {
    color: var(--dr-mocha, #8B7355);
    text-decoration: line-through;
    text-decoration-color: var(--dr-burnt-sienna, #C75B39);
}

.nev-evidence-new {
    color: var(--dr-bone, #EBE1D7);
    border-left-color: var(--dr-teal, #4CC4B4);
}

.nev-evidence-citations {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nev-evidence-group {
    border: 1px solid var(--dr-crater-deep, #3C2A21);
    border-radius: 2px;
    background: var(--dr-obsidian, #160E08);
}

.nev-evidence-group-header {
    padding: 4px 8px;
    background: var(--dr-roasted-bean, #3C2A1E);
    color: var(--dr-bone, #EBE1D7);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wider, 0.10em);
    border-bottom: 1px solid var(--dr-crater-deep, #3C2A21);
}

.nev-evidence-row-item {
    padding: 6px 8px;
    border-bottom: 1px solid var(--dr-dark-cacao, #1E140E);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    line-height: 1.5;
}

.nev-evidence-row-item:last-child {
    border-bottom: none;
}

.nev-evidence-row-item.no-locator {
    border-left: 2px solid var(--dr-burnt-sienna, #C75B39);
}

.nev-evidence-label {
    color: var(--dr-bone, #EBE1D7);
    font-weight: 500;
}

.nev-evidence-value {
    color: var(--dr-amber, #E69A4C);
}

.nev-evidence-locator {
    display: block;
    margin-top: 2px;
    color: var(--dr-mocha, #8B7355);
    font-size: 0.5625rem;
}

.nev-evidence-locator-missing {
    color: var(--dr-burnt-sienna, #C75B39);
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wider, 0.10em);
}

.nev-evidence-quote {
    margin-top: 4px;
    padding-left: 8px;
    border-left: 1px solid var(--dr-crater-deep, #3C2A21);
    color: var(--dr-bone, #EBE1D7);
    font-style: italic;
    line-height: 1.55;
}

/* ────────────── Wave 3 / 3c — Phosphor icon + diff arrow + confidence bar
   ──────────────
   Visual primitives in the evidence drawer. The Phosphor stylesheet is
   loaded in templates/census.html (already there pre-Wave 3); we just
   size the icon for the evidence drawer's tight typographic floor.
*/

/* Group-header icon (lab → ph-flask, vital → ph-drop, etc.). 12 px icon
   prepended to the group label. .nev-evidence-group-header is now a
   flex row so the icon and label sit on a single line. */
.nev-evidence-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
}
.nev-evidence-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    font-size: 12px;
    line-height: 1;
    color: var(--dr-amber, #E69A4C);
}
.nev-evidence-group[data-source-type="lab"] .nev-evidence-icon,
.nev-evidence-group[data-source-type="vital"] .nev-evidence-icon,
.nev-evidence-group[data-source-type="io"] .nev-evidence-icon {
    color: var(--dr-teal, #4CC4B4);
}
.nev-evidence-group[data-source-type="medication_order"] .nev-evidence-icon {
    color: var(--dr-gold, #DAA520);
}
.nev-evidence-group[data-source-type="voice_transcript"] .nev-evidence-icon,
.nev-evidence-group[data-source-type="doctor_update"] .nev-evidence-icon {
    color: var(--dr-mocha, #8B7355);
}

/* Diff arrow (op:replace patches in the change section). Mocha so it
   reads as structural, not severity. The diff-row is a 3-cell flex
   layout (old → arrow → new) so the arrow stays centered on the
   row regardless of clamp-truncation. */
.nev-evidence-diff-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.nev-evidence-diff-row .nev-evidence-old,
.nev-evidence-diff-row .nev-evidence-new {
    flex: 1 1 220px;
    margin: 0;
}
.nev-diff-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-sm, 0.75rem);
    color: var(--dr-mocha, #8B7355);
    user-select: none;
}

/* Confidence bar — 72×6 px gradient amber→teal whose painted width is
   driven by --confidence (0..1) set inline by the row renderer. The
   `meter` ARIA role is structural; visual presentation is the bar. */
.nev-evidence-confidence-bar {
    display: inline-block;
    width: 72px;
    height: 6px;
    margin-top: 4px;
    background: var(--dr-crater-deep, #3C2A21);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    vertical-align: middle;
}
.nev-evidence-confidence-bar::before {
    content: '';
    display: block;
    height: 100%;
    width: calc(72px * var(--confidence, 0.5));
    background: linear-gradient(
        90deg,
        var(--dr-amber, #E69A4C) 0%,
        var(--dr-teal, #4CC4B4) 100%
    );
    transition: width 240ms var(--dr-easing, cubic-bezier(0.4, 0, 0.2, 1));
}

.nev-evidence-empty {
    padding: 12px;
    border: 1px solid var(--dr-burnt-sienna, #C75B39);
    border-radius: 2px;
    background: var(--dr-obsidian, #160E08);
}

.nev-evidence-empty-msg {
    color: var(--dr-bone, #EBE1D7);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    line-height: 1.55;
    margin: 0;
}

.nev-evidence-empty-msg strong {
    color: var(--dr-burnt-sienna, #C75B39);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wider, 0.10em);
}

/* ----------------------------------------------------------------- *
 * Conflict block + 4-action resolution row (Wave 2 / 2d)             *
 * Inline with the patch tile, NOT a popup, NOT hover-only.            *
 * Layout per CONTRACT § 3 + INDEX.md conflict tile (9 rows / 216 px). *
 * ----------------------------------------------------------------- */

.nev-conflict-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    margin: 6px 0;
    border: 1px solid var(--dr-burnt-sienna, #C75B39);
    border-left-width: 3px;
    border-radius: 2px;
    background: rgba(199, 91, 57, 0.06);  /* burnt-sienna at low alpha */
}

.nev-conflict-headline {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    margin-bottom: 4px;
}

.nev-conflict-marker {
    color: var(--dr-burnt-sienna, #C75B39);
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-widest, 0.20em);
    font-weight: 600;
    font-size: 0.5625rem;
}

.nev-conflict-message {
    color: var(--dr-bone, #EBE1D7);
}

.nev-conflict-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    line-height: 1.35;
    padding: 1px 0;
}

.nev-conflict-row-label {
    flex: 0 0 82px;
    color: var(--dr-mocha, #8B7355);
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wide, 0.05em);
    font-size: 0.5625rem;
}

.nev-conflict-row-value {
    color: var(--dr-bone, #EBE1D7);
    font-weight: 500;
}

.nev-conflict-row-meta {
    color: var(--dr-mocha, #8B7355);
    font-size: 0.5625rem;
}

.nev-conflict-row[data-source="doctor"] .nev-conflict-row-value {
    color: var(--dr-amber, #E69A4C);
}
.nev-conflict-row[data-source="ehr"] .nev-conflict-row-value {
    color: var(--dr-teal, #4CC4B4);
}
.nev-conflict-row[data-source="prior"] .nev-conflict-row-value {
    color: var(--dr-mocha, #8B7355);
    text-decoration: line-through;
    text-decoration-color: var(--dr-burnt-sienna, #C75B39);
}

/* 4-action button styling — only inside the takeover (these classes
   are also used in the rail-only path; takeover-scope keeps the
   visual contract aligned without breaking rail fallback). */

.sol-workspace-main[data-takeover="active"] .nev-card-btn.conflict-doctor {
    border-color: var(--dr-amber, #E69A4C);
    color: var(--dr-amber, #E69A4C);
}
.sol-workspace-main[data-takeover="active"] .nev-card-btn.conflict-doctor:hover {
    background: rgba(230, 154, 76, 0.08);
}

.sol-workspace-main[data-takeover="active"] .nev-card-btn.conflict-ehr {
    border-color: var(--dr-teal, #4CC4B4);
    color: var(--dr-teal, #4CC4B4);
}
.sol-workspace-main[data-takeover="active"] .nev-card-btn.conflict-ehr:hover {
    background: rgba(76, 196, 180, 0.08);
}

/* Conflict tile honors the active review-row grid in takeover. */
.sol-workspace-main[data-takeover="active"] .nev-review-card[data-validation="conflict"] {
    min-height: calc(9 * var(--nev-row-grid, 18px));
    height: auto;
}

/* ----------------------------------------------------------------- *
 * Command palette (Wave 2 / 2e) — inline overlay above right column  *
 * ----------------------------------------------------------------- */

.nev-command-palette {
    position: absolute;
    top: 64px;     /* below the takeover header */
    right: 16px;
    width: 520px;
    max-width: calc(100% - 32px);
    z-index: 100;
    /* The palette is a sibling of .nev-takeover-body so it can overlay
       the right column without affecting grid geometry. */
}

.nev-command-palette[hidden] {
    display: none !important;
}

.nev-cp-frame {
    background: var(--dr-obsidian, #160E08);
    border: 1px solid var(--dr-amber, #E69A4C);
    border-radius: 2px;
    color: var(--dr-bone, #EBE1D7);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    /* No drop-shadow per visual contract. The 1 px amber hairline
       does the visual lift instead. */
}

.nev-cp-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--dr-crater-deep, #3C2A21);
    background: var(--dr-espresso, #2A1C13);
}

.nev-cp-prompt {
    color: var(--dr-amber, #E69A4C);
    font-weight: 600;
}

.nev-cp-input {
    flex: 1 1 auto;
    background: transparent;
    border: none;
    outline: none;
    color: var(--dr-bone, #EBE1D7);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-sm, 0.75rem);
}

.nev-cp-hint {
    color: var(--dr-mocha, #8B7355);
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wider, 0.10em);
}

.nev-cp-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 320px;
    overflow-y: auto;
}

.nev-cp-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 12px;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: background 80ms var(--dr-easing, cubic-bezier(0.4, 0, 0.2, 1));
}

.nev-cp-row:hover,
.nev-cp-row.is-active {
    background: var(--dr-dark-cacao, #1E140E);
    border-left-color: var(--dr-amber, #E69A4C);
}

.nev-cp-row-main {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.nev-cp-row-label {
    color: var(--dr-bone, #EBE1D7);
    font-weight: 600;
    flex: 0 0 160px;
}

.nev-cp-row-description {
    color: var(--dr-mocha, #8B7355);
    flex: 1 1 auto;
    font-family: var(--dr-font-body, 'DM Sans', system-ui, sans-serif);
}

.nev-cp-row-signature {
    color: var(--dr-crater, #5A453A);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: 0.5625rem;
    margin-left: 160px;
    /* Subtle dim mono signature beneath the row, per agent-native
       parity rule (action rows always carry a structured-call hint). */
}

.nev-cp-empty {
    padding: 12px;
    color: var(--dr-mocha, #8B7355);
    font-style: italic;
    text-align: center;
}

.nev-cp-footer {
    padding: 6px 12px;
    border-top: 1px solid var(--dr-crater-deep, #3C2A21);
    color: var(--dr-mocha, #8B7355);
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-wider, 0.10em);
    background: var(--dr-dark-cacao, #1E140E);
}

/* ----------------------------------------------------------------- *
 * New-problem block (Wave 2 / 2g) — bottom of A&P, high-risk only    *
 * ----------------------------------------------------------------- */

.nev-new-problem-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    margin: 16px 0 8px 0;
    border: 1px solid var(--dr-gold, #DAA520);
    border-left-width: 3px;
    border-radius: 2px;
    background: rgba(218, 165, 32, 0.05);
}

.nev-new-problem-block .nev-category-badge {
    align-self: flex-start;
    color: var(--dr-gold, #DAA520);
    border-color: var(--dr-gold, #DAA520);
    text-transform: uppercase;
    letter-spacing: var(--dr-tracking-widest, 0.20em);
}

.nev-new-problem-title {
    color: var(--dr-bone, #EBE1D7);
    font-family: var(--dr-font-heading, 'Instrument Sans', sans-serif);
    font-size: var(--dr-text-base, 0.875rem);
    font-weight: 600;
}

.nev-new-problem-block .nev-amendment.insert {
    color: var(--dr-bone, #EBE1D7);
    background: transparent;
    line-height: 1.55;
}

.nev-new-problem-plan {
    list-style: none;
    margin: 4px 0 0 0;
    padding-left: 16px;
    color: var(--dr-bone, #EBE1D7);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: var(--dr-text-xs, 0.625rem);
    line-height: 1.55;
}

.nev-new-problem-plan li {
    position: relative;
    padding-left: 8px;
}

.nev-new-problem-plan li::before {
    content: "·";
    position: absolute;
    left: 0;
    color: var(--dr-mocha, #8B7355);
}

/* New-problem tile in the review queue uses the active review-row grid. */
.sol-workspace-main[data-takeover="active"] .nev-review-card[data-category="new_problem"] {
    min-height: calc(10 * var(--nev-row-grid, 18px));
    height: auto;
}

/* ----------------------------------------------------------------- *
 * Traceability highlight (Wave 2 / 2k) — entry card -> patch link    *
 * The right-column patch click emits nev:patch-focused; the left     *
 * column subscribes and adds .is-traceability-source to the source    *
 * entry card.                                                        *
 * ----------------------------------------------------------------- */

.nev-entry-card.is-traceability-source {
    border-color: var(--dr-amber, #E69A4C);
    box-shadow: inset 3px 0 0 0 var(--dr-amber, #E69A4C);
    /* No drop-shadow per visual contract; the inset 3 px amber rail
       does the visual lift. */
    transition: border-color 120ms var(--dr-easing, cubic-bezier(0.4, 0, 0.2, 1));
}

.nev-entry-card.is-traceability-source .nev-entry-time {
    color: var(--dr-amber, #E69A4C);
}

/* ----------------------------------------------------------------- *
 * Reduced-motion respect                                             *
 * ----------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .nev-takeover-body,
    .nev-longitudinal-card,
    .nev-longitudinal-snippet,
    .nev-finalize-host[data-state="ready"] .nev-finalize-cta-btn {
        transition: none !important;
    }
}

/* =========================================================================
   PROVENANCE v0 — fan-out badge + spotlight (2026-05-11)
   
   LivingUpdateColumn paints `→ N patches` chip on each journal entry whose
   linkedEntryIds is non-empty. Clicking the chip fires nev:patch-fanout;
   the workspace adds .is-fanout-spotlight to matching patch tiles in the
   right column. Esc or outside-click clears.
   
   UI rule: badge is omitted entirely when count is 0 (the rendering layer
   does this; this CSS only styles the populated case). Never `→ 0`.
   ========================================================================= */
.nev-entry-fanout {
    margin-top: 6px;
    display: flex;
    align-items: center;
    min-height: 0;
}
.nev-entry-fanout:empty {
    /* Collapse vertical space when no badge is painted. The corpus rule
       is to omit, not show `→ 0`; the rendering layer leaves the host
       empty in that case. */
    margin-top: 0;
}

.nev-fanout-badge {
    font-family: var(--ff-ui, 'Instrument Sans', system-ui, sans-serif);
    font-size: 11px;
    letter-spacing: 0.05em;
    padding: 3px 9px;
    background: var(--dr-provenance-link-bg, #1A130D);
    color: var(--dr-teal, #4CC4B4);
    border: 1px solid var(--dr-provenance-link-border, #2E8A7E);
    cursor: pointer;
    transition: background 100ms ease-out, color 100ms ease-out, border-color 100ms ease-out;
    /* Provenance v0: badge is a navigation control, not decoration —
       hover indicates the click affordance clearly. */
}
.nev-fanout-badge:hover {
    background: var(--dr-teal-deep, #2E8A7E);
    color: var(--dr-fg-display, #FFF7EE);
    border-color: var(--dr-teal, #4CC4B4);
}
.nev-fanout-badge:focus-visible {
    outline: 2px solid var(--dr-teal, #4CC4B4);
    outline-offset: 2px;
}

/* Spotlight rule applied by workspace._handlePatchFanout. Bright outline
   plus subtle inner glow makes it readable against any validation state's
   existing chrome (apply_failed scarlet, conflict amber, etc.). No raw
   background change — preserves the validation-state visual axis. */
.is-fanout-spotlight {
    outline: 2px solid var(--dr-teal, #4CC4B4);
    outline-offset: -1px;
    box-shadow: inset 0 0 0 1px var(--dr-teal, #4CC4B4),
                0 0 12px -2px var(--dr-teal-deep, #2E8A7E);
    transition: outline-color 120ms ease-out, box-shadow 120ms ease-out;
}

/* =========================================================================
   PROVENANCE v0/v1 — fan-IN badge + spotlight (2026-05-11)

   Workspace paints `origin: N` button on patch tiles whose linkedEntryIds
   contains 2+ entries. Clicking fires nev:patch-origin; LivingUpdateColumn
   adds .is-fanin-spotlight to matching entry cards in the left column.
   Esc / outside-click clears. Mirrors the fan-OUT pattern above so the
   doctor learns one interaction model in both directions.

   UI rule: badge is omitted entirely when count <= 1 (the singleton edge
   is already shown by the Fan-OUT chip on the entry side). Same teal as
   .nev-fanout-badge — same provenance edge viewed from the other end.
   ========================================================================= */
.nev-origin-badge {
    font-family: var(--ff-ui, 'Instrument Sans', system-ui, sans-serif);
    font-size: 11px;
    letter-spacing: 0.05em;
    padding: 3px 9px;
    background: var(--dr-provenance-link-bg, #1A130D);
    color: var(--dr-teal, #4CC4B4);
    border: 1px solid var(--dr-provenance-link-border, #2E8A7E);
    cursor: pointer;
    transition: background 100ms ease-out, color 100ms ease-out, border-color 100ms ease-out;
}
.nev-origin-badge:hover {
    background: var(--dr-teal-deep, #2E8A7E);
    color: var(--dr-fg-display, #FFF7EE);
    border-color: var(--dr-teal, #4CC4B4);
}
.nev-origin-badge:focus-visible {
    outline: 2px solid var(--dr-teal, #4CC4B4);
    outline-offset: 2px;
}

/* Spotlight rule applied by living-update-column._handlePatchOrigin. Same
   visual axis as .is-fanout-spotlight — teal outline + inset glow — because
   it's the same provenance edge viewed from the other end. No background
   change; preserves the entry-card source/status visual axes. */
.is-fanin-spotlight {
    outline: 2px solid var(--dr-teal, #4CC4B4);
    outline-offset: -1px;
    box-shadow: inset 0 0 0 1px var(--dr-teal, #4CC4B4),
                0 0 12px -2px var(--dr-teal-deep, #2E8A7E);
    transition: outline-color 120ms ease-out, box-shadow 120ms ease-out;
}

/* =========================================================================
   PROVENANCE RAIL v0 (2026-05-11)

   SVG overlay rendered absolutely inside .nev-takeover-body, drawing
   connector paths between linked artifacts when a Fan-Out chain is
   active. Pointer-events: none so clicks pass through to underlying
   DOM. The workspace owns the drawing logic (see note-evolution-
   workspace.js::_drawProvenanceOverlay); this rule set styles the canvas.

   Daily-driver rail unaffected — overlay only renders inside the
   ENABLE_THREE_SUBSTRATE_TAKEOVER takeover host.

   v0 scope: Fan-Out direction only (entry → patches). v1 will hook
   the Fan-IN reverse direction (patches → entries via origin badge)
   into the same overlay. Dock indicators + 3-segment-with-middle-
   anchor design from v3 mock deferred.
   ========================================================================= */
.nev-takeover-body {
    /* Required for the overlay's absolute positioning to register
       against the takeover body, not the page. Existing layout uses
       grid; position: relative composes safely with that. */
    position: relative;
}

.nev-provenance-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    /* Hidden until the workspace adds .is-active. Avoids a flash of
       empty SVG before the first chain activates. */
    opacity: 0;
    transition: opacity 120ms ease-out;
}
.nev-provenance-overlay.is-active {
    opacity: 1;
}

.nev-provenance-path {
    fill: none;
    stroke: var(--dr-teal, #4CC4B4);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    /* Subtle dashed pattern signals "ephemeral focus mode, not a
       permanent diagram element." Pattern dashes are 6px on / 4px off
       at the path's natural stroke. */
    stroke-dasharray: 6 4;
    /* Glow without a filter — composes with the spotlight box-shadow
       on the linked tiles for a unified visual. */
    filter: drop-shadow(0 0 4px var(--dr-teal-deep, #2E8A7E));
}

/* =========================================================================
   PROVENANCE OVERLAY v2 — DOCK INDICATORS (2026-05-12)
   ========================================================================= */
/* Off-viewport linked-artifact pills. Sit absolutely inside .nev-column
   (just below the column header for top, just above the column footer for
   bottom). Hidden by default; the workspace toggles .is-visible on them
   when the active provenance chain has anchors that have scrolled out of
   the column body's viewport. Click scrolls the offscreen anchor back into
   view. Border + color match .nev-provenance-path stroke (a path
   class preexisting from v0; not renamed). The chip reads as the
   overlay's continuation pulled into a label. */
.nev-provenance-dock {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dr-obsidian, #160E08);
    border: 1px solid var(--dr-teal-deep, #2E8A7E);
    color: var(--dr-teal, #4CC4B4);
    font-family: var(--dr-font-mono, 'Fira Code', monospace);
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    display: none;
    cursor: pointer;
    z-index: 6;
    pointer-events: auto;
    white-space: nowrap;
    border-radius: 2px;
    /* Match the rail's drop-shadow so visible docks read as part of the
       same lit chain. Subtle, not strobing. */
    box-shadow: 0 0 6px var(--dr-teal-deep, #2E8A7E);
}
.nev-provenance-dock.is-visible {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nev-provenance-dock-top    { top: 50px; }    /* below .nev-column-header */
.nev-provenance-dock-bottom { bottom: 6px; }
.nev-provenance-dock:hover,
.nev-provenance-dock:focus-visible {
    background: var(--dr-dark-cacao, #1E140E);
    color: var(--dr-bone, #EBE1D7);
    outline: none;
}

/* =========================================================================
   BASE NOTE STRUCTURED RENDERER (2026-05-11)

   The right column's "Today's Note" was rendered as flat `.textContent` —
   a giant blob of plaintext. This is the structured renderer's CSS: real
   document chrome with section headers, A&P problem cards, and status
   pills mapped to clinical severity tiers.

   Mounted into `.nev-base-note-host` (data-mount="base-note") via
   NoteEvolutionWorkspace._renderBaseNote().
   ========================================================================= */
.nev-base-note-doc {
    font-family: var(--ff-ui, 'Instrument Sans', system-ui, sans-serif);
    font-size: 14px;
    line-height: 1.65;
    color: var(--dr-fg-body, #E8E0D6);
    padding: 16px 24px 32px;
    overflow-y: auto;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
}

/* Document header (Date, Service, Active Consults) — compact info strip. */
.nev-bn-doc-header {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
    padding: 0 0 8px;
    margin: 0 0 12px;
    border-bottom: 2px dashed var(--dr-divider, #2A2018);
    font-family: var(--ff-mono, 'JetBrains Mono', monospace);
    font-size: 12px;
}
.nev-bn-doc-field { display: inline-flex; align-items: baseline; gap: 6px; }
.nev-bn-field-label {
    color: var(--dr-fg-muted, #8E8074);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    font-size: 11px;
}
.nev-bn-field-value { color: var(--dr-fg-display, #FFF7EE); font-weight: 500; }

/* Section: SUBJECTIVE / OBJECTIVE / etc. Top divider + uppercase title
   creates visible hierarchy without bouncing the eye between sections. */
.nev-bn-section {
    margin: 0 0 16px;
    padding-top: 8px;
    border-top: 1px solid var(--dr-divider-soft, #1F1810);
}
.nev-bn-section:first-of-type { border-top: none; padding-top: 0; }
.nev-bn-section-title {
    font-family: var(--ff-mono, 'JetBrains Mono', monospace);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--dr-teal, #4CC4B4);
    margin: 0 0 12px;
    padding-bottom: 4px;
    border-bottom: 1px dashed var(--dr-divider-soft, #1F1810);
    display: inline-block;
}
.nev-bn-section-body { color: var(--dr-fg-body, #E8E0D6); }
.nev-bn-para { margin: 0 0 10px; }
.nev-bn-para:last-child { margin-bottom: 0; }

.nev-bn-list {
    margin: 6px 0 16px;
    padding-left: 20px;
    list-style: none;
}
.nev-bn-list li { position: relative; padding: 3px 0; }
.nev-bn-list li::before {
    content: '·';
    position: absolute;
    left: -14px;
    top: -2px;
    color: var(--dr-teal-deep, #2E8A7E);
    font-weight: 700;
    font-size: 16px;
}

/* A&P section — distinct chrome. The summary line above the problems
   gets italicized so it reads as epigraph, not body. */
.nev-bn-section-ap .nev-bn-section-title { color: var(--dr-amber, #E8A23A); }
.nev-bn-ap-summary {
    font-family: var(--ff-prose, 'Source Serif Pro', Georgia, serif);
    font-style: italic;
    font-size: 15px;
    color: var(--dr-fg-muted, #8E8074);
    margin: 0 0 12px;
    padding: 10px 14px;
    border-left: 3px solid var(--dr-amber-deep, #8A5F1E);
    background: var(--dr-bg-elev, rgba(255, 247, 238, 0.025));
    border-radius: 0 4px 4px 0;
}
.nev-bn-ap-summary > .nev-bn-para { margin: 0; }
.nev-bn-problems { display: flex; flex-direction: column; gap: 12px; }

/* Problem card — hash sigil + title + status pill in the header row,
   body indented under. Status colors lifted from the existing risk/
   validation palette so the same severity ladder applies whether the
   doctor's looking at a patch tile or a problem card. */
.nev-bn-problem {
    position: relative;
    padding: 8px 10px 10px 12px;
    background: var(--dr-espresso, #2A1C13); /* content plane — must sit ≥1 canonical step above the obsidian column, else it vanishes (measured Δ0 vs backdrop 2026-08-19) */
    border: 1px solid var(--dr-crater, #5A453A);
    border-left: 4px solid var(--dr-crater, #5A453A);
    border-radius: 6px;
    margin-bottom: 8px;
    transition: border-left-color 100ms ease-out, box-shadow 150ms ease;
    box-shadow: 0 4px 12px rgba(0,0,0, 0.3), inset 0 1px 0 rgba(255,247,238, 0.06);
}
.nev-bn-problem:hover {
    box-shadow: 0 6px 16px rgba(0,0,0, 0.4), inset 0 2px 10px rgba(0,0,0, 0.2);
}
.nev-bn-problem-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.02);
    margin: -8px -10px 8px -12px;
    padding: 6px 10px 6px 12px;
    border-bottom: 1px solid var(--dr-crater-deep, #3C2A21);
    border-radius: 6px 6px 0 0;
}
.nev-bn-problem-hash {
    font-family: var(--ff-mono, 'JetBrains Mono', monospace);
    color: var(--dr-fg-muted, #8E8074);
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
}
.nev-bn-problem-title {
    margin: 0;
    flex: 1 1 auto;
    font-family: var(--ff-ui, 'Instrument Sans', system-ui, sans-serif);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--dr-bone, #EBE1D7);
    line-height: 1.2;
}
.nev-bn-problem-status {
    display: inline-flex;
    align-items: center;
    font-family: var(--ff-mono, 'JetBrains Mono', monospace);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px dashed currentColor;
    background: var(--dr-bg-elev, rgba(0, 0, 0, 0.2));
}
.nev-bn-problem-body { padding-left: 2px; color: var(--dr-fg-body, #E8E0D6); }
.nev-bn-problem-body .nev-bn-para { font-size: 14.5px; line-height: 1.65; }
.nev-bn-problem-body .nev-bn-list { margin-top: 8px; font-size: 14.5px; line-height: 1.65; }

/* Status color ladder — locked to the same axis as risk/validation badges
   elsewhere. New = gold (novel, action required), Worsening = magenta
   (escalation), Stable = olive (steady-state), Improving = harvest (trending
   right), Resolved/Resolving = teal. */
.nev-bn-problem[data-status="new"]            { border-left-color: var(--dr-gold, #F5C24A); }
.nev-bn-problem[data-status="new"] .nev-bn-problem-status            { color: var(--dr-gold, #F5C24A); }
.nev-bn-problem[data-status="worsening"]      { border-left-color: var(--severity-worsening, #C25F90); }
.nev-bn-problem[data-status="worsening"] .nev-bn-problem-status      { color: var(--severity-worsening, #C25F90); }
.nev-bn-problem[data-status="stable"]         { border-left-color: var(--severity-stable, #879A39); }
.nev-bn-problem[data-status="stable"] .nev-bn-problem-status         { color: var(--severity-stable, #879A39); }
.nev-bn-problem[data-status="improving"]      { border-left-color: var(--severity-improving, #D4A040); }
.nev-bn-problem[data-status="improving"] .nev-bn-problem-status      { color: var(--severity-improving, #D4A040); }
.nev-bn-problem[data-status="resolving"],
.nev-bn-problem[data-status="resolved"]       { border-left-color: var(--severity-resolved, #4CC4B4); opacity: 0.78; }
.nev-bn-problem[data-status="resolving"] .nev-bn-problem-status,
.nev-bn-problem[data-status="resolved"] .nev-bn-problem-status       { color: var(--severity-resolved, #4CC4B4); }
.nev-bn-problem[data-status="active"]         { border-left-color: var(--dr-teal-deep, #2E8A7E); }
.nev-bn-problem[data-status="active"] .nev-bn-problem-status         { color: var(--dr-teal-deep, #2E8A7E); }

/* Fallback for total parse failure — preserve raw text so the doctor never
   stares at a blank pane. Monospace + scroll, reads as "diagnostic." */
.nev-bn-fallback {
    font-family: var(--ff-mono, 'JetBrains Mono', monospace);
    font-size: 12px;
    line-height: 1.55;
    color: var(--dr-fg-body, #E8E0D6);
    white-space: pre-wrap;
    margin: 0;
    padding: 16px;
    background: var(--dr-bg-surface, rgba(255, 247, 238, 0.02));
    border: 1px dashed var(--dr-divider, #2A2018);
    border-radius: 4px;
}
.nev-bn-preface { margin: 0 0 16px; color: var(--dr-fg-body, #E8E0D6); font-family: var(--ff-mono, 'JetBrains Mono', monospace); }

/* ─── Inline diff overlay — "rolled-up Today's Note" (2026-05-11) ───
   Each accepted patch is projected as a single `<p.nev-bn-patch-line>`
   appended into the matching problem body (or section body / synthesized
   new-problem card). The line hosts the legacy `.nev-amendment` spans
   so the existing category/risk color CSS in note-evolution.css
   applies unchanged. We add layout-level placement here. */
.nev-bn-patch-line {
    margin: 6px 0 0;
    padding: 6px 8px 6px 10px;
    background: rgba(232, 162, 58, 0.05); /* Diff-like highlight */
    border: 1px dashed var(--dr-amber, #E8A23A);
    border-left: 4px solid var(--dr-amber, #E8A23A);
    border-radius: 4px;
    font-family: var(--ff-mono, 'JetBrains Mono', monospace); /* Monospace patches */
    font-size: 13.5px;
    line-height: 1.5;
    display: block;
    color: var(--dr-fg-body, #E8E0D6);
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
    box-shadow: 0 2px 8px rgba(0,0,0, 0.2);
}
.nev-bn-patch-line:hover {
    background: rgba(232, 162, 58, 0.12);
    border-color: var(--dr-gold, #F5C24A);
    transform: translateX(2px);
}
.nev-bn-patch-line--projection,
.nev-bn-patch-line--projection:hover {
    background: rgba(232, 162, 58, 0.05);
    border-color: var(--dr-amber, #E8A23A);
    cursor: default;
    transform: none;
}
.nev-bn-patch-line:focus-visible {
    outline: 2px solid var(--dr-teal, #4CC4B4);
    outline-offset: -2px;
}

.nev-patch-pending-badge {
    display: inline-flex;
    align-items: center;
    margin: 0 6px 4px 0;
    padding: 2px 6px;
    color: var(--dr-teal, #4CC4B4);
    background: rgba(76, 196, 180, 0.09);
    border: 1px solid rgba(76, 196, 180, 0.38);
    border-radius: 999px;
    font: 700 10.5px/1.35 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .01em;
}
.nev-patch-pending-badge[data-state="physician"] {
    color: var(--dr-gold, #F5C24A);
    background: rgba(245, 194, 74, 0.08);
    border-color: rgba(245, 194, 74, 0.4);
}
.nev-patch-pending-badge[data-state="selected"] {
    color: var(--dr-brass, #BFA162);
    background: rgba(191, 161, 98, 0.09);
    border-color: rgba(191, 161, 98, 0.4);
}

/* Explicit Diff-Esque Visuals for Insertions and Deletions inside Patches */
.nev-bn-patch-line .nev-amendment.insert {
    background: rgba(76, 196, 180, 0.2);
    color: var(--dr-teal, #4CC4B4);
    padding: 2px 6px;
    margin: 0 2px;
    border-radius: 3px;
    border-bottom: 1px solid rgba(76, 196, 180, 0.5);
    text-decoration: none;
    font-weight: 500;
}
.nev-bn-patch-line .nev-amendment.insert::before {
    content: '+';
    margin-right: 4px;
    opacity: 0.7;
    font-weight: 700;
}

.nev-bn-patch-line .nev-amendment.delete {
    background: rgba(196, 76, 76, 0.2);
    color: var(--dr-scarlet, #E5524A);
    padding: 2px 6px;
    margin: 0 2px;
    border-radius: 3px;
    border-bottom: 1px solid rgba(196, 76, 76, 0.5);
    text-decoration: line-through;
    opacity: 0.85;
    font-weight: 500;
}
.nev-bn-patch-line .nev-amendment.delete::before {
    content: '-';
    margin-right: 4px;
    opacity: 0.7;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
}

/* 2026-05-12 — inline edit affordance on accepted patch-line. Default is
   invisible (no clutter on a fresh substrate render); fades in on hover or
   keyboard focus so doctors discover it without seeing a row of tiny
   buttons across every line. */
.nev-bn-patch-edit,
.nev-bn-patch-source {
    float: right;
    margin-left: 8px;
    padding: 1px 6px;
    font-family: var(--dr-font-mono, 'JetBrains Mono', monospace);
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dr-mocha, #8E8074);
    background: transparent;
    border: 1px solid var(--dr-crater-deep, #3C2A21);
    border-radius: 2px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 150ms ease, color 150ms ease, border-color 150ms ease;
}
.nev-bn-patch-line:hover .nev-bn-patch-edit,
.nev-bn-patch-line:focus-within .nev-bn-patch-edit,
.nev-bn-patch-edit:focus-visible,
.nev-bn-patch-line:hover .nev-bn-patch-source,
.nev-bn-patch-line:focus-within .nev-bn-patch-source,
.nev-bn-patch-source:focus-visible {
    opacity: 1;
}
.nev-bn-patch-edit:hover,
.nev-bn-patch-edit:focus-visible,
.nev-bn-patch-source:hover,
.nev-bn-patch-source:focus-visible {
    color: var(--dr-bone, #FFF7EE);
    border-color: var(--dr-teal, #4CC4B4);
}
/* 2026-05-12 — symmetric reject affordance. Same hairline aesthetic +
   hover-fade pattern as `.nev-bn-patch-edit`; hover/focus flip to scarlet
   so the destructive intent reads at a glance. Color cue + window.confirm
   are the two guards against accidental clicks. */
.nev-bn-patch-reject {
    float: right;
    margin-left: 6px;
    padding: 1px 6px;
    font-family: var(--dr-font-mono, 'JetBrains Mono', monospace);
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dr-mocha, #8E8074);
    background: transparent;
    border: 1px solid var(--dr-crater-deep, #3C2A21);
    border-radius: 2px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 150ms ease, color 150ms ease, border-color 150ms ease;
}
.nev-bn-patch-line:hover .nev-bn-patch-reject,
.nev-bn-patch-line:focus-within .nev-bn-patch-reject,
.nev-bn-patch-reject:focus-visible {
    opacity: 1;
}
.nev-bn-patch-reject:hover,
.nev-bn-patch-reject:focus-visible {
    color: var(--dr-bone, #FFF7EE);
    border-color: var(--dr-scarlet, #E5524A);
}
/* 2026-05-12 — Edited-vs-accepted visual differentiation. Doctor-rewritten
   patches (`editPatch` Wave-1 edit-and-accept OR `editAcceptedPatch` post-
   accept edit) carry `status === 'edited'`. Prefix the insert span with a
   small ✎ mark in gold so a doctor reviewing the rolled-up note can see at
   a glance which lines are their own wording vs verbatim-accepted LLM
   output. Single character, no extra DOM element, no JS change — pure
   `data-status` attribute selector + `::before` content. */
.nev-bn-patch-line[data-status="edited"] .nev-amendment.insert::before {
    content: '✎';
    display: inline-block;
    color: var(--dr-gold, #F5C24A);
    font-weight: 700;
    margin-right: 4px;
    opacity: 0.85;
}
.nev-bn-patch-line[data-risk="high"]   { border-left-color: var(--dr-scarlet, #E5524A); }
.nev-bn-patch-line[data-risk="medium"] { border-left-color: var(--dr-amber, #E8A23A); }
.nev-bn-patch-line[data-risk="low"]    { border-left-color: var(--dr-teal, #4CC4B4); }

/* Stack the category badge to the left of the inserted text; suppress
   the heavy underline-by-default styling that .nev-amendment carries
   outside a problem-card context — inside the rolled-up doc, the
   left rail + badge is enough provenance. */
.nev-bn-patch-line .nev-amendment {
    border-bottom: none;
    background: transparent;
    color: inherit;
    padding: 0 2px;
}
.nev-bn-patch-line .nev-amendment.accepted.delete { display: none; }
.nev-bn-patch-line .nev-amendment.accepted.insert { opacity: 1; }
.nev-bn-inline-projection {
    display: inline;
}
.nev-bn-inline-projection .nev-bn-inline-accepted {
    display: inline;
    padding: 1px 2px;
    color: inherit;
    background: rgba(76, 196, 180, 0.09);
    border-bottom: 1px dashed rgba(76, 196, 180, 0.58);
    border-radius: 2px;
    font-weight: inherit;
    text-decoration: none;
    white-space: pre-wrap;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}
.nev-bn-inline-projection[data-status="edited"] .nev-bn-inline-accepted {
    background: rgba(245, 194, 74, 0.08);
    border-bottom-color: rgba(245, 194, 74, 0.62);
}
.nev-bn-inline-ownership-marker {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 5px;
    border: 1px solid rgba(191, 161, 98, .42);
    border-radius: 999px;
    color: var(--dr-gold, #F5C24A);
    background: rgba(245, 194, 74, .07);
    font: 650 9.5px/1.35 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .025em;
    vertical-align: 1px;
    white-space: nowrap;
}
.nev-bn-inline-ownership-marker[data-origin="physician_adopted"],
.nev-bn-inline-ownership-marker[data-origin="physician_edited"],
.nev-bn-inline-ownership-marker[data-origin="physician_stated"] {
    color: var(--dr-teal, #4CC4B4);
    border-color: rgba(76, 196, 180, .42);
    background: rgba(76, 196, 180, .07);
}
.nev-bn-patch-line--anchored {
    padding-block: 5px;
}
.nev-bn-patch-application {
    display: block;
    clear: both;
    margin-top: 2px;
    color: var(--dr-fg-muted, #B9ADA2);
    font: 600 10.5px/1.4 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .01em;
}
.nev-bn-patch-line .nev-category-badge {
    display: inline-block;
    font-family: var(--ff-mono, 'JetBrains Mono', monospace);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 1px 5px;
    margin-right: 6px;
    border-radius: 2px;
    vertical-align: 1px;
    background: rgba(255, 247, 238, 0.06);
    color: var(--dr-fg-body, #E8E0D6);
}

/* Full Note is a mandatory clinical read-through, so accepted patch prose
   keeps the same happened-vs-next semantics visible below the exact inserted
   wording. Span-only DOM remains valid inside the patch paragraph; grid gives
   mixed clauses room without creating a second scrolling surface. */
.nev-bn-patch-semantics {
    display: grid;
    clear: both;
    width: 100%;
    gap: 4px;
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid rgba(191, 161, 98, .22);
}
.nev-bn-patch-semantics > .nev-rec-badges {
    justify-self: start;
}
.nev-bn-patch-semantics .nev-rec-breakdown {
    margin-top: 2px;
}
.nev-bn-patch-semantics--bhc {
    margin: 6px 0 8px;
}

.nev2-inline-edit-semantics {
    margin-top: 5px;
    padding: 5px 7px;
    border-left: 2px solid var(--dr-gold, #F5C24A);
    color: var(--dr-bone, #EBE1D7);
    background: rgba(245, 194, 74, .07);
    font: 600 10.5px/1.4 var(--dr-font-mono, 'Fira Code', monospace);
}

/* Note-Evolution-only handoff into the ordinary final review. The node is
   created only while the recommendation-origin flag and audit context are
   both present, so the ordinary rail remains untouched. */
.nev-final-review-sidecar {
    display: block;
    /* Flex child of .rail-review-body (overflow hidden): never grow past
     * 40% of it, scroll inside; the note below keeps the rest (2026-09-06). */
    flex: 0 0 auto;
    max-height: 40%;
    overflow-y: auto;
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid rgba(191, 161, 98, .42);
    border-left: 3px solid var(--dr-gold, #F5C24A);
    border-radius: 4px;
    background: rgba(245, 194, 74, .055);
    color: var(--dr-bone, #EBE1D7);
}
.nev-final-review-sidecar > summary {
    cursor: pointer;
    color: var(--dr-crema, #FFF7EE);
    font: 700 12px/1.35 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .035em;
    text-transform: uppercase;
    list-style: none;
}
.nev-final-review-sidecar > summary::before { content: '▸ '; }
.nev-final-review-sidecar[open] > summary::before { content: '▾ '; }
.nev-final-review-sidecar[open] > summary { margin-bottom: 10px; }
.nev-final-review-sidecar-note { margin-bottom: 10px; }
.nev-final-review-sidecar-group + .nev-final-review-sidecar-group { margin-top: 10px; }
.nev-final-review-sidecar h3,
.nev-final-review-sidecar h4,
.nev-final-review-sidecar p,
.nev-final-review-sidecar ul {
    margin: 0;
}
.nev-final-review-sidecar h3 {
    color: var(--dr-crema, #FFF7EE);
    font: 700 12px/1.35 var(--dr-font-mono, 'Fira Code', monospace);
    letter-spacing: .035em;
    text-transform: uppercase;
}
.nev-final-review-sidecar-note {
    color: var(--dr-sand, #C7B299);
    font-size: 11px;
    line-height: 1.45;
}
.nev-final-review-sidecar-group {
    display: grid;
    gap: 5px;
}
.nev-final-review-sidecar-group h4 {
    color: var(--dr-brass, #BFA162);
    font: 700 10.5px/1.35 var(--dr-font-mono, 'Fira Code', monospace);
    text-transform: uppercase;
}
.nev-final-review-sidecar-group[data-kind="adopted"] h4 {
    color: var(--dr-gold, #F5C24A);
}
.nev-final-review-sidecar-group ul {
    display: grid;
    gap: 6px;
    padding: 0;
    list-style: none;
}
.nev-final-review-sidecar-group li {
    display: grid;
    gap: 2px;
    padding-top: 6px;
    border-top: 1px solid rgba(191, 161, 98, .18);
}
.nev-final-review-sidecar-labels {
    color: var(--dr-brass, #BFA162);
    font: 600 10px/1.35 var(--dr-font-mono, 'Fira Code', monospace);
}
.nev-final-review-sidecar-text {
    color: var(--dr-bone, #EBE1D7);
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 520px) {
    .nev-view-switch-btn,
    .nev-problem-review-full-btn,
    .nev-full-note-problem-return {
        min-height: 40px;
    }
}

/* Brief flash to draw the eye when a patch lands on accept. Animation
   class is removed via animationend so doctors scrubbing accept/reject
   don't strobe the column. */
@keyframes nev-bn-patch-flash {
    0%   { background: rgba(232, 162, 58, 0.22); }
    100% { background: var(--dr-bg-surface, rgba(255, 247, 238, 0.025)); }
}
.nev-bn-patch-line-flash {
    animation: nev-bn-patch-flash 0.9s ease-out 1;
}

/* Synthesized problem card for accepted `new_problem` / unmatched-target
   patches. Subtle "new" treatment (gold rail mirrors data-status="new"
   in the existing pill mapping) so it sits naturally alongside parsed
   problems without looking grafted on. */
.nev-bn-problem-new {
    border-left-style: dashed;
    background: rgba(245, 194, 74, 0.04);
}
.nev-bn-problem-new .nev-bn-problem-title { color: var(--dr-gold, #F5C24A); }

/* ────────────────────────────────────────────────────────────────────
   Divergence 2 (2026-05-16) — manual scoped slot-edit controls.

   The `data-nev-slot-type` attribute is emitted ONLY when the nested
   sub-flag chain (__ENABLE_NEV_SLOT_EDIT && __ENABLE_THREE_SUBSTRATE_
   TAKEOVER) is on, so every rule below is structurally dormant flag-OFF
   — zero visual delta vs the committed daily-driver right pane.

   The hover pencil is a single CSS ::after affordance (NOT a per-slot
   <button> in the DOM) — keeps the rendered tree byte-light and the
   click wiring delegated from #nevBaseNote. textarea/input/select only;
   there is deliberately NO contenteditable styling (vision non-goal).
   ──────────────────────────────────────────────────────────────────── */

/* Editable units get a quiet hover affordance: a hairline ring + a
   pencil glyph anchored top-right. position:relative is scoped to
   slot-typed nodes only so non-slot layout is untouched. */
[data-nev-slot-type] {
    position: relative;
    border-radius: 3px;
    transition: background var(--dr-timing-fast, 120ms)
        var(--dr-easing-ease-out, ease-out);
}
[data-nev-slot-type]:hover {
    background: rgba(245, 194, 74, 0.05);
    box-shadow: inset 0 0 0 1px var(--dr-divider-soft, rgba(255, 247, 238, 0.10));
}
[data-nev-slot-type]:hover::after {
    content: "\270E";                 /* ✎ lower-right pencil */
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 11px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 3px;
    color: var(--dr-gold, #F5C24A);
    background: var(--dr-bg-elev, rgba(20, 14, 10, 0.85));
    border: 1px solid var(--dr-divider, rgba(255, 247, 238, 0.14));
    pointer-events: none;             /* click goes to the slot/dblclick */
    opacity: 0;
    animation: nev-slot-pencil-in var(--dr-timing-fast, 120ms)
        var(--dr-easing-ease-out, ease-out) forwards;
}
/* A dedicated single-click pencil hit-target overlaying the glyph area.
   Rendered for keyboard/click users who prefer not to double-click;
   the delegated handler in note-evolution-workspace.js routes a click
   on `.nev-slot-edit-trigger` to _activateSlotEdit. Invisible until the
   slot is hovered (sits under the ::after glyph). */
.nev-slot-edit-trigger {
    position: absolute;
    top: 0;
    right: 0;
    width: 26px;
    height: 22px;
    border: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    opacity: 0;
}
[data-nev-slot-type]:hover .nev-slot-edit-trigger { opacity: 1; }

@keyframes nev-slot-pencil-in {
    from { opacity: 0; transform: translateY(-1px); }
    to   { opacity: 0.92; transform: translateY(0); }
}

/* Active-editing slot: hide the hover pencil, draw a focus ring so the
   doctor sees exactly which unit is being amended. */
[data-nev-slot-type].editing { background: var(--dr-bg-elev, rgba(20, 14, 10, 0.6)); }
[data-nev-slot-type].editing:hover::after { content: none; }
[data-nev-slot-type].editing {
    box-shadow: inset 0 0 0 1px var(--dr-gold, #F5C24A);
    padding: 6px;
}

/* The inline editor container (control + Save/Cancel). */
.nev-slot-editor {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

/* Dark-roast form controls. Auto-height textarea is sized in JS via the
   rows attribute (content-aware); width fills the slot. */
.nev-slot-textarea,
.nev-slot-input,
.nev-slot-select {
    width: 100%;
    box-sizing: border-box;
    font-family: var(--dr-font-body, inherit);
    font-size: 13px;
    line-height: 1.5;
    color: var(--dr-fg-body, #E8E0D6);
    background: var(--dr-bg-surface, rgba(255, 247, 238, 0.025));
    border: 1px solid var(--dr-divider, rgba(255, 247, 238, 0.16));
    border-radius: 4px;
    padding: 7px 9px;
    outline: none;
    resize: vertical;
}
.nev-slot-input,
.nev-slot-select { resize: none; }
.nev-slot-textarea:focus,
.nev-slot-input:focus,
.nev-slot-select:focus {
    border-color: var(--dr-gold, #F5C24A);
    box-shadow: 0 0 0 2px rgba(245, 194, 74, 0.18);
}
.nev-slot-textarea { min-height: 64px; }

/* Save / Cancel row — compact, right-aligned, peer-tool register. */
.nev-slot-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}
.nev-slot-btn {
    font-family: var(--dr-font-body, inherit);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--dr-divider, rgba(255, 247, 238, 0.16));
    background: var(--dr-bg-surface, rgba(255, 247, 238, 0.03));
    color: var(--dr-fg-body, #E8E0D6);
    transition: background var(--dr-timing-fast, 120ms)
        var(--dr-easing-ease-out, ease-out);
}
.nev-slot-btn:hover { background: rgba(255, 247, 238, 0.08); }
.nev-slot-save {
    border-color: var(--dr-gold, #F5C24A);
    color: var(--dr-gold, #F5C24A);
}
.nev-slot-save:hover { background: rgba(245, 194, 74, 0.14); }

/* ───────────────────────────────────────────────────────────────────
 * Divergence 1 (2026-05-16) — inline-at-knot action surface.
 *
 * Phase B: sticky note-block action bar at the top edge of the focused
 *          .nev-bn-problem (the right-pane mirror of the knot popover).
 * Phase C: read-only patch-ledger chip that replaces the queue card's
 *          action row when the queue is demoted (flag-ON only).
 *
 * Dormant unless __ENABLE_NEV_INLINE_ACTIONS (the markup is never
 * emitted otherwise — see _isInlineActionsEnabled()). All rules scoped
 * to the takeover surface so the rail/daily-driver is untouched. Dark
 * Roast --dr-* tokens with safe fallbacks. NO contenteditable styling.
 * ─────────────────────────────────────────────────────────────────── */

/* Phase B — sticky note-block action bar. Sits at the block's top edge
 * and stays pinned while the doctor scrolls the assessment body. */
.sol-workspace-main[data-takeover="active"] .nev-bn-action-bar {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: -2px -2px 8px;
    padding: 6px 8px;
    background: rgba(18, 12, 6, 0.92);
    border: 1px solid rgba(191, 161, 98, 0.40);
    border-radius: 3px;
    backdrop-filter: blur(2px);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
}
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-head {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-title {
    font: 600 11px/1.2 inherit;
    color: var(--dr-crema, #FFF7EE);
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-count {
    font: 9px/1 inherit;
    color: var(--dr-mocha, #8B7355);
    letter-spacing: 0.03em;
}
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-cat {
    font: 8px/1 inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dr-brass, #BFA162);
    padding-right: 4px;
}
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-btn,
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-edit {
    appearance: none;
    border: 1px solid rgba(139, 115, 85, 0.55);
    background: rgba(30, 20, 14, 0.72);
    color: var(--dr-bone, #EBE1D7);
    font: 9px/1 inherit;
    padding: 4px 8px;
    border-radius: 2px;
    cursor: pointer;
    transition: background 120ms var(--dr-easing-ease-out, ease-out);
}
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-btn:hover,
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-edit:hover {
    background: rgba(255, 247, 238, 0.08);
}
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-btn.accept {
    border-color: var(--dr-gold, #F5C24A);
    color: var(--dr-gold, #F5C24A);
}
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-btn.accept:hover {
    background: rgba(245, 194, 74, 0.14);
}
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-btn.accept[disabled],
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-btn.accept[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: auto;
}
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-btn.accept[data-stale-warn="true"] {
    border-color: var(--dr-amber, #E69A4C);
    color: var(--dr-amber, #E69A4C);
}
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-btn.reject {
    border-color: var(--dr-scarlet, #C44C4C);
    color: var(--dr-scarlet, #C44C4C);
}
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-btn.reject:hover {
    background: rgba(196, 76, 76, 0.12);
}
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-btn.doctor {
    border-color: var(--dr-amber, #E69A4C);
    color: var(--dr-amber, #E69A4C);
}
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-btn.ehr {
    border-color: var(--dr-teal, #4CC4B4);
    color: var(--dr-teal, #4CC4B4);
}
.sol-workspace-main[data-takeover="active"] .nev-bn-ab-chip {
    font: 9px/1 inherit;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dr-mocha, #8B7355);
    padding: 3px 6px;
    border: 1px solid rgba(139, 115, 85, 0.4);
    border-radius: 2px;
}

@media (max-width: 520px), (pointer: coarse) {
    .sol-workspace-main[data-takeover="active"] .nev-bn-ab-btn,
    .sol-workspace-main[data-takeover="active"] .nev-bn-ab-edit,
    .nev-bn-patch-edit,
    .nev-bn-patch-reject,
    .nev-bn-patch-source {
        min-height: 36px;
        padding: 7px 10px;
        font-size: 11px;
        opacity: 1;
    }
}

/* Phase C — read-only patch-ledger chip (replaces the queue card's
 * action row when the queue is demoted). No buttons; pure state. */
.sol-workspace-main[data-takeover="active"] .nev-ledger-chip {
    display: inline-flex;
    align-items: center;
    font: 9px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dr-mocha, #8B7355);
    padding: 3px 8px;
    border: 1px solid rgba(139, 115, 85, 0.45);
    border-radius: 2px;
    background: rgba(18, 12, 6, 0.44);
}
.sol-workspace-main[data-takeover="active"] .nev-ledger-chip.accepted {
    color: var(--dr-gold, #F5C24A);
    border-color: rgba(245, 194, 74, 0.45);
}
.sol-workspace-main[data-takeover="active"] .nev-ledger-chip.rejected {
    color: var(--dr-scarlet, #C44C4C);
    border-color: rgba(196, 76, 76, 0.42);
}
.sol-workspace-main[data-takeover="active"] .nev-ledger-chip.edited {
    color: var(--dr-amber, #E69A4C);
    border-color: rgba(230, 154, 76, 0.42);
}
/* Ledger rows stay click-to-navigate (focus block + tapestry knot). */
.sol-workspace-main[data-takeover="active"] .nev-review-card:hover {
    cursor: pointer;
}

/* FIX (2026-07-03) — unreachable-proposal fallback. A PROPOSED patch with
 * no exact-match note block (new-problem / drifted title) falls through to
 * a real action row instead of a dead ledger chip; badge it so it reads as
 * an intentional exception, not a stray inconsistent card. */
.sol-workspace-main[data-takeover="active"] .nev-ledger-unreachable {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 8px;
    border: 1px dashed rgba(230, 154, 76, 0.5);
    border-radius: 3px;
    background: rgba(230, 154, 76, 0.08);
}
.sol-workspace-main[data-takeover="active"] .nev-ledger-unreachable-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.sol-workspace-main[data-takeover="active"] .nev-ledger-unreachable-note {
    font: 9px/1.3 ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dr-amber, #E69A4C);
}

/* R10d — labeled control zones: CHART (navigates history, never edits) vs
 * WORKSPACE (accept/reject/finalize — changes today's note). */
.nev-column[data-zone="chart"] .nev-column-eyebrow {
    color: var(--dr-mocha, #8B7355);
    border-left: 2px solid var(--dr-mocha, #8B7355);
    padding-left: 5px;
}
.nev-column[data-zone="workspace"] .nev-column-eyebrow {
    color: var(--dr-teal, #4CC4B4);
    border-left: 2px solid var(--dr-teal, #4CC4B4);
    padding-left: 5px;
}

/* ===== Fact-checker's margin (2026-07-20, ENABLE_NE_WITNESS_MARGIN) =====
   Exception-first review: witnessed assertion rows recede; unwitnessed rows
   carry the amber chip. Chips are tiny outlined pills — semantic accents,
   no neon shadows (Cold Brew contract). Absent witness data = no classes,
   surface byte-identical to flag-off. */
.nev-assertion-item.nev-assertion--witnessed {
    opacity: 0.62;
}
.nev-assertion-item.nev-assertion--witnessed:hover,
.nev-assertion-item.nev-assertion--witnessed:focus-within {
    opacity: 1;
}
.nev-assertion-item.nev-assertion--unwitnessed {
    box-shadow: inset 2px 0 0 0 rgba(194, 147, 46, 0.85);
}
.nev-witness-chip {
    display: inline-block;
    margin-left: 6px;
    padding: 0 7px;
    border-radius: 999px;
    border: 1px solid currentColor;
    font-size: 10px;
    line-height: 16px;
    vertical-align: middle;
    white-space: nowrap;
    cursor: help;
}
.nev-witness-chip--ok { color: #6f9e79; }
.nev-witness-chip--warn { color: #c2932e; font-weight: 600; }

/* Illuminated Loom cohesion (2026-07-23): problem-card titles join the serif
   masthead family (heading only; 18px kept); the # sigil becomes a brass finial. */
.nev-bn-problem-title { font-family: var(--nev-serif, 'Book Antiqua', Georgia, serif); }
.nev-bn-problem-hash { color: var(--dr-brass, #BFA162); }

/* ── Lane A (2026-08-18): one-click ceremony surfaces ─────────────────
   All selectors below are rendered ONLY when ENABLE_NE_ONE_CLICK_ACCEPT
   is on (JS gates the markup) — inert rules until the flag flips. */
.nev-consequence-line {
    font-size: 0.82rem;
    color: var(--nev-text-muted, #8a8f98);
    border-left: 2px solid var(--nev-risk-high, #c0564f);
    padding: 0.15rem 0 0.15rem 0.6rem;
    margin: 0.35rem 0;
}
body[data-nev-one-click] .nev-review-card[data-risk="high"] {
    border-left: 3px solid var(--nev-risk-high, #c0564f);
}
.nev-undo-btn { opacity: 0.85; }
.nev-problem-chip-strip {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.4rem 0.2rem;
    background: var(--nev-surface, #14181d);
    border-bottom: 1px solid var(--nev-border, #262c33);
}
.nev-problem-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    white-space: nowrap;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--nev-border, #262c33);
    background: transparent;
    color: var(--nev-text, #d7dbe0);
    cursor: pointer;
}
.nev-problem-chip .nev-chip-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--nev-ok, #4f9c6b);
}
.nev-problem-chip[data-chip-risk="high"] .nev-chip-dot { background: var(--nev-risk-high, #c0564f); }
.nev-problem-chip[data-chip-risk="attention"] .nev-chip-dot { background: var(--nev-warn, #c9944a); }
.nev-problem-chip .nev-chip-count { color: var(--nev-text-muted, #8a8f98); }
.nev-refresh-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    white-space: nowrap;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px dashed var(--nev-border, #262c33);
    color: var(--nev-text-muted, #8a8f98);
}
.nev-refresh-chip .nev-chip-undo {
    border: 0; background: transparent; cursor: pointer;
    color: var(--nev-accent, #5b9dd9); font-size: inherit; padding: 0;
}


/* ── Course tapestry polish (2026-08-18 late pass) ────────────────────
   In the takeover's left column the whole .nev-tap component rendered at
   its weave max-content width (700px measured) inside the 385px scrolling
   .nev-column-body — header, course warnings, and toolbar all rode the
   horizontal scroll and clipped mid-sentence at the column edge (owner
   screenshot 21:48 + harness shots). Clamp the component to the column and
   let ONLY the weave grid scroll sideways. Scoped under .nev-column-body so
   the census-side tapestry mount is untouched. */
/* The weave's 700px+ min-width is DELIBERATE (dates/knots must never crush
   — see the takeover calibration-strip comment at the middle-column rule).
   The defect was that the component ROOT carried it, dragging the header,
   course warnings, and toolbar into the horizontal scroll. Clamp the root
   to the column; the lane/spine/phase ROWS keep their own grid-track floors
   and scroll inside wv-main. Selector mirrors the v2 adaptive rule plus
   .nev-column-body so it wins regardless of stylesheet order. */
#noteEvolutionTakeover[data-nev-v2] .nev-column[data-column="middle"]
    .nev-column-body .nev-tap-wv,
#noteEvolutionTakeover[data-nev-v2] .nev-column[data-column="middle"]
    .nev-column-body .nev-tap-wv[data-wv-axis="adaptive"] {
    min-width: 0;
    max-width: 100%;
}
.nev-column-body .nev-tap .nev-tap-wv-main {
    overflow-x: auto;
    overscroll-behavior-x: contain;
}
.nev-column-body .nev-tap .nev-tap-wv-main > * {
    min-width: max-content;
}
/* Warnings now clamp to the visible column: let the message wrap fully
   instead of single-line clipping. */
.nev-column-body .nev-tap-course-warning .message {
    white-space: normal;
    overflow-wrap: anywhere;
}
/* Day header cells: never crush below a readable floor; the +N collapse
   chip keeps its gap instead of fusing into the neighbor cell. */
.nev-tap-wv-day {
    min-width: 34px;
}
