:root {
  color-scheme: dark;
  --night: #141B3C;
  --dusk: #1E2752;
  --rule: #343E72;
  --moon: #EFEDFB;
  --haze: #B1B5D8;
  --sodium: #FFB547;
  --dawn: #FFD99A;
  --done: #5C6699;
  --up: #6BE3BB;
  --down: #FF98AA;
  --gutter: clamp(16px, 3vw, 40px);
  --body: 'Barlow', system-ui, sans-serif;
  --tight: 'Barlow Semi Condensed', 'Barlow', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--moon); font: 400 15px/1.45 var(--body); font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration-color: var(--done); text-underline-offset: 2px; }
a:hover { color: var(--dawn); }
:focus-visible { outline: 2px solid var(--sodium); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--moon); color: var(--night); padding: 6px 10px; z-index: 5; }

.top { padding: clamp(24px, 4vw, 48px) var(--gutter) clamp(18px, 2.5vw, 28px); max-width: 1500px; margin: 0 auto; }
h1 { font: 500 clamp(30px, 4.6vw, 62px)/1.06 var(--tight); letter-spacing: -.01em; max-width: 26ch; text-wrap: balance; }
.sub { margin-top: 12px; font: 400 clamp(17px, 1.6vw, 21px)/1.35 var(--tight); color: var(--haze); max-width: 70ch; }
.error { margin-top: 12px; color: var(--down); }

main { max-width: 1500px; margin: 0 auto; padding: 0 var(--gutter); }
h2 { font: 600 19px/1.2 var(--tight); }
h3 { font: 600 15px/1.2 var(--tight); color: var(--haze); }
.note { color: var(--haze); font-size: 13px; line-height: 1.4; margin-top: 3px; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--haze); }

/* SPY estimate */
.spy { margin-bottom: 36px; padding: 16px 0 18px; border-top: 2px solid var(--sodium); border-bottom: 1px solid var(--rule); }
.spy-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 40px; margin-top: 6px; }
.spy-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.spy-num { font: 500 clamp(40px, 5vw, 66px)/1.05 var(--tight); color: var(--sodium); }
.spy-for { font: 400 16px/1.3 var(--tight); color: var(--haze); }
.spy-for span { font-weight: 500; }
.spy-summary { font: 400 16px/1.42 var(--body); max-width: 68ch; }
.reason-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 24px; margin-top: 10px; }
.reasons { margin-top: 3px; font: 400 14.5px/1.3 var(--tight); }
.reasons li { padding: 3px 0; border-top: 1px solid var(--rule); }
.record { margin-top: 12px; }
.record summary { font: 400 14.5px/1.3 var(--tight); color: var(--haze); }
.scale { position: relative; height: 26px; margin: 10px 0 8px; }
.scale::before { content: ''; position: absolute; left: 0; right: 0; top: 12px; height: 2px; background: var(--rule); }
.scale i { position: absolute; display: block; }
.scale .rng { top: 7px; height: 12px; background: var(--dusk); box-shadow: inset 0 0 0 1px var(--done); border-radius: 3px; }
.m { transform: translateX(-50%); }
.m.close { top: 3px; width: 3px; height: 20px; background: var(--haze); border-radius: 2px; }
.m.fut { top: 7px; width: 12px; height: 12px; background: var(--night); border: 2px solid var(--moon); transform: translateX(-50%) rotate(45deg); }
.m.ai { top: 5px; width: 16px; height: 16px; background: var(--sodium); border: 2px solid var(--night); border-radius: 50%; }
.scale-key { display: flex; flex-wrap: wrap; gap: 3px 14px; margin-bottom: 6px; font: 400 14px/1.3 var(--tight); }
.scale-key li { display: inline-flex; align-items: center; gap: 6px; }
.k { display: inline-block; flex: none; }
.k.close { width: 3px; height: 13px; background: var(--haze); border-radius: 2px; }
.k.fut { width: 9px; height: 9px; border: 2px solid var(--moon); transform: rotate(45deg); }
.k.ai { width: 11px; height: 11px; background: var(--sodium); border-radius: 50%; }
.k.rng { width: 16px; height: 10px; background: var(--dusk); box-shadow: inset 0 0 0 1px var(--done); border-radius: 2px; }

/* The trading day chart: each exchange on a shared clock, so the night reads as a staircase. */
.path-head { display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: baseline; margin-bottom: 8px; }
.sunpath { --name: 158px; --last: 86px; --pct: 72px; --spark: 92px; }
.sp-row, .sp-axis { display: grid; grid-template-columns: var(--name) var(--last) var(--pct) var(--spark) minmax(0, 1fr); align-items: center; column-gap: 10px; }
.sp-row { min-height: 37px; border-top: 1px solid var(--rule); }
.sp-row:last-child { border-bottom: 1px solid var(--rule); }
.sp-name { min-width: 0; line-height: 1.12; }
.sp-name b { display: block; font: 600 16px/1.15 var(--tight); }
.sp-name span { font: 400 12.5px/1.15 var(--tight); color: var(--haze); }
.sp-last, .sp-pct { text-align: right; font: 500 16px/1 var(--tight); white-space: nowrap; }
.sp-spark { height: 28px; }
.sp-spark svg { display: block; width: 100%; height: 28px; overflow: visible; }
.sp-band { position: relative; height: 37px; }
.sp-ticks { position: relative; height: 22px; font: 400 12.5px/22px var(--tight); color: var(--haze); }
.sp-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.sp-ticks span:first-child { transform: none; }
.sp-ticks span:last-child { transform: translateX(-100%); }
.tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rule); opacity: .55; }
.bar { position: absolute; top: 9px; height: 19px; border-radius: 3px; font: 500 12px/19px var(--tight); padding: 0 5px; overflow: hidden; white-space: nowrap; cursor: default; }
.bar.upcoming { background: transparent; box-shadow: inset 0 0 0 1.5px var(--sodium); color: var(--dawn); }
.bar.live { background: var(--sodium); color: #231703; }
.bar.past { background: var(--done); color: var(--moon); }
.bar.ext { top: 13px; height: 11px; line-height: 11px; font-size: 0; padding: 0; opacity: .95; background-image: repeating-linear-gradient(135deg, currentColor 0 2px, transparent 2px 5px); background-color: transparent; color: var(--sodium); box-shadow: none; }
.bar.ext.past { color: var(--done); }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--moon); z-index: 2; pointer-events: none; }
.now-flag { position: absolute; top: 0; transform: translateX(-50%); background: var(--moon); color: var(--night); font: 600 12px/20px var(--tight); padding: 0 6px; border-radius: 3px; z-index: 3; white-space: nowrap; }
.key { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; color: var(--haze); font: 400 13px/1.3 var(--tight); }
.key li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 18px; height: 10px; border-radius: 2px; display: inline-block; }
.sw.now { background: var(--sodium); }
.sw.soon { box-shadow: inset 0 0 0 1.5px var(--sodium); }
.sw.done { background: var(--done); }
.sw.ext { background: repeating-linear-gradient(135deg, var(--sodium) 0 2px, transparent 2px 5px); }

/* Cross-asset */
.cross { margin-top: 38px; }
.futures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; margin-top: 10px; }
.fut b { display: block; font: 500 15px/1.2 var(--tight); color: var(--haze); }
.fut-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.fut-last { font: 500 clamp(26px, 3vw, 40px)/1.1 var(--tight); }
.fut-pct { font: 500 clamp(17px, 1.6vw, 22px)/1.1 var(--tight); }
.fut svg { display: block; width: 100%; height: 54px; margin-top: 6px; overflow: visible; }
.assets { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px 28px; margin-top: 22px; }
.rows { margin-top: 5px; }
.rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto 62px; gap: 8px; padding: 3.5px 0; border-top: 1px solid var(--rule); font: 500 15px/1.25 var(--tight); }
.rows .lbl { font-weight: 400; color: var(--haze); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .pct { text-align: right; }

/* Columns */
.columns { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0 36px; margin-top: 40px; align-items: start; }
.columns section + section { margin-top: 32px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 8px 0 6px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
button { font: 500 14px/1 var(--tight); color: var(--moon); background: var(--dusk); border: 1px solid var(--rule); border-radius: 4px; padding: 7px 10px; cursor: pointer; }
button:hover { border-color: var(--haze); }
.chips button[aria-pressed="true"] { background: var(--moon); color: var(--night); border-color: var(--moon); }
.search input { font: 400 14px/1 var(--tight); color: var(--moon); background: var(--night); border: 1px solid var(--rule); border-radius: 4px; padding: 7px 9px; width: 170px; }
.search input::placeholder { color: var(--haze); }

.wire li.item { padding: 8px 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 2px 10px; }
.wire .when { font: 500 13.5px/1.4 var(--tight); color: var(--haze); }
.wire a.head { font: 500 15.5px/1.32 var(--body); text-decoration: none; }
.wire a.head:hover { text-decoration: underline; }
.wire .meta { grid-column: 2; font: 400 13px/1.25 var(--tight); color: var(--haze); }
.wire li.older a.head { color: var(--haze); font-weight: 400; }
.wire li.close-mark { border-top: 2px solid var(--sodium); padding: 5px 0 10px; font: 600 14px/1.2 var(--tight); color: var(--dawn); }
.more { margin-top: 10px; width: 100%; }

.movers { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 8px; }
.tbl { width: 100%; border-collapse: collapse; font: 500 15px/1.2 var(--tight); margin-top: 4px; }
.tbl th { font: 400 12.5px/1.2 var(--tight); color: var(--haze); text-align: right; padding: 2px 0 3px 8px; }
.tbl th:first-child { text-align: left; padding-left: 0; }
.tbl td { border-top: 1px solid var(--rule); padding: 4px 0 4px 8px; text-align: right; white-space: nowrap; }
.tbl td:first-child { text-align: left; padding-left: 0; white-space: normal; }
.tbl td small { display: block; font: 400 12.5px/1.15 var(--tight); color: var(--haze); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl td .x { background: none; border: 0; padding: 0 0 0 6px; color: var(--haze); font-size: 16px; }
.tbl td small.up { color: var(--up); }
.tbl td small.down { color: var(--down); }
.tag { display: inline-block; font: 500 11.5px/15px var(--tight); padding: 0 5px; border-radius: 3px; background: var(--dusk); color: var(--dawn); margin-left: 4px; }
.watch-form { display: flex; gap: 6px; margin: 8px 0 4px; }
.watch-form input { width: 140px; }

.econ li { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 1px 10px; padding: 6px 0; border-top: 1px solid var(--rule); font: 400 14.5px/1.25 var(--tight); }
.econ .when { color: var(--haze); font-size: 13px; }
.econ .imp { font-weight: 600; }
.econ small { grid-column: 2; color: var(--haze); font-size: 12.5px; }
.econ li.past { color: var(--haze); }
.econ .day { display: block; padding: 10px 0 2px; font: 600 14px/1.2 var(--tight); color: var(--haze); }
.econ li.day-row { display: block; border: 0; padding: 0; }
.mood-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 6px 0; border-top: 1px solid var(--rule); font: 500 15px/1.25 var(--tight); }
.mood-row small { grid-column: 1 / -1; color: var(--haze); font: 400 13px/1.25 var(--tight); }
.plain li { padding: 6px 0; border-top: 1px solid var(--rule); font: 400 14px/1.3 var(--tight); }
.plain li b { font-weight: 500; display: block; }
.plain li small { color: var(--haze); font-size: 12.5px; display: block; }
.empty { padding: 10px 0; color: var(--haze); font-size: 14px; }
h3 + .plain, h3 + .tbl { margin-top: 4px; }
.subhead { margin-top: 16px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip-list a { font: 500 13.5px/1 var(--tight); background: var(--dusk); padding: 5px 7px; border-radius: 3px; text-decoration: none; }

.foot { max-width: 1500px; margin: 40px auto 0; padding: 14px var(--gutter) 40px; border-top: 1px solid var(--rule); }
summary { cursor: pointer; font: 500 15px/1.3 var(--tight); }
.sources { margin-top: 10px; columns: 3 220px; font: 400 13.5px/1.5 var(--tight); color: var(--haze); }
.sources .bad { color: var(--down); }
.tip { position: fixed; pointer-events: none; background: var(--moon); color: var(--night); font: 500 13px/1.25 var(--tight); padding: 4px 7px; border-radius: 3px; z-index: 10; white-space: nowrap; }

@media (max-width: 1180px) {
  .columns { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .col-side { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 28px; margin-top: 32px; }
  .col-side section + section { margin-top: 0; }
}
@media (max-width: 820px) {
  .spy-grid { grid-template-columns: minmax(0, 1fr); }
  .sunpath { --name: 1fr; }
  .sp-axis { grid-template-columns: minmax(0, 1fr); }
  .sp-axis > div:not(.sp-ticks) { display: none; }
  .sp-row { grid-template-columns: minmax(0, 1fr) auto 62px; padding-top: 5px; }
  .sp-spark { display: none; }
  .sp-band { grid-column: 1 / -1; height: 30px; }
  .bar { top: 5px; }
  .bar.ext { top: 9px; }
  .columns { grid-template-columns: minmax(0, 1fr); }
  .col-mid { margin-top: 32px; }
  .col-side { display: block; }
  .col-side section + section { margin-top: 32px; }
  .futures { gap: 0 14px; }
  .fut svg { height: 38px; }
}
@media (prefers-reduced-motion: no-preference) {
  .bar.live { animation: glow 3.6s ease-in-out infinite; }
  @keyframes glow { 50% { box-shadow: 0 0 10px 1px rgba(255, 181, 71, .55); } }
}
@media (forced-colors: active) {
  .bar { border: 1px solid CanvasText; }
  .now-line { background: Highlight; }
}
