/* Meta Viewer styles. Ladderline Software brand (logo-style) + Ladderline app look (app v12.62.3 tokens).
   Every colour, size and radius is a token below; components only use tokens. */

/* ── Fonts (self-hosted) ─────────────────────────────────────────────────── */
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2'); }

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  /* Ground and surfaces */
  --ground: #0d1017;
  --surface: #151920;
  --surface-2: #1c212b;
  --line: #232833;
  --line-strong: #646b78;
  /* Text */
  --ink: #eceef2;
  --wordmark: #e6e8ec;
  --muted: #9aa1ae;
  --faint: #6b7280;
  /* Brand */
  --gold: #e8c36a;
  --gold-hover: #f0d48f;
  --on-gold: #1a1406;
  --gold-bg: #2c2923;
  /* Status (text on ground, and the tinted backgrounds behind status text) */
  --success: #7ec8a0;
  --success-bg: #1d2a2a;
  --warn: #e8a33d;
  --warn-bg: #2c251c;
  --danger: #e07070;
  --danger-bg: #2b1d23;
  --info: #6ab0d8;
  /* Charts: win-rate bars (step down in lightness: L* 80 / 62 / 48 / 34) */
  --chart-high: #e8c36a;
  --chart-mid: #8f97a5;
  --chart-low: #b85547;
  --chart-none: #4a505c;
  --chart-track: #1c212b;
  --chart-band: rgba(255, 255, 255, 0.06);
  --chart-midline: #6b7280;
  /* Charts: trend lines (L* 94 / 80 / 69 / 56 / 45), always labelled and dashed differently */
  --series-1: #eceef2;
  --series-2: #e8c36a;
  --series-3: #6ab0d8;
  --series-4: #c46a8a;
  --series-5: #26786a;
  /* Charts: matchup cells (gold = won more, blue = lost more; ink text passes 4.5:1 on every level) */
  --mx-win-1: #272521;
  --mx-win-2: #423b2b;
  --mx-win-3: #655838;
  --mx-loss-1: #162330;
  --mx-loss-2: #1f364a;
  --mx-loss-3: #2c4f6b;
  --mx-even: #1c212b;
  --mx-none: #13161d;
  /* Type */
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  /* Radius */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  /* Shadows */
  --shadow-card: 0 12px 40px rgba(0, 0, 0, .35);
  --shadow-dialog: 0 16px 48px rgba(0, 0, 0, 0.55);
  /* Sizes */
  --tap: 44px;
  --control: 48px;
  --mark: 36px;
  color-scheme: dark;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font: 400 15px/1.5 var(--sans); }
body { min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: var(--gold); }
a:hover { color: var(--gold-hover); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--space-5); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.sub { color: var(--muted); }

/* ── Text styles ─────────────────────────────────────────────────────────── */
.th, .label { font: 600 12px/1.3 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
h1.title { margin: 0; font: 700 30px/1.15 var(--sans); letter-spacing: -0.01em; }
h2.section { margin: 0; font: 700 22px/1.2 var(--sans); letter-spacing: -0.01em; }
.figure { font: 700 26px/1.1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.foot-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 75ch; }

/* ── Header and nav (lockup: 36px mark, 12px gap, 22px wordmark) ─────────── */
.hdr { border-bottom: 1px solid var(--line); background: var(--ground); }
.hdr .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-5); min-height: 64px; }
.brand { display: flex; align-items: center; gap: var(--space-3); padding: 14px 0; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark { width: var(--mark); height: var(--mark); display: block; flex: 0 0 var(--mark); }
.brand-name { font: 700 22px/28px var(--sans); letter-spacing: -0.01em; color: var(--wordmark); white-space: nowrap; }
.nav { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.nav a { color: var(--muted); text-decoration: none; font: 600 14px/1 var(--sans); padding: 0 var(--space-3); min-height: var(--tap); display: flex; align-items: center; border-radius: var(--radius); }
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--gold); }

/* ── Notices ─────────────────────────────────────────────────────────────── */
.notice { border: 1px solid var(--warn); background: var(--warn-bg); color: var(--ink); padding: 10px 14px; font-size: 14px; border-radius: var(--radius); }
.notice b { color: var(--warn); }
.free-note { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3) var(--space-4); border: 1px solid var(--gold); background: var(--gold-bg); color: var(--ink); padding: var(--space-3) var(--space-4); font-size: 14px; border-radius: var(--radius); margin-bottom: var(--space-4); }
.free-note p { margin: 0; flex: 1 1 260px; }
.free-note b { color: var(--gold); }
.free-note .btn-primary { flex: none; align-self: center; }
.error { border: 1px solid var(--danger); background: var(--danger-bg); color: var(--danger); padding: 12px 14px; border-radius: var(--radius); }

/* ── Scope bar and filters ───────────────────────────────────────────────── */
.scopebar { background: var(--surface); border-bottom: 1px solid var(--line); }
.scopebar .wrap { padding-top: var(--space-3); padding-bottom: var(--space-3); display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .flabel { font-weight: 600; font-size: 14px; }
.scope-field { flex: 999 1 300px; }
.game-field { flex: 1 1 200px; max-width: 280px; }
@media (max-width: 640px) { .game-field { max-width: none; flex-basis: 100%; } }
.scope-btn { height: var(--control); display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); width: 100%; background: var(--ground); border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--ink); font-size: 16px; padding: 0 14px; cursor: pointer; text-align: left; }
.scope-btn:hover { border-color: var(--gold); }
.scope-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; height: var(--control); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px; cursor: pointer; font-weight: 600; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); margin: 0; }
.check.off { color: var(--faint); cursor: not-allowed; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .grow { flex: 999 1 240px; }
.filters .f { flex: 1 1 160px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ── Inputs ──────────────────────────────────────────────────────────────── */
.input, .select { height: var(--control); background: var(--ground); border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--ink); font-size: 16px; padding: 0 12px; width: 100%; }
.input::placeholder { color: var(--faint); }
.input:hover, .select:hover { border-color: var(--muted); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[disabled], .select[disabled] { color: var(--faint); border-color: var(--line); cursor: not-allowed; }
.field-error { color: var(--danger); font-size: 14px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary { min-height: var(--control); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); background: var(--gold); color: var(--on-gold); border: 0; border-radius: var(--radius); font: 700 16px var(--sans); padding: 0 22px; cursor: pointer; text-decoration: none; align-self: flex-start; }
.btn-primary:hover { background: var(--gold-hover); color: var(--on-gold); }
.btn-primary[disabled] { background: var(--surface-2); color: var(--faint); cursor: not-allowed; }
.btn { min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); background: transparent; color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius); font: 600 14px var(--sans); padding: 0 16px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink); background: var(--surface-2); color: var(--ink); }
.btn[disabled] { color: var(--faint); border-color: var(--line); background: transparent; cursor: not-allowed; }
.btn-ghost { border-color: transparent; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.seg { display: flex; padding: 3px; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; max-width: 100%; }
.seg button { flex: 1; min-height: 38px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); font: 600 14px var(--sans); cursor: pointer; padding: 0 12px; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); }
.chip { min-height: 40px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: transparent; color: var(--ink); font: 600 14px var(--sans); padding: 0 16px; cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: var(--space-1); font: 600 12px/1 var(--sans); padding: 5px 8px; border-radius: var(--radius-sm); white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge-pro { background: var(--gold-bg); color: var(--gold); }
.badge-ok { background: var(--success-bg); color: var(--success); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--danger-bg); color: var(--danger); }
.badge-low { background: transparent; color: var(--muted); border: 1px dashed var(--line-strong); }

/* ── Cards and figures ───────────────────────────────────────────────────── */
main.wrap { padding-top: var(--space-5); padding-bottom: 48px; display: flex; flex-direction: column; gap: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); }
.event-card { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4) 28px; }
.figs { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); }
.fig { display: flex; flex-direction: column; }
.fig b { font: 700 26px/1.1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-3); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px var(--space-4); display: flex; flex-direction: column; gap: 2px; }
.tile b { font: 700 26px/1.1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tile small { color: var(--muted); font-size: 13px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3); }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.tbox { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; background: var(--ground); }
.trow { display: grid; grid-template-columns: 32px minmax(150px, 1.5fr) 70px 64px 130px 70px minmax(190px, 1.7fr) 84px 76px; gap: var(--space-3); align-items: center; padding: 11px var(--space-4); border-top: 1px solid var(--line); min-width: 1040px; }
.trow.head { border-top: 0; background: var(--surface); }
.trow:not(.head):hover { background: var(--surface); }
.trow.low { opacity: 0.55; }
.rank { color: var(--muted); font-weight: 600; }
.name { display: flex; flex-direction: column; min-width: 0; }
.name b, .name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name b { font-weight: 600; }
.name small { color: var(--muted); font-size: 13px; }
.hi { color: var(--chart-high); }
.lo { color: var(--danger); }
.zero { color: var(--faint); }
.empty { padding: 28px var(--space-4); color: var(--muted); }
.loading { opacity: 0.6; transition: opacity 0.15s; }

/* ── Chart: win-rate bar ─────────────────────────────────────────────────── */
.wr { display: flex; align-items: center; gap: var(--space-3); }
.wr b { font: 700 16px var(--sans); font-variant-numeric: tabular-nums; width: 56px; text-align: right; flex: 0 0 56px; }
.bar { position: relative; flex: 1; height: 8px; background: var(--chart-track); border-radius: var(--radius-pill); }
.bar .band { position: absolute; top: -4px; bottom: -4px; left: 45%; width: 10%; background: var(--chart-band); border-radius: 2px; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--radius-pill); background: var(--chart-mid); }
.bar .fill.is-high { background: var(--chart-high); }
.bar .fill.is-mid { background: var(--chart-mid); }
.bar .fill.is-low { background: var(--chart-low); }
.bar .fill.is-none { background: var(--chart-none); }
.bar .mid { position: absolute; top: -5px; bottom: -5px; left: 50%; width: 1px; background: var(--chart-midline); }

/* ── Chart: matchup bars (diverging from 50%) and matrix cells ───────────── */
.dv { position: relative; height: 12px; background: var(--chart-track); border-radius: var(--radius-pill); }
.dv .mid { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--chart-midline); }
.dv .fill { position: absolute; top: 0; bottom: 0; }
.dv .fill.is-win { left: 50%; background: var(--chart-high); border-radius: 0 var(--radius-pill) var(--radius-pill) 0; }
.dv .fill.is-loss { right: 50%; background: var(--info); border-radius: var(--radius-pill) 0 0 var(--radius-pill); }
.mx { display: grid; gap: 2px; }
.mx-cell { min-width: 64px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--mx-even); color: var(--ink); font-variant-numeric: tabular-nums; }
.mx-cell b { font: 700 15px/1.1 var(--sans); }
.mx-cell small { font-size: 11px; color: var(--muted); }
.mx-cell[data-level="win-1"] { background: var(--mx-win-1); }
.mx-cell[data-level="win-2"] { background: var(--mx-win-2); }
.mx-cell[data-level="win-3"] { background: var(--mx-win-3); }
.mx-cell[data-level="loss-1"] { background: var(--mx-loss-1); }
.mx-cell[data-level="loss-2"] { background: var(--mx-loss-2); }
.mx-cell[data-level="loss-3"] { background: var(--mx-loss-3); }
.mx-cell[data-level="none"] { background: var(--mx-none); outline: 1px dashed var(--line-strong); outline-offset: -4px; }
.mx-cell[data-level="none"] b { color: var(--muted); }

/* ── Chart: trend lines (SVG) ────────────────────────────────────────────── */
.trend { width: 100%; height: auto; display: block; }
.trend .grid { stroke: var(--line); stroke-width: 1; }
.trend .axis { fill: var(--muted); font: 12px var(--sans); }
.trend .band { fill: var(--chart-band); }
.trend .marker { stroke: var(--warn); stroke-width: 1.5; }
.trend .marker-label { fill: var(--warn); font: 600 12px var(--sans); }
.trend .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.trend .line.s1 { stroke: var(--series-1); }
.trend .line.s2 { stroke: var(--series-2); stroke-width: 3; }
.trend .line.s3 { stroke: var(--series-3); stroke-dasharray: 8 5; }
.trend .line.s4 { stroke: var(--series-4); stroke-dasharray: 2 5; }
.trend .line.s5 { stroke: var(--series-5); stroke-dasharray: 12 4 2 4; }
.trend .series-label { font: 600 13px var(--sans); }
.trend .series-label.s1 { fill: var(--series-1); }
.trend .series-label.s2 { fill: var(--series-2); }
.trend .series-label.s3 { fill: var(--series-3); }
.trend .series-label.s4 { fill: var(--series-4); }
.trend .series-label.s5 { fill: var(--series-5); }

/* ── Upgrade prompt (paywall) ────────────────────────────────────────────── */
.paywall { background: linear-gradient(135deg, var(--surface-2), var(--surface)); border: 1px solid var(--gold); border-radius: var(--radius-lg); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); max-width: 560px; }
.paywall h3 { margin: 0; font: 700 20px/1.25 var(--sans); letter-spacing: -0.01em; }
.paywall p { margin: 0; color: var(--muted); }
.paywall .badge { align-self: flex-start; }
.paywall .actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin-top: var(--space-1); }
.locked { position: relative; }
.locked > .locked-content { filter: blur(4px); opacity: 0.5; pointer-events: none; user-select: none; }
.locked > .paywall { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92%, 520px); box-shadow: var(--shadow-card); }

/* ── Event picker (dialog) ───────────────────────────────────────────────── */
.backdrop { position: fixed; inset: 0; background: rgba(5, 7, 10, 0.75); z-index: 20; display: flex; justify-content: center; align-items: flex-start; padding: var(--space-4); overflow-y: auto; }
.picker { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-dialog); width: 100%; max-width: 880px; display: flex; flex-direction: column; margin-top: 40px; max-height: calc(100vh - 72px); overflow: hidden; }
.picker-head { padding: 14px var(--space-4); display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); border-bottom: 1px solid var(--line); }
.picker-head h2 { margin: 0; font: 700 20px var(--sans); letter-spacing: -0.01em; }
.picker-body { padding: var(--space-4); display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid var(--line); }
.ev-list { overflow-y: auto; min-height: 120px; }
.wk { position: sticky; top: 0; background: var(--surface-2); padding: var(--space-2) var(--space-4); display: flex; justify-content: space-between; gap: var(--space-3); border-top: 1px solid var(--line); z-index: 1; }
.wk .th:first-child { color: var(--ink); }
.ev { display: grid; grid-template-columns: minmax(0, 1fr) 96px 104px 130px; gap: var(--space-3); align-items: center; width: 100%; min-height: 56px; padding: var(--space-2) var(--space-4); border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); text-align: left; cursor: pointer; }
.ev:hover { background: var(--surface-2); }
.ev[aria-pressed="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--gold); }
.ev[disabled] { cursor: not-allowed; color: var(--muted); }
.ev .n { display: flex; flex-direction: column; min-width: 0; }
.ev .n b, .ev .n small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .n b { font-weight: 600; }
.ev .n small { color: var(--muted); font-size: 13px; }
.tag { justify-self: end; }
.picker-foot { padding: var(--space-3) var(--space-4); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.app-foot { border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }
.app-foot .wrap { padding-top: var(--space-4); padding-bottom: var(--space-5); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); }

/* ── Admin ───────────────────────────────────────────────────────────────── */
/* Sign in, sign up, account */
.auth-main { align-items: center; }
.auth-card { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: var(--space-4); }
.auth-form { display: flex; flex-direction: column; gap: var(--space-4); }
.auth-form .btn-primary, .auth-form .btn { width: 100%; }
.auth-switch { margin: 0; font-size: 15px; }
.hint { color: var(--muted); font-size: 14px; margin: 0; }
.ok-note { border: 1px solid var(--success); background: var(--success-bg); color: var(--ink); padding: 10px 14px; border-radius: var(--radius); font-size: 14px; }
.acct-list { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: 0; }
.acct-list dt { color: var(--muted); font-size: 14px; }
.acct-list dd { margin: 0; overflow-wrap: anywhere; }
.acct-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.acct-actions > * { flex: 1 1 180px; }
.nav .nav-signin { color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); border-radius: var(--radius); }
.nav .nav-signin:hover { color: var(--gold-hover); background: var(--gold-bg); }
.users-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.users-table th, .users-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.users-table th { color: var(--muted); font-weight: 600; }
.users-table td:first-child { white-space: normal; overflow-wrap: anywhere; }
.users-wrap { overflow-x: auto; }
.admin-signin { max-width: 460px; display: flex; flex-direction: column; gap: var(--space-4); }
.admin-card { display: flex; flex-direction: column; gap: 14px; }
.game-pick { max-width: 360px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 0 28px; }
.set-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.set-row .chip-s { flex: none; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.chip-s { display: inline-block; font: 600 12px var(--sans); padding: 4px 8px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip-s.ok { background: var(--success-bg); color: var(--success); }
.chip-s.warn { background: var(--warn-bg); color: var(--warn); }
.chip-s.bad { background: var(--danger-bg); color: var(--danger); }
.test-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) 14px; }
.test-row .btn { min-height: var(--control); }
.test-res { font-size: 14px; color: var(--muted); }
.test-res.ok { color: var(--success); }
.test-res.bad { color: var(--danger); }
table.log { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 820px; }
table.log th { text-align: left; font: 600 12px var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; background: var(--surface); }
table.log td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
table.log .log-detail { color: var(--muted); max-width: 360px; overflow-wrap: anywhere; }
/* Discord preview: imitates Discord's own colours, so it uses Discord's values, not brand tokens. */
.dc-wrap { display: flex; flex-direction: column; gap: 14px; }
.dc-msg { background: #313338; border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: var(--space-2); font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; color: #dbdee1; }
.dc-who { display: flex; gap: var(--space-2); align-items: center; color: #f2f3f5; }
.dc-who img { width: 32px; height: 32px; border-radius: 50%; }
.dc-embed { background: #2b2d31; border-left: 4px solid var(--gold); border-radius: 4px; padding: 10px 14px; display: flex; flex-direction: column; gap: var(--space-2); max-width: 520px; font-size: 14px; }
.dc-title { font-weight: 700; color: #f2f3f5; }
.dc-title a, .dc-text a { color: #00a8fc; text-decoration: none; }
.dc-text code { background: #1e1f22; padding: 0 3px; font-size: 13px; }
.dc-fields { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.dc-field { flex: 1 1 100%; }
.dc-field.inline { flex: 1 1 200px; }
.dc-fname { font-weight: 700; color: #f2f3f5; margin-bottom: 2px; }
.dc-foot { font-size: 12px; color: #b5bac1; }

/* ── Style page ──────────────────────────────────────────────────────────── */
.sg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); }
.sg-swatch { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); font-size: 13px; }
.sg-swatch i { display: block; height: 48px; }
.sg-swatch span { display: block; padding: 6px 10px; }
.sg-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* ── Small screens ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  h1.title { font-size: 26px; }
  .backdrop { padding: 0; }
  .picker { margin-top: 0; max-height: 100vh; min-height: 100vh; border: 0; border-radius: 0; }
  .ev { grid-template-columns: minmax(0, 1fr) auto; }
  .ev .c-players, .ev .c-type { display: none; }
  .check { flex: 1 1 auto; }
}
@media (max-width: 480px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .tile { padding: var(--space-3); }
  .tile b, .fig b { font-size: 22px; }
  .seg { width: 100%; }
  .seg button { padding: 0 6px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── 0.9.0: detail pages, grids, trends, compare ─────────────────────────── */
.subnav { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--line); overflow-x: auto; }
.subnav a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gold); }
.stack { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.detail { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.back { color: var(--gold); text-decoration: none; font-weight: 600; font-size: 14px; align-self: flex-start; }
.back:hover { text-decoration: underline; }
.detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--space-3); }
.detail-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.detail-title .title { display: flex; align-items: center; gap: 10px; margin: 0; }
.detail-title .sub a { color: var(--ink); }
.row-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.row-link:hover { text-decoration-color: var(--gold); color: var(--ink); }
.trow .name .row-link b { overflow: hidden; text-overflow: ellipsis; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: var(--space-4); align-items: start; }
.grid2 > .card { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.split-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 96px 52px minmax(120px, 1.2fr); gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.split-row.head { border-top: 0; padding-top: 0; }
.split-row.low { opacity: 0.55; }
.split-row .row-link { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.pickbar { display: flex; align-items: center; gap: 8px; }
.pick-track { flex: 1; height: 8px; background: var(--chart-track); border-radius: var(--radius-pill); overflow: hidden; }
.pick-track span { display: block; height: 100%; background: var(--chart-mid); border-radius: var(--radius-pill); }
.pickbar .num { width: 36px; }
.wr.compact { gap: 8px; }
.wr.compact b { width: 48px; flex-basis: 48px; font-size: 14px; }
.bar .rng { position: absolute; top: 3px; height: 2px; background: var(--ink); opacity: 0.55; border-radius: 1px; }
.fd { display: inline-block; width: 18px; height: 18px; flex: 0 0 18px; }
.title .fd { width: 26px; height: 26px; flex-basis: 26px; }
.fd-shield { clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%); }
.fd-hex { clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.fd-tri { clip-path: polygon(0 8%, 100% 8%, 50% 100%); }
.fd-diamond { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.fd-circle { border-radius: 50%; }
.callouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--space-3); }
.callout { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.callout b { font-size: 18px; }
.callout small { color: var(--muted); }
.mrow { display: grid; grid-template-columns: minmax(150px, 1.2fr) 64px 96px 96px minmax(200px, 1.6fr); gap: var(--space-3); align-items: center; padding: 10px var(--space-4); border-top: 1px solid var(--line); }
.mrow.head { border-top: 0; background: var(--surface); }
.mrow.low { opacity: 0.5; }
.mrow .name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chart { position: relative; background: var(--ground); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }
.chart svg { display: block; touch-action: pan-y; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis-mid { stroke: var(--line-strong); stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 12px var(--sans); }
.chart .balance { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0.7; }
.chart .balance-label { fill: var(--gold); }
.chart .cross { stroke: var(--line-strong); stroke-width: 1; }
.chart .end-label { fill: var(--ink); font: 600 12px var(--sans); }
.tip { position: absolute; top: 12px; transform: translateX(8px); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; pointer-events: none; max-width: 260px; }
.tip i, .tchip i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.table-view summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.table-view .tbox { margin-top: var(--space-2); max-height: 320px; overflow: auto; }
table.plain { border-collapse: collapse; font-size: 13px; width: 100%; }
table.plain th, table.plain td { padding: 6px 10px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.plain th:first-child, table.plain td:first-child { text-align: left; }
table.plain thead th { background: var(--surface); color: var(--muted); font-weight: 600; position: sticky; top: 0; }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: transparent; color: var(--muted); font: 600 13px var(--sans); cursor: pointer; }
.tchip:hover { color: var(--ink); border-color: var(--line-strong); }
.tchip[aria-pressed="true"] { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); }
.grid-box { overflow: auto; max-height: 78vh; }
table.heat { border-collapse: separate; border-spacing: 2px; font-size: 13px; }
table.heat th, table.heat td { padding: 0; }
table.heat td { width: 38px; min-width: 38px; height: 34px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); background: var(--surface); border-radius: 4px; }
table.heat td.low { color: var(--faint); }
table.heat td.dark-text { color: var(--on-gold); }
table.heat td.self { background: repeating-linear-gradient(135deg, var(--surface) 0 4px, var(--ground) 4px 8px); }
table.heat thead th { position: sticky; top: 0; background: var(--ground); z-index: 1; vertical-align: bottom; }
table.heat .col-h span { writing-mode: vertical-rl; transform: rotate(180deg); display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; color: var(--muted); font-weight: 600; white-space: nowrap; max-height: 170px; overflow: hidden; text-overflow: ellipsis; }
table.heat .row-h { position: sticky; left: 0; background: var(--ground); z-index: 2; text-align: left; padding-right: 10px; white-space: nowrap; font-weight: 600; }
table.heat .row-h a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
table.heat .row-h .fd { margin-right: 6px; vertical-align: -3px; }
table.heat .corner { position: sticky; left: 0; top: 0; z-index: 3; background: var(--ground); }
.compare-pick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); max-width: 640px; }
.compare-pick .field { min-width: 0; }
.cmp-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.cmp-row.head { border-top: 0; padding-top: 0; font-weight: 700; }
.cmp-row .th { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 14px; }
.cmp-row .faint { opacity: 0.5; }
.h2h { display: flex; flex-direction: column; gap: 8px; }
.h2h b { font-size: 18px; }
.h2h small { color: var(--muted); }
.top-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 150px) 64px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.top-row .name { display: flex; flex-direction: column; min-width: 0; }
.top-row .name small { color: var(--muted); font-size: 12px; }
.top-row .disp { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.grid2 .btn { align-self: flex-start; }
@media (max-width: 640px) {
  .hide-s { display: none !important; }
  .mrow { grid-template-columns: minmax(0, 1fr) 46px minmax(120px, 1.2fr); padding: 10px var(--space-3); }
  .split-row { grid-template-columns: 22px minmax(0, 1fr) 72px minmax(96px, 1fr); }
  .split-row > :nth-child(4) { display: none; }
  .top-row { grid-template-columns: 24px minmax(0, 1fr) 24px 56px; }
  .compare-pick { grid-template-columns: 1fr; }
  .detail-head .btn { width: 100%; }
}

.mrow .name { flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; }
.cmp-row .num { justify-self: end; }
.split-row { grid-template-columns: 24px minmax(0, 1fr) 120px 52px minmax(120px, 1.2fr); }
@media (max-width: 640px) { .split-row { grid-template-columns: 22px minmax(0, 1fr) 80px minmax(96px, 1fr); } }
.split-row { grid-template-columns: 24px minmax(100px, 1.3fr) 104px 48px minmax(110px, 1fr); }
@media (max-width: 640px) { .split-row { grid-template-columns: 22px minmax(0, 1fr) 40px minmax(108px, 1fr); } .split-row .pick-track { display: none; } .split-row .pickbar .num { width: auto; } }
.data-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.data-row .seg { flex: 0 1 320px; }
.sub-h { margin: var(--space-2) 0 0; font-size: 15px; }
.import-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; }
.import-row .field { flex: 1 1 200px; min-width: 0; }
.device-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.device-list li { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) 0; border-top: 1px solid var(--line); }
.device-list li:first-child { border-top: 0; }
.danger-zone { border-top: 1px solid var(--line); padding-top: var(--space-4); margin-top: var(--space-2); }
.check-line { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check-line input { width: 20px; height: 20px; accent-color: var(--gold); }
.auth-card > .btn { align-self: flex-start; }
/* The view tabs scroll sideways on small screens only; no scrollbar arrows (Windows showed them). */
.subnav { overflow-y: hidden; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { margin-bottom: 0; }
/* 0.10.2: the matchup grid fits the page width (no inner scrollbars on desktop); phones swipe sideways. */
.grid-box { max-height: none; overflow-y: visible; overflow-x: auto; }
table.heat { width: 100%; table-layout: fixed; }
table.heat .corner { width: 150px; }
table.heat td { width: auto; min-width: 0; height: 30px; font-size: 12px; }
table.heat .row-h { overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
table.heat thead th { position: static; }
table.heat .col-h span { font-size: 12px; max-height: 150px; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 13px; }

/* 0.11.0: chart view and Export PDF */
.seg-small button { min-height: 32px; font-size: 13px; padding: 0 12px; }
.mchart { padding: var(--space-2) var(--space-4) var(--space-3); }
.mc-row { display: grid; grid-template-columns: minmax(110px, 180px) repeat(3, minmax(0, 1fr)); gap: var(--space-3); align-items: center; padding: 4px 0; }
.mc-head { align-items: end; padding: 8px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.mc-sort { background: none; border: 0; color: var(--ink); text-align: left; cursor: pointer; padding: 0; display: flex; flex-direction: column; gap: 2px; font: 600 13px var(--sans); }
.mc-sort small { color: var(--muted); font-weight: 400; font-size: 11px; }
.mc-sort[aria-sort="descending"] > span { color: var(--gold); }
.mc-sort i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.mc-name { justify-content: flex-end; text-align: right; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.mc-cell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mc-track { position: relative; flex: 1; height: 14px; background: var(--chart-track); border-radius: 0 4px 4px 0; min-width: 0; }
.mc-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; }
.mc-ref { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 1px dashed var(--ink); opacity: 0.6; }
.mc-val { font-size: 12px; font-variant-numeric: tabular-nums; width: 44px; flex: 0 0 44px; }
.mc-note { padding: 10px 0 0; }
@media (max-width: 640px) {
  .mc-row { grid-template-columns: 84px repeat(3, minmax(0, 1fr)); gap: 6px; }
  .mc-name { font-size: 12px; }
  .mc-val { width: 34px; flex-basis: 34px; font-size: 11px; }
  .mc-sort { font-size: 12px; } .mc-sort small { display: none; }
  .mchart { padding: var(--space-2) var(--space-3) var(--space-3); }
}
@media (max-width: 640px) {
  .mc-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 8px; padding: 6px 0; border-top: 1px solid var(--line); }
  .mc-head { border-top: 0; }
  .mc-head > span:first-child { display: none; }
  .mc-name { grid-column: 1 / -1; text-align: left; font-size: 13px; }
  .mc-val { width: 38px; flex-basis: 38px; font-size: 11px; }
}
.erow { display: grid; grid-template-columns: minmax(0, 1fr) 70px 80px 60px 90px 60px; gap: var(--space-3); align-items: center; padding: 9px var(--space-4); border-top: 1px solid var(--line); }
.erow.head { border-top: 0; background: var(--surface); }
.erow .name { min-width: 0; }
.ext { color: var(--gold); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.ext:hover { text-decoration: underline; }
@media (max-width: 640px) { .erow { grid-template-columns: minmax(0, 1fr) 44px 44px 50px; padding: 9px var(--space-3); } }
.stack > .btn-small { align-self: flex-start; }
.urow { display: grid; grid-template-columns: minmax(0, 1.4fr) 70px 70px 74px 110px minmax(160px, 1.2fr); gap: var(--space-3); align-items: center; padding: 8px var(--space-4); border-top: 1px solid var(--line); }
.urow.head { border-top: 0; background: var(--surface); }
.urow .name { min-width: 0; }
.urow > .num:nth-child(5) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
@media (max-width: 640px) { .urow { grid-template-columns: minmax(0, 1fr) 46px 46px minmax(96px, 1fr); padding: 8px var(--space-3); } }
.bcp-login { display: flex; flex-direction: column; gap: var(--space-3); }
.login-form { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; }
.login-form .field { flex: 1 1 220px; min-width: 0; }

/* 0.13.0: sortable headings */
.sort-btn { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; text-align: inherit; width: 100%; display: inline-flex; align-items: center; gap: 2px; justify-content: inherit; min-height: 24px; }
.num .sort-btn { justify-content: flex-end; }
.sort-btn:hover, .sorted .sort-btn { color: var(--ink); }
.sort-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
.sort-ind { font-size: 9px; color: var(--gold); }
table.heat td.self .mirror-n { font-size: 10px; font-weight: 600; color: var(--muted); background: var(--ground); padding: 1px 3px; border-radius: 3px; }

/* 0.13.0: movers, shape, FD by faction, upcoming, lists */
.vrow { display: grid; grid-template-columns: minmax(0, 1.4fr) 80px 80px 100px 120px 110px; gap: var(--space-3); align-items: center; padding: 9px var(--space-4); border-top: 1px solid var(--line); }
.vrow.head { border-top: 0; background: var(--surface); }
.vrow.low { opacity: 0.5; }
.callout b + b { margin-top: 2px; }
.shape-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px minmax(130px, 1.1fr); gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.shape-row.low { opacity: 0.55; }
.shape-gap { height: var(--space-2); }
.fdf { min-width: 760px; }
.fdf-row { display: grid; grid-template-columns: minmax(150px, 1.3fr) 60px repeat(5, minmax(90px, 1fr)); gap: var(--space-2); align-items: center; padding: 8px var(--space-4); border-top: 1px solid var(--line); }
.fdf-row.head { border-top: 0; background: var(--surface); align-items: end; }
.fdf-cell { display: flex; flex-direction: column; align-items: flex-end; }
.fdf-cell small { color: var(--muted); font-size: 11px; }
.faint { opacity: 0.5; }
.up-ev summary, .list-card summary { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); cursor: pointer; list-style: none; }
.up-ev summary::-webkit-details-marker, .list-card summary::-webkit-details-marker { display: none; }
.up-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.up-title small { color: var(--muted); }
.up-count { color: var(--gold); font-weight: 700; white-space: nowrap; }
.up-body { margin-top: var(--space-4); }
.up-disp { display: flex; flex-wrap: wrap; gap: 8px; }
.up-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--radius-pill); font-size: 13px; }
.up-row { grid-template-columns: minmax(0, 1fr) 120px minmax(150px, 1fr) !important; }
.lists-filter { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; }
.lists-filter .field { flex: 1 1 220px; min-width: 0; }
.srow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 60px 80px 80px minmax(150px, 1.1fr); gap: var(--space-3); align-items: center; padding: 8px var(--space-4); border-top: 1px solid var(--line); }
.srow.head { border-top: 0; background: var(--surface); }
.srow .name small { color: var(--muted); font-size: 12px; }
.list-rec { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.list-text { white-space: pre-wrap; font: 13px/1.5 ui-monospace, Consolas, monospace; background: var(--ground); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-3); margin: var(--space-3) 0; max-height: 520px; overflow: auto; color: var(--ink); }
@media (max-width: 640px) {
  .vrow { grid-template-columns: minmax(0, 1fr) 54px 54px 70px; padding: 9px var(--space-3); }
  .shape-row { grid-template-columns: minmax(0, 1fr) 74px minmax(96px, 1fr); font-size: 13px; }
  .srow { grid-template-columns: minmax(0, 1fr) 44px minmax(96px, 1fr); padding: 8px var(--space-3); }
  .up-row { grid-template-columns: minmax(0, 1fr) 84px minmax(96px, 1fr) !important; }
}
.shape-row { grid-template-columns: minmax(0, 1fr) 130px minmax(130px, 1.1fr); }
.shape-row .num { white-space: nowrap; }
@media (max-width: 640px) { .shape-row { grid-template-columns: minmax(0, 1fr) 96px minmax(90px, 1fr); } .shape-row .num { font-size: 12px; } }
.eurow { display: grid; grid-template-columns: minmax(0, 1.5fr) 90px 70px 60px minmax(150px, 1.1fr); gap: var(--space-3); align-items: center; padding: 8px var(--space-4); border-top: 1px solid var(--line); }
.eurow.head { border-top: 0; background: var(--surface); }
.eurow .name small { color: var(--muted); font-size: 12px; }
@media (max-width: 640px) { .eurow { grid-template-columns: minmax(0, 1fr) 70px 46px minmax(90px, 1fr); padding: 8px var(--space-3); } }
/* Hidden screen-reader text in bars must stay inside its table (it pushed phones wide). */
.tbox, .wr, .card { position: relative; }
