@import url("product-nav-icons.css?v=432f6a45");

/* Shared theme + common components for every page. Single source of color
   variables (dark default, light override) so the toggle works everywhere.
   Badges/pills/tags are TINTED from one base color via color-mix() so they
   auto-adapt: dark tint + light text in dark mode, light tint + dark text in
   light mode. Nothing hard-codes a dark background. */

/* Inter — the cross-platform carrier of the house voice (San Francisco leads on
   Apple; see --font-ui). SELF-HOSTED (was a Google Fonts web import): the Google
   Fonts CDN is blocked in mainland China, so the WOFF2 files are vendored under
   site/fonts/ (source: templates/fonts/, copied by build_site) and served
   same-origin. theme.css is linked by every page, so these @font-face rules give
   every non-Apple client the full 400–900 range with no third-party request. */
@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url("fonts/Inter-400.woff2") format("woff2");}
@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url("fonts/Inter-500.woff2") format("woff2");}
@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url("fonts/Inter-600.woff2") format("woff2");}
@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url("fonts/Inter-700.woff2") format("woff2");}
@font-face{font-family:Inter;font-style:normal;font-weight:800;font-display:swap;src:url("fonts/Inter-800.woff2") format("woff2");}
@font-face{font-family:Inter;font-style:normal;font-weight:900;font-display:swap;src:url("fonts/Inter-900.woff2") format("woff2");}
:root {
  /* ── font stacks ─────────────────────────────────────────────────────────────
     --font-ui   : primary UI stack. San Francisco leads via the system keywords
                   — SF cannot be self-hosted (Apple's licence bars webfont
                   redistribution), and naming no optical variant lets SF pick
                   Text/Display itself. Inter follows as the carrier elsewhere,
                   AHEAD of Segoe UI / Roboto so non-Apple gets the house face.
     --font-mono : figures, tickers, code, axis ticks. ui-monospace resolves to
                   SF Mono (macOS/iOS), Consolas (Windows) — no download. */
  --font-ui: var(--font-ui-latin);
  --font-ui-latin: -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", Roboto,
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono",
    Menlo, Consolas, "DejaVu Sans Mono", monospace;
  /* --num : numeric-face alias. Referenced ~30× on the macro dashboard for its
     data numerals; body.page-macro overrides it to a mono terminal face on its
     own scope. This :root default keeps the token valid everywhere else (a bare
     `font-family:var(--num)` is otherwise an invalid decl on non-macro pages). */
  --num: var(--font-ui-latin);
  /* ── type ramp — the SITE type scale (design-system packet PR-0(a)) ─────────
     11 shared steps, originally promoted out of body.page-macro
     (dashboard.html.j2) where it was born; body.estate (seo_base) carried a
     byte-identical copy and leader_radar/intraday_flow carried near-copies.
     Secondary text, labels and ticks use a more readable shared scale. Pages
     with a documented local override continue to own their density.

     It must live at :root, NOT on a body class. body.page-stocks (the Prophet
     board) never declared the ramp and inherits it ONLY through :root — a
     body-class home would leave every Prophet surface off the scale. Same for
     the calculators and the seo_* estate children, which use var(--fs-*)
     without declaring it and today resolve it through their base template. */
  --fs-display:46px;   /* hero verdict word          */
  --fs-num-xl:38px;    /* the big board scores        */
  --fs-h1:28px;        /* page / hero title           */
  --fs-num-lg:22px;    /* secondary big numerals      */
  --fs-h2:17px;        /* panel section titles        */
  --fs-md:15px;        /* lead body / strong figures  */
  --fs-body:14px;      /* base copy                   */
  --fs-h3:14px;        /* subsection titles           */
  --fs-sm:13px;      /* secondary copy / table body */
  --fs-label:12px;     /* MONO eyebrows · caps        */
  --fs-micro:11px;     /* dense ticks · table heads   */
  --bg: #0f1115; --panel: #181b21; --panel2: #1e222a; --text: #d7dce3;
  --muted: #8b93a1;
  /* Estate contrast pass 2026-08-03: #2a2f3a measured 1.13–1.29:1 against the
     dark panels — fainter than the LIGHT theme's raised 1.6 floor, inverted from
     how the two themes should sit. #3a4150 lands containers at 1.56–1.85 across
     the estate's dark surfaces, the same perceptual band as light. */
  --line: #3a4150;
  --line-quiet: #272C35;
  --q1: #2e9e4f; --q2: #d4a017; --q3: #d04545; --q4: #3f78d8;
  --warn: #e0a030; --act: #e05555; --ok: #3da564;
  /* Freshness/recency snapshot of --ok, computed HERE (unremapped). It inherits
     RESOLVED, so a .fresh chip inside html[data-lang="zh"] .rrx / .igs keeps the
     status green when those scopes remap --ok onto --up. Do not redeclare this
     alias inside .rrx/.igs — that would re-resolve against the remapped --ok. */
  --fresh-ok: var(--ok);
  --up: #45b873; --down: #e06464; --orange: #e08b45;
  --info: #5b9bf0; --link: #7aa7e0;
  --g-cold: #4d8df0; --g-hot: #e0a23c; --g-mid: #3a4150;
  /* ── prophet-card verb hues (_prophet_card.html.j2) ─────────────────────────
     One hue per card state: buy/near/wait/hold/avoid. English uses the Western
     green-up/red-down convention. Chinese mode rebinds only these Prophet tokens
     onto the site's Asia-aware --up/--down pair below, so every Prophet board
     becomes red-bullish/green-bearish without recolouring non-Prophet status UI.

     STANCE IS NOT DIRECTION (DA-002 cure, C8-C — reference board.css:48/:83/:110).
     --pv-buy used to be the literal #45b873, byte-identical to --up above: a Buy
     chip and a +2.1% change printed the SAME ink, so one colour on one card meant
     two different things and no reader could tell the call from the tape. Stance
     now sits a deliberate tone off the direction ink it belongs to — same semantic
     family, visibly not the same colour. Derived FROM --up rather than hand-picked
     so the zh flip stays structural: 红涨绿跌 needs no second table below, and a
     future --up nudge carries the stance with it instead of silently re-colliding.
     Deepening toward --text also RAISES contrast for BUY on both planes, on all four
     of its consumers, in all four quadrants. It does not do so uniformly: Near, which
     is now mixed toward --muted rather than carrying its own hue, regresses on the
     two DARK quadrants — 8 pairs, worst -0.94 (en/dark .pv-znl 8.12 -> 7.18) — and
     every one of them still clears AA by a margin. Do not restate this as a blanket
     improvement; the measured plane is what governs (measured by
     tests/test_prophet_verb_ink_contrast.py, all 5 verbs x 4 consumers x 4
     theme/lang quadrants; re-measure with mockups/refs/prophet_verb_ink/probe_pv_ink.py).
     Separation, CIELAB dE, raw token / text ink, all eight readings 0.00 before:
       en-light 30.5 / 5.6 · zh-light 35.1 / 23.3 · en-dark 10.1 / 10.1 · zh-dark 12.5 / 12.5
     en/light's 5.6 is the thinnest and is INHERITED, not chosen: light's --ink-mix-up
     is 62% and this mix is 54% — two points on one axis, so those two inks are close
     by construction. It clears the ~2.3 just-noticeable threshold and the two never
     take the same form (Buy is a solid pill, the change is small text), but it is the
     quadrant to re-open first if the separation is ever judged too thin.

     --pv-near follows --pv-buy rather than carrying its own literal, and that is
     forced, not tidy: at the old literal #63c08d, Near landed within ~4/255 per
     channel of the retuned Buy, i.e. curing DA-002 alone would have replaced a
     stance/direction collision with a Buy/Near one. Mixing toward --muted keeps
     Near reading as the softer call at every point on the ramp. */
  --pv-buy: color-mix(in srgb, var(--up) 82%, var(--text));
  --pv-near: color-mix(in srgb, var(--pv-buy) 70%, var(--muted));
  --pv-wait: #e0a030;
  --pv-hold: #8b93a1; --pv-avoid: #e06464;
  /* Prophet setup-detail modal tokens: literal color decisions live in the palette, not component CSS. */
  --pv-dialog-shadow: 0 18px 60px rgba(0,0,0,.2666667);
  --pv-dialog-backdrop: rgba(0,0,0,.5333333);
  --chart-bg: transparent;
  --card-shadow: 0 1px 0 rgba(255,255,255,.02);
  --popover-shadow: 0 6px 18px rgba(0,0,0,.5);
  /* ── custom scrollbars ───────────────────────────────────────────────────────
     Thumb tint derived from --muted so it adapts to dark / light / zh with no
     per-theme override (--info gives the drag-state a branded accent). Consumed
     by the global scrollbar rules further down and mirrored (with fallbacks) by
     theme.js for the self-contained pages that don't link this file. */
  --sb-thumb: color-mix(in srgb, var(--muted) 34%, transparent);
  --sb-thumb-hover: color-mix(in srgb, var(--muted) 60%, transparent);
  --sb-thumb-active: color-mix(in srgb, var(--info) 62%, var(--muted));
  /* ── frosted-glass popover system ───────────────────────────────────────────
     ONE token set shared by every floating menu surface — the top-nav dropdowns,
     the Research mega-menu, the global-search suggestions, the gear settings
     popover, the bell alert popover and the fired-alerts popup — so they all read
     as a single design family. backdrop-filter blurs the aurora + page behind the
     panel; the translucent fill lets that colour bleed through. Opacity + shadow
     are re-tuned per theme in the light block below. The self-contained vector
     family (no theme.css) mirrors these values inline in _vector_polish.html.j2
     and theme.js, so keep the three in sync if you retune the glass. */
  --glass-bg: color-mix(in srgb, var(--panel) 86%, transparent);
  --glass-brd: color-mix(in srgb, var(--text) 14%, transparent);
  --glass-blur: saturate(180%) blur(22px);
  --glass-shadow: 0 24px 64px -22px rgba(3,7,18,.74), 0 10px 26px -12px rgba(3,7,18,.55),
    inset 0 1px 0 color-mix(in srgb,#fff 10%,transparent);
  /* ── gbtn: house glass-button token set (macro sweep 2026-07) ──────────────
     The default button surface for the whole site — a frosted pill that reads as
     one family with the glass popovers above. Fill/border derive from --panel2 /
     --text via color-mix so dark, light and the zh swap all resolve at paint. */
  --gbtn-bg:        color-mix(in srgb, var(--panel2) 52%, transparent);
  --gbtn-bg-hover:  color-mix(in srgb, var(--panel2) 76%, transparent);
  --gbtn-brd:       color-mix(in srgb, var(--text) 12%, transparent);
  --gbtn-brd-hover: color-mix(in srgb, var(--text) 24%, transparent);
  --gbtn-sheen:     rgba(255,255,255,.09);
  /* Retained evidence states share the canonical theme surfaces. */
  --surface-warn-subtle: color-mix(in srgb, var(--warn) 6%, var(--panel));
  --surface-skeleton-deep: color-mix(in srgb, var(--panel2) 86%, var(--line));
  /* ── Macro Command tints (templates/macro_command.css) ────────────────────
     color-mix on an added surface line is enforce-added-illegal; the mixes
     live here so the surface only names tokens. --text/--info/--ok track
     the theme (and the zh swap) at paint. Halo fill is currentColor at
     calc(var(--mc-halo) * 100%): rest 12% on dark, lit 22% when the
     signature :has() raises --mc-halo, cancelled (0) on light. Stance
     wash is 0 dark / 6% light. --mc-accent-line keeps the dest-hover
     second stop on --mq-line (macro_suite.css), not a 12% --text stand-in. */
  --mc-ink-02: color-mix(in srgb, var(--text) 2%, transparent);
  --mc-ink-05: color-mix(in srgb, var(--text) 5%, transparent);
  --mc-ink-07: color-mix(in srgb, var(--text) 7%, transparent);
  --mc-ink-08: color-mix(in srgb, var(--text) 8%, transparent);
  --mc-ink-09: color-mix(in srgb, var(--text) 9%, transparent);
  --mc-ink-10: color-mix(in srgb, var(--text) 10%, transparent);
  --mc-ink-12: color-mix(in srgb, var(--text) 12%, transparent);
  --mc-ink-14: color-mix(in srgb, var(--text) 14%, transparent);
  --mc-ink-18: color-mix(in srgb, var(--text) 18%, transparent);
  --mc-text-06: color-mix(in srgb, var(--text) 6%, transparent);
  --mc-text-10: color-mix(in srgb, var(--text) 10%, transparent);
  --mc-text-22: color-mix(in srgb, var(--text) 22%, transparent);
  --mc-accent-10: color-mix(in srgb, var(--info) 10%, transparent);
  --mc-accent-12: color-mix(in srgb, var(--info) 12%, transparent);
  --mc-accent-22: color-mix(in srgb, var(--info) 22%, transparent);
  --mc-accent-34: color-mix(in srgb, var(--info) 34%, transparent);
  --mc-accent-line: color-mix(in srgb, var(--info) 38%, var(--mq-line));
  --mc-halo: 0;
  --mc-halo-fill: color-mix(in srgb, currentColor calc(var(--mc-halo) * 100%), transparent);
  --mc-stance-ok: transparent;
  --mc-stance-warn: transparent;
  --mc-stance-bad: transparent;
  --mc-stance-neutral: transparent;
  --mc-stance-fill: var(--mc-stance-neutral);
  /* Expectation Surface page tokens (templates/expectation_surface.html.j2 aliases them under body.page-es) */
  --esurf-hair: color-mix(in srgb, var(--line) 78%, transparent);
  --esurf-hair-soft: color-mix(in srgb, var(--line) 44%, transparent);
  --esurf-ser1: var(--info);
  --esurf-ser2: #d4a017;
  --esurf-band: color-mix(in srgb, var(--esurf-ser1) 15%, transparent);
  --esurf-flat: #5f6879;
  --esurf-skel: #22262f;
  --esurf-neutral-soft: color-mix(in srgb, var(--muted) 14%, transparent);
  --esurf-warn-soft: color-mix(in srgb, var(--warn) 13%, transparent);
  --esurf-warn-line: color-mix(in srgb, var(--warn) 40%, transparent);
  --esurf-ok-soft: color-mix(in srgb, var(--ok) 13%, transparent);
  --esurf-btn-hover: color-mix(in srgb, var(--panel2) 72%, var(--line));
  --esurf-chip-warn-hover: color-mix(in srgb, var(--warn) 18%, transparent);
  --esurf-mv-hover: color-mix(in srgb, var(--panel2) 60%, transparent);
}
html[data-theme="light"] {
  /* light glass buttons: white reads thin when too transparent, so lift the fill
     and soften the top sheen (the dark theme's bright inset reads as a hard line
     on a white pill). */
  --gbtn-bg:        color-mix(in srgb, var(--panel2) 78%, var(--panel));
  --gbtn-bg-hover:  color-mix(in srgb, var(--panel2) 96%, var(--panel));
  /* Estate contrast pass 2026-08-03: at 11%, the pill outline measured 1.24:1 —
     the border IS the affordance on a glass button, a WCAG 1.4.11 component
     boundary, so it earns the 3:1 bar (50% text ≈ 3.08 on the light canvas).
     Dark is left alone: its frosted fill + sheen carry the boundary there, and
     the dark A/B in this pass is pinned to byte-identical. */
  --gbtn-brd:       color-mix(in srgb, #1c2430 50%, transparent);
  --gbtn-brd-hover: color-mix(in srgb, #1c2430 66%, transparent);
  --gbtn-sheen:     rgba(255,255,255,.7);
  --mc-stance-ok: color-mix(in srgb, var(--ok) 6%, transparent);
  --mc-stance-warn: color-mix(in srgb, var(--warn) 6%, transparent);
  --mc-stance-bad: color-mix(in srgb, var(--act) 6%, transparent);
  --mc-stance-neutral: color-mix(in srgb, var(--muted) 6%, transparent);
  --esurf-ser1: #2f63c4;
  --esurf-ser2: #8f6a04;
  --esurf-band: color-mix(in srgb, var(--esurf-ser1) 11%, transparent);
  --esurf-flat: #8a93a1;
  --esurf-skel: #e9ecf1;
  --esurf-neutral-soft: var(--panel2);
  --esurf-warn-soft: color-mix(in srgb, var(--warn) 12%, var(--panel));
  --esurf-warn-line: color-mix(in srgb, var(--warn) 45%, transparent);
  --esurf-ok-soft: color-mix(in srgb, var(--ok) 10%, var(--panel));
}
html[data-theme="light"] {
  /* Light palette tuned to match the Bitcoin Vector dashboard: airy #F7F8FA
     canvas, white cards on a soft #EAECF0 grid, and the same vivid #285FFF
     primary so links / buttons / accents read as one design family. The dark
     theme (the :root block above) is intentionally left untouched. */
  --bg: #f7f8fa; --panel: #ffffff; --panel2: #eef1f6; --text: #1c2430;
  --muted: #5d6b7e;
  /* Estate contrast pass 2026-08-03: #eaecf0 drew a 1.02–1.18:1 hairline on the
     light surfaces — a card boundary you have to hunt for (the W3 audit's words
     for the same defect on the sector page). 16% text lands the container edge
     at 1.61 vs a white card / 1.48 vs the canvas, matching the W3 light floor
     (1.6) and the raised dark hairline below, without turning row rules into a
     grid. */
  --line: color-mix(in srgb, #1c2430 16%, #eaecf0);
  --line-quiet: #E2E6EC;
  --q1: #1f8b41; --q2: #b07d05; --q3: #c12f2f; --q4: #2f63c4;
  --warn: #b9791a; --act: #c43d3d; --ok: #2f8a52;
  --fresh-ok: var(--ok);
  --up: #1f9a55; --down: #cf4040; --orange: #c4781f;
  --info: #285fff; --link: #285fff;
  --g-cold: #285fff; --g-hot: #c2841f; --g-mid: #cdd5e0;
  /* prophet-card verb hues — the same stance ramp, re-authored for a WHITE card.
     The mix is 54%, NOT the 62% that would mirror --ink-mix-up: at 62% the stance
     token resolves byte-identically to --ink-up (light --ink-mix-up is also 62%),
     so the solid BUY chip and the live +N% change on the same card would be one
     colour again — DA-002 in the other theme. 54% separates them and raises
     contrast at the same time. (reference board.css:83) */
  --pv-buy: color-mix(in srgb, var(--up) 54%, var(--text));
  --pv-near: color-mix(in srgb, var(--pv-buy) 70%, var(--muted));
  --pv-wait: #b9791a;
  --pv-hold: #5d6b7e; --pv-avoid: #cf4040;
  --chart-bg: #11151c;            /* keep dark-rendered Plotly charts legible */
  --card-shadow: 0 1px 3px rgba(20,30,50,.07);
  /* soft, light popover shadow — the dark theme's heavy 50%-black drop shadow
     reads as a murky grey halo on the white light-mode tooltips */
  --popover-shadow: 0 4px 10px rgba(20,30,50,.06), 0 12px 28px rgba(20,30,50,.14);
  /* light glass: brighter fill (white reads thin when too transparent) + an airy
     soft shadow with a crisp white top-edge sheen instead of the dark theme's
     heavy drop. */
  --glass-bg: color-mix(in srgb, var(--panel) 90%, transparent);
  --glass-brd: color-mix(in srgb, #1c2430 9%, transparent);
  --glass-shadow: 0 20px 54px -24px rgba(20,32,64,.34), 0 10px 24px -14px rgba(20,32,64,.20),
    inset 0 1px 0 rgba(255,255,255,.85);
}
/* ---- Chinese mode: Asia colour convention -----------------------------------
   In Asia red = up/bullish, green = down/bearish — the inverse of the West. So
   in zh mode we SWAP the up/down pair and flip the green/red quadrants
   (Goldilocks -> red, Stagflation -> green); gold (Reflation) and blue
   (Growth-scare) already read right and stay. Status colours (--ok/--warn/--act,
   data-health, alert severity) encode health/danger, NOT price direction, so
   they are deliberately left alone. Because every tinted badge, gauge, quad tile
   and .pos/.neg already resolves these vars at paint time (mtf.js re-reads them
   on `langchange`), the whole UI recolours instantly.
   Specificity note: html[data-theme="light"] and html[data-lang="zh"] tie at
   (0,1,1); the dual-attribute selector (0,2,1) below pins the light+zh combo. */
/* Freshness / provenance states live on the STATUS plane, not the direction pair.
   A fresh / stale / verified / updated / as-of chip ("Confirmed <date>", coverage
   badges, live dots) says how CURRENT a datum is, never which way a market moved,
   so it is coloured with --ok/--warn/--act (+ their --ink-*) and NEVER with
   --up/--down — otherwise the swap below paints the same chip green in EN and red
   in ZH (Opus re-review of PR #6933, international_macro .imd-chip.fresh).
   Inside a gauge-scoped zh remap (.rrx / .igs) even var(--ok) flips, because
   those scopes rebind --ok onto --up. Freshness chips there must paint with
   --fresh-ok (snapshotted at :root / light, inherited resolved) and must not
   redeclare that alias in the remap zone.
   tests/test_freshness_chips_language_invariant.py pins every template rule,
   including local custom-property indirection (--rvc) and scoped remaps. */
html[data-lang="zh"] {
  --up: #e06464; --down: #45b873;        /* swapped: red now = up */
  --q1: #d04545;                         /* Goldilocks -> red */
  --q3: #2e9e4f;                         /* Stagflation -> green */
  /* Prophet-only verdict palette: buy/near = bullish red, avoid = bearish green.
     Wait/hold stay direction-neutral amber/grey.
     C8-C: buy/near no longer need a zh line at all. They derive from --up, which
     this very block has just flipped, so a zh Buy chip is red BY CONSTRUCTION
     rather than by a second hand-tuned palette that a future --up edit could
     desynchronise. --pv-avoid still needs its line: it is a literal on the :root
     plane, so without this it would keep the EN bearish red under zh. */
  --pv-avoid: var(--down);
}
html[data-theme="light"][data-lang="zh"] {
  --up: #cf4040; --down: #1f9a55;
  --q1: #c12f2f;
  --q3: #1f8b41;
  /* No --pv-buy/--pv-near line here, deliberately — and this is a TRADE, not a
     free win. The reference restates both tokens in this quadrant precisely for
     source-order safety (its VTC-311 note). C8-C takes the other side: the retune
     left exactly ONE declaration of each per theme plane and the zh block no
     longer competes for them, so restating here would mean two copies of one
     formula that a later palette edit can desynchronise — the drift the
     restatement was guarding against, re-created in a new place. The hazard is
     therefore not GONE, it is pinned somewhere else: by
     test_stance_is_never_the_direction_ink[zh-light], which resolves this exact
     quadrant through the real cascade and fails if source order ever hands it the
     wrong --up. If that guard is deleted, restate the two formulas here.
     --pv-avoid is the one stance token still carrying literals, so it keeps its
     zh line above. */
}
/* ---- odo-needle: shared light-mode odometer pointer -------------------------
   Dark mode's white blade + coloured hub already reads beautifully. The country
   dashboards used to replace that blade with near-black in light mode, which made
   the most important mark on the dial look like a stray SVG rule. Keep dark mode
   byte-untouched; in light, turn the pointer into a two-tone instrument: a crisp
   state-coloured blade, a softer colour bloom, and a white hub that belongs on the
   card. --odo-accent is supplied by each gauge from its existing semantic state
   token, so EN/zh direction swaps remain automatic. */
html[data-theme="light"] .odo-needle {
  filter:
    drop-shadow(0 1px 1px rgba(23,32,55,.16))
    drop-shadow(0 0 5px color-mix(in srgb,var(--odo-accent,var(--warn)) 22%,transparent));
}
html[data-theme="light"] .odo-needle--compact > line {
  stroke:color-mix(in srgb,var(--odo-accent,var(--warn)) 44%,transparent);
}
html[data-theme="light"] .odo-needle--compact > polygon {
  fill:color-mix(in srgb,var(--odo-accent,var(--warn)) 94%,var(--panel,#fff));
  opacity:1;
}
html[data-theme="light"] .odo-needle--compact > circle:first-of-type {
  fill:color-mix(in srgb,var(--odo-accent,var(--warn)) 12%,transparent);
}
html[data-theme="light"] .odo-needle--compact > .odo-needle-hub {
  fill:var(--panel,#fff);
}
/* ---- Text-grade state INKS (estate pass 2026-08-03; method = SI V2 W3 audit) --
   The state palette is FILL-grade, not TEXT-grade: on light, --up #1f9a55 tops
   out at 3.61:1 on pure white (3.00 on the estate's darkest common surface
   #e8eaed) and --warn/--orange sit at 2.9–3.6 — yet this file and most product
   pages print them as 9–15px text. These tokens are the text-safe form.

   Shape: --ink-mix-* holds the share of the STATE hue kept in the ink; the rest
   is --text. Dark keeps 100% (ink ≡ raw token → dark renders byte-identical —
   the raw dark inks were measured at 4.5:1+ against --bg/--panel/--panel2, the
   flat surfaces the estate prints state text on. That measurement does NOT cover
   a surface tinted with the hue's OWN colour: a color-mix(<hue> 13%, --panel)
   chip is DARKER than --panel, so a dark hue printed on its own tint is a
   strictly harder pair than anything in the pass above. The prophet cards do
   exactly that, and #e06464 failed there — see the verb-ink block below, which is
   why that block no longer inherits a blanket dark pass-through). Light percentages
   are keyed to HUE, not token name — green sits high in luminance and needs far
   more darkening than red — and are adopted verbatim from the W3 calibration so
   the estate and the SI workspace speak one vocabulary: measured on the worst
   light surface (#e8eaed) they land at 4.8–5.5:1 (up 5.22 · down 4.83 · warn
   5.25 · ok 5.27 · act 4.96 · orange 5.45 · link 4.81). The zh twin re-keys
   up/down because 红涨绿跌 swaps the HUES under the names: red clears AA with
   far less mixing, and keeping one percentage for both would print a dour
   maroon (W3's words — the exact failure this prevents).

   The inks resolve at html scope (page-level :root re-themes still flow in;
   subtree rebinds of --up do not — the one subtree rebinder today, the SI V2
   workspace, computes the same formula so the results agree). Consumers in page
   templates should write var(--ink-up, var(--up)) so a cache-stale theme.css
   degrades to today's colors rather than an invalid declaration. */
:root {
  --ink-mix-up: 100%; --ink-mix-down: 100%; --ink-mix-warn: 100%; --ink-mix-ok: 100%;
  --ink-mix-act: 100%; --ink-mix-orange: 100%; --ink-mix-link: 100%; --ink-mix-info: 100%;
}
html[data-theme="light"] {
  --ink-mix-up: 62%; --ink-mix-down: 84%; --ink-mix-warn: 62%; --ink-mix-ok: 70%;
  --ink-mix-act: 88%; --ink-mix-orange: 58%; --ink-mix-link: 88%; --ink-mix-info: 88%;
}
html[data-theme="light"][data-lang="zh"] {
  --ink-mix-up: 84%;   /* red under 红涨绿跌 */
  --ink-mix-down: 62%; /* green */
}
:root {
  --ink-up:     color-mix(in srgb, var(--up)     var(--ink-mix-up),     var(--text));
  --ink-down:   color-mix(in srgb, var(--down)   var(--ink-mix-down),   var(--text));
  --ink-warn:   color-mix(in srgb, var(--warn)   var(--ink-mix-warn),   var(--text));
  --ink-ok:     color-mix(in srgb, var(--ok)     var(--ink-mix-ok),     var(--text));
  --ink-act:    color-mix(in srgb, var(--act)    var(--ink-mix-act),    var(--text));
  --ink-orange: color-mix(in srgb, var(--orange) var(--ink-mix-orange), var(--text));
  --ink-link:   color-mix(in srgb, var(--link)   var(--ink-mix-link),   var(--text));
  --ink-info:   color-mix(in srgb, var(--info)   var(--ink-mix-info),   var(--text));
  /* Translucent state planes for liveness indicators (F01 O27 R3): a wash for
     live-pill fills and live-tag backgrounds, a ring for live-dot halos and the
     pill hairline. Composed from --ok so the ZH .rrx/.igx remaps flow through;
     extend per hue only when a consumer needs it — no speculative family. */
  --wash-ok:    color-mix(in srgb, var(--ok) 16%, transparent);
  --ring-ok:    color-mix(in srgb, var(--ok) 26%, transparent);
}
/* ---- SOLID fills that carry WHITE text --------------------------------------
   The third grade, and the one the estate was missing. --up/--down/… are FILL
   grade for TINTS (a 13% wash under ink-grade text, >=3:1 non-text) and --ink-*
   is TEXT grade. Neither is right for the solid chip — the filled pill, the tier
   badge, the primary CTA — where the hue IS the background and the label is #fff.

   Measured white-on-raw-token 2026-08-12, and it fails in BOTH themes:

       token    dark   light        token    dark   light
       --up     2.51   3.61         --act    3.75   5.14
       --down   3.40   4.71         --link   2.49   5.03
       --warn   2.27   3.61         --info   2.84   5.03
       --ok     3.10   4.30         --orange 2.64   3.47

   Reaching for --ink-* here is the trap: --ink-mix-* is 100% on :root, so in DARK
   the rung IS the raw token and a "fix" that reads correct in light leaves dark
   exactly as broken (the tier badges and the tier-gate CTA both landed there).
   Mixing toward black instead is theme-independent by construction — 64% keeps
   the hue plainly recognisable and lands white at 5.14-10.19:1 across all eight
   tokens in both themes, worst case --warn/dark. Consumers write
   var(--fill-x, var(--x)) so a cache-stale theme.css degrades to today's colour. */
:root {
  --fill-mix: 64%;
  --fill-up:     color-mix(in srgb, var(--up)     var(--fill-mix), #000);
  --fill-down:   color-mix(in srgb, var(--down)   var(--fill-mix), #000);
  --fill-warn:   color-mix(in srgb, var(--warn)   var(--fill-mix), #000);
  --fill-ok:     color-mix(in srgb, var(--ok)     var(--fill-mix), #000);
  --fill-act:    color-mix(in srgb, var(--act)    var(--fill-mix), #000);
  --fill-orange: color-mix(in srgb, var(--orange) var(--fill-mix), #000);
  --fill-link:   color-mix(in srgb, var(--link)   var(--fill-mix), #000);
  --fill-info:   color-mix(in srgb, var(--info)   var(--fill-mix), #000);
}
/* ── Fundamental Forensics tints (templates/fundamental_forensics.css) ─────
   color-mix on an added surface line is enforce-added-illegal; the mixes
   live here so the surface only names tokens (the Macro Command idiom).
   Each formula is carried over byte-for-byte from the FIF P2 desk, so both
   themes paint exactly what the surface used to compute inline: --panel,
   --panel2, --line, --bg and the state hues re-theme on html, and
   --ff-border is that page's own :root hairline. Name = hue-percent-base;
   no base means over transparent. Consumers: that page only. */
:root {
  --ff-tint-act-8: color-mix(in srgb, var(--act) 8%, transparent);
  --ff-tint-act-43-border: color-mix(in srgb, var(--act) 43%, var(--ff-border));
  --ff-tint-act-30-line: color-mix(in srgb, var(--act) 30%, var(--line));
  --ff-tint-act-10-panel2: color-mix(in srgb, var(--act) 10%, var(--panel2));
  --ff-tint-act-12-panel: color-mix(in srgb, var(--act) 12%, var(--panel));
  --ff-tint-bg-96-act: color-mix(in srgb, var(--bg) 96%, var(--act));
  --ff-tint-bg-94-info: color-mix(in srgb, var(--bg) 94%, var(--info));
  --ff-tint-info-7: color-mix(in srgb, var(--info) 7%, transparent);
  --ff-tint-info-8: color-mix(in srgb, var(--info) 8%, transparent);
  --ff-tint-info-11: color-mix(in srgb, var(--info) 11%, transparent);
  --ff-tint-info-35: color-mix(in srgb, var(--info) 35%, transparent);
  --ff-tint-info-45: color-mix(in srgb, var(--info) 45%, transparent);
  --ff-tint-info-32-border: color-mix(in srgb, var(--info) 32%, var(--ff-border));
  --ff-tint-info-38-border: color-mix(in srgb, var(--info) 38%, var(--ff-border));
  --ff-tint-info-40-border: color-mix(in srgb, var(--info) 40%, var(--ff-border));
  --ff-tint-info-70-border: color-mix(in srgb, var(--info) 70%, var(--ff-border));
  --ff-tint-info-40-line: color-mix(in srgb, var(--info) 40%, var(--line));
  --ff-tint-info-45-line: color-mix(in srgb, var(--info) 45%, var(--line));
  --ff-tint-info-4-panel: color-mix(in srgb, var(--info) 4%, var(--panel));
  --ff-tint-info-5-panel: color-mix(in srgb, var(--info) 5%, var(--panel));
  --ff-tint-info-10-panel: color-mix(in srgb, var(--info) 10%, var(--panel));
  --ff-tint-info-11-panel2: color-mix(in srgb, var(--info) 11%, var(--panel2));
  --ff-tint-info-12-panel: color-mix(in srgb, var(--info) 12%, var(--panel));
  --ff-tint-info-12-panel2: color-mix(in srgb, var(--info) 12%, var(--panel2));
  --ff-tint-info-16-panel: color-mix(in srgb, var(--info) 16%, var(--panel));
  --ff-tint-info-18-panel: color-mix(in srgb, var(--info) 18%, var(--panel));
  --ff-tint-muted-8: color-mix(in srgb, var(--muted) 8%, transparent);
  --ff-tint-muted-40-line: color-mix(in srgb, var(--muted) 40%, var(--line));
  --ff-tint-warn-6: color-mix(in srgb, var(--warn) 6%, transparent);
  --ff-tint-warn-40-line: color-mix(in srgb, var(--warn) 40%, var(--line));
}
/* prophet-card verb inks. English keeps the original hue calibration; the light+zh
   twin below re-keys the percentages after bullish becomes red and bearish green.

   This :root block IS the dark plane. It is deliberately NOT written as
   html[data-theme="dark"]: every page's pre-paint head script is
   `var t=localStorage.getItem('theme'); if(t) setAttribute('data-theme',t)`, so a
   first-time visitor renders dark with NO data-theme attribute at all and a
   [data-theme="dark"] rule would match nothing for them. Light overrides these on
   specificity (html[data-theme="light"] is (0,1,1) vs :root's (0,1,0)), which is
   the only mechanism that needs to hold. Both ink harnesses set the attribute
   explicitly, so a dark rule keyed the wrong way measures GREEN in each of them
   while shipping dead on the site — do not "tidy" this into an attribute selector.

   --ink-pv-avoid is mixed rather than passed through because the pass-through
   FAILED: .pv-chip prints the verb on color-mix(--pvh 13%, --panel), a tint of the
   hue itself and therefore DARKER than --panel, and the raw dark #e06464 measured
   4.33:1 there — under AA for 10px/800 text. 88% lands it at 4.77 on the chip and
   5.04 on the thinner 9% target pill, the same margin band the light rungs sit in;
   94% is the bare minimum that clears 4.5 and was rejected as a hairline that the
   next palette nudge re-breaks. Hue drift is small by design: #e06464 -> #df7273.

   Systematic note, so a future palette edit does not re-open this: what is weak in
   dark is the HUE #e06464, not the verb. zh used to bind that same raw red straight
   to --pv-buy (红涨), which put the thinnest margin of any RETUNED verb on the dark
   plane — 4.57 on .pv-trg — on the Buy card of every Chinese board. C8-C's stance
   retune moved that off the raw hue (zh dark --pv-buy now resolves #de7a7b, .pv-trg
   5.21); the thinnest margin among the tokens this PR moves is now zh/dark Near at
   4.69 on the chip tint. That is NOT the plane's overall minimum and never was:
   .pv-hold sits lower at 4.61 on both dark quadrants (4.58 light), it carries no
   rung and no token change, and it is untouched here — see the .pv-hold note below.
   Pinned by tests/test_prophet_verb_ink_contrast.py, which measures all 5 verbs
   x 4 consumers x 4 theme/lang combos, so none of this can drift silently.
   .pv-hold has no rung here at all: it binds --pvh-ink straight to --pv-hold in
   _prophet_card.html.j2 (4.58 light / 4.61 dark — passing on every consumer). */
:root {
  --ink-pv-buy: var(--pv-buy); --ink-pv-near: var(--pv-near);
  --ink-pv-wait: var(--pv-wait);
  --ink-pv-avoid: color-mix(in srgb, var(--pv-avoid) 88%, var(--text));
}
html[data-theme="light"] {
  /* C8-C: buy and near pass through on the light plane too, because the deepening
     they used to get here now lives in the TOKEN (see the stance block above).
     Keeping both would mix toward --text twice — light --pv-buy at 54% re-mixed at
     62% lands the verb near a third of its own hue, a grey-green that no longer
     reads as a call. One deepening, declared once, at the token. */
  --ink-pv-buy:   var(--pv-buy);
  --ink-pv-near:  var(--pv-near);
  --ink-pv-wait:  color-mix(in srgb, var(--pv-wait)  62%, var(--text));
  --ink-pv-avoid: color-mix(in srgb, var(--pv-avoid) 84%, var(--text));
}
html[data-theme="light"][data-lang="zh"] {
  /* C8-C RETIRED the buy/near rungs that used to sit here (84% / 70%). They existed
     to repair a hand-keyed zh palette: --pv-near was `color-mix(--up 82%, #fff)`, a
     red pushed most of the way to WHITE, so its ink had to be deepened hard and buy
     and near needed two different percentages to stay in the right order. Neither
     token is hand-keyed any more — buy derives from the flipped --up, near derives
     from buy toward --muted — so the ramp's ordering (Near lighter than Buy) is now
     a property of the derivation rather than of two tuned numbers that a palette
     edit could invert. tests/test_prophet_verb_ink_contrast.py still pins both the
     AA floor and that ordering on this exact quadrant; re-measure with
     mockups/refs/prophet_verb_ink/probe_pv_ink.py. --pv-avoid keeps its rung
     because it is still a literal on this plane. */
  --ink-pv-avoid: color-mix(in srgb, var(--pv-avoid) 62%, var(--text));
}
/* W-L1 provisional plane (research/WL1_PROVISIONAL_BOARD_DESIGN_SPEC.md §4.1).
   Same hue as the P1 .pv-live chip's local --plvc, and that is the point: the ◐ strip
   and the ◐ board stamp name the SAME epistemic tier — settled by the tape, not yet by
   the record — and a second vocabulary for one idea is a tax on the reader.
   --prov is the FILL-grade hue (tints, rules, borders); --prov-ink is the TEXT-grade
   one, following this file's own --ink-* convention. Dark keeps ink ≡ raw so dark
   renders byte-identical to a single-token version; light deepens toward --text,
   because the fill-grade blue measured 4.22:1 as type on its own 11% tint over white —
   under AA, and invisible to anyone who only ever looked at the dark shot (doctrine
   §5.8: light is a design target, not a translation).
   Direction-neutral BY CONSTRUCTION so 红涨绿跌 holds: never derive it from --up/--down. */
:root { --prov: #62a0e8; --prov-ink: var(--prov); }
html[data-theme="light"] { --prov: #2f6fd0;
  --prov-ink: color-mix(in srgb, var(--prov) 82%, var(--text)); }
/* ---- Chinese mode: directional GAUGES that paint state from status tokens ----
   The status tokens --ok/--act deliberately DON'T swap (they encode health/danger, see
   above). But a few gauges are genuine market-DIRECTION reads (bullish vs bearish) that
   happen to colour themselves from --ok/--act — the Risk Radar (.rrx: --ok=calm/risk-on,
   --act=risk-off) and the Ignition Radar (.igx/.igs: --ok=ignited/breakout). Under the
   Asia convention these must read red=risk-on/bullish, green=risk-off/bearish — matching
   the price tables and the Market State board (which already swap via --up/--down). We
   remap ONLY the pole tokens, ONLY inside these gauge scopes, so global --ok/--act stay
   Western and every health/severity/staleness/validation signal keeps red=bad. --up/--down
   already carry correct dark+light zh values, so remapping onto them needs no hex here.
   (Mid-tones --warn/--orange/--info/--muted are direction-neutral escalation — left alone.) */
html[data-lang="zh"] .rrx { --ok: var(--up); --act: var(--down);
  --ink-ok: var(--ink-up); --ink-act: var(--ink-down); }
html[data-lang="zh"] :is(.igx, .igs) { --ok: var(--up); --ink-ok: var(--ink-up); }
/* ---- language visibility toggle (dual-emit text) ---------------------------- */
html:not([data-lang="zh"]) .l-zh { display: none; }
html[data-lang="zh"] .l-en { display: none; }
/* The locale bridge updates data-lang on initial load and when the reader switches.
   Inheriting the token also covers component labels that set font-family explicitly. */
html[data-lang="zh"] {
  --font-ui: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    "Noto Sans SC", "Source Han Sans SC", var(--font-ui-latin);
}
html[data-lang="zh"] body {
  font-family: var(--font-ui);
  line-height: 1.65;
  line-break: strict;
}
html[data-lang="zh"] :is(h1, h2, h3, h4, h5, h6) {
  letter-spacing: normal;
  line-height: 1.4;
}
html[data-lang="zh"] .eyebrow {
  letter-spacing: normal;
  line-height: 1.45;
}

a { color: var(--ink-link, var(--link)); }

/* ---- custom scrollbars ------------------------------------------------------
   One themed scrollbar for the whole site — the page scroll and every scroll
   container. The tint derives from --muted (via the --sb-* tokens up top) so it
   tracks dark / light / zh automatically; a transparent track plus a rounded
   pill inset by a padding-box border reads as a floating bar, not a heavy gutter.
   Element-scoped rules (.tbl-scroll, .lst-ovl-body, the mobile chip strips) carry
   a class and out-specificity these, so their bespoke treatment is preserved.
   Firefox uses the two standard properties; WebKit / Blink the pseudo-elements. */
* { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) transparent; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--sb-thumb); border-radius: 999px;
  border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--sb-thumb-hover); }
*::-webkit-scrollbar-thumb:active { background: var(--sb-thumb-active); }
*::-webkit-scrollbar-corner { background: transparent; }

/* Canonical UI font on every page. The `html body` selector has higher
   specificity than each page's own `body { font: 14px/1.5 -apple-system… }`
   shorthand, so it swaps the family while leaving font-size/line-height
   untouched. Uses the --font-ui token so all font-family declarations across
   the site resolve to one consistent stack. */
html body { font-family: var(--font-ui); font-size: 15px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ---- ambient aurora backdrop (site-wide) ------------------------------------
   The landing hub's soft accent washes, shared by every page. A fixed, full-
   viewport pseudo-element pinned behind all content (z-index:-1) — it paints
   over the opaque `body { background:var(--bg) }` but under the page's own
   content, so it reads as faint colour in the margins/gaps without touching
   legibility. Dark and light get SEPARATE tunings: richer, jewel-toned washes
   on the dark canvas; airier, lighter tints on the white canvas. Colours are
   fixed accents blended into transparent via color-mix, so only the alpha
   differs between themes. Non-animated, so no reduced-motion concern. */
html body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(680px 440px at 10% -8%, color-mix(in srgb, #416aec 20%, transparent), transparent 68%),
    radial-gradient(620px 440px at 94% 2%, color-mix(in srgb, #8b5cf6 16%, transparent), transparent 70%),
    radial-gradient(760px 520px at 50% 112%, color-mix(in srgb, #0ea5e9 14%, transparent), transparent 70%);
}
html[data-theme="light"] body::before {
  background:
    radial-gradient(680px 440px at 10% -8%, color-mix(in srgb, #416aec 9%, transparent), transparent 68%),
    radial-gradient(620px 440px at 94% 2%, color-mix(in srgb, #8b5cf6 8%, transparent), transparent 70%),
    radial-gradient(760px 520px at 50% 112%, color-mix(in srgb, #0ea5e9 7%, transparent), transparent 70%);
}

/* ---- Vector polish: airier cards + a little more headline hierarchy ---------
   Bitcoin Vector breathes more than this data-dense dashboard. These nudge (not
   restructure) toward its feel; `html body …` out-specifies each page's own
   element rules so no (i18n-heavy) template edits are needed. Both themes. */
html body .grid { gap: 18px; }
html body .panel { border-radius: 14px; padding: 16px 18px; }
html body .actcol, html body .mtf-card, html body .card { border-radius: 12px; }
html body h1 { font-size: 24px; }
html body .badge { font-size: 14px; padding: 4px 13px; }
html body .prob .pc { font-size: 18px; font-weight: 700; }

/* buttons — shared polish mirroring the landing's interactive feel: smooth
   transitions, a subtle lift + accent glow on hover, a pressed state, and a
   crisp keyboard focus ring. The accent is always --link (per theme); the
   red/green up-down semantics are never touched. */
/* .navbtn / .theme-btn — adopt the gbtn glass recipe in place (nav keeps its
   --link text identity; theme-btn reads quiet until hover). Frosted fill + inset
   sheen so both sit in the same family as the gbtn system and the glass menus. */
.navbtn, .theme-btn { transition: transform .16s ease, border-color .16s ease,
  color .16s ease, background .16s ease, box-shadow .25s ease; cursor: pointer;
  -webkit-backdrop-filter:blur(12px) saturate(140%); backdrop-filter:blur(12px) saturate(140%);
  box-shadow: inset 0 1px 0 var(--gbtn-sheen), 0 1px 2px rgba(3,7,18,.18); }
.navbtn { background: var(--gbtn-bg); border: 1px solid var(--gbtn-brd); color: var(--ink-link, var(--link));
  padding: 5px 14px; border-radius: 8px; font-size: 13px; }
.navbtn:hover { border-color: color-mix(in srgb, var(--link) 40%, var(--gbtn-brd-hover)); transform: translateY(-1px);
  background: var(--gbtn-bg-hover);
  box-shadow: inset 0 1px 0 var(--gbtn-sheen), 0 8px 20px -10px color-mix(in srgb, var(--link) 45%, transparent); }
.navbtn:active { transform: translateY(0) scale(.985); box-shadow: inset 0 1px 0 var(--gbtn-sheen); }
.theme-btn { background: var(--gbtn-bg); border: 1px solid var(--gbtn-brd);
  color: var(--muted); padding: 5px 11px; border-radius: 8px; font-size: 13px;
  line-height: 1; }
.theme-btn:hover { color: var(--text); border-color: var(--gbtn-brd-hover); transform: translateY(-1px);
  background: var(--gbtn-bg-hover);
  box-shadow: inset 0 1px 0 var(--gbtn-sheen), 0 8px 20px -10px rgba(3,7,18,.45); }
.theme-btn:active { transform: translateY(0) scale(.985); box-shadow: inset 0 1px 0 var(--gbtn-sheen); }

/* common page-local pill / action buttons — layer the same hover feel site-wide
   (additive: only transition + a hover accent border + soft glow), so each keeps
   its own base colours and its .on/.active fills. html-body specificity wins over
   a bare `.fbtn:hover` but loses to a two-class `.fbtn.on:hover`, so active
   states are left intact. */
html body :is(.tm-btn, .vtm-btn, .lang-btn, .wl-btn, .fbtn, .aff) {
  transition: transform .16s ease, border-color .16s ease, color .16s ease,
              background .16s ease, box-shadow .18s ease; }
html body :is(.tm-btn, .vtm-btn, .lang-btn, .wl-btn, .fbtn, .aff):hover {
  border-color: color-mix(in srgb, var(--link) 58%, var(--line));
  box-shadow: 0 4px 13px -5px color-mix(in srgb, var(--link) 40%, transparent); }
/* tabs / segmented controls — accent glow on hover, no lift (tabs shouldn't move) */
html body :is(.tabbtn, .segbtn, .brief-tab-btn) {
  transition: color .16s ease, border-color .16s ease, background .16s ease, box-shadow .18s ease; }
html body :is(.tabbtn, .segbtn, .brief-tab-btn):hover {
  box-shadow: 0 3px 10px -4px color-mix(in srgb, var(--link) 34%, transparent); }

/* clickable card / tile containers — the landing's hover light-up, shared: a
   gentle lift, an accent border and a soft accent glow. Additive (hover only),
   so each card keeps its own base layout. */
html body :is(a.actitem, a.idx-alloc, .nbcard, a.scard) {
  transition: transform .2s cubic-bezier(.2,.7,.3,1), border-color .2s ease, box-shadow .2s ease; }
html body :is(a.actitem, a.idx-alloc, .nbcard, a.scard):hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--link) 45%, var(--line));
  box-shadow: 0 14px 30px -16px color-mix(in srgb, var(--link) 40%, transparent); }

/* keyboard focus ring on interactive surfaces — accessible, and low-specificity
   (:where) so it never fights component styles; only shows for keyboard nav. */
:where(.navbtn, .theme-btn, .tm-btn, .vtm-btn, .lang-btn, .wl-btn, .fbtn, .tabbtn,
  .segbtn, .brief-tab-btn, .aff, .af-toggle, .sm-btn, .theme-switch, .lang-toggle,
  .ai-brief-link, .nav-link, .nav-dd-menu a, a.actitem, a.idx-alloc, .nbcard,
  a.scard):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--link) 70%, transparent); outline-offset: 2px; }

/* ── gbtn: house glass button system (macro sweep 2026-07) ────────────────────
   The codebase-wide default button. A frosted pill with a hairline border, an
   inset top sheen, a hover lift and a single diagonal sheen sweep — one family
   with the glass popovers. Variants: -pill (fully round) -sm/-lg (size)
   -quiet (chrome-less until hover) -icon (32px circle) -cta (breathing link halo)
   -warn / -up (semantic tint from the status tokens). Reduced-motion strips the
   sweep, the lift and the breathing. Tokens live in :root beside the glass set. */
.gbtn{ position:relative; overflow:hidden; display:inline-flex; align-items:center; justify-content:center; gap:7px;
  padding:7px 14px; border-radius:10px; border:1px solid var(--gbtn-brd);
  background:var(--gbtn-bg);
  -webkit-backdrop-filter:blur(12px) saturate(140%); backdrop-filter:blur(12px) saturate(140%);
  color:color-mix(in srgb, var(--text) 90%, transparent);
  font:600 12.5px/1 var(--font-ui); letter-spacing:.01em;
  box-shadow: inset 0 1px 0 var(--gbtn-sheen), 0 1px 2px rgba(3,7,18,.18);
  cursor:pointer; text-decoration:none; user-select:none; white-space:nowrap;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .16s ease, box-shadow .25s ease; }
.gbtn:hover{ background:var(--gbtn-bg-hover); border-color:var(--gbtn-brd-hover); color:var(--text);
  transform:translateY(-1px); box-shadow: inset 0 1px 0 var(--gbtn-sheen), 0 8px 20px -10px rgba(3,7,18,.55); }
.gbtn:active{ transform:translateY(0) scale(.985); }
.gbtn:focus-visible{ outline:2px solid var(--link); outline-offset:2px; }
.gbtn::after{ content:""; position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(105deg, transparent 40%, rgba(255,255,255,.13) 50%, transparent 60%);
  transform:translateX(-140%) skewX(-8deg); }
.gbtn:hover::after{ transform:translateX(140%) skewX(-8deg); transition:transform .55s ease; }
.gbtn-pill{ border-radius:999px; }
.gbtn-sm{ padding:5px 10px; font-size:11.5px; border-radius:8px; }
.gbtn-lg{ padding:10px 18px; font-size:13.5px; border-radius:12px; }
.gbtn-quiet{ border-color:transparent; background:transparent; backdrop-filter:none; -webkit-backdrop-filter:none; box-shadow:none; }
.gbtn-quiet:hover{ background:var(--gbtn-bg); border-color:var(--gbtn-brd); }
.gbtn-icon{ width:32px; height:32px; padding:0; border-radius:999px; }
.gbtn-cta{ border-color:color-mix(in srgb, var(--link) 45%, var(--gbtn-brd));
  background:linear-gradient(180deg, color-mix(in srgb, var(--link) 14%, var(--gbtn-bg)), var(--gbtn-bg));
  color:var(--text); animation:gbtnBreath 3.4s ease-in-out infinite; }
.gbtn-cta:hover{ border-color:var(--link); box-shadow: inset 0 1px 0 var(--gbtn-sheen), 0 8px 24px -10px color-mix(in srgb, var(--link) 55%, transparent); }
.gbtn-warn{ border-color:color-mix(in srgb, var(--warn) 45%, var(--gbtn-brd)); background:linear-gradient(180deg, color-mix(in srgb, var(--warn) 12%, var(--gbtn-bg)), var(--gbtn-bg)); }
.gbtn-up{ border-color:color-mix(in srgb, var(--up) 45%, var(--gbtn-brd)); background:linear-gradient(180deg, color-mix(in srgb, var(--up) 12%, var(--gbtn-bg)), var(--gbtn-bg)); }
@keyframes gbtnBreath{ 0%,100%{ box-shadow: inset 0 1px 0 var(--gbtn-sheen), 0 0 0 0 color-mix(in srgb, var(--link) 0%, transparent); }
  50%{ box-shadow: inset 0 1px 0 var(--gbtn-sheen), 0 0 18px -4px color-mix(in srgb, var(--link) 38%, transparent); } }
/* Perf: box-shadow breathing repaints on the MAIN THREAD every frame — measured
   ~4.5s of style/paint per 18s on a mid phone (2026-07-21 mobile audit). The
   .gbtn overflow:hidden clips any pseudo-element glow overlay, so touch devices
   simply hold the static resting state; desktop keeps the identical breathing. */
@media (pointer: coarse){ .gbtn-cta{ animation:none; } }
@media (prefers-reduced-motion: reduce){
  .gbtn::after{ display:none; } .gbtn, .gbtn:hover, .gbtn:active{ transform:none; } .gbtn-cta{ animation:none; } }

/* ── typography utilities (macro sweep 2026-07) ──────────────────────────────
   .tnum locks tabular figures so columns of numerals never jitter; .eyebrow is
   the house section-label treatment (spaced uppercase Inter). Both theme-safe. */
.tnum{ font-variant-numeric:tabular-nums; }
.eyebrow{ font:600 var(--fs-label)/1.35 var(--font-ui); letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }

/* ---- tinted semantic badges -------------------------------------------------
   Any element with one of these classes is tinted from its --c base color. */
.st-FRESH_BUY, .st-TURN_SIGNALED, .st-RALLY_ON, .st-BOTTOM_WATCH, .st-TOP_WATCH,
.st-ROLLING_OVER, .st-DECLINE, .st-COUNTERTREND_BOUNCE,
.state-STABLE, .state-WEAKENING, .state-TRANSITIONING, .state-NEW_REGIME,
.pill-ok, .pill-stale, .pill-failed, .pill-dead, .pill-blocked,
.tag-lead, .tag-avoid, .tag-watch, .chip-pos, .chip-neg,
.sig-p, .sig-m, .sig-i, .urgpill, .lad-tint {
  background: color-mix(in srgb, var(--c, var(--muted)) 12%, var(--panel));
  color: color-mix(in srgb, var(--c, var(--muted)) 86%, var(--text));
  border-color: color-mix(in srgb, var(--c, var(--muted)) 34%, transparent);
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
}
/* base-color assignments — bound to the text-grade INKS, not the raw fills:
   these chips carry their state in 9–15px text, and the raw light palette tops
   out at 2.9–3.6:1 there (ink ≡ raw under dark, so dark pixels are unchanged).
   The ink follows the zh 红涨绿跌 swap and the .rrx/.igx gauge remaps because
   --c resolves on the element. */
.st-FRESH_BUY, .st-RALLY_ON, .pill-ok, .tag-lead, .chip-pos, .sig-p,
.urgpill.urg-now { --c: var(--ink-up); }
.st-TURN_SIGNALED, .st-BOTTOM_WATCH, .tag-watch, .sig-i,
.urgpill.urg-imminent, .urgpill.urg-soon, .state-NEW_REGIME { --c: var(--ink-info); }
.st-TOP_WATCH, .pill-stale, .urgpill.urg-caution, .state-WEAKENING { --c: var(--ink-warn); }
.st-ROLLING_OVER, .st-COUNTERTREND_BOUNCE, .state-TRANSITIONING { --c: var(--ink-orange); }
.st-DECLINE, .pill-failed, .pill-dead, .tag-avoid, .chip-neg, .sig-m,
.urgpill.urg-exit, .urgpill.urg-avoid { --c: var(--ink-down); }
.pill-blocked, .state-STABLE, .urgpill.urg-hold, .urgpill.urg-later { --c: var(--muted); }

.pos { color: var(--ink-up); } .neg { color: var(--ink-down); }

/* advancing/declining mini-bar (market-breadth scorecard) */
.bbar { display:inline-flex; width:90px; height:7px; margin-left:8px; vertical-align:middle;
  border:1px solid var(--line); border-radius:4px; overflow:hidden; background:var(--panel2); }
.bbar i { display:block; height:100%; }

/* market snapshot tiles + VIX monitor (macro at-a-glance surfacing) */
.mtiles { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
@media (max-width:760px){ .mtiles { grid-template-columns:repeat(2,1fr); } }
.mtile { background:var(--panel2); border:1px solid var(--line); border-radius:9px; padding:10px 12px; }
.mtile-top { display:flex; justify-content:space-between; align-items:baseline; gap:6px; }
.mtile-lbl { font-size:12px; color:var(--muted); }
.mtile-tag { font-size:9px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); opacity:.65; white-space:nowrap; }
.mtile-val { font-size:20px; font-weight:700; margin:3px 0 1px; }
.mtile-chg { font-size:12px; }
.vixhead { display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; }
.vixnum { font-size:30px; font-weight:700; line-height:1; }
.vixstats { display:flex; gap:16px; flex-wrap:wrap; margin-top:8px; }
.badge.vix-muted { --c: var(--muted); } .badge.vix-warn { --c: var(--ink-warn); } .badge.vix-neg { --c: var(--ink-down); }

/* rotation-stage pills (heat board) — tinted like the badges */
.stg-improving, .stg-leading, .stg-weakening, .stg-lagging {
  background: color-mix(in srgb, var(--c) 15%, var(--panel));
  color: color-mix(in srgb, var(--c) 80%, var(--text));
}
.stg-improving { --c: var(--ink-info); } .stg-leading { --c: var(--ink-up); }
.stg-weakening { --c: var(--ink-warn); } .stg-lagging { --c: var(--ink-down); }

/* charts render on their own dark slate (set in build_site PLOT_LAYOUT); the
   wrapper just rounds the corners so they sit cleanly in either theme */
.chart, .tv { border-radius: 8px; overflow: hidden; }

/* multi-timeframe visual cards */
.mtf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-top: 8px; }
@media (max-width: 620px) { .mtf-grid { grid-template-columns: 1fr; } }
.mtf-card { background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; }
.mtf-h { font-size: 11px; font-weight: 700; letter-spacing: .08em;
  color: var(--muted); margin-bottom: 5px; }
.mtf-row { display: grid; grid-template-columns: 38px 1fr auto; align-items: center;
  gap: 7px; margin: 3px 0; }
.mtf-k { font-size: 11px; color: var(--muted); font-weight: 600; }
.mtf-v { font-size: 13px; font-weight: 700; text-align: right; display: flex;
  flex-direction: column; align-items: flex-end; line-height: 1.1; }
.mtf-v small { font-size: 9.5px; font-weight: 400; color: var(--muted); }

/* ---- site footer (shared signature, themed via vars) ---- */
.site-footer {
  max-width: 1500px;
  margin: 44px auto 16px;
  padding: 22px 16px 4px;
  border-top: 1px solid var(--line);
  text-align: center;
  line-height: 1.6;
  font-family: var(--font-ui);
}
.site-footer .made {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .2px;
}
.site-footer .dev {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  color: var(--muted);
}

/* ===================== unified macro nav =====================
   One bar across the macro dashboard family: section links · global stock
   search · animated theme + language toggles. The toggles are driven PURELY
   by the html[data-theme] / html[data-lang] attributes (theme.js just flips
   those), so no JS rewrites their markup. The legacy .theme-btn / .lang-btn
   remain for pages we are NOT restyling (Bitcoin Vector, hub, China). */
/* 2-column grid so the controls (theme + language toggles) sit in a fixed
   right-hand column that NEVER moves — the links wrap inside the left column and
   the search drops to a full-width row below, so switching language (which
   changes link-text widths) can't shift the toggles around. */
/* max-width + auto margins pin the bar to ONE consistent width on every page
   (matching .site-footer and the vector family's 1500px nav) — full-width macro
   dashboards and 1180px reading pages no longer make the menu jump width as you
   navigate between them. Below 1500px the cap is inert, so laptops see no change. */
.site-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; column-gap: 12px; row-gap: 9px; margin: 0 auto 16px;
  max-width: 1500px; }
/* the menu owns the full first row on its own (one clean line); the search +
   the Mastermind/Terminal/⚙ cluster share the second row. Keeping the links off
   the controls' column is what holds the bar to TWO rows — 7 dropdowns + brand
   no longer get squeezed into wrapping a third row beside the pills. */
.site-nav .nav-links { grid-column: 1 / -1; grid-row: 1; display: flex; flex-wrap: wrap;
  align-items: center; gap: 3px; min-width: 0; }
/* CLS: pre-collapse the mobile nav at PARSE time. theme.js injects the hamburger +
   flyout sheet on init, but that lands ~2s in on a phone — until then the full
   desktop menu (~258px tall at 412px wide) rendered expanded, then vanished:
   a 0.30 layout shift on every mobile load (2026-07-21 audit, the whole page
   jumped up). Same 900px breakpoint as theme.js's injected sheet; :not(.nav-open)
   keeps this inert once the flyout opens (JS toggles nav-open on .site-nav); the
   <noscript> re-expand in _navlinks.html.j2 preserves the no-JS fallback. */
@media (max-width: 900px){
  .site-nav:not(.nav-open) .nav-links { display: none; }
}
/* ── Brand lockup — the crafted Mastermind “M” logomark + MASTERMIND wordmark, the
   first item in the shared _navlinks list, pinned at the head of the menu bar and
   linking Home. The wordmark collapses on phones (≤560px); the full “Market
   Intelligence” lockup also lives on the landing hero. */
.site-nav .nav-brand { display: inline-flex; align-items: center; gap: 8px; flex: none;
  padding: 3px 10px 3px 4px; margin: 0 6px 0 0; border-radius: 11px; text-decoration: none;
  transition: background .18s, transform .16s ease; }
.site-nav .nav-brand:hover { background: color-mix(in srgb, var(--link) 11%, transparent);
  transform: translateY(-1px); }
.site-nav .nav-brand .brand-glyph { width: 29px; height: 29px; display: block; flex: none;
  filter: drop-shadow(0 2px 6px rgba(40,56,128,.34)); }
/* weight 900 (Inter Black — loaded via the @font-face rules at the top) + tight tracking so the
   wordmark reads as heavy as the logo glyph; line-height:1 so the all-caps ink centres
   on the glyph (the inherited 1.5 line-height left the caps sitting visibly high). */
.site-nav .nav-brand .brand-word { font-family: var(--font-ui);
  font-size: 13.5px; font-weight: 900; letter-spacing: .07em; line-height: 1;
  color: var(--text); white-space: nowrap; }
.site-nav a.nav-link { padding: 7px 11px; border-radius: 9px; font-size: 13.5px;
  font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap;
  transition: color .18s, background .18s; }
.site-nav a.nav-link:hover, .site-nav a.nav-link.active { color: var(--text);
  background: color-mix(in srgb, var(--link) 12%, var(--panel2)); }
/* nav dropdown (e.g. US Macro ▾ → dashboard + S&P / Macro Vector); mirrors the
   inline Bitcoin-Vector dropdown some pages already ship, themed via theme vars */
.site-nav .nav-dd { position: relative; display: inline-flex; }
.site-nav .nav-dd > a.nav-link .caret { display: inline-block; margin-left: 3px;
  font-size: 9px; opacity: .6; transition: transform .2s; }
.site-nav .nav-dd:hover > a.nav-link .caret { transform: rotate(180deg); }
.site-nav .nav-dd::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 9px; }
/* ── HEADER LAYER LAW ────────────────────────────────────────────────────────
   An open nav menu outranks EVERY page container and page popup. The site's
   layer ladder, low to high:

     page containers ............ z-index auto (flat — they never lift)
     lifted page content ........ 95   (#regime-radar.mx5-pop-open)
     page popovers .............. 100  (.mx5-popover)
     header search .............. 110  (.nav-search)
     page hover popups .......... 120  (.mx5-flipctx-pop, .ms-alerts-pop)
   >>> nav dropdowns / megas .... 150  (this rule + .nav-mega + .nav-panel-in 151)
     dialogs .................... 200+ (.mx5-dlg and the modal layers above it)

   This was 90, which lost to all four page layers above it. Only the Research
   `.nav-mega` had been raised to 150 (navigation-refresh.css) — the six market
   menus were left behind, so opening the regime popup (which lifts the hero
   card to 95) or simply having the search box overlap made the US/China/HK/
   Canada/International/Other-Assets panels paint UNDER page content. Fixing the
   families one at a time is what let this regress twice; the base rule now
   carries the whole nav family, and page content must never exceed 149. */
.site-nav .nav-dd-menu { position: absolute; top: calc(100% + 7px); left: 0; z-index: 150;
  min-width: 218px; background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd); border-radius: 14px;
  box-shadow: var(--glass-shadow); padding: 6px; opacity: 0; visibility: hidden;
  transform: translateY(-6px); transition: opacity .18s, transform .18s, visibility .18s; }
.site-nav .nav-dd:hover > .nav-dd-menu, .site-nav .nav-dd:focus-within > .nav-dd-menu {
  opacity: 1; visibility: visible; transform: translateY(0); }
.site-nav .nav-dd-menu a { display: block; padding: 9px 12px; border-radius: 9px; font-size: 13.5px;
  font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap;
  transition: color .18s, background .18s; }
.site-nav .nav-dd-menu a:hover { color: var(--text); }

/* US Macro submenu — CSS-only dropdown (hover + focus-within for keyboard), shared
   across every .site-nav page. Houses the factor/index lab (factors, baskets,
   seasonality) under the US Macro entry without crowding the flat bar. */
.nav-dd { position: relative; display: inline-flex; }
.nav-dd > a.nav-link .caret { display: inline-block; margin-left: 3px; font-size: 9px; opacity: .6;
  transition: transform .2s; }
.nav-dd:hover > a.nav-link .caret, .nav-dd:focus-within > a.nav-link .caret { transform: rotate(180deg); }
.nav-dd::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 9px; } /* hover gap bridge */
.nav-dd-menu { position: absolute; top: calc(100% + 7px); left: 0; min-width: 232px; background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd); border-radius: 14px; box-shadow: var(--glass-shadow); padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  /* 150 = the nav layer (see HEADER LAYER LAW above). Was 70, which lost to the
     same four page layers the .site-nav family lost to; the generic header
     families (.topbar and friends) inherit the fix from here. */
  z-index: 150; }
.nav-dd:hover > .nav-dd-menu, .nav-dd:focus-within > .nav-dd-menu { opacity: 1; visibility: visible;
  transform: translateY(0); }
.nav-dd-menu a { display: block; padding: 8px 11px; border-radius: 9px; font-size: 13px; font-weight: 500;
  color: var(--text); text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.nav-dd-menu a .d { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 1px; }
.nav-dd-menu a:hover, .nav-dd-menu a.active { color: var(--text); }
/* 3rd tier: a .nav-dd nested inside a .nav-dd-menu (Other Assets ▸ Bitcoin
   Vector / Commodities). On desktop the child menu flies out to the right of
   its row; ::after bridges the gap so the cursor can cross into it. */
.nav-dd-menu .nav-sub { display: block; position: relative; }
/* flex-start (not center): the trigger is a two-line row — .nav-sub-text (the
   emoji+title+.d column) on the left, the ▸ caret on the right. flex-start
   top-aligns the text column while the caret stays vertically centered via
   align-self. The emoji lives INSIDE .nav-sub-text (not as a flex sibling) so
   the block .d description wraps to the column's left edge, aligning under the
   emoji exactly like the leaf links. */
.nav-dd-menu .nav-sub > a.nav-sub-trig { display: flex; align-items: flex-start; gap: .3em; }
.nav-dd-menu .nav-sub > a.nav-sub-trig .caret-r { margin-left: auto; padding-left: 12px; font-size: 10px;
  opacity: .55; flex: none; align-self: center; transition: transform .2s, color .2s, opacity .2s, filter .2s; }
/* breathe only while the dropdown is open (hover/focus) and only on hover-capable
   devices with motion allowed — never on hidden carets (perf), and never on the
   mobile accordion where a running animation's transform would clobber theme.js's
   rotate(90deg) open-state. The .nav-sub:hover glow below wins by source order. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .nav-dd:hover .nav-sub > a.nav-sub-trig .caret-r,
  .nav-dd:focus-within .nav-sub > a.nav-sub-trig .caret-r { animation: navCaretBreath 2.6s ease-in-out infinite; } }
.nav-dd-menu .nav-sub:hover > a.nav-sub-trig .caret-r { animation: none; opacity: 1; transform: translateX(3px);
  color: var(--ink-link, var(--link, var(--blue, #5b9dff)));
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--link, var(--blue, #5b9dff)) 65%, transparent)); }
/* nav-sub-text: emoji+title+description column inside the flex .nav-sub-trig row
   — makes fly-out triggers visually identical to leaf links while the flex
   layout keeps the ▸ caret right-aligned. */
.nav-dd-menu .nav-sub > a.nav-sub-trig .nav-sub-text { display: block; flex: 1; min-width: 0; white-space: normal; }
.nav-dd-menu .nav-sub > .nav-dd-menu { top: -7px; left: 100%; z-index: 95;
  /* The 2nd-tier .nav-dd-menu already has backdrop-filter, making it a backdrop
     root — so this nested fly-out's own backdrop-filter can't reach & blur the
     page behind it, and the translucent --glass-bg alone reads as see-through.
     Give it a denser near-opaque fill so it matches the 2nd tier's frosted density. */
  background: color-mix(in srgb, var(--panel) 96%, transparent); }
.nav-dd-menu .nav-sub::after { content: ""; position: absolute; top: 0; left: 100%; width: 12px; height: 100%; }

/* ── Aurora-glass hover ───────────────────────────────────────────────────────
   Animated frosted hover for dropdown items: a soft blue→violet aurora wash
   (::before, opacity-faded) plus a luminous left accent bar (::after) and a 2px
   glide. Excludes the Research mega cards (.nm-feat / .nav-mega-item) — they keep
   their own hover. Accent falls back --link → --blue → #5b9dff so the identical
   rule serves the macro family (this file) and the self-contained vector family
   (mirrored in _vector_polish.html.j2). .active = the current-page item, lit the
   same way. The old flat hover fill was removed above so only this wash paints. */
.nav-dd-menu a:not(.nm-feat):not(.nav-mega-item) { position: relative; isolation: isolate;
  transition: transform .24s cubic-bezier(.2,.7,.3,1), color .18s; }
.nav-dd-menu a:not(.nm-feat):not(.nav-mega-item)::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: 0;
  transition: opacity .3s ease;
  background:
    radial-gradient(130% 150% at 0% 50%, color-mix(in srgb, var(--link, var(--blue, #5b9dff)) 18%, transparent), transparent 62%),
    linear-gradient(90deg, color-mix(in srgb, var(--link, var(--blue, #5b9dff)) 10%, transparent), color-mix(in srgb, #9b8cff 7%, transparent) 70%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent); }
.nav-dd-menu a:not(.nm-feat):not(.nav-mega-item)::after {
  content: ""; position: absolute; left: 3px; top: 50%; transform: translateY(-50%);
  height: 0; width: 2.5px; border-radius: 3px; z-index: -1; opacity: 0;
  background: linear-gradient(color-mix(in srgb, var(--link, var(--blue, #5b9dff)) 90%, #fff), #9b8cff);
  box-shadow: 0 0 8px color-mix(in srgb, var(--link, var(--blue, #5b9dff)) 70%, transparent);
  transition: height .3s cubic-bezier(.2,.7,.3,1), opacity .3s ease; }
.nav-dd-menu a:not(.nm-feat):not(.nav-mega-item):hover { transform: translateX(2px); }
.nav-dd-menu a:not(.nm-feat):not(.nav-mega-item):hover::before,
.nav-dd-menu a:not(.nm-feat):not(.nav-mega-item).active::before { opacity: 1; }
.nav-dd-menu a:not(.nm-feat):not(.nav-mega-item):hover::after,
.nav-dd-menu a:not(.nm-feat):not(.nav-mega-item).active::after { height: 56%; opacity: 1; }
@keyframes navCaretBreath { 0%,100% { opacity: .45; transform: translateX(0); } 50% { opacity: .9; transform: translateX(2px); } }
@media (prefers-reduced-motion: reduce) {
  .nav-dd-menu .nav-sub > a.nav-sub-trig .caret-r { animation: none; }
  .nav-dd-menu a:not(.nm-feat):not(.nav-mega-item):hover { transform: none; }
  .nav-dd-menu a:not(.nm-feat):not(.nav-mega-item)::after { transition: none; } }

@media (max-width: 560px) {   /* no hover on touch — render the submenu inline-expanded */
  .nav-dd { display: block; }
  .nav-dd > a.nav-link .caret { display: none; }
  .nav-dd-menu { position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; padding: 1px 0 4px 16px; min-width: 0; }
  .nav-dd-menu a { padding: 5px 8px; font-size: 12.5px; }
  .nav-dd-menu a .d { display: none; }
}
/* Pre-JS / no-JS overflow guard for the .site-nav family. theme.js loads at the
   END of <body> and only then adds .has-nav-toggle, whose 0,3,0-specificity rules
   collapse the dropdowns into the hamburger. Until it runs, the FIRST paint shows
   the un-collapsed bar — and the closed .nav-dd-menu panels are still
   position:absolute; min-width:218px, so on a phone they stick out past the
   viewport and force documentElement.scrollWidth wider than the screen, clipping
   page content (a horizontal-overflow flash on every load; also the permanent
   state if JS fails). The generic ≤560 collapse above can't neutralise this
   because `.site-nav .nav-dd-menu{position:absolute}` (0,2,0) out-specificities its
   bare `.nav-dd-menu` (0,1,0). Mirror the hamburger's closed state at the same
   ≤900px range: fold the dropdowns in-flow (stacked, zero-height) so nothing
   overflows. Once theme.js runs its has-nav-toggle rules (0,3,0) win and this goes
   inert; desktop (>900px) is untouched, so hover fly-outs are unaffected. */
@media (max-width: 900px) {
  .site-nav .nav-dd { display: block; }
  .site-nav .nav-dd-menu { position: static; min-width: 0; max-height: 0;
    overflow: hidden; transform: none; box-shadow: none; border: 0; background: transparent; }
}

/* global stock search */
.nav-search { grid-column: 1; grid-row: 2; position: relative; min-width: 0; max-width: 480px; }
.nav-search .mag { position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  font-size: 12px; opacity: .65; pointer-events: none; }
.nav-search input { width: 100%; box-sizing: border-box; padding: 8px 12px 8px 32px;
  border-radius: 10px; border: 1px solid color-mix(in srgb, #416aec 30%, var(--line));
  background: var(--panel2);
  color: var(--text); font: inherit; font-size: 13px; outline: none;
  box-shadow: 0 0 5px 0 rgba(65,106,236,.10);
  transition: border-color .18s, box-shadow .25s ease; }
/* idle: a calm #416aec glow that breathes in and out, drawing the eye to the
   search. Stops dead on focus so typing feels solid and steady.
   Perf: the glow lives on a pseudo whose ONLY animated property is opacity —
   compositor-run, zero per-frame style/paint. Never animate box-shadow or
   border-color here: that repaints the nav on the main thread every frame
   (~measured seconds of phone CPU per minute, 2026-07-21 mobile audit). */
.nav-search::after { content: ""; position: absolute; inset: 0; border-radius: 10px;
  border: 1px solid #416aec;
  box-shadow: 0 0 0 3px rgba(65,106,236,.22), 0 0 16px 2px rgba(65,106,236,.38);
  opacity: 0; pointer-events: none;
  animation: mmGlowBreathe 3.8s ease-in-out infinite; }
.nav-search:focus-within::after { animation: none; opacity: 0; }
/* shared compositor-only breathing ramp — reused by page-level glow pulses */
@keyframes mmGlowBreathe { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
.nav-search input::placeholder { color: var(--muted); }
.nav-search input:focus { border-color: var(--link); box-shadow: none; }
.nav-sugg { position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 80;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd); border-radius: 13px; overflow: hidden;
  overflow-y: auto; max-height: 60vh; box-shadow: var(--glass-shadow); display: none; }
.nav-sugg.show { display: block; }
.nav-sugg .row { display: flex; align-items: center; gap: 9px; padding: 8px 12px; cursor: pointer; }
.nav-sugg .row:hover, .nav-sugg .row.sel { background: color-mix(in srgb, var(--link) 12%, var(--panel2)); }
/* leading market flag (US / China / HK / Canada / Intl) on the unified universe search */
.nav-sugg .row .mkt { flex: none; width: 20px; text-align: center; font-size: 13px; line-height: 1; }
.nav-sugg .row b { min-width: 58px; font-size: 13px; color: var(--text); font-weight: 600; }
.nav-sugg .row small { flex: 1; color: var(--muted); font-size: 12px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.nav-sugg .row .stt { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 6px;
  white-space: nowrap; }
.nav-sugg .empty { padding: 11px 13px; color: var(--muted); font-size: 12.5px; }

/* ---- responsive data tables ------------------------------------------------
   Wide data tables (screeners, scoreboards, flow tables) are wrapped by theme.js
   in this container so they scroll horizontally WITHIN their card on narrow screens
   instead of bleeding past the viewport. width:100% tables keep filling the card on
   desktop (content fits, no scroll); only genuine overflow scrolls. The thin styled
   scrollbar hints the table is scrollable. */
.tbl-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain; }
.tbl-scroll::-webkit-scrollbar { height: 6px; }
.tbl-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }

/* ---- live table filter (injected by tablesort.js into long data tables) -----
   The little searchbar that auto-appears above any scorecard / data table with
   ≥12 rows (Data health, screeners, …). Built as <div.tbl-filter><input
   type=search><span.cnt>. Mirrors .nav-search so it feels native to the page
   rather than a naked browser input. */
.tbl-filter { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px;
  flex-wrap: wrap; }
.tbl-filter input[type="search"] {
  appearance: none; -webkit-appearance: none; /* search fields ignore border/radius otherwise */
  flex: 0 1 280px; min-width: 0; box-sizing: border-box;
  padding: 7px 12px 7px 32px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 13px;
  outline: none; transition: border-color .18s, box-shadow .25s ease;
  background: var(--panel2)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b94a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E")
    no-repeat 10px 50%;
  background-size: 14px; }
.tbl-filter input[type="search"]::placeholder { color: var(--muted); }
.tbl-filter input[type="search"]:hover { border-color: color-mix(in srgb, var(--link) 45%, var(--line)); }
.tbl-filter input[type="search"]:focus { border-color: var(--link);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 20%, transparent); }
.tbl-filter .cnt { font-size: 12px; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap; }

.site-nav .nav-ctrls { grid-column: 2; grid-row: 2; justify-self: end; align-self: center;
  display: flex; align-items: center; gap: 10px; }

/* Mastermind + Terminal nav pills — rebuilt on the gbtn glass recipe (macro sweep
   2026-07). Both are frosted glass pills with an inset sheen and a diagonal sheen
   sweep on hover, so they read as one family with the rest of the button system.
   Mastermind (base) carries the -cta breathing link halo — the single "enter the
   brain" signature in the nav; Terminal keeps its link-tinted "outbound door"
   identity, no breathing (one breathing element only). Class names unchanged so
   every page's nav upgrades at once. */
.nav-ctrls .ai-brief-link { position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; flex: none; padding: 6px 13px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--link) 45%, var(--gbtn-brd));
  background: linear-gradient(180deg, color-mix(in srgb, var(--link) 14%, var(--gbtn-bg)), var(--gbtn-bg));
  -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%);
  color: var(--text);
  font-size: 12.5px; font-weight: 600; letter-spacing: .1px; line-height: 1; cursor: pointer;
  box-shadow: inset 0 1px 0 var(--gbtn-sheen), 0 1px 2px rgba(3,7,18,.18);
  animation: gbtnBreath 3.4s ease-in-out infinite;
  transition: background .2s, border-color .2s, color .2s, transform .16s ease, box-shadow .25s ease; }
.nav-ctrls .ai-brief-link::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.13) 50%, transparent 60%);
  transform: translateX(-140%) skewX(-8deg); }
.nav-ctrls .ai-brief-link:hover::after { transform: translateX(140%) skewX(-8deg); transition: transform .55s ease; }
.nav-ctrls .ai-brief-link:hover { border-color: var(--link); color: var(--text); transform: translateY(-1px);
  background: linear-gradient(180deg, color-mix(in srgb, var(--link) 22%, var(--gbtn-bg)), var(--gbtn-bg));
  box-shadow: inset 0 1px 0 var(--gbtn-sheen), 0 8px 24px -10px color-mix(in srgb, var(--link) 55%, transparent); }
.nav-ctrls .ai-brief-link:active { transform: translateY(0) scale(.985); box-shadow: inset 0 1px 0 var(--gbtn-sheen); }
.nav-ctrls .ai-brief-link.active { border-color: var(--link);
  background: linear-gradient(180deg, color-mix(in srgb, var(--link) 26%, var(--gbtn-bg)), var(--gbtn-bg)); }
/* Terminal entry — the live Mastermind Terminal (app.mastermind-x.com). Link-tinted
   glass fill + --link text mark it as the one outbound door to the live app. It
   overrides the base's breathing (steady) and re-tints its resting fill. */
.nav-ctrls .ai-brief-link.terminal-link {
  border-color: color-mix(in srgb, var(--link) 55%, var(--gbtn-brd)); color: var(--ink-link, var(--link));
  background: linear-gradient(180deg, color-mix(in srgb, var(--link) 12%, var(--gbtn-bg)), color-mix(in srgb, var(--link) 6%, var(--gbtn-bg)));
  animation: none; }
.nav-ctrls .ai-brief-link.terminal-link:hover { color: #fff; border-color: var(--link);
  background: linear-gradient(180deg, color-mix(in srgb, var(--link) 88%, transparent), var(--link));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 8px 24px -10px color-mix(in srgb, var(--link) 60%, transparent); }
/* Perf: box-shadow breathing = main-thread repaint per frame; touch devices hold
   the resting state (see .gbtn-cta note; 2026-07-21 mobile audit). The nav-search
   pseudo-breathe is compositor-only, so it stays on for touch. */
@media (pointer: coarse){
  .nav-ctrls .ai-brief-link { animation: none; } }
@media (prefers-reduced-motion: reduce){
  .nav-ctrls .ai-brief-link { animation: none; transform: none; }
  .nav-ctrls .ai-brief-link::after { display: none; }
  .nav-search::after { animation: none; opacity: 0; }
  .nav-ctrls .ai-brief-link:hover { transform: none; } }

/* AI Daily Brief entry card — the single in-page doorway to the cross-asset LLM
   synthesis page (aibrief.html). Replaces the old inline AI Master Brief panel on the
   macro / China / Hong Kong / Bitcoin dashboards. Rendered as a clickable .panel/.card. */
.aibrief-card { display: flex; align-items: center; gap: 14px; text-decoration: none;
  color: inherit; border-left: 3px solid var(--link); cursor: pointer;
  transition: border-color .15s, transform .16s ease, box-shadow .18s ease; }
.aibrief-card:hover { transform: translateY(-1px);
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--link) 42%, transparent); }
.aibrief-card .abc-ic { font-size: 30px; line-height: 1; flex: none; }
.aibrief-card .abc-mid { flex: 1; min-width: 0; }
.aibrief-card .abc-tit { display: block; font-size: 16px; font-weight: 700; }
.aibrief-card .abc-sub { display: block; margin-top: 2px; }
.aibrief-card .abc-go { font-size: 22px; font-weight: 700; color: var(--ink-link, var(--link)); flex: none; }

/* animated dark / light switch — slides on html[data-theme] */
.theme-switch { width: 56px; height: 27px; border-radius: 999px; background: var(--panel2);
  border: 1px solid var(--line); position: relative; cursor: pointer; padding: 0; flex: none;
  transition: border-color .18s ease, box-shadow .18s ease; }
.theme-switch:hover, .lang-toggle:hover { border-color: color-mix(in srgb, var(--link) 55%, var(--line));
  box-shadow: 0 3px 11px -5px color-mix(in srgb, var(--link) 40%, transparent); }
.theme-switch .ic { position: absolute; top: 50%; transform: translateY(-50%); font-size: 10.5px;
  opacity: .5; line-height: 1; }
/* Place each static icon UNDER where the knob rests for its mode: the knob sits
   left in dark (shows 🌙) and slides right in light (shows ☀️). So the moon goes
   left and the sun goes right — the knob then covers the icon it duplicates,
   leaving the OTHER icon visible. (Previously both were on the wrong side, so the
   knob's ☀️ + the static ☀️ showed two suns in light mode.) */
.theme-switch .ic.sun { right: 8px; } .theme-switch .ic.moon { left: 8px; }
.theme-switch .knob { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px;
  border-radius: 50%; background: #e8c15a; display: flex; align-items: center; justify-content: center;
  font-size: 11px; box-shadow: 0 2px 5px rgba(0,0,0,.3);
  transition: transform .34s cubic-bezier(.34, 1.45, .5, 1), background .3s; }
.theme-switch .knob::before { content: "🌙"; }
html[data-theme="light"] .theme-switch .knob { transform: translateX(29px); background: #285fff; }
html[data-theme="light"] .theme-switch .knob::before { content: "☀️"; }

/* animated EN / 中文 segmented toggle — slides on html[data-lang] */
.lang-toggle { display: inline-flex; position: relative; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px; flex: none; cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease; }
.lang-toggle .pill { position: absolute; top: 3px; left: 3px; width: calc(50% - 3px);
  height: calc(100% - 6px); border-radius: 999px; background: var(--link);
  transition: transform .34s cubic-bezier(.34, 1.4, .5, 1); }
html[data-lang="zh"] .lang-toggle .pill { transform: translateX(100%); }
.lang-toggle .opt { position: relative; z-index: 1; min-width: 28px; text-align: center;
  padding: 3px 9px; font-size: 11.5px; font-weight: 600; color: var(--muted); transition: color .25s;
  user-select: none; }
html:not([data-lang="zh"]) .lang-toggle .en-opt { color: #fff; }
html[data-lang="zh"] .lang-toggle .zh-opt { color: #fff; }

/* ===================== readability restructure components =====================
   Shared by the stock analyzer and the sector-ETF pages: a bold VERDICT hero and
   an at-a-glance SIGNAL-CHIP strip so the call + the technical picture read in a
   few seconds. Colours resolve from the theme vars at paint time, so light/dark
   and the zh red/green swap both apply automatically. */
.verdict { display: flex; align-items: center; gap: 14px 16px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: 14px; background: var(--panel2);
  border: 1px solid var(--line); border-left: 6px solid var(--c, var(--muted));
  margin: 12px 0 14px; }
.verdict .v-act { font-size: 23px; font-weight: 800; line-height: 1.05;
  letter-spacing: .005em; color: var(--c, var(--text)); white-space: nowrap; }
.verdict .v-tag { font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; padding: 4px 11px; border-radius: 8px; white-space: nowrap;
  background: color-mix(in srgb, var(--c, var(--muted)) 18%, var(--panel));
  color: color-mix(in srgb, var(--c, var(--muted)) 85%, var(--text));
  border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 35%, transparent); }
.verdict .v-text { flex: 1; min-width: 220px; font-size: 14.5px; line-height: 1.45;
  color: var(--text); }
.verdict .v-text b { color: var(--c, var(--text)); }
/* urgency → accent colour (mirrors the entrybar mapping, one source here).
   Ink-grade: .v-act and .v-text b print --c as text (23px/800 clears at 3:1,
   but light --up only reaches 3.0 on the darkest estate surface). */
.verdict.urg-now    { --c: var(--ink-up); }
.verdict.urg-imminent, .verdict.urg-soon { --c: var(--g-cold); }
.verdict.urg-caution { --c: var(--ink-warn); }
.verdict.urg-exit, .verdict.urg-avoid { --c: var(--ink-down); }
.verdict.urg-hold, .verdict.urg-later { --c: var(--muted); }

.sigstrip { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.sigchip { display: flex; flex-direction: column; gap: 1px; padding: 8px 13px;
  border-radius: 11px; background: var(--panel2); border: 1px solid var(--line);
  min-width: 104px; }
.sigchip .sc-k { font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; }
.sigchip .sc-v { font-size: 15px; font-weight: 800; line-height: 1.15; color: var(--text); }
.sigchip .sc-s { font-size: 10.5px; font-weight: 500; color: var(--muted); }
.sigchip.up   { border-color: color-mix(in srgb, var(--ink-up) 42%, transparent);
  background: color-mix(in srgb, var(--ink-up) 9%, var(--panel)); }
.sigchip.up   .sc-v { color: var(--ink-up); }
.sigchip.down { border-color: color-mix(in srgb, var(--ink-down) 42%, transparent);
  background: color-mix(in srgb, var(--ink-down) 9%, var(--panel)); }
.sigchip.down .sc-v { color: var(--ink-down); }
.sigchip.warn { border-color: color-mix(in srgb, var(--ink-warn) 42%, transparent);
  background: color-mix(in srgb, var(--ink-warn) 10%, var(--panel)); }
.sigchip.warn .sc-v { color: var(--ink-warn); }

/* ===================== alert feed (.af-*) =====================
   Cloned from the Bitcoin Vector alert timeline (.tl-*), re-themed to the shared
   vars and shared by the stock + sector pages. The node colour encodes DIRECTION
   (var(--up)/--down, so it swaps in zh mode); severity only drives sort order. */
.af-toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  padding: 6px 13px; border-radius: 10px; font-size: 13px; font-weight: 700; line-height: 1;
  transition: transform .16s ease, border-color .16s ease, color .16s ease,
              background .16s ease, box-shadow .18s ease; }
.af-toggle:hover { border-color: var(--link); transform: translateY(-1px);
  box-shadow: 0 5px 14px -5px color-mix(in srgb, var(--link) 42%, transparent); }
.af-toggle:active { transform: translateY(0); box-shadow: none; }
.af-toggle[aria-expanded="true"] { border-color: var(--link); color: var(--ink-link, var(--link));
  background: color-mix(in srgb, var(--link) 10%, var(--panel2)); }
/* count ink: var(--bg), not #fff — white on the dark theme's #e05555 is 3.75:1
   at 11px/800; near-black passes (6.1) and light's near-white is visually the
   white it always was (4.9). The solid urgent-red pill identity is kept. */
.af-toggle .af-badge { background: var(--act); color: var(--bg); font-size: 11px; font-weight: 800;
  min-width: 18px; text-align: center; padding: 1px 6px; border-radius: 9px; }
.af-toggle .af-caret { font-size: 10px; opacity: .6; transition: transform .2s; }
.af-toggle[aria-expanded="true"] .af-caret { transform: rotate(180deg); }

/* --- floating alert popover -------------------------------------------------
   The feed no longer expands in place (which shoved the page down and read as
   "the content vanished"). It now floats out of the 🔔 toggle as an anchored
   popover that OVERLAYS the page — the underlying content never moves, so the
   user keeps their place. A soft scrim dims (not hides) the page behind it and
   gives a click-away target. Shared by the stock + sector pages. */
.af-wrap { position: relative; display: inline-flex; }
.af-scrim { position: fixed; inset: 0; z-index: 90; background: transparent;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .22s ease, visibility 0s linear .22s; }
.af-scrim.af-open { opacity: 1; visibility: visible; pointer-events: auto;
  background: color-mix(in srgb, var(--bg) 30%, transparent);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  transition: opacity .22s ease; }

/* JS pins top/left/transform-origin on open so the panel grows straight out of
   the bell and is always clamped on-screen (the toggle can wrap anywhere in the
   header); top/right here are just the no-JS fallback. */
.af { position: fixed; top: 64px; right: 14px; z-index: 100;
  width: min(470px, calc(100vw - 24px));
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd); border-radius: 16px;
  box-shadow: var(--glass-shadow);
  transform-origin: top right; transform: translateY(-7px) scale(.95); opacity: 0;
  visibility: hidden; pointer-events: none;
  transition: opacity .19s ease, transform .24s cubic-bezier(.18,.9,.32,1.12),
              visibility 0s linear .24s; }
.af.af-open { opacity: 1; transform: translateY(0) scale(1);
  visibility: visible; pointer-events: auto;
  transition: opacity .19s ease, transform .24s cubic-bezier(.18,.9,.32,1.12); }
.af-bar { display: flex; align-items: center; gap: 9px; padding: 12px 15px 11px;
  border-bottom: 1px solid var(--line); }
.af-bar-t { font-size: 13.5px; font-weight: 800; color: var(--text);
  flex: 1; min-width: 0; }
.af-x { display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--muted); font-size: 13px; cursor: pointer;
  line-height: 1; transition: color .15s, border-color .15s, background .15s; }
.af-x:hover { color: var(--text); border-color: var(--link); }
.af-body { padding: 13px 15px 15px; max-height: min(62vh, 540px); overflow-y: auto;
  overscroll-behavior: contain; border-radius: 0 0 14px 14px; }
.af-body > :last-child { margin-bottom: 0; }

@media (max-width: 560px) {
  /* phone: rise from the bottom as a sheet instead of a corner dropdown */
  .af { position: fixed; left: 50%; right: auto; top: auto; bottom: env(safe-area-inset-bottom, 0);
    width: 100%; max-width: 540px; border-radius: 16px 16px 0 0;
    transform-origin: bottom center; transform: translate(-50%, 16px) scale(1); }
  .af.af-open { transform: translate(-50%, 0) scale(1); }
  .af-body { max-height: 68vh; border-radius: 0; }
  .af-scrim.af-open { background: color-mix(in srgb, var(--bg) 52%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .af { transition: opacity .15s ease, visibility 0s linear .15s; transform: none; }
  .af.af-open { transform: none; transition: opacity .15s ease; }
  .nav-search input { animation: none; }
  /* hover lifts collapse to a static accent (keep colour/shadow, drop the move) */
  .navbtn:hover, .theme-btn:hover, .af-toggle:hover, .nav-ctrls .ai-brief-link:hover,
  html body :is(a.actitem, a.idx-alloc, .nbcard, a.scard):hover { transform: none; }
}

/* pinned standing read — the ladder's current call, top of the feed */
.af-pin { border: 1px solid color-mix(in srgb, var(--c, var(--info)) 32%, var(--line));
  background: color-mix(in srgb, var(--c, var(--info)) 8%, var(--panel));
  border-left: 4px solid var(--c, var(--info)); border-radius: 12px;
  padding: 11px 14px; margin-bottom: 14px; }
.af-pin.dir-up { --c: var(--ink-up); } .af-pin.dir-down { --c: var(--ink-down); }
.af-pin.dir-neutral { --c: var(--muted); }
.af-pin .af-pin-h { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.af-pin .af-pin-tag { font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--c, var(--info)); }
.af-pin .af-pin-title { font-size: 15.5px; font-weight: 800; color: var(--text); }
.af-pin .af-pin-d { margin: 5px 0 0; font-size: 13px; color: var(--muted); line-height: 1.55; }

.af-filters { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.aff { padding: 5px 13px; border-radius: 9px; background: var(--panel2); color: var(--muted);
  font-weight: 700; font-size: 12.5px; cursor: pointer; border: 1px solid var(--line); }
.aff:hover { color: var(--text); }
.aff.active { background: var(--link); color: #fff; border-color: var(--link); }

.af-day { margin-bottom: 16px; }
.af-date { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; margin: 0 0 8px; }
.af-item { border-left: 2px solid var(--line); padding: 0 0 0 18px; margin-left: 6px;
  position: relative; }
.af-item > summary { display: flex; align-items: center; gap: 10px; padding: 8px 0;
  cursor: pointer; list-style: none; flex-wrap: wrap; }
.af-item > summary::-webkit-details-marker { display: none; }
.af-item[hidden] { display: none; }
.af-node { position: absolute; left: -7px; top: 14px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--muted); border: 2px solid var(--panel); }
.af-node.dir-up { background: var(--up); } .af-node.dir-down { background: var(--down); }
.af-node.dir-neutral { background: var(--muted); }
.af-item.pinned > summary .af-node { box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 30%, transparent); }
.af-chip { font-size: 10.5px; font-weight: 700; padding: 2px 9px; border-radius: 7px;
  background: color-mix(in srgb, var(--c, var(--muted)) 16%, var(--panel));
  color: color-mix(in srgb, var(--c, var(--muted)) 82%, var(--text));
  border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 28%, transparent); white-space: nowrap; }
.af-chip.f-signal   { --c: var(--ink-info); } .af-chip.f-trend  { --c: var(--ink-link); }
.af-chip.f-momentum { --c: var(--g-cold); } .af-chip.f-strength { --c: var(--ink-warn); }
.af-chip.f-cycle    { --c: var(--ink-orange); }
.af-head { font-weight: 600; color: var(--text); font-size: 13.5px; flex: 1; min-width: 180px; }
.af-time { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.af-detail { padding: 2px 0 12px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.af-edge { margin-top: 6px; font-size: 12px; color: var(--text); }
.af-fwd { margin-top: 3px; font-size: 12px; color: var(--muted); }
.af-empty { padding: 10px 2px; color: var(--muted); font-size: 13px; }

/* mobile: full-width search, and tighter links so the wrapped menu stays compact
   (controls stay pinned in their own grid column regardless) */
@media (max-width: 760px) { .nav-search { max-width: none; } }
@media (max-width: 560px) {
  /* one column: toggles get their own top-right row, the menu links wrap across
     the FULL width below (instead of being squeezed beside the toggles), then
     the search — so links stay readable and the toggles never float mid-list. */
  .site-nav { grid-template-columns: 1fr; column-gap: 8px; row-gap: 8px; }
  /* stretch the cluster to the full column and let it WRAP — keeping the default
     justify-self:end sized it to its content (max-content), so the AI-brief pills +
     theme + EN/中文 toggles overflowed the viewport ~21px at 375px. flex-wrap lets
     the toggles drop to a second row instead of spilling; justify-content keeps
     them flush right as the comment below intends. */
  .site-nav .nav-ctrls { grid-column: 1; grid-row: 1; margin-top: 0;
    justify-self: stretch; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
  .site-nav .nav-links { grid-column: 1; grid-row: 2; }
  .nav-search { grid-column: 1; grid-row: 3; }
  .site-nav a.nav-link { padding: 6px 8px; font-size: 12.5px; }
  .site-nav .nav-ctrls { gap: 7px; }
  .site-nav .nav-brand .brand-word { display: none; }  /* phones: keep the menu compact, glyph only */
}

/* ---- Time-machine warning chips: hover definition popover ------------------ */
.tm-flag { position: relative; cursor: help; }
.tm-flag .tm-tip { display: none; position: absolute; bottom: 145%; left: 0;
  width: 230px; max-width: 230px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; z-index: 70; font-size: 11.5px; font-weight: 400;
  line-height: 1.45; color: var(--text); text-align: left; box-shadow: var(--popover-shadow);
  pointer-events: none; white-space: normal; letter-spacing: normal; }
.tm-flag:hover .tm-tip, .tm-flag:focus .tm-tip { display: block; }
/* chips near the right edge of the row open leftward so the tip stays on-screen */
.tm-flags .tm-flag:nth-child(n+4) .tm-tip { left: auto; right: 0; }

/* ---- Signal stack: consolidated cross-subsystem read (display-only) -------- */
#signal-stack .sstack-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 760px) { #signal-stack .sstack-grid { grid-template-columns: 1fr; } }
.sstack-legs { display: flex; flex-direction: column; }
.sstack-leg { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 11px;
  padding: 7px 2px; border-bottom: 1px solid var(--line); }
.sstack-leg:last-child { border-bottom: none; }
.sstack-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.sstack-name { font-size: 13.5px; color: var(--text); }
.sstack-tier { font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; margin-left: 7px; vertical-align: middle; }
.sstack-state { font-size: 12.5px; font-weight: 600; text-align: right; }
.sstack-dot.tone-up { background: var(--up); } .sstack-dot.tone-down { background: var(--down); }
.sstack-dot.tone-flat { background: var(--muted); }
.sstack-state.tone-up, b.tone-up { color: var(--ink-up); } .sstack-state.tone-down, b.tone-down { color: var(--ink-down); }
.sstack-state.tone-flat { color: var(--muted); }
.sstack-verdict { background: var(--panel2); border: 1px solid var(--line); border-radius: 11px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; }
.sstack-final { font-size: 16.5px; color: var(--text); }
.sstack-final.tone-up { color: var(--ink-up); } .sstack-final.tone-down { color: var(--ink-down); }
.sstack-agree { font-size: 13px; color: var(--muted); } .sstack-agree b { color: var(--text); }
.sstack-tally { font-size: 12px; color: var(--muted); } .sstack-tally b { color: var(--text); }
.sstack-contra { font-size: 13px; color: var(--ink-warn); line-height: 1.45; margin-top: 2px; }
.sstack-contra.ok { color: var(--ink-ok); }

/* ---- progressive "show more" for standout-stock card grids (shared; wired by
   theme.js initShowMore on any [data-showmore] grid). Cards beyond the initial
   count are display:none until revealed, then fade-slide in (staggered). ------- */
.sm-hidden { display: none !important; }
@keyframes smReveal { from { opacity: 0; transform: translateY(10px) scale(.985); }
                      to   { opacity: 1; transform: none; } }
.sm-reveal { animation: smReveal .36s cubic-bezier(.2,.7,.3,1) both; }
@media (prefers-reduced-motion: reduce) { .sm-reveal { animation: none; } }
.sm-bar { display: flex; align-items: center; justify-content: center; gap: 10px 14px;
  flex-wrap: wrap; margin: 15px 0 2px; }
.sm-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.sm-count b { color: var(--text); font-weight: 700; }
.sm-btns { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sm-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--text); font: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease; }
.sm-btn:hover { border-color: var(--link); color: var(--ink-link, var(--link)); transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(0,0,0,.16); }
.sm-btn:active { transform: translateY(0); box-shadow: none; }
.sm-btn .sm-ic { font-size: 11px; line-height: 1; transition: transform .25s ease; }
.sm-btn.sm-ghost { background: transparent; border-color: transparent; color: var(--muted); font-weight: 500; padding: 8px 12px; }
.sm-btn.sm-ghost:hover { color: var(--ink-link, var(--link)); background: var(--panel2); box-shadow: none; transform: none; }
.sm-btn.sm-collapse .sm-ic { transform: rotate(180deg); }

/* ---- sitewide theme-toggle flourish (theme.js skyToggleFx) ------------------
   A compact, modern icon blooms in the centre of the screen on every page EXCEPT
   the landing hub (which runs its own richer sun/moon choreography + sets
   window.__skyDeck): a luminous sun (→ light) or a crescent moon (→ dark). It
   pops in with a soft expanding ring, holds, and fades. Pure CSS, self-removing.
   The crescent is mask-carved on .disc; the glow lives on .orb (unmasked). */
.sky-fx { position: fixed; inset: 0; z-index: 2147483600; pointer-events: none;
  display: grid; place-items: center; }
.sky-fx .orb { position: relative; width: clamp(74px, 11vw, 104px); height: clamp(74px, 11vw, 104px);
  border-radius: 50%; animation: skyfx-pop 1.05s cubic-bezier(.18,.9,.3,1) forwards; }
.sky-fx .disc { position: absolute; inset: 0; border-radius: 50%; }
.sky-fx .ring { position: absolute; inset: -7px; border-radius: 50%; border: 2px solid currentColor;
  opacity: 0; animation: skyfx-ring 1.05s ease-out forwards; }
.sky-fx.sun .orb { box-shadow: 0 0 40px 8px rgba(255,210,120,.55), 0 0 104px 34px rgba(255,180,80,.28); }
.sky-fx.sun .disc { background: radial-gradient(circle at 50% 46%, #fffdf7 0%, #ffeeb8 26%, #ffc35a 58%, rgba(255,150,40,.3) 74%, transparent 82%); }
.sky-fx.sun .ring { color: rgba(255,200,110,.6); }
.sky-fx.moon .orb { box-shadow: 0 0 40px 8px rgba(160,190,245,.5), 0 0 104px 34px rgba(130,165,235,.26); }
.sky-fx.moon .disc { background: radial-gradient(circle at 42% 38%, #f4f7ff 0%, #cbd6ee 64%, #9fb0d2 100%);
  -webkit-mask: radial-gradient(circle at 70% 36%, transparent 0 41%, #000 42%);
  mask: radial-gradient(circle at 70% 36%, transparent 0 41%, #000 42%); }
.sky-fx.moon .ring { color: rgba(160,190,245,.55); }
@keyframes skyfx-pop { 0% { transform: scale(.5); opacity: 0; } 26% { transform: scale(1.05); opacity: 1; }
  40% { transform: scale(1); } 72% { opacity: 1; } 100% { transform: scale(1.02); opacity: 0; } }
@keyframes skyfx-ring { 0% { transform: scale(.55); opacity: .55; } 70% { opacity: .12; } 100% { transform: scale(2.1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sky-fx { display: none !important; } }

/* Forward-cone "anticipation" conviction note — hidden site-wide (low signal value).
   Single shared-CSS gate so it stays suppressed on every dashboard (US / China / HK /
   Canada / Intl) regardless of which generator emitted it (engine.stock_score or
   scripts.build_intl_library._cone_note). The sibling 'rank' note is unaffected. */
.nb-note-anticipation { display: none !important; }

/* ---- confluence buy-gate tier badge (owner's T1->T4 cascade, _sig_badge.html.j2) ---- */
.sig-gate { display:inline-flex; align-items:center; gap:3px; font-size:11px; font-weight:600;
  line-height:1; padding:2px 7px; border-radius:999px; white-space:nowrap;
  background: color-mix(in srgb, var(--c, var(--muted)) 16%, var(--panel));
  color: color-mix(in srgb, var(--c, var(--muted)) 82%, var(--text));
  border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 34%, transparent); }
.sig-gate.sig-take { --c: var(--ok); }
.sig-gate.sig-pending { --c: var(--ink-warn); }
.sig-gate.sig-t2 { --c: var(--ok); opacity:.82; }
.sig-gate.sig-early { --c: var(--muted); }
/* S1 HTF-sponsorship badge (display-only, rank-neutral, 2026-07-06) */
.sig-gate.sig-htf-s1 { --c: #7c6ece; font-size:10px; font-weight:800; letter-spacing:.3px; }
.sig-gate .sig-w { font-size:9.5px; font-weight:700; letter-spacing:.2px; opacity:.7;
  padding-left:3px; border-left:1px solid color-mix(in srgb, var(--c, var(--muted)) 30%, transparent); }
/* provisional-basis marker (W6 #22): a T3 fresh fire is graded on an incomplete resample
   bucket and repaints at a measured 9.4% US / 0% CN (post-N=2 persistence hardening) — flagged wherever the tier renders
   (_sig_badge, Top-setups strip, discovery chip). Dashed border = tentative by design. */
.prov-flag { display:inline-block; font-size:9px; font-weight:800; letter-spacing:.4px;
  text-transform:uppercase; line-height:1; padding:2px 5px; border-radius:4px; margin-left:4px;
  vertical-align:1px; white-space:nowrap; cursor:help;
  background: color-mix(in srgb, var(--warn) 22%, var(--panel));
  color: color-mix(in srgb, var(--warn) 92%, var(--text));
  border: 1.5px solid color-mix(in srgb, var(--warn) 60%, transparent); }

/* ---- Collapsible "Show more" lists (buy/add & reduce/avoid columns) -------------------
   Keeps long action lists short: 7 rows on a wide screen, 5 on a narrow one, the rest behind
   a Show more / Show less toggle. Markup: a column with class .lst-wrap containing a
   .lst-collapse.is-collapsed wrapper around the rows and a sibling .lst-more <button>.
   theme.js flips .is-collapsed + aria-expanded on click. Row hiding is plain :nth-child;
   only the button's visibility uses :has() (so it surfaces just when rows are actually
   hidden) — degrades to an always-shown button if :has() is unsupported, which is harmless. */
.lst-collapse.is-collapsed > :nth-child(n+8) { display:none; }
@media (max-width:680px) { .lst-collapse.is-collapsed > :nth-child(n+6) { display:none; } }
.lst-more { display:block; width:100%; margin-top:8px; padding:6px 10px;
  font: inherit; font-size:12px; font-weight:600; color:var(--muted); text-align:center;
  background:var(--panel2); border:1px solid var(--line); border-radius:8px; cursor:pointer; }
.lst-more:hover { color:var(--text); border-color:var(--muted); }
.lst-more .lm-hide { display:none; }
.lst-more[aria-expanded="true"] .lm-show { display:none; }
.lst-more[aria-expanded="true"] .lm-hide { display:inline; }
/* on wide screens, hide the button unless an 8th row exists (nothing hidden at ≤7 rows) */
@media (min-width:681px) {
  .lst-wrap:has(.lst-collapse) > .lst-more { display:none; }
  .lst-wrap:has(.lst-collapse > :nth-child(8)) > .lst-more { display:block; }
}

/* Tighter 6-row variant (.lst-cap6) — same plumbing, but caps at 6 on EVERY width.
   Used by the HOLD / avoid action column, which stacks the most sectors + baskets. The
   6th-child override beats the shared 5-on-mobile rule above; the :has() gate re-enables
   the button at a 7th row (the shared rule above would otherwise wait for an 8th). */
.lst-collapse.lst-cap6.is-collapsed > :nth-child(n+7) { display:none; }
@media (max-width:680px) { .lst-collapse.lst-cap6.is-collapsed > :nth-child(6) { display:flex; } }
@media (min-width:681px) {
  .lst-wrap:has(.lst-collapse.lst-cap6 > :nth-child(7)) > .lst-more { display:block; }
}

/* Tightest 4-row variant (.lst-cap4) — the China stocks page's "What to act on now"
   sector columns cap at 4 on EVERY width; button gates on a 5th child. */
.lst-collapse.lst-cap4.is-collapsed > :nth-child(n+5) { display:none; }
@media (min-width:681px) {
  .lst-wrap:has(.lst-collapse.lst-cap4 > :nth-child(5)) > .lst-more { display:block; }
}

/* Prophet action lanes: top three at a glance, with the remainder in Show more. */
.lst-collapse.lst-cap3.is-collapsed > :nth-child(n+4) { display:none; }
@media (min-width:681px) {
  .lst-wrap:has(.lst-collapse.lst-cap3 > :nth-child(4)) > .lst-more { display:block; }
}

/* ---- List overlay (theme.js initListOverlay) -------------------------------------
   Replaces the in-flow "Show more" expansion on every .lst-wrap list: theme.js restyles
   the .lst-more button into a quiet "View all N" pill (.lst-viewall) and a click MOVES
   the live .lst-collapse node into a centered modal instead of unfolding it in place
   (a 40-row lane expanded in-flow made the column ~4 pages tall). The list node itself
   is relocated — bilingual l-en/l-zh spans, delegated handlers and row popovers keep
   working inside the modal — and is returned to its placeholder on close. The native
   scrollbar is hidden and replaced by a JS-driven thumb (.lst-ovl-sb) because macOS
   overlay scrollbars auto-hide and ignore ::-webkit-scrollbar styling entirely. */
.lst-more.lst-viewall { width:fit-content; padding:4px 12px; margin:8px auto 2px;
  font-size:11px; border-radius:999px; background:transparent; }
.lst-more.lst-viewall .lst-va-arr { opacity:.6; margin-left:2px; }
.lst-more.lst-viewall:hover .lst-va-arr { opacity:1; }
.lst-ovl { position:fixed; inset:0; z-index:10500; display:flex; align-items:center;
  justify-content:center; padding:20px;
  background:color-mix(in srgb, var(--bg) 60%, transparent);
  backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px);
  opacity:0; pointer-events:none; transition:opacity .16s ease; }
.lst-ovl.is-open { opacity:1; pointer-events:auto; }
.lst-ovl-modal { width:min(660px, 94vw); max-height:78vh; display:flex; flex-direction:column;
  background:var(--panel); border:1px solid var(--line); border-radius:14px;
  box-shadow:0 28px 90px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.3);
  transform:translateY(10px) scale(.985); transition:transform .18s cubic-bezier(.2,.7,.3,1);
  overflow:hidden; outline:none; }
.lst-ovl.is-open .lst-ovl-modal { transform:none; }
@media (prefers-reduced-motion:reduce) { .lst-ovl, .lst-ovl-modal { transition:none; } }
.lst-ovl-hd { --lane:var(--muted); position:relative; display:flex; align-items:flex-start;
  gap:10px; padding:14px 16px 11px; border-bottom:1px solid var(--line); }
.lst-ovl-hd::before { content:""; position:absolute; top:0; left:0; right:0; height:3px;
  background:linear-gradient(90deg, var(--lane), transparent 70%); }
.lst-ovl-title { font-size:13px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  color:var(--lane); line-height:1.3; }
.lst-ovl-count { margin-left:6px; font-size:11px; font-weight:600; color:var(--muted);
  background:var(--panel2); border:1px solid var(--line); border-radius:999px;
  padding:1px 8px; vertical-align:1px; }
.lst-ovl-sub { display:block; margin-top:2px; font-size:11px; font-weight:400; letter-spacing:0;
  text-transform:none; color:var(--muted); }
.lst-ovl-x { margin-left:auto; flex:none; width:28px; height:28px; border-radius:8px;
  border:1px solid transparent; background:transparent; color:var(--muted);
  font:inherit; font-size:15px; line-height:1; cursor:pointer; }
.lst-ovl-x:hover { background:var(--panel2); color:var(--text); border-color:var(--line); }
.lst-ovl-bodywrap { position:relative; flex:1; min-height:0; display:flex; }
.lst-ovl-body { flex:1; overflow-y:auto; overscroll-behavior:contain;
  padding:6px 18px 12px 16px; scrollbar-width:none; -ms-overflow-style:none; }
.lst-ovl-body::-webkit-scrollbar { display:none; }
.lst-ovl-sb { position:absolute; top:8px; right:5px; bottom:8px; width:5px; border-radius:3px;
  background:color-mix(in srgb, var(--muted) 12%, transparent); }
.lst-ovl-sb-thumb { position:absolute; left:0; width:100%; border-radius:3px;
  background:color-mix(in srgb, var(--muted) 55%, transparent); cursor:grab; }
.lst-ovl-sb-thumb:hover, .lst-ovl-sb-thumb.is-drag {
  background:color-mix(in srgb, var(--muted) 80%, transparent); }
.lst-ovl-ft { padding:9px 16px; font-size:10.5px; color:var(--muted);
  border-top:1px solid var(--line); display:flex; gap:12px; justify-content:space-between; }
body.lst-ovl-lock { overflow:hidden; }
/* transitional: the US action board's page-local .act-pop (z 9999) must clear the
   overlay until the follow-up PR replaces it with the shared .row-pop engine */
body.lst-ovl-lock .act-pop { z-index:12000; }
/* rows breathe a little more inside the modal than in a packed column */
.lst-ovl-body > .lst-collapse > * { border-bottom:1px solid
  color-mix(in srgb, var(--line) 60%, transparent); padding-top:8px; padding-bottom:9px; }
.lst-ovl-body > .lst-collapse > :last-child { border-bottom:0; }

/* ---- Row conditions popover (theme.js initRowPop) --------------------------------
   Shared hover/focus card for board rows: any element with [data-rpop] and a hidden
   .rp-src child gets a body-appended fixed popover built from a CLONE of that child
   (dual-span l-en/l-zh content — the [data-lang] CSS picks the language, so it
   live-updates on toggle). Unlike the retired page-local .act-pop engine, the card
   itself is hoverable (grace timers bridge the gap), scrolling REPOSITIONS instead of
   dismissing, and keyboard focus opens it. z-index sits above the list overlay so
   cards work on rows inside the modal. */
.row-pop { position:fixed; z-index:12000; width:360px; max-width:min(92vw, 400px);
  background:var(--panel); border:1px solid var(--line); border-radius:12px;
  box-shadow:0 18px 60px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.25);
  font-size:12px; color:var(--text); }
/* snappy show — a quick rise+fade so the card lands instantly without a hard pop */
.row-pop:not([hidden]) { animation:rowPopIn .09s ease both; }
@keyframes rowPopIn { from { opacity:0; transform:translateY(3px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion:reduce) { .row-pop:not([hidden]) { animation:none; } }
.row-pop-hd { display:flex; align-items:center; gap:8px; padding:11px 13px 9px; flex-wrap:wrap; }
.row-pop-name { font-weight:700; font-size:13px; color:var(--text); }
.row-pop-kind { font-size:9.5px; font-weight:600; letter-spacing:.08em; padding:2px 7px;
  border-radius:999px; color:var(--muted); background:var(--panel2); border:1px solid var(--line); }
.row-pop-tag { margin-left:auto; font-size:10px; font-weight:700; letter-spacing:.05em;
  padding:2px 8px; border-radius:6px; color:var(--muted); background:var(--panel2);
  border:1px solid var(--line); }
.row-pop-tag.up   { color:var(--ink-up);   background:color-mix(in srgb, var(--ink-up) 12%, transparent);
  border-color:color-mix(in srgb, var(--ink-up) 35%, transparent); }
.row-pop-tag.dn   { color:var(--ink-down); background:color-mix(in srgb, var(--ink-down) 10%, transparent);
  border-color:color-mix(in srgb, var(--ink-down) 32%, transparent); }
.row-pop-tag.warn { color:var(--ink-warn); background:color-mix(in srgb, var(--ink-warn) 10%, transparent);
  border-color:color-mix(in srgb, var(--ink-warn) 32%, transparent); }
.row-pop-div { height:1px; background:var(--line); margin:0 13px; }
.row-pop-grid { display:grid; grid-template-columns:1fr 1fr; gap:7px 14px; padding:10px 13px; }
.row-pop-cell { display:flex; flex-direction:column; gap:2px; min-width:0; }
.row-pop-cell.wide { grid-column:1 / -1; }
.row-pop-lbl { font-size:9.5px; letter-spacing:.07em; text-transform:uppercase; color:var(--muted); }
.row-pop-val { font-size:12px; font-weight:600; color:var(--text); font-variant-numeric:tabular-nums; }
.row-pop-val .up  { color:var(--ink-up); }
.row-pop-val .dn  { color:var(--ink-down); }
.row-pop-val .mut { color:var(--muted); font-weight:400; }
.row-pop-bar { height:3px; border-radius:2px; background:var(--panel2); margin-top:3px;
  position:relative; overflow:hidden; }
.row-pop-bar i { position:absolute; top:0; bottom:0; left:0; border-radius:2px; background:currentColor; }
.row-pop-why { margin:0; padding:2px 13px 10px; }
.row-pop-why li { list-style:none; position:relative; padding-left:12px; margin:3px 0;
  font-size:11px; color:var(--muted); line-height:1.45; }
.row-pop-why li::before { content:"·"; position:absolute; left:2px; }
.row-pop-ft { padding:7px 13px 9px; border-top:1px solid var(--line); font-size:9.5px;
  color:var(--muted); display:flex; justify-content:space-between; gap:10px; }
.rp-src { display:none !important; }

/* ==== Act-Now v2 four-lane board (W8-R3, china_stocks.html) ================
   anv2-board: stocks-mode only; macro-panel keeps legacy actcol.
   Lane accent: buy=green, pull=blue, bot=amber, red=red.
   Mobile: single-column ≤560px; board label 12px nowrap at 390px.
   =========================================================================== */
.anv2-board { }
.anv2-hd { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.anv2-hd h2 { font-size:15px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; margin:0; display:flex; align-items:center; gap:8px; flex-wrap:nowrap; white-space:nowrap; }
@media (max-width:390px) { .anv2-hd h2 { font-size:12px; } }
.anv2-v2pill { font-size:10px; font-weight:700; background:color-mix(in srgb,var(--info) 14%,var(--panel)); color:color-mix(in srgb,var(--info) 80%,var(--text)); border:1px solid color-mix(in srgb,var(--info) 28%,transparent); padding:1px 7px; border-radius:5px; }
.anv2-meta { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.anv2-xlink { font-size:12px; color:var(--ink-link, var(--link)); font-weight:600; text-decoration:none; white-space:nowrap; }
.anv2-xlink:hover { text-decoration:underline; }
.anv2-notes { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
/* four-column grid at ≥960px, two-column 560–959, single-column ≤560 */
.anv2-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; align-items:start; }
@media (max-width:960px) { .anv2-grid { grid-template-columns:repeat(2,1fr); } }
@media (max-width:560px)  { .anv2-grid { grid-template-columns:1fr; } }
/* individual lane card */
.anv2-lane { background:var(--panel); border:1px solid var(--line); border-radius:14px; overflow:hidden; display:flex; flex-direction:column; }
/* accent top bar */
.anv2-lane-hd { padding:10px 13px 8px; border-bottom:1px solid var(--line); position:relative; }
.anv2-lane-hd::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; border-radius:14px 14px 0 0; background:var(--anv2-accent,var(--muted)); }
.anv2-lane--buy   { --anv2-accent: var(--up); }
.anv2-lane--pull  { --anv2-accent: var(--info); }
.anv2-lane--bot   { --anv2-accent: var(--warn); }
.anv2-lane--red   { --anv2-accent: var(--down); }
.anv2-lane-title { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; display:flex; align-items:center; gap:5px; white-space:nowrap; }
.anv2-lane--buy   .anv2-lane-title { color:var(--ink-up); }
.anv2-lane--pull  .anv2-lane-title { color:var(--ink-info); }
.anv2-lane--bot   .anv2-lane-title { color:var(--ink-warn); }
.anv2-lane--red   .anv2-lane-title { color:var(--ink-down); }
.anv2-lane-count { font-size:11px; color:var(--muted); font-weight:400; text-transform:none; letter-spacing:0; }
.anv2-lane-sub { font-size:10.5px; color:var(--muted); margin-top:3px; line-height:1.4; }
.anv2-lane--bot .anv2-lane-sub { color:color-mix(in srgb,var(--warn) 75%,var(--muted)); }
/* lane body */
.anv2-lane-body { padding:6px 0; flex:1; }
/* bottoming disclaimer box */
.anv2-bot-disc { margin:6px 12px 4px; background:color-mix(in srgb,var(--warn) 8%,var(--panel2)); border:1px solid color-mix(in srgb,var(--warn) 20%,transparent); border-radius:7px; padding:6px 9px; font-size:10.5px; line-height:1.45; }
.anv2-bot-disc strong { display:block; font-size:10px; letter-spacing:.04em; text-transform:uppercase; color:color-mix(in srgb,var(--ink-warn) 90%,var(--text)); margin-bottom:2px; }
/* row items */
.anv2-lst .anv2-row { padding:7px 13px; border-bottom:1px solid color-mix(in srgb,var(--line) 55%,transparent); min-width:0; overflow:hidden; }
.anv2-lst .anv2-row:last-child { border-bottom:none; }
.anv2-lst .anv2-row:hover { background:color-mix(in srgb,var(--panel2) 55%,transparent); }
.anv2-row-top { display:flex; align-items:center; justify-content:space-between; gap:6px; margin-bottom:4px; }
.anv2-name { font-size:12.5px; font-weight:600; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.anv2-score { font-size:15px; font-weight:800; font-variant-numeric:tabular-nums; white-space:nowrap; }
.anv2-score-hi  { color:var(--ink-up); }
.anv2-score-mid { color:var(--ink-warn); }
.anv2-score-lo  { color:var(--ink-down); }
.anv2-chips { display:flex; flex-wrap:wrap; gap:3px; align-items:center; margin-bottom:3px; }
/* chip base */
.anv2-chip { display:inline-flex; align-items:center; font-size:10px; font-weight:700; letter-spacing:.03em; padding:2px 6px; border-radius:4px; border:1px solid; white-space:nowrap; text-transform:uppercase; }
.anv2-chip-theme  { background:color-mix(in srgb,var(--info) 12%,var(--panel)); color:color-mix(in srgb,var(--info) 80%,var(--text)); border-color:color-mix(in srgb,var(--info) 26%,transparent); }
.anv2-chip-basket { background:color-mix(in srgb,#8b5cf6 10%,var(--panel)); color:color-mix(in srgb,#8b5cf6 80%,var(--text)); border-color:color-mix(in srgb,#8b5cf6 24%,transparent); }
.anv2-chip-sector { background:color-mix(in srgb,var(--warn) 10%,var(--panel)); color:color-mix(in srgb,var(--warn) 75%,var(--text)); border-color:color-mix(in srgb,var(--warn) 24%,transparent); }
/* reco chips */
.anv2-chip-reco-accumulate,.anv2-chip-reco-enter { background:color-mix(in srgb,var(--up) 14%,var(--panel)); color:color-mix(in srgb,var(--up) 85%,var(--text)); border-color:color-mix(in srgb,var(--up) 32%,transparent); }
.anv2-chip-reco-hold { background:color-mix(in srgb,var(--muted) 12%,var(--panel)); color:color-mix(in srgb,var(--muted) 75%,var(--text)); border-color:color-mix(in srgb,var(--muted) 24%,transparent); }
.anv2-chip-reco-trim,.anv2-chip-reco-avoid { background:color-mix(in srgb,var(--down) 12%,var(--panel)); color:color-mix(in srgb,var(--down) 80%,var(--text)); border-color:color-mix(in srgb,var(--down) 28%,transparent); }
/* bottoming + dual-read chips */
.anv2-chip-trough  { background:color-mix(in srgb,var(--warn) 12%,var(--panel)); color:color-mix(in srgb,var(--warn) 85%,var(--text)); border-color:color-mix(in srgb,var(--warn) 28%,transparent); }
.anv2-chip-turn    { background:color-mix(in srgb,#3dd6c8 10%,var(--panel)); color:color-mix(in srgb,#3dd6c8 80%,var(--text)); border-color:color-mix(in srgb,#3dd6c8 24%,transparent); }
/* light: 80% of the teal literal toward a near-black text is still 2.13:1 on the
   tinted chip — the teal needs to KEEP mostly text. 40% lands at 5.6:1. */
html[data-theme="light"] .anv2-chip-turn { color:color-mix(in srgb,#3dd6c8 40%,var(--text)); border-color:color-mix(in srgb,#3dd6c8 55%,var(--line)); }
.anv2-chip-washout { background:color-mix(in srgb,var(--warn) 11%,var(--panel)); color:color-mix(in srgb,var(--warn) 80%,var(--text)); border-color:color-mix(in srgb,var(--warn) 26%,transparent); cursor:help; }
.anv2-chip-tag     { background:var(--panel2); color:var(--muted); border-color:var(--line); }
/* stat line */
.anv2-stat { font-size:11px; color:var(--muted); }
.anv2-pos { color:var(--ink-up); font-weight:600; }
.anv2-neg { color:var(--ink-down); font-weight:600; }

/* ==== regime panels (base-effect strip + HMM regime-probability) — shared by dashboard.html.j2 (US) + china.html.j2. Status colours --ok/--warn/--muted do NOT flip in zh; quad colours --q1..--q4 do (intentional). ==== */
/* MEASURED / MODELED / NO-EDGE honesty badges (status colours --ok/--warn/--muted do NOT
   flip in zh mode, unlike --up/--down) + the base-effect forward strip (v0). */
.mbadge { display:inline-flex; align-items:center; gap:4px; font-size:9px; font-weight:800;
          letter-spacing:.07em; padding:2px 7px; border-radius:5px; text-transform:uppercase; border:1px solid; }
.mbadge.measured { color:var(--ink-ok);    border-color:color-mix(in srgb,var(--ink-ok) 55%,transparent);   background:color-mix(in srgb,var(--ink-ok) 12%,transparent); }
.mbadge.modeled  { color:var(--ink-warn);  border-color:color-mix(in srgb,var(--ink-warn) 55%,transparent); background:color-mix(in srgb,var(--ink-warn) 12%,transparent); }
.mbadge.noedge   { color:var(--muted); border-color:var(--line); background:var(--panel2); }
.bfwd .bfwd-head { display:flex; align-items:center; gap:9px; flex-wrap:wrap; margin:0 0 4px; }
.bfwd .bfwd-head h3 { font-size:12px; margin:0; color:var(--text); text-transform:uppercase; letter-spacing:.05em; }
.bfwd-sub { color:var(--muted); font-size:12px; margin:0 0 12px; max-width:78ch; }
.bfwd-main { display:flex; gap:18px; flex-wrap:wrap; align-items:stretch; }
.bfwd-now { flex:0 0 auto; min-width:158px; display:flex; flex-direction:column; gap:3px; justify-content:center;
            padding:10px 15px; border-radius:11px; color:#fff; }
.bfwd-now.q-Q2 { color:#1a1a1a; }
.bfwd-now .k { font-size:9px; letter-spacing:.09em; text-transform:uppercase; opacity:.9; }
.bfwd-now .v { font-size:17px; font-weight:800; line-height:1.12; }
.bfwd-now .s { font-size:10px; opacity:.88; }
.bfwd-axes { flex:1 1 300px; display:grid; grid-template-columns:auto auto 1fr; gap:7px 14px; align-content:center; }
.bfwd-ax-l { font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; align-self:center; }
.bfwd-ax-v { font-variant-numeric:tabular-nums; font-weight:700; font-size:13px; align-self:center; white-space:nowrap; }
.bfwd-ax-v .bfa { font-weight:700; margin-left:3px; }
.bfwd-ax-n { font-size:11px; color:var(--muted); align-self:center; }
.bfwd-path { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:14px; }
.bfwd-path .pl { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin-right:2px; }
.bfwd-path .arw { color:var(--muted); }
.bfq { border-radius:6px; padding:4px 9px; color:#fff; font-weight:700; font-size:10.5px; white-space:nowrap; }
.bfq.q-Q2 { color:#1a1a1a; } .bfq small { font-weight:500; opacity:.85; }
.bfwd-note { font-size:11px; color:var(--muted); margin-top:12px; line-height:1.5;
             border-top:1px solid var(--line); padding-top:8px; }
@media (max-width:640px){ .bfwd-main{ gap:12px; } .bfwd-now{ width:100%; }
  .bfwd-axes{ grid-template-columns:auto 1fr; column-gap:12px; row-gap:2px; }
  .bfwd-ax-n{ grid-column:1/-1; margin:0 0 8px; } }
/* HMM regime-probability panel (v1) — soft P(Quad) + transition odds + hazard */
.rhmm-main { display:flex; gap:24px; flex-wrap:wrap; align-items:flex-start; }
.rhmm-bars { display:grid; grid-template-columns:auto 1fr auto; gap:5px 9px; align-items:center;
             flex:1 1 340px; max-width:480px; }
.rhmm-q { font-size:11px; font-weight:600; white-space:nowrap; }
.rhmm-track { height:12px; border-radius:6px; background:var(--panel2); overflow:hidden; min-width:70px; }
.rhmm-fill { height:100%; border-radius:6px; }
.rhmm-pct { font-size:11px; font-variant-numeric:tabular-nums; color:var(--muted); text-align:right; min-width:34px; }
.rhmm-side { flex:1 1 300px; font-size:12px; line-height:1.65; }
.rhmm-side .k { color:var(--muted); text-transform:uppercase; font-size:10px; letter-spacing:.05em; }
.rhmm-chip { display:inline-block; padding:1px 7px; border-radius:5px; color:#fff; font-size:10.5px;
             font-weight:700; margin:0 3px 3px 0; }
.rhmm-chip.q-Q2 { color:#1a1a1a; }
@media (max-width:640px){ .rhmm-bars{ min-width:0; } }

/* ---- i18n tooltip → LENS popover ([data-tip-en]/[data-tip-zh], wired in theme.js)
   The Lens explainer card (design mockups/lens, merged #3102) replaced the old
   .i18n-tip-pop singleton. Its component CSS is INJECTED by theme.js (#lens-style)
   rather than living here, so vector-family pages — which load theme.js but NOT
   theme.css and use different token names (--card/--ink vs --panel/--text) — style
   it correctly through the --lens-* fallback chains. Only the trigger affordance
   belongs in this file. z-index 12600 (above .row-pop 12000). */
[data-tip-en] { cursor: help; }

/* ── W8-R1: Ripening three-zone shelf (READY / BASING / FALLING sink) ─────── */
/* Zone accent tokens — inherit from --up/--down/--warn; re-stated for legibility. */
.rip-shelf { border:1px solid var(--line); border-radius:12px; overflow:hidden; margin-top:16px; }
.rip-shelf-hdr { display:flex; align-items:baseline; gap:12px; flex-wrap:wrap;
                 padding:13px 16px 11px; border-bottom:1px solid var(--line);
                 background:color-mix(in srgb,var(--warn) 4%,var(--panel)); }
.rip-shelf-title { font-size:12px; font-weight:700; letter-spacing:.07em; text-transform:uppercase;
                   color:var(--muted); }
.rip-shelf-sub { font-size:11px; color:var(--muted); }
.rip-shelf-asof { margin-left:auto; font-size:10.5px; color:var(--muted); opacity:.7; }

/* Zone band */
.rip-zone { padding:14px 16px; border-bottom:1px solid var(--line); }
.rip-zone:last-child { border-bottom:none; }
.rip-zone.rz-ready  { background:color-mix(in srgb,var(--up) 5%,var(--panel)); border-left:3px solid var(--up); }
.rip-zone.rz-basing { background:var(--panel); border-left:3px solid color-mix(in srgb,var(--muted) 40%,var(--line)); }
.rip-zone.rz-fall   { background:color-mix(in srgb,var(--down) 5%,var(--panel)); border-left:3px solid var(--down); }

/* Zone header row — uses .nb-shelf-hdr accent-left-border idiom */
.rip-zone-hdr { display:flex; align-items:center; gap:9px; margin-bottom:12px; flex-wrap:wrap; }
.rip-zone-label { font-size:11px; font-weight:800; letter-spacing:.07em; text-transform:uppercase; }
.rz-ready  .rip-zone-label { color:var(--ink-up); }
.rz-basing .rip-zone-label { color:var(--muted); }
.rz-fall   .rip-zone-label { color:var(--ink-down); }
.rip-zone-count { font-size:9.5px; font-weight:700; padding:1px 6px; border-radius:14px; }
.rz-ready  .rip-zone-count { background:color-mix(in srgb,var(--ink-up) 14%,var(--panel)); color:var(--ink-up); border:1px solid color-mix(in srgb,var(--ink-up) 28%,transparent); }
.rz-basing .rip-zone-count { background:color-mix(in srgb,var(--muted) 12%,var(--panel)); color:var(--muted); border:1px solid color-mix(in srgb,var(--muted) 20%,transparent); }
.rz-fall   .rip-zone-count { background:color-mix(in srgb,var(--ink-down) 14%,var(--panel)); color:var(--ink-down); border:1px solid color-mix(in srgb,var(--ink-down) 28%,transparent); }
.rip-zone-defn { font-size:10.5px; color:var(--muted); margin-left:auto; font-style:italic; }
.rip-toggle-btn { margin-left:auto; font-size:10.5px; color:var(--ink-link, var(--link)); cursor:pointer;
                  background:none; border:none; font-family:inherit; padding:2px 7px; border-radius:6px; }
.rip-toggle-btn:hover { background:color-mix(in srgb,var(--link) 10%,transparent); }

/* Scorecard grid for READY + BASING */
.rip-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:12px; }
@media (max-width:480px) { .rip-grid, .nbgrid { grid-template-columns:1fr; } }

/* Full scorecard for ripening (similar to .nbcard chassis) */
.rip-card { background:var(--panel2,var(--panel)); border:1px solid var(--line); border-radius:11px;
            overflow:hidden; display:flex; flex-direction:column; transition:border-color .18s; }
.rip-card:hover { border-color:color-mix(in srgb,var(--link) 40%,var(--line)); }
.rip-card-stripe { height:3px; }
.rz-ready  .rip-card-stripe { background:linear-gradient(90deg,var(--up),color-mix(in srgb,var(--up) 30%,transparent)); }
.rz-basing .rip-card-stripe { background:linear-gradient(90deg,var(--muted),transparent); opacity:.6; }
.rz-fall   .rip-card-stripe { background:linear-gradient(90deg,var(--down),color-mix(in srgb,var(--down) 30%,transparent)); }
.rip-card-body { padding:11px 13px; display:flex; flex-direction:column; gap:8px; }
.rip-card-id { display:flex; justify-content:space-between; align-items:flex-start; gap:6px; }
.rip-card-tk { font-size:13px; font-weight:800; letter-spacing:.02em; color:var(--text); }
.rip-card-px { font-size:13px; font-weight:700; color:var(--text); white-space:nowrap; text-align:right; }
.rip-card-nm { font-size:11px; color:var(--muted); line-height:1.3; margin-top:1px; }
.rip-card-sec { font-size:9.5px; color:var(--muted); opacity:.8; margin-top:1px; }
/* Sparkline row */
.rip-card-spark { height:34px; width:100%; }
.rip-card-spark svg { width:100%; height:100%; }
/* 2-col metrics grid */
.rip-metrics { display:grid; grid-template-columns:1fr 1fr; gap:5px 10px; }
.rip-metric { display:flex; flex-direction:column; gap:1px; }
.rip-metric-lbl { font-size:9px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; font-weight:600; }
.rip-metric-val { font-size:12px; font-weight:700; color:var(--text); display:flex; align-items:center; gap:3px; }
.rip-metric-val.pos { color:var(--ink-up); } .rip-metric-val.neg { color:var(--ink-down); } .rip-metric-val.mut { color:var(--muted); }
/* MACD glyph strip (D/2D/3D) */
.rip-macd-strip { display:flex; gap:3px; align-items:center; }
.rip-macd-g { font-size:12px; line-height:1; }
.rip-macd-g.pg { color:var(--ink-up); } .rip-macd-g.ng { color:var(--ink-down); } .rip-macd-g.mg { color:var(--muted); }
.rip-macd-lbl { font-size:8.5px; color:var(--muted); letter-spacing:.03em; }
/* Evidence + chip row */
.rip-chips { display:flex; flex-wrap:wrap; gap:4px; margin-top:2px; }
.rip-chip { font-size:9px; font-weight:600; padding:2px 7px; border-radius:14px; border:1px solid transparent; white-space:nowrap; }
.rip-chip.cp-cross { background:color-mix(in srgb,var(--info) 10%,var(--panel)); color:var(--ink-info, var(--info)); border-color:color-mix(in srgb,var(--info) 25%,transparent); }
.rip-chip.cp-ready { background:color-mix(in srgb,var(--ink-up) 10%,var(--panel)); color:var(--ink-up); border-color:color-mix(in srgb,var(--ink-up) 25%,transparent); }
.rip-chip.cp-warn  { background:color-mix(in srgb,var(--ink-warn) 10%,var(--panel)); color:var(--ink-warn); border-color:color-mix(in srgb,var(--ink-warn) 25%,transparent); }
.rip-chip.cp-neutral { background:color-mix(in srgb,var(--muted) 8%,var(--panel)); color:var(--muted); border-color:color-mix(in srgb,var(--muted) 18%,transparent); }
/* Stoch arrow */
.rip-arrow { font-size:10px; }
.rip-arrow.up { color:var(--ink-up); } .rip-arrow.dn { color:var(--ink-down); } .rip-arrow.fl { color:var(--muted); }

/* FALLING sink — compact rows, muted+red */
.rip-fall-rows { display:flex; flex-direction:column; gap:5px; }
.rip-fall-row { display:grid; grid-template-columns:120px 1fr auto auto; align-items:center; gap:10px;
                background:color-mix(in srgb,var(--down) 4%,var(--panel)); border:1px solid color-mix(in srgb,var(--down) 15%,var(--line));
                border-radius:7px; padding:7px 11px; opacity:.72; font-size:11px; }
.rip-fall-tk { font-weight:800; color:var(--text); }
/* washout reversal watch shelf — neutral/amber (measurement, not a falling-knife sink) */
.revw-rows { display:flex; flex-direction:column; gap:5px; margin-top:8px; }
.revw-row { display:grid; grid-template-columns:minmax(140px,1.4fr) auto auto auto; align-items:center; gap:14px;
            background:color-mix(in srgb,var(--warn) 4%,var(--panel)); border:1px solid color-mix(in srgb,var(--warn) 18%,var(--line));
            border-radius:7px; padding:7px 11px; font-size:11px; }
.revw-val { font-weight:700; color:var(--text); font-variant-numeric:tabular-nums; }
.revw-val.pos { color:var(--ink-up, var(--up)); } .revw-val.neg { color:var(--ink-down, var(--down)); }
.revw-null { margin-top:7px; font-size:10px; color:var(--muted); }
@media (max-width:640px){ .revw-row { grid-template-columns:1fr auto; grid-template-rows:auto auto; } }
.rip-fall-nm { font-size:10px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rip-fall-ret { font-weight:700; color:var(--ink-down); white-space:nowrap; }
.rip-fall-lbl { font-size:9.5px; color:var(--ink-down); opacity:.7; }
@media (max-width:480px) {
  .rip-fall-row { grid-template-columns:1fr auto; grid-template-rows:auto auto; }
  .rip-fall-nm { grid-column:1/-1; grid-row:2; }
}
/* Collapse state */
.rip-fall-body { display:block; }
.rip-fall-body.rip-collapsed { display:none; }

/* ---- help "?" icon glyph metrics (site-wide correction) --------------------
   The circular help/hint icon is defined inline per page as
   `.help { width:15px; height:15px; border-radius:50%; font-size:10px; … }`.
   At 10px the "?" glyph is too tall for the 13px inner circle and its top curve
   + bottom dot visibly touch the border. This one shared rule shrinks the glyph
   so it sits centred with even breathing room on every page at once — the
   `span.help` selector (0,0,1,1) outranks the inline `.help` rules (0,0,1,0)
   regardless of source order, and every help icon is a <span class="help">.
   Only the glyph metrics are overridden; the circle box stays as each page
   defines it (so the icon footprint / alignment is unchanged). */
span.help { font-size: 9px; line-height: 1; }

/* 2026-07-16: unify the look with the "new" Mag7 / Leadership icons — a filled pill
   (panel2 fill + subtle line border + bolder glyph) instead of the thin outline — and
   route the tooltip through theme.js's viewport-clamped tap-to-toggle popover.
   BOTH the restyle and the popover apply ONLY to icons theme.js has confirmed are
   canonical help() "?" glyphs (upgradeHelpIcons → .help-upgraded). This scoping is
   deliberate and load-bearing: the bare `.help` class is reused on NON-icon content
   (market-state factor labels `f-name help`, the seasonality cell, the anticipation
   `idxbadge … help`) whose rich tooltips + styling must be left untouched — those are
   never upgraded, so they never match .help-upgraded. */
span.help.help-upgraded { font-size: 9.5px; font-weight: 700;
  background: var(--panel2); border-color: var(--line); color: var(--muted); }
/* once upgraded, suppress the old nested :hover tooltip so it doesn't double up with
   the popover (progressive enhancement — .tip stays live until JS marks the icon). */
.help.help-upgraded .tip { display: none !important; }

/* The upgraded "?" icons (and the sibling Mag7 / Leadership / table-header icons) must
   not select-on-hold or pop the iOS callout menu on touch — a long press should do
   nothing (the popover opens on tap), not start a text selection. Scoped so content
   rows keep normal selection; the popover body (.lens-pop) also stays selectable. */
.help.help-upgraded, .m7p-help, .ldb-help, .st-th-tip {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* ---- dtp: self-labeling data-honesty strips (shared cockpit primitive) ----
   Lifted from the two legacy basket-tape implementations so every dashboard,
   including the Crypto Cockpit family, uses one freshness/status language.
   A stale feed is calm data-quality context: never a red banner. */
.dtp-row { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 14px; padding:9px 16px 8px; }
.dtp-token, .dtp-chip {
  display:inline-flex; align-items:center; gap:5px; flex:none;
  font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  color:var(--muted);
}
.dtp-chip {
  padding:4px 8px; border:1px solid var(--line); border-radius:999px;
  background:color-mix(in srgb,var(--panel2) 70%,transparent);
  letter-spacing:.035em; text-transform:none; font-weight:600;
}
.dtp-chip > i {
  width:6px; height:6px; border-radius:50%; flex:none;
  background:currentColor;
}
.dtp-chip--live { color:var(--ink-ok); }
.dtp-chip--pre { color:var(--ink-link, var(--link)); }
.dtp-chip--warn { color:var(--ink-warn); }
.dtp-chip--stale, .dtp-chip--behind { color:var(--muted); }
.dtp-token.live { color:var(--ink-ok); }
.dtp-token.pre { color:var(--ink-link, var(--link)); }
.dtp-token.warn { color:var(--ink-warn); }
.dtp-token.stale, .dtp-token.behind { color:var(--muted); }
.dtp-dot { width:6px; height:6px; border-radius:50%; background:currentColor; animation:dtp-pulse 1.4s ease-in-out infinite; flex:none; }
.dtp-token.post .dtp-dot, .dtp-token.closed .dtp-dot,
.dtp-token.stale .dtp-dot, .dtp-token.behind .dtp-dot { animation:none; opacity:.45; }
@keyframes dtp-pulse { 0%,100%{opacity:1;} 50%{opacity:.35;} }
.dtp-asof { font-size:10.5px; color:var(--muted); margin-left:auto; font-variant-numeric:tabular-nums; flex:none; }
.dtp-body { display:grid; grid-template-columns:1fr 1fr; border-top:1px solid var(--line); }
.dtp-col { padding:8px 16px 9px; min-width:0; }
.dtp-col + .dtp-col { border-left:1px solid var(--line); }
.dtp-col-lbl { font-size:9.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; margin-bottom:5px; }
.dtp-col-lbl.up { color:color-mix(in srgb,var(--up) 70%,transparent); }
.dtp-col-lbl.dn { color:color-mix(in srgb,var(--down) 70%,transparent); }
.dtp-col-lbl.cx { color:var(--ink-link, var(--link)); }
.dtp-mrow { display:flex; align-items:center; gap:7px; padding:2.5px 0; font-size:12.5px; text-decoration:none; color:inherit; }
.dtp-mrow:hover .dtp-mname { color:var(--ink-link, var(--link)); }
#ftr-tape-band:not(.live-mode) .dtp-mrow,
#dash-tape-band:not(.live-mode) .dtp-mrow { opacity:.92; }
.dtp-rank { width:16px; flex:none; font-size:10px; color:var(--muted); font-variant-numeric:tabular-nums; }
.dtp-mname { flex:1; min-width:0; color:var(--text); font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dtp-mflow { flex:none; font-size:9.5px; color:var(--muted); white-space:nowrap; }
.dtp-mpct { flex:none; min-width:56px; text-align:right; font-family:var(--font-mono,monospace); font-variant-numeric:tabular-nums; font-weight:700; font-size:12px; }
.dtp-mpct.up { color:var(--ink-up); }
.dtp-mpct.dn { color:var(--ink-down); }
.dtp-mtrack { flex:none; width:56px; height:4px; display:flex; align-items:center; }
.dtp-mtrack.dn { justify-content:flex-end; }
.dtp-mbar { height:4px; border-radius:2px; min-width:4px; display:inline-block; }
.dtp-mbar.up { background:color-mix(in srgb,var(--up) 65%,transparent); }
.dtp-mbar.dn { background:color-mix(in srgb,var(--down) 65%,transparent); }
.dtp-2d { font-size:10px; color:var(--muted); font-family:var(--font-mono,monospace); white-space:nowrap; }
.dtp-empty { grid-column:1/-1; padding:10px 16px; font-size:11px; color:var(--muted); }
.dtp-colmore { border-top:1px dashed var(--line); margin-top:5px; padding-top:5px; }
.dtp-more { display:block; width:100%; padding:5px 10px; font:inherit; font-size:11px; font-weight:600; color:var(--muted); text-align:center; background:transparent; border:none; border-top:1px solid var(--line); cursor:pointer; }
.dtp-more:hover { color:var(--text); background:color-mix(in srgb,var(--text) 4%,transparent); }
.dtp-colmore[hidden], .dtp-more[hidden] { display:none; }
.dtp-fn { padding:5px 16px 7px; font-size:10.5px; color:var(--muted); border-top:1px solid var(--line); line-height:1.45; }
@media(max-width:640px){
  .dtp-row { gap:5px 10px; padding:8px 12px 7px; }
  .dtp-asof { width:100%; margin-left:0; }
  .dtp-body { grid-template-columns:1fr; }
  .dtp-col + .dtp-col { border-left:none; border-top:1px solid var(--line); }
  .dtp-mname { font-size:12px; }
}

/* ---- public nav: the primary CTA was a blank pill ---------------------------
   `.public-nav-cta` sets `color:#fff` at specificity (0,1,0). Every article shell
   ships `body.estate a { color: … }` at (0,2,1), which therefore WON: the "Start
   free" button rendered its label in the link blue on the blue pill — 1.0:1, an
   empty button, on every public and editorial page in both themes. Nothing about
   the palette was wrong; the button just never got to set its own ink.
   The :link/:visited pair is the classic link-colour idiom and lands at (0,3,1),
   above any body-scoped `a` rule. It lives HERE rather than in
   _public_chrome_css.html.j2 because that partial is inlined into seo_base, i.e.
   inside the free-content estate's byte-for-byte render contract, and a linked
   sheet is outside it. */
.public-nav a.public-nav-cta:link, .public-nav a.public-nav-cta:visited,
.public-nav a.public-nav-cta:hover, .public-nav a.public-nav-cta:focus { color: #fff; }
.public-nav a.public-nav-login:link, .public-nav a.public-nav-login:visited { color: #5d6b7e; }
.public-nav a.public-nav-login:hover, .public-nav a.public-nav-login:focus { color: #1c2430; }
html[data-theme="dark"] .public-nav a.public-nav-login:link,
html[data-theme="dark"] .public-nav a.public-nav-login:visited { color: var(--muted); }

/* ═══ design-system shared primitives (packet PR-0(b)) ═════════════════════════
   Canonical source: mockups/design_system/specimen.html — the visual
   constitution (research/MASTER_PRODUCT_DESIGN_SYSTEM_V1.md). These live HERE,
   not in a page template, so build_site.py and build_vector.py templates consume
   ONE definition instead of re-inventing a local family each.

   NAMESPACE LAW (red-team 2026-08-12): every new primitive is .mx-*. The
   unprefixed names these were drafted under (.ladder / .chg-row / .empty)
   collide with 11+ existing page-local class families across templates/.

   DS-PR-0 FORWARD-COMPAT: the specimen styles these with the proposed token
   scales (--sp-*, --r-*). Those scales are NOT part of this PR, so each such
   reference carries the specimen's own value as a var() fallback. When DS-PR-0
   lands the scales at :root the tokens win and the fallbacks go inert — no
   follow-up edit needed here. */

/* DecisionRow — one scannable "what changed" line. */
.mx-chg-row { display:flex; align-items:center; gap:10px; padding:9px 2px;
  border-bottom:1px solid var(--line); text-decoration:none; color:inherit; }
.mx-chg-row:last-child { border-bottom:none; }
.mx-chg-name { font-weight:700; font-size:var(--fs-md); flex:none; }
.mx-chg-what { color:var(--text); font-size:var(--fs-sm); flex:1; min-width:0; }
/* inert until .mx-stance itself lands; kept so the row's contract stays whole */
.mx-chg-row .mx-stance { flex:none; font-size:var(--fs-label); padding:3px 9px; }
.mx-chg-chev { color:var(--muted); flex:none; }
@media (max-width:640px) {
  .mx-chg-row { flex-wrap:wrap; row-gap:4px; }
  .mx-chg-what { flex-basis:100%; order:3; }
}

/* Empty state — never a bare blank. .mx-empty-why is REQUIRED alongside
   .mx-empty: doctrine says a null is disclosed in plain words, so the state
   always carries its reason. */
.mx-empty { padding:var(--sp-6,24px) var(--sp-4,16px); text-align:center; }
.mx-empty-line { font-size:var(--fs-md); font-weight:600; }
.mx-empty-why { color:var(--muted); font-size:var(--fs-sm); margin-top:4px; }

/* Loading + error states — the other two non-live states next to .mx-empty
   above. Loading is true geometry with no words (skeleton shimmer); error
   names what failed and what still works, never a bare "—" (doctrine, see
   the design-system's null-disclosure law). Ported verbatim from
   mockups/design_system/specimen.html:112-116 — P-MP1-SHELL / DS-PR gate:
   MP-1 Amendment 1 V-B4 makes review of §10's loading/error states
   blocking against these two specimen components. No consumer wired here;
   the shell builder owns the markup (blast radius = 0, see PR body).

   --r-ctl/--r-card are DS-PR-0 scales not yet landed at :root — same
   FORWARD-COMPAT situation the section header above documents, and the
   same idiom .mx-ladder below already uses (var(--r-btn,10px)): each
   fallback is the specimen's OWN :root value (specimen.html:24 —
   --r-ctl:8px, --r-card:12px), not an invented one. Both fallbacks go
   inert the moment DS-PR-0 lands the scale. */
.skel { border-radius:var(--r-ctl,8px); background:linear-gradient(90deg, var(--panel2) 25%, color-mix(in srgb, var(--text) 7%, var(--panel2)) 45%, var(--panel2) 65%); background-size:200% 100%; animation:skel 1.2s linear infinite; }
@keyframes skel { to { background-position:-200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation:none; } }
.mx-error { display:flex; align-items:flex-start; gap:10px; border:1px solid color-mix(in srgb, var(--warn) 34%, var(--line));
  border-radius:var(--r-card,12px); padding:10px 14px; font-size:var(--fs-sm); background:color-mix(in srgb, var(--warn) 6%, var(--panel)); }
.mx-error b { color:var(--ink-warn); }

/* Count ladder — control form; the active cell reads as WEIGHT (solid underline
   + 800), never as hue.

   SCOPE RIDER — binding (Sol §J.9 ruling, 2026-08-12): .mx-ladder is scoped to
   Prophet / lifecycle-derived surfaces and MUST NOT proliferate as a generic
   site-wide control. It is the signature device of one archetype, not a general
   segmented-control primitive; reach for it only where the counts it ladders are
   lifecycle-derived.

   FORM RIDER (C8-C): the two ladder forms are DISJOINT, not cascaded. Every rule
   below that can reach a board child — this block's, and the shared focus-visible
   rule at the end of the section — excludes .mx-ladder--board, so an element
   carrying both classes cannot inherit half of one form. `:last-child` and
   `[aria-pressed]` here out-specify a bare `.mx-cell` and would otherwise strip
   the terminal cell's dashed rule and double-mark selection. The exclusion is
   written on the .mx-lad-total rules too even though the board ladder emits no
   total cell (its headline sits out of the device): "cannot reach it today" is a
   markup fact that a later edit can repeal, and the guard that enforces this is
   cheaper to keep absolute than to teach which children are safe.
   Because the board form can no longer match any of them, it also needs no
   counter-resets — a `border:none` there would only mask a future accidental
   removal of a :not() qualifier. Guarded by
   test_the_two_ladder_forms_are_disjoint. */
.mx-ladder:not(.mx-ladder--board) { display:flex; align-items:stretch; gap:0;
  border:1px solid var(--line); border-radius:var(--r-btn,10px); overflow:hidden; }
.mx-ladder:not(.mx-ladder--board) .mx-lad-total { padding:8px 14px; font-weight:800;
  font-size:var(--fs-md); border-right:1px solid var(--line); background:var(--panel2); }
.mx-ladder:not(.mx-ladder--board) .mx-lad-total small { display:block;
  font-size:var(--fs-micro); font-weight:600; color:var(--muted); }
/* The display:block above ties the language toggle on specificity — both land at
   (0,2,1) — and this file's toggle sits EARLIER (see "language visibility
   toggle"), so source order hands the tie to the rule above and BOTH language
   labels printed in the total cell under zh. Restore the toggle explicitly. */
html:not([data-lang="zh"]) .mx-ladder:not(.mx-ladder--board) .mx-lad-total small.l-zh,
html[data-lang="zh"] .mx-ladder:not(.mx-ladder--board) .mx-lad-total small.l-en { display:none; }
.mx-ladder:not(.mx-ladder--board) button { appearance:none; background:none; border:none;
  border-right:1px solid var(--line); padding:8px 12px;
  font:600 var(--fs-sm)/1.2 var(--font-ui); color:var(--muted); cursor:pointer; }
.mx-ladder:not(.mx-ladder--board) button:last-child { border-right:none; }
.mx-ladder:not(.mx-ladder--board) button b { display:block; font-size:var(--fs-md);
  color:var(--text); font-variant-numeric:tabular-nums; }
.mx-ladder:not(.mx-ladder--board) button[aria-pressed="true"] { color:var(--text);
  font-weight:800; box-shadow:inset 0 -3px 0 var(--text); }

/* ── the BOARD ladder (.mx-ladder--board) + the lifecycle weight grammar ───────
   Landed by C8-C, the Design-System PR chartered by the R4 composition verdict
   (research/reference_integrity/prophet-board-5514-r4-composition/verdict.yml).
   Source geometry: mockups/refs/institutionalize/us_stocks/board.css:221-387,
   the ratified reference; grammar: its DESIGN_NOTES §3/§4b.

   WHY A MODIFIER RATHER THAN A REPLACEMENT (verdict ruling n1). R4's ladder — a
   grid of enclosed cells with a per-cell weight cap and a terminal cell held
   visibly outside the live sum — is CANONICAL for archetype-B board pages. The
   flex bar above stays: it is the specimen's generic illustration, and the
   operator-ruled seven-cell partition + two-total law simply cannot fit a
   single-total bar. Two forms, one family, one namespace; the board form is
   opt-in and greppable, so nothing that ships the bar today changes a byte.
   Every board-form rule below carries the .mx-ladder--board prefix for a second
   reason as well: `.mx-ladder button` above is (0,1,1) and would otherwise WIN
   over a bare `.mx-cell` (0,1,0) and repaint every cell's border and padding.

   The SCOPE RIDER on the bar (Sol §J.9) binds here unchanged, and harder: this
   form is the signature device of ONE archetype. Reach for it only where the
   counts it ladders are lifecycle-derived and exhaustive.

   DIRECTION-NEUTRAL BY CONSTRUCTION. The whole grammar paints in currentColor,
   --text and --muted — no --up/--down/--q* hue ever touches a lifecycle mark. So
   it is byte-identical under the zh direction flip, and it never competes with
   the stance ramp for meaning: lifecycle is WEIGHT, stance is HUE.

   The 11px/9px radii and 18px/11.5px sizes below are the reference's measured
   geometry, deliberately not re-keyed to the --r- or --fs- scales: the enclosure reads
   against the card radius rather than the button scale, and 11.5px is what fits
   six labels across without ellipsis at the widths this ladder actually runs at.
   ───────────────────────────────────────────────────────────────────────────── */
.mx-ladder--board { display:grid; align-items:stretch; gap:0;
  grid-template-columns:repeat(6, minmax(0, 1fr)) 15px minmax(0, .9fr); }

/* The live enclosure: cells 1-6 share one recessed band, so "these six sum to the
   headline" is a visual fact rather than a caption. */
.mx-ladder--board .mx-cell { position:relative; display:flex; flex-direction:column;
  gap:2px; padding:11px 10px 8px; min-width:0;   /* top padding clears the weight cap */
  background:color-mix(in srgb, var(--panel) 72%, transparent);
  border:1px solid var(--line); border-right-width:0;
  font:inherit; color:inherit; text-align:left; overflow:hidden;
  transition:background .13s, border-color .13s; }
.mx-ladder--board .mx-cell:first-child { border-radius:11px 0 0 11px; }
.mx-ladder--board .mx-cell--last-live { border-right-width:1px; border-radius:0 11px 11px 0; }
/* Affordance follows interactivity. The ladder renders static <div> cells on the
   surfaces where filtering is not offered (locked tier, print), and a pointer
   cursor plus a hover wash on a cell that does nothing is a promise the page
   cannot keep — so both are scoped to the button form. */
.mx-ladder--board button.mx-cell { cursor:pointer; }
.mx-ladder--board button.mx-cell:hover { background:color-mix(in srgb, var(--text) 6%, var(--panel)); }
.mx-ladder--board .mx-cell:focus-visible { outline:2px solid var(--ink-link);
  outline-offset:2px; z-index:3; }

.mx-ladder--board .mx-cell-n { font-size:18px; font-weight:800; line-height:1;
  letter-spacing:-.025em; font-variant-numeric:tabular-nums; color:var(--text); }
.mx-ladder--board .mx-cell-l { font-size:11.5px; font-weight:650; line-height:1.25;
  color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* zero is honest inventory for a producing cell — it recedes, it does not vanish */
.mx-ladder--board .mx-cell[data-zero="1"] .mx-cell-n { color:var(--muted); opacity:.75; }
/* key-absence is NOT zero — an em dash, never a silent 0 */
.mx-ladder--board .mx-cell[data-absent="1"] .mx-cell-n { color:var(--muted); opacity:.6; }

/* The terminal cell: visibly OUTSIDE the live sum, because a closed plan is
   record rather than inventory. The divider owns a column of its own so the
   separation survives every width. */
.mx-ladder--board .mx-ladder-gap { position:relative; }
.mx-ladder--board .mx-ladder-gap::before { content:""; position:absolute; left:50%;
  top:9px; bottom:9px; width:1px; background:var(--line); }
.mx-ladder--board .mx-cell--term { background:transparent;
  border:1px dashed var(--line); border-radius:11px; }
.mx-ladder--board .mx-cell--term .mx-cell-n { color:var(--muted); }
.mx-ladder--board .mx-ladder-termnote { grid-column:8; font-size:9.5px; line-height:1.3;
  color:var(--muted); padding:5px 3px 0; text-align:left; }

/* SELECTION — never violet; violet is lock-only estate-wide. Identity and
   selection ride deliberately separate channels so they can never collide:
   identity is the weight MARK (a short inset rule under the label), selection is
   the CELL CHROME (fill + a full-bleed heavier rule). Different width, different
   position, different property — a selected Watch cell still reads as dashed. */
.mx-ladder--board .mx-cell[aria-pressed="true"] {
  background:color-mix(in srgb, var(--text) 11%, var(--panel));
  border-color:color-mix(in srgb, var(--text) 34%, var(--line)); z-index:2; }
.mx-ladder--board .mx-cell[aria-pressed="true"]::after { content:""; position:absolute;
  left:0; right:0; bottom:0; height:3px; background:var(--text); }
.mx-ladder--board .mx-cell[aria-pressed="true"] .mx-cell-l { color:var(--text); }

/* ── THE SIX-WEIGHT LIFECYCLE GRAMMAR ────────────────────────────────────────
   ONE grammar, two scales, in two different places:
     .mx-cap  — a full-bleed 3px cap at the top of a LADDER CELL. Ladder only:
                the card's top cap was repealed so it would stop competing with
                the chart for the card's head, and that repeal is law. The cap's
                base rule and its content:"" are therefore SCOPED to .mx-cell,
                which makes the law structural — a .mx-cap emitted anywhere else
                generates no box at all rather than a stray 3px artefact.
     .mx-mark — the same six weights at inline scale (26x8px), for the card's
                lifecycle fact column, the table cell and the absence line.
   So the ladder-to-card link is carried by the INLINE MARK, not by a shared cap:
   the same six weights on both surfaces, each at the scale that surface can
   afford. Identical grammar, deliberately non-identical geometry. */
.mx-cell > .mx-cap { position:absolute; top:0; left:0; right:0; height:3px;
  color:var(--text); pointer-events:none; }
.mx-mark { position:relative; display:inline-block; width:26px; height:8px; flex:none;
  color:var(--text); vertical-align:middle; }
.mx-cell > .mx-cap::before, .mx-mark::before { content:""; position:absolute; inset:0; }

/* Watch — dashed hairline: a signal fired, nothing is committed */
.mx-cap--watch::before  { background:repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 9px); }
.mx-mark--watch::before { top:3px; height:2px;
  background:repeating-linear-gradient(90deg, currentColor 0 3px, transparent 3px 6.5px); }
/* Ready — half filled: the plan is armed, the position is not open yet */
.mx-cap--ready::before  { background:linear-gradient(90deg, currentColor 0 50%,
  color-mix(in srgb, currentColor 16%, transparent) 50%); }
.mx-mark--ready::before { top:2.5px; height:3px;
  background:linear-gradient(90deg, currentColor 0 50%,
  color-mix(in srgb, currentColor 20%, transparent) 50%); }
/* Entered — solid: a live commitment */
.mx-cap--entered::before  { background:currentColor; }
.mx-mark--entered::before { top:2.5px; height:3px; background:currentColor; }
/* Delivering — the SAME commitment weight as Entered, not a re-encoding, with the
   first target it has reached marked at the end of the run. Entered is a plain
   bar; Delivering is a bar that arrives somewhere. (Before this distinction
   existed, the one difference a holder cares about most had no visual difference
   at all.) */
.mx-cap--delivering::before { background:currentColor; }
/* .mx-cell-scoped like the base rule: this ::after declares its own content, so an
   unscoped copy would paint a stray currentColor bar outside a ladder and falsify
   the containment law the base rule establishes. */
.mx-cell > .mx-cap--delivering::after { content:""; position:absolute; right:0; top:0;
  width:22%; height:6px; background:currentColor; }
.mx-mark--delivering::before { top:2.5px; height:3px; background:currentColor; }
.mx-mark--delivering::after { content:""; position:absolute; right:0; top:0;
  width:5px; height:8px; border-radius:1px; background:currentColor; }
/* Overtime — solid muted: the declared window expired, the plan is still open */
.mx-cap--overtime::before  { background:color-mix(in srgb, currentColor 34%, transparent); }
.mx-mark--overtime::before { top:2.5px; height:3px;
  background:color-mix(in srgb, currentColor 42%, transparent); }
/* Invalidated — hollow + struck: the plan's own stated void level was hit */
.mx-cap--invalidated::before { top:1px; bottom:0; background:transparent;
  border-top:1px solid color-mix(in srgb, currentColor 60%, transparent);
  border-bottom:1px solid color-mix(in srgb, currentColor 60%, transparent); }
/* .mx-cell-scoped for the same reason as Delivering's ::after above. */
.mx-cell > .mx-cap--invalidated::after { content:""; position:absolute; left:0; right:0; top:1.5px;
  height:1px; background:repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 10px); }
.mx-mark--invalidated::before { top:2.5px; height:3px; background:transparent;
  border:1px solid color-mix(in srgb, currentColor 62%, transparent); }
.mx-mark--invalidated::after { content:""; position:absolute; left:-1px; right:-1px;
  top:3.5px; height:1px; background:currentColor; transform:rotate(-9deg); }
/* Resolved — neutral outline: graded out, archive weight */
.mx-cap--resolved, .mx-mark--resolved { color:var(--muted); }
.mx-cap--resolved::before { top:1px; bottom:0; background:transparent;
  border-top:1px solid color-mix(in srgb, var(--muted) 52%, transparent);
  border-bottom:1px solid color-mix(in srgb, var(--muted) 52%, transparent); }
.mx-mark--resolved::before { top:2.5px; height:3px; background:transparent;
  border:1px solid color-mix(in srgb, var(--muted) 55%, transparent); }

/* Light plane: the recessed band reads as a wash on a white page, so the cells
   take the card surface itself. */
html[data-theme="light"] .mx-ladder--board .mx-cell { background:var(--panel); }

/* ≤720px: the ladder keeps its full 4+3 wrap and EVERY count. The divider
   survives rather than collapsing — it used to be display:none, which turned the
   terminal cell into the third cell of an ordinary row and left "Resolved sits
   outside the total" resting on a caption alone, on exactly the viewport where a
   count claim is most likely to be misread. */
@media (max-width:720px) {
  .mx-ladder--board { grid-template-columns:repeat(4, minmax(0, 1fr)); gap:5px; }
  .mx-ladder--board .mx-ladder-gap { display:block; }
  .mx-ladder--board .mx-ladder-gap::before { top:4px; bottom:4px; }
  .mx-ladder--board .mx-cell { border-right-width:1px; border-radius:9px;
    padding:9px 9px 7px; }
  .mx-ladder--board .mx-cell:first-child,
  .mx-ladder--board .mx-cell--last-live { border-radius:9px; }
  .mx-ladder--board .mx-cell-l { font-size:10.5px; white-space:normal; }
  .mx-ladder--board .mx-ladder-termnote { grid-column:4; text-align:left; padding:4px 2px 0; }
}

/* keyboard affordance for the two interactive primitives landed here. Qualified
   like the rest of the bar block: the board form ships its own focus ring
   (--ink-link, offset 2, z-index 3) and :where() contributes NO specificity, so
   an unqualified rule here would be a second focus declaration whose precedence
   rests on source order alone. */
:where(.mx-chg-row, .mx-ladder:not(.mx-ladder--board) button):focus-visible {
  outline:2px solid color-mix(in srgb, var(--link) 70%, transparent); outline-offset:2px; }

/* ── TOUCH FLOOR for the estate's inherited small controls (MPDS §14, ≥40x40) ──
   Landed by C8-C. The C8 composition review measured three shared controls under
   the floor on a 390px board — the `?` help dot at 17px, the Grid/Table segmented
   toggle at ~22px, and the ⚠N caution pill at 19px, which on touch is the ONLY
   route to a card's safety copy. All three are inherited estate debt, not a
   migration defect, so the cure belongs here in the shared sheet rather than as a
   page-scoped fork.

   THE VISUAL SIZE IS NOT THE DEFECT. A 17px `?` beside a heading is correct
   typography; a 40px one would shout over the text it annotates. What was wrong
   was the TARGET. So two different instruments, chosen per control:

     · isolated controls (`?`, ⚠N) get an invisible ::after that extends the hit
       area to 40x40 around the unchanged glyph. Layout, ink and desktop bytes are
       untouched.
     · the segmented toggle gets REAL height, because its buttons are adjacent:
       overlapping invisible targets do not enlarge a target, they hand taps near
       the seam to whichever control paints last.

   Gated on `pointer: coarse` — the floor is a touch obligation, and both isolated
   controls open on hover, so a fine pointer must keep its exact trigger area or
   popovers start firing at nothing. */
@media (pointer: coarse) {
  /* `?` — .lens-q's visible chrome is injected by theme.js; only the target is set
     here, and ::after is a property that injection never declares, so no cascade
     race exists between the two sheets. */
  .lens-q { position:relative; }
  .lens-q::after { content:""; position:absolute; top:50%; left:50%;
    width:40px; height:40px; transform:translate(-50%,-50%); }
  /* ⚠N caution pill (_prophet_card.html.j2) — it sits in an absolutely positioned
     overlay row above the sparkline, so growing the box would push the row over
     the chart. The pill keeps its 19px; the tap does not. */
  .pv-cau-btn { position:relative; }
  .pv-cau-btn::after { content:""; position:absolute; top:50%; left:50%;
    min-width:40px; min-height:40px; width:100%; height:100%;
    transform:translate(-50%,-50%); }
  /* Grid/Table view toggle (declared page-locally on every board that ships it;
     none of them set a height, so this reaches all of them without a fork). */
  .st-view-toggle button { min-height:40px; }
}

/* ===================== debt maturity ladder (_debt_maturity.html.j2, packet B-F09-3) =====================
   Moved out of the partial's own inline <style> (META-CEO ruling round 2, B3 —
   an inline <style> block is a design-system bypass; governed CSS owns material
   decisions). DARK TREATMENT = command center: achromatic bars on a near-black
   track, --prov is the ONLY hue on this panel and means exactly one thing (a
   bucket was not reported) via a dashed hollow track. LIGHT TREATMENT = research
   workspace: ink-on-paper bars, hairline row rules instead of a track fill, and
   the null state reads as a HATCHED texture (not just a color swap) because a
   dashed outline alone reads too faint against white paper. Differs
   intentionally: row separators (none in dark; a hairline per row in light),
   the rail's edge (a vertical hairline in dark; a heavier top rule in light,
   matching the research-workspace "shadow instead of glow" law), and the null
   texture (hollow dashed in dark; hatched dashed in light). Everything else —
   grid geometry, type scale, spacing, EN/ZH label widths, motion — is shared,
   because it is information architecture, not material. */
.dmw{display:grid;grid-template-columns:minmax(0,1fr) 236px;gap:22px;align-items:start;}
.dmw.dmw-no-rail{grid-template-columns:minmax(0,1fr);}
.dmw-lede{margin:0 0 14px;font-size:13.5px;line-height:1.55;}
.dmw-rows{display:flex;flex-direction:column;gap:9px;min-width:0;}
.dmr{display:grid;grid-template-columns:12ch minmax(0,1fr) 11ch;align-items:center;gap:12px;min-width:0;}
.dmr-lb{font-size:12px;font-weight:600;color:var(--muted);}
.dmr-tr{position:relative;height:26px;border-radius:var(--r-ctl,8px);overflow:hidden;
  background:color-mix(in srgb,var(--text) 6%,transparent);}
.dmr-bar{position:absolute;left:0;top:0;bottom:0;width:var(--w,0%);border-radius:var(--r-ctl,8px);
  background:color-mix(in srgb,var(--text) 22%,transparent);
  border-top:1px solid color-mix(in srgb,var(--text) 38%,transparent);}
.dmr-val{font-family:var(--num);font-variant-numeric:tabular-nums;font-size:13px;font-weight:700;text-align:right;}
.dmr.na .dmr-tr{background:transparent;border:1px dashed color-mix(in srgb,var(--prov) 55%,transparent);}
/* Adjudication (r4 MINOR-1): "not reported" / "未披露" is a non-interactive
   absence, not a provenance link. --prov-ink is the TEXT-grade provenance
   hue and reads as interactive/link blue in both themes. --muted is the
   estate's quiet-absence ink (labels, footnotes, hints). The --prov hue
   stays on the dashed/hatched TRACK — that is the sanctioned null texture. */
.dmr.na .dmr-val{font-family:var(--font-ui);font-size:11.5px;font-weight:600;color:var(--muted);}
/* Round-2 review MINOR-4: a REPORTED zero (real "$0", a zero-width bar) and
   an UNREPORTED bucket (dashed/hatched track, no bar) read as near-identical
   empty boxes at a glance. This tick is the one thing that says "a number
   was given, and it was zero" -- present only when `reported` is true. */
.dmr-zero::before{content:"";position:absolute;left:0;top:3px;bottom:3px;width:3px;
  border-radius:var(--r-ctl,8px);background:color-mix(in srgb,var(--text) 45%,transparent);}
.dmw-rail{border-left:1px solid var(--hair);padding-left:18px;}
.dmw-tl{font-size:11px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.07em;}
.dmw-total{font-family:var(--num);font-variant-numeric:tabular-nums;font-size:24px;font-weight:800;letter-spacing:-.02em;margin-top:4px;}
.dmw-note,.dmw-src{font-size:11.5px;color:var(--muted);line-height:1.55;margin:10px 0 0;}
.dmw-null{margin:0;font-size:14px;font-weight:600;}
.dmw-nullwhy{margin:6px 0 0;font-size:12.5px;color:var(--muted);line-height:1.55;}
.dmw-detail{margin-top:12px;font-size:11.5px;color:var(--muted);}
.dmw-detail summary{cursor:pointer;font-weight:600;}
.dmw-detail code{font-family:var(--font-mono);font-size:10.5px;word-break:break-all;}
html[data-lang="zh"] .dmw-tl{text-transform:none;letter-spacing:.02em;}
html[data-lang="zh"] .dmr{grid-template-columns:10ch minmax(0,1fr) 11ch;}
/* LIGHT — research workspace: ink on paper, hairline rules, hatched null. */
[data-theme="light"] .dmr{border-bottom:1px solid var(--hair);padding-bottom:7px;}
[data-theme="light"] .dmr-tr{background:var(--panel2);border:1px solid var(--hair);}
[data-theme="light"] .dmr-bar{background:color-mix(in srgb,var(--text) 78%,transparent);border-top:0;}
[data-theme="light"] .dmr.na .dmr-tr{border:1px dashed color-mix(in srgb,var(--prov) 60%,transparent);
  background:repeating-linear-gradient(135deg,color-mix(in srgb,var(--text) 6%,transparent) 0 3px,transparent 3px 7px);}
[data-theme="light"] .dmw-rail{border-left:0;border-top:2px solid var(--text);padding:12px 0 0;}
/* motion — reuses the page .rv reveal, no new clock */
html.has-js .rv .dmr-bar{transform:scaleX(0);transform-origin:left center;}
html.has-js .rv.in .dmr-bar{transform:none;transition:transform .5s cubic-bezier(.22,.9,.26,1.02);transition-delay:calc(var(--i,0)*45ms);}
@media(prefers-reduced-motion:reduce){html.has-js .rv .dmr-bar,html.has-js .rv.in .dmr-bar{transform:none;transition:none;}}
@media(max-width:760px){
  .dmw{grid-template-columns:1fr;gap:16px;}
  .dmw-rail{order:-1;border-left:0;border-bottom:1px solid var(--hair);padding:0 0 12px;}
  [data-theme="light"] .dmw-rail{border-top:2px solid var(--text);border-bottom:0;padding:12px 0 0;}
  .dmr{grid-template-columns:1fr auto;grid-template-areas:"lb val" "tr tr";row-gap:6px;}
  .dmr-lb{grid-area:lb;} .dmr-val{grid-area:val;} .dmr-tr{grid-area:tr;height:22px;}
}
/* end debt maturity ladder */

/* ===================== cash runway (_debt_maturity.html.j2, packet B-F09-3 second slice) =====================
   Reuses the ladder's .dmw-lede / .dmw-null / .dmw-nullwhy tokens and the
   same mod-ft footer. Dark/light treatment is inherited from the ladder panel
   above (same section, same #debt-maturity / #cash-runway parent). No new
   colours — same tokens as the ladder rules above. */
.dmw-runway{margin-top:28px;padding-top:22px;
  border-top:1px solid color-mix(in srgb,var(--hair) 60%,transparent);}
[data-theme="light"] .dmw-runway{
  border-top-color:var(--hair);}
/* end cash runway */

/* account sheet: alert delivery preferences (B-F08-1a) */
.mmacc-alerts{position:relative;padding-left:14px}
.mmacc-alerts::before{content:"";position:absolute;left:0;top:13px;bottom:13px;width:2px;border-radius:var(--r-ctl,8px);background:var(--line);transition:background .22s ease,box-shadow .22s ease}
.mmacc-alerts[data-on="true"]::before{background:linear-gradient(180deg,var(--ok),color-mix(in srgb,var(--ok) 26%,transparent));box-shadow:0 0 10px -3px color-mix(in srgb,var(--ok) 55%,transparent)}
.mmacc-alerts[data-state="unknown"]::before{background:color-mix(in srgb,var(--muted) 40%,transparent);box-shadow:none}
.mmacc-alerts[data-quiet="true"]::after{content:"";position:absolute;left:0;bottom:13px;width:2px;height:34%;border-radius:var(--r-ctl,8px);background:repeating-linear-gradient(180deg,color-mix(in srgb,var(--ok) 70%,transparent) 0 4px,transparent 4px 8px)}
.mmacc-k-lead{color:var(--text);font-weight:600}
.mmacc-sublabel{font-size:var(--fs-label,11px);font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--muted);margin:12px 0 6px}
button.mmacc-switch{width:34px;height:20px;border-radius:var(--r-pill,999px);background:var(--panel2);border:1px solid var(--line);position:relative;flex:none;padding:0;cursor:pointer;opacity:1;font-family:var(--font-ui,inherit);transition:background .18s ease,border-color .18s ease}
button.mmacc-switch::after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:var(--r-pill,999px);background:var(--muted);transition:transform .18s cubic-bezier(.2,.9,.3,1.1),background .18s ease}
button.mmacc-switch[aria-checked="true"]{background:var(--ok);border-color:var(--ok)}
button.mmacc-switch[aria-checked="true"]::after{transform:translateX(14px);background:var(--panel)}
button.mmacc-switch:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--link) 22%,transparent)}
.mmacc-switch-sm{width:30px;height:18px}
.mmacc-switch-sm::after{width:12px;height:12px}
.mmacc-switch-sm[aria-checked="true"]::after{transform:translateX(12px)}
.mmacc-field.mmacc-alert-detail{max-height:0}
.mmacc-field.mmacc-alert-detail.open{max-height:min(80vh,960px)}
.mmacc-select{appearance:none;background-image:none;cursor:pointer}
.mmacc-timepair{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.mmacc-time{width:auto;min-width:0;flex:1 1 108px;margin-bottom:0}
.mmacc-timesep{color:var(--muted);font-size:var(--fs-sm,12.5px);flex:none}
.mmacc-hint-off,.mmacc-hint-unknown,.mmacc-hint-none{margin-top:7px}
.mmacc-hint-unknown{color:var(--ink-warn,var(--warn))}
:root[data-theme="light"] .mmacc-alerts{background:var(--panel);border:1px solid var(--line);border-radius:var(--r-card,12px);padding:11px 12px 11px 14px;box-shadow:var(--card-shadow)}
:root[data-theme="light"] .mmacc-alerts[data-on="true"]::before{background:var(--ok);box-shadow:none}
:root[data-theme="light"] button.mmacc-switch[aria-checked="true"]::after{background:var(--panel);border:1px solid color-mix(in srgb,var(--text) 12%,transparent)}
:root[data-theme="light"] .mmacc-time,:root[data-theme="light"] .mmacc-select{background:var(--panel)}
@media (max-width:560px){.mmacc-timepair{gap:6px}.mmacc-time{flex:1 1 100%}.mmacc-timesep{display:none}}
@media (prefers-reduced-motion:reduce){.mmacc-alerts::before,button.mmacc-switch,button.mmacc-switch::after{transition:none}}
/* end account sheet: alert delivery preferences (B-F08-1a) */

/* ════════════════════════════════════════════════════════════════════════════════
   .mx-spine — Unified Macro Dashboard regime spine (UD-B1 §3, spec §3)

   The signature primitive of the Unified Macro Dashboard (archetype D,
   regime_dashboard). One horizontal scale (Risk-off ←→ Risk-on) reused identically
   by five market rows. Each row carries: today's position (solid marker), the
   position it came from a month ago (hollow marker), a thin connector between
   them, a signed travel figure, and a plain stance word.

   Encoding rules (each is a law being obeyed, not a style choice):
   • Position uses neutral geometry; the marker takes its stance's ink, NEVER a
     category hue. Travel uses muted measurement ink + an explicit arrow, NEVER
     --up / --down (this dodges the 红涨绿跌 flip — a travel figure means the same
     thing in both languages).
   • Stance ink encodes health, and health never flips: Act / Get ready → --ink-ok;
     Watch — don't chase / Protect gains → --ink-warn; Stand aside / Ignore → --muted.
     Three levels, achromatic by default; colour only where it means severity.
   • Zone ticks at 25 / 50 / 75 are notches, not labels. The axis is anchored in
     WORDS (Risk-off · Neutral · Risk-on), never in a bare 0–100.
   • The subject market (e.g. US stocks) is the only marked subject, one per spine.
   • The null row is designed: dashed rail, no marker, "Read being updated" chip.
     Not a blank, not an em-dash, and never falsifier vocabulary.

   Token substitution alone is never proof of a light design — the spine has
   theme-specific mechanisms (the bloom vs ring on the subject marker; the rail
   track border; the raw ink vs ink-rung state ink). See spec §5 row 2/3/8.
   ════════════════════════════════════════════════════════════════════════════════ */

/* axis — one shared rail with notches */
.mx-spine{
  --mxsp-rail-h: 6px;
  --mxsp-notch-w: 1px;
  --mxsp-marker-d: 14px;
  --mxsp-marker-d-subject: 18px;
  --mxsp-rail-bg: color-mix(in srgb, var(--line) 70%, transparent);
  --mxsp-rail-brd: transparent;
  --mxsp-notch-bg: var(--line);
  --mxsp-travel-ink: var(--ink-3);
  --mxsp-zone-ink: var(--muted);
  display:flex; flex-direction:column; gap:0;
  padding: var(--sp-4,16px) 0 0;
  font-family: var(--num, var(--font-mono));
}
.mx-spine-head{
  display:grid; grid-template-columns: 150px 1fr 78px 168px;
  gap:14px; align-items:center;
  padding: 0 0 8px;
  border-bottom:1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.mx-spine-head > span{
  font-size:var(--fs-micro); font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--muted);
}
html[data-lang="zh"] .mx-spine-head > span{ letter-spacing:0; text-transform:none; }
/* Spec §11 item 5: Noto Sans SC has no 600/800. The ZH ramp maps 800→Black
   and 600→Medium (the file's proxy for PingFang SC / Noto Sans CJK SC); this
   mapping is a documented decision, not an accident. ZH 390 evidence
   confirms the rendered glyphs (美股 / 香港 / 避险 / 趋险) hold weight
   contrast and stay inside the spec §1 column widths at the design floor. */

/* a single row — five markets on one rail */
.mx-spine-row{
  display:grid; grid-template-columns: 150px 1fr 78px 168px;
  gap:14px; align-items:center;
  padding: 10px 0;
  border-bottom:1px solid color-mix(in srgb, var(--line) 40%, transparent);
}
.mx-spine-row:last-of-type{ border-bottom:none; }
.mx-spine-name{
  font-size:var(--fs-md); font-weight:600; color:var(--text);
  display:flex; flex-direction:column; gap:2px;
}
.mx-spine-name small{
  font-size:var(--fs-micro); color:var(--muted); font-weight:400;
}

/* the rail with notches */
.mx-spine-rail{
  position:relative; height: var(--mxsp-rail-h);
  background: var(--mxsp-rail-bg);
  border: 1px solid var(--mxsp-rail-brd);
  border-radius: var(--r-pill,999px);
}
/* notches at 25 / 50 / 75 (not labels — just visual ticks cutting through the rail) */
.mx-spine-rail::before,
.mx-spine-rail::after,
.mx-spine-rail .mx-spine-n25,
.mx-spine-rail .mx-spine-n50,
.mx-spine-rail .mx-spine-n75{
  content:""; position:absolute; top:50%; transform:translateY(-50%);
  width: var(--mxsp-notch-w); height: calc(var(--mxsp-rail-h) + 8px);
  background: var(--mxsp-notch-bg);
}
.mx-spine-rail .mx-spine-n25{ left:25%; }
.mx-spine-rail .mx-spine-n50{ left:50%; }
.mx-spine-rail .mx-spine-n75{ left:75%; }
/* axis-anchor words sit just under the rail */
.mx-spine-anchors{
  display:flex; justify-content:space-between;
  margin-top:6px;
  font-size:var(--fs-micro); font-weight:600; letter-spacing:.04em;
  color:var(--mxsp-zone-ink);
}
.mx-spine-anchors .mx-spine-a-mid{ margin:0 auto; }
html[data-lang="zh"] .mx-spine-anchors{ letter-spacing:0; }

/* the marker (today) — solid disc in the stance's ink */
.mx-spine-mark{
  position:absolute; top:50%;
  width: var(--mxsp-marker-d); height: var(--mxsp-marker-d);
  border-radius:var(--r-pill,999px);
  transform: translate(-50%, -50%);
  background: var(--mxsp-mark-ink, var(--muted));
  z-index:2;
}
/* the older marker (month-ago) — hollow */
.mx-spine-prev{
  position:absolute; top:50%;
  width: 9px; height: 9px;
  border-radius:var(--r-pill,999px);
  transform: translate(-50%, -50%);
  background: var(--panel);
  border: 1.5px solid var(--mxsp-mark-ink, var(--muted));
  z-index:1;
  opacity:.55;
}
/* the thin connector between them */
.mx-spine-conn{
  position:absolute; top:50%; height: 1.5px;
  background: var(--mxsp-mark-ink, var(--muted));
  opacity:.4;
  transform:translateY(-50%);
  z-index:1;
}
/* the SUBJECT market marker — larger, with a soft bloom on dark / a 2px ring on light */
.mx-spine-row[data-subject="1"] .mx-spine-mark{
  width: var(--mxsp-marker-d-subject); height: var(--mxsp-marker-d-subject);
  background: var(--mxsp-mark-ink, var(--ink-link));
}
html[data-theme="dark"] .mx-spine-row[data-subject="1"] .mx-spine-mark{
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--link) 55%, transparent))
          drop-shadow(0 0 14px color-mix(in srgb, var(--link) 35%, transparent));
}
html[data-theme="light"] .mx-spine-row[data-subject="1"] .mx-spine-mark{
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--mxsp-mark-ink, var(--link)),
              0 2px 4px rgba(20,30,50,.12);
}

/* stance ink — three levels, achromatic by default; colour only where it means severity */
.mx-spine-row[data-stance="act"],
.mx-spine-row[data-stance="get-ready"]{
  --mxsp-mark-ink: var(--ink-ok);
}
.mx-spine-row[data-stance="watch"],
.mx-spine-row[data-stance="protect"]{
  --mxsp-mark-ink: var(--ink-warn);
}
.mx-spine-row[data-stance="stand-aside"],
.mx-spine-row[data-stance="ignore"]{
  --mxsp-mark-ink: var(--muted);
}

/* travel column — signed, muted measurement ink + explicit arrow (never --up/--down) */
.mx-spine-travel{
  font-size:var(--fs-md); font-weight:700;
  font-variant-numeric: tabular-nums;
  color: var(--mxsp-travel-ink);
  display:flex; align-items:center; gap:5px;
}
.mx-spine-travel .mx-spine-arrow{
  font-size: 12px; font-weight:700;
  color: var(--mxsp-travel-ink);
}

/* stance chip on the right — uses .mx-stance tokens */
.mx-spine-stance{ display:flex; justify-content:flex-start; }

/* null row — dashed rail, no marker, "Read being updated" chip */
.mx-spine-row[data-null="1"] .mx-spine-rail{
  background: transparent;
  border: 1px dashed var(--mxsp-rail-bg);
}
.mx-spine-row[data-null="1"] .mx-spine-mark,
.mx-spine-row[data-null="1"] .mx-spine-prev,
.mx-spine-row[data-null="1"] .mx-spine-conn{ display:none; }

/* footnote (once per spine) */
.mx-spine-foot{
  margin-top:10px;
  font-size:var(--fs-micro); color:var(--muted);
  font-weight:400; line-height:1.5;
}

/* ── light theme specific mechanisms (spec §5 row 2/3/8) ──────────────────────
   Token swap alone is NOT a light design. Three mechanisms intentionally differ:
     • spine rail on white gains a 1px track border (neutral segments vanish on white)
     • travel ink uses --ink-* rung (raw fill fails the 4.5:1 floor on white)
     • subject marker becomes a 2px ring (bloom becomes a pastel stain on white).
*/
html[data-theme="light"] .mx-spine{
  --mxsp-rail-brd: color-mix(in srgb, var(--text) 10%, var(--line));
  --mxsp-notch-bg: var(--panel);
  --mxsp-travel-ink: color-mix(in srgb, var(--ink-3) 92%, var(--text));
  --mxsp-zone-ink: color-mix(in srgb, var(--muted) 88%, var(--text));
}

/* ── mobile 390 reduction (spec §7): stacked cards, NOT a squeezed table ──────
   Scale survives; table geometry does not. Each row becomes two rows on the
   card: row 1 = name + stance; row 2 = the same shared rail + travel figure.
   The --mobile:1 opt-in lets the specimen preview the reduction at any
   viewport (used in mockups/design_system/specimen.html §6.6); it does NOT
   affect real production render — only fires alongside the @media query. */
/* (Canonical @media (max-width:640px) spine rule is unified below in the
   .ud-hero block — see UD-B1 §3. The older two-column variant lived here and
   contradicted the spec §7 single-column + grid-template-areas form.) */
/* specimen opt-in: when a `.mx-spine` carries `style="--mobile:1;"` (the
   design_system specimen's §6.6 panel) the reduction also fires at any
   viewport. Real production never sets this flag; the rule is scoped to
   the specimen wrapper class so it cannot leak. */
.mockup-spine-390 .mx-spine-head{ display:none; }
.mockup-spine-390 .mx-spine-row{
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name    stance"
    "rail    rail"
    "travel  travel";
  column-gap: 10px;
  row-gap: 6px;
  padding: 14px 0;
}
.mockup-spine-390 .mx-spine-name{ grid-area: name; flex-direction:row; align-items:center; justify-content:space-between; }
.mockup-spine-390 .mx-spine-stance{ grid-area: stance; align-self:center; }
.mockup-spine-390 .mx-spine-rail-wrap{ grid-area: rail; }
.mockup-spine-390 .mx-spine-travel{ grid-area: travel; }
/* end .mx-spine — UD-B1 §3 */

/* ════════════════════════════════════════════════════════════════════════════════
   Locked-content ghost — spec §11 item 4

   The unified dashboard's locked tier surfaces (driver 4 / locked depth-link
   previews) use a deliberately desaturated blur to read as "this content is
   here, just not yours yet" — NOT as a smudge on white. The recipe is exact:
     filter: blur(5px) saturate(.35) opacity ≈ .42

   Dark keeps the shipped .46 from the light-only stocks sweep (the stocks sweep
   was a light-only design; dark inherits the locked tier .42 to stay consistent
   with the new spec). The light theme ships the spec's exact saturate(.35) +
   opacity .42. (test_design_system checks .mx-tier-blurred across both themes.)
   ════════════════════════════════════════════════════════════════════════════════ */
.mx-tier-blurred--spec{ filter: blur(5px) saturate(.35); opacity:.42; }
html[data-theme="dark"]  .mx-tier-blurred--spec{ opacity:.42; }
/* end locked-content ghost */

/* ════════════════════════════════════════════════════════════════════════════════
   .mx-stance — stance ink chip (UD-B1)

   The hero & spine use a single chip class with a derived `--c` setter that
   downstream rules consume (background, border, ink). Stance ink encoding:
     act / get-ready   → --ink-ok
     watch / protect   → --ink-warn
     stand-aside / ignore → --muted
     narrowing-pill    → --ink-warn (a derived specialty, not a third category)
   Three levels, achromatic by default; colour only where it means severity.
   ════════════════════════════════════════════════════════════════════════════════ */
.mx-stance{
  display:inline-flex; align-items:center; gap:6px;
  font-size:var(--fs-label,11px); font-weight:700;
  padding:4px 11px; border-radius:var(--r-pill,999px);
  background:color-mix(in srgb, var(--c) 12%, var(--panel));
  border:1px solid color-mix(in srgb, var(--c) 28%, var(--line));
  color:color-mix(in srgb, var(--c) 78%, var(--text));
  line-height:1;
}
.mx-stance--ok{ --c: var(--ink-ok); }
.mx-stance--warn{ --c: var(--ink-warn); }
.mx-stance--down{ --c: var(--ink-down); }
.mx-stance--muted{ --c: var(--muted); }
/* end .mx-stance */

/* ════════════════════════════════════════════════════════════════════════════════
   .ud-hero — Unified Macro Dashboard hero (UD-B1, spec §1 / §3 / §5 / §7)

   Verdict hero + score + progress bar + verdict rows + arc gauge (#3/#4/#5/#9/#10)
   plus the regime spine (#11 quad map subsumed per spec §3) plus spec §6
   "What changed" / "Drivers" / "Watching" / "Go deeper" blocks. Dark and light
   are TWO art directions (per CLAUDE.md §Theme art direction): dark = command
   center with luminance depth and restrained glow; light = research workspace
   with cool canvas, hairline discipline, shadow instead of glow. Token swap
   alone is never proof of a light design — the bloom→ring on the subject
   marker is one of three intentionally differing mechanisms (see spec §5).
   ════════════════════════════════════════════════════════════════════════════════ */
body.page-macro #ud-hero{ margin-top:0; }
body.page-macro .ud-hero-panel{
  display:flex; flex-direction:column; gap:var(--sp-5,20px);
}
body.page-macro .ud-hero-head{
  display:flex; align-items:center; gap:var(--sp-3,12px);
  font-family:var(--num,var(--font-mono));
}
body.page-macro .ud-eyebrow{
  font-size:11px; font-weight:700; letter-spacing:.2em; text-transform:uppercase;
  color:var(--ink-2,var(--muted));
}
html[data-lang="zh"] body.page-macro .ud-eyebrow{ letter-spacing:0; text-transform:none; }
/* 390 floor — the EN uppercase + tracking still shreds the small eyebrow;
   drop the tracking and uppercase so both locales render at the same weight. */
@media (max-width:390px){
  body.page-macro .ud-eyebrow{ letter-spacing:.04em; text-transform:none; font-size:10.5px; }
}
body.page-macro .ud-live{
  display:inline-flex; align-items:center; gap:6px;
  font-size:11px; font-weight:700; letter-spacing:.04em;
  color:var(--ink-2,var(--muted));
}
body.page-macro .ud-live i{
  width:7px; height:7px; border-radius:var(--r-pill,999px);
  background:var(--ink-3,var(--muted));
  box-shadow:0 0 0 3px color-mix(in srgb, var(--ink-3,var(--muted)) 18%, transparent);
}
/* R-D: live dot uses HEALTH tokens (ok/warn) — never direction tokens
   (up/down), so it cannot flip red under the ZH 红涨绿跌 convention. */
body.page-macro .ud-live--ok i{
  background:var(--ink-ok,var(--up));
  box-shadow:0 0 0 3px color-mix(in srgb, var(--ink-ok,var(--up)) 22%, transparent);
}
body.page-macro .ud-live--warn i{
  background:var(--ink-warn,var(--warn));
  box-shadow:0 0 0 3px color-mix(in srgb, var(--ink-warn,var(--warn)) 22%, transparent);
}
body.page-macro .ud-asof{
  margin-left:auto;
  font-size:11px; letter-spacing:.04em; color:var(--ink-3,var(--muted));
  font-variant-numeric:tabular-nums;
}

/* ── §1 grid: 660 copy + 316 gauge, space-between ────────────────────── */
body.page-macro .ud-hero-grid{
  display:grid; grid-template-columns:660px 316px;
  justify-content:space-between;
  gap:var(--sp-5,20px) 36px; align-items:start;
}
@media (max-width:1280px){ body.page-macro .ud-hero-grid{ grid-template-columns:minmax(0,1fr) 316px; } }
@media (max-width:860px){ body.page-macro .ud-hero-grid{ grid-template-columns:1fr; } }

body.page-macro .ud-verdict{
  display:flex; flex-wrap:wrap; align-items:baseline; gap:0 10px;
  font-size:var(--fs-display,46px); font-weight:800; line-height:.95;
  letter-spacing:-.03em;
  margin:4px 0 8px;
}
body.page-macro .ud-verdict > .l-en,
body.page-macro .ud-verdict > .l-zh{
  /* Per-locale phrase is its own flex item; the comma + qualifier are inline
     within it so the gap can never strand the comma on its own line. The
     inline-flex gap stays >0 so the comma hugs the verdict word with a real
     word-space, never glued onto the next qualifier. */
  display:inline-flex; align-items:baseline; flex-wrap:wrap;
  row-gap:0; column-gap:0;
}
body.page-macro .ud-verdict > .l-en .ud-verdict-comma{ margin-right:.25em; }
body.page-macro .ud-verdict > .l-en .ud-verdict-qualifier{ margin-left:.25em; }
body.page-macro .ud-verdict-comma{ font-weight:800; color:var(--ink-1,var(--text)); }
html[data-lang="zh"] body.page-macro .ud-verdict-comma{ display:none; }
html[data-lang="zh"] body.page-macro .ud-verdict{ letter-spacing:0; }
@media (max-width:390px){
  /* Spec §7 390: two-tone pair wraps to 2 lines at 36px, gauge below. */
  body.page-macro .ud-verdict{ font-size:36px; }
  body.page-macro .ud-verdict > .l-en, body.page-macro .ud-verdict > .l-zh{
    flex-basis:100%;
  }
}
body.page-macro .ud-verdict-word--up{ color:var(--ink-up,var(--up)); }
body.page-macro .ud-verdict-word--down{ color:var(--ink-down,var(--down)); }
body.page-macro .ud-verdict-word--warn{ color:var(--ink-warn,var(--warn)); }
body.page-macro .ud-verdict-comma{ font-size:var(--fs-display,46px); font-weight:800; color:var(--ink-1,var(--text)); }
body.page-macro .ud-verdict-qualifier--warn{ color:var(--ink-warn,var(--warn)); }
body.page-macro .ud-verdict-qualifier--down{ color:var(--ink-down,var(--down)); }
body.page-macro .ud-verdict-qualifier--muted{ color:var(--ink-3,var(--muted)); }

body.page-macro .ud-clause,
body.page-macro .ud-flip{
  margin:4px 0 0; max-width:62ch;
  font-size:var(--fs-md,15px); color:var(--text);
}
body.page-macro .ud-flip{ color:var(--ink-2,var(--muted)); font-size:var(--fs-sm,12.5px); }

body.page-macro .ud-meta{
  display:flex; flex-wrap:wrap; gap:8px; margin-top:14px;
}
body.page-macro .ud-fired-chip{
  display:inline-flex; align-items:center; gap:6px;
  font-size:var(--fs-label,11px); font-weight:700;
  padding:4px 11px; border-radius:var(--r-pill,999px);
  background:color-mix(in srgb, var(--act,var(--down)) 12%, var(--panel));
  border:1px solid color-mix(in srgb, var(--act,var(--down)) 28%, var(--line));
  color:color-mix(in srgb, var(--act,var(--down)) 78%, var(--text));
}

/* ── Gauge column ─────────────────────────────────────────────────────── */
body.page-macro .ud-hero-gauge{
  display:flex; flex-direction:column; align-items:center; gap:8px;
  padding:8px 6px 0;
  border-left:1px solid var(--line);
  padding-left:var(--sp-4,16px);
}
@media (max-width:860px){ body.page-macro .ud-hero-gauge{ border-left:0; padding-left:0; } }
body.page-macro .ud-score{
  display:flex; align-items:baseline; gap:6px;
  font-family:var(--num,var(--font-mono));
}
body.page-macro .ud-score-num{ font-size:var(--fs-num-xl,38px); font-weight:800; color:var(--ink-1,var(--text)); line-height:1; font-variant-numeric:tabular-nums; }
body.page-macro .ud-score-out{ font-size:18px; font-weight:500; color:var(--muted); }
body.page-macro .ud-score-label{ font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }
html[data-lang="zh"] body.page-macro .ud-score-label{ letter-spacing:0; text-transform:none; }

body.page-macro .ud-prog-wrap{ width:100%; margin-top:10px; }
body.page-macro .ud-prog{
  position:relative; height:8px; border-radius:var(--r-ctl,8px);
  background:var(--tile,var(--panel2));
}
body.page-macro .ud-prog-fill{
  position:absolute; top:0; left:0; height:100%;
  background:var(--up); border-radius:var(--r-ctl,8px);
}
body.page-macro .ud-prog-tick{
  position:absolute; top:-3px; width:1px; height:14px;
  background:var(--ink-3,var(--muted)); opacity:.55;
}
body.page-macro .ud-prog-pin{
  position:absolute; top:50%; transform:translate(-50%,-50%);
  width:3px; height:16px; background:var(--ink-1,var(--text)); border-radius:var(--r-ctl,8px);
}
body.page-macro .ud-prog-anchors{
  display:flex; justify-content:space-between;
  margin-top:6px; font-size:var(--fs-micro,10px);
  font-weight:600; color:var(--ink-3,var(--muted));
  font-family:var(--num,var(--font-mono));
}
body.page-macro .ud-prog-mid{ margin:0 auto; }
html[data-lang="zh"] body.page-macro .ud-prog-anchors{ letter-spacing:0; }

body.page-macro .ud-arc{ width:100%; max-width:220px; height:auto; margin-top:6px; }
body.page-macro .ud-arc-solid{ transition:stroke-dasharray .35s var(--ease-std,ease); }
body.page-macro .ud-arc-track{ stroke:var(--line); }
body.page-macro .ud-arc-stroke{ stroke:var(--up); }

/* ── §3 spine host — namespaced, governed in theme.css ────────────────── */
body.page-macro .ud-spine-wrap{ margin-top:6px; }
body.page-macro .ud-spine-foot{
  margin:8px 0 0;
  font-size:var(--fs-micro,10px); color:var(--ink-3,var(--muted));
  font-weight:400; line-height:1.5;
}

/* ── §6 What changed ──────────────────────────────────────────────────── */
body.page-macro .ud-changed{ margin-top:4px; }
body.page-macro .ud-changed .mx-chg-row{ padding:9px 0; }

/* ── §6 Drivers 2×2 ───────────────────────────────────────────────────── */
body.page-macro .ud-drivers{ margin-top:8px; }
body.page-macro .ud-driver-grid{
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr));
  gap:var(--gap-grid,18px);
}
@media (max-width:860px){ body.page-macro .ud-driver-grid{ grid-template-columns:1fr; } }
body.page-macro .ud-driver{
  padding:14px 16px;
  display:flex; flex-direction:column; gap:8px;
}
body.page-macro .ud-driver-head{ font-size:var(--fs-h3,14px); font-weight:800; color:var(--ink-1,var(--text)); margin:0; }
body.page-macro .ud-driver-body{ margin:0; font-size:var(--fs-sm,12.5px); color:var(--ink-2,var(--muted)); }
body.page-macro .ud-driver--locked{ position:relative; padding:0; min-height:90px; overflow:hidden; }
body.page-macro .ud-driver--locked .mx-tier-blurred--spec{ padding:14px 16px; }
body.page-macro .ud-driver-lock{
  position:absolute; inset:auto 0 0 0;
  padding:6px 16px; font-size:11px; font-weight:700;
  background:color-mix(in srgb, var(--panel) 88%, transparent);
  text-align:center; color:var(--ink-2,var(--muted));
}

/* ── §6 Watching list — three if→what rows ───────────────────────────── */
body.page-macro .ud-watching{ margin-top:6px; }
body.page-macro .ud-watch-list{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:8px; }
body.page-macro .ud-watch-item{
  padding:10px 14px;
  border:1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius:var(--r-ctl,8px);
  background:var(--panel2);
  font-size:var(--fs-sm,12.5px); color:var(--ink-2,var(--muted));
  line-height:1.5;
}
/* Per-cell locale display law: BOTH head AND body cells paint in each locale.
   EN locale hides ZH spans (global .l-zh{display:none}); ZH locale hides EN.
   Pre-fix only unhide one head + one body, leaving the other two blank. */
body.page-macro .ud-watch-item-head{ display:none; font-weight:700; color:var(--ink-1,var(--text)); margin-bottom:4px; }
body.page-macro .ud-watch-item-body{ display:none; font-weight:400; line-height:1.5; color:var(--ink-2,var(--muted)); }
html:not([data-lang="zh"]) body.page-macro .ud-watch-item-head.l-en{ display:block; }
html:not([data-lang="zh"]) body.page-macro .ud-watch-item-body.l-en{ display:block; }
html[data-lang="zh"] body.page-macro .ud-watch-item-head.l-zh{ display:block; }
html[data-lang="zh"] body.page-macro .ud-watch-item-body.l-zh{ display:block; }
/* Each .ud-watch-item is a flex row carrying head + body cells. */
body.page-macro .ud-watch-item{ display:flex; flex-direction:column; gap:2px; }
/* Desktop: full list visible (force-open via specificity that beats the UA
   `details:not([open]) > :not(summary) { display: none }` rule — this selector
   has (0,3,3) vs the UA's (0,2,2)), summary row hidden, <details> marker
   hidden so the summary doesn't render its disclosure triangle at 1440. R-J
   round 7 — the wrapper is now <details><summary>…</summary><ul>…</ul></details>
   for tap-open semantics at 390, but desktop forces the list open via CSS. */
body.page-macro .ud-watch-details:not([open]) .ud-watch-list{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:8px; }
body.page-macro .ud-watch-summary{ display:none; }
body.page-macro .ud-watch-details > summary::-webkit-details-marker{ display:none; }
body.page-macro .ud-watch-details > summary{ list-style:none; }
body.page-macro .ud-driver-count{ display:none; }

/* ── §6 Go deeper chip rail ──────────────────────────────────────────── */
body.page-macro .ud-deeper{ margin-top:6px; }
body.page-macro .ud-deeper-rail{
  display:flex; flex-wrap:wrap; gap:8px;
}
body.page-macro .ud-depth{
  display:inline-flex; align-items:center;
  padding:6px 12px;
  font-size:var(--fs-sm,12.5px); font-weight:600;
  background:var(--panel2); border:1px solid var(--line);
  border-radius:var(--r-pill,999px); color:var(--text);
  text-decoration:none;
  transition:border-color .14s var(--ease-std,ease), background .14s var(--ease-std,ease);
}
body.page-macro .ud-depth:hover{
  border-color:color-mix(in srgb, var(--link) 50%, var(--line));
  background:color-mix(in srgb, var(--link) 6%, var(--panel2));
}

/* ── Page footer (spec §6) ────────────────────────────────────────────── */
body.page-macro .ud-foot{
  margin-top:8px; padding-top:14px;
  border-top:1px solid var(--line);
  font-size:var(--fs-micro,10px); color:var(--ink-3,var(--muted));
  text-align:center;
}

/* ── Light theme: depth + bloom→ring + ink rungs (spec §5 row 2/3/8) ──
   Three mechanisms intentionally differ:
     • panel surface switches from panel2-tinted to pure panel-white with
       a 1px ring + soft cast shadow (the canvas stays perceptibly cooler).
     • the subject marker bloom becomes a 2px ring (a pastel stain on white).
     • the arc stroke darkens to --up-light for 4.5:1 on white. */
html[data-theme="light"] body.page-macro .ud-hero-panel{
  background:var(--panel);
  box-shadow:0 1px 3px color-mix(in srgb, var(--text) 7%, transparent),
             0 0 0 1px color-mix(in srgb, var(--text) 6%, transparent);
}
html[data-theme="light"] body.page-macro .ud-arc-stroke{ stroke:var(--up); }

/* ── Mobile 390 reduction (spec §7) — declarative re-composition ────── */
@media (max-width:390px){
  body.page-macro .ud-hero-grid{ grid-template-columns:1fr; gap:var(--sp-4,16px); }
  body.page-macro .ud-verdict{ font-size:36px; }
  body.page-macro .ud-driver-grid{ gap:var(--sp-3,12px); }
}
/* ── Mobile 640 reduction — spine as stacked cards (spec §7 row 1) ────
   Stance chip joins the name on row 1; the rail + travel form row 2;
   column heads hide. The .mockup-spine-390 wrapper class also forces the
   640 layout at any viewport so the specimen page previews the floor. */
@media (max-width:640px){
  body.page-macro .mx-spine-head{ display:none; }
  body.page-macro .mx-spine-row{
    grid-template-columns:1fr;
    grid-template-areas:
      "name stance"
      "rail  rail"
      "travel travel";
    gap:6px 10px;
    padding:12px 4px;
  }
  body.page-macro .mx-spine-row[data-null="1"]{ grid-template-areas:"name stance" "rail rail"; }
  body.page-macro .mx-spine-name{ grid-area:name; }
  body.page-macro .mx-spine-rail-wrap{ grid-area:rail; }
  body.page-macro .mx-spine-travel{ grid-area:travel; justify-content:flex-end; }
  body.page-macro .mx-spine-stance{ grid-area:stance; justify-content:flex-end; }
  /* Display the same in the specimen via .mockup-spine-390 wrapper class. */
  .mockup-spine-390 .mx-spine-head{ display:none; }
  .mockup-spine-390 .mx-spine-row{
    grid-template-columns:1fr;
    grid-template-areas:
      "name stance"
      "rail  rail"
      "travel travel";
    gap:6px 10px;
    padding:12px 4px;
  }
  .mockup-spine-390 .mx-spine-row[data-null="1"]{ grid-template-areas:"name stance" "rail rail"; }
  .mockup-spine-390 .mx-spine-name{ grid-area:name; }
  .mockup-spine-390 .mx-spine-rail-wrap{ grid-area:rail; }
  .mockup-spine-390 .mx-spine-travel{ grid-area:travel; justify-content:flex-end; }
  .mockup-spine-390 .mx-spine-stance{ grid-area:stance; justify-content:flex-end; }
}

/* ── Mobile 390 reduction (spec §7) — declarative re-composition ──────
   1. Verdict two-tone pair wraps to 2 lines at 36px (no mid-word hyphen).
   2. Drivers become a horizontal SWIPE STRIP — cards at ~86% width, with a
      `1 / 3` counter overlay; the clipped second card is the affordance.
      Locked (#4) hidden — same demotion rule as the desktop locked content.
   3. Watching collapses to ONE DISCLOSURE ROW — title, count `3`, chevron,
      plus a one-line preview of the first condition. Windows footnote stays. */
@media (max-width:390px){
  body.page-macro .ud-hero-grid{ grid-template-columns:1fr; gap:var(--sp-4,16px); }
  body.page-macro .ud-verdict{ font-size:36px; }

  /* Drivers → swipe strip. */
  body.page-macro .ud-driver-grid{
    display:flex; flex-wrap:nowrap; gap:12px; overflow-x:auto;
    grid-template-columns:none;
    scroll-snap-type:x mandatory;
    padding-bottom:4px;
    margin:0 -8px; padding-left:8px; padding-right:8px;
  }
  body.page-macro .ud-driver{
    flex:0 0 86%; scroll-snap-align:start; min-width:0;
  }
  body.page-macro .ud-driver--locked{ display:none; }

  /* Driver counter chip — `1 / 3` badge that floats over the strip's right
     edge. Hidden at desktop; the swipe strip at 390 is the affordance. */
  body.page-macro .ud-driver-count{ display:inline-flex; }
}
/* end .ud-hero — UD-B1 §1/§3/§6 */

/* ── Mobile ≤640px watching disclosure (R-L BLOCKER-1 fix) ─────────────
   At ≤640px the inline state JS in templates/dashboard.html.j2 removes the
   `open` attribute on .ud-watch-details so the <summary> disclosure row takes
   over. The summary chrome shows by default; the list is hidden until the
   user taps the disclosure row (the UA `:not([open])` rule handles that —
   CSS cannot override it, which is why the DOM state is the lawful fix). */
@media (max-width:640px){
  body.page-macro .ud-watch-item{ display:none; }
  body.page-macro .ud-watch-details[open] .ud-watch-item{ display:flex; }
  body.page-macro .ud-watch-summary{
    display:flex; flex-direction:column; align-items:stretch; gap:6px;
    padding:10px 14px;
    border:1px solid color-mix(in srgb, var(--line) 60%, transparent);
    border-radius:var(--r-ctl,8px);
    background:var(--panel2);
    cursor:pointer;
  }
  body.page-macro .ud-watch-summary-row{
    display:flex; align-items:center; gap:10px;
  }
  body.page-macro .ud-watch-summary-h{ flex:1; font-weight:700; color:var(--ink-1,var(--text)); }
  body.page-macro .ud-watch-summary-ct{
    font-size:var(--fs-sm,12.5px); font-weight:600;
    color:var(--ink-2,var(--muted));
  }
  body.page-macro .ud-watch-summary-chev{
    color:var(--ink-2,var(--muted)); font-size:18px;
  }
  body.page-macro .ud-watch-summary-preview{
    font-size:var(--fs-sm,12.5px); line-height:1.5;
    color:var(--ink-2,var(--muted));
  }
}

/* ══════════════════════════════════════════════════════════
   UD-B2-W1 — Vol-weather sub-row inside the mx5 scorecard
   (.mx5-sc-left). The fold-in: chips previously lived in
   #dlg-sentiment as a sibling section; they now live inside
   the scorecard left column, below its dial + scar chips.
   Scoped to body.page-macro .mx5-sc-vw so the strip stays a
   one-off — no global rules. #sx-risk-v2 is not a host.

   Dark treatment: calm/breeze/gust/storm glyphs in their own
   severity color (--up/info/warn/down), each row on a tinted
   --panel2 cell with a hairline --line border, eyebrow in
   --isle-color (the risk token). Reads like an instrument
   strip on a calm command-center surface.

   Light treatment: same geometry, but every tinted --panel2
   cell becomes a soft hairline-bordered white card; the
   glyphs keep their severity colors (they are the same
   semantic meaning in both themes); the eyebrow ink-3 tone
   softens so the header doesn't shout against the white
   panel. The visual identity stays "risk instrument" — not
   "risk callout" — so a calm day reads as one calm row, not
   as a louder headline. -#}

/* ── Strip container ── */
body.page-macro .mx5-sc-vw .sx-vw-strip{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:10px;
  padding:10px 12px 12px;
  border-top:1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background:color-mix(in srgb, var(--panel2) 56%, transparent);
  border-radius:inherit;
  border-top-left-radius:0;
  border-top-right-radius:0;
}
html[data-theme="light"] body.page-macro .mx5-sc-vw .sx-vw-strip{
  background:color-mix(in srgb, var(--panel2) 30%, var(--panel) 70%);
  border-top-color:color-mix(in srgb, var(--line) 80%, transparent);
}

/* ── Eyebrow ── */
body.page-macro .mx5-sc-vw .sx-vw-eyebrow{
  font-size:10px;
  font-weight:700;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--isle-color, var(--ink-3));
  display:flex;
  align-items:center;
  gap:6px;
  margin-bottom:2px;
}
body.page-macro .mx5-sc-vw .sx-vw-eyebrow::after{
  content:'';flex:1;height:1px;
  background:color-mix(in srgb, var(--isle-color, var(--line)) 28%, transparent);
}
html[data-theme="light"] body.page-macro .mx5-sc-vw .sx-vw-eyebrow{
  color:color-mix(in srgb, var(--isle-color, var(--ink-3)) 92%, transparent);
}

/* ── Row: glyph · mid · tier ── */
body.page-macro .mx5-sc-vw .sx-vw-row{
  display:grid;
  grid-template-columns:24px minmax(0,1fr) 70px;
  align-items:center;
  gap:10px;
  padding:6px 8px;
  border-radius:var(--r-ctl,8px);
  border:1px solid color-mix(in srgb, var(--line) 55%, transparent);
  background:color-mix(in srgb, var(--panel) 88%, transparent);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
}
html[data-theme="light"] body.page-macro .mx5-sc-vw .sx-vw-row{
  background:color-mix(in srgb, var(--panel) 100%, transparent);
  border-color:color-mix(in srgb, var(--line) 75%, transparent);
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}

/* ── Glyph colour is class-driven (one-integer law: tier-word only, no values) ── */
body.page-macro .mx5-sc-vw .sx-vw-row .sg-wx{
  width:24px;height:24px;
  display:flex;align-items:center;justify-content:center;
  color:var(--muted);
}
body.page-macro .mx5-sc-vw .sx-vw-row.sx-vw-row--calm    .sg-wx{color:var(--up,#22c55e);}
body.page-macro .mx5-sc-vw .sx-vw-row.sx-vw-row--quiet   .sg-wx{color:var(--info,#4d8ef5);}
body.page-macro .mx5-sc-vw .sx-vw-row.sx-vw-row--low     .sg-wx{color:var(--info,#4d8ef5);}
body.page-macro .mx5-sc-vw .sx-vw-row.sx-vw-row--normal  .sg-wx{color:var(--info,#4d8ef5);}
body.page-macro .mx5-sc-vw .sx-vw-row.sx-vw-row--elevated .sg-wx{color:var(--warn,#f59e0b);}
body.page-macro .mx5-sc-vw .sx-vw-row.sx-vw-row--extreme .sg-wx{color:var(--down,#ef4444);}
body.page-macro .mx5-sc-vw .sx-vw-row.sx-vw-row--young   .sg-wx{color:var(--muted);opacity:.6;}
body.page-macro .mx5-sc-vw .sx-vw-row .sg-wx svg{width:18px;height:18px;display:block;}

/* ── Mid column ── */
body.page-macro .mx5-sc-vw .sx-vw-mid{
  display:flex;flex-direction:column;gap:2px;min-width:0;
}
body.page-macro .mx5-sc-vw .sx-vw-name{
  font-size:12px;font-weight:700;color:var(--ink-1);
  line-height:1.3;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
body.page-macro .mx5-sc-vw .sx-vw-read{
  font-size:11px;line-height:1.45;color:var(--ink-2);
  /* Wrap, never truncate: the read sentence is the user-facing message; clipping
     mid-sentence at 390 is unreadable. Names alone get ellipsis if needed. */
  overflow-wrap:anywhere;
}
html[data-theme="light"] body.page-macro .mx5-sc-vw .sx-vw-name{color:var(--text);}
html[data-theme="light"] body.page-macro .mx5-sc-vw .sx-vw-read{color:color-mix(in srgb, var(--text) 78%, transparent);}

/* ── Tier word (right column): calm / breeze / gust / storm. Bilingual side-by-side. ── */
body.page-macro .mx5-sc-vw .sx-vw-tier{
  font-size:11px;font-weight:700;text-align:right;letter-spacing:.02em;
  color:var(--ink-2);
  display:flex;flex-direction:column;align-items:flex-end;gap:1px;
  white-space:nowrap;
}
body.page-macro .mx5-sc-vw .sx-vw-tier .l-en{font-size:11px;line-height:1.1;}
body.page-macro .mx5-sc-vw .sx-vw-tier .l-zh{font-size:10px;line-height:1.1;color:var(--ink-3);}
body.page-macro .mx5-sc-vw .sx-vw-row.sx-vw-row--calm    .sx-vw-tier{color:var(--up,#22c55e);}
body.page-macro .mx5-sc-vw .sx-vw-row.sx-vw-row--quiet   .sx-vw-tier{color:var(--info,#4d8ef5);}
body.page-macro .mx5-sc-vw .sx-vw-row.sx-vw-row--low     .sx-vw-tier{color:var(--info,#4d8ef5);}
body.page-macro .mx5-sc-vw .sx-vw-row.sx-vw-row--normal  .sx-vw-tier{color:var(--info,#4d8ef5);}
body.page-macro .mx5-sc-vw .sx-vw-row.sx-vw-row--elevated .sx-vw-tier{color:var(--warn,#f59e0b);}
body.page-macro .mx5-sc-vw .sx-vw-row.sx-vw-row--extreme .sx-vw-tier{color:var(--down,#ef4444);}
body.page-macro .mx5-sc-vw .sx-vw-row.sx-vw-row--young   .sx-vw-tier{color:var(--ink-3);}
html[data-theme="light"] body.page-macro .mx5-sc-vw .sx-vw-tier{color:color-mix(in srgb, var(--text) 78%, transparent);}
html[data-theme="light"] body.page-macro .mx5-sc-vw .sx-vw-tier .l-zh{color:color-mix(in srgb, var(--text) 55%, transparent);}

/* ── Mobile (≤560px): tighten padding, allow mid column to wrap freely ── */
@media(max-width:560px){
  body.page-macro .mx5-sc-vw .sx-vw-strip{padding:8px 10px 10px;}
  body.page-macro .mx5-sc-vw .sx-vw-row{
    grid-template-columns:22px minmax(0,1fr) 64px;
    gap:8px;padding:6px 8px;
  }
  body.page-macro .mx5-sc-vw .sx-vw-row .sg-wx{width:22px;height:22px;}
  body.page-macro .mx5-sc-vw .sx-vw-row .sg-wx svg{width:16px;height:16px;}
  body.page-macro .mx5-sc-vw .sx-vw-name{font-size:11px;white-space:normal;}
  body.page-macro .mx5-sc-vw .sx-vw-read{font-size:10.5px;}
  body.page-macro .mx5-sc-vw .sx-vw-tier{font-size:10px;}
  body.page-macro .mx5-sc-vw .sx-vw-tier .l-zh{font-size:9px;}
}

/* Percentile-bar mark moved from dashboard.html.j2 (governed CSS).
   --r-pill on a 12x12 box is a circle (was 50%). Border is --panel. */
.sg-pos-mark{
  position:absolute;top:-3px;width:12px;height:12px;
  border-radius:var(--r-pill,999px);transform:translateX(-50%);
  background:var(--muted);border:2px solid var(--panel);
  box-shadow:0 1px 3px rgba(0,0,0,.35);
}

/* ── markets.html risk-regime strip (.mrs) ──────────────────────────────────
   Compact three-row read between the cycle overlay and today's positions.
   Reuses .mx-stance--{ok,warn,down,muted}. No new token family.
   Dark: a lifted panel and a 1px inset edge (luminance, no outer glow).
   Light: the white card, a hairline, and the card shadow (shadow, not glow). */
.mrs{
  margin:var(--sp-4,16px) 0;
  padding:var(--sp-4,16px);
  border:1px solid var(--line);
  border-radius:var(--r-card,12px);
  background:var(--panel);
  color:var(--text);
}
html[data-theme="dark"] .mrs{
  background:color-mix(in srgb, var(--panel) 86%, var(--text));
  box-shadow:inset 0 1px 0 color-mix(in srgb, var(--text) 8%, transparent);
}
html[data-theme="light"] .mrs{
  background:var(--panel);
  border-color:var(--line);
  box-shadow:var(--card-shadow);
}
/* zh swaps --down to green (red = up). Risk-off is a danger stance, not a
   price candle, so this pill stays on --ink-act, which does not swap.
   Otherwise 风险规避 paints the same green family as 风险偏好. */
html[data-lang="zh"] .mrs .mx-stance--down{ --c: var(--ink-act); }
.mrs-hd{ margin:0 0 var(--sp-3,12px); }
.mrs-title{
  margin:0;
  font-size:var(--fs-body,14px);
  font-weight:700;
  letter-spacing:0;
  color:var(--text);
}
.mrs-sub{
  margin:var(--sp-1,4px) 0 0;
  font-size:var(--fs-sm,12.5px);
  line-height:1.45;
  color:var(--muted);
}
.mrs-rows{ display:flex; flex-direction:column; }
.mrs-row{
  display:grid;
  grid-template-columns:minmax(8rem,12rem) auto minmax(0,1fr) auto;
  gap:var(--sp-3,12px);
  align-items:center;
  padding:var(--sp-3,12px) 0;
  border-top:1px solid var(--line);
}
.mrs-row:first-child{ border-top:0; padding-top:0; }
.mrs-name{
  font-size:var(--fs-body,14px);
  font-weight:700;
  color:var(--text);
}
.mrs-state,.mrs-do{ margin:0; }
.mrs-caveat{ position:relative; justify-self:end; }
.mrs-caveat-btn{
  font:inherit;
  font-size:var(--fs-sm,12.5px);
  line-height:1.3;
  color:var(--muted);
  background:transparent;
  border:1px solid var(--line);
  border-radius:var(--r-pill,999px);
  padding:4px 10px;
  cursor:pointer;
}
html[data-theme="dark"] .mrs-caveat-btn{
  background:color-mix(in srgb, var(--panel2) 70%, transparent);
  color:var(--ink-2,var(--muted));
}
html[data-theme="light"] .mrs-caveat-btn{
  background:var(--panel);
  color:var(--muted);
  box-shadow:none;
}
/* Tier-2 caveat: clipped out of the glance until hover or keyboard focus.
   Kept in the tree so aria-describedby can point at it. Not a title= tooltip. */
.mrs-pop{
  position:absolute;
  z-index:3;
  right:0;
  top:calc(100% + 6px);
  box-sizing:border-box;
  padding:var(--sp-3,12px);
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--r-card,12px);
  color:var(--text);
  font-size:var(--fs-sm,12.5px);
  font-weight:400;
  line-height:1.45;
  text-align:left;
  white-space:normal;
  clip:rect(0 0 0 0);
  clip-path:inset(50%);
  height:1px;
  width:1px;
  overflow:hidden;
}
html[data-theme="dark"] .mrs-pop{
  background:var(--panel);
  box-shadow:none;
}
html[data-theme="light"] .mrs-pop{
  background:var(--panel);
  box-shadow:var(--popover-shadow);
}
.mrs-caveat:hover .mrs-pop,
.mrs-caveat:focus-within .mrs-pop{
  clip:auto;
  clip-path:none;
  height:auto;
  width:min(36rem,80vw);
  overflow:visible;
}
@media (max-width:640px){
  .mrs{ padding:var(--sp-3,12px); }
  .mrs-row{
    grid-template-columns:1fr;
    gap:var(--sp-2,8px);
    align-items:start;
  }
  .mrs-caveat{ justify-self:start; }
  .mrs-pop{ left:0; right:auto; }
}
/* R7 Wave A (2026-10-21), OQ8 repair — add-only. --warn is the series/alert hue,
   not a text ink: the two earlier rules that paint risk-tier text in the raw hue
   (the .sg-wx line and the .sx-vw-tier line above) stay byte-identical; repeating
   their selectors here with the readable ink token wins as the later rule at
   equal specificity, in both themes. */
body.page-macro .mx5-sc-vw .sx-vw-row.sx-vw-row--elevated .sg-wx{color:var(--ink-warn, var(--warn));}
body.page-macro .mx5-sc-vw .sx-vw-row.sx-vw-row--elevated .sx-vw-tier{color:var(--ink-warn, var(--warn));}
.nowrap{white-space:nowrap}

/* ===== GMI explorer extension (SPECS §5; additive; consumed only by gmi.css) ===== */
/* ---------- B. GMI extension tokens (derived only) ------------------------------ */
:root{
  --gmi-mark:       color-mix(in srgb, var(--text) 78%, transparent);  /* admitted: solid ink   */
  --gmi-mark-faint: color-mix(in srgb, var(--text) 44%, transparent);  /* outlines              */
  --gmi-hatch:      color-mix(in srgb, var(--text) 40%, transparent);  /* acceptance-set hatch  */
  --gmi-held:       var(--info);                                       /* held ring (redundant to shape) */
  --gmi-hair:       color-mix(in srgb, var(--text) 9%, transparent);   /* dark hairline         */
  --gmi-step:       color-mix(in srgb, var(--text) 2.5%, transparent); /* dark luminance step   */
  --gmi-elev:       inset 0 1px 0 rgba(255,255,255,.035), 0 1px 0 rgba(0,0,0,.35);
  --gmi-select:     0 0 0 1px var(--link), 0 0 22px -8px color-mix(in srgb, var(--link) 70%, transparent);
  --gmi-hero-wash:  radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--info) 9%, transparent), transparent 62%);
  --gmi-glow-held:  0 0 0 3px color-mix(in srgb, var(--info) 16%, transparent), 0 0 14px 0 color-mix(in srgb, var(--info) 55%, transparent);
  --gmi-tray:       none;                                              /* side sheet: dark = luminance only */
  --gmi-cell:14px; --gmi-cell-gap:5px;
}
html[data-theme="light"]{
  --gmi-mark:       color-mix(in srgb, var(--text) 86%, transparent);
  --gmi-mark-faint: color-mix(in srgb, var(--text) 40%, transparent);
  --gmi-hatch:      color-mix(in srgb, var(--text) 30%, transparent);
  --gmi-held:       var(--ink-info);
  --gmi-hair:       var(--line);
  --gmi-step:       transparent;
  --gmi-elev:       0 1px 2px rgba(20,30,50,.06), 0 8px 24px -16px rgba(20,32,64,.22);
  --gmi-select:     0 0 0 2px var(--link);
  --gmi-hero-wash:  none;
  --gmi-glow-held:  0 0 0 3px color-mix(in srgb, var(--ink-info) 14%, transparent);
  --gmi-tray:       inset 0 1px 2px rgba(20,30,50,.05);                 /* light: a recessed tray */
}
@media (max-width:640px){ :root{ --gmi-cell:10px; --gmi-cell-gap:3px; } }

/* --- port-round tokens (lane table): every colour decision stays a theme token --- */
:root{
  --gmi-btn-lift:   none;
  --gmi-rail:       color-mix(in srgb, var(--text) 10%, transparent);
  --gmi-hist-bar:   color-mix(in srgb, var(--text) 26%, transparent);
  --gmi-hist-glow:  0 0 18px -6px color-mix(in srgb, var(--text) 60%, transparent);
  --gmi-track:      color-mix(in srgb, var(--text) 7%, transparent);
  --gmi-stack-2:    color-mix(in srgb, var(--text) 22%, transparent);
  --gmi-ladder-1:   color-mix(in srgb, var(--text) 48%, transparent);
  --gmi-ladder-2:   color-mix(in srgb, var(--text) 34%, transparent);
  --gmi-ladder-3:   color-mix(in srgb, var(--text) 22%, transparent);
  --gmi-ladder-ink-theme: color-mix(in srgb, var(--text) 82%, transparent);
  --gmi-ladder-ink-cat:   color-mix(in srgb, var(--text) 62%, transparent);
  --r-gmi-focus:4px; --r-gmi-xs:1px; --r-gmi-sm:2px; --r-gmi-md:3px; --r-gmi-kbd:5px; --r-gmi-tag:6px;
  --r-gmi-dot:50%; --r-gmi-bar-top:3px 3px 0 0;
  --gmi-cell-key:12px; --gmi-cell-xl:20px; --gmi-cell-strip:6px; --gmi-cell-mini:8px;
  --gmi-chain-slot:24px; --gmi-chain-edge-none:0px; --gmi-chain-rail:22px; --gmi-chain-edge:40px;
  --gmi-pip:12px; --gmi-pip-anchor:22px; --gmi-pip-void:10px; --gmi-pip-cat:9px;
}
html[data-theme="light"]{
  --gmi-btn-lift:   0 1px 2px rgba(20,30,50,.06);
  --gmi-hist-bar:   color-mix(in srgb, var(--text) 18%, var(--panel));
  --gmi-hist-glow:  none;
}
/* ===== end GMI explorer extension ===== */
