/* QFST design language: a terminal. Black panels, hairline rules, monospace data and tight rows, in
   the manner of Godel Terminal; light mode is the same layout on paper. One set of tokens and one set of
   components for every page. Colour is reserved for data and state; mint marks what is active. */

/* ---- tokens ------------------------------------------------------------------------------------------ */
:root {
  color-scheme: light;
  --page: #f7f7f4; --surface-1: #fcfcfa; --surface-2: #ebeae5;
  --text-primary: #26251e; --text-secondary: #5d5c55; --text-muted: #6f6e66;
  --border: #dddcd5; --gridline: #ebeae5; --baseline: #b3b1a8;
  --accent: #0a7a51; --accent-soft: #dff1e8; --on-accent: #fcfcfa;
  --critical: #c8402f; --critical-soft: #f7e0db; --warning: #8a6416; --warning-soft: #f5ecd7; --good: #0a7a51;
  /* Data, validated with the dataviz checks (lightness band, CVD separation, contrast). Diverging is
     the chart green (risk-on) to red (defensive); cells always print their value as well. */
  --series-1: #1f8a65; --series-2: #e2580e; --series-3: #7a5bc7;
  --div-neg-3: #c8402f; --div-neg-2: #e48b7b; --div-neg-1: #f4d3cb; --div-mid: #ebeae5;
  --div-pos-1: #d2e9dc; --div-pos-2: #7cc19f; --div-pos-3: #1f8a65; --div-strong-text: #fcfcfa;
  --seq-track: #ebeae5; --seq-fill: #1f8a65;
  --age-0: #d6ab6c; --age-1: #cc8640; --age-2: #b45f1e; --age-3: #86400f; --age-4: #4a210b;
  /* Eight categorical hues for many-line charts, in fixed order (dataviz reference palette, validated). */
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100; --cat-5: #e87ba4; --cat-6: #008300; --cat-7: #6250d6; --cat-8: #e34948;
  /* Type and rhythm */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font: var(--font-mono);
  --font-display: "Quantico", system-ui, sans-serif;
  --gap: 6px; --pad: 10px; --bar: 34px; --sidebar: 200px;
  /* Motion: quick and decelerating; nothing waits on an animation. */
  --ease: cubic-bezier(.2, .7, .2, 1); --fast: 120ms; --base: 200ms;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #000000; --surface-1: #0a0a0a; --surface-2: #151515;
    --text-primary: #eaeaea; --text-secondary: #a3a3a3; --text-muted: #808080;
    --border: #222222; --gridline: #161616; --baseline: #3a3a3a;
    --accent: #33e29a; --accent-soft: #0e2018; --on-accent: #000000;
    --critical: #ff6868; --critical-soft: #2a1212; --warning: #e89a3c; --warning-soft: #2b1d11; --good: #33e29a;
    --series-1: #20a374; --series-2: #e06a1c; --series-3: #8b72dc;
    --div-neg-3: #e85c58; --div-neg-2: #9a3532; --div-neg-1: #3d1716; --div-mid: #1a1a1a;
    --div-pos-1: #0c2c20; --div-pos-2: #13694b; --div-pos-3: #20a374; --div-strong-text: #000000;
    --seq-track: #1a1a1a; --seq-fill: #20a374;
    --age-0: #6b4521; --age-1: #9a5a20; --age-2: #cc7a30; --age-3: #e8a660; --age-4: #f8dcae;
    --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; --cat-6: #008300; --cat-7: #9085e9; --cat-8: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #000000; --surface-1: #0a0a0a; --surface-2: #151515;
  --text-primary: #eaeaea; --text-secondary: #a3a3a3; --text-muted: #808080;
  --border: #222222; --gridline: #161616; --baseline: #3a3a3a;
  --accent: #33e29a; --accent-soft: #0e2018; --on-accent: #000000;
  --critical: #ff6868; --critical-soft: #2a1212; --warning: #e89a3c; --warning-soft: #2b1d11; --good: #33e29a;
  --series-1: #20a374; --series-2: #e06a1c; --series-3: #8b72dc;
  --div-neg-3: #e85c58; --div-neg-2: #9a3532; --div-neg-1: #3d1716; --div-mid: #1a1a1a;
  --div-pos-1: #0c2c20; --div-pos-2: #13694b; --div-pos-3: #20a374; --div-strong-text: #000000;
  --seq-track: #1a1a1a; --seq-fill: #20a374;
  --age-0: #6b4521; --age-1: #9a5a20; --age-2: #cc7a30; --age-3: #e8a660; --age-4: #f8dcae;
  --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; --cat-6: #008300; --cat-7: #9085e9; --cat-8: #e66767;
}

/* ---- elements ---------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html, body { margin: 0; }
body { background: var(--page); color: var(--text-primary); font: 12px/1.45 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
/* Sentences read in the sans; everything tabular, labelled or clickable stays monospace. */
:is(.sub, .prose, ul.readings, .hint, .notice, .headline, .strategy-card p, .workflow-note p, .account-card p, .trade-text, .factor-page details, small, .empty) { font-family: var(--font-sans); }
h1, h2, h3, p { margin: 0; }
/* Quantico is reserved for the brand and the one title per page. */
h1, .brand-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.2; text-transform: uppercase; letter-spacing: .04em; }
h2 { font-size: 12px; font-weight: 600; }
a { color: inherit; text-underline-offset: 2px; text-decoration-color: var(--baseline); }
a:hover { text-decoration-color: currentColor; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
small { display: block; color: var(--text-muted); font-size: 11px; }
/* Icons (icons.js, Lucide line icons) take the text colour and size; [data-icon] marks a slot in static markup. */
.icon { width: 14px; height: 14px; flex-shrink: 0; transition: transform var(--base) var(--ease), color var(--fast); }
[data-icon] { display: inline-flex; }
.link-icon { display: inline-flex; align-items: center; gap: 4px; }

/* The label voice: column heads, field labels, tabs, navigation groups. */
th, .label, .field > span:first-child, .tabs a, .nav-heading, .card h3, .tip-title, .strategy-number {
  font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
}

:where(button) {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 24px; padding: 0 8px;
  border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary); font: inherit; font-size: 11px; white-space: nowrap; cursor: pointer;
}
:where(button):hover { background: var(--surface-2); }
:where(button):disabled { opacity: .45; cursor: default; }
:where(button)[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
:where(input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea) {
  min-height: 24px; padding: 2px 6px; min-width: 0; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary); font: inherit;
}
:where(input, select, textarea):focus { border-color: var(--accent); outline: none; }
:where(input[type="number"]) { text-align: right; }
:where(input:disabled, select:disabled) { color: var(--text-secondary); background: var(--page); }
textarea { width: 100%; resize: vertical; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }

/* ---- shell ------------------------------------------------------------------------------------------- */
.viz-root { min-height: 100vh; display: flex; flex-direction: column; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar); display: flex; flex-direction: column; background: var(--surface-1); border-right: 1px solid var(--border); }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; min-height: var(--bar); padding: 0 12px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-name { font-size: 13px; }
.brand-mark { width: 18px; height: 18px; flex: 0 0 18px; display: inline-block; background: var(--text-primary); -webkit-mask: url("/gradient-mark.svg?v=2") center / contain no-repeat; mask: url("/gradient-mark.svg?v=2") center / contain no-repeat; }
#workspace-nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 0; }
.nav-heading { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; min-height: 26px; padding: 0 12px; border: 0; background: none; }
.nav-heading:hover { background: var(--surface-2); }
.nav-heading:hover, .current-group .nav-heading { color: var(--text-primary); }
.nav-heading > .icon { width: 14px; height: 14px; }
.nav-chevron { margin-left: auto; }
.nav-heading[aria-expanded="true"] .nav-chevron { transform: rotate(90deg); }
.nav-section ul { list-style: none; margin: 0 0 4px; padding: 0; }
.nav-section a { display: flex; align-items: center; gap: 8px; padding: 3px 12px 3px 32px; border-left: 2px solid transparent; color: var(--text-secondary); text-decoration: none; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-section a > span { overflow: hidden; text-overflow: ellipsis; }
.nav-section a .icon { color: var(--text-muted); }
.nav-section a:hover { background: var(--surface-2); color: var(--text-primary); }
.nav-section a:is(:hover, .active) .icon { color: var(--accent); }
.nav-section a.active { border-left-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.sidebar-bottom { border-top: 1px solid var(--border); padding: 4px 12px; }
.account-dropdown { position: relative; }
.account-link { justify-content: flex-start; gap: 8px; width: 100%; min-height: 28px; padding: 0; border: 0; background: none; text-align: left; }
.account-link:hover, .account-link.active { background: none; color: var(--accent); }
.account-avatar { width: 20px; height: 20px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: var(--page); color: var(--text-secondary); font-size: 10px; }
.account-arrow { margin-left: auto; color: var(--text-muted); }
.account-link[aria-expanded="true"] .account-arrow { transform: rotate(180deg); }
.account-menu { position: absolute; bottom: calc(100% + 8px); left: -8px; right: -8px; min-width: 184px; background: var(--surface-1); border: 1px solid var(--baseline); }
.account-menu a, .account-signout, .account-theme { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; padding: 5px 10px; border: 0; background: none; color: var(--text-secondary); text-decoration: none; font-size: 11px; }
.account-menu a:hover, .account-signout:hover, .account-theme:hover { background: var(--surface-2); color: var(--text-primary); }
.account-menu a.active { color: var(--accent); }
.account-menu-divider { margin: 0; border: 0; border-top: 1px solid var(--border); }
.account-signout, #signout-status { color: var(--critical); }
#signout-status { margin: 0; padding: 4px 12px; font-size: 11px; }

.workspace { margin-left: var(--sidebar); min-width: 0; min-height: 100dvh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; min-height: var(--bar); padding: 0 var(--pad); background: var(--surface-1); border-bottom: 1px solid var(--border); }
/* Long portfolio names truncate rather than wrap the header. */
.breadcrumbs { display: flex; flex: 1 1 0; align-items: center; gap: 6px; min-width: 0; color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.breadcrumbs strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); font-weight: 600; }
.freshness { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 11px; }
.icon-button { min-width: 24px; padding: 0; border-color: transparent; background: none; }
.icon-button .icon, .nav-heading .icon { width: 14px; height: 14px; }
.icon-button:hover { border-color: var(--border); }
.mobile-only { display: none; }
.skip-link { position: fixed; top: -100px; left: calc(var(--sidebar) + 16px); z-index: 50; padding: 12px; background: var(--surface-1); border: 1px solid var(--border); }
.skip-link:focus { top: 8px; }
#main-content { flex: 1; min-width: 0; }
main { width: 100%; padding: 8px var(--pad) 16px; }
.foot { max-width: 1100px; padding: 8px var(--pad) 16px; color: var(--text-muted); font-size: 11px; }
.loading { opacity: .55; transition: opacity .15s; }

@media (min-width: 901px) {
  .sidebar-collapsed { --sidebar: 44px; }
  .sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0; }
  .sidebar-collapsed :is(.brand-label, .nav-label, .nav-chevron, .nav-section:not(.flyout-open) ul, .account-label, .account-arrow) { display: none; }
  .sidebar-collapsed .nav-heading { justify-content: center; padding: 0; }
  .sidebar-collapsed .current-group .nav-heading { background: var(--accent-soft); color: var(--accent); }
  /* On the rail a group opens as a fly-out beside its icon, titled with the group's name. */
  .sidebar-collapsed .flyout-open .nav-heading { background: var(--surface-2); color: var(--text-primary); }
  .sidebar-collapsed .flyout-open ul { position: fixed; top: var(--flyout-top, 0); left: var(--sidebar); z-index: 35; min-width: 200px; max-height: calc(100vh - 16px); overflow-y: auto; margin: 0; padding: 0 0 4px; background: var(--surface-1); border: 1px solid var(--baseline); box-shadow: 0 8px 24px rgb(0 0 0 / 35%); animation: pop var(--fast) var(--ease); }
  .sidebar-collapsed .flyout-open ul::before { content: attr(data-title); display: block; margin-bottom: 4px; padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
  .sidebar-collapsed .flyout-open ul a { padding: 4px 12px; }
  .sidebar-collapsed .sidebar-bottom { padding: 8px; }
  .sidebar-collapsed .account-link { justify-content: center; }
  .sidebar-collapsed .account-menu { left: calc(100% + 16px); right: auto; bottom: 0; width: 200px; }
}

/* ---- layout: one vertical rhythm -------------------------------------------------------------------- */
#app > * + *, .stack > * + * { margin-top: var(--gap); }
.card > * + *, .account-card > * + *, dialog.dialog > * + * { margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: var(--gap); }
/* Small charts side by side inside one card (commodity.js), each on its own scale. */
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--gap); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap); align-items: start; }
.page-head, .page-intro { padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 16px; }
.sub { color: var(--text-secondary); font-size: 11.5px; }
h1 + .sub { margin-top: 2px; max-width: 900px; }
.reading { font-weight: 600; }
.muted { color: var(--text-muted); }
.negative { color: var(--critical); }
.hint { color: var(--text-muted); font-size: 11px; }
.empty { padding: 16px 0; color: var(--text-muted); text-align: center; }

/* ---- components -------------------------------------------------------------------------------------- */
.card { min-width: 0; padding: 8px var(--pad); background: var(--surface-1); border: 1px solid var(--border); }
/* A card's head is a panel title bar across its top; cards without one start with their content. */
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: -8px calc(-1 * var(--pad)) 0; padding: 5px var(--pad); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.card-head .sub { margin-top: 1px; font-size: 11px; }
.card-head button { min-height: 20px; padding: 0 6px; font-size: 10px; }
.card h3 { margin-top: 10px; }

.controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 12px; }
.controls.end { justify-content: flex-end; }
.field { display: grid; gap: 2px; align-content: start; min-width: 0; }
.field > :is(input, select) { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 10px; }
.input-unit { display: flex; align-items: stretch; }
.input-unit > input { flex: 1; width: 100%; }
.input-unit > span { display: flex; align-items: center; padding: 0 6px; border: 1px solid var(--border); border-left: 0; background: var(--page); color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.row-label { align-self: center; min-width: 56px; font-weight: 600; }
.segmented { display: inline-flex; flex-wrap: wrap; }
.segmented button + button { margin-left: -1px; }
.segmented button[aria-pressed="true"] { position: relative; }
.row-pick, .factor-sort, .linklike { min-height: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; white-space: normal; text-decoration: underline; text-decoration-color: var(--baseline); text-underline-offset: 2px; }
.row-pick:hover, .factor-sort:hover, .linklike:hover { background: none; text-decoration-color: currentColor; }
.row-pick { font-weight: 600; }
.factor-sort { text-decoration: none; letter-spacing: inherit; text-transform: inherit; }

.tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--border); }
.tabs a { display: flex; align-items: center; gap: 6px; margin-bottom: -1px; padding: 5px 10px; border-bottom: 2px solid transparent; text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--text-primary); }
.tabs a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--accent); }
.count { padding: 0 4px; border: 1px solid var(--border); font-size: 10px; letter-spacing: 0; }

/* Tile rows read as one ruled strip. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.tile { padding: 5px 8px; background: var(--surface-1); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.tile .value { margin-top: 1px; font-size: 16px; font-weight: 500; }
.tile .delta { color: var(--text-secondary); font-size: 11px; }
.tile.selected { box-shadow: inset 0 -2px var(--accent); }
.card.selected { box-shadow: inset 0 2px var(--accent); }
:is(.card, .stack) > .tile { border: 1px solid var(--border); }

.notice { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 10px; border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--surface-1); color: var(--text-secondary); }
.notice.critical { border-left-color: var(--critical); background: var(--critical-soft); color: var(--text-primary); }
.notice.warning { border-left-color: var(--warning); background: var(--warning-soft); color: var(--text-primary); }
.tag { display: inline-block; padding: 0 5px; border: 1px solid var(--border); color: var(--text-secondary); font-size: 10px; font-weight: 500; letter-spacing: .04em; }
ul.readings, ul.issues { margin: 0; padding-left: 16px; line-height: 1.5; }
ul.issues li::marker { color: var(--warning); }
ul.readings a { font-weight: 600; }

.list { max-height: 360px; overflow-y: auto; border: 1px solid var(--border); background: var(--surface-1); }
.list-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 8px; color: var(--text-secondary); font-size: 11px; }
.stack.divided { padding-top: var(--gap); border-top: 1px solid var(--border); }
.stack.divided > * + * { margin-top: 8px; }
.prose p { color: var(--text-secondary); line-height: 1.6; }

dialog.dialog { width: min(640px, calc(100vw - 32px)); max-height: 90vh; padding: 12px; border: 1px solid var(--baseline); background: var(--surface-1); color: var(--text-primary); }
dialog.dialog::backdrop { background: rgb(0 0 0 / 55%); }

/* ---- tables ---------------------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); background: var(--surface-1); }
.card .table-wrap { max-height: 520px; }
table.board, table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11.5px; }
table.board :is(th, td), table.data :is(th, td) { padding: 2px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--gridline); }
table.board th, table.data th { position: sticky; top: 0; z-index: 1; vertical-align: bottom; padding-top: 4px; padding-bottom: 4px; background: var(--surface-2); border-bottom-color: var(--border); }
table.data :is(th, td) { padding: 2px 6px; font-size: 11px; }
table.board th.group { text-align: center; color: var(--text-secondary); border-bottom-color: var(--baseline); }
table.board :is(td, th):first-child, table.data :is(td, th):first-child { text-align: left; }
table.board td:first-child, table.board th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface-1); }
table.board th:first-child { z-index: 2; background: var(--surface-2); }
table.board tbody tr:hover td, table.board tr.selected-row td { background: var(--surface-2); }
table.board tr.group-row td { background: var(--page); color: var(--text-secondary); font-weight: 600; }
table.board a { font-weight: 500; color: var(--accent); text-decoration: none; }
table.board a:hover { text-decoration: underline; }
table.board td small { max-width: 260px; white-space: normal; }
table.board :is(td, th).text-cell { text-align: left; white-space: normal; min-width: 140px; }
table.board td.score { text-align: center; font-weight: 600; min-width: 34px; }
table.board th.selected-col, table.matrix th.selected-col { color: var(--text-primary); }
.cell-input { width: 88px; min-height: 20px; padding: 1px 4px; }
table.facts { width: 100%; border-collapse: collapse; }
table.facts th { padding: 3px 10px 3px 0; text-align: left; vertical-align: top; white-space: nowrap; border-bottom: 1px solid var(--gridline); }
table.facts td { padding: 3px 0; text-align: right; border-bottom: 1px solid var(--gridline); }
.card .table-box { max-height: 280px; overflow: auto; }

/* Heat matrices: moneyness x tenor, symbol x moneyness, calls tenor x strike. */
table.matrix { width: 100%; border-collapse: separate; border-spacing: 1px; font-size: 11px; }
table.matrix th { padding: 2px 4px; text-align: center; white-space: nowrap; }
table.matrix th[scope="row"] { text-align: left; }
table.matrix th .strike { margin-left: 6px; color: var(--text-muted); font-weight: 400; letter-spacing: 0; }
table.matrix th a { color: var(--text-primary); text-decoration: none; }
table.matrix td.cell { min-width: 42px; padding: 3px 3px; text-align: center; background: var(--div-mid); cursor: pointer; }
table.matrix td.cell.empty { background: none; cursor: default; }
table.matrix td.cell.thin { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--gridline) 4px 6px); color: var(--text-muted); }
table.matrix td.cell.selected { outline: 2px solid var(--text-primary); outline-offset: -2px; }
table.matrix td.level { padding: 0 8px; text-align: right; color: var(--text-secondary); }
table.matrix tr.group-row td { padding: 5px 4px 1px; text-align: left; color: var(--text-muted); font-size: 10px; font-weight: 500; }
table.matrix td.cell .cell-score { font-size: 13px; font-weight: 600; }
table.matrix td.cell .cell-sub { margin-top: 1px; font-size: 10px; opacity: .85; }
table.matrix.surface td.cell { min-width: 38px; padding: 3px 2px; font-variant-numeric: tabular-nums; cursor: default; }
table.matrix.surface th.axis-title { color: var(--text-secondary); letter-spacing: .14em; text-transform: uppercase; font-size: 10px; }
table.matrix.surface tr.atm th[scope="row"] { color: var(--accent); }
table.matrix.shifts td.cell { min-width: 64px; padding: 3px 6px; }
table.matrix.shifts :is(td, th):last-child { border-left: 2px solid var(--surface-1); }
table.matrix.shifts tfoot :is(td, th) { padding-top: 5px; font-weight: 600; }
.card .table-wrap.shifts-wrap { max-height: none; }
.as-of { display: flex; align-items: center; gap: 4px; }
.as-of input[type="date"] { width: auto; }
.as-of button.step { padding-inline: 6px; }
table.heat td.cell { text-align: right; }
table.heat td.region { font-weight: 600; }

/* ---- charts ------------------------------------------------------------------------------------------ */
svg.chart { display: block; overflow: visible; }
.gridline { stroke: var(--gridline); }
.baseline { stroke: var(--baseline); }
.tick { fill: var(--text-muted); font-size: 10px; }
.line { fill: none; stroke-width: 1.5; stroke-linejoin: round; }
.line.thin { stroke-width: 1.25; }
.dot { stroke: var(--surface-1); stroke-width: 2; }
.endlabel { fill: var(--text-secondary); font-size: 10px; font-weight: 600; }
.crosshair, .refline { stroke: var(--text-muted); }
.refline.strong { stroke: var(--text-primary); }
.refline.dashed { stroke-dasharray: 4 3; }
.reflabel, .quadlabel { fill: var(--text-secondary); font-size: 10px; }
.quadlabel { font-weight: 600; }
.rowlabel, .paneltitle { fill: var(--text-primary); font-size: 11px; }
.paneltitle { font-weight: 600; }
.rownote { fill: var(--text-muted); font-size: 10px; font-weight: 600; }
.rownote.strong { fill: var(--text-primary); }
.pairline { stroke: var(--baseline); stroke-width: 2; }
.halo { paint-order: stroke; stroke: var(--surface-1); stroke-width: 3px; stroke-linejoin: round; }
.bar { outline: none; }
.bar:hover, .bar:focus { opacity: .8; }
.halfdot { stroke: var(--text-primary); stroke-width: 1.5; }
.halfdot.first, .legend-key.halfkey.first { fill: var(--surface-1); background: var(--surface-1); }
.halfdot.second, .legend-key.halfkey.second { fill: var(--text-primary); background: var(--text-primary); }
.legend { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; color: var(--text-secondary); font-size: 11px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-key { width: 14px; height: 2px; }
.legend-key.bar { width: 10px; height: 10px; }
/* Dots are data marks, the one place a circle carries meaning. */
.legend-key.dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-key.halfkey { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--text-primary); }
.tooltip { position: fixed; z-index: 40; min-width: 140px; padding: 4px 8px; pointer-events: none; background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--baseline); font-size: 11px; }
.tip-title { margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-key { width: 12px; height: 2px; }
.tip-key.bar { width: 8px; height: 8px; }
.tip-name { color: var(--text-secondary); }
.key { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 11px; }
.key .swatches { display: inline-flex; }
.key .swatches span { width: 18px; height: 10px; }
.swatch-thin { display: inline-block; width: 18px; height: 10px; margin-left: 8px; background: repeating-linear-gradient(135deg, transparent 0 3px, var(--baseline) 3px 5px); border: 1px solid var(--gridline); }
.age-ramp { display: inline-block; width: 140px; height: 8px; }
.meter { display: inline-flex; align-items: center; gap: 6px; }
.meter .track { display: inline-block; width: 44px; height: 6px; overflow: hidden; background: var(--seq-track); }
.meter .fill { display: block; height: 100%; background: var(--seq-fill); }
.zbar { position: relative; height: 8px; margin: 6px 0 4px; background: var(--div-mid); }
.zbar .mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--baseline); }
.zbar .fill { position: absolute; top: 0; bottom: 0; }
.zbar .then { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--text-muted); }

/* At-a-glance readouts: a verdict chip, a strip of stat tiles and aligned bar rows replace sentences. */
.glance > * + * { margin-top: 8px; }
.glance-label { margin-top: 10px; }
.verdict-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border: 1px solid currentColor; color: var(--text-secondary); font-size: 10px; font-weight: 600; line-height: 16px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.chip.pos { color: var(--div-pos-3); background: color-mix(in srgb, var(--div-pos-3) 14%, transparent); }
.chip.neg { color: var(--div-neg-3); background: color-mix(in srgb, var(--div-neg-3) 14%, transparent); }
.chip.warn { color: var(--warning); background: var(--warning-soft); }
.chip.big { padding: 2px 10px; font-size: 13px; line-height: 18px; }
.bar-label .chip { margin-left: 6px; }
.stats { display: flex; flex-wrap: wrap; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.stat { min-width: 92px; padding: 3px 10px 4px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat .label { white-space: nowrap; }
.stat-value { font-size: 15px; font-weight: 600; white-space: nowrap; }
:is(.stat-value, .bar-value).pos { color: var(--div-pos-3); }
:is(.stat-value, .bar-value).neg { color: var(--div-neg-3); }
.bar-rows { display: grid; grid-template-columns: minmax(110px, max-content) minmax(90px, 1fr) max-content max-content; align-items: center; gap: 4px 10px; }
.bar-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-value { text-align: right; font-weight: 600; white-space: nowrap; }
.bar-rows .zbar { margin: 0; }
.sbar, .ptrack { position: relative; height: 10px; background: var(--div-mid); }
.sbar .mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--baseline); }
.sbar .fill { position: absolute; top: 0; bottom: 0; background: var(--text-muted); }
.sbar .fill.pos { background: var(--div-pos-3); }
.sbar .fill.neg { background: var(--div-neg-3); }
.ptrack .zone { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--warning) 16%, transparent); }
.ptrack .mark { position: absolute; top: -3px; bottom: -3px; width: 3px; background: var(--text-primary); }
.ptrack .mark.extreme { background: var(--warning); }
.gauge { position: relative; height: 22px; margin-bottom: 18px; background: var(--div-mid); }
.gauge-zone { position: absolute; top: 0; bottom: 0; overflow: hidden; padding: 0 6px; font-size: 10px; font-weight: 600; line-height: 22px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.gauge-zone.pos { color: var(--div-pos-3); background: color-mix(in srgb, var(--div-pos-3) 16%, transparent); }
.gauge-zone.neg { color: var(--div-neg-3); background: color-mix(in srgb, var(--div-neg-3) 16%, transparent); text-align: right; }
/* A zone too narrow for its words: the label sits at the gauge's right edge instead. */
.gauge-note { position: absolute; top: 0; right: 6px; font-size: 10px; font-weight: 600; line-height: 22px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.gauge-note.neg { color: var(--div-neg-3); }
.gauge-mark { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: var(--text-primary); }
.gauge-value { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 1px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.entry-glance { max-width: 760px; margin-top: 8px; }
/* Regimes: a glance panel beside its chart; legends that hide and show lines; z shading in stats tables. */
.split-panel { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 12px 20px; align-items: start; }
.sector-now { margin-top: 8px; }
.legend-toggle { min-height: 0; padding: 0; gap: 6px; border: 0; background: none; color: inherit; font: inherit; }
.legend-toggle:hover { background: none; color: var(--text-primary); }
.legend-toggle[aria-pressed="false"] { opacity: .4; text-decoration: line-through; }
table.stats-table td:first-child { color: var(--text-secondary); }
table.stats-table th .legend-key { display: inline-block; vertical-align: middle; }
.zmark { padding: 0 4px; }
.zmark.z1 { background: var(--warning-soft); color: var(--warning); }
.zmark.z2 { background: var(--warning); color: var(--on-accent); font-weight: 600; }
@media (max-width: 1100px) { .split-panel { grid-template-columns: minmax(0, 1fr); } }

/* ---- page specifics: data shapes no shared component covers ------------------------------------------ */
.symbol-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 16px; }
.headline { font-size: 14px; font-weight: 600; line-height: 1.35; }
.section-title { margin-top: 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.flows-now { display: grid; grid-template-columns: minmax(320px, 1.3fr) minmax(320px, 2fr); gap: var(--gap); align-items: start; }
.layer-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.layer-tile { padding: 5px 8px; background: var(--page); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.layer-tile .value { margin: 1px 0; font-size: 17px; font-weight: 500; }
.layer-tile .word { color: var(--text-secondary); font-size: 11px; }
/* Macro: the main chart with its breakdown and evidence beside it. */
.grid2.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hero .card-head { align-items: flex-start; }
.hero .card-head .controls { margin: 0; flex-wrap: nowrap; justify-content: flex-end; }
.hero .card-head { flex-wrap: wrap; gap: 6px 16px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--gap); align-items: start; }
.hero-side { min-width: 0; }
.hero-side .bar-rows { grid-template-columns: minmax(96px, max-content) minmax(60px, 1fr) max-content max-content; gap: 4px 8px; }
.hero-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.hero-side-block > * + * { margin-top: 6px; }
/* Systematic positioning: the flow ladder, one column per S&P move and a row per strategy. */
.ladder { display: grid; gap: 2px; align-items: stretch; min-width: 0; }
.hero-grid.ladder-hero { grid-template-columns: minmax(0, 720px) minmax(300px, 520px); gap: 40px; justify-content: start; }
@media (max-width: 900px) { .hero-grid.ladder-hero { grid-template-columns: minmax(0, 1fr); gap: var(--gap); } }
.ladder-bars { position: relative; height: 64px; }
.ladder-zero { position: absolute; left: 0; right: 0; border-top: 1px solid var(--baseline); }
.ladder-bar { position: absolute; left: 50%; width: min(28px, 46%); transform: translateX(-50%); border-radius: 2px; }
.ladder-bar.pos { background: var(--div-pos-3); }
.ladder-bar.neg { background: var(--div-neg-3); }
.ladder-axis { align-self: end; padding: 0 10px 4px 0; color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.ladder-head { display: flex; flex-direction: column; align-items: center; padding: 2px 0 4px; color: var(--text-muted); font-size: 11px; line-height: 1.25; }
.ladder-head strong { color: var(--text-secondary); font-weight: 600; }
.ladder-head.now strong { color: var(--text-primary); }
.ladder-label { display: flex; align-items: center; gap: 6px; padding-right: 10px; color: var(--text-secondary); white-space: nowrap; }
.ladder-label .swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.ladder-label.total { margin-top: 4px; color: var(--text-primary); font-weight: 600; }
.ladder-cell { padding: 5px 2px; border-radius: 2px; background: var(--div-mid); text-align: center; white-space: nowrap; }
.ladder-cell.total { margin-top: 4px; padding: 7px 2px; font-weight: 600; }
@media (max-width: 600px) { .ladder-cell, .ladder-label, .ladder-head { font-size: 11px; } .ladder-label { padding-right: 6px; } .ladder-axis { padding-right: 6px; font-size: 10px; } }
.hero-total { display: flex; align-items: baseline; gap: 8px; }
.hero-total .stat-value { font-size: 22px; }
.section-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 6px; }
.section-row .section-title { margin: 0; }
.section-row .controls { margin: 0; }
/* Macro: the read as a picture, a money-flow diagram beside gauge tiles. */
.read-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--gap); margin-top: 10px; align-items: start; }
.flow-diagram .flow-node { fill: var(--surface-2); stroke: var(--border); }
.flow-diagram .flow-title { fill: var(--text-secondary); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.flow-diagram .flow-line { fill: var(--text-primary); font-size: 12px; }
.flow-diagram .flow-line.big { font-size: 17px; font-weight: 600; }
.flow-diagram .flow-line.muted { fill: var(--text-muted); font-size: 11px; }
.flow-diagram :is(.flow-line, .flow-value).pos { fill: var(--div-pos-3); }
.flow-diagram :is(.flow-line, .flow-value).neg { fill: var(--div-neg-3); }
.flow-diagram .flow-label { fill: var(--text-secondary); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.flow-diagram .flow-value { fill: var(--text-primary); font-size: 12px; font-weight: 600; }
.gauge-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.gauge-tile { display: grid; gap: 5px; align-content: start; min-width: 0; padding: 6px 10px 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.gauge-tile .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gauge-tile .sub { font-size: 11px; line-height: 1.35; }
.gauge-tile .bar-rows { grid-template-columns: minmax(70px, max-content) minmax(40px, 1fr) max-content max-content; gap: 3px 8px; font-size: 11px; }
.lbar, .ztrack { position: relative; height: 10px; background: var(--div-mid); }
.lbar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--text-muted); }
.lbar .fill.pos { background: var(--div-pos-3); }
.lbar .fill.neg { background: var(--div-neg-3); }
.ztrack .zone { position: absolute; top: 0; bottom: 0; }
.ztrack .zone.pos { background: color-mix(in srgb, var(--div-pos-3) 35%, transparent); }
.ztrack .zone.warn { background: color-mix(in srgb, var(--warning) 35%, transparent); }
.ztrack .zone.neg { background: color-mix(in srgb, var(--div-neg-3) 35%, transparent); }
.ztrack .mark { position: absolute; top: -3px; bottom: -3px; width: 3px; background: var(--text-primary); }
.verdict-tag { font-size: 12px; font-weight: 600; }
.verdict-tag.leads { color: var(--div-pos-3); }
.verdict-tag.against { color: var(--div-neg-3); }
.verdict-tag.unclear, .verdict-tag.short { color: var(--text-muted); }
.agree { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.agree-cell { padding: 3px 3px; text-align: center; background: var(--surface-1); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.agree-cell.selected { outline: 2px solid var(--text-primary); outline-offset: -2px; }
.agree-net, .agree-label { font-size: 11px; opacity: .8; }
.agree-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agree-paid { font-size: 13px; font-weight: 600; }
.agree-bar { height: 3px; margin: 4px 2px; overflow: hidden; background: var(--gridline); }
.agree-bar span { display: block; height: 100%; background: currentColor; opacity: .7; }

.trade-status { color: var(--text-secondary); }
.trade-status.bad { color: var(--critical); }
.trade-list { display: grid; gap: 4px; }
.trade-post { padding: 6px 10px; background: var(--surface-1); border: 1px solid var(--border); border-left: 3px solid var(--border); }
.trade-post.signal { border-left-color: var(--series-1); }
.trade-post.level { border-left-color: var(--series-3); }
.trade-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.trade-tags, .trade-images, .trade-context-row { display: flex; flex-wrap: wrap; gap: 6px; }
.trade-tag { padding: 0 6px; border: 1px solid var(--border); color: var(--text-secondary); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.trade-tag.signal { color: var(--series-1); border-color: currentColor; }
.trade-tag.level { color: var(--series-3); border-color: currentColor; }
.trade-tag.buy { background: var(--good); border-color: var(--good); color: var(--on-accent); }
.trade-tag.sell { background: var(--critical); border-color: var(--critical); color: #fff; }
.trade-tag.muted { color: var(--text-muted); }
.trade-details { margin-top: 6px; }
.trade-tickers { font-weight: 600; }
.trade-text { margin: 4px 0 2px; white-space: pre-wrap; }
.trade-images { margin: 6px 0; }
.trade-images img { max-height: 160px; max-width: 280px; border: 1px solid var(--border); }
.trade-context { padding: 2px 8px; background: var(--div-mid); color: var(--text-primary); font-size: 12px; text-decoration: none; }
.trade-paste-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }

.strategy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.strategy-card { display: flex; flex-direction: column; padding: 10px 12px; background: var(--surface-1); border: 1px solid var(--border); }
.strategy-number { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.strategy-number .icon { width: 16px; height: 16px; color: var(--accent); }
.strategy-card h2 { font-size: 13px; }
.strategy-card p { margin: 4px 0 10px; color: var(--text-secondary); line-height: 1.55; }
.strategy-card a { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; color: var(--accent); font-size: 12px; font-weight: 600; text-decoration: none; }
.workflow-note { display: flex; align-items: baseline; gap: 20px; padding-top: 10px; border-top: 1px solid var(--border); }
.workflow-note h2 { flex-shrink: 0; }
.workflow-note p { color: var(--text-secondary); line-height: 1.6; }

.account-layout { max-width: 840px; display: grid; gap: var(--gap); }
.account-card { padding: 10px 12px; background: var(--surface-1); border: 1px solid var(--border); }
.account-card p { color: var(--text-secondary); line-height: 1.55; }
.account-facts > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); }
.account-facts dt { color: var(--text-secondary); }
.account-facts dd { margin: 0; overflow-wrap: anywhere; }
.account-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.account-status { min-height: 20px; }
.whitelist-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.whitelist-form label { display: grid; flex: 1 1 220px; gap: 4px; color: var(--text-secondary); }
.whitelist-emails { margin: 0; padding: 0; list-style: none; }
.whitelist-emails li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.x-handles { margin: 0; padding: 0; list-style: none; }
.x-handles li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); }
.x-handles li > div { display: grid; gap: 2px; }
.x-handles small, .x-handle-status { color: var(--text-secondary); font-size: 12px; }
.x-handle-status.bad { color: var(--critical); }
.steps { margin: 0; padding-left: 20px; color: var(--text-secondary); line-height: 1.8; }
.bookmarklet { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border: 1px dashed var(--accent); color: var(--accent); font-weight: 600; text-decoration: none; cursor: grab; }
.x-settings { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.x-settings label { display: grid; flex: 1 1 200px; gap: 4px; color: var(--text-secondary); }
.x-settings label.check { display: flex; flex: 0 1 auto; align-items: center; gap: 8px; color: var(--text-primary); }
.x-meter { display: flex; margin-top: 6px; }
.x-meter .track { width: 100%; }
.x-meter.bad .fill { background: var(--critical); }
.trade-handles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.trade-handle { padding: 2px 8px; border: 1px solid var(--border); color: var(--text-primary); font-size: 12px; text-decoration: none; }
.trade-handle::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; vertical-align: middle; background: var(--text-muted); }
.trade-handle.ok::before { background: var(--good); }
.trade-handle.bad::before { background: var(--critical); }
.trade-manage { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; color: var(--accent); font-size: 12px; text-decoration: none; }
.trade-paste-row { display: grid; gap: 8px; }
.trade-capture { border-left: 3px solid var(--accent); }
.x-scroll { overflow-x: auto; }

/* Factors (factors.js): the universe as grouped panels, one flat table or a heatmap; one factor; blends. */
.factor-page a.button { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 8px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary); font-size: 11px; text-decoration: none; white-space: nowrap; }
.factor-page a.button:hover { background: var(--surface-2); }
.factor-page .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.back-link { display: inline-flex; align-items: center; gap: 5px; color: var(--text-secondary); font-size: 11px; text-decoration: none; }
.back-link:hover { color: var(--accent); }
:is(a, button):hover .i-arrow-left { transform: translateX(-3px); }
.search-box { position: relative; display: flex; }
.search-box .icon { position: absolute; left: 6px; top: 50%; translate: 0 -50%; color: var(--text-muted); pointer-events: none; }
.search-box input { width: 100%; padding-left: 24px; }
.factor-search { width: 240px; }
.factor-sortbar .hint { align-self: center; font-family: var(--font-sans); }
.factor-tabs button { min-height: 0; margin-bottom: -1px; padding: 5px 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-muted); font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.factor-tabs button:hover { background: none; color: var(--text-primary); }
.factor-tabs button[aria-pressed="true"] { border-bottom-color: var(--accent); background: none; color: var(--accent); }
.factor-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: var(--gap); align-items: start; }
.factor-card { padding: 0; }
.factor-card > * + * { margin-top: 0; }
.factor-card .card-head { margin: 0; }
.factor-card .table-wrap { max-height: none; border: 0; }
.factor-card .list-foot { border-top: 1px solid var(--gridline); }
table.factor-table td:first-child { min-width: 160px; max-width: 240px; white-space: normal; }
table.factor-table tbody tr { cursor: pointer; }
table.factor-table td.sorted { color: var(--text-primary); font-weight: 600; }
.factor-cov { font-size: 10px; }
.factor-cov.low { color: var(--warning); }
table.board th .factor-sort { gap: 3px; white-space: nowrap; }
table.board th .factor-sort .icon { width: 11px; height: 11px; }
.spark-cell { width: 76px; }
.spark { display: block; width: 64px; height: 16px; margin-left: auto; }
.spark path { fill: none; stroke: var(--series-1); stroke-width: 1.25; stroke-linejoin: round; }
.spark circle { fill: var(--series-1); }
.heat-key strong { color: var(--text-primary); font-weight: 600; }
.heat-key .hint { margin-left: 8px; font-family: var(--font-sans); }
.heat-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--gap); align-items: start; }
.heat-group { min-width: 0; background: var(--surface-1); border: 1px solid var(--border); }
.heat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 5px var(--pad); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.heat-head h2 { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.heat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 1px; padding: 1px; }
.heat-tile { aspect-ratio: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 2px; padding: 5px 6px; background: var(--div-mid); color: var(--text-primary); font-size: 10.5px; line-height: 1.25; text-decoration: none; transition: box-shadow var(--fast), background-color var(--fast); }
.heat-tile:hover, .heat-tile:focus-visible { box-shadow: inset 0 0 0 2px var(--text-primary); outline: none; }
.heat-tile.none { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--gridline) 4px 6px); box-shadow: inset 0 0 0 1px var(--border); color: var(--text-muted); }
.heat-name { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; font-family: var(--font-sans); font-weight: 600; overflow-wrap: break-word; hyphens: auto; }
.heat-value { font-size: 14px; font-weight: 600; text-align: right; }
.weight-bar { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; }
.weight-bar .track { width: 56px; height: 6px; overflow: hidden; background: var(--seq-track); }
.weight-bar .fill { display: block; height: 100%; background: var(--seq-fill); }
.mark { display: inline-block; margin-left: 5px; padding: 0 3px; border: 1px solid var(--border); color: var(--text-muted); font-size: 9.5px; line-height: 13px; }
.mark.stale { border-color: currentColor; color: var(--warning); }
.factor-about { max-width: 900px; }
.factor-about > * + * { margin-top: 2px; }
.factor-about > p:first-child { color: var(--text-secondary); font-family: var(--font-sans); line-height: 1.5; }
.factor-about .tag + .tag { margin-left: 5px; }
.factor-page details { padding: 6px 0; border-top: 1px solid var(--border); line-height: 1.6; }
.factor-page details > * + * { margin-top: 6px; }
.factor-page details p { max-width: 900px; color: var(--text-secondary); }
.factor-page summary { cursor: pointer; font-weight: 600; }
table.data tr.selected-row td { background: var(--surface-2); font-weight: 600; }
.blend-search { max-width: 400px; }
.blend-picks { max-width: 760px; }
.blend-results { max-width: 400px; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); background: var(--surface-1); }
.blend-results button { display: flex; justify-content: space-between; gap: 10px; width: 100%; min-height: 26px; border: 0; border-bottom: 1px solid var(--gridline); background: none; text-align: left; white-space: normal; }
.blend-results button:hover, .blend-results button:focus-visible { background: var(--surface-2); color: var(--accent); }
.blend-results .hint { padding: 4px 8px; }

/* Option chains (chains.js): symbol bar, bookmarks, expiry strip, calls | strike | puts with a contract
   panel, and watchlists. Dropdown menus are <details class="menu">. */
.icon.filled { fill: currentColor; }
.chain-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.chain-title { display: flex; align-items: baseline; gap: 10px; }
.chain-title h1 { font-size: 20px; }
.symbol-picker { width: 170px; }
.symbol-list { position: absolute; top: calc(100% + 2px); left: 0; z-index: 20; width: 300px; max-height: 320px; overflow-y: auto; margin: 0; padding: 0; list-style: none; background: var(--surface-1); border: 1px solid var(--baseline); box-shadow: 0 8px 24px rgb(0 0 0 / 30%); animation: pop var(--fast) var(--ease); }
.symbol-list li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--gridline); cursor: pointer; }
.symbol-list li .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-sans); }
.symbol-list li:hover { background: var(--surface-2); }
.symbol-list li[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.symbol-list li.current strong { color: var(--accent); }
.chain-stats .stat { min-width: 0; }
.chain-stats .stat-value { font-size: 13px; }
.chain-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.saved-status:empty { display: none; }
.saved-status.bad { color: var(--critical); }
.chain-marks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-height: 20px; }
.chain-marks > .label { margin-right: 2px; }
.mark-chip { display: inline-flex; align-items: stretch; border: 1px solid var(--border); background: var(--surface-1); font-size: 11px; }
.mark-chip a { padding: 1px 6px; color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.mark-chip a:hover { background: var(--surface-2); color: var(--text-primary); }
.mark-chip.current { border-color: var(--accent); }
.mark-chip.current a { color: var(--accent); }
.mark-chip button { min-height: 0; padding: 0 3px; border: 0; border-left: 1px solid var(--border); background: none; color: var(--text-muted); }
.mark-chip button .icon { width: 11px; height: 11px; }
.mark-chip button:hover { background: var(--critical-soft); color: var(--critical); }

.expiry-strip { position: relative; display: flex; overflow-x: auto; scrollbar-width: thin; background: var(--surface-1); border: 1px solid var(--border); }
.exp-month { display: flex; flex-shrink: 0; align-items: stretch; }
.exp-month + .exp-month { border-left: 1px solid var(--baseline); }
.exp-year { display: flex; align-items: center; padding: 0 6px; background: var(--surface-2); color: var(--text-secondary); font-size: 10px; font-weight: 600; letter-spacing: .06em; }
.exp-tab { display: flex; align-items: center; padding: 4px 8px 3px; border-bottom: 2px solid transparent; color: var(--text-muted); font-size: 11px; text-decoration: none; white-space: nowrap; }
.exp-tab .dte { white-space: pre; opacity: .75; }
.exp-tab.monthly, .exp-tab.quarterly { color: var(--text-primary); font-weight: 600; }
/* Standard expiries carry a flag: M for monthlies, Q for the quarterly ones (Mar, Jun, Sep, Dec), which also get a tinted cell. */
.exp-tab.quarterly { background: color-mix(in srgb, var(--warning) 12%, transparent); }
.exp-flag { display: inline-flex; align-items: center; justify-content: center; min-width: 13px; height: 13px; margin-right: 5px; padding: 0 2px; border: 1px solid currentColor; font-size: 9px; font-weight: 700; line-height: 1; }
.exp-flag.monthly { color: var(--accent); }
.exp-flag.quarterly { color: var(--warning); background: var(--warning-soft); }
.expiry-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-bottom: 4px; color: var(--text-secondary); font-size: 11px; }
.exp-key { display: inline-flex; align-items: center; }
.exp-only { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; cursor: pointer; color: var(--text-primary); }
.exp-only input { margin: 0; accent-color: var(--accent); }
.exp-tab:hover { background: var(--surface-2); color: var(--text-primary); }
.exp-tab[hidden], .exp-month[hidden] { display: none; }
.exp-tab[aria-current] { border-bottom-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.exp-tab:focus-visible { outline-offset: -2px; }

.chain-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap); align-items: start; }
.chain-card, .watch-card { padding: 0; }
:is(.chain-card, .watch-card) > * + * { margin-top: 0; }
:is(.chain-card, .watch-card) .card-head { margin: 0; align-items: center; flex-wrap: wrap; }
.chain-tools { display: flex; align-items: center; gap: 6px; }
.chain-tools .segmented button { min-height: 20px; padding: 0 6px; font-size: 10px; }
.card .chain-wrap { max-height: max(360px, calc(100vh - 240px)); border: 0; scroll-padding-top: 44px; }
table.chain-table :is(th, td) { padding: 2px 6px; }
table.chain-table :is(td, th):first-child { left: auto; text-align: right; }
table.chain-table td:first-child { position: static; background: none; }
table.chain-table thead .side-row th { height: 20px; padding-top: 2px; padding-bottom: 2px; text-align: center; color: var(--text-secondary); letter-spacing: .14em; border-bottom-color: var(--baseline); }
table.chain-table thead .col-row th { top: 20px; }
table.chain-table :is(.strike, .strike-head) { position: sticky; left: 0; right: 0; z-index: 2; min-width: 62px; text-align: center; background: var(--surface-2); border-left: 1px solid var(--baseline); border-right: 1px solid var(--baseline); color: var(--text-primary); }
table.chain-table thead .strike-head { z-index: 3; vertical-align: middle; }
table.chain-table tbody th.strike { top: auto; padding-top: 2px; padding-bottom: 2px; font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none; border-bottom-color: var(--gridline); }
table.chain-table td { cursor: pointer; }
/* In the money: a neutral tint that reads in both themes (surface-2 alone is too faint on black). */
table.chain-table td.itm, table.watch-table td.itm { background: color-mix(in srgb, var(--text-primary) 7%, var(--surface-1)); }
table.chain-table td.none { cursor: default; background: repeating-linear-gradient(135deg, transparent 0 4px, var(--gridline) 4px 6px); }
table.chain-table tbody tr:hover td:not(.none) { background: color-mix(in srgb, var(--text-primary) 5%, var(--surface-1)); }
table.chain-table tbody tr:hover td.itm { background: color-mix(in srgb, var(--text-primary) 12%, var(--surface-1)); }
table.chain-table td.sel, table.chain-table tbody tr:hover td.sel { background: var(--accent-soft); box-shadow: inset 0 1px var(--accent), inset 0 -1px var(--accent); }
table.chain-table th.sel-strike { background: var(--accent); color: var(--on-accent); }
/* IV shading (chains.js shadeVols): rank among the chain's IVs, low green to high red, kept on hover and selection. */
table.chain-table tbody tr td[data-iv-level="p3"], table.chain-table tbody tr:hover td[data-iv-level="p3"] { background: var(--div-pos-3); color: var(--div-strong-text); }
table.chain-table tbody tr td[data-iv-level="p2"], table.chain-table tbody tr:hover td[data-iv-level="p2"] { background: var(--div-pos-2); }
table.chain-table tbody tr td[data-iv-level="p1"], table.chain-table tbody tr:hover td[data-iv-level="p1"] { background: var(--div-pos-1); }
table.chain-table tbody tr td[data-iv-level="m"], table.chain-table tbody tr:hover td[data-iv-level="m"] { background: var(--div-mid); }
table.chain-table tbody tr td[data-iv-level="n1"], table.chain-table tbody tr:hover td[data-iv-level="n1"] { background: var(--div-neg-1); }
table.chain-table tbody tr td[data-iv-level="n2"], table.chain-table tbody tr:hover td[data-iv-level="n2"] { background: var(--div-neg-2); }
table.chain-table tbody tr td[data-iv-level="n3"], table.chain-table tbody tr:hover td[data-iv-level="n3"] { background: var(--div-neg-3); color: var(--div-strong-text); }
table.chain-table :is(td, th):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
:is(.chain-table, .watch-table, .chain-detail) .pos { color: var(--div-pos-3); }
:is(.chain-table, .watch-table, .chain-detail) .neg { color: var(--div-neg-3); }
table.chain-table tr.fwd-row td, table.chain-table tbody tr.fwd-row:hover td { height: 0; padding: 0; background: none; border-top: 2px solid var(--accent); border-bottom: 0; cursor: default; }
table.chain-table tr.fwd-row td.fwd-mark, table.chain-table tbody tr.fwd-row:hover td.fwd-mark { position: sticky; left: 0; right: 0; padding: 0 4px; background: var(--accent); color: var(--on-accent); font-size: 9.5px; font-weight: 600; line-height: 13px; text-align: center; white-space: nowrap; }

.chain-detail { position: sticky; top: calc(var(--bar) + 8px); }
.chain-detail .stats .stat { flex: 1 1 30%; min-width: 0; padding: 3px 8px 4px; }
.chain-detail .stat-value { font-size: 13px; }
.chain-detail .table-wrap { max-height: none; }
.chain-detail table.data :is(th, td) { padding: 2px 4px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 6px; }
:is(.chain-star, .detail-actions button)[aria-pressed="true"] .i-star { color: var(--accent); }

details.menu { position: relative; display: inline-block; }
details.menu > summary { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 8px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary); font-size: 11px; white-space: nowrap; list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary:hover { background: var(--surface-2); }
details.menu[open] > summary { border-color: var(--accent); color: var(--accent); }
.card-head details.menu > summary { min-height: 20px; padding: 0 6px; font-size: 10px; }
.menu-pop { position: absolute; top: calc(100% + 2px); right: 0; z-index: 20; display: grid; gap: 8px; min-width: 240px; max-height: 70vh; overflow-y: auto; padding: 8px; background: var(--surface-1); border: 1px solid var(--baseline); box-shadow: 0 8px 24px rgb(0 0 0 / 30%); animation: pop var(--fast) var(--ease); }
.menu-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
.menu-group legend { margin-bottom: 3px; padding: 0; }
label.check { display: flex; align-items: center; gap: 6px; font-size: 11px; white-space: nowrap; cursor: pointer; }
.menu-list { display: grid; border-top: 1px solid var(--gridline); }
.menu-list button { justify-content: flex-start; min-height: 26px; border: 0; border-bottom: 1px solid var(--gridline); background: none; }
.menu-list button .count { margin-left: auto; }
.menu-list button[aria-pressed="true"] { background: var(--accent-soft); }
.menu-form { display: flex; gap: 4px; }
.menu-form input { flex: 1; min-width: 0; }
.watch-create input { width: 170px; }
.card .watch-wrap { max-height: none; border: 0; }
table.watch-table tbody tr { cursor: pointer; }
table.watch-table tr.gone td { color: var(--text-muted); }
table.watch-table td.state { text-align: left; }
table.watch-table td.remove { width: 30px; padding: 0 2px; text-align: center; }
.tag.expired { border-color: currentColor; color: var(--warning); }
.watch-page .tabs { overflow-y: hidden; }
.watch-page .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 1280px) { .chain-layout { grid-template-columns: minmax(0, 1fr); } .chain-detail { position: static; } }
@media (max-width: 600px) {
  .gauge-tiles { grid-template-columns: minmax(0, 1fr); }
  .chain-actions { margin-left: 0; }
  .symbol-picker, .watch-create { width: 100%; }
  .watch-create input { width: auto; }
  .card .chain-wrap { max-height: 70vh; }
}

/* ---- sign-in: always dark, same components ------------------------------------------------------------ */
.signin-page { position: relative; isolation: isolate; overflow: clip; min-height: 100svh; display: grid; place-items: center; padding: 72px 24px; background: #000; color: #eaeaea; color-scheme: dark; }
.signin-background { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.signin {
  --page: #000; --surface-1: #0a0a0a; --surface-2: #151515; --text-primary: #eaeaea; --text-secondary: #a3a3a3; --text-muted: #808080;
  --border: #222; --baseline: #3a3a3a; --accent: #33e29a; --on-accent: #000;
  position: relative; z-index: 1; width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; padding: 32px;
  background: rgb(10 10 10 / 85%); border: 1px solid var(--border); color: var(--text-primary);
}
.signin-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.signin-brand .brand-mark { width: 32px; height: 32px; flex-basis: 32px; }
.signin-brand h1 { line-height: 1; text-box-trim: trim-both; text-box-edge: cap alphabetic; }
.signin-intro { color: var(--text-secondary); }
.signin label { display: grid; gap: 4px; color: var(--text-muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.signin input { min-height: 38px; background: var(--page); font-size: 14px; font-weight: 400; letter-spacing: normal; text-transform: none; }
.signin input[name="code"] { font-size: 22px; letter-spacing: .3em; text-align: center; }
.signin button[type="submit"] { min-height: 38px; background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.signin .linklike { color: var(--text-secondary); font-size: 12px; }
.signin-motion { position: absolute; right: 24px; bottom: 20px; z-index: 1; gap: 8px; background: #000; border-color: #222; color: #808080; font-size: 11px; }
.signin-motion:hover { background: #000; border-color: #3a3a3a; color: #fff; }
.motion-symbol { width: 8px; height: 9px; border-inline: 2px solid currentColor; }
.signin-motion[data-paused="true"] .motion-symbol { width: 0; height: 0; border: 5px solid transparent; border-right: 0; border-left: 8px solid currentColor; }

/* ---- responsive -------------------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .grid2, .split { grid-template-columns: minmax(0, 1fr); }
  .freshness { font-size: 11px; }
}
@media (max-width: 900px) {
  :root { --bar: 44px; }
  .workspace { margin-left: 0; }
  .sidebar { width: 260px; max-width: 100vw; transform: translateX(-100%); visibility: hidden; }
  .nav-open .sidebar { transform: none; visibility: visible; }
  .nav-open { overflow: hidden; }
  .mobile-only { display: inline-flex; }
  .desktop-only { display: none; }
  .icon-button { min-width: 36px; min-height: 36px; }
  .nav-heading { min-height: 40px; }
  .nav-section a, .account-menu a, .account-signout { padding-top: 9px; padding-bottom: 9px; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 25; background: rgb(0 0 0 / 45%); }
  .skip-link { left: 16px; }
  .flows-now { grid-template-columns: minmax(0, 1fr); }
  .read-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .grid2.two-up { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .top { flex-wrap: wrap; gap: 8px; padding: 6px 16px; }
  .breadcrumbs { font-size: 11px; }
  .freshness:not([hidden]) { order: 4; width: 100%; padding-left: 44px; }
  main { padding: 8px 8px 16px; }
  .foot { padding: 16px; }
  .grid3, .strategy-grid { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .factor-search, .blend-search { width: 100%; max-width: none; }
  .heat-tiles { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .account-facts > div { grid-template-columns: 1fr; gap: 4px; }
  .workflow-note { flex-direction: column; gap: 8px; }
  .signin { padding: 24px; }
  .signin-motion { right: 16px; bottom: 16px; }
}
/* ---- motion ------------------------------------------------------------------------------------------ */
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.99); } }
@keyframes draw { from { stroke-dasharray: 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; } }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(400%); } }
@keyframes pulse { 50% { opacity: .35; } }

/* Controls answer the pointer. */
:where(button, a, input, select, textarea), .nav-heading, .tile, table.board td, table.matrix td.cell {
  transition: background-color var(--fast), border-color var(--fast), color var(--fast), box-shadow var(--fast), text-decoration-color var(--fast), opacity var(--fast);
}
:where(button):active:not(:disabled) { transform: translateY(1px); }
.nav-chevron, .account-arrow { transition: transform var(--base) var(--ease); }
.sidebar { transition: width var(--base) var(--ease), transform var(--base) var(--ease), visibility var(--base); }
.workspace, .skip-link { transition: margin-left var(--base) var(--ease), left var(--base) var(--ease), top var(--fast); }
table.matrix td.cell:not(.empty):hover { box-shadow: inset 0 0 0 1px var(--text-primary); }

/* Pages enter: sections rise in turn; chart lines draw from the left, their marks follow. */
.enter > *, .enter :is(.grid2, .grid3) > * { animation: enter var(--base) var(--ease) both; }
.enter > :nth-child(2), .enter :is(.grid2, .grid3) > :nth-child(2) { animation-delay: 40ms; }
.enter > :nth-child(3), .enter :is(.grid2, .grid3) > :nth-child(3) { animation-delay: 80ms; }
.enter > :nth-child(4) { animation-delay: 120ms; }
.enter > :nth-child(n + 5) { animation-delay: 160ms; }
.enter svg.chart .line[pathLength] { animation: draw 650ms var(--ease) 80ms both; }
.enter svg.chart :is(.dot, .bar, .endlabel) { animation: fade 300ms ease 450ms both; }

/* Things that appear: menus, dialogs, tooltips, the mobile sidebar backdrop. */
.account-menu:not([hidden]) { animation: pop var(--fast) var(--ease); }
dialog.dialog.opening { animation: pop var(--base) var(--ease); }
dialog.dialog.opening::backdrop { animation: fade var(--base) linear; }
.tooltip:not([hidden]) { animation: fade 80ms linear; }
.nav-backdrop:not([hidden]) { animation: fade var(--base) linear; }

/* Loading: a sweep along the header's lower edge. Current data: a slow pulse on the status mark. */
.top { overflow-x: clip; }
.top::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 25%; height: 2px; background: var(--accent); opacity: 0; transition: opacity var(--base); pointer-events: none; }
.workspace:has(#app.loading) .top::after { opacity: 1; animation: sweep 1s var(--ease) infinite; }
.freshness .icon.good { animation: pulse 2.4s ease-in-out infinite; }

/* Icons answer too: arrows lean forward, refresh and add turn, delete warns, the theme mark tilts. */
:is(a, button):hover .i-arrow-right { transform: translateX(3px); }
:is(a, button):hover .i-external-link { transform: translate(1px, -1px); }
button:hover :is(.i-refresh-cw, .i-plus) { transform: rotate(90deg); }
button:hover .i-trash-2 { color: var(--critical); }
#theme:hover .icon { transform: rotate(-25deg); }
.nav-heading:hover > .icon:first-child { color: var(--accent); }

/* Theme changes cross-fade. */
.theming, .theming * { transition: background-color 250ms, color 250ms, border-color 250ms !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::backdrop { animation: none !important; transition: none !important; }
}
@media print { .sidebar, .top, .skip-link, .nav-backdrop { display: none; } .workspace { margin-left: 0; } }

/* ---- credit stress (#/credit) ---------------------------------------------------------------------- */
.stress-gauge-big .gauge-head, .episode .gauge-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stress-gauge-big .gauge-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; margin: 2px 0; }
.stress-gauge-big .stat-value { font-size: 22px; }
/* Credit: gauges as rows (name, value, percentile track, status), explanations on hover. */
.stress-gauges { display: grid; grid-template-columns: max-content max-content minmax(50px, 1fr); align-items: center; gap: 7px 10px; }
.stress-gauges > .glance-label { grid-column: 1 / -1; margin-bottom: -2px; }
.stress-gauge { display: contents; cursor: help; }
.stress-gauge .gauge-name { font-size: 11.5px; color: var(--text-secondary); }
.stress-gauge .stat-value { font-size: 13px; text-align: right; }
.stress-gauges > * + * { margin-top: 0; }
.hero-verdict { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.hero-verdict .chip { white-space: normal; cursor: help; }
.info-mark { color: var(--text-muted); font-weight: 400; cursor: help; }
h2[title] { cursor: help; }
.caption { margin-top: 2px; color: var(--text-muted); font-size: 10.5px; cursor: help; }
.spark { display: block; width: 100%; height: 46px; }
.stress-gauges > .status-key { grid-column: 1 / -1; display: flex; gap: 10px; color: var(--text-muted); font-size: 10px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--text-muted); vertical-align: 1px; }
.status-key .status-dot { margin: 0 4px 0 0; }
.status-dot.pos { background: var(--div-pos-3); }
.status-dot.warn { background: var(--warning); }
.status-dot.neg { background: var(--div-neg-3); }
.stat-value.warn { color: var(--warning); }
.card-more > summary h2 { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.spark-axis { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 10px; }
.sbar .tick { position: absolute; top: -3px; bottom: -3px; width: 3px; background: var(--text-primary); }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 10px; }
.mini-stats .label { font-size: 10px; }
.mini-value { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.mini-value.pos { color: var(--div-pos-3); }
.mini-value.neg { color: var(--div-neg-3); }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 2px; margin-top: 8px; color: var(--text-muted); font-size: 10px; }
.heat-legend span:first-child { margin-right: 4px; }
.heat-legend span:last-child { margin-left: 4px; }
.heat-swatch { width: 14px; height: 10px; }
.card-more > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.card-more > summary::-webkit-details-marker { display: none; }
.card-more > summary::before { content: '▸'; color: var(--text-muted); font-size: 10px; }
.card-more[open] > summary::before { content: '▾'; }
.card-more[open] > summary { margin-bottom: 8px; }
td .chip { margin-left: 6px; }

/* Repo (#/repo): the Fed's corridor, the calendar strip key */
.repo-tiles { margin-top: 12px; }
@media (min-width: 1100px) { .repo-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.corridor { display: grid; gap: 4px; padding-top: 4px; }
.corridor-track { position: relative; height: 10px; background: linear-gradient(90deg, color-mix(in srgb, var(--div-pos-3) 30%, transparent), var(--div-mid) 50%, color-mix(in srgb, var(--div-neg-3) 30%, transparent)); }
.corridor-iorb { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--text-muted); }
.corridor-mark { position: absolute; top: -4px; width: 9px; height: 18px; margin-left: -4px; border: 2px solid var(--surface-1, var(--bg)); border-radius: 3px; }
.corridor-mark.sofr { background: var(--cat-1); }
.corridor-mark.tgcr { background: var(--cat-2); }
.corridor-scale { position: relative; display: flex; justify-content: space-between; color: var(--text-muted); font-size: 10px; }
.corridor-scale span[style] { position: absolute; transform: translateX(-50%); }
.mini-rows { display: grid; gap: 2px; font-size: 11px; }
.mini-rows > div { display: flex; justify-content: space-between; gap: 8px; }
.mini-rows span { color: var(--text-muted); }
.strip-key { display: flex; gap: 14px; margin-top: 4px; color: var(--text-muted); font-size: 10.5px; }
.strip-key .swatch { display: inline-block; width: 12px; height: 8px; margin-right: 5px; vertical-align: 0; }
.strip-key .swatch.pressure { background: color-mix(in srgb, var(--warning) 60%, transparent); }
.strip-key .swatch.gse { background: color-mix(in srgb, var(--cat-1) 45%, transparent); }
.card-lede { margin-bottom: 8px; }
.board td.cal-event { text-align: left; white-space: normal; cursor: help; }
.board td.cal-event .chip { margin: 0 8px 0 0; }

/* ---- verdict art (verdict-art.js): a dithered band across the top of a page's verdict card ---------------- */
.verdict-art { position: relative; height: 72px; margin: -8px calc(-1 * var(--pad)) 8px; background: var(--surface-1); border-bottom: 1px solid var(--border); overflow: hidden; cursor: help; }
.verdict-art:has(+ .card-head) { margin-bottom: 0; }
.verdict-art + .card-head { margin-top: 0; }
.verdict-art canvas { display: block; width: 100%; height: 100%; }
.verdict-art-label { position: absolute; left: var(--pad); bottom: 6px; padding: 1px 6px; background: var(--surface-1); font: 600 11px/16px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.verdict-art.pos .verdict-art-label { color: var(--div-pos-3); }
.verdict-art.neg .verdict-art-label { color: var(--div-neg-3); }
.verdict-art.warn .verdict-art-label { color: var(--warning); }
.verdict-art.flat .verdict-art-label { color: var(--text-secondary); }
@media (max-width: 600px) { .verdict-art { height: 48px; } }

/* Credit circuit (#/lending). */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.chip-row .chip { white-space: normal; }
.swatch { display: inline-block; width: 8px; height: 8px; margin-right: 6px; vertical-align: 0; }
.split-bar { display: flex; height: 18px; font-size: 10px; font-weight: 600; line-height: 18px; }
.split-bar { width: 100%; overflow: hidden; }
.split-bar .split { box-sizing: border-box; min-width: 0; overflow: hidden; padding: 0 6px; white-space: nowrap; }
.split-bar .income { background: color-mix(in srgb, var(--cat-1) 70%, transparent); color: var(--text-primary); }
.split-bar .asset { background: color-mix(in srgb, var(--cat-2) 60%, transparent); color: var(--text-primary); text-align: right; }
/* Rules from portfolio/*.css that have always reached other pages too (the commodity and lending heatmaps, card
   titles, .negative). Those files now load with the portfolio page only (portfolio.js), so the other
   pages keep these copies; the portfolio files keep theirs, later in the cascade. */
.card-head h2 { display: inline-flex; align-items: center; gap: 4px; }
.negative { color: var(--critical); }
table.heatmap { border-collapse: separate; border-spacing: 2px; font-size: 10.5px; }
table.heatmap th { padding: 0 4px; white-space: nowrap; }
table.heatmap thead th { height: 22px; text-align: center; }
table.heatmap tbody th { text-align: right; }
table.heatmap td { width: var(--cell); height: 28px; min-width: var(--cell); text-align: center; color: var(--text-primary); }
table.heatmap td.strong { color: var(--div-strong-text); font-weight: 600; }
table.heatmap td.heat { min-width: 30px; text-align: center; font-size: 11px; }
table.heatmap td:first-child { white-space: nowrap; }
.warn-text { color: var(--warning); }
.weights { display: grid; gap: 8px; margin-top: 8px; }
.weight-row { display: grid; grid-template-columns: minmax(110px, max-content) 1fr 40px; align-items: center; gap: 10px; }
.wtrack { position: relative; height: 12px; background: var(--div-mid); }
.wtrack .band { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--warning) 22%, transparent); }
.wtrack .fill { position: absolute; top: 3px; bottom: 3px; left: 0; background: var(--text-secondary); }
.wtrack .dot { position: absolute; top: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--div-neg-3); }
.weights-key { display: flex; gap: 12px; margin-top: 6px; color: var(--text-muted); font-size: 10px; }
.weights-key .status-dot { margin: 0 4px 0 0; }
.key-bar, .key-band { display: inline-block; width: 14px; height: 6px; margin-right: 4px; vertical-align: 1px; background: var(--text-secondary); }
.key-band { height: 10px; background: color-mix(in srgb, var(--warning) 22%, transparent); }
.hero-side .bar-rows { grid-template-columns: minmax(90px, max-content) minmax(50px, 1fr) max-content minmax(0, max-content); }

/* ---- Plumbing (#/plumbing): the reserve sensitivity strip, the three ladders, the vol-spike line ------------- */
.plumb-sens { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: help; }
.plumb-sens .sub { font-size: 11px; }
.ladders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: 12px; }
.ladders > .ladder { align-self: start; }
.ladder > .label { margin-bottom: 6px; cursor: help; }
.ladder ol { display: grid; align-content: start; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ladder .step { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; align-items: start; cursor: help; }
.ladder .step .dot { width: 10px; height: 10px; margin-top: 3px; border: 1.5px solid var(--text-muted); border-radius: 50%; }
.ladder .step.neg .dot { background: var(--div-neg-3); border-color: var(--div-neg-3); }
.ladder .step.pos .dot { background: var(--div-pos-3); border-color: var(--div-pos-3); }
.ladder .step.warn .dot { background: linear-gradient(90deg, var(--warning) 50%, transparent 50%); border-color: var(--warning); }
.ladder .step.off .step-label { color: var(--text-secondary); }
.ladder .step-label { font-size: 12.5px; font-weight: 600; }
.ladder .step .sub { font-size: 11px; line-height: 1.35; }
.plumb-spike { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); cursor: help; }
.plumb-spike .sub { flex: 1 1 320px; font-size: 12px; }
.plumb-tiles { margin-top: 4px; }
@media (min-width: 1100px) { .plumb-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .ladders, .plumb-sens { grid-template-columns: minmax(0, 1fr); } .plumb-sens { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.plumb-cross { margin-top: 8px; }
.plumb-fc-tables { margin-top: 12px; }
.plumb-fc-tables > div > .label { margin-bottom: 6px; cursor: help; }

/* ---- Market state (#/market, public/market.js) ---------------------------------------------------------------- */
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--gap); margin-top: 10px; }
.mk-domain { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-content: start; padding: 8px 10px; border: 1px solid var(--border); border-left: 3px solid var(--baseline); background: var(--surface-1); color: inherit; text-decoration: none; min-width: 0; transition: border-color var(--fast) var(--ease); }
.mk-domain:hover { border-color: var(--text-muted); }
.mk-domain.pos { border-left-color: var(--div-pos-3); }
.mk-domain.neg { border-left-color: var(--div-neg-3); }
.mk-domain.warn { border-left-color: var(--warning); }
.mk-domain-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mk-domain-head .label { font-weight: 600; color: var(--text-primary); }
.mk-domain-text { margin: 0; font-family: var(--font-sans); font-size: 12px; line-height: 1.4; color: var(--text-secondary); }
.mk-items { display: grid; grid-template-columns: minmax(84px, 1fr) minmax(0, max-content) 48px 30px; gap: 3px 8px; align-items: center; font-size: 11px; }
.mk-item { display: contents; }
.mk-item-label { color: var(--text-muted); }
.mk-item b { text-align: right; white-space: nowrap; }
.mk-item b.pos { color: var(--div-pos-3); } .mk-item b.neg { color: var(--div-neg-3); } .mk-item b.warn { color: var(--warning); }
.mk-item-pct { color: var(--text-muted); text-align: right; }
.mk-pct { position: relative; height: 6px; background: var(--div-mid); }
.mk-pct.none { background: none; }
.mk-pct-mark { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--text-primary); }
.mk-pct-mark.extreme { background: var(--warning); }
.mk-legend { margin-top: 8px; }
.mk-calls { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); gap: 12px; align-items: start; margin-top: 8px; }
.mk-calls-table td.mk-cell { text-align: center; }
.mk-calls-table td.mk-cell.pos { background: var(--div-pos-1); } .mk-calls-table td.mk-cell.neg { background: var(--div-neg-1); }
.mk-third { display: flex; justify-content: center; gap: 8px; }
.mk-third span { color: var(--text-muted); }
.mk-calls-side { display: grid; gap: 8px; }
.mk-odds-label { margin-top: 4px; }
.mini-rows b.pos { color: var(--div-pos-3); } .mini-rows b.neg { color: var(--div-neg-3); }
.mk-record { font-family: var(--font-sans); font-size: 11px; line-height: 1.4; color: var(--text-secondary); white-space: normal; }
.mk-stack { display: grid; gap: var(--gap); align-content: start; }
@media (max-width: 720px) { .mk-calls { grid-template-columns: 1fr; } }
.mk-list { display: grid; }
.mk-row { display: grid; gap: 2px; padding: 5px 0; border-bottom: 1px solid var(--gridline); }
.mk-row:last-child { border-bottom: 0; }
.mk-row-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.mk-row-head .mk-date { color: var(--text-muted); min-width: 92px; }
.mk-row-head .mk-date + a { margin-right: auto; }
.mk-row .mk-record { margin: 0; min-width: 0; }
.mk-row, .mk-row-head > * { min-width: 0; }
.mk-row-head .chip { white-space: normal; text-align: right; }

/* ---- Short-dated SPX (#/short-vol, public/short-vol.js) ---- */
/* Short-dated SPX vol (short-vol.js): read tiles, the expiry heatmap, per-session forward move bars. */
.sv-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 12px; }
.sv-tiles .gauge-tile .stat-value { white-space: normal; }
@media (max-width: 1100px) { .sv-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .sv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .sv-tiles { grid-template-columns: minmax(0, 1fr); } }

table.matrix.sv-matrix th[scope="row"] { white-space: nowrap; }
table.matrix.sv-matrix th .sv-strike { display: block; margin-left: 0; font-size: 10px; }
table.matrix.sv-matrix tr.sv-thin-row th[scope="row"] { color: var(--text-muted); }

.sv-fwd { display: grid; grid-template-columns: max-content minmax(60px, 1fr) max-content 44px; gap: 3px 10px; align-items: center; font-size: 11px; }
.sv-fwd-row { display: contents; }
.sv-fwd-label { white-space: nowrap; color: var(--text-secondary); }
.sv-fwd-track { position: relative; height: 12px; }
.sv-fwd-bar { position: absolute; left: 0; top: 0; bottom: 0; max-width: 100%; background: var(--cat-1); border-radius: 0 4px 4px 0; }
.sv-fwd-row.event .sv-fwd-bar { background: var(--warning); }
.sv-fwd-row.negative .sv-fwd-bar { background: none; }
.sv-fwd-row.event .sv-fwd-label { color: var(--text-primary); font-weight: 600; }
.sv-fwd-base { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--text-primary); opacity: .55; }
.sv-fwd-value { text-align: right; font-variant-numeric: tabular-nums; }
.sv-fwd-flag { text-align: left; }
@media (max-width: 600px) { .sv-fwd { grid-template-columns: max-content minmax(40px, 1fr) max-content; } .sv-fwd-flag { display: none; } }

table.board tr.sv-selected td { background: var(--surface-2); }
.sv-last { margin-top: 8px; }

/* ---- futures-positioning (#/futures-positioning, public/futures-positioning.js) ---- */
/* Futures positioning (#/futures-positioning). Loaded by futures-positioning.js. */
.fp-timing { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: help; }
.fp-timing .stat-value { font-size: 15px; }
.fp-tiles { margin-top: 12px; }
@media (min-width: 1100px) { .fp-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.fp-tiles .gauge-tile { cursor: help; }
.fp-tiles .stat-value { font-size: 15px; white-space: normal; overflow-wrap: anywhere; }
.fp-tiles .gauge-tile .label { white-space: normal; }
.fp-picks { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: flex-end; }
.fp-picks .segmented { flex-wrap: wrap; }
.fp-page .board td.fp-pos { color: var(--div-pos-3); }
.fp-page .board td.fp-neg { color: var(--div-neg-3); }
.fp-page .board td.fp-strong { font-weight: 600; }
.fp-page .board td .chip { margin-left: 6px; }
.fp-page .board tr.fp-first td { border-top: 1px solid var(--border-strong, var(--border)); }
.fp-oos { font-size: 11px; }
@media (max-width: 900px) { .fp-timing { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- global-liquidity (#/global-liquidity, public/global-liquidity.js) ---- */
/* Global liquidity (#/global-liquidity). Loaded by global-liquidity.js. */
.gl-shares { margin-top: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.gl-share-track { display: flex; height: 10px; overflow: hidden; }
.gl-share-track > span { display: block; height: 100%; cursor: help; }
.gl-share-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 11px; }
.gl-share-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; vertical-align: 0; }
.gl-tiles { margin-top: 4px; }
@media (min-width: 1100px) { .gl-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.gl-tiles .gauge-tile { cursor: help; }
.gl-tiles .stat-value { font-size: 15px; }
.gl-split { margin-top: 10px; cursor: help; }
.gl-page .board td.gl-pos { color: var(--div-pos-3); }
.gl-page .board td.gl-neg { color: var(--div-neg-3); }
.gl-strong { margin-top: 10px; }
.gl-skip-label { margin: 12px 0 6px; }
/* Druckenmiller's read */
.dk-tiles { margin-top: 4px; }
@media (min-width: 1100px) { .dk-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } .dk-predict { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dk-predict { margin-top: 10px; }
.dk-tiles .gauge-tile { cursor: help; }
.dk-tiles .stat-value { font-size: 15px; }
.dk-label { margin: 12px 0 6px; }
.dk-page .board td.dk-pos { color: var(--div-pos-3); }
.dk-page .board td.dk-neg { color: var(--div-neg-3); }
.dk-page .board td.dk-warn { color: var(--warning); }
.dk-page .board td.dk-pass { font-weight: 600; }
.dk-page .board td.dk-quote { min-width: 260px; max-width: 420px; white-space: normal; }
.dk-page .board td.dk-quote a { color: inherit; text-decoration: underline dotted; text-underline-offset: 2px; }
.dk-page .board td .chip { vertical-align: 1px; }
.dk-page .board td .dk-venue { font-size: 11px; white-space: normal; max-width: 140px; }
.dk-page .board tr.dk-subhead td { padding-top: 10px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-secondary); }
.dk-page .board td .chip + .chip { margin-left: 4px; }
.dk-page .board td .chip { white-space: normal; }

/* ---- vol radar (#/radar, public/radar.js) ---- */
.radar-page { display: grid; gap: var(--gap); }
.radar-box { display: flex; justify-content: center; padding-top: 8px; }
.radar-chart { max-width: 100%; height: auto; }
.radar-chart .radar-spread { fill: var(--text-muted); font-size: 9px; }
.radar-chart .radar-label { fill: var(--text-primary); }
.radar-page .board td.radar-name { text-align: left; white-space: nowrap; }
.radar-page .board td.radar-strong { font-weight: 600; }
.radar-page .board td .chip { margin: 0; }
.radar-page .legend { justify-content: center; }
.radar-page .table-wrap + .table-wrap, .radar-page .sub + .table-wrap { margin-top: 8px; }
/* ---- commodities (#/commodities, #/oil, #/shipping; public/commodities.js) ---- */
.vr-bars { display: grid; gap: 3px; }
.vr-row { display: grid; grid-template-columns: minmax(96px, 150px) 1fr 42px; align-items: center; gap: 8px; font-size: 11.5px; }
.vr-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vr-track { position: relative; height: 12px; background: var(--surface-2); }
.vr-fill { position: absolute; inset: 0 auto 0 0; background: var(--baseline); }
.vr-fill.energy { background: var(--cat-2); opacity: .7; }
.vr-fill.hot { opacity: 1; }
.vr-one { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--text-muted); }
.vr-val { text-align: right; font-variant-numeric: tabular-nums; }
.pump-bars { display: grid; gap: 10px; margin-top: 6px; }
.pump-label { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 3px; }
.pump-bar { display: flex; height: 22px; overflow: hidden; }
.pump-seg { display: flex; align-items: center; justify-content: center; min-width: 0; color: #fff; font-size: 10.5px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.world-map svg { display: block; width: 100%; height: auto; }
.wm-land { fill: var(--surface-2); stroke: var(--border); stroke-width: .4; }
.wm-lane { fill: none; stroke: var(--cat-1); stroke-opacity: .55; stroke-linecap: round; }
.wm-lane.hormuz { stroke: var(--cat-8); }
.wm-lane.suez { stroke-dasharray: 3 3; }
.wm-lane:hover { stroke-opacity: .95; }
.wm-region circle { fill: var(--text-muted); fill-opacity: .35; stroke: var(--text-secondary); stroke-width: .8; }
.wm-region.down circle { fill: var(--div-neg-2); fill-opacity: .55; stroke: var(--div-neg-3); }
.wm-region.down2 circle { fill: var(--div-neg-3); fill-opacity: .6; stroke: var(--div-neg-3); }
.wm-region.up circle { fill: var(--div-pos-2); fill-opacity: .55; stroke: var(--div-pos-3); }
.wm-region.up2 circle { fill: var(--div-pos-3); fill-opacity: .6; stroke: var(--div-pos-3); }
.wm-label { fill: var(--text-primary); font-size: 9px; font-weight: 600; text-anchor: middle; paint-order: stroke; stroke: var(--surface-1); stroke-width: 2.5px; pointer-events: none; }
.wm-choke rect { fill: var(--surface-1); stroke: var(--text-secondary); stroke-width: 1.2; }
.wm-choke.shut rect { fill: var(--div-neg-3); stroke: var(--div-neg-3); }
.wm-choke.busy rect { fill: var(--warning); stroke: var(--warning); }
.wm-choke-label { fill: var(--text-primary); font-size: 8.5px; font-weight: 600; paint-order: stroke; stroke: var(--surface-1); stroke-width: 2.5px; }
.wm-freight { fill: var(--cat-8); font-size: 9.5px; font-weight: 700; paint-order: stroke; stroke: var(--surface-1); stroke-width: 3px; }
.wm-key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--text-secondary); }
.wm-key > span { display: inline-flex; align-items: center; gap: 5px; }
.wm-key-line { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--cat-1); opacity: .7; }
.wm-key-line.hormuz { border-color: var(--cat-8); }
.wm-key-line.suez { border-top-style: dashed; }
.wm-key-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.wm-key-dot.down2 { background: var(--div-neg-3); }
.wm-key-dot.up2 { background: var(--div-pos-3); }
.wm-key-diamond { display: inline-block; width: 7px; height: 7px; transform: rotate(45deg); background: var(--div-neg-3); }
@media (max-width: 640px) { .world-map { overflow-x: auto; } .world-map svg { min-width: 760px; } }
.wm-spr rect { fill: var(--cat-7); fill-opacity: .35; stroke: var(--cat-7); stroke-width: 1; }
.wm-spr .wm-spr-cap { fill: none; stroke: var(--cat-7); stroke-dasharray: 2 2; stroke-opacity: .7; }
.wm-spr.drawn rect:not(.wm-spr-cap) { fill: var(--div-neg-2); stroke: var(--div-neg-3); fill-opacity: .55; }
.wm-spr.drawn2 rect:not(.wm-spr-cap) { fill: var(--div-neg-3); stroke: var(--div-neg-3); fill-opacity: .6; }
.wm-spr.filled rect:not(.wm-spr-cap) { fill: var(--div-pos-2); stroke: var(--div-pos-3); fill-opacity: .55; }
.wm-spr-label { fill: var(--cat-7); font-size: 8.5px; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: var(--surface-1); stroke-width: 2.5px; pointer-events: none; }
.wm-key-square { display: inline-block; width: 9px; height: 9px; background: color-mix(in srgb, var(--cat-7) 40%, transparent); border: 1px solid var(--cat-7); }
.spr-bars { display: grid; gap: 4px; margin-top: 4px; }
.spr-row { display: grid; grid-template-columns: minmax(90px, 130px) 1fr 44px 40px; align-items: center; gap: 8px; font-size: 11.5px; }
.spr-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spr-track { position: relative; height: 14px; }
.spr-cap { position: absolute; inset: 0 auto 0 0; border: 1px dashed var(--cat-7); }
.spr-before { position: absolute; inset: 2px auto 2px 0; background: color-mix(in srgb, var(--cat-7) 25%, transparent); }
.spr-now { position: absolute; inset: 2px auto 2px 0; background: var(--cat-7); }
.spr-now.drawn { background: var(--div-neg-3); }
.spr-val, .spr-chg { text-align: right; font-variant-numeric: tabular-nums; }
.spr-chg.neg { color: var(--div-neg-3); }
.wm-lane.lng { stroke: var(--cat-5); }
.wm-lane.lng.hormuz { stroke: var(--cat-8); }
.wm-lane.pipe { stroke: var(--cat-7); stroke-dasharray: 5 3; stroke-opacity: .6; }
.wm-key-line.lng { border-color: var(--cat-5); }
.wm-key-line.pipe { border-color: var(--cat-7); border-top-style: dashed; }
.wm-store circle { fill: var(--cat-7); fill-opacity: .3; stroke: var(--cat-7); stroke-width: .8; }
.wm-store.low circle { fill: var(--div-neg-2); stroke: var(--div-neg-3); fill-opacity: .5; }
.wm-store.low2 circle { fill: var(--div-neg-3); stroke: var(--div-neg-3); fill-opacity: .6; }
.wm-store.high circle { fill: var(--div-pos-2); stroke: var(--div-pos-3); fill-opacity: .5; }
.wm-key-dot.store { background: color-mix(in srgb, var(--cat-7) 45%, transparent); border: 1px solid var(--cat-7); }
.eu-bars { display: grid; gap: 3px; margin-top: 4px; }
.eu-row { display: grid; grid-template-columns: minmax(80px, 120px) 1fr 52px 40px; align-items: center; gap: 8px; font-size: 11.5px; }
.eu-row.eu-total { font-weight: 700; }
.eu-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eu-track { position: relative; height: 13px; }
.eu-fill { position: absolute; inset: 0 auto 0 0; display: flex; overflow: hidden; }
.eu-fill > span { height: 100%; }
.eu-fill.plain { background: var(--baseline); }
.eu-ttf { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text-primary); }
.eu-val, .eu-chg { text-align: right; font-variant-numeric: tabular-nums; }
.eu-chg.up { color: var(--div-neg-3); }
