:root {
  color-scheme: dark;
  --bg: #171717;
  --panel: #1d1d1d;
  --panel-2: #222;
  --border: #343434;
  --grid: #303030;
  --text: #f0f0f0;
  --muted: #a3a3a3;
  --quiet: #737373;
  --price: #8ec5ff;
  --bvps: #ff914d;
  --green: #7bd88f;
  --red: #ff7373;
  --blue: #78a6d8;
  --orange: #cf834d;
  --pink: #e98abd;
  --focus: #d7eeff;
  --radius: 14px;
  --shadow: 0 16px 40px rgb(0 0 0 / 18%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
a { color: var(--price); }

.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 10px 14px; color: #111; background: var(--focus); border-radius: 8px; }
.skip-link:focus { top: 12px; }

.topbar { max-width: 1540px; margin: 0 auto; padding: 28px 28px 18px; display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; }
.eyebrow { margin: 0 0 5px; color: var(--bvps); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(26px, 4vw, 44px); line-height: 1.04; letter-spacing: -.035em; }
.subtitle { margin: 9px 0 0; color: var(--muted); }
.source-state { display: flex; align-items: center; gap: 11px; min-width: 260px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.source-state div { display: grid; gap: 3px; }
.source-state strong { font-size: 14px; }
.source-state span:last-child { color: var(--muted); font-size: 12px; }
.status-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; box-shadow: 0 0 0 4px rgb(255 255 255 / 5%); }
.status-dot.open { background: var(--green); } .status-dot.closed { background: var(--quiet); } .status-dot.stale { background: #ffc267; } .status-dot.unknown { background: var(--pink); }

.page-shell { max-width: 1540px; margin: 0 auto; padding: 0 28px 56px; }
.toolbar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; margin: 0 -8px 20px; padding: 12px 8px; background: rgb(23 23 23 / 92%); backdrop-filter: blur(14px); border-bottom: 1px solid transparent; }
.toolbar label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
input[type="date"], select { min-height: 36px; padding: 7px 10px; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.segmented { display: flex; padding: 3px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.segmented button { min-width: 44px; padding: 7px 9px; border: 0; color: var(--muted); background: transparent; border-radius: 7px; cursor: pointer; }
.segmented button:hover { color: var(--text); } .segmented button.active { color: #111; background: var(--price); font-weight: 750; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 7px 13px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; cursor: pointer; }
.button.primary { color: #111; background: var(--bvps); border-color: var(--bvps); font-weight: 750; }
.button.secondary { color: var(--text); background: var(--panel); }
.button:hover { filter: brightness(1.1); }
.switch { grid-template-columns: 32px auto !important; align-items: center; gap: 7px !important; min-height: 36px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { position: relative; width: 32px; height: 18px; background: #3b3b3b; border-radius: 999px; transition: .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 12px; height: 12px; background: #aaa; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: #496e91; } .switch input:checked + span::after { transform: translateX(14px); background: var(--price); }

.alert { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #7e512f; border-radius: 10px; color: #ffd7b8; background: #2b211b; }
.alert.hidden { display: none; }
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(160px, 1fr)); gap: 10px; }
.kpi { min-height: 112px; padding: 15px; display: flex; flex-direction: column; justify-content: space-between; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.kpi.featured { background: linear-gradient(145deg, #202a31, #1d1d1d 65%); border-color: #365064; }
.kpi.model { background: linear-gradient(145deg, #29231e, #1d1d1d 70%); }
.kpi > span { color: var(--muted); font-size: 12px; }
.kpi strong { margin: 7px 0 3px; font-size: clamp(20px, 2.1vw, 29px); letter-spacing: -.025em; }
.kpi small { min-height: 16px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.positive { color: var(--green) !important; } .negative { color: var(--red) !important; }

.method-strip { margin-top: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; background: var(--border); border: 1px solid var(--border); border-radius: 12px; }
.method-strip div { display: grid; gap: 6px; padding: 13px 15px; background: var(--panel); }
.method-strip span { color: var(--muted); font-size: 11px; }.method-strip strong { font-size: 13px; }
.forecast-notice { margin: 12px 0 20px; padding: 12px 14px; color: #d7d7d7; background: #24211c; border-left: 3px solid var(--bvps); border-radius: 6px; font-size: 12px; line-height: 1.55; }

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.chart-card, .table-card { margin-top: 12px; overflow: hidden; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.chart-card > header, .table-card > header { min-height: 66px; padding: 14px 17px 8px; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.chart-card h2, .table-card h2 { margin: 0; font-size: 15px; }.chart-card header p, .table-card header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.chart { width: 100%; height: 350px; }.chart.xl { height: 510px; }.chart.tall { height: 430px; }
.chip { padding: 5px 8px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; font-size: 11px; white-space: nowrap; }
.legend { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 11px; }.legend i { width: 18px; height: 2px; margin-left: 6px; }.legend .price { background: var(--price); }.legend .bvps { background: var(--bvps); }
.warning-list { padding: 0 17px 14px; color: #d5b99f; font-size: 11px; line-height: 1.5; }.warning-list p { margin: 5px 0; }

.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 12px; }
th, td { padding: 10px 13px; border-top: 1px solid var(--grid); text-align: right; white-space: nowrap; }
th { position: sticky; top: 0; color: var(--muted); background: var(--panel); font-weight: 600; }
th:first-child, td:first-child, th:last-child, td:last-child { text-align: left; }
tbody tr:hover { background: #232323; }
.status-pill { padding: 3px 6px; border-radius: 999px; color: var(--muted); background: #2b2b2b; font-size: 10px; }
.status-pill.forecast { color: #bde9c6; background: #203326; }.status-pill.interpolated { color: #bed8ef; background: #22303b; }

footer { max-width: 1540px; margin: 0 auto; padding: 22px 28px 34px; display: flex; gap: 22px; color: var(--quiet); border-top: 1px solid var(--border); font-size: 11px; }
footer a { margin-left: auto; color: var(--muted); }

@media (max-width: 1250px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .toolbar { position: static; }
}
@media (max-width: 800px) {
  .topbar { align-items: stretch; flex-direction: column; padding: 20px 14px 14px; }
  .source-state { min-width: 0; }
  .page-shell { padding: 0 12px 36px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method-strip { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .chart, .chart.tall { height: 330px; }.chart.xl { height: 410px; }
  .toolbar { margin-inline: 0; }.toolbar > * { flex-grow: 1; }
  footer { margin: 0 12px; padding-inline: 0; flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .kpi-grid, .method-strip { grid-template-columns: 1fr; }
  .kpi { min-height: 96px; }
  .segmented { width: 100%; overflow-x: auto; }.segmented button { flex: 1 0 44px; }
  .chart-card > header { flex-direction: column; }
  .chart, .chart.tall { height: 300px; }.chart.xl { height: 360px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
