    :root {
      /* STYLE-01 -- the design tokens. These names are canonical; the older
         names below them (--bg-card, --border-emph) are kept as aliases so
         every page that already reads a variable restyles with them. */
      --bg-base: #0b0f14;
      --bg-raised: #131922;
      --bg-elevated: #1a2230;
      /* TEST-ENV-COLOR-01 (#2499) -- the not-prod page and its tag. */
      --bg-not-prod: #1d1222;
      --env-tag-bg: #a3428f;
      --env-tag-text: #ffffff;
      --border: #1f2a37;
      --border-strong: #3b4b61;
      --text-heading: #e8e6dc;
      --text-primary: #d6dee8;
      --bg-card: var(--bg-raised);
      --border-emph: #1d9e7555;
      /* ADA-COMPLIANCE-01 (#1519) -- WCAG 1.4.3 Contrast (Minimum).
         Was #6b7280, which is 3.65:1 against --bg-card and fails the 4.5:1
         floor for normal text. This token is used in 264 places, so every
         hint, caption, timestamp and secondary label on the site was in
         violation; one line corrects all of them.
         #9ca3af measures 6.95:1 on the card and 7.57:1 on the body -- chosen
         over #7b828e (4.56:1) deliberately: a 1.3% margin would be broken
         again by any future background tweak, with nobody noticing. */
      --text-muted: #9ca3af;

      /* ADA-COMPLIANCE-01 (#1519) -- the WCAG 2.4.7 focus ring, as a TOKEN.
         #93c5fd measures 10.01:1 on --bg-card and 1.80:1 on white. It is the
         indicator this file guarantees, so on a light ground the guarantee
         would be invisible while every test still passed -- the ring present,
         correct, and unseeable. A literal would have to be FOUND again later;
         a token is one redefinition. No blue is strong on both grounds
         (#2563eb is 3.49:1 dark vs 5.17:1 light), so the value belongs to the
         theme, not to the rule. */
      --focus-ring: #93c5fd;
      --text-pos: #6ee7b7;
      --text-neg: #fca5a5;
      --text-warn: #fcd34d;
      --text-warn-bright: #facc15;
      /* SHELF-SCAN-SURFACE-01 (#1840) -- the ground --text-warn sits on when a
         warning needs a filled badge rather than bare text. Measured, not
         assumed: #fcd34d on #422006 is 10.11:1, well clear of the 4.5:1 floor,
         and it keeps the pairing in ONE place so a future theme change moves
         both together instead of leaving a badge unreadable. */
      --bg-warn-subtle: #422006;
      /* STYLE-04 -- status tints and borders, at the values the admin status
         boxes already used, so they look identical. Text on each tint
         (--text-pos / --text-warn / --text-neg / --text-primary / --text-muted)
         measures 6.06:1 or better. */
      --bg-pos-tint: #0d2818;
      --bg-warn-tint: #2b2413;
      --bg-neg-tint: #2b1416;
      --border-pos: #1f6f3f;
      --border-warn: #7a5c1e;
      --border-neg: #7a2530;
      /* STYLE-04 -- a selected item, active tab or current nav entry: the
         accent at 25%. --text-heading on it measures 10.44:1 over
         --bg-elevated, 11.47:1 over --bg-raised, 12.62:1 over --bg-base. */
      --bg-selected: #0f6e5640;
      /* STYLE-05 -- disabled-button text (exempt from 4.5:1, WCAG 1.4.3), the
         strong danger fill (a danger button's hover; --text-neg on it measures
         5.01:1), and the sunken surface the undefined --bg-secondary always
         rendered through its fallback. */
      --text-disabled: #4b5563;
      --bg-neg-strong: #7f2626;
      --bg-sunken: #0d1520;
      /* DEMO-02 -- the dark overlay behind the home page's screenshot popup. */
      --scrim: #05080cf2;
      /* STYLE-01 -- --accent is a FILL (buttons, active dots, bars). It is too
         dark to read as text on the dark ground, so text, links, borders and
         icons use --accent-bright. The app moved from blue to green here on
         purpose (Jason, STYLE-01). */
      --accent: #0f6e56;
      --accent-bright: #1d9e75;
      /* COSTS-01 (#2541) -- the two exit kinds on the Trading Costs page: a market exit
         (stop, time limit) and a limit exit (target). Checked with the dataviz palette
         validator against --bg-raised: lightness band, chroma, colour-blind separation. */
      --exit-market: #4f8fe6;
      --exit-limit: #c07d1f;
      /* #2839 step 3 -- the five levels of the one backtest line on the Activity page, a text
         colour each on a tint of it; told apart by lightness as well as hue. */
      --line-1: #fca5a5;
      --line-2: #93c5fd;
      --line-3: #c4b5fd;
      --line-4: #fcd34d;
      --line-5: #7dd3c0;
      --line-6: #9ca3af;
      /* CHART-POINTERS-01 (#2849) -- indicator colours, TradingView's defaults (Jason,
         2026-11-26: "On MACD, can you copy TV?"), read by static/js/tp-indicators.js. */
      --ind-blue: #2962ff;
      --ind-orange: #ff6d00;
      --ind-purple: #7e57c2;
      --ind-red: #b71c1c;
      --ind-pink: #f50057;
      --ind-green: #43a047;
      --ind-olive: #999915;
      --ind-hist-up: #26a69a;
      --ind-hist-up-soft: #b2dfdb;
      --ind-hist-down: #ff5252;
      --ind-hist-down-soft: #ffcdd2;
      --ind-cloud-up: #a5d6a7;
      --ind-cloud-down: #ef9a9a;
      --ind-trend-up: #089981;
      --ind-trend-down: #f23645;
      --ind-level: #787b86;
      /* The pointers drawn over a match chart: one colour per gate, in turn. */
      --ptr-1: #f59e0b;
      --ptr-2: #a78bfa;
      --ptr-3: #22c55e;
      --ptr-4: #60a5fa;
      --ptr-5: #f472b6;
      --ptr-6: #2dd4bf;
      /* STYLE-02 -- the hover FILL of every primary button. --accent-bright
         under the --on-accent label measured 2.71:1; this is 6.54:1. */
      --accent-hover: #0b5a46;
      /* 2026-11-06 Education redesigns -- text on a green or red tint, dark text on the
         bright accent fill, and the two fund-mix colours that are not regime colours. */
      --pos-text: #6ee7b7;
      --neg-text: #fca5a5;
      --on-accent-bright: #06120e;
      --fund-sector: #8b5cf6;
      --fund-other: #64748b;
      --on-accent: #e8e6dc;
      --logo-red: #ff4746;
      --logo-amber: #ffa40a;
      --logo-mint: #22ffa994;
      --logo-mint-pale: #10ff9f60;
      --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
      --font-display: "Sora", var(--font-sans);
      --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
      --space-1: 4px;
      --space-2: 8px;
      --space-3: 12px;
      --space-4: 16px;
      --space-6: 24px;
      --space-8: 32px;
      --space-12: 48px;
      --space-16: 64px;
      --space-24: 96px;
      --radius-sm: 6px;
      --radius-md: 8px;
      --radius-lg: 12px;
      --radius-pill: 999px;
      --shadow-card: 0 8px 24px #00000066;
      --shadow-frame: 0 24px 64px #000000b3;
      /* STYLE-02 -- depth, layered as background-image over a card's own
         background-colour. --text-muted measured on the lightest point:
         6.09:1 on --bg-raised + --grad-card, 5.15:1 on --bg-elevated +
         --grad-frame (both above the 4.5:1 floor). */
      --grad-card: linear-gradient(180deg, #ffffff0d 0%, #ffffff00 70%);
      --grad-frame: radial-gradient(120% 80% at 0% 0%, #1d9e7526 0%, #1d9e7500 60%);
      /* REGIME-COLOR-UNIFICATION-01 (#1804, 2026-09-21) -- THE canonical
         regime palette. Jason's call: these are the public landing page's
         colors (landing.html's REGIME_COLORS/REGIME_CARDS, and
         templating.py's now-removed _REGIME_COLORS carried the same values
         by hand) made canonical here, with every other surface reading
         these vars instead of holding its own copy.

         Before this ticket there were FIVE independent regime-color
         definitions: this block (different values then), a second literal
         copy in education/regime_methodology.html's own --rmp-* block, a
         third in landing.html (server-rendered banner + client JS, the one
         that won), and a fourth in api/routes/public.py's public
         /api/public/regime JSON response -- that last one is an external
         API contract with no consumer inside this repo and is deliberately
         NOT changed here; do not assume it matches these.

         Every INTERNAL consumer -- the dashboard's SPY-header chart, the
         education page's chart and card grid, and the landing page's
         banner/cards/chart -- reads these vars at render time. Do not add a
         second definition. */
      --regime-bull: #1D9E75;
      --regime-sideways: #378ADD;
      --regime-pullback: #EF9F27;
      --regime-correction: #E24B4A;
      --regime-bear: #991B1B;
      /* STYLE-01 -- --regime-bear is a fill; as text it measures 2.31:1 on
         --bg-base and 2.12:1 on --bg-raised, so bear TEXT uses this lighter
         red (6.95:1 and 6.38:1). */
      --regime-bear-text: #f87171;
    }
    /* STYLE-03 -- margin: 0. The browser's default 8px body margin sat outside
       the p-6 padding, so the full-bleed bars (the ribbon, the navs, the
       landing canvas, all pulled out by -1.5rem) stopped 8px short of the
       edges and left a strip between the ribbon and the app nav. */
    body { margin: 0; background: var(--bg-base); color: var(--text-primary); font-family: var(--font-sans); }
    /* TEST-ENV-COLOR-01 (#2499) -- every environment but prod: a plum page and a
       fixed tag, so nobody mistakes test or dev for prod. --text-muted (#9ca3af)
       measures 7.1:1 on #1d1222, above the 4.5:1 floor. */
    /* Redefine the base token, not the body's paint: pages that lay their own
       --bg-base over the body (the landing page's .landing-main) turn plum too. */
    body.env-not-prod { --bg-base: var(--bg-not-prod); }
    .env-tag { position: fixed; bottom: 0.75rem; left: 0.75rem; z-index: 1000;
      padding: 0.2rem 0.6rem; border-radius: 4px; background: var(--env-tag-bg); color: var(--env-tag-text);
      font: 600 0.8rem/1.4 var(--font-mono, monospace); letter-spacing: 0.08em;
      pointer-events: none; }
    /* STYLE-05 -- plain links. Without this, an unclassed <a> drew in the
       browser's default dark blue on the dark ground. :where() keeps the
       hover at element specificity, so any link whose class sets its own
       colour (buttons, nav, badges) keeps it, on hover too. The focus ring
       is the global :focus-visible rule further down. */
    a { color: var(--accent-bright); }
    a:where(:hover) { color: var(--text-heading); }
    /* STYLE-05 -- type: page titles and section headings in the app take the
       display face; body text stays --font-sans. Admin pages (body.is-admin,
       set in base.html) keep their headings as they are. */
    body:not(.is-admin) :is(h1, h2, h3) { font-family: var(--font-display); }
    .card { background-color: var(--bg-card); background-image: var(--grad-card); border: 1px solid var(--border); }
    .card-emph { background: var(--bg-card); border: 1px solid var(--border-emph); }
    .tab-row td { padding: 0.55rem 0.6rem; font-variant-numeric: tabular-nums; font-size: 0.875rem; }
    .tab-row { border-bottom: 1px solid var(--border); }
    .tab-row:hover { background: #1a2230; }
    .tab-row.selected { background: #1e293b; }
    .tab-row.selected:hover { background: #243349; }
    .pill { display:inline-block; padding: 0.1rem 0.45rem; border-radius: 9999px; font-size: 0.65rem; font-weight: 600; line-height: 1.3; }
    .pill-watch { background: var(--bg-elevated); color: var(--text-primary); }
    .pill-pending { background: var(--bg-warn-tint); color: var(--text-warn); }
    .pill-entered { background: var(--bg-pos-tint); color: var(--text-pos); }
    .pill-near { background: var(--bg-pos-tint); color: var(--text-pos); }
    .pill-new { background: var(--bg-selected); color: var(--text-heading); margin-right: 0.4rem; vertical-align: middle; }
    .badge-small { display: inline-block; padding: 0.05rem 0.4rem; border-radius: 0.25rem; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.04em; background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); }
    .num-pos { color: var(--text-pos); }
    .num-neg { color: var(--text-neg); }
    .muted { color: var(--text-muted); }
    .closing-soon { color: #facc15; font-weight: 700; }
    /* #1705 — a split restatement is stated, not silent. Muted amber: it is
       information, not a warning, and not something the subscriber must act on. */
    .split-adjusted { color: #d6a35c; }
    .closing-soon-bg { background: #422006; }
    .heat-zone { background: linear-gradient(90deg, transparent 0%, #523a0944 100%); }
    .heat-approaching { background: linear-gradient(90deg, transparent 0%, #1e3a5f44 100%); }
    table { width: 100%; border-collapse: collapse; }
    th { text-align: left; padding: 0.4rem 0.6rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); border-bottom: 1px solid var(--border); font-weight: 600; cursor: pointer; user-select: none; }
    th:hover { color: #d6dee8; }
    th.right, td.right { text-align: right; }
    th.center, td.center { text-align: center; }
    th.no-sort { cursor: default; }
    th.no-sort:hover { color: var(--text-muted); }
    .sort-indicator { font-size: 0.55rem; margin-left: 0.2rem; color: #2563eb; }
    .ticker { font-weight: 700; letter-spacing: 0.02em; }
    /* box-sizing: this project has no global border-box reset, so a .filter-btn
       stretched to full width used to compute as 100% PLUS 1.3rem of padding and
       2px of border, and overflowed its container. */
    .filter-btn { box-sizing: border-box; padding: 0.25rem 0.65rem; border-radius: 0.375rem; background: #1f2a37; color: #9ca3af; border: 1px solid #2a3848; font-size: 0.75rem; cursor: pointer; transition: all 0.1s; }
    .filter-btn:hover { background: #2a3848; color: #d6dee8; }
    .filter-btn.active { background: var(--bg-selected); color: var(--text-heading); border-color: var(--accent); }
    .progress-bar { height: 4px; background: #1f2a37; border-radius: 9999px; overflow: hidden; position: relative; }
    .progress-fill { height: 100%; }
    .tv-link { color: var(--text-muted); text-decoration: none; font-size: 0.7rem; margin-left: 0.25rem; }
    .tv-link:hover { color: var(--text-heading); }
    .inferred-mark { color: #fb923c; font-size: 0.8rem; cursor: help; }
    input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
    .sticky-footer {
      position: sticky;
      bottom: 0;
      background: rgba(11, 15, 20, 0.95);
      backdrop-filter: blur(8px);
      border-top: 1px solid var(--border);
      padding: 0.75rem 1rem;
      margin: 0 -1rem -1rem -1rem;
      z-index: 10;
    }
    .tooltip { position: relative; }
    .tooltip:hover::after {
      content: attr(data-tip);
      position: absolute;
      bottom: 120%;
      left: 50%;
      transform: translateX(-50%);
      background: #1f2a37;
      color: #d6dee8;
      padding: 0.4rem 0.6rem;
      border-radius: 0.375rem;
      border: 1px solid #2a3848;
      font-size: 0.7rem;
      white-space: nowrap;
      z-index: 20;
    }
    .summary-line { font-size: 0.85rem; }
    .summary-bad { color: #facc15; font-weight: 600; }
    .summary-good { color: var(--text-pos); }
    .summary-neutral { color: var(--text-muted); }
    /* CAPITAL-NAV — the account-value widget now lives inline in the nav bar
       (was a fixed overlay). .nav-capital is the HTMX host slot; .capital-widget
       is the inline compact display; the expanded detail drops down as a popover
       anchored to the widget so it never reflows the nav row. */
    .nav-capital {
      display: flex;
      align-items: center;
      margin-right: 0.75rem;
    }
    .capital-widget {
      position: relative;  /* anchor for the expanded dropdown popover */
      display: flex;
      align-items: center;
      gap: 1rem;
      font-size: 0.75rem;
      color: var(--text-muted);
      white-space: nowrap;
      cursor: pointer;
      transition: color 0.2s;
    }
    /* NAV-BAR-CONSISTENCY-01 — align the two columns to a shared grid so the
       labels sit on one baseline and the amounts on another. align-items:center
       let each column centre independently, which is why "P/L" floated above
       "ACCOUNT VALUE" and the two amounts did not line up. */
    .capital-widget-collapsed {
      display: flex; align-items: stretch; gap: 1.25rem;
    }
    /* align-items:center centres the label over the value within each column.
       The two columns are different widths — "Account value" is wider than its
       amount, "P/L" is narrower than its — so left-aligning made each pair look
       accidentally offset. Centring is per-column and does NOT disturb the
       shared baselines, which come from the fixed line-heights below. */
    .capital-col {
      display: flex; flex-direction: column;
      justify-content: center; align-items: center;
    }
    .capital-col-label {
      font-size: 0.625rem; line-height: 1rem; text-transform: uppercase;
      letter-spacing: 0.05em; color: var(--text-muted, #9ca3af); white-space: nowrap;
    }
    .capital-col-value {
      font-size: 1rem; line-height: 1.25rem; font-weight: 700;
      font-variant-numeric: tabular-nums; white-space: nowrap;
    }
    .capital-caret { align-self: center; font-size: 0.75rem; color: var(--text-muted, #9ca3af); }
    .capital-widget-expanded { display: none; }
    .capital-widget.expanded .capital-widget-expanded {
      display: block;
      position: absolute;
      top: calc(100% + 0.5rem);
      right: 0;
      min-width: 280px;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 0.5rem;
      padding: 1rem;
      z-index: 50;  /* sit above page content, level with nav dropdowns */
      white-space: normal;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    }
    [x-cloak] { display: none !important; }

    /* UI-POLISH-01: pause/resume status indicator */
    #auto-refresh-status { font-size: 11px; color: #6ee7b7; }
    #auto-refresh-status.paused { color: #6b7280; }
    #auto-refresh-status::before { content: "● "; }

    /* ALERT-RULES-01c: toast stack */
    .toast-stack {
      position: fixed;
      top: 16px;
      right: 16px;
      z-index: 1000;
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-width: 420px;
      pointer-events: none;
    }
    .toast {
      pointer-events: auto;
      display: flex;
      align-items: center;
      gap: 0.6rem;
      padding: 0.6rem 0.9rem;
      border-radius: 8px;
      font-size: 0.85rem;
      border-left: 3px solid;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
      animation: toast-slide-in 0.25s ease-out;
      transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    }
    .toast-fading {
      opacity: 0;
      transform: translateX(20px);
    }
    .toast-info     { background: var(--bg-elevated); border-color: var(--border-strong); color: var(--text-primary); }
    .toast-warning  { background: #4d3a09; border-color: #d97706; color: #fde68a; }
    .toast-critical { background: #4d1717; border-color: #ef4444; color: #fecaca; }
    .toast-icon { font-size: 1.05rem; flex-shrink: 0; }
    .toast-message { flex: 1; }
    /* #2677: the short disclaimer under an alert's text. */
    .toast-legal { display: block; font-size: 0.72rem; opacity: 0.75; margin-top: 2px; }
    .toast-legal a { color: inherit; text-decoration: underline; }
    /* #2677: the standard disclaimer under a trade form's buttons. */
    .modal-legal { font-size: 0.72rem; color: var(--text-muted); margin: 0.8rem 0 0; line-height: 1.4; }
    .toast-dismiss {
      background: none; border: none; color: inherit;
      opacity: 0.6; cursor: pointer; font-size: 1rem; padding: 0 0.3rem;
      flex-shrink: 0;
    }
    .toast-dismiss:hover { opacity: 1; }

    @keyframes toast-slide-in {
      from { opacity: 0; transform: translateX(40px); }
      to   { opacity: 1; transform: translateX(0); }
    }

    /* UI-POLISH-01: centered-on-entry progress bar (candidates + active positions) */
    .tt-bar-cell { display: flex; flex-direction: column; gap: 5px; align-items: center; }
    .tt-bar { position: relative; width: 200px; height: 10px; background: #1f2a37; border-radius: 5px; overflow: visible; }
    .tt-center { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: #d6dee8; transform: translateX(-50%); z-index: 2; }
    .tt-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: #2a3848; }
    .tt-fill { position: absolute; top: 0; bottom: 0; height: 100%; }
    .tt-fill.pos { left: 50%; border-radius: 0 5px 5px 0; }
    .tt-fill.neg { right: 50%; border-radius: 5px 0 0 5px; }
    .tt-overflow { position: absolute; top: 50%; transform: translateY(-50%); width: 0; height: 0; }
    .tt-overflow.right.pos { right: -8px; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 7px solid #00d68f; }
    .tt-overflow.left.neg { left: -8px; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-right: 7px solid #ef1d1d; }
    .tt-bar-label { font-size: 11px; font-variant-numeric: tabular-nums; line-height: 1.5; text-align: center; }
    .tt-pct-line { font-weight: 500; white-space: nowrap; }
    .tt-bullet-pos { color: #00d68f; font-size: 13px; line-height: 1; vertical-align: -1px; }
    .tt-bullet-neg { color: #ef1d1d; font-size: 13px; line-height: 1; vertical-align: -1px; }
    .tt-shares-line { color: #6b7280; font-size: 10px; }
    .gb-pos { color: var(--text-pos); }
    .gb-neg { color: var(--text-neg); }

    /* MY-POSITIONS-PROGRESS-BAR-01: centered-on-entry bar (My Positions only).
       Separate from .tt-bar above so the Actionable bar is untouched. */
    .position-bar-cell { min-width: 160px; }
    .position-bar-empty { text-align: center; padding: 4px 0; }
    .position-bar-wrapper {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .position-bar-track {
      position: relative;
      flex: 1;
      height: 12px;
      background: #050c18;
      border: 0.5px solid var(--border);
      border-radius: 3px;
      overflow: hidden;
    }
    .position-bar-loss-zone {
      position: absolute;
      left: 0; top: 0; bottom: 0;
      width: 50%;
      background: rgba(239, 68, 68, 0.15);
    }
    .position-bar-profit-zone {
      position: absolute;
      left: 50%; top: 0; bottom: 0;
      width: 50%;
      background: rgba(16, 185, 129, 0.15);
    }
    .position-bar-track.no-left .position-bar-loss-zone {
      background: transparent;
      border-right: 1px dashed #374151;
    }
    .position-bar-track.no-right .position-bar-profit-zone {
      background: transparent;
      border-left: 1px dashed #374151;
    }
    /* POSITION-BAR-R-SCALE-01 (#2374): the fill from entry to the marker, and
       the target as a tick on the R scale. */
    .position-bar-fill {
      position: absolute;
      top: 0; bottom: 0;
    }
    .position-bar-fill.fill-win  { background: rgba(16, 185, 129, 0.55); }
    .position-bar-fill.fill-lose { background: rgba(239, 68, 68, 0.55); }
    .position-bar-target {
      position: absolute;
      top: 0; bottom: 0;
      width: 0;
      border-left: 2px dotted #e5e7eb;
      transform: translateX(-1px);
    }
    .position-bar-entry-line {
      position: absolute;
      left: 50%;
      top: -3px;
      bottom: -3px;
      width: 1px;
      background: #374151;
    }
    .position-bar-marker {
      position: absolute;
      top: -3px;
      bottom: -3px;
      width: 3px;
      border-radius: 2px;
      transform: translateX(-50%);
    }
    .position-bar-marker.marker-win     { background: #10b981; }
    .position-bar-marker.marker-lose    { background: #ef4444; }
    .position-bar-marker.marker-neutral { background: #9ca3af; }
    .position-bar-track.no-price .position-bar-marker { opacity: 0.4; }
    .position-bar-icon {
      font-size: 14px;
      line-height: 1;
    }

    /* SIGNAL-DASHBOARD-01: per-strategy group header + hold-day heat.
       The bar itself reuses .position-bar-* above — no new bar styles. */
    .sig-group { margin-bottom: 1.25rem; }
    .sig-group:last-child { margin-bottom: 0; }
    .sig-group-head {
      display: flex; align-items: center; gap: 0.6rem;
      margin-bottom: 0.35rem;
    }
    .sig-group-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
    .sig-group-rule { flex: 1; height: 1px; background: var(--border); }
    .sig-group-stats {
      font-size: 0.75rem; color: var(--text-muted);
      white-space: nowrap; font-variant-numeric: tabular-nums;
    }
    /* table-layout: fixed so the <colgroup> widths are honoured. Without it the
       browser sizes columns from content, and since each strategy group is its
       own table, groups with wider prices push their columns out of line with
       the group above — the stack reads as sloppy even though each table is
       internally correct. */
    .sig-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; table-layout: fixed; }
    /* Fixed columns cannot grow, so long values must not silently overflow. */
    .sig-table th, .sig-table td { overflow: hidden; text-overflow: ellipsis; }
    /* ...EXCEPT the measurement cell, which anchors the per-gate hover.
       An absolutely-positioned popup is clipped by ANY ancestor with
       `overflow: hidden`, and the rule above applies it to every cell. That is
       why the hover shipped with a working trigger (the cursor changed) and an
       invisible popup: it rendered in the DOM and was cropped to the cell.
       Exempting one cell is safe where the blanket rule is not — this cell
       holds a two-digit score or an em-dash, never a long value that could
       silently overflow a fixed column. */
    .sig-table td.pmh-cell { overflow: visible; }
    .sig-table td { padding: 0.4rem 0.6rem; font-variant-numeric: tabular-nums; }
    .sig-pnl { margin-left: 0.35rem; font-size: 0.78rem; }
    /* INTRADAY-PRICE-REFRESH-02 — the percentage sits on the side of the bar it
       describes: a loss left with the loss zone, a gain right with the profit
       zone. Both rendered left before, because .position-bar-wrapper is a flex
       (block-level) container and this span is a sibling that wraps beneath it. */
    /* INTRADAY-PRICE-REFRESH-02 — placement by sign, via flex rather than
       text-align. text-align on a block aligns to the TABLE CELL's edge; the bar
       is narrower than its cell, so a "right-aligned" gain drifted away from the
       profit zone it describes. A flex row constrained to the wrapper's width
       puts the label under the correct half of the BAR. */
    /* SIGNAL-PRICE-FRESHNESS-01 — the group's price basis, in the header.
       Deliberately quiet: it is context for the numbers, not a warning. "Prices
       at last close" is the NORMAL state outside market hours and must not read
       as a fault, or the reader learns to ignore it on the morning it matters. */
    .sig-price-basis { font-weight: 600; }
    .basis-live  { color: #10b981; }
    .basis-session { color: #60a5fa; }
    .basis-eod   { color: #9ca3af; }
    .basis-mixed { color: #f59e0b; }
    .sig-pnl-row { display: flex; margin-top: 1px; }
    .sig-pnl-row.is-neg { justify-content: flex-start; }
    .sig-pnl-row.is-pos { justify-content: flex-end; }
    .sig-pnl-row .sig-pnl { margin-left: 0; }
    /* My Positions renders the same rule on its own label block. */
    .tt-bar-label.is-neg { text-align: left; }
    .tt-bar-label.is-pos { text-align: right; }
    /* Shown only when the intraday refresh could not supply a price, so an EOD
       close is never mistaken for a live one. */
    .sig-stale {
      display: inline-block; margin-left: 0.35rem; padding: 0 0.25rem;
      font-size: 0.62rem; font-weight: 600; letter-spacing: 0.03em;
      color: #9ca3af; border: 1px solid #374151; border-radius: 0.2rem;
    }
    /* #2943 — a match waiting for the next open: its entry is not a price yet. */
    .sig-waiting-open { font-weight: 600; color: var(--text-warn); white-space: nowrap; }
    /* INTRADAY-PRICE-REFRESH-02 — ticker page header. The tag states WHICH kind of
       price is shown; a delayed quote and a previous close must never look alike. */
    .tk-price-tag {
      display: inline-block; margin-left: 0.4rem; padding: 0 0.3rem;
      font-size: 0.6rem; font-weight: 600; letter-spacing: 0.04em;
      color: #9ca3af; border: 1px solid #374151; border-radius: 0.2rem;
      vertical-align: middle;
    }
    .tk-prev-close { margin-left: 0.5rem; font-size: 0.72rem; }
    /* Runway warning: amber past half the hold horizon, red past 80%. */
    .held-warn   { color: var(--text-warn); font-weight: 600; }
    .held-danger { color: var(--text-neg); font-weight: 700; }

    /* SIGNAL-HISTORY-01: Pipeline Signals tab bar. Sits directly above the
       fragment's .card, so it reads as the card's own header strip. */
    /* STYLE-01 Part 5 — underline-style tabs (was filled-background). Active
       tab: white text + blue underline; inactive: muted, no fill. */
    .tab-bar { display: flex; gap: 0.25rem; margin-bottom: 0; border-bottom: 1px solid var(--border); }
    .tab-btn {
      padding: 0.5rem 0.9rem; font-size: 0.85rem; font-family: inherit;
      background: transparent; color: var(--text-muted);
      border: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
      border-radius: 0; cursor: pointer; transition: color 0.1s, border-color 0.1s;
    }
    .tab-btn:hover { color: var(--text-primary); background: transparent; }
    .tab-btn.tab-active {
      background: transparent;
      color: var(--text-primary);
      border-bottom-color: var(--accent-bright);
      font-weight: 600;
    }

    /* SIGNAL-HISTORY-01: closed-signal rows */
    .hist-outcome { white-space: nowrap; font-weight: 600; }
    .hist-outcome-target  { color: var(--text-pos); }
    .hist-outcome-stop    { color: var(--text-neg); }
    .hist-outcome-expired { color: var(--text-muted); }
    .hist-path { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
    .hist-path-arrow { margin: 0 0.25rem; }
    .badge-dedup {
      display: inline-block; padding: 0.05rem 0.4rem; border-radius: 0.25rem;
      font-size: 0.6rem; font-weight: 700; letter-spacing: 0.04em;
      background: #2a3441; color: #9ca3af; border: 1px solid #3a4655;
      margin-left: 0.3rem;
    }
    .hist-insufficient { color: var(--text-warn); font-size: 0.75rem; }
    .hist-disclaimer {
      margin: 0.75rem 0 0 0; padding-top: 0.6rem;
      border-top: 1px solid var(--border);
      color: var(--text-muted); font-size: 0.75rem; line-height: 1.5;
    }

    /* TICKER-PAGE-01: public ticker page */
    .tk-header { margin-bottom: 1rem; }
    .tk-header-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
    .tk-h1 { margin: 0; font-size: 1.6rem; font-weight: 700; }
    .tk-sym { color: var(--text-muted); font-weight: 600; }
    .tk-h2 { margin: 0 0 0.75rem 0; font-size: 1.05rem; font-weight: 600; }
    .tk-price { font-size: 1.35rem; font-weight: 700; margin-top: 0.3rem; font-variant-numeric: tabular-nums; }
    .tk-chg { font-size: 0.9rem; font-weight: 600; margin-left: 0.4rem; }
    .tk-meta { font-size: 0.85rem; text-align: right; }
    .tk-facts {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
      gap: 0.75rem 1rem; margin: 1rem 0 0 0;
    }
    .tk-facts dt { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
    .tk-facts dd { margin: 0.15rem 0 0 0; font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
    .tk-chart { width: 100%; height: 360px; }
    /* CHART-01 — the pattern-match page's chart (tp-chart.js). */
    .app-pattern-detail .sd-chart { width: 100%; height: 420px; }
    .tk-legend { display: flex; gap: 1rem; font-size: 0.75rem; margin-top: 0.5rem; }
    .tk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 9999px; margin-right: 0.3rem; }
    .tk-dot-match { background: var(--focus-ring); }
    .tk-dot-custom { background: var(--text-warn); }
    /* CHART-01 — the chart's level lines (tp-chart.js): entry, stop, target. */
    .tk-dot-entry { background: var(--regime-bull); }
    .tk-dot-stop { background: var(--regime-correction); }
    .tk-dot-target { background: var(--regime-sideways); }
    /* The ticker page's Live now card links to the match's own page. */
    .tk-match-link { color: var(--text-primary); text-decoration: none; }
    .tk-match-link:hover { color: var(--regime-bull); text-decoration: underline; }
    .tk-match-open { display: inline-block; margin-top: 0.5rem; font-size: 0.85rem; color: var(--regime-bull); }
    /* The pattern match page: each gate with its name, settings, reading, education link. */
    .mg-intro { margin: 0 0 0.75rem; font-size: 0.85rem; }
    .mg-list { display: flex; flex-direction: column; gap: 0.5rem; }
    .mg-row { border: 1px solid var(--border); border-radius: 8px; padding: 0.65rem 0.8rem; }
    .mg-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
    .mg-name { font-weight: 600; color: var(--text-primary); }
    .mg-settings { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0.35rem 0 0; font-size: 0.82rem; }
    .mg-settings div { display: flex; gap: 0.35rem; }
    .mg-settings dt { color: var(--text-muted); }
    .mg-settings dd { margin: 0; color: var(--text-primary); font-family: var(--font-mono); }
    .mg-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; flex: 0 0 auto; }
    .mg-score { font-family: var(--font-mono); color: var(--text-muted); }
    .mg-learn { font-size: 0.82rem; color: var(--regime-bull); white-space: nowrap; }
    @media (max-width: 640px) { .mg-head { flex-direction: column; } .mg-side { align-items: flex-start; } }
    .tk-teaser {
      display: flex; align-items: center; gap: 0.9rem;
      background: #1e3a5f33; border: 1px solid #2563eb55;
      border-radius: 0.5rem; padding: 0.85rem 1rem;
    }
    .tk-teaser > div { flex: 1; }
    .tk-bolt { font-size: 1.3rem; }
    .tk-names { margin: 0 0 0.6rem 1.1rem; font-size: 0.9rem; }
    .tk-perf { margin-bottom: 1.25rem; }
    .tk-perf:last-of-type { margin-bottom: 0; }
    .tk-perf-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.35rem; }
    .tk-perf-stats {
      display: flex; gap: 1.1rem; flex-wrap: wrap;
      font-size: 0.9rem; font-variant-numeric: tabular-nums; margin-bottom: 0.5rem;
    }
    .tk-owner { font-size: 0.7rem; margin-left: 0.35rem; }
    .tk-more { font-size: 0.78rem; margin-top: 0.4rem; }
    .tk-disclaimer {
      margin: 1rem 0 0 0; padding-top: 0.75rem;
      border-top: 1px solid var(--border);
      color: var(--text-muted); font-size: 0.78rem; line-height: 1.5;
    }

    /* SECURITIES-PAGES-01 (#2248): the security page and the securities search.
       Tokens only: green is --text-pos and red is --text-neg, the same values
       the candles, P&L and outcome text use everywhere else on the site. */
    .sec-stack { display: flex; flex-direction: column; gap: 1rem; }
    .sec-stack .card { padding: 1.1rem 1.25rem; border-radius: 0.5rem; }
    .sec-stack .card.tk-header { margin-bottom: 0; }
    .sec-split { display: flex; flex-wrap: wrap; gap: 1rem; align-items: stretch; }
    .sec-split > .sec-main { flex: 999 1 560px; min-width: 0; }
    .sec-split > .sec-side { flex: 1 1 300px; min-width: 0; }
    .sec-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
    .sec-chip {
      display: inline-flex; align-items: center; gap: 0.4rem;
      padding: 0.25rem 0.65rem; border-radius: 9999px; font-size: 0.78rem;
      background: var(--bg-base); border: 1px solid var(--border); color: var(--text-primary);
    }
    .sec-chip-key { font-size: 0.65rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
    .sec-range { margin-top: 0.25rem; }
    .sec-range-track { position: relative; height: 6px; border-radius: 3px; background: var(--border); }
    .sec-range-mark {
      position: absolute; top: -5px; width: 4px; height: 16px; margin-left: -2px;
      border-radius: 2px; background: var(--text-primary);
    }
    .sec-range-ends { display: flex; justify-content: space-between; font-size: 0.75rem; margin-top: 0.35rem; font-variant-numeric: tabular-nums; }
    .sec-bt-label { font-size: 0.78rem; margin: 0.5rem 0 0.75rem; }
    .sec-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
    .sec-kpi { padding: 1rem 1.1rem; border-radius: 0.5rem; }
    .sec-kpi-label { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
    .sec-kpi-value { font-size: 1.6rem; font-weight: 700; margin-top: 0.35rem; font-variant-numeric: tabular-nums; }
    .sec-kpi-unit { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }
    .sec-kpi-note { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3rem; }
    .sec-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0.75rem 0; }
    .sec-level { background: var(--bg-base); border: 1px solid var(--border); border-radius: 0.4rem; padding: 0.55rem 0.65rem; }
    .sec-level dt { font-size: 0.65rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
    .sec-level dd { margin: 0.2rem 0 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
    .sec-live-item + .sec-live-item { border-top: 1px solid var(--border); margin-top: 0.9rem; padding-top: 0.9rem; }
    .sec-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
    .sec-sub { font-size: 0.85rem; color: var(--text-muted); margin: 0.2rem 0 0 0; }
    .sec-tabs { display: inline-flex; gap: 0.25rem; padding: 0.2rem; border-radius: 0.5rem; background: var(--bg-base); border: 1px solid var(--border); }
    .sec-tab {
      font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; min-height: 2.25rem;
      padding: 0.35rem 0.85rem; border-radius: 0.4rem; border: 1px solid transparent;
      background: transparent; color: var(--text-muted);
    }
    .sec-tab[aria-selected="true"], .sec-tab[aria-pressed="true"] { background: var(--bg-card); border-color: var(--border); color: var(--text-primary); }
    .sec-tab:focus-visible, .sec-expand:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
    .sec-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
    .sec-legend { display: flex; gap: 0.9rem; flex-wrap: wrap; font-size: 0.78rem; color: var(--text-muted); }
    .sec-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
    .sec-scroll { overflow-x: auto; }
    .sec-strats { min-width: 900px; }
    .sec-srow {
      display: grid; grid-template-columns: minmax(200px, 2.2fr) 64px 76px 140px 60px minmax(220px, 2.6fr) 40px;
      gap: 0.9rem; align-items: center; padding: 0.7rem 0.4rem; border-top: 1px solid var(--border);
    }
    .sec-srow-head { border-top: none; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); padding-top: 0; }
    .sec-num { text-align: right; font-variant-numeric: tabular-nums; }
    .sec-name { font-weight: 600; font-size: 0.9rem; line-height: 1.35; }
    .sec-shared { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }
    .sec-rbar { position: relative; width: 80px; height: 8px; border-radius: 4px; background: var(--bg-base); flex: none; }
    .sec-rbar-zero { position: absolute; left: 28px; top: -3px; width: 1px; height: 14px; background: var(--text-muted); }
    .sec-rbar-fill { position: absolute; top: 0; height: 8px; border-radius: 4px; }
    .sec-rbar-fill.pos { left: 28px; background: var(--text-pos); }
    .sec-rbar-fill.neg { right: 52px; background: var(--text-neg); }
    .sec-rcell { display: flex; align-items: center; gap: 0.5rem; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
    .sec-axis { position: relative; height: 1rem; }
    .sec-axis span { position: absolute; transform: translateX(-50%); }
    .sec-lane { position: relative; height: 20px; border-radius: 4px; background: var(--bg-base); }
    .sec-lane-year { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
    .sec-dot { position: absolute; top: 4px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; box-sizing: border-box; }
    .sec-legend .sec-dot { position: static; margin: 0; }
    .sec-dot-target { background: var(--text-pos); }
    .sec-dot-win { border: 2px solid var(--text-pos); background: var(--bg-base); }
    .sec-dot-loss { border: 2px solid var(--text-neg); background: var(--bg-base); }
    .sec-dot-stop { background: var(--text-neg); }
    .sec-dot-flat { background: var(--text-muted); }
    .sec-pips { display: flex; gap: 0.35rem; flex-wrap: wrap; }
    .sec-pips .sec-dot { position: static; margin: 0; }
    .sec-expand {
      font: inherit; width: 2.25rem; height: 2.25rem; border-radius: 0.4rem; cursor: pointer;
      border: 1px solid var(--border); background: var(--bg-base); color: var(--text-primary);
    }
    .sec-detail { padding: 0.25rem 0.4rem 1rem; background: var(--bg-base); border-top: 1px solid var(--border); }
    .sec-detail[hidden] { display: none; }
    .sec-badge {
      display: inline-block; padding: 0.1rem 0.55rem; border-radius: 9999px; font-size: 0.75rem;
      border: 1px solid var(--border); color: var(--text-muted);
    }
    .sec-badge.pos { color: var(--text-pos); border-color: color-mix(in srgb, var(--text-pos) 40%, transparent); background: color-mix(in srgb, var(--text-pos) 10%, transparent); }
    .sec-badge.neg { color: var(--text-neg); border-color: color-mix(in srgb, var(--text-neg) 40%, transparent); background: color-mix(in srgb, var(--text-neg) 10%, transparent); }
    .sec-howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
    .sec-howto p { margin: 0.4rem 0 0 0; font-size: 0.85rem; line-height: 1.55; }
    .sec-search { display: flex; gap: 0.5rem; flex-wrap: wrap; }
    .sec-search input[type="search"] {
      flex: 1 1 260px; min-height: 2.5rem; padding: 0.4rem 0.75rem; font: inherit;
      background: var(--bg-base); color: var(--text-primary); border: 1px solid var(--border); border-radius: 0.4rem;
    }
    .sec-search select {
      min-height: 2.5rem; padding: 0.3rem 0.6rem; font: inherit;
      background: var(--bg-base); color: var(--text-primary); border: 1px solid var(--border); border-radius: 0.4rem;
    }

    /* USER-POSITIONS-02: trade modal (add/close) */
    .modal-backdrop {
      position: fixed; inset: 0; z-index: 100;
      background: rgba(0,0,0,0.6); backdrop-filter: blur(2px);
      display: flex; align-items: center; justify-content: center;
      padding: 1rem;
    }
    /* USER-POSITIONS-03: stacked modal — secondary host floats above primary */
    #modal-host-secondary .modal-backdrop { z-index: 110; }
    .modal-card {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 0.5rem; padding: 1.25rem 1.5rem;
      width: 100%; max-width: 520px;
      box-shadow: 0 12px 40px rgba(0,0,0,0.45);
    }
    .modal-card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.75rem; }
    .modal-card label { display: block; font-size: 0.7rem; color: var(--text-muted);
                       text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
    .modal-card input[type=text], .modal-card input[type=number],
    .modal-card input[type=date], .modal-card textarea,
    /* ADD-TRADE-STRATEGY-DROPDOWN-03 — the Strategy field became a <select>.
       Added to the existing rule rather than given its own, so it cannot drift
       from the inputs beside it. */
    .modal-card select {
      width: 100%; padding: 0.4rem 0.55rem;
      background: var(--bg-base); color: var(--text-primary);
      border: 1px solid var(--border); border-radius: 0.375rem;
      font-size: 0.875rem; font-variant-numeric: tabular-nums;
    }
    .modal-card input:read-only { background: var(--bg-elevated); color: var(--text-muted); }
    .modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.6rem; }
    .modal-row.single { grid-template-columns: 1fr; }
    .modal-context { background: var(--bg-base); border: 1px solid var(--border);
                    border-radius: 0.375rem; padding: 0.6rem 0.75rem;
                    margin-bottom: 0.85rem; font-size: 0.8rem;
                    font-variant-numeric: tabular-nums; }
    .modal-context .row { display: flex; justify-content: space-between; padding: 0.1rem 0; }
    .modal-context .label { color: var(--text-muted); }
    .modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }
    .btn-primary { padding: 0.4rem 0.85rem; background: var(--accent); color: white;
                  border: none; border-radius: 0.375rem; font-size: 0.825rem;
                  font-weight: 600; cursor: pointer; }
    .btn-primary:hover:not(:disabled) { background: var(--accent-hover); } /* STYLE-02: was the old blue #1d4ed8 under a green button */
    .btn-primary:disabled { background: var(--border); color: var(--text-disabled); cursor: not-allowed; }
    .btn-secondary { padding: 0.4rem 0.85rem; background: transparent; color: var(--text-muted);
                    border: 1px solid var(--border); border-radius: 0.375rem;
                    font-size: 0.825rem; cursor: pointer; }
    .btn-secondary:hover { color: var(--text-primary); border-color: var(--border-strong); }
    .btn-link { background: none; border: none; color: var(--accent-bright); cursor: pointer;
               padding: 0.1rem 0.25rem; }
    .btn-link:hover { color: #bfdbfe; text-decoration: underline; }
    .modal-error { color: var(--text-neg); font-size: 0.75rem; margin-top: 0.5rem; }

    /* ADD-TRADE-STRATEGY-DROPDOWN-03 — USER-POSITIONS-02a's .strategy-field-group
       (datalist + gear icon) removed with the freeform field and the Manage
       Strategies modal it opened. */
    .btn-icon {
      padding: 0 0.55rem;
      background: transparent;
      color: var(--text-muted);
      border: 1px solid var(--border);
      border-radius: 0.375rem;
      font-size: 1rem;
      line-height: 1;
      cursor: pointer;
      transition: color 0.1s, border-color 0.1s;
    }
    .btn-icon:hover { color: var(--text-primary); border-color: var(--border-strong); }

    /* CLOSED-TRADES-VIEW-01: top nav */
    /* NAV-BAR-CONSISTENCY-01 — a fixed height, not a derived one.
       .top-nav sized to its tallest child, and that child is the capital widget,
       whose height varied: the server-side placeholder is two lines, the HTMX
       fragment used to be three, and the third line was conditional. So the nav
       stood at a different height per page AND jumped once the fragment landed.
       Making the widget two rows unconditionally fixes the cause; this fixes it
       for good, so no future nav child can reflow the bar. */
    .top-nav {
      display: flex; align-items: center; gap: 0.5rem;
      height: 3.25rem; box-sizing: border-box;
      padding: 0 1rem; background: var(--bg-raised);
      border-bottom: 1px solid var(--border);
      margin: -1.5rem -1.5rem 1rem -1.5rem;
    }
    /* Nothing in the bar may outgrow it. */
    .top-nav > * { max-height: 100%; }
    .nav-link {
      padding: 0.35rem 0.75rem; border-radius: 4px;
      text-decoration: none; color: var(--text-muted); font-size: 0.875rem;
    }
    .nav-link:hover { background: var(--bg-elevated); color: var(--text-heading); }
    .nav-link.active { background: var(--bg-selected); color: var(--text-heading); }
    .nav-spacer { flex: 1; }
    .nav-title { color: var(--text-muted); font-size: 0.75rem; }

    /* SIGNAL-GENERATION-UI-01: Signal Generation dropdown.
       Click-to-toggle with outside-click dismissal; the menu collapses
       on its own when focus moves elsewhere. Highlighted state mirrors
       .nav-link.active so the parent stays lit while the child page is
       open. */
    .nav-dropdown { position: relative; }
    .nav-dropdown-trigger {
      background: none; border: none; cursor: pointer;
      padding: 0.35rem 0.75rem; border-radius: 4px;
      text-decoration: none; color: var(--text-muted); font-size: 0.875rem;
      font-family: inherit;
    }
    .nav-dropdown-trigger:hover { background: var(--bg-elevated); color: var(--text-heading); }
    .nav-dropdown.active .nav-dropdown-trigger { background: var(--bg-selected); color: var(--text-heading); }
    .nav-dropdown-menu {
      display: none; position: absolute; top: 100%; left: 0;
      background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px;
      min-width: 180px; z-index: 50; padding: 0.25rem 0;
      box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    }
    .nav-dropdown-menu.open { display: block; }
    .nav-dropdown-item {
      display: block; padding: 0.4rem 0.85rem;
      color: var(--text-muted); font-size: 0.875rem; text-decoration: none;
    }
    .nav-dropdown-item:hover { background: var(--bg-elevated); color: var(--text-heading); }
    .nav-dropdown-item.active { color: var(--text-heading); background: var(--bg-selected); }
    /* WB-NAV-01 (#2472) — a menu item the user's plan does not include: greyed,
       tagged with the plan, and a tooltip on hover or keyboard focus. */
    .nav-dropdown-item-locked { position: relative; cursor: default; color: var(--text-disabled); }
    .nav-dropdown-item-locked:hover { background: transparent; color: var(--text-disabled); }
    .nav-plan-tag {
      margin-left: 0.4rem; padding: 0 0.35rem; border: 1px solid var(--border);
      border-radius: 3px; font-size: 0.7rem; color: var(--text-disabled);
    }
    .nav-dropdown-item-locked:hover::after,
    .nav-dropdown-item-locked:focus::after {
      content: attr(data-tip); position: absolute; left: 100%; top: 50%;
      transform: translateY(-50%); margin-left: 0.4rem; white-space: nowrap;
      background: var(--bg-elevated); color: var(--text-heading); border: 1px solid var(--border);
      border-radius: 4px; padding: 0.25rem 0.5rem; font-size: 0.75rem; z-index: 60;
    }
    @media (max-width: 768px) {
      .nav-dropdown-item-locked:hover::after,
      .nav-dropdown-item-locked:focus::after {
        position: static; display: block; transform: none; margin: 0.25rem 0 0; white-space: normal;
      }
    }

    /* Nested dropdown — the Strategies row inside the Signal
       Generation menu fans out a second-level menu on hover (no
       click handler so the submenu disappears when the mouse leaves
       either layer; the parent menu's outside-click handler still
       collapses the whole tree). */
    .nav-dropdown-submenu { position: relative; }
    .nav-dropdown-submenu-menu {
      display: none;
      position: absolute;
      left: 100%;
      top: 0;
      background: var(--bg-elevated);
      border: 1px solid var(--border-strong);
      border-radius: 0.3rem;
      min-width: 180px;
      z-index: 200;
    }
    .nav-dropdown-submenu:hover .nav-dropdown-submenu-menu { display: block; }

    /* STYLE-05 — the nav at phone width. Above 768px .nav-items takes no box
       of its own (display: contents), so the bar is exactly as before and the
       Menu button is hidden. At 768px and below the items become a vertical
       panel under the bar, opened by the button; dropdowns open in place and
       submenus are listed inline, so every item stays a plain link. */
    .nav-items { display: contents; }
    .nav-menu-toggle { display: none; }
    @media (max-width: 768px) {
      .top-nav { flex-wrap: wrap; height: auto; min-height: 3.25rem; padding: 0.4rem 1rem; }
      .top-nav > * { max-height: none; }
      .nav-menu-toggle {
        display: inline-flex; align-items: center; margin-left: auto;
        padding: 0.4rem 0.85rem; border-radius: var(--radius-sm);
        background: transparent; color: var(--text-primary); font: inherit; font-size: 0.875rem;
        border: 1px solid var(--border-strong); cursor: pointer;
      }
      .top-nav.is-open .nav-menu-toggle { background: var(--bg-selected); color: var(--text-heading); }
      .nav-items {
        display: none; flex-basis: 100%; flex-direction: column; align-items: stretch;
        gap: 0.15rem; padding: 0.5rem 0 0.75rem; border-top: 1px solid var(--border); margin-top: 0.4rem;
      }
      .top-nav.is-open .nav-items { display: flex; }
      .nav-items .nav-link,
      .nav-items .nav-dropdown-trigger { display: block; width: 100%; text-align: left; padding: 0.55rem 0.75rem; box-sizing: border-box; }
      .nav-items .nav-spacer { display: none; }
      .nav-items .nav-dropdown-menu {
        position: static; min-width: 0; box-shadow: none; border: 0; border-left: 2px solid var(--border);
        margin: 0.15rem 0 0.35rem 0.75rem; background: transparent;
      }
      .nav-items .nav-dropdown-menu-right { left: auto; right: auto; }
      .nav-items .nav-dropdown-submenu-menu {
        display: block; position: static; min-width: 0; border: 0; background: transparent; padding-left: 0.85rem;
      }
      .nav-items .nav-dropdown-submenu-trigger { color: var(--text-muted); }
      .nav-items .nav-capital { padding: 0.35rem 0.75rem; }
      .nav-items .nav-user-dropdown { order: 0; }
    }
    .nav-dropdown-submenu-trigger {
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: default;
    }
    .nav-dropdown-submenu-trigger::after { content: '▶'; font-size: 0.6rem; }

    /* BETA-FIX-01 — brand logo in the nav (always visible, no auth guard). */
    /* BETA-FIX-04 — strip any border/outline/background so the dark wordmark
       blends into the nav (no visible box). That never worked on its own: the
       old PNG had an opaque #0f172a background baked in, and neither nav is
       that colour. tp_site_header.png is the same art with that background
       keyed to alpha (composites back onto #0f172a within 1/255). */
    .nav-logo {
      display: flex; align-items: center; margin-right: 0.5rem;
      text-decoration: none; border: none; outline: none; background: transparent;
    }
    /* BETA-FIX-03 — hard cap so the logo never renders at natural/full size. */
    .nav-logo img {
      display: block; height: 32px; width: auto; max-width: 160px;
      border: none; outline: none; background: transparent;
    }

    /* BETA-FIX-01 (Fix 5b) — account menu. Reuses the .nav-dropdown machinery;
       the trigger holds an inline SVG person icon (tabler is not loaded) and the
       menu anchors to the right edge so it never overflows off-screen. */
    /* BETA-FIX-03 — trigger must not stretch the nav bar. */
    .nav-user-trigger {
      display: flex; align-items: center; padding: 4px;
      background: none; border: none; cursor: pointer; color: inherit; flex-shrink: 0;
    }
    .nav-user-trigger svg { display: block; }
    /* BETA-FIX-03 — Google profile photo avatar (falls back to the inline SVG). */
    /* Initials in place of the Google photo (Jason, 2026-11-12): nothing fetched. */
    .nav-user-initials {
      width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
      display: inline-flex; align-items: center; justify-content: center;
      font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
      color: var(--text-primary); background: var(--bg-card); border: 1px solid var(--border-emph);
    }
    .nav-dropdown-menu-right { left: auto; right: 0; }
    /* BETA-FIX-03 — compact inline tier selector on the admin users table. */
    .admin-select-sm {
      font-size: 0.8rem; padding: 2px 4px; border-radius: 4px;
      background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border);
    }
    /* BETA-FIX-03 (Fix 6) — group divider inside dropdown menus. */
    .nav-dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
    /* "Sign out" is a POST <form>, so reset its button to read as a plain item. */
    .nav-user-logout-form { margin: 0; }
    .nav-user-logout-btn {
      width: 100%; text-align: left; cursor: pointer;
      background: none; border: none; font-family: inherit;
    }

    /* BETA-FIX-01 — legal pages (/terms, /privacy), rendered markdown. */
    .legal-page {
      max-width: 740px;
      margin: 2rem auto;
      line-height: 1.7;
      font-size: 0.95rem;
    }
    .legal-page h1, .legal-page h2, .legal-page h3 {
      margin-top: 1.5rem;
      font-weight: 600;
    }
    .legal-page p { margin-bottom: 0.9rem; }
    .legal-page hr { margin: 1.5rem 0; opacity: 0.2; }

    /* FAQ-PAGE-SHELL-01 (#1807) — native <details>/<summary> accordion. */
    .faq-page { max-width: 740px; margin: 2rem auto; }
    .faq-title { font-size: 1.5rem; font-weight: 600; margin: 0 0 1.25rem; color: var(--text-primary); }
    .faq-empty { color: var(--text-muted); }
    .faq-list { display: flex; flex-direction: column; gap: 0.6rem; }
    .faq-item {
      background-color: var(--bg-card); background-image: var(--grad-card); border: 1px solid var(--border); border-radius: 8px;
      padding: 0.1rem 1rem;
    }
    .faq-question {
      cursor: pointer; padding: 0.85rem 0; font-weight: 600; font-size: 0.95rem;
      color: var(--text-primary); list-style: none;
    }
    .faq-question::-webkit-details-marker { display: none; }
    .faq-question::before { content: "+"; display: inline-block; width: 1.2em; color: var(--accent-bright); }
    details[open] > .faq-question::before { content: "\2212"; }
    .faq-answer { padding: 0 0 0.9rem 1.2em; color: var(--text-muted); font-size: 0.9rem; line-height: 1.65; }
    .faq-answer p:last-child { margin-bottom: 0; }

    /* CLOSED-TRADES-VIEW-01: page header + summary stats grid */
    .page-header { margin-bottom: 1rem; }
    .page-header h1 { margin: 0; font-size: 1.5rem; }
    .page-header .muted { font-size: 0.85rem; margin-top: 0.25rem; }
    .stats-grid {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 0.75rem; margin-bottom: 1.5rem;
    }
    .stat-card {
      background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px;
      padding: 0.75rem; display: flex; flex-direction: column; gap: 0.15rem;
    }
    .stat-label { font-size: 0.75rem; color: var(--text-muted);
                  text-transform: uppercase; letter-spacing: 0.05em; }
    .stat-value { font-size: 1.25rem; font-weight: 600; }
    .stat-sub { font-size: 0.7rem; }
    .charts-grid {
      display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem;
    }
    @media (max-width: 900px) {
      .charts-grid { grid-template-columns: 1fr; }
    }
    .chart-card {
      background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px;
      padding: 0.75rem; height: 240px;
    }
    .chart-card h3 {
      margin: 0 0 0.5rem 0; font-size: 0.85rem; font-weight: 500; color: #9ca3af;
    }
    .filters form {
      display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end;
      background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px;
      padding: 0.75rem; margin-bottom: 1rem;
    }
    .filters label {
      display: flex; flex-direction: column; gap: 0.2rem;
      font-size: 0.8rem; color: #9ca3af;
    }
    .filters input, .filters select {
      background: var(--bg-elevated); color: var(--text-heading); border: 1px solid var(--border-strong);
      padding: 0.3rem 0.5rem; border-radius: 4px; font-size: 0.85rem;
    }
    .filters button {
      background: var(--bg-elevated); color: var(--text-heading); border: 1px solid var(--border-strong);
      padding: 0.35rem 0.85rem; border-radius: 4px; cursor: pointer; font-size: 0.85rem;
    }
    .filters .filter-reset {
      color: #9ca3af; text-decoration: none; font-size: 0.8rem; padding: 0.35rem;
    }
    .closed-trades-table {
      width: 100%; border-collapse: collapse; font-size: 0.85rem;
      background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px;
      overflow: hidden;
    }
    .closed-trades-table th,
    .closed-trades-table td { padding: 0.4rem 0.6rem; text-align: left; }
    .closed-trades-table th {
      font-weight: 600; font-size: 0.75rem; color: #9ca3af;
      text-transform: uppercase; letter-spacing: 0.05em;
      border-bottom: 1px solid var(--border); background: #050c18;
    }
    .closed-trades-table td { border-bottom: 1px solid #111827; }
    .closed-trades-table .num { text-align: right; font-variant-numeric: tabular-nums; }
    .notes-cell { color: #9ca3af; font-size: 0.78rem; max-width: 280px; }
    .pnl-up   { color: #10b981; }
    .pnl-down { color: #ef4444; }
    .empty-state {
      background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px;
      padding: 2rem; text-align: center;
    }
    .empty-state a { color: #3b82f6; }

    /* USER-POSITIONS-02a: Manage Strategies modal */
    .modal-card-wide { max-width: 720px; }
    .strategies-section { margin-bottom: 1.1rem; }
    .strategies-section h4 {
      font-size: 0.7rem; color: var(--text-muted);
      text-transform: uppercase; letter-spacing: 0.05em;
      margin-bottom: 0.4rem;
    }
    .strategy-create-row {
      display: grid; grid-template-columns: 1fr 1.5fr auto; gap: 0.5rem;
      align-items: center;
    }
    .strategy-list { list-style: none; padding: 0; margin: 0; }
    .strategy-row {
      padding: 0.4rem 0; border-bottom: 1px solid var(--border);
    }
    .strategy-row:last-child { border-bottom: none; }
    .strategy-row-muted { opacity: 0.55; }
    .strategy-edit-form {
      display: grid;
      grid-template-columns: 1.1fr 1.7fr auto auto auto;
      gap: 0.5rem; align-items: center;
    }
    .strategy-name-readonly { font-weight: 600; }
    .strategy-active-toggle {
      display: flex; align-items: center; gap: 0.25rem;
      font-size: 0.7rem; color: var(--text-muted);
      text-transform: none; letter-spacing: 0; margin: 0;
    }
    .strategy-delete { color: var(--text-neg); }

    /* UI-02: ticker click-through link (keeps .ticker styling, adds anchor affordance) */
    .ticker-link { color: inherit; text-decoration: none; }
    .ticker-link:hover { color: var(--text-heading); text-decoration: underline; }

    /* UI-02: Symbol Detail page */
    .sd-header-top { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
    .sd-ticker { margin: 0; font-size: 2rem; font-weight: 700; letter-spacing: 0.02em; }
    .sd-in-position { text-decoration: none; }
    .sd-subtitle { font-size: 0.9rem; margin-top: 0.35rem; }
    .sd-stats { margin-bottom: 1.5rem; }
    .sd-card {
      background-color: var(--bg-card); background-image: var(--grad-card); border: 1px solid var(--border);
      border-radius: 0.5rem; padding: 1rem 1.25rem; margin-bottom: 1.25rem;
    }
    .sd-section-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.75rem 0; }
    .sd-kv {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
      gap: 0.6rem 1rem; margin: 0 0 0.85rem 0;
    }
    .sd-kv dt { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
    .sd-kv dd { margin: 0.1rem 0 0 0; font-size: 0.95rem; font-variant-numeric: tabular-nums; font-weight: 600; }
    .sd-position + .sd-position { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
    .sd-position-bar { margin-top: 0.25rem; }

    /* UI-02: notes section */
    .sd-note-add { margin-bottom: 1rem; }
    .sd-note-add textarea, .sd-note-edit textarea {
      width: 100%; padding: 0.45rem 0.6rem; background: var(--bg-base); color: var(--text-primary);
      border: 1px solid var(--border); border-radius: 0.375rem; font-size: 0.875rem;
      font-family: inherit; resize: vertical;
    }
    .sd-note-add-row { display: flex; gap: 0.5rem; margin-top: 0.4rem; align-items: center; }
    .sd-note-add-row input[type=text] {
      flex: 1; padding: 0.35rem 0.55rem; background: var(--bg-base); color: var(--text-primary);
      border: 1px solid var(--border); border-radius: 0.375rem; font-size: 0.8rem;
    }
    .sd-note-list { list-style: none; padding: 0; margin: 0; }
    .sd-note { padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
    .sd-note:last-child { border-bottom: none; }
    .sd-note-pinned { background: #11203355; border-radius: 0.375rem; padding: 0.6rem 0.7rem; }
    .sd-note-body { font-size: 0.9rem; white-space: pre-wrap; }
    .sd-note-tags { margin-top: 0.35rem; display: flex; gap: 0.3rem; flex-wrap: wrap; }
    .sd-note-meta { margin-top: 0.35rem; font-size: 0.72rem; color: var(--text-muted); }
    .sd-note-author { color: var(--text-primary); }
    .sd-note-controls { margin-left: 0.4rem; }
    .sd-note-delete { color: var(--text-neg); }
    .sd-empty-notes { padding: 0.4rem 0; }

    /* STRATEGY-PERFORMANCE: per-strategy performance pages */
    .sp-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
    .sp-toggles { display: flex; gap: 0.75rem; flex-wrap: wrap; }
    .toggle-group {
      display: inline-flex; background: var(--bg-raised); border: 1px solid var(--border);
      border-radius: 6px; overflow: hidden;
    }
    .toggle-pill {
      padding: 0.3rem 0.7rem; font-size: 0.78rem; text-decoration: none;
      color: var(--text-muted); border-right: 1px solid var(--border);
    }
    .toggle-pill:last-child { border-right: none; }
    .toggle-pill:hover { background: var(--bg-elevated); color: var(--text-heading); }
    .toggle-pill.active { background: var(--bg-selected); color: var(--text-heading); }
    .sp-banner {
      display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; align-items: baseline;
      background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px;
      padding: 0.6rem 0.85rem; margin-bottom: 1.5rem; font-size: 0.85rem;
    }
    .sp-banner b { font-variant-numeric: tabular-nums; }
    .sp-banner .sp-banner-note { color: #6b7280; margin-left: auto; font-size: 0.78rem; }
    .sp-table { width: 100%; border-collapse: collapse; font-size: 0.85rem;
      background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
    .sp-table th, .sp-table td { padding: 0.45rem 0.7rem; text-align: left; }
    .sp-table th {
      font-weight: 600; font-size: 0.75rem; color: #9ca3af;
      text-transform: uppercase; letter-spacing: 0.05em;
      border-bottom: 1px solid var(--border); background: #050c18;
    }
    .sp-table td { border-bottom: 1px solid #111827; font-variant-numeric: tabular-nums; }
    .sp-table th.num, .sp-table td.num { text-align: right; }
    .sp-row-link { cursor: pointer; }
    .sp-row-link:hover { background: #1a2230; }
    .sp-row-link a.sp-strategy-name { color: var(--accent-bright); text-decoration: none; font-weight: 600; }
    .sp-row-link:hover a.sp-strategy-name { text-decoration: underline; }
    .sp-arrow { color: #6b7280; text-align: right; }
    .sp-subcount { color: #6b7280; font-size: 0.72rem; margin-left: 0.25rem; }
    .sp-footer-note { color: #6b7280; font-size: 0.8rem; margin-top: 0.75rem; }
    .sp-breadcrumb { font-size: 0.8rem; margin-bottom: 0.4rem; }
    .sp-breadcrumb a { color: var(--accent-bright); text-decoration: none; }
    .sp-breadcrumb a:hover { text-decoration: underline; }

    .metric-grid {
      display: grid; grid-template-columns: repeat(4, 1fr);
      gap: 0.75rem; margin-bottom: 1.5rem;
    }
    @media (max-width: 720px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } }
    .metric-card {
      background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px;
      padding: 0.85rem; display: flex; flex-direction: column; gap: 0.2rem;
    }
    .metric-label { font-size: 0.72rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; }
    .metric-value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
    .metric-value.pos { color: #10b981; }
    .metric-value.neg { color: #ef4444; }
    .metric-value.neutral { color: var(--text-primary); }
    .metric-sub { font-size: 0.72rem; color: #6b7280; }

    .doughnut-row { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
    .doughnut-wrap { width: 180px; height: 180px; flex-shrink: 0; }
    .doughnut-legend { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
    .doughnut-legend li { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0; }
    .legend-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
    .legend-count { font-variant-numeric: tabular-nums; }
    .legend-pct { color: #6b7280; font-variant-numeric: tabular-nums; }

    .outcome-pill {
      display: inline-block; padding: 0.1rem 0.5rem; border-radius: 9999px;
      font-size: 0.7rem; font-weight: 600; white-space: nowrap;
    }
    .outcome-target { background: #134e2a; color: #6ee7b7; }
    .outcome-stop { background: #4d1717; color: #fca5a5; }
    .outcome-inconclusive { background: var(--bg-elevated); color: var(--text-muted); }
    .outcome-never { background: transparent; color: #6b7280; }
    .outcome-ambiguous { background: #4d3a09; color: #fcd34d; }
    .outcome-pending { background: transparent; color: #6b7280; font-style: italic; }

    .sp-pagination { display: flex; align-items: center; gap: 1rem; margin-top: 0.75rem; font-size: 0.82rem; color: var(--text-muted); }
    .sp-pagination button {
      background: var(--bg-elevated); color: var(--text-heading); border: 1px solid var(--border-strong);
      padding: 0.3rem 0.8rem; border-radius: 4px; cursor: pointer; font-size: 0.82rem;
    }
    .sp-pagination button:hover { background: var(--border-strong); }
    .sp-show-all td { text-align: center; }
    .sp-show-all button {
      background: none; border: none; color: var(--accent-bright); cursor: pointer; font-size: 0.82rem;
    }
    .sp-show-all button:hover { text-decoration: underline; }

    /* SETTINGS-PAGE-01: Settings page */
    .settings-section { margin-bottom: 1.5rem; }
    .settings-head {
      display: flex; align-items: center; justify-content: space-between;
      gap: 1rem; margin-bottom: 0.5rem;
    }
    .settings-head .sd-section-title { margin: 0; }
    .settings-hint { font-size: 0.8rem; margin-bottom: 0.75rem; }
    .settings-account-kv { margin-bottom: 1.25rem; }
    .settings-account-kv dd { font-weight: 600; }
    .settings-subline { font-size: 0.72rem; font-weight: 400 !important; margin-top: 0.15rem; }
    .settings-subhead {
      font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em;
      color: var(--text-muted); margin: 1rem 0 0.5rem 0;
    }
    .settings-flash { color: var(--text-pos); font-size: 0.8rem; margin-bottom: 0.5rem; }
    .settings-form {
      display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end;
      margin-bottom: 0.5rem;
    }
    .settings-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; color: var(--text-muted); }
    .settings-field input {
      padding: 0.4rem 0.55rem; background: var(--bg-base); color: var(--text-primary);
      border: 1px solid var(--border); border-radius: 0.375rem; font-size: 0.875rem;
      font-variant-numeric: tabular-nums; min-width: 200px;
    }
    .settings-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 0.25rem; }
    .settings-table th {
      text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
      color: var(--text-muted); padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--border); cursor: default;
    }
    .settings-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border); }
    .settings-table .right { text-align: right; }
    .settings-show-all { margin-top: 0.5rem; }
    .settings-empty { font-size: 0.85rem; padding: 0.4rem 0; }
    .settings-skip-table .settings-drag-handle { width: 1.5rem; color: var(--text-muted); cursor: grab; user-select: none; }
    .settings-skip-code { font-size: 0.78rem; }
    .settings-skip-actions .btn-link { font-size: 0.78rem; }
    .settings-row-inactive { opacity: 0.55; }
    .settings-add-row, .settings-edit-row {
      display: flex; gap: 0.5rem; align-items: center; margin: 0.5rem 0;
    }
    .settings-add-row input, .settings-edit-row input {
      padding: 0.35rem 0.55rem; background: var(--bg-base); color: var(--text-primary);
      border: 1px solid var(--border); border-radius: 0.375rem; font-size: 0.85rem;
    }
    .settings-add-row input[name="label"], .settings-edit-row input { flex: 1; }
    .settings-stub { font-size: 0.9rem; line-height: 1.5; max-width: 60ch; }
    .settings-stub p { margin: 0 0 0.75rem 0; }
    .settings-stub-coming { color: var(--text-warn); font-weight: 600; }
    .sortable-ghost { opacity: 0.4; background: #1e293b; }

    /* ADMIN-IMPERSONATION-01 — persistent banner. Fixed to the top of
       the viewport so it never scrolls off; the whole page pads down
       by ``--impersonation-banner-height`` when active so no page
       content hides behind the banner. */
    .impersonation-banner {
      position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
      background: #78350f; border-bottom: 2px solid #f59e0b;
      color: #fde68a; padding: 0.55rem 1rem;
      display: flex; align-items: center; justify-content: space-between;
      gap: 0.75rem; font-size: 0.9rem;
      box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    }
    .impersonation-banner-eye { font-size: 1.15rem; }
    .impersonation-banner-body { flex: 1; }
    .impersonation-banner-body strong { color: #fef3c7; }
    .impersonation-banner-exit {
      background: #1f2a37; color: #fde68a;
      border: 1px solid #f59e0b;
      padding: 0.3rem 0.9rem; border-radius: 0.3rem;
      font-size: 0.82rem; cursor: pointer;
    }
    .impersonation-banner-exit:hover { background: #111827; }
    body.impersonating { padding-top: 3.5rem; }

    /* ==================================================================
       STYLE-01 — Tailwind utility compatibility layer.
       The Tailwind CDN was removed (STYLE-01 Part 0). These are the exact
       utility classes the templates use, defined once here so every page
       keeps its layout without the CDN. Values match Tailwind's defaults.
       ================================================================== */
    .flex { display: flex; }
    .grid { display: grid; }
    .block { display: block; }
    .inline-block { display: inline-block; }
    .hidden { display: none; }
    .flex-col { flex-direction: column; }
    .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .items-center { align-items: center; }
    .items-baseline { align-items: baseline; }
    .items-start { align-items: flex-start; }
    .justify-between { justify-content: space-between; }
    .justify-center { justify-content: center; }
    .justify-end { justify-content: flex-end; }
    .gap-1 { gap: 0.25rem; }
    .gap-1\.5 { gap: 0.375rem; }
    .gap-2 { gap: 0.5rem; }
    .gap-3 { gap: 0.75rem; }
    .gap-4 { gap: 1rem; }
    /* Same reason as .filter-btn above — a width utility that ignores padding
       overflows the moment it lands on anything with padding or a border. */
    .w-full { width: 100%; box-sizing: border-box; }
    .min-h-screen { min-height: 100vh; }
    .text-center { text-align: center; }
    .text-xs { font-size: 0.75rem; }
    .text-sm { font-size: 0.875rem; }
    .text-base { font-size: 1rem; }
    .text-lg { font-size: 1.125rem; }
    .text-2xl { font-size: 1.5rem; }
    .text-gray-200 { color: #e5e7eb; }
    .font-semibold { font-weight: 600; }
    .font-bold { font-weight: 700; }
    .tracking-tight { letter-spacing: -0.015em; }
    .tracking-wider { letter-spacing: 0.05em; }
    .leading-tight { line-height: 1.25; }
    .uppercase { text-transform: uppercase; }
    .rounded-lg { border-radius: 0.5rem; }
    .border-t { border-top: 1px solid var(--border); }
    .border-gray-800 { border-color: var(--border); }
    .mt-1 { margin-top: 0.25rem; }
    .mt-2 { margin-top: 0.5rem; }
    .mt-3 { margin-top: 0.75rem; }
    .mt-8 { margin-top: 2rem; }
    .mb-2 { margin-bottom: 0.5rem; }
    .mb-3 { margin-bottom: 0.75rem; }
    .mb-5 { margin-bottom: 1.25rem; }
    .mb-6 { margin-bottom: 1.5rem; }
    .pt-2 { padding-top: 0.5rem; }
    .pt-4 { padding-top: 1rem; }
    .p-4 { padding: 1rem; }
    .p-6 { padding: 1.5rem; }
    .p-8 { padding: 2rem; }
    .space-y-2 > * + * { margin-top: 0.5rem; }

    /* ==================================================================
       STYLE-01 Part 1 — dashboard header.
       ================================================================== */
    .dashboard-header { display: flex; flex-direction: column; }
    .morning-triage-title { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; margin: 0; }
    .dashboard-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; margin-top: 4px; }
    .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; display: inline-block; box-shadow: 0 0 0 0 rgba(34,197,94,0.5); animation: live-pulse 2s infinite; }
    @keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.45); } 70% { box-shadow: 0 0 0 5px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
    .meta-separator { color: var(--border); }
    .session-label { color: var(--text-muted); }
    .dashboard-controls { display: flex; align-items: center; gap: 0.5rem; }

    /* ==================================================================
       REGIME-DASHBOARD-01 Phase B — SPY regime-header chart, replacing the
       four KPI stat cards STYLE-01 Part 2 used to render here.
       ================================================================== */
    .dash-regime-header { display: flex; align-items: stretch; gap: 0.75rem; margin-bottom: 1.5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; }
    @media (max-width: 640px) { .dash-regime-header { flex-direction: column; } .dash-regime-header .dash-regime-badge { flex-basis: auto; padding-block: 6px; } }
    .dash-regime-header-loading, .dash-regime-header-empty { color: var(--text-muted); font-size: 0.85rem; padding: 24px; justify-content: center; align-items: center; }
    /* #1686 regression: inside the column `.dash-regime-chart-wrap`, `flex: 1` made the box's HEIGHT
       flexible, so the canvas grew the box and Chart.js's resize observer grew the canvas — taller on
       every HTMX refresh. The box must have a definite height the canvas cannot change.

       DASHBOARD-CHART-SCALE-01 (2026-09-21) -- 150px tall against a chart box that
       typically runs 1000-1600px wide on desktop is a 7-10:1 aspect ratio. At that
       ratio ANY real trend reads as flat, independent of how tight the y-axis min/max
       are (see the same-day fix to dashboard_regime_header.html's y-axis) -- Jason,
       looking at the SAME data after that fix: "it look flat to sideways becvause of
       how wide it is." Widening the vertical extent is the honest fix: it changes how
       much of the SAME data's real slope gets drawn per pixel, not the data itself --
       unlike narrowing the y-axis further, which would start compressing genuine noise
       into a fake-looking trend. 300px roughly halves the aspect ratio without pushing
       the sections below the fold on a typical viewport. */
    .dash-regime-chart-card { flex: none; min-width: 0; height: 300px; position: relative; overflow: hidden; }
    .dash-regime-chart-card > canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
    .dash-regime-badge { flex: 0 0 150px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 12px; border-left: 3px solid var(--border); }
    .dash-regime-badge-label { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.08em; color: var(--text-muted); text-transform: uppercase; }
    .dash-regime-badge-value { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }
    .dash-regime-badge-asof { font-size: 0.7rem; color: var(--text-muted); }
    .dash-regime-badge-note { font-size: 0.65rem; color: var(--text-muted); font-style: italic; }
    .dash-regime-badge-bull { border-left-color: var(--regime-bull); }
    .dash-regime-badge-bull .dash-regime-badge-value { color: var(--regime-bull); }
    .dash-regime-badge-sideways { border-left-color: var(--regime-sideways); }
    .dash-regime-badge-sideways .dash-regime-badge-value { color: var(--regime-sideways); }
    .dash-regime-badge-pullback { border-left-color: var(--regime-pullback); }
    .dash-regime-badge-pullback .dash-regime-badge-value { color: var(--regime-pullback); }
    .dash-regime-badge-correction { border-left-color: var(--regime-correction); }
    .dash-regime-badge-correction .dash-regime-badge-value { color: var(--regime-correction); }
    .dash-regime-badge-bear { border-left-color: var(--regime-bear); }
    .dash-regime-badge-bear .dash-regime-badge-value { color: var(--regime-bear); }
    /* REGIME-ROOM-GAUGE (2026-09-28) — the card grows into a side panel with the
       room gauge. No vertical rule beside the chart's price axis: the panel keeps
       its own space and colours only the regime name. It must not outgrow the chart. */
    /* #2758 (Jason, 2026-11-20: "the block on the right is getting too tall") — wider, so
       the chart and the ways out sit side by side and the panel is no taller than the chart. */
    .dash-regime-side { flex: 0 0 min(600px, 44%); justify-content: flex-start; gap: 10px; padding: 2px 0 0 18px; border-left: 0; overflow: hidden; }
    /* 2026-11-06 (Jason) — the "as of" date sits under the regime, as SPY's "live"
       time sits under its price, so "Pullback as of 2026-11-05" no longer wraps. */
    .dash-regime-now { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
    /* 2026-10-15 — SPY's price to the left of the current regime. */
    .dash-regime-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 18px; }
    .dash-regime-spy { display: flex; flex-direction: column; gap: 2px; padding-right: 18px; border-right: 1px solid var(--border); }
    .dash-regime-spy-value { font-size: 1.5rem; line-height: 1.1; font-weight: 700; color: var(--text-primary); }
    .dash-regime-side .dash-regime-badge-value { font-size: 1.5rem; line-height: 1.1; }
    .dash-regime-room { display: flex; flex-direction: column; gap: 5px; padding-top: 9px; border-top: 1px solid var(--border); }
    /* Heading UP: the near end of the track is the regime it is reaching, not an alarm. */
    /* Two-sided (sideways/pullback/correction): each half in the colour of the regime at that end. */
    .dash-regime-day { font-size: 0.85rem; line-height: 1.4; color: var(--text-heading); margin: 2px 0 6px; }
    .dash-regime-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
    .dash-regime-lower-chart, .dash-regime-exits { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
    .dash-regime-exit { padding: 6px 9px; border: 1px solid var(--border); border-radius: 6px; }
    .dash-regime-exit-head { font-size: 0.78rem; font-weight: 600; color: var(--text-primary); }
    .dash-regime-exit-sub { font-size: 0.7rem; color: var(--text-muted); }
    .dash-regime-exit-bull { border-color: var(--regime-bull); }
    .dash-regime-exit-sideways { border-color: var(--regime-sideways); }
    .dash-regime-exit-pullback { border-color: var(--regime-pullback); }
    .dash-regime-exit-correction { border-color: var(--regime-correction); }
    .dash-regime-exit-bear { border-color: var(--regime-bear); }
    .dash-regime-exit-bull .dash-regime-exit-head { color: var(--regime-bull); }
    .dash-regime-exit-sideways .dash-regime-exit-head { color: var(--regime-sideways); }
    .dash-regime-exit-pullback .dash-regime-exit-head { color: var(--regime-pullback); }
    .dash-regime-exit-correction .dash-regime-exit-head { color: var(--regime-correction); }
    .dash-regime-exit-bear .dash-regime-exit-head { color: var(--regime-bear); }
    .dash-regime-roomchart { width: 100%; height: auto; display: block; }
    .dash-regime-roomchart-line { fill: none; stroke: var(--text-heading); stroke-width: 1.6; }
    .dash-regime-roomchart-dot { fill: var(--text-heading); }
    .dash-regime-roomchart-muted { fill: var(--text-muted); }
    .dash-regime-exit b { color: var(--text-primary); }
    .dash-regime-exit { font-size: 0.72rem; line-height: 1.35; color: var(--text-muted); }
    @media (max-width: 900px) { .dash-regime-lower { grid-template-columns: minmax(0, 1fr); } }
    @media (max-width: 640px) { .dash-regime-side { flex-basis: auto; padding-left: 0; } }
    /* DASHBOARD-CHART-LEGIBILITY-01 — the chart states what it is: title, range, axes, legend. */
    .dash-regime-chart-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
    .dash-regime-chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
    .dash-regime-chart-title { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
    .dash-regime-chart-range { font-size: 0.72rem; color: var(--text-muted); }
    .dash-regime-legend { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; font-size: 0.7rem; color: var(--text-muted); }
    .dash-regime-legend-label { font-weight: 600; }
    .dash-regime-legend-item { display: inline-flex; align-items: center; gap: 4px; }
    .dash-regime-legend-swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; opacity: 0.6; }
    .dash-regime-swatch-bull { background: var(--regime-bull); }
    .dash-regime-swatch-sideways { background: var(--regime-sideways); }
    .dash-regime-swatch-pullback { background: var(--regime-pullback); }
    .dash-regime-swatch-correction { background: var(--regime-correction); }
    .dash-regime-swatch-bear { background: var(--regime-bear); }

    /* ==================================================================
       REGIME-DASHBOARD-01 Phase A — five collapsible regime groups.
       ================================================================== */
    /* DASHBOARD-CLEANUP-02 (#1694) — NO `overflow: hidden` here. It clipped the
       per-gate score popup (.pmh-pop, absolutely positioned, opening upward from
       its cell) at the card's top border on the first rows of a strategy table:
       any ancestor with overflow: hidden crops an absolute descendant. It existed
       only to round the summary's background into the card's corners, which the
       two radius rules below now do directly (7px = the card's 8px minus its
       1px border). */
    .regime-group { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 0.6rem; }
    .regime-group-summary { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding: 0.7rem 1rem; cursor: pointer; list-style: none; background: var(--bg-card); border-radius: 7px; }
    .regime-group[open] > .regime-group-summary { border-radius: 7px 7px 0 0; }
    .regime-group-summary::-webkit-details-marker { display: none; }
    .regime-group-summary::before { content: '\25B8'; color: var(--text-muted); transition: transform 0.15s; }
    .regime-group[open] > .regime-group-summary::before { transform: rotate(90deg); }
    .regime-group-swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
    .regime-group-name { font-weight: 600; font-size: 0.95rem; }
    .regime-group-current-badge { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; background: #134e2a; color: #6ee7b7; padding: 0.1rem 0.45rem; border-radius: 9999px; }
    .regime-group-pooled { color: var(--text-muted); font-size: 0.8rem; margin-left: auto; }
    .regime-group-body { padding: 0.75rem 1rem 1rem; border-top: 1px solid var(--border); }
    .regime-group-empty { margin: 0; }
    .regime-group-bull .regime-group-swatch { background: var(--regime-bull); }
    .regime-group-sideways .regime-group-swatch { background: var(--regime-sideways); }
    .regime-group-pullback .regime-group-swatch { background: var(--regime-pullback); }
    .regime-group-correction .regime-group-swatch { background: var(--regime-correction); }
    .regime-group-bear .regime-group-swatch { background: var(--regime-bear); }
    .regime-group-unplaced .regime-group-swatch { background: var(--text-muted); }

    .regime-strategy { padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
    .regime-strategy:last-child { border-bottom: none; }
    .regime-strategy-head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
    .regime-strategy-name { font-weight: 600; font-size: 0.88rem; }
    /* UI-QUICK-FIXES-01 — the strategy name links to its detail page in a new tab.
       It keeps the heading's look (it is still the section title); the underline on
       hover and the small arrow say "this opens something" without turning the
       heading into link-blue text. */
    .regime-strategy-name a { color: inherit; text-decoration: none; }
    .regime-strategy-name a:hover, .regime-strategy-name a:focus-visible { text-decoration: underline; }
    .regime-strategy-name .regime-strategy-popout { font-size: 0.72rem; color: var(--text-muted); margin-left: 0.2rem; }
    .regime-strategy-live { color: var(--text-muted); font-size: 0.78rem; }
    .regime-strategy-empty { font-size: 0.82rem; margin: 0.3rem 0 0; }

    /* Show-all / top-5 toggle — rows past the cap start hidden. */
    .sig-table tr.sig-row-extra { display: none; }
    .sig-table.sig-table-expanded tr.sig-row-extra { display: table-row; }
    .sig-show-all-btn { background: none; border: none; color: var(--accent-bright); font-size: 0.78rem; cursor: pointer; padding: 0.4rem 0; }
    .sig-show-all-btn:hover { text-decoration: underline; }

    /* Locked strategy — blurred fake rows, server never sent real ones. */
    .sig-locked-wrap { position: relative; }
    .sig-table-locked { filter: blur(3px); user-select: none; pointer-events: none; }
    .sig-locked-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; text-align: center; background: rgba(11,15,20,0.55); border-radius: 6px; padding: 1rem; }
    .sig-locked-icon { font-size: 1.3rem; }
    .sig-locked-msg { font-size: 0.8rem; color: var(--text-primary); max-width: 320px; }
    .sig-locked-cta { font-size: 0.8rem; color: var(--accent-bright); text-decoration: none; font-weight: 600; }
    .sig-locked-cta:hover { text-decoration: underline; }

    /* Part 4 — score column + tier badge (dashboard signals table). */
    .signal-score { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
    .signal-score.high { color: #22c55e; }
    .signal-score.qual { color: #f59e0b; }
    .signal-score.weak { color: var(--text-muted); }
    .tier-badge { display: inline-block; padding: 0.08rem 0.45rem; border-radius: 9999px; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.03em; line-height: 1.4; }
    .tier-badge.high { background: var(--bg-elevated); color: var(--text-primary); }
    .tier-badge.qual { background: var(--bg-warn-tint); color: var(--text-warn); }
    .tier-badge.weak { background: var(--bg-elevated); color: var(--text-muted); }

/* COMPOSER-UX-01b — three-level gate picker slide-over */
.gate-picker-overlay { position: fixed; inset: 0; background: rgba(11, 15, 20, 0.55); display: none; z-index: 90; }
.gate-picker-overlay.open { display: block; }
.gate-picker-panel {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(420px, 92vw);
  background: var(--bg-card); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform 0.18s ease; z-index: 91;
  display: flex; flex-direction: column;
}
.gate-picker-panel.open { transform: translateX(0); }
.gate-picker-header { display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); }
.gate-picker-breadcrumb { flex: 1; font-size: 0.8rem; color: var(--text-muted); }
.gate-picker-breadcrumb .gp-crumb { cursor: pointer; color: var(--accent-bright); }
.gate-picker-breadcrumb .gp-crumb:hover { text-decoration: underline; }
.gate-picker-breadcrumb .gp-sep { color: var(--text-muted); margin: 0 0.15rem; }
.gate-picker-close { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; line-height: 1; }
.gate-picker-close:hover { color: var(--text-primary); }
.gate-picker-body { flex: 1; overflow-y: auto; padding: 0.8rem 0.9rem; }
.gate-picker-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
.gate-picker-family-card { background: #0b121d; border: 1px solid var(--border); border-radius: 0.4rem; padding: 0.75rem 0.8rem; cursor: pointer; }
.gate-picker-family-card:hover { border-color: var(--accent-bright); }
.gate-picker-family-card.coming-soon { opacity: 0.45; cursor: not-allowed; }
.gate-picker-family-card .gp-fam-icon { font-size: 0.7rem; color: var(--text-muted); }
.gate-picker-family-card .gp-fam-name { font-weight: 600; font-size: 0.85rem; margin-top: 0.25rem; color: var(--text-primary); }
.gate-picker-family-card .gp-fam-count { color: var(--text-muted); font-size: 0.72rem; }
.gate-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.gate-picker-row:hover { background: #101a2b; }
.gate-picker-row.coming-soon { opacity: 0.45; cursor: not-allowed; }
.gate-picker-row.coming-soon:hover { background: transparent; }
.gate-picker-row .gp-row-main { display: flex; align-items: center; gap: 0.5rem; }
.gate-picker-row .gp-row-name { font-size: 0.85rem; color: var(--text-primary); }
.gate-picker-row .gp-row-meta { display: flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; color: var(--text-muted); }
/* WORKBENCH-COMPOSER-LEVEL2-LEARN-01 — unobtrusive by default (muted, same
   weight as the row's other metadata), an accent hint only on hover/focus so
   it reads as "there is more here" without competing with the indicator name
   for attention at the level a subscriber is still just scanning. */
.gate-picker-row .gp-row-learn { font-size: 0.78rem; line-height: 1; color: var(--text-muted); text-decoration: none; }
.gate-picker-row .gp-row-learn:hover,
.gate-picker-row .gp-row-learn:focus-visible { color: var(--accent-bright); }
.gate-picker-badge-coming-soon { font-size: 0.62rem; background: #2a1b0b; color: #facc15; border-radius: 0.25rem; padding: 0.05rem 0.4rem; }

/* COMPOSER-UX-01c — gate config modal */
.gate-config-modal-backdrop {
  position: fixed; inset: 0; background: rgba(11, 15, 20, 0.72);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
.gate-config-modal-backdrop.open { display: flex; }
.gate-config-modal-backdrop .gp-modal-inner {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 0.5rem;
  width: min(560px, 94vw); max-height: 88vh; overflow-y: auto; padding: 1.3rem 1.4rem;
}
.gp-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.gp-modal-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.gp-modal-sub { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.15rem; }
.gp-modal-desc { font-size: 0.85rem; color: var(--text-primary); line-height: 1.5; margin: 0.7rem 0; }
.gp-modal-svg { margin: 0.6rem 0; }
.gp-modal-svg svg, .gp-modal-svg img { max-width: 100%; height: auto; }
.gp-modal-locked { background: #2a1b0b; color: #facc15; border-radius: 0.35rem; padding: 0.5rem 0.7rem; font-size: 0.8rem; margin: 0.5rem 0; }
/* SECTOR-ROTATION-HISTORY-CHECK-01 — a known constraint on what the gate's
   numbers MEAN, shown where the gate is configured rather than on a docs page.
   Deliberately quieter than .gp-modal-locked: that one says "you cannot change
   this", which needs to stop the eye. This one qualifies a number the
   subscriber is about to rely on, and has to be read rather than dismissed. */
.gp-modal-limitation { background: var(--bg-elevated); color: var(--text-primary); border-left: 3px solid #38bdf8; border-radius: 0.35rem; padding: 0.55rem 0.7rem; font-size: 0.78rem; line-height: 1.45; margin: 0.5rem 0; }
.gp-modal-limitation-label { display: block; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: #38bdf8; margin-bottom: 0.2rem; }
/* #2079 — a tick-box list, and the line that says what is selected right now. */
.gp-multi-list { display: flex; flex-direction: row; flex-wrap: wrap; gap: 0.35rem 1rem; }
.gp-multi-opt { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; color: var(--text-primary); cursor: pointer; }
.gp-selection-status { background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--text-pos); border-radius: 0.35rem; padding: 0.45rem 0.7rem; font-size: 0.78rem; line-height: 1.45; margin: 0.5rem 0; color: var(--text-primary); }
.gp-modal-params { margin: 0.7rem 0; display: flex; flex-direction: column; gap: 0.7rem; }
.gp-param { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.82rem; color: var(--text-primary); }
.gp-param > span { display: flex; flex-direction: column; }
.gp-param-hint { font-size: 0.7rem; color: var(--text-muted); font-weight: 400; }
/* PATTERN-LIBRARY-CLEANUP-01 — parameters with no tuner are never applied on
   save (indicator settings come bundled with the selected version_key). They
   stay visible because the value is informative, but must not look editable. */
.gp-param-fixed { opacity: 0.62; }
.gp-param-fixed .gate-param-slider,
.gp-param-fixed .gate-param-number { cursor: not-allowed; }
.gp-param-fixed-note { display: block; font-style: italic; }
.gp-slider-row { display: flex; align-items: center; gap: 0.6rem; }
.gp-slider-row input[type=range] { flex: 1; }
.gp-param-val { min-width: 3.5rem; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-primary); font-weight: 700; }
/* WORKBENCH-COMPOSER-FIX-01 (#539) Fix 9 — slider paired with a number input. */
.gate-param-controls { display: flex; align-items: center; gap: 0.6rem; }
.gate-param-controls .gate-param-slider { flex: 1; min-width: 0; }
.gate-param-controls .gate-param-number {
  width: 4.5rem; flex: none; background: #0b121d; color: #f3f4f6;
  border: 1px solid var(--border); border-radius: 0.3rem;
  padding: 0.2rem 0.35rem; font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

/* WORKBENCH-COMPOSER-FIX-01 (#539) Fix 2+8 — direction toggle above the
   entry cards, replacing the blocking Long/Short chat question. */
.composer-direction-row {
  display: flex; align-items: center; gap: 0.4rem; margin: 0.5rem 0 0.25rem;
}
.composer-direction-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); margin-right: 0.15rem;
}
.composer-direction-btn {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 0.3rem;
  padding: 0.2rem 0.7rem; font-size: 0.74rem; cursor: pointer;
}
.composer-direction-btn:hover { color: #f3f4f6; }
.composer-direction-btn.active {
  background: #0b2a17; color: #6ee7b7; border-color: #14532d; font-weight: 700;
}
.composer-direction-btn.active[data-dir="short"] {
  background: #2d1a1a; color: #fca5a5; border-color: #7f1d1d;
}

/* WORKBENCH-COMPOSER-FIX-01 (#539) Fix 4 — locked parameter display, used
   where only one registered indicator version exists (EMA period). */
.gate-param-readonly { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.82rem; color: var(--text-primary); }
.gate-param-label { color: var(--text-primary); }
.gate-param-value { font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.gate-param-note { font-size: 0.7rem; color: var(--text-muted); font-weight: 400; }
.gp-radio { display: block; padding: 0.35rem 0; font-size: 0.82rem; cursor: pointer; }
.gp-modal-learn { display: inline-block; margin: 0.4rem 0; font-size: 0.8rem; color: var(--accent-bright); }
.gp-modal-actions { display: flex; justify-content: flex-end; gap: 0.55rem; margin-top: 1rem; }
.gp-btn { border-radius: 0.3rem; padding: 0.4rem 0.95rem; cursor: pointer; font-size: 0.82rem; border: 1px solid var(--border); background: transparent; color: var(--text-primary); }
.gp-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.gate-row .gate-params { color: var(--text-muted); font-weight: 400; font-size: 0.72rem; }

/* MY-STRATEGIES-01 — reusable strategy card (partials/strategy_card.html) */
.strategy-card { background-color: var(--bg-card); background-image: var(--grad-card); border: 1px solid var(--border); border-radius: 0.6rem; padding: 1.1rem 1.25rem; margin-bottom: 1.1rem; }
.strategy-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; flex-wrap: wrap; }
/* STRATEGY-NOTES (#2300) — the note button and modal (partials/strategy_notes.html,
   static/js/strategy_notes.js), on Composer, Edge Lab, My Strategies and the Journal.
   Replaces JOURNAL-01 Part C's icon and dialog. */
.sn-btn {
  display: inline-flex; align-items: center; gap: 0.2rem; vertical-align: middle;
  background: transparent; border: 1px solid var(--border); border-radius: 0.35rem;
  color: var(--text-muted); padding: 0.1rem 0.35rem; cursor: pointer; line-height: 1;
  font-size: 0.72rem; transition: color .15s, border-color .15s, background .15s;
}
.sn-btn:hover, .sn-btn:focus-visible { color: var(--text-primary); border-color: var(--accent-bright); }
.sn-btn svg { width: 0.95rem; height: 0.95rem; }
.sn-btn .sn-count { font-variant-numeric: tabular-nums; }
.sn-btn.sn-has { color: var(--text-warn); border-color: var(--text-warn); }
.sn-btn .sn-count:empty { display: none; }

.sn-backdrop {
  position: fixed; inset: 0; z-index: 1000; display: none;
  background: color-mix(in srgb, var(--bg-base) 70%, transparent);
  backdrop-filter: blur(3px); align-items: flex-start; justify-content: center;
  padding: 5vh 1rem;
}
.sn-backdrop.sn-open { display: flex; animation: sn-fade .15s ease-out; }
@keyframes sn-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sn-rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.sn-modal {
  width: min(760px, 100%); max-height: 90vh; display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 0.6rem;
  box-shadow: 0 24px 60px color-mix(in srgb, var(--bg-base) 80%, transparent);
  animation: sn-rise .18s ease-out; overflow: hidden;
}
.sn-head {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.sn-head h2 { margin: 0; font-size: 1rem; color: var(--text-primary); flex: 1; min-width: 0; }
.sn-head .sn-sub {
  display: block; font-size: 0.75rem; color: var(--text-muted); font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sn-x {
  background: transparent; border: 0; color: var(--text-muted); font-size: 1.3rem;
  cursor: pointer; line-height: 1; padding: 0.2rem 0.4rem; border-radius: 0.3rem;
}
.sn-x:hover { color: var(--text-primary); }
.sn-private { font-size: 0.7rem; color: var(--text-muted); padding: 0 1.1rem; margin: 0.5rem 0 0; }
.sn-list { overflow-y: auto; padding: 0.6rem 1.1rem; flex: 1; min-height: 4rem; }
.sn-empty { color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 1.5rem 0; }
.sn-note {
  border: 1px solid var(--border); border-left: 3px solid var(--accent-bright);
  border-radius: 0.4rem; margin: 0 0 0.6rem; background: var(--bg-base);
}
.sn-note.sn-from-edge_lab { border-left-color: var(--text-pos); }
.sn-meta {
  display: flex; align-items: center; gap: 0.5rem; font-size: 0.72rem; color: var(--text-muted);
  padding: 0.4rem 0.7rem 0;
}
.sn-src {
  text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.62rem;
  border: 1px solid var(--border); border-radius: 0.25rem; padding: 0.05rem 0.35rem;
}
.sn-from-composer .sn-src { color: var(--focus-ring); }
.sn-from-edge_lab .sn-src { color: var(--text-pos); }
.sn-meta .sn-actions { margin-left: auto; display: flex; gap: 0.2rem; opacity: 0; transition: opacity .15s; }
.sn-note:hover .sn-actions, .sn-note:focus-within .sn-actions { opacity: 1; }
.sn-act {
  background: transparent; border: 0; color: var(--text-muted); cursor: pointer;
  font-size: 0.72rem; padding: 0.1rem 0.35rem; border-radius: 0.25rem;
}
.sn-act:hover { color: var(--text-primary); background: var(--bg-card); }
.sn-act.sn-del:hover { color: var(--text-neg); }
.sn-modal .sn-note .ql-editor { padding: 0.35rem 0.7rem 0.6rem; color: var(--text-primary); font-size: 0.88rem; min-height: 0; }
.sn-modal .sn-compose { border-top: 1px solid var(--border); padding: 0.7rem 1.1rem 0.9rem; }
.sn-modal .sn-compose .ql-toolbar.ql-snow, .sn-modal .sn-compose .ql-container.ql-snow { border-color: var(--border); }
.sn-modal .sn-compose .ql-toolbar.ql-snow { border-radius: 0.4rem 0.4rem 0 0; background: var(--bg-base); }
.sn-modal .sn-compose .ql-container.ql-snow {
  border-radius: 0 0 0.4rem 0.4rem; background: var(--bg-base); color: var(--text-primary);
  font-size: 0.9rem; font-family: inherit;
}
.sn-modal .sn-compose .ql-editor { min-height: 7.5rem; max-height: 16rem; overflow-y: auto; }
.sn-modal .sn-compose .ql-editor.ql-blank::before { color: var(--text-muted); font-style: normal; }
.sn-modal .ql-snow .ql-stroke { stroke: var(--text-muted); }
.sn-modal .ql-snow .ql-fill { fill: var(--text-muted); }
.sn-modal .ql-snow .ql-picker { color: var(--text-muted); }
.sn-modal .ql-snow.ql-toolbar button:hover .ql-stroke, .sn-modal .ql-snow.ql-toolbar button.ql-active .ql-stroke, 
.sn-modal .ql-snow .ql-picker-label:hover .ql-stroke { stroke: var(--focus-ring); }
.sn-modal .ql-snow.ql-toolbar button:hover .ql-fill, .sn-modal .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--focus-ring); }
.sn-modal .ql-snow .ql-picker-options { background: var(--bg-card); border-color: var(--border); }
.sn-modal .ql-snow .ql-tooltip {
  background: var(--bg-card); border-color: var(--border); color: var(--text-primary);
  box-shadow: none; z-index: 2;
}
.sn-modal .ql-snow .ql-tooltip input[type=text] { background: var(--bg-base); color: var(--text-primary); border-color: var(--border); }
.sn-modal .ql-editor li[data-list=checked] > .ql-ui, .sn-modal .ql-editor li[data-list=unchecked] > .ql-ui { color: var(--text-muted); }
.sn-modal .ql-editor li[data-list=checked] { color: var(--text-muted); text-decoration: line-through; }
.sn-modal .ql-snow .ql-editor a { color: var(--focus-ring); }
.sn-modal .ql-snow .ql-editor blockquote { border-left-color: var(--border); color: var(--text-muted); }
.sn-modal .ql-snow .ql-editor pre.ql-syntax, .sn-modal .ql-snow .ql-editor code {
  background: var(--bg-card); color: var(--text-primary);
}
.sn-foot { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.6rem; }
.sn-hint { font-size: 0.7rem; color: var(--text-muted); margin-right: auto; }
.sn-err { font-size: 0.78rem; color: var(--text-neg); }
.sn-save {
  background: var(--accent); color: var(--text-primary); border: 0; border-radius: 0.35rem;
  padding: 0.4rem 1rem; font-size: 0.82rem; cursor: pointer;
}
.sn-save:disabled { opacity: 0.5; cursor: default; }
.sn-cancel {
  background: transparent; color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 0.35rem; padding: 0.4rem 0.8rem; font-size: 0.82rem; cursor: pointer;
}
.strategy-card-title { font-size: 1.15rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.strategy-card-badges { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.strategy-card-description { font-size: 0.92rem; color: var(--text-primary); margin: 0.4rem 0 0.75rem 0; }
.strategy-card-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; font-variant-numeric: tabular-nums; }
.badge-custom { display: inline-block; padding: 0.05rem 0.45rem; border-radius: 0.3rem; background: var(--bg-elevated); color: var(--text-primary); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.04em; }
.badge-regime { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 9999px; background: var(--border); color: var(--text-muted); font-size: 0.65rem; font-weight: 600; letter-spacing: 0.03em; }

.strategy-card-signals { margin-top: 0.4rem; }
.signals-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.35rem; }
.signal-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.6rem; background: #0b121d; border-radius: 0.35rem; margin-bottom: 0.3rem; font-size: 0.85rem; }
.signal-ticker { font-weight: 600; min-width: 3.5rem; }
.signal-date { font-size: 0.78rem; }
.signal-score { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.signal-detail-link { color: var(--accent-bright); text-decoration: none; font-size: 0.8rem; }
.signal-detail-link:hover { text-decoration: underline; }

.tier-pill { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 9999px; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; }
.tier-pill-high { background: #134e2a; color: #6ee7b7; }
.tier-pill-qualified { background: var(--bg-elevated); color: var(--text-primary); }
.tier-pill-weak { background: #1f2a37; color: #9ca3af; }

.strategy-card-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.85rem; }
.btn-ghost { padding: 0.4rem 0.85rem; background: transparent; color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: 0.375rem; font-size: 0.82rem; text-decoration: none; }
.btn-ghost:hover { text-decoration: underline; background: var(--bg-elevated); }

/* BACKTEST-VIZ-01 — sampled-ticker transparency panel */
.ticker-list-toggle { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.8rem; padding: 0.25rem 0; text-align: left; }
.ticker-list-toggle:hover { color: var(--text-primary); }
.ticker-list-body { margin-top: 0.5rem; max-height: 220px; overflow-y: auto; }
.ticker-chip { display: inline-block; margin: 2px; padding: 2px 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; font-size: 0.72rem; cursor: pointer; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ticker-chip:hover { border-color: var(--accent-bright); color: var(--text-heading); }

/* BACKTEST-VIZ-01 — corpus row click-to-replay */
.corpus-row { cursor: pointer; }
.corpus-row:hover { background: var(--bg-card); }
.corpus-row.selected { background: var(--bg-card); outline: 1px solid var(--accent-bright); }

/* ── INDICATOR-LIBRARY-PAGE-01 — subscriber education page ──────────── */
.ind-lib-family { margin-bottom: 2.25rem; }
.ind-lib-family-header { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 0.9rem; border-bottom: 1px solid var(--border); padding-bottom: 0.45rem; }
.ind-lib-family-name { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); margin: 0; }
.ind-lib-family-count { font-size: 0.78rem; color: var(--text-muted); }
.ind-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; }
.ind-lib-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.ind-lib-card-header { display: flex; flex-direction: column; gap: 0.1rem; }
.ind-lib-indicator-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.ind-lib-action-name { font-size: 0.78rem; color: var(--text-muted); }
.ind-lib-badges { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.ind-lib-description { font-size: 0.8rem; line-height: 1.4; color: var(--text-muted); margin: 0; }

/* Difficulty badges — codebase palette (green / amber / red). Admin-only
   surface (pattern_matching/indicators.html, is_admin-gated) -- subscriber
   surfaces dropped this display, this one is unrelated staff tooling. */
.ind-lib-badge-difficulty { font-size: 0.65rem; padding: 1px 7px; border-radius: 4px; font-weight: 600; letter-spacing: 0.02em; }
.ind-lib-badge-beginner { background: rgba(110, 231, 183, 0.13); color: #6ee7b7; }
.ind-lib-badge-intermediate { background: rgba(252, 211, 77, 0.13); color: #fcd34d; }
.ind-lib-badge-advanced { background: rgba(252, 165, 165, 0.13); color: #fca5a5; }

/* Regime + Composer badges */
.ind-lib-badge-regime { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 9999px; background: #1f2a37; color: #9ca3af; font-size: 0.65rem; font-weight: 600; }
.ind-lib-badge-composer { font-size: 0.65rem; padding: 1px 7px; border-radius: 4px; background: var(--bg-elevated); color: var(--text-primary); font-weight: 600; }

/* ── STRATEGY-DETAIL-01 — subscriber strategy detail page ──────────── */
.sd-meta-strip { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 0.75rem 0 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.sd-stat { font-size: 0.85rem; color: var(--text-muted); }
.sd-stat strong { color: var(--text-primary); }
.sd-notes { background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; padding: 0.75rem 1rem; font-size: 0.9rem; margin-bottom: 1rem; }
.sd-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.sd-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 0.6rem 1.1rem; font-size: 0.9rem; font-weight: 500; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; gap: 0.4rem; }
.sd-tab.active { color: var(--text-primary); border-bottom-color: var(--accent-bright); }
.sd-tab:hover:not(.active) { color: var(--text-primary); }
.sd-tab-count { background: var(--bg-card); border: 1px solid var(--border); border-radius: 9999px; font-size: 0.7rem; padding: 0 5px; min-width: 18px; text-align: center; }
.sd-tab-panel { min-width: 0; }
.sd-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.sd-table th { text-align: left; padding: 0.4rem 0.6rem; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.04em; }
.sd-table td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.sd-table tr:last-child td { border-bottom: none; }
.sd-ticker { font-weight: 600; }
.sd-pos { color: #6ee7b7; font-weight: 600; }
.sd-neg { color: #fca5a5; font-weight: 600; }
.sd-outcome-target { color: #6ee7b7; }
.sd-outcome-stop { color: #fca5a5; }
.sd-outcome-expired { color: var(--text-muted); }
.sd-outcome-delisted { color: var(--text-muted); }
.sd-overview-grid { display: flex; gap: 1.5rem; flex-wrap: wrap; padding: 0.5rem 0; }
.sd-overview-item { display: flex; flex-direction: column; gap: 0.2rem; }
.sd-overview-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.sd-overview-value { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }

/* ── MY-DRAFTS-01 — draft card ─────────────────────────────────────── */
.draft-card-meta { display: flex; gap: 1rem; font-size: 0.82rem; margin: 0.25rem 0 0.5rem; flex-wrap: wrap; }
.draft-meta-item { color: var(--text-muted); }
.draft-stage { margin-bottom: 0.75rem; }
.draft-stage-badge { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.draft-stage-pending { background: rgba(252, 211, 77, 0.13); color: #fcd34d; }
.draft-stage-sampled { background: var(--bg-elevated); color: var(--text-primary); }
.draft-stage-full { background: rgba(110, 231, 183, 0.13); color: #6ee7b7; }
.draft-delete-btn { color: #fca5a5; }
.draft-delete-btn:hover { color: #f87171; text-decoration: underline; }
/* DRAFT-DELETE-ERROR-SURFACING-01 -- the Delete button's refusal (open pattern
   matches, in the basic-tier rotation) had nowhere to render: htmx only swaps
   the card on a 2xx, so a 409 left the click looking like it did nothing. */
.draft-card-error { color: var(--text-neg); font-size: 0.8rem; margin-top: 0.5rem; }

/* ── TEST-RESULTS-01 — backtest results page ───────────────────────── */
.br-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; margin-bottom: 2rem; }
.br-stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 0.875rem 1rem; }
.br-stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.25rem; }
.br-stat-value { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); }
.br-pos { color: #6ee7b7; }
.br-neg { color: #fca5a5; }
.br-signals-section { margin-bottom: 2rem; }
.br-section-title { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); }
.br-truncation-note { font-size: 0.82rem; margin-top: 0.5rem; }
.br-meta-section { margin-bottom: 2rem; }
.br-meta-grid { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.br-meta-item { display: flex; flex-direction: column; gap: 0.15rem; }
.br-meta-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.br-meta-value { font-size: 0.9rem; color: var(--text-primary); }
.results-permalink { display: inline-block; margin-top: 0.75rem; }

/* ── BILLING-01 — subscription pages ───────────────────────────────── */
.billing-current-plan { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.billing-plan-label { color: var(--text-muted); font-size: 0.85rem; }
.billing-cancelled-banner { background: color-mix(in srgb, var(--text-neg) 10%, transparent); border: 1px solid color-mix(in srgb, var(--text-neg) 30%, transparent); color: var(--text-neg); border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1.5rem; font-weight: 500; }
.billing-plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.billing-plan-card { background-color: var(--bg-card); background-image: var(--grad-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }
.billing-plan-current { border-color: var(--accent-bright); }
.billing-plan-header { display: flex; justify-content: space-between; align-items: flex-start; }
.billing-plan-name { font-size: 1.1rem; font-weight: 700; margin: 0; }
.billing-plan-price { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }
.billing-plan-period { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }
.billing-current-badge { text-align: center; font-size: 0.8rem; color: var(--text-primary); font-weight: 600; }
.billing-upgrade-btn { width: 100%; }
.billing-status-active { color: #6ee7b7; font-size: 0.8rem; font-weight: 600; }
.billing-status-cancelled { color: #fca5a5; font-size: 0.8rem; font-weight: 600; }
.billing-status-past_due { color: #fcd34d; font-size: 0.8rem; font-weight: 600; }
.billing-disclaimer { font-size: 0.78rem; margin-top: 1rem; line-height: 1.5; }

/* Price cards: Trader Pro and Quant (2026-10-23). Quant is the featured card. */
.price-intro { text-align: center; margin: 0.5rem auto 1.75rem; max-width: 40rem; }
.price-intro-title { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-heading); margin: 0 0 0.4rem; }
.price-intro-sub { color: var(--text-muted); font-size: 1rem; margin: 0; }
.price-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; max-width: 56rem; margin: 0 auto 1.25rem; align-items: stretch; }
@media (max-width: 760px) { .price-cards { grid-template-columns: 1fr; } }
.price-card { position: relative; display: flex; flex-direction: column; padding: 2rem 1.75rem 1.75rem; background-color: var(--bg-card); background-image: var(--grad-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.price-card--featured { border-color: var(--accent-bright); background-image: var(--grad-frame), var(--grad-card); box-shadow: 0 0 0 1px var(--border-emph), var(--shadow-frame); }
.price-card-badge { position: absolute; top: -0.75rem; left: 50%; transform: translateX(-50%); padding: 0.25rem 0.85rem; border-radius: var(--radius-pill); background: var(--accent-bright); color: var(--bg-base); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.price-card-kicker { margin: 0 0 0.35rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-bright); }
.price-card-name { margin: 0; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--text-heading); }
.price-card-headline { margin: 0.35rem 0 1.25rem; color: var(--text-primary); font-size: 1rem; }
.price-card-price { display: flex; align-items: baseline; gap: 0.25rem; }
.price-card-amount { font-family: var(--font-display); font-size: 3rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--text-heading); }
.price-card-period { color: var(--text-muted); font-size: 1rem; }
.price-card-terms { margin: 0.5rem 0 1.25rem; color: var(--text-muted); font-size: 0.82rem; }
.price-card-cta { width: 100%; padding: 0.8rem 1rem; border-radius: var(--radius-md); border: 1px solid var(--border-strong); background: transparent; color: var(--text-heading); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: background-color 0.15s, border-color 0.15s; }
.price-card-cta:hover { border-color: var(--accent-bright); background: var(--bg-selected); }
.price-card-cta:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.price-card-cta--featured { background: var(--accent-bright); border-color: var(--accent-bright); color: var(--bg-base); }
.price-card-cta--featured:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.price-card-rule { height: 1px; background: var(--border); margin: 1.5rem 0 1.25rem; }
.price-card-includes { margin: 0 0 0.75rem; font-size: 0.85rem; font-weight: 600; color: var(--text-heading); }
.price-card-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.price-card-features li { display: flex; gap: 0.6rem; align-items: flex-start; color: var(--text-primary); font-size: 0.92rem; line-height: 1.4; }
.price-card-check { flex: none; width: 1rem; height: 1rem; margin-top: 0.15rem; color: var(--accent-bright); }
.price-cards ~ .billing-disclaimer { max-width: 56rem; margin: 0.75rem auto 1.5rem; text-align: center; }
.price-footnote { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 1.25rem; max-width: 56rem; margin: 0 auto; color: var(--text-muted); font-size: 0.82rem; text-align: center; }
.billing-success { max-width: 480px; margin: 3rem auto; text-align: center; display: flex; flex-direction: column; gap: 1rem; }
.billing-manage-section { margin-bottom: 2rem; }
.billing-section-title { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); }
.billing-cancel-section { margin-top: 2rem; }
.billing-manage-link { margin-left: auto; }
.btn-danger { background: color-mix(in srgb, var(--text-neg) 15%, transparent); border: 1px solid color-mix(in srgb, var(--text-neg) 40%, transparent); color: var(--text-neg); padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }
.btn-danger:hover { background: color-mix(in srgb, var(--text-neg) 25%, transparent); }

/* ── BILLING-02: basic rotation, upgrade nudge, deactivated cards ── */
.upgrade-nudge {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 0.75rem 1rem;
    background: rgba(37, 99, 235, 0.10);
    border: 1px solid rgba(37, 99, 235, 0.30);
    border-radius: 8px; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.upgrade-nudge-text { font-size: 0.88rem; color: var(--text-primary); }
.upgrade-nudge-btn { white-space: nowrap; }
.strategy-card-deactivated { opacity: 0.6; }
.badge-deactivated {
    display: inline-block; padding: 0.05rem 0.45rem; margin-left: 0.4rem;
    border-radius: 0.3rem; background: rgba(252, 165, 165, 0.15);
    color: #fca5a5; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.04em;
}
.rotation-current { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.rotation-current li { display: flex; gap: 0.6rem; align-items: baseline; }
.rotation-form { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.rotation-field { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; }
.rotation-field select { padding: 0.4rem 0.5rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-elevated, #111827); color: var(--text-primary); }

/* ── App footer (ONBOARDING-01) ──────────────────────────────── */
.app-footer {
    margin-top: auto; padding: 1.5rem 1.5rem 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
}
.app-footer-links {
    display: flex; justify-content: center; gap: 0.5rem;
    flex-wrap: wrap; margin-bottom: 0.5rem;
}
.app-footer-links a {
    font-size: 0.78rem; color: var(--text-muted);
    text-decoration: none;
}
.app-footer-links a:hover { color: var(--text-primary); }
.app-footer-sep { color: var(--text-muted); font-size: 0.78rem; }
.app-footer-legal {
    font-size: 0.72rem; color: var(--text-muted);
    max-width: 600px; margin: 0 auto; line-height: 1.5;
}

/* ── Onboarding (ONBOARDING-01; redesigned 2026-11-06, Jason: "Make them sexy and
   helpful. Friendly Teacher voice please") ──────────────────────────────────── */
.ob-shell { max-width: 780px; margin: 2rem auto 3rem; padding: 0 1rem; }
.ob-dots { display: flex; justify-content: center; gap: 10px; margin-bottom: 1.25rem; flex-wrap: wrap; }
.ob-dot { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--border); color: var(--text-muted); font-size: 0.8rem; text-decoration: none; }
.ob-dot i { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.ob-dot:hover { border-color: var(--accent-bright); color: var(--text-primary); }
.ob-dot.on { border-color: var(--accent-bright); color: var(--text-heading); }
.ob-dot.on i, .ob-dot.seen i { background: var(--accent-bright); }
.ob-card { background: linear-gradient(180deg, var(--bg-elevated), var(--bg-raised)); border: 1px solid var(--border);
    border-radius: 16px; padding: 30px 32px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.ob-card p { line-height: 1.55; margin: 0 0 12px; max-width: 64ch; }
.ob-kicker { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-bright); }
.ob-title { font-family: var(--font-display); color: var(--text-heading); font-size: 1.75rem; line-height: 1.2; margin: 6px 0 10px; text-wrap: balance; }
.ob-lead { font-size: 1.04rem; }
.ob-muted { color: var(--text-muted); }
.ob-hd { color: var(--text-heading); }
.ob-pos { color: var(--regime-bull); }
.ob-neg { color: var(--regime-correction); }
.ob-mono { font-family: var(--font-mono); }
.ob-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0 6px; }
.ob-tile { background: var(--bg-base); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.ob-num { font-family: var(--font-mono); color: var(--accent-bright); font-size: 0.8rem; margin-bottom: 8px; }
.ob-t { font-family: var(--font-display); color: var(--text-heading); font-size: 0.95rem; margin-bottom: 6px; }
.ob-b { font-size: 0.86rem; line-height: 1.45; color: var(--text-muted); }
.ob-plan { display: inline-flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 0.85rem; color: var(--text-muted); }
.ob-plan b { color: var(--text-heading); border: 1px solid var(--accent); padding: 2px 8px; border-radius: 6px; }
.ob-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; gap: 12px; flex-wrap: wrap; }
.ob-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ob-actions form { margin: 0; }
.ob-btn { display: inline-block; cursor: pointer; background: var(--accent); color: #fff; font: inherit; font-weight: 600;
    font-size: 0.92rem; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; text-decoration: none; }
.ob-btn:hover { background: var(--accent-bright); color: #fff; }
.ob-btn.ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.ob-btn.ghost:hover { color: var(--text-primary); border-color: var(--text-muted); }
.ob-btn:focus-visible, .ob-dot:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
.ob-market { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; margin-top: 16px; align-items: start; }
.ob-panel { background: var(--bg-base); border: 1px solid var(--border); border-radius: 12px; padding: 14px 14px 10px; }
.ob-now { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ob-regime { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.ob-asof { font-size: 0.75rem; color: var(--text-muted); }
.ob-day { font-size: 0.86rem; line-height: 1.45; color: var(--text-heading); margin: 6px 0 8px; }
.ob-lbl { font-size: 0.68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.ob-panel .dash-regime-roomchart { width: 100%; height: auto; display: block; }
.ob-ladder { display: flex; flex-direction: column; gap: 6px; }
.ob-rg { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; border: 1px solid transparent; font-size: 0.86rem; }
.ob-rg i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.ob-rg span { color: var(--text-muted); font-size: 0.78rem; margin-left: auto; text-align: right; }
.ob-rg.here { background: var(--bg-base); color: var(--text-heading); }
.ob-why { margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--accent-bright); background: var(--bg-base);
    border-radius: 0 10px 10px 0; font-size: 0.9rem; line-height: 1.45; }
.ob-match { display: grid; grid-template-columns: 1fr 1.15fr; gap: 20px; margin-top: 16px; }
.ob-mhead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ob-tk { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--text-heading); }
.ob-nm { color: var(--text-muted); font-size: 0.85rem; }
.ob-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.ob-chip { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); }
.ob-svgwrap { background: var(--bg-base); border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.ob-svgwrap svg { width: 100%; height: auto; display: block; }
.ob-svgtext { fill: var(--text-heading); }
.ob-entryline { stroke: var(--text-heading); }
.ob-made { margin-top: 12px; font-size: 0.8rem; color: var(--text-muted); }
.ob-read { display: flex; flex-direction: column; gap: 10px; }
.ob-row { display: grid; grid-template-columns: 78px 1fr; gap: 10px; font-size: 0.88rem; line-height: 1.45; }
.ob-row b { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.ob-k { font-size: 0.72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding-top: 2px; }
.ob-legal { margin: 14px 0 0; font-size: 0.74rem; color: var(--text-muted); }
.ob-seefull { display: inline-block; margin-top: 6px; font-size: 0.82rem; color: var(--accent-bright); text-decoration: none; }
.ob-seefull:hover { text-decoration: underline; }
/* Step 4, the reading list (Jason, 2026-11-06: "any way to up the sexy?"). */
.ob-path-lbl { display: flex; align-items: center; gap: 12px; margin: 18px 0 4px; font-size: 0.68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-bright); }
.ob-path-lbl i { flex: 1; height: 1px; background: linear-gradient(90deg, var(--accent-bright), transparent); }
.ob-path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ob-pcard { position: relative; display: flex; flex-direction: column; background: var(--bg-base); border: 1px solid var(--border); border-radius: 14px; margin-top: 18px;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.ob-pcard:hover, .ob-pcard:focus-within { transform: translateY(-3px); border-color: var(--accent-bright); box-shadow: 0 14px 30px rgba(0,0,0,.4), 0 0 0 1px rgba(29,158,117,.25); }
.ob-pnum { position: absolute; top: 0; left: 14px; transform: translateY(-50%); z-index: 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent-bright); color: #06120e; font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; box-shadow: 0 0 0 4px var(--bg-raised); }
.ob-art { height: 96px; border-radius: 13px 13px 0 0; overflow: hidden; border-bottom: 1px solid var(--border);
    background: radial-gradient(120% 140% at 0% 0%, rgba(29,158,117,.18), transparent 60%), var(--bg-elevated); }
.ob-art svg { width: 100%; height: 100%; display: block; }
.ob-pbody { display: flex; flex-direction: column; gap: 6px; padding: 14px; flex: 1; }
.ob-ptag { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: .06em; text-transform: uppercase; }
.ob-et { font-family: var(--font-display); color: var(--text-heading); font-size: 0.92rem; line-height: 1.3; }
.ob-eb { font-size: 0.82rem; line-height: 1.45; color: var(--text-muted); }
.ob-ego { margin-top: auto; font-size: 0.82rem; color: var(--accent-bright); }
.ob-cover { position: absolute; inset: 0; border-radius: 14px; z-index: 1; }
.ob-cover:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
.ob-edu-lbl { font-size: 0.68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 16px 0 8px; }
.ob-curious { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ob-cpill { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-base);
    color: var(--text-muted); text-decoration: none; transition: border-color .18s ease, color .18s ease; }
.ob-cpill:hover, .ob-cpill:focus-visible { border-color: var(--accent-bright); color: var(--accent-bright); }
.ob-cpill svg { width: 22px; height: 22px; flex: none; color: var(--accent-bright); }
.ob-cpill span { display: flex; flex-direction: column; font-size: 0.8rem; line-height: 1.35; }
.ob-cpill b { color: var(--text-heading); font-weight: 600; font-size: 0.86rem; }
@media (prefers-reduced-motion: reduce) { .ob-pcard, .ob-pcard:hover { transition: none; transform: none; } }
@media (max-width: 680px) {
    .ob-trio, .ob-market, .ob-match, .ob-path, .ob-curious { grid-template-columns: 1fr; }
    .ob-card { padding: 22px 18px; }
    .ob-title { font-size: 1.4rem; }
    .ob-dot span { display: none; }
}

/* ── Admin invite / grant pages (BILLING-04) ──────────────────── */
.admin-section { margin-bottom: 2rem; }
.admin-section-title {
    font-size: 0.9rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: 0.75rem; padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}
.admin-form { margin-bottom: 1rem; }
.admin-form-row {
    display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap;
}
.admin-form-row label {
    display: flex; flex-direction: column; gap: 0.3rem;
    font-size: 0.82rem; color: var(--text-muted);
}
.admin-input, .admin-select {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 6px; padding: 0.4rem 0.6rem;
    color: var(--text-primary); font-size: 0.88rem;
}
.admin-success-banner {
    background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3);
    color: #22c55e; border-radius: 8px; padding: 0.75rem 1rem;
    margin-bottom: 1.5rem; font-size: 0.9rem;
}
.admin-row-used { opacity: 0.5; }

/* ── Education pages (EDUCATION-01) ───────────────────────────── */
.education-page {
    max-width: 720px; margin: 0 auto; padding: 1.5rem 1rem 3rem;
    display: flex; flex-direction: column; gap: 2rem;
}
.education-header { display: flex; flex-direction: column; gap: 0.5rem; }
.education-breadcrumb { font-size: 0.78rem; color: var(--text-muted); }
.education-breadcrumb a { color: var(--accent-bright); text-decoration: none; }
.education-breadcrumb a:hover { text-decoration: underline; }
.education-title {
    font-size: 1.6rem; font-weight: 700; color: var(--text-primary); margin: 0;
}
.education-subtitle { font-size: 0.95rem; margin: 0; }
.education-section { display: flex; flex-direction: column; gap: 0.75rem; }
.education-section-title {
    font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted);
    padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); margin: 0;
}
.education-card {
    background-color: var(--bg-card); background-image: var(--grad-card); border: 1px solid var(--border);
    border-radius: 8px; padding: 1rem 1.25rem;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.education-card-excluded { border-left: 3px solid rgba(239,68,68,0.4); }
.education-card-header { display: flex; align-items: center; gap: 0.6rem; }
.education-card-icon { font-size: 1rem; flex-shrink: 0; }
.education-card-title { font-size: 0.95rem; font-weight: 600; margin: 0; }
.education-card p { font-size: 0.88rem; margin: 0; line-height: 1.6; }
.education-filter-grid { display: flex; flex-direction: column; gap: 0.6rem; }
.education-filter-item {
    display: flex; gap: 0.75rem; align-items: flex-start;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 6px; padding: 0.75rem 1rem;
}
.education-filter-icon { font-size: 1rem; flex-shrink: 0; margin-top: 0.1rem; }
.education-filter-label {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-muted); margin-bottom: 0.15rem;
}
.education-filter-value { font-size: 0.88rem; color: var(--text-primary); }
.education-callout {
    background: rgba(15,110,86,0.08); border: 1px solid rgba(15,110,86,0.2);
    border-radius: 8px; padding: 1rem 1.25rem;
    font-size: 0.9rem; font-style: italic; color: var(--text-primary);
}
.education-disclaimer { font-size: 0.75rem; }
.education-coming-soon {
    display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem;
}
.coming-soon-badge {
    display: inline-block; padding: 0.15rem 0.5rem;
    background: rgba(245,158,11,0.15); color: #f59e0b;
    border-radius: 4px; font-size: 0.65rem; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase;
}
.coming-soon-badge-lg {
    font-size: 0.8rem; padding: 0.3rem 0.75rem; align-self: flex-start;
}

/* ── Billing portal (BILLING-PORTAL-01) ───────────────────────── */
.billing-actions-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.billing-trial-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1.5rem;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.billing-trial-head { display: flex; justify-content: space-between; align-items: baseline; }
.billing-trial-title {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
}
.billing-trial-remaining { font-size: 0.9rem; font-weight: 600; color: #6ee7b7; }
.billing-trial-bar-track {
    height: 8px; border-radius: 4px; background: var(--border); overflow: hidden;
}
.billing-trial-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.billing-trial-note { font-size: 0.8rem; margin: 0; }
.billing-payment-method-row {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; padding: 0.875rem 1rem;
}
.billing-card-chip { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.billing-card-brand { font-weight: 700; font-size: 0.9rem; }
.billing-card-number { font-family: var(--font-mono); letter-spacing: 0.08em; }
.billing-card-exp { font-size: 0.8rem; }
.billing-invoice-list { display: flex; flex-direction: column; gap: 0.5rem; }
.billing-invoice-row {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 6px; padding: 0.6rem 1rem; font-size: 0.88rem;
}
.billing-invoice-date { min-width: 110px; color: var(--text-muted); }
.billing-invoice-amount { flex: 1; }
/* In-flow overlay (NOT position: fixed) — grows the page when opened. */
.billing-modal-overlay {
    display: none; width: 100%; min-height: 40vh;
    align-items: center; justify-content: center;
    background: rgba(11, 15, 20, 0.55); border-radius: 10px;
    padding: 2rem 1rem; margin-top: 1.5rem;
}
.billing-modal-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 10px; padding: 1.5rem; width: min(440px, 100%);
    display: flex; flex-direction: column; gap: 1rem;
}
.billing-card-element {
    background: #0d1520; border: 1px solid var(--border);
    border-radius: 6px; padding: 0.75rem;
}
.billing-card-errors { color: #fca5a5; font-size: 0.82rem; min-height: 1rem; }

/* ===================================================================== */
/* LANDING-PAGE-01/02, restyled by STYLE-01 — public marketing landing   */
/* page. Scoped .landing-* so nothing bleeds into the app. STYLE-01      */
/* retired the page's private --lp-* palette: every colour here is a     */
/* :root token. Regime colours are data colours, read from --regime-*.   */
/* ===================================================================== */

/* STYLE-01 — the logo ribbon, first thing on every page (base.html).
   STYLE-02 — full width with no inset: positioned against the page itself
   (nothing above it is positioned), and the nav below takes back the 6px the
   ribbon used to occupy. STYLE-03 set body { margin: 0 }, so the nav now sits
   flush under the ribbon. */
.tp-ribbon {
    position: absolute; top: 0; left: 0; right: 0;
    display: flex; gap: var(--space-1); height: 6px;
}
.tp-ribbon > span { border-radius: 3px; }
.tp-ribbon > span:nth-child(1) { flex: 1; background: var(--logo-red); }
.tp-ribbon > span:nth-child(2) { flex: 2; background: var(--logo-amber); }
.tp-ribbon > span:nth-child(3) { flex: 3; background: var(--logo-mint); }
.tp-ribbon > span:nth-child(4) { flex: 4; background: var(--logo-mint-pale); }
.tp-ribbon + .top-nav { margin-top: calc(-1.5rem + 6px); }

/* Marketing nav — full-bleed bar (cancels base.html's body p-6 inset). */
.landing-nav {
    display: flex; align-items: center; gap: var(--space-4);
    margin: -1.5rem -1.5rem 0; padding: var(--space-4) var(--space-8);
    height: auto; background: var(--bg-base); border-bottom: 1px solid var(--border);
}
.landing-brand { display: inline-flex; align-items: center; text-decoration: none; }
.landing-logo { height: 44px; width: auto; display: block; }

/* Buttons. ONE primary per screen: the hero's. The nav's is secondary. */
.landing-btn {
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-sans); font-weight: 600; font-size: 0.95rem;
    padding: var(--space-3) var(--space-6); border-radius: var(--radius-md);
    text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.landing-btn-primary { background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); }
.landing-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.landing-btn-secondary { background: transparent; color: var(--text-heading); border: 1px solid var(--border-strong); }
.landing-btn-secondary:hover { border-color: var(--accent-bright); color: var(--accent-bright); }
.landing-nav .landing-btn { font-size: 0.85rem; padding: var(--space-2) var(--space-4); }

/* Full-bleed page canvas so the dark tone runs edge to edge. */
.landing-main { display: block; margin: 0 -1.5rem -1.5rem; padding: 0 var(--space-6); background: var(--bg-base); color: var(--text-primary); }
.landing-section { max-width: 72rem; margin: 0 auto; padding: var(--space-12) 0; }
.landing-section-title { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em; color: var(--text-heading); margin: 0 0 var(--space-6); }

/* Hero, with two soft glows (accent top-right, sideways blue bottom-left). */
/* The glows sit on a pseudo-element that runs past the hero's bottom edge and
   fades out with a mask, so neither glow ends in a visible straight line. */
.landing-hero-wrap { position: relative; isolation: isolate; margin: 0 calc(-1 * var(--space-6)); padding: 0 var(--space-6); }
.landing-hero-wrap::before {
    content: ""; position: absolute; inset: 0 0 -10rem 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(40rem 26rem at 88% 0%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%),
        radial-gradient(36rem 24rem at 4% 78%, color-mix(in srgb, var(--regime-sideways) 12%, transparent), transparent 70%);
    -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent);
    mask-image: linear-gradient(to bottom, black 55%, transparent);
}
.landing-hero { max-width: 56rem; margin: 0 auto; padding: var(--space-16) 0 var(--space-12); }
.landing-h1 { font-family: var(--font-display); font-size: clamp(1.9rem, 4.4vw, 3.25rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; color: var(--text-heading); margin: var(--space-3) 0 0; }
.landing-h1-bull { color: var(--regime-bull); }
.landing-h1-correction { color: var(--regime-correction); }
.landing-subhead { margin: var(--space-6) 0 0; font-size: 1.1rem; line-height: 1.65; color: var(--text-muted); max-width: 40rem; }
.landing-hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }

.landing-overline { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin: 0; }
.landing-overline-accent { color: var(--accent-bright); font-weight: 600; }

/* Product frame: the live regime chart, framed as the product. */
.landing-frame {
    background-color: var(--bg-elevated); background-image: var(--grad-frame);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-frame);
    padding: var(--space-4);
}
.landing-frame-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: var(--space-1) var(--space-2) var(--space-4); }
.landing-chart-box { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); height: 320px; }
.landing-chart-box canvas { width: 100% !important; height: 100% !important; }
.landing-chart-empty { color: var(--text-muted); font-size: 0.85rem; text-align: center; margin: 0; padding-top: 7rem; }

/* LANDING-MOBILE-OVERFLOW-01 — `.landing-chart-caption` once carried
   `flex-shrink: 0` inside a flex row with no wrap: at 390px the DOCUMENT was
   727px wide. `min-width: 0` is the other half of the fix — a flex item's
   default `min-width: auto` refuses to shrink below its content. */
.landing-chart-meta { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-3); padding: 0 var(--space-2); }
.landing-chart-caption { font-size: 0.75rem; color: var(--text-muted); text-align: right; min-width: 0; margin: 0; }
@media (max-width: 720px) {
    .landing-chart-meta { flex-direction: column; align-items: flex-start; }
    .landing-chart-caption { text-align: left; }
}

/* Stat strip */
.landing-stats { display: grid; grid-template-columns: 1fr; gap: 1px; margin-top: var(--space-8); background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
@media (min-width: 768px) { .landing-stats { grid-template-columns: 1fr 2fr; } }
.landing-stat { background-color: var(--bg-raised); background-image: var(--grad-card); padding: var(--space-4) var(--space-6); }
.landing-stat-value { font-family: var(--font-mono); font-weight: 500; font-size: 1.15rem; color: var(--text-heading); margin: var(--space-1) 0 0; }
.landing-stat-text { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; margin: var(--space-1) 0 0; }
.landing-stat-regime { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-weight: 600; }
.landing-stat-num { font-family: var(--font-mono); font-weight: 500; color: var(--text-heading); }
.landing-dot-bull { background: var(--regime-bull); }
.landing-dot-sideways { background: var(--regime-sideways); }
.landing-dot-pullback { background: var(--regime-pullback); }
.landing-dot-correction { background: var(--regime-correction); }
.landing-dot-bear { background: var(--regime-bear); }

/* Inside the product: screenshot frames (placeholders until real shots). */
.landing-shots { display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
@media (min-width: 900px) { .landing-shots { grid-template-columns: repeat(3, 1fr); } }
.landing-shot {
    display: flex; align-items: center; justify-content: center; text-align: center;
    min-height: 13rem; padding: var(--space-6);
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-frame);
    color: var(--text-muted); font-family: var(--font-mono); font-size: 0.85rem;
}
/* DEMO-02 — "Inside the product": each card is a button that opens the popup. Captions in the
   body sans; the first slide is the thumbnail, cropped to the screenshot's 16:10 so a swap of
   any size keeps the card the same height. */
.gallery-card {
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    min-height: 0; padding: 0; overflow: hidden; width: 100%;
    font-family: var(--font-sans); font-size: 1rem; text-align: left; color: inherit;
    cursor: pointer; transition: border-color 0.2s ease;
}
.gallery-card:hover { border-color: var(--border-strong); }
.gallery-card:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.gallery-thumb {
    position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden;
    background: var(--bg-sunken); border-bottom: 1px solid var(--border);
}
.gallery-thumb img {
    display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left;
    transition: transform 0.35s ease;
}
.gallery-card:hover .gallery-thumb img, .gallery-card:focus-visible .gallery-thumb img { transform: scale(1.03); }
.gallery-badge {
    position: absolute; left: var(--space-3); bottom: var(--space-3);
    padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
    background: var(--bg-elevated); color: var(--text-heading); border: 1px solid var(--border-strong);
}
.gallery-expand {
    position: absolute; top: var(--space-3); right: var(--space-3);
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
    background: var(--bg-elevated); color: var(--text-heading); border: 1px solid var(--border-strong);
    opacity: 0.8; transition: opacity 0.2s ease;
}
.gallery-card:hover .gallery-expand, .gallery-card:focus-visible .gallery-expand { opacity: 1; }
.gallery-text { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4); }
.gallery-title { color: var(--text-heading); font-size: 1.05rem; font-weight: 600; }
.gallery-desc { color: var(--text-muted); font-size: 0.95rem; line-height: 1.45; }

/* The popup: a native <dialog> filling the viewport, so a click on the dark area is a click on
   the dialog itself (closes). The image fits the viewport at any width, no sideways scroll. */
.gallery-scroll-lock, .gallery-scroll-lock body { overflow: hidden; }
.gallery-dialog {
    position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
    margin: 0; padding: 0; border: 0; overflow: hidden;
    background: var(--scrim); color: var(--text-primary); font-family: var(--font-sans);
}
.gallery-dialog:focus { outline: none; }
.gallery-stage {
    box-sizing: border-box; height: 100%; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: var(--space-4);
    padding: var(--space-16) var(--space-16) var(--space-6);
}
.gallery-figure {
    margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--space-4);
    max-width: min(1200px, 100%); min-height: 0;
}
.gallery-frame { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; max-width: 100%; }
.gallery-image {
    display: block; max-width: 100%; max-height: calc(100dvh - 260px); width: auto; height: auto;
    border-radius: var(--radius-lg); border: 1px solid var(--border-strong);
    background: var(--bg-base); box-shadow: var(--shadow-frame);
}
.gallery-nav, .gallery-close {
    display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%;
    background: var(--bg-elevated); color: var(--text-heading); border: 1px solid var(--border-strong);
    cursor: pointer;
}
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.gallery-prev { left: calc(-44px - var(--space-4)); }
.gallery-next { right: calc(-44px - var(--space-4)); }
.gallery-close { position: absolute; top: var(--space-4); right: var(--space-4); }
.gallery-nav[hidden], .gallery-dots[hidden] { display: none; }
.gallery-nav:hover, .gallery-close:hover { border-color: var(--text-muted); }
.gallery-nav:focus-visible, .gallery-close:focus-visible, .gallery-dot:focus-visible {
    outline: 2px solid var(--focus-ring); outline-offset: 2px;
}
.gallery-text-block { text-align: center; max-width: 62ch; }
.gallery-dialog .gallery-dialog-title { margin: 0; font-family: var(--font-sans); font-size: 1.15rem; font-weight: 600; color: var(--text-heading); }
.gallery-caption { margin: var(--space-1) 0 0; line-height: 1.5; }
.gallery-dots { display: flex; gap: var(--space-1); }
.gallery-dot {
    display: grid; place-items: center; width: 28px; height: 28px; padding: 0;
    background: none; border: 0; border-radius: 50%; cursor: pointer;
}
.gallery-dot::before {
    content: ""; width: 10px; height: 10px; border-radius: 50%;
    border: 1px solid var(--text-muted); background: transparent;
}
.gallery-dot[aria-current="true"]::before { background: var(--text-heading); border-color: var(--text-heading); }
@media (max-width: 700px) {
    .gallery-stage { padding: calc(44px + var(--space-8)) var(--space-4) var(--space-4); }
    .gallery-prev { left: var(--space-2); }
    .gallery-next { right: var(--space-2); }
}
@media (prefers-reduced-motion: reduce) {
    .gallery-thumb img, .gallery-expand, .gallery-card { transition: none; }
    .gallery-card:hover .gallery-thumb img, .gallery-card:focus-visible .gallery-thumb img { transform: none; }
}

/* Regime cards: dot + name + share + share bar + description. No coloured
   left border. Colours come from --regime-* at runtime (renderCards). */
.landing-regime-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); margin-top: var(--space-4); }
@media (min-width: 640px) { .landing-regime-grid { grid-template-columns: repeat(2, 1fr); } }
/* LANDING-PAGE-REGIME-FIXES-01 (#1806) -- all FIVE regime cards fit one row
   at desktop widths; a 4-column grid left the fifth as an orphaned wrap. */
@media (min-width: 1024px) { .landing-regime-grid { grid-template-columns: repeat(5, 1fr); gap: var(--space-3); } }
.landing-regime-card {
    display: flex; flex-direction: column; text-align: left; font: inherit;
    background-color: var(--bg-raised); background-image: var(--grad-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: var(--space-4); cursor: pointer; color: inherit;
    box-shadow: var(--shadow-card);
    transition: border-color 150ms ease; opacity: 1;
}
.landing-regime-card:hover { border-color: var(--border-strong); }
.landing-regime-card.is-dimmed { opacity: 0.4; }
.landing-regime-card.is-active { border-color: var(--accent-bright); }
.landing-card-head { display: flex; align-items: center; gap: var(--space-2); }
/* STYLE-02 — a faint top-left wash of each card's own regime colour (10%,
   transparent by 65%), over --grad-card. --text-muted at the lightest point:
   bull 5.31, sideways 5.32, pullback 5.07, correction 5.49, bear 5.88 :1. */
.landing-regime-card-bull { --rg-wash: var(--regime-bull); }
.landing-regime-card-sideways { --rg-wash: var(--regime-sideways); }
.landing-regime-card-pullback { --rg-wash: var(--regime-pullback); }
.landing-regime-card-correction { --rg-wash: var(--regime-correction); }
.landing-regime-card-bear { --rg-wash: var(--regime-bear); }
.landing-regime-card[class*="landing-regime-card-"] {
    background-image: radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--rg-wash) 10%, transparent) 0%, transparent 65%), var(--grad-card);
}
.landing-card-dot { width: 10px; height: 10px; border-radius: var(--radius-pill); flex-shrink: 0; }
.landing-card-label { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--text-heading); margin: 0; }
.landing-card-pct { margin-left: auto; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-primary); }
.landing-card-bar { height: 4px; margin-top: var(--space-3); background: var(--border); border-radius: var(--radius-pill); overflow: hidden; }
.landing-card-bar > span { display: block; height: 100%; border-radius: var(--radius-pill); }
.landing-card-desc { margin: var(--space-3) 0 0; flex: 1; font-size: 0.8rem; color: var(--text-muted); line-height: 1.6; }
.landing-card-link { margin-top: var(--space-3); display: inline-block; font-size: 0.78rem; color: var(--accent-bright); text-decoration: none; }
.landing-card-link:hover { text-decoration: underline; }
.landing-share-window { margin: var(--space-3) 0 0; color: var(--text-muted); font-size: 0.75rem; }

/* Landing disclaimer — LANDING-DISCLAIMER-01: real copy at ordinary footnote
   weight. It is still NOT the final attorney-reviewed wording; that marker
   lives in the template comment, where a visitor will not see it. */
.landing-disclaimer {
    /* Centred under the market panel (Jason, 2026-11-12). */
    margin: var(--space-6) auto 0; padding: var(--space-3) 0 0; border-top: 1px solid var(--border);
    color: var(--text-muted); font-size: 0.75rem; line-height: 1.6; text-align: center;
    max-width: 62ch;
}

/* LANDING-MOBILE-OVERFLOW-01 — measured at 390x844: the nav did not fit
   (logo + gap + CTA + padding > 374px available) and the tooltip's padding
   sat outside its width cap. The nav wraps with a smaller logo, and
   `box-sizing: border-box` makes the tooltip's cap mean what it says. */
@media (max-width: 720px) {
    .landing-nav { flex-wrap: wrap; row-gap: var(--space-2); padding: var(--space-4) var(--space-6); }
    .landing-logo { max-width: 150px; height: auto; }
    .landing-tooltip-body { box-sizing: border-box; width: auto; max-width: calc(100vw - 4.5rem); }
    .landing-hero { padding: var(--space-12) 0 var(--space-8); }
    .landing-hero-actions .landing-btn { flex: 1 1 100%; }
}

/* Tooltip */
.landing-tooltip-wrap { position: relative; }
.landing-tooltip-btn { background: none; border: none; padding: 0; cursor: pointer; color: var(--accent-bright); font-size: 0.85rem; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; }
.landing-tooltip-body {
    visibility: hidden; opacity: 0;
    position: absolute; left: 0; top: 100%; margin-top: var(--space-2); z-index: 10;
    width: min(560px, calc(100vw - 3rem));
    background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: var(--space-4); font-size: 0.85rem; color: var(--text-muted); line-height: 1.6;
    box-shadow: var(--shadow-card);
}
.landing-tooltip-wrap:hover .landing-tooltip-body,
.landing-tooltip-wrap:focus-within .landing-tooltip-body { visibility: visible; opacity: 1; }

/* How it works */
.landing-how-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
@media (min-width: 768px) { .landing-how-grid { grid-template-columns: repeat(3, 1fr); } }
.landing-how-card { background-color: var(--bg-raised); background-image: var(--grad-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.landing-step-num {
    width: 2rem; height: 2rem; border-radius: var(--radius-pill); flex-shrink: 0;
    border: 1px solid var(--accent-bright); color: var(--accent-bright);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 0.85rem; font-weight: 500;
}
.landing-step-title { font-family: var(--font-display); font-weight: 600; color: var(--text-heading); margin: 0 0 var(--space-2); }
.landing-step-body { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin: 0; }

/* Closing */
.landing-closing { display: flex; justify-content: center; padding: var(--space-12) 0 var(--space-16); }
.landing-closing p { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.2rem, 2.6vw, 1.5rem); color: var(--text-heading); max-width: 44rem; line-height: 1.5; text-align: center; margin: 0; }

/* ===================================================================== */
/* INDICATOR-EDUCATION-UI-01 — indicator education panel (detail page) +  */
/* subscriber-card tagline. Dark app palette; regime colours match the    */
/* four-regime data colours used elsewhere.                               */
/* ===================================================================== */
.edu-section { padding: 0.25rem 0 0.5rem; margin-bottom: 1.25rem; }
.edu-tagline { color: var(--text-muted); font-style: italic; font-size: 1rem; line-height: 1.5; margin-bottom: 1rem; }

.edu-blocks { display: flex; flex-direction: column; gap: 1rem; }
.edu-block { padding: 0; }
.edu-block-highlight { background: rgba(37, 99, 235, 0.08); border: 1px solid var(--border-emph); border-radius: 8px; padding: 0.85rem 1rem; }
.edu-block-title { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; margin: 0 0 0.4rem; }
.edu-block-body { color: var(--text-primary); line-height: 1.65; font-size: 0.9rem; margin: 0; }

.edu-params, .edu-common-settings { margin-top: 1.1rem; }
.edu-param-row, .edu-setting-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.edu-param-name { font-family: var(--font-mono); color: var(--accent-bright); font-size: 0.82rem; }
.edu-param-default { color: var(--text-muted); font-size: 0.78rem; }
.edu-param-desc, .edu-setting-desc { color: var(--text-primary); font-size: 0.85rem; line-height: 1.5; flex: 1 1 16rem; }
.edu-setting-value { font-family: var(--font-mono); color: var(--accent-bright); font-size: 0.82rem; }
.edu-divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

/* Subscriber card tagline (best-effort education join). */
.ind-lib-edu-tagline { color: var(--text-muted); font-style: italic; font-size: 0.8rem; line-height: 1.45; margin: 0.5rem 0 0; }

/* ===================================================================== */
/* INDICATOR-EDUCATION-SPLIT-01 — subscriber Indicator Library pages.      */
/* Dark app palette; teal (#1D9E75) education accent to match the SVGs.    */
/* ===================================================================== */
.edu-overview-page { max-width: 1100px; margin: 0 auto; padding: 0 0.5rem 4rem; }
.edu-overview-hero { padding: 1rem 0 2rem; }
.edu-overview-hero h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 600; color: var(--text-primary); margin: 0 0 1rem; letter-spacing: -0.01em; }
.edu-overview-intro { color: var(--text-muted); font-size: 1.05rem; line-height: 1.65; max-width: 44rem; margin: 0; }
.edu-overview-concepts { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 1rem 0 2.5rem; }
@media (min-width: 768px) { .edu-overview-concepts { grid-template-columns: repeat(2, 1fr); } }
.edu-concept-block { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem 1.4rem; }
.edu-concept-title { font-size: 0.95rem; font-weight: 600; color: #1d9e75; margin: 0 0 0.6rem; }
.edu-concept-block p { color: var(--text-primary); font-size: 0.9rem; line-height: 1.6; margin: 0; }

.edu-family-browse { margin-top: 1.5rem; }
.edu-browse-title { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); margin: 0 0 1rem; }
.edu-family-section { border-top: 1px solid var(--border); padding-top: 1.4rem; margin-top: 1.4rem; }
.edu-family-name { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin: 0 0 1rem; display: flex; align-items: center; gap: 0.6rem; }
.edu-family-count { font-size: 0.7rem; color: var(--text-muted); background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; padding: 0.05rem 0.55rem; }
.edu-indicator-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .edu-indicator-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .edu-indicator-grid { grid-template-columns: repeat(3, 1fr); } }
.edu-indicator-card { display: block; text-decoration: none; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; transition: transform 0.12s ease, border-color 0.12s ease; }
.edu-indicator-card:hover { transform: translateY(-2px); border-color: #1d9e7566; }
.edu-indicator-card-thumb { background: #131922; border-bottom: 1px solid var(--border); max-height: 96px; overflow: hidden; }
.edu-indicator-card-thumb svg { display: block; }
/* EDUCATION-CHARTS-01 Phase 6 — the real closing-price sparkline
   (chart_sparkline.py) replacing the retired chart_svg schematic. */
.edu-sparkline { width: 100%; height: 64px; }
.edu-indicator-card-body { padding: 0.9rem 1rem; }
.edu-indicator-card-name { font-weight: 600; color: var(--text-primary); font-size: 0.95rem; }
.edu-indicator-card-tagline { color: var(--text-muted); font-size: 0.78rem; line-height: 1.45; margin-top: 0.35rem; }

/* --- Detail page (Page 2) --- */
.edu-detail-page { max-width: 900px; margin: 0 auto; padding: 0 0.5rem 4rem; }
.edu-breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-muted); padding: 0.75rem 0; }
.edu-breadcrumb a { color: #1d9e75; text-decoration: none; }
.edu-breadcrumb a:hover { text-decoration: underline; }
.edu-breadcrumb-sep { color: var(--text-muted); }
.edu-detail-header { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; padding: 0.5rem 0 1.5rem; border-bottom: 1px solid var(--border); }
.edu-detail-header-text { flex: 1 1 20rem; }
.edu-detail-header-chart { flex: 0 0 320px; max-width: 100%; background: #131922; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; scroll-margin-top: 5rem; }
/* EDUCATION-CHARTS-01 Phase 5 — the real Lightweight Charts canvas
   (education_chart.js). Header chart is wider than the old fixed-320px
   SVG slot needed, since a real candlestick+indicator-pane chart wants
   room to be readable. */
.edu-detail-header:has(.edu-hero-chart-canvas) .edu-detail-header-chart { flex: 1 1 32rem; }
.edu-hero-chart-canvas { width: 100%; height: 360px; }
/* EDUCATION-CHARTS-01 Phase 5 — convention G (pattern gallery) is a
   full-width section below the header, not squeezed into the header's
   narrow side-by-side chart slot: a 2x2 grid of independently-readable
   mini-charts needs real width, which a flex sibling to the title text
   in a 900px-max page cannot give it. */
.edu-gallery-section { padding: 1rem 0 0.5rem; border-bottom: 1px solid var(--border); }
.edu-gallery-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; width: 100%; }
@media (min-width: 640px) { .edu-gallery-grid { grid-template-columns: repeat(2, 1fr); } }
.edu-gallery-panel { background: #131922; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.edu-gallery-panel-title { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); }
.edu-gallery-panel-chart { width: 100%; height: 260px; }
/* CHART-01 follow-up: the numbered key under a chart with several marks (tp-chart.js key). */
.tp-chart-key { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; padding: 0.5rem 0.75rem; font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.4; color: var(--text-muted); }
.tp-chart-key-item { display: inline-flex; align-items: center; }
.tp-chart-key-n { display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.15rem; padding: 0 0.2rem; margin-right: 0.4rem; border-radius: 999px; color: var(--bg-base); font-size: 0.7rem; font-weight: 700; }
.edu-detail-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; color: var(--text-primary); margin: 0 0 0.6rem; letter-spacing: -0.01em; }
.edu-detail-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.8rem; }
.edu-detail-tagline { color: var(--text-muted); font-style: italic; font-size: 1rem; line-height: 1.5; margin: 0; }
.edu-detail-overview { padding-top: 0.5rem; }
.edu-detail-section { padding: 1.4rem 0; border-bottom: 1px solid var(--border); }
.edu-detail-section-highlight { background: rgba(29, 158, 117, 0.07); border: 1px solid #1d9e7533; border-radius: 10px; padding: 1.2rem 1.4rem; margin: 1rem 0; }
.edu-section-title { font-size: 1.05rem; font-weight: 600; color: var(--text-primary); margin: 0 0 0.75rem; }
.edu-section-body { color: var(--text-primary); font-size: 0.95rem; line-height: 1.7; margin: 0; }
.edu-section-intro { font-size: 0.88rem; line-height: 1.55; margin: 0 0 1rem; }

.edu-param-list { display: flex; flex-direction: column; gap: 1rem; }
.edu-param-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.2rem; }
.edu-param-header { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 0.5rem; }
.edu-param-name { font-family: var(--font-mono); color: #1d9e75; font-size: 0.9rem; font-weight: 600; }
.edu-param-default { color: var(--text-muted); font-size: 0.78rem; }
.edu-param-desc { color: var(--text-primary); font-size: 0.88rem; line-height: 1.55; margin: 0 0 0.9rem; }
.edu-param-effects { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 640px) { .edu-param-effects { grid-template-columns: repeat(2, 1fr); } }
.edu-param-effect { border-left: 3px solid var(--border); padding: 0.5rem 0.85rem; background: rgba(255,255,255,0.02); border-radius: 0 6px 6px 0; }
.edu-param-effect p { color: var(--text-muted); font-size: 0.82rem; line-height: 1.5; margin: 0.35rem 0 0; }
.edu-param-increase { border-left-color: #1d9e75; }
.edu-param-decrease { border-left-color: #ef9f27; }
.edu-param-effect-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-primary); }
.edu-settings-list { display: flex; flex-direction: column; gap: 0; }
.edu-settings-list .edu-setting-row { display: flex; flex-wrap: wrap; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.edu-settings-list .edu-setting-value { font-family: var(--font-mono); color: #1d9e75; font-size: 0.85rem; min-width: 5rem; }
.edu-settings-list .edu-setting-desc { color: var(--text-primary); font-size: 0.85rem; line-height: 1.5; flex: 1 1 16rem; }

.edu-action-card { background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid #1d9e75; border-radius: 8px; padding: 1.1rem 1.3rem; margin-top: 1rem; scroll-margin-top: 5rem; }
.edu-action-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.edu-action-name { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin: 0; }
.edu-action-body { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.edu-action-text { flex: 1 1 20rem; }
.edu-action-chart { flex: 0 0 240px; max-width: 100%; background: #131922; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
/* EDUCATION-CHARTS-01 Phase 5 — every action shows its parent's real
   chart, not its own (#1594 §3); this replaces the per-action chart_svg
   slot with a link back up to it. */
.edu-action-chart-link { color: #1d9e75; text-decoration: none; font-size: 0.82rem; font-weight: 500; white-space: nowrap; }
.edu-action-chart-link:hover { text-decoration: underline; }
.edu-action-block { margin-bottom: 0.75rem; }
.edu-action-block p { color: var(--text-primary); font-size: 0.85rem; line-height: 1.55; margin: 0.25rem 0 0; }
/* EDUCATION-COVERAGE-AUDIT-01 (#1581) — a gate with no write-up says so rather than rendering an empty body. */
.edu-action-nocontent { color: var(--text-muted); font-size: 0.85rem; font-style: italic; line-height: 1.55; margin: 0.15rem 0 0; }
.edu-action-block-warning p { color: #d9b47a; }
.edu-action-label { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.edu-action-footer { border-top: 1px solid var(--border); margin-top: 0.9rem; padding-top: 0.8rem; }
.edu-action-composer-link { color: #1d9e75; text-decoration: none; font-size: 0.82rem; font-weight: 500; }
.edu-action-composer-link:hover { text-decoration: underline; }

.edu-detail-cta { display: flex; justify-content: center; margin-top: 2.5rem; }
.edu-upgrade-prompt { text-align: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; max-width: 32rem; }
.edu-upgrade-prompt p { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 1rem; }
.edu-family-badge { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; padding: 0.12rem 0.6rem; }

/* ---------------------------------------------------------------------------
   INTRADAY-PRICE-REFRESH-02 — admin Price Feed page.
   The verdict banner is the whole point of the page: it must be readable from
   across the room, because the failure it reports (a two-month-old price shown
   as current) is invisible everywhere else.
   --------------------------------------------------------------------------- */
.pf-verdict {
  padding: 0.85rem 1.1rem; margin: 0 0 1.1rem;
  border-left: 4px solid #4b5563; border-radius: 0.3rem; background: #111827;
}
.pf-verdict-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; }
.pf-verdict-detail { margin-top: 0.25rem; font-size: 0.85rem; color: #9ca3af; }
.pf-healthy  { border-left-color: #10b981; }
.pf-healthy  .pf-verdict-label { color: #10b981; }
.pf-degraded { border-left-color: #f59e0b; }
.pf-degraded .pf-verdict-label { color: #f59e0b; }
.pf-dead     { border-left-color: #ef4444; }
.pf-dead     .pf-verdict-label { color: #ef4444; }
.pf-closed   { border-left-color: #6b7280; }
.pf-closed   .pf-verdict-label { color: #9ca3af; }

.pf-stats { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.1rem; }
.pf-stat {
  flex: 1 1 9rem; padding: 0.7rem 0.9rem;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 0.3rem;
}
.pf-stat-value { font-size: 1.35rem; font-weight: 600; }
.pf-stat-label { margin-top: 0.15rem; font-size: 0.72rem; color: #9ca3af; }

.pf-legend { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0 0.9rem; }
.pf-pill {
  display: inline-block; padding: 0.1rem 0.45rem; border-radius: 0.75rem;
  font-size: 0.68rem; font-weight: 600; border: 1px solid transparent;
}
.pf-live  { color: #10b981; border-color: #065f46; background: #06251c; }
.pf-stale { color: #f59e0b; border-color: #78350f; background: #2a1c05; }
.pf-close { color: #9ca3af; border-color: #374151; background: #16181d; }
.pf-none  { color: #ef4444; border-color: #7f1d1d; background: #2a0d0d; }

.pf-tag {
  margin-left: 0.25rem; padding: 0 0.22rem; font-size: 0.58rem; font-weight: 600;
  color: #9ca3af; border: 1px solid #374151; border-radius: 0.15rem;
}
.pf-total td { border-top: 1px solid #374151; }
.pf-footer { margin-top: 1rem; font-size: 0.75rem; }

/* ---------------------------------------------------------------------------
   BULK-SIGNAL-SELECT-03 — signal selection + the batch-add modal.
   --------------------------------------------------------------------------- */
/* SIGNALS-TICKER-LINKS-01 — ticker + chart icon share ONE column. inline-flex
   with a small gap keeps them on one line inside a fixed-width cell, and the
   icon does not shrink, so a long ticker cannot push it out of the row. */
.sig-ticker-cell { display: inline-flex; align-items: center; gap: 0.3rem; }
.sig-ticker-cell .tv-link { flex: 0 0 auto; font-size: 0.75rem; opacity: 0.6; }
.sig-ticker-cell .tv-link:hover { opacity: 1; }
.bulk-check-col { width: 3%; text-align: center; }
.sig-select { cursor: pointer; accent-color: var(--accent, #2563eb); }
/* A signal already held shows a tick instead of a checkbox — the row stays
   readable, it just cannot be selected again. */
.bulk-held { color: #10b981; font-size: 0.85rem; }

.bulk-bar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0.9rem; margin: 0 0 0.75rem;
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 0.375rem;
}
.bulk-bar-count { font-size: 0.8rem; color: var(--text-muted, #9ca3af); margin-right: auto; }
/* DASHBOARD-CLEANUP-02 (#1694) — `.bulk-bar { display: flex }` outranks the
   browser's default `[hidden] { display: none }`, so the bar showed "0 selected"
   permanently while its markup said hidden. This restores the intended
   appear-on-selection behaviour. */
.bulk-bar[hidden] { display: none; }

/* BULK-MODAL-LAYOUT-02 — the modal must fit the viewport.
   With eleven rows plus a per-row result line the card ran off the bottom of
   the screen: Cancel and "Add to positions" were unreachable, and the results
   the user needed to read were below the fold with no way to scroll to them.
   The card is now bounded by viewport height; only the ROW LIST scrolls, so the
   tally, the disclosure and the buttons stay put. */
.bulk-modal {
  position: relative;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  max-height: min(86vh, 900px);
}
/* The scrolling region. Everything below it is pinned. */
.bulk-scroll {
  overflow-y: auto;
  min-height: 4rem;
  /* Keeps the sticky header from sitting flush against the clipped edge. */
  padding-right: 0.25rem;
}
.bulk-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-card, #131922);
  z-index: 1;
}
/* Results can be long — cap and scroll rather than pushing the buttons away. */
.bulk-results { max-height: 8rem; overflow-y: auto; }
.modal-sub { margin: -0.35rem 0 0.9rem; font-size: 0.8rem; color: var(--text-muted, #9ca3af); }
.bulk-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.bulk-table th {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted, #9ca3af); font-weight: 600; padding: 0.3rem 0.4rem;
  border-bottom: 1px solid var(--border); text-align: left;
}
.bulk-table th.right, .bulk-table td.right { text-align: right; }
.bulk-table td { padding: 0.45rem 0.4rem; border-bottom: 1px solid #131a24; }
.bulk-ticker { font-weight: 700; }
.bulk-strategy { font-size: 0.7rem; color: var(--text-muted, #9ca3af); }
/* Now is display-only and must not read as an input. */
.bulk-now { color: var(--text-muted, #9ca3af); font-variant-numeric: tabular-nums; }
/* Attorney's memo (Jason, 2026-11-11): the Shares header says the number is at the
   subscriber's own risk setting. */
.bulk-th-sub { display: block; font-size: 0.7rem; font-weight: 400; color: var(--text-muted); }

/* `.modal-card input[type=number]` (width 100%, larger padding) outranked a
   bare `.bulk-in`, so each box filled its cell and touched the next one, and
   Shares lost its colour. `input.bulk-in` inside the table outranks it. */
.bulk-table input.bulk-in {
  width: 5.5rem; padding: 0.25rem 0.4rem; text-align: right;
  background: #0b1220; border: 1px solid #263243; border-radius: 0.25rem;
  color: var(--text-primary, #e5e7eb); font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.bulk-table input.bulk-shares { color: #34d399; }
.bulk-value { font-weight: 700; }
.tabular { font-variant-numeric: tabular-nums; }
.bulk-remove {
  background: none; border: none; color: var(--text-muted, #9ca3af);
  cursor: pointer; font-size: 1rem; line-height: 1;
}
.bulk-remove:hover { color: var(--text-neg, #ef4444); }
/* The close button had no rule at all and rendered as a full-width bar. */
.bulk-modal .modal-x {
  position: absolute; top: 0.6rem; right: 0.8rem; width: auto; padding: 0;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1.3rem; line-height: 1;
}
.bulk-modal .modal-x:hover { color: var(--text-primary); }
.bulk-row.is-done { opacity: 0.55; }
.bulk-row.is-failed { background: #2a0d0d; }

/* Green while the batch fits, amber once it does not. The colour is the whole
   signal here — the numbers alone do not read as pass/fail at a glance. */
.bulk-tally {
  margin: 0.9rem 0 0.5rem; padding: 0.6rem 0.85rem; border-radius: 0.375rem;
  background: #06251c; border: 1px solid #065f46;
}
.bulk-tally.is-over { background: #2a1c05; border-color: #78350f; }
.bulk-tally-row { display: flex; justify-content: space-between; padding: 0.12rem 0; font-size: 0.85rem; }
.bulk-tally #bulk-committed { color: #34d399; font-weight: 700; }
.bulk-tally.is-over #bulk-committed { color: #f59e0b; }
/* `display: flex` beats the `hidden` attribute — the UA stylesheet's
   [hidden]{display:none} loses to any explicit display rule. The over-budget
   panel therefore stayed on screen after scale-to-fit brought the total under
   budget, showing a stale "Over by $338,949" beside a green passing tally.
   The [hidden] rule below restores it. */
.bulk-over[hidden] { display: none !important; }
.bulk-over {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid #78350f;
  font-size: 0.8rem; color: #f59e0b;
}
.bulk-stale { font-size: 0.72rem; margin: 0.2rem 0 0.6rem; }
.bulk-results { margin: 0.6rem 0; font-size: 0.78rem; }
.bulk-result { padding: 0.12rem 0; }
.bulk-result.is-ok { color: #10b981; }
.bulk-result.is-fail { color: #ef4444; }


/* ── SCORING-DECISIONS-01 Decision 3 — per-gate readings on hover ───────────
   Every pattern on the dashboard passed every gate, so the margin is the only
   thing that varies. Shown on hover AND on keyboard focus: a hover-only
   affordance is unreachable by keyboard and does not exist on touch.
   Bars are each gate's own reading at equal visual weight — never a weighting
   between gates, which would make this a ranking rather than a measurement. */
.pmh-trigger { position: relative; display: inline-block; cursor: help; outline: none; }
.pmh-trigger .pmh-dash { border-bottom: 1px dotted var(--text-muted); }
.pmh-pop {
  display: none;
  position: absolute;
  z-index: 60;
  /* ANCHORED LEFT, NOT CENTRED. The measurement cell is the leftmost column
     on the dashboard, so a 20-24rem popup centred on it puts half its width
     past the left edge of the viewport and the readings are unreadable — the
     gate names and bar labels are the part that gets clipped, because they sit
     on the left of the panel.

     Opening rightward is safe in a way centring is not: there is always table
     to the right (this is column one), and the popup floats above it. Centring
     could only work for a column near the middle, which this one can never be. */
  left: 0;
  bottom: calc(100% + 0.4rem);
  min-width: 20rem;
  max-width: 24rem;
  padding: 0.6rem 0.7rem;
  text-align: left;
  background: var(--bg-card, #121821);
  border: 1px solid var(--border, #2a3441);
  border-radius: 0.4rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  white-space: normal;
  font-weight: 400;
}
.pmh-trigger:hover .pmh-pop,
.pmh-trigger:focus .pmh-pop,
.pmh-trigger:focus-within .pmh-pop { display: block; }
/* DASHBOARD-CLEANUP-02 (#1694) — opens BELOW the row when there is not room
   above it in the viewport (a first row near the top of the screen). Set by the
   dashboard script on hover/focus from measured space, never by default: upward
   stays the normal direction so the popup does not cover the rows being read. */
.pmh-pop.pmh-pop-below { bottom: auto; top: calc(100% + 0.4rem); }
/* ADA (#1749) -- this ring was #2d4f7a, which measures 2.16:1 on --bg-card
   and 2.27:1 on --bg-base. WCAG 1.4.11 / 2.4.7 require 3:1, so the focus
   indicator on a deliberately keyboard-reachable control could not be seen.
   Uses --focus-ring rather than a second literal: one focus colour on the
   site, and this control comes along for free when a light theme lands. */
.pmh-trigger:focus { box-shadow: 0 0 0 2px var(--focus-ring); border-radius: 0.2rem; }

.pmh-head {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); margin-bottom: 0.4rem;
}
.pmh-readings { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.pmh-readings td { padding: 0.18rem 0.3rem; vertical-align: middle; }
.pmh-gate { color: var(--text-primary); white-space: nowrap; }
.pmh-bar-cell { width: 100%; padding-left: 0.5rem !important; }
.pmh-bar {
  display: block; height: 0.5rem; border-radius: 0.25rem;
  background: #3b82f6; min-width: 2px;
}
.pmh-score {
  text-align: right; font-variant-numeric: tabular-nums;
  color: var(--text-muted); white-space: nowrap;
}
.pmh-disclaimer {
  margin: 0.5rem 0 0 0; font-size: 0.68rem; line-height: 1.35;
  color: var(--text-muted);
}
.pmh-loading { font-size: 0.75rem; color: var(--text-muted); }

/* ── #1306 — the gate bars span the live band (a bare pass to full credit),
   not 0-100. Every gate on the dashboard passed, so no reading below the
   floor can occur and drawing 0-100 wasted three quarters of the track.
   `min-width` keeps a bare pass visible: an empty bar would read as a
   failure, and a failing gate cannot appear here at all. */
.pm-bar, .pmh-bar { min-width: 3px; }
.pm-caption, .pmh-caption {
  margin: 0.35rem 0 0 0; font-size: 0.66rem; line-height: 1.3;
  color: var(--text-muted); opacity: 0.85;
}

/* ---------------------------------------------------------------------------
   ADA-COMPLIANCE-01 (#1519) — support for partials/a11y.html.

   `.sr-only` is load-bearing, not decoration: the macros put "(required)" and
   other announcements in it. Without this rule that text renders visibly in the
   middle of every label, so the class and the macros ship together.

   The clip/1px technique keeps the text in the accessibility tree, which
   `display:none` and `visibility:hidden` both remove — those hide it from screen
   readers too, which is the opposite of what is wanted.
   --------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Visible again on keyboard focus, so a skip-link built on `.sr-only` can be
   reached. A permanently invisible focusable element is a keyboard trap. */
.sr-only-focusable:focus,
.sr-only-focusable:active {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.a11y-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.a11y-field > label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.a11y-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* A visible focus indicator is WCAG 2.4.7. Browsers supply one; a stylesheet
   that sets `outline: none` anywhere removes it silently, so this restores a
   deliberate one on every interactive element rather than relying on defaults. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* BILLING-UPGRADE-01 — plan-change acknowledgement on /billing. Tokens only:
   COLOUR-TOKEN-RATCHET-01 (#1747) counts hex and rgb()/hsl() literals per file,
   and main.css is already the largest holder of them. A new literal here would
   grow the baseline the ratchet exists to shrink, and would ignore a future
   theme switch exactly the way #1746's hardcoded focus ring did. */
.billing-plan-changed {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-pos);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
}

/* ADMIN-BILLING-VIEW-01 — the "you are looking at a subscriber's page" notice
   on /billing and /billing/manage. Tokens only: COLOUR-TOKEN-RATCHET-01 counts
   hex and rgb()/hsl() literals per file, and main.css already holds the most
   of them in the tree. */
.billing-admin-preview {
  margin: 0 0 1.25rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-warn);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
}
.nav-dropdown-note { color: var(--text-muted); font-size: 0.8em; }

/* DASHBOARD-WORKS-HERE-01 — the today-first strategy list. Tokens only:
   COLOUR-TOKEN-RATCHET-01 counts hex and rgb()/hsl() literals per file and
   main.css already holds the most in the tree. The regime swatches reuse the
   canonical --regime-* set #1804 made one source, so this list and every other
   regime surface cannot drift apart. */
.rg-today {
  display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; align-items: baseline;
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent-bright); border-radius: 9px;
  padding: 0.7rem 0.95rem; margin-bottom: 0.9rem;
}
.rg-today-bull { border-left-color: var(--regime-bull); }
.rg-today-sideways { border-left-color: var(--regime-sideways); }
.rg-today-pullback { border-left-color: var(--regime-pullback); }
.rg-today-correction { border-left-color: var(--regime-correction); }
.rg-today-bear { border-left-color: var(--regime-bear); }
.rg-today-n { font-weight: 700; font-variant-numeric: tabular-nums; }
.rg-today-unknown { margin-bottom: 0.9rem; }

.rg-row { border-bottom: 1px solid var(--border); padding: 0.7rem 0; }
.rg-row:last-child { border-bottom: 0; }
.rg-row-head {
  display: flex; flex-wrap: nowrap; gap: 0.5rem 1.1rem; align-items: center;
  margin-bottom: 0.45rem;
}
/* DASHBOARD-ROW-NAME-01 (#2353) — one line: the name takes what the figures leave and
   is cut with "..."; the figures never shrink or wrap. */
.rg-name { font-weight: 600; margin-right: auto; display: flex; align-items: baseline;
           gap: 0.3rem; flex: 1 1 0; min-width: 6rem; }
.rg-name .pill { flex: none; }
.rg-name a { display: flex; align-items: baseline; min-width: 0; }
.rg-name-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.rg-popout { flex: none; }
.rg-row-head > :not(.rg-name) { flex: none; }
.rg-row-head .rg-live { white-space: nowrap; }
.rg-name a { color: inherit; text-decoration: none; }
.rg-name a:hover { color: var(--accent-bright); text-decoration: underline; }
.rg-popout { font-size: 0.72em; opacity: 0.55; margin-left: 0.2rem; }

.rg-live { font-size: 0.78rem; color: var(--text-muted); }
.rg-stat { display: flex; flex-direction: column; min-width: 5.6rem; }
/* DASHBOARD-REGIME-YEARS-01 — the section header and its sort choice. */
.rg-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
           gap: 0.5rem 1rem; margin-bottom: 0.75rem; }
.rg-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.8rem; }
.rg-sort-label { color: var(--text-muted); margin-right: 0.15rem; }
.rg-sort-btn { background: transparent; color: var(--text-muted); border: 1px solid var(--border);
               border-radius: 999px; padding: 0.15rem 0.65rem; cursor: pointer; font: inherit; }
.rg-sort-btn:hover { color: var(--text-primary); }
.rg-sort-btn.is-on { color: var(--text-primary); border-color: var(--accent-bright); }
.rg-sort-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
/* COSTS-01 (#2541) — the line under the head saying what "after costs" includes. */
.rg-costs-note { font-size: 0.8rem; margin: 0.25rem 0 0.5rem; }
.rg-stat-label {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted);
}
.rg-stat-val { font-weight: 600; font-variant-numeric: tabular-nums; }
/* OPS-INNER-SPLIT-FLAG-01 (#1886) — a split failure flagged into the Inside EOD
   summary replaces "nothing to act on" rather than contradicting it. */
.jr-drawer-line:has([data-force-open]) .jr-ok-text { display: none; }
.jr-drawer-line .jr-bad ~ #eod-inner-split-flag [data-force-open]::before { content: "· "; }
/* DASHBOARD-TESTED-BOX-01 — the backtest figures, boxed and captioned as one group. */
.rg-tested { position: relative; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem;
             border: 1px solid var(--border); border-radius: 6px;
             padding: 0.55rem 0.7rem 0.3rem; margin-top: 0.35rem; }
.rg-tested-cap { position: absolute; top: -0.55rem; left: 0.55rem; padding: 0 0.3rem;
                 background: var(--bg-card); font-size: 0.58rem; text-transform: uppercase;
                 letter-spacing: 0.08em; color: var(--text-muted); white-space: nowrap; }
.rg-stat-sub { font-size: 0.66rem; color: var(--text-muted); }
/* A figure from too few trades is shown but NOT tinted. Colour is a verdict. */
.rg-thin { color: var(--text-muted); font-weight: 500; }

.rg-strip { display: flex; gap: 2px; }
.rg-cell {
  width: 2.15rem; min-height: 1.9rem; border-radius: 4px; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  font-size: 0.56rem; line-height: 1.15; border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}
.rg-cell-k { font-size: 0.5rem; text-transform: uppercase; opacity: 0.75; }
.rg-cell-works { color: var(--bg-base); font-weight: 700; }
.rg-cell-works.rg-cell-bull { background: var(--regime-bull); }
.rg-cell-works.rg-cell-sideways { background: var(--regime-sideways); }
.rg-cell-works.rg-cell-pullback { background: var(--regime-pullback); }
.rg-cell-works.rg-cell-correction { background: var(--regime-correction); }
/* Bear is the one regime fill dark enough to need light text. Measured:
   near-black on --regime-bear (#991B1B) is 2.31:1 — the cell text is ~9px, so
   the AA floor is 4.5:1, not the 3.0 large-text one. --text-primary on the same
   fill is 8.3:1. Caught by computing every pairing before shipping rather than
   by looking at it; at this cell size a failure is easy to miss by eye. */
.rg-cell-works.rg-cell-bear { background: var(--regime-bear); color: var(--text-primary); }
.rg-cell-none { background: var(--bg-base); color: var(--text-muted); border-color: var(--border); }
.rg-cell-thin { color: var(--text-muted); border: 1px dashed var(--border); }
.rg-cell-now { outline: 2px solid var(--accent-bright); outline-offset: 1px; }

.rg-more > summary { cursor: pointer; padding: 0.55rem 0; color: var(--text-muted); font-size: 0.88rem; }
.rg-more > summary:hover { color: var(--accent-bright); }
.rg-empty { margin: 0.3rem 0 0; }
.rg-legend {
  margin: 1rem 0 0; padding-top: 0.7rem; border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.78rem; line-height: 1.6;
}
.rg-legend-key { display: inline-flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; align-items: center; margin-left: 0.3rem; }
.rg-sw { width: 0.85rem; height: 0.85rem; border-radius: 3px; display: inline-block; vertical-align: -0.1rem; }
.rg-sw-w { background: var(--regime-bull); }
.rg-sw-n { background: var(--bg-base); border: 1px solid var(--border); }
.rg-sw-t { border: 1px dashed var(--border); }
@media (max-width: 640px) {
  .rg-row-head { gap: 0.4rem 0.7rem; }
  .rg-row-head { flex-wrap: wrap; }
  .rg-row-head > :not(.rg-name) { flex: 0 1 auto; min-width: 0; }
  .rg-name { flex: 1 1 100%; margin-right: 0; }
  .rg-cell { width: 1.95rem; }
}

/* ===================================================================== */
/* STYLE-01 — public pages: login and the beta application. Moved here    */
/* from each template's own <style> block, with every colour a token.     */
/* ===================================================================== */

/* Login (was a standalone page; now extends base.html). */
.login-page { display: flex; justify-content: center; align-items: flex-start; padding: var(--space-16) 0; }
.login-card {
    background-color: var(--bg-raised); background-image: var(--grad-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
    padding: var(--space-12) var(--space-8); max-width: 420px; width: 100%;
    box-sizing: border-box; text-align: center;
}
.login-card h1 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--text-heading); margin: 0 0 var(--space-2); }
.login-sub { margin: 0 0 var(--space-8); font-size: 0.9rem; }
/* LOGIN-DOCTYPE-01 (#1846) moved these rules once already (out of a <style>
   that preceded the doctype); STYLE-01 moved them again, into main.css. */
.signed-out-notice {
    display: block; margin: 0 0 var(--space-4) 0; padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-emph); border-radius: var(--radius-sm);
    background: var(--bg-elevated); color: var(--text-primary); font-size: 0.85rem; line-height: 1.45; text-align: left;
}
.signed-out-notice strong { display: block; margin-bottom: 0.15rem; color: var(--text-heading); }
/* Google's mark is drawn in its own brand colours (the SVG in login.html);
   the button around it is the light surface Google's guidelines ask for. */
.btn-google {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    padding: var(--space-3) var(--space-6); background: var(--text-heading); color: var(--bg-base);
    font-weight: 600; border-radius: var(--radius-md); text-decoration: none;
    transition: background-color 150ms ease;
}
.btn-google:hover { background: white; }
.btn-google svg { width: 18px; height: 18px; }
.footer-note { margin-top: var(--space-6); font-size: 0.78rem; color: var(--text-muted); }
/* MAGIC-LINK-01 — email login link form. */
.magic-link-divider { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-6) 0; color: var(--text-muted); font-size: 0.8rem; }
.magic-link-divider::before, .magic-link-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.magic-link-form { display: flex; flex-direction: column; gap: var(--space-2); }
.magic-link-input {
    width: 100%; box-sizing: border-box; padding: var(--space-3) var(--space-4);
    background: var(--bg-base); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
    color: var(--text-primary); font-size: 0.9rem; font-family: inherit;
}
.magic-link-input:focus { border-color: var(--accent-bright); }
.btn-magic-link {
    width: 100%; padding: var(--space-3) var(--space-6); cursor: pointer;
    background: transparent; border: 1px solid var(--accent-bright); border-radius: var(--radius-md);
    color: var(--accent-bright); font-weight: 600; font-size: 0.9rem; font-family: inherit;
    transition: background-color 150ms ease, color 150ms ease;
}
.btn-magic-link:hover { background: var(--accent); color: var(--on-accent); }
.magic-link-sent { margin-top: var(--space-4); font-size: 0.85rem; color: var(--accent-bright); }
.magic-link-error { margin-top: var(--space-4); font-size: 0.85rem; color: var(--text-neg); }

/* Beta application (/apply). */
.apply-wrap { max-width: 640px; margin: var(--space-8) auto; }
.apply-card { background-color: var(--bg-raised); background-image: var(--grad-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-8); box-shadow: var(--shadow-card); }
.apply-card .page-header h1 { font-family: var(--font-display); font-weight: 600; color: var(--text-heading); }
.apply-intro { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; margin-bottom: var(--space-6); }
.apply-error {
    background: var(--bg-elevated); border: 1px solid var(--regime-correction); color: var(--text-neg);
    border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); font-size: 0.85rem; margin-bottom: var(--space-4);
}
.apply-q { margin: var(--space-6) 0; }
.apply-q > legend, .apply-label { display: block; color: var(--text-heading); font-weight: 600; font-size: 0.95rem; margin-bottom: var(--space-2); padding: 0; }
.apply-required { color: var(--text-neg); }
.apply-opt { display: block; color: var(--text-primary); font-size: 0.9rem; margin: 0.35rem 0; cursor: pointer; }
.apply-opt input { margin-right: var(--space-2); }
.apply-input, .apply-textarea {
    width: 100%; box-sizing: border-box; padding: var(--space-2) var(--space-3); margin-top: var(--space-1);
    background: var(--bg-base); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    color: var(--text-heading); font-size: 0.95rem; font-family: inherit;
}
/* The old `outline: none` here removed the WCAG 2.4.7 focus ring on this form;
   the global :focus-visible rule now draws it, and the border still turns green. */
.apply-input:focus, .apply-textarea:focus { border-color: var(--accent-bright); }
.apply-textarea { min-height: 90px; resize: vertical; }
.apply-hint { color: var(--text-muted); font-size: 0.78rem; margin-top: var(--space-1); }
.apply-research-note { color: var(--text-muted); font-size: 0.85rem; margin: var(--space-2) 0 0; }
.apply-submit {
    width: 100%; margin-top: var(--space-6); padding: var(--space-3); cursor: pointer;
    background: var(--accent); border: none; border-radius: var(--radius-md);
    color: var(--on-accent); font-size: 1rem; font-weight: 600; font-family: inherit;
    transition: background-color 150ms ease;
}
.apply-submit:hover { background: var(--accent-hover); }
fieldset.apply-q { border: none; }

/* Headings on the other public pages (FAQ, About, Terms, Privacy, apply
   confirmations) take the display face. */
.faq-title, .legal-page h1, .legal-page h2 { font-family: var(--font-display); color: var(--text-heading); }

/* STYLE-03 — the admin pages' own rules (moved from each template's <style>
   below) are scoped to a wrapper class per page, `.adm-<page>`. The wrapper
   takes no box of its own, so it changes no layout. */
.adm-scope { display: contents; }

/* ===================================================================== */
/* STYLE-03 — admin: admin/data_health.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-data-health (wrapper in the template).          */
/* ===================================================================== */
  .adm-data-health .dh-wrap { max-width: 1120px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
  .adm-data-health .dh-back { color: var(--text-muted); font-size: 0.82rem; text-decoration: none; }
  .adm-data-health .dh-head { display: flex; align-items: flex-start; justify-content: space-between;
             gap: 1rem; margin: 0.5rem 0 1.25rem; }
  .adm-data-health .dh-head h1 { margin: 0; font-size: 1.6rem; }
  .adm-data-health .dh-sub { color: var(--text-muted); font-size: 0.76rem; }
  .adm-data-health .dh-btn { background: var(--bg-raised); border: 1px solid var(--border-strong); color: var(--text-primary);
            border-radius: 6px; padding: 0.35rem 0.7rem; font-size: 0.78rem;
            cursor: pointer; white-space: nowrap; }
  .adm-data-health .dh-btn:hover { background: var(--bg-elevated); }
  .adm-data-health .dh-btn-clean { border-color: var(--border-pos); color: var(--text-pos); }
  .adm-data-health .dh-btn-danger { border-color: var(--border-neg); color: var(--text-neg); margin-left: 0.35rem; }
  .adm-data-health .dh-sec { border-top: 1px solid var(--border); margin-top: 1.75rem; padding-top: 1rem; }
  .adm-data-health .dh-sec:first-of-type { border-top: none; }
  .adm-data-health .dh-sec-head { display: flex; align-items: baseline; justify-content: space-between;
                 margin-bottom: 0.6rem; }
  .adm-data-health .dh-label { color: var(--text-muted); font-size: 0.7rem; letter-spacing: 0.08em;
              text-transform: uppercase; }
  .adm-data-health .dh-box { background: var(--bg-base); border: 1px solid var(--border); border-radius: 8px;
            overflow: hidden; }
  .adm-data-health .dh-stats { display: grid; grid-template-columns: repeat(4, 1fr);
              border-bottom: 1px solid var(--border); }
  @media (max-width: 760px) { .adm-data-health .dh-stats { grid-template-columns: repeat(2, 1fr); } }
  .adm-data-health .dh-stat { padding: 0.7rem 1rem; border-right: 1px solid var(--border); }
  .adm-data-health .dh-stat .k { color: var(--text-muted); font-size: 0.72rem; }
  .adm-data-health .dh-stat .v { font-size: 1.25rem; font-weight: 600; margin-top: 0.1rem; }
  .adm-data-health .dh-stat .v.amber { color: var(--text-warn); }
  .adm-data-health .dh-legend { display: flex; gap: 1.1rem; padding: 0.55rem 1rem; font-size: 0.74rem;
               color: var(--text-muted); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
  .adm-data-health .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
         margin-right: 0.35rem; }
  .adm-data-health .dot-issue { background: var(--text-neg); } .adm-data-health .dot-run { background: var(--accent-bright); }
  .adm-data-health .dot-clean { background: var(--text-pos); }
  .adm-data-health table.dh { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
  .adm-data-health table.dh th { text-align: left; color: var(--text-muted); font-weight: 500; font-size: 0.7rem;
                letter-spacing: 0.05em; text-transform: uppercase;
                padding: 0.55rem 1rem; background: var(--bg-raised); }
  .adm-data-health table.dh td { padding: 0.6rem 1rem; border-top: 1px solid var(--border); vertical-align: top; }
  .adm-data-health table.dh tr.dh-extra { display: none; }
  .adm-data-health table.dh.dh-open tr.dh-extra { display: table-row; }
  /* The four row states. */
  .adm-data-health tr.dh-row-clean { background: var(--bg-pos-tint); }
  .adm-data-health tr.dh-row-error { background: var(--bg-warn-tint); }
  .adm-data-health .dh-recheck.dh-clean .dh-detail { color: var(--text-pos); }
  .adm-data-health .dh-right { text-align: right; }
  .adm-data-health .dh-detail { color: var(--text-muted); font-size: 0.7rem; margin-top: 0.2rem; }
  /* HTMX drives the busy state — no JS, and it cannot get stuck. */
  .adm-data-health .dh-busy { display: none; color: var(--accent-bright); }
  .adm-data-health .htmx-request .dh-idle { display: none; }
  .adm-data-health .htmx-request .dh-busy { display: inline; }
  .adm-data-health .htmx-request.dh-btn { border-color: var(--accent-bright); color: var(--accent-bright); }
  .adm-data-health .dh-wait { color: var(--text-muted); padding: 1.1rem 1rem; font-size: 0.85rem; }
  .adm-data-health .dh-more { width: 100%; background: var(--bg-raised); border: none; border-top: 1px solid var(--border);
             color: var(--text-primary); padding: 0.65rem; cursor: pointer; font-size: 0.85rem; }
  .adm-data-health .dh-more:hover { background: var(--bg-raised); }
  /* Unrouted versions — carried from /admin/indicator-status (#771). Amber
     rather than red: an unrouted version is a registration gap to fix, not an
     outage. The section only renders when the list is non-empty. */
  .adm-data-health .dh-unrouted { border-top: 1px solid var(--border); padding: 0.9rem 1rem 1rem;
                 background: var(--bg-warn-tint); }
  .adm-data-health .dh-unrouted-head { color: var(--text-warn); }
  .adm-data-health .dh-unrouted-note { margin: 0.35rem 0 0.6rem; font-size: 0.8rem; line-height: 1.5; }
  .adm-data-health .dh-unrouted-list { margin: 0; padding-left: 1.1rem; font-size: 0.82rem; line-height: 1.7; }
  .adm-data-health .dh-unrouted-list code { color: var(--text-primary); }
  .adm-data-health .dh-pills { display: flex; gap: 0.4rem; padding: 0.7rem 1rem;
              border-bottom: 1px solid var(--border); flex-wrap: wrap; }
  .adm-data-health .dh-pill { background: var(--bg-raised); border: 1px solid var(--border-strong); color: var(--text-primary);
             border-radius: 6px; padding: 0.35rem 0.8rem; font-size: 0.8rem; cursor: pointer; }
  .adm-data-health .dh-pill.active { background: var(--bg-selected); border-color: var(--accent); color: var(--text-heading); }
  .adm-data-health .dh-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
  .adm-data-health .dh-muted { color: var(--text-muted); }
  /* #2010 — price flags: the notice after an action, and the flagged bar in
     the stored-bars table a finding is verified against. No new colours: the
     colour ratchet (#1747) counts them per file. */
  .adm-data-health .dh-note { padding: 0.6rem 1rem; font-size: 0.82rem; font-weight: 600; }
  .adm-data-health .dh-flagged-bar td { font-weight: 700; text-decoration: underline; }
  .adm-data-health .dh-flag-bars { margin-top: 0.35rem; }
  .adm-data-health .dh-ok { color: var(--text-pos); font-size: 0.78rem; }
  .adm-data-health .dh-bad { color: var(--text-neg); font-size: 0.78rem; }
  .adm-data-health .dh-actions { padding: 0.7rem 1rem; border-top: 1px solid var(--border);
                display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
  .adm-data-health .dh-det { margin: 0; }
  .adm-data-health .dh-det > summary { cursor: pointer; color: var(--accent-bright); font-size: 0.78rem;
                      padding: 0.5rem 1rem; border-top: 1px solid var(--border); }
  .adm-data-health .dh-pre { background: var(--bg-base); margin: 0; padding: 0.7rem 1rem; font-size: 0.72rem;
            white-space: pre-wrap; word-break: break-word; max-height: 340px; overflow: auto; }
  .adm-data-health .badge { display: inline-block; padding: 0.1rem 0.45rem; border-radius: 5px;
           font-size: 0.72rem; font-weight: 600; }
  .adm-data-health .badge-pass, .adm-data-health .badge-current, .adm-data-health .badge-dense, .adm-data-health .badge-complete { background: var(--bg-pos-tint); color: var(--text-pos); }
  .adm-data-health .badge-fail, .adm-data-health .badge-stale { background: var(--bg-neg-tint); color: var(--text-neg); }
  .adm-data-health .badge-info, .adm-data-health .badge-blocked, .adm-data-health .badge-thin, .adm-data-health .badge-deficient { background: var(--bg-warn-tint); color: var(--text-warn); }
  /* #960 — `unmeasured` is deliberately NOT green and NOT the same amber as a
     finding. An unknown outranks a finding, so it must not read as either a
     pass or a smaller version of a problem. */
  .adm-data-health .badge-unmeasured { background: var(--border); color: var(--text-muted); }
  .adm-data-health .badge-log { background: var(--bg-raised); color: var(--text-muted); }

  /* DATA-HEALTH-VERDICT-01 — the verdict bar. */
  .adm-data-health .dh-verdict { background: var(--bg-base); border: 1px solid var(--border); border-radius: 8px;
                padding: 0.8rem 1rem; margin: 0 0 1.5rem; }
  .adm-data-health .dh-verdict-line { display: block; font-size: 0.95rem; color: var(--text-primary);
                     line-height: 1.45; }
  .adm-data-health .dh-verdict.state-ok { border-left: 3px solid var(--text-pos); }
  .adm-data-health .dh-verdict.state-warn { border-left: 3px solid var(--text-warn); }
  .adm-data-health .dh-verdict.state-bad { border-left: 3px solid var(--text-neg); }
  .adm-data-health .dh-verdict.state-unknown, .adm-data-health .dh-verdict.state-pending { border-left: 3px solid var(--text-muted); }
  .adm-data-health .dh-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
  .adm-data-health .dh-chip { font-size: 0.72rem; padding: 0.18rem 0.5rem; border-radius: 999px;
             border: 1px solid var(--border-strong); color: var(--text-muted); background: var(--bg-raised);
             white-space: nowrap; }
  .adm-data-health .dh-chip-ok { border-color: var(--border-pos); color: var(--text-pos); }
  .adm-data-health .dh-chip-warn { border-color: var(--border-warn); color: var(--text-warn); }
  .adm-data-health .dh-chip-bad { border-color: var(--border-neg); color: var(--text-neg); }
  .adm-data-health .dh-chip-unknown { border-color: var(--border-strong); color: var(--text-muted); }
  /* Report-only: dashed, and it carries the word. A standing amber nobody must
     act on is how a reader learns to skip amber entirely. */
  .adm-data-health .dh-chip-adv { border-style: dashed; }
  .adm-data-health .dh-chip-flag { font-size: 0.62rem; text-transform: uppercase;
                  letter-spacing: 0.06em; opacity: 0.75; }

/* ===================================================================== */
/* STYLE-03 — admin: admin/command_center.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-command-center (wrapper in the template).          */
/* ===================================================================== */
  .adm-command-center .cc-wrap { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
  .adm-command-center .cc-head { display: flex; align-items: flex-start; justify-content: space-between;
             gap: 1rem; margin-bottom: 1rem; }
  .adm-command-center .cc-head h1 { margin: 0; font-size: 1.6rem; letter-spacing: -0.01em; }
  .adm-command-center .cc-sub { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.2rem; }
  .adm-command-center .cc-actions { display: flex; gap: 0.5rem; }
  .adm-command-center .cc-btn { background: var(--bg-raised); border: 1px solid var(--border-strong); color: var(--text-primary);
            border-radius: 7px; padding: 0.5rem 0.9rem; font-size: 0.85rem;
            cursor: pointer; }
  .adm-command-center .cc-btn:hover { background: var(--bg-elevated); }
  .adm-command-center .cc-label { color: var(--text-muted); font-size: 0.7rem; letter-spacing: 0.08em;
              text-transform: uppercase; margin: 1.5rem 0 0.6rem; }

  /* Status bar */
  .adm-command-center .cc-status { display: flex; align-items: center; justify-content: space-between;
               gap: 1rem; border-radius: 8px; padding: 0.75rem 1rem;
               border: 1px solid; font-size: 0.9rem; }
  .adm-command-center .cc-status.green { background: var(--bg-pos-tint); border-color: var(--border-pos); color: var(--text-pos); }
  .adm-command-center .cc-status.amber { background: var(--bg-warn-tint); border-color: var(--border-warn); color: var(--text-warn); }
  .adm-command-center .cc-status.red { background: var(--bg-neg-tint); border-color: var(--border-neg); color: var(--text-neg); }
  .adm-command-center .cc-status .meta { color: var(--text-muted); font-size: 0.82rem; }
  .adm-command-center .cc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
            background: currentColor; margin-right: 0.5rem; }

  /* External gauges */
  .adm-command-center .cc-gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
  @media (max-width: 820px) { .adm-command-center .cc-gauges { grid-template-columns: 1fr; } }
  .adm-command-center .cc-gauge { background-color: var(--bg-base); background-image: var(--grad-card); border: 1px solid var(--border); border-top: 2px solid var(--border-pos);
              border-radius: 8px; padding: 0.75rem 0.9rem; }
  .adm-command-center .cc-gauge.amber { border-top-color: var(--border-warn); }
  .adm-command-center .cc-gauge.red { border-top-color: var(--border-neg); }
  .adm-command-center .cc-gauge-top { display: flex; align-items: center; justify-content: space-between; }
  .adm-command-center .cc-gauge-name { font-weight: 600; margin-top: 0.3rem; }
  .adm-command-center .cc-gauge-meta { color: var(--text-muted); font-size: 0.76rem; margin-top: 0.2rem; }
  .adm-command-center .cc-badge { font-size: 0.72rem; font-weight: 600; }
  .adm-command-center .cc-badge.green { color: var(--text-pos); } .adm-command-center .cc-badge.amber { color: var(--text-warn); }
  .adm-command-center .cc-badge.red { color: var(--text-neg); }

  /* Internal panels */
  .adm-command-center .cc-panel { background: var(--bg-base); border: 1px solid var(--border); border-top: 2px solid var(--border-pos);
              border-radius: 8px; margin-bottom: 1rem; overflow: hidden; }
  .adm-command-center .cc-panel.amber { border-top-color: var(--border-warn); } .adm-command-center .cc-panel.red { border-top-color: var(--border-neg); }
  .adm-command-center .cc-panel-head { display: flex; align-items: flex-start; justify-content: space-between;
                   padding: 0.8rem 1rem; gap: 1rem; }
  .adm-command-center .cc-panel-head h2 { margin: 0; font-size: 1rem; }
  .adm-command-center .cc-panel-head .sub { color: var(--text-muted); font-size: 0.76rem; margin-top: 0.15rem; }
  .adm-command-center .cc-metrics { display: grid; grid-template-columns: repeat(3, 1fr);
                border-top: 1px solid var(--border); }
  @media (max-width: 820px) { .adm-command-center .cc-metrics { grid-template-columns: repeat(2, 1fr); } }
  .adm-command-center .cc-metric { padding: 0.7rem 1rem; border-right: 1px solid var(--border);
               border-bottom: 1px solid var(--border); }
  .adm-command-center .cc-metric .k { color: var(--text-muted); font-size: 0.74rem; }
  .adm-command-center .cc-metric .v { font-size: 1.35rem; font-weight: 600; margin: 0.1rem 0; }
  .adm-command-center .cc-metric .n { color: var(--text-muted); font-size: 0.72rem; }
  .adm-command-center .cc-metric .v.green { color: var(--text-pos); } .adm-command-center .cc-metric .v.amber { color: var(--text-warn); }
  .adm-command-center .cc-metric .v.red { color: var(--text-neg); }

  .adm-command-center .cc-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
  .adm-command-center .cc-table th { text-align: left; color: var(--text-muted); font-weight: 500; font-size: 0.7rem;
                 letter-spacing: 0.05em; text-transform: uppercase;
                 padding: 0.55rem 1rem; background: var(--bg-raised); }
  .adm-command-center .cc-table td { padding: 0.55rem 1rem; border-top: 1px solid var(--border); }
  .adm-command-center .cc-table tr.cc-extra { display: none; }
  .adm-command-center .cc-table.cc-open tr.cc-extra { display: table-row; }
  .adm-command-center .cc-more { width: 100%; background: var(--bg-raised); border: none; border-top: 1px solid var(--border);
             color: var(--text-primary); padding: 0.65rem; cursor: pointer; font-size: 0.85rem; }
  .adm-command-center .cc-more:hover { background: var(--bg-raised); }
  .adm-command-center .cc-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
  .adm-command-center .cc-muted { color: var(--text-muted); }
  .adm-command-center .cc-err { color: var(--text-neg); padding: 0.7rem 1rem; font-size: 0.82rem; }
  .adm-command-center .cc-wait { color: var(--text-muted); padding: 1.1rem 1rem; font-size: 0.85rem; }

  /* Detail cards */
  .adm-command-center .cc-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  @media (max-width: 820px) { .adm-command-center .cc-cards { grid-template-columns: 1fr; } }
  .adm-command-center .cc-card { display: flex; align-items: center; justify-content: space-between;
             background-color: var(--bg-base); background-image: var(--grad-card); border: 1px solid var(--border); border-radius: 8px;
             padding: 0.9rem 1rem; color: inherit; text-decoration: none; }
  .adm-command-center .cc-card:hover { border-color: var(--border-strong); background: var(--bg-raised); }
  .adm-command-center .cc-card h3 { margin: 0 0 0.15rem; font-size: 0.95rem; }
  .adm-command-center .cc-card .sub { color: var(--text-muted); font-size: 0.76rem; }
  .adm-command-center .cc-pill { display: inline-block; background: var(--bg-raised); border: 1px solid var(--border);
             border-radius: 5px; padding: 0.12rem 0.45rem; font-size: 0.7rem;
             color: var(--text-muted); margin: 0.35rem 0.25rem 0 0; }

/* ===================================================================== */
/* STYLE-03 — admin: admin/operations.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-operations (wrapper in the template).          */
/* ===================================================================== */
  .adm-operations .jr-wrap { max-width: 1400px; margin: 0 auto; }
  .adm-operations .jr-sum { display: flex; gap: .75rem; flex-wrap: wrap; margin: .5rem 0 1.25rem; }
  .adm-operations .jr-pill { padding: .3rem .7rem; border-radius: 999px; font-size: .8rem;
             border: 1px solid var(--border); }
  .adm-operations .jr-group { margin-top: 2rem; }
  .adm-operations .jr-group h3 { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem;
                opacity: .7; margin-bottom: .4rem; }
  .adm-operations table.jr { width: 100%; border-collapse: collapse; font-size: .86rem; }
  .adm-operations table.jr th { text-align: left; font-weight: 600; opacity: .65; font-size: .74rem;
                text-transform: uppercase; letter-spacing: .05em;
                padding: .4rem .5rem; border-bottom: 1px solid var(--border); }
  .adm-operations table.jr td { padding: .45rem .5rem; border-bottom: 1px solid rgba(128,128,128,.15);
                vertical-align: top; }
  .adm-operations .dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%;
         margin-right: .45rem; }
  .adm-operations .s-green { background: var(--text-pos); } .adm-operations .s-amber { background: var(--text-warn); }
  .adm-operations .s-red { background: var(--text-neg); } .adm-operations .s-grey { background: var(--text-muted); }
  .adm-operations .bw-btn { font: inherit; font-size: .78rem; padding: .18rem .5rem; margin: 0 .2rem .2rem 0;
            border: 1px solid var(--border-strong); border-radius: 4px; background: var(--border); color: var(--text-primary);
            cursor: pointer; }
  .adm-operations .bw-btn:hover:not([disabled]) { border-color: var(--text-muted); }
  /* OPS-LOG-DRAWERS-01 (#1886) */
  .adm-operations details.jr-drawer { border: 1px solid var(--border); border-radius: 6px;
                      margin: .5rem 0; padding: 0 .75rem; }
  .adm-operations details.jr-drawer > summary { cursor: pointer; padding: .55rem 0; list-style: none;
                                display: flex; gap: .75rem; align-items: baseline; }
  .adm-operations details.jr-drawer > summary::-webkit-details-marker { display: none; }
  .adm-operations details.jr-drawer > summary::before { content: "\25B8"; color: var(--text-muted);
                                        transition: transform .12s; }
  .adm-operations details.jr-drawer[open] > summary::before { transform: rotate(90deg); }
  .adm-operations details.jr-drawer[open] { padding-bottom: .6rem; }
  .adm-operations .jr-drawer-title { font-weight: 600; }
  .adm-operations .jr-drawer-line { color: var(--text-muted); font-size: .82rem; }
  .adm-operations .jr-drawer-alert { border-color: var(--text-neg); }
  .adm-operations .jr-inner-row > td { padding: 0 0 .4rem 2.4rem; border-top: none; }
  .adm-operations details.jr-inner { margin: 0; }
  .adm-operations .jr-bad { color: var(--text-neg); font-weight: 600; }
  .adm-operations #ops-log-alerts:empty { display: none; }
  .adm-operations .jr-log-alert { border: 1px solid var(--text-neg); border-radius: 6px;
                  padding: .5rem .75rem; margin: 0 0 .6rem; }
  .adm-operations .jr-log-alert a { color: var(--focus-ring); }
  .adm-operations .bw-btn:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 1px; }
  .adm-operations .bw-btn[disabled] { opacity: .45; cursor: not-allowed; }
  .adm-operations .bw-danger:not([disabled]) { border-color: var(--border-neg); color: var(--text-neg); }
  .adm-operations .bw-out:not(:empty) { margin-top: .35rem; font-size: .78rem; }
  .adm-operations .s-never { background: var(--text-muted); } .adm-operations .s-idle { background: var(--border-strong);
              border: 1px solid var(--text-muted); }
  .adm-operations .s-unobserved { background: repeating-linear-gradient(45deg,var(--text-muted),var(--text-muted) 2px,var(--border-strong) 2px,var(--border-strong) 4px);
              border: 1px solid var(--text-muted); }
  .adm-operations .mono { font-family: var(--font-mono, monospace); font-size: .78rem; opacity: .85; }
  .adm-operations .why { opacity: .7; font-size: .78rem; }
  .adm-operations .badge { font-size: .68rem; padding: .1rem .4rem; border-radius: 3px;
           border: 1px solid rgba(128,128,128,.4); opacity: .8; }
  .adm-operations .note { opacity: .6; font-size: .76rem; font-style: italic; }
  .adm-operations .warn { border-left: 3px solid var(--text-warn); padding-left: .8rem; margin: 1.5rem 0; }
    /* OPERATIONS-JOB-HISTORY-01 — disclosure with no JavaScript, so there is no
       script that a future refresh could re-run and reset. The checkbox holds
       the state; the sibling row reads it. */
    .adm-operations .jr-toggle { display: none; }
    .adm-operations .jr-chev { cursor: pointer; color: var(--text-muted); user-select: none;
               display: inline-block; transition: transform .12s; }
    .adm-operations .jr-chev:hover { color: var(--text-primary); }
    .adm-operations .jr-toggle:checked + .jr-chev { transform: rotate(90deg); color: var(--accent-bright); }
    .adm-operations .jr-hist-row { display: none; }
    .adm-operations .jr-toggle-cell:has(.jr-toggle:checked) { color: var(--accent-bright); }
    .adm-operations tr.jr-row:has(.jr-toggle:checked) + tr.jr-hist-row { display: table-row; }
    .adm-operations .jr-hist { padding: .5rem .25rem .75rem; }
    .adm-operations .jr-hist-tbl { width: 100%; border-collapse: collapse; font-size: .78rem; }
    /* OPS-SWEEP-01 (#1867) — a failure the job has already recovered from is
       still shown, because hiding it would conceal a flapping job, but it must
       not compete visually with a live one. Dimmed, not coloured: this page is
       already carrying red/amber/green meaning and adding a fourth hue would
       make the legend the thing you have to learn first. */
    .adm-operations .jr-hist-tbl tr.jr-superseded { opacity: .55; }
    .adm-operations .jr-hist-tbl th { text-align: left; color: var(--text-muted); font-weight: 500;
                      padding: .3rem .5rem; background: var(--bg-raised); }
    .adm-operations .jr-hist-tbl td { padding: .3rem .5rem; border-top: 1px solid var(--border);
                      vertical-align: top; }
    .adm-operations .jr-hist-probe { font-size: .78rem; color: var(--text-primary); margin: .2rem 0 .5rem; }
    /* #1186 — what the stage produced, not merely that it ran. */
    .adm-operations .jr-out { color: var(--text-pos); font-size: .74rem; }
    /* #1194 — the audit's three checks, each with its own verdict. */
    .adm-operations .jr-areas { display: flex; flex-direction: column; gap: .15rem; margin: .3rem 0 .1rem; }
    .adm-operations .jr-area { display: flex; align-items: baseline; gap: .5rem; font-size: .74rem; }
    .adm-operations .jr-area-n { color: var(--text-muted); min-width: 9.5rem; }
    .adm-operations .jr-area-c { color: var(--text-primary); font-variant-numeric: tabular-nums; }
    .adm-operations .badge.b-none { background: var(--border); color: var(--text-muted); }
    .adm-operations .b-success, .adm-operations .b-complete, .adm-operations .b-ok { background: var(--bg-pos-tint); color: var(--text-pos); }
    .adm-operations .b-failed, .adm-operations .b-failure, .adm-operations .b-error { background: var(--bg-neg-tint); color: var(--text-neg); }
    /* #1194, EOD half — the steps inside one run. */
    .adm-operations .jr-steps { display: flex; flex-direction: column; gap: .15rem; margin: .3rem 0 .1rem; }
    .adm-operations .jr-step { display: flex; align-items: baseline; gap: .5rem; font-size: .74rem; }
    .adm-operations .jr-step-n { color: var(--text-muted); min-width: 1.2rem; text-align: right;
                 font-variant-numeric: tabular-nums; }
    .adm-operations .jr-step-name { color: var(--text-muted); min-width: 9.5rem; }
    .adm-operations .jr-step-s { color: var(--text-primary); font-variant-numeric: tabular-nums; min-width: 4rem; }
    .adm-operations .jr-step-d { font-size: .72rem; }
    /* AMBER, not green and not red. An interrupted step is not a failure —
       nothing about it went wrong — and it is emphatically not a success. It
       ran until something else killed the stage, and how far it got is
       unknown. Colouring it green is the defect this badge exists to end. */
    .adm-operations .b-interrupted { background: var(--bg-warn-tint); color: var(--text-warn); }
    .adm-operations .b-running { background: var(--bg-elevated); color: var(--accent-bright); }
    /* PIPELINE-PHASE-PROGRESS-01 — only rendered when a total was reported. */
    .adm-operations .jr-prog { display: inline-flex; align-items: center; gap: .4rem; }
    .adm-operations .jr-prog-bar { display: inline-block; width: 5rem; height: .4rem; background: var(--border);
                   border-radius: 2px; overflow: hidden; }
    .adm-operations .jr-prog-bar i { display: block; height: 100%; background: var(--accent-bright); }
    .adm-operations .jr-prog-n { color: var(--text-muted); font-size: .72rem; }
    .adm-operations .jr-prog-p { color: var(--text-primary); font-size: .72rem; min-width: 2.4rem; }
    .adm-operations .err { color: var(--text-neg); font-size: .72rem; }
    /* #1889 — a probe's FINDING, which is not an error: the probe ran and
       reported something. Its own class so it never borrows .err's colour. */
    .adm-operations .jr-finding { font-size: .74rem; }
    .adm-operations .jr-findings, .adm-operations .jr-why { font-size: .72rem; margin-top: .15rem; }
    .adm-operations .jr-findings summary, .adm-operations .jr-why summary { cursor: pointer; color: var(--text-muted); }
    .adm-operations .jr-findings ul { margin: .2rem 0 0 1rem; padding: 0; }
    .adm-operations .jr-why { display: inline-block; margin-left: .4rem; }
  

/* ===================================================================== */
/* STYLE-03 — admin: admin/workbench.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-workbench (wrapper in the template).          */
/* ===================================================================== */
  .adm-workbench .wb-header {
    display: flex; align-items: center; gap: 1rem;
    padding-bottom: 0.6rem; border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
  }
  .adm-workbench .wb-header h1 { margin: 0; font-size: 1.4rem; font-weight: 700; }
  /* STYLE-05 — a <select> is as wide as its longest option, and one strategy's
     display name made the page 1,487px wide at every width. */
  .adm-workbench .wb-strategy-select, .adm-workbench .wb-strategy-select select { max-width: 100%; }
  .adm-workbench .wb-strategy-select { min-width: 0; }  /* a flex item: without this it keeps the select's width */
  .adm-workbench .wb-strategy-select select {
    background: var(--bg-raised); color: var(--text-heading);
    border: 1px solid var(--border); border-radius: 0.35rem;
    padding: 0.35rem 0.6rem;
  }
  .adm-workbench .wb-grid {
    display: grid; grid-template-columns: 360px 1fr; gap: 1.25rem;
    align-items: flex-start;
  }
  @media (max-width: 900px) { .adm-workbench .wb-grid { grid-template-columns: 1fr; } }

  .adm-workbench .wb-panel {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 0.6rem; padding: 1rem;
  }
  .adm-workbench .wb-panel h2 {
    margin: 0 0 0.7rem 0; font-size: 0.95rem; font-weight: 600;
  }

  .adm-workbench .param-group-label {
    font-size: 0.7rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
    margin: 0.75rem 0 0.35rem 0;
  }
  .adm-workbench .param-row { margin-bottom: 0.6rem; }
  .adm-workbench .param-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.4rem;
  }
  .adm-workbench .param-header label { font-size: 0.85rem; color: var(--text-heading); }
  .adm-workbench .param-header input[type="number"], .adm-workbench .param-header input[type="checkbox"] {
    background: var(--bg-raised); color: var(--text-heading);
    border: 1px solid var(--border); border-radius: 0.3rem;
    padding: 0.15rem 0.4rem; text-align: right;
    /* min-width holds 9-digit values like ``500,000,000`` without
       truncation (``min_avg_dollar_volume`` is the loudest case). */
    min-width: 110px;
  }
  .adm-workbench .param-header input[type="checkbox"] { min-width: 0; width: auto; }
  .adm-workbench .param-slider-row {
    /* Range labels widen to 5.5rem each so comma-formatted boundary
       values like ``5,000,000`` and ``500,000,000`` render without
       wrapping or column collapse. */
    display: grid; grid-template-columns: 5.5rem 1fr 5.5rem;
    align-items: center; gap: 0.4rem; font-size: 0.7rem;
    color: var(--text-muted);
  }
  .adm-workbench .param-slider-row input[type="range"] { width: 100%; }
  .adm-workbench .param-min, .adm-workbench .param-max { text-align: center; }

  .adm-workbench .wb-actions {
    display: flex; gap: 0.5rem; flex-wrap: wrap;
    margin-top: 0.85rem; padding-top: 0.7rem;
    border-top: 1px solid var(--border);
  }
  .adm-workbench .btn-primary, .adm-workbench .btn-secondary, .adm-workbench .btn-ghost {
    padding: 0.4rem 0.8rem; border-radius: 0.4rem;
    border: 1px solid var(--border); cursor: pointer;
    font-size: 0.85rem; font-weight: 600;
  }
  .adm-workbench .btn-primary {
    background: var(--accent); color: var(--on-accent); border-color: var(--accent);
  }
  .adm-workbench .btn-primary:disabled, .adm-workbench .btn-secondary:disabled {
    opacity: 0.5; cursor: not-allowed;
  }
  .adm-workbench .btn-secondary { background: var(--bg-raised); color: var(--text-primary); }
  .adm-workbench .btn-ghost { background: transparent; color: var(--text-muted); }

  .adm-workbench .stat-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem;
    margin-bottom: 0.85rem;
  }
  .adm-workbench .stat-card {
    background: var(--bg-raised); border-radius: 0.4rem; padding: 0.6rem 0.7rem;
    text-align: center;
  }
  .adm-workbench .stat-label {
    font-size: 0.7rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
  }
  .adm-workbench .stat-value {
    font-size: 1.25rem; font-weight: 700; margin-top: 0.2rem;
  }
  .adm-workbench .stat-delta {
    font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem;
  }
  .adm-workbench .stat-delta.up { color: var(--text-pos); }
  .adm-workbench .stat-delta.down { color: var(--text-neg); }

  .adm-workbench .error-banner {
    background: var(--bg-neg-tint); border: 1px solid var(--border-neg); color: var(--text-neg);
    border-radius: 0.4rem; padding: 0.6rem 0.8rem; font-size: 0.9rem;
  }
  .adm-workbench .error-banner a { color: var(--text-neg); text-decoration: underline; }

  .adm-workbench .promote-panel {
    border-top: 1px solid var(--border);
    margin-top: 1rem; padding-top: 0.85rem;
  }
  .adm-workbench .promote-panel textarea {
    width: 100%; min-height: 4rem; background: var(--bg-raised); color: var(--text-heading);
    border: 1px solid var(--border); border-radius: 0.4rem;
    padding: 0.5rem; font-size: 0.85rem; box-sizing: border-box;
  }
  .adm-workbench .promote-panel label.checkbox-row {
    display: flex; align-items: center; gap: 0.4rem;
    margin: 0.5rem 0 0.7rem 0; font-size: 0.85rem;
  }
  .adm-workbench .char-count {
    font-size: 0.72rem; color: var(--text-muted); text-align: right;
  }

  /* In-flow overlay (no ``position: fixed`` per spec non-negotiable).
     The wrapper expands to its parent and uses flex centering so the
     modal card sits in the middle of the page body without escaping
     the document flow. */
  .adm-workbench .modal-wrapper {
    min-height: 400px; background: rgba(0, 0, 0, 0.45);
    border-radius: 0.4rem; padding: 1.5rem;
    align-items: center; justify-content: center;
    margin-top: 1rem;
  }
  .adm-workbench .modal-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 0.6rem; padding: 1.25rem; max-width: 560px;
    width: 100%;
  }
  .adm-workbench .modal-card h3 { margin: 0 0 0.7rem 0; }
  .adm-workbench .modal-content { margin: 0.6rem 0; font-size: 0.9rem; }
  .adm-workbench .modal-actions {
    display: flex; gap: 0.5rem; justify-content: flex-end;
    margin-top: 0.85rem;
  }
  .adm-workbench .modal-warning {
    background: var(--bg-warn-tint); color: var(--text-warn); border-radius: 0.35rem;
    padding: 0.5rem 0.7rem; margin: 0.5rem 0; font-size: 0.85rem;
  }

  .adm-workbench .data-table {
    width: 100%; border-collapse: collapse; font-size: 0.85rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 0.4rem; overflow: hidden;
  }
  .adm-workbench .data-table th, .adm-workbench .data-table td {
    padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border);
    text-align: left;
  }
  .adm-workbench .data-table th {
    background: var(--bg-raised); color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.7rem;
  }
  .adm-workbench .data-table tr:last-child td { border-bottom: none; }
  .adm-workbench .status-pill {
    display: inline-block; padding: 0.1rem 0.5rem; border-radius: 9999px;
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  }
  .adm-workbench .status-pending { background: var(--border); color: var(--text-muted); }
  .adm-workbench .status-running { background: var(--bg-elevated); color: var(--text-primary); }
  .adm-workbench .status-success { background: var(--bg-pos-tint); color: var(--text-pos); }
  .adm-workbench .status-failed { background: var(--bg-neg-tint); color: var(--text-neg); }
  .adm-workbench .empty { text-align: center; color: var(--text-muted); font-style: italic; padding: 1rem; }
  .adm-workbench .results-running { color: var(--text-muted); font-style: italic; padding: 0.5rem 0; }

/* ===================================================================== */
/* STYLE-03 — admin: admin/users.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-users (wrapper in the template).          */
/* ===================================================================== */
  .adm-users .users-panel {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 0.4rem; padding: 1rem 1.1rem; margin: 0 0 1rem 0;
  }
  .adm-users .users-meta { color: var(--text-muted); font-size: 0.85rem; }
  .adm-users .users-table {
    width: 100%; border-collapse: collapse; font-size: 0.88rem;
  }
  .adm-users .users-table th, .adm-users .users-table td {
    padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border);
    text-align: left;
  }
  .adm-users .users-table th {
    background: var(--bg-raised); color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.7rem;
  }
  .adm-users .users-table tr:last-child td { border-bottom: none; }
  .adm-users .tier-pill {
    display: inline-block; padding: 0.1rem 0.5rem;
    border-radius: 9999px; font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.03em; text-transform: uppercase;
  }
  .adm-users .tier-admin { background: var(--bg-warn-tint); color: var(--text-warn); }
  .adm-users .tier-custom { background: var(--bg-elevated); color: var(--text-primary); }
  .adm-users .tier-base { background: var(--border); color: var(--text-primary); }
  .adm-users .view-as-btn {
    background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-strong);
    padding: 0.2rem 0.65rem; border-radius: 0.3rem;
    cursor: pointer; font-size: 0.78rem;
  }
  .adm-users .view-as-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
  .adm-users .view-as-note { color: var(--text-muted); font-size: 0.75rem; }
  .adm-users .users-impersonation-status {
    background: var(--bg-warn-subtle); border: 1px solid var(--border-warn);
    color: var(--text-warn); border-radius: 0.4rem;
    padding: 0.55rem 0.85rem; margin: 0 0 0.85rem 0;
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.75rem; font-size: 0.88rem;
  }
  .adm-users .users-impersonation-status a {
    color: var(--text-warn); font-weight: 600; text-decoration: underline;
  }
  /* BILLING-CANCEL-01 (#1697) — billing actions sit under the tier control so
     the destructive one is never adjacent to the routine one. */
  .adm-users .admin-cancel-actions {
    display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.35rem;
  }
  .adm-users .admin-cancel-link {
    font-size: 0.72rem; color: var(--text-muted); text-decoration: underline;
  }
  .adm-users .admin-cancel-link-danger { color: var(--text-neg); }

  /* ADMIN-USER-METRICS-01 — the band above the table. */
  .adm-users .um-band { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
             gap:.75rem; margin:0 0 .5rem; }
  .adm-users .um-card { background:var(--bg-card); border:1px solid var(--border);
             border-radius:.5rem; padding:.7rem .85rem; }
  .adm-users .um-label { font-size:.65rem; text-transform:uppercase; letter-spacing:.06em;
              color:var(--text-muted); font-weight:700; margin-bottom:.3rem; }
  .adm-users .um-big { font-size:1.75rem; font-weight:700; line-height:1.05;
            font-variant-numeric:tabular-nums; }
  .adm-users .um-note { font-size:.72rem; color:var(--text-muted); margin-top:.25rem; }
  .adm-users .um-chips { display:flex; flex-wrap:wrap; gap:.25rem; margin-top:.4rem; }
  .adm-users .um-chip { font-size:.66rem; background:var(--bg-elevated); color:var(--text-primary);
             border-radius:.25rem; padding:.1rem .35rem; }
  .adm-users .um-bar-row { display:flex; align-items:center; gap:.4rem; margin:.18rem 0; }
  .adm-users .um-bar-name { font-size:.7rem; color:var(--text-muted); width:4.6rem;
                 overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .adm-users .um-bar { flex:1; height:10px; }
  .adm-users .um-bar rect { fill:var(--accent-bright); }
  .adm-users .um-bar-val { font-size:.72rem; font-variant-numeric:tabular-nums; width:2.2rem;
                text-align:right; }
  .adm-users .um-spark { width:100%; height:34px; }
  .adm-users .um-spark rect { fill:var(--accent-bright); }
  .adm-users .um-caveat { font-size:.74rem; color:var(--text-muted); margin:0 0 .9rem; }

/* ===================================================================== */
/* STYLE-03 — admin: admin/user_detail.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-user-detail (wrapper in the template).          */
/* ===================================================================== */
  .adm-user-detail .ud-head { display:flex; align-items:baseline; gap:.75rem; flex-wrap:wrap; margin-bottom:.25rem; }
  .adm-user-detail .ud-sub { color:var(--text-muted); font-size:.9rem; margin:0 0 1.25rem; }
  .adm-user-detail .ud-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:1rem; }
  .adm-user-detail .ud-card { background:var(--bg-card); border:1px solid var(--border); border-radius:.5rem;
             padding:.9rem 1rem; }
  .adm-user-detail .ud-card h2 { font-size:.7rem; text-transform:uppercase; letter-spacing:.06em;
                color:var(--text-muted); margin:0 0 .6rem; font-weight:700; }
  .adm-user-detail .ud-kv { display:flex; justify-content:space-between; gap:1rem; padding:.2rem 0;
           font-size:.88rem; border-bottom:1px solid rgba(255,255,255,.04); }
  .adm-user-detail .ud-kv:last-child { border-bottom:0; }
  .adm-user-detail .ud-kv span:last-child { color:var(--text-primary); font-variant-numeric:tabular-nums; }
  .adm-user-detail .ud-big { font-size:1.6rem; font-weight:700; font-variant-numeric:tabular-nums; }
  .adm-user-detail .ud-note { color:var(--text-muted); font-size:.78rem; margin:.4rem 0 0; }
  .adm-user-detail .ud-table { width:100%; border-collapse:collapse; font-size:.84rem; }
  .adm-user-detail .ud-table th { text-align:left; font-size:.66rem; text-transform:uppercase;
                 letter-spacing:.05em; color:var(--text-muted); padding:.3rem .5rem .3rem 0; }
  .adm-user-detail .ud-table td { padding:.3rem .5rem .3rem 0; border-top:1px solid rgba(255,255,255,.05);
                 font-variant-numeric:tabular-nums; }
  .adm-user-detail .ud-unavailable { color:var(--text-warn); font-size:.82rem; }
  .adm-user-detail .ud-empty { color:var(--text-muted); font-size:.82rem; }
  .adm-user-detail .ud-danger { color:var(--text-neg); }
  .adm-user-detail .ud-section { margin-top:1.5rem; }
  .adm-user-detail .ud-name { max-width:16rem; overflow:hidden; text-overflow:ellipsis;
             white-space:nowrap; }

/* ===================================================================== */
/* STYLE-03 — admin: admin/beta_applications.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-beta-applications (wrapper in the template).          */
/* ===================================================================== */
  .adm-beta-applications .ba-tabs { display: flex; gap: 0.5rem; margin: 1rem 0; flex-wrap: wrap; }
  .adm-beta-applications .ba-tab { padding: 0.35rem 0.85rem; border-radius: 999px; text-decoration: none;
    font-size: 0.85rem; color: var(--text-muted); border: 1px solid var(--border-strong); }
  .adm-beta-applications .ba-tab.active { background: var(--bg-selected); color: var(--text-heading); border-color: var(--accent); }
  .adm-beta-applications .ba-answers { color: var(--text-muted); font-size: 0.8rem; }
  .adm-beta-applications .ba-status { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
  .adm-beta-applications .ba-status-pending { color: var(--text-warn); }
  .adm-beta-applications .ba-status-approved { color: var(--text-pos); }
  .adm-beta-applications .ba-status-rejected { color: var(--text-neg); }
  .adm-beta-applications .ba-actions form { display: inline; }
  .adm-beta-applications .ba-code { font-family: ui-monospace, monospace; color: var(--accent-bright); font-size: 0.85rem; }
  /* Fix 2 / BETA-FIX-03 — email at normal body size (no sd-ticker), wrapped. */
  .adm-beta-applications .ba-email { font-size: 0.875rem; word-break: break-all; }
  /* Fix 1 — expandable free-text answers (Q6/Q7). */
  .adm-beta-applications .ba-details summary { cursor: pointer; color: var(--accent-bright); font-size: 0.8rem; }
  .adm-beta-applications .ba-q { color: var(--text-muted); font-size: 0.8rem; font-weight: 600; margin: 0.5rem 0 0.15rem; }
  .adm-beta-applications .ba-a { color: var(--text-primary); font-size: 0.85rem; margin: 0 0 0.35rem; white-space: pre-wrap; }
  .adm-beta-applications .ba-detail-row td { padding-top: 0; border-top: none; }

/* ===================================================================== */
/* STYLE-03 — admin: admin/tier_changes.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-tier-changes (wrapper in the template).          */
/* ===================================================================== */
  .adm-tier-changes .tcl-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
  .adm-tier-changes .tcl-table th, .adm-tier-changes .tcl-table td {
    padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border); text-align: left;
  }
  .adm-tier-changes .tcl-table th {
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.7rem;
  }
  .adm-tier-changes .tcl-src {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    border-radius: 9999px; padding: 0.1rem 0.5rem;
  }
  .adm-tier-changes .tcl-src-admin_manual { background: var(--bg-warn-tint); color: var(--text-warn); }  /* amber  */
  .adm-tier-changes .tcl-src-stripe_webhook { background: var(--bg-elevated); color: var(--text-primary); } /* blue   */
  .adm-tier-changes .tcl-src-system { background: var(--border); color: var(--text-primary); }  /* gray   */

/* ===================================================================== */
/* STYLE-03 — admin: admin/impersonation_log.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-impersonation-log (wrapper in the template).          */
/* ===================================================================== */
  .adm-impersonation-log .log-panel {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 0.4rem; padding: 1rem 1.1rem; margin: 0 0 1rem 0;
  }
  .adm-impersonation-log .log-meta { color: var(--text-muted); font-size: 0.85rem; }
  .adm-impersonation-log .log-table {
    width: 100%; border-collapse: collapse; font-size: 0.85rem;
  }
  .adm-impersonation-log .log-table th, .adm-impersonation-log .log-table td {
    padding: 0.45rem 0.65rem; border-bottom: 1px solid var(--border);
    text-align: left;
  }
  .adm-impersonation-log .log-table th {
    background: var(--bg-raised); color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.7rem;
  }
  .adm-impersonation-log .log-table tr:last-child td { border-bottom: none; }
  .adm-impersonation-log .end-reason { font-size: 0.75rem; letter-spacing: 0.02em; }
  .adm-impersonation-log .er-exit { color: var(--accent-bright); }
  .adm-impersonation-log .er-expired { color: var(--text-warn); }
  .adm-impersonation-log .er-logout { color: var(--text-primary); }
  .adm-impersonation-log .er-active { color: var(--text-neg); }

/* ===================================================================== */
/* Operations: Accounts closing card (#2829), scoped to #ops-closing.      */
/* ===================================================================== */
  #ops-closing .jr-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; margin: 0.4rem 0; }
  #ops-closing .jr-table th { text-align: left; font-size: 0.68rem; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted); padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); }
  #ops-closing .jr-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); }
  #ops-closing .ud-danger { color: var(--text-neg); }

/* ===================================================================== */
/* Sign-in log (admin/sign_ins.html), scoped to .adm-sign-ins.             */
/* ===================================================================== */
  .adm-sign-ins .log-panel {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 0.4rem; padding: 1rem 1.1rem; margin: 0 0 1rem 0; overflow-x: auto;
  }
  .adm-sign-ins .log-meta { color: var(--text-muted); font-size: 0.85rem; }
  .adm-sign-ins .log-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
  .adm-sign-ins .log-table th, .adm-sign-ins .log-table td {
    padding: 0.45rem 0.65rem; border-bottom: 1px solid var(--border); text-align: left;
  }
  .adm-sign-ins .log-table th {
    background: var(--bg-raised); color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.7rem;
  }
  .adm-sign-ins .log-table tr:last-child td { border-bottom: none; }
  .adm-sign-ins .si-kpis { margin: 1rem 0; }
  .adm-sign-ins .si-filters { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0 0 1rem 0; }
  .adm-sign-ins .si-search {
    flex: 1 1 220px; max-width: 320px; padding: 0.4rem 0.6rem; border-radius: 0.35rem;
    border: 1px solid var(--border); background: var(--bg-raised); color: var(--text-primary);
  }
  .adm-sign-ins .si-clear { font-size: 0.85rem; color: var(--text-muted); }
  .adm-sign-ins .si-badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 9999px; font-size: 0.72rem; font-weight: 600; }
  .adm-sign-ins .si-ok { background: var(--bg-pos-tint); color: var(--text-pos); }
  .adm-sign-ins .si-fail { background: var(--bg-neg-tint); color: var(--text-neg); }
  .adm-sign-ins .si-reason { color: var(--text-muted); font-size: 0.8rem; }

/* ===================================================================== */
/* STYLE-03 — admin: admin/landing.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-landing (wrapper in the template).          */
/* ===================================================================== */
  /* Scoped to this page. The card grid is the Strategies-consolidation shape,
     which is the pattern this restructure was chosen to match. */
  .adm-landing .admin-cat { margin-bottom: 32px; }
  .adm-landing .admin-cat-head {
    display: flex; align-items: baseline; gap: 10px;
    margin-bottom: 12px; flex-wrap: wrap;
  }
  .adm-landing .admin-cat-title {
    font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
    font-weight: 600; margin: 0;
  }
  .adm-landing .admin-cat-blurb { font-size: 12px; }

  .adm-landing .admin-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
  }
  /* The whole card is the link — a card whose only clickable part is the title
     invites a click on the description that does nothing. */
  .adm-landing .admin-item-card {
    display: block; padding: 16px; border-radius: 10px;
    border: 1px solid var(--border);
    background-color: var(--bg-raised); background-image: var(--grad-card);
    text-decoration: none; color: inherit;
    transition: border-color .12s;
  }
  .adm-landing .admin-item-card:hover, .adm-landing .admin-item-card:focus-visible { border-color: var(--border-strong); }
  /* Keyboard focus must be visible: this page is a list of eighteen links and
     tabbing through it is a normal way to use it. */
  .adm-landing .admin-item-card:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

  .adm-landing .admin-item-name { display: block; font-weight: 500; margin-bottom: 4px; }
  .adm-landing .admin-item-desc { display: block; font-size: 12px; }

/* ===================================================================== */
/* STYLE-03 — admin: admin/edge_lab.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-edge-lab (wrapper in the template).          */
/* ===================================================================== */
  .adm-edge-lab .el-intro { color: var(--text-muted); font-size: 0.88rem; max-width: 64ch; margin: 0 0 1.2rem; }
  .adm-edge-lab .el-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
  .adm-edge-lab .el-table th, .adm-edge-lab .el-table td { padding: 0.4rem 0.55rem; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
  .adm-edge-lab .el-table th:first-child, .adm-edge-lab .el-table td:first-child, .adm-edge-lab .el-table th.el-left, .adm-edge-lab .el-table td.el-left { text-align: left; }
  .adm-edge-lab .el-table th { color: var(--text-muted); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; }
  .adm-edge-lab .el-num { font-variant-numeric: tabular-nums; }
  .adm-edge-lab .el-empty td { color: var(--text-muted); }
  .adm-edge-lab .el-kind { font-size: 0.75rem; padding: 0.1rem 0.4rem; border-radius: 0.25rem; border: 1px solid var(--border); color: var(--text-muted); }
  .adm-edge-lab .el-note { color: var(--text-muted); font-size: 0.8rem; margin: 1rem 0 0; max-width: 64ch; }
  .adm-edge-lab .el-error { color: var(--text-neg); font-size: 0.88rem; margin: 0 0 1rem; }
  /* #2190, seen 2026-10-13: the links took the browser's dark blue, hard to
     read on this background. They take the page's text colour and keep their
     underline, which is what marks them as links. */
  .adm-edge-lab .el-table a { color: var(--text-primary); }
  /* #2630 — rows the Composer cannot build yet: the board's call-out. */
  .adm-edge-lab .el-gap { border: 1px solid var(--text-neg); border-radius: 0.375rem; padding: 0.5rem 0.875rem; margin: 0 0 1.25rem; font-size: 0.88rem; }
  .adm-edge-lab .el-gap p { margin: 0 0 0.375rem; }
  .adm-edge-lab .el-gap ul { margin: 0; padding-left: 1.25rem; }
  .adm-edge-lab-anchor .el-gap-cell { color: var(--text-neg); font-size: 0.75rem; white-space: nowrap; cursor: help; }
  /* #2190, seen 2026-10-13: the strategies table made the page 3,457px wide in
     a 1,500px window, because no cell could wrap, and the anchors table pushed
     it 138px wide on its own. In BOTH tables the cells of words and the column
     headings wrap; anything still too wide scrolls inside the table's own box,
     not the page. Measured at a 1,500px window on production's rows that day:
     the page is 1,500px and each table is the width of its box. */
  .adm-edge-lab .el-scroll { overflow-x: auto; max-width: 100%; }
  .adm-edge-lab .el-table th { white-space: normal; }
  .adm-edge-lab .el-table td.el-wrap { white-space: normal; min-width: 11rem; }
  .adm-edge-lab .el-table td.el-wrap .el-kind { display: inline-block; white-space: normal; margin-top: 0.2rem; }

/* ===================================================================== */
/* STYLE-03 — admin: admin/edge_lab_anchor.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-edge-lab-anchor (wrapper in the template).          */
/* ===================================================================== */
  .adm-edge-lab-anchor .el-intro { color: var(--text-muted); font-size: 0.88rem; max-width: 64ch; margin: 0 0 1rem; }
  .adm-edge-lab-anchor .el-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
  .adm-edge-lab-anchor .el-table th, .adm-edge-lab-anchor .el-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
  .adm-edge-lab-anchor .el-table th.el-left, .adm-edge-lab-anchor .el-table td.el-left { text-align: left; white-space: normal; }
  .adm-edge-lab-anchor .el-table th { color: var(--text-muted); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; }
  .adm-edge-lab-anchor .el-table th a { color: inherit; text-decoration: none; }
  .adm-edge-lab-anchor .el-table th.el-sorted a { color: var(--text-primary); }
  .adm-edge-lab-anchor .el-num { font-variant-numeric: tabular-nums; }
  .adm-edge-lab-anchor .el-pos { color: var(--text-pos); } .adm-edge-lab-anchor .el-neg { color: var(--text-neg); }
  .adm-edge-lab-anchor .el-controls { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 0.9rem; font-size: 0.82rem; }
  .adm-edge-lab-anchor .el-controls a { padding: 0.2rem 0.55rem; border: 1px solid var(--border); border-radius: 0.3rem; color: var(--text-muted); text-decoration: none; }
  .adm-edge-lab-anchor .el-controls a.active { color: var(--text-primary); border-color: var(--text-muted); }
  .adm-edge-lab-anchor .el-kind { font-size: 0.75rem; padding: 0.1rem 0.4rem; border-radius: 0.25rem; border: 1px solid var(--border); color: var(--text-muted); }
  .adm-edge-lab-anchor .el-note { color: var(--text-muted); font-size: 0.8rem; margin: 1rem 0 0; max-width: 64ch; }
  .adm-edge-lab-anchor .el-error { color: var(--text-neg); font-size: 0.88rem; margin: 0 0 1rem; }
  .adm-edge-lab-anchor .el-made { color: var(--text-pos); text-decoration: none; font-size: 0.78rem; }
  .adm-edge-lab-anchor .el-draft { margin: 0; } .adm-edge-lab-anchor .el-draft button { font-size: 0.75rem; padding: 0.1rem 0.5rem; border: 1px solid var(--border); border-radius: 0.25rem; background: none; color: var(--text-primary); cursor: pointer; }

/* ===================================================================== */
/* STYLE-03 — admin: admin/edge_lab_combined.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-edge-lab-combined (wrapper in the template).          */
/* ===================================================================== */
  .adm-edge-lab-combined .co-intro { color: var(--text-muted); font-size: 0.88rem; max-width: 70ch; margin: 0 0 1rem; }
  .adm-edge-lab-combined .co-deck { border: 1px solid var(--border); border-radius: 0.4rem; padding: 0.8rem; display: grid; gap: 0.8rem; margin: 0 0 0.8rem; }
  .adm-edge-lab-combined .co-row { display: flex; flex-wrap: wrap; gap: 0.7rem 1.2rem; align-items: flex-end; }
  .adm-edge-lab-combined .co-ctl { display: grid; gap: 0.25rem; min-width: 0; }
  .adm-edge-lab-combined .co-ctl > span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
  .adm-edge-lab-combined .co-chips { display: flex; flex-wrap: wrap; gap: 0.25rem; }
  .adm-edge-lab-combined .co-chip { position: relative; }
  .adm-edge-lab-combined .co-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
  .adm-edge-lab-combined .co-chip span { display: inline-block; font-size: 0.78rem; padding: 0.2rem 0.55rem; border: 1px solid var(--border); border-radius: 0.3rem; color: var(--text-muted); cursor: pointer; }
  .adm-edge-lab-combined .co-chip input:checked + span { color: var(--text-primary); border-color: var(--text-muted); font-weight: 600; }
  .adm-edge-lab-combined .co-chip input:focus-visible + span { outline: 2px solid var(--text-muted); outline-offset: 1px; }
  .adm-edge-lab-combined .co-deck select, .adm-edge-lab-combined .co-deck input[type=number], .adm-edge-lab-combined .co-deck input[type=search] { font: inherit; font-size: 0.82rem; padding: 0.25rem 0.4rem; border: 1px solid var(--border); border-radius: 0.3rem; background: transparent; color: var(--text-primary); }
  .adm-edge-lab-combined .co-deck input[type=number] { width: 7rem; }
  /* The open list of a select draws in the page's colours, not the browser's light
     default with muted text (found live 2026-10-15). */
  .adm-edge-lab-combined .co-deck select { color-scheme: dark; background: var(--bg-card); }
  .adm-edge-lab-combined .co-deck select option { background: var(--bg-card); color: var(--text-primary); }
  .adm-edge-lab-combined .co-lvl { display: flex; align-items: center; gap: 0.3rem; }
  .adm-edge-lab-combined .co-lvl b { font-size: 0.78rem; color: var(--text-muted); }
  /* #2753 — one split family at a time, its buckets as their own group; extra filters folded. */
  .adm-edge-lab-combined .co-family { padding: 0.5rem 0.6rem; border-left: 2px solid var(--accent); background: var(--bg-card); border-radius: 0 0.3rem 0.3rem 0; }
  .adm-edge-lab-combined .co-family[hidden] { display: none; }
  .adm-edge-lab-combined .co-line { font-style: normal; text-transform: none; letter-spacing: 0; margin-left: 0.4rem; }
  .adm-edge-lab-combined .co-more > summary { cursor: pointer; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
  .adm-edge-lab-combined .co-apply { border-color: var(--accent); color: var(--accent-bright); font-weight: 600; }
  .adm-edge-lab-combined .co-pending { font-size: 0.78rem; color: var(--accent-bright); align-self: center; }
  .adm-edge-lab-combined .co-btn { font: inherit; font-size: 0.8rem; padding: 0.25rem 0.7rem; border: 1px solid var(--border); border-radius: 0.3rem; background: none; color: var(--text-primary); cursor: pointer; }
  .adm-edge-lab-combined .co-count { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 0.5rem; font-variant-numeric: tabular-nums; }
  .adm-edge-lab-combined .co-count b { color: var(--text-primary); }
  .adm-edge-lab-combined .co-box { overflow: auto; max-height: 72vh; border: 1px solid var(--border); border-radius: 0.4rem; }
  .adm-edge-lab-combined .co-table { border-collapse: collapse; font-size: 0.78rem; width: max-content; min-width: 100%; }
  .adm-edge-lab-combined .co-table th, .adm-edge-lab-combined .co-table td { padding: 0.32rem 0.5rem; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
  .adm-edge-lab-combined .co-table th { position: sticky; top: 0; background: var(--bg-base); color: var(--text-muted); font-weight: 600; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer; }
  .adm-edge-lab-combined .co-table th.co-left, .adm-edge-lab-combined .co-table td.co-left { text-align: left; }
  .adm-edge-lab-combined .co-table td { font-variant-numeric: tabular-nums; }
  .adm-edge-lab-combined .co-lv { font-size: 0.72rem; margin-left: 0.2rem; color: var(--text-primary); }
  .adm-edge-lab-combined .co-pos { color: var(--text-pos); } .adm-edge-lab-combined .co-neg { color: var(--text-neg); }
  .adm-edge-lab-combined .co-v { color: var(--text-muted); font-size: 0.7rem; }
  .adm-edge-lab-combined .co-made { color: var(--text-pos); text-decoration: none; }
  /* #2517 — "new results since this page was drawn" (edge_lab_live.js). */
  .el-live-notice { margin: 0 0 0.75rem; padding: 0.4rem 0.7rem; border: 1px solid var(--accent); border-radius: 0.3rem; color: var(--text-primary); font-size: 0.85rem; }
  /* #2517 — a row new this week, on Combined Output, the anchor page and the board. */
  .adm-edge-lab-combined .co-new,
  .adm-edge-lab-anchor .el-new,
  .adm-edge-lab .el-new { font-size: 0.7rem; font-weight: 600; padding: 0.05rem 0.35rem; border-radius: 0.25rem; color: var(--accent-bright); border: 1px solid var(--accent); white-space: nowrap; }
  .adm-edge-lab-combined .co-draft { margin: 0; display: inline; } .adm-edge-lab-combined .co-draft button { font-size: 0.72rem; padding: 0.05rem 0.45rem; border: 1px solid var(--border); border-radius: 0.25rem; background: none; color: var(--text-primary); cursor: pointer; }
  .adm-edge-lab-combined .co-pager { display: flex; gap: 0.6rem; align-items: center; font-size: 0.82rem; margin: 0.6rem 0 0; }
  .adm-edge-lab-combined .co-pager a { color: var(--text-primary); }
  .adm-edge-lab-combined .co-note { color: var(--text-muted); font-size: 0.8rem; margin: 1rem 0 0; max-width: 75ch; }
  .adm-edge-lab-combined .co-error { color: var(--text-neg); font-size: 0.88rem; margin: 0 0 1rem; }

/* ===================================================================== */
/* STYLE-03 — admin: admin/edge_lab_draft.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-edge-lab-draft (wrapper in the template).          */
/* ===================================================================== */
  .adm-edge-lab-draft .el-intro { color: var(--text-muted); font-size: 0.88rem; max-width: 72ch; margin: 0 0 1rem; }
  .adm-edge-lab-draft .el-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin: 0 0 1rem; }
  .adm-edge-lab-draft .el-table th, .adm-edge-lab-draft .el-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); text-align: left; }
  .adm-edge-lab-draft .el-table th { color: var(--text-muted); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; }
  .adm-edge-lab-draft .el-kind { font-size: 0.75rem; padding: 0.1rem 0.4rem; border-radius: 0.25rem; border: 1px solid var(--border); color: var(--text-muted); }
  .adm-edge-lab-draft .el-sub { font-size: 1rem; margin: 1.2rem 0 0.5rem; }
  .adm-edge-lab-draft .el-list { font-size: 0.88rem; max-width: 80ch; margin: 0 0 1rem 1.1rem; }
  .adm-edge-lab-draft .el-error { color: var(--text-neg); font-size: 0.9rem; margin: 0 0 0.5rem; }
  .adm-edge-lab-draft .el-ok { color: var(--text-pos); font-size: 0.95rem; margin: 0 0 1rem; }

/* ===================================================================== */
/* STYLE-03 — admin: the Issues pages' styles (#2291), moved from the deleted partial admin/partials/_issues_styles.html. The price flags and delisting fragments that moved there from Data Health use its class names, so they are defined again here, from the tokens alone (#1747). Colours */
/* on the tokens, scoped to .adm-issues (wrapper in the template).          */
/* ===================================================================== */
  .adm-issues .dh-wrap { max-width: 1120px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
  .adm-issues .dh-back { color: var(--text-muted); font-size: 0.82rem; text-decoration: none; }
  .adm-issues .dh-head { display: flex; justify-content: space-between; gap: 1rem; margin: 0.5rem 0 1.25rem; }
  .adm-issues .dh-head h1 { margin: 0; font-size: 1.6rem; }
  .adm-issues .dh-sub, .adm-issues .dh-muted { color: var(--text-muted); font-size: 0.76rem; }
  .adm-issues .dh-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; }
  .adm-issues .dh-sec { margin-bottom: 1.25rem; }
  .adm-issues .dh-sec-head { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.4rem; }
  .adm-issues .dh-label { font-weight: 700; font-size: 0.95rem; }
  .adm-issues .dh-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
            overflow-x: auto; }
  .adm-issues .dh-note, .adm-issues .dh-wait { padding: 0.6rem 1rem; font-size: 0.82rem; }
  .adm-issues .dh-bad { color: var(--text-neg); font-size: 0.8rem; }
  .adm-issues .dh-ok { color: var(--text-pos); }
  .adm-issues table.dh { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
  .adm-issues table.dh th, .adm-issues table.dh td { padding: 0.45rem 0.75rem; border-bottom: 1px solid var(--border);
                             text-align: left; vertical-align: top; }
  .adm-issues table.dh th { color: var(--text-muted); font-weight: 600; }
  .adm-issues .dh-right { text-align: right; }
  .adm-issues .dh-btn { background: var(--bg-base); border: 1px solid var(--border); color: var(--text-primary);
            border-radius: 6px; padding: 0.35rem 0.7rem; font-size: 0.78rem; cursor: pointer; }
  .adm-issues .dh-btn-danger { color: var(--text-neg); }
  .adm-issues .badge { display: inline-block; padding: 0.05rem 0.45rem; border-radius: 0.3rem; font-size: 0.7rem;
           border: 1px solid var(--border); }
  .adm-issues .badge-info { color: var(--text-muted); }
  .adm-issues .badge-warning { color: var(--text-warn); background: var(--bg-warn-subtle); }
  .adm-issues details > summary { cursor: pointer; padding: 0.5rem 1rem; font-size: 0.85rem; }
  .adm-issues .is-form { display: grid; gap: 0.5rem; padding: 0.8rem 1rem; max-width: 640px; }
  .adm-issues .is-form label { font-size: 0.8rem; color: var(--text-muted); }
  .adm-issues .is-form input, .adm-issues .is-form select, .adm-issues .is-form textarea {
    background: var(--bg-base); border: 1px solid var(--border); color: var(--text-primary);
    border-radius: 6px; padding: 0.35rem 0.5rem; font-size: 0.85rem; }
  .adm-issues .is-kv { padding: 0.6rem 1rem; font-size: 0.85rem; line-height: 1.7; }
  @media (max-width: 640px) { .adm-issues .dh-head { flex-direction: column; } }

/* ===================================================================== */
/* STYLE-03 — the admin templates' inline style="" attributes, as classes. */
/* u-* hold one or two plain declarations; adm-* name a composite. Each    */
/* declaration is !important ON PURPOSE: these replace inline styles, which */
/* beat every stylesheet rule, and the pages' own scoped rules (.adm-<page> */
/* td, ...) would otherwise override them. Measured: 4 pages had elements   */
/* whose padding, alignment or size changed without it.                     */
/* ===================================================================== */
.adm-aside { margin-left: 0.75rem !important; color: var(--text-muted) !important; }
.adm-bare { padding: 0 !important; border: none !important; }
.adm-btn-danger-tone { border-color: var(--border-neg) !important; color: var(--text-neg) !important; }
.adm-btn-quiet { border-color: var(--border-strong) !important; color: var(--text-muted) !important; background: var(--bg-base) !important; }
.adm-empty-cell { text-align: center !important; color: var(--text-muted) !important; padding: 1rem !important; }
.adm-field-label { display: block !important; margin: 1.25rem 0 0.4rem !important; color: var(--text-primary) !important; }
.adm-input-block { width: 100% !important; box-sizing: border-box !important; padding: 0.6rem 0.75rem !important; font-family: inherit !important; background: var(--bg-card) !important; color: var(--text-primary) !important; border: 1px solid var(--border) !important; border-radius: 6px !important; }
.adm-input-block-sm { width: 100% !important; box-sizing: border-box !important; padding: 0.5rem 0.6rem !important; font-family: inherit !important; background: var(--bg-card) !important; color: var(--text-primary) !important; border: 1px solid var(--border) !important; border-radius: 6px !important; }
.adm-link-block { display: block !important; text-align: center !important; text-decoration: none !important; }
.adm-muted-plain { color: var(--text-muted) !important; font-weight: 400 !important; }
.adm-note { color: var(--text-muted) !important; font-size: 0.85rem !important; margin-bottom: 1rem !important; }
.adm-num-input { width: 70px !important; margin-left: 8px !important; }
.adm-row-between { display: flex !important; justify-content: space-between !important; align-items: center !important; }
.adm-small-muted { font-size: 0.8rem !important; color: var(--text-muted) !important; }
.u-c-accent-bright { color: var(--accent-bright) !important; }
.u-c-text-primary { color: var(--text-primary) !important; }
.u-c-text-neg { color: var(--text-neg) !important; }
.u-c-text-pos { color: var(--text-pos) !important; }
.u-d-inline { display: inline !important; }
.u-fs-0_85rem { font-size: 0.85rem !important; }
.u-fs-0_95rem { font-size: 0.95rem !important; }
.u-fs-1rem { font-size: 1rem !important; }
.u-m-0-0-0_6rem { margin: 0 0 0.6rem !important; }
.u-m-0_2rem-0-0_6rem { margin: .2rem 0 .6rem !important; }
.u-m-0_6rem-0 { margin: .6rem 0 !important; }
.u-m-0_6rem-0-0 { margin: .6rem 0 0 !important; }
.u-mt-0_4rem { margin-top: 0.4rem !important; }
.u-mt-0_6rem { margin-top: .6rem !important; }
.u-mt-0_75rem { margin-top: 0.75rem !important; }
.u-mt-0_8rem { margin-top: 0.8rem !important; }
.u-mt-1_25rem { margin-top: 1.25rem !important; }
.u-mt-1rem { margin-top: 1rem !important; }
.u-mt-2rem { margin-top: 2rem !important; }
.u-p-0 { padding: 0 !important; }
.u-p-0_4rem-1rem-0_6rem { padding: 0.4rem 1rem 0.6rem !important; }
.u-p-0_5rem-1rem-0_9rem { padding: 0.5rem 1rem 0.9rem !important; }
.u-ta-left { text-align: left !important; }
.u-td-none { text-decoration: none !important; }
.u-w-10pct { width: 10% !important; }
.u-w-11pct { width: 11% !important; }
.u-w-12pct { width: 12% !important; }
.u-w-1_2rem { width: 1.2rem !important; }
.u-w-41pct { width: 41% !important; }
.u-w-6pct { width: 6% !important; }

/* ===================================================================== */
/* STYLE-04 — admin: admin_notifications.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-notifications (wrapper in the template).          */
/* ===================================================================== */
  .adm-notifications .nl-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
  }
  .adm-notifications .nl-head { display: flex; justify-content: space-between; align-items: baseline;
             gap: 1rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
  .adm-notifications .nl-sub { color: var(--text-muted); font-size: 0.8rem; }
  .adm-notifications .nl-scope a { color: var(--text-muted); font-size: 0.78rem;
                text-decoration: none; padding: 0.2rem 0.5rem;
                border: 1px solid var(--border); border-radius: 0.3rem; }
  .adm-notifications .nl-scope a.on { color: var(--text-heading); border-color: var(--accent); background: var(--bg-selected); }

  .adm-notifications .nl-grid { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
  .adm-notifications .nl-grid th, .adm-notifications .nl-grid td {
    padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border);
    text-align: right;
  }
  .adm-notifications .nl-grid th:first-child, .adm-notifications .nl-grid td:first-child { text-align: left; }
  .adm-notifications .nl-grid thead th { color: var(--text-muted); font-weight: 600;
                      font-size: 0.72rem; text-transform: uppercase;
                      letter-spacing: 0.04em; }
  .adm-notifications .nl-grid tfoot td { font-weight: 700; border-top: 2px solid var(--border);
                      border-bottom: none; }
  .adm-notifications .nl-n { font-variant-numeric: tabular-nums; }
  .adm-notifications .nl-zero { color: var(--text-muted); opacity: 0.55; }
  .adm-notifications .nl-hot { color: var(--text-neg); font-weight: 700; }

  .adm-notifications .nl-pill { display: inline-block; padding: 0.1rem 0.45rem; border-radius: 0.75rem;
             font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; }
  .adm-notifications .nl-failed { background: var(--bg-neg-tint); color: var(--text-neg); }
  .adm-notifications .nl-pending { background: var(--bg-warn-tint); color: var(--text-warn); }
  .adm-notifications .nl-sent { background: var(--bg-pos-tint); color: var(--text-pos); }
  /* Deliberately neutral — a deliberate non-send is not a fault. */
  .adm-notifications .nl-suppressed { background: var(--bg-elevated); color: var(--text-muted); }

  .adm-notifications .nl-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
  .adm-notifications .nl-table th, .adm-notifications .nl-table td {
    padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border);
    text-align: left; vertical-align: top;
  }
  .adm-notifications .nl-table thead th { color: var(--text-muted); font-weight: 600;
                       font-size: 0.72rem; text-transform: uppercase; }
  .adm-notifications .nl-err { color: var(--text-neg); font-size: 0.76rem; word-break: break-word;
            max-width: 26rem; display: inline-block; }
  .adm-notifications .nl-ev { color: var(--text-muted); font-size: 0.74rem; }
  .adm-notifications .nl-empty { color: var(--text-muted); padding: 1.2rem 0; line-height: 1.6; }
  .adm-notifications .nl-scroll { overflow-x: auto; }
  .adm-notifications .nl-filters { display: flex; gap: 0.5rem; align-items: end; flex-wrap: wrap;
                margin-bottom: 0.7rem; }
  .adm-notifications .nl-filters select { background: var(--bg-raised); color: var(--text-primary);
                       border: 1px solid var(--border); border-radius: 0.3rem;
                       padding: 0.3rem 0.45rem; font: inherit; font-size: 0.8rem; }
  .adm-notifications .nl-filters label { color: var(--text-muted); font-size: 0.72rem;
                      display: block; margin-bottom: 0.15rem; }
  .adm-notifications .nl-btn { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-strong);
            padding: 0.32rem 0.8rem; border-radius: 0.3rem; cursor: pointer;
            font-size: 0.8rem; }

/* ===================================================================== */
/* STYLE-04 — admin: admin_ticker_status.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-ticker-status (wrapper in the template).          */
/* ===================================================================== */
  .adm-ticker-status .ts-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
  }
  .adm-ticker-status .ts-filters {
    display: flex; gap: 0.6rem; align-items: end;
    flex-wrap: wrap;
  }
  .adm-ticker-status .ts-filters label {
    color: var(--text-muted);
    font-size: 0.75rem;
    display: block;
    margin-bottom: 0.2rem;
  }
  .adm-ticker-status .ts-filters input, .adm-ticker-status .ts-filters select {
    background: var(--bg-raised); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 0.3rem;
    padding: 0.35rem 0.5rem; font: inherit;
  }
  .adm-ticker-status .ts-btn {
    background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-strong);
    padding: 0.4rem 0.9rem; border-radius: 0.35rem;
    cursor: pointer; font-size: 0.85rem;
  }
  .adm-ticker-status .ts-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
  .adm-ticker-status .ts-table th, .adm-ticker-status .ts-table td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
  }
  .adm-ticker-status .ts-table th {
    background: var(--bg-raised); color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em; font-size: 0.7rem;
  }
  .adm-ticker-status .ts-status-pill {
    display: inline-block;
    padding: 0.1rem 0.5rem; border-radius: 9999px;
    font-size: 0.7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.03em;
  }
  .adm-ticker-status .ts-status-activated_new { background: var(--bg-pos-tint); color: var(--text-pos); }
  .adm-ticker-status .ts-status-reactivated { background: var(--bg-elevated); color: var(--text-primary); }
  .adm-ticker-status .ts-status-deactivated { background: var(--bg-neg-tint); color: var(--text-neg); }
  .adm-ticker-status .ts-status-below_filter { background: var(--bg-warn-tint); color: var(--text-warn); }
  /* EODHD-SYMBOL-CHANGE-01 — flag-only rename event; distinct violet so it
     reads as "needs review", not an active/inactive state change. */
  .adm-ticker-status .ts-status-symbol_changed { background: var(--bg-warn-tint); color: var(--text-warn); box-shadow: inset 0 0 0 1px var(--border-warn); }
  .adm-ticker-status .ts-snapshot {
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.75rem;
    white-space: pre-wrap; word-break: break-word;
    max-width: 320px;
  }
  .adm-ticker-status .ts-empty {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 1rem;
  }
  /* UNIVERSE-INTEGRITY-01b — grace period + deactivate control. */
  .adm-ticker-status .ts-btn-danger {
    background: var(--bg-neg-tint); color: var(--text-neg); border: 1px solid var(--border-neg);
  }
  .adm-ticker-status .ts-btn-danger:hover { background: var(--bg-neg-strong); color: var(--text-neg); }
  .adm-ticker-status .ts-confirm { display: inline-flex; align-items: center; gap: 0.4rem; }
  .adm-ticker-status .ts-confirm-q { color: var(--text-neg); font-size: 0.8rem; }
  .adm-ticker-status .ts-done { color: var(--text-pos); font-size: 0.8rem; }
  .adm-ticker-status .ts-done-muted { color: var(--text-muted); font-size: 0.8rem; }
  .adm-ticker-status .ts-grace-warn { color: var(--text-warn); font-weight: 600; }
  .adm-ticker-status .ts-grace-soon { color: var(--text-neg); font-weight: 600; }
  .adm-ticker-status .ts-num { text-align: right; font-variant-numeric: tabular-nums; }
  /* BULK-DEACTIVATE-01 — evidence-led candidate panel. */
  .adm-ticker-status .ts-muted { color: var(--text-muted); font-size: 0.78rem; }
  .adm-ticker-status .ts-bulk td, .adm-ticker-status .ts-bulk th { vertical-align: top; }
  .adm-ticker-status .ts-bulk-bar {
    display: flex; align-items: center; gap: 0.8rem; margin-top: 0.7rem;
  }
  .adm-ticker-status .ts-badge {
    display: inline-block; border-radius: 3px; padding: 0 0.35rem;
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em;
    margin-right: 0.35rem;
  }
  .adm-ticker-status .ts-badge-confirmed { background: var(--bg-neg-tint); color: var(--text-neg); }
  .adm-ticker-status .ts-badge-likely { background: var(--bg-warn-tint); color: var(--text-warn); }
  .adm-ticker-status .ts-badge-review { background: var(--bg-elevated); color: var(--text-primary); }
  .adm-ticker-status .ts-confirm-bulk { display: block; }
  .adm-ticker-status .ts-confirm-list { color: var(--text-muted); font-size: 0.8rem; margin: 0.2rem 0 0.6rem 0; }

/* ===================================================================== */
/* STYLE-04 — admin: admin_ticker_universe.html, moved from the template's <style>, colours */
/* on the tokens, scoped to .adm-ticker-universe (wrapper in the template).          */
/* ===================================================================== */
  .adm-ticker-universe .uf-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
  }
  .adm-ticker-universe .uf-card h2 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 0.6rem 0;
  }
  .adm-ticker-universe .uf-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0.4rem 1rem;
    margin-bottom: 0.4rem;
    align-items: center;
  }
  .adm-ticker-universe .uf-row label {
    color: var(--text-muted);
    font-size: 0.85rem;
  }
  .adm-ticker-universe .uf-row .uf-help {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.1rem;
  }
  .adm-ticker-universe .uf-row input {
    background: var(--bg-raised);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 0.3rem;
    padding: 0.35rem 0.5rem;
    width: 160px;
    font: inherit;
  }
  .adm-ticker-universe .uf-preview {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-pos);
  }
  .adm-ticker-universe .uf-preview-error {
    font-size: 0.8rem;
    color: var(--text-neg);
    margin-top: 0.3rem;
    white-space: pre-wrap;
  }
  .adm-ticker-universe .uf-btn-row { margin-top: 0.8rem; display: flex; gap: 0.6rem; }
  .adm-ticker-universe .uf-btn {
    background: var(--bg-elevated); color: var(--text-primary);
    border: 1px solid var(--border-strong);
    padding: 0.4rem 0.9rem; border-radius: 0.35rem;
    cursor: pointer; font-size: 0.85rem;
  }
  .adm-ticker-universe .uf-btn-primary {
    background: var(--bg-pos-tint); color: var(--text-pos); border-color: var(--border-pos);
  }
  .adm-ticker-universe .uf-saved {
    background: var(--bg-pos-tint); color: var(--text-pos);
    border: 1px solid var(--border-pos); border-radius: 0.35rem;
    padding: 0.4rem 0.7rem; font-size: 0.85rem; margin-bottom: 1rem;
  }

/* ===================================================================== */
/* STYLE-04 — the three admin pages outside admin/: inline style as classes. */
/* u-* hold one or two plain declarations; adm-* name a composite. Each    */
/* declaration is !important for the reason given in STYLE-03's block:    */
/* they replace inline styles, which beat the pages' scoped rules.         */
/* ===================================================================== */
.u-mt-0_7rem { margin-top: 0.7rem !important; }
.adm-page-intro { color: var(--text-muted) !important; margin: 0.2rem 0 1rem 0 !important; font-size: 0.9rem !important; }
.adm-page-note { color: var(--text-muted) !important; margin: 0 0 1rem 0 !important; font-size: 0.85rem !important; }
.adm-section-note { color: var(--text-muted) !important; margin: 0 0 0.6rem 0 !important; font-size: 0.8rem !important; }
.adm-section-title { font-size: 1rem !important; margin: 0 0 0.6rem 0 !important; color: var(--text-heading) !important; }
.adm-section-title-tight { font-size: 1rem !important; margin: 0 0 0.3rem 0 !important; color: var(--text-heading) !important; }
.u-w-100px { width: 100px !important; }
.u-w-110px { width: 110px !important; }

/* ===================================================================== */
/* STYLE-05 — phone width (768px and below). After the nav collapses, the */
/* pages still wider than the viewport were held open by their content:   */
/* wide data tables become their own horizontal scroll box (the page stays */
/* at the viewport width; the table scrolls inside itself), rows of stat   */
/* tiles wrap, and form controls and embedded frames cap at the page.     */
/* ===================================================================== */
@media (max-width: 768px) {
  #my-positions-table, .closed-trades-table, .users-table, .yg-table, .sd-table,
  .tcl-table, .log-table, .data-table, .ts-table, .adm-operations table.jr,
  .adm-beta-applications .sd-table {
    display: block; max-width: 100%; overflow-x: auto;
  }
  .sc-row, .sc-stats, .ind-family-tabs { flex-wrap: wrap; }
  .sc-stats { row-gap: 10px; }
  .sd-dot-labels span { min-width: 0; overflow: hidden; }
  select, input, textarea { max-width: 100%; }
  /* Stripe.js injects a hidden metrics iframe at the end of <body>, position:
     fixed at the body's 24px inset and full width, so it ran 24px past the edge. */
  iframe { max-width: 100%; }
  body > iframe[name^="__privateStripeMetricsController"] { left: 0; }
  /* journal filters: the strategy <select> is as wide as its longest option */
  .filters form { flex-wrap: wrap; }
  .filters form label { min-width: 0; max-width: 100%; }
  .filters form select { width: 100%; }
  .adm-ticker-universe .uf-row { grid-template-columns: 1fr; }
  .adm-workbench .wb-grid { grid-template-columns: 1fr; }
  .adm-workbench .wb-grid > * { min-width: 0; }
  .adm-operations table.jr-hist-tbl { display: block; max-width: 100%; overflow-x: auto; }
  .jr-strategy-table { display: block; max-width: 100%; overflow-x: auto; }
  .dashboard-controls { flex-wrap: wrap; }
  /* a stat figure is one unbreakable string ($4,980,555,644,928 on AAPL) */
  .stats-grid { grid-template-columns: 1fr; }
  .sd-note-add-row { flex-wrap: wrap; }
  .sd-note-add-row input[type=text] { min-width: 0; }
}

/* ===================================================================== */
/* STYLE-05 — strategies_console.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-strategies-console (wrapper in the template).            */
/* ===================================================================== */
  .app-strategies-console .sc-head h1 { font-size: 22px; font-weight: 600; margin: 0; }
  .app-strategies-console .sc-sub { color: var(--text-muted, var(--text-muted)); font-size: 13px; margin: 4px 0 22px; }
  .app-strategies-console .sc-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted, var(--text-muted)); margin: 26px 0 10px; }
  .app-strategies-console .sc-row { display: flex; align-items: center; gap: 14px; background: var(--bg-raised);
    border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 8px; }
  .app-strategies-console .sc-row:hover { border-color: var(--border-strong); }
  .app-strategies-console .sc-row.locked { opacity: .55; position: relative; }
  .app-strategies-console .sc-row.locked:hover { opacity: .85; }
  /* STRATEGIES-CONSOLE-TRUTH-01 — was `min-width: 240px`, so a long strategy
     name pushed the stats right and no two rows lined up: Avg R / PF / Win Rate
     started at a different x on every card, which is most of why this page read
     as messy. A fixed basis puts every stat column on the same vertical line.
     `min-width: 0` lets a long name wrap instead of forcing the row wider. */
  .app-strategies-console .sc-name-col { flex: 0 0 33%; min-width: 0; }
  .app-strategies-console .sc-name { overflow-wrap: anywhere; }
  /* Keeps the action buttons on one vertical line whether or not a row carries
     the rotation pill — without it the buttons jog left on every other card. */
  .app-strategies-console .sc-pill-spacer { display: inline-block; width: 86px; }
  /* A ratio computed from a handful of trades is rendered WITHOUT the
     green/red tint. Colour is a verdict, and 'PF 0.00' off one stopped-out
     signal is not a verdict. The number is still shown — this marks its
     weight, it does not hide it. */
  .app-strategies-console .sc-stat-val.provisional { color: var(--text-muted); font-weight: 500; }
  .app-strategies-console .sc-sample { color: var(--text-muted); font-size: 10.5px; margin-top: 2px; }
  .app-strategies-console .sc-legend { color: var(--text-muted); font-size: 11.5px; margin: 10px 0 18px; }
  .app-strategies-console .sc-name { font-weight: 500; font-size: 14.5px; }
  .app-strategies-console .sc-tags { display: flex; gap: 6px; margin-top: 4px; }
  .app-strategies-console .sc-tag { font-size: 10.5px; padding: 2px 7px; border-radius: 5px;
    border: 1px solid var(--border); color: var(--text-muted); }
  .app-strategies-console .sc-tag.universal { color: var(--text-primary); border-color: var(--border-strong); }
  .app-strategies-console .sc-tag.custom { color: var(--text-pos); border-color: var(--border-pos); }
  /* `paused` shares `draft`'s amber by GROUPING the selector rather than
     repeating the two values — one declaration, one place to change it. */
  .app-strategies-console .sc-tag.draft, .app-strategies-console .sc-tag.paused { color: var(--text-warn); border-color: var(--border-warn); }
  .app-strategies-console .sc-tag.testing { color: var(--text-pos); border-color: var(--border); }
  .app-strategies-console .sc-tag.regime { color: var(--text-muted); border-color: var(--border); text-transform: capitalize; }
  .app-strategies-console .sc-stats { display: flex; gap: 26px; flex: 1; min-width: 0; font-size: 13px; }
  .app-strategies-console .sc-stat { min-width: 70px; }
  .app-strategies-console .sc-stat-label { color: var(--text-muted); font-size: 10.5px; text-transform: uppercase;
    letter-spacing: .03em; }
  .app-strategies-console .sc-stat-val { font-weight: 600; margin-top: 2px; }
  .app-strategies-console .sc-stat-val.pos { color: var(--text-pos); }
  .app-strategies-console .sc-stat-val.neg { color: var(--text-neg); }
  .app-strategies-console .sc-pill { font-size: 11.5px; padding: 4px 10px; border-radius: 12px; white-space: nowrap; }
  .app-strategies-console .sc-pill.active { background: var(--bg-pos-tint); color: var(--text-pos); }
  .app-strategies-console .sc-pill.rotation { background: var(--bg-elevated); color: var(--text-primary); }
  .app-strategies-console .sc-pill.draft { background: #2a2438; color: #b48fe0; }
  /* STRATEGIES-CONSOLE-STATE-PILL-01 (#1857) — TOKENS, not literals.
     COLOUR-TOKEN-RATCHET-01 refuses new hardcoded colours, and correctly: a
     literal ignores a theme switch, so a pill added today would stay dark on a
     light ground. `--text-pos` is the existing positive-green token, which is
     the right family — `testing` SCANS, so it is nearer to running than to the
     dormant purple `.draft` wears. */
  .app-strategies-console .sc-pill.testing { background: var(--bg-card); color: var(--text-pos); }
  .app-strategies-console .sc-pill.deactivated, .app-strategies-console .sc-pill.paused { background: var(--bg-warn-tint); color: var(--text-warn); }
  .app-strategies-console .sc-lock { color: var(--text-warn); font-size: 15px; }
  .app-strategies-console .sc-actions { display: flex; gap: 6px; }
  .app-strategies-console .sc-btn { font-size: 12px; padding: 6px 11px; border-radius: 6px; border: 1px solid var(--border);
    background: transparent; color: inherit; cursor: pointer; text-decoration: none; }
  .app-strategies-console .sc-btn:hover { border-color: var(--border-strong); }
  .app-strategies-console .sc-btn.primary { background: var(--bg-elevated); border-color: var(--border-strong); }
  .app-strategies-console .sc-btn.danger { color: var(--text-neg); border-color: var(--border-neg); }
  .app-strategies-console .sc-btn.danger:hover { border-color: var(--border-neg); background: var(--bg-neg-tint); }
  .app-strategies-console .sc-modal { display: none; position: fixed; inset: 0; z-index: 100;
    background: rgba(0,0,0,.6); align-items: center; justify-content: center; }
  .app-strategies-console .sc-modal.open { display: flex; }
  .app-strategies-console .sc-modal-box { background: var(--bg-raised); border: 1px solid var(--border-neg); border-radius: 12px;
    padding: 22px 24px; max-width: 520px; width: calc(100% - 32px); }
  .app-strategies-console .sc-modal-box h2 { font-size: 17px; margin: 0 0 6px; }
  .app-strategies-console .sc-modal-sub { color: var(--text-muted); font-size: 13px; margin: 0 0 16px; }
  .app-strategies-console .sc-kv { display: flex; gap: 9px; font-size: 13px; margin-bottom: 7px; align-items: baseline; }
  .app-strategies-console .sc-x { color: var(--text-neg); } .app-strategies-console .sc-keep { color: var(--text-pos); }
  .app-strategies-console .sc-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
  .app-strategies-console .sc-btn:focus-visible, .app-strategies-console .sc-modal-box button:focus-visible { outline: 2px solid var(--focus-ring);
    outline-offset: 2px; }
  .app-strategies-console .sc-tip-wrap { position: relative; }
  .app-strategies-console .sc-tip { display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
    width: 360px; background: var(--bg-raised); border: 1px solid var(--border-strong); border-radius: 10px;
    padding: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
  .app-strategies-console .sc-row.locked:hover .sc-tip { display: block; }
  .app-strategies-console .sc-tip-title { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
  .app-strategies-console .sc-regime { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; }
  .app-strategies-console .sc-regime-name { width: 70px; color: var(--text-muted); text-transform: capitalize; }
  .app-strategies-console .sc-bar-bg { flex: 1; height: 8px; background: var(--bg-raised); border-radius: 4px; overflow: hidden; }
  .app-strategies-console .sc-bar-fill { height: 100%; border-radius: 4px; }
  .app-strategies-console .sc-regime-r { width: 58px; text-align: right; font-size: 11px; }
  .app-strategies-console .sc-regime-pf { width: 38px; text-align: right; font-weight: 600; }
  .app-strategies-console .sc-thin { font-size: 11px; color: var(--text-muted); font-style: italic; }
  .app-strategies-console .sc-empty { color: var(--text-muted); font-size: 13px; padding: 14px 16px;
    border: 1px dashed var(--border); border-radius: 10px; }
  /* STRATEGY-SCREENS-01 (#2612): Archived link, the history modal, the Archived screen. */
  .app-strategies-console .sc-archived-foot { margin: 28px 0 8px; font-size: 0.9rem; }
  .app-strategies-console .sc-back { display: inline-block; font-size: 13px; margin-bottom: 6px; }
  .app-strategies-console .sc-empty-cell { color: var(--text-muted); text-align: center; padding: 24px 14px; }
  .app-strategies-console .sc-scopes { border: 0; padding: 0; }
  .app-strategies-console .sc-count { color: var(--text-muted); font-variant-numeric: tabular-nums; }
  .app-strategies-console .sc-row-error { flex-basis: 100%; color: var(--text-warn); font-size: 12px; }
  .app-strategies-console .sc-hist-box { max-width: 720px; border-color: var(--border); max-height: calc(100vh - 64px);
    display: flex; flex-direction: column; }
  .app-strategies-console .sc-hist-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
  .app-strategies-console .sc-hist-eyebrow, .app-strategies-console .sc-hist-kind { font-size: 11px; font-weight: 600;
    letter-spacing: .12em; color: var(--text-muted); }
  .app-strategies-console .sc-hist-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .app-strategies-console .sc-chip { font-size: 12px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border-strong);
    background: transparent; color: var(--text-primary); cursor: pointer; }
  .app-strategies-console .sc-chip.is-on { border-color: var(--accent-bright, var(--text-pos)); background: var(--bg-elevated); }
  .app-strategies-console .sc-chip:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
  .app-strategies-console .sc-hist-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
  .app-strategies-console .sc-hist-item { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 12px 0;
    border-top: 1px solid var(--border); }
  .app-strategies-console .sc-hist-when { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
  .app-strategies-console .sc-hist-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
  .app-strategies-console .sc-hist-title { font-weight: 600; color: var(--text-heading, var(--text-primary)); }
  .app-strategies-console .sc-hist-detail { font-size: 13px; margin-top: 2px; }
  .app-strategies-console .sc-hist-who, .app-strategies-console .sc-hist-empty { font-size: 12px; color: var(--text-muted); }
  .app-strategies-console .sc-search { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 10px; }
  .app-strategies-console .sc-search input[type="search"] { flex: 1 1 320px; max-width: 520px; min-height: 40px; padding: 0 12px;
    background: var(--bg-base, transparent); color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: 8px; font: inherit; }
  .app-strategies-console .sc-search input[type="search"]:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
  .app-strategies-console .sc-scopes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; font-size: 12px; }
  .app-strategies-console .sc-scopes input { position: absolute; opacity: 0; width: 1px; height: 1px; }
  .app-strategies-console .sc-scopes label { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border-strong); cursor: pointer; }
  .app-strategies-console .sc-scopes input:checked + label { border-color: var(--accent-bright, var(--text-pos)); background: var(--bg-elevated); }
  .app-strategies-console .sc-scopes input:focus-visible + label { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
  .app-strategies-console .sc-arch-wrap { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
  .app-strategies-console .sc-arch { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 13px; }
  .app-strategies-console .sc-arch th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 10px 14px;
    border-bottom: 1px solid var(--border); }
  .app-strategies-console .sc-arch td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
  .app-strategies-console .sc-arch .num { text-align: right; font-variant-numeric: tabular-nums; }
  .app-strategies-console .sc-arch-conds { font-size: 12px; color: var(--text-muted); }
  .app-strategies-console .sc-arch-why { font-size: 12px; color: var(--text-pos); margin-top: 3px; }
  .app-strategies-console .sc-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0 18px; }
  .app-strategies-console .sc-tile { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
  .app-strategies-console .sc-tile-val { font-size: 28px; font-variant-numeric: tabular-nums; }
  .app-strategies-console .sc-tile-label { font-size: 12px; color: var(--text-muted); }
  @media (max-width: 640px) {
    .app-strategies-console .sc-tiles { grid-template-columns: minmax(0, 1fr); }
    .app-strategies-console .sc-hist-item { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  }

/* ===================================================================== */
/* STYLE-05 — strategies_console_detail.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-strategy-detail (wrapper in the template).            */
/* ===================================================================== */
  .app-strategy-detail .sd-crumb { font-size: 12.5px; color: var(--text-muted); margin-bottom: 10px; }
  .app-strategy-detail .sd-crumb a { color: var(--accent-bright); text-decoration: none; }
  .app-strategy-detail .sd-title-row { display: flex; justify-content: space-between; align-items: flex-start;
    gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
  .app-strategy-detail .sd-title-main { flex: 1 1 360px; min-width: 0; }
  .app-strategy-detail .sd-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
  .app-strategy-detail .sd-head h1 { font-size: 22px; font-weight: 600; margin: 0; }
  .app-strategy-detail .sd-tag { font-size: 11px; padding: 2px 7px; border-radius: 5px;
    border: 1px solid var(--border); color: var(--text-muted); }
  .app-strategy-detail .sd-tag.universal { color: var(--text-primary); border-color: var(--border-strong); }
  .app-strategy-detail .sd-tag.custom { color: var(--text-pos); border-color: var(--border-pos); }
  /* COSTS-01 (#2541) — the after/before costs switch: ONE style for the strategies list,
     the strategy page and the run page (Jason, 2026-11-06: "I can't tell which is active
     without clicking"). Two joined options; the active one is filled. */
  .costs-switch { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; font-size: 12px; }
  .costs-switch-label { color: var(--text-muted); }
  .costs-switch-opt { padding: 3px 11px; border: 1px solid var(--border-strong); color: var(--text-muted);
    text-decoration: none; background: transparent; }
  .costs-switch-opt + .costs-switch-opt { margin-left: -8px; border-left: 0; }
  .costs-switch-opt:first-of-type { border-radius: 5px 0 0 5px; }
  .costs-switch-opt:last-of-type { border-radius: 0 5px 5px 0; }
  .costs-switch-opt:hover { color: var(--text-primary); }
  .costs-switch-opt.is-on { color: #fff; background: var(--accent); border-color: var(--accent); font-weight: 600; }
  /* Composer draws the switch with buttons (#2541, 2026-11-08); they take the link's look. */
  button.costs-switch-opt { font: inherit; cursor: pointer; }
  .costs-switch-note { font-size: 0.7rem; color: var(--text-muted); margin: -4px 0 8px; }
  .app-strategy-detail .sd-sub { color: var(--text-muted); font-size: 13px; margin: 6px 0 0; }
  .app-strategy-detail .sd-behaves { margin: 10px 0 0; max-width: 78ch; }
  .app-strategy-detail .sd-behaves-h { font-size: 12px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
  .app-strategy-detail .sd-behaves p { color: var(--text-muted); font-size: 13px; line-height: 1.5; margin: 0; }
  .app-strategy-detail .sd-built { color: var(--text-primary); background: var(--bg-raised); border: 1px solid var(--border);
    border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
  .app-strategy-detail .sd-built-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 6px 18px; align-items: start; }
  .app-strategy-detail .sd-built-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); margin-bottom: 7px; }
  .app-strategy-detail .sd-chip { display: inline-block; font-size: 12px; padding: 4px 9px; border-radius: 12px;
    background: var(--bg-raised); border: 1px solid var(--border); margin: 0 4px 5px 0; }
  .app-strategy-detail .sd-gate { margin: 0; }
  .app-strategy-detail .sd-gate .sd-chip { margin-bottom: 3px; }
  .app-strategy-detail .sd-params { list-style: none; margin: 0 0 0 10px; padding: 0; font-size: 12px; color: var(--text-muted); }
  .app-strategy-detail .sd-params li { margin: 1px 0; }
  .app-strategy-detail .sd-params b { color: var(--text-primary); font-weight: 500; }
  .app-strategy-detail .sd-card { color: var(--text-primary); background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px;
    padding: 16px 18px; margin-bottom: 14px; }
  .app-strategy-detail .sd-card-title { font-size: 13px; font-weight: 600; margin: 0 0 12px; }
  .app-strategy-detail .sd-card-sub { font-size: 12px; color: var(--text-muted); font-weight: 400; }

  .app-strategy-detail .sd-rl { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; overflow: hidden; }
  .app-strategy-detail .sd-rl.is-primary { border-width: 1.5px; }
  .app-strategy-detail .sd-rl-sum { display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-wrap: wrap; padding: 10px 14px; cursor: pointer; list-style: none; background: var(--bg-raised);
    color: var(--text-primary); }
  .app-strategy-detail .sd-rl-sum::-webkit-details-marker { display: none; }
  .app-strategy-detail .sd-rl.is-primary .sd-rl-sum { background: var(--bg-raised); }
  .app-strategy-detail .sd-rl-left { display: flex; align-items: center; gap: 9px; }
  .app-strategy-detail .sd-rl-swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
  .app-strategy-detail .sd-rl-name { font-size: 13.5px; font-weight: 500; text-transform: capitalize; }
  .app-strategy-detail .sd-rl-primary { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
    color: var(--bg-base); letter-spacing: .03em; }
  .app-strategy-detail .sd-rl-stats { display: flex; align-items: center; gap: 15px; font-size: 12.5px; color: var(--text-muted);
    font-variant-numeric: tabular-nums; }
  .app-strategy-detail .sd-rl-sum::after { content: '\25BE'; color: var(--text-muted); margin-left: 4px; }
  .app-strategy-detail .sd-rl[open] > .sd-rl-sum::after { content: '\25B4'; }
  .app-strategy-detail .sd-rl-body { padding: 4px 14px 10px; }
  .app-strategy-detail .sd-yr { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px;
    padding: 5px 0; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
  .app-strategy-detail .sd-yr-gap { color: var(--text-muted); font-style: italic; }
  .app-strategy-detail .sd-rl-bull .sd-rl-swatch, .app-strategy-detail .sd-rl-bull .sd-rl-primary { background: var(--regime-bull); }
  .app-strategy-detail .sd-rl-sideways .sd-rl-swatch, .app-strategy-detail .sd-rl-sideways .sd-rl-primary { background: var(--regime-sideways); }
  .app-strategy-detail .sd-rl-pullback .sd-rl-swatch, .app-strategy-detail .sd-rl-pullback .sd-rl-primary { background: var(--regime-pullback); }
  .app-strategy-detail .sd-rl-correction .sd-rl-swatch, .app-strategy-detail .sd-rl-correction .sd-rl-primary { background: var(--regime-correction); }
  .app-strategy-detail .sd-rl-bear .sd-rl-swatch, .app-strategy-detail .sd-rl-bear .sd-rl-primary { background: var(--regime-bear); }
  .app-strategy-detail .sd-rl-bull.is-primary { border-color: var(--regime-bull); }
  .app-strategy-detail .sd-rl-sideways.is-primary { border-color: var(--regime-sideways); }
  .app-strategy-detail .sd-rl-pullback.is-primary { border-color: var(--regime-pullback); }
  .app-strategy-detail .sd-rl-correction.is-primary { border-color: var(--regime-correction); }
  .app-strategy-detail .sd-rl-bear.is-primary { border-color: var(--regime-bear); }

  .app-strategy-detail .sd-thin { font-size: 12px; color: var(--text-muted); font-style: italic; }
  .app-strategy-detail .pos { color: var(--text-pos); } .app-strategy-detail .neg { color: var(--text-neg); }
  .app-strategy-detail table.sd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  .app-strategy-detail .sd-scroll { overflow-x: auto; }
  .app-strategy-detail .sd-table th { text-align: right; font-size: 11px; text-transform: uppercase;
    letter-spacing: .04em; color: var(--text-muted); font-weight: 600; padding: 6px 10px;
    border-bottom: 1px solid var(--border); white-space: nowrap; }
  .app-strategy-detail .sd-table td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--border);
    white-space: nowrap; font-variant-numeric: tabular-nums; }
  .app-strategy-detail .sd-table th:first-child, .app-strategy-detail .sd-table td:first-child { text-align: left; }
  .app-strategy-detail .sd-table tr:last-child td { border-bottom: none; }
  .app-strategy-detail .sd-run-link { color: var(--accent-bright); text-decoration: none; }
  /* History beside Edit in Composer (Jason, 2026-11-09): a button that reads as the link. */
  .app-strategy-detail .sd-head-links { display: flex; align-items: baseline; gap: 18px; }
  .app-strategy-detail .sd-link-btn { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
  .app-strategy-detail .sd-n { font-size: 12px; color: var(--text-muted); }
  .app-strategy-detail .sd-stat-grid { display: flex; gap: 10px; flex-wrap: wrap; }
  .app-strategy-detail .sd-stat { flex: 1 1 110px; color: var(--text-primary); background: var(--bg-raised); border: 1px solid var(--border);
    border-radius: 8px; padding: 12px 13px; }
  .app-strategy-detail .sd-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
    color: var(--text-muted); }
  .app-strategy-detail .sd-stat-val { font-size: 19px; font-weight: 700; margin-top: 4px; }
  /* #2080 — two counts in one card: gains on the left, losses on the right. */
  .app-strategy-detail .sd-stat-pair { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
  .app-strategy-detail .sd-stat-pair small { margin-left: 4px; font-size: 11px; font-weight: 500; color: var(--text-muted); }
  /* #1829 — an empty state reads as information, not a missing value. */
  .app-strategy-detail .sd-none-yet-title { margin: 0; font-weight: 600; color: var(--text-primary); }
  .app-strategy-detail .sd-none-yet-body {
    margin: 6px 0 0 0; color: var(--text-muted); font-size: 0.85rem; line-height: 1.5;
    max-width: 62ch;
  }
  .app-strategy-detail .sd-live-regimes { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
  .app-strategy-detail .sd-locked { border: 1px dashed var(--border-warn); background: var(--bg-warn-tint); border-radius: 10px;
    padding: 14px 16px; color: var(--text-warn); font-size: 13px; margin-bottom: 14px; }
  .app-strategy-detail .sd-locked a { color: var(--accent-bright); }
  .app-strategy-detail .sd-empty { color: var(--text-muted); font-size: 12.5px; padding: 10px 0; }
  /* UI-QUICK-FIXES-01 — live matches: In flight + History, first 25 rows, Show all.
     Scoped to .sd-live-table so the run-history links keep their own styling. */
  .app-strategy-detail .sd-subhead { font-size: 12px; font-weight: 600; color: var(--text-primary); margin: 16px 0 6px; }
  .app-strategy-detail .sd-subhead.first { margin-top: 4px; }
  .app-strategy-detail .sd-live-table tr.sd-row-extra { display: none; }
  .app-strategy-detail .sd-live-table.sd-expanded tr.sd-row-extra { display: table-row; }
  .app-strategy-detail .sd-live-table td a { color: inherit; text-decoration: none; }
  .app-strategy-detail .sd-live-table td a:hover { text-decoration: underline; }
  .app-strategy-detail .sd-show-all { background: none; border: none; color: var(--text-primary); font-size: 12px;
    cursor: pointer; padding: 6px 0; }

  .app-strategy-detail .sd-metric { display: flex; gap: 16px; margin-bottom: 10px; font-size: 12.5px; flex-wrap: wrap; }
  .app-strategy-detail .sd-metric label { display: flex; align-items: center; gap: 5px; cursor: pointer; color: var(--text-muted); }
  .app-strategy-detail .sd-dots { position: relative; height: 150px; }
  .app-strategy-detail .sd-dot-base { position: absolute; left: 0; right: 0; height: 1px; background: var(--bg-elevated); }
  .app-strategy-detail .sd-dot-col { position: absolute; top: 0; height: 100%; }
  .app-strategy-detail .sd-dot { position: absolute; left: 50%; width: 9px; height: 9px; border-radius: 50%;
    transform: translate(-50%, -50%); }
  .app-strategy-detail .sd-dot.hollow { width: 7px; height: 7px; border: 1.5px solid var(--border-strong); background: var(--bg-raised); }
  .app-strategy-detail .sd-dot-labels { display: flex; margin-top: 4px; }
  .app-strategy-detail .sd-dot-labels span { flex: 1; text-align: center; font-size: 11px; color: var(--text-muted); }
  .app-strategy-detail .sd-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--text-muted); }
  .app-strategy-detail .sd-legend span { display: inline-flex; align-items: center; gap: 5px; }
  .app-strategy-detail .sd-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
  .app-strategy-detail .sd-version { border-top: 1px solid var(--border); padding: .75rem 0; }
  .app-strategy-detail .sd-version:first-of-type { border-top: 0; }
  .app-strategy-detail .sd-version-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
  .app-strategy-detail .sd-version-n { font-weight: 700; }
  .app-strategy-detail .sd-version-current .sd-version-n { color: var(--accent-bright); }
  .app-strategy-detail .sd-version-built { margin: .4rem 0 .5rem; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
  .app-strategy-detail .sd-rollback, .app-strategy-detail .sd-scoreboard-btn { background: none; border: 0; cursor: pointer; padding: 0; font: inherit; }
  .app-strategy-detail .sd-run-actions { white-space: nowrap; text-align: right; }
  .app-strategy-detail .sd-run-actions > * + * { margin-left: .9rem; }
  .app-strategy-detail .sd-dialog { max-width: 760px; width: calc(100% - 2rem); background: var(--bg-card); color: inherit; border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.25rem; }
  .app-strategy-detail .sd-dialog-head { display: flex; justify-content: space-between; align-items: center; }

/* ===================================================================== */
/* STYLE-05 — backtest_run_console.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-run-console (wrapper in the template).            */
/* ===================================================================== */
  .app-run-console .br-crumb { font-size: 12.5px; color: var(--text-muted); margin-bottom: 10px; }
  .app-run-console .br-crumb a { color: var(--accent-bright); text-decoration: none; }
  .app-run-console .br-head h1 { font-size: 21px; font-weight: 600; margin: 0; }
  .app-run-console .br-sub { color: var(--text-muted); font-size: 13px; margin: 6px 0 20px; }
  .app-run-console .br-years { display: inline-block; font-size: 11.5px; color: var(--text-primary);
    border: 1px solid var(--border-strong); border-radius: 5px; padding: 2px 8px; margin-left: 6px; }
  .app-run-console .br-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px;
    padding: 16px 18px; margin-bottom: 14px; }
  .app-run-console .br-card-title { font-size: 13px; font-weight: 600; margin: 0 0 14px; }
  /* An Edge Lab re-run's page: what it kept, and where its trades are (2026-11-23). */
  .app-run-console .br-rerun { background: var(--bg-warn-tint); border-color: var(--border-warn); }
  .app-run-console .br-rerun p { margin: 0 0 6px; }
  .app-run-console .br-rerun p:last-child { margin: 0; }
  .app-run-console .br-rerun a { color: var(--accent-bright); font-weight: 600; }
  .app-run-console .br-stats { display: flex; gap: 10px; flex-wrap: wrap; }
  .app-run-console .br-stat { flex: 1 1 110px; background: var(--bg-raised); border: 1px solid var(--border);
    border-radius: 8px; padding: 12px 13px; }
  .app-run-console .br-stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em;
    color: var(--text-muted); }
  .app-run-console .br-stat-val { font-size: 20px; font-weight: 700; margin-top: 4px; }
  .app-run-console .br-regimes { display: flex; gap: 10px; flex-wrap: wrap; }
  .app-run-console .br-regime { flex: 1 1 140px; background: var(--bg-raised); border: 1px solid var(--border);
    border-radius: 8px; padding: 11px 12px; }
  .app-run-console .br-regime-name { font-size: 11px; text-transform: capitalize; color: var(--text-muted); }
  .app-run-console .br-regime-top { display: flex; align-items: baseline; gap: 8px; margin-top: 5px; }
  .app-run-console .br-r { font-size: 12.5px; } .app-run-console .br-pf { font-size: 18px; font-weight: 700; }
  .app-run-console .br-n { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
  .app-run-console .br-regime-excluded { font-size: 10.5px; color: var(--text-muted); margin-top: 6px; }
  .app-run-console .br-thin { font-size: 12px; color: var(--text-muted); font-style: italic; }
  /* COSTS-01 (#2541) — the after/before costs switch, as on the strategy page. */
  .app-run-console .pos { color: var(--text-pos); } .app-run-console .neg { color: var(--text-neg); }
  .app-run-console .br-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    margin-bottom: 12px; }
  .app-run-console .br-chip { font-size: 11.5px; padding: 5px 11px; border-radius: 14px; text-decoration: none;
    border: 1px solid var(--border); color: var(--text-muted); }
  .app-run-console .br-chip.on { background: var(--bg-selected); border-color: var(--border-strong); color: var(--text-primary); }
  .app-run-console .br-search { margin-left: auto; display: flex; gap: 6px; }
  .app-run-console .br-pager { display: flex; gap: 10px; align-items: center; justify-content: center;
    margin-top: 12px; font-size: 12px; color: var(--text-muted); }
  .app-run-console .br-pager-off { opacity: 0.4; }
  .app-run-console .br-search input { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px;
    color: inherit; font-size: 12.5px; padding: 5px 9px; width: 130px; }
  .app-run-console .br-search button { font-size: 12px; padding: 5px 11px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg-elevated); color: inherit; cursor: pointer; }
  .app-run-console .br-count { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
  .app-run-console .br-scroll { overflow-x: auto; }
  .app-run-console table.br-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  .app-run-console .br-table th { text-align: right; font-size: 10.5px; text-transform: uppercase;
    letter-spacing: .04em; color: var(--text-muted); font-weight: 600; padding: 6px 9px;
    border-bottom: 1px solid var(--border); white-space: nowrap; }
  .app-run-console .br-table td { text-align: right; padding: 7px 9px; border-bottom: 1px solid var(--border);
    white-space: nowrap; font-variant-numeric: tabular-nums; }
  .app-run-console .br-table th:first-child, .app-run-console .br-table td:first-child { text-align: left; }
  .app-run-console .br-table tr:last-child td { border-bottom: none; }
  .app-run-console .br-empty { color: var(--text-muted); font-size: 13px; padding: 14px 0; }
  /* REGIME-BACKTEST-RUN-01 — the six-view panel. */
  .app-run-console .br-vtabs { display: flex; gap: 4px; flex-wrap: wrap; background: var(--bg-raised); border-radius: 8px;
    padding: 3px; width: fit-content; max-width: 100%; margin-bottom: 14px; }
  .app-run-console .br-vt { border: none; background: transparent; padding: 6px 11px; border-radius: 6px;
    font-size: 12.5px; cursor: pointer; color: var(--text-muted); }
  .app-run-console .br-vt.on { background: var(--bg-selected); color: var(--text-primary); font-weight: 600; }
  .app-run-console .br-vpanel { display: none; } .app-run-console .br-vpanel.on { display: block; }
  .app-run-console .br-chart { position: relative; height: 270px; }
  .app-run-console .br-note { font-size: 11.5px; color: var(--text-muted); margin: 8px 0 0; }
  .app-run-console .br-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-muted); margin-bottom: 8px; }
  .app-run-console .br-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 4px; }
  .app-run-console .br-swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }
  .app-run-console .br-sw-bull { background: var(--regime-bull); } .app-run-console .br-sw-sideways { background: var(--regime-sideways); }
  .app-run-console .br-sw-pullback { background: var(--regime-pullback); } .app-run-console .br-sw-correction { background: var(--regime-correction); }
  .app-run-console .br-sw-bear { background: var(--regime-bear); }
  .app-run-console table.br-mini { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 12.5px; }
  .app-run-console .br-mini th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); font-weight: 600; padding: 5px 9px; }
  .app-run-console .br-mini td { padding: 8px 10px; border-radius: 6px; font-variant-numeric: tabular-nums; }
  .app-run-console .br-mini td.br-cell-empty { background: var(--bg-raised); color: var(--text-muted); }
  .app-run-console table.br-tear { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 18px; }
  .app-run-console .br-tear th { text-align: right; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); font-weight: 600; padding: 6px 9px; border-bottom: 1px solid var(--border); }
  .app-run-console .br-tear td { text-align: right; padding: 7px 9px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
  .app-run-console .br-tear th:first-child, .app-run-console .br-tear td:first-child, .app-run-console .br-tear th:nth-child(2), .app-run-console .br-tear td:nth-child(2) { text-align: left; }
  .app-run-console .br-mix { font-size: 11px; color: var(--text-muted); }
  .app-run-console .br-sub-title { font-size: 12px; color: var(--text-muted); font-weight: 600; margin: 0 0 6px; }
  .app-run-console .br-lb-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-size: 12.5px; }
  .app-run-console .br-lb-t { width: 58px; color: var(--text-muted); }
  .app-run-console .br-lb-bar { flex: 1; background: var(--bg-raised); border-radius: 4px; height: 13px; overflow: hidden; }
  .app-run-console .br-lb-fill { height: 100%; }
  .app-run-console .br-lb-v { width: 120px; text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }
  .app-run-console .br-lb-mid { display: none; } .app-run-console .br-lb.all .br-lb-mid { display: flex; }
  .app-run-console .br-lb-gap { font-size: 11.5px; color: var(--text-muted); margin: 6px 0; }
  .app-run-console .br-lb.all .br-lb-gap { display: none; }
  .app-run-console .br-linkbtn { background: none; border: none; color: var(--accent-bright); cursor: pointer; font-size: 12px; padding: 4px 0; }

/* ===================================================================== */
/* STYLE-05 — pattern_detail.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-pattern-detail (wrapper in the template).            */
/* ===================================================================== */
  /* STRATEGY-MGMT-01: signal detail */
  .app-pattern-detail .sig-back { font-size: 0.85rem; }
  .app-pattern-detail .sig-back a { color: var(--accent-bright); text-decoration: none; }
  .app-pattern-detail .sig-back a:hover { text-decoration: underline; }

  .app-pattern-detail .sig-hero {
    display: grid; grid-template-columns: 1fr auto auto; gap: 1.25rem;
    align-items: center;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 0.6rem; padding: 1.2rem 1.4rem; margin: 0.4rem 0 1.1rem 0;
  }
  .app-pattern-detail .sig-ticker { font-size: 2.3rem; font-weight: 800; line-height: 1; }
  .app-pattern-detail .sig-sub { font-size: 0.92rem; color: var(--text-muted); margin-top: 0.3rem; }
  .app-pattern-detail .sig-score {
    width: 84px; height: 84px; border-radius: 50%;
    background: var(--bg-pos-tint); color: var(--text-pos); display: flex;
    align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.5rem; font-variant-numeric: tabular-nums;
  }
  .app-pattern-detail .sig-badges { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-end; }
  .app-pattern-detail .sig-badges .tier-pill { font-size: 0.75rem; padding: 0.2rem 0.65rem; }

  .app-pattern-detail .sd-card { background: var(--bg-card); border: 1px solid var(--border);
             border-radius: 0.5rem; padding: 1rem 1.2rem; margin-bottom: 1.1rem; }
  .app-pattern-detail .sd-card h3 { font-size: 1rem; font-weight: 700; margin: 0 0 0.65rem 0; }

  .app-pattern-detail .levels-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem;
    margin-bottom: 0.6rem;
  }
  .app-pattern-detail .levels-mini { background: var(--bg-raised); border: 1px solid var(--border);
                 border-radius: 0.4rem; padding: 0.6rem 0.7rem; }
  .app-pattern-detail .levels-mini .lbl { font-size: 0.62rem; text-transform: uppercase;
                      letter-spacing: 0.05em; color: var(--text-muted); }
  .app-pattern-detail .levels-mini .val { font-size: 1.15rem; font-weight: 700;
                      font-variant-numeric: tabular-nums; margin-top: 0.2rem; }
  .app-pattern-detail .levels-math { font-size: 0.85rem; color: var(--text-primary); }
  .app-pattern-detail .levels-math .lbl { color: var(--text-muted); }
  .app-pattern-detail .levels-costs { font-size: 0.8rem; color: var(--text-muted); margin: 0.6rem 0 0; }
  .app-pattern-detail .levels-costs a { margin-left: 0.25rem; }
  /* Chart and trade levels side by side (2026-11-02); stacked when narrow. */
  .app-pattern-detail .sd-chart-row {
    display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1.1rem;
    align-items: start; margin-bottom: 1.1rem;
  }
  .app-pattern-detail .sd-chart-row .sd-card { margin-bottom: 0; }
  .app-pattern-detail .sd-levels-card .levels-grid { grid-template-columns: 1fr; }
  .app-pattern-detail .sd-levels-card .levels-math { display: flex; flex-direction: column; gap: 0.3rem; }
  @media (max-width: 900px) {
    .app-pattern-detail .sd-chart-row { grid-template-columns: 1fr; }
  }

  .app-pattern-detail .factor-row {
    display: flex; gap: 0.6rem; padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
  }
  .app-pattern-detail .factor-row:last-child { border-bottom: none; }
  .app-pattern-detail .factor-check { color: var(--text-pos); font-weight: 700; font-size: 1rem; line-height: 1.5; }
  .app-pattern-detail .factor-headline { font-weight: 600; font-size: 0.92rem; }
  .app-pattern-detail .factor-sub { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.15rem; }

  .app-pattern-detail .regime-line {
    font-size: 0.88rem; color: var(--text-primary); padding: 0.55rem 0.75rem;
    background: var(--bg-raised); border-radius: 0.4rem;
  }
  .app-pattern-detail .regime-line .lbl { color: var(--text-muted); }

  .app-pattern-detail .disclaimer {
    font-size: 0.78rem; color: var(--text-muted);
    background: var(--bg-raised); border-left: 3px solid var(--border-warn);
    padding: 0.5rem 0.7rem; border-radius: 0.35rem; margin-top: 0.7rem;
  }

  .app-pattern-detail .admin-section {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 0.5rem; margin-bottom: 1.1rem; overflow: hidden;
  }
  .app-pattern-detail .admin-section-header {
    background: var(--bg-warn-tint); color: var(--text-warn); padding: 0.5rem 0.85rem;
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
    font-weight: 700;
  }
  .app-pattern-detail .admin-section-body { padding: 1rem 1.2rem; }

  .app-pattern-detail .admin-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
              gap: 0.5rem 1rem; font-size: 0.82rem; }
  .app-pattern-detail .admin-kv .lbl { color: var(--text-muted); font-size: 0.7rem;
                   text-transform: uppercase; letter-spacing: 0.04em; }
  .app-pattern-detail .raw-bar {
    width: 100%; height: 8px; background: var(--border); border-radius: 4px;
    overflow: hidden; margin-top: 0.3rem;
  }
  .app-pattern-detail .raw-bar-fill { height: 100%; background: var(--accent); }
  .app-pattern-detail .dict-kv pre {
    background: var(--bg-raised); border: 1px solid var(--border);
    border-radius: 0.4rem; padding: 0.55rem 0.7rem; font-size: 0.78rem;
    white-space: pre-wrap; margin: 0;
  }
.app-scope { display: contents; }

/* ===================================================================== */
/* STYLE-05 — the app templates' inline style="" attributes, as classes. */
/* u-* hold one or two plain declarations; adm-* name a composite.          */
/* ===================================================================== */
.adm-muted-plain { color: var(--text-muted) !important; font-weight: 400 !important; }
.u-b-1_5px-solid-border-strong { border: 1.5px solid var(--border-strong) !important; }
.u-b-8b93a7 { background: #8b93a7 !important; }
.u-b-b48ef0 { background: #b48ef0 !important; }
.u-b-regime-bear { background: var(--regime-bear) !important; }
.u-b-regime-bull { background: var(--regime-bull) !important; }
.u-b-regime-correction { background: var(--regime-correction) !important; }
.u-b-regime-pullback { background: var(--regime-pullback) !important; }
.u-b-regime-sideways { background: var(--regime-sideways) !important; }
.u-b-text-neg { background: var(--text-neg) !important; }
.u-b-text-pos { background: var(--text-pos) !important; }
.u-c-text-warn { color: var(--text-warn) !important; }
.u-c-text-warn-fw-400 { color: var(--text-warn) !important; font-weight: 400 !important; }
.u-d-flex-ai-center-g-14px { display: flex !important; align-items: center !important; gap: 14px !important; }
.u-d-flex-jc-flex-end-g-0_5rem { display: flex !important; justify-content: flex-end !important; gap: 0.5rem !important; }
.u-d-inline { display: inline !important; }
.u-fs-0_82rem { font-size: 0.82rem !important; }
.u-fs-0_9rem { font-size: 0.9rem !important; }
.u-gtc-repeat-3-1fr { grid-template-columns: repeat(3, 1fr) !important; }
.u-m-0-0-8px { margin: 0 0 8px !important; }
.u-m-6px-0-0 { margin: 6px 0 0 !important; }
.u-mb-8px { margin-bottom: 8px !important; }
.u-mt-0_4rem-fs-0_85rem { margin-top: 0.4rem !important; font-size: 0.85rem !important; }
.u-mt-0_6rem { margin-top: 0.6rem !important; }
.u-mt-0_6rem-fs-0_85rem { margin-top: 0.6rem !important; font-size: 0.85rem !important; }
.u-mt-0_75rem { margin-top: 0.75rem !important; }
.u-mt-0_85rem { margin-top: 0.85rem !important; }
.u-mt-10px-fs-11_5px-c-text-warn { margin-top: 10px !important; font-size: 11.5px !important; color: var(--text-warn) !important; }
.u-mt-6px { margin-top: 6px !important; }
.u-mt-8px { margin-top: 8px !important; }
.u-ox-auto { overflow-x: auto !important; }
.u-x9e9d1d { display: flex !important; justify-content: space-between !important; align-items: flex-start !important; gap: 0.75rem !important; }

/* ===================================================================== */
/* STYLE-05 — workbench/composer.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-composer (wrapper in the template).            */
/* ===================================================================== */
  .app-composer .composer-shell {
    display: grid;
    /* Jason, 2026-11-23: the controls on the left and the chat on the right, side by
       side; the chart is a popup (#composer-chart-dialog). */
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    height: calc(100vh - 5rem);
    padding: 0 1rem;
  }

  /* COMPOSER-BANNER-LAYOUT-01 — full-width banners in a two-column grid.
     ``.composer-shell`` is a grid, and these three banners are DIRECT
     children of it. Without a column span each one claims a single cell,
     so the banner took the left column, the chart took the right, and the
     strategy card was pushed down to row 2 — leaving a screen-height gap
     between the banner and the panel it describes.
     They also had no styling at all: the paused banner rendered as bare
     body text with no background, border or padding, which reads as
     stray copy rather than a status message about the strategy. */
  .app-composer .composer-active-banner, .app-composer .composer-paused-banner, .app-composer .composer-save-error {
    grid-column: 1 / -1;
    padding: 0.7rem 0.95rem;
    border-radius: 0.4rem;
    border: 1px solid var(--border);
    font-size: 0.86rem;
    line-height: 1.5;
  }
  .app-composer .composer-active-banner p, .app-composer .composer-paused-banner p, .app-composer .composer-save-error p { margin: 0; }
  .app-composer .composer-active-banner p + p, .app-composer .composer-paused-banner p + p, .app-composer .composer-save-error p + p { margin-top: 0.3rem; }

  /* Active: amber. It is a constraint — edits will be refused until the
     strategy is demoted — so it reads as something to act on. */
  .app-composer .composer-active-banner {
    background: var(--bg-warn-tint); color: var(--text-warn); border-color: var(--border-warn);
  }
  /* #2527 — the gates, exits and run windows of an active strategy (inert). */
  .app-composer .is-locked { opacity: 0.55; cursor: not-allowed; }
  .app-composer .composer-active-banner #demote-to-draft-btn {
    margin-top: 0.5rem;
  }

  /* Paused: neutral. Editing is ENABLED here, so this states a status
     rather than warning about one. Amber would imply something is wrong
     when the subscriber has just done exactly what they intended. */
  .app-composer .composer-paused-banner {
    background: var(--bg-raised); color: var(--text-primary); border-color: var(--border);
  }

  /* Save error: red, and it persists until resolved. */
  .app-composer .composer-save-error {
    background: var(--bg-neg-tint); color: var(--text-neg); border-color: var(--border-neg);
  }
  /* The JS toggles the ``hidden`` attribute; a bare display rule above
     would defeat it. */
  .app-composer .composer-save-error[hidden] { display: none; }

  /* ---- Left column — chart + toolbar ---- */
  .app-composer .composer-chart-col {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
  }
  .app-composer .composer-chart-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
  }
  .app-composer .composer-chart-toolbar .ticker-badge {
    font-weight: 700;
    font-size: 1rem;
    padding: 0.25rem 0.6rem;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-radius: 0.35rem;
  }
  .app-composer .composer-chart-toolbar .tf-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 0.3rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
  }
  .app-composer .composer-chart-toolbar .tf-btn.active {
    color: var(--text-primary);
    border-color: var(--border-emph);
  }
  .app-composer .composer-chart-toolbar .indicator-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.5rem;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
  }
  .app-composer .composer-chart-toolbar .indicator-pill .close {
    cursor: pointer; opacity: 0.6;
  }
  .app-composer .composer-chart-toolbar .indicator-pill .close:hover { opacity: 1; }
  .app-composer .composer-chart-toolbar .spacer { flex: 1; }
  .app-composer .composer-chart-toolbar .ask-chart-btn {
    background: transparent;
    color: var(--accent-bright);
    border: 1px solid var(--accent-bright);
    border-radius: 0.3rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
  }
  /* #2869 — the "+ indicator" list, under its button. */
  .app-composer .add-ind-wrap { position: relative; display: inline-flex; }
  .app-composer .add-ind-menu {
    position: absolute; top: calc(100% + 0.35rem); left: 0; z-index: 30;
    width: 17rem; max-height: 22rem; display: flex; flex-direction: column;
    background: var(--bg-elevated); border: 1px solid var(--border-emph);
    border-radius: 0.5rem; box-shadow: var(--shadow-card); overflow: hidden;
  }
  .app-composer .add-ind-menu[hidden] { display: none; }
  .app-composer .add-ind-menu input {
    margin: 0.5rem; padding: 0.4rem 0.55rem; font-size: 0.8rem;
    background: var(--bg-card); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 0.35rem;
  }
  .app-composer .add-ind-list { overflow-y: auto; padding: 0 0.35rem 0.4rem; }
  .app-composer .add-ind-group {
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-muted); padding: 0.55rem 0.4rem 0.25rem;
  }
  .app-composer .add-ind-item {
    display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem;
    width: 100%; text-align: left; background: transparent; border: 0; border-radius: 0.3rem;
    padding: 0.35rem 0.45rem; font-size: 0.8rem; color: var(--text-primary); cursor: pointer;
  }
  .app-composer .add-ind-item:hover, .app-composer .add-ind-item:focus-visible {
    background: var(--bg-card); outline: none;
  }
  .app-composer .add-ind-item .add-ind-params { color: var(--text-muted); font-size: 0.75rem; }
  .app-composer .add-ind-note { margin: 0; padding: 0.5rem 0.75rem; font-size: 0.75rem; color: var(--text-muted); border-top: 1px solid var(--border); }
  .app-composer .add-ind-note[hidden] { display: none; }
  .app-composer #composer-chart-wrap {
    flex: 1;
    min-height: 0;
    position: relative;  /* anchor for the placeholder overlay */
  }
  .app-composer #composer-chart {
    width: 100%;
    height: 100%;
    min-height: 0;  /* flex-shrink OK for chart canvas */
  }
  .app-composer #composer-chart-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: #131922;      /* matches the chart layout background */
    color: var(--text-muted);
    /* Never swallow a wheel/drag the chart needs once it is live — the
       element is hidden by then, but a stray pointer event during the
       swap would suppress pan/zoom (UX-02 Fix D). */
    pointer-events: none;
  }
  .app-composer #composer-chart-placeholder .placeholder-text {
    font-size: 0.85rem;
    letter-spacing: 0.01em;
  }
  .app-composer #composer-chart-placeholder.hidden { display: none; }
  /* CHART-POINTERS-01 (#2849) -- what the strategy saw on a match day: rings, numbered
     pills, pattern boxes and the key, over the chart (static/js/tp-indicators.js). */
  .tp-ptr-layer, .tp-ptr-legends { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
  .tp-ptr-ring {
    position: absolute; width: 14px; height: 14px; box-sizing: border-box;
    border: 2px solid; border-radius: 50%; background: var(--bg-raised);
  }
  .tp-ptr-box { position: absolute; box-sizing: border-box; border: 1px dashed; border-radius: 4px; }
  .tp-ptr-pill {
    position: absolute; display: flex; gap: 6px; align-items: center; white-space: nowrap;
    padding: 3px 9px 3px 4px; border: 1px solid; border-radius: 14px;
    background: var(--bg-base); color: var(--text-primary); font-size: 12px; line-height: 1.2;
  }
  .tp-ptr-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%; color: var(--on-accent-bright);
    font-weight: 700; font-size: 11px;
  }
  .tp-ptr-legend {
    position: absolute; left: 10px; display: flex; gap: 8px; font-size: 12px;
    color: var(--text-primary); white-space: nowrap;
  }
  .tp-ptr-legend-name { color: var(--text-primary); }
  .tp-ptr-key {
    position: absolute; left: 12px; top: 12px; z-index: 4; width: 320px; max-height: 60%;
    overflow: auto; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border-strong);
    border-radius: 8px; background: var(--bg-base); display: flex; flex-direction: column;
    gap: 7px; font-size: 12.5px; color: var(--text-primary);
  }
  .tp-ptr-key[hidden] { display: none; }
  .tp-ptr-key-head {
    font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
  }
  .tp-ptr-key-row { display: flex; gap: 8px; align-items: baseline; }
  .tp-ptr-swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
  .tp-ptr-swatch-none { border: 1px solid var(--text-muted); border-radius: 50%; box-sizing: border-box; }
  .tp-ptr-key-text { flex: 1; }
  .tp-ptr-key-note { color: var(--text-muted); }
  .tp-ptr-key-foot { color: var(--text-muted); font-size: 11.5px; }
  .tp-ptr-pass { color: var(--pos-text); }
  .tp-ptr-fail { color: var(--neg-text); }
  .app-composer .what-it-saw-btn[aria-pressed="true"] { color: var(--line-4); border-color: var(--line-4); }

  /* ---- Left column — the strategy's controls (2026-11-23) ---- */
  .app-composer .composer-controls-col {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow-y: auto;
    min-height: 0;
  }
  /* The column scrolls as a whole, so the gate list is no longer capped at 220px. */
  .app-composer .composer-controls-col .composer-gates-panel { max-height: none; overflow: visible; border-bottom: 0; }
  @media (max-width: 900px) {
    .app-composer .composer-shell { grid-template-columns: 1fr; height: auto; }
    .app-composer .composer-conv-col { min-height: 70vh; }
  }

  /* ---- The ticker chart and Against SPY, as popups (2026-11-23) ---- */
  .app-composer .composer-chart-dialog, .app-composer .composer-spy-dialog {
    width: min(1200px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: 0;
    background: var(--bg-raised);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
  }
  .app-composer .composer-chart-dialog { height: min(720px, calc(100vh - 2rem)); }
  .app-composer .composer-chart-dialog[open] { display: flex; }
  .app-composer .composer-chart-dialog .composer-chart-col { flex: 1; border: 0; border-radius: 0; }
  .app-composer .composer-spy-dialog { overflow: auto; padding: 1rem; }
  .app-composer .composer-chart-dialog::backdrop, .app-composer .composer-spy-dialog::backdrop { background: var(--scrim); }
  .app-composer .composer-spy-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
  .app-composer .composer-spy-head h2 { flex: 1; margin: 0; font-size: 1rem; }
  .app-composer .composer-spy-head .tf-btn {
    background: transparent; color: var(--text-muted); border: 1px solid var(--border);
    border-radius: 0.3rem; padding: 0.25rem 0.6rem; font-size: 0.75rem; cursor: pointer;
  }
  .app-composer .composer-chart-dialog .composer-chart-col { width: 100%; min-width: 0; }
  .app-composer .composer-chart-dialog #composer-chart-wrap { width: 100%; }
  /* The run windows (YEAR-GROUPS-01) were never styled; the chart column hid that. */
  .app-composer .yg-slot-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
  .app-composer .yg-slot { display: grid; gap: 0.2rem; flex: 1; min-width: 12rem; font-size: 0.72rem; color: var(--text-muted); }
  .app-composer .yg-slot select {
    background: var(--bg-raised); color: var(--text-heading); border: 1px solid var(--border);
    border-radius: 0.3rem; padding: 0.25rem 0.35rem; font-size: 0.78rem;
  }
  /* #2900 (Jason, 2026-12-02) — the run area as two numbered steps, each saying what it
     does and, when locked, why. */
  .app-composer .run-steps { margin-top: 0.75rem; padding-top: 0.65rem; border-top: 1px solid var(--border); }
  .app-composer .run-steps-title {
    margin: 0 0 0.5rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase; color: var(--text-muted);
  }
  .app-composer .run-step {
    display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: 0.2rem 0.65rem;
    align-items: start; padding: 0.55rem 0; border-bottom: 1px solid var(--border);
  }
  .app-composer .run-step-n {
    display: grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%;
    border: 1px solid var(--accent-bright); color: var(--accent-bright);
    font-size: 0.75rem; font-weight: 700;
  }
  .app-composer .run-step-body { min-width: 0; }
  .app-composer .run-step-head {
    display: flex; flex-wrap: wrap; align-items: end; gap: 0.4rem 0.9rem;
    color: var(--text-heading); font-size: 0.85rem;
  }
  .app-composer .run-step-head .yg-slot-row { flex: 0 1 16rem; }
  .app-composer .run-step-head .yg-slot { min-width: 10rem; }
  .app-composer .run-step-what { margin: 0.25rem 0 0; font-size: 0.78rem; line-height: 1.4; color: var(--text-muted); }
  .app-composer .run-step-state { margin: 0.3rem 0 0; font-size: 0.76rem; color: var(--text-primary); }
  .app-composer .run-step-state:empty { display: none; }
  .app-composer .run-step-state.is-locked { color: var(--text-warn); }
  .app-composer .run-step > button { align-self: center; white-space: nowrap; }
  .app-composer .run-steps .run-steps-finish { justify-content: flex-end; border-top: 0; margin-top: 0.5rem; padding-top: 0; }
  @media (max-width: 600px) {
    .app-composer .run-step { grid-template-columns: 1.6rem minmax(0, 1fr); }
    .app-composer .run-step > button { grid-column: 2; justify-self: start; }
  }

  /* ---- Right column — the conversation ---- */
  .app-composer .composer-conv-col {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
  }
  .app-composer .composer-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--border);
  }
  .app-composer .composer-header input.name {
    flex: 1;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid transparent;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.35rem 0.5rem;
    border-radius: 0.3rem;
  }
  .app-composer .composer-header input.name:hover, .app-composer .composer-header input.name:focus {
    border-color: var(--border);
    outline: none;
  }
  .app-composer .composer-header .direction-badge {
    padding: 0.2rem 0.55rem;
    background: var(--bg-pos-tint);
    color: var(--text-pos);
    border-radius: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
  }

  /* Conversation thread — scrollable, inline tuner cards */
  .app-composer #composer-thread {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1rem 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }
  .app-composer .msg {
    padding: 0.75rem 0.95rem;
    border-radius: 0.4rem;
    line-height: 1.5;
    font-size: 0.9rem;
  }
  .app-composer .msg.claude {
    background: var(--bg-raised);
    border-left: 3px solid var(--accent-bright);
  }
  .app-composer .msg.claude .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 0.3rem;
  }
  /* A reply's paragraphs and bullets (renderReply in workbench_composer.js). */
  /* WB-SESSION-01 (#2475) — a line redrawn from a reopened conversation. */
  .app-composer .msg.replayed { white-space: pre-line; }
  .app-composer .msg.claude .reply p { margin: 0 0 0.6rem; }
  .app-composer .msg.claude .reply ul { margin: 0 0 0.6rem; padding-left: 1.2rem; list-style: disc; }
  .app-composer .msg.claude .reply li { margin: 0 0 0.35rem; }
  .app-composer .msg.claude .reply .reply-wait { color: var(--text-muted); font-style: italic; }
  .app-composer .msg.claude .reply > :last-child { margin-bottom: 0; }
  /* Jason, 2026-11-10 (option A): the reply's buttons on their own line, full size,
     inside the one reply bubble. */
  .app-composer .msg.claude .reply .reply-actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.45rem 0 0.6rem;
  }
  .app-composer .msg.claude .reply li .reply-actions { margin-bottom: 0.2rem; }
  .app-composer .msg.claude .reply .reply-add-gate,
  .app-composer .msg.claude .reply .reply-tune {
    font: inherit; font-size: 0.875rem; font-weight: 600; line-height: 1.2;
    min-height: 2.5rem; padding: 0.5rem 0.9rem; border-radius: 8px; cursor: pointer;
    transition: background-color 150ms, border-color 150ms;
  }
  .app-composer .msg.claude .reply .reply-add-gate {
    color: var(--text-pos); background: transparent; border: 1px solid var(--accent-bright);
  }
  .app-composer .msg.claude .reply .reply-add-gate:hover { background: color-mix(in srgb, var(--accent-bright) 12%, transparent); }
  .app-composer .msg.claude .reply .reply-tune {
    color: var(--text-heading); background: var(--accent); border: 1px solid var(--accent);
  }
  .app-composer .msg.claude .reply .reply-tune:hover:not(:disabled) { background: var(--accent-bright); }
  .app-composer .msg.claude .reply .reply-tune:disabled { opacity: 0.75; cursor: default; }
  .app-composer .msg.claude .reply .reply-add-gate:focus-visible,
  .app-composer .msg.claude .reply .reply-tune:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
  .app-composer .msg.claude .reply .reply-tune-note { font-size: 0.8rem; color: var(--text-muted); }
  .app-composer .msg.user {
    background: var(--bg-elevated);
    align-self: flex-end;
    max-width: 78%;
  }
  .app-composer .msg.notice-blue {
    background: var(--bg-raised);
    border-left: 3px solid var(--border-strong);
    padding: 0.75rem 0.95rem;
  }
  .app-composer .msg.notice-amber {
    background: var(--bg-warn-tint);
    border-left: 3px solid var(--text-warn-bright);
    padding: 0.75rem 0.95rem;
  }
  .app-composer .msg.notice-blue .label, .app-composer .msg.notice-amber .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    margin-bottom: 0.3rem;
  }
  .app-composer .msg.notice-blue .label { color: var(--text-primary); }
  .app-composer .msg.notice-amber .label { color: var(--text-warn-bright); }

  /* COMPOSER-BUBBLE-TIMESTAMPS-01 — when the bubble arrived, in the
     subscriber's SAVED timezone (UI-TIMEZONE-01), not the browser's.
     The header is a flex row so the stamp sits at the right edge of the
     bubble and the label text keeps the left, however long either gets. */
  .app-composer .msg .label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .app-composer .msg .label .label-text {
    min-width: 0;
  }
  .app-composer .msg-stamp {
    /* The header is uppercased and letter-spaced; "3:02:28p" is neither —
       without this it renders "09/04 3:02:28P". */
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    font-size: 0.7rem;
    color: var(--text-muted);
    /* Stamps stack down the thread, so the digits have to line up. */
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex: none;
  }

  /* Tuner cards — inline in conversation */
  .app-composer .tuner-card {
    background: var(--bg-card);
    border: 1px solid var(--border-emph);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
  }
  .app-composer .tuner-card h4 {
    margin: 0 0 0.35rem 0;
    font-size: 0.85rem;
    font-weight: 700;
  }
  .app-composer .tuner-card .progress-dots {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
  }
  .app-composer .tuner-card .slider-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0;
  }
  .app-composer .tuner-card input[type=range] {
    flex: 1;
  }
  .app-composer .tuner-card .val {
    min-width: 60px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 700;
  }
  .app-composer .tuner-card .tradeoff {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
    margin: 0.35rem 0 0.5rem 0;
  }
  .app-composer .tuner-card .actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
  }
  .app-composer .tuner-card button.reset {
    background: transparent;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: 0.3rem;
    padding: 0.25rem 0.55rem;
    font-size: 0.7rem;
    cursor: pointer;
  }
  .app-composer .tuner-card button.confirm {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 0.3rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
  }

  /* Path cards for Entry B blank canvas */
  .app-composer .path-card-inline {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    padding: 0.75rem 0.9rem;
    cursor: pointer;
  }
  .app-composer .path-card-inline:hover { border-color: var(--border-emph); }
  .app-composer .path-card-inline h5 { margin: 0 0 0.2rem 0; font-size: 0.85rem; font-weight: 700; }
  .app-composer .path-card-inline p { margin: 0; color: var(--text-muted); font-size: 0.75rem; }

  /* Input box — directly below conversation, always visible */
  .app-composer .composer-input-row {
    display: flex;
    gap: 0.55rem;
    padding: 0.55rem 0.75rem;
    border-top: 1px solid var(--border);
    background: var(--bg-base);
  }
  .app-composer .composer-input-row input {
    flex: 1;
    background: var(--bg-raised);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.9rem;
  }
  .app-composer .composer-input-row button {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 0.35rem;
    padding: 0 1.1rem;
    font-weight: 600;
    cursor: pointer;
  }

  /* Gates panel — pinned at TOP of the conversation column so the
     subscriber can always see which gate is being tuned and where
     they are in the sequence (WORKBENCH-COMPOSER-UX-02 Fix E). */
  .app-composer .composer-gates-panel {
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-base);
    max-height: 220px;
    overflow-y: auto;
    flex-shrink: 0;
  }
  .app-composer .composer-gates-panel .panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }
  .app-composer .composer-gates-panel .panel-header h4 {
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
  }
  .app-composer .composer-gates-panel .gate-row-wrapper {
    margin-bottom: 0.1rem;
  }
  .app-composer .composer-gates-panel .gate-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.5rem;
    border-radius: 0.3rem;
    font-size: 0.8rem;
    cursor: pointer;
  }
  .app-composer .composer-gates-panel .gate-row:hover {
    background: var(--bg-raised);
  }
  .app-composer .composer-gates-panel .gate-row .state {
    width: 1rem; text-align: center; font-weight: 700;
  }
  .app-composer .composer-gates-panel .gate-row .chev {
    width: 0.9rem; text-align: center; color: var(--text-muted);
    font-size: 0.7rem;
  }
  .app-composer .composer-gates-panel .gate-row.pending { color: var(--text-muted); }
  .app-composer .composer-gates-panel .gate-row.configuring { color: var(--text-primary); background: var(--bg-raised); }
  .app-composer .composer-gates-panel .gate-row.done { color: var(--text-pos); }
  .app-composer .composer-gates-panel .gate-row.expanded { background: var(--bg-raised); }
  .app-composer .composer-gates-panel .gate-row .name { flex: 1; }
  /* WORKBENCH-COMPOSER-UX-02 Fix J — accordion body */
  .app-composer .composer-gates-panel .gate-accordion-body {
    display: none;
    padding: 0.55rem 0.75rem 0.75rem 2.1rem;
    background: var(--bg-raised);
    border-left: 2px solid var(--border-strong);
    margin: 0 0.15rem 0.35rem 0.6rem;
    font-size: 0.8rem;
    color: var(--text-primary);
  }
  .app-composer .composer-gates-panel .gate-accordion-body.open { display: block; }
  .app-composer .composer-gates-panel .gate-accordion-body .slider-row {
    display: flex; align-items: center; gap: 0.55rem; margin-top: 0.3rem;
  }
  .app-composer .composer-gates-panel .gate-accordion-body .slider-row input[type=range] {
    flex: 1;
  }
  .app-composer .composer-gates-panel .gate-accordion-body .slider-row .val {
    font-variant-numeric: tabular-nums; min-width: 5rem; text-align: right;
    color: var(--text-muted);
  }
  .app-composer .composer-gates-panel .gate-accordion-body .tradeoff {
    color: var(--text-muted); font-size: 0.75rem; margin-top: 0.35rem;
  }
  .app-composer .composer-gates-panel .gate-accordion-body .actions {
    display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.55rem;
  }
  .app-composer .composer-gates-panel .gate-accordion-body .actions button {
    background: transparent; color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.3rem 0.7rem; font-size: 0.75rem; cursor: pointer;
    border-radius: 0.3rem;
  }
  .app-composer .composer-gates-panel .gate-accordion-body .actions button.confirm {
    background: var(--bg-pos-tint); color: var(--text-pos); border-color: var(--border-pos);
  }
  .app-composer .composer-gates-panel .gate-accordion-body label {
    display: block; padding: 0.35rem 0; cursor: pointer;
  }
  /* COMPOSER-ADJUST-HELP-01 (#1882) — label, "?" help, and the unit beside
     every adjustable value. The bubble is position:fixed (placed by JS) so the
     scrolling gates panel cannot clip it. */
  .app-composer .composer-gates-panel .gate-accordion-body label.adj-label, .app-composer .gp-modal label .adj-label {
    display: inline-flex; align-items: center; gap: 0.35rem;
  }
  /* Scoped to the panel: the accordion's own button rules are more specific
     than a bare class and turned this into a padded block pill. */
  .app-composer .composer-gates-panel .gate-accordion-body .adj-help, .app-composer .adj-help {
    display: inline-flex; align-items: center; justify-content: center;
    box-sizing: border-box; width: 1.15rem; height: 1.15rem; min-width: 0;
    padding: 0; margin: 0; border-radius: 50%;
    border: 1px solid var(--border); background: transparent;
    color: var(--text-muted); font-size: 0.7rem; line-height: 1; cursor: help;
    flex-shrink: 0;
  }
  .app-composer .composer-gates-panel .gate-accordion-body .adj-help:hover, .app-composer .adj-help:hover, .app-composer .adj-help:focus-visible, .app-composer .adj-help.pinned {
    color: var(--text-primary); border-color: var(--accent-bright);
  }
  /* box-sizing: the script sets this box's WIDTH and keeps that width inside
     the window. With the default sizing the padding and border were drawn
     outside it, so a "?" near the right edge opened a box 24px too wide and
     its text was cut off (seen on the exits rows, 2026-10-13). */
  .app-composer .adj-help-pop {
    box-sizing: border-box;
    display: none; position: fixed; z-index: 1000;
    padding: 0.55rem 0.7rem; border-radius: 0.4rem;
    background: var(--bg-card); color: var(--text-primary);
    border: 1px solid var(--border); box-shadow: 0 6px 18px var(--bg-base);
    font-size: 0.75rem; line-height: 1.45; text-align: left; white-space: normal;
  }
  .app-composer .adj-help-pop.show { display: block; }
  .app-composer .adj-help-pop em { color: var(--text-muted); font-style: normal; }
  .app-composer .adj-unit {
    color: var(--text-muted); font-size: 0.75rem; white-space: nowrap;
    min-width: 4.75rem;
  }
  .app-composer .composer-gates-panel .gate-row .gate-menu {
    position: relative;
  }
  .app-composer .composer-gates-panel .gate-row .gate-menu-trigger {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0.15rem 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 0.25rem;
    line-height: 1;
  }
  .app-composer .composer-gates-panel .gate-row .gate-menu-trigger:hover {
    color: var(--text-primary); background: var(--bg-elevated);
  }
  .app-composer .composer-gates-panel .gate-row .gate-menu-list {
    position: absolute;
    top: calc(100% + 2px); right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    padding: 0.2rem 0;
    min-width: 8rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 10;
    display: none;
  }
  .app-composer .composer-gates-panel .gate-row .gate-menu-list.open { display: block; }
  .app-composer .composer-gates-panel .gate-row .gate-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--text-primary);
    border: none;
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
    cursor: pointer;
  }
  .app-composer .composer-gates-panel .gate-row .gate-menu-item:hover {
    background: var(--bg-elevated);
    color: var(--text-neg);
  }
  /* WORKBENCH-COMPOSER-FIX-01 (#539) Fix 10 — pinned positioning disclaimer. */
  .app-composer .composer-disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted, var(--text-muted));
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-border, var(--border));
  }
  /* Jason, 2026-11-25 — "New conversation": opening a strategy continues its latest one. */
  .app-composer .composer-thread-bar {
    display: flex;
    justify-content: flex-end;
    padding: 0.3rem 0.75rem;
    border-bottom: 1px solid var(--color-border, var(--border));
  }
  .app-composer .composer-new-conv {
    font-size: 0.78rem;
    color: var(--accent);
    text-decoration: none;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 6px;
  }
  .app-composer .composer-new-conv:hover,
  .app-composer .composer-new-conv:focus-visible {
    background: var(--bg-elevated);
  }
  .app-composer .composer-research-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0;
    padding: 0.3rem 0.75rem 0.5rem;
  }

  /* WORKBENCH-COMPOSER-FIX-01 (#539) Fix 3 — permanent exits section. */
  .app-composer .composer-exits-section {
    border-top: 1px solid var(--border);
    padding: 0.5rem 0.6rem 0.6rem;
  }
  .app-composer .composer-exits-header {
    display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.4rem;
  }
  .app-composer .composer-exits-header h4 {
    margin: 0; font-size: 0.72rem; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted);
  }
  .app-composer .composer-exits-note { font-size: 0.7rem; color: var(--text-muted); }
  .app-composer .composer-exit-row {
    display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.35rem;
    font-size: 0.72rem;
  }
  .app-composer .composer-exit-row > label {
    min-width: 62px; color: var(--text-muted);
  }
  .app-composer .composer-exit-row select, .app-composer .composer-exit-row input[type=number] {
    background: var(--bg-raised); color: var(--text-heading); border: 1px solid var(--border);
    border-radius: 0.3rem; padding: 0.2rem 0.35rem; font-size: 0.72rem;
  }
  .app-composer .composer-exit-row input[type=number] { width: 64px; }
  .app-composer .composer-exit-row select { flex: 1; min-width: 0; }
  .app-composer .composer-exit-unit { color: var(--text-muted); font-size: 0.7rem; }
  .app-composer .composer-exit-row[hidden] { display: none; }
  .app-composer #universal-row > label {
    min-width: 0; display: inline-flex; align-items: center; gap: 0.3rem;
    color: var(--text-heading); cursor: pointer;
  }
  .app-composer .composer-admin-badge {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase; color: var(--text-warn); border: 1px solid var(--border-warn);
    background: var(--bg-warn-tint); border-radius: 0.25rem; padding: 0.05rem 0.3rem;
  }
  .app-composer .composer-gates-panel .actions-row {
    display: flex;
    gap: 0.55rem;
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
  }
  .app-composer .composer-gates-panel button {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    cursor: pointer;
  }
  .app-composer .composer-gates-panel button.primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
  }
  .app-composer .composer-gates-panel button.success {
    background: var(--bg-pos-tint);
    color: var(--text-pos);
    border-color: var(--border-pos);
  }
  .app-composer .composer-gates-panel button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  /* Stat cards for sample / full run results */
  .app-composer .stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin: 0.5rem 0;
  }
  .app-composer .stat-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    padding: 0.5rem 0.6rem;
  }
  .app-composer .stat-card .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .app-composer .stat-card .val {
    font-size: 1.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
  }
  .app-composer .stat-card .val.pos { color: var(--text-pos); }
  .app-composer .stat-card .val.neg { color: var(--text-neg); }

  /* Modal — Activate */
  .app-composer .modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(11, 15, 20, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
  }
  .app-composer .modal-backdrop.open { display: flex; }
  .app-composer .modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    max-width: 560px;
    width: 92%;
    max-height: 88vh;
    overflow-y: auto;
    padding: 1.5rem;
  }
  .app-composer .modal h2 { margin: 0 0 0.5rem 0; font-size: 1.15rem; }
  .app-composer .modal .kv-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.25rem 0; }
  .app-composer .modal .kv-row .check-y { color: var(--text-pos); font-weight: 700; }
  .app-composer .modal .kv-row .check-n { color: var(--text-neg); font-weight: 700; }
  .app-composer .modal .disclaimer {
    background: var(--bg-elevated);
    border-left: 3px solid var(--text-muted);
    padding: 0.7rem 0.9rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 1rem 0;
    border-radius: 0 0.3rem 0.3rem 0;
    line-height: 1.55;
  }
  .app-composer .modal .modal-actions {
    display: flex; gap: 0.55rem; justify-content: flex-end;
    margin-top: 1rem;
  }
    .app-composer .composer-versions { margin-top: .6rem; font-size: .8rem; }
    .app-composer .version-status { color: var(--text-muted); margin-bottom: .3rem; }
    .app-composer .versions-details summary { cursor: pointer; color: var(--text-muted); }
    .app-composer .version-row { display: flex; gap: .6rem; align-items: center; padding: .25rem 0; }
    .app-composer .version-rollback { font-size: .75rem; padding: .15rem .5rem; }
    .app-composer .checks-busy-note { margin: .4rem 0 .2rem; padding: .35rem .6rem; border: 1px solid var(--border-warn); border-radius: 6px; background: var(--bg-warn-tint); color: var(--text-warn); font-size: .85rem; }
  

/* ===================================================================== */
/* STYLE-05 — workbench/entry_point.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-workbench-new (wrapper in the template).            */
/* ===================================================================== */
  .app-workbench-new .composer-landing {
    max-width: 720px;
    margin: 2.5rem auto;
    padding: 0 1.25rem;
  }
  .app-workbench-new .composer-landing h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
  }
  .app-workbench-new .composer-landing .subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0 0 1.5rem 0;
  }
  .app-workbench-new .composer-landing .claude-question {
    background: var(--bg-card);
    border-left: 3px solid var(--accent-bright);
    border-radius: 0 0.35rem 0.35rem 0;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0 2rem 0;
    line-height: 1.55;
  }
  .app-workbench-new .composer-landing .claude-question .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 0.35rem;
  }
  .app-workbench-new .composer-landing .path-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: border-color 120ms ease, transform 120ms ease;
  }
  .app-workbench-new .composer-landing .path-card:hover {
    border-color: var(--border-emph);
    transform: translateY(-1px);
  }
  .app-workbench-new .composer-landing .path-card h3 {
    margin: 0 0 0.35rem 0;
    font-size: 1.05rem;
    font-weight: 600;
  }
  .app-workbench-new .composer-landing .path-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
  }
  .app-workbench-new .composer-landing .ticker-form {
    display: none;  /* toggled by JS when Entry A is chosen */
    background: var(--bg-card);
    border: 1px solid var(--border-emph);
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
  }
  .app-workbench-new .composer-landing .ticker-form.open { display: block; }
  .app-workbench-new .composer-landing .ticker-form label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
  }
  .app-workbench-new .composer-landing .ticker-form .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
  }
  .app-workbench-new .composer-landing .ticker-form input {
    width: 100%;
    background: var(--bg-raised);
    color: var(--text-heading);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.95rem;
  }
  .app-workbench-new .composer-landing .ticker-form .actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 0.75rem;
  }
  .app-workbench-new .composer-landing button.primary {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 0.35rem;
    padding: 0.55rem 1.1rem;
    font-weight: 600;
    cursor: pointer;
  }
  .app-workbench-new .composer-landing button.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .app-workbench-new .composer-landing button.secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    padding: 0.55rem 1.1rem;
    cursor: pointer;
  }
  .app-workbench-new .composer-landing .divider {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 2rem 0;
  }

/* ===================================================================== */
/* STYLE-05 — pattern_matching/indicators.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-indicators (wrapper in the template).            */
/* ===================================================================== */
.app-indicators {
    --ind-surface-1: var(--bg-raised);
    --ind-surface-2: var(--bg-elevated);
    --ind-surface-3: var(--border);
    --ind-text-primary: var(--text-heading);
    --ind-text-secondary: var(--text-muted);
    --ind-text-muted: var(--text-muted);
    --ind-border: var(--border);
    --ind-border-strong: var(--border-strong);
    --ind-border-accent: var(--accent);
    --ind-border-danger: var(--border-neg);
    --ind-border-success: var(--border-pos);
    --ind-border-warning: var(--border-warn);
    --ind-bg-accent: var(--bg-selected);
    --ind-bg-success: var(--bg-pos-tint);
    --ind-bg-warning: var(--bg-warn-tint);
    --ind-bg-danger: var(--bg-neg-tint);
    --ind-fill-accent: var(--accent);
    --ind-fill-warning: var(--text-warn);
    --ind-text-accent: var(--accent-bright);
    --ind-text-danger: var(--text-neg);
    --ind-text-success: var(--text-pos);
    --ind-text-warning: var(--text-warn);
    --ind-radius: 6px;
    --ind-mono: var(--font-mono);
  }
  .app-indicators .ind-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
  .app-indicators .ind-title { font-size: 20px; font-weight: 500; }
  .app-indicators .ind-btn-add {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; border: 0.5px solid var(--ind-border-strong);
    border-radius: var(--ind-radius); background: var(--ind-surface-2);
    color: var(--ind-text-primary); font-size: 13px; cursor: pointer;
  }
  .app-indicators .ind-btn-add:hover { background: var(--ind-surface-3); }
  .app-indicators .ind-family-tabs { display: flex; border-bottom: 0.5px solid var(--ind-border); margin-bottom: 1.5rem; }
  .app-indicators .ind-tab {
    padding: 8px 16px; font-size: 13px; color: var(--ind-text-secondary);
    cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -0.5px;
    text-decoration: none; display: inline-block;
  }
  .app-indicators .ind-tab:hover { color: var(--ind-text-primary); }
  .app-indicators .ind-tab.active { color: var(--ind-text-accent); border-bottom-color: var(--ind-border-accent); font-weight: 500; }
  .app-indicators .ind-content { display: flex; gap: 1.25rem; }
  .app-indicators .ind-type-list { width: 180px; flex-shrink: 0; }
  .app-indicators .ind-type-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 10px; border-radius: var(--ind-radius); cursor: pointer;
    font-size: 13px; color: var(--ind-text-secondary);
    text-decoration: none; margin-bottom: 2px;
  }
  .app-indicators .ind-type-item:hover { background: var(--ind-surface-2); color: var(--ind-text-primary); }
  .app-indicators .ind-type-item.active { background: var(--ind-bg-accent); color: var(--ind-text-accent); font-weight: 500; }
  .app-indicators .ind-type-item.muted { color: var(--ind-text-muted); }
  .app-indicators .ind-type-badge {
    font-size: 11px; background: var(--ind-surface-1); border: 0.5px solid var(--ind-border);
    border-radius: 10px; padding: 1px 7px; color: var(--ind-text-muted); font-weight: 400; flex-shrink: 0;
  }
  .app-indicators .ind-type-item.active .ind-type-badge { background: var(--ind-fill-accent); border-color: var(--ind-fill-accent); color: var(--text-heading); }
  .app-indicators .ind-right { flex: 1; min-width: 0; overflow: hidden; }
  .app-indicators .ind-panel-title { font-size: 16px; font-weight: 500; }
  .app-indicators .ind-panel-sub { font-size: 11px; color: var(--ind-text-muted); font-family: var(--ind-mono); margin-top: 3px; margin-bottom: 12px; }
  .app-indicators .ind-progress {
    display: flex; align-items: center; gap: 8px; padding: 9px 14px;
    background: var(--ind-bg-warning); border: 0.5px solid var(--ind-border-warning);
    border-radius: var(--ind-radius); margin-bottom: 12px; font-size: 12px;
    color: var(--ind-text-warning); overflow: hidden;
  }
  .app-indicators .ind-spinner {
    width: 11px; height: 11px; border: 1.5px solid var(--ind-border-warning);
    border-top-color: var(--ind-text-warning); border-radius: 50%;
    animation: ind-spin 0.7s linear infinite; flex-shrink: 0;
  }
  @keyframes ind-spin { to { transform: rotate(360deg); } }
  .app-indicators .ind-prog-track { width: 70px; height: 5px; background: rgba(0,0,0,0.25); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
  .app-indicators .ind-prog-fill { height: 100%; border-radius: 3px; background: var(--ind-fill-warning); }
  .app-indicators .ind-vtable { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
  .app-indicators .ind-vtable th {
    text-align: left; padding: 6px 8px; color: var(--ind-text-muted); font-weight: 400;
    font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase;
    border-bottom: 0.5px solid var(--ind-border);
  }
  .app-indicators .ind-vtable td { padding: 11px 8px; border-bottom: 0.5px solid var(--ind-border); vertical-align: middle; overflow: hidden; }
  .app-indicators .ind-vtable tbody tr.dep-open > td:not(.ind-dep-cell) { background: var(--ind-bg-accent); }
  .app-indicators .ind-mono { font-family: var(--ind-mono); font-size: 11px; }
  .app-indicators .ind-params { font-family: var(--ind-mono); font-size: 10px; color: var(--ind-text-muted); line-height: 1.8; }
  .app-indicators .ind-pill {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; white-space: nowrap;
  }
  .app-indicators .ind-pill-green { background: var(--ind-bg-success); color: var(--ind-text-success); border: 0.5px solid var(--ind-border-success); }
  .app-indicators .ind-pill-amber { background: var(--ind-bg-warning); color: var(--ind-text-warning); border: 0.5px solid var(--ind-border-warning); }
  .app-indicators .ind-pill-muted { background: var(--ind-surface-1); color: var(--ind-text-muted); border: 0.5px solid var(--ind-border); }
  .app-indicators .ind-pill-purple { background: #26215C; color: #AFA9EC; border: 0.5px solid #534AB7; cursor: pointer; }
  .app-indicators .ind-pill-purple:hover { background: #3C3489; }
  .app-indicators .ind-pill-none { background: var(--ind-surface-1); color: var(--ind-text-muted); border: 0.5px solid var(--ind-border); cursor: pointer; }
  .app-indicators .ind-act-links { display: flex; flex-direction: column; gap: 5px; }
  .app-indicators .ind-act-link {
    background: none; border: none; padding: 0; font-size: 11px;
    cursor: pointer; color: var(--ind-text-secondary); text-align: left; line-height: 1;
  }
  .app-indicators .ind-act-link:hover { color: var(--ind-text-primary); text-decoration: underline; }
  .app-indicators .ind-act-link.danger { color: var(--ind-text-danger); }
  .app-indicators .ind-act-inprog { font-size: 11px; color: var(--ind-text-muted); }
  .app-indicators .ind-rows-partial { color: var(--ind-text-warning); font-family: var(--ind-mono); font-size: 11px; }
  .app-indicators .ind-rows-total { color: var(--ind-text-muted); font-family: var(--ind-mono); font-size: 11px; }
  .app-indicators .ind-dep-cell { padding: 0 !important; border-bottom: 0.5px solid var(--ind-border-accent); }
  .app-indicators .ind-dep-panel { background: var(--ind-surface-1); border-top: 0.5px solid var(--ind-border-accent); padding: 14px 16px; }
  .app-indicators .ind-dep-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .app-indicators .ind-dep-title { font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
  .app-indicators .ind-dep-title .ind-mono { color: var(--ind-text-accent); }
  .app-indicators .ind-dep-close { background: none; border: none; color: var(--ind-text-muted); cursor: pointer; font-size: 18px; line-height: 1; }
  .app-indicators .ind-dep-close:hover { color: var(--ind-text-primary); }
  .app-indicators .ind-dep-card { background: var(--ind-surface-2); border: 0.5px solid var(--ind-border); border-radius: var(--ind-radius); padding: 12px 14px; margin-bottom: 8px; }
  .app-indicators .ind-dep-strat-name { font-size: 12px; font-weight: 500; margin-bottom: 3px; }
  .app-indicators .ind-dep-strat-key { font-size: 10px; font-family: var(--ind-mono); color: var(--ind-text-muted); }
  .app-indicators .ind-dep-strat-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
  .app-indicators .ind-dep-strat-link { font-size: 11px; color: var(--ind-text-accent); text-decoration: none; }
  .app-indicators .ind-dep-strat-link:hover { text-decoration: underline; }
  .app-indicators .ind-dep-none { font-size: 12px; color: var(--ind-text-muted); }

  .app-indicators .ind-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    display: none; align-items: center; justify-content: center; z-index: 100;
  }
  .app-indicators .ind-modal-backdrop.open { display: flex; }
  .app-indicators .ind-modal {
    background: var(--ind-surface-2); border: 0.5px solid var(--ind-border-strong);
    border-radius: 12px; width: 480px; max-height: 85vh; overflow-y: auto;
    padding: 1.5rem 1.75rem; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  }
  .app-indicators .ind-modal-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
  .app-indicators .ind-modal-title { font-size: 16px; font-weight: 500; }
  .app-indicators .ind-modal-close { background: none; border: none; color: var(--ind-text-muted); cursor: pointer; font-size: 22px; line-height: 1; }
  .app-indicators .ind-modal-close:hover { color: var(--ind-text-primary); }
  .app-indicators .ind-fg { margin-bottom: 1rem; }
  .app-indicators .ind-flabel { display: block; font-size: 11px; color: var(--ind-text-secondary); margin-bottom: 5px; }
  .app-indicators .ind-finput {
    width: 100%; padding: 7px 10px; border: 0.5px solid var(--ind-border-strong);
    border-radius: var(--ind-radius); font-size: 13px;
    color: var(--ind-text-primary); background: var(--ind-surface-1);
    box-sizing: border-box;
  }
  .app-indicators .ind-finput:focus { outline: none; border-color: var(--ind-border-accent); box-shadow: 0 0 0 2px var(--ind-bg-accent); }
  .app-indicators .ind-vkey-box {
    background: var(--bg-base); border: 0.5px solid var(--ind-border);
    border-radius: var(--ind-radius); padding: 7px 10px;
    font-family: var(--ind-mono); font-size: 11px; color: var(--ind-text-secondary);
  }
  .app-indicators .ind-info-note {
    background: var(--ind-surface-1); border: 0.5px solid var(--ind-border);
    border-radius: var(--ind-radius); padding: 10px 14px; font-size: 12px;
    color: var(--ind-text-muted); margin-bottom: 1rem; line-height: 1.6;
  }
  .app-indicators .ind-modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    margin-top: 1.25rem; padding-top: 1rem; border-top: 0.5px solid var(--ind-border);
  }
  .app-indicators .ind-mfbtn {
    padding: 7px 16px; border-radius: var(--ind-radius); border: 0.5px solid var(--ind-border-strong);
    background: transparent; color: var(--ind-text-primary); font-size: 13px; cursor: pointer;
  }
  .app-indicators .ind-mfbtn:hover { background: var(--ind-surface-3); }
  .app-indicators .ind-mfbtn.primary { background: var(--ind-fill-accent); border-color: var(--ind-fill-accent); color: var(--text-heading); }
  .app-indicators .ind-mfbtn.primary:hover { background: var(--accent); }
  .app-indicators .ind-mfbtn.danger { color: var(--ind-text-danger); border-color: var(--ind-border-danger); }
  .app-indicators .ind-mfbtn.danger:hover { background: var(--ind-bg-danger); }
  .app-indicators .ind-mfbtn:disabled { opacity: 0.38; cursor: not-allowed; }
  .app-indicators .ind-dep-warn {
    background: var(--ind-bg-danger); border: 0.5px solid var(--ind-border-danger);
    border-radius: var(--ind-radius); padding: 10px 14px; font-size: 12px;
    color: var(--ind-text-danger); margin: 12px 0;
  }
  .app-indicators .ind-dep-modal-item {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 12px; background: var(--ind-surface-1); border-radius: var(--ind-radius);
    font-size: 12px; margin-bottom: 6px;
  }
  .app-indicators .ind-inline-error {
    color: var(--ind-text-danger); font-size: 11px; margin-top: 4px;
  }
  .app-indicators .ind-empty-panel {
    text-align: center; padding: 3rem 1rem; color: var(--ind-text-muted);
    font-style: italic; font-size: 13px;
  }

/* ===================================================================== */
/* STYLE-05 — the app templates' inline style="" attributes, as classes. */
/* u-* hold one or two plain declarations; adm-* name a composite.          */
/* ===================================================================== */
.u-b-bg-pos-tint-c-text-pos-bc-border-pos { background: var(--bg-pos-tint) !important; color: var(--text-pos) !important; border-color: var(--border-pos) !important; }
.u-c-ind-text-muted-fs-11px { color: var(--ind-text-muted) !important; font-size: 11px !important; }
.u-c-ind-text-secondary { color: var(--ind-text-secondary) !important; }
.u-c-text-muted-fs-0_85rem { color: var(--text-muted) !important; font-size: 0.85rem !important; }
.u-c-text-neg-fs-0_85rem { color: var(--text-neg) !important; font-size: 0.85rem !important; }
.u-d-block { display: block !important; }
.u-d-flex-fd-column-g-0_5rem-mb-0_75rem { display: flex !important; flex-direction: column !important; gap: 0.5rem !important; margin-bottom: 0.75rem !important; }
.u-d-flex-g-6px-ai-center-mb-8px { display: flex !important; gap: 6px !important; align-items: center !important; margin-bottom: 8px !important; }
.u-d-grid-gtc-1fr-1fr-g-12px-mb-12px { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 12px !important; margin-bottom: 12px !important; }
.u-d-inline { display: inline !important; }
.u-f-1 { flex: 1 !important; }
.u-f-1-fs-12px-p-5px-8px { flex: 1 !important; font-size: 12px !important; padding: 5px 8px !important; }
.u-f-2-fs-12px-p-5px-8px { flex: 2 !important; font-size: 12px !important; padding: 5px 8px !important; }
.u-ff-mono-b-bg-base { font-family: var(--font-mono) !important; background: var(--bg-base) !important; }
.u-fs-0_7rem-c-text-muted { font-size: 0.7rem !important; color: var(--text-muted) !important; }
.u-fs-0_95rem { font-size: 0.95rem !important; }
.u-fs-11px-c-ind-text-muted-mt-10px { font-size: 11px !important; color: var(--ind-text-muted) !important; margin-top: 10px !important; }
.u-fs-13px-c-ind-text-secondary-mt-12px { font-size: 13px !important; color: var(--ind-text-secondary) !important; margin-top: 12px !important; }
.u-fs-13px-mb-8px { font-size: 13px !important; margin-bottom: 8px !important; }
.u-fw-500 { font-weight: 500 !important; }
.u-m-0 { margin: 0 !important; }
.u-mb-0_5rem { margin-bottom: 0.5rem !important; }
.u-mt-0_2rem { margin-top: 0.2rem !important; }
.u-mt-10px-c-ind-text-accent { margin-top: 10px !important; color: var(--ind-text-accent) !important; }
.u-mt-1rem-fs-0_85rem { margin-top: 1rem !important; font-size: 0.85rem !important; }
.u-ox-auto { overflow-x: auto !important; }
.u-p-1_5rem-0 { padding: 1.5rem 0 !important; }
.u-r-vertical { resize: vertical !important; }
.u-ta-center-m-0 { text-align: center !important; margin: 0 !important; }
.u-w-0pct { width: 0% !important; }
.u-w-10pct { width: 10% !important; }
.u-w-12pct { width: 12% !important; }
.u-w-17pct { width: 17% !important; }
.u-w-18pct { width: 18% !important; }
.u-w-26pct { width: 26% !important; }
.u-w-90px-fs-12px-p-5px-8px { width: 90px !important; font-size: 12px !important; padding: 5px 8px !important; }
.u-w-9px-h-9px-bw-1_5px { width: 9px !important; height: 9px !important; border-width: 1.5px !important; }
.u-ws-nowrap-fs-0 { white-space: nowrap !important; flex-shrink: 0 !important; }
.u-x00c8c2 { background: transparent !important; color: var(--accent-bright) !important; border: 1px solid var(--accent-bright) !important; border-radius: 0.3rem !important; padding: 0.2rem 0.55rem !important; font-size: 0.7rem !important; cursor: pointer !important; }
.u-x408270 { font-size: 10px !important; font-weight: 500 !important; color: var(--ind-text-muted) !important; letter-spacing: 0.05em !important; text-transform: uppercase !important; margin-bottom: 8px !important; }
.u-x51f10b { background: none !important; border: none !important; color: var(--ind-text-muted) !important; cursor: pointer !important; font-size: 16px !important; padding: 0 4px !important; }
.u-x9e9d1d { display: flex !important; justify-content: space-between !important; align-items: flex-start !important; gap: 0.75rem !important; }
.u-x9fe5af { padding: 0.2rem 0.55rem !important; background: var(--bg-elevated) !important; color: var(--text-muted) !important; border-radius: 9999px !important; font-size: 0.7rem !important; font-weight: 600 !important; letter-spacing: 0.03em !important; font-variant-numeric: tabular-nums !important; }

/* ===================================================================== */
/* STYLE-05 — closed_trades.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-journal (wrapper in the template).            */
/* ===================================================================== */
  /* CLOSED-TRADE-EDIT-DELETE-01 (#760) */
  .app-journal .actions-col { width: 1%; white-space: nowrap; }
  .app-journal .actions-cell { white-space: nowrap; text-align: right; }
  .app-journal .row-action {
    background: transparent; border: 1px solid var(--border, var(--border));
    color: var(--text-muted, var(--text-muted)); border-radius: 0.3rem;
    font-size: 0.72rem; padding: 0.15rem 0.5rem; cursor: pointer; margin-left: 0.25rem;
  }
  .app-journal .row-action:hover { color: var(--accent-bright); border-color: var(--border-strong); }
  .app-journal .row-action-danger:hover { color: var(--text-neg); border-color: var(--text-neg); }
  .app-journal .ct-dialog-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center; z-index: 60;
  }
  .app-journal .ct-dialog {
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 0.5rem;
    padding: 1.25rem; min-width: 22rem; max-width: 30rem;
  }
  .app-journal .ct-dialog h3 { margin: 0 0 0.75rem 0; font-size: 1rem; }
  .app-journal .ct-dialog label { display: block; font-size: 0.75rem; color: var(--text-muted); margin: 0.6rem 0 0.2rem; }
  .app-journal .ct-dialog input { width: 100%; padding: 0.4rem; background: var(--bg-raised);
    border: 1px solid var(--border); border-radius: 0.3rem; color: inherit; }
  .app-journal .ct-dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }
  .app-journal .ct-dialog-note { font-size: 0.75rem; color: var(--text-muted); margin: 0.5rem 0 0; line-height: 1.4; }
  .app-journal .ct-dialog-warn { color: var(--text-neg); }
  .app-journal .ct-err { color: var(--text-neg); font-size: 0.78rem; margin-top: 0.5rem; min-height: 1rem; }

  /* JOURNAL-01 */
  .app-journal .ct-dialog textarea { width: 100%; padding: 0.4rem; background: var(--bg-raised);
    border: 1px solid var(--border); border-radius: 0.3rem; color: inherit;
    font: inherit; resize: vertical; min-height: 3.5rem; }
  .app-journal .jr-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.3rem; }
  .app-journal .jr-chip { font-size: 0.72rem; padding: 0.2rem 0.55rem; border-radius: 999px;
    border: 1px solid var(--border); color: var(--text-muted); cursor: pointer;
    background: transparent; user-select: none; }
  .app-journal .jr-chip[aria-pressed="true"] { color: var(--text-primary); border-color: var(--border-strong); }
  .app-journal .jr-adherence { display: flex; gap: 0.35rem; margin-top: 0.3rem; }
  .app-journal .jr-adherence button { flex: 1; }
  .app-journal .jr-has { color: var(--text-primary); }
  /* Numbers only — no verdict column, deliberately. See the tone rule. */
  .app-journal .jr-agg { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
  .app-journal .jr-agg th, .app-journal .jr-agg td { padding: 0.3rem 0.5rem; text-align: left;
    border-bottom: 1px solid var(--border); }
  .app-journal .jr-agg td.num, .app-journal .jr-agg th.num { text-align: right;
    font-variant-numeric: tabular-nums; }
  .app-journal .jr-agg tr.jr-zero td { color: var(--text-muted); }
  .app-journal .jr-strategy-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
  .app-journal .jr-strategy-table th, .app-journal .jr-strategy-table td { padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--border); text-align: left; }
  .app-journal .jr-strategy-table td.num, .app-journal .jr-strategy-table th.num { text-align: right;
    font-variant-numeric: tabular-nums; }

/* ===================================================================== */
/* STYLE-05 — partials/my_positions_table.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-positions-table (wrapper in the template).            */
/* ===================================================================== */
  /* POSITION-EXIT-STATE-01 (#765) */
  .app-positions-table .exit-reached {
    display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem;
    margin-bottom: 0.25rem; font-size: 0.7rem; white-space: nowrap;
  }
  .app-positions-table .exit-reached-label { font-weight: 600; }
  .app-positions-table .exit-reached-target .exit-reached-label { color: var(--text-pos); }
  .app-positions-table .exit-reached-stop .exit-reached-label { color: var(--text-neg); }
  .app-positions-table .exit-reached-level { font-variant-numeric: tabular-nums; color: var(--text-muted, var(--text-muted)); }
  .app-positions-table .btn-confirm-exit {
    background: var(--bg-pos-tint); border: 1px solid var(--border-pos); color: var(--text-pos);
    border-radius: 0.3rem; padding: 0.1rem 0.45rem; cursor: pointer;
  }
  .app-positions-table .exit-reached-stop .btn-confirm-exit {
    background: var(--bg-neg-tint); border-color: var(--border-neg); color: var(--text-neg);
  }
  .app-positions-table .btn-confirm-exit:hover { filter: brightness(1.25); }

/* ===================================================================== */
/* STYLE-05 — partials/execution_trace.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-execution-trace (wrapper in the template).            */
/* ===================================================================== */
  .app-execution-trace .trace-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    font-size: 0.8rem;
    margin: 0.4rem 0 0.6rem 0;
  }
  .app-execution-trace .trace-table th, .app-execution-trace .trace-table td {
    padding: 0.35rem 0.55rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
  }
  .app-execution-trace .trace-table th {
    background: var(--bg-raised);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.68rem;
  }
  .app-execution-trace .trace-table tr:last-child td { border-bottom: none; }
  .app-execution-trace .trace-status {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .app-execution-trace .trace-status-ok { background: var(--bg-pos-tint); color: var(--text-pos); }
  .app-execution-trace .trace-status-warn { background: var(--bg-warn-tint); color: var(--text-warn); }
  .app-execution-trace .trace-status-error { background: var(--bg-neg-tint); color: var(--text-neg); }
  .app-execution-trace .trace-payload {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
  }
  .app-execution-trace .trace-message-error { color: var(--text-neg); font-weight: 600; }
  .app-execution-trace .trace-empty {
    padding: 0.6rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
  }

/* ===================================================================== */
/* STYLE-05 — the app templates' inline style="" attributes, as classes. */
/* u-* hold one or two plain declarations; adm-* name a composite.          */
/* ===================================================================== */
.u-c-text-muted-fs-0_8rem-mt-0_3rem { color: var(--text-muted) !important; font-size: 0.8rem !important; margin-top: 0.3rem !important; }
.u-c-text-neg { color: var(--text-neg) !important; }
.u-l-16_7pct { left: 16.7% !important; }
.u-l-33_3pct { left: 33.3% !important; }
.u-l-66_7pct { left: 66.7% !important; }
.u-l-83_3pct { left: 83.3% !important; }
.u-m-0 { margin: 0 !important; }
.u-mb-1rem { margin-bottom: 1rem !important; }
.u-w-13pct { width: 13% !important; }
.u-w-32pct { width: 32% !important; }
.u-w-3pct { width: 3% !important; }
.u-w-4pct { width: 4% !important; }
.u-w-7pct { width: 7% !important; }
.u-w-8pct { width: 8% !important; }
.u-w-9pct { width: 9% !important; }

/* ===================================================================== */
/* STYLE-05 — signup/choose_method.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-signup-choose (wrapper in the template).            */
/* ===================================================================== */
  .app-signup-choose .sc-wrap { display: flex; justify-content: center; padding: 3rem 1rem; }
  .app-signup-choose .sc-card {
    width: 100%; max-width: 420px; background: var(--bg-raised);
    border: 1px solid var(--border); border-radius: 10px; padding: 2rem; text-align: center;
  }
  .app-signup-choose .sc-card h1 { font-size: 1.35rem; font-weight: 600; color: var(--text-heading); margin-bottom: 0.75rem; }
  .app-signup-choose .sc-badge {
    display: inline-block; background: var(--bg-elevated); color: var(--text-primary); border-radius: 9999px;
    padding: 0.2rem 0.75rem; font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; margin-bottom: 1.25rem;
  }
  .app-signup-choose .sc-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.25rem; }
  .app-signup-choose .sc-error {
    background: color-mix(in srgb, var(--text-neg) 8%, transparent); border: 1px solid var(--border-neg); color: var(--text-neg);
    border-radius: 6px; padding: 0.6rem 0.75rem; font-size: 0.85rem; margin-bottom: 1rem;
  }
  .app-signup-choose .btn-google {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem; width: 100%;
    padding: 0.65rem; background: var(--text-heading); color: var(--bg-base); border: none; border-radius: 6px;
    font-size: 0.95rem; font-weight: 600; font-family: inherit; cursor: pointer;
  }
  .app-signup-choose .btn-google:hover { background: white; }
  .app-signup-choose .btn-google svg { width: 18px; height: 18px; }
  .app-signup-choose .sc-divider { display: flex; align-items: center; gap: 0.75rem; color: var(--text-muted);
    font-size: 0.8rem; margin: 1.25rem 0; }
  .app-signup-choose .sc-divider::before, .app-signup-choose .sc-divider::after { content: ""; flex: 1; height: 1px; background: var(--bg-elevated); }
  .app-signup-choose .sc-ml-label { display: block; text-align: left; color: var(--text-muted); font-size: 0.85rem;
    margin-bottom: 0.4rem; }
  .app-signup-choose .sc-ml-input {
    width: 100%; box-sizing: border-box; padding: 0.6rem 0.75rem; margin-bottom: 0.75rem;
    background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px;
    color: var(--text-heading); font-size: 0.95rem; font-family: inherit;
  }
  .app-signup-choose .sc-ml-input:focus { outline: none; border-color: var(--accent-bright); }
  .app-signup-choose .btn-magic-link {
    width: 100%; padding: 0.6rem; cursor: pointer; background: transparent;
    border: 1px solid var(--accent-bright); border-radius: 6px; color: var(--accent-bright);
    font-size: 0.95rem; font-weight: 600; font-family: inherit;
  }
  .app-signup-choose .btn-magic-link:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }

/* ===================================================================== */
/* STYLE-05 — signup/magic_link_invite.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-signup-invite (wrapper in the template).            */
/* ===================================================================== */
  .app-signup-invite .ml-signup-wrap { display: flex; justify-content: center; padding: 3rem 1rem; }
  .app-signup-invite .ml-signup-card {
    width: 100%; max-width: 420px; background: var(--bg-raised);
    border: 1px solid var(--border); border-radius: 10px; padding: 2rem;
  }
  .app-signup-invite .ml-signup-title { font-size: 1.25rem; font-weight: 600; color: var(--text-heading); margin-bottom: 0.5rem; }
  .app-signup-invite .ml-signup-sub { color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; margin-bottom: 1.25rem; }
  .app-signup-invite .ml-signup-sub strong { color: var(--accent-bright); }
  .app-signup-invite .ml-signup-error {
    background: color-mix(in srgb, var(--text-neg) 8%, transparent); border: 1px solid var(--border-neg); color: var(--text-neg);
    border-radius: 6px; padding: 0.6rem 0.75rem; font-size: 0.85rem; margin-bottom: 1rem;
  }
  .app-signup-invite .ml-signup-label { display: block; color: var(--text-muted); font-size: 0.8rem; margin-bottom: 0.35rem; }
  .app-signup-invite .ml-signup-input {
    width: 100%; box-sizing: border-box; padding: 0.6rem 0.75rem;
    background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px;
    color: var(--text-heading); font-size: 0.95rem; font-family: inherit;
  }
  .app-signup-invite .ml-signup-input:focus { outline: none; border-color: var(--accent-bright); }
  .app-signup-invite .ml-signup-btn {
    width: 100%; margin-top: 1rem; padding: 0.65rem; cursor: pointer;
    background: var(--accent); border: none; border-radius: 6px;
    color: var(--on-accent); font-size: 0.95rem; font-weight: 600; font-family: inherit;
  }
  .app-signup-invite .ml-signup-btn:hover { background: var(--accent-hover); }
  .app-signup-invite .ml-signup-back { margin-top: 1.25rem; text-align: center; font-size: 0.85rem; }
  .app-signup-invite .ml-signup-back a { color: var(--text-muted); text-decoration: none; }
  .app-signup-invite .ml-signup-back a:hover { color: var(--text-heading); }

/* ===================================================================== */
/* STYLE-05 — education/regime_methodology.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-regime-methodology (wrapper in the template).            */
/* ===================================================================== */
  .app-regime-methodology .rmp-page {
    --rmp-bg:#0b1220; --rmp-card:#131c30; --rmp-border:#22304a;
    --rmp-text:#e7ebf3; --rmp-muted:#8b93a7;
    /* REGIME-COLOR-UNIFICATION-01 (#1804) -- these five are aliases of
       main.css's canonical --regime-* vars, never a second literal copy.
       -teal/-red/-gold/-blue are this page's own established names for
       bull/bear/pullback/sideways; --rmp-correction already matched the
       regime name directly. The -dim pair is the ONLY thing genuinely
       specific to this page: bull and sideways are 53%/19% of all days, so
       painting a decade of chart background at full brightness would be
       solid color, not a chart. color-mix() derives the dim tone FROM the
       canonical color instead of hand-picking a second, independent hex
       that could drift from it. */
    --rmp-teal: var(--regime-bull);
    --rmp-teal-dim: color-mix(in srgb, var(--regime-bull) 22%, var(--rmp-bg));
    --rmp-red: var(--regime-bear);
    --rmp-correction: var(--regime-correction);
    --rmp-gold: var(--regime-pullback);
    --rmp-blue: var(--regime-sideways);
    --rmp-blue-dim: color-mix(in srgb, var(--regime-sideways) 22%, var(--rmp-bg));
    max-width: 920px; margin: 0 auto; padding: 8px 0 64px;
    color: var(--rmp-text); font-size: 14px; line-height: 1.6;
  }
  /* 2026-11-06 redesign (Jason: "positive personality and style"): pictures first, plain
     words, the math in a fold-out. Scoped like the rest of this page. */
  .app-regime-methodology .rgp { font-size: 15px; }
  .app-regime-methodology .rgp p { max-width: 68ch; }
  .app-regime-methodology .rgp-kick { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--regime-bull); }
  .app-regime-methodology .rgp-h1 { font-family: var(--font-display); color: var(--text-heading); font-size: 2.1rem; line-height: 1.15; margin: 8px 0 12px; text-wrap: balance; }
  .app-regime-methodology .rgp-lead { font-size: 1.08rem; color: var(--text-primary); }
  .app-regime-methodology .rgp-h2, .app-regime-methodology .rmp-h2 { font-family: var(--font-display); color: var(--text-heading); font-size: 1.35rem; margin: 0 0 8px; text-wrap: balance; }
  .app-regime-methodology .rgp-sec { margin-top: 44px; }
  .app-regime-methodology .rgp-small { font-size: 0.8rem; color: var(--rmp-muted); margin: 8px 0; }
  .app-regime-methodology .rgp-card { background: linear-gradient(180deg, var(--bg-elevated), var(--bg-raised)); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
  .app-regime-methodology .rgp-card svg { width: 100%; height: auto; display: block; }
  .app-regime-methodology .rgp-stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; margin: 18px 0 14px; }
  .app-regime-methodology .rgp-stack i { display: block; height: 100%; }
  .app-regime-methodology .rgp-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
  .app-regime-methodology .rgp-rc { background: var(--bg-base); border: 1px solid var(--border); border-top: 3px solid var(--c); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
  .app-regime-methodology .rgp-rc.now { box-shadow: 0 0 0 1px var(--c), var(--shadow-card); }
  .app-regime-methodology .rgp-rn { font-family: var(--font-display); color: var(--c); font-weight: 700; }
  .app-regime-methodology .rgp-rn b { font-family: var(--font-mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: .08em; color: var(--bg-base); background: var(--c); padding: 1px 6px; border-radius: 4px; margin-left: 4px; vertical-align: 2px; }
  .app-regime-methodology .rgp-rp { font-family: var(--font-mono); color: var(--text-heading); font-size: 1.1rem; font-variant-numeric: tabular-nums; }
  .app-regime-methodology .rgp-rd { font-size: 0.8rem; line-height: 1.4; color: var(--rmp-muted); flex: 1; }
  .app-regime-methodology .rgp-ref { font-size: 0.75rem; color: var(--rmp-muted); }
  .app-regime-methodology .rgp-split { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; align-items: center; }
  .app-regime-methodology .rgp-big2 { display: flex; flex-direction: column; gap: 12px; }
  .app-regime-methodology .rgp-num { background: var(--bg-base); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
  .app-regime-methodology .rgp-num .v { font-family: var(--font-mono); font-size: 1.6rem; color: var(--text-heading); }
  .app-regime-methodology .rgp-num .l { font-size: 0.85rem; color: var(--rmp-muted); }
  .app-regime-methodology .rgp-verdict { font-size: 0.95rem; padding: 12px 14px; border-radius: 12px; border: 1px solid; color: var(--text-heading); background: var(--bg-base); }
  .app-regime-methodology .rgp-ladder { display: flex; flex-direction: column; gap: 8px; }
  .app-regime-methodology .rgp-step { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg-base); border: 1px solid var(--border); }
  .app-regime-methodology .rgp-step .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; color: var(--bg-base); }
  .app-regime-methodology .rgp-step .t { color: var(--text-heading); }
  .app-regime-methodology .rgp-step .t small { display: block; color: var(--rmp-muted); font-size: 0.8rem; margin-top: 2px; }
  .app-regime-methodology .rgp-step .a { font-family: var(--font-display); font-weight: 700; }
  .app-regime-methodology .rgp-why { margin-top: 14px; padding: 12px 16px; border-left: 3px solid var(--regime-bull); background: var(--bg-base); border-radius: 0 12px 12px 0; }
  .app-regime-methodology .rgp-why b, .app-regime-methodology .rgp-good b, .app-regime-methodology .rgp-mathbody b { color: var(--text-heading); }
  .app-regime-methodology .rgp-flips { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0; }
  .app-regime-methodology .rgp-strip { display: flex; height: 22px; border-radius: 6px; overflow: hidden; }
  .app-regime-methodology .rgp-strip i { flex: 1; }
  .app-regime-methodology .rgp-buf { display: grid; grid-template-columns: 150px 1fr 70px 130px; align-items: center; gap: 10px; padding: 6px 0; font-size: 0.85rem; color: var(--rmp-muted); }
  .app-regime-methodology .rgp-buf .bt { height: 10px; background: var(--bg-base); border-radius: 999px; overflow: hidden; }
  .app-regime-methodology .rgp-buf .bt i { display: block; height: 100%; background: var(--border); border-radius: 999px; }
  .app-regime-methodology .rgp-buf.on { color: var(--text-heading); font-weight: 600; }
  .app-regime-methodology .rgp-buf.on .bt i { background: var(--regime-bull); }
  .app-regime-methodology .rgp-buf .bv, .app-regime-methodology .rgp-buf .bo { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .app-regime-methodology .rgp-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .app-regime-methodology .rgp-fs { background: var(--bg-base); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
  .app-regime-methodology .rgp-fs .k { font-family: var(--font-mono); font-size: 0.7rem; color: var(--regime-bull); letter-spacing: .08em; text-transform: uppercase; }
  .app-regime-methodology .rgp-fs .t { font-family: var(--font-display); color: var(--text-heading); margin: 6px 0; }
  .app-regime-methodology .rgp-fs .b { font-size: 0.85rem; color: var(--rmp-muted); line-height: 1.45; }
  .app-regime-methodology .rgp-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
  .app-regime-methodology .rgp-chip { padding: 8px 12px; border-radius: 10px; background: var(--bg-base); border: 1px solid var(--border); font-size: 0.85rem; }
  .app-regime-methodology .rgp-chip b { margin-right: 6px; }
  .app-regime-methodology .rgp-good { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .app-regime-methodology .rgp-good div { background: var(--bg-base); border: 1px solid var(--border); border-radius: 12px; padding: 14px; font-size: 0.88rem; line-height: 1.5; }
  .app-regime-methodology .rgp-math { margin-top: 44px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-raised); }
  .app-regime-methodology .rgp-math summary { cursor: pointer; padding: 16px 20px; font-family: var(--font-display); color: var(--text-heading); font-size: 1.05rem; }
  .app-regime-methodology .rgp-mathbody { padding: 0 20px 20px; }
  .app-regime-methodology .rgp-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: tabular-nums; margin: 6px 0 12px; }
  .app-regime-methodology .rgp-table th, .app-regime-methodology .rgp-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
  .app-regime-methodology .rgp-table th { color: var(--rmp-muted); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .06em; }
  @media (max-width: 760px) {
    .app-regime-methodology .rgp-cards { grid-template-columns: 1fr 1fr; }
    .app-regime-methodology .rgp-split, .app-regime-methodology .rgp-flips, .app-regime-methodology .rgp-flow, .app-regime-methodology .rgp-good { grid-template-columns: 1fr; }
    .app-regime-methodology .rgp-buf { grid-template-columns: 110px 1fr 60px; }
    .app-regime-methodology .rgp-buf .bo { display: none; }
    .app-regime-methodology .rgp-h1 { font-size: 1.7rem; }
  }
  .app-regime-methodology .rmp-eyebrow { font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--rmp-teal); font-weight:600; margin-bottom:8px; }
  .app-regime-methodology .rmp-h1 { font-size:26px; font-weight:600; margin:0 0 8px; color:var(--rmp-text); }
  .app-regime-methodology .rmp-lede { color:var(--rmp-muted); font-size:15px; margin:0 0 36px; max-width:640px; }
  .app-regime-methodology .rmp-h2 { font-size:18px; font-weight:600; margin:44px 0 14px; padding-top:8px; border-top:1px solid var(--rmp-border); color:var(--rmp-text); }
  .app-regime-methodology .rmp-page > .rmp-h2:first-of-type { border-top:none; padding-top:0; margin-top:0; }
  .app-regime-methodology .rmp-h3 { font-size:14.5px; font-weight:600; margin:24px 0 10px; color:var(--rmp-text); }
  .app-regime-methodology .rmp-page p { margin:0 0 14px; }
  .app-regime-methodology .rmp-muted { color:var(--rmp-muted); }
  .app-regime-methodology .rmp-fn { font-size:11.5px; }
  .app-regime-methodology .rmp-page code { background:var(--bg-raised); border:1px solid var(--rmp-border); border-radius:4px; padding:1px 6px; font-size:12.5px; color:var(--rmp-blue); }
  .app-regime-methodology .rmp-formula { background:var(--bg-raised); border:1px solid var(--rmp-border); border-radius:8px; padding:14px 16px; font-family:var(--font-mono); font-size:12.5px; color:var(--text-primary); margin:12px 0 18px; overflow-x:auto; white-space:pre; }

  .app-regime-methodology .rmp-card-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:10px; margin-bottom:14px; }
  @media (max-width:800px){ .app-regime-methodology .rmp-card-grid {grid-template-columns:repeat(2,1fr);} }
  .app-regime-methodology .rmp-regime-card { background:var(--rmp-card); border:1px solid var(--rmp-border); border-left:3px solid; border-radius:8px; padding:12px 14px; }
  .app-regime-methodology .rmp-regime-card .rmp-name { font-weight:600; font-size:13px; margin-bottom:2px; }
  .app-regime-methodology .rmp-regime-card .rmp-pct { color:var(--rmp-muted); font-size:11px; }
  .app-regime-methodology .rmp-regime-card .rmp-def { color:var(--rmp-muted); font-size:11.5px; margin-top:6px; line-height:1.45; }
  .app-regime-methodology .rmp-ipedia { display:block; margin-top:8px; font-size:11px; }
  .app-regime-methodology .rmp-ipedia a { color:var(--rmp-teal); text-decoration:none; }
  .app-regime-methodology .rmp-rc-bear { border-color:var(--rmp-red); } .app-regime-methodology .rmp-rc-bear .rmp-name {color:var(--rmp-red);}
  .app-regime-methodology .rmp-rc-correction { border-color:var(--rmp-correction); } .app-regime-methodology .rmp-rc-correction .rmp-name {color:var(--rmp-correction);}
  .app-regime-methodology .rmp-rc-pullback { border-color:var(--rmp-gold); } .app-regime-methodology .rmp-rc-pullback .rmp-name {color:var(--rmp-gold);}
  .app-regime-methodology .rmp-rc-sideways { border-color:var(--rmp-blue); } .app-regime-methodology .rmp-rc-sideways .rmp-name {color:var(--rmp-blue);}
  .app-regime-methodology .rmp-rc-bull { border-color:var(--rmp-teal); } .app-regime-methodology .rmp-rc-bull .rmp-name {color:var(--rmp-teal);}

  .app-regime-methodology .rmp-chart-card { background:var(--rmp-card); border:1px solid var(--rmp-border); border-radius:12px; padding:18px; margin:18px 0 8px; }
  .app-regime-methodology .rmp-chart-title { font-weight:500; font-size:13px; margin-bottom:2px; }
  .app-regime-methodology .rmp-chart-sub { color:var(--rmp-muted); font-size:11.5px; margin-bottom:14px; }
  .app-regime-methodology .rmp-chart-empty { color:var(--rmp-muted); font-size:13px; padding:48px 0; text-align:center; }
  .app-regime-methodology #rmpRegimeChart { width:100%; max-height:340px; }
  .app-regime-methodology .rmp-legend-row { display:flex; gap:16px; flex-wrap:wrap; margin-top:12px; font-size:11px; color:var(--rmp-muted); }
  .app-regime-methodology .rmp-legend-row span { display:inline-flex; align-items:center; gap:5px; }
  .app-regime-methodology .rmp-swatch { width:10px; height:10px; border-radius:2px; display:inline-block; }

  .app-regime-methodology .rmp-callout { background:var(--bg-raised); border:1px solid var(--rmp-border); border-left:3px solid var(--rmp-blue); border-radius:8px; padding:14px 16px; margin:16px 0; font-size:13px; }
  .app-regime-methodology .rmp-callout.rmp-warn { border-left-color:var(--rmp-gold); }
  .app-regime-methodology .rmp-callout.rmp-crit { border-left-color:var(--rmp-red); }
  .app-regime-methodology .rmp-callout b { color:var(--rmp-text); }

  .app-regime-methodology .rmp-table-scroll { overflow-x:auto; }
  .app-regime-methodology .rmp-stat-table { width:100%; border-collapse:collapse; margin:14px 0 20px; font-size:12.5px; }
  .app-regime-methodology .rmp-stat-table th { text-align:right; font-size:10.5px; text-transform:uppercase; letter-spacing:.03em; color:var(--rmp-muted); padding:6px 10px; border-bottom:1px solid var(--rmp-border); }
  .app-regime-methodology .rmp-stat-table th:first-child { text-align:left; }
  .app-regime-methodology .rmp-stat-table td { text-align:right; padding:7px 10px; border-bottom:1px solid var(--border); }
  .app-regime-methodology .rmp-stat-table td:first-child { text-align:left; color:var(--rmp-muted); }
  .app-regime-methodology .rmp-stat-table tr.rmp-hl td { color:var(--rmp-teal); font-weight:600; }
  .app-regime-methodology .rmp-verdict-aligned { color:var(--rmp-teal); font-weight:600; }
  .app-regime-methodology .rmp-verdict-neutral { color:var(--rmp-gold); font-weight:600; }
  .app-regime-methodology .rmp-verdict-caution { color:var(--rmp-red); font-weight:600; }

  .app-regime-methodology .rmp-page ol, .app-regime-methodology .rmp-page ul { padding-left:20px; margin:0 0 16px; }
  .app-regime-methodology .rmp-page li { margin-bottom:6px; }

  .app-regime-methodology .rmp-disclaimer { margin-top:56px; padding-top:18px; border-top:1px solid var(--rmp-border); color:var(--rmp-muted); font-size:11.5px; }

/* ===================================================================== */
/* STYLE-05 — scoring_explainer.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-scoring-explainer (wrapper in the template).            */
/* ===================================================================== */
  .app-scoring-explainer .explainer-wrap { max-width: 760px; }
  .app-scoring-explainer .explainer-section { background: var(--bg-card); border: 1px solid var(--border);
                       border-radius: 0.5rem; padding: 1.1rem 1.3rem; margin-bottom: 1rem; }
  .app-scoring-explainer .explainer-section h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.55rem 0; }
  .app-scoring-explainer .explainer-section p { font-size: 0.93rem; line-height: 1.55; margin: 0 0 0.6rem 0; }
  .app-scoring-explainer .explainer-section p:last-child { margin-bottom: 0; }
  .app-scoring-explainer .explainer-section ul { font-size: 0.92rem; line-height: 1.55;
                          margin: 0 0 0.6rem 1.1rem; padding: 0; }
  .app-scoring-explainer .explainer-section li { margin-bottom: 0.3rem; }
  .app-scoring-explainer .step-row { display: flex; gap: 0.7rem; align-items: flex-start; margin-bottom: 0.7rem; }
  .app-scoring-explainer .step-row:last-child { margin-bottom: 0; }
  .app-scoring-explainer .step-num { flex: 0 0 1.5rem; height: 1.5rem; border-radius: 9999px;
              background: var(--bg-raised); border: 1px solid var(--border);
              color: var(--text-muted); font-size: 0.78rem; font-weight: 700;
              display: flex; align-items: center; justify-content: center; }
  .app-scoring-explainer .step-body { font-size: 0.92rem; line-height: 1.5; }
  .app-scoring-explainer .step-body strong { display: block; margin-bottom: 0.1rem; }
  .app-scoring-explainer .disclaimer-strong {
    background: var(--bg-raised); border-left: 3px solid var(--border-warn);
    padding: 0.65rem 0.9rem; border-radius: 0.4rem; color: var(--text-warn);
    font-size: 0.88rem; line-height: 1.45;
  }

/* ===================================================================== */
/* STYLE-05 — errors/403.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-error-403 (wrapper in the template).            */
/* ===================================================================== */
  .app-error-403 .err-panel {
    max-width: 40rem; margin: 3rem auto; text-align: center;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 0.5rem; padding: 2.2rem 2rem;
  }
  .app-error-403 .err-status {
    color: var(--text-muted); font-size: 0.8rem; letter-spacing: 0.15em;
    text-transform: uppercase; margin-bottom: 0.5rem;
  }
  .app-error-403 .err-title { font-size: 1.4rem; font-weight: 700; margin: 0 0 0.6rem 0; }
  .app-error-403 .err-body { color: var(--text-primary); font-size: 0.95rem; margin: 0 0 0.4rem 0; }
  .app-error-403 .err-support { color: var(--text-muted); font-size: 0.85rem; margin: 0.4rem 0 1.4rem 0; }
  .app-error-403 .err-actions { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
  .app-error-403 .err-btn {
    background: var(--bg-elevated); color: var(--accent-bright); border: 1px solid var(--border-strong);
    padding: 0.5rem 1rem; border-radius: 0.35rem; text-decoration: none;
    font-size: 0.9rem;
  }
  .app-error-403 .err-btn-secondary {
    background: transparent; color: var(--text-muted); border: 1px solid var(--border);
  }

/* ===================================================================== */
/* STYLE-05 — errors/500.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-error-500 (wrapper in the template).            */
/* ===================================================================== */
  .app-error-500 .err-panel {
    max-width: 40rem; margin: 3rem auto; text-align: center;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 0.5rem; padding: 2.2rem 2rem;
  }
  .app-error-500 .err-status {
    color: var(--text-muted); font-size: 0.8rem; letter-spacing: 0.15em;
    text-transform: uppercase; margin-bottom: 0.5rem;
  }
  .app-error-500 .err-title { font-size: 1.4rem; font-weight: 700; margin: 0 0 0.6rem 0; }
  .app-error-500 .err-body { color: var(--text-primary); font-size: 0.95rem; margin: 0 0 0.4rem 0; }
  .app-error-500 .err-support { color: var(--text-muted); font-size: 0.85rem; margin: 0.4rem 0 1.4rem 0; }
  .app-error-500 .err-actions { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
  .app-error-500 .err-btn {
    background: var(--bg-elevated); color: var(--accent-bright); border: 1px solid var(--border-strong);
    padding: 0.5rem 1rem; border-radius: 0.35rem; text-decoration: none;
    font-size: 0.9rem;
  }
  .app-error-500 .err-btn-secondary {
    background: transparent; color: var(--text-muted); border: 1px solid var(--border);
  }

/* ===================================================================== */
/* STYLE-05 — errors/404.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-error-404 (wrapper in the template).            */
/* ===================================================================== */
  .app-error-404 .err-panel {
    max-width: 40rem; margin: 3rem auto; text-align: center;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 0.5rem; padding: 2.2rem 2rem;
  }
  .app-error-404 .err-status {
    color: var(--text-muted); font-size: 0.8rem; letter-spacing: 0.15em;
    text-transform: uppercase; margin-bottom: 0.5rem;
  }
  .app-error-404 .err-title { font-size: 1.4rem; font-weight: 700; margin: 0 0 0.6rem 0; }
  .app-error-404 .err-body { color: var(--text-primary); font-size: 0.95rem; margin: 0 0 1.4rem 0; }
  .app-error-404 .err-actions { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
  .app-error-404 .err-btn {
    background: var(--bg-elevated); color: var(--accent-bright); border: 1px solid var(--border-strong);
    padding: 0.5rem 1rem; border-radius: 0.35rem; text-decoration: none;
    font-size: 0.9rem;
  }
  .app-error-404 .err-btn-secondary {
    background: transparent; color: var(--text-muted); border: 1px solid var(--border);
  }

/* ===================================================================== */
/* STYLE-05 — education/position_sizing.html: moved from the template's <style>, colours on */
/* the tokens, scoped to .app-position-sizing (wrapper in the template).            */
/* ===================================================================== */
  .app-position-sizing .ps-page {
    --ps-bg: var(--bg-base);
    --ps-surface: var(--bg-card);
    --ps-surface-2: color-mix(in srgb, var(--bg-card) 95%, var(--text-primary));
    --ps-border: var(--border);
    --ps-text: var(--text-primary);
    --ps-text-dim: var(--text-muted);
    /* 85%: the lowest mix that still clears 4.5:1 on --ps-surface-2 (4.73). */
    --ps-text-faint: color-mix(in srgb, var(--text-muted) 85%, var(--bg-base));
    /* A form field's edge: 3:1 against the card (WCAG 1.4.11), 3.5 measured. */
    --ps-control-edge: color-mix(in srgb, var(--text-muted) 65%, var(--bg-base));
    --ps-win: var(--text-pos);
    --ps-win-dim: color-mix(in srgb, var(--text-pos) 60%, var(--bg-base));
    --ps-loss: var(--text-neg);
    --ps-loss-dim: color-mix(in srgb, var(--text-neg) 60%, var(--bg-base));
    --ps-edge: var(--text-warn);
    --ps-edge-dim: color-mix(in srgb, var(--text-warn) 55%, var(--bg-base));
    --ps-focus: var(--focus-ring);
    color: var(--ps-text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
  }
  .app-position-sizing .ps-page * { box-sizing: border-box; }
  .app-position-sizing .ps-page .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .app-position-sizing .ps-page .wrap { max-width: 1080px; margin: 0 auto; padding: 16px 0 56px; }

  .app-position-sizing .ps-page header.page { margin-bottom: 32px; }
  .app-position-sizing .ps-page header.page h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 12px; }
  .app-position-sizing .ps-page header.page p { color: var(--ps-text-dim); font-size: 17px; line-height: 1.55; max-width: 62ch; margin: 0; }

  .app-position-sizing .ps-page .hero { background: var(--ps-surface); border: 1px solid var(--ps-border); border-radius: 14px; padding: 24px; margin-bottom: 28px; }
  @media (max-width: 640px) { .app-position-sizing .ps-page .hero { padding: 16px; } }
  .app-position-sizing .ps-page .hero-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 18px; }
  .app-position-sizing .ps-page .hero-top .label { color: var(--ps-text-dim); font-size: 14px; }
  .app-position-sizing .ps-page .chart-toggles { display: flex; gap: 6px; }
  .app-position-sizing .ps-page .toggle-btn { background: transparent; border: 1px solid var(--ps-border); color: var(--ps-text-dim); font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
  .app-position-sizing .ps-page .toggle-btn:hover { border-color: var(--ps-text-faint); color: var(--ps-text); }
  .app-position-sizing .ps-page .toggle-btn.active { background: var(--ps-surface-2); border-color: var(--ps-edge-dim); color: var(--ps-edge); }
  .app-position-sizing .ps-page .toggle-btn:focus-visible { outline: 2px solid var(--ps-focus); outline-offset: 2px; }
  .app-position-sizing .ps-page #chart-holder { position: relative; width: 100%; }
  .app-position-sizing .ps-page canvas#chart { width: 100%; display: block; touch-action: none; }
  .app-position-sizing .ps-page .chart-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; font-size: 13px; color: var(--ps-text-dim); }
  .app-position-sizing .ps-page .chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
  .app-position-sizing .ps-page .swatch { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
  .app-position-sizing .ps-page .swatch.edge { background: var(--ps-edge); }
  .app-position-sizing .ps-page .swatch.edge-dim { background: var(--ps-edge-dim); opacity: .5; }
  .app-position-sizing .ps-page .swatch.faint { background: var(--ps-text-faint); }

  .app-position-sizing .ps-page .stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--ps-border); border: 1px solid var(--ps-border); border-radius: 12px; overflow: hidden; margin-bottom: 28px; }
  .app-position-sizing .ps-page .stat-strip.three { grid-template-columns: repeat(3, 1fr); }
  @media (max-width: 720px) { .app-position-sizing .ps-page .stat-strip, .app-position-sizing .ps-page .stat-strip.three { grid-template-columns: repeat(2, 1fr); } }
  .app-position-sizing .ps-page .stat { background: var(--ps-surface); padding: 18px 20px; }
  .app-position-sizing .ps-page .stat .k { font-size: 13px; color: var(--ps-text-dim); margin-bottom: 6px; }
  .app-position-sizing .ps-page .stat .v { font-size: 24px; font-weight: 700; }
  .app-position-sizing .ps-page .stat .v.win, .app-position-sizing .ps-page .kv .v.win, .app-position-sizing .ps-page .field-head .val.win { color: var(--ps-win); }
  .app-position-sizing .ps-page .stat .v.loss, .app-position-sizing .ps-page .kv .v.loss, .app-position-sizing .ps-page .field-head .val.loss { color: var(--ps-loss); }
  .app-position-sizing .ps-page .stat .sub { font-size: 12.5px; color: var(--ps-text-faint); margin-top: 4px; }

  .app-position-sizing .ps-page .grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 20px; margin-bottom: 40px; align-items: start; }
  @media (max-width: 860px) { .app-position-sizing .ps-page .grid { grid-template-columns: 1fr; } }
  .app-position-sizing .ps-page .panel { background: var(--ps-surface); border: 1px solid var(--ps-border); border-radius: 14px; padding: 22px 24px; }
  .app-position-sizing .ps-page .panel h2 { font-size: 15px; font-weight: 700; margin: 0 0 18px; color: var(--ps-text); }
  .app-position-sizing .ps-page .field { margin-bottom: 20px; }
  .app-position-sizing .ps-page .field:last-child { margin-bottom: 0; }
  .app-position-sizing .ps-page .field-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
  .app-position-sizing .ps-page .field-head label { font-size: 14px; color: var(--ps-text-dim); }
  .app-position-sizing .ps-page .field-head .val { font-size: 15px; font-weight: 600; }
  .app-position-sizing .ps-page .field-head .val.edge { color: var(--ps-edge); }
  .app-position-sizing .ps-page input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 2px; background: var(--ps-surface-2); outline: none; cursor: pointer; }
  .app-position-sizing .ps-page input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ps-text); border: 3px solid var(--ps-bg); box-shadow: 0 0 0 1px var(--ps-border); cursor: pointer; margin-top: -1px; }
  .app-position-sizing .ps-page input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--ps-text); border: 3px solid var(--ps-bg); box-shadow: 0 0 0 1px var(--ps-border); cursor: pointer; }
  .app-position-sizing .ps-page input[type="range"]:focus-visible { box-shadow: 0 0 0 2px var(--ps-focus); border-radius: 4px; }
  .app-position-sizing .ps-page .field-note { font-size: 12.5px; color: var(--ps-text-faint); margin-top: 6px; }
  .app-position-sizing .ps-page .row-check { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
  .app-position-sizing .ps-page .row-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ps-edge); cursor: pointer; }
  .app-position-sizing .ps-page .row-check label { font-size: 14px; color: var(--ps-text); cursor: pointer; }
  .app-position-sizing .ps-page .capital-input { display: flex; align-items: center; background: var(--ps-surface-2); border: 1px solid var(--ps-control-edge); border-radius: 8px; padding: 0 12px; width: 100%; }
  .app-position-sizing .ps-page .capital-input:focus-within { outline: 2px solid var(--ps-focus); outline-offset: 2px; }
  .app-position-sizing .ps-page .capital-input span { color: var(--ps-text-faint); font-size: 15px; }
  .app-position-sizing .ps-page .capital-input input[type="number"] { flex: 1; background: transparent; border: none; outline: none; color: var(--ps-text); font-family: var(--font-mono); font-size: 15px; padding: 10px 8px; width: 100%; -moz-appearance: textfield; }
  .app-position-sizing .ps-page .capital-input input::-webkit-outer-spin-button, .app-position-sizing .ps-page .capital-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .app-position-sizing .ps-page .kv { display: flex; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--ps-border); }
  .app-position-sizing .ps-page .kv:first-of-type { border-top: none; }
  .app-position-sizing .ps-page .kv .k { font-size: 14px; color: var(--ps-text-dim); }
  .app-position-sizing .ps-page .kv .v { font-size: 14.5px; font-weight: 600; }
  .app-position-sizing .ps-page .kelly-note { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--ps-border); font-size: 12.5px; color: var(--ps-text-faint); line-height: 1.5; }
  .app-position-sizing .ps-page .kelly-note strong { color: var(--ps-text); }
  .app-position-sizing .ps-page a.ext { color: var(--ps-edge); }

  .app-position-sizing .ps-page .explain { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 40px; }
  @media (max-width: 780px) { .app-position-sizing .ps-page .explain { grid-template-columns: 1fr; } }
  .app-position-sizing .ps-page .explain .card { background: var(--ps-surface); border: 1px solid var(--ps-border); border-radius: 12px; padding: 20px 22px; }
  .app-position-sizing .ps-page .explain .card h3 { font-size: 15px; font-weight: 700; margin: 0 0 8px; }
  .app-position-sizing .ps-page .explain .card p { font-size: 14.5px; color: var(--ps-text-dim); line-height: 1.6; margin: 0; }
  .app-position-sizing .ps-page .explain .card .num-ex { color: var(--ps-edge); font-weight: 600; }
  .app-position-sizing .ps-page .long-note { background: var(--ps-surface); border: 1px solid var(--ps-border); border-radius: 14px; padding: 26px 28px; margin-bottom: 32px; }
  .app-position-sizing .ps-page .long-note h2 { font-size: 17px; font-weight: 700; margin: 0 0 12px; }
  .app-position-sizing .ps-page .long-note p { font-size: 15px; color: var(--ps-text-dim); line-height: 1.65; margin: 0 0 14px; max-width: 74ch; }
  .app-position-sizing .ps-page .long-note p:last-child { margin-bottom: 0; }
  .app-position-sizing .ps-page .long-note strong { color: var(--ps-text); font-weight: 600; }

  .app-position-sizing .ps-page .mode-toggle { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
  .app-position-sizing .ps-page .mode-btn { flex: 1; min-width: 220px; background: var(--ps-surface); border: 1px solid var(--ps-border); color: var(--ps-text-dim); font: inherit; text-align: left; padding: 14px 16px; border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
  .app-position-sizing .ps-page .mode-btn .t { font-size: 14.5px; font-weight: 700; color: var(--ps-text); display: block; margin-bottom: 2px; }
  .app-position-sizing .ps-page .mode-btn .d { font-size: 12.5px; color: var(--ps-text-faint); }
  .app-position-sizing .ps-page .mode-btn.active { border-color: var(--ps-edge-dim); background: var(--ps-surface-2); }
  .app-position-sizing .ps-page .mode-btn.active .t { color: var(--ps-edge); }
  .app-position-sizing .ps-page .mode-btn:focus-visible { outline: 2px solid var(--ps-focus); outline-offset: 2px; }
  .app-position-sizing .ps-page .mode-btn:disabled { opacity: .5; cursor: default; }
  .app-position-sizing .ps-page .real-only { display: none; }
  .app-position-sizing .ps-page .model-only { display: block; }
  .app-position-sizing .ps-page[data-mode="real"] .real-only { display: block; }
  .app-position-sizing .ps-page[data-mode="real"] .model-only { display: none; }
  .app-position-sizing .ps-page[data-mode="real"] .stat-strip.real-only { display: grid; }
  .app-position-sizing .ps-page[data-mode="real"] .row-check.real-only { display: flex; }
  .app-position-sizing .ps-page[data-mode="model"] .stat-strip.model-only { display: grid; }
  .app-position-sizing .ps-page .chart-legend.real-only { display: none; }
  .app-position-sizing .ps-page[data-mode="real"] .chart-legend.real-only { display: flex; }
  .app-position-sizing .ps-page[data-mode="real"] .chart-legend.model-only { display: none; }

  .app-position-sizing .ps-page .strat-select { width: 100%; min-height: 44px; background: var(--ps-surface-2); color: var(--ps-text); border: 1px solid var(--ps-control-edge); border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 15px; cursor: pointer; }
  .app-position-sizing .ps-page .strat-select:focus-visible { outline: 2px solid var(--ps-focus); outline-offset: 2px; }
  .app-position-sizing .ps-page .picker-count { font-size: 12.5px; color: var(--ps-text-faint); margin-top: 6px; }
  .app-position-sizing .ps-page .year-table { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 14px 0 16px; }
  .app-position-sizing .ps-page .year-cell { background: var(--ps-surface-2); border: 1px solid var(--ps-border); border-radius: 8px; padding: 8px 10px; text-align: center; }
  /* Marked by the dashed edge and its note, not by fading — faded text fails contrast. */
  .app-position-sizing .ps-page .year-cell.thin { border-style: dashed; border-color: var(--ps-control-edge); background: transparent; }
  .app-position-sizing .ps-page .year-cell .y { font-size: 11.5px; color: var(--ps-text-faint); }
  .app-position-sizing .ps-page .year-cell .r { font-size: 14px; font-weight: 700; margin-top: 2px; }
  .app-position-sizing .ps-page .year-cell .r.win { color: var(--ps-win); }
  .app-position-sizing .ps-page .year-cell .r.loss { color: var(--ps-loss); }
  .app-position-sizing .ps-page .year-cell .n { font-size: 10.5px; color: var(--ps-text-faint); margin-top: 1px; }
  .app-position-sizing .ps-page .source-note { font-size: 12px; color: var(--ps-text-faint); line-height: 1.5; margin: 4px 0 20px; }

  .app-position-sizing .ps-page .r-primer { background: var(--ps-surface); border: 1px solid var(--ps-edge-dim); border-radius: 10px; padding: 18px 22px; margin-bottom: 28px; }
  .app-position-sizing .ps-page .r-primer p { font-size: 15px; color: var(--ps-text-dim); line-height: 1.6; margin: 0; max-width: 68ch; }
  .app-position-sizing .ps-page .r-primer strong { color: var(--ps-text); font-weight: 600; }
  .app-position-sizing .ps-page .r-primer .soon { font-size: 13px; color: var(--ps-text-faint); margin-top: 10px; }
  .app-position-sizing .ps-page .page-notes { font-size: 12.5px; color: var(--ps-text-faint); line-height: 1.6; border-top: 1px solid var(--ps-border); padding-top: 20px; max-width: 74ch; }
  .app-position-sizing .ps-page .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  @media (prefers-reduced-motion: reduce) { .app-position-sizing .ps-page .toggle-btn, .app-position-sizing .ps-page .mode-btn { transition: none; } }
  .app-position-sizing .ps-page .color-probe { position: absolute; visibility: hidden; pointer-events: none; }

/* ===================================================================== */
/* STYLE-05 — the app templates' inline style="" attributes, as classes. */
/* u-* hold one or two plain declarations; adm-* name a composite.          */
/* ===================================================================== */
.u-b-rmp-blue-dim-b-1px-solid-rmp-blue { background: var(--rmp-blue-dim) !important; border: 1px solid var(--rmp-blue) !important; }
.u-b-rmp-correction { background: var(--rmp-correction) !important; }
.u-b-rmp-gold { background: var(--rmp-gold) !important; }
.u-b-rmp-red { background: var(--rmp-red) !important; }
.u-b-rmp-teal-dim-b-1px-solid-rmp-teal { background: var(--rmp-teal-dim) !important; border: 1px solid var(--rmp-teal) !important; }
.u-b-text-neg { background: var(--text-neg) !important; }
.u-b-text-pos { background: var(--text-pos) !important; }
.u-b-text-primary { background: var(--text-primary) !important; }
.u-c-text-muted-fs-0_85rem { color: var(--text-muted) !important; font-size: 0.85rem !important; }
.u-c-text-neg { color: var(--text-neg) !important; }
.u-c-text-pos { color: var(--text-pos) !important; }
.u-c-text-primary { color: var(--text-primary) !important; }
.u-c-text-warn-b-bg-warn-subtle { color: var(--text-warn) !important; background: var(--bg-warn-subtle) !important; }
.u-d-flex-g-0_35rem-ai-center-fw-wrap { display: flex !important; gap: 0.35rem !important; align-items: center !important; flex-wrap: wrap !important; }
.u-f-1-1-300px-minw-0 { flex: 1 1 300px !important; min-width: 0 !important; }
.u-f-999-1-420px-minw-0 { flex: 999 1 420px !important; min-width: 0 !important; }
.u-fs-0_78rem-m-0_9rem-0-0-0-lh-1_5 { font-size: 0.78rem !important; margin: 0.9rem 0 0 0 !important; line-height: 1.5 !important; }
.u-fs-0_85rem { font-size: 0.85rem !important; }
.u-fs-0_85rem-mt-0_35rem { font-size: 0.85rem !important; margin-top: 0.35rem !important; }
.u-fs-0_85rem-mt-0_5rem { font-size: 0.85rem !important; margin-top: 0.5rem !important; }
.u-fs-0_8rem { font-size: 0.8rem !important; }
.u-fs-0_8rem-m-0_75rem-0-0-0 { font-size: 0.8rem !important; margin: 0.75rem 0 0 0 !important; }
.u-fs-0_8rem-mt-0_2rem { font-size: 0.8rem !important; margin-top: 0.2rem !important; }
.u-fs-1_5rem-m-0-0-0_75rem-0 { font-size: 1.5rem !important; margin: 0 0 0.75rem 0 !important; }
.u-fw-600 { font-weight: 600 !important; }
.u-fw-700 { font-weight: 700 !important; }
.u-m-0 { margin: 0 !important; }
.u-m-0-0-0_6rem-0 { margin: 0 0 0.6rem 0 !important; }
.u-m-0-0-1rem-0 { margin: 0 0 1rem 0 !important; }
.u-mb-0_5rem { margin-bottom: 0.5rem !important; }
.u-mb-1rem { margin-bottom: 1rem !important; }
.u-mt-0_5rem { margin-top: 0.5rem !important; }
.u-mt-1_5rem { margin-top: 1.5rem !important; }
.u-minw-0 { min-width: 0 !important; }
.u-maxw-44rem-m-3rem-auto { max-width: 44rem !important; margin: 3rem auto !important; }
.u-minw-680px { min-width: 680px !important; }
.u-minw-760px { min-width: 760px !important; }
.u-w-12pct { width: 12% !important; }
.u-w-18pct { width: 18% !important; }
.u-w-280px { width: 280px !important; }
.u-w-34pct { width: 34% !important; }
.u-w-40pct { width: 40% !important; }
.u-x3db2e8 { background: rgba(110,231,183,0.12) !important; border-color: rgba(110,231,183,0.35) !important; color: var(--text-pos) !important; }
.u-x9e9d1d { display: flex !important; justify-content: space-between !important; align-items: flex-start !important; gap: 0.75rem !important; }

/* #2559 — the Terms box on the sign-up pages. */
.signup-terms { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0 0 1rem; font-size: 0.85rem; color: var(--text-muted); text-align: left; }
.signup-terms input { margin-top: 0.2rem; flex-shrink: 0; }
.signup-terms a { color: var(--accent-bright); }
/* Country and state at sign-up (attorney's memo, Jason 2026-11-11). */
.signup-location { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 0 0 0.75rem; text-align: left; }
.signup-location-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--text-muted); }
.signup-location-field select { padding: 0.45rem 0.5rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-elevated, var(--bg)); color: var(--text); font-size: 0.9rem; }
.signup-location-note { grid-column: 1 / -1; margin: 0; font-size: 0.78rem; }
@media (max-width: 480px) { .signup-location { grid-template-columns: 1fr; } }

/* Against SPY (#2582, #2584) — partials/against_spy.html, on the run page and the strategy page. */
.as-sub { font-size: 12px; color: var(--text-muted); font-weight: 600; margin: 0 0 6px; }
.as-sub-gap { margin-top: 22px; }
.as-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.as-thin { font-size: 12px; color: var(--text-muted); }
.as-chip { font: inherit; font-size: 11.5px; padding: 4px 11px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border); color: var(--text-muted); background: transparent; }
.as-chip.on { background: var(--bg-selected); border-color: var(--border-strong); color: var(--text-primary); }
.as-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-muted); margin-bottom: 8px; }
.as-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.as-legend b { width: 12px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 4px; }
.as-key { margin: 0 0 0 auto; }
.as-chart { position: relative; height: 270px; }
.as-chart-tall { height: 380px; }
/* SPY-ZOOM-01 (#2786) — the zoomable Against SPY chart. */
.as-tools { gap: 8px 10px; }
.as-tools-in { margin: 0; }
.as-play { border-color: var(--border-pos); }
.as-hud { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-left: auto; }
.as-stage { position: relative; }
.as-zoom { display: block; width: 100%; height: 400px; cursor: grab; touch-action: none; border-radius: 6px; }
/* CHART-ZOOM-01 (#2788) — any chart on the shared zoom kit (static/js/tp_zoom.js). */
.tpz-canvas { display: block; width: 100%; height: 340px; cursor: grab; touch-action: none; border-radius: 6px; }
.as-zoom.tpz-dragging, .tpz-canvas.tpz-dragging { cursor: grabbing; }
.tpz-brush { display: block; width: 100%; height: 44px; margin-top: 6px; cursor: ew-resize; touch-action: none;
  border-radius: 4px; background: var(--bg-base); }
.tpz-tools { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 8px; }
.tpz-hud { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-left: auto; }
.tpz-stage { position: relative; }
@media (max-width: 560px) { .tpz-canvas { height: 280px; } .tpz-hud { margin-left: 0; } }
.as-brush { display: block; width: 100%; height: 52px; margin-top: 6px; cursor: ew-resize; touch-action: none; border-radius: 4px;
  background: var(--bg-base); }
.as-tip { position: absolute; pointer-events: none; z-index: 3; background: var(--bg-base); border: 1px solid var(--border-strong);
  border-radius: 6px; padding: 7px 9px; font-size: 11.5px; line-height: 1.5; color: var(--text-primary); min-width: 180px; }
.as-pin { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-top: 8px; padding: 8px 10px;
  border: 1px solid var(--border-strong); border-radius: 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.as-pin-h { font-weight: 600; color: var(--text-heading); }
.as-pin-big { font-family: var(--font-mono); font-size: 18px; font-weight: 600; }
.as-pin[hidden], .as-tip[hidden] { display: none; }
.as-pin .pos { color: var(--text-pos); } .as-pin .neg { color: var(--text-neg); }
/* SPY-ZOOM-02 (#2791): a pinned bubble's trades, and a backtest trade's chart popup. */
.as-trades { margin-top: 6px; }
.as-trades[hidden] { display: none; }
.as-trades .as-scroll { max-height: 320px; overflow-y: auto; }
.as-trade-table td .as-chip { padding: 2px 9px; font-size: 11px; }
.as-trades .pos, .as-dialog .pos { color: var(--text-pos); } .as-trades .neg, .as-dialog .neg { color: var(--text-neg); }
.as-dialog { width: min(920px, calc(100vw - 32px)); max-width: none; padding: 14px 16px 16px; border: 1px solid var(--border-strong);
  border-radius: 8px; background: var(--bg-raised); color: var(--text-primary); }
.as-dialog::backdrop { background: var(--scrim); }
.as-dialog-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-heading); }
.as-dialog-chart { height: 380px; margin-top: 10px; color: var(--text-muted); font-size: 12px; }
@media (max-width: 560px) { .as-dialog-chart { height: 300px; } }
@media (max-width: 560px) { .as-zoom { height: 300px; } .as-hud { margin-left: 0; } }
.as-note { font-size: 11.5px; color: var(--text-muted); margin: 8px 0 0; }
.as-scroll { overflow-x: auto; }
.as-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; margin-top: 10px; }
.as-table th { font-size: 11px; font-weight: 600; color: var(--text-muted); text-align: right; padding: 6px 8px;
  border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.04em; }
.as-table td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.as-table th:first-child, .as-table td:first-child { text-align: left; }
.as-table .pos { color: var(--text-pos); } .as-table .neg { color: var(--text-neg); }
.sd-spy-scope { margin: 0 0 12px; }

/* COSTS-01 (#2541) — the Trading Costs education page, a short lesson with pictures (Jason,
   2026-11-06, mockup approved). The two exit colours are this page's own: blue a market
   exit (stop, time limit), amber a limit exit (target); checked with the dataviz palette
   validator against --bg-raised (lightness, chroma, colour-blind separation, contrast). */
.tc-edu { max-width: 980px; }
.tc-edu .tc-crumb { font-size: 12px; color: var(--text-muted); }
.tc-edu .tc-crumb a { color: var(--accent-bright); text-decoration: none; }
.tc-edu .tc-title { font-size: 2.1rem; line-height: 1.15; color: var(--text-heading); margin: 10px 0 8px; letter-spacing: -.01em; }
.tc-edu .tc-lede { font-size: 1.05rem; color: var(--text-primary); max-width: 62ch; margin: 0; }
.tc-edu p { max-width: 68ch; }
.tc-edu .tc-takeaways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0 8px; }
.tc-edu .tc-tk { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.tc-edu .tc-tk b { display: block; color: var(--text-heading); font-size: 15px; margin-bottom: 2px; }
.tc-edu .tc-tk span { color: var(--text-muted); font-size: 13px; }
.tc-edu .tc-tk .tc-n { display: block; font-size: 12px; font-weight: 700; color: var(--accent-bright); letter-spacing: .08em; }
.tc-edu .tc-section { margin-top: 46px; }
.tc-edu .tc-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--accent-bright); text-transform: uppercase; }
.tc-edu .tc-h2 { font-size: 1.5rem; color: var(--text-heading); margin: 4px 0 10px; }
.tc-edu .tc-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-top: 14px; }
.tc-edu .tc-two { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; align-items: center; }
.tc-edu .tc-muted { color: var(--text-muted); }
.tc-edu .tc-small { font-size: 13px; }
.tc-edu .tc-mt8 { margin: 8px 0 0; }
.tc-edu .tc-note { border-left: 3px solid var(--accent-bright); background: color-mix(in srgb, var(--accent-bright) 7%, transparent); padding: 10px 14px; border-radius: 0 8px 8px 0; margin-top: 14px; font-size: 14px; }
.tc-edu .tc-legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: var(--text-primary); margin: 4px 0 6px; }
.tc-edu .tc-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.tc-edu .tc-key-market { background: var(--exit-market); }
.tc-edu .tc-key-limit { background: var(--exit-limit); }
.tc-edu .tc-controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.tc-edu .tc-controls select { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: 6px; padding: 4px 8px; font: inherit; }
.tc-edu .tc-controls b { color: var(--text-heading); }
.tc-edu .tc-readout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.tc-edu .tc-ro { background: var(--bg-elevated); border-radius: 8px; padding: 10px 12px; }
.tc-edu .tc-ro .tc-l { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.tc-edu .tc-ro .tc-v { font-size: 22px; font-weight: 700; color: var(--text-heading); }
.tc-edu .tc-chart { position: relative; }
.tc-edu .tc-tip { position: absolute; pointer-events: none; background: var(--bg-base); border: 1px solid var(--border-strong); border-radius: 6px; padding: 6px 9px; font-size: 12px; color: var(--text-primary); white-space: nowrap; opacity: 0; transition: opacity .08s; }
.tc-edu .tc-quiz { display: grid; gap: 10px; }
.tc-edu .tc-q { background: var(--bg-elevated); border-radius: 10px; padding: 12px 14px; }
.tc-edu .tc-q button { background: transparent; border: 1px solid var(--border-strong); color: var(--text-primary); border-radius: 6px; padding: 4px 10px; margin: 6px 6px 0 0; cursor: pointer; font: inherit; font-size: 13px; }
.tc-edu .tc-q button.is-right { border-color: var(--accent-bright); background: color-mix(in srgb, var(--accent-bright) 15%, transparent); }
.tc-edu .tc-q button.is-wrong { border-color: var(--text-neg); background: color-mix(in srgb, var(--text-neg) 12%, transparent); }
.tc-edu .tc-why { display: none; margin-top: 8px; font-size: 13px; color: var(--text-muted); }
.tc-edu .tc-q.is-done .tc-why { display: block; }
.tc-edu .tc-never { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tc-edu .tc-never div { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.tc-edu .tc-never b { color: var(--text-heading); display: block; margin-bottom: 4px; }
.tc-edu .tc-never span { color: var(--text-muted); font-size: 13px; }
.tc-edu .tc-yours { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.tc-edu .tc-yours-line { font-size: 17px; color: var(--text-heading); margin-top: 4px; }
.tc-edu .tc-btn { text-decoration: none; }
.tc-edu .tc-pill { display: inline-block; background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 20px; padding: 3px 11px; font-size: 13px; margin: 3px 6px 3px 0; }
.tc-edu svg text { font-family: inherit; }
.tc-edu .tc-t { fill: var(--text-primary); }
.tc-edu .tc-t-strong { fill: var(--text-heading); font-weight: 700; }
.tc-edu .tc-t-muted { fill: var(--text-muted); }
.tc-edu .tc-fill-muted { fill: var(--text-muted); }
.tc-edu .tc-stroke-muted { stroke: var(--text-muted); }
.tc-edu .tc-box-market { fill: color-mix(in srgb, var(--exit-market) 16%, transparent); stroke: var(--exit-market); }
.tc-edu .tc-box-limit { fill: color-mix(in srgb, var(--exit-limit) 16%, transparent); stroke: var(--exit-limit); }
.tc-edu .tc-box-plain { fill: var(--bg-elevated); stroke: var(--border-strong); }
.tc-edu .tc-line-market { stroke: var(--exit-market); stroke-width: 2; }
.tc-edu .tc-line-limit { stroke: var(--exit-limit); stroke-width: 2; }
@media (max-width: 760px) {
  .tc-edu .tc-takeaways, .tc-edu .tc-never, .tc-edu .tc-readout, .tc-edu .tc-two { grid-template-columns: 1fr; }
}

/* COSTS-01 (#2541) — Edge Lab's strict-list mark: on the list after costs, or meeting the
   bar only before costs (the ticket's marker). */
.el-strict { display: inline-block; font-size: 0.7rem; padding: 0 6px; border-radius: 4px; border: 1px solid var(--accent-bright); color: var(--text-pos); white-space: nowrap; }
.el-strict.is-before-only { border-color: var(--text-warn); color: var(--text-warn); }

/* ===================================================================== */
/* education/indicator_runs.html, redesigned 2026-11-06 (Jason: "positive personality and */
/* style"): the RSI drawn, the two choices as rows of days, a 30 / 32 switch.            */
/* ===================================================================== */
.irp { max-width: 940px; font-size: 15px; }
.irp p { line-height: 1.6; max-width: 68ch; }
.irp b { color: var(--text-heading); }
.irp-kick { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-bright); margin-top: 10px; }
.irp-h1 { font-family: var(--font-display); color: var(--text-heading); font-size: 2.05rem; line-height: 1.15; margin: 8px 0 12px; text-wrap: balance; }
.irp-lead { font-size: 1.08rem; }
.irp-h2 { font-family: var(--font-display); color: var(--text-heading); font-size: 1.3rem; margin: 0 0 8px; text-wrap: balance; }
.irp-sec { margin-top: 42px; }
.irp-card { background: linear-gradient(180deg, var(--bg-elevated), var(--bg-raised)); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.irp-card svg { width: 100%; height: auto; display: block; margin: 8px 0; }
.irp-cardh { color: var(--text-heading); font-weight: 600; margin-bottom: 6px; }
.irp-small { font-size: 0.8rem; color: var(--text-muted); margin: 8px 0 0; }
.irp-ax { fill: var(--text-muted); font-family: var(--font-mono); }
.irp-lvl { stroke: var(--accent-bright); }
.irp-lvltext { fill: var(--accent-bright); font-family: var(--font-mono); }
.irp-gap { fill: var(--bg-raised); }
.irp-line { stroke: var(--text-heading); }
.irp-dot-on { fill: var(--accent-bright); }
.irp-dot-off { fill: var(--bg-raised); stroke: var(--text-muted); }
.irp-daytext { fill: var(--pos-text); font-family: var(--font-mono); }
.irp-details { margin-top: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-base); }
.irp-details summary { cursor: pointer; padding: 10px 14px; color: var(--text-heading); }
.irp-table { width: calc(100% - 28px); margin: 0 14px 14px; border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.irp-table th, .irp-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.irp-table th { color: var(--text-muted); font-weight: 500; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; }
.irp-days, .irp-row { display: grid; grid-template-columns: 120px repeat(10, 1fr) 120px; gap: 6px; align-items: center; }
.irp-days { font-size: 0.7rem; color: var(--text-muted); text-align: center; font-family: var(--font-mono); }
.irp-row { margin-top: 10px; }
.irp-rl { font-size: 0.85rem; color: var(--text-heading); }
.irp-cnt { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted); text-align: right; }
.irp-cell { height: 30px; border-radius: 8px; background: var(--bg-base); border: 1px solid var(--border); display: grid; place-items: center; font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-mono); }
.irp-cell.hit { background: var(--accent-bright); border-color: transparent; color: var(--on-accent-bright); font-weight: 600; }
.irp-toggle { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-base); border: 1px solid var(--border); border-radius: 999px; margin-bottom: 12px; }
.irp-toggle button { cursor: pointer; border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-muted); }
.irp-toggle button.on { background: var(--accent-bright); color: var(--on-accent-bright); font-weight: 600; }
.irp-toggle button:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
.irp-callout { margin-top: 14px; padding: 12px 16px; border-left: 3px solid var(--accent-bright); background: var(--bg-base); border-radius: 0 12px 12px 0; line-height: 1.5; }
.irp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.irp-gate { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 8px; align-items: center; font-size: 0.85rem; margin-top: 8px; }
.irp-gh { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); text-align: center; }
.irp-pill { text-align: center; padding: 6px; border-radius: 8px; font-family: var(--font-mono); font-size: 0.8rem; }
.irp-pill.ok { background: color-mix(in srgb, var(--accent-bright) 18%, transparent); color: var(--pos-text); }
.irp-pill.no { background: color-mix(in srgb, var(--regime-correction) 15%, transparent); color: var(--neg-text); }
.irp-pill.res { background: var(--bg-base); border: 1px solid var(--border); color: var(--text-heading); }
.irp-tl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.irp-tl.irp-tl4 { grid-template-columns: repeat(4, 1fr); }
.irp-tl div { padding: 8px; border-radius: 8px; background: var(--bg-base); border: 1px solid var(--border); font-size: 0.78rem; text-align: center; min-height: 54px; }
.irp-tl .in { border-color: var(--accent-bright); color: var(--text-heading); }
.irp-tl .stop { border-color: var(--regime-correction); color: var(--neg-text); }
.irp-tl .skip { opacity: .45; }
.irp-tl b { display: block; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); font-weight: 400; margin-bottom: 4px; }
.irp-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.irp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.irp-chip { padding: 6px 10px; border-radius: 999px; font-size: 0.8rem; border: 1px solid var(--border); background: var(--bg-base); color: var(--text-muted); }
.irp-chip.yes { border-color: color-mix(in srgb, var(--accent-bright) 50%, transparent); color: var(--text-heading); }
@media (max-width: 760px) {
  .irp-two, .irp-three { grid-template-columns: 1fr; }
  .irp-days, .irp-row { grid-template-columns: 70px repeat(10, 1fr); }
  .irp-cnt, .irp-days span:last-child { display: none; }
  .irp-h1 { font-size: 1.65rem; }
}

/* ===================================================================== */
/* education/universe.html, redesigned 2026-11-06 (Jason: "positive personality and style"): */
/* the universe as six doors, with live counts and the live fund mix.                        */
/* ===================================================================== */
.unp { max-width: 940px; font-size: 15px; }
.unp p { line-height: 1.6; max-width: 68ch; }
.unp b { color: var(--text-heading); }
.unp-kick { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-bright); margin-top: 10px; }
.unp-h1 { font-family: var(--font-display); color: var(--text-heading); font-size: 2.05rem; line-height: 1.15; margin: 8px 0 12px; text-wrap: balance; }
.unp-lead { font-size: 1.08rem; }
.unp-h2 { font-family: var(--font-display); color: var(--text-heading); font-size: 1.3rem; margin: 0 0 8px; }
.unp-sec { margin-top: 42px; }
.unp-card { background: linear-gradient(180deg, var(--bg-elevated), var(--bg-raised)); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.unp-hero { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; margin-top: 18px; }
.unp-big { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.unp-big .v { font-family: var(--font-mono); font-size: 2.1rem; color: var(--text-heading); line-height: 1.1; }
.unp-big .l { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }
.unp-big.total { border-color: var(--accent-bright); background: linear-gradient(135deg, color-mix(in srgb, var(--accent-bright) 16%, transparent), var(--bg-raised) 60%); }
.unp-big.total .v { color: var(--pos-text); }
.unp-doors { display: flex; flex-direction: column; }
.unp-door { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; background: var(--bg-base); border: 1px solid var(--border); border-radius: 12px; position: relative; }
.unp-door + .unp-door { margin-top: 10px; }
.unp-door + .unp-door::before { content: ""; position: absolute; left: 43px; top: -11px; height: 10px; border-left: 2px dashed var(--accent-bright); opacity: .6; }
.unp-door .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent-bright) 14%, transparent); color: var(--accent-bright); }
.unp-door .ic svg { width: 22px; height: 22px; }
.unp-door .t { color: var(--text-heading); font-weight: 600; }
.unp-door .d { color: var(--text-muted); font-size: 0.85rem; line-height: 1.45; margin-top: 2px; }
.unp-door .rule { font-family: var(--font-mono); color: var(--pos-text); font-size: 0.9rem; text-align: right; white-space: nowrap; }
.unp-why { margin-top: 14px; padding: 12px 16px; border-left: 3px solid var(--accent-bright); background: var(--bg-base); border-radius: 0 12px 12px 0; }
.unp-mix { display: flex; height: 16px; border-radius: 999px; overflow: hidden; margin: 2px 0 12px; }
.unp-mix i { display: block; height: 100%; }
.unp-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-muted); }
.unp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.unp-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.unp-legend b { font-family: var(--font-mono); font-weight: 500; }
.unp-out { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.unp-oc { background: var(--bg-base); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.unp-oc .h { display: flex; align-items: center; gap: 8px; color: var(--text-heading); font-weight: 600; font-size: 0.92rem; }
.unp-oc .h i { width: 18px; height: 18px; border-radius: 50%; background: color-mix(in srgb, var(--regime-correction) 18%, transparent); color: var(--neg-text); display: grid; place-items: center; font-style: normal; font-size: 0.75rem; flex: none; }
.unp-oc .d { color: var(--text-muted); font-size: 0.8rem; line-height: 1.45; margin-top: 6px; }
@media (max-width: 760px) {
  .unp-hero, .unp-out { grid-template-columns: 1fr; }
  .unp-door { grid-template-columns: 44px 1fr; }
  .unp-door .rule { grid-column: 2; text-align: left; }
  .unp-h1 { font-size: 1.65rem; }
}

/* ===================================================================== */
/* education/indicator_detail.html, redesigned 2026-11-06 (Jason: "positive personality */
/* and style"): one template for every indicator page. Tokens only (#1747 ratchet).    */
/* ===================================================================== */
.idp { max-width: 1040px; }
.idp .idp-hero { display: grid; grid-template-columns: 1fr 1.05fr; gap: 26px; align-items: center; margin-top: 12px; }
.idp .idp-hero.idp-hero-solo { grid-template-columns: 1fr; }
.idp .idp-fam { display: inline-block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-bright); background: color-mix(in srgb, var(--accent-bright) 12%, transparent); padding: 4px 10px; border-radius: 999px; border: 0; }
.idp .idp-title { font-family: var(--font-display); color: var(--text-heading); font-size: 2.2rem; line-height: 1.1; margin: 12px 0 10px; }
.idp .idp-tag { font-size: 1.08rem; color: var(--text-primary); max-width: 48ch; font-style: normal; }
.idp-facts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.idp-fact { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; max-width: 240px; }
.idp-fact .v { font-family: var(--font-mono); color: var(--text-heading); font-size: 1.02rem; }
.idp-fact .l { color: var(--text-muted); font-size: 0.75rem; line-height: 1.35; }
.idp .idp-chart { border-radius: 16px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.idp .idp-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 40px; }
.idp .idp-tc { background: linear-gradient(180deg, var(--bg-elevated), var(--bg-raised)); border: 1px solid var(--border); border-radius: 16px; padding: 18px; margin: 0; }
.idp .idp-tc .edu-section-title { font-family: var(--font-display); font-size: 1rem; color: var(--text-heading); margin: 0 0 8px; }
.idp .idp-tc .edu-section-body { font-size: 0.9rem; line-height: 1.6; }
.idp-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 1.1rem; margin-bottom: 10px; }
.idp-ic-blue { background: color-mix(in srgb, var(--regime-sideways) 16%, transparent); color: var(--regime-sideways); }
.idp-ic-gold { background: color-mix(in srgb, var(--regime-pullback) 16%, transparent); color: var(--regime-pullback); }
.idp-ic-green { background: color-mix(in srgb, var(--accent-bright) 16%, transparent); color: var(--pos-text); }
.idp .idp-sec { margin-top: 46px; }
.idp .idp-h2 { font-family: var(--font-display); color: var(--text-heading); font-size: 1.35rem; margin: 0 0 6px; }
.idp .idp-sub { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 14px; max-width: 70ch; }
.idp .idp-params { display: grid; gap: 14px; }
.idp .idp-param { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; }
.idp .idp-param .edu-param-name { font-family: var(--font-display); color: var(--text-heading); font-size: 1.05rem; }
.idp .idp-param .edu-param-default { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent-bright); background: color-mix(in srgb, var(--accent-bright) 12%, transparent); padding: 2px 8px; border-radius: 999px; }
.idp .idp-knob { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.idp .idp-knob .edu-param-effect { border-radius: 12px; padding: 12px 14px; background: var(--bg-base); border: 1px solid var(--border); }
.idp .idp-knob .edu-param-increase { border-left: 3px solid var(--accent-bright); }
.idp .idp-knob .edu-param-decrease { border-left: 3px solid var(--regime-pullback); }
.idp .idp-knob .edu-param-effect-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: .06em; text-transform: uppercase; }
.idp .idp-knob .edu-param-increase .edu-param-effect-label { color: var(--pos-text); }
.idp .idp-knob .edu-param-decrease .edu-param-effect-label { color: var(--regime-pullback); }
.idp .idp-knob p { font-size: 0.86rem; margin: 4px 0 0; }
.idp .idp-sets-h { margin: 18px 0 10px; }
.idp .idp-sets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.idp .idp-sets { align-items: start; }
.idp .idp-sets .edu-setting-row { min-height: 0; height: auto; grid-template-columns: none; background: var(--bg-base); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.idp .idp-sets .edu-setting-value { font-family: var(--font-mono); color: var(--pos-text); }
.idp .idp-sets .edu-setting-desc { font-size: 0.82rem; color: var(--text-muted); flex: none; }
.idp .idp-sets .edu-setting-value { min-width: 0; }
.idp .idp-sets .edu-setting-row { padding: 12px 14px; }
.idp-jumps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.idp-jump { font-size: 0.8rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-raised); color: var(--text-primary); text-decoration: none; }
.idp-jump:hover, .idp-jump:focus-visible { border-color: var(--accent-bright); color: var(--pos-text); }
.idp .idp-gate { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px; margin: 0 0 10px; padding: 0; transition: border-color .15s ease; }
.idp .idp-gate[open] { border-color: color-mix(in srgb, var(--accent-bright) 55%, transparent); box-shadow: var(--shadow-card); }
.idp .idp-gate > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 34px minmax(140px, 220px) 1fr 18px; align-items: center; gap: 12px; padding: 14px 16px; }
.idp .idp-gate > summary::-webkit-details-marker { display: none; }
.idp .idp-gate > summary:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: -2px; border-radius: 14px; }
.idp .idp-gate .edu-action-name { font-family: var(--font-display); color: var(--text-heading); font-size: 1rem; margin: 0; }
.idp-gi { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent-bright) 14%, transparent); color: var(--pos-text); font-family: var(--font-mono); font-size: 0.85rem; }
.idp-gm { color: var(--text-muted); font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idp-chev { color: var(--text-muted); transition: transform .15s ease; }
.idp .idp-gate[open] .idp-chev { transform: rotate(90deg); }
.idp .idp-gb { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 16px 16px; }
.idp .idp-gcol { background: var(--bg-base); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0; }
.idp .idp-gcol .edu-action-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.idp .idp-good .edu-action-label { color: var(--pos-text); }
.idp .idp-warn .edu-action-label { color: var(--regime-pullback); }
.idp .idp-warn p, .idp .idp-gcol.edu-action-block-warning p { color: var(--text-primary); }
.idp .idp-gcol p { font-size: 0.87rem; margin: 6px 0 0; line-height: 1.55; }
.idp .idp-seechart { grid-column: 1 / -1; font-size: 0.8rem; }
.idp .idp-gate .edu-action-nocontent, .idp .idp-gate .edu-action-footer { padding: 0 16px 14px; margin: 0; }
.idp .idp-cta { margin-top: 34px; text-align: center; padding: 22px; border-radius: 16px; border: 1px dashed var(--border); }
@media (prefers-reduced-motion: reduce) { .idp-chev, .idp .idp-gate { transition: none; } }
@media (max-width: 820px) {
  .idp .idp-hero, .idp .idp-three, .idp .idp-knob, .idp .idp-sets, .idp .idp-gb { grid-template-columns: 1fr; }
  .idp .idp-gate > summary { grid-template-columns: 30px 1fr 16px; }
  .idp-gm { display: none; }
  .idp .idp-title { font-size: 1.75rem; }
}

/* ===================================================================== */
/* education/indicators.html (the Indicator Library front), redesigned 2026-11-06: how the */
/* pieces fit as one picture, three short cards, the families as chips. Tokens only.        */
/* ===================================================================== */
.lip-kick { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-bright); }
.lip .lip-h1 { font-family: var(--font-display); color: var(--text-heading); font-size: 2.15rem; line-height: 1.15; margin: 8px 0 12px; text-wrap: balance; }
.lip .lip-lead { font-size: 1.08rem; max-width: 68ch; }
.lip-sec { margin-top: 38px; }
.lip-h2 { font-family: var(--font-display); color: var(--text-heading); font-size: 1.3rem; margin: 0 0 8px; }
.lip-sub { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 12px; }
.lip-flow { display: grid; grid-template-columns: 1fr 34px 1fr 34px 1fr 34px 1fr; align-items: stretch; margin-top: 16px; }
.lip-step { background: linear-gradient(180deg, var(--bg-elevated), var(--bg-raised)); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.lip-step .k { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-bright); }
.lip-step .t { font-family: var(--font-display); color: var(--text-heading); font-size: 1.05rem; margin: 6px 0; }
.lip-step .b { font-size: 0.85rem; color: var(--text-muted); line-height: 1.45; }
.lip-step .ex { margin-top: 10px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--pos-text); background: var(--bg-base); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.lip-step.end { border-color: var(--accent-bright); background: linear-gradient(135deg, color-mix(in srgb, var(--accent-bright) 16%, transparent), var(--bg-raised) 60%); }
.lip-arrow { display: grid; place-items: center; color: var(--accent-bright); font-size: 1.3rem; }
.lip-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lip-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.lip-card h3 { font-family: var(--font-display); color: var(--text-heading); font-size: 1rem; margin: 0 0 8px; }
.lip-card p { font-size: 0.88rem; line-height: 1.55; margin: 0 0 8px; }
.lip-card a { color: var(--accent-bright); }
.lip-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 10px; }
.lip-ic-filter { background: color-mix(in srgb, var(--regime-sideways) 16%, transparent); color: var(--regime-sideways); }
.lip-ic-dial { background: color-mix(in srgb, var(--regime-pullback) 16%, transparent); color: var(--regime-pullback); }
.lip-ic-regime { background: color-mix(in srgb, var(--accent-bright) 16%, transparent); color: var(--pos-text); }
.lip-reg { display: flex; gap: 4px; margin: 4px 0 10px; }
.lip-reg i { flex: 1; height: 8px; border-radius: 999px; }
.lip-fams { display: flex; flex-wrap: wrap; gap: 8px; }
.lip-fam { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: var(--bg-raised); border: 1px solid var(--border); color: var(--text-primary); font-size: 0.85rem; text-decoration: none; }
.lip-fam:hover, .lip-fam:focus-visible { border-color: var(--accent-bright); color: var(--pos-text); }
.lip-fam b { font-family: var(--font-mono); font-weight: 500; color: var(--pos-text); font-size: 0.78rem; }
@media (max-width: 860px) {
  .lip-flow, .lip-three { grid-template-columns: 1fr; }
  .lip-arrow { transform: rotate(90deg); height: 28px; }
}

/* STRATEGY-CHECKS-01 (#2692): random days, Monte Carlo and Plateau after a full run. */
.chk { margin: 1.25rem 0; }
.chk-head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.chk-title { font-size: 1.05rem; color: var(--text-heading); margin: 0; }
.chk-sub, .chk-note { color: var(--text-muted); font-size: 0.78rem; }
.chk-note { margin: 0.5rem 0 0; }
.chk-warn-note { color: var(--text-warn); }
/* Jason, 2026-11-23: what a check's numbers mean, in one plain sentence. */
.chk-verdict { margin: 0.6rem 0 0; padding: 0.5rem 0.7rem; border-radius: 6px; border: 1px solid var(--border); font-size: 0.82rem; line-height: 1.45; }
.chk-verdict p { margin: 0; }
.chk-verdict p + p { margin-top: 0.3rem; }
.chk-good { border-color: var(--text-pos); background: color-mix(in srgb, var(--text-pos) 10%, transparent); }
.chk-meh { border-color: var(--border-warn); background: var(--bg-warn-tint); }
.chk-bad { border-color: var(--text-neg); background: color-mix(in srgb, var(--text-neg) 10%, transparent); }
.chk-empty, .chk-wait { color: var(--text-muted); font-size: 0.85rem; margin: 0.4rem 0; }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 0.9rem; }
.chk-card { background-color: var(--bg-card); background-image: var(--grad-card); border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem 1rem; min-width: 0; }
.chk-card-wide { grid-column: 1 / -1; }
.chk-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.chk-card-head h3 { margin: 0; font-size: 0.95rem; color: var(--text-heading); }
.chk-q { margin: 0.15rem 0 0.7rem; color: var(--text-muted); font-size: 0.82rem; }
.chk-sub-h { font-size: 0.78rem; font-weight: 600; color: var(--text-primary); margin: 0.8rem 0 0.4rem; display: flex; align-items: center; gap: 0.35rem; }
.chk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.6rem 0.9rem; margin: 0; }
.chk-stats dt { font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.3rem; }
.chk-stats dd { margin: 0.15rem 0 0; font-size: 1rem; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.chk-stats dd.chk-big { font-size: 1.35rem; font-weight: 600; }
.chk-stats .chk-span { grid-column: 1 / -1; }
.chk .pos, .chk-stats dd.pos { color: var(--text-pos); }
.chk .neg, .chk-stats dd.neg { color: var(--text-neg); }
.chk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-bright); margin-right: 0.45rem; animation: chk-pulse 1.4s ease-in-out infinite; }
@keyframes chk-pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .chk-dot { animation: none; } }
.chk-btn { background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent-bright); border-radius: 6px; padding: 0.45rem 1rem; font-size: 0.85rem; cursor: pointer; }
.chk-btn:hover { background: var(--accent-bright); }
.chk-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
/* Pressed: the button says so at once, while the server starts the work (2026-11-23). */
.chk-starting .chk-btn, .chk-btn:disabled { cursor: progress; opacity: 0.75; }
.chk-starting .chk-btn::before { content: ""; display: inline-block; width: 0.8em; height: 0.8em; margin-right: 0.45em;
  vertical-align: -0.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: chk-spin 0.8s linear infinite; }
@keyframes chk-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .chk-starting .chk-btn::before { animation: none; } }
.chk-admin { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0.4rem 0 0.8rem; padding: 0.5rem 0.7rem; border: 1px dashed var(--border-warn); border-radius: 6px; }
.chk-btn-quiet { background: transparent; color: var(--text-warn); border-color: var(--border-warn); }
.chk-btn-quiet:hover { background: var(--bg-warn-tint); }
/* #2767: random days and Monte Carlo start from one button above their two cards. */
.chk-start { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0 0 0.9rem; }
.chk-start .chk-note, .chk-start .chk-wait { margin: 0; }
.chk-table-wrap { overflow-x: auto; }
.chk-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 0.82rem; }
.chk-table th, .chk-table td { padding: 0.45rem 0.6rem; text-align: center; vertical-align: top; }
.chk-table thead th { color: var(--text-muted); font-weight: 500; font-size: 0.74rem; white-space: nowrap; }
.chk-table tbody th { text-align: left; font-weight: 400; text-transform: none; letter-spacing: normal; font-size: 0.82rem; }
.chk-table td[data-side]::before { display: none; }
@media (max-width: 640px) {
  .chk-table thead { display: none; }
  .chk-table, .chk-table tbody { display: block; }
  .chk-table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-bottom: 10px; }
  .chk-table tbody th { grid-column: 1 / -1; padding: 0.2rem 0; }
  .chk-table td { padding: 0.4rem 0.3rem; }
  .chk-table td[data-side]::before { display: block; content: attr(data-side); font-size: 0.66rem; color: var(--text-muted); margin-bottom: 2px; }
}
.chk-table td { background: var(--bg-sunken); border-radius: 6px; }
.chk-table td.chk-yours { background: var(--bg-selected); }
.chk-table td.chk-better { background: var(--bg-pos-tint); box-shadow: inset 0 0 0 1px var(--border-pos); }
.chk-table td.chk-worse { background: var(--bg-neg-tint); box-shadow: inset 0 0 0 1px var(--border-neg); }
.chk-set { display: block; color: var(--text-primary); }
.chk-gate { display: block; color: var(--text-muted); font-size: 0.72rem; }
.chk-val { display: block; color: var(--text-muted); font-size: 0.72rem; }
.chk-fig { display: block; font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.chk-better .chk-fig { color: var(--text-pos); }
.chk-worse .chk-fig { color: var(--text-neg); }
.chk-mini { display: block; color: var(--text-muted); font-size: 0.7rem; }
.chk-disclaimer { margin-top: 0.75rem; font-size: 0.72rem; }
/* #2844 (Jason, 2026-11-25): random days and Monte Carlo neatened; Plateau's "Use this"
   and its full-run button. The two cards stretch to one height, their notes at the foot. */
.chk-grid > .chk-card:not(.chk-card-wide) { display: flex; flex-direction: column; }
.chk-foot { margin-top: auto; padding-top: 0.6rem; }
.chk-lbl { font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.3rem; }
.chk-lead { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.chk-hero { font-size: 1.9rem; font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.chk-pill { font-size: 0.7rem; font-weight: 600; border-radius: 999px; padding: 0.2rem 0.6rem; border: 1px solid var(--border); white-space: nowrap; }
.chk-pill-good { color: var(--text-pos); border-color: var(--border-pos); background: var(--bg-pos-tint); }
.chk-pill-meh { color: var(--text-warn); border-color: var(--border-warn); background: var(--bg-warn-tint); }
.chk-bars { margin: 0.75rem 0 0; padding: 0.6rem 0.75rem; background: var(--bg-sunken); border-radius: 8px; display: flex; flex-direction: column; gap: 0.45rem; }
.chk-bar-row { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 3.6rem; align-items: center; gap: 0.5rem; }
.chk-bar-track { position: relative; height: 14px; }
.chk-bar-zero { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--border-strong); }
.chk-bar { position: absolute; top: 0; bottom: 0; min-width: 2px; border-radius: 3px; }
.chk-bar-yours { background: var(--accent-bright); }
.chk-bar-yours.neg { background: var(--text-neg); }
.chk-bar-random { background: var(--text-muted); }
.chk-bar-mark { position: absolute; top: -4px; bottom: -4px; border-left: 1px dashed var(--text-warn); }
.chk-bar-num { font-size: 0.82rem; text-align: right; font-variant-numeric: tabular-nums; }
.chk-bar-axis .chk-bar-track { height: 12px; font-size: 0.66rem; color: var(--text-muted); }
.chk-axis-0, .chk-axis-mark { position: absolute; top: 0; white-space: nowrap; }
.chk-axis-0 { transform: translateX(-50%); }
.chk-axis-mark { color: var(--text-warn); padding-left: 4px; }
.chk-mc { width: 100%; border-collapse: collapse; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.chk-mc thead th { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); text-align: right; padding: 0 0 0.3rem; white-space: nowrap; }
.chk-mc thead th > * { vertical-align: middle; }
.chk-mc tbody th { text-align: left; font-weight: 400; font-size: 0.75rem; color: var(--text-muted); padding: 0.45rem 0; white-space: nowrap; }
.chk-mc td { text-align: right; padding: 0.45rem 0; border-top: 1px solid var(--border); }
.chk-mc tbody th { border-top: 1px solid var(--border); }
.chk-mc td.chk-mc-key { font-size: 0.95rem; font-weight: 650; }
.chk-warn-num { color: var(--text-warn); }
.chk-warn-line { display: flex; gap: 0.4rem; align-items: flex-start; line-height: 1.4; }
.chk-warn-line svg { flex-shrink: 0; margin-top: 2px; }
.chk-stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chk-range { position: relative; height: 2.1rem; margin-top: 0.35rem; }
.chk-range-track, .chk-range-band { position: absolute; top: 6px; height: 6px; border-radius: 3px; }
.chk-range-track { left: 0; right: 0; background: var(--bg-sunken); }
.chk-range-band { background: var(--accent); }
.chk-range-dot { position: absolute; top: 2px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--text-heading); border: 2px solid var(--bg-card); box-sizing: border-box; }
.chk-range-lbl { position: absolute; top: 1.05rem; transform: translateX(-50%); font-size: 0.7rem; white-space: nowrap; color: var(--text-muted); }
.chk-range-act { color: var(--text-heading); }
.chk-plan { margin: 0.75rem 0 0; padding: 0.5rem 0.7rem; background: var(--bg-sunken); border-radius: 6px; font-size: 0.82rem; line-height: 1.45; }
.chk-mini-inline { color: var(--text-muted); }
.chk-changed { margin-bottom: 0.5rem; }
.chk-use { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-bright); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.chk-use:hover { color: var(--text-pos); }
.chk-use:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.chk-use:disabled { color: var(--text-muted); cursor: not-allowed; text-decoration: none; }
/* The Composer's gates panel styles every button in it (border, padding); "Use this" is a
   plain link on the value line, so the tile keeps its shape (Jason, 2026-11-25). */
.app-composer .composer-gates-panel button.chk-use { background: none; border: 0; border-radius: 0;
  padding: 0; font: inherit; color: var(--accent-bright); line-height: inherit; }
.app-composer .composer-gates-panel button.chk-use:hover { color: var(--text-pos); }
.chk-table tr[hidden], .chk-table tfoot[hidden] { display: none; }
.chk-table .chk-confirm-row td, .chk-table tfoot td { background: none; box-shadow: none; }
.chk-table td.chk-picked { box-shadow: inset 0 0 0 2px var(--text-pos); }
.chk-confirm { display: flex; align-items: center; gap: 0.6rem 1rem; flex-wrap: wrap; text-align: left; padding: 0.55rem 0.75rem; border: 1px solid var(--border-strong); background: var(--bg-elevated); border-radius: 8px; }
.chk-confirm-text { flex: 1 1 260px; margin: 0; font-size: 0.82rem; line-height: 1.45; }
.chk-confirm-text .chk-mini-inline { display: block; }
.chk-confirm-btns { display: flex; gap: 0.5rem; }
.chk-rerun-cell { text-align: center; }
/* The boxes keep their width: the columns are fixed, so a long line under the run button
   or in the confirm row cannot widen one of them (Jason: "I like the current sizing"). */
.chk-table { table-layout: fixed; }
.chk-table thead th:first-child { width: 28%; }
.chk-mc th { text-transform: none; letter-spacing: normal; }
.chk-rerun-cell .chk-btn { margin-top: 0.4rem; }
.chk-rerun-cell .chk-mini { margin-top: 0.35rem; line-height: 1.4; }
@media (max-width: 640px) {
  .chk-table .chk-confirm-row td, .chk-table tfoot .chk-rerun-cell { grid-column: 1 / -1; }
  .chk-table tfoot td:empty { display: none; }
  .chk-table tfoot { display: block; }
  .chk-table tfoot[hidden] { display: none; }
}
/* The "?" bubble: a native details element, so it needs no script on either page. */
.chk-help { position: relative; display: inline-block; }
.chk-help > summary { list-style: none; cursor: pointer; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border-strong); color: var(--text-muted); font-size: 0.65rem; line-height: 14px; text-align: center; font-weight: 600; }
.chk-help > summary::-webkit-details-marker { display: none; }
.chk-help > summary:hover, .chk-help[open] > summary { color: var(--text-primary); border-color: var(--accent-bright); }
.chk-help > summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.chk-help-pop { position: absolute; z-index: 50; top: 22px; right: -8px; width: min(300px, 78vw); background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 8px; padding: 0.6rem 0.75rem; font-size: 0.78rem; font-weight: 400; line-height: 1.45; color: var(--text-primary); text-align: left; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); white-space: normal; }
.chk-toasts { top: auto; bottom: 16px; }
.chk-toast-link { color: inherit; text-decoration: none; }
.chk-toast-link:hover { text-decoration: underline; }

/* ===================================================================== */
/* Acknowledgments (#2831): the boxes, the sign-in screen, the Composer window. */
/* ===================================================================== */
.ack-box { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.6rem 0; line-height: 1.45;
  font-size: 0.9rem; color: var(--text-primary); cursor: pointer; text-align: left; }
.ack-box input[type="checkbox"] { margin-top: 0.2rem; flex: 0 0 auto; width: 1rem; height: 1rem; }
.ack-links { display: block; margin-top: 0.2rem; font-size: 0.8rem; color: var(--text-muted); }
.ack-links a { color: var(--accent-bright); }
.ack-page { max-width: 44rem; margin: 2rem auto; padding: 0 1rem; }
.ack-page h1 { font-size: 1.5rem; margin-bottom: 0.4rem; }
.ack-card { padding: 1.25rem 1.4rem; margin: 1rem 0; }
.ack-card .btn-primary { margin-top: 0.8rem; }
.ack-foot { font-size: 0.8rem; }
.ack-ai-title { font-size: 1.05rem; margin: 1.2rem 0 0.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.ack-points { margin: 0 0 0.8rem 1.2rem; padding: 0; font-size: 0.88rem; line-height: 1.55; color: var(--text-primary); }
.ack-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg-base) 75%, transparent); padding: 1rem; }
.ack-modal-card { max-width: 36rem; width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 0.6rem; padding: 1.4rem 1.5rem; }
.ack-modal-card h2 { font-size: 1.15rem; margin: 0 0 0.6rem; }
.ack-modal-card .btn-primary { margin-top: 0.6rem; }
.ack-modal-card .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.price-card form .ack-box { font-size: 0.78rem; margin: 0 0 0.6rem; color: var(--text-muted); }
.rg-own-label { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; white-space: normal; }
.sig-own-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.35rem; }
.ai-label { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; }
.rg-matches-note { flex-basis: 100%; order: 3; font-size: 0.78rem; color: var(--text-muted); margin: 0.3rem 0 0; }
.modal-hint { font-size: 0.72rem; color: var(--text-muted); margin: 0.3rem 0 0; line-height: 1.4; }
.composer-ideas-label { font-size: 0.72rem; color: var(--text-muted); margin: 0.4rem 0 0; }
.legal-change-banner { margin: 0.5rem 1rem; padding: 0.55rem 0.9rem; border: 1px solid var(--border); border-radius: 0.4rem; background: var(--bg-card); font-size: 0.85rem; color: var(--text-primary); }
.cx-report { margin-top: 0.5rem; font-size: 0.78rem; } .cx-report form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.35rem; }
