:root {
  --bg: #000;
  --panel: #111;
  --btn: #1c1c1c;
  --line: #1e1e1e;
  --line-2: #2c2c2c;
  --ink: #fff;
  --ink-2: #b4b4b4;
  --ink-3: #6e6e6e;
  --up: #6fe3a0;
  --down: #ff7a6b;
  --font: 'Poppins', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
i { font-style: normal; }

/* ---------- top bar ---------- */
.top { display: flex; justify-content: space-between; align-items: center; padding: 22px 40px; max-width: 1360px; margin: 0 auto; }
.logo img { height: 44px; display: block; }
.logo b { font: 800 22px/1 var(--font); letter-spacing: .02em; }
.top-right { display: flex; align-items: center; gap: 22px; }
.tagline { font: 300 12px/1 var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.tagline i { margin: 0 6px; color: var(--ink); }
.sync {
  display: inline-flex; align-items: center; gap: 8px; background: var(--btn); border-radius: 5px;
  padding: 9px 14px; font: 500 12px/1 var(--font);
}
.sync::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--up); }
.sync.stale::before { background: var(--down); }
.demo {
  max-width: 1280px; margin: 0 auto; padding: 10px 14px; border-radius: 5px; background: var(--ink); color: var(--bg);
  font: 400 13px/1.4 var(--font);
}
.demo b { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-right: 8px; }

main { max-width: 1360px; margin: 0 auto; padding: 28px 40px 72px; }

/* ---------- filters: MO4 buttons (white = on, charcoal = off) ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 26px; }
.seg { display: inline-flex; gap: 4px; }
.seg button {
  background: var(--btn); border: 0; border-radius: 5px; padding: 10px 16px; cursor: pointer;
  font: 500 13px/1 var(--font); color: var(--ink); transition: background .15s, color .15s;
}
.seg button:hover { background: #2a2a2a; }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--bg); }
.seg.small button { padding: 8px 12px; font-size: 12px; }
.custom { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); }
input[type=date], select, input[type=search] {
  background: var(--btn); border: 0; border-radius: 5px; padding: 0 14px; height: 33px;
  font: 500 13px/1 var(--font); color-scheme: dark; outline: none;
}
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
select { padding-right: 34px; appearance: none; cursor: pointer;
  background: var(--btn) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Cpath d='M5 0v10M0 5h10' stroke='%23fff' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center; }

/* ---------- hero: one giant number + four supporting ---------- */
.hero {
  position: relative; display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  border: 1px solid var(--line); margin-bottom: 56px;
}
.plus { position: absolute; width: 18px; height: 18px; z-index: 1; }
.plus::before, .plus::after { content: ''; position: absolute; background: var(--ink); }
.plus::before { left: 8px; top: 0; width: 2px; height: 18px; }
.plus::after { top: 8px; left: 0; height: 2px; width: 18px; }
.plus.tl { top: -9px; left: -9px; } .plus.tr { top: -9px; right: -9px; }
.plus.bl { bottom: -9px; left: -9px; } .plus.br { bottom: -9px; right: -9px; }

.hero-main { padding: 34px 38px 30px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.label { font: 300 12px/1 var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); }
.label i { color: var(--ink); margin: 0 6px; }
.giant { font: 800 clamp(96px, 13vw, 184px)/.9 var(--font); letter-spacing: -.045em; margin: 22px 0 18px -6px; white-space: nowrap; }
.unit {
  font-style: italic; color: transparent; -webkit-text-stroke: 2px var(--ink);
  margin-left: .02em; letter-spacing: -.02em;
}
.giant .unit { -webkit-text-stroke-width: 3px; }
.hero-foot { margin-top: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font: 400 13px/1.4 var(--font); color: var(--ink-2); }

.hero-grid { display: grid; grid-template-columns: 1fr 1fr; }
.kpi { padding: 28px 30px 24px; display: flex; flex-direction: column; }
.kpi:nth-child(odd) { border-right: 1px solid var(--line); }
.kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.kpi .value { font: 700 clamp(40px, 4.4vw, 60px)/1 var(--font); letter-spacing: -.035em; margin: 18px 0 14px; white-space: nowrap; }
.kpi .value .unit { -webkit-text-stroke-width: 1.6px; }
.kpi .sub { margin-top: auto; font-size: 12px; color: var(--ink-3); }

.delta { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--font); color: var(--ink-3); }
.delta.up { color: var(--up); } .delta.down { color: var(--down); }
.pill { background: var(--btn); border-radius: 5px; padding: 6px 9px; }
.up { color: var(--up); } .down { color: var(--down); }

/* ---------- panels ---------- */
.panel { margin-bottom: 64px; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
h2 { margin: 0; font: 700 34px/1 var(--font); letter-spacing: -.02em; }
.count { font-weight: 300; color: var(--ink-3); margin-left: 4px; }
.hint { font: 300 12px/1 var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
input[type=search] { width: 280px; font-weight: 400; }
input[type=search]::placeholder { color: var(--ink-3); }

/* ---------- chart ---------- */
.chart { height: 260px; position: relative; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart .axis text { fill: var(--ink-3); font: 400 11px var(--font); }
.chart .bar { fill: var(--ink); transition: opacity .12s; }
.chart.hovering .bar { opacity: .22; }
.chart.hovering .bar.on { opacity: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }

/* ---------- tables ---------- */
.scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th {
  text-align: right; font: 300 11px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
  padding: 0 14px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; user-select: none;
}
.table th:first-child, .table td:first-child { text-align: left; padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table th.sortable { cursor: pointer; }
.table th.sortable:hover, .table th.sorted { color: var(--ink); }
.table th.sorted::after { content: ' ↓'; }
.table th.sorted.asc::after { content: ' ↑'; }
.table td { text-align: right; padding: 14px; border-bottom: 1px solid var(--line); font: 500 14px/1.3 var(--font); white-space: nowrap; }
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr:hover td { background: var(--panel); }
.table td.muted, .muted { color: var(--ink-3); font-weight: 400; }

.pubname { display: flex; align-items: center; gap: 14px; height: 34px; }
.pubname img { height: 30px; max-width: 120px; object-fit: contain; object-position: left center; display: block; }
.pubname b { font: 700 15px/1 var(--font); }
.pubname .tag { font: 300 11px/1 var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.active-row td { background: var(--panel); }
.active-row td:first-child { box-shadow: inset 3px 0 0 var(--ink); padding-left: 14px; }

.share { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.share .track { width: 110px; height: 6px; background: var(--btn); border-radius: 3px; overflow: hidden; }
.share i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }

.post { display: flex; gap: 14px; align-items: center; white-space: normal; min-width: 360px; }
.thumb {
  width: 48px; height: 48px; flex: none; border-radius: 5px; background: var(--btn); object-fit: cover;
  display: grid; place-items: center; font: 700 11px var(--font); color: var(--ink-3);
}
.post .cap { font: 500 14px/1.35 var(--font); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.post .sub { font: 400 12px/1.3 var(--font); color: var(--ink-3); margin-top: 4px; }
.ext {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 5px; background: var(--btn);
  color: var(--ink); text-decoration: none; font-weight: 500;
}
.ext:hover { background: var(--ink); color: var(--bg); }

.more {
  display: flex; align-items: center; gap: 10px; margin: 24px auto 0; background: var(--ink); color: var(--bg);
  border: 0; border-radius: 5px; padding: 12px 22px; cursor: pointer; font: 600 13px/1 var(--font);
}
.more i { font-size: 18px; font-weight: 400; line-height: 0; }
.empty { padding: 48px 0; text-align: center !important; color: var(--ink-3); font-weight: 400 !important; }

.foot { color: var(--ink-3); font: 300 12px/1.7 var(--font); max-width: 820px; }

/* ---------- tooltip ---------- */
.tip {
  position: fixed; pointer-events: none; z-index: 10; background: var(--ink); color: var(--bg); border-radius: 5px;
  padding: 12px 14px; font: 400 12px/1.6 var(--font); min-width: 170px;
}
.tip b { font-weight: 700; display: block; margin-bottom: 4px; }
.tip .row { display: flex; justify-content: space-between; gap: 18px; }
.tip .row span:last-child { font-weight: 600; }

.loading .hero, .loading .chart, .loading .table { opacity: .45; transition: opacity .2s; }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .hero-main { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .top { padding: 18px 20px; }
  .logo img { height: 34px; }
  .tagline { display: none; }
  .demo { margin: 0 20px; max-width: none; }
  main { padding: 22px 20px 56px; }
  .hero-main { padding: 26px 22px 22px; }
  .giant { font-size: 92px; }
  .kpi { padding: 22px 20px 18px; }
  h2 { font-size: 26px; }
  .panel-head { flex-wrap: wrap; align-items: center; }
  input[type=search] { width: 100%; }
}
