/* =============================================================================
   EV Delay – design tokens + base components (vanilla CSS, no external requests)
   Spec: web/evdelay-design/DESIGN.md (sections 1-19 = tokens.css; app layer at the end)
   Colour method: data-viz reference instance (categorical slots 1–8, fixed order),
   validated with validate_palette (light on #fcfcfb, dark on #1a1a19).
   Theme: follows the OS; <html data-theme="light|dark"> overrides it both ways.
   v2 (8.11.2026): stronger type scale, one surface system (page < card < raised), hero overview with
   sparkline + ticker, tile panels, motion tokens. Data colours (slots, ramps, status) unchanged.
   ============================================================================= */

/* ---------- 1. Tokens: light (default) ---------- */
:root {
  color-scheme: light;

  /* planes & ink */
  --page: #f4f4f1;          /* page plane (one step below the cards) */
  --surface: #fcfcfb;       /* cards, chart surface (validator surface) */
  --surface-2: #ecebe6;     /* inset fills: segmented control track, code */
  --ink: #0b0b0b;           /* primary text, hero numbers           19.2:1 */
  --ink-2: #52514e;         /* secondary text, labels                7.7:1 */
  --ink-3: #6b6a65;         /* hints, captions (AA small text)       5.3:1 */
  --muted: #898781;         /* axis ticks only (graphical text)      3.5:1 */
  --grid: #e1e0d9;          /* gridlines, row rules (hairline) */
  --axis: #c3c2b7;          /* baseline, table header rule */
  --ring: rgba(11, 11, 11, 0.10);        /* hairline card ring */
  --ring-strong: rgba(11, 11, 11, 0.28); /* chip / input ring on hover */
  --wash: rgba(11, 11, 11, 0.045);       /* hover wash */
  --shadow-pop: 0 12px 32px -6px rgba(20, 20, 15, 0.16), 0 2px 6px rgba(20, 20, 15, 0.06);
  --sh-1: 0 1px 1px rgba(20, 20, 15, 0.03), 0 2px 8px -2px rgba(20, 20, 15, 0.06);  /* card at rest */
  --sh-2: 0 2px 4px rgba(20, 20, 15, 0.04), 0 14px 32px -10px rgba(20, 20, 15, 0.16); /* linked card on hover */
  --hl: inset 0 0 0 0 transparent;                                                     /* top highlight (dark only) */
  --wash-k: 8%;                                                                        /* model tint in the hero */
  --scroll-shade: rgba(11, 11, 11, 0.16);  /* edge shade of horizontally scrollable areas */
  --tap: 44px;                             /* minimum touch target */

  /* categorical – fixed order, never cycled (slot n = --s<n>) */
  --s1: #2a78d6;  /* blue    */
  --s2: #eb6834;  /* orange  */
  --s3: #1baf7a;  /* aqua    */
  --s4: #eda100;  /* yellow  */
  --s5: #e87ba4;  /* magenta */
  --s6: #008300;  /* green   */
  --s7: #6250d6;  /* violet  */
  --s8: #e34948;  /* red     */
  --s-other: #c3c2b7;       /* folded "Other" – always labelled */
  --mark-neutral: #6b6a65;  /* single non-model measure (e.g. data lag) */

  /* entity → slot (colour follows the entity, never its rank) */
  --m-ex60: var(--s1);
  --m-ix3:  var(--s2);
  --m-glc:  var(--s3);
  --c-pl: var(--s1); --c-nl: var(--s2); --c-es: var(--s3); --c-fi: var(--s4);
  --c-ee: var(--s5); --c-il: var(--s6); --c-de: var(--s7); --c-se: var(--s8);
  --v-1: var(--s1); --v-2: var(--s2); --v-3: var(--s3); /* versions in model order */

  /* delay scale 0–4 – ordinal plum ramp (OKLCH h≈328°, C 0.10), light → dark */
  --lvl-0: #d197ce; --lvl-1: #aa73a8; --lvl-2: #855083; --lvl-3: #612f60; --lvl-4: #3b1b3a;
  --lvl-0-on: #0b0b0b; --lvl-1-on: #0b0b0b; --lvl-2-on: #ffffff; --lvl-3-on: #ffffff; --lvl-4-on: #ffffff;

  /* status – fixed, never themed; always icon + label */
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --good-text: #006300;

  /* type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 12px; --fs-s: 13px; --fs-m: 15px; --fs-l: 17px;
  --fs-h3: 16px; --fs-h2: 23px; --fs-h1: clamp(44px, 12.5vw, 72px); --fs-h1-long: clamp(30px, 7.6vw, 46px);
  --fs-tile: 26px; --fs-hero: clamp(72px, 23vw, 132px);
  --lh: 1.5;

  /* space, radius, layout */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --r-s: 6px; --r-m: 11px; --r-l: 18px; --r-xl: 24px; --r-pill: 999px;
  /* motion: one UI ease-out, one settle curve for entrances, one in-out for travel; no overshoot */
  --ease: cubic-bezier(.2, .8, .2, 1); --ease-enter: cubic-bezier(.22, 1, .36, 1); --ease-io: cubic-bezier(.65, 0, .35, 1);
  --m-in: 150ms; --m-out: 120ms; --m-slide: 260ms;
  --wrap: 1120px; --gutter: 16px; --pad: 16px;
}
@media (min-width: 720px) { :root { --pad: 24px; --fs-h2: 28px; --fs-tile: 30px; } }
@media (min-width: 1100px) { :root { --pad: 32px; --wrap: 1200px; } }

/* ---------- 2. Tokens: dark (selected steps, not an automatic flip) ---------- */
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0b0b0a; --surface: #1a1a19; --surface-2: #262624;
    --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #a3a29b; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835;
    --ring: rgba(255, 255, 255, 0.10); --ring-strong: rgba(255, 255, 255, 0.30); --wash: rgba(255, 255, 255, 0.06);
    --shadow-pop: 0 12px 36px -4px rgba(0, 0, 0, 0.6); --scroll-shade: rgba(255, 255, 255, 0.14);
    --sh-1: 0 1px 2px rgba(0, 0, 0, 0.5); --sh-2: 0 16px 36px -10px rgba(0, 0, 0, 0.7); --hl: inset 0 1px 0 rgba(255, 255, 255, 0.045); --wash-k: 13%;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --s-other: #5f5e59; --mark-neutral: #a3a29b;
    --lvl-0: #723f71; --lvl-1: #945e92; --lvl-2: #b77fb4; --lvl-3: #dba1d8; --lvl-4: #f5cbf3;
    --lvl-0-on: #ffffff; --lvl-1-on: #ffffff; --lvl-2-on: #0b0b0b; --lvl-3-on: #0b0b0b; --lvl-4-on: #0b0b0b;
    --good-text: #0ca30c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b0b0a; --surface: #1a1a19; --surface-2: #262624;
  --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #a3a29b; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835;
  --ring: rgba(255, 255, 255, 0.10); --ring-strong: rgba(255, 255, 255, 0.30); --wash: rgba(255, 255, 255, 0.06);
  --shadow-pop: 0 12px 36px -4px rgba(0, 0, 0, 0.6); --scroll-shade: rgba(255, 255, 255, 0.14);
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.5); --sh-2: 0 16px 36px -10px rgba(0, 0, 0, 0.7); --hl: inset 0 1px 0 rgba(255, 255, 255, 0.045); --wash-k: 13%;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --s-other: #5f5e59; --mark-neutral: #a3a29b;
  --lvl-0: #723f71; --lvl-1: #945e92; --lvl-2: #b77fb4; --lvl-3: #dba1d8; --lvl-4: #f5cbf3;
  --lvl-0-on: #ffffff; --lvl-1-on: #ffffff; --lvl-2-on: #0b0b0b; --lvl-3-on: #0b0b0b; --lvl-4-on: #0b0b0b;
  --good-text: #0ca30c;
}

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: var(--fs-m)/var(--lh) var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--axis); text-underline-offset: 3px; transition: text-decoration-color var(--m-out) var(--ease); }
a:hover { text-decoration-color: currentColor; transition-duration: var(--m-in); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap {
  max-width: var(--wrap); margin: 0 auto;
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
}
.ext::after { content: " ↗"; font-size: 0.85em; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: var(--r-m); text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- 4. Site header, tabs ---------- */
.site { background: var(--page); padding-top: env(safe-area-inset-top); }
.site-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; letter-spacing: -0.025em; text-decoration: none; white-space: nowrap; color: var(--ink); }
.brand-mark { width: 26px; height: 26px; flex: none; color: var(--ink); }
.brand-name span { color: var(--ink-3); font-weight: 500; }
.site-tools { display: flex; align-items: center; gap: var(--sp-2); }
.about-link { font-size: var(--fs-s); font-weight: 560; color: var(--ink-2); text-decoration: none; }
.about-link.hd { display: none; padding: 0 10px; min-height: 36px; align-items: center; border-radius: var(--r-pill); transition: background-color var(--m-out) var(--ease), color var(--m-out) var(--ease); }
.about-link.hd:hover { background: var(--wash); color: var(--ink); transition-duration: var(--m-in); }
@media (min-width: 560px) { .about-link.hd { display: inline-flex; } .tab.about-link.tb, .tab-spacer { display: none; } }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: var(--r-pill);
  border: 1px solid var(--ring); background: var(--surface); color: var(--ink-2); cursor: pointer; font: inherit;
  transition: color var(--m-out) var(--ease), border-color var(--m-out) var(--ease), transform var(--m-out) var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--ring-strong); transition-duration: var(--m-in); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 16px; height: 16px; }

.tabs {
  position: relative; display: flex; align-items: stretch; gap: 2px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--grid);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs, .chips, .secnav { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
@media (min-width: 1100px) { .tabs, .secnav { -webkit-mask-image: none; mask-image: none; } }
.tab {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; flex: none; min-height: 48px;
  padding: 10px 12px 11px; font-size: var(--fs-m); font-weight: 560;
  color: var(--ink-3); text-decoration: none; transition: color var(--m-out) var(--ease);
}
.tab:first-child { padding-left: 2px; }
.tab:hover { color: var(--ink); transition-duration: var(--m-in); }
.tab[aria-current="page"] { color: var(--ink); }
.tab .n { font-size: 12px; font-weight: 560; color: var(--ink-3); background: var(--surface-2); border-radius: var(--r-pill); padding: 1px 7px; font-variant-numeric: tabular-nums; line-height: 1.5; }
.tab[aria-current="page"] .n { background: var(--ink); color: var(--surface); }
.tab-sep { flex: none; align-self: center; width: 1px; height: 18px; background: var(--grid); margin: 0 6px; }
.tab-spacer { flex: 1 0 8px; }
.tab-ind { position: absolute; left: 0; bottom: 0; width: 100px; height: 2px; background: var(--ink); transform-origin: 0 0; transition: transform var(--m-slide) var(--ease-io); pointer-events: none; }

/* identity keys: a coloured mark beside ink text – never coloured text */
.key { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--k, var(--s1)); }
.key.dot { border-radius: 50%; width: 8px; height: 8px; }
.key.line { width: 14px; height: 2px; border-radius: 1px; }
.key.hollow { background: var(--surface); box-shadow: inset 0 0 0 2px var(--k, var(--s1)); border-radius: 50%; width: 10px; height: 10px; }

/* ---------- 5. Page head: brand eyebrow, big model name, lede + freshness, in-page nav ---------- */
.page-head { display: grid; gap: var(--sp-3) var(--sp-7); padding-top: 28px; padding-bottom: 2px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 6px; }
.eyebrow:empty { display: none; }
.page-head h1 { font-size: var(--fs-h1-long); font-weight: 700; letter-spacing: -0.032em; line-height: 1.06; text-wrap: balance; }
.page-head.is-model h1 { font-size: var(--fs-h1); letter-spacing: -0.05em; line-height: 0.92; }
.lede { color: var(--ink-2); max-width: 600px; font-size: var(--fs-m); line-height: 1.55; text-wrap: pretty; }
.freshness { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: var(--sp-3); font-size: var(--fs-s); color: var(--ink-3); }
.freshness a { color: var(--ink-2); }
.secnav { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .page-head { grid-template-columns: minmax(0, 1fr) minmax(0, 480px); align-items: end; padding-top: 44px; }
  .page-head .ph-side { padding-bottom: 4px; }
}

/* ---------- 6. Status (freshness) – icon + label, never colour alone ---------- */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-s); color: var(--ink-2); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 18%, transparent); }
.status.is-monthly::before { background: transparent; box-shadow: inset 0 0 0 2px var(--good); }
.status.is-late::before { background: var(--warning); border-radius: 1px; transform: rotate(45deg); width: 7px; height: 7px; box-shadow: none; }
.status.is-down::before { background: var(--critical); border-radius: 1px; box-shadow: none; }
.status.is-planned::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }

/* ---------- 7. Filter bar: scope switcher, country chips, segmented controls ---------- */
.filterbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--page) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--grid);
  padding-top: env(safe-area-inset-top); /* PWA / landscape notch: stuck bar never slides under the status bar */
}
.filterbar .wrap { display: flex; align-items: center; gap: var(--sp-3); padding-top: 8px; padding-bottom: 8px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; padding: 4px 28px 4px 1px; scroll-padding: 0 28px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 7px; flex: none; height: 36px; padding: 0 13px 0 10px;
  border-radius: var(--r-pill); border: 1px solid var(--ring); background: var(--surface);
  font: inherit; font-size: var(--fs-s); font-weight: 560; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color var(--m-out) var(--ease), border-color var(--m-out) var(--ease), color var(--m-out) var(--ease), transform var(--m-out) var(--ease);
}
.chip:hover { border-color: var(--ring-strong); transition-duration: var(--m-in); }
.chip:active { transform: scale(.97); }
.chip::after { content: ""; position: absolute; inset: -5px -3px; } /* 46 px touch target, visual 36 px */
.chip .n { color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip[aria-pressed="true"] .n { color: color-mix(in srgb, var(--surface) 72%, transparent); }
.chip[aria-disabled="true"] { color: var(--ink-3); background: transparent; border-style: dashed; cursor: not-allowed; }
.chip[aria-disabled="true"] .flag { filter: grayscale(1); opacity: 0.55; }
.chip.all { padding-left: 13px; }

.flag { width: 20px; height: 14px; flex: none; border-radius: 3px; box-shadow: 0 0 0 1px var(--ring); display: inline-block; vertical-align: -2px; overflow: hidden; }
.code { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; color: var(--ink-3); }

.seg { display: inline-flex; flex: none; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button, .seg a {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: var(--fs-s); font-weight: 560; color: var(--ink-2); background: none; border: 0;
  border-radius: 9px; padding: 5px 12px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color var(--m-out) var(--ease), color var(--m-out) var(--ease), box-shadow var(--m-out) var(--ease);
}
.seg button:hover, .seg a:hover { color: var(--ink); transition-duration: var(--m-in); }
.seg [aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--ring), 0 1px 3px rgba(0, 0, 0, .08); }
.seg [aria-disabled="true"] { color: var(--muted); cursor: not-allowed; }
.seg.tier [aria-pressed="true"] { background: var(--ink); color: var(--surface); box-shadow: none; }

.more-filters { flex: none; margin-left: auto; }
.more-filters > summary { list-style: none; }
.more-filters > summary::-webkit-details-marker { display: none; }

/* ---------- 8. Section nav (in-page) ---------- */
.secnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: var(--sp-3) 28px 0 0; margin-left: -10px; }
.secnav::-webkit-scrollbar { display: none; }
.secnav a { flex: none; display: inline-flex; align-items: center; min-height: 40px; font-size: var(--fs-s); font-weight: 520; color: var(--ink-3); text-decoration: none; padding: 0 10px; border-radius: var(--r-pill); transition: background-color var(--m-out) var(--ease), color var(--m-out) var(--ease); }
.secnav a:hover { background: var(--wash); color: var(--ink); transition-duration: var(--m-in); }
.secnav a[aria-current="true"] { color: var(--ink); background: var(--wash); font-weight: 560; }

/* ---------- 9. Sections, cards, grid ---------- */
.section { padding: 56px 0 0; }
.section.sec-tight { padding-top: var(--sp-4); }
@media (min-width: 720px) { .section { padding-top: 72px; } .section.sec-tight { padding-top: var(--sp-4); } }
.section-head { margin-bottom: var(--sp-5); max-width: 760px; }
.section-head h2 { font-size: var(--fs-h2); font-weight: 700; letter-spacing: -0.028em; line-height: 1.15; }
.section-head p { color: var(--ink-2); font-size: var(--fs-m); margin-top: 6px; line-height: 1.55; text-wrap: pretty; }
.section-head p:empty { display: none; }
.card { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r-l); padding: 18px; min-width: 0; box-shadow: var(--sh-1), var(--hl); }
@media (min-width: 720px) { .card { padding: 24px; } }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-2) var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.card-head h3 { font-size: var(--fs-h3); font-weight: 650; letter-spacing: -0.01em; line-height: 1.35; }
.ch-t { display: grid; gap: 2px; min-width: 0; }
.ch-t .note-line { margin: 0; }
.card-head .hint, .hint { font-size: var(--fs-s); color: var(--ink-3); }
.card-foot { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--grid); font-size: var(--fs-s); color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; }
.stack > * + * { margin-top: var(--gutter); }
.grid { display: grid; gap: var(--gutter); grid-template-columns: minmax(0, 1fr); align-items: start; }
/* charts go two-up only at >=1100 px (charts need ~480 px to keep 12 px text); text cards at >=720 px */
@media (min-width: 720px) { .grid.g2s { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) {
  .grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .span-2 { grid-column: span 2; }
}

/* ---------- 10. Overview hero: big total, delta, running-total sparkline, latest-registration ticker ---------- */
.section.ov { padding-top: var(--sp-5); }
.ov-hero {
  --k: var(--s1);
  position: relative; display: grid; gap: var(--sp-4); padding: 20px 20px 16px;
  border: 1px solid var(--ring); border-radius: var(--r-xl); box-shadow: var(--sh-1), var(--hl); overflow: hidden;
  background-color: var(--surface);
  background-image: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--k) var(--wash-k), transparent) 0%, transparent 62%);
}
.ov-num { min-width: 0; }
.ov-label { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; font-size: var(--fs-s); font-weight: 600; color: var(--ink-2); }
.ov-asof { font-weight: 450; color: var(--ink-3); font-size: var(--fs-xs); }
.hero-value { font-size: var(--fs-hero); font-weight: 720; letter-spacing: -0.055em; line-height: 0.9; margin: 10px 0 0 -0.04em; white-space: nowrap; }
.ov-delta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; margin-top: 12px; font-size: var(--fs-m); color: var(--ink-2); }
.ov-delta b.up { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-weight: 650; }
.ov-delta b.up::before { content: ""; width: 0; height: 0; border: 5px solid transparent; border-bottom: 7px solid var(--k); border-top-width: 0; transform: translateY(-1px); }
.ov-delta .sep, .hero-cap .sep { color: var(--ink-3); }
.hero-cap { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; color: var(--ink-3); font-size: var(--fs-s); margin-top: 4px; }
.hero-cap .ent { color: var(--ink-2); font-weight: 560; gap: 6px; }
.ov-spark { position: relative; min-height: 64px; align-self: end; }
.ov-spark .spark { position: relative; }
.ov-spark.is-empty { display: none; }
.ov-ticker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding-top: 14px; border-top: 1px solid var(--grid); font-size: var(--fs-s); min-width: 0; }
.ov-ticker:empty { display: none; }
.tk-label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-weight: 560; white-space: nowrap; flex-basis: 100%; }
.live { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--good); opacity: 0; }
.ov-ticker.running .live::after { animation: ring 2.4s var(--ease) infinite; }
.tk-win { position: relative; flex: 1 1 0; min-width: 0; height: 22px; overflow: hidden; }
.tk-list { position: relative; height: 100%; }
.tk-item { position: absolute; inset: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; opacity: 0; transform: translateY(100%); transition: transform .42s var(--ease-enter), opacity .3s var(--ease); }
.tk-item.on { opacity: 1; transform: none; }
.tk-item.out { opacity: 0; transform: translateY(-100%); }
.tk-item b { font-weight: 650; flex: none; }
.tk-where { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tk-when { color: var(--ink-3); margin-left: auto; padding-left: 8px; flex: none; font-variant-numeric: tabular-nums; }
.tk-btn { position: relative; flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--ring); background: var(--surface); color: var(--ink-2); cursor: pointer; display: inline-grid; place-items: center; padding: 0; }
.tk-btn::after { content: ""; position: absolute; inset: -8px; }
.tk-btn::before { content: ""; width: 8px; height: 9px; border-left: 2.5px solid currentColor; border-right: 2.5px solid currentColor; box-sizing: border-box; }
.tk-btn[aria-pressed="true"]::before { width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent currentColor; margin-left: 2px; }
.tk-btn:hover { color: var(--ink); border-color: var(--ring-strong); }
@media (min-width: 560px) { .tk-label { flex-basis: auto; } .tk-label::after { content: ""; width: 1px; height: 14px; background: var(--grid); margin-left: 4px; } }
@media (min-width: 900px) {
  .ov-hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "num spark" "tick tick"; gap: var(--sp-5) 48px; padding: 32px 36px 20px; }
  .ov-num { grid-area: num; } .ov-ticker { grid-area: tick; }
  .ov-spark { grid-area: spark; align-self: stretch; min-height: 140px; }
  .ov-spark .spark { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
  .hero-value { margin-top: 14px; }
  .ov-label { justify-content: flex-start; }
  .ov-asof::before { content: "· "; }
}
/* sparkline (hero + compare cards) */
.spark { display: block; width: 100%; height: auto; overflow: visible; }
.spark .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.spark .area { opacity: 0.1; }
.spark .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .dot { stroke: var(--surface); stroke-width: 2; }
.spark .pulse { opacity: 0; transform-box: fill-box; transform-origin: center; animation: ring 2.4s var(--ease) .9s 2; }
.spark .xhair { stroke: var(--axis); stroke-width: 1; }
.spark .hit { fill: transparent; cursor: crosshair; outline: none; }
.spark text { fill: var(--muted); font: 12px var(--font); font-variant-numeric: tabular-nums; }
@keyframes ring { 0% { opacity: .45; transform: scale(1); } 100% { opacity: 0; transform: scale(3.2); } }

/* ---------- 10b. Stat tiles: one panel, hairline dividers ---------- */
.tiles {
  display: grid; grid-template-columns: repeat(var(--cols-s, 2), minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--sh-1), var(--hl);
}
#ov-tiles, #dl-tiles { margin-top: var(--gutter); }
#dl-tiles { margin-top: 0; margin-bottom: var(--gutter); }
.tiles:empty { display: none; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(var(--cols-m, 3), minmax(0, 1fr)); } }
@media (min-width: 1040px) { .tiles { grid-template-columns: repeat(var(--cols-l, 4), minmax(0, 1fr)); } }
.tile { padding: 14px 16px 16px; min-width: 0; margin: 0 -1px -1px 0; box-shadow: inset -1px 0 var(--grid), inset 0 -1px var(--grid); }
.tile:last-child { grid-column: span var(--span-s, 1); }
@media (min-width: 720px) { .tile:last-child { grid-column: span var(--span-m, 1); } }
@media (min-width: 1040px) { .tile:last-child { grid-column: span var(--span-l, 1); } }
@media (min-width: 720px) { .tile { padding: 18px 20px 20px; } }
.tile-label { font-size: var(--fs-s); color: var(--ink-2); line-height: 1.3; font-weight: 520; }
.tile-value { font-size: var(--fs-tile); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-value small { font-size: 15px; font-weight: 560; color: var(--ink-2); letter-spacing: 0; margin-left: 2px; }
.tile-value .tv-text { font-size: 20px; letter-spacing: -0.02em; }
.tile-meta { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 5px; line-height: 1.4; }
.delta-up { color: var(--good-text); font-weight: 600; }

/* compare: one linked card per model with its own sparkline */
.section#porownanie { padding-top: var(--sp-5); }
.cmp-tiles { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .cmp-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cm-card {
  position: relative; display: grid; gap: 4px; padding: 18px 18px 14px; text-decoration: none; color: inherit; overflow: hidden;
  background-color: var(--surface); border: 1px solid var(--ring); border-radius: var(--r-l); box-shadow: var(--sh-1), var(--hl);
  background-image: radial-gradient(140% 120% at 100% 0%, color-mix(in srgb, var(--k) var(--wash-k), transparent), transparent 60%);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}
.cm-head { display: flex; align-items: center; gap: 8px; font-size: var(--fs-s); font-weight: 600; color: var(--ink-2); }
.cm-go { margin-left: auto; color: var(--ink-3); transition: transform var(--m-in) var(--ease); }
.cm-value { font-size: clamp(40px, 11vw, 56px); font-weight: 720; letter-spacing: -0.05em; line-height: 1; margin-top: 6px; }
.cm-meta { font-size: var(--fs-s); color: var(--ink-3); }
.cm-spark { margin-top: 10px; min-height: 40px; }
@media (max-width: 719px) { .cm-card { padding: 16px 16px 12px; } .cm-value { font-size: 40px; } .cm-spark { margin-top: 6px; } }
@media (hover: hover) and (pointer: fine) {
  .cm-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2), var(--hl); border-color: var(--ring-strong); }
  .cm-card:hover .cm-go { transform: translateX(3px); color: var(--ink); }
}

/* ---------- 11. Charts ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-s); color: var(--ink-2); margin-bottom: var(--sp-3); }
.legend:empty { display: none; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart { position: relative; width: 100%; transition: opacity var(--m-in) var(--ease); }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .hit { fill: transparent; outline: none; }
.chart .hit:hover, .chart .hit:focus-visible { fill: var(--wash); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .today { stroke: var(--axis); stroke-width: 1; }
.chart text { fill: var(--muted); font: 12px var(--font); font-variant-numeric: tabular-nums; }
.chart text.lbl { fill: var(--ink-2); }
.chart text.val { fill: var(--ink); font-weight: 650; }
.chart .mark:hover { filter: brightness(1.12); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: 0.1; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .dot.hollow { fill: var(--surface); stroke-width: 2; }
.chart .xhair { stroke: var(--axis); stroke-width: 1; }
.chart .bar path { transition: filter var(--m-out) var(--ease); }
.chart .bar.on path { filter: brightness(1.12); }
.chart .empty, .hbars .empty { padding: var(--sp-5) var(--sp-4); }

/* horizontal bar list (HTML, responsive without re-render) */
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(84px, 34%) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 14px; }
.hbar .n { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-2); }
.hbar .n > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .n.link { cursor: pointer; text-decoration: underline; text-decoration-color: var(--axis); text-underline-offset: 3px; }
.hbar .track { height: 14px; display: flex; gap: 2px; min-width: 0; border-radius: 0 4px 4px 0; }
.hbar .fill { height: 100%; min-width: 2px; background: var(--k, var(--s1)); outline: none; transition: filter var(--m-out) var(--ease); }
.hbar .fill:last-child { border-radius: 0 4px 4px 0; }
.hbar .fill:hover, .hbar .fill:focus-visible { filter: brightness(1.12); }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.hbar .v small { font-weight: 450; color: var(--ink-3); margin-left: 6px; }
/* long labels on phones: label on its own line above the bar */
@media (max-width: 599px) {
  .hbars.lab-top { gap: 12px; }
  .hbars.lab-top .hbar { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .hbars.lab-top .hbar .n { grid-column: 1 / -1; }
}

/* 100 % distribution strip (delay levels) */
.dist { display: flex; gap: 2px; height: 12px; border-radius: 4px; overflow: hidden; min-width: 80px; }
.dist i { display: block; height: 100%; }

/* table view twin of every chart: a quiet card footer */
.tableview { margin-top: var(--sp-3); border-top: 1px solid var(--grid); padding-top: 2px; }
.tableview > summary { cursor: pointer; font-size: var(--fs-s); color: var(--ink-3); list-style: none; display: inline-flex; gap: 8px; align-items: center; min-height: 36px; transition: color var(--m-out) var(--ease); }
.tableview > summary::-webkit-details-marker { display: none; }
.tableview > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform var(--m-in) var(--ease); }
.tableview[open] > summary::before { transform: rotate(45deg) translate(-2px, -1px); }
.tableview > summary:hover { color: var(--ink); }
.tableview .tablewrap { margin-top: var(--sp-2); }

/* tooltip – positioned by app.js in viewport coordinates */
.tip {
  position: fixed; z-index: 30; pointer-events: none; min-width: 140px; opacity: 0; transform: translateY(2px);
  max-width: min(320px, calc(100vw - 16px));
  background: color-mix(in srgb, var(--surface) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--ring); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 9px 12px; font-size: var(--fs-s);
  transition: opacity .1s var(--ease), transform .1s var(--ease);
}
.tip.on { opacity: 1; transform: none; }
.tip .h { color: var(--ink-3); font-size: var(--fs-xs); margin-bottom: 4px; }
.tip .h .flag { margin-right: 6px; }
.tip .r { display: flex; align-items: center; gap: 8px; line-height: 1.7; }
.tip .r b { font-variant-numeric: tabular-nums; min-width: 30px; font-weight: 700; }
.tip .r span:last-child { color: var(--ink-2); }
.tip .h .ent { display: flex; align-items: center; gap: 8px; }
.tip .h .ent b { color: var(--ink); font-size: var(--fs-s); font-weight: 600; }
.tip .h .ent .flag { margin-right: 0; }
.tip .stag { margin-left: auto; padding-left: 10px; font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; }
.tip .stag.st-live { color: var(--good); }
.tip .n { color: var(--ink-2); font-size: var(--fs-xs); line-height: 1.45; }
.tip .n.sub { color: var(--ink-3); margin-bottom: 2px; }
.tip .n.sep { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--ring); }
.tip .n.hint { color: var(--ink-3); margin-top: 2px; }

/* ---------- 12. Tables ---------- */
.tablewrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left center / 32px 100%,
    linear-gradient(to left, var(--surface) 30%, transparent) right center / 32px 100%,
    radial-gradient(farthest-side at 0 50%, var(--scroll-shade), transparent) left center / 12px 100%,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-shade), transparent) right center / 12px 100%;
  background-repeat: no-repeat; background-attachment: local, local, scroll, scroll;
}
.scroll-hint { display: none; font-size: var(--fs-xs); color: var(--ink-3); margin: -4px 0 6px; }
@media (max-width: 719px) { .scroll-hint { display: block; } }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th {
  text-align: left; font-weight: 560; color: var(--ink-3); font-size: var(--fs-xs); letter-spacing: 0.02em;
  padding: 8px 10px; border-bottom: 1px solid var(--axis); white-space: nowrap; vertical-align: bottom;
}
.t td { padding: 10px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t th:first-child, .t td:first-child { padding-left: 0; }
.t th:last-child, .t td:last-child { padding-right: 0; }
.t .r, .t .num { text-align: right; font-variant-numeric: tabular-nums; }
.t td.wrap-ok { white-space: normal; min-width: 180px; }
.t tbody tr { transition: background-color var(--m-out) var(--ease); }
.t tbody tr:hover { background: var(--wash); }
.t .sub { display: block; font-size: var(--fs-xs); color: var(--ink-3); }
.t .ent { display: inline-flex; align-items: center; gap: 8px; }
.t tfoot td { border-top: 1px solid var(--axis); border-bottom: 0; font-weight: 600; }
@media (max-width: 599px) { .t .hide-s { display: none; } .t th, .t td { padding-left: 7px; padding-right: 7px; } }
@media (max-width: 1099px) { .t .hide-m { display: none; } }
.t .inbar { display: flex; align-items: center; gap: 10px; }
.t .inbar b { min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.t .inbar i { display: block; height: 8px; border-radius: 0 3px 3px 0; background: var(--k, var(--s1)); }
.t .inbar + .sub { padding-left: calc(3.2em + 10px); }
.yes { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); vertical-align: 1px; }
.no { color: var(--muted); }

/* stacked rows on phones: <table class="t t-stack"> + data-label on each td */
@media (max-width: 640px) {
  .t-stack thead { display: none; }
  .t-stack, .t-stack tbody, .t-stack td { display: block; width: auto; }
  .t-stack tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 14px; padding: 12px 0; border-bottom: 1px solid var(--grid); }
  .t-stack tr:last-child { border-bottom: 0; }
  .t-stack tr::before { content: ""; flex-basis: 100%; height: 0; order: 3; } /* line break after lead + end */
  .t-stack tbody tr:hover { background: none; }
  .t-stack td, .t-stack td.r, .t-stack td.num { order: 4; border: 0; padding: 0; white-space: normal; text-align: left; font-size: var(--fs-s); color: var(--ink-2); }
  .t-stack td.lead { order: 1; flex: 1 1 auto; min-width: 0; font-size: 14px; color: var(--ink); font-weight: 560; }
  .t-stack td.end { order: 2; text-align: right; }
  .t-stack td.wrap-ok { flex-basis: 100%; min-width: 0; }
  .t-stack td[data-label]:not(.lead):not(.end)::before { content: attr(data-label) " "; color: var(--ink-3); }
  .t-stack td.nil, .t-stack td.hide-s { display: none; }
}

/* ---------- 13. Lists: recent registrations, news ---------- */
.rows > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 11px 0; border-top: 1px solid var(--grid); font-size: 14px; align-items: baseline; }
.rows > li:first-child { border-top: 0; padding-top: 2px; }
.rows .main { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 560; }
.rows .when { color: var(--ink-3); font-size: var(--fs-s); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.rows .meta { grid-column: 1 / -1; color: var(--ink-3); font-size: var(--fs-s); }
@media (min-width: 900px) {
  .rows-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
  .rows-2 > li:nth-child(2) { border-top: 0; padding-top: 2px; }
}
.news > li { padding: 12px 0; border-top: 1px solid var(--grid); }
.news > li:first-child { border-top: 0; padding-top: 2px; }
.news .when { font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.news p { margin-top: 2px; font-size: 14px; }
.news .src { font-size: var(--fs-s); color: var(--ink-3); margin-top: 2px; }

/* ---------- 14. Delay-scale badge ---------- */
.lvl { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: var(--fs-s); color: var(--ink-2); }
.lvl b {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--lvl-0); color: var(--lvl-0-on);
}
.lvl[data-l="1"] b { background: var(--lvl-1); color: var(--lvl-1-on); }
.lvl[data-l="2"] b { background: var(--lvl-2); color: var(--lvl-2-on); }
.lvl[data-l="3"] b { background: var(--lvl-3); color: var(--lvl-3-on); }
.lvl[data-l="4"] b { background: var(--lvl-4); color: var(--lvl-4-on); }
.lvl.lg b { min-width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
.lvl.lg { font-size: 14px; color: var(--ink); font-weight: 560; }
.scale-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }

/* ---------- 15. Order card ("Your order") ---------- */
.order { border: 1.5px solid var(--ink); }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); flex-wrap: wrap; }
.order-head h3 { font-size: var(--fs-h3); font-weight: 650; }
.order-head .what { font-size: var(--fs-s); color: var(--ink-3); margin-top: 2px; }
.order .what b { color: var(--ink-2); font-weight: 500; }
.order-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px; margin: var(--sp-4) 0 var(--sp-3); }
.order-big .v { font-size: 52px; font-weight: 720; letter-spacing: -0.045em; line-height: 1; }
.order-big .v small { font-size: 18px; font-weight: 560; letter-spacing: 0; color: var(--ink-2); margin-left: 4px; }
.order-big .c { color: var(--ink-2); font-size: 14px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin-top: var(--sp-4); }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.facts dt { font-size: var(--fs-xs); color: var(--ink-3); }
.facts dd { font-size: 15px; font-weight: 600; margin-top: 1px; }
.facts dd small { display: block; font-size: var(--fs-xs); font-weight: 450; color: var(--ink-3); }
.otl { position: relative; height: 62px; margin: 8px 2px 0; }
.otl .track { position: absolute; left: 0; right: 0; top: 24px; height: 4px; border-radius: 2px; background: var(--grid); }
.otl .done { position: absolute; top: 24px; height: 4px; border-radius: 2px 0 0 2px; background: var(--ink-2); }
.otl .late { position: absolute; top: 24px; height: 4px; background: var(--lvl-3); }
.otl .pin { position: absolute; top: 18px; width: 2px; height: 16px; background: var(--ink); transform: translateX(-1px); }
.otl .pin.soft { background: var(--muted); }
.otl .lab { position: absolute; top: 38px; font-size: var(--fs-xs); line-height: 1.3; color: var(--ink-3); white-space: nowrap; transform: translateX(-50%); }
.otl .lab b { display: block; color: var(--ink); font-weight: 600; }
.otl .lab.up { top: 0; }
.otl .lab.l { transform: none; } .otl .lab.r { transform: translateX(-100%); text-align: right; }

/* ---------- 16. Source panel ---------- */
.src-card { display: grid; gap: var(--sp-3); align-content: start; }
.src-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.src-head .flag { width: 28px; height: 20px; border-radius: 4px; }
.src-head h3 { font-size: 18px; font-weight: 680; letter-spacing: -0.015em; }
.src-head .status { margin-left: auto; }
.src-name { font-size: 14px; font-weight: 560; }
.src-name .pub { display: block; font-weight: 400; color: var(--ink-3); font-size: var(--fs-s); }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 0; font-size: 14px; }
.kv dt, .kv dd { padding: 7px 0; border-top: 1px solid var(--grid); }
.kv dt { color: var(--ink-3); font-size: var(--fs-s); padding-right: 12px; }
.kv dd { font-variant-numeric: tabular-nums; }
.kv dd .sub { display: block; color: var(--ink-3); font-size: var(--fs-xs); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: var(--fs-xs); padding: 2px 9px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.tag.off { background: transparent; box-shadow: inset 0 0 0 1px var(--grid); color: var(--muted); text-decoration: line-through; }
.note { font-size: var(--fs-s); color: var(--ink-2); line-height: 1.55; }
.src-counts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-s); color: var(--ink-2); }
.src-counts span { display: inline-flex; align-items: center; gap: 6px; }
.src-counts b { color: var(--ink); font-variant-numeric: tabular-nums; }
.h3sec { font-size: 19px; font-weight: 680; letter-spacing: -0.015em; margin: var(--sp-7) 0 var(--sp-3); }

/* ---------- 17. Empty state, buttons, inputs, coming-soon badge ---------- */
.empty { display: grid; justify-items: start; gap: 8px; padding: var(--sp-5); border-radius: var(--r-m); background: var(--page); box-shadow: inset 0 0 0 1px var(--grid); }
.empty .t1 { font-weight: 650; font-size: 15px; }
.empty .t2 { color: var(--ink-3); font-size: var(--fs-s); max-width: 520px; }
.empty .hint { margin-top: 2px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: var(--r-m);
  border: 1px solid var(--ring); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-s); font-weight: 560;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform var(--m-out) var(--ease), border-color var(--m-out) var(--ease), background-color var(--m-out) var(--ease), box-shadow var(--m-out) var(--ease);
}
.btn:hover { border-color: var(--ring-strong); transition-duration: var(--m-in); }
.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--surface)); }
@media (hover: hover) and (pointer: fine) { .btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .18); } }
.btn:active { transform: translateY(1px) scale(.985); box-shadow: none; transition-duration: 90ms; }
.btn.has-soon { flex-wrap: wrap; white-space: normal; row-gap: 4px; padding-top: 7px; padding-bottom: 7px; text-align: left; }
.soon {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; line-height: 1;
  background: var(--surface-2); color: var(--ink-2);
}
.soon::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 1.5px var(--warning); }
.btn.primary .soon { background: color-mix(in srgb, var(--surface) 16%, transparent); color: var(--surface); }
.site-foot .links li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; break-inside: avoid; }
.input {
  height: 38px; padding: 0 14px; border-radius: var(--r-m); border: 1px solid var(--ring); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 14px; min-width: 0; flex: 1 1 220px; max-width: 360px;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.input:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px var(--wash); }
.input::placeholder { color: var(--ink-3); }
.tools { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-3); }
.cta { display: grid; gap: 12px; align-content: start; }
.cta .card-head { margin-bottom: 0; }
.cta .tools { margin: 0; }

/* touch: every control >= 44 px on phones / coarse pointers */
@media (max-width: 719px), (pointer: coarse) {
  .btn, .icon-btn, .input { min-height: var(--tap); height: auto; }
  .icon-btn { width: var(--tap); }
  .seg { padding: 3px; }
  .seg button, .seg a { position: relative; min-height: 38px; padding: 0 12px; display: inline-flex; align-items: center; }
  .seg button::after, .seg a::after { content: ""; position: absolute; inset: -3px 0; } /* 44 px target incl. track padding */
  .tableview > summary { min-height: var(--tap); }
  .rows a, .news a { padding: 4px 0; }
  .about-link.hd { min-height: var(--tap); }
}

/* ---------- 18. Footer ---------- */
.site-foot { margin-top: 96px; padding: 48px 0 calc(var(--sp-7) + env(safe-area-inset-bottom)); border-top: 1px solid var(--grid); font-size: var(--fs-s); color: var(--ink-2); background: color-mix(in srgb, var(--surface) 55%, var(--page)); }
.foot-top { display: grid; gap: var(--sp-6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .foot-top { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 48px; } }
.foot-about { display: grid; gap: 12px; max-width: 520px; align-content: start; }
.foot-about .brand { font-size: 18px; }
.site-foot h4 { font-size: 12px; color: var(--ink-3); margin-bottom: 10px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; }
.site-foot .links li { padding: 4px 0; }
.site-foot .links a { color: var(--ink); text-decoration-color: transparent; }
.site-foot .links a:hover { text-decoration-color: currentColor; }
.foot-bottom { display: grid; gap: 8px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--grid); color: var(--ink-3); font-size: var(--fs-xs); }
@media (min-width: 860px) { .foot-bottom { grid-template-columns: minmax(0, 1fr) auto; gap: 24px; } }

/* ---------- 19. Motion: one entrance on first paint, reduced motion, forced colours, print ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { stroke-dasharray: 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; } }
.m-enter .page-head .eyebrow { animation: rise .52s var(--ease-enter) both; }
.m-enter .page-head h1 { animation: rise .7s var(--ease-enter) .05s both; }
.m-enter .page-head .ph-side { animation: rise .52s var(--ease-enter) .18s both; }
.m-enter .ov-hero, .m-enter .cmp-tiles { animation: rise .6s var(--ease-enter) .24s both; }
.m-enter #ov-tiles { animation: rise .52s var(--ease-enter) .32s both; }
.m-enter .spark .line { animation: draw 1.1s var(--ease-enter) .3s both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) {
  .key, .hbar .fill, .dist i, .lvl b, .live { forced-color-adjust: none; outline: 1px solid CanvasText; }
  .chip[aria-pressed="true"], .seg [aria-pressed="true"] { outline: 2px solid Highlight; }
  .tab-ind { background: Highlight; }
}
@media print {
  .filterbar, .site-tools, .secnav, .tableview > summary, .tk-btn { display: none; }
  .tableview .tablewrap { display: block; }
  .card, .ov-hero, .tiles { break-inside: avoid; box-shadow: none; }
}

/* =============================================================================
   20. App layer (EV Delay client) – view switching, map, choropleth, popovers
   ============================================================================= */
:root {
  --map-base: #efeee9; --map-none: #dcdad2; --map-planned: #b4b2a9; --map-live: #6b6a65; --map-bub: #0b0b0b;
  /* sequential ramps (choropleth), one per model hue – OKLCH steps, monotone, validated */
  --q-ex60-1: #bedaff; --q-ex60-2: #8cbaf7; --q-ex60-3: #5997e6; --q-ex60-4: #3575c4; --q-ex60-5: #205596;
  --q-ix3-1: #fbcbba; --q-ix3-2: #efa286; --q-ix3-3: #da7651; --q-ix3-4: #b6522c; --q-ix3-5: #8a3918;
  --q-glc-1: #b5e4cc; --q-glc-2: #79cca4; --q-glc-3: #2aae7b; --q-glc-4: #008d5a; --q-glc-5: #006940;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --map-base: #222220; --map-none: #2e2e2b; --map-planned: #4c4b47; --map-live: #8f8d86; --map-bub: #f0efec;
    --q-ex60-1: #233e61; --q-ex60-2: #2f598f; --q-ex60-3: #4178bf; --q-ex60-4: #649ae1; --q-ex60-5: #97c1f7;
    --q-ix3-1: #5c2f1f; --q-ix3-2: #864229; --q-ix3-3: #b35a39; --q-ix3-4: #d67d5d; --q-ix3-5: #f0aa91;
    --q-glc-1: #0f4832; --q-glc-2: #026947; --q-glc-3: #008d60; --q-glc-4: #44af81; --q-glc-5: #87d0ac;
  }
}
:root[data-theme="dark"] {
  --map-base: #222220; --map-none: #2e2e2b; --map-planned: #4c4b47; --map-live: #8f8d86; --map-bub: #f0efec;
  --q-ex60-1: #233e61; --q-ex60-2: #2f598f; --q-ex60-3: #4178bf; --q-ex60-4: #649ae1; --q-ex60-5: #97c1f7;
  --q-ix3-1: #5c2f1f; --q-ix3-2: #864229; --q-ix3-3: #b35a39; --q-ix3-4: #d67d5d; --q-ix3-5: #f0aa91;
  --q-glc-1: #0f4832; --q-glc-2: #026947; --q-glc-3: #008d60; --q-glc-4: #44af81; --q-glc-5: #87d0ac;
}


/* view switching (body classes set by app.js) */
body:not(.view-model) .model-only, body:not(.view-cmp) .cmp-only, body:not(.view-src) .src-only,
body:not(.multi) .multi-only, body:not(.single-regions) .single-only, body:not(.scope-pl) .pl-only,
body:not(.show-map) .map-sec, body.view-src .nosrc-only, body:not(.has-filters) .filterbar { display: none !important; }
body.loading main { opacity: .5; }
.map-sec { padding-top: var(--sp-5); }
body.view-model .map-sec, body.view-cmp .map-sec { padding-top: var(--gutter); }

/* filter bar contents */
.fb { flex-wrap: nowrap; }
.fb-inline { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; padding: 4px 28px 4px 0;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.fb-inline::-webkit-scrollbar { display: none; }
.fb-group { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.fb-group > .lab { font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; font-weight: 560; }
.more-filters { position: relative; }
.more-filters > summary .badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: var(--surface); font-size: 11px; font-weight: 700; }
.filter-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: max-content; max-width: min(420px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r-l); box-shadow: var(--shadow-pop); padding: 16px; display: grid; gap: 14px;
  animation: pop .18s var(--ease-enter);
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }
.filter-pop .fb-group { display: grid; gap: 6px; }
.filter-pop .seg { flex-wrap: wrap; }
/* phones: scope switcher + "Filters" on the first row, country chips get a full-width row of their own */
@media (max-width: 719px) {
  body.show-countries .fb { flex-wrap: wrap; row-gap: 4px; padding-top: 6px; padding-bottom: 4px; }
  body.show-countries #f-country { order: 3; flex-basis: 100%; padding-top: 2px; padding-bottom: 2px; }
  body.view-world #f-model { margin-top: 4px; }
}

/* misc app pieces */
.ctrls { display: flex; gap: 8px; flex-wrap: wrap; }
.note-line { font-size: var(--fs-s); color: var(--ink-3); margin: 0 0 10px; }
.note-line:empty { display: none; }
.t tr.clickable { cursor: pointer; }
.t tr.hl td { background: var(--wash); font-weight: 600; }
.t tr.hl td:first-child { box-shadow: inset 3px 0 0 var(--k, var(--ink)); padding-left: 8px; }
.t tr.gap td { color: var(--ink-3); text-align: center; padding: 4px; border-bottom: 0; }
.t tr.pend td { color: var(--ink-3); }
.t th[data-k] { cursor: pointer; user-select: none; }
.t th[data-k]:hover { color: var(--ink); }
.t th .arr { font-size: 9px; margin-left: 3px; }
.t td.wrap-ok { white-space: normal; }
.rank { color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 1.6em; display: inline-block; }
.more { text-align: center; margin-top: 14px; }
.ent { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }

/* markets map */
.map { position: relative; width: 100%; }
.map svg { display: block; width: 100%; height: auto; max-height: 440px; }
.map path.cty { stroke: var(--surface); stroke-width: .35; vector-effect: non-scaling-stroke; transition: filter var(--m-out) var(--ease); }
.map path.cty.live { cursor: pointer; }
.map path.cty:hover { filter: brightness(1.08); }
.map path.cty.sel { stroke: var(--ink); stroke-width: 1.4; }
.map circle.bub { fill: var(--map-bub); fill-opacity: .85; stroke: var(--surface); stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.map text.bl { fill: var(--ink); font-family: var(--font); font-weight: 650; paint-order: stroke; stroke: var(--surface); pointer-events: none; }
.map-legend { margin: 14px 0 0; }

/* Poland choropleth */
.plmap svg { display: block; width: 100%; height: auto; max-height: 520px; }
.plmap path { stroke: var(--surface); stroke-width: 1; vector-effect: non-scaling-stroke; cursor: default; outline: none; }
.plmap path:hover, .plmap path:focus-visible { stroke: var(--ink); stroke-width: 1.6; }
.plmap path.border { fill: none; stroke: var(--ink-3); stroke-width: 1; stroke-linejoin: round; pointer-events: none; }
.plmap text { font: 650 11px var(--font); fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; pointer-events: none; }
.plmap text.zero { fill: var(--muted); font-weight: 500; }
.scale { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-s); color: var(--ink-2); margin-top: 12px; align-items: center; }
.scale span { display: inline-flex; align-items: center; gap: 6px; }
.scale i { width: 16px; height: 12px; border-radius: 3px; display: inline-block; box-shadow: inset 0 0 0 1px var(--ring); }

/* footer links */
.site-foot .links { columns: 2; column-gap: 24px; }
@media (min-width: 860px) { .site-foot .links { columns: 1; } }
@media (max-width: 599px) { .t .inbar i { max-width: 44px; } }

/* coverage disclaimer under the hero total */
.coverage { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); max-width: 62ch; }
.coverage a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line, currentColor); }

/* map timeline (scrubber under the markets map): play, month + running total, monthly bars aligned to the slider steps */
.mtl:empty { display: none; }
.mtl { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--grid); }
.mtl-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.mtl-play { flex: none; width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; background: var(--ink); color: var(--surface); cursor: pointer; display: inline-grid; place-items: center; padding: 0;
  transition: transform var(--m-out) var(--ease), background-color var(--m-out) var(--ease); }
.mtl-play::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent currentColor; margin-left: 3px; }
.mtl-play.on::before { width: 12px; height: 14px; border-width: 0 4px; border-color: currentColor; margin-left: 0; box-sizing: border-box; }
.mtl-play:hover { background: color-mix(in srgb, var(--ink) 86%, var(--surface)); }
.mtl-play:active { transform: scale(.95); }
.mtl-t { display: grid; gap: 0; min-width: 0; flex: 1 1 auto; }
.mtl-m { font-size: var(--fs-l); font-weight: 650; letter-spacing: -0.01em; line-height: 1.3; font-variant-numeric: tabular-nums; }
.mtl-n { font-size: var(--fs-s); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mtl-keys { margin: 0; flex: none; }
.mtl-track { position: relative; }
.mtl-bars { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.mtl-bars .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.mtl-bars .col path { transition: opacity var(--m-in) var(--ease); }
.mtl-bars .col.later path { opacity: .28; }
.mtl-bars .hit { fill: transparent; cursor: pointer; }
.mtl-range { --p: 100%; display: block; width: 100%; height: var(--tap); margin: 0; padding: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; touch-action: pan-y; }
.mtl-range:focus-visible { outline: none; }
.mtl-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--ink) var(--p), var(--grid) var(--p)); }
.mtl-range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--grid); }
.mtl-range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ink); }
.mtl-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; margin-top: -10px; border-radius: 50%; background: var(--ink); border: 0; box-shadow: 0 0 0 3px var(--surface), 0 1px 4px 3px rgba(0, 0, 0, .12); }
.mtl-range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); border: 0; box-shadow: 0 0 0 3px var(--surface), 0 1px 4px 3px rgba(0, 0, 0, .12); }
.mtl-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }
.mtl-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }
.mtl-ends { position: relative; height: 18px; margin-top: -8px; font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mtl-ends span { position: absolute; top: 0; transform: translateX(-50%); }
.mtl-ends span.first { transform: translateX(-12px); }
.mtl-ends span.last { transform: translateX(calc(-100% + 12px)); }
.mtl-hint { display: none; margin-left: auto; font-size: var(--fs-xs); color: var(--ink-3); }
@media (min-width: 720px) and (hover: hover) and (pointer: fine) { .mtl-hint { display: inline; } }
@media print { .mtl { display: none; } }
