/* Author: Simon-Pierre Boucher */
/* Mail: contact@spboucher.ai */
/* Design tokens from the validated dataviz reference palette */
:root {
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb;
  --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781;
  --grid: #e1e0d9; --baseline: #c3c2b7; --ring: rgba(11,11,11,.10);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --seq-150: #b7d3f6;
  --good-text: #006300; --bad: #d03b3b; --div-neg: #e34948;
  --shadow: 0 1px 3px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19;
    --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --baseline: #383835; --ring: rgba(255,255,255,.10);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --seq-150: #184f95;
    --good-text: #0ca30c; --bad: #e66767; --div-neg: #e66767;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--s1); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- top nav ---- */
.topnav { position: sticky; top: 0; z-index: 20; background: var(--surface);
  border-bottom: 1px solid var(--ring); padding: 0 20px;
  display: flex; align-items: center; gap: 18px; height: 52px; }
.topnav .logo { font-weight: 700; font-size: 15px; color: var(--ink); white-space: nowrap; }
.topnav .logo span { color: var(--s1); }
.topnav nav { display: flex; gap: 2px; overflow-x: auto; }
.topnav nav a { color: var(--ink-2); padding: 6px 10px; border-radius: 8px;
  font-size: 13px; white-space: nowrap; }
.topnav nav a:hover { background: color-mix(in oklab, var(--s1) 8%, transparent);
  text-decoration: none; }
.topnav nav a.active { color: var(--ink); font-weight: 600;
  background: color-mix(in oklab, var(--s1) 12%, transparent); }
.searchbox { margin-left: auto; display: flex; min-width: 180px; flex: 0 1 340px; }
.searchbox input { width: 100%; background: var(--page); color: var(--ink);
  border: 1px solid var(--ring); border-radius: 8px; padding: 7px 12px; font: inherit; }
.searchbox input:focus { outline: 2px solid var(--s1); outline-offset: -1px; }

/* ---- layout ---- */
main { display: grid; gap: 14px; padding: 16px 20px 40px;
  grid-template-columns: repeat(12, 1fr); max-width: 1320px; margin: 0 auto; }
.card { background: var(--surface); border: 1px solid var(--ring);
  border-radius: 12px; padding: 14px 16px; grid-column: span 12; box-shadow: var(--shadow); }
@media (min-width: 900px) {
  .tile { grid-column: span 3; }
  .half { grid-column: span 6; }
  .third { grid-column: span 4; }
  .twothird { grid-column: span 8; }
}
.card h2 { font-size: 13px; margin: 0 0 10px; color: var(--ink-2); font-weight: 600;
  display: flex; align-items: baseline; gap: 8px; }
.card h2 .sub { color: var(--muted); font-weight: 400; font-size: 12px; }
.tile .big { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.tile .note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tile .delta { font-size: 12px; font-weight: 600; }
.up { color: var(--good-text); } .down { color: var(--bad); }

.pagehead { grid-column: span 12; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pagehead h1 { font-size: 20px; margin: 4px 0; }
.pagehead .sub { color: var(--muted); font-size: 13px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 99px;
  border: 1px solid var(--ring); color: var(--ink-2); }
.badge.native { color: var(--good-text); border-color: color-mix(in oklab, var(--good-text) 40%, transparent); }
.badge.bridged { color: var(--s2); border-color: color-mix(in oklab, var(--s2) 40%, transparent); }
.badge.discontinued { color: var(--bad); border-color: color-mix(in oklab, var(--bad) 40%, transparent); }

/* ---- filters ---- */
.filters { grid-column: span 12; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input, .filters button, .btn {
  background: var(--surface); color: var(--ink); border: 1px solid var(--ring);
  border-radius: 8px; padding: 7px 11px; font: inherit; cursor: pointer; }
.filters input { cursor: text; }
.presets { display: flex; gap: 4px; }
.presets button[aria-pressed="true"] { border-color: var(--s1); font-weight: 600; }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 5px 8px;
  border-bottom: 1px solid var(--grid); position: sticky; top: 0; background: var(--surface); }
td { padding: 5px 8px; border-bottom: 1px solid var(--grid);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:hover td { background: color-mix(in oklab, var(--s1) 5%, transparent); }
td.num, th.num { text-align: right; }
td.mono { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--ink-2);
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.scroll { max-height: 420px; overflow-y: auto; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--s1); margin-right: 6px; }
.mint { color: var(--good-text); font-weight: 600; }
.burn { color: var(--bad); font-weight: 600; }

/* ---- bars (magnitude) ---- */
.bars { display: flex; flex-direction: column; gap: 2px; }
.bar-row { display: grid; grid-template-columns: 100px 1fr 96px; align-items: center;
  gap: 8px; padding: 3px 4px; border-radius: 6px; min-height: 22px; }
.bar-row:hover { background: color-mix(in oklab, var(--s1) 8%, transparent); }
.bar-label { color: var(--ink-2); font-size: 12.5px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.bar-label a { color: inherit; }
.bar-track { height: 12px; border-radius: 0 4px 4px 0;
  border-left: 2px solid var(--baseline); position: relative; }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--s1);
  border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; }

/* ---- charts ---- */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 12px;
  color: var(--ink-2); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 5px; vertical-align: -1px; }
#tooltip { position: fixed; pointer-events: none; background: var(--surface);
  border: 1px solid var(--ring); border-radius: 8px; padding: 7px 10px;
  font-size: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.18); display: none; z-index: 30;
  font-variant-numeric: tabular-nums; }
#tooltip b { display: block; margin-bottom: 2px; }
.empty { color: var(--muted); font-size: 12.5px; padding: 12px 0; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 0 0 28px; }
