:root {
  --bg: #080C12;
  --panel: #0E1520;
  --panel-2: #121B28;
  --line: #1F2B3A;
  --text: #E8EEF5;
  --dim: #8FA0B3;
  --faint: #7A8BA0; /* >= 4.5:1 on the panel colour */
  --accent: #4FA3FF;
  --up: #2FD08A;
  --down: #FF6470;
  --warn: #F2B544;
  --band80: rgba(79, 163, 255, 0.14);
  --band50: rgba(79, 163, 255, 0.30);
  --radius: 12px;
  --font: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.num, td, .big, .tile .v { font-variant-numeric: tabular-nums; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(8, 12, 18, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.wordmark { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
.wordmark:hover { text-decoration: none; }
.logo { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1 1 auto; }
nav a { color: var(--dim); padding: 6px 10px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.updated { margin-left: auto; color: var(--faint); font-size: 13px; white-space: nowrap; }

/* Panels */
main.wrap { padding-top: 24px; padding-bottom: 40px; } /* .wrap's padding shorthand otherwise wins */
main > *, .panel > * { min-width: 0; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
h1, h2, h3 { margin: 0 0 6px; letter-spacing: -0.015em; }
h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; margin-top: 24px; }
.sub { color: var(--dim); margin: 0 0 16px; font-size: 14px; max-width: 820px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.notice { background: rgba(255, 100, 112, 0.1); border: 1px solid var(--down); color: var(--text); padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }

/* Tabs */
.tabs { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tabs button {
  font: inherit; font-weight: 600; font-size: 14px;
  background: none; border: 0; color: var(--dim);
  padding: 7px 16px; border-radius: 7px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

/* Hero */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; margin-top: 8px; }
.quote { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.quote .big { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.quote .name { color: var(--dim); font-size: 14px; }
.chg.up { color: var(--up); }
.chg.down { color: var(--down); }
.chip { font-size: 12px; color: var(--dim); background: var(--panel-2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; }

.chart { margin: 0; position: relative; }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--dim); font-size: 13px; font-family: var(--font); }
.chart .price { fill: none; stroke: var(--text); stroke-width: 1.6; }
.chart .b80 { fill: var(--band80); }
.chart .b50 { fill: var(--band50); }
.chart .med { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-dasharray: 5 4; }
.chart .now { stroke: var(--faint); stroke-dasharray: 2 3; }
.chart .hover-line { stroke: var(--dim); stroke-width: 1; }
.tip {
  position: absolute; pointer-events: none;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 12px; line-height: 1.5; white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.tip b { display: block; color: var(--dim); font-weight: 500; }

.legend { display: flex; gap: 18px; flex-wrap: wrap; color: var(--dim); font-size: 12px; margin-top: 8px; }
.sw { display: inline-block; width: 14px; height: 10px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.sw-line { height: 2px; background: var(--text); }
.sw-80 { background: var(--band80); }
.sw-50 { background: var(--band50); }
.sw-med { height: 0; border-top: 2px dashed var(--accent); }

.horizons { display: flex; flex-direction: column; gap: 12px; }
.hcard { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.hcard .label { color: var(--dim); font-size: 13px; display: flex; justify-content: space-between; }
.hcard .prob { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0; }
.hcard .meter { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin: 6px 0 10px; position: relative; }
.hcard .meter span { position: absolute; top: 0; bottom: 0; left: 0; background: var(--accent); border-radius: 3px; }
.hcard .meter i { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--warn); }
.hcard dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-size: 13px; }
.hcard dt { color: var(--dim); }
.hcard dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.drivers { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 20px; }
.driver { display: grid; grid-template-columns: 230px 1fr 70px; align-items: center; gap: 12px; padding: 5px 0; font-size: 14px; }
.driver .bar { position: relative; height: 10px; }
.driver .bar::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.driver .bar span { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.driver .bar span.pos { left: 50%; background: var(--up); }
.driver .bar span.neg { right: 50%; background: var(--down); }
.driver .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--dim); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--dim); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
.good { color: var(--up); }
.bad { color: var(--down); }
.muted { color: var(--faint); }
.verdict { background: var(--panel-2); border-left: 3px solid var(--warn); padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }

/* Gamma */
.gex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.gex-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.gex-card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.gex-card header strong { font-size: 16px; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.badge.positive { background: rgba(47, 208, 138, 0.14); color: var(--up); }
.badge.negative { background: rgba(255, 100, 112, 0.14); color: var(--down); }
.gex-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.gex-stats div { font-size: 12px; color: var(--dim); }
.gex-stats b { display: block; color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.gex-card svg { width: 100%; height: auto; display: block; }
.gex-card .pos { fill: var(--up); }
.gex-card .neg { fill: var(--down); }
.gex-card .spot { stroke: var(--text); stroke-dasharray: 3 3; }
.gex-card .flip { stroke: var(--warn); stroke-dasharray: 3 3; }
.gex-card .axis { fill: var(--dim); font-size: 12px; font-family: var(--font); }

/* Macro */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tile { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.tile .k { color: var(--dim); font-size: 12px; }
.tile .v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.tile .d { font-size: 12px; color: var(--faint); }
.cycle { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cyc { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.cyc.current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cyc .k { color: var(--dim); font-size: 12px; }
.cyc .v { font-size: 20px; font-weight: 700; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin-top: 8px; align-items: end; height: 130px; }
.months b { font-weight: 500; font-size: 10px; color: var(--dim); margin-bottom: 2px; }
.cycle + .sub { margin-top: 16px; }
.months div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 10px; color: var(--faint); }
.months span { width: 70%; border-radius: 2px 2px 0 0; min-height: 1px; }
.months .up { background: var(--up); }
.months .down { background: var(--down); }
.months .now span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* News */
.news { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
.news li { break-inside: avoid; padding: 10px 0; border-bottom: 1px solid var(--line); }
.news .meta { color: var(--faint); font-size: 12px; }
.news a { color: var(--text); }
.news a:hover { color: var(--accent); }

/* Method */
.method p { color: var(--dim); max-width: 880px; font-size: 14px; }
.method strong { color: var(--text); }
.disclaimer { border-top: 1px solid var(--line); padding-top: 12px; }
.sources { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sources li { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--dim); }
.sources li.fail { border-color: var(--down); color: var(--down); }

.site-footer { color: var(--faint); font-size: 12px; padding: 20px 0 40px; border-top: 1px solid var(--line); }
.empty { color: var(--faint); font-size: 14px; padding: 12px 0; }
.hl { font-weight: 600; }
.hcard .note { font-size: 12px; color: var(--dim); margin: -4px 0 8px; }
.hcard .range-pct { display: block; font-size: 12px; color: var(--dim); }
.hcard .extra { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.chart .event { fill: var(--warn); }
.chart .whisker { stroke-width: 2; stroke-opacity: 0.6; }
.chart .hit { stroke: var(--up); fill: var(--up); }
.chart .miss { stroke: var(--down); fill: var(--down); }
.chart .event-label { fill: var(--warn); font-size: 11px; font-family: var(--font); }
.updated-inline { display: none; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.glance .g { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.glance .k { color: var(--dim); font-size: 12px; }
.glance .v { font-size: 17px; font-weight: 700; margin: 2px 0; overflow-wrap: anywhere; }
.glance .d { color: var(--faint); font-size: 12px; }
.calib { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 8px; }
.calib figure { margin: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.calib figcaption { font-size: 13px; color: var(--dim); margin-bottom: 6px; }
.calib svg { width: 100%; height: auto; display: block; }
.calib .diag { stroke: var(--faint); stroke-dasharray: 4 4; }
.calib .frame { fill: none; stroke: var(--line); }
.calib .pt { fill: var(--accent); fill-opacity: 0.75; }
.calib .axis { fill: var(--dim); font-size: 9px; font-family: var(--font); }

@media (max-width: 980px) {
  nav { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); padding-right: 32px; }
  .hero-grid, .gex-grid { grid-template-columns: minmax(0, 1fr); }
  .horizons { display: grid; grid-template-columns: repeat(3, 1fr); }
  .cycle { grid-template-columns: repeat(2, 1fr); }
  .updated { display: none; }
  .updated-inline { display: block; }
}
@media (max-width: 640px) {
  .wrap, main { padding-left: 16px; padding-right: 16px; }
  .panel { padding: 18px 16px; }
  .header-inner { gap: 12px; }
  .horizons { grid-template-columns: 1fr; }
  .driver { grid-template-columns: 1fr 1fr 56px; font-size: 13px; }
  .gex-stats { grid-template-columns: repeat(2, 1fr); }
  .news { columns: 1; }
  .quote .big { font-size: 28px; }
  .chart .axis { font-size: 17px; } /* compact 520-wide chart on phones */
  .chart .event-label { font-size: 15px; }
  .gex-card .axis { font-size: 20px; } /* the SVG scales down ~2.5x at phone width */
}
