:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --field-bg: #ffffff;
  --surface-2: #f1f0ec;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #76746e;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-7: #6250d6;
  --series-8: #e34948;
  /* Fear (blue, cold) ↔ Greed (red, hot). Same direction as the Korean convention: up = red, down = blue. */
  --ef: #1c5cab; --f: #6da7ec; --n: #a8a69c; --g: #e57a79; --eg: #d03b3b;
  --up: #d03b3b; --down: #256abf;
  /* Status colors (only used together with an icon + label) */
  --calm: #0ca30c; --normal: #898781; --caution: #c98500; --stress: #d03b3b;
  --seq-0: var(--surface-2); --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #256abf; --seq-6: #184f95;
  /* tile-map label colors per bucket (contrast against each fill) */
  --seq-t0: var(--muted); --seq-t1: #0b0b0b; --seq-t2: #0b0b0b; --seq-t3: #0b0b0b; --seq-t4: #fff; --seq-t5: #fff;
  --font: system-ui, -apple-system, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --field-bg: #1a1a19; --surface: #1a1a19; --surface-2: #242422; --text: #f0efec; --text-2: #c3c2b7; --muted: #9a988f;
    --grid: #2c2c2a; --axis: #45453f; --border: rgba(255, 255, 255, 0.1);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-7: #9085e9; --series-8: #e66767;
    --ef: #3987e5; --f: #86b6ef; --n: #6b6a64; --g: #e88a89; --eg: #e66767; --up: #ef6f6f; --down: #5598e7;
    --calm: #0ca30c; --normal: #9a988f; --caution: #fab219; --stress: #e66767;
    --seq-1: #1f2f45; --seq-2: #184f95; --seq-3: #1c5cab; --seq-4: #2a78d6; --seq-5: #5598e7; --seq-6: #9ec5f4;
    --seq-t0: var(--muted); --seq-t1: #f0efec; --seq-t2: #f0efec; --seq-t3: #f0efec; --seq-t4: #0b0b0b; --seq-t5: #0b0b0b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --field-bg: #1a1a19; --surface: #1a1a19; --surface-2: #242422; --text: #f0efec; --text-2: #c3c2b7; --muted: #9a988f;
  --grid: #2c2c2a; --axis: #45453f; --border: rgba(255, 255, 255, 0.1);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-7: #9085e9; --series-8: #e66767;
  --ef: #3987e5; --f: #86b6ef; --n: #6b6a64; --g: #e88a89; --eg: #e66767; --up: #ef6f6f; --down: #5598e7;
  --calm: #0ca30c; --normal: #9a988f; --caution: #fab219; --stress: #e66767;
  --seq-1: #1f2f45; --seq-2: #184f95; --seq-3: #1c5cab; --seq-4: #2a78d6; --seq-5: #5598e7; --seq-6: #9ec5f4;
  --seq-t0: var(--muted); --seq-t1: #f0efec; --seq-t2: #f0efec; --seq-t3: #f0efec; --seq-t4: #0b0b0b; --seq-t5: #0b0b0b;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 15px/1.65 var(--font); -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--series-1); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; }
p { margin: 0 0 8px; }
small, .muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
code { font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; border-radius: 4px; }
/* #view only receives focus programmatically after navigation (for screen readers); no ring there. */
#view:focus, #view:focus-visible { outline: none; }

/* header & tabs */
header.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); padding-top: env(safe-area-inset-top); }
.top-inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px 4px; display: flex; align-items: center; gap: 10px; }
.brand { font-weight: 800; font-size: 17px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.updated { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; gap: 6px; }
button.ghost { white-space: nowrap; background: transparent; border: 1px solid var(--border); color: var(--text-2); border-radius: 10px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; min-height: 36px; }
button.ghost:hover { background: var(--surface-2); color: var(--text); }
button.ghost.on { background: var(--text); color: var(--surface); border-color: var(--text); }
nav.tabs { max-width: 1200px; margin: 0 auto; display: flex; gap: 4px; padding: 4px 12px 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a { flex: none; color: var(--text-2); padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 550; white-space: nowrap; min-height: 36px; display: inline-flex; align-items: center; }
nav.tabs a:hover { background: var(--surface-2); text-decoration: none; }
nav.tabs a[aria-current="page"] { background: var(--text); color: var(--surface); }

main { max-width: 1200px; margin: 0 auto; padding: 18px 16px 64px; outline: none; }
.page-head { margin-bottom: 14px; }
.page-head h1 { font-size: 24px; font-weight: 800; }
.page-head p { color: var(--text-2); margin-top: 4px; font-size: 14.5px; }
section.block { margin-top: 28px; }
section.block > h2 { font-size: 18px; font-weight: 750; margin-bottom: 10px; }
section.block > .lead { color: var(--text-2); font-size: 14px; margin: -4px 0 12px; }

.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
@media (max-width: 960px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } .auto { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; min-width: 0; }
.card h3 { font-size: 15.5px; font-weight: 700; }
.card .sub { color: var(--muted); font-size: 13px; margin: 2px 0 10px; }
.card.span2 { grid-column: span 2; }
@media (max-width: 640px) { .card.span2 { grid-column: auto; } .card { padding: 14px; border-radius: 14px; } }
.chart { width: 100%; min-height: 60px; }
.empty, .err { color: var(--muted); font-size: 14px; padding: 12px 0; }
.err::before { content: '⚠ '; }
.src { margin-top: 10px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.src a { color: var(--muted); text-decoration: underline; }
.note { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--text-2); }
.badge { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); vertical-align: 2px; }
.skeleton { height: 140px; border-radius: 14px; background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sh 1.4s infinite; }
@keyframes sh { to { background-position: -200% 0; } }

/* summary banner on top of each page */
.summary { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--series-1); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.summary h2 { font-size: 15px; color: var(--muted); font-weight: 650; margin-bottom: 4px; }
.summary p { font-size: 16px; font-weight: 600; margin: 0; line-height: 1.6; }
.summary ul { margin: 6px 0 0; padding-left: 18px; }
.summary li { margin: 3px 0; }

/* status chips (icon + label, never color alone) */
.tone { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tone i { font-style: normal; font-size: 10px; }
.tone-calm { color: var(--calm); background: color-mix(in srgb, var(--calm) 13%, transparent); }
.tone-normal { color: var(--text-2); background: var(--surface-2); }
.tone-caution { color: var(--caution); background: color-mix(in srgb, var(--caution) 15%, transparent); }
.tone-stress { color: var(--stress); background: color-mix(in srgb, var(--stress) 13%, transparent); }

/* hero gauges */
.hero { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 12px; }
@media (max-width: 1040px) { .hero { grid-template-columns: 1fr 1fr; } .hero .regime-card { grid-column: span 2; } }
@media (max-width: 640px) { .hero { grid-template-columns: 1fr; } .hero .regime-card { grid-column: auto; } }
.gauge-card { text-align: center; }
.gauge { width: 100%; max-width: 330px; display: block; margin: 0 auto; }
.gband { opacity: 0.32; } .gband.active { opacity: 1; }
.gband.g0 { fill: var(--ef); } .gband.g1 { fill: var(--f); } .gband.g2 { fill: var(--n); } .gband.g3 { fill: var(--g); } .gband.g4 { fill: var(--eg); }
.glabel, .gtick { fill: var(--muted); font-size: 10.5px; }
.needle { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.hub { fill: var(--text); }
.score-big { font-size: 48px; font-weight: 800; line-height: 1; margin-top: -6px; }
.score-band { font-size: 17px; font-weight: 700; margin-top: 6px; }
.band-extreme-fear { color: var(--ef); } .band-fear { color: var(--f); } .band-neutral { color: var(--text-2); } .band-greed { color: var(--g); } .band-extreme-greed { color: var(--eg); }
.prevs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.prevs.p3 { grid-template-columns: repeat(3, 1fr); }
.prev { background: var(--surface-2); border-radius: 10px; padding: 6px 4px; font-size: 12px; color: var(--text-2); }
.prev b { display: block; font-size: 16px; color: var(--text); }
.regime-label { font-size: 24px; font-weight: 800; margin: 4px 0 6px; }
.flags { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.flags li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }

/* page link cards on home */
.jump { display: block; color: inherit; }
.jump:hover { text-decoration: none; border-color: var(--series-1); }
.jump .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.jump p { color: var(--text-2); font-size: 14px; margin: 6px 0 0; }

/* tables: become stacked cards on phones */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 8px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
td { padding: 10px 8px; border-bottom: 1px solid var(--grid); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
.table-wrap { overflow-x: auto; }
@media (max-width: 640px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 10px 0; border-bottom: 1px solid var(--grid); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 3px 0; text-align: left !important; }
  table.stack td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 84px; margin-right: 10px; color: var(--muted); font-size: 12.5px; }
}
.scorebar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); min-width: 90px; margin-top: 6px; }
.scorebar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.desc { color: var(--muted); font-size: 12.5px; }

/* stat tiles */
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; min-width: 0; }
.tile .k { color: var(--text-2); font-size: 13.5px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tile .v { font-size: 24px; font-weight: 800; margin-top: 2px; }
.tile .d { font-size: 13px; color: var(--muted); margin-top: 2px; }
.up { color: var(--up); } .down { color: var(--down); }
.spark { display: block; margin-top: 8px; overflow: visible; max-width: 100%; }
.spark .ref { stroke: var(--axis); stroke-dasharray: 2 2; }

/* guide cards */
.guide .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.guide .val { font-size: 26px; font-weight: 800; line-height: 1.2; }
.guide .now { margin-top: 8px; font-size: 14.5px; }
.guide details { margin-top: 10px; border-top: 1px solid var(--grid); padding-top: 8px; }
.guide summary { cursor: pointer; color: var(--series-1); font-size: 14px; font-weight: 600; list-style: none; padding: 4px 0; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::before { content: '▸ '; }
.guide details[open] summary::before { content: '▾ '; }
.guide h4 { font-size: 13px; color: var(--muted); margin: 10px 0 2px; font-weight: 650; }
.guide .zones { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; }
.guide .zones li { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: baseline; font-size: 13.5px; padding: 5px 8px; border-radius: 8px; }
.guide .zones li.cur { background: var(--surface-2); font-weight: 600; }
.guide .zones .rng { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* RSI cards */
.rsi-card .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rsi-val { font-size: 28px; font-weight: 800; }
.rsi-zone { font-size: 13px; font-weight: 700; }
.zone-ob { color: var(--eg); } .zone-os { color: var(--ef); } .zone-mid { color: var(--text-2); }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.kv b { display: block; color: var(--text); font-size: 14px; font-weight: 650; }

/* charts */
svg text { font-family: var(--font); }
line.gl { stroke: var(--grid); stroke-width: 1; }
.axis { stroke: var(--axis); }
.tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ref { stroke: var(--axis); stroke-dasharray: 4 3; }
.ref-label { fill: var(--muted); font-size: 11px; }
.crosshair { stroke: var(--muted); stroke-width: 1; }
.hover-dot { stroke: var(--surface); stroke-width: 2; }
.zone.ob { fill: var(--eg); opacity: 0.08; } .zone.os { fill: var(--ef); opacity: 0.08; }
.chart-tip { position: fixed; z-index: 50; display: none; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 6px 24px rgba(0,0,0,.18); border-radius: 10px; padding: 8px 10px; font-size: 13px; min-width: 150px; }
.tip-date { color: var(--muted); margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-row b { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
.sw { width: 12px; height: 3px; border-radius: 2px; display: inline-block; flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--grid); font-size: 14px; }
.list li:last-child { border-bottom: 0; }
.list .meta { color: var(--muted); font-size: 12.5px; }
.bullets { margin: 0; padding-left: 20px; }
.bullets li { margin: 5px 0; }
.tag { display: inline-block; font-size: 11.5px; padding: 0 7px; border-radius: 5px; border: 1px solid var(--border); color: var(--muted); margin-left: 4px; vertical-align: 1px; }
.tag.high { color: var(--calm); border-color: color-mix(in srgb, var(--calm) 40%, transparent); }

/* politics */
.stance { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 1px 9px; border-radius: 999px; white-space: nowrap; }
.stance::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stance-pro-build { color: var(--series-3); background: color-mix(in srgb, var(--series-3) 13%, transparent); }
.stance-restrictive { color: var(--series-2); background: color-mix(in srgb, var(--series-2) 13%, transparent); }
.stance-mixed { color: var(--series-7); background: color-mix(in srgb, var(--series-7) 13%, transparent); }
.stance-unknown { color: var(--muted); background: var(--surface-2); }
.party { font-weight: 800; font-size: 11.5px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--border); }
.party-R { color: #d03b3b; } .party-D { color: #2a78d6; }
.race { border-top: 1px solid var(--grid); padding: 14px 0; }
.race:first-child { border-top: 0; padding-top: 2px; }
.race-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.race-head .st { font-weight: 800; font-size: 13px; background: var(--surface-2); padding: 1px 8px; border-radius: 6px; }
.cands { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; margin-top: 10px; }
.cand { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.cand .nm { font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.cand.win { outline: 2px solid var(--calm); }
.why { font-size: 14px; color: var(--text-2); margin-top: 8px; }
details.more summary { cursor: pointer; color: var(--series-1); font-size: 14px; margin-top: 6px; }
.dir-positive { color: var(--calm); } .dir-negative { color: var(--stress); } .dir-mixed { color: var(--series-7); }
.unv { color: var(--muted); font-size: 11.5px; border: 1px dashed var(--axis); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

/* calendar */
.cal { display: grid; gap: 4px; }
.cal-row { display: grid; grid-template-columns: 88px 52px 1fr; gap: 10px; padding: 9px 10px; border-radius: 10px; align-items: baseline; font-size: 14px; }
.cal-row:nth-child(odd) { background: var(--surface-2); }
.cal-row.past { opacity: 0.5; }
.cal-row.today { outline: 2px solid var(--series-1); }
.cal-row.imp3 .ev { font-weight: 700; }
.cal-cat { font-size: 11.5px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--border); color: var(--muted); margin-left: 6px; white-space: nowrap; }
@media (max-width: 640px) { .cal-row { grid-template-columns: 70px 1fr; } .cal-row .t { display: none; } }

/* data centers */
.statusbar { display: flex; height: 24px; border-radius: 7px; overflow: hidden; gap: 2px; margin: 10px 0; }
.statusbar span { display: block; min-width: 2px; }
.tilemap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; margin-top: 8px; }
.tilemap .st { aspect-ratio: 1; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; line-height: 1.1; cursor: pointer; border: 0; padding: 0; font-family: inherit; }
.tilemap .st small { font-weight: 500; font-size: 9.5px; color: inherit; opacity: 0.9; }
.tilemap .st.sel { outline: 2px solid var(--text); outline-offset: 1px; }
@media (max-width: 640px) { .tilemap { gap: 2px; } .tilemap .st { font-size: 9.5px; border-radius: 4px; } .tilemap .st small { display: none; } }
.ramp { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.ramp span.sq { width: 18px; height: 12px; border-radius: 3px; display: inline-block; }
.iframe-wrap { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.iframe-wrap iframe { width: 100%; height: 640px; border: 0; display: block; }
@media (max-width: 640px) { .iframe-wrap iframe { height: 520px; } }
/* date · source · reliability line under data */
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.meta-line a { color: inherit; text-decoration: underline; }
.meta-line .tone { font-size: 11.5px; padding: 0 7px; }
.meta-line .desc { flex-basis: 100%; }

/* stacked panel title (e.g. Nasdaq under the score chart) */
.panel-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 14px; margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--grid); }
.panel-h:empty { display: none; }

/* backtests */
.bt-head { font-size: 14.5px; color: var(--text-2); margin: 6px 0 4px; }
.bt-head b { color: var(--text); }
.sub-h { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.bt-range { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: -2px 0 10px; font-size: 14px; color: var(--text-2); }
/* year pickers: plain white fields with a black border (dark theme: page surface with a light border) */
.bt-range select { font: inherit; font-size: 14.5px; font-weight: 650; color: var(--text); background-color: var(--field-bg); border: 1.5px solid var(--text); border-radius: 10px; padding: 6px 10px; min-height: 38px; cursor: pointer; }
table.bt { table-layout: fixed; }
table.bt th:first-child, table.bt td:first-child { width: 28%; }
table.bt th.r, table.bt td.r { text-align: center; }
table.bt td .desc, table.bt th .desc { display: block; font-weight: 400; }
table.bt td.r b, table.bt td.r .desc { white-space: nowrap; }
table.bt tbody tr[data-ep] { cursor: pointer; }
table.bt tbody tr[data-ep]:hover td { background: var(--surface-2); }
table.bt tbody tr[data-ep]:focus-visible { outline: 2px solid var(--series-1); outline-offset: -2px; }
/* today's zone: warm tint with an accent bar */
table.bt tr.cur td, table.bt tr.cur:hover td { background: color-mix(in srgb, var(--series-4) 16%, transparent); }
table.bt tr.cur td:first-child { box-shadow: inset 4px 0 0 var(--series-4); }
table.bt tr.sel td:first-child b { text-decoration: underline; text-underline-offset: 3px; }
/* the comparison baseline keeps its fill and gets a frame in the theme's line color */
table.bt tr.base td { background: var(--surface-2); border-top: 1px solid var(--axis); border-bottom: 1px solid var(--axis); }
table.bt tr.base td:first-child { border-left: 1px solid var(--axis); }
table.bt tr.base td:last-child { border-right: 1px solid var(--axis); }
/* six horizon tiles: 3 per row (2 on phones) */
.bt-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .bt-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bt-tiles .tile { padding: 12px; } .bt-tiles .tile .v { font-size: 21px; } }
.bt-ep { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--grid); }
.bt-ep h3 { margin-bottom: 2px; }
.ep-list { list-style: none; margin: 8px 0 0; padding: 0; }
.ep-list li { padding: 10px 2px; border-bottom: 1px solid var(--grid); font-size: 14px; }
.ep-list li:last-child { border-bottom: 0; }
.ep-h { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.ep-r { display: flex; gap: 4px 14px; flex-wrap: wrap; margin-top: 4px; font-size: 13.5px; color: var(--text-2); }
.ep-r .dd { color: var(--muted); }
@media (max-width: 640px) {
  /* six horizons don't fit 375px: the table scrolls sideways with the zone column pinned */
  table.bt { min-width: 520px; }
  table.bt td.r { font-size: 12.5px; }
  table.bt td:first-child { font-size: 13px; }
  table.bt th, table.bt td { padding-left: 3px; padding-right: 3px; }
  table.bt th:first-child, table.bt td:first-child { width: 118px; padding-left: 6px; position: sticky; left: 0; z-index: 1; background: var(--surface); }
  table.bt tr.cur td:first-child { background: color-mix(in srgb, var(--series-4) 16%, var(--surface)); }
  table.bt tr.base td:first-child { background: var(--surface-2); }
  .ep-r { gap: 2px 10px; font-size: 13px; }
}

/* midterm cycle table: wide, scrolls sideways with the year column pinned */
table.mid { min-width: 860px; font-size: 13.5px; }
table.mid th, table.mid td { padding: 8px 6px; }
table.mid th.r, table.mid td.r { text-align: center; white-space: nowrap; }
table.mid td .desc { display: block; }
table.mid th:first-child, table.mid td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 84px; }
table.mid tr.cur td { background: color-mix(in srgb, var(--series-4) 16%, var(--surface)); }
table.mid tr.base td { background: var(--surface-2); border-top: 1px solid var(--axis); }

/* data-center search */
/* search field: same plain white field + black border as the year pickers, with a magnifier icon */
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-2); pointer-events: none; }
input.search { width: 100%; font: inherit; font-size: 16px; font-weight: 500; color: var(--text); background: var(--field-bg); border: 1.5px solid var(--text); border-radius: 12px; padding: 11px 14px 11px 42px; min-height: 46px; }
input.search::placeholder { color: var(--text-2); opacity: 1; font-weight: 400; }
input.search:focus { outline: 2px solid var(--text); outline-offset: 2px; }
.hit-sec { margin: 16px 0 2px; font-size: 14.5px; }
.hit-h { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.hit-kv { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }
/* long tables that scroll inside their card; the header row stays visible */
.scroll-y { max-height: 460px; overflow-y: auto; border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); }
.scroll-y thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
@media (max-width: 640px) { .scroll-y { max-height: 62vh; } }
/* dense tables that stay tables on phones (one row per item; secondary text drops to a second line) */
@media (max-width: 640px) {
  table.compact { font-size: 13.5px; }
  table.compact th, table.compact td { padding: 8px 4px; }
  table.compact td .desc { display: block; }
}
.link-btn { display: inline-block; font-size: 13.5px; border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; color: var(--text-2); margin-top: 8px; }
.link-btn:hover { background: var(--surface-2); text-decoration: none; }

footer { color: var(--muted); font-size: 12.5px; text-align: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
footer a { color: var(--muted); text-decoration: underline; }

@media (max-width: 520px) {
  .updated { display: none; }
  .top-inner { padding: 8px 12px 2px; }
  main { padding: 14px 12px 56px; }
  .page-head h1 { font-size: 21px; }
  .summary p { font-size: 15px; }
}

/* momentum comparison table */
table.mom { table-layout: fixed; }
table.mom th:first-child, table.mom td:first-child { width: 40%; }
table.mom td .desc { display: block; font-weight: 400; }
table.mom td .scorebar { min-width: 0; margin-left: auto; max-width: 140px; }
table.mom tr.mom-total td { border-bottom: 2px solid var(--border); }
table.mom tr.mom-sep td { color: var(--muted); font-size: 12.5px; padding-top: 14px; }
