/* Market Today stylesheet. Design tokens first (UI_REDESIGN_PLAN.md section 6); every colour,
   radius and type size used below is one of these. Raw colour values appear only in this block. */
:root {
  color-scheme: light;
  /* surfaces */
  --bg-0: #f7f7f5; --bg-1: #ffffff; --bg-2: #f0f0ed; --bg-hover: #ececea;
  /* borders and text */
  --border-subtle: rgba(0,0,0,.07); --border-strong: rgba(0,0,0,.14);
  --text-1: #111113; --text-2: #55555b; --text-3: #86868c;
  /* semantic */
  --interactive: #2f5fd0; --interactive-soft: #e9effb; --on-interactive: #ffffff;
  --positive: #1a7f4b; --negative: #c23b3b; --neutral: #8a8a90;
  --heat-pos: #1a7f4b; --heat-neg: #c23b3b; --heat-neu: #8a8a90;
  --positive-soft: #e5f2ea; --negative-soft: #f8e7e7; --warning: #a86b00; --warning-soft: #f8efdc; --research: #6b5bd2;
  /* chart series (8 categorical, none equal to --interactive) and chart furniture */
  --s1: #1f77b4; --s2: #e8711c; --s3: #2a9d6a; --s4: #8a5cd1; --s5: #c0398b; --s6: #9a7b18; --s7: #5f6f7a; --s8: #1f9fbd;
  --on-series: #ffffff; --grid: rgba(0,0,0,.07); --axis: #86868c; --img-bg: #ffffff;
  /* overlays */
  --scrim: rgba(0,0,0,.32); --shadow-overlay: 0 12px 40px rgba(0,0,0,.16);
  /* type: 8 sizes */
  --fs-meta2: 11px; --fs-meta: 12px; --fs-table: 13px; --fs-body: 14px; --fs-title: 15px; --fs-lead: 18px;
  --fs-page: 22px; --fs-hero: 28px;
  /* radii: controls, cards, panels */
  --r-1: 6px; --r-2: 8px; --r-3: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-0: #101011; --bg-1: #17171a; --bg-2: #1f1f23; --bg-hover: #26262b;
    --border-subtle: rgba(255,255,255,.07); --border-strong: rgba(255,255,255,.14);
    --text-1: #ededef; --text-2: #a1a1a8; --text-3: #6e6e75;
    --interactive: #7aa2f7; --interactive-soft: #1d2638; --on-interactive: #101011;
    --positive: #3fb67a; --negative: #ef6b6b; --neutral: #8a8a90;
    --heat-pos: #1f8a55; --heat-neg: #b8393b; --heat-neu: #66666d;
    --positive-soft: #15281e; --negative-soft: #321c1c; --warning: #e0a63a; --warning-soft: #2e2615; --research: #9d90f0;
    --s1: #4c9be8; --s2: #f08a3c; --s3: #3fbf88; --s4: #a98be8; --s5: #e46bb0; --s6: #cfae4a; --s7: #9aa6ae; --s8: #4cc4de;
    --on-series: #101011; --grid: rgba(255,255,255,.07); --axis: #6e6e75; --img-bg: #ffffff;
    --scrim: rgba(0,0,0,.5); --shadow-overlay: 0 12px 40px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-0: #101011; --bg-1: #17171a; --bg-2: #1f1f23; --bg-hover: #26262b;
  --border-subtle: rgba(255,255,255,.07); --border-strong: rgba(255,255,255,.14);
  --text-1: #ededef; --text-2: #a1a1a8; --text-3: #6e6e75;
  --interactive: #7aa2f7; --interactive-soft: #1d2638; --on-interactive: #101011;
  --positive: #3fb67a; --negative: #ef6b6b; --neutral: #8a8a90;
  --heat-pos: #1f8a55; --heat-neg: #b8393b; --heat-neu: #66666d;
  --positive-soft: #15281e; --negative-soft: #321c1c; --warning: #e0a63a; --warning-soft: #2e2615; --research: #9d90f0;
  --s1: #4c9be8; --s2: #f08a3c; --s3: #3fbf88; --s4: #a98be8; --s5: #e46bb0; --s6: #cfae4a; --s7: #9aa6ae; --s8: #4cc4de;
  --on-series: #101011; --grid: rgba(255,255,255,.07); --axis: #6e6e75; --img-bg: #ffffff;
  --scrim: rgba(0,0,0,.5); --shadow-overlay: 0 12px 40px rgba(0,0,0,.5);
}
/* ---- end of tokens ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg-0); color: var(--text-1); font: var(--fs-body)/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; }
a { color: var(--interactive); text-decoration: none; } a:hover { text-decoration: underline; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.seg.mode { flex-shrink: 0; } .seg a, .seg button { white-space: nowrap; }
.seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--bg-2); border-radius: var(--r-1); overflow: hidden; }
.seg a, .seg button { padding: 4px 8px; font: inherit; font-size: var(--fs-table); color: var(--text-2); background: none; border: 0; border-radius: var(--r-1); cursor: pointer; }
.seg a:hover, .seg button:hover { color: var(--text-1); }
.seg a.on { background: var(--bg-1); color: var(--text-1); font-weight: 600; }
.seg a:hover { text-decoration: none; }
main { padding: 24px 0 48px; }
h1 { font-size: var(--fs-page); line-height: 1.2; letter-spacing: -.02em; margin: 4px 0 8px; font-weight: 600; }
h2 { font-size: var(--fs-meta2); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 32px 0 12px; font-weight: 600; }
h2 a { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: var(--fs-table); margin-left: 8px; }
.lede { font-size: var(--fs-title); color: var(--text-2); max-width: 760px; margin: 0; }
.meta { color: var(--text-3); font-size: var(--fs-table); }
.card { background: var(--bg-1); border-radius: var(--r-2); padding: 16px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.grid3 { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.split { display: grid; gap: 16px; grid-template-columns: 1.7fr 1fr; }
.notice { background: var(--warning-soft); border-radius: var(--r-2); padding: 12px 16px; margin: 12px 0; }
.up { color: var(--positive); } .down { color: var(--negative); } .flat { color: var(--text-2); }
.chg { font-weight: 600; font-variant-numeric: tabular-nums; }
/* mood */
.mood .score { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 2px; }
.mood .num { font-size: var(--fs-hero); font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.mood .of { color: var(--text-3); font-size: var(--fs-title); }
.mood .word { font-size: var(--fs-lead); font-weight: 600; }
.mbar { position: relative; height: 8px; border-radius: var(--r-1); margin: 12px 0 4px;
  background: linear-gradient(90deg, var(--negative) 0 20%, color-mix(in srgb, var(--negative) 45%, var(--bg-2)) 20% 40%,
  var(--bg-2) 40% 60%, color-mix(in srgb, var(--positive) 45%, var(--bg-2)) 60% 80%, var(--positive) 80% 100%); }
.mbar i { position: absolute; top: -5px; width: 4px; height: 18px; margin-left: -2px; background: var(--text-1); border-radius: var(--r-1); box-shadow: 0 0 0 2px var(--bg-1); }
.mscale { display: flex; justify-content: space-between; font-size: var(--fs-meta2); color: var(--text-3); }
.drivers { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-table); padding: 4px 8px; border-radius: var(--r-1); background: var(--bg-2); color: var(--text-1); white-space: nowrap; }
.chip.supportive { background: var(--positive-soft); } .chip.weighing { background: var(--negative-soft); } .chip.neutral { background: var(--warning-soft); } .chip.missing { color: var(--text-3); }
.chip .sym { font-size: var(--fs-meta2); } .chip.supportive .sym { color: var(--positive); } .chip.weighing .sym { color: var(--negative); } .chip.neutral .sym { color: var(--warning); }
/* tickers */
.tickers { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.tick { padding: 12px 16px; position: relative; }
.tick .n { font-size: var(--fs-table); color: var(--text-2); font-weight: 600; }
.tick .v { font-size: var(--fs-lead); font-weight: 600; font-variant-numeric: tabular-nums; margin: 2px 0; }
.tick .note { font-size: var(--fs-meta2); color: var(--text-3); }
.tick.stale .v { color: var(--text-3); }
svg.spark { width: 100%; height: 32px; display: block; margin-top: 4px; }
svg.spark polyline { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
svg.spark.up polyline { stroke: var(--positive); } svg.spark.down polyline { stroke: var(--negative); }
.star { position: absolute; top: 8px; right: 8px; border: 0; background: none; font-size: var(--fs-lead); color: var(--text-3); cursor: pointer; padding: 4px; line-height: 1; }
.star.on { color: var(--warning); }
/* stories & feed */
.story h3 { font-size: var(--fs-title); line-height: 1.35; margin: 8px 0 8px; }
.story .lbl { font-size: var(--fs-meta2); text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; margin-top: 12px; }
.story p { margin: 2px 0 0; color: var(--text-2); }
.affects { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.imp { font-size: var(--fs-table); padding: 2px 8px; border-radius: var(--r-1); font-weight: 600; }
.imp.up { background: var(--positive-soft); } .imp.down { background: var(--negative-soft); } .imp.flat, .imp.unclear { background: var(--bg-2); color: var(--text-2); }
.badge { display: inline-block; font-size: var(--fs-meta2); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.badge.OFFICIAL { color: var(--interactive); } .badge.NEWS { color: var(--text-3); } .badge.RESEARCH { color: var(--research); }
.badge.SOCIAL, .badge.VIDEO { color: var(--text-3); }
.fhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-table); color: var(--text-3); }
.fhead .src { color: var(--text-1); font-weight: 600; }
.fcard { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.fcard h3 { font-size: var(--fs-title); line-height: 1.4; margin: 4px 0 4px; font-weight: 600; }
.fcard .txt { color: var(--text-2); font-size: var(--fs-body); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fcard .take { margin: 8px 0 0; font-size: var(--fs-body); } .fcard .take b { font-weight: 600; }
.fcard .foot { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: var(--fs-table); }
.fcard img.th { width: 120px; height: 68px; object-fit: cover; border-radius: var(--r-2); background: var(--bg-2); }
.commentary { font-size: var(--fs-meta); color: var(--warning); font-weight: 600; }
.feedlist { display: flex; flex-direction: column; gap: 12px; }
.pills { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.pill { padding: 4px 12px; border-radius: var(--r-1); background: var(--bg-2); color: var(--text-2); font-size: var(--fs-body); }
.pill.on { background: var(--interactive-soft); color: var(--interactive); font-weight: 600; }
.pill:hover { text-decoration: none; background: var(--bg-hover); color: var(--text-1); }
.pill .c { color: var(--text-3); font-size: var(--fs-meta); margin-left: 4px; } .pill.on .c { color: inherit; opacity: .8; }
/* trending */
.trends { display: flex; flex-direction: column; gap: 2px; }
.trend { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); color: var(--text-1); }
.trend:last-child { border-bottom: 0; } .trend:hover { text-decoration: none; background: var(--bg-hover); }
.trend .tn { font-weight: 600; } .trend .arr { width: 18px; display: inline-block; }
.trend .tc { color: var(--text-3); font-size: var(--fs-table); text-align: right; }
/* chart */
svg.cod { width: 100%; height: auto; display: block; font-size: var(--fs-meta); }
svg.cod .grid { stroke: var(--grid); } svg.cod .ax { fill: var(--axis); font-size: var(--fs-meta2); }
svg.cod .ln { fill: none; stroke-width: 2; stroke-linejoin: round; } svg.cod .lab { fill: var(--text-2); font-size: var(--fs-meta); }
svg.cod .s1 { stroke: var(--s1); } svg.cod .s2 { stroke: var(--s2); } svg.cod .s3 { stroke: var(--s3); }
svg.cod circle.s1 { fill: var(--s1); } svg.cod circle.s2 { fill: var(--s2); } svg.cod circle.s3 { fill: var(--s3); }
svg.cod circle.dot { stroke: var(--bg-1); stroke-width: 2; }
svg.cod .s4 { stroke: var(--s4); } svg.cod .s5 { stroke: var(--s5); } svg.cod .s6 { stroke: var(--s6); } svg.cod .s7 { stroke: var(--s7); } svg.cod .s8 { stroke: var(--s8); } svg.cod .s9 { stroke: var(--text-2); }
svg.cod circle.s4 { fill: var(--s4); } svg.cod circle.s5 { fill: var(--s5); } svg.cod circle.s6 { fill: var(--s6); } svg.cod circle.s7 { fill: var(--s7); } svg.cod circle.s8 { fill: var(--s8); } svg.cod circle.s9 { fill: var(--text-2); }
svg.cod .evl { stroke: var(--axis); stroke-dasharray: 2 3; opacity: .7; } svg.cod .evt { fill: var(--text-3); font-size: var(--fs-meta2); }
svg.cod .anl { stroke: var(--interactive); stroke-dasharray: 1 3; } svg.cod .anp { fill: var(--bg-1); stroke: var(--interactive); stroke-width: 2; } svg.cod .ant { fill: var(--interactive); font-size: var(--fs-meta); font-weight: 600; }
svg.cod .hit { fill: transparent; } svg.cod .xhair { stroke: var(--axis); visibility: hidden; pointer-events: none; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: var(--fs-table); color: var(--text-2); margin: 4px 0; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: var(--r-1); vertical-align: middle; margin-right: 4px; }
#tip { position: fixed; z-index: 50; pointer-events: none; display: none; background: var(--bg-1); color: var(--text-1); border: 1px solid var(--border-subtle); border-radius: var(--r-2); padding: 4px 8px; font-size: var(--fs-table); box-shadow: var(--shadow-overlay); max-width: 320px; }
/* calendar */
.cal { display: flex; flex-direction: column; }
.cev { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-subtle); }
.cev:last-child { border-bottom: 0; }
.cev .tm { font-weight: 600; font-variant-numeric: tabular-nums; }
.cev .nm { font-weight: 600; } .cev .why { color: var(--text-2); font-size: var(--fs-body); margin-top: 2px; }
.impact { font-size: var(--fs-meta2); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-left: 8px; }
.impact.high { color: var(--text-1); } .impact.medium { color: var(--text-2); } .impact.low { color: var(--text-3); }
.nums { font-size: var(--fs-table); color: var(--text-3); margin-top: 4px; }
/* tables on method page */
table.m { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
table.m th, table.m td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
table.m th { font-size: var(--fs-meta); color: var(--text-2); }
footer.foot { border-top: 1px solid var(--border-subtle); padding: 16px 0 48px; color: var(--text-3); font-size: var(--fs-table); }
footer.foot .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.seg.mode a { font-weight: 600; }
.badge.MOVE { color: var(--text-2); }
.demo { font-size: var(--fs-meta2); font-weight: 600; letter-spacing: .05em; color: var(--warning); border: 1.5px dashed var(--warning); border-radius: var(--r-1); padding: 1px 4px; }
.view { font-weight: 600; } .status-strengthening { color: var(--positive); } .status-weakening, .status-needs_review { color: var(--negative); } .status-stable { color: var(--text-2); }
.rel-SUPPORT { color: var(--positive); font-weight: 600; } .rel-CONTRADICT { color: var(--negative); font-weight: 600; } .rel-NEUTRAL, .rel-UNCLEAR { color: var(--text-2); font-weight: 600; }
.steps { counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
.step { position: relative; padding-left: 48px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 16px; top: 18px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-2); color: var(--text-2); font-size: var(--fs-table); font-weight: 600; display: flex; align-items: center; justify-content: center; }
.step h3 { margin: 0 0 4px; font-size: var(--fs-title); }
.inline-form { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select, .inline-form textarea { font: inherit; font-size: var(--fs-body); padding: 4px 8px; border: 1px solid var(--border-strong); border-radius: var(--r-1); background: var(--bg-1); color: var(--text-1); }
.btn.ok { background: var(--positive-soft); color: var(--text-1); } .btn.no { background: var(--negative-soft); color: var(--text-1); }
.tabs { display: flex; gap: 4px; margin-bottom: 8px; } .tabs button { font: inherit; font-size: var(--fs-table); padding: 4px 12px; border-radius: var(--r-1); border: 0; background: var(--bg-2); color: var(--text-2); cursor: pointer; }
.tabs button:hover { color: var(--text-1); }
.tabs button.on { background: var(--interactive-soft); color: var(--interactive); font-weight: 600; }
.draft { white-space: pre-wrap; background: var(--bg-2); border-radius: var(--r-2); padding: 12px 12px; margin: 0; font-size: var(--fs-body); line-height: 1.55; }
.graph { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 8px; }
.node { border-radius: var(--r-2); padding: 8px 12px; background: var(--bg-2); }
.node.SUPPORT { box-shadow: inset 3px 0 0 var(--positive); } .node.CONTRADICT { box-shadow: inset 3px 0 0 var(--negative); }
nav.bottom { display: none; }
@media (max-width: 900px) {
  .grid3 { grid-template-columns: 1fr; } .split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  h1 { font-size: var(--fs-page); } .lede { font-size: var(--fs-title); }
  .grid2 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mood .num { font-size: var(--fs-hero); } .mood .word { font-size: var(--fs-title); } .card { padding: 12px; }
  .tickers { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; padding-bottom: 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .tickers .tick { min-width: 150px; scroll-snap-align: start; }
  .fcard { grid-template-columns: 1fr; } .fcard img.th { width: 100%; height: 160px; }
}
@media (max-width: 420px) { .grid2.moods { grid-template-columns: 1fr; } }
.hm { padding: 16px 16px; }
.hm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.hm-title { font-weight: 600; font-size: var(--fs-title); }
.hm-signal { margin: 4px 0 0; color: var(--text-2); font-size: var(--fs-body); }
.hm-group { font-size: var(--fs-meta); font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin: 12px 0 4px; }
.hm-grid { display: grid; gap: 2px; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.hm-grid.wide { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.hm-cell { display: flex; flex-direction: column; gap: 1px; padding: 8px 8px; border-radius: var(--r-1); min-height: 64px; text-decoration: none; }
.hm-cell:hover { text-decoration: none; outline: 2px solid var(--text-1); outline-offset: -2px; }
.hm-cell:focus-visible { outline: 2px solid var(--interactive); outline-offset: 1px; }
.hm-cell .hn { font-size: var(--fs-meta); font-weight: 600; }
.hm-cell .hv { font-size: var(--fs-title); font-weight: 600; font-variant-numeric: tabular-nums; }
.hm-cell .hz { font-size: var(--fs-meta2); }
.hm-cell .hmn { font-size: var(--fs-meta2); }
/* Market colour rule (D2): hue = direction (t-pos / t-neg / t-neu, set per asset in
   mie.visual.data.direction_tone); intensity = how unusual (b0..b4 from the |z| bin). Never mixed. */
.hm-cell { --hue: var(--heat-neu); --k: 12%; background: color-mix(in srgb, var(--hue) var(--k), var(--bg-1)); color: var(--text-1); }
.hm-cell.t-pos { --hue: var(--heat-pos); } .hm-cell.t-neg { --hue: var(--heat-neg); } .hm-cell.t-neu { --hue: var(--heat-neu); }
.hm-cell.b0 { --k: 12%; } .hm-cell.b1 { --k: 25%; } .hm-cell.b2 { --k: 42%; } .hm-cell.b3 { --k: 62%; } .hm-cell.b4 { --k: 85%; }
.hm-cell.bx { background: var(--bg-2); outline: 1px dashed var(--border-strong); outline-offset: -1px; }
.hm-cell.stale { opacity: .6; }
.hm-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 8px; font-size: var(--fs-meta); color: var(--text-3); }
.hm-legend .lg { display: inline-flex; align-items: center; gap: 4px; }
.hm-legend i.hm-cell { display: inline-block; width: 14px; height: 14px; min-height: 0; padding: 0; border-radius: 3px; outline: 1px solid var(--border-subtle); outline-offset: -1px; }
.hm-legend .lg-sep { margin-left: 8px; }
.hm-foot { margin: 8px 0 0; }
.ranges a { padding: 4px 8px; }
.grid2.sectors { align-items: start; }
.grid2.sectors .hm-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
h3.grp { font-size: var(--fs-body); color: var(--text-2); margin: 16px 0 8px; }
.mood .word.big { font-size: var(--fs-page); font-weight: 600; letter-spacing: -.01em; }
.mood .score { flex-wrap: wrap; }
.dbars { display: grid; gap: 4px; margin-top: 8px; }
.dbar { display: grid; grid-template-columns: minmax(96px, 1.1fr) 2fr 28px minmax(84px, auto); gap: 8px; align-items: center; color: var(--text-1); font-size: var(--fs-table); }
.dbar:hover { text-decoration: none; } .dbar:hover .dn { text-decoration: underline; }
.dtrack { height: 10px; background: var(--bg-2); border-radius: var(--r-1); position: relative; overflow: hidden; }
.dtrack i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--s1); border-radius: 0 var(--r-1) var(--r-1) 0; }
.dtrack.empty { background: repeating-linear-gradient(45deg, var(--bg-2), var(--bg-2) 3px, transparent 3px, transparent 6px); }
.dv { font-variant-numeric: tabular-nums; text-align: right; color: var(--text-2); }
.ds { font-size: var(--fs-meta); color: var(--text-2); white-space: nowrap; }
.ds .sym { margin-right: 4px; } .dbar.supportive .sym { color: var(--positive); } .dbar.weighing .sym { color: var(--negative); } .dbar.missing { color: var(--text-3); }
.dnote { margin: 8px 0 0; }
.xpanel { padding: 16px 16px; }
svg.xp { width: 100%; max-width: 620px; height: auto; display: block; margin: 8px 0; font-size: var(--fs-table); }
svg.xp .grid { stroke: var(--grid); } svg.xp .ax { fill: var(--axis); font-size: var(--fs-meta2); }
svg.xp .guide { stroke: var(--axis); stroke-dasharray: 3 3; }
svg.xp .rl { fill: var(--text-2); } svg.xp .pv { fill: var(--text-2); font-variant-numeric: tabular-nums; }
svg.xp .strong { fill: var(--text-1); font-weight: 600; }
svg.xp .pt.actual { fill: var(--s1); stroke: var(--bg-1); stroke-width: 2; }
svg.xp .pt.consensus { fill: var(--bg-1); stroke: var(--text-2); stroke-width: 2; }
svg.xp .pt.previous { fill: var(--text-3); stroke: var(--bg-1); stroke-width: 2; }
.lvl { font-weight: 500; color: var(--text-2); font-size: .7em; }
.mv .meta { margin-bottom: 4px; font-weight: 600; }
.xrow { padding: 4px 0; border-bottom: 1px solid var(--border-subtle); display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.card.rel { padding: 8px 12px; margin-bottom: 8px; }
.subnav { margin: 0 0 16px; } .notice.fresh { margin-bottom: 16px; }
/* ---- stories */
.stg, .vrf { display: inline-block; font-size: var(--fs-meta); font-weight: 600; padding: 2px 8px; border-radius: var(--r-1); margin-right: 4px; background: var(--bg-2); }
.stg.breaking { background: var(--warning-soft); } .stg.developing { background: var(--bg-2); } .stg.confirmed { background: var(--interactive-soft); }
.stg.market_reacted { background: var(--interactive); color: var(--on-interactive); }
.vrf { font-weight: 500; color: var(--text-2); background: none; padding-left: 0; }
.storylist { display: grid; gap: 8px; }
.srow { display: grid; gap: 4px; color: var(--text-1); } .srow:hover { text-decoration: none; background: var(--bg-hover); }
.stitle { font-size: var(--fs-title); font-weight: 600; }
.covbar { display: flex; gap: 2px; height: 10px; max-width: 420px; } .covbar i { display: block; height: 100%; }
.covbar i:first-child { border-radius: var(--r-1) 0 0 var(--r-1); } .covbar i:last-child { border-radius: 0 var(--r-1) var(--r-1) 0; }
.covlab { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--fs-meta); color: var(--text-2); }
.covlab i { display: inline-block; width: 10px; height: 10px; border-radius: var(--r-1); margin-right: 4px; vertical-align: -1px; }
.c-official { background: var(--interactive); } .c-news { background: var(--text-3); } .c-social { background: var(--warning); } .c-video { background: var(--negative); }
.lifecycle { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 8px; font-size: var(--fs-table); }
.lc { background: var(--bg-2); border-radius: var(--r-1); padding: 4px 8px; } .lcarr { color: var(--text-3); }
.stl { padding: 12px 16px; } .stday { font-size: var(--fs-meta); font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin: 12px 0 4px; }
.stu { display: grid; grid-template-columns: 48px 24px 1fr; gap: 8px; padding: 8px 0; border-left: 2px solid var(--border-subtle); margin-left: 70px; position: relative; }
.stu .stt { position: absolute; left: -70px; width: 60px; text-align: right; font-size: var(--fs-meta); color: var(--text-2); font-variant-numeric: tabular-nums; padding-top: 2px; }
.stu .stm { grid-column: 1; margin-left: -9px; width: 16px; text-align: center; background: var(--bg-1); font-size: var(--fs-table); line-height: 1.4; }
.stu .stb { grid-column: 2 / -1; margin-left: -28px; }
.stu.official .stm { color: var(--interactive); } .stu.social .stm { color: var(--warning); } .stu.market .stm { color: var(--interactive); }
.stu.no_material_new_information .stb { opacity: .65; }
.ictag { font-size: var(--fs-meta2); font-weight: 600; padding: 1px 4px; border-radius: var(--r-1); background: var(--bg-2); margin-right: 4px; }
.stu.new_fact .ictag, .stu.new_confirmation .ictag { background: var(--interactive-soft); color: var(--interactive); }
.stu.market_reaction .ictag { background: var(--interactive); color: var(--on-interactive); } .stu.new_rumor .ictag { background: var(--warning-soft); }
/* ---- chart of the day / rebuilt charts */
svg.cod .hl { fill: var(--interactive-soft); } svg.cod .hlt { fill: var(--interactive); font-size: var(--fs-meta2); font-weight: 600; }
.alts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-subtle); font-size: var(--fs-body); }
.card.rebuilt { margin-bottom: 12px; } .card.rebuilt .rt { font-weight: 600; margin: 4px 0 4px; }
.rebuilt-grid { align-items: start; } .rebuilt-grid .card.rebuilt { margin: 0; }
/* ---- X pulse */
.xp-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.trow { display: grid; grid-template-columns: minmax(110px, 1fr) 1.4fr 1.2fr; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-body); }
.trow.head { font-size: var(--fs-meta); color: var(--text-2); font-weight: 600; padding-top: 0; }
.trow a.tn { color: var(--text-1); font-weight: 600; }
.abar { position: relative; height: 12px; background: var(--bg-2); border-radius: 0 var(--r-1) var(--r-1) 0; }
.abar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--s1); border-radius: 0 var(--r-1) var(--r-1) 0; }
.abar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-1); }
.anote { font-size: var(--fs-meta); color: var(--text-2); margin-top: 2px; }
.nbar { display: flex; gap: 2px; height: 12px; } .nbar i { display: block; height: 100%; }
.nbar i:first-child { border-radius: var(--r-1) 0 0 var(--r-1); } .nbar i:last-child { border-radius: 0 var(--r-1) var(--r-1) 0; }
.nbar .p { background: var(--positive); } .nbar .u { background: var(--neutral); } .nbar .n { background: var(--negative); }
.wordtag { font-size: var(--fs-meta); font-weight: 600; } .wordtag.positive { color: var(--positive); } .wordtag.negative { color: var(--negative); }
.chips2 { display: flex; flex-wrap: wrap; gap: 4px; } .chips2 span { font-size: var(--fs-meta); padding: 2px 8px; background: var(--bg-2); border-radius: var(--r-1); }
.xcharts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.xchart { display: block; border-radius: var(--r-2); overflow: hidden; background: var(--bg-2); color: var(--text-1); }
.xchart img { width: 100%; height: 130px; object-fit: cover; display: block; background: var(--bg-2); color: transparent; font-size: 0; }
.xchart .cap { padding: 4px 8px; font-size: var(--fs-meta); }
.fam { margin-bottom: 8px; } .fam .fn { font-size: var(--fs-meta); font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.fam a { display: inline-block; margin: 4px 8px 0 0; font-size: var(--fs-table); }
.mvchip { display: inline-block; font-size: var(--fs-meta); padding: 2px 8px; border-radius: var(--r-1); background: var(--bg-2); margin: 4px 4px 0 0; }
/* ---- calendar */
.cal-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 8px; }
.cal-title { font-weight: 600; font-size: var(--fs-title); margin-right: auto; }
.cal-bar .seg.nav a { font-size: var(--fs-body); } .lowt { font-size: var(--fs-table); }
.cal-legend { margin: 0 0 12px; }
.imp-m { letter-spacing: -1px; font-size: var(--fs-meta2); white-space: nowrap; }
.imp-m.high { color: var(--interactive); } .imp-m.medium { color: var(--text-2); } .imp-m.low { color: var(--text-3); }
.keyk { color: var(--interactive); }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; align-items: start; }
.cev2 .sess { font-weight: 400; color: var(--text-3); font-size: var(--fs-meta); }
.fold summary { list-style: none; cursor: pointer; font-size: var(--fs-meta); color: var(--interactive); padding: 4px; } .fold summary::-webkit-details-marker { display: none; }
.cal-day { background: var(--bg-1); border-radius: var(--r-2); padding: 8px 4px; min-height: 180px; min-width: 0; }
.cal-day header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 4px; padding: 0 4px 8px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; }
.cal-day .wd { font-size: var(--fs-meta); color: var(--text-2); font-weight: 600; } .cal-day .dn { font-size: var(--fs-lead); font-weight: 600; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--interactive); } .cal-day.today .dn { color: var(--interactive); }
.tbadge { margin-left: auto; font-size: var(--fs-meta2); font-weight: 600; color: var(--interactive); }
.cal-day.past header { opacity: .6; } .cal-day.wknd { background: color-mix(in srgb, var(--bg-1) 60%, var(--bg-0)); }
.cal-day.beyond { background-image: repeating-linear-gradient(45deg, transparent, transparent 6px, var(--border-subtle) 6px, var(--border-subtle) 7px); }
.cal-day .empty { padding: 4px; margin: 0; }
.cev2 { border-radius: var(--r-2); margin: 2px 0; }
.cev2 summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr; gap: 0 4px; padding: 4px 4px; border-radius: var(--r-2); font-size: var(--fs-table); line-height: 1.3; }
.cev2 summary::-webkit-details-marker { display: none; }
.cev2 summary:hover { background: var(--bg-hover); }
.cev2 .t { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: var(--fs-meta); grid-row: span 2; padding-top: 1px; }
.cev2 .n { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cev2.high .n { font-weight: 600; }
.cev2 .imp-m { grid-column: 2; }
.cev2.past { opacity: .55; } .cev2.key summary { border-left: 3px solid var(--interactive); }
.cev2[open] { background: var(--bg-2); } .cev2[open] .n { -webkit-line-clamp: unset; }
.cev2 .d { padding: 2px 8px 8px; font-size: var(--fs-meta); display: grid; gap: 4px; } .cev2 .why { color: var(--text-2); }
.nowline { position: relative; height: 14px; margin: 2px 0; } .nowline::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; border-top: 2px solid var(--interactive); }
.nowline span { position: relative; background: var(--bg-1); color: var(--interactive); font-size: var(--fs-meta2); font-weight: 600; padding: 0 4px; margin-left: 4px; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-month .mh { font-size: var(--fs-meta); font-weight: 600; color: var(--text-2); padding: 4px 4px; }
.mcell { display: flex; flex-direction: column; gap: 2px; min-height: 104px; padding: 4px; border-radius: var(--r-2); background: var(--bg-1); color: var(--text-1); overflow: hidden; }
.mcell:hover { text-decoration: none; background: var(--bg-hover); }
.mcell.out { opacity: .45; } .mcell.today { box-shadow: inset 0 0 0 2px var(--interactive); } .mcell.today .mdn { color: var(--interactive); }
.mcell.beyond { background-image: repeating-linear-gradient(45deg, transparent, transparent 6px, var(--border-subtle) 6px, var(--border-subtle) 7px); }
.mdn { font-weight: 600; font-size: var(--fs-body); }
.mev { font-size: var(--fs-meta2); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.mev.high { color: var(--text-1); font-weight: 600; } .mev.key { color: var(--interactive); } .mev .mt { font-variant-numeric: tabular-nums; color: var(--text-3); }
.mcell .more { font-size: var(--fs-meta2); color: var(--interactive); }
.xrow { display: block; } .xmeta { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.xshow { margin-top: 4px; font: inherit; font-size: var(--fs-table); padding: 4px 12px; border-radius: var(--r-1); border: 0; background: var(--bg-2); color: var(--text-1); font-weight: 600; cursor: pointer; }
.xshow:hover { background: var(--bg-hover); }
.xshow:disabled { color: var(--text-3); cursor: default; }
.xembed:empty { display: none; } .xembed { margin-top: 4px; max-width: 550px; }
/* downloads, provenance, Data Explorer */
.tbtn { font: inherit; font-size: var(--fs-meta); padding: 2px 4px; border: 0; border-radius: var(--r-1); background: none; color: var(--interactive); font-weight: 600; cursor: pointer; }
.tbtn:hover { background: var(--bg-hover); text-decoration: none; }
.lab-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
.lab-form { display: grid; gap: 8px; margin-top: 16px; }
.lab-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lab-row .slot { width: 22px; height: 22px; border-radius: var(--r-1); color: var(--on-series); font-weight: 600; font-size: var(--fs-meta); display: inline-flex; align-items: center; justify-content: center; }
.lab-row input[type=text], .lab-row input[type=date], .lab-row select { font: inherit; font-size: var(--fs-body); padding: 4px 8px; border-radius: var(--r-1); border: 1px solid var(--border-strong); background: var(--bg-1); color: var(--text-1); }
.lab-row input[list] { flex: 1 1 220px; min-width: 0; }
.lab-row label { font-size: var(--fs-table); color: var(--text-2); }
.lab-side h3 { font-size: var(--fs-meta); text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 12px 0 4px; }
.lab-side a { display: block; font-size: var(--fs-table); padding: 2px 0; }
.lab-side details.pgroup { border-top: 1px solid var(--border-subtle); padding: 4px 0; }
.lab-side details.pgroup summary { cursor: pointer; font-size: var(--fs-body); font-weight: 600; color: var(--text-1); list-style: none; display: flex; gap: 8px; }
.lab-side details.pgroup summary::-webkit-details-marker { display: none; } .lab-side details.pgroup summary .meta { margin-left: auto; font-weight: 400; }
.lab-narrow { display: none; }
@media (max-width: 640px) { .lab-wide { display: none; } .lab-narrow { display: block; } }
.lab-side details.pgroup summary::after { content: "▸"; color: var(--text-3); margin-left: 8px; } .lab-side details.pgroup[open] summary::after { content: "▾"; }
.lab-side details.pgroup a { padding-left: 4px; }
.legend .dash i { background: none !important; border-top: 2px dashed currentColor; height: 0; }
@media (max-width: 900px) { .lab-grid { grid-template-columns: 1fr; } }
.dl { display: inline-flex; gap: 4px; align-items: center; font-size: var(--fs-meta); color: var(--text-3); flex-wrap: wrap; }
.dl .tbtn { color: var(--interactive); }
.dl a { padding: 2px 4px; border-radius: var(--r-1); color: var(--interactive); font-weight: 600; }
.dl a:hover { text-decoration: none; background: var(--bg-hover); }
.prov { font-size: var(--fs-meta); color: var(--text-3); margin-top: 4px; line-height: 1.5; }
.prov b { font-weight: 600; color: var(--text-2); }
.prov .rec { display: inline-block; font-weight: 600; color: var(--text-1); background: var(--bg-2); border-radius: var(--r-1); padding: 0 4px; margin-right: 4px; }
.cardfoot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.dx-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.dx-filters input[type=search], .dx-filters input:not([type]), .dx-filters select { font: inherit; font-size: var(--fs-body); padding: 4px 8px; border-radius: var(--r-1); border: 1px solid var(--border-strong); background: var(--bg-1); color: var(--text-1); }
.dx-filters input[type=search] { flex: 1 1 260px; min-width: 0; }
.dx-filters select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.dx-filters input:not([type]) { flex: 0 1 160px; min-width: 0; }
table.dx { width: 100%; border-collapse: collapse; font-size: var(--fs-table); }
table.dx th { text-align: left; font-size: var(--fs-meta2); color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: 4px 8px; border-bottom: 1px solid var(--border-subtle); }
table.dx td { padding: 8px 8px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
table.dx td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.dx .k { font-size: var(--fs-meta2); color: var(--text-3); }
.badge.stale { color: var(--warning); margin-left: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.libtabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 16px 0 12px; }
.libtabs a { padding: 4px 12px; border-radius: var(--r-1); background: var(--bg-2); color: var(--text-2); font-size: var(--fs-table); }
.libtabs a.on { background: var(--interactive-soft); color: var(--interactive); font-weight: 600; } .libtabs a span { color: var(--text-3); font-size: var(--fs-meta); } .libtabs a.on span { color: inherit; opacity: .8; }
.libtabs a:hover { text-decoration: none; background: var(--bg-hover); color: var(--text-1); }
.libcard .rt { font-weight: 600; font-size: var(--fs-title); line-height: 1.35; margin: 2px 0 4px; }
.libcard .obs { margin: 0 0 4px; font-size: var(--fs-body); color: var(--text-2); }
.libcard img.thumb { max-width: 100%; max-height: 260px; border-radius: var(--r-2); border: 1px solid var(--border-subtle); background: var(--img-bg); display: block; margin: 4px 0; }
.libcard .bnote { margin: 8px 0 0; padding: 4px 8px; border-left: 3px solid var(--interactive); background: var(--interactive-soft); border-radius: 0 var(--r-1) var(--r-1) 0; font-size: var(--fs-body); }
details.save { position: relative; } details.save summary { list-style: none; } details.save summary::-webkit-details-marker { display: none; }
.saveform { position: absolute; right: 0; bottom: 34px; z-index: 15; width: 280px; display: grid; gap: 4px; background: var(--bg-1); border: 1px solid var(--border-subtle); border-radius: var(--r-2); padding: 8px; box-shadow: var(--shadow-overlay); }
.saveform input, .saveform select { font: inherit; font-size: var(--fs-table); padding: 4px 8px; border-radius: var(--r-1); border: 1px solid var(--border-strong); background: var(--bg-1); color: var(--text-1); width: 100%; }
.saveform label { font-size: var(--fs-meta); color: var(--text-2); display: grid; gap: 2px; }
.seg.seg-wrap { flex-wrap: wrap; max-width: 100%; }
.boardctl { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 0; } .boardctl input { flex: 1 1 160px; min-width: 0; font: inherit; font-size: var(--fs-table); padding: 4px 8px; border-radius: var(--r-1); border: 1px solid var(--border-strong); background: var(--bg-1); color: var(--text-1); }
.pager a { min-width: 30px; text-align: center; }
.libgrid > * { min-width: 0; }
.sblocks { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); }
.sblocks > * { min-width: 0; } .sblocks > .stablecard { grid-column: 1 / -1; }
.stitle { font-weight: 600; font-size: var(--fs-title); margin-bottom: 8px; } details > summary.stitle { cursor: pointer; margin-bottom: 0; }
details[open] > summary.stitle { margin-bottom: 8px; }
.stable-wrap { overflow-x: auto; margin: 0 -4px; } table.stable th, table.stable td { white-space: nowrap; }
table.stable td .pos { color: var(--text-1); } table.stable td .neg { color: var(--text-1); }
table.stable .quote { white-space: normal; display: block; min-width: 260px; max-width: 520px; font-size: var(--fs-table); color: var(--text-2); }
.ssec { scroll-margin-top: 70px; } .sjump { margin-top: 12px; }
@media (max-width: 720px) { .grid2.libgrid { grid-template-columns: 1fr; } }
.dx-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 8px; }
.dx-groups a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: var(--r-2); background: var(--bg-1); color: var(--text-1); }
.dx-groups a:hover { text-decoration: none; background: var(--bg-hover); }
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: var(--fs-table); margin: 0; }
dl.meta dt { color: var(--text-3); } dl.meta dd { margin: 0; }
@media (max-width: 720px) {
  table.dx .hide-s { display: none; }
  .hm-grid { grid-template-columns: repeat(2, 1fr); }
  .xp-grid { grid-template-columns: 1fr; } .trow { grid-template-columns: 1fr 1fr; } .trow .narr { grid-column: 1 / -1; }
  .cal-week { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 8px; }
  .cal-week .cal-day { min-width: 78vw; scroll-snap-align: start; }
  .mcell { min-height: 64px; padding: 4px; } .mev .mt, .mev { font-size: var(--fs-meta2); } .mev { white-space: normal; max-height: 2.6em; }
  .cal-title { width: 100%; order: -1; }
  .grid2.sectors { grid-template-columns: 1fr; }
  .dbar { grid-template-columns: 1fr 1.4fr 24px; } .dbar .ds { grid-column: 1 / -1; margin-top: -4px; }
}

/* ---- application shell: sidebar + top bar + content; drawer and command bar overlays ---- */
body.app { display: grid; grid-template-columns: var(--sbw, 216px) minmax(0, 1fr); min-height: 100vh; }
html.sb-min body.app { --sbw: 56px; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
  padding: 12px 8px; background: var(--bg-1); border-right: 1px solid var(--border-subtle); z-index: 25; }
.sidebar .brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px; color: var(--text-1); font-weight: 600; font-size: var(--fs-title); white-space: nowrap; }
.sidebar .brand:hover { text-decoration: none; }
.sidebar .mark { width: 24px; height: 24px; flex: 0 0 24px; border-radius: var(--r-1); background: var(--text-1); color: var(--bg-1); display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-table); }
.sbgroup { display: flex; flex-direction: column; gap: 1px; }
.sbh { font-size: var(--fs-meta2); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 4px 8px; list-style: none; cursor: default; }
details.sbgroup > summary { cursor: pointer; } details.sbgroup > summary::-webkit-details-marker { display: none; }
details.sbgroup > summary::after { content: " ▾"; } details.sbgroup:not([open]) > summary::after { content: " ▸"; }
.nv { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: var(--r-1); color: var(--text-2); font-size: var(--fs-body); white-space: nowrap; }
.nv:hover { background: var(--bg-hover); color: var(--text-1); text-decoration: none; }
.nv.on { background: var(--bg-2); color: var(--text-1); font-weight: 600; box-shadow: inset 2px 0 0 var(--interactive); }
.ic { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.sbcollapse { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 0; background: none; color: var(--text-3); font: inherit; font-size: var(--fs-table); cursor: pointer; border-radius: var(--r-1); }
.sbcollapse:hover { background: var(--bg-hover); color: var(--text-1); }
html.sb-min .sidebar .lbl { display: none; } html.sb-min .sbh { display: none; }
html.sb-min details.sbgroup > summary { display: block; height: 1px; padding: 0; margin: 4px 8px; background: var(--border-subtle); overflow: hidden; }
html.sb-min .sbcollapse .ic { transform: rotate(180deg); }
html.sb-min .nv, html.sb-min .sbcollapse, html.sb-min .sidebar .brand { justify-content: center; padding-left: 0; padding-right: 0; }
.appmain { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg-0) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border-subtle); }
.cmdk-open { flex: 0 1 460px; min-width: 0; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: var(--r-1);
  border: 1px solid var(--border-strong); background: var(--bg-1); color: var(--text-3); font: inherit; font-size: var(--fs-table); cursor: text; text-align: left; }
.cmdk-open:hover { border-color: color-mix(in srgb, var(--interactive) 50%, var(--border-subtle)); }
.cmdk-open .ph { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbd { font: var(--fs-meta2)/1 system-ui, sans-serif; color: var(--text-3); border: 1px solid var(--border-subtle); border-radius: var(--r-1); padding: 2px 4px; background: var(--bg-0); }
.tb-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.tb-menu { display: none; border: 0; background: none; color: var(--text-2); padding: 4px; border-radius: var(--r-1); cursor: pointer; }
main { padding: 24px 0 48px; flex: 1; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
footer.foot { padding: 16px 0 24px; }
nav.bottom { display: none; }
.sbscrim { position: fixed; inset: 0; background: var(--scrim); z-index: 24; }
/* tools index */
.toolist { list-style: none; margin: 16px 0 0; padding: 0; max-width: 820px; }
.toolist li { display: grid; grid-template-columns: 260px 1fr; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.toolist li a { font-weight: 600; }
@media (max-width: 720px) { .toolist li { grid-template-columns: 1fr; gap: 2px; } }
/* command bar */
.cmdk { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.cmdk[hidden] { display: none; }
.cmdk-box { width: min(640px, 100%); background: var(--bg-1); border: 1px solid var(--border-subtle); border-radius: var(--r-3); box-shadow: var(--shadow-overlay); overflow: hidden; }
.cmdk-in { display: flex; align-items: center; gap: 8px; padding: 12px 12px; border-bottom: 1px solid var(--border-subtle); color: var(--text-3); }
.cmdk-in input { flex: 1; border: 0; outline: 0; background: none; color: var(--text-1); font: inherit; font-size: var(--fs-title); }
.cmdk-list { max-height: 56vh; overflow-y: auto; padding: 4px 0; }
.cmdk-group { font-size: var(--fs-meta2); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 8px 16px 4px; }
.cmdk-item { display: flex; align-items: baseline; gap: 8px; padding: 8px 16px; color: var(--text-1); cursor: pointer; text-decoration: none; }
.cmdk-item:hover { text-decoration: none; } .cmdk-item[aria-selected="true"] { background: var(--bg-2); }
.cmdk-item .sub { color: var(--text-3); font-size: var(--fs-meta); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.cmdk-empty { padding: 16px 16px; color: var(--text-3); font-size: var(--fs-body); }
.cmdk-foot { padding: 8px 16px; border-top: 1px solid var(--border-subtle); font-size: var(--fs-meta); }
/* drawer */
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(460px, 100vw); z-index: 50; background: var(--bg-1); border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-overlay); transform: translateX(100%); transition: transform .18s ease; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-bar { display: flex; justify-content: flex-end; padding: 8px 8px 0; }
.drawer-x { border: 0; background: none; color: var(--text-3); font-size: var(--fs-title); padding: 4px 8px; border-radius: var(--r-1); cursor: pointer; }
.drawer-x:hover { background: var(--bg-hover); color: var(--text-1); }
.drawer-body { overflow-y: auto; padding: 0 16px 24px; flex: 1; }
.dr-actions .star { position: static; width: auto; height: 32px; font-size: var(--fs-title); }
.dr-spark { margin-top: 12px; } .dr-spark svg { width: 100%; height: 48px; }
.dr-skel div { height: 14px; border-radius: var(--r-1); background: var(--bg-2); margin: 12px 0; } .dr-skel div:first-child { height: 26px; width: 60%; }
.dr-k { font-size: var(--fs-meta2); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 16px 0 4px; }
.dr-h { font-size: var(--fs-lead); font-weight: 600; margin: 0; text-transform: none; letter-spacing: 0; color: var(--text-1); } .dr-v { font-size: var(--fs-hero); font-weight: 600; font-variant-numeric: tabular-nums; margin: 4px 0 0; }
.dr-moves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border-subtle); border-radius: var(--r-2); overflow: hidden; margin-top: 8px; }
.dr-moves div { background: var(--bg-1); padding: 8px 8px; font-variant-numeric: tabular-nums; } .dr-moves .meta { display: block; font-size: var(--fs-meta2); }
.dr-list { list-style: none; margin: 0; padding: 0; } .dr-list li { padding: 8px 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-body); }
.dr-list li:last-child { border-bottom: 0; } .dr-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.btn { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; border-radius: var(--r-1); font: inherit; font-size: var(--fs-table); font-weight: 600; border: 0; cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; } .btn.primary { background: var(--interactive); color: var(--on-interactive); } .btn.secondary { background: var(--bg-2); color: var(--text-1); }
:focus-visible { outline: 2px solid var(--interactive); outline-offset: 2px; }
@media (max-width: 1100px) { html:not(.sb-open) body.app { --sbw: 56px; } html:not(.sb-open) .sidebar .lbl, html:not(.sb-open) .sbh { display: none; }
  html:not(.sb-open) .nv, html:not(.sb-open) .sidebar .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  html:not(.sb-open) details.sbgroup > summary { display: block; height: 1px; padding: 0; margin: 4px 8px; background: var(--border-subtle); overflow: hidden; } }
@media (max-width: 860px) {
  body.app { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: 240px; transform: translateX(-100%); transition: transform .18s ease; }
  html.sb-open .sidebar { transform: none; } html.sb-open .sidebar .lbl, html.sb-open .sbh { display: initial; }
  .tb-menu { display: inline-flex; } .topbar { padding: 0 12px; gap: 8px; } .cmdk-open .kbd { display: none; }
  .sbcollapse { display: none; }
  main { padding-bottom: 110px; }
  nav.bottom { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--bg-1);
    border-top: 1px solid var(--border-subtle); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); justify-content: space-around; }
  nav.bottom a { display: flex; flex-direction: column; align-items: center; font-size: var(--fs-meta2); color: var(--text-3); gap: 2px; padding: 4px 4px; }
  nav.bottom a.on { color: var(--text-1); font-weight: 600; } nav.bottom a:hover { text-decoration: none; }
  .wrap { padding: 0 16px; }
}

/* ---- utilities (spacing on the 4/8/12/16/24/32 scale; they stand in for one-off inline styles) ---- */
.m-0 { margin: 0 !important; } .mx-0 { margin-left: 0 !important; margin-right: 0 !important; }
.mt-0 { margin-top: 0 !important; } .mt-2 { margin-top: 2px !important; } .mt-4 { margin-top: 4px !important; } .mt-8 { margin-top: 8px !important; }
.mt-12 { margin-top: 12px !important; } .mt-16 { margin-top: 16px !important; } .mt-24 { margin-top: 24px !important; } .mt-32 { margin-top: 32px !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: 2px !important; } .mb-4 { margin-bottom: 4px !important; } .mb-8 { margin-bottom: 8px !important; }
.mb-12 { margin-bottom: 12px !important; } .mb-16 { margin-bottom: 16px !important; } .mb-24 { margin-bottom: 24px !important; }
.ta-r { text-align: right; } .ta-c { text-align: center; } .ox-auto { overflow-x: auto; }
.mw-prose { max-width: 760px; } .mw-form { max-width: 560px; } .w-100 { width: 100%; }
.fw-6 { font-weight: 600; } .c-2 { color: var(--text-2); } .fs-title { font-size: var(--fs-title); } .fs-lead { font-size: var(--fs-lead); }
.plain-list { margin: 0; padding-left: 20px; line-height: 1.7; }
.f-1 { flex: 1; } .f-grow { flex: 1 1 260px; min-width: 0; }
.form-col { display: grid; gap: 12px; }
.blocklink { display: block; color: inherit; } .blocklink:hover { text-decoration: none; background: var(--bg-hover); }
.inp { font: inherit; font-size: var(--fs-body); padding: 4px 8px; border-radius: var(--r-1); border: 1px solid var(--border-strong); background: var(--bg-1); color: var(--text-1); }
textarea.inp { padding: 8px; }
.trow.trow-3 { grid-template-columns: minmax(90px, 1fr) 1.2fr 1.1fr; }

/* ---- building blocks (templates/_ui.html) ---- */
.ui-sec { margin: 32px 0 0; } .ui-sec-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.ui-sec-h h2 { margin: 0; } .ui-sec-a { font-size: var(--fs-table); }
.ui-panel { background: var(--bg-1); border-radius: var(--r-2); padding: 16px; }
.ui-panel-t { font-size: var(--fs-title); font-weight: 600; margin-bottom: 8px; }
.ui-fresh { font-size: var(--fs-meta2); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.ui-fresh.stale, .ui-fresh.error { color: var(--warning); }
.ui-src { font-size: var(--fs-meta); color: var(--text-3); }
.ui-empty { padding: 16px 0; color: var(--text-2); } .ui-empty p { margin: 0 0 4px; }
.ui-metric-l { font-size: var(--fs-meta); color: var(--text-2); } .ui-metric-v { font-size: var(--fs-lead); font-weight: 600; }
.ui-metric-c { font-size: var(--fs-table); font-weight: 600; } .ui-metric-n { font-size: var(--fs-meta); color: var(--text-3); }
.t-pos { color: var(--positive); } .t-neg { color: var(--negative); } .t-neu { color: var(--text-2); }
.hm-cell.t-pos, .hm-cell.t-neg, .hm-cell.t-neu { color: var(--text-1); }
.ui-actions { display: flex; gap: 12px; font-size: var(--fs-table); margin-top: 8px; }
.btn.tertiary { background: none; color: var(--interactive); padding: 0 4px; } .btn.tertiary:hover { background: var(--bg-hover); }
.btn.icon { width: 28px; height: 28px; padding: 0; justify-content: center; background: none; color: var(--text-2); } .btn.icon:hover { background: var(--bg-hover); }
.btn.secondary:hover { background: var(--bg-hover); } .btn.primary:hover { filter: brightness(1.08); }

/* ---- Today: briefing canvas (UI_REDESIGN_PLAN.md 5.1) ---- */
.brief .hero { font-size: var(--fs-hero); line-height: 1.2; letter-spacing: -.02em; margin: 8px 0 4px; }
.brief .lede { max-width: 820px; }
.moodrow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-top: 16px; }
.mood-chip { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 8px 12px; border-radius: var(--r-2); background: var(--bg-1); color: var(--text-1); min-width: 0; }
.mood-chip:hover { text-decoration: none; background: var(--bg-hover); }
.mc-l { font-size: var(--fs-meta); color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.mc-w { font-weight: 600; } .mc-s { color: var(--text-2); }
.mc-d { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--fs-table); color: var(--text-2); }
.mc-d .dbar { display: inline; } .mc-d .sym { margin-right: 2px; }
.dbar.supportive .sym { color: var(--positive); } .dbar.weighing .sym { color: var(--negative); } .dbar.neutral .sym { color: var(--text-3); }
.mood-more { align-self: center; font-size: var(--fs-table); padding: 4px 8px; }
.today-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.tg-main > .card, .tg-main > section { margin: 0; }
.wm { list-style: none; margin: 0; padding: 0; }
.wm li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border-subtle); }
.wm li:first-child { padding-top: 0; } .wm li:last-child { border-bottom: 0; }
.wm-n { font-size: var(--fs-table); color: var(--text-3); font-weight: 600; padding-top: 2px; }
.wm-t { display: block; font-weight: 600; color: var(--text-1); line-height: 1.35; margin-bottom: 4px; }
.wm-t:hover { color: var(--interactive); text-decoration: none; }
.wm .affects { margin-top: 4px; } .wm .imp { font-size: var(--fs-meta); }
.cu { list-style: none; margin: 0; padding: 0; }
.cu li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-table); }
.cu li:last-child { border-bottom: 0; }
.cu-t { color: var(--text-2); font-size: var(--fs-meta); line-height: 1.4; }
.cu-n { font-weight: 600; }
.pulse { list-style: none; margin: 0; padding: 0; background: var(--bg-1); border-radius: var(--r-2); }
.pulse li { display: grid; grid-template-columns: 44px 72px minmax(0, 1fr) minmax(0, auto); gap: 12px; align-items: baseline; padding: 8px 16px; border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-table); }
.pulse li:last-child { border-bottom: 0; }
.pl-t { color: var(--text-3); font-variant-numeric: tabular-nums; }
.pl-x { color: var(--text-1); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-x:hover { color: var(--interactive); text-decoration: none; }
.pl-a { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; } .pl-a .imp { font-size: var(--fs-meta); }
.trendrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.trendrow .chip .arr { color: var(--text-3); } .trendrow .chip .c { color: var(--text-3); font-size: var(--fs-meta); }
.trendrow .chip:hover { text-decoration: none; background: var(--bg-hover); }
.fold-why summary { cursor: pointer; font-size: var(--fs-table); color: var(--interactive); }
.dr-of { font-size: var(--fs-title); color: var(--text-2); font-weight: 400; }
.dr .xpanel { padding: 0; background: none; margin-top: 8px; }
.dr .hm-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
@media (max-width: 1100px) { .today-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .brief .hero { font-size: var(--fs-page); }
  .mood-chip { flex: 1 1 100%; }
  .pulse li { grid-template-columns: 40px minmax(0, 1fr); gap: 4px 8px; padding: 8px 12px; }
  .pulse li .badge { grid-column: 2; } .pulse li .pl-x { grid-column: 2; white-space: normal; } .pulse li .pl-a { grid-column: 2; justify-content: flex-start; }
}

/* ---- Markets: workspace (map + asset panel) and tables (UI_REDESIGN_PLAN.md 5.2, 6.7) ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ws { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.ws-main > .card { margin: 0; }
.ws-panel { position: sticky; top: 68px; max-height: calc(100vh - 84px); overflow-y: auto; background: var(--bg-1); border-radius: var(--r-2); padding: 16px; }
.ws-panel[aria-busy] { opacity: .6; }
.hm-cell.sel { outline: 2px solid var(--interactive); outline-offset: -2px; }
@media (max-width: 1279px) { .ws { grid-template-columns: 1fr; } .ws-panel { display: none; } }
table.stable thead th { position: sticky; top: 0; background: var(--bg-1); z-index: 1; }
table.stable tbody tr:hover { background: var(--bg-hover); }
.stable-wrap { max-height: none; }
.showall { margin-top: 8px; }

/* ---- Pulse: timeline (UI_REDESIGN_PLAN.md 5.3) ---- */
.pfilters { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-bottom: 8px; }
.pfilters select.inp { font-size: var(--fs-table); max-width: 200px; }
.ptl { background: var(--bg-1); border-radius: var(--r-2); }
.pday { position: sticky; top: 52px; z-index: 2; background: var(--bg-1); padding: 12px 16px 4px; font-size: var(--fs-meta2); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--border-subtle); }
.pday:first-child { border-radius: var(--r-2) var(--r-2) 0 0; }
.pi { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
.pi:last-child { border-bottom: 0; }
.pi.nt { grid-template-columns: minmax(0, 1fr) auto; } .pi.nt .pi-t { display: none; }
.pi-t { font-size: var(--fs-table); color: var(--text-3); font-variant-numeric: tabular-nums; padding-top: 2px; }
.pi-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: var(--fs-meta); color: var(--text-3); }
.pi-h .src { color: var(--text-2); font-weight: 600; }
.pi-x { font-size: var(--fs-title); font-weight: 600; line-height: 1.35; margin: 4px 0; }
.pi-x a { color: var(--text-1); } .pi-x a:hover { color: var(--interactive); text-decoration: none; }
.pi-txt { margin: 0 0 4px; font-size: var(--fs-table); color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pi-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 4px; font-size: var(--fs-table); }
.pi-row .affects { margin: 0; }
.pi-k { font-size: var(--fs-meta2); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin-right: 4px; }
.pi-why { margin-top: 4px; font-size: var(--fs-table); }
.pi-why summary { cursor: pointer; list-style: none; } .pi-why summary::-webkit-details-marker { display: none; }
.pi-why .pi-more { color: var(--interactive); font-size: var(--fs-meta); margin-left: 4px; }
.pi-why[open] .pi-more { display: none; } .pi-why p { color: var(--text-2); margin-top: 4px; }
.pi-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: var(--fs-table); }
.pi img.th { width: 112px; height: 64px; object-fit: cover; border-radius: var(--r-1); background: var(--bg-2); }
@media (max-width: 720px) { .pi { grid-template-columns: 40px minmax(0, 1fr); padding: 12px; } .pi img.th { grid-column: 2; width: 100%; height: 140px; } }
svg.scat { max-width: 720px; } svg.scat .sd { stroke: var(--bg-1); stroke-width: 2; fill: var(--neutral); }
svg.scat .sd.t-pos { fill: var(--positive); } svg.scat .sd.t-neg { fill: var(--negative); }
svg.scat .sl { fill: var(--text-2); font-size: var(--fs-meta); } svg.scat a:hover .sl { fill: var(--interactive); }

/* ---- Pulse › Social ---- */
.fold-sum { cursor: pointer; font-size: var(--fs-table); color: var(--interactive); }
.carousel { padding: 16px; }
.cz { margin: 0; } .cz img { width: 100%; max-height: 460px; object-fit: contain; display: block; background: var(--img-bg); border-radius: var(--r-1); }
.cz figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-top: 8px; font-size: var(--fs-table); color: var(--text-2); }
.cz-links { display: flex; gap: 16px; }
.cz-thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; }
.cz-t { flex: 0 0 96px; height: 60px; padding: 0; border: 0; border-radius: var(--r-1); overflow: hidden; background: var(--bg-2); cursor: pointer; opacity: .6; }
.cz-t img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cz-t.on, .cz-t:hover { opacity: 1; box-shadow: inset 0 0 0 2px var(--interactive); }
details.crowd > summary { cursor: pointer; }

/* ---- Calendar: agenda (UI_REDESIGN_PLAN.md 5.4) ---- */
.agenda { display: flex; flex-direction: column; gap: 16px; }
.ag-day { background: var(--bg-1); border-radius: var(--r-2); padding: 4px 0; }
.ag-day.today { box-shadow: inset 3px 0 0 var(--interactive); }
.ag-h { margin: 8px 16px 4px; }
.ag-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 96px minmax(0, 220px); gap: 4px 12px; align-items: baseline; padding: 8px 16px; border-top: 1px solid var(--border-subtle); color: var(--text-1); font-size: var(--fs-body); }
.ag-row:hover { background: var(--bg-hover); text-decoration: none; }
.ag-row.past { opacity: .6; } .ag-row.high .ag-name { font-weight: 600; }
.ag-t { color: var(--text-2); font-variant-numeric: tabular-nums; font-size: var(--fs-table); }
.ag-n { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ag-why { font-size: var(--fs-table); color: var(--text-2); }
.ag-imp { margin-left: 0; } .ag-nums { font-size: var(--fs-table); color: var(--text-2); text-align: right; }
.ag-empty { margin: 4px 16px 8px; }
.ag-day .nowline { margin: 0 16px; }
a.cev2 { display: grid; grid-template-columns: auto 1fr; gap: 0 4px; padding: 4px; border-radius: var(--r-2); font-size: var(--fs-table); line-height: 1.3; color: var(--text-1); }
a.cev2:hover { background: var(--bg-hover); text-decoration: none; }
a.cev2.key { box-shadow: inset 3px 0 0 var(--interactive); }
.mcell a.mdn { color: var(--text-1); } .mcell a.mev:hover { text-decoration: underline; }
@media (max-width: 720px) { .ag-row { grid-template-columns: 44px minmax(0, 1fr); } .ag-imp, .ag-nums { grid-column: 2; text-align: left; } }
.cu-n { color: var(--text-1); } .cu-n:hover { color: var(--interactive); text-decoration: none; }

/* ---- Chart Studio: series legend with controls ---- */
.slegend { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--fs-table); }
.slegend li { display: inline-flex; align-items: center; gap: 4px; }
.slegend .sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.slegend .sw.dash { background: none !important; border-top: 2px dashed var(--text-2); height: 0; }
.slegend .sl-n { color: var(--text-2); }
.sl-c { display: inline-flex; gap: 2px; margin-left: 4px; }
.sl-c a { color: var(--text-3); padding: 0 4px; border-radius: var(--r-1); font-size: var(--fs-meta); }
.sl-c a:hover { background: var(--bg-hover); color: var(--interactive); text-decoration: none; }
.evk { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: var(--fs-table); }
.dr-table th, .dr-table td { white-space: nowrap; font-size: var(--fs-meta); }
h1 .star { position: static; vertical-align: middle; font-size: var(--fs-lead); }

/* Country Lab */
.cmx-wrap { margin-bottom: 8px; }
table.cmx { border-collapse: separate; border-spacing: 4px; min-width: 980px; width: 100%; font-size: var(--fs-table); }
table.cmx thead th { text-align: left; font-size: var(--fs-meta2); color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: 0 4px; vertical-align: bottom; }
table.cmx thead th .k { text-transform: none; letter-spacing: 0; font-weight: 400; }
table.cmx th.cn { text-align: left; white-space: nowrap; padding-right: 8px; position: sticky; left: 0; background: var(--bg-0); z-index: 1; }
table.cmx tbody th.cn { font-weight: 600; font-size: var(--fs-table); }
table.cmx td { padding: 0; vertical-align: top; width: 11.5%; }
table.cmx .k { font-size: var(--fs-meta2); color: var(--text-3); }
tr.cmx-sep td { padding: 12px 4px 4px; }
.hm-cell.cc { min-height: 60px; }
.hm-cell.cc .hv { font-size: var(--fs-body); }
.hm-cell.nc { color: var(--text-3); justify-content: center; }
.cgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.cpill { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cpill .cpl { font-size: var(--fs-meta); font-weight: 600; }
.cpill .k { font-size: var(--fs-meta2); color: var(--text-3); min-height: 2.4em; }
details.cser { margin-bottom: 8px; }
details.cser summary { cursor: pointer; }
.cpick { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 8px; }
.cmpf select { max-width: 100%; }
svg.regime .ql { font-weight: 600; }
@media (max-width: 720px) { .cgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ag-list { padding: 0; overflow: hidden; }
.ag-list .ag-row { grid-template-columns: 96px minmax(0, 1fr) 96px minmax(0, 220px); }
.ag-list .ag-row:first-child { border-top: 0; }
@media (max-width: 720px) { .ag-list .ag-row { grid-template-columns: 80px minmax(0, 1fr); } .ag-list .ag-imp, .ag-list .ag-nums { grid-column: 2; } }

/* Watchlist (My pulse) */
.whead { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 8px; }
.wsugg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.wsugg .chip { display: inline-flex; align-items: center; gap: 4px; }
.wsugg .star, .wtable .star { position: static; }
.wtable tr.stale td { opacity: .7; }
.badge.unusual { color: var(--warning); margin-left: 2px; }
.wlist { padding: 0; overflow: hidden; }
.wli { display: flex; flex-direction: column; gap: 2px; padding: 8px 16px; border-top: 1px solid var(--border-subtle); color: var(--text-1); }
.wli:first-child { border-top: 0; }
.wli:hover { background: var(--bg-hover); text-decoration: none; }
.wli .wt { font-size: var(--fs-body); }
.wli .k { font-size: var(--fs-meta2); color: var(--text-3); }
.wcols { align-items: start; }
.wcols .ag-list .ag-row { grid-template-columns: 88px minmax(0, 1fr) auto; }
.wcols .ag-list .ag-nums { display: none; }
@media (max-width: 720px) { .wcols .ag-list .ag-row { grid-template-columns: 80px minmax(0, 1fr); } }
@media (max-width: 720px) { .wtable .badge.unusual { display: none; } .wtable td, .wtable th { padding-left: 4px; padding-right: 4px; } }
@media (max-width: 720px) { .grid2.wcols { grid-template-columns: minmax(0, 1fr); } }

/* Research pages */
table.hvb td { vertical-align: top; }
.grid2.sides { align-items: start; }
.sides .card.evr, .feedlist .card.evr { margin-bottom: 8px; }
ol.tline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--border-subtle); }
ol.tline li { position: relative; padding: 4px 0 8px 8px; font-size: var(--fs-table); }
ol.tline li::before { content: ""; position: absolute; left: -22px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
ol.tline li.tl-view::before { background: var(--interactive); }
ol.tline li.tl-review::before { background: var(--research); }
ol.tline .mem-r { color: var(--text-2); margin-top: 2px; }
.cgrid3 { align-items: start; }
.tmap-wrap { padding: 8px; }
svg.tmap { width: 100%; min-width: 980px; height: auto; display: block; }
svg.tmap .tn { fill: var(--bg-1); stroke: var(--border-strong); }
svg.tmap .tn.views { stroke: var(--interactive); }
svg.tmap .tl { fill: var(--text-1); font-size: var(--fs-meta); }
svg.tmap .th { font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
svg.tmap .edge { fill: none; stroke: var(--border-strong); stroke-width: 1.5; }
svg.tmap .edge.key { stroke-width: 3; }
svg.tmap .edge.t-pos { stroke: var(--positive); } svg.tmap .edge.t-neg { stroke: var(--negative); }
svg.tmap a:hover .tn { stroke: var(--text-1); }
.hm-legend i.sw { display: inline-block; width: 16px; height: 3px; vertical-align: middle; background: var(--border-strong); }
.hm-legend i.sw.t-pos { background: var(--positive); } .hm-legend i.sw.t-neg { background: var(--negative); }
.chip.t-pos { color: var(--positive); } .chip.t-neg { color: var(--negative); }
td .chip { margin: 2px 4px 2px 0; white-space: normal; }
@media (max-width: 720px) { .grid2.sides, .grid3.cgrid3 { grid-template-columns: minmax(0, 1fr); } }
.xcov { align-items: start; }
.xcov > * { min-width: 0; }
@media (max-width: 720px) { .grid2.xcov, .grid3.xcov { grid-template-columns: minmax(0, 1fr); } }
code { overflow-wrap: anywhere; }

/* Analytics */
svg.xys .pt { fill: var(--s1); fill-opacity: .55; }
svg.xys .pt.last { fill: none; stroke: var(--text-1); stroke-width: 2; }
svg.xys .fit { stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
svg.hbars { width: 100%; height: auto; display: block; }
svg.hbars .bar { fill: var(--s1); fill-opacity: .75; } svg.hbars .bar.neg { fill: var(--s2); }
svg.hbars .tl { fill: var(--text-1); font-size: var(--fs-meta); }
.statline { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--fs-table); }
.statline b { font-variant-numeric: tabular-nums; }
.anaform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.anaform input[type=text], .anaform input:not([type]), .anaform select { font: inherit; font-size: var(--fs-body); padding: 4px 8px; border-radius: var(--r-1); border: 1px solid var(--border-strong); background: var(--bg-1); color: var(--text-1); max-width: 100%; min-width: 0; }
.anaform textarea { font: inherit; width: 100%; min-height: 3em; padding: 4px 8px; border-radius: var(--r-1); border: 1px solid var(--border-strong); background: var(--bg-1); color: var(--text-1); }
.warnline { color: var(--warning); }
.fchips { display: flex; flex-wrap: wrap; gap: 4px; }

/* Anomaly Radar: how unusual a move is (intensity only; the sign is printed, not coloured) */
.zb { display: inline-block; padding: 0 6px; border-radius: var(--r-1); font-variant-numeric: tabular-nums; }
.zb.z1 { background: color-mix(in srgb, var(--warning) 14%, transparent); }
.zb.z2 { background: color-mix(in srgb, var(--warning) 28%, transparent); }
.zb.z3 { background: color-mix(in srgb, var(--warning) 44%, transparent); font-weight: 600; }
svg.xss .pt { fill-opacity: .75; }
svg.xss .g1 { fill: var(--s1); } svg.xss .g2 { fill: var(--s2); } svg.xss .g3 { fill: var(--s3); } svg.xss .g4 { fill: var(--s4); }
svg.xss .g5 { fill: var(--s5); } svg.xss .g6 { fill: var(--s6); } svg.xss .g7 { fill: var(--s7); } svg.xss .g8 { fill: var(--s8); }
svg.xss a:hover .pt { fill-opacity: 1; stroke: var(--text-1); }
@media (max-width: 720px) { .grid2.ana-hub { grid-template-columns: minmax(0, 1fr); } }
svg.dots { width: 100%; max-width: 360px; height: auto; display: block; }
svg.dots .pt { fill: var(--s1); fill-opacity: .7; }
svg.trails .tr { fill: none; stroke-width: 1.5; stroke-opacity: .7; }
svg.trails .tr.g1 { stroke: var(--s1); } svg.trails .tr.g2 { stroke: var(--s2); } svg.trails .tr.g3 { stroke: var(--s3); } svg.trails .tr.g4 { stroke: var(--s4); }
svg.trails .tr.g5 { stroke: var(--s5); } svg.trails .tr.g6 { stroke: var(--s6); } svg.trails .tr.g7 { stroke: var(--s7); } svg.trails .tr.g8 { stroke: var(--s8); }
svg.trails .tp.g1 { fill: var(--s1); } svg.trails .tp.g2 { fill: var(--s2); } svg.trails .tp.g3 { fill: var(--s3); } svg.trails .tp.g4 { fill: var(--s4); }
svg.trails .tp.g5 { fill: var(--s5); } svg.trails .tp.g6 { fill: var(--s6); } svg.trails .tp.g7 { fill: var(--s7); } svg.trails .tp.g8 { fill: var(--s8); }
svg.trails .tp { fill-opacity: .55; } svg.trails .tp.last { fill-opacity: 1; }
.momentum { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0; }
.momentum .mm { min-width: 0; }
.noteform { display: grid; gap: 12px; max-width: 760px; }
.noteform label { display: grid; gap: 4px; font-size: var(--fs-meta); color: var(--text-2); }
.noteform input, .noteform textarea, .noteform select { font: inherit; font-size: var(--fs-body); padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--r-1); background: var(--bg-1); color: var(--text-1); min-width: 0; }
.noteform fieldset { border: 1px solid var(--border-subtle); border-radius: var(--r-1); padding: 8px; display: grid; gap: 6px; }
.noteform .lrow { display: flex; gap: 6px; flex-wrap: wrap; }
.notebody p { margin: 0 0 10px; } .vbody { white-space: pre-wrap; font: inherit; font-size: var(--fs-meta); margin: 4px 0 0; }

/* Workspaces and exhibits (Sprint 3) */
.tplgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tplcard { display: grid; gap: 8px; align-content: start; }
.tplcard .lab-row input { flex: 1 1 120px; min-width: 0; }
.wsitem .rt a { color: var(--text-1); }
.wsspark svg { width: 100%; height: 36px; display: block; }
.wsmissing { opacity: .7; }
.addform { max-width: 420px; display: grid; gap: 8px; }
.addform input, .addform select, .addform textarea { font: inherit; font-size: var(--fs-table); padding: 4px 8px; border-radius: var(--r-1); border: 1px solid var(--border-strong); background: var(--bg-1); color: var(--text-1); width: 100%; }
.addform label { font-size: var(--fs-meta); color: var(--text-2); display: grid; gap: 2px; }
.wsmanage .lab-row input { flex: 1 1 140px; min-width: 0; }
.exannot { white-space: pre-wrap; }
.nv { position: relative; }
.nvcount { margin-left: auto; min-width: 18px; padding: 0 5px; border-radius: var(--r-2); background: var(--interactive); color: var(--on-interactive); font-size: var(--fs-meta); line-height: 18px; text-align: center; font-weight: 600; }
html.sb-min .nvcount { position: absolute; top: 0; right: 2px; min-width: 14px; line-height: 14px; padding: 0 3px; }
@media (max-width: 1100px) { html:not(.sb-open) .nvcount { position: absolute; top: 0; right: 2px; min-width: 14px; line-height: 14px; padding: 0 3px; } }
.alform { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); align-items: end; }
.alform label { font-size: var(--fs-meta); color: var(--text-2); display: grid; gap: 2px; min-width: 0; }
.alform input, .alform select { font: inherit; font-size: var(--fs-table); padding: 4px 8px; border-radius: var(--r-1); border: 1px solid var(--border-strong); background: var(--bg-1); color: var(--text-1); width: 100%; min-width: 0; }
.alrow-paused { opacity: .6; }
.hitnew { font-weight: 600; }

/* Report builder and print view (Sprint 3) */
.rbuild { display: grid; gap: 12px; }
.rcard { min-width: 0; }
.rctl { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.rctl .boardctl { margin: 0; }
.rtextform { max-width: none; }
.rmod { min-width: 0; }
.rmod .hm { box-shadow: none; }
.rtext p { margin: 0 0 8px; }
.rempty { font-style: italic; }
.rsnap { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.rtile { border: 1px solid var(--border-subtle); border-radius: var(--r-1); padding: 8px; }
.rlvl { font-size: var(--fs-title); font-weight: 600; color: var(--text-1); }
body.rprint { background: var(--bg-1); color: var(--text-1); }
.rpage { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }
.rpage .rmod { margin: 0 0 24px; break-inside: avoid; page-break-inside: avoid; }
.rpage .rmod-text { break-inside: auto; page-break-inside: auto; }
.rprint-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 16px; }
.rhead { border-bottom: 1px solid var(--border-strong); margin-bottom: 16px; }
.rfoot { border-top: 1px solid var(--border-subtle); padding-top: 8px; margin-top: 24px; }
@media print {
  .noprint { display: none !important; }
  .rpage { max-width: none; padding: 0; }
  .rpage a { color: inherit; text-decoration: none; }
  .rpage .hm-head .ranges { display: none; }
  @page { margin: 16mm 14mm; }
}

/* Portfolio (Sprint 4) */
.pfwarn b { color: var(--text-1); }
.pfhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pfload > * { min-width: 0; }
.pfload textarea { width: 100%; }
.pfmodel { display: grid; gap: 2px; margin: 0 0 8px; justify-items: start; }
.pfopts { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.pfopts label { font-size: var(--fs-meta); color: var(--text-2); display: grid; gap: 2px; }
.pfopts input, .pfopts select, .pfscen select { font: inherit; font-size: var(--fs-table); padding: 4px 8px; border-radius: var(--r-1); border: 1px solid var(--border-strong); background: var(--bg-1); color: var(--text-1); }
.pftiles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pftotal { border-color: var(--border-strong); }
.pfbar { display: block; height: 6px; background: var(--bg-2); border-radius: var(--r-1); margin: 2px 0; min-width: 60px; }
.pfbar i { display: block; height: 100%; background: var(--interactive); border-radius: var(--r-1); }
.pfrisk .pfbar + .pfbar i { background: var(--warning); }
.pfbarcell { width: 35%; }
.pfunres td { background: var(--warning-soft); }
.pfbasis { font-size: var(--fs-meta); font-weight: 600; white-space: nowrap; }
.pfb-direct-shock { color: var(--interactive); }
.pfb-historical-sensitivity { color: var(--research); }
.pfb-analyst-assumption { color: var(--warning); }
.pfb-no-shock { color: var(--text-3); }
.pfscen textarea { width: 100%; }
.chk { display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-meta); color: var(--text-2); }
.pfwarnc { color: var(--warning); }
.addform input[type=checkbox] { width: auto; }
.addform label.chk { display: flex; gap: 6px; align-items: center; justify-items: start; }

/* Data infrastructure (Sprint 5) */
a.hltile { color: inherit; text-decoration: none; }
a.hltile.on { border-color: var(--interactive); }
.hlflag { font-size: var(--fs-meta); }
.usedby li { margin: 0 0 4px; }
.cmpgrid > * { min-width: 0; }
@media (max-width: 720px) { .grid2.cmpgrid { grid-template-columns: 1fr; } }
.hlfilter input[type=text] { flex: 1 1 260px; max-width: 420px; min-width: 0; }
.nowrap { white-space: nowrap; }
