@font-face{font-family:"Akkurat LL";src:url(./Regular.otf);font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Akkurat LL";src:url(./Bold.otf);font-weight:700;font-style:normal;font-display:swap}
@font-face{font-family:"Akkurat LL";src:url(./Italic.otf);font-weight:400;font-style:italic;font-display:swap}
/* Adaptiv Design System — Tokens */

/* Akkurat LL — Adaptiv brand font */











:root {
  /* ⭐ The 6-stop Adaptiv brand LOGO gradient — the rotating "A" (FloatingMenu
     mark) is its only consumer. FIXED navy→pink identity: like the other marks
     it is NEVER re-themed, so do NOT override this ramp in any theme scope
     (JB 2026-07-19). See --brand-mark-* above for the 2-stop variant. */
  --brand-g-1: #000064;
  --brand-g-2: #60006d;
  --brand-g-3: #a71992;
  --brand-g-4: #d011a0;
  --brand-g-5: #ed09ab;
  --brand-g-6: #ff00b2;
  /* ⭐ FIXED brand identity — NEVER re-themed. The corporate marks (the Adaptiv
     wordmark and Merlin's animated ring) keep the navy→pink gradient in every
     colour profile. Deliberately NOT --accent-*, which both the mono-indigo
     scope and the accent picker rewrite. Do NOT override these in any theme
     scope: a mark that changes colour stops being the mark (JB 2026-07-19). */
  --brand-mark-pink: #ff00b2;
  --brand-mark-indigo: #20286d;
  /* accent options */
  --accent-pink: #ff00b2;
  --accent-indigo: #20286d;
  /* Theme-aware indigo INK — always indigo regardless of colour profile (the
     "no-pink" surfaces like the NOW priorities band use it for tint + text),
     but lightens on dark surfaces where the fixed navy --accent-indigo would
     be unreadable. Pairs with tintBg(var(--accent-indigo-ink)) for the fill. */
  --accent-indigo-ink: #20286d;
  /* Band FILL — decoupled from the ink so light mode reads as a real light
     indigo (a tint of the ramp's light end) rather than the greyish tint a
     navy base gives. Ink text stays navy for contrast. */
  --accent-indigo-band: color-mix(in oklch, #6d7ade 28%, transparent);
  --accent-blue: #2185d0;
  /* "SIMULATED" badges — a location that is a simulation, not a real building.
     Tokenised (was a bare #7c3aed at 4 call sites) so it follows the theme:
     a hard-coded hue is invisible to every colour profile and left a violet
     pill glowing on the otherwise colourless Adaptiv Mono canvas. */
  --sim: #7c3aed;
  /* Deployments pipeline: the 'installed' stage hue (was a bare #8b5cf6 in two
     files). The other stages already ride semantic tokens. */
  --stage-installed: #8b5cf6;

  /* Bubble-cloud attention palette. Deliberately its OWN tokens rather than
     --risk/--warn: those are AA-darkened at :root for white-on-fill in the light
     theme (#dc2626/#b45309), and pointing the cloud at them would visibly shift
     JB's signature UI in light mode — not what a theme addition should do. These
     hold the cloud's exact shipped values in every existing profile and are
     re-pointed only by Adaptiv Mono. Consumed by now-bubbles-model.js, which
     both surfaces share. */
  --bubble-risk: #ef4444;
  --bubble-watch: #f59e0b;
  --bubble-calm: #94a3b8;
  /* The three BUSINESS bubbles (Decisions / Proposals / Contracts) carry their
     own accents so an action reads differently from an SLA band. */
  --bubble-biz-decisions: #6d5efc;
  --bubble-biz-proposals: #0ea5e9;
  --bubble-biz-contracts: #14b8a6;

  /* DISPLAY status — the vivid trio the briefing cards paint on dark card
     headers, sparklines and pills. Distinct from --ok/--warn/--risk for the same
     reason as the bubble tokens: the semantic set is AA-darkened at :root for
     text/fills, while these were hard-coded to the DARK values unconditionally.
     Holding the shipped values here keeps every existing theme byte-identical
     and gives Adaptiv Mono one place to drain them. */
  --status-ok: #10b981;
  --status-warn: #f59e0b;
  --status-risk: #ef4444;
  --status-info: #3b82f6;

  /* Blue since the November 2026 baseline (design-system-baseline-2026-11.md).
     The runtime value is resolved in one place, src/app/accent.js. */
  --accent: var(--accent-blue);
  --accent-soft: color-mix(in oklch, var(--accent) 12%, transparent);
  --accent-line: color-mix(in oklch, var(--accent) 40%, transparent);
  /* INK ON A SOLID ACCENT/STATUS FILL — the label colour of a filled primary
     button, a status pill, a selected segment. White in every colour profile,
     because every accent and status fill in this system is a saturated mid-dark.
     It exists for the profiles where that stops being true: Adaptiv Mono paints
     its fills WHITE, and a hard-coded white label would vanish into them. Was
     literal `color: '#fff'` at ~120 call sites before the mono theme forced the
     split — if you add a new solid accent/status fill, label it with this. */
  --accent-ink: #ffffff;

  /* HAIRLINE WIDTH — the weight of a card/panel/input edge, paired with
     --border and --border-strong. A token because it is the only way to tune
     edge weight in a theme that cannot reach for a lower opacity: at 11% white
     a 1px rule is quiet, at 100% white the same 1px is a hard line. JB on
     Adaptiv Mono: "The card edges, menu edges are too thick, maybe one or 2
     pixels less is better." On a 2x display 0.5px is one device pixel — the
     thinnest a rule can be — so the theme halves this rather than dimming the
     colour. 1px everywhere else, so no other profile moves. */
  --hairline: 1px;

  /* light surfaces */
  --bg: #f4f6fa;
  /* Baseline 2026-11: a flat, pale workspace canvas. The ambient glows were a
     cool grey (#e9edf5) and a PINK cast (#f6e8f1) that fought the blue accent;
     both now sit on --bg. Dark/Black/Mono keep their own canvas rules. */
  --bg-grad-a: #f4f6fa;
  --bg-grad-b: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f4f9;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: #0b1020;
  --text-soft: #3a4161;
  /* text-dim/faint darkened to clear WCAG AA 4.5:1 on white (were 4.69 borderline
     / 2.58 fail) — hue-preserving; see docs/deliverables/accessibility-conformance.md */
  --text-dim: #666e8b;
  --text-faint: #6c748e;

  /* Mobile shell backgrounds — the app COLUMN and the surround behind it.
     Separate tokens rather than reading --surface/--surface-2 directly, because
     on mobile --surface also backs sheets and cards: pushing that token to black
     would flatten every sheet into the page instead of letting it sit above it.
     Light keeps the approved look exactly (column on --surface, faintly grey
     surround); only dark diverges. */
  --mobile-page-bg: var(--surface);
  --mobile-shell-bg: var(--surface-2);

  /* Mobile Liquid-Glass tab bar (MobileApp TabBar). Themed via tokens so dark can
     ELEVATE the glass instead of inheriting a near-black slab that vanishes into a
     near-black page. Light = the original approved look (surface-tinted, faint
     rim). See mobile-merlin memory + docs. */
  --glass-bar-bg: color-mix(in oklch, var(--surface) 55%, transparent);
  --glass-bar-border: color-mix(in oklch, var(--border) 45%, transparent);
  --glass-bar-shadow:
    0 10px 30px color-mix(in oklch, #000 14%, transparent), inset 0 1px 0 color-mix(in oklch, #fff 55%, transparent);
  --glass-bar-item-bg: color-mix(in oklch, var(--surface) 70%, transparent);
  /* Label + icon of the SELECTED dock item. Its own token because Adaptiv Mono
     inverts it: there the selected pill is a solid ink fill, so the label has to
     flip to --accent-ink or it is white-on-white. Every other theme keeps the
     accent colour it has always had. */
  --glass-bar-item-fg: var(--accent);
  /* SELECTED nav item (pillar rail rows + IconBtn) — the tinted chip and its
     label. Own tokens for the same reason as --glass-bar-item-fg: Adaptiv Mono
     has to signal selection with a FILL, since --accent-soft drains to black and
     the active/inactive labels both collapse to the same ink. Defaults are the
     values these sites already used, so no other theme moves. */
  --nav-active-bg: var(--accent-soft);
  --nav-active-fg: var(--accent);
  /* Baseline (2026-11) selection EDGE for the rail item, plus the lighter
     sub-navigation pair. Mixed against TRANSPARENT so alpha compositing gives
     the reference values over white at the blue default (#c4ddef edge;
     #e9f2fa / #c7deef sub-nav) and still reads on dark surfaces. Re-declared
     wherever --accent is body-scoped (mono-indigo) and drained by Mono. */
  --nav-active-edge: color-mix(in oklch, var(--accent) 27%, transparent);
  --subnav-active-bg: color-mix(in oklch, var(--accent) 10%, transparent);
  --subnav-active-border: color-mix(in oklch, var(--accent) 25%, transparent);
  --glass-bar-item-shadow:
    inset 0 1px 0 color-mix(in oklch, #fff 70%, transparent), 0 2px 8px color-mix(in oklch, #000 10%, transparent);

  /* semantic — darkened so a WHITE label on these as a fill clears AA 4.5:1 in the
     default (light) theme (amber was 2.15, green 2.54, blue 3.94, red 3.76). Hue
     preserved. body.dark re-declares the originals below so dark mode is unchanged
     (a darker status color as TEXT on a dark surface would otherwise regress). */
  --ok: #0a8159;
  --warn: #b45309;
  /* A brighter, more saturated orange used ONLY as a band/tint FILL (never as a
     white-on-fill surface), so it can skip the AA-darkening that makes --warn
     read brown. Card-header bars mix this at a stronger % for a colourful
     orange while the label text stays on the AA-safe --warn. */
  --warn-vivid: #f97316;
  --risk: #dc2626;
  --info: #1976c4;

  /* layout */
  --sidebar-w: 260px;
  --chat-w: 520px;
  --pad: 18px;
  --row-h: 32px;
  --radius: 12px;
  --radius-sm: 8px;

  /* ── November 2026 baseline roles ─────────────────────────────────────────
     docs/reference/design-system-baseline-2026-11.md. NAMED roles, so a page
     asks for "card title" or "metadata" instead of restating 12px/700. The
     existing --radius (12) and --radius-sm (8) keep their meaning; the new
     shapes get their own names so no unrelated component moves.
     Geometry is theme-independent: every theme inherits these unchanged. */
  --type-body: 13px; /* root text, line height --leading-body */
  --type-desc: 12px; /* descriptive interface text */
  --type-meta: 11px; /* compact controls and metadata; never paragraphs or inputs */
  --type-module: 11px;
  --weight-module: 500;
  --tracking-module: 0.06em;
  --type-card-title: 13px; /* weight 700 */
  --type-node-title: 12px; /* weight 700 */
  --type-section: 21px; /* weight 400 */
  --type-page: 25px; /* weight 400; 24px at phone width (below) */
  --type-metric: 25px; /* weight 400, tabular numerals */
  --type-eyebrow: 11px; /* uppercase, --tracking-eyebrow */
  --tracking-eyebrow: 1px;
  --leading-body: 1.5;

  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;

  --radius-surface: 14px; /* floating rail, workspace content surface */
  --radius-panel: 10px; /* secondary panel, metric card */
  --radius-node: 9px; /* topology node */
  --radius-control: 8px; /* rail item, compact button */
  --radius-control-sm: 6px; /* chips, segmented items */

  --workspace-gap: 12px; /* outer gap around the floating surfaces */
  --content-inset: 24px; /* page padding, top; smaller at narrow widths */
  --page-gap: 12px; /* every page: left, right, bottom, and between cards (JB, 2026-11-25) */
  --rail-w: 52px;
  --rail-pad: 7px;
  --rail-gap: 6px;
  --rail-item: 36px;
  --rail-glyph: 18px;
  --icon-stroke: 1.7; /* the Lucide 24-unit nav glyphs */

  --font: 'Akkurat LL', -apple-system, BlinkMacSystemFont, 'SF Pro', 'Helvetica Neue', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

body.dark {
  /* TRUE BLACK on the mobile surface. On the OLED panels the native shell runs
     on, #000 switches pixels off outright: deeper blacks, no backlight haze at
     the bezel, and less power. The near-black --surface below stays exactly as
     it was, so sheets and cards keep lifting off the page instead of merging
     into it — the contrast is what makes black work rather than muddy. */
  --mobile-page-bg: #000000;
  --mobile-shell-bg: #000000;
  --bg: #0a0d14;
  --bg-grad-a: #0c1120;
  --bg-grad-b: #170b1e;
  --surface: #11151f;
  --surface-2: #161b28;
  --surface-3: #1b2130;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eef1f8;
  /* Elevated glass: a slab a few steps LIGHTER than the near-black page so it
     floats, plus a bright specular rim and a deep ambient shadow — the cues that
     read as glass on dark (matching the Le Monde bar JB referenced). Content
     still shows through via the 30px backdrop blur. */
  --glass-bar-bg: color-mix(in oklch, #2b3242 62%, transparent);
  --glass-bar-border: rgba(255, 255, 255, 0.16);
  --glass-bar-shadow: 0 14px 34px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  --glass-bar-item-bg: color-mix(in oklch, #3d4759 74%, transparent);
  --glass-bar-item-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 10px rgba(0, 0, 0, 0.45);
  --text-soft: #c1c7d7;
  --text-dim: #8d94a8;
  --text-faint: #5c6277;
  /* Light indigo so the indigo-ink surfaces stay legible on dark bg. */
  --accent-indigo-ink: #97a3f2;
  /* On dark, a subtle tint of the light ink reads best (a brighter fill would
     glare against the dark bg) — keep the band understated here. */
  --accent-indigo-band: color-mix(in oklch, #97a3f2 16%, transparent);
  --accent-soft: color-mix(in oklch, var(--accent) 18%, transparent);
  /* Keep the ORIGINAL bright status colors on dark surfaces: they already have
     good contrast as fills + colored text against the dark bg, and the :root
     darkening (an AA fix for white-on-fill in the LIGHT theme) would drop
     colored-status TEXT on dark below 4.5:1. */
  --ok: #10b981;
  --warn: #f59e0b;
  --warn-vivid: #fb923c;
  --risk: #ef4444;
  --info: #2185d0;
}

/* ── Adaptiv Black (Settings → Appearance → Theme, desktop) ─────────────────
   Opt-in THIRD theme (Light / Dark / Adaptiv Black) — the standard dark is
   untouched. Layers on TOP of body.dark (the app adds both classes).

   v3 (JB: "can we try pure black, no glass effect?"): the mobile true-black
   recipe (#1712), on desktop. NO glows, NO translucency:
   - #000 canvas AND #000 opaque cards; the gradient tokens are pinned to
     #000 so the base body rule paints nothing.
   - Separation is hairlines alone (borders 0.07 → 0.11/0.19), exactly the
     iOS true-black trade.
   - Inner fills (--surface-2/3) stay as white-alpha lifts: they back chips,
     inputs and bubbles INSIDE cards, which need a step off pure black to
     stay visible. That is layering, not glass.
   Opaque #000 surface also makes dropdowns/popovers/the floating chat
   trivially readable — the v2 translucency concern disappears.

   (History, so nobody re-lands the traps: v1 read NAVY because its glows
   peaked brighter than standard dark's AND the bold-variant !important
   background painted over the token canvas entirely; v2 fixed both with
   whisper glows + 72%-opacity glass cards; v3 removes glow and glass on
   JB's call. Verify any change here by ARITHMETIC on computed styles —
   headless screenshots hide canvas luminance.) */
body.dark.adaptiv-black {
  --bg: #000000;
  --bg-grad-a: #000000;
  --bg-grad-b: #000000;
  --surface: #000000;
  /* NESTED panels are black too. --surface-2 backs expanded card bodies and
     inner sections; at a 6% white lift those read as grey slabs inside a black
     card, which is exactly what JB rejected ("I don't like the non black
     background of the expanded card"). Their borders already separate them.
     --surface-3 KEEPS a lift: it backs segmented-control TRACKS and similar
     grooves, where the recess is the affordance and a border alone would not
     read. Trade-off accepted: row hovers that tint with --surface-2 lose their
     feedback on this theme. */
  --surface-2: #000000;
  --surface-3: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.19);
}

/* ── Adaptiv Mono (Settings → Appearance → Theme, desktop) ──────────────────
   JB, 2026-07-27, after seeing the first cut: "I want only black and white. No
   variation, no grey, no other color. Just black and white, except the
   wordmark."

   So this is a STRICTLY TWO-VALUE system. Every colour below is #000000 or
   #ffffff — there is no ramp, no tint, no translucency. A hairline at
   rgba(255,255,255,.11) paints a GREY pixel, and a 16% white "soft" fill is a
   grey slab; both are exactly what was rejected, so both go to a pure value.
   The first cut ranked severity by luminance (risk white → ok mid grey); that
   ranking is GONE by request. Urgency now reads only through what the cloud
   already encodes structurally: bubble SIZE, ring fill proportion and dashes.

   It layers on Adaptiv Black (the app adds .dark .adaptiv-black .adaptiv-mono
   together), so the black canvas and the bold-variant override are inherited.

   THE ONE RULE that decides #fff vs #000 for any token you add here:

     Does it paint INK (text, stroke, border, glyph) or a FIELD (a background
     behind text)?  INK → #ffffff.  FIELD → #000000.

   Get it backwards and you ship invisible text: --accent-soft backs 206 of its
   227 call sites, so at #fff every selected row would be a white slab under
   white text. It goes BLACK — in a two-value system a "soft tint" cannot exist,
   and selection falls to the border, which is now full white and loud enough.
   The inverse holds for a SOLID accent fill: that is a white slab on purpose,
   and its label must be --accent-ink (#000 here) or it vanishes.

   The corporate marks are the single exception JB carved out ("except the
   wordmark"): --brand-mark-* and --brand-g-* keep their identity, same rule as
   every other profile.

   ⚠️ Verify by ARITHMETIC on computed styles — a headless screenshot hides
   canvas luminance (the trap that shipped Adaptiv Black v1 navy).
   tests/theme-adaptiv-mono.test.js asserts EVERY token here is pure #000/#fff,
   so a grey cannot creep back in. */
body.dark.adaptiv-black.adaptiv-mono {
  /* THE INK — the single non-black value of this duotone theme. JB: "white
     color should be able to be changed with an HEX reference. Only black
     stays." Settings -> Appearance exposes a hex field while this theme is
     active; App.jsx writes the choice to --mono-ink-user on <html>, and every
     white below follows through this token. Black is NOT configurable: it is
     the canvas, and --accent-ink (the label on an ink-filled control) stays
     black for the same reason. */
  --mono-ink: var(--mono-ink-user, #ffffff);

  /* ── INK ─────────────────────────────────────────────────────────────── */
  --accent: var(--mono-ink);
  --accent-pink: var(--mono-ink);
  --accent-indigo: var(--mono-ink);
  --accent-blue: var(--mono-ink);
  --accent-indigo-ink: var(--mono-ink);
  /* ⚠️ the derived mixes MUST be re-declared: :root computes them from :root's
     --accent (pink) and descendants inherit the RESOLVED pink — overriding
     --accent alone leaves every selection tint pink. (Learned in mono-indigo.)
     --accent-line is a BORDER at 197 of 200 call sites, so it is ink. */
  --accent-line: var(--mono-ink);

  /* The type ramp flattens. --text-dim/-faint were blue-greys carrying the
     hierarchy; captions and placeholders now read at full strength, which is
     the accepted cost of "no grey". */
  --text: var(--mono-ink);
  --text-soft: var(--mono-ink);
  --text-dim: var(--mono-ink);
  --text-faint: var(--mono-ink);

  /* Hairlines become hard rules — the loudest consequence of the strict
     reading, since a full-white edge cannot be quietened with opacity. Weight
     was tried as the lever instead: 0.5px (a single device pixel at 2x) shipped
     in #1731, but a one-device-pixel ARC leaves the rasteriser no room to
     anti-alias, and at white-on-black contrast every rounded corner read
     pixelated (JB, 2026-07-28: "rounded corners seems like pixeled, all over
     the app"). Back to the :root 1px — two device pixels give the arc a proper
     AA ramp; no declaration here means Mono inherits it. */
  --border: var(--mono-ink);
  --border-strong: var(--mono-ink);
  --glass-bar-border: var(--mono-ink);

  /* Status and the bubble cloud: one value, no ranking. */
  --risk: var(--mono-ink);
  --warn: var(--mono-ink);
  --warn-vivid: var(--mono-ink);
  --info: var(--mono-ink);
  --ok: var(--mono-ink);
  --sim: var(--mono-ink);
  --status-risk: var(--mono-ink);
  --status-warn: var(--mono-ink);
  --status-info: var(--mono-ink);
  --status-ok: var(--mono-ink);
  --bubble-risk: var(--mono-ink);
  --bubble-watch: var(--mono-ink);
  --bubble-calm: var(--mono-ink);
  --bubble-biz-decisions: var(--mono-ink);
  --bubble-biz-proposals: var(--mono-ink);
  --bubble-biz-contracts: var(--mono-ink);

  /* ── FIELD ───────────────────────────────────────────────────────────── */
  /* Ink on a solid accent/status fill — that fill is a white slab, so its label
     inverts. Any NEW solid accent/status fill must label with this. */
  --accent-ink: #000000;

  /* Tints and grooves collapse to nothing. --surface-3 backed segmented-control
     tracks; the active white pill is now the only mark, which is enough. */
  --accent-soft: #000000;
  --accent-indigo-band: #000000;
  --surface-3: #000000;
  --glass-bar-bg: #000000;

  /* ⭐ EXCEPTION to the drain-the-tint rule above: the mobile dock's SELECTED
     item. Draining it removed the last cue that anything was selected — the
     glass pill went black-on-black, its specular shadow went none, and the
     label's --accent and the siblings' --text-dim both collapse to the same ink
     (JB, 2026-07-28: "there is no way to distinguish what is selected in the
     floating menu"). A two-value theme has to signal state with FILL, not hue,
     so the selected pill becomes a solid ink slab and its label inverts to
     --accent-ink. Same rule as every other solid fill in this theme. */
  --glass-bar-item-bg: var(--mono-ink);
  --glass-bar-item-fg: var(--accent-ink);
  /* Same fix for the DESKTOP pillar rail: the selected pillar was equally
     invisible (chip drained to black; active --accent and inactive --text-soft
     both collapse to the ink). Solid ink chip, inverted label. */
  --nav-active-bg: var(--mono-ink);
  --nav-active-fg: var(--accent-ink);
  --nav-active-edge: var(--mono-ink);
  --subnav-active-bg: #000000; /* a FIELD: the label stays ink, so the fill is black */
  --subnav-active-border: var(--mono-ink);

  /* mono-indigo sets --bg-grad-b to a navy; pinned here so no ambient tint can
     reach the canvas through a token path. */
  --bg-grad-a: #000000;
  --bg-grad-b: #000000;

  /* Both carry inset white highlights — grey lines by another name. */
  --glass-bar-shadow: none;
  --glass-bar-item-shadow: none;

  /* ── KILL SWITCHES for colour manufactured BELOW the token layer ─────── */
  /* Components that build a colour by MIXING cannot be drained by overriding
     their inputs: 16% of pure white over pure black is still #292929. These two
     tokens are read as var() overrides at the point of mixing, so the theme
     wins without every call site learning about it.

     --bubble-fill   → the cloud's band and disc fills (now-bubbles-face), which
                       are mixes by construction. Flat black leaves the white
                       ring edges as the only mark.
     --identity-ink  → the IDENTITY palettes: 12 per-agent hues (agent-colors)
                       and 4 per-service-line hues (servicing-areas). Both also
                       feed three.js / Leaflet / canvas, so they resolve in JS.
     --identity-soft → the same palettes' mixed tint (domainSoft), which draining
                       the input cannot fix — 14% of white over black is grey. */
  --bubble-fill: #000000;
  --identity-ink: var(--mono-ink);
  --identity-soft: #000000;
  /* The SIMULATED pill's tinted field and its 30% border — both mixes, so both
     need the switch rather than a drained input. Kept as their own pair (not
     --identity-*) because --sim is a status badge, not an identity palette. */
  --sim-soft: #000000;
  --sim-line: var(--mono-ink);
  /* Parking Hypervisor space states. Every other theme falls through to the
     --status-* set at the call site. Here all four are the ink: the plan tells
     them apart by SHAPE, not hue (occupied = solid fill, free = outline only,
     because its tinted fill rides --tint-bg, no signal = dashed outline, low
     battery = a heavier outline), so nothing is lost by draining them. */
  --parking-free: var(--mono-ink);
  --parking-occupied: var(--mono-ink);
  --parking-nosignal: var(--mono-ink);
  --parking-lowbatt: var(--mono-ink);
  /* --tint-bg / --tint-line → the app-wide translucent-tint idiom
     (`color-mix(X n%, transparent|surface)`) for FILLS and BORDERS
     respectively. Any mix output is a grey/tint by construction, so call
     sites wrap: `var(--tint-bg, color-mix(...))`. Undefined outside this
     block -> every other theme keeps its mix.
     --identity-fill → solid identity-tinted fills (crew avatars, installer
     chips): the disc goes ink, its label goes --accent-ink.
     --meter-track(-w) → Ring gauge tracks: with track and arc both ink, a 60%
     and a 95% ring were IDENTICAL ("percentage indicators are misleading");
     the track thins to a hairline so the arc reads against it. */
  --tint-bg: #000000;
  --tint-line: var(--mono-ink);
  --identity-fill: var(--mono-ink);
  --meter-track: var(--mono-ink);
  --meter-track-w: var(--hairline);
  --stage-installed: var(--mono-ink);
  /* ANTICIPATE sweep (2026-07-27): hues those pages carried outside the token
     layer. --chart-bar-fill flattens the Forecast occupancy bars' vertical
     accent→tint gradient (a white→black ramp here = a grey ramp); the dashed
     capacity line already says which bars run hot, so a solid ink bar loses
     nothing. --track-slas is the SLA-track blue (#2185D0: tab accent, shield
     glyph, sparkline stroke/dots). --tone-info is Compliance's indigo 'info'
     tone (#6366f1: NOT HELD label, progress rings). */
  --chart-bar-fill: var(--mono-ink);
  --track-slas: var(--mono-ink);
  --tone-info: var(--mono-ink);
  /* DOCUMENT sweep: the per-document-kind hues (AdminSetup DOC_KIND_STYLE —
     eyebrow text + hover border; their tintBg() fill already dies via
     --tint-bg). One switch, six hues. */
  --doc-ink: var(--mono-ink);
  /* Translucent emphasis (opacity ramps on pipeline segments) is a grey by
     construction — clamp to opaque here; sites read opacity via this var. */
  --tint-op: 1;

  /* The weather widget (metrics-weather-widget.jsx) — an ILLUSTRATION, redrawn
     as a duotone pictogram set rather than merely drained (JB: "do the weather
     widget in black and white too"):
     --wx-ink          one switch over every scene colour (sun, clouds, rain,
                       temperature bars, UV/AQI dots, hero text) — each site
                       keeps its own hue as the var() fallback, so other themes
                       are pixel-identical. Solid-ink pictograms, no seams.
     --wx-hero         the sky gradient's field → flat black.
     --wx-overlay-op   kills the animated layer (drifting clouds, rain streaks,
                       star glows) — every particle there is translucent by
                       construction, i.e. a grey.
     --wx-emoji-display hides the 💧 emoji (OS-coloured, can't be recoloured);
                       the % figure it decorated carries the information.
     --wx-bar-glow     the temperature bar's colour glow → none. */
  --wx-ink: var(--mono-ink);
  --wx-hero: #000000;
  --wx-overlay-op: 0;
  --wx-emoji-display: none;
  --wx-bar-glow: none;

  /* The Merlin mark (rings and dot): the spinning brand gradient becomes STATIC
     solid ink (JB: "I don't want the Merlin disc animation anywhere when black
     and white mode."). The one sanctioned exception to marks-never-retheme, at
     JB's explicit request. */
  --merlin-mark: var(--mono-ink);
  --merlin-mark-spin: none;
}

/* Leaflet ships its own chrome colours (grey canvas behind tiles, grey borders
   on the zoom control) that no token reaches — pin them to the two values.
   The TILES stay photographic (the acknowledged map exception); this only
   drains the library's UI chrome around them. */
body.dark.adaptiv-black.adaptiv-mono .leaflet-container {
  background: #000000;
}
body.dark.adaptiv-black.adaptiv-mono .leaflet-bar,
body.dark.adaptiv-black.adaptiv-mono .leaflet-bar a {
  border-color: var(--mono-ink);
}

/* ── TRUE BLACK cards on the mobile surface (JB, 2026-07-26) ────────────────
   #1706 took the mobile PAGE to #000 but kept cards on the near-black
   --surface so they lifted off the page by contrast. JB has seen it and wants
   the full OLED look: cards black too. With page and card both #000 the
   separation duty moves entirely to HAIRLINE BORDERS — the same trade iOS's
   own true-black apps make — so --border steps up alongside.

   Scoped to body.mobile-app (added by MobileApp on mount, removed on unmount)
   so desktop dark keeps its approved near-black cards untouched. Body-level on
   purpose: Sheet PORTALS to document.body, and a column-scoped override would
   miss every sheet.

   --surface-2 keeps a slight lift: it backs the fills INSIDE cards — chips,
   chat bubbles, input fields — and if it went #000 too, those would melt into
   the very cards they sit on. The cards read black; their contents stay
   legible. */
body.dark.mobile-app {
  --surface: #000000;
  --surface-2: #0e1219;
  --surface-3: #151a26;
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.2);
}

/* ── Monochrome indigo (Settings → Appearance → Style) ──────────────────────
   One professional single-hue ramp built around the brand indigo (#20286D).
   Strategy: override the BRAND variables inside this scope, so every accent,
   hover, chart stroke and pink→indigo gradient in the app collapses onto the
   indigo ramp with zero component changes (the gradients read
   var(--accent-pink) → var(--accent-indigo), which becomes light-indigo →
   deep-indigo here). Semantic status colors (--ok/--warn/--risk) are
   deliberately UNTOUCHED — SLA breaches, battery risk and incident severity
   must keep their meaning in an operations product.
   Body-scoped custom properties beat the inline --accent the accent picker
   writes on <html> (nearest-ancestor wins), but App.jsx also clears that
   inline value while mono is active to keep DevTools honest. */
body.mono-indigo {
  --accent: #3542a8;
  --nav-active-edge: color-mix(in oklch, var(--accent) 27%, transparent);
  --subnav-active-bg: color-mix(in oklch, var(--accent) 10%, transparent);
  --subnav-active-border: color-mix(in oklch, var(--accent) 25%, transparent);
  /* ⚠️ the derived mixes MUST be re-declared here: :root computes them from
     :root's --accent (pink) and descendants inherit the RESOLVED pink value —
     overriding --accent alone leaves every accent-soft selection pink. */
  --accent-soft: color-mix(in oklch, var(--accent) 12%, transparent);
  --accent-line: color-mix(in oklch, var(--accent) 40%, transparent);
  --accent-pink: #6d7ade; /* gradient start → the ramp's light end */
  --accent-blue: #4d5ac2; /* mid tone for charts that used brand blue */
  --info: #4d5ac2;
  --bg-grad-b: #e9ebf6; /* the ambient tint loses its pink cast */
  /* ⚠️ --brand-g-* is deliberately NOT overridden here. The ramp's only
     consumer is the rotating Adaptiv "A", and marks keep their brand
     identity in every profile (JB 2026-07-19) — same rule as the wordmark
     and Merlin's ring. */
}

body.dark.mono-indigo {
  --accent: #97a3f2; /* lighter for contrast on dark surfaces */
  --nav-active-edge: color-mix(in oklch, var(--accent) 27%, transparent);
  --subnav-active-bg: color-mix(in oklch, var(--accent) 10%, transparent);
  --subnav-active-border: color-mix(in oklch, var(--accent) 25%, transparent);
  --accent-soft: color-mix(in oklch, var(--accent) 18%, transparent);
  --accent-line: color-mix(in oklch, var(--accent) 40%, transparent);
  --accent-pink: #6d7ade;
  --accent-blue: #7f8ce8;
  --info: #7f8ce8;
  --bg-grad-b: #101430;
}

/* Interface Magenta is an opt-in UI color. Brand marks and the default blue
   remain unchanged. The lighter ink on dark surfaces has a dark solid-fill
   label so both text links and filled controls remain legible. */
body.interface-magenta {
  --accent-soft: #fff0fa;
  --accent-line: #ffc2ed;
  --nav-active-bg: var(--accent-soft);
  --nav-active-fg: var(--accent);
  --nav-active-edge: #ffc2ed;
  --subnav-active-bg: #fff0fa;
  --subnav-active-border: #ffc2ed;
}
body.dark.interface-magenta,
body.bold-variant.interface-magenta {
  --accent: #ee8dcf;
  --accent-ink: #101010;
  --accent-soft: #341b2d;
  --accent-line: #72435f;
  --nav-active-bg: var(--accent-soft);
  --nav-active-fg: var(--accent);
  --nav-active-edge: #72435f;
  --subnav-active-bg: #341b2d;
  --subnav-active-border: #72435f;
  --glass-bar-item-fg: var(--accent);
}

/* Soft Mono is separate from the strict two-value Adaptiv Mono. It uses
   opaque charcoal surfaces and quiet 1px boundaries. Semantic status colors
   retain the dark theme's meanings; corporate marks retain their branding. */
body.dark.soft-mono {
  --mono-ink: var(--mono-ink-user, #f1f1f1);
  --bg: #090909;
  --bg-grad-a: #090909;
  --bg-grad-b: #090909;
  --surface: #101010;
  --surface-2: #141414;
  --surface-3: #202020;
  --border: #252525;
  --border-strong: #303030;
  --text: var(--mono-ink);
  --text-soft: #c4c4c4;
  --text-dim: #a3a3a3;
  --text-faint: #a3a3a3;
  --accent: var(--mono-ink);
  --accent-ink: #090909;
  --accent-soft: #222222;
  --accent-line: #666666;
  --nav-active-bg: #222222;
  --nav-active-fg: var(--mono-ink);
  --nav-active-edge: #666666;
  --subnav-active-bg: #222222;
  --subnav-active-border: #666666;
  --glass-bar-bg: #141414;
  --glass-bar-border: #303030;
  --glass-bar-shadow: none;
  --glass-bar-item-bg: #222222;
  --glass-bar-item-fg: var(--mono-ink);
  --glass-bar-item-shadow: none;
  --mobile-page-bg: #090909;
  --mobile-shell-bg: #101010;
}

body.compact {
  --pad: 14px;
  --row-h: 28px;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #1a1f2e;
  color: var(--text);
  font-family: var(--font);
}
body {
  background:
    radial-gradient(1200px 800px at 20% 0%, var(--bg-grad-a), transparent 60%),
    radial-gradient(1000px 700px at 90% 100%, var(--bg-grad-b), transparent 50%), var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  /* Baseline 2026-11 root text: 13px / 1.5. Sized on body, NOT html, so rem
     units (and the user's browser zoom / font-size setting) keep their basis. */
  font-size: var(--type-body);
  line-height: var(--leading-body);
}
body.dark {
  background:
    radial-gradient(1200px 800px at 20% 0%, #1a1e3b 0%, transparent 50%),
    radial-gradient(900px 700px at 100% 100%, #2b0d3a 0%, transparent 50%), #05070d;
}
/* sobre: the dark ambience loses its purple-pink cast under monochrome */
body.dark.mono-indigo {
  background:
    radial-gradient(1200px 800px at 20% 0%, #151a3d 0%, transparent 50%),
    radial-gradient(900px 700px at 100% 100%, #0f1330 0%, transparent 50%), #05070d;
}

/* ── The black themes own the canvas outright ───────────────────────────────
   The two rules ABOVE declare a LITERAL background shorthand with baked-in
   navy stops, and no amount of --bg-grad-* overriding can beat a literal
   declaration — so .adaptiv-black's token block silently lost the canvas to
   body.dark, and (at equal specificity, later in the file) to
   body.dark.mono-indigo. The theme still LOOKED black only because
   body.bold-variant.adaptiv-black forces #000 with !important, and JB runs
   bold; with bold off, "pure black" rendered NAVY — the exact v1 bug wearing a
   different hat.

   This rule must stay AFTER every Style profile: it ties with
   body.dark.mono-indigo on specificity and wins on source order. Same reason
   the bold-variant override exists. */
body.dark.adaptiv-black {
  background: #000000;
}

/* Co-brand org logo (TopBar, next to the floating menu). Tenant logos
   tend to be single-color dark wordmarks (e.g. Samsic navy) that read
   well on the light shell but vanish on the dark one. Knock them out to
   white in dark mode. A future per-org "dark logo variant" could opt out
   of this for multi-color marks. */
body.dark .org-cobrand-logo {
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

/* height: 100dvh tracks the DYNAMIC viewport — i.e. the visible area as the
   iPad / mobile browser toolbars show and hide. Plain 100vh is the *largest*
   viewport (toolbars hidden), so a fixed-height shell sized to 100vh hangs its
   bottom off-screen while the toolbars are up. The 100vh line is the fallback. */
#root {
  height: 100vh;
  height: 100dvh;
  width: 100vw;
}
.screen-h {
  height: 100vh;
  height: 100dvh;
}

/* scrollbar — slim light-pink (brand accent at low alpha). Thumb sits
   flush against the card's inner edge: the old `border: 2px solid
   transparent` padding-clip trick made it look floating ~2px in from
   the edge, which JB called out as "not at the edge of the box".
   2026-05-22.

   Updated 2026-05-25 (PR #660): thumb is transparent by default and
   appears only when the user is ACTIVELY scrolling. Driven by a body
   `.is-scrolling` class toggled by App.jsx's scroll detector — much
   closer to native macOS overlay behavior than the prior hover-based
   approach, which lit up the scrollbar whenever the cursor crossed
   the page (e.g., while interacting with the 3D viewer). */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
  transition: background 0.25s ease;
}
/* While the user is scrolling, fade thumbs in. Body class is added on
   any scroll event and removed ~800ms after the last one (App.jsx). */
body.is-scrolling ::-webkit-scrollbar-thumb {
  background: color-mix(in oklch, var(--accent) 30%, transparent);
}
/* Direct thumb hover (once visible) bumps the colour up — gives users
   a target for click-drag scrolling. */
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in oklch, var(--accent) 55%, transparent);
}
::-webkit-scrollbar-corner {
  background: transparent;
}
/* Firefox — `auto` lets the browser use its native overlay-style
   scrollbar (which already auto-hides in recent Firefox). Colour
   only applies if Firefox renders a persistent gutter. */
* {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
body.is-scrolling * {
  scrollbar-color: color-mix(in oklch, var(--accent) 30%, transparent) transparent;
}

/* Fully hide the native scrollbar (still scrolls via wheel/trackpad/keys). The
   global custom `::-webkit-scrollbar { width: 6px }` above renders a CUSTOM
   scrollbar that TAKES 6px of layout space — enough to break a pixel-exact 12px
   gutter and to make it "jump" when content overflows after async load. Main
   content scrollers opt in here so their left/right margins stay a true, stable
   12px (owned by inner padding) regardless of OS scrollbar setting. */
.no-native-scrollbar {
  scrollbar-width: none; /* Firefox */
}
.no-native-scrollbar::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none; /* Chrome/Safari — 0 layout space */
}

/* MONITOR → Locations, LIST layout. The row packs name + stats + occupancy +
   actions on one line; below ~900px (narrow window, or the docked Merlin chat
   open on a laptop) the trailing columns are what give, so the name/address
   column never collapses to an ellipsis. Cards remain the full-detail layout. */
@media (max-width: 900px) {
  .locations-row-stats {
    display: none !important;
  }
}
@media (max-width: 720px) {
  .locations-row-occ {
    display: none !important;
  }
}

button {
  font-family: inherit;
}
* {
  box-sizing: border-box;
}

/* Baseline 2026-11 responsive roles: the page heading drops to the mobile
   reference size and the workspace inset tightens on narrow screens. */
@media (max-width: 900px) {
  :root {
    --content-inset: 16px;
  }
}
@media (max-width: 600px) {
  :root {
    --type-page: 24px;
    --content-inset: 12px;
  }
}

/* ── Baseline 2026-11 text roles ─────────────────────────────────────────
   Class form of the --type-* roles for markup that is not a primitive.
   Primitives (primitives.jsx Text/PageTitle/...) read the same tokens. */
.t-body {
  font-size: var(--type-body);
  line-height: var(--leading-body);
}
.t-desc {
  font-size: var(--type-desc);
  color: var(--text-soft);
}
.t-meta {
  font-size: var(--type-meta);
  color: var(--text-dim);
}
.t-card-title {
  font-size: var(--type-card-title);
  font-weight: 700;
  color: var(--text);
}
.t-section {
  font-size: var(--type-section);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.t-page {
  font-size: var(--type-page);
  font-weight: 400;
  letter-spacing: -0.015em;
}
.t-metric {
  font-size: var(--type-metric);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.t-eyebrow {
  font-size: var(--type-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-dim);
}

/* animation keyframes */
/* merlinPulse (blinking status-dot ring) removed 2026-07-16 — pulsing status
   dots were disabled app-wide; loading indicators (merlinDot typing dots,
   adaptiv-pulse loader, spinners) are intentionally kept. */
@keyframes merlinShimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: 200px 0;
  }
}
@keyframes merlinFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes merlinSlideIn {
  from {
    transform: translateX(16px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.merlin-thinking span {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-dim);
  margin: 0 1.5px;
  animation: merlinDot 1.2s infinite ease-in-out;
}
.merlin-thinking span:nth-child(2) {
  animation-delay: 0.15s;
}
.merlin-thinking span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes merlinDot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Weather widget — animated overlay layers */
@keyframes merlinDrift {
  from {
    transform: translateX(-30%);
  }
  to {
    transform: translateX(140%);
  }
}
@keyframes merlinRainFall {
  from {
    transform: translate3d(0, -10%, 0) rotate(15deg);
    opacity: 0;
  }
  10% {
    opacity: 0.9;
  }
  to {
    transform: translate3d(20%, 140%, 0) rotate(15deg);
    opacity: 0;
  }
}
@keyframes merlinSnowFall {
  from {
    transform: translate3d(0, -10%, 0);
    opacity: 0;
  }
  10% {
    opacity: 0.85;
  }
  to {
    transform: translate3d(8%, 140%, 0);
    opacity: 0;
  }
}
@keyframes merlinTwinkle {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}
@keyframes merlinLightning {
  0%,
  96%,
  100% {
    opacity: 0;
  }
  97% {
    opacity: 0.85;
  }
  98% {
    opacity: 0.1;
  }
  99% {
    opacity: 0.7;
  }
}

/* Widget cell hover-chrome — settings cog + close icons fade in only
   while the user is hovering or interacting with the cell, so they
   never permanently overlap widget content. Stays visible when the
   cell is flipped (settings face is up) since that's an active
   interaction state the user is clearly engaged with. */
.widget-cell .widget-chrome {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.widget-cell:hover .widget-chrome,
.widget-cell:focus-within .widget-chrome,
.widget-cell.is-flipped .widget-chrome {
  opacity: 1;
  pointer-events: auto;
}

/* bold variant overlay */
body.bold-variant {
  background:
    radial-gradient(900px 600px at 15% -10%, color-mix(in oklch, var(--accent) 28%, transparent), transparent 50%),
    radial-gradient(1100px 900px at 110% 110%, #20286d 0%, transparent 55%), #05050e !important;
}
/* Adaptiv Black must stay BLACK under the bold variant too. Bold's own
   background above (28% accent glow + full-strength navy floor, !important)
   outranks the token-level canvas — without this override the theme never
   paints (the v1 "not dark at all" bug). v3 is PURE black: no gradients at
   all (JB: "pure black, no glass effect"). */
body.bold-variant.adaptiv-black {
  background: #000000 !important;
}
body.dark.soft-mono {
  background: var(--bg) !important;
}
body.bold-variant:not(.dark) {
  color: #eef1f8;
  --text: #eef1f8;
  --text-soft: #c9cfde;
  --text-dim: #878ea3;
  --text-faint: #5c6277;
  --surface: rgba(22, 22, 34, 0.72);
  --surface-2: rgba(30, 30, 44, 0.72);
  --surface-3: rgba(42, 42, 60, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  /* dark-surface variant → keep bright status colors (see body.dark note) */
  --ok: #10b981;
  --warn: #f59e0b;
  --warn-vivid: #fb923c;
  --risk: #ef4444;
  --info: #2185d0;
}
body.bold-variant .mac-window {
  background: transparent !important;
}
body.bold-variant h1 {
  font-weight: 900 !important;
  letter-spacing: -0.02em !important;
}

.sidebar-row:hover .pin-toggle {
  opacity: 1;
}
.sidebar-row .pin-toggle:hover {
  color: var(--accent) !important;
}

/* IconBtn default hover — owned by CSS so it can never get "stuck" the way an
   imperative element.style mutation did when a click/re-render swallowed the
   mouseleave (left the bottom-rail settings icon looking permanently selected).
   active/chromeless IconBtns set their background inline and don't get this class. */
.mrln-iconbtn {
  background: transparent;
  transition: background 0.12s;
}
.mrln-iconbtn:hover {
  background: var(--surface-3);
}

/* ── Baseline 2026-11 component states (primitives.jsx) ───────────────────
   Hover, keyboard focus and disabled belong to the component, not the page.
   Focus is a 2px accent ring OUTSIDE the control, so it never shifts layout
   and reads on every surface (Mono: the ink). Rendered in gallery.html. */
.mrln-iconbtn:focus-visible,
.mrln-btn:focus-visible,
.mrln-subnav:focus-visible,
.mrln-seg-item:focus-visible,
.mrln-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.mrln-panel {
  background: var(--surface);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-panel);
}
.mrln-panel--interactive {
  font: inherit;
  color: inherit;
  text-align: inherit;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.12s;
}
.mrln-panel--interactive:hover {
  border-color: var(--border-strong);
}
.mrln-panel--interactive:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.mrln-count {
  font-size: var(--type-meta);
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  background: var(--surface-3);
  border-radius: var(--radius-control-sm);
  padding: 1px 6px;
}
.mrln-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  font-family: inherit;
  font-size: var(--type-desc);
  font-weight: 700;
  line-height: 1.2;
  border-radius: var(--radius-control);
  border: var(--hairline) solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.12s,
    border-color 0.12s;
}
.mrln-btn--md {
  padding: 7px 12px;
  min-height: 30px;
}
.mrln-btn--sm {
  padding: 4px 9px;
  min-height: 24px;
  font-size: var(--type-meta);
  border-radius: var(--radius-control-sm);
}
.mrln-btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.mrln-btn--primary:hover:not(:disabled) {
  background: color-mix(in oklch, var(--accent) 88%, var(--text));
}
.mrln-btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.mrln-btn--secondary:hover:not(:disabled),
.mrln-btn--ghost:hover:not(:disabled) {
  background: var(--surface-3);
}
.mrln-btn--ghost {
  background: transparent;
  color: var(--text-soft);
}
.mrln-btn--danger {
  background: transparent;
  color: var(--risk);
  border-color: var(--tint-line, color-mix(in oklch, var(--risk) 30%, transparent));
}
.mrln-btn--danger:hover:not(:disabled) {
  background: var(--tint-bg, color-mix(in oklch, var(--risk) 8%, transparent));
}
.mrln-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.mrln-btn[aria-busy='true'] {
  cursor: progress;
}
.mrln-field-label {
  font-size: var(--type-meta);
  font-weight: 700;
  color: var(--text-soft);
}
/* Inputs stay at the 13px body size: the 11px metadata role is never an input
   size (readability, and iOS zooms anything under 16px on focus anyway). */
.mrln-input {
  font-family: inherit;
  font-size: var(--type-body);
  color: var(--text);
  background: var(--surface);
  border: var(--hairline) solid var(--border-strong);
  border-radius: var(--radius-control);
  padding: 7px 10px;
  min-height: 32px;
  min-width: 0;
}
.mrln-input::placeholder {
  color: var(--text-faint);
}
.mrln-input[aria-invalid='true'] {
  border-color: var(--risk);
}
.mrln-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.mrln-select {
  padding-right: 28px;
}
.mrln-seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--surface-3);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-control);
}
.mrln-seg-item {
  font-family: inherit;
  font-size: var(--type-desc);
  font-weight: 700;
  color: var(--text-dim);
  background: transparent;
  border: var(--hairline) solid transparent;
  border-radius: var(--radius-control-sm);
  padding: 4px 10px;
  cursor: pointer;
}
.mrln-seg-item.is-on {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.mrln-seg-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.mrln-subnav {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: var(--type-desc);
  font-weight: 700;
  color: var(--text-soft);
  background: transparent;
  border: var(--hairline) solid transparent;
  border-radius: var(--radius-control);
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.12s;
}
.mrln-subnav:hover:not(.is-active) {
  background: var(--surface-3);
}
.mrln-subnav.is-active {
  background: var(--subnav-active-bg);
  border-color: var(--subnav-active-border);
  color: var(--accent);
}
.mrln-status {
  display: inline-flex;
  align-items: center;
  font-size: var(--type-meta);
  font-weight: 700;
  line-height: 1.3;
  padding: 2px 7px;
  border-radius: var(--radius-control-sm);
  white-space: nowrap;
  border: var(--hairline) solid transparent;
}
.mrln-status--ok {
  color: var(--ok);
  background: var(--tint-bg, color-mix(in oklch, var(--ok) 10%, transparent));
}
.mrln-status--warn {
  color: var(--warn);
  background: var(--tint-bg, color-mix(in oklch, var(--warn) 10%, transparent));
}
.mrln-status--risk {
  color: var(--risk);
  background: var(--tint-bg, color-mix(in oklch, var(--risk) 10%, transparent));
}
.mrln-status--info {
  color: var(--info);
  background: var(--tint-bg, color-mix(in oklch, var(--info) 10%, transparent));
}
.mrln-status--accent {
  color: var(--accent);
  background: var(--accent-soft);
}
.mrln-status--neutral {
  color: var(--text-soft);
  background: var(--surface-3);
}
/* Pane tabs: plain text tabs with a 2px active underline (JB 2026-11-10).
   Shared by workspace navigation, queues and Merlin chat panes; the active
   tab follows the person's resolved interface accent. The parent carries
   the hairline; the -1px margin sits the underline on it. */
.mrln-pane-tabs {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
}
.mrln-pane-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 11px 11px;
  margin-bottom: -1px;
  font-family: inherit;
  font-size: var(--type-body);
  font-weight: 400;
  white-space: nowrap;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  user-select: none;
  transition:
    color 0.12s,
    border-color 0.12s;
}
.mrln-pane-tab:hover:not(.is-active) {
  color: var(--text);
}
.mrln-pane-tab.is-active {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
}
.mrln-pane-tab:focus-visible {
  /* Inside the tab: the strip scrolls, so an outline's top edge was cut. The transparent outline is for forced colours. */
  outline: 2px solid transparent;
  box-shadow: inset 0 0 0 2px var(--accent);
  border-radius: var(--radius-control-sm);
}
.mrln-pane-tab-count {
  font-size: var(--type-meta);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: 10px;
  color: var(--text-soft);
  background: var(--surface-3);
}
/* Queue workspace (queue-workspace.jsx): PILOT > Activity and ANTICIPATE >
   Savings (JB 2026-11-10 mocks). KPI cards, then one card holding a tabbed
   list and the selected item's detail. */
.mrln-queue-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--page-gap);
  flex-shrink: 0;
}
.mrln-queue-kpi {
  background: var(--surface);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-24);
  min-width: 0;
}
.mrln-queue-kpi-label {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: 14px;
  color: var(--text-soft);
}
.mrln-queue-kpi-value {
  margin-top: var(--space-16);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.mrln-queue-kpi-sub {
  margin-top: var(--space-12);
  font-size: var(--type-body);
  color: var(--text-dim);
}
.mrln-queue {
  background: var(--surface);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
  flex-shrink: 0;
}
.mrln-queue-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  padding: var(--space-24) var(--space-24) var(--space-8);
}
.mrln-queue-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-12);
  min-width: 0;
}
.mrln-queue-title h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.mrln-queue-context,
.mrln-queue-note {
  font-size: var(--type-body);
  color: var(--text-dim);
  white-space: nowrap;
}
.mrln-queue-tabs {
  padding: 0 var(--space-24);
  border-bottom: var(--hairline) solid var(--border);
}
.mrln-queue-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
}
.mrln-queue-list {
  min-width: 0;
  border-right: var(--hairline) solid var(--border);
}
.mrln-queue-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mrln-queue-list-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-12);
  padding: var(--space-16) var(--space-20);
  font-size: var(--type-body);
  color: var(--text-soft);
  border-bottom: var(--hairline) solid var(--border);
}
.mrln-queue-row {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: var(--space-16);
  align-items: center;
  padding: var(--space-20);
  font-family: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: var(--hairline) solid var(--border);
  box-shadow: none;
  cursor: pointer;
  color: inherit;
}
.mrln-queue-row:hover:not(.is-selected) {
  background: var(--surface-2);
}
.mrln-queue-row.is-selected {
  background: color-mix(in oklch, var(--accent) 6%, var(--surface));
  box-shadow: inset 3px 0 0 var(--accent);
}
.mrln-queue-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.mrln-queue-tile {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-soft);
}
.mrln-queue-row-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}
.mrln-queue-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mrln-queue-row-sub {
  font-size: var(--type-body);
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mrln-queue-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-8);
}
.mrln-queue-row-value {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.mrln-queue-row-meta {
  font-size: var(--type-body);
  color: var(--text-dim);
  white-space: nowrap;
}
.mrln-queue-empty {
  padding: 40px var(--space-20);
  text-align: center;
  font-size: var(--type-body);
  color: var(--text-dim);
}
.mrln-queue-detail-col {
  min-width: 0;
  padding: var(--space-16);
}
.mrln-queue-detail {
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-24);
  position: sticky;
  top: 0;
}
.mrln-queue-detail-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-12);
  font-size: var(--type-body);
  color: var(--text-soft);
}
.mrln-queue-detail-title {
  margin: var(--space-16) 0 0;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--text);
}
.mrln-queue-detail-lead {
  margin: var(--space-12) 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
}
.mrln-queue-figure {
  margin-top: var(--space-16);
  display: flex;
  align-items: baseline;
  gap: var(--space-8);
  flex-wrap: wrap;
}
.mrln-queue-figure b {
  font-size: 32px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.mrln-queue-figure span {
  font-size: var(--type-body);
  color: var(--text-dim);
}
.mrln-queue-section {
  margin-top: var(--space-20);
  padding-top: var(--space-20);
  border-top: var(--hairline) solid var(--border);
}
.mrln-queue-section h4 {
  margin: 0 0 var(--space-12);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.mrln-queue-section p,
.mrln-queue-section li {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
}
.mrln-queue-section ol {
  margin: 0;
  padding-left: 18px;
}
.mrln-queue-source {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin-top: var(--space-12);
  font-size: var(--type-body);
  color: var(--text-soft);
}
.mrln-queue-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: var(--space-8) var(--space-16);
  margin: 0;
  font-size: var(--type-body);
}
.mrln-queue-facts dt {
  color: var(--text-dim);
}
.mrln-queue-facts dd {
  margin: 0;
  color: var(--text);
}
.mrln-queue-actions {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
  margin-top: var(--space-20);
}
.mrln-queue-link {
  padding: 0;
  font: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.mrln-queue-link:hover {
  text-decoration: underline;
}
.mrln-queue-actions .mrln-btn {
  height: 40px;
  padding: 0 var(--space-16);
  font-size: 14px;
  gap: var(--space-8);
}
.mrln-queue-footnote {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin: 0;
  font-size: var(--type-body);
  color: var(--text-dim);
}
@media (max-width: 1100px) {
  .mrln-queue-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .mrln-queue-list {
    border-right: 0;
  }
  .mrln-queue-detail {
    position: static;
  }
}
@media (max-width: 760px) {
  .mrln-queue-kpis {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Section tabs (UnderlineTabs): icon + label chips, sub-nav selected state. */
.mrln-tabs {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  min-width: 0;
}
.mrln-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  font-family: inherit;
  font-size: var(--type-body);
  font-weight: 400;
  white-space: nowrap;
  color: var(--text-soft);
  background: transparent;
  border: var(--hairline) solid transparent;
  border-radius: var(--radius-control);
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.12s;
}
.mrln-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.mrln-tab:hover:not(.is-active):not(:disabled) {
  background: var(--surface-3);
}
.mrln-tab.is-active {
  background: var(--subnav-active-bg);
  border-color: var(--subnav-active-border);
  color: var(--accent);
}
.mrln-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.mrln-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.mrln-tab-count {
  font-size: var(--type-meta);
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}
.mrln-tab.is-active .mrln-tab-count {
  color: var(--accent);
}

.mrln-rail-divider {
  width: 22px;
  height: 0;
  border-top: var(--hairline) solid var(--border-strong);
  margin: var(--space-4) 0 var(--space-4) 7px; /* centred under the 36px item */
  flex-shrink: 0;
}
.mrln-workspace-card:hover {
  border-color: var(--border-strong) !important;
}
.mrln-workspace-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* A page's root scroll container in the main content card: the 12px
   at the sides, the bottom and between cards, the baseline inset above, and a column of sections. */
.mrln-page {
  flex: 1;
  overflow: auto;
  padding: var(--content-inset) var(--page-gap) var(--page-gap);
  display: flex;
  flex-direction: column;
  gap: var(--page-gap);
}

/* Page header (PageHeader): the KPI Cockpit title block, on every page.
   JB 2026-11-09: "use the same title style as Cockpit". Eyebrow 11px
   uppercase, title 25/400, description 12px, tight 4px / 6px rhythm. */
.mrln-page-header {
  display: flex;
  align-items: flex-end;
  gap: var(--space-16) var(--space-24);
  flex-wrap: wrap;
  flex-shrink: 0;
}
.mrln-page-eyebrow {
  font-size: var(--type-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.mrln-page-title {
  margin: 0;
  color: var(--text);
  line-height: 1.2;
}
.mrln-page-desc {
  margin: 6px 0 0;
  font-size: var(--type-desc);
  color: var(--text-soft);
  max-width: 640px;
}
.mrln-page-extra {
  margin-top: var(--space-12);
}
.mrln-page-aside {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  flex-shrink: 0;
}
/* Metric card (control-room reference). */
.mrln-metric-label {
  flex: 1;
  min-width: 0;
  font-size: var(--type-body);
  color: var(--text-soft);
}
.mrln-metric-of,
.mrln-metric-unit {
  font-size: var(--type-desc);
  color: var(--text-dim);
  margin-left: 4px;
}
.mrln-metric-sub {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin-top: var(--space-12);
  font-size: var(--type-body);
  color: var(--text-soft);
}
/* A static state dot owned by its component (metric card, sub-nav, nodes).
   Not the retired global Dot primitive: no pulse, no size props. */
.mrln-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-dim);
}
.mrln-dot--ok {
  background: var(--ok);
}
.mrln-dot--warn {
  background: var(--warn);
}
.mrln-dot--risk {
  background: var(--risk);
}
.mrln-dot--info {
  background: var(--info);
}

/* Data table: metadata-size uppercase headers, body-size cells, quiet rules. */
.mrln-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--type-desc);
}
.mrln-table th {
  text-align: left;
  font-size: var(--type-meta);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-dim);
  padding: var(--space-6) var(--space-8);
  border-bottom: var(--hairline) solid var(--border-strong);
}
.mrln-table td {
  padding: var(--space-8);
  border-bottom: var(--hairline) solid var(--border);
  color: var(--text);
}
.mrln-table td.is-num,
.mrln-table th.is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mrln-table tbody tr:hover td {
  background: var(--surface-2);
}
/* Mono: a tinted chip cannot exist (two values); the label keeps an ink edge. */
body.adaptiv-mono .mrln-status,
body.adaptiv-mono .mrln-count {
  background: #000000;
  border-color: var(--mono-ink);
}
body.adaptiv-mono .mrln-seg-item.is-on {
  background: var(--mono-ink);
  color: var(--accent-ink);
}
body.adaptiv-mono .mrln-btn--primary:hover:not(:disabled) {
  background: var(--mono-ink);
}

.merlin-message:hover .merlin-pin {
  opacity: 1;
}
.merlin-message .merlin-pin:hover {
  color: var(--accent) !important;
}

/* Leaflet tile filter — used by the EcosystemMapWidget to render its
   CARTO basemap in monochrome. CARTO light is already minimal; the
   grayscale pass takes it to true B/W and the small contrast bump
   keeps roads readable. */
.merlin-mono-tiles {
  filter: grayscale(1) contrast(1.05) brightness(1.02);
}

/* Print: clicking "Generate" with format=PDF on the Reports page
   invokes window.print(). This stylesheet hoists the report preview
   out and hides everything else so the printed page is clean. The
   user picks "Save as PDF" in the browser's print dialog. */
@media print {
  html,
  body,
  #root {
    height: auto !important;
    overflow: visible !important;
    background: white !important;
  }
  /* Hoist the print target out of its scrolling ancestors. */
  #merlin-print-target {
    position: fixed !important;
    inset: 0 !important;
    background: white !important;
    color: black !important;
    padding: 24px !important;
    overflow: visible !important;
    z-index: 2147483647 !important;
  }
  #merlin-print-target * {
    color: black !important;
    background: white !important;
    border-color: #ccc !important;
    box-shadow: none !important;
  }
  /* Anything explicitly tagged stays out of print. */
  .merlin-no-print {
    display: none !important;
  }
  @page {
    margin: 0.5in;
  }
}

/* PWA installed with Window Controls Overlay: the brand gradient title bar
   fills the OS title-bar strip. Give it a little extra height beyond
   env(titlebar-area-height) so the app's top-right menu button (Adaptiv "A")
   and the rest of the top chrome clear the title bar + Chrome's window
   controls instead of tucking under them. No effect outside an installed WCO
   window (the selector only matches that display mode). */
@media (display-mode: window-controls-overlay) {
  .merlin-wco-titlebar {
    min-height: calc(env(titlebar-area-height, 0px) + 14px);
  }
}

/* ── Selects — custom chevron, app-wide (JB 2026-07-10) ─────────────────────
   The native <select> arrow hugs the right edge; JB wants it 10px further in.
   Native arrows can't be positioned, so appearance:none + our own chevron.
   !important on the background-image/position/repeat + padding-right because
   most selects set an inline `background:` SHORTHAND (the FIELD style objects),
   which would otherwise reset background-image to none and let long text run
   under the chevron. Inline `background-color`/colors still apply — only the
   image layer is forced. Chevron = 12px stroke, --text-dim per theme. */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%236b7390' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  padding-right: 32px !important;
}
body.dark select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%238d94a8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") !important;
}

/* ── Browser autofill: keep the field's own surface ─────────────────────────
   Chrome paints an autofilled field with its OWN pale blue (#e8f0fe), which no
   theme can reach — it looked like a highlight box on the sign-in fields and,
   in Adaptiv Mono, it is a colour the two-value brief excludes outright.

   Deferring the background-color transition by ~7 days is the one fix that does
   NOT require guessing a replacement colour: the usual `box-shadow: 0 0 0 1000px
   <colour> inset` hard-codes a surface, and our inputs sit on --surface in some
   places and --surface-2 in others, so a single value would be wrong half the
   time. The field simply keeps whatever background it already had. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  transition: background-color 0s 604800s;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}

/* ── Accessibility: keyboard focus indicator (WCAG 2.4.7) ───────────────────
   Most controls in the app set an inline `outline:none` (46 sites) and paint
   their own focus ring only on mouse-driven :focus (box-shadow via onFocus
   handlers), which leaves KEYBOARD users with no visible focus on many
   controls. This adds one app-wide :focus-visible ring on interactive
   elements. `:focus-visible` fires only for keyboard/AT focus, so mouse and
   touch users see NO visual change — behaviour-preserving for sighted pointer
   use. `!important` is required to beat the inline `outline:none`. The ring
   uses --accent, which clears the 3:1 non-text-contrast bar (1.4.11) in all
   four theme × color-scheme combinations (pink 3.56/5.12, indigo 8.41/7.68). */
/* Sign-in fields opt OUT of the ring and carry the focus state on their own
   border instead (Auth.jsx sets borderColor to --accent on focus). The detached
   2px offset ring read as a highlight box around the email/password — JB asked
   for it gone twice. This REPLACES the indicator rather than removing it: the
   accent border is still a visible focus change and still clears the 3:1
   non-text-contrast bar, so 2.4.7 / 1.4.11 hold. Scoped to .auth-field so the
   app-wide ring below is untouched everywhere else. */
.auth-field input:focus-visible,
.auth-field select:focus-visible {
  outline: none !important;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
[role='button']:focus-visible,
[role='link']:focus-visible,
[role='tab']:focus-visible,
[role='menuitem']:focus-visible,
[role='option']:focus-visible,
[contenteditable]:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px !important;
}

/* ── Accessibility: reduced motion (WCAG 2.3.3) ─────────────────────────────
   The app's motion lives almost entirely in inline `style={{ transition/
   animation }}` (167 transitions, 33 animations across the JSX) plus the
   keyframes in this file. When the user asks their OS for reduced motion, we
   neutralise all of it. `!important` is required to win over the inline
   styles. Durations are collapsed rather than removed so any transition-end /
   animation-end listeners still fire (behaviour-preserving). Note: the
   three.js `useFrame` render loops in the Hypervisor 3D viewer are JS-driven
   and NOT covered here — they need a matchMedia opt-out (tracked as a
   follow-up in the conformance report). */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    animation-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}

/* Hide the horizontal scrollbar on mobile scroll rails (the Anticipate
   sub-track strip, the paged tab track). A native app has no scrollbars; the
   overflow still scrolls, only the bar is hidden. */
.no-scrollbar {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* legacy Edge */
}
.no-scrollbar::-webkit-scrollbar {
  display: none; /* WebKit / iOS */
}

/* Shared module label: approved Merlin viewer proposal. */
.module-label {
  font-family: var(--font);
  font-size: var(--type-module);
  font-weight: var(--weight-module);
  letter-spacing: var(--tracking-module);
  line-height: 1.45;
  text-transform: uppercase;
  color: var(--accent);
  flex-shrink: 0;
}
