/* Runnista's dashboard (web/dash/index.html): dark like the feed, numbers first. */
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-display: swap; src: url(/fonts/barlow-condensed-800.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: italic; font-weight: 800; font-display: swap; src: url(/fonts/barlow-condensed-800-italic.woff2) format('woff2'); }

:root {
  --bg: #000;
  --panel: #121215;
  --surface: #1c1c1f;
  --surface-2: #2a2a2e;
  --line: rgb(255 255 255 / .1);
  --text: #f5f5f4;
  --muted: #a1a1a8;
  --soft: #c8c8ce;
  --accent: #7c9fff;
  --up: #5ee3a1;
  --down: #ff7a6e;
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding: calc(12px + env(safe-area-inset-top)) 20px 12px; background: rgb(0 0 0 / .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.wordmark { font: italic 800 26px/1 var(--display); text-decoration: none; margin-right: auto; }
.wordmark span { font-style: normal; color: var(--muted); font-size: 18px; letter-spacing: .04em; text-transform: uppercase; margin-left: 4px; }
.range { display: flex; padding: 3px; border-radius: 999px; background: var(--surface); }
.range button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); }
.range button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.live { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--soft); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 4px rgb(94 227 161 / .18); }
.who { font-size: 13px; color: var(--muted); }
.link { border: 0; background: none; padding: 0; color: var(--soft); text-decoration: underline; text-underline-offset: 3px; }

main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; display: grid; gap: 18px; }
.state { padding: 60px 0; text-align: center; color: var(--muted); }
.state h1 { font: 800 34px/1 var(--display); color: var(--text); margin-bottom: 10px; }
.signin { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.signin input { width: min(320px, 100%); height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.btn { height: 44px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--text); color: #000; font-weight: 700; }
.demo { justify-self: start; padding: 4px 10px; border-radius: 999px; background: #3a2f12; color: #ffd27a; font-size: 13px; font-weight: 600; }

/* ---------- Cards ---------- */
.card { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; min-width: 0; }
.card h2 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.card h2 small { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; }

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.tile .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile .value { font: 800 40px/1.05 var(--display); margin: 4px 0 2px; }
.tile .note { font-size: 13px; color: var(--muted); }
.delta { font-weight: 700; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }

/* Time charts: the SVG draws the marks only, stretched to the box; labels are HTML so they stay sharp */
.chart { position: relative; height: 190px; border-bottom: 1px solid var(--line); }
.chart.short { height: 120px; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .area { fill: color-mix(in oklab, var(--accent) 16%, transparent); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .bar { fill: var(--accent); }
.chart .y { position: absolute; right: 100%; transform: translate(-6px, -50%); font-size: 12px; color: var(--muted); white-space: nowrap; }
.chart-box { position: relative; margin-left: 34px; }
.x-axis { position: relative; height: 18px; margin: 6px 0 0 34px; }
.x-axis span { position: absolute; top: 0; transform: translateX(var(--shift, -50%)); font-size: 12px; color: var(--soft); font-weight: 600; white-space: nowrap; }
.hover-rule { position: absolute; top: 0; bottom: 0; width: 1px; background: rgb(255 255 255 / .35); pointer-events: none; }
.hover-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--accent); transform: translate(-50%, -50%); pointer-events: none; }
.tip {
  position: absolute; top: -6px; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 8px; pointer-events: none;
  background: var(--surface-2); font-size: 13px; white-space: nowrap; box-shadow: 0 6px 20px rgb(0 0 0 / .4); z-index: 2;
}
.tip b { font-weight: 700; }

/* Ranked lists with a bar */
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rank li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 6px 0; }
.rank .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rank .num { font-weight: 700; text-align: right; }
.rank .num small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.rank .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface); overflow: hidden; }
.rank .bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.empty { color: var(--muted); font-size: 14px; }

/* Countries: a table, three measures */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: right; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 0 8px 12px; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
td { padding: 7px 0 7px 12px; border-top: 1px solid var(--line); text-align: right; font-weight: 600; }
td:first-child { font-weight: 600; }
td .flag { margin-right: 8px; }
td.share { width: 34%; }
td.share .bar { height: 6px; border-radius: 3px; background: var(--surface); }
td.share .bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }

.part { font: 800 26px/1 var(--display); margin: 14px 0 -4px; }
.note { margin-top: 10px; font-size: 13px; color: var(--muted); }
.verdict { margin-top: 12px; font-size: 15px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--soft); margin: -4px 0 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .key { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.legend .key.soft, .chart .bar.soft { background: color-mix(in oklab, var(--accent) 38%, var(--panel)); fill: color-mix(in oklab, var(--accent) 38%, var(--panel)); }
tr.base td { color: var(--muted); }
td.low { color: var(--down); }
.card table { font-variant-numeric: tabular-nums; }
.pick {
  display: block; margin: -4px 0 12px; height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: 600 13px system-ui, sans-serif; text-transform: none; letter-spacing: 0;
}
.foot { color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 640px) {
  .top { padding-left: 16px; padding-right: 16px; }
  main { padding: 16px 16px 48px; }
  .tile .value { font-size: 34px; }
  td.share { display: none; }
}
