/*
 * TraderHome unify layer — loaded after every product stylesheet.
 *
 * Each product keeps its own CSS and local variable names. This file only
 * points those variables at the shared tokens in traderhome-tokens.css and
 * harmonises a few shared components (buttons, inputs, tables, cards).
 * Keep rules scoped by html[data-th-stage] so one product cannot leak into
 * another, and prefer variable mapping over restyling individual selectors.
 */

/* ---------- Base: every route ---------- */
html[data-th-stage] body {
  font-family: var(--th-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
html[data-th-stage] ::selection { background: color-mix(in srgb, var(--th-accent) 32%, transparent); color: var(--th-text); }
html[data-th-stage] :focus-visible { outline: 2px solid var(--th-accent); outline-offset: 2px; }
html[data-th-stage] { scrollbar-color: #2a3647 transparent; }
html[data-th-stage] table,
html[data-th-stage] [class*="metric"] strong,
html[data-th-stage] [class*="kpi"] strong { font-variant-numeric: tabular-nums; }
/* Product CSS sometimes sets display on buttons that start [hidden]. */
html[data-th-stage] [hidden] { display: none !important; }
html[data-th-stage] h1, html[data-th-stage] h2, html[data-th-stage] h3 { text-wrap: balance; }
/* Chinese headlines break at punctuation first, never leaving a lone "下。". */
html[data-th-stage] :is(.th-hero h1, .io-hero h1, .tt-hero h1, .th-flow strong, .th-sys h3) { word-break: keep-all; overflow-wrap: anywhere; }
html[data-th-stage] p { text-wrap: pretty; }

/* ---------- Kezhou · 历史证据 (generated page: variables only) ---------- */
html[data-th-stage="history"]:not([data-theme="light"]) {
  --bg: var(--th-bg);
  --bg2: var(--th-surface-2);
  --pan: var(--th-surface-1);
  --pan2: var(--th-surface-2);
  --ink: var(--th-text);
  --ink2: var(--th-text-2);
  --mut: var(--th-muted);
  --line: var(--th-line);
  --line2: var(--th-line-strong);
  --acc: var(--th-accent-history);
  --acc2: #8aa5c8;
  --up: var(--th-up);
  --dn: var(--th-down);
  --gold: var(--th-warn);
  --head: rgba(8, 12, 20, .88);
  --sh: var(--th-shadow);
}
html[data-th-stage="history"][data-theme="dark"] body,
html[data-th-stage="history"]:not([data-theme]) body {
  background: radial-gradient(1100px 560px at 82% -12%, var(--th-bg-glow), transparent 60%), var(--th-bg);
}
html[data-th-stage="history"] .appbar-in { max-width: 1400px; }
html[data-th-stage="history"] .btn.pri { color: var(--th-on-accent); }
/* Generated page uses 10–11px captions; lift Chinese text to the 12px floor. */
html[data-th-stage="history"] #app :is(.csub, .note, .universe-meta, .market-count, td.mut, span.mut, th, small) { font-size: 12px; }
@media (max-width: 680px) {
  /* Long source URLs and the search field must not widen the page. */
  html[data-th-stage="history"] body { overflow-x: hidden; }
  html[data-th-stage="history"] .sidesearch,
  html[data-th-stage="history"] .sidesearch input { max-width: 100%; min-width: 0; }
  html[data-th-stage="history"] #app * { overflow-wrap: anywhere; }
}

/* ---------- TradeReview OS · 交易复盘 ---------- */
html[data-th-stage="review"] {
  --rv-bg: var(--th-bg);
  --rv-surface: var(--th-surface-1);
  --rv-surface-2: var(--th-surface-2);
  --rv-surface-3: var(--th-surface-3);
  --rv-line: var(--th-line-strong);
  --rv-line-soft: var(--th-line);
  --rv-text: var(--th-text);
  --rv-muted: var(--th-muted);
  --rv-green: var(--th-up);
  --rv-blue: var(--th-info);
  --rv-amber: var(--th-warn);
  --rv-red: var(--th-down);
  --rv-cyan: var(--th-accent-history);
}
html[data-th-stage="review"] body.rv-page { background: radial-gradient(1000px 520px at 85% -10%, rgba(180, 165, 251, .08), transparent 60%), var(--th-bg); }
html[data-th-stage="review"] .rv-page .th-kicker { color: var(--th-accent); }
html[data-th-stage="review"] .rv-button--primary {
  color: var(--th-on-accent);
  background: var(--th-accent);
  border-color: var(--th-accent);
}
html[data-th-stage="review"] .rv-button--primary:hover { background: color-mix(in srgb, var(--th-accent) 88%, white); border-color: color-mix(in srgb, var(--th-accent) 88%, white); }

/* ---------- IncomeOS (default "ocean" theme maps to shared tokens) ---------- */
html[data-th-stage="incomeos"]:is(:not([data-income-color]), [data-income-color="ocean"]) {
  --income-font-family: var(--th-font);
  --io-bg: var(--th-bg);
  --io-panel: var(--th-surface-1);
  --io-panel-2: var(--th-surface-2);
  --io-input-bg: var(--th-input);
  --io-topbar-bg: rgba(8, 12, 20, .9);
  --io-tabs-bg: rgba(8, 12, 20, .94);
  --io-glow-a: rgba(94, 224, 210, .08);
  --io-glow-b: rgba(122, 174, 255, .07);
  --io-line: var(--th-line);
  --io-text: var(--th-text);
  --io-muted: var(--th-muted);
  --io-cyan: var(--th-accent-incomeos);
  --io-blue: var(--th-info);
  --io-amber: var(--th-warn);
  --io-red: var(--th-down);
  --io-green: var(--th-up);
}
/* One sticky bar only: the product tabs sit directly under the site shell. */
html[data-th-stage="incomeos"] .io-topbar { position: relative; top: auto; z-index: 1; }
/* Brand, back link and status duplicate the site shell and the snapshot gate. */
html[data-th-stage="incomeos"] .io-topbar-inner { display: none; }
html[data-th-stage="incomeos"] .io-tabs-shell { top: var(--th-shell-h) !important; }
/* A weekly tool: keep the input panel above the fold. */
html[data-th-stage="incomeos"] .io-hero,
html[data-th-stage="incomeos"] .io-hero.compact-hero { min-height: 0; padding-block: 40px 40px; gap: 48px; }
html[data-th-stage="incomeos"] .io-hero h1 { font-size: clamp(30px, 3.6vw, 52px); line-height: 1.08; letter-spacing: -.03em; margin: 12px 0 16px; }
html[data-th-stage="incomeos"] .io-hero-copy > p { font-size: var(--th-fs-base); }
/* Allocation legend: value sits next to its own label, not the next dot. */
html[data-th-stage="incomeos"] .io-allocation-legend { column-gap: 22px; row-gap: 8px; }
html[data-th-stage="incomeos"] .io-allocation-legend div { grid-template-columns: 8px auto auto; justify-content: start; gap: 7px; font-size: var(--th-fs-sm); }
html[data-th-stage="incomeos"] .io-allocation-legend b { font-size: var(--th-fs-sm); }

/* ---------- TailTrend Lab ---------- */
html[data-th-stage="tailtrend"] {
  --tt-bg: var(--th-bg);
  --tt-panel: var(--th-surface-1);
  --tt-panel-2: var(--th-surface-2);
  --tt-line: var(--th-line);
  --tt-text: var(--th-text);
  --tt-text-2: var(--th-text-2);
  --tt-muted: var(--th-muted);
  --tt-mint: var(--th-accent-tailtrend);
  --tt-cyan: var(--th-accent-history);
  --tt-amber: var(--th-warn);
  --tt-red: var(--th-down);
  --tt-violet: var(--th-accent-review);
  --tt-radius: var(--th-r-lg);
}
html[data-th-stage="tailtrend"] body.tailtrend { background: radial-gradient(1000px 520px at 84% -8%, rgba(116, 227, 173, .08), transparent 60%), var(--th-bg); }
html[data-th-stage="tailtrend"] .tt-wrap { width: min(var(--th-container), calc(100% - 2 * var(--th-gutter))); }
html[data-th-stage="tailtrend"] .tt-hero { min-height: 0; padding-block: 48px 40px; }
html[data-th-stage="tailtrend"] .tt-hero h1 { font-size: clamp(30px, 3.4vw, 48px); line-height: 1.12; letter-spacing: -.03em; }
/* The scanner table scrolls inside its card instead of clipping columns. */
html[data-th-stage="tailtrend"] .tt-table-wrap { overflow-x: auto; }
html[data-th-stage="tailtrend"] .tt-table td:last-child,
html[data-th-stage="tailtrend"] .tt-table th:last-child { white-space: nowrap; }
html[data-th-stage="tailtrend"] .tt-stale-banner {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid rgba(240, 122, 133, .4);
  border-radius: var(--th-r-md);
  color: #ffc9cf;
  background: var(--th-down-bg);
  font-size: var(--th-fs-md);
}

/* ---------- 主流市场模拟分析 ---------- */
html[data-th-stage="marketSimulation"] .ms-page {
  --ms-bg: var(--th-bg);
  --ms-card: var(--th-surface-1);
  --ms-line: var(--th-line-strong);
  --ms-muted: var(--th-muted);
  --ms-ink: var(--th-text);
  --ms-accent: var(--th-accent-market);
  --ms-warn: var(--th-warn);
  --ms-down: var(--th-down);
  font-family: var(--th-font);
}
html[data-th-stage="marketSimulation"] .ms-wrap { max-width: var(--th-container-wide); padding-inline: var(--th-gutter); }

/* ---------- 场外日线 ---------- */
html[data-th-stage="otc"] {
  --bg: var(--th-bg);
  --panel: var(--th-surface-1);
  --line: var(--th-line-strong);
  --text: var(--th-text);
  --muted: var(--th-muted);
  --cyan: var(--th-accent-otc);
  --green: var(--th-up);
  --red: var(--th-down);
  --amber: var(--th-warn);
}
html[data-th-stage="otc"] body { font-family: var(--th-font); }
html[data-th-stage="otc"] body > main { max-width: var(--th-container-wide); padding-inline: var(--th-gutter); }

/* ---------- 交易早晚报 reports (generated HTML) ---------- */
html[data-th-stage="dailyTrade"] body { font-family: var(--th-font); }

/* ---------- Shared component harmonisation ---------- */
html[data-th-stage]:not([data-th-stage="home"]) :is(.rv-button, .tt-button, .io-button, .ms-page button, .btn) { border-radius: var(--th-r-md); }
html[data-th-stage]:not([data-th-stage="home"]) :is(.rv-table thead th, .tt-table th, .io-table th) {
  color: var(--th-muted);
  font-size: var(--th-fs-xs);
  font-weight: 650;
  letter-spacing: .04em;
}
html[data-th-stage="tailtrend"] .tt-hero__status[data-expired] .tt-live-dot { color: var(--th-down); }
html[data-th-stage="tailtrend"] .tt-hero__status[data-expired] .tt-live-dot::before { background: var(--th-down) !important; box-shadow: none !important; }
html[data-th-stage="tailtrend"] .tt-fresh.stale { color: var(--th-down); }
html[data-th-stage="incomeos"] .io-topbar-status[data-level="stale"] { color: var(--th-down); }
html[data-th-stage="incomeos"] .io-topbar-status[data-level="stale"] i { background: var(--th-down); box-shadow: none; }
html[data-th-stage="incomeos"] .io-topbar-status[data-level="watch"] i,
html[data-th-stage="incomeos"] .io-topbar-status[data-level="aging"] i { background: var(--th-warn); box-shadow: none; }
/* Short pages: the canvas below <body> matches the page background. */
html[data-th-stage]:not([data-income-color="daylight"]):not([data-theme="light"]) { background-color: var(--th-bg); }

/* ---------- Clarity pass (November 2026) ---------- */
/* Home: a stale system's link reads as a look-back, not an action; keep product names on one line. */
html[data-th-stage="home"] .th-sys__go.is-stale { color: var(--th-muted); }
html[data-th-stage="home"] .th-contracts th[scope="row"] { white-space: nowrap; }

/* IncomeOS: say "old data" right next to the plan date; the option card no longer stretches to the order list. */
html[data-th-stage="incomeos"] .io-meta.is-stale b { color: var(--th-down); }
html[data-th-stage="incomeos"] .io-meta-stale { color: var(--th-warn); font-size: var(--th-fs-xs); }
html[data-th-stage="incomeos"] .io-action-grid > .io-put-callout { align-self: start; }

/* TailTrend: product buttons were inheriting 16px from the generic `.tailtrend button` rule. */
html[data-th-stage="tailtrend"] .tailtrend :is(.tt-filter, .tt-button) { font-size: var(--th-fs-sm); }
html[data-th-stage="tailtrend"] .tt-action--stale { color: var(--th-warn); font-weight: 600; }
html[data-th-stage="tailtrend"] .tailtrend input[type="file"] { max-width: 100%; color: var(--th-muted); font-size: var(--th-fs-sm); }
html[data-th-stage="tailtrend"] .tailtrend input[type="file"]::file-selector-button {
  margin-right: 10px; padding: 6px 12px; border: 1px solid var(--th-line-strong); border-radius: var(--th-r-sm);
  color: var(--th-text); background: var(--th-surface-2); font: 600 var(--th-fs-sm) var(--th-font); cursor: pointer;
}

/* Review: what you get after importing. */
html[data-th-stage="review"] .rv-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; counter-reset: rvflow; }
html[data-th-stage="review"] .rv-flow li { position: relative; padding: 12px 12px 12px 40px; border: 1px solid var(--th-line); border-radius: var(--th-r-md); background: var(--th-surface-2); counter-increment: rvflow; }
html[data-th-stage="review"] .rv-flow li::before { content: counter(rvflow); position: absolute; left: 12px; top: 12px; width: 20px; height: 20px; border-radius: 50%; color: var(--th-on-accent); background: var(--th-accent-review); font: 700 12px/20px var(--th-font); text-align: center; }
html[data-th-stage="review"] .rv-flow b { display: block; color: var(--th-text); font-size: var(--th-fs-sm); }
html[data-th-stage="review"] .rv-flow span { display: block; margin-top: 2px; color: var(--th-muted); font-size: var(--th-fs-xs); line-height: 1.5; }
@media (max-width: 760px) { html[data-th-stage="review"] .rv-flow { grid-template-columns: 1fr 1fr; } }

/* Market simulation: "休市" is a neutral state, not a warning. */
html[data-th-stage="marketSimulation"] .ms-badge:not(.good):not(.warn):not(.bad) { color: var(--th-muted); border-color: var(--th-line-strong); background: var(--th-surface-2); }

/* ============================================================
   Unification pass 3 (2026-11-10)
   Every product page: page bar (shell) → compact page header → content → page note → site footer.
   ============================================================ */

/* ---------- Page note: one short, page-specific data note above the site footer ---------- */
.th-pagenote {
  box-sizing: border-box;
  margin: 32px auto 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--th-line);
  color: var(--th-muted);
  font: 400 var(--th-fs-xs)/1.6 var(--th-font);
  text-align: left;
}
html[data-th-stage="otc"] .th-pagenote { margin-inline: 0; }
html[data-th-stage="marketSimulation"] .ms-footer {
  margin-top: 32px; padding: 14px 0 0; border-top: 1px solid var(--th-line);
  color: var(--th-muted); font-size: var(--th-fs-xs); line-height: 1.6;
}
html[data-th-stage="marketSimulation"] .ms-footer p { margin: 0 0 4px; }
html[data-th-stage="dailyTrade"] .dt-page { padding-bottom: 0; }

/* ---------- One page-header scale for product pages (the home page keeps its landing hero) ---------- */
html[data-th-stage="review"] .rv-header h1,
html[data-th-stage="dailyTrade"] .dt-head h1,
html[data-th-stage="otc"] .workhead h1,
html[data-th-stage="marketSimulation"] .ms-hero h1,
html[data-th-stage="incomeos"] .io-hero h1,
html[data-th-stage="tailtrend"] .tt-hero h1 {
  margin: 0 0 10px;
  font-family: var(--th-font);
  font-size: var(--th-fs-3xl);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -.02em;
}
html[data-th-stage="incomeos"] .io-hero h1 br,
html[data-th-stage="tailtrend"] .tt-hero h1 br { display: none; }
html[data-th-stage="incomeos"] .io-hero h1 span,
html[data-th-stage="tailtrend"] .tt-hero h1 span { color: var(--th-accent); background: none; -webkit-background-clip: border-box; background-clip: border-box; }
html[data-th-stage="incomeos"] .io-hero-copy > p,
html[data-th-stage="tailtrend"] .tt-hero__copy > p,
html[data-th-stage="marketSimulation"] .ms-subtitle,
html[data-th-stage="review"] .rv-header p {
  max-width: 760px;
  color: var(--th-text-2);
  font-size: var(--th-fs-base);
  line-height: 1.7;
}

/* IncomeOS: content lines up with the navigation; the hero is a header, not a landing page. */
html[data-th-stage="incomeos"] .io-wrap { width: min(var(--th-container), calc(100% - 2 * var(--th-gutter))); }
html[data-th-stage="incomeos"] .io-hero,
html[data-th-stage="incomeos"] .io-hero.compact-hero { min-height: 0; align-items: start; gap: 40px; padding-block: 40px 36px; }
html[data-th-stage="incomeos"] .io-hero-proof { margin: 20px 0 14px; }
html[data-th-stage="incomeos"] .io-control-panel { box-shadow: none; border-radius: var(--th-r-lg); }

/* TailTrend: same header; the ornament goes, the source facts stay. */
html[data-th-stage="tailtrend"] .tt-hero { min-height: 0; align-items: start; gap: 40px; padding: 40px 0 28px; }
html[data-th-stage="tailtrend"] .tt-orbit { display: none; }
html[data-th-stage="tailtrend"] .tt-hero__status { padding: 18px 20px; border-radius: var(--th-r-lg); box-shadow: none; }
html[data-th-stage="tailtrend"] .tt-statusline { margin-bottom: 12px; }
html[data-th-stage="tailtrend"] .tt-actions { margin-top: 18px; }
html[data-th-stage="tailtrend"] .tt-hero__rules { margin-top: 14px; }
html[data-th-stage="tailtrend"] .tt-health { margin-bottom: 0; }
html[data-th-stage="tailtrend"] .tt-section { padding-block: 40px; }

/* Section headings: one size for h2 across product pages. */
html[data-th-stage="tailtrend"] .tt-section h2,
html[data-th-stage="incomeos"] .io-section-head h2 { font-size: var(--th-fs-2xl); line-height: 1.25; letter-spacing: -.01em; }

/* TailTrend on phones: one compact card per stock instead of a tall stack of labelled fields. */
@media (max-width: 760px) {
  html[data-th-stage="tailtrend"] .tt-table tbody tr { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 14px; }
  html[data-th-stage="tailtrend"] .tt-table td::before { display: none; }
  html[data-th-stage="tailtrend"] .tt-table td:first-child { grid-column: 1; padding-bottom: 0; border-bottom: 0; }
  html[data-th-stage="tailtrend"] .tt-table td[data-label="状态"] { grid-column: 2; grid-row: 1; text-align: right; }
  html[data-th-stage="tailtrend"] .tt-table td[data-label="位置"],
  html[data-th-stage="tailtrend"] .tt-table td[data-label="动作"] { grid-column: 1 / -1; }
  html[data-th-stage="tailtrend"] .tt-table td[data-label="周线 / 波动"] { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; }
  html[data-th-stage="tailtrend"] .tt-table td[data-label="周线 / 波动"] .tt-cell-sub { margin: 0; }
  html[data-th-stage="tailtrend"] .tt-table td[data-label="数据"] { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; }
  /* A fresh row does not need to repeat "fresh + date" on every card; anything else stays visible. */
  html[data-th-stage="tailtrend"] .tt-table td[data-label="数据"]:has(.tt-fresh.fresh) { display: none; }
  html[data-th-stage="incomeos"] .io-hero, html[data-th-stage="incomeos"] .io-hero.compact-hero { padding-block: 28px; gap: 24px; }
  html[data-th-stage="tailtrend"] .tt-hero { padding: 28px 0 20px; gap: 20px; }
  html[data-th-stage="review"] .rv-header h1, html[data-th-stage="dailyTrade"] .dt-head h1, html[data-th-stage="otc"] .workhead h1,
  html[data-th-stage="marketSimulation"] .ms-hero h1, html[data-th-stage="incomeos"] .io-hero h1, html[data-th-stage="tailtrend"] .tt-hero h1 { font-size: var(--th-fs-2xl); }
}

/* TailTrend audit: missing runs are a visible gap, not "0 changes". */
html[data-th-stage="tailtrend"] .tt-audit-changes > article.tt-audit-missing { border-style: dashed; background: transparent; }
html[data-th-stage="tailtrend"] .tt-audit-changes > article.tt-audit-missing b { color: var(--th-warn); }
html[data-th-stage="tailtrend"] .tt-audit-changes > article.tt-audit-missing.is-planned b { color: var(--th-muted); }
html[data-th-stage="tailtrend"] .tt-audit-versus { display: block; margin-top: 4px; color: var(--th-muted); font-size: var(--th-fs-xs); }
html[data-th-stage="tailtrend"] .tt-audit-changes details { margin-top: 6px; color: var(--th-muted); font-size: var(--th-fs-xs); }
html[data-th-stage="tailtrend"] .tt-audit-changes summary { cursor: pointer; }

/* OTC: the plan panel's date drops under its heading instead of squeezing the heading into two lines. */
html[data-th-stage="otc"] .plan .panelhead { flex-wrap: wrap; }
html[data-th-stage="otc"] .plan .panelhead h2 { white-space: nowrap; }
html[data-th-stage="otc"] .plan .panelhead span { color: var(--th-muted); font-size: var(--th-fs-xs); }
@media (max-width: 760px) {
  html[data-th-stage="incomeos"] .io-hero-proof { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   Editions and notices (2026-11-10)
   A page can be up to date and still not be "the signal of the day": a research edition that
   produces no orders, or a same-day recalculation under a newer engine. One notice says so.
   ============================================================ */
.th-notice {
  box-sizing: border-box;
  display: grid;
  gap: 4px;
  max-width: 100%;
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--th-line);
  border-left: 3px solid var(--th-info);
  border-radius: var(--th-r-md);
  background: var(--th-info-bg);
  color: var(--th-text-2);
  font: 400 var(--th-fs-sm)/1.65 var(--th-font);
  letter-spacing: 0;
  text-align: left;
}
.th-notice > b { color: var(--th-text); font: 650 var(--th-fs-md)/1.4 var(--th-font); letter-spacing: 0; }
.th-notice > span { color: var(--th-text-2); font-size: var(--th-fs-sm); }
.th-notice[data-tone="warn"] { border-left-color: var(--th-warn); background: var(--th-warn-bg); }
.th-notice[data-tone="stop"] { border-left-color: var(--th-down); background: var(--th-down-bg); }
.th-notice[data-tone="ok"] { border-left-color: var(--th-up); background: var(--th-up-bg); }
.th-notice[data-tone="quiet"] { border-left-color: var(--th-line-strong); background: var(--th-surface-2); }

/* IncomeOS: the snapshot notice sits between the lead and the numbers; research tags share its colour. */
html[data-th-stage="incomeos"] .io-hero-copy > .th-notice { margin: 18px 0 0; max-width: 760px; }
html[data-th-stage="incomeos"] .io-hero-proof { margin: 18px 0 0; }
html[data-th-stage="incomeos"] .io-state.research { color: var(--th-info); border-color: rgba(122, 174, 255, .38); background: var(--th-info-bg); }
html[data-th-stage="incomeos"] .io-meta.is-research b { color: var(--th-info); }
html[data-th-stage="incomeos"] .io-meta.is-research .io-meta-stale { color: var(--th-info); }
html[data-th-stage="incomeos"] .io-meta-note { display: block; margin-top: 2px; color: var(--th-muted); font-size: var(--th-fs-xs); }
html[data-th-stage="incomeos"] .io-orders > p.io-orders-empty { margin: 0; color: var(--th-muted); font-size: var(--th-fs-sm); line-height: 1.6; }
html[data-th-stage="incomeos"] .io-table-note { margin: 0 0 10px; color: var(--th-muted); font-size: var(--th-fs-xs); line-height: 1.6; }
/* Data room: a few grouped facts instead of one line per symbol. */
html[data-th-stage="incomeos"] .io-gaps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
html[data-th-stage="incomeos"] .io-gaps > li { padding: 12px 14px; border: 1px solid var(--th-line); border-radius: var(--th-r-md); background: var(--th-surface-2); }
html[data-th-stage="incomeos"] .io-gaps b { display: block; color: var(--th-text); font-size: var(--th-fs-md); font-weight: 600; }
html[data-th-stage="incomeos"] .io-gaps span { display: block; margin-top: 2px; color: var(--th-muted); font-size: var(--th-fs-xs); line-height: 1.6; overflow-wrap: anywhere; }
html[data-th-stage="incomeos"] .io-gaps-count { float: right; margin-left: 12px; color: var(--th-text-2); font: 600 var(--th-fs-sm) var(--th-font-mono); }
html[data-th-stage="incomeos"] .io-data-block { margin-top: 20px; }
html[data-th-stage="incomeos"] .io-data-block > h3 { margin: 0 0 4px; color: var(--th-text); font-size: var(--th-fs-lg); }
html[data-th-stage="incomeos"] .io-data-block > p { margin: 0 0 12px; color: var(--th-muted); font-size: var(--th-fs-sm); line-height: 1.6; }
html[data-th-stage="incomeos"] .io-data-block ul.io-plain { margin: 0; padding-left: 18px; color: var(--th-text-2); font-size: var(--th-fs-sm); line-height: 1.7; }
html[data-th-stage="incomeos"] .io-data-block details { margin-top: 12px; color: var(--th-muted); font-size: var(--th-fs-sm); }
html[data-th-stage="incomeos"] .io-data-block summary { cursor: pointer; color: var(--th-text-2); }
html[data-th-stage="incomeos"] .io-data-block details .io-table-wrap { margin-top: 10px; max-height: 420px; overflow: auto; }

/* TailTrend: a recalculated edition is announced above the table, in the same notice. */
html[data-th-stage="tailtrend"] #ttRevisionNote { margin: 0 0 16px; }

/* Home: a status line that wraps should not leave two characters on the second line. */
html[data-th-stage="home"] .th-sys footer small { text-wrap: balance; }

/* TailTrend on a weekly rhythm: past the four-day window but on schedule reads as a caution, not an outage. */
html[data-th-stage="tailtrend"] .tt-hero__status[data-expired][data-waiting] .tt-live-dot { color: var(--th-warn); }
html[data-th-stage="tailtrend"] .tt-hero__status[data-expired][data-waiting] .tt-live-dot::before { background: var(--th-warn) !important; }
html[data-th-stage="tailtrend"] #ttStaleBanner.th-notice { margin: 0 0 20px; }
