/* ==========================================================================
   Lemez — a shared HTML + CSS style for three sites
   One core file (this one) + one small theme file per site (colours only).
   No JavaScript required. Optional js/mode.js only remembers light/dark choice.
   Target: current evergreen browsers (2024+): :has(), light-dark(), popover,
   @layer, @property, container-free.
   ========================================================================== */

@layer reset, tokens, base, layout, components, utilities;

/* ---------- Fonts (self-hosted, SIL OFL) ---------------------------------- */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-ext-wdth-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-wdth-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Counter animation property ------------------------------------ */
@property --n {
  syntax: "<integer>";
  inherits: false;
  initial-value: 0;
}

/* ==========================================================================
   RESET
   ========================================================================== */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  img, picture, svg, video { display: block; max-width: 100%; height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  p, h1, h2, h3, h4, h5, h6, li, dd, figcaption { overflow-wrap: break-word; }
  table { border-collapse: collapse; }
  [hidden] { display: none !important; }
}

/* ==========================================================================
   TOKENS — neutral defaults. Every theme file overrides the colour tokens.
   Colours use light-dark(), so light / dark / auto is one switch:
   the root `color-scheme` decides which side is used.
   ========================================================================== */
@layer tokens {
  :root {
    color-scheme: light dark;

    /* Colour (theme files replace these) */
    --c-bg:          light-dark(#f5f5f4, #18191b);
    --c-surface:     light-dark(#ffffff, #212326);
    --c-surface-2:   light-dark(#e8e8e6, #2b2e32);
    --c-ink:         light-dark(#1e2125, #ececea);
    --c-ink-soft:    light-dark(#575c62, #a9aeb3);
    --c-line:        light-dark(#c9cac6, #3b4045);
    --c-line-strong: light-dark(#1e2125, #ececea);
    --c-primary:     light-dark(#2b2f33, #e5e5e2);
    --c-on-primary:  light-dark(#ffffff, #18191b);
    --c-accent:      light-dark(#2b2f33, #e5e5e2);
    --c-accent-text: light-dark(#2b2f33, #e5e5e2);   /* accent that passes AA as text */
    --c-on-accent:   light-dark(#ffffff, #18191b);
    --c-link:        light-dark(#1e2125, #ececea);
    --c-focus:       light-dark(#1d4ed8, #93b4ff);
    --c-success:     light-dark(#1f6b3a, #6fd29a);
    --c-warning:     light-dark(#8a5a00, #f2c14e);
    --c-danger:      light-dark(#b3261e, #ff7a70);
    --c-info:        light-dark(#1f5a85, #7cc1ee);
    --c-series-1:    light-dark(#2b2f33, #e5e5e2);
    --c-series-2:    light-dark(#6b7177, #9aa1a8);
    --c-series-3:    light-dark(#a9aeb3, #5e646a);
    --c-series-4:    light-dark(#d4d6d8, #3f444a);
    --c-loss:        var(--c-danger);
    --c-recovered:   var(--c-success);

    /* Type */
    --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --wide: 125%;          /* expanded width: headings, big numbers */
    --semi-wide: 112%;
    --normal: 100%;
    --narrow: 85%;         /* condensed: dense tables, small labels */

    /* Classical scale: 14 · 16 · 18 · 21 · 24 · 36 · 48 · 72 px */
    --fs-sm:  0.875rem;
    --fs-base: 1rem;
    --fs-md:  1.125rem;    /* body */
    --fs-lg:  1.3125rem;
    --fs-xl:  1.5rem;
    --fs-2xl: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);
    --fs-3xl: clamp(2.125rem, 1.6rem + 2.4vw, 3rem);
    --fs-4xl: clamp(2.5rem, 1.6rem + 4.2vw, 4.5rem);

    --lh-body: 1.55;
    --lh-tight: 1.08;
    --measure: 66ch;

    /* Space (4-px base) */
    --s-1: 0.25rem;
    --s-2: 0.5rem;
    --s-3: 0.75rem;
    --s-4: 1rem;
    --s-5: 1.5rem;
    --s-6: 2rem;
    --s-7: 3rem;
    --s-8: 4rem;
    --s-9: 6rem;

    /* Shape — square plates, slightly softened controls */
    --bw: 1px;
    --bw-strong: 2px;
    --bw-mark: 6px;        /* the accent "marking" bar */
    --r-control: 3px;

    /* Layout */
    --page-max: 76rem;
    --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);

    /* Motion */
    --ease: cubic-bezier(.2, .7, .2, 1);
    --dur: 160ms;
  }

  /* Mode switch: radio buttons (no JS) or data-mode set by optional js/mode.js */
  :root:has(#mode-light:checked), :root[data-mode="light"] { color-scheme: light; }
  :root:has(#mode-dark:checked),  :root[data-mode="dark"]  { color-scheme: dark; }
}

/* ==========================================================================
   BASE — plain HTML looks right without classes
   ========================================================================== */
@layer base {
  html {
    font-family: var(--font);
    font-size: 100%;
    line-height: var(--lh-body);
    background: var(--c-bg);
    color: var(--c-ink);
    font-synthesis: none;
    font-kerning: normal;
    scroll-padding-top: var(--s-8);
    -webkit-font-smoothing: antialiased;
  }
  body {
    font-size: var(--fs-md);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
  }
  main { flex: 1; }

  :lang(hu) { quotes: "„" "”" "»" "«"; }
  :lang(en) { quotes: "“" "”" "‘" "’"; }

  h1, h2, h3, h4, h5, h6 {
    font-stretch: var(--wide);
    font-weight: 800;
    line-height: var(--lh-tight);
    letter-spacing: -0.01em;
    text-wrap: balance;
  }
  h1 { font-size: var(--fs-4xl); letter-spacing: -0.025em; }
  h2 { font-size: var(--fs-3xl); letter-spacing: -0.02em; }
  h3 { font-size: var(--fs-xl); }
  h4 { font-size: var(--fs-lg); font-stretch: var(--semi-wide); font-weight: 700; }
  h5, h6 { font-size: var(--fs-md); font-stretch: var(--normal); font-weight: 700; }

  p, li, dd { text-wrap: pretty; }
  p { max-width: var(--measure); }

  a {
    color: var(--c-link);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
  }
  a:hover { text-decoration-thickness: 0.16em; }

  strong, b { font-weight: 700; }
  small { font-size: var(--fs-sm); }
  em, i { font-style: italic; }
  mark { background: color-mix(in oklab, var(--c-accent) 30%, transparent); color: inherit; padding-inline: 0.1em; }
  time { white-space: nowrap; }
  abbr[title] { text-decoration: underline dotted; cursor: help; }
  q::before { content: open-quote; }
  q::after { content: close-quote; }

  ul, ol { padding-inline-start: 1.25em; }
  li + li { margin-top: var(--s-1); }
  li::marker { color: var(--c-ink-soft); }

  dt { font-weight: 700; }
  dd { margin-inline-start: 0; }

  hr { border: 0; border-top: var(--bw) solid var(--c-line); margin-block: var(--s-6); }

  blockquote {
    border-inline-start: var(--bw-mark) solid var(--c-accent);
    padding-inline-start: var(--s-5);
    font-size: var(--fs-lg);
  }

  code, kbd, samp, pre {
    font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
    font-size: 0.875em;
  }
  code { background: var(--c-surface-2); padding: 0.1em 0.3em; border-radius: var(--r-control); }
  pre {
    background: var(--c-surface-2);
    padding: var(--s-4);
    overflow-x: auto;
    border-radius: var(--r-control);
    line-height: 1.5;
  }
  pre code { background: none; padding: 0; }

  /* Tables: plain <table> is already readable */
  table { width: 100%; font-variant-numeric: tabular-nums; }
  caption { text-align: start; font-weight: 700; font-stretch: var(--semi-wide); padding-bottom: var(--s-3); caption-side: top; }
  th, td { text-align: start; padding: var(--s-3) var(--s-3); border-bottom: var(--bw) solid var(--c-line); vertical-align: top; }
  thead th { border-bottom: var(--bw-strong) solid var(--c-line-strong); font-size: var(--fs-sm); font-weight: 700; vertical-align: bottom; }
  tbody th { font-weight: 600; }

  figure { margin: 0; }
  figcaption { font-size: var(--fs-sm); color: var(--c-ink-soft); margin-top: var(--s-2); }

  img { background: var(--c-surface-2); }

  /* Form controls: base look */
  label { font-weight: 600; font-size: var(--fs-base); }
  input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"]), select, textarea {
    display: block;
    width: 100%;
    min-height: 2.875rem;
    padding: var(--s-2) var(--s-3);
    background: var(--c-surface);
    color: var(--c-ink);
    border: var(--bw) solid var(--c-ink-soft);
    border-radius: var(--r-control);
    font-size: var(--fs-md);
    line-height: 1.4;
  }
  textarea { min-height: 8rem; resize: vertical; }
  select {
    appearance: none;
    padding-inline-end: var(--s-7);
    background-image:
      linear-gradient(45deg, transparent 50%, var(--c-ink) 50%),
      linear-gradient(135deg, var(--c-ink) 50%, transparent 50%);
    background-position: calc(100% - 1.25rem) 55%, calc(100% - 0.875rem) 55%;
    background-size: 0.375rem 0.375rem;
    background-repeat: no-repeat;
  }
  input::placeholder, textarea::placeholder { color: var(--c-ink-soft); opacity: 0.8; }
  input[type="checkbox"], input[type="radio"] { accent-color: var(--c-primary); width: 1.25rem; height: 1.25rem; }
  input:disabled, select:disabled, textarea:disabled { opacity: 0.55; cursor: not-allowed; }
  input:user-invalid, select:user-invalid, textarea:user-invalid { border-color: var(--c-danger); border-width: var(--bw-strong); }

  fieldset { border: var(--bw) solid var(--c-line); padding: var(--s-4) var(--s-5) var(--s-5); border-radius: var(--r-control); }
  legend { font-weight: 700; padding-inline: var(--s-2); }

  button { cursor: pointer; }

  /* Focus: always visible for keyboard users */
  :focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
  input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }

  ::selection { background: color-mix(in oklab, var(--c-accent) 40%, transparent); }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  }
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */
@layer layout {
  .container { width: min(100% - 2 * var(--gutter), var(--page-max)); margin-inline: auto; }
  .container--narrow { --page-max: 48rem; }

  .section { padding-block: clamp(var(--s-7), 6vw, var(--s-9)); }
  .section--tight { padding-block: var(--s-7); }
  .section--alt { background: var(--c-surface-2); }
  .section--surface { background: var(--c-surface); }
  /* The marking bar: a thick accent rule on top of a section */
  .section--marked { border-top: var(--bw-mark) solid var(--c-accent); }

  .section__head { display: grid; gap: var(--s-3); margin-bottom: var(--s-6); max-width: var(--measure); }
  .section__head p { color: var(--c-ink-soft); font-size: var(--fs-lg); }

  /* Stack: vertical rhythm between children */
  .stack { display: flex; flex-direction: column; gap: var(--stack, var(--s-4)); }
  .stack > * { margin: 0; }
  .stack--sm { --stack: var(--s-2); }
  .stack--lg { --stack: var(--s-6); }

  /* Flow: for long-form text (articles). Headings get more room above. */
  .prose > * + * { margin-top: var(--s-4); }
  .prose > :is(h2, h3, h4) { margin-top: var(--s-7); }
  .prose > :is(h2, h3, h4) + * { margin-top: var(--s-3); }
  .prose h2 { font-size: var(--fs-2xl); }
  .prose > .meta + :is(h1, h2) { margin-top: var(--s-2); }
  .prose { hyphens: auto; }

  /* Cluster: inline items that wrap */
  .cluster { display: flex; flex-wrap: wrap; gap: var(--cluster, var(--s-3)); align-items: center; }
  .cluster--between { justify-content: space-between; }

  /* Auto grid: as many columns as fit */
  .grid { display: grid; gap: var(--grid-gap, var(--s-5)); grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--grid-min, 17rem)), 1fr)); }
  .grid--2 { --grid-min: 22rem; }
  .grid--3 { --grid-min: 19.5rem; }
  .grid--4 { --grid-min: 13rem; }

  /* Split: main + side; collapses on narrow screens */
  .split { display: grid; gap: var(--s-7); grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 60rem) {
    .split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
    .split--even { grid-template-columns: 1fr 1fr; }
    .split--reverse { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
    .sticky { position: sticky; top: var(--s-5); }
  }
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */
@layer components {

  /* ---- Skip link ---------------------------------------------------------- */
  .skip-link { position: absolute; left: var(--s-3); top: -10rem; z-index: 100; background: var(--c-primary); color: var(--c-on-primary); padding: var(--s-2) var(--s-4); font-weight: 700; }
  .skip-link:focus { top: var(--s-3); }

  /* ---- Site header & navigation ------------------------------------------ */
  .site-header {
    background: var(--c-surface);
    border-bottom: var(--bw) solid var(--c-line);
    border-top: var(--bw-mark) solid var(--c-accent);
  }
  .site-header__inner { display: flex; align-items: center; gap: var(--s-5); min-height: 4.5rem; flex-wrap: wrap; padding-block: var(--s-2); }
  .brand {
    font-stretch: var(--wide);
    font-weight: 900;
    font-size: var(--fs-lg);
    letter-spacing: -0.02em;
    color: var(--c-ink);
    text-decoration: none;
    line-height: 1;
    margin-inline-end: auto;
  }
  .brand small { display: block; font-stretch: var(--normal); font-weight: 500; font-size: var(--fs-sm); color: var(--c-ink-soft); letter-spacing: 0; margin-top: var(--s-1); }

  .nav ul { list-style: none; padding: 0; display: flex; gap: var(--s-1); flex-wrap: wrap; }
  .nav li { margin: 0; }
  .nav a {
    display: block;
    padding: var(--s-2) var(--s-3);
    color: var(--c-ink);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--fs-base);
    border-bottom: 3px solid transparent;
  }
  .nav a:hover { border-bottom-color: var(--c-line); }
  .nav a[aria-current="page"] { border-bottom-color: var(--c-accent); }

  /* Mobile: nav becomes a popover opened by .nav-toggle (HTML only, no JS) */
  .site-header .nav-toggle { display: none; }
  @media (max-width: 47.99rem) {
    .site-header .nav-toggle { display: inline-flex; }
    .nav[popover] {
      position: fixed;
      inset: 0 0 auto auto;
      width: min(20rem, 100vw);
      height: 100dvh;
      margin: 0;
      border: 0;
      border-inline-start: var(--bw-mark) solid var(--c-accent);
      background: var(--c-surface);
      color: var(--c-ink);
      padding: var(--s-6) var(--s-5);
    }
    .nav[popover]::backdrop { background: rgb(0 0 0 / .45); }
    .nav[popover] ul { flex-direction: column; }
    .nav[popover] a { font-size: var(--fs-lg); border-bottom: var(--bw) solid var(--c-line); }
    .nav .nav__close { margin-bottom: var(--s-5); }
  }
  @media (min-width: 48rem) {
    /* Desktop: the same element shows inline, popover behaviour ignored */
    .nav[popover] { display: block; position: static; inset: auto; width: auto; height: auto; margin: 0; padding: 0; border: 0; background: none; color: inherit; overflow: visible; }
    .nav .nav__close { display: none; }
  }

  /* ---- Mode switch (Auto / Light / Dark) — radios, no JS ----------------- */
  .mode-switch, .seg {
    display: inline-flex;
    border: var(--bw) solid var(--c-line);
    border-radius: var(--r-control);
    padding: 2px;
    gap: 2px;
    margin: 0;
    background: var(--c-bg);
  }
  .mode-switch legend, .seg legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .mode-switch label, .seg label {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: var(--s-1) var(--s-3);
    font-size: var(--fs-sm);
    font-weight: 600;
    border-radius: 2px;
    cursor: pointer;
    color: var(--c-ink-soft);
  }
  .mode-switch input, .seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
  .mode-switch label:has(:checked), .seg label:has(:checked) { background: var(--c-ink); color: var(--c-bg); }
  .mode-switch label:has(:focus-visible), .seg label:has(:focus-visible) { outline: 3px solid var(--c-focus); outline-offset: 1px; }

  /* ---- Language switch ---------------------------------------------------- */
  .lang-switch { display: inline-flex; gap: var(--s-1); list-style: none; padding: 0; font-size: var(--fs-sm); font-weight: 700; }
  .lang-switch li { margin: 0; }
  .lang-switch a { display: block; padding: var(--s-1) var(--s-2); color: var(--c-ink-soft); text-decoration: none; border-radius: var(--r-control); }
  .lang-switch a[aria-current="true"] { color: var(--c-ink); box-shadow: inset 0 -3px 0 var(--c-accent); border-radius: 0; }

  /* ---- Breadcrumb --------------------------------------------------------- */
  .breadcrumb ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); font-size: var(--fs-sm); }
  .breadcrumb li { margin: 0; color: var(--c-ink-soft); }
  .breadcrumb li + li::before { content: "/"; margin-inline-end: var(--s-2); color: var(--c-line); }
  .breadcrumb a { color: var(--c-ink-soft); }
  .breadcrumb [aria-current="page"] { color: var(--c-ink); font-weight: 600; }

  /* ---- Site footer -------------------------------------------------------- */
  .site-footer { background: var(--c-surface); border-top: var(--bw) solid var(--c-line); padding-block: var(--s-7) var(--s-6); font-size: var(--fs-base); margin-top: auto; }
  .site-footer h2 { font-size: var(--fs-base); font-stretch: var(--semi-wide); margin-bottom: var(--s-3); }
  .site-footer ul { list-style: none; padding: 0; }
  .site-footer a { color: var(--c-ink); }
  .site-footer__base { max-width: none; margin-top: var(--s-7); padding-top: var(--s-4); border-top: var(--bw) solid var(--c-line); color: var(--c-ink-soft); font-size: var(--fs-sm); }

  .site-footer__base:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

  /* ---- Hero --------------------------------------------------------------- */
  .hero { padding-block: clamp(var(--s-7), 7vw, var(--s-9)); }
  .hero__grid { display: grid; gap: var(--s-7); align-items: center; }
  @media (min-width: 60rem) { .hero__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
  .hero__title { font-size: var(--fs-4xl); font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
  .hero__lead { font-size: var(--fs-lg); color: var(--c-ink-soft); margin-top: var(--s-5); }
  .hero__actions { margin-top: var(--s-6); }
  .hero__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

  /* Big text treatments */
  .display { font-size: var(--fs-4xl); font-stretch: var(--wide); font-weight: 900; line-height: 1; letter-spacing: -0.03em; }
  .lead { font-size: var(--fs-lg); line-height: 1.5; }
  .meta { font-size: var(--fs-sm); color: var(--c-ink-soft); }
  .meta-list { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); list-style: none; padding: 0; font-size: var(--fs-sm); color: var(--c-ink-soft); }
  .meta-list li { margin: 0; }
  .meta-list dt, .meta-list .meta-list__label { font-weight: 400; }

  /* ---- Buttons ------------------------------------------------------------ */
  .btn {
    --btn-bg: var(--c-surface);
    --btn-fg: var(--c-ink);
    --btn-bd: var(--c-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    min-height: 2.875rem;
    padding: var(--s-2) var(--s-5);
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: var(--bw-strong) solid var(--btn-bd);
    border-radius: var(--r-control);
    font-size: var(--fs-base);
    font-weight: 700;
    font-stretch: var(--semi-wide);
    line-height: 1.1;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
  }
  .btn:hover { --btn-bg: var(--c-surface-2); }
  .btn:active { translate: 0 1px; }
  .btn--primary { --btn-bg: var(--c-primary); --btn-fg: var(--c-on-primary); --btn-bd: var(--c-primary); }
  .btn--primary:hover { --btn-bg: color-mix(in oklab, var(--c-primary) 86%, var(--c-ink)); --btn-bd: var(--btn-bg); }
  .btn--accent { --btn-bg: var(--c-accent); --btn-fg: var(--c-on-accent); --btn-bd: var(--c-accent); }
  .btn--accent:hover { --btn-bg: color-mix(in oklab, var(--c-accent) 86%, var(--c-ink)); --btn-bd: var(--btn-bg); }
  .btn--ghost { --btn-bg: transparent; --btn-bd: transparent; text-decoration: underline; text-underline-offset: 0.2em; }
  .btn--ghost:hover { --btn-bg: var(--c-surface-2); }
  .btn--danger { --btn-bg: var(--c-danger); --btn-fg: var(--c-surface); --btn-bd: var(--c-danger); }
  .btn--sm { min-height: 2.25rem; padding: var(--s-1) var(--s-3); font-size: var(--fs-sm); }
  .btn--lg { min-height: 3.5rem; padding: var(--s-3) var(--s-6); font-size: var(--fs-md); }
  .btn--block { width: 100%; }
  .btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
  .btn-group { display: flex; flex-wrap: wrap; gap: var(--s-3); }

  /* ---- Badges & status ---------------------------------------------------- */
  .badge {
    --badge-c: var(--c-ink-soft);
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.15em 0.6em;
    font-size: var(--fs-sm);
    font-weight: 700;
    line-height: 1.4;
    color: var(--badge-c);
    background: color-mix(in oklab, var(--badge-c) 12%, var(--c-surface));
    border: var(--bw) solid color-mix(in oklab, var(--badge-c) 45%, transparent);
    border-radius: var(--r-control);
    white-space: nowrap;
  }
  /* The square marker repeats the colour; the word carries the meaning */
  .badge--status::before { content: ""; width: 0.55em; height: 0.55em; background: currentColor; }
  .badge--success { --badge-c: var(--c-success); }
  .badge--warning { --badge-c: var(--c-warning); }
  .badge--danger  { --badge-c: var(--c-danger); }
  .badge--info    { --badge-c: var(--c-info); }
  .badge--solid { color: var(--c-on-accent); background: var(--c-accent); border-color: var(--c-accent); }

  /* ---- Lists -------------------------------------------------------------- */
  .list-plain { list-style: none; padding: 0; }
  .list-inline { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
  .list-inline li { margin: 0; }

  .list-check, .list-cross { list-style: none; padding: 0; }
  .list-check li, .list-cross li { position: relative; padding-inline-start: 1.75em; }
  .list-check li + li, .list-cross li + li { margin-top: var(--s-2); }
  .list-check li::before, .list-cross li::before {
    position: absolute; inset-inline-start: 0; top: 0.15em;
    width: 1.2em; height: 1.2em;
    display: grid; place-items: center;
    font-size: 0.85em; font-weight: 900; line-height: 1;
  }
  .list-check li::before { content: "✓"; background: var(--c-success); color: var(--c-surface); }
  .list-cross li::before { content: "✕"; background: var(--c-surface-2); color: var(--c-ink-soft); border: var(--bw) solid var(--c-line); }

  .list-divided { list-style: none; padding: 0; border-top: var(--bw) solid var(--c-line); }
  .list-divided > li { margin: 0; padding-block: var(--s-3); border-bottom: var(--bw) solid var(--c-line); }

  /* Steps: only for real sequences (a process the customer goes through) */
  .steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
  .steps > li { counter-increment: step; margin: 0; padding-top: var(--s-4); border-top: var(--bw-strong) solid var(--c-line-strong); }
  .steps > li::before {
    content: counter(step);
    display: block;
    font-size: var(--fs-3xl);
    font-stretch: var(--wide);
    font-weight: 900;
    line-height: 1;
    color: var(--c-accent-text);
    margin-bottom: var(--s-3);
    font-variant-numeric: tabular-nums;
  }
  .steps h3 { font-size: var(--fs-lg); margin-bottom: var(--s-2); }
  .steps p { color: var(--c-ink-soft); font-size: var(--fs-base); }

  /* Definition list as key / value rows */
  .dl-rows { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; border-top: var(--bw) solid var(--c-line); }
  .dl-rows > dt, .dl-rows > dd { padding-block: var(--s-3); border-bottom: var(--bw) solid var(--c-line); }
  .dl-rows > dt { padding-inline-end: var(--s-5); font-weight: 600; }

  /* ---- Features ----------------------------------------------------------- */
  .features { display: grid; gap: var(--s-6) var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); list-style: none; padding: 0; }
  .feature { margin: 0; padding-top: var(--s-4); border-top: var(--bw-mark) solid var(--c-accent); }
  .feature h3 { font-size: var(--fs-lg); margin-bottom: var(--s-2); }
  .feature p { color: var(--c-ink-soft); font-size: var(--fs-base); }

  /* ---- Cards -------------------------------------------------------------- */
  .card {
    display: flex;
    flex-direction: column;
    background: var(--c-surface);
    border: var(--bw) solid var(--c-line);
    color: var(--c-ink);
    min-width: 0;
  }
  .card__media { position: relative; }
  .card__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
  .card__media .badge { position: absolute; top: var(--s-3); left: var(--s-3); }
  .card__body { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5); flex: 1; }
  .card__title { font-size: var(--fs-xl); }
  .card__title a { color: inherit; text-decoration: none; }
  .card__title a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
  .card:has(.card__title a) { position: relative; }
  .card:has(.card__title a:hover) { border-color: var(--c-line-strong); }
  .card:has(.card__title a:focus-visible) { outline: 3px solid var(--c-focus); outline-offset: 2px; }
  .card__title a:focus-visible { outline: none; }
  .card__footer {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
    padding: var(--s-4) var(--s-5);
    border-top: var(--bw) solid var(--c-line);
    background: var(--c-bg);
  }
  .card__footer .btn { position: relative; z-index: 1; }
  .card--marked { border-top: var(--bw-mark) solid var(--c-accent); }

  /* ---- Spec plate (machine / container data) -----------------------------
     Inspired by stamped data plates: label small, value large and tabular.  */
  .spec { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); border-top: var(--bw) solid var(--c-line); border-left: var(--bw) solid var(--c-line); margin: 0; }
  .spec > div { padding: var(--s-2) var(--s-3); border-right: var(--bw) solid var(--c-line); border-bottom: var(--bw) solid var(--c-line); min-width: 0; }
  .spec dt { font-size: var(--fs-sm); font-weight: 500; color: var(--c-ink-soft); line-height: 1.3; }
  .spec dd { font-size: var(--fs-lg); font-weight: 700; font-stretch: var(--semi-wide); font-variant-numeric: tabular-nums; line-height: 1.25; }
  .spec dd small { font-size: var(--fs-sm); font-weight: 500; font-stretch: var(--normal); color: var(--c-ink-soft); }
  .spec--plate { border: var(--bw-strong) solid var(--c-line-strong); background: var(--c-surface); }
  .spec--plate > div { border-color: var(--c-line); }
  .spec--compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 6.5rem), 1fr)); }
  .spec--compact dd { font-size: var(--fs-md); }

  /* ---- Data tables -------------------------------------------------------- */
  .table-wrap { position: relative; overflow-x: auto; border: var(--bw) solid var(--c-line); background: var(--c-surface); }
  .table-wrap > table { min-width: 36rem; }
  .table-wrap--fit > table { min-width: 0; }   /* few columns: fit the phone instead of scrolling */
  .table-wrap caption { padding: var(--s-4) var(--s-4) var(--s-3); }
  .table th:first-child, .table td:first-child { padding-inline-start: var(--s-4); }
  .table th:last-child, .table td:last-child { padding-inline-end: var(--s-4); }
  .table tbody tr:last-child > * { border-bottom: 0; }
  .table--striped tbody tr:nth-child(even) { background: color-mix(in oklab, var(--c-surface-2) 55%, transparent); }
  .table--compact th, .table--compact td { padding-block: var(--s-2); font-size: var(--fs-base); }
  .table tbody tr:hover { background: color-mix(in oklab, var(--c-accent) 7%, transparent); }
  /* Comparison: the highlighted column */
  .table .is-highlight { background: color-mix(in oklab, var(--c-accent) 12%, transparent); }
  thead .is-highlight { box-shadow: inset 0 var(--bw-mark) 0 var(--c-accent); }
  .num, td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .yes { color: var(--c-success); font-weight: 700; }
  .no { color: var(--c-ink-soft); }

  /* ---- Price -------------------------------------------------------------- */
  .price { display: inline-flex; flex-direction: column; line-height: 1.15; font-variant-numeric: tabular-nums; }
  .price__main { font-size: var(--fs-xl); font-weight: 800; font-stretch: var(--semi-wide); white-space: nowrap; }
  .price__alt { font-size: var(--fs-sm); color: var(--c-ink-soft); white-space: nowrap; }
  .price__unit { font-size: var(--fs-sm); font-weight: 500; font-stretch: var(--normal); color: var(--c-ink-soft); }
  .price--lg .price__main { font-size: var(--fs-3xl); font-stretch: var(--wide); font-weight: 900; }

  /* Price list with dotted leaders */
  .price-list { list-style: none; padding: 0; }
  .price-list > li { margin: 0; padding-block: var(--s-3); border-bottom: var(--bw) solid var(--c-line); }
  .price-list__row { display: flex; align-items: baseline; gap: var(--s-3); }
  .price-list__name { font-weight: 700; }
  .price-list__row::after { content: none; }
  .price-list__leader { flex: 1; min-width: var(--s-5); border-bottom: 2px dotted var(--c-line); translate: 0 -0.3em; }
  .price-list__price { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
  .price-list__price small { display: block; font-weight: 500; color: var(--c-ink-soft); }
  .price-list__desc { color: var(--c-ink-soft); font-size: var(--fs-base); margin-top: var(--s-1); max-width: 52ch; }
  .price-list__group { font-size: var(--fs-lg); margin-top: var(--s-6); margin-bottom: var(--s-2); }
  .price-list__group:first-child { margin-top: 0; }

  /* ---- Notices / callouts ------------------------------------------------- */
  .notice {
    --notice-c: var(--c-ink-soft);
    padding: var(--s-4) var(--s-5);
    background: color-mix(in oklab, var(--notice-c) 9%, var(--c-surface));
    border-inline-start: var(--bw-mark) solid var(--notice-c);
    max-width: 52rem;
  }
  .notice > * + * { margin-top: var(--s-2); }
  .notice__title { font-weight: 800; font-stretch: var(--semi-wide); font-size: var(--fs-md); }
  .notice--info    { --notice-c: var(--c-info); }
  .notice--success { --notice-c: var(--c-success); }
  .notice--warning { --notice-c: var(--c-warning); }
  .notice--danger  { --notice-c: var(--c-danger); }

  /* ---- Forms -------------------------------------------------------------- */
  .form { display: grid; gap: var(--s-5); }
  .form__row { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
  .field { display: grid; gap: var(--s-2); align-content: start; }
  .field__hint { font-size: var(--fs-sm); color: var(--c-ink-soft); }
  .field__error { font-size: var(--fs-sm); font-weight: 700; color: var(--c-danger); display: none; }
  .field:has(:user-invalid) .field__error { display: block; }
  .field label .req { color: var(--c-danger); }
  .field--invalid input, .field--invalid select, .field--invalid textarea { border-color: var(--c-danger); border-width: var(--bw-strong); }
  .field--invalid .field__error { display: block; }
  .choice { display: flex; align-items: flex-start; gap: var(--s-3); font-weight: 400; font-size: var(--fs-md); cursor: pointer; }
  .choice input { flex: none; margin-top: 0.2em; }
  .choices { display: grid; gap: var(--s-3); }
  .choices--inline { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); }
  .input-group { display: flex; align-items: stretch; }
  .input-group input { border-start-end-radius: 0; border-end-end-radius: 0; }
  .input-group__addon { display: grid; place-items: center; padding-inline: var(--s-3); border: var(--bw) solid var(--c-ink-soft); border-inline-start: 0; background: var(--c-surface-2); font-weight: 600; border-start-end-radius: var(--r-control); border-end-end-radius: var(--r-control); }

  /* ---- Gallery + lightbox (HTML popover, no JS) --------------------------- */
  .gallery { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); list-style: none; padding: 0; }
  .gallery li { margin: 0; }
  .gallery__item { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
  .gallery__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: filter var(--dur) var(--ease); }
  .gallery__item:hover img { filter: brightness(1.08); }
  .gallery--feature li:first-child { grid-column: span 2; grid-row: span 2; }
  .gallery--feature li:first-child img { height: 100%; }
  @media (max-width: 30rem) { .gallery--feature li:first-child { grid-column: auto; grid-row: auto; } }

  .lightbox[popover] {
    width: min(100vw - 2rem, 70rem);
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: 0;
    border: 0;
    background: var(--c-surface);
    color: var(--c-ink);
    overflow: auto;
  }
  .lightbox::backdrop { background: rgb(10 12 14 / .85); }
  .lightbox img { width: 100%; max-height: calc(100dvh - 9rem); object-fit: contain; background: #000; }
  .lightbox__bar { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); flex-wrap: wrap; }
  .lightbox__bar { margin: 0; font-size: var(--fs-base); color: var(--c-ink); }
  .lightbox__caption { margin-inline-end: auto; }
  .lightbox[popover]:popover-open { animation: lightbox-in 180ms var(--ease); }
  @keyframes lightbox-in { from { opacity: 0; scale: .98; } }

  /* ---- Accordion (details / summary) -------------------------------------- */
  .accordion { border-top: var(--bw) solid var(--c-line); }
  .accordion details { border-bottom: var(--bw) solid var(--c-line); }
  .accordion summary {
    display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
    padding-block: var(--s-4);
    font-weight: 700; font-stretch: var(--semi-wide);
    cursor: pointer; list-style: none;
  }
  .accordion summary::-webkit-details-marker { display: none; }
  .accordion summary::after { content: "+"; font-size: var(--fs-xl); font-weight: 400; line-height: 1; flex: none; }
  .accordion details[open] summary::after { content: "−"; }
  .accordion details > :not(summary) { padding-bottom: var(--s-4); color: var(--c-ink-soft); }

  /* ---- Stat tiles --------------------------------------------------------- */
  .stats { container-type: inline-size; display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); border-top: var(--bw-strong) solid var(--c-line-strong); list-style: none; padding: 0; }
  .stat { margin: 0; padding: var(--s-4) var(--s-5) var(--s-5) 0; display: flex; flex-direction: column; gap: var(--s-1); }
  .stat + .stat { padding-inline-start: var(--s-5); border-inline-start: var(--bw) solid var(--c-line); }
  @media (max-width: 30rem) { .stat + .stat { padding-inline-start: 0; border-inline-start: 0; border-top: var(--bw) solid var(--c-line); } }
  .stat__value { order: 1; font-size: clamp(2rem, 5.2cqi, 3rem); white-space: nowrap; font-stretch: var(--wide); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
  .stat__value small { font-size: 0.45em; font-weight: 700; letter-spacing: 0; }
  .stat__label { order: 2; font-weight: 600; font-size: var(--fs-base); }
  .stat__note { order: 3; font-size: var(--fs-sm); color: var(--c-ink-soft); }
  .stat__delta { order: 3; font-size: var(--fs-sm); font-weight: 700; }
  .stat__delta--bad { color: var(--c-danger); }
  .stat__delta--good { color: var(--c-success); }

  /* ---- Charts: pure CSS ---------------------------------------------------
     Values come from an inline custom property: style="--v: 62"  (0–100).
     The number is always printed as text too, so the chart never relies on
     length or colour alone.                                                 */

  /* Progress */
  .progress { display: grid; gap: var(--s-2); }
  .progress__head { display: flex; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-base); }
  .progress__label { font-weight: 600; }
  .progress__value { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
  .progress__track { height: 0.875rem; background: var(--c-surface-2); border: var(--bw) solid var(--c-line); }
  .progress__bar { height: 100%; width: calc(min(var(--v, 0), 100) * 1%); background: var(--bar-c, var(--c-primary)); }
  .progress--danger { --bar-c: var(--c-danger); }
  .progress--success { --bar-c: var(--c-success); }
  .progress--warning { --bar-c: var(--c-warning); }
  .progress--thin .progress__track { height: 0.5rem; }

  /* Horizontal bar chart (semantic table) */
  .chart-bars, .chart-stacked { position: relative; width: 100%; }
  .chart-bars th, .chart-bars td { border: 0; padding-block: var(--s-2); vertical-align: middle; }
  .chart-bars thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .chart-bars tbody th { width: 30%; font-weight: 600; font-size: var(--fs-base); padding-inline: 0 var(--s-4); }
  .chart-bars td { padding-inline: 0; }
  .chart-bars__cell { display: flex; align-items: center; gap: var(--s-3); }
  .chart-bars__bar { display: block; height: 1.5rem; width: calc(var(--v, 0) * 0.82%); min-width: 2px; background: var(--bar-c, var(--c-series-1)); }
  .chart-bars__value { font-variant-numeric: tabular-nums; font-weight: 700; font-size: var(--fs-base); white-space: nowrap; }
  .chart-bars tr.is-highlight { --bar-c: var(--c-danger); }
  @media (max-width: 36rem) {
    .chart-bars tbody tr { display: grid; padding-block: var(--s-2); }
    .chart-bars tbody th { width: auto; padding-bottom: 0; }
  }

  /* Stacked bar: one row split into parts */
  .stacked { position: relative; display: flex; height: 2rem; list-style: none; padding: 0; gap: 2px; background: var(--c-bg); }
  .stacked li { margin: 0; flex: var(--v, 1) 1 0; min-width: 2px; background: var(--seg-c, var(--c-series-1)); }
  .stacked--thin { height: 0.75rem; }
  .s1 { --seg-c: var(--c-series-1); }
  .s2 { --seg-c: var(--c-series-2); }
  .s3 { --seg-c: var(--c-series-3); }
  .s4 { --seg-c: var(--c-series-4); }
  .s-loss { --seg-c: var(--c-loss); }
  .s-recovered { --seg-c: var(--c-recovered); }
  .s-open { --seg-c: var(--c-surface-2); }

  /* Legend */
  .legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); list-style: none; padding: 0; font-size: var(--fs-sm); margin-top: var(--s-3); }
  .legend li { margin: 0; display: inline-flex; align-items: center; gap: var(--s-2); }
  .legend li::before { content: ""; width: 0.9em; height: 0.9em; background: var(--seg-c, var(--c-series-1)); border: var(--bw) solid color-mix(in oklab, var(--c-ink) 20%, transparent); }
  .legend .legend__value { font-weight: 700; font-variant-numeric: tabular-nums; }

  /* Stacked bar chart: several rows (table) */
  .chart-stacked th, .chart-stacked td { border: 0; padding: var(--s-2) 0; vertical-align: middle; }
  .chart-stacked thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .chart-stacked tbody th { width: 30%; padding-inline-end: var(--s-4); font-size: var(--fs-base); }
  .chart-stacked td.num { width: 7rem; padding-inline-start: var(--s-3); font-weight: 700; font-size: var(--fs-base); }

  .chart { display: grid; gap: var(--s-4); }
  .chart .chart__title, .chart__title { font-size: var(--fs-lg); font-weight: 800; font-stretch: var(--semi-wide); color: var(--c-ink); line-height: 1.25; margin: 0; }
  .chart__source { font-size: var(--fs-sm); color: var(--c-ink-soft); }

  /* ---- Lost money tracker ------------------------------------------------- */
  .tracker {
    background: var(--c-surface);
    border: var(--bw-strong) solid var(--c-line-strong);
    border-top: var(--bw-mark) solid var(--c-loss);
    padding: clamp(var(--s-5), 4vw, var(--s-7));
    display: grid;
    gap: var(--s-5);
  }
  .tracker__label { font-size: var(--fs-lg); font-weight: 700; font-stretch: var(--semi-wide); }
  .tracker__amount { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s-3); line-height: 0.95; }
  .tracker__alt { font-size: var(--fs-lg); color: var(--c-ink-soft); font-variant-numeric: tabular-nums; }
  .tracker__updated { font-size: var(--fs-sm); color: var(--c-ink-soft); }

  /* Animated counter: CSS counts from 0 to --to (integer) once on load.
     The real value sits in .sr-only text for screen readers and copy/paste.
     Integers up to ~2 billion are safe; show large sums in "Mrd Ft"/"bn".  */
  .counter {
    font-size: clamp(3rem, 1.5rem + 7vw, 7.5rem);
    font-stretch: var(--wide);
    font-weight: 900;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    color: var(--c-loss);
  }
  .counter__num { --n: var(--to); counter-reset: n var(--n); animation: count-up 2.4s var(--ease) both; }
  .counter__num::before { content: counter(n); }
  .counter__unit { font-size: 0.4em; letter-spacing: -0.01em; }
  @keyframes count-up { from { --n: 0; } }

  /* ---- Timeline (real chronology only) ------------------------------------ */
  .timeline { list-style: none; padding: 0; border-inline-start: var(--bw-strong) solid var(--c-line-strong); margin-inline-start: 0.4rem; }
  .timeline > li { position: relative; margin: 0; padding: 0 0 var(--s-5) var(--s-5); }
  .timeline > li::before { content: ""; position: absolute; inset-inline-start: calc(-0.4rem - 1px); top: 0.35em; width: 0.8rem; height: 0.8rem; background: var(--c-bg); border: var(--bw-strong) solid var(--c-line-strong); }
  .timeline > li.is-key::before { background: var(--c-accent); border-color: var(--c-accent); }
  .timeline time { display: block; font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--c-ink-soft); }
  .timeline h3 { font-size: var(--fs-md); font-stretch: var(--semi-wide); margin-block: var(--s-1); }
  .timeline p { font-size: var(--fs-base); color: var(--c-ink-soft); }

  /* ---- Quotes & sources --------------------------------------------------- */
  .quote { border: 0; padding: 0; font-size: var(--fs-xl); font-stretch: var(--semi-wide); font-weight: 600; line-height: 1.3; max-width: 40ch; }
  .quote p::before { content: open-quote; }
  .quote p::after { content: close-quote; }
  .quote footer { margin-top: var(--s-3); font-size: var(--fs-base); font-weight: 400; font-stretch: var(--normal); color: var(--c-ink-soft); }

  .ref { font-size: 0.7em; font-weight: 700; vertical-align: super; line-height: 0; text-decoration: none; padding-inline: 0.15em; }
  .sources { font-size: var(--fs-sm); color: var(--c-ink-soft); padding-inline-start: 1.5em; }
  .sources li { padding-inline-start: var(--s-1); }
  .sources li:target { background: color-mix(in oklab, var(--c-accent) 18%, transparent); color: var(--c-ink); }
  .sources a { overflow-wrap: anywhere; }

  /* ---- Pagination --------------------------------------------------------- */
  .pagination ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1); }
  .pagination li { margin: 0; }
  .pagination a, .pagination span {
    display: grid; place-items: center; min-width: 2.75rem; height: 2.75rem; padding-inline: var(--s-3);
    border: var(--bw) solid var(--c-line); background: var(--c-surface); color: var(--c-ink);
    text-decoration: none; font-weight: 600; font-variant-numeric: tabular-nums; border-radius: var(--r-control);
  }
  .pagination a:hover { border-color: var(--c-line-strong); }
  .pagination [aria-current="page"] { background: var(--c-ink); color: var(--c-bg); border-color: var(--c-ink); }

  /* ---- Contact block ------------------------------------------------------ */
  .contact-list { list-style: none; padding: 0; display: grid; gap: var(--s-4); }
  .contact-list li { margin: 0; display: grid; }
  .contact-list .meta { order: -1; }
  .contact-list a { font-size: var(--fs-lg); font-weight: 700; font-stretch: var(--semi-wide); color: var(--c-ink); }
}

/* ==========================================================================
   UTILITIES — few, on purpose
   ========================================================================== */
@layer utilities {
  .sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .soft { color: var(--c-ink-soft); }
  .wide { font-stretch: var(--wide); }
  .nowrap { white-space: nowrap; }
  .mt-0 { margin-top: 0 !important; }
  .mt-4 { margin-top: var(--s-4) !important; }
  .mt-6 { margin-top: var(--s-6) !important; }
  .mt-7 { margin-top: var(--s-7) !important; }
  .scheme-dark { color-scheme: dark; background: var(--c-bg); color: var(--c-ink); }
  .scheme-light { color-scheme: light; background: var(--c-bg); color: var(--c-ink); }
}

/* ---------- Print -------------------------------------------------------- */
@media print {
  :root { color-scheme: light !important; }
  .site-header nav, .nav-toggle, .mode-switch, .lang-switch, .lightbox { display: none !important; }
  .counter__num { animation: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
