/* f1gures Sharp component library (redesign stage 2).
   .s-* classes for src/components/sharp/. Tokens only (public/css/app.css
   :root for dark, html.light for light); no hex here. Linked last from
   BaseLayout. Behaviour: public/js/sharp.js. Spec: design-system/TOKENS.md
   §11 and the catalogue at design-system/sharp.html.
   Rules: hard corners, condensed uppercase labels, mono numerics, team
   colour only on strips / rules / dots / chip edges / bar fills (--tc),
   --accent red at most once per screen. Breakpoint: 720px. */

/* ── Base atoms ─────────────────────────────────────────────────────── */
.s-eyebrow {
  margin: 0; font-family: var(--f-mono); font-size: var(--fs-label); font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-3);
}
.s-link {
  font-family: var(--f-display); font-weight: 700; font-size: 12.5px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-1);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 4px;
}
.s-link:hover { text-decoration-thickness: 2px; }
.s-page :focus-visible, .s-card :focus-visible, .s-tabs :focus-visible, .s-chips :focus-visible,
.s-legend :focus-visible, .s-rail :focus-visible, .s-scrub:focus-visible, .s-btn:focus-visible,
.s-ibtn:focus-visible, .s-pager :focus-visible, .s-ll :focus-visible, .s-input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.s-page { max-width: var(--w-page); }
.s-page--read { max-width: var(--w-read); }
.s-page--narrow { max-width: var(--w-narrow); }

/* ── PageHeader ─────────────────────────────────────────────────────── */
.s-ph { display: grid; gap: 10px; margin: 0 0 20px; }
.s-ph-back {
  display: inline-flex; align-items: center; gap: 6px; width: max-content;
  font-family: var(--f-display); font-weight: 700; font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--fg-3); text-decoration: none;
}
.s-ph-back:hover { color: var(--fg-1); }
.s-ph-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.s-ph-text { display: grid; gap: 6px; min-width: 0; }
.s-ph-title {
  margin: 0; font-family: var(--f-display); font-weight: 800; font-size: var(--fs-title);
  line-height: 0.95; letter-spacing: 0.005em; text-transform: uppercase; color: var(--fg-1);
  overflow-wrap: break-word;
}
/* No intro paragraph (review round 2): only a short status line, `meta`. */
.s-ph--article .s-ph-dek { margin: 0; font-size: 17px; color: var(--fg-2); max-width: 64ch; }
.s-ph-meta { margin: 0; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); }
.s-ph--article .s-ph-title { text-transform: none; letter-spacing: 0; line-height: 1.02; }
.s-ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* App feel on phone: the toolbar carries the title and the back arrow, so the
   in-page eyebrow, title and back link go below 720px (the title stays for
   screen readers and search engines). Article headers keep their headline:
   on a post or guide chapter it is content, not a page label. */
@media (max-width: 720px) {
  .s-ph-back, .s-ph:not(.s-ph--article) .s-eyebrow { display: none; }
  .s-ph:not(.s-ph--article) .s-ph-title {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .s-ph:not(.s-ph--article):not(:has(.s-ph-meta, .s-ph-actions)) { margin: 0; }
}

/* ── SectionHead ────────────────────────────────────────────────────── */
.s-sh {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end;
  row-gap: 7px; column-gap: 12px; margin: 28px 0 14px;
}
.s-sh-title {
  margin: 0; display: flex; align-items: baseline; gap: 10px; min-width: 0;
  font-family: var(--f-display); font-weight: 800; font-size: var(--fs-section);
  letter-spacing: 0.02em; text-transform: uppercase; line-height: 1; color: var(--fg-1);
}
.s-sh-count { font-family: var(--f-mono); font-weight: 500; font-size: 12px; letter-spacing: 0.06em; color: var(--fg-3); }
.s-sh-rule {
  grid-column: 1 / -1; height: var(--rule-h);
  background: linear-gradient(90deg, var(--tc, var(--accent)) var(--rule-accent-w), var(--line-2) var(--rule-accent-w));
}
.s-sh:not(.s-sh--team) .s-sh-rule { --tc: var(--accent); }
@media (max-width: 720px) { .s-sh-title { font-size: 26px; } }

/* ── Card ───────────────────────────────────────────────────────────── */
.s-card {
  position: relative; display: block; min-width: 0;
  background: var(--bg-2); color: var(--fg-1);
  border: 0; border-top: 2px solid var(--card-rule);
  text-decoration: none;
}
.s-card-body { padding: 16px; }
.s-card--flush > .s-card-body { padding: 0; }
.s-card--team { border-top-color: var(--tc, var(--team-fallback)); }
.s-card--accent, .s-card--next { border-top-color: var(--accent); }
.s-card--next { background: linear-gradient(var(--accent-glow), var(--accent-glow)), var(--bg-2); }
.s-card--link { cursor: pointer; transition: background var(--mo) ease; }
.s-card--link:hover { background: var(--bg-hover); }
/* No corner mark on link cards (review round 2: read as a glitch); the
   hover tint and the card's own content say it opens. */
.s-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line-1);
}
.s-card-title {
  margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 15px;
  letter-spacing: 0.1em; text-transform: uppercase;
}

/* ── Grid ───────────────────────────────────────────────────────────── */
.s-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 14px; align-items: start; }
.s-grid--gap-s { gap: 8px; }
.s-grid--gap-l { gap: 20px; }
@media (max-width: 720px) { .s-grid { grid-template-columns: repeat(var(--mcols, 1), minmax(0, 1fr)); } }

/* ── Tabs ───────────────────────────────────────────────────────────── */
/* The grey 2px baseline is painted inside the list and the 3px red bar
   inside the active tab (inset shadows), never with a negative margin: the
   list scrolls sideways (overflow-x), which also clips vertically, and the
   old margin-bottom: -2px trick lost the bar's lower part to that clip (a
   hairline, or nothing, on phones; review round 2, 13 Nov). */
.s-tabs { position: relative; }
.s-tabs--sticky {
  position: sticky; top: var(--nav-h); z-index: var(--z-sticky);
  background: var(--bg-1);
}
@media (max-width: 720px) { .s-tabs--sticky { top: var(--topbar-h); } }
.s-tabs-list { display: flex; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; box-shadow: inset 0 -2px 0 var(--line-2); }
.s-tabs-list::-webkit-scrollbar { display: none; }
.s-tab {
  flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 14px 14px; margin: 0; min-height: 44px;
  background: transparent; border: 0; border-radius: 0; box-shadow: none; cursor: pointer;
  font-family: var(--f-display); font-weight: 700; font-size: 14px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fg-3); text-decoration: none; white-space: nowrap;
  transition: color var(--mo) ease;
}
.s-tab:hover { color: var(--fg-1); }
.s-tab[aria-selected="true"], .s-tab[aria-current="page"] { color: var(--fg-1); box-shadow: inset 0 -3px 0 var(--accent); }
.s-tabs--s .s-tab { font-size: 12.5px; padding: 9px 10px 11px; min-height: 38px; }
/* The ring sits inside the tab: the scrolling list would clip one outside. */
.s-tabs .s-tab:focus-visible { outline-offset: -2px; }
.s-tabs--mobile-only { display: none; }
@media (max-width: 720px) { .s-tabs--mobile-only { display: block; } }
/* App feel on phones (9 Nov): page-level tab rows run edge to edge right
   under the toolbar (the type tabs) or stick under it (sticky); three or
   fewer tabs share the width equally; a row that overflows fades at the
   edge it continues past (data-fade from sharp.js); no range sub-label. */
@media (max-width: 720px) {
  .s-tabs--mobile-only, .s-tabs--sticky { margin-inline: -14px; }
  .page > .s-tabs--mobile-only:first-child { margin-top: -16px; }
  .s-tabs-list:not(:has(> .s-tab:nth-child(4))) > .s-tab { flex: 1 1 0; min-width: 0; }
  .s-tab-count { display: none; }
  .s-tabs-list[data-fade="end"] { mask-image: linear-gradient(to right, var(--bg-1) calc(100% - 32px), transparent); }
  .s-tabs-list[data-fade="start"] { mask-image: linear-gradient(to left, var(--bg-1) calc(100% - 32px), transparent); }
  .s-tabs-list[data-fade="start end"] { mask-image: linear-gradient(to right, transparent, var(--bg-1) 32px, var(--bg-1) calc(100% - 32px), transparent); }
  .s-tab { -webkit-tap-highlight-color: transparent; }
  .s-tab:active { background: var(--bg-hover); }
}
/* Link tabs (Standings Drivers / Constructors / Records) slide between
   pages: sharp.js sets html[data-tab-slide] for that one navigation. */
@keyframes s-tab-out-next { to { transform: translateX(-24%); opacity: 0; } }
@keyframes s-tab-in-next { from { transform: translateX(24%); opacity: 0; } }
@keyframes s-tab-out-prev { to { transform: translateX(24%); opacity: 0; } }
@keyframes s-tab-in-prev { from { transform: translateX(-24%); opacity: 0; } }
@media (max-width: 720px) and (prefers-reduced-motion: no-preference) {
  html[data-tab-slide="next"]::view-transition-old(root) { animation: s-tab-out-next 220ms var(--ease-out) both; }
  html[data-tab-slide="next"]::view-transition-new(root) { animation: s-tab-in-next 220ms var(--ease-out) both; }
  html[data-tab-slide="prev"]::view-transition-old(root) { animation: s-tab-out-prev 220ms var(--ease-out) both; }
  html[data-tab-slide="prev"]::view-transition-new(root) { animation: s-tab-in-prev 220ms var(--ease-out) both; }
}
.s-tab-count { font-family: var(--f-mono); font-size: 10.5px; color: var(--fg-3); letter-spacing: 0.04em; }

/* ── ChipToggle / ChartLegend ───────────────────────────────────────── */
.s-chips, .s-legend { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.s-legend { flex-wrap: wrap; padding: 0 14px 14px; }
.s-chip, .s-legend button {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px;
  background: var(--bg-2); color: var(--fg-2); border: 1px solid var(--line-2); cursor: pointer;
  font-family: var(--f-display); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
}
.s-chip[aria-pressed="true"] { background: var(--fg-1); color: var(--bg-2); border-color: var(--fg-1); }
/* Touch targets: 44px minimum below 720px for every tappable library row. */
/* StatGrid links are not in this list: the link's ::after covers the whole
   tile (60px+), so the tile is the target, and a 44px link box would push
   the label away from the value (media tiles, review round 2). */
@media (max-width: 720px) { .s-chip, .s-legend button, .s-pod-in, a.s-cal-in, .s-lr-main { min-height: 44px; } }
.s-chip:disabled { cursor: not-allowed; color: var(--fg-3); background: var(--surface-sunk); border-style: dashed; }
.s-chip[aria-pressed="true"]:disabled { color: var(--bg-2); background: var(--fg-3); border-color: var(--fg-3); border-style: solid; }
.flag-none { display: inline-grid; place-items: center; width: 24px; height: 16px; background: var(--surface-sunk); border: 1px solid var(--line-2); color: var(--fg-3); vertical-align: middle; }
.flag-none svg { width: 100%; height: 100%; display: block; }
.s-chip-sw, .s-legend button i { width: 12px; height: 3px; background: var(--tc, var(--team-fallback)); display: block; }
.s-chip--swatch[aria-pressed="true"] .s-chip-sw { background: var(--tc); }
.s-legend button { font-family: var(--f-mono); font-weight: 500; font-size: 11.5px; letter-spacing: 0.02em; text-transform: none; min-height: 30px; padding: 4px 8px; }
.s-legend button[aria-pressed="false"] { opacity: 0.45; }

/* ── Button / IconButton ────────────────────────────────────────────── */
.s-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; cursor: pointer; text-decoration: none;
  font-family: var(--f-display); font-weight: 700; font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--fg-1); background: transparent; color: var(--fg-1);
  transition: background var(--mo) ease, color var(--mo) ease, border-color var(--mo) ease;
}
.s-btn--s { min-height: 34px; padding: 0 12px; font-size: 12px; gap: 6px; }
.s-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.s-btn--primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); }
.s-btn--secondary:hover { background: var(--fg-1); color: var(--bg-2); }
.s-btn--ghost { border-color: transparent; padding-left: 4px; padding-right: 4px; text-decoration: underline; text-underline-offset: 3px; }
.s-btn--ghost:hover { text-decoration-thickness: 2px; }
.s-ibtn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; flex: none;
  background: var(--bg-2); color: var(--fg-1); border: 1px solid var(--line-1); cursor: pointer;
}
.s-ibtn:hover { border-color: var(--fg-3); }
.s-ibtn--ink { background: transparent; color: var(--ink-fg); border-color: var(--ink-line); }

/* ── Badge ──────────────────────────────────────────────────────────── */
.s-badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; vertical-align: middle;
  padding: 3px 7px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--fg-2);
  font-family: var(--f-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.2;
}
.s-badge--red { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.s-badge--ink { background: var(--fg-1); border-color: var(--fg-1); color: var(--bg-2); }
.s-badge--ok { color: var(--pos); border-color: color-mix(in srgb, var(--pos) 40%, transparent); background: color-mix(in srgb, var(--pos) 8%, var(--bg-2)); }
.s-badge--gold { color: var(--gold-text); border-color: color-mix(in srgb, var(--gold) 55%, transparent); background: color-mix(in srgb, var(--gold) 10%, var(--bg-2)); }
.s-badge--purple { color: var(--purple); border-color: color-mix(in srgb, var(--purple) 45%, transparent); }
.s-badge--live { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.s-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: s-pulse 1.6s ease-out infinite; }
@keyframes s-pulse { 0% { box-shadow: 0 0 0 0 var(--accent-glow); } 100% { box-shadow: 0 0 0 7px transparent; } }

/* ── Field ──────────────────────────────────────────────────────────── */
.s-field { display: grid; gap: 6px; }
.s-field-label {
  font-family: var(--f-mono); font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--fg-3); padding: 0;
}
.s-input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 0;
  background: var(--bg-2); color: var(--fg-1); border: 1px solid var(--line-2);
  font-family: var(--f-body); font-size: 16px; line-height: 1.3;
}
.s-input::placeholder { color: var(--fg-3); }
.s-input:hover { border-color: var(--line-3); }
.s-input:focus-visible { border-color: var(--fg-1); }
.s-field--error .s-input { border-color: var(--neg); }
.s-textarea { resize: vertical; min-height: 120px; }
.s-select-wrap { position: relative; display: block; }
.s-select { appearance: none; padding-right: 36px; }
.s-select-caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--fg-3); }
.s-field-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.s-field-hint { color: var(--fg-3); }
.s-field-error { color: var(--neg); font-weight: 600; }
.s-field-count { font-family: var(--f-mono); color: var(--fg-3); font-size: 11px; }
.s-search { position: relative; }
.s-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--fg-3); pointer-events: none; }
.s-search-input { padding-left: 38px; }

/* ── ChoiceGroup ────────────────────────────────────────────────────── */
.s-choices { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.s-choices-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.s-choice { position: relative; cursor: pointer; }
.s-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.s-choice-box {
  display: grid; gap: 3px; height: 100%; padding: 12px; background: var(--bg-2); border: 1px solid var(--line-2);
}
.s-choice-box b { font-family: var(--f-display); font-weight: 700; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }
.s-choice-box small { color: var(--fg-3); font-size: 12px; }
.s-choice input:checked + .s-choice-box { border-color: var(--fg-1); box-shadow: inset 0 -3px 0 var(--accent); }
.s-choice input:focus-visible + .s-choice-box { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Disabled: no opacity (it would drop the text under AA); a sunk surface,
   dashed edge and --fg-3 text (5.3:1 light, 6.7:1 dark) instead. */
.s-choice.is-disabled, .s-choice.is-disabled input { cursor: not-allowed; }
.s-choice.is-disabled .s-choice-box { background: var(--surface-sunk); border-style: dashed; color: var(--fg-3); }
.s-choice.is-disabled input:checked + .s-choice-box { border-color: var(--fg-3); border-style: solid; box-shadow: inset 0 -3px 0 var(--fg-3); }
.s-choices--error .s-choice-box { border-color: var(--neg); }
.s-choices-error { margin: 0; font-size: 12px; }

/* ── Pager ──────────────────────────────────────────────────────────── */
.s-pager { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; margin: 20px 0; }
.s-pager-btn {
  min-width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0 8px;
  background: var(--bg-2); color: var(--fg-2); border: 1px solid var(--line-1); cursor: pointer; text-decoration: none;
  font-family: var(--f-display); font-weight: 700; font-size: 15px;
}
.s-pager-btn:hover { border-color: var(--fg-3); color: var(--fg-1); }
.s-pager-btn.is-current { background: var(--fg-1); color: var(--bg-2); border-color: var(--fg-1); }
.s-pager-btn.is-off { opacity: 0.35; cursor: default; }
.s-pager-gap { align-self: center; color: var(--fg-3); padding: 0 4px; }
.s-pager-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 24px 0; }
.s-pager-card {
  display: grid; gap: 6px; padding: 14px 16px; text-decoration: none; color: var(--fg-1);
  background: var(--bg-2); border-top: 2px solid var(--card-rule);
}
.s-pager-card b { font-family: var(--f-display); font-weight: 800; font-size: 18px; line-height: 1.05; text-transform: uppercase; }
.s-pager-card--next { text-align: right; justify-items: end; }
.s-pager-card:hover { background: var(--bg-hover); }
.s-pager-card .s-eyebrow { display: inline-flex; align-items: center; gap: 4px; }

/* ── TeamMark ───────────────────────────────────────────────────────── */
.s-tm { display: inline-block; flex: none; background: var(--tc, var(--team-fallback)); vertical-align: middle; }
.s-tm--strip { width: 3px; height: 1.6em; align-self: stretch; }
.s-tm--strip.s-tm--l { width: 4px; }
.s-tm--dot { width: 8px; height: 8px; border-radius: 50%; }
.s-tm--rule { height: 3px; width: 100%; display: block; }
.s-tm--edge { width: 3px; height: 1.2em; margin-right: 6px; }

/* ── Face / TeamLogo ────────────────────────────────────────────────── */
.s-face {
  position: relative; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  width: 44px; height: 44px; background: var(--bg-3);
  border-bottom: 3px solid var(--tc, var(--team-fallback));
}
/* The code tile is always there; the photo sits over it. Until the photo has
   loaded (data-ok) the code shows through, and a broken photo is dropped, so
   a face is never an empty box. Without :has the code stays under the photo. */
.s-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.s-face img[data-broken] { display: none; }
.s-face:has(> img[data-ok]) > .s-face-code { visibility: hidden; }
.s-face--xs { width: 24px; height: 24px; border-bottom-width: 2px; }
.s-face--s { width: 32px; height: 32px; border-bottom-width: 2px; }
.s-face--l { width: 64px; height: 64px; }
.s-face--hero { width: 88px; height: 80px; }
.s-face-code {
  font-family: var(--f-display); font-weight: 800; font-size: 13px; letter-spacing: 0.04em; color: var(--fg-1);
  background: color-mix(in srgb, var(--tc, var(--team-fallback)) 18%, var(--bg-3)); width: 100%; height: 100%; display: grid; place-items: center;
}
.s-face--xs .s-face-code { font-size: 8px; }
.s-logo { display: inline-grid; place-items: center; flex: none; background: var(--tile-logo); border-radius: 2px; padding: 3px; overflow: hidden; }
.s-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ── Pos / Change ───────────────────────────────────────────────────── */
.s-pos { font-family: var(--f-display); font-weight: 800; font-size: var(--fs-num-m); line-height: 1; font-variant-numeric: tabular-nums; color: var(--fg-1); }
.s-pos--s { font-size: var(--fs-num-s); }
.s-pos--gold { color: var(--gold-text); }
.s-pos--silver { color: var(--silver-text); }
.s-pos--bronze { color: var(--bronze-text); }
.s-pos--status { font-size: 13px; letter-spacing: 0.06em; color: var(--neg); }
.s-chg { display: inline-flex; align-items: center; gap: 2px; font-family: var(--f-mono); font-size: 10px; color: var(--fg-3); }
.s-chg i { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.s-chg--up { color: var(--pos); }
.s-chg--up i { border-bottom: 5px solid currentColor; }
.s-chg--down { color: var(--neg); }
.s-chg--down i { border-top: 5px solid currentColor; }

/* ── Sparkline ──────────────────────────────────────────────────────── */
.s-spark { display: inline-block; vertical-align: middle; overflow: visible; flex: none; }
.s-spark-bar { fill: var(--tc, var(--fg-3)); }
.s-spark-zero { fill: var(--line-2); }
.s-spark-line { stroke: var(--tc, var(--fg-2)); stroke-width: 1.6; }
.s-spark-end { fill: var(--tc, var(--fg-2)); }

/* ── BarMeter ───────────────────────────────────────────────────────── */
.s-bar { display: grid; gap: 5px; }
.s-bar-head { display: flex; justify-content: space-between; gap: 10px; font-family: var(--f-mono); font-size: 11px; color: var(--fg-3); letter-spacing: 0.06em; text-transform: uppercase; }
.s-bar-head b { font-family: var(--f-display); font-weight: 800; font-size: 16px; color: var(--fg-1); letter-spacing: 0; }
.s-bar-track { position: relative; height: 6px; background: var(--bg-3); overflow: hidden; }
.s-bar--hair .s-bar-track { height: 3px; }
.s-bar--m .s-bar-track { height: 10px; }
.s-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; display: block; background: var(--tc, var(--fg-2)); }

/* ── BigNumber ──────────────────────────────────────────────────────── */
.s-big { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.s-big-v { font-family: var(--f-display); font-weight: 800; font-size: var(--fs-num-l); line-height: 0.9; font-variant-numeric: tabular-nums; color: var(--fg-1); }
.s-big--xl .s-big-v { font-size: var(--fs-num-xl); }
.s-big--m .s-big-v { font-size: var(--fs-num-m); }
.s-big--team .s-big-v { color: color-mix(in srgb, var(--tc) 62%, var(--fg-1)); }
.s-big-u, .s-big-l { font-family: var(--f-mono); font-size: 11px; color: var(--fg-3); letter-spacing: 0.08em; text-transform: uppercase; }
.s-big-l { flex-basis: 100%; }

/* ── StatGrid ───────────────────────────────────────────────────────── */
.s-stats { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); margin: 0; gap: 1px; background: var(--line-1); }
.s-stats--framed { border-top: 1px solid var(--line-1); }
.s-stat { padding: 10px 12px; background: var(--bg-2); min-width: 0; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 3px; }
.s-stat dt { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); }
.s-stat dd { margin: 0; display: flex; align-items: baseline; gap: 5px; }
.s-stat b { font-family: var(--f-display); font-weight: 800; font-size: var(--fs-num-m); line-height: 1; font-variant-numeric: tabular-nums; }
.s-stat small { font-family: var(--f-mono); font-size: 10px; color: var(--fg-3); }
.s-stats--s .s-stat b { font-size: var(--fs-num-s); }
.s-stats--l .s-stat b { font-size: 34px; }
.s-stat.is-long b { font-size: var(--fs-num-s); }
.s-stat--accent b { color: var(--accent-text); }
.s-stat--link { position: relative; transition: background var(--mo) ease; }
.s-stat--link:hover { background: var(--bg-hover); }
.s-stat-link { display: flex; align-items: baseline; gap: 5px; color: inherit; text-decoration: none; }
.s-stat-link::after { content: ''; position: absolute; inset: 0; }
/* Link tiles (review round 2): no corner mark; a chevron at the right edge,
   centred, says the tile goes somewhere. */
.s-stat--link { padding-right: 30px; }
.s-stat-chev { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--fg-3); pointer-events: none; }
.s-stat--link:hover .s-stat-chev { color: var(--fg-1); }
/* Media tiles: a headshot, team logo, flag or circuit outline beside the
   value and label (40px box, vertically centred). Decorative. */
.s-stat--media { position: relative; padding-left: 62px; min-height: 64px; justify-content: center; }
.s-stat-media { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; }
.s-stat-media .s-logo { width: 40px; height: 40px; }
.s-stat-media--flag .flag-img { width: 36px; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--line-1); }
.s-stat-media--track .s-track { width: 44px; height: 44px; }
.s-stat-link:focus-visible { outline: none; }
.s-stat--link:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
.s-stats--fill > .s-stat:last-child { grid-column: span var(--fill, 1); }
@media (max-width: 720px) {
  /* --mcols is always set by StatGrid (statCols); min() inside repeat()
     is not valid everywhere, so no maths here. */
  .s-stats { grid-template-columns: repeat(var(--mcols, 2), minmax(0, 1fr)); }
  .s-stats--fill > .s-stat:last-child { grid-column: span var(--mfill, 1); }
  .s-stat { padding: 9px 10px; }
  /* Keep room for the media (10px + 44px box) and the link chevron: the
     phone padding above would otherwise put text under them. */
  .s-stat--media { padding-left: 62px; }
  .s-stat--link { padding-right: 30px; }
}

/* ── DuelBar ────────────────────────────────────────────────────────── */
.s-duel { display: grid; gap: 6px; }
.s-duel-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); }
.s-duel-head span:last-child { text-align: right; }
.s-duel-label { color: var(--fg-2); }
.s-duel-bar { display: flex; height: 34px; background: var(--bg-3); }
.s-duel-a, .s-duel-b { display: flex; align-items: center; padding: 0 10px; min-width: 44px; }
.s-duel-a { background: var(--tc, var(--fg-2)); }
.s-duel-a b { background: color-mix(in srgb, var(--bg-2) 82%, transparent); padding: 1px 5px; }
.s-duel-b { flex: 1; justify-content: flex-end; border-right: 4px solid var(--tc, var(--line-3)); }
.s-duel b { font-family: var(--f-display); font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; color: var(--fg-1); }

/* ── LeaderList / LeaderRow ─────────────────────────────────────────── */
.s-ll { min-width: 0; list-style: none; margin: 0; padding: 0; background: var(--bg-2); border-top: 2px solid var(--card-rule); }
.s-lr { border-top: 1px solid var(--line-1); }
.s-lr:first-child { border-top: 0; }
.s-lr-main {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 9px 14px;
  background: var(--bg-2); color: var(--fg-1); border: 0; text-align: left; text-decoration: none; font: inherit; cursor: pointer;
}
div.s-lr-main { cursor: default; }
@media (hover: hover) {
  .s-lr-main:hover { background: var(--bg-0); }
  div.s-lr-main:hover { background: var(--bg-2); }
}
.s-lr-pos { width: 30px; text-align: center; flex: none; }
.s-lr-chg { width: 22px; flex: none; text-align: center; }
.s-lr-strip { width: 3px; align-self: stretch; flex: none; background: var(--tc, var(--team-fallback)); }
.s-lr-who { flex: 1; min-width: 0; display: block; }
.s-lr-name { display: flex; align-items: center; gap: 0; font-size: 15.5px; line-height: 1.15; white-space: nowrap; overflow: hidden; }
.s-lr-name b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.s-lr-first { color: var(--fg-2); margin-right: 4px; }
.s-lr-flag { flex: none; width: 20px; height: 14px; margin-right: 6px; object-fit: cover; border: 1px solid var(--line-1); }
.s-lr-logo { flex: none; }
.s-lr-spark { margin-left: 8px; }
.s-lr-sub { display: block; font-size: 12px; color: var(--fg-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-lr-bar { display: block; height: 3px; background: var(--bg-3); margin-top: 6px; position: relative; overflow: hidden; }
.s-lr-bar i { position: absolute; left: 0; top: 0; bottom: 0; display: block; background: var(--tc, var(--fg-3)); }
.s-lr-val { font-family: var(--f-display); font-weight: 800; font-size: var(--fs-num-m); line-height: 1; font-variant-numeric: tabular-nums; text-align: right; min-width: 48px; }
.s-lr-val small { display: block; font-family: var(--f-mono); font-weight: 400; font-size: 10px; color: var(--fg-3); margin-top: 2px; }
.s-lr-val.is-long { font-size: var(--fs-num-s); }
.s-lr-chev { color: var(--fg-4); flex: none; transition: transform 250ms var(--ease-out); }
.s-lr-main[aria-expanded="true"] .s-lr-chev { transform: rotate(90deg); }
.s-lr-x { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 300ms var(--ease-out); background: var(--surface-raised); }
.s-lr-main[aria-expanded="true"] + .s-lr-x { grid-template-rows: 1fr; }
.s-lr-x-in { overflow: hidden; min-height: 0; }
.s-lr-main[aria-expanded="false"] + .s-lr-x .s-lr-x-in { visibility: hidden; transition: visibility 0s 300ms; }
.s-lr-x-body { display: grid; gap: 12px; padding: 14px 14px 14px 56px; border-top: 1px solid var(--line-1); }
/* The open row keeps its identity (review round 2, 13 Nov): the row and its
   detail lift together onto --surface-raised with --shadow-raised, a 5px
   team-colour edge runs down the whole open block (an edge, never a fill),
   the row's own strip thickens, and hover never greys it out. Hover tints
   only where a pointer hovers, so a tapped row on a phone is not left grey. */
.s-lr--x { position: relative; }
.s-lr--x:has(> .s-lr-main[aria-expanded="true"]) { z-index: var(--z-raised); box-shadow: var(--shadow-raised); border-top-color: var(--line-3); }
.s-lr--x:has(> .s-lr-main[aria-expanded="true"])::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; z-index: 1;
  background: var(--tc, var(--team-fallback)); pointer-events: none;
}
.s-lr--x:has(> .s-lr-main[aria-expanded="true"]) + .s-lr { border-top-color: var(--line-3); }
.s-lr-main[aria-expanded="true"], .s-lr-main[aria-expanded="true"]:hover { background: var(--surface-raised); }
.s-lr-main[aria-expanded="true"] .s-lr-strip { width: 5px; }
.s-lr-main[aria-expanded="true"] .s-lr-chev { color: var(--fg-1); }

/* RowDetail: what an expanded LeaderRow shows. Last N rounds as result
   tiles (round, finishing position in medal ink, points), a compact stat
   strip, then actions. Sits on --surface-raised with the open row; tiles and
   stat cells are outlined, not filled, so every label sits on the raised
   surface itself and clears AA in both themes (medal and DNF ink included). */
.s-rd { display: grid; gap: 12px; }
.s-rd-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.s-rd-head b { font-family: var(--f-mono); font-size: 11px; font-weight: 600; color: var(--fg-1); }
.s-rd-head .s-eyebrow { color: var(--fg-2); }
.s-rd-form { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 4px; }
.s-rd-tile { display: grid; justify-items: center; gap: 3px; padding: 8px 2px 7px; background: var(--surface-raised); border: 1px solid var(--line-2); border-top: 3px solid var(--line-3); min-width: 0; }
.s-rd-tile.is-gold { border-top-color: var(--gold); }
.s-rd-tile.is-silver { border-top-color: var(--silver); }
.s-rd-tile.is-bronze { border-top-color: var(--bronze); }
.s-rd-tile.is-out { border-top-color: var(--neg); }
.s-rd-rnd { display: flex; align-items: center; gap: 4px; font-family: var(--f-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: var(--fg-2); text-transform: uppercase; white-space: nowrap; }
.s-rd-rnd .flag-img { height: 9px; width: auto; }
.s-rd-pos { font-family: var(--f-display); font-weight: 800; font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--fg-1); }
.s-rd-tile.is-gold .s-rd-pos { color: var(--gold-text); }
.s-rd-tile.is-silver .s-rd-pos { color: var(--silver-text); }
.s-rd-tile.is-bronze .s-rd-pos { color: var(--bronze-text); }
.s-rd-tile.is-out .s-rd-pos { color: var(--neg); font-size: 15px; padding: 5px 0 4px; letter-spacing: 0.04em; }
.s-rd-pts { font-family: var(--f-mono); font-size: 11px; font-weight: 600; color: var(--fg-1); }
.s-rd-pts.is-zero { color: var(--fg-2); font-weight: 400; }
.s-rd-stats { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--line-2); border: 1px solid var(--line-2); }
.s-rd-stats > div { background: var(--surface-raised); padding: 7px 10px; display: grid; gap: 2px; align-content: start; }
.s-rd-stats b { font-family: var(--f-display); font-weight: 800; font-size: 20px; line-height: 1; font-variant-numeric: tabular-nums; }
.s-rd-stats span { font-family: var(--f-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-2); }
.s-rd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
@media (max-width: 720px) {
  .s-lr-main { padding: 8px 12px; gap: 8px; }
  /* The change chip stays on a phone, stacked and narrow. */
  .s-lr-chg { width: 16px; }
  .s-lr-chg .s-chg { flex-direction: column; gap: 1px; font-size: 9px; line-height: 1; }
  .s-lr-first { display: none; }
  /* The name gets the room: the unit wraps under a narrow number and a
     two-word name may take two lines rather than being cut. */
  .s-lr-val { min-width: 36px; }
  .s-lr-val small { max-width: 8ch; margin-left: auto; white-space: normal; line-height: 1.15; }
  .s-lr-name { white-space: normal; }
  .s-lr-name b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.1; }
  .s-lr-x-body { padding-left: 14px; }
}

/* ── DataTable ──────────────────────────────────────────────────────── */
.s-tbl-wrap { overflow-x: auto; background: var(--bg-2); border-top: 2px solid var(--card-rule); }
.s-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.s-tbl th {
  position: sticky; top: 0; z-index: var(--z-raised); text-align: left; white-space: nowrap;
  padding: 9px 12px; background: var(--tbl-head-bg); color: var(--fg-3);
  font-family: var(--f-mono); font-weight: 500; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
}
.s-tbl td { white-space: nowrap; padding: 10px 12px; border-top: 1px solid var(--line-1); vertical-align: middle; }
.s-tbl tbody tr:hover td { background: var(--bg-hover); }
.s-tbl--static tbody tr:hover td { background: transparent; }
.s-tbl tr[style*="--tc"] td:first-child { box-shadow: inset 3px 0 0 var(--tc); }
.s-tbl .is-wrap { white-space: normal; overflow-wrap: break-word; min-width: 9ch; }
@media (max-width: 720px) {
  .s-tbl .is-hide-phone { display: none; }
  .s-tbl .s-th-sort { min-height: 44px; }
}
.s-tbl .is-right { text-align: right; }
.s-tbl .is-center { text-align: center; }
.s-tbl .is-mono { font-family: var(--f-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.s-tbl .is-strong { font-family: var(--f-display); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.s-th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.s-th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
th.is-sorted { color: var(--fg-1); }
@media (max-width: 720px) { .s-tbl-wrap--rows { display: none; } }

/* ── RecordCard (on top of the lodestar .card-accent + .card-bars) ──── */
.s-rec { display: grid; gap: 0; }
.s-rec-head { padding: 14px 16px 10px; display: grid; gap: 4px; }
.s-rec-title { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 22px; text-transform: uppercase; line-height: 1; }
.s-rec-title a { color: inherit; text-decoration: none; }
.s-rec-holder { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line-1); border-bottom: 1px solid var(--line-1); }
.s-rec-holder-tx { flex: 1; min-width: 0; display: grid; }
.s-rec-holder-tx b { font-family: var(--f-display); font-weight: 800; font-size: 20px; text-transform: uppercase; line-height: 1; }
.s-rec-holder-tx span { font-size: 12px; color: var(--fg-3); }
.s-rec-holder-v b { font-family: var(--f-display); font-weight: 800; font-size: var(--fs-num-l); line-height: 0.9; color: color-mix(in srgb, var(--tc, var(--fg-1)) 62%, var(--fg-1)); }
.s-rec-holder-v { flex: none; white-space: nowrap; }
.s-rec-holder-v.is-long b { font-size: var(--fs-num-m); }
.s-rec-holder-v small { font-family: var(--f-mono); font-size: 10px; color: var(--fg-3); margin-left: 3px; }
.s-rec-bars { list-style: none; margin: 0; padding: 8px 16px 12px; display: grid; gap: 7px; }
.s-rec-bars li { display: grid; grid-template-columns: 22px minmax(0, 1fr) 70px 40px; gap: 8px; align-items: center; }
.s-rec-bars--labels li { grid-template-columns: 22px minmax(0, 1fr) minmax(40px, 64px) 9ch; }
.s-rec-rank { font-family: var(--f-display); font-weight: 800; color: var(--fg-3); }
.s-rec-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-rec-name a { color: inherit; text-decoration: none; }
.s-rec-name small { margin-left: 6px; color: var(--fg-3); font-weight: 400; }
.s-rec-track { height: 6px; background: var(--bg-3); position: relative; overflow: hidden; }
.s-rec-track i { position: absolute; inset: 0 auto 0 0; display: block; background: var(--tc, var(--fg-3)); }
.s-rec-v { font-family: var(--f-mono); font-weight: 600; font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-rec-more { margin: 0 16px 14px; }

/* ── LeaderHero ─────────────────────────────────────────────────────── */
.s-lead { display: grid; grid-template-columns: 1fr 116px; overflow: hidden; }
.s-lead-tx { padding: 14px 16px; display: grid; gap: 4px; align-content: start; }
.s-lead-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.s-lead-first { font-family: var(--f-display); font-weight: 700; font-size: 17px; text-transform: uppercase; color: var(--fg-2); line-height: 1; }
.s-lead-last { font-family: var(--f-display); font-weight: 800; font-size: 34px; text-transform: uppercase; line-height: 0.9; }
.s-lead-team { display: flex; align-items: center; gap: 7px; font-family: var(--f-display); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); }
.s-lead-pic { position: relative; background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 28%, var(--bg-2)), var(--bg-2) 72%); border-left: 3px solid var(--tc, var(--team-fallback)); }
.s-lead-init { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 40px; letter-spacing: 0.02em; color: color-mix(in srgb, var(--tc, var(--fg-3)) 62%, var(--fg-1)); }
.s-lead-logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 7px; }
.s-lead-pic > img { position: absolute; bottom: 0; right: -8px; width: 140px; height: auto; max-width: none; }
.s-lead-big { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 6px; padding: 2px 16px 12px; }
.s-lead-big b { font-family: var(--f-display); font-weight: 800; font-size: var(--fs-num-xl); line-height: 0.85; font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--tc) 62%, var(--fg-1)); }
.s-lead-big span { font-family: var(--f-mono); font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.1em; }
.s-lead-stats { grid-column: 1 / -1; }
.s-lead-note { grid-column: 1 / -1; margin: 0; padding: 10px 16px; border-top: 1px solid var(--line-1); font-size: 13.5px; color: var(--fg-2); }
@media (min-width: 721px) { .s-lead { grid-template-columns: 1fr 200px; } .s-lead-pic > img { width: 230px; } .s-lead-last { font-size: 44px; } }

/* ── Podium ─────────────────────────────────────────────────────────── */
.s-podium { list-style: none; margin: 0; padding: 0; }
.s-pod { --m: var(--line-3); --mt: var(--fg-2); }
.s-pod--gold { --m: var(--gold); --mt: var(--gold-text); }
.s-pod--silver { --m: var(--silver); --mt: var(--silver-text); }
.s-pod--bronze { --m: var(--bronze); --mt: var(--bronze-text); }
.s-pod-in { color: var(--fg-1); text-decoration: none; }
.s-pod-pos { font-family: var(--f-display); font-weight: 800; color: var(--mt); line-height: 1; }
.s-pod-who { display: grid; min-width: 0; }
.s-pod-who b { font-family: var(--f-display); font-weight: 800; font-size: 17px; text-transform: uppercase; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-pod-short { display: none; }
.s-pod-flag { display: inline-block; width: 20px; height: 14px; margin-right: 6px; vertical-align: -1px; object-fit: cover; border: 1px solid var(--line-1); }
@media (max-width: 720px) {
  /* Visually hidden, still read: the short name is aria-hidden. */
  .s-pod-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .s-pod-short { display: inline; }
  .s-pod-who b { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.05; }
}
.s-pod-who small, .s-pod-gap small { font-size: 11.5px; color: var(--fg-3); }
.s-pod-gap { font-family: var(--f-mono); font-size: 12px; color: var(--fg-2); display: grid; }
.s-podium--steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.s-podium--steps .s-pod-in { position: relative; display: grid; justify-items: center; gap: 4px; padding: 12px 6px 10px; text-align: center; background: var(--bg-2); border-top: 3px solid var(--m); }
.s-podium--steps .s-pod--gold .s-pod-in { padding-top: 20px; }
.s-podium--steps .s-pod-pos { position: absolute; left: 8px; top: 6px; font-size: 28px; }
.s-podium--steps .s-pod-gap { justify-items: center; }
.s-podium--steps .s-pod-flag { display: block; margin: 0 auto 5px; }
.s-podium--rows { background: var(--bg-2); border-top: 2px solid var(--card-rule); }
.s-podium--rows .s-pod + .s-pod { border-top: 1px solid var(--line-1); }
.s-podium--rows .s-pod-in { display: grid; grid-template-columns: 30px 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 14px; }
.s-podium--rows .s-pod--noface .s-pod-in { grid-template-columns: 30px minmax(0, 1fr) auto; }
.s-podium--rows .s-pod-pos { font-size: 30px; }
.s-podium--rows .s-pod-gap { text-align: right; }

/* ── Countdown ──────────────────────────────────────────────────────── */
.s-cd { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--ink); color: var(--ink-fg); border-top: 1px solid var(--ink-edge); }
.s-cd-cap { grid-column: 1 / -1; margin: 0; padding: 10px 14px 0; text-align: center; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }
.s-cd--plain .s-cd-cap { color: var(--fg-3); }
.s-cd-cell { position: relative; text-align: center; padding: 12px 0 10px; }
.s-cd-cell + .s-cd-cell::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: var(--ink-line); }
.s-cd-cell b { display: block; font-family: var(--f-display); font-weight: 800; font-size: var(--fs-num-l); line-height: 1; font-variant-numeric: tabular-nums; }
.s-cd-cell span { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.16em; color: var(--ink-dim); text-transform: uppercase; }
.s-cd--plain { background: transparent; color: var(--fg-1); border-top: 1px solid var(--line-1); border-bottom: 1px solid var(--line-1); }
.s-cd--plain .s-cd-cell + .s-cd-cell::before { top: 0; bottom: 0; background: var(--line-1); }
.s-cd--plain .s-cd-cell span { color: var(--fg-3); }
.s-cd-inline, .s-cd-days { font-family: var(--f-mono); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--fg-2); }

/* ── SessionList ────────────────────────────────────────────────────── */
.s-ses ol { list-style: none; margin: 0; padding: 0; }
.s-ses li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line-1); font-size: 14px; }
.s-ses li:first-child { border-top: 0; }
.s-ses-dot { width: 8px; height: 8px; background: var(--line-2); justify-self: center; }
.s-ses .is-done .s-ses-dot { background: var(--fg-3); }
.s-ses .is-done .s-ses-n, .s-ses .is-done .s-ses-t { color: var(--fg-3); }
.s-ses .is-next { background: var(--accent-glow); }
.s-ses .is-next .s-ses-dot { background: var(--accent); animation: s-pulse 1.6s ease-out infinite; }
.s-ses .is-highlight .s-ses-dot { background: var(--fg-1); }
.s-ses .is-highlight .s-ses-n { font-weight: 800; color: var(--fg-1); }
.s-ses .is-highlight { background: var(--bg-hover); }
.s-ses-n { font-family: var(--f-display); font-weight: 700; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; }
.s-ses-t { font-family: var(--f-mono); font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.s-ses-times { display: grid; justify-items: end; gap: 1px; }
.s-ses-tt { font-family: var(--f-mono); font-size: 11px; color: var(--fg-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-ses-t { white-space: nowrap; }
/* The zone label after each time (review round 2): "UK", "EST", "GMT+4",
   and "local" on the grey circuit time. Mono, small, never underlined. */
.s-ses-z { font-family: var(--f-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: var(--fg-3); text-decoration: none; border: 0; cursor: help; }
.s-ses-tt .s-ses-z { font-weight: 400; }
.s-ses .is-done .s-ses-tt { color: var(--fg-3); }
.s-ses-w { min-width: 58px; text-align: right; }
.s-ses-done { font-family: var(--f-mono); font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.08em; }
.s-ses-tz { margin: 0; padding: 8px 16px 10px; font-family: var(--f-mono); font-size: 10.5px; color: var(--fg-3); border-top: 1px solid var(--line-1); }
.s-ses--compact li { padding: 7px 12px; }

/* ── WeatherChip ────────────────────────────────────────────────────── */
.s-wx { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-mono); font-size: 11.5px; color: var(--fg-2); }
.s-wx b { font-weight: 600; }
.s-wx small { color: var(--fg-3); font-size: 10.5px; }
.s-wx--rain .icon { color: var(--fg-1); }
.s-wx--climate { opacity: 0.75; }
.s-wx--climate::after { content: '~'; color: var(--fg-3); }

/* ── NextRaceCard ───────────────────────────────────────────────────
   Head row: text on the left, the raised track on the right (never under
   the text). Ghost round number behind both. Countdown on an ink band. */
.s-nr { overflow: hidden; border-top-color: var(--accent); }
.s-nr-top { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) clamp(132px, 38%, 230px); align-items: center; gap: 4px; padding: 14px 12px 10px 16px; }
.s-nr-ghost { position: absolute; right: -4px; top: -22px; font-family: var(--f-display); font-weight: 800; font-size: 150px; line-height: 1; color: color-mix(in srgb, var(--bg-3) 55%, var(--bg-2)); pointer-events: none; user-select: none; }
.s-nr-head { position: relative; display: grid; gap: 6px; min-width: 0; }
.s-nr-top--notrack { grid-template-columns: minmax(0, 1fr); }
.s-nr-track { position: relative; width: 100%; }
.s-nr-name { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 50px; line-height: 0.88; text-transform: uppercase; overflow-wrap: break-word; }
.s-nr-name--m { font-size: 42px; }
.s-nr-name--s { font-size: 34px; }
.s-nr-name i { font-style: normal; }
.s-nr-gp { display: block; font-size: 0.4em; letter-spacing: 0.06em; color: var(--fg-2); margin-top: 4px; }
.s-nr-venue { margin: 0; display: flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 12px; color: var(--fg-2); }
.s-nr-venue .flag-img { height: 16px; width: auto; }
.s-nr-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line-1); }
.s-nr-foot .s-link { margin-left: auto; }
@media (max-width: 720px) { .s-nr-name { font-size: 40px; } .s-nr-name--m { font-size: 33px; } .s-nr-name--s { font-size: 28px; } }
@media (min-width: 721px) { .s-nr-name { font-size: 60px; } .s-nr-name--m { font-size: 52px; } .s-nr-name--s { font-size: 44px; } }

/* ── TrackMap (raised model) ───────────────────────────────────────
   A tilted plane (CSS 3D) carrying stacked SVG layers: one blurred contact
   shadow, LAYERS side layers lifted --track-step apart, and the top face
   (hairline edge + matte face + start bar + lapping marker). Every layer
   draws the same path via <use>. */
.s-track { display: block; position: relative; aspect-ratio: 1; max-width: 100%; }
.s-track svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.s-track use, .s-track path { fill: none; stroke-linejoin: round; stroke-linecap: round; vector-effect: none; }
.s-track--raised { aspect-ratio: 4 / 3; perspective: 900px; perspective-origin: 50% 40%; }
.s-track-plane {
  position: absolute; left: 12%; right: 12%; top: 50%; aspect-ratio: 1; transform-style: preserve-3d;
  transform: translateY(-50%) rotateX(52deg) rotateZ(-10deg) scale(1.12);
  background: radial-gradient(closest-side, var(--track-floor), transparent) center / 100% 100% no-repeat;
}
.s-track-plane svg { transform: translateZ(calc(var(--z, 0) * var(--track-step))); }
.s-track-shadow use { stroke: var(--track-shadow); stroke-width: 34; filter: blur(6px); }
.s-track-side use { stroke: var(--track-side); stroke-width: 22; }
.s-track-edge { stroke: var(--track-edge); stroke-width: 24; }
.s-track-face { stroke: var(--track-top); stroke-width: 18; }
.s-track-start { fill: var(--track-edge); }
.s-track-dot { fill: var(--accent); stroke: var(--track-top); stroke-width: 4; }
.s-track--flat .s-track-edge { stroke-width: 20; }
.s-track--flat .s-track-face { stroke-width: 13; }
@media (prefers-reduced-motion: reduce) { .s-track-dot { display: none; } }

/* ── CalendarRow ────────────────────────────────────────────────────── */
.s-calendar ol { list-style: none; margin: 0; padding: 0; }
.s-mon { margin: 0; padding: 12px 14px 6px; background: var(--bg-0); border-top: 1px solid var(--line-1); font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-3); }
.s-calendar section:first-child .s-mon { border-top: 0; }
.s-cal { border-top: 1px solid var(--line-1); }
.s-cal-in { display: grid; grid-template-columns: 34px 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 14px; color: var(--fg-1); text-decoration: none; }
a.s-cal-in:hover { background: var(--bg-hover); }
.s-cal-rn { font-family: var(--f-display); font-weight: 800; font-size: 20px; color: var(--fg-3); text-align: center; }
.s-cal-fgw { width: 30px; height: 20px; display: block; background: var(--bg-3); }
.s-cal-fg { width: 30px; height: 20px; object-fit: cover; border: 1px solid var(--line-1); display: block; }
.s-cal-tx { display: grid; min-width: 0; }
.s-cal-nm {
  font-family: var(--f-display); font-weight: 800; font-size: 17px; text-transform: uppercase; line-height: 1.02;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: break-word;
}
.s-cal-nm--m { font-size: 15.5px; }
.s-cal-nm--s { font-size: 14px; letter-spacing: -0.005em; }
.s-cal-ci { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--fg-3); }
.s-cal-ci > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.s-cal-ci .s-badge { flex: none; padding: 1px 5px; font-size: 9.5px; }
.s-cal-rt { text-align: right; display: grid; justify-items: end; gap: 3px; }
.s-cal-dt { font-family: var(--f-mono); font-size: 12px; font-weight: 600; }
.s-cal-wn { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.s-cal-in--link { grid-template-columns: 34px 30px minmax(0, 1fr) auto 16px; }
.s-cal-chev { color: var(--fg-3); }
a.s-cal-in:hover .s-cal-chev { color: var(--fg-1); }
/* Upcoming rounds carry a full-strength number; done rounds a muted one
   with a tick, plus the winner and the chevron. */
.s-cal-rn { display: grid; justify-items: center; gap: 2px; line-height: 1; }
.s-cal:not(.s-cal--done):not(.s-cal--next) .s-cal-rn { color: var(--fg-1); }
.s-cal-tick { color: var(--pos); stroke-width: 3; }
.s-cal--done .s-cal-dt { color: var(--fg-3); font-weight: 500; }
.s-cal--next { background: var(--accent-glow); box-shadow: inset 3px 0 0 var(--accent); }
.s-cal--next .s-cal-rn { color: var(--accent-text); }

/* ── Rail ───────────────────────────────────────────────────────────── */
.s-rail { min-width: 0; }
.s-rail-track {
  display: grid; grid-auto-flow: column; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain;
  grid-auto-columns: calc((100% - 10px * (var(--pv-m, 1.25) - 1)) / var(--pv-m, 1.25));
  scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px;
}
.s-rail-track::-webkit-scrollbar { display: none; }
.s-rail-item { scroll-snap-align: start; min-width: 0; display: grid; }
.s-rail-item > * { min-width: 0; }
@media (min-width: 721px) { .s-rail-track { grid-auto-columns: calc((100% - 10px * (var(--pv-d, 4) - 1)) / var(--pv-d, 4)); } }
.s-rail-dots { display: flex; justify-content: center; gap: 2px; margin-top: 6px; }
.s-rail-dot { width: 22px; height: 22px; padding: 0; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.s-rail-dot::before { content: ''; width: 6px; height: 6px; background: var(--line-2); transition: width 250ms var(--ease-out), background 250ms var(--ease-out); }
.s-rail-dot.is-on::before { width: 18px; background: var(--fg-1); }
.s-rail-dot[hidden] { display: none; }
.s-rail--marquee { overflow: hidden; }
.s-rail--marquee .s-rail-track { display: flex; width: max-content; overflow: visible; gap: 10px; scroll-snap-type: none; animation: s-marquee 40s linear infinite; }
.s-rail--marquee .s-rail-dup { display: flex; gap: 10px; }
.s-rail--marquee:hover .s-rail-track { animation-play-state: paused; }
@keyframes s-marquee { to { transform: translateX(-50%); } }

/* ── SeasonProgress ─────────────────────────────────────────────────── */
.s-sprog { display: grid; gap: 10px; padding: 14px 16px; background: var(--ink); color: var(--ink-fg); border-top: 1px solid var(--ink-edge); }
.s-sprog-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.s-sprog-top b { font-family: var(--f-display); font-weight: 800; font-size: 40px; line-height: 1; }
.s-sprog-top b span { color: var(--ink-dim); font-size: 0.55em; }
.s-sprog-t { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-dim); }
.s-sprog-flags { list-style: none; margin: 0; padding: 3px; display: grid; grid-template-columns: repeat(var(--n, 24), minmax(0, 1fr)); gap: 6px 3px; }
.s-sprog-flags li { min-width: 0; display: grid; }
/* Each flag is a link (review round 2): the whole cell is the target, 44px
   tall on a phone; hover lifts it to --ink-2; focus is a white ring, since
   the next round already wears the red one. */
.s-sprog-flag {
  min-width: 0; display: grid; gap: 3px; justify-items: center; align-content: center;
  padding: 3px 0; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.s-sprog-flag:hover { background: var(--ink-2); }
.s-sprog-flag:focus-visible { outline: 2px solid var(--ink-fg); outline-offset: 0; }
@media (max-width: 720px) { .s-sprog-flag { min-height: 44px; } .s-sprog-flags { gap: 2px 0; } }
.s-sprog-flags img, .s-sprog-flags .flag-none { width: 100%; max-width: 26px; height: auto; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.s-sprog-flags .is-future img, .s-sprog-flags .is-future .flag-none { opacity: 0.3; filter: grayscale(1); }
.s-sprog-flags .is-next img, .s-sprog-flags .is-next .flag-none { outline: 2px solid var(--accent); outline-offset: 1px; }
.s-sprog-flags .is-next span { color: var(--ink-fg); font-weight: 700; }
@media (max-width: 720px) { .s-sprog-flags { grid-template-columns: repeat(var(--n-phone, 12), minmax(0, 1fr)); } }
.s-sprog-flags span { font-family: var(--f-mono); font-size: 8.5px; color: var(--ink-dim); }

/* ── Charts ─────────────────────────────────────────────────────────── */
.s-chart { margin: 0; }
.s-chart-title { padding: 12px 14px 0; font-family: var(--f-display); font-weight: 800; font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase; }
.s-chart-body { padding: 6px 14px 12px; }
.s-chart-grid { stroke: var(--chart-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.s-chart-line { fill: none; stroke: var(--tc, var(--chart-tick)); stroke-width: 2.25; vector-effect: non-scaling-stroke; stroke-linejoin: round; transition: opacity var(--mo) ease; }
.s-chart-line.is-off { opacity: 0; }
.s-readout { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 14px 0; }
.s-readout > b { font-family: var(--f-display); font-weight: 800; font-size: 18px; text-transform: uppercase; }
.s-readout-vals { display: flex; gap: 12px; flex-wrap: wrap; font-family: var(--f-mono); font-size: 11.5px; color: var(--fg-2); }
.s-readout-vals span { display: inline-flex; align-items: center; gap: 5px; }
.s-readout-vals i { width: 8px; height: 8px; background: var(--tc); display: block; }
.s-readout-vals b { color: var(--fg-1); font-weight: 700; }
.s-scrub { position: relative; height: var(--h, 180px); touch-action: pan-y; cursor: crosshair; border-bottom: 1px solid var(--chart-axis); }
.s-scrub svg { width: 100%; height: 100%; display: block; overflow: visible; }
.s-scrub-cursor { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--chart-cursor); pointer-events: none; }
.s-scrub script { display: none; }

/* ── Tooltip ────────────────────────────────────────────────────────── */
.s-tip { position: absolute; z-index: var(--z-raised); transform: translate(10px, -50%); min-width: 120px; padding: 8px 10px; display: grid; gap: 3px; pointer-events: none;
  background: var(--chart-tooltip-bg); color: var(--chart-tooltip-fg); border: 1px solid var(--chart-tooltip-line); box-shadow: var(--shadow-float); font-family: var(--f-mono); font-size: 11.5px; }
.s-tip--flip { transform: translate(calc(-100% - 10px), -50%); }
.s-tip-title { font-family: var(--f-display); font-weight: 800; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.s-tip-row { display: grid; grid-template-columns: 8px 1fr auto; gap: 6px; align-items: center; }
.s-tip-row i { width: 8px; height: 8px; background: var(--tc); display: block; }

/* ── Timeline ───────────────────────────────────────────────────────── */
.s-tl { list-style: none; margin: 0; padding: 0; background: var(--bg-2); border-top: 2px solid var(--card-rule); }
.s-tl li { position: relative; display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line-1); }
.s-tl li:first-child { border-top: 0; }
.s-tl li::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tc, var(--line-2)); }
.s-tl-label { font-family: var(--f-mono); font-size: 11px; color: var(--fg-3); padding-top: 2px; }
.s-tl-tx b { display: block; font-family: var(--f-display); font-weight: 800; font-size: 15px; letter-spacing: 0.05em; text-transform: uppercase; }
.s-tl-tx span { font-size: 13.5px; color: var(--fg-2); }

/* ── EntityHero ─────────────────────────────────────────────────────── */
.s-hero { display: grid; overflow: hidden; }
.s-hero-art { position: relative; height: 210px; overflow: hidden; border-bottom: 1px solid var(--line-1);
  background: repeating-linear-gradient(-45deg, var(--bg-0) 0 10px, var(--bg-2) 10px 20px); }
.s-hero-art > img { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); height: 200px; width: auto; max-width: none; }
.s-hero-mark { position: absolute; right: 10px; bottom: -16px; font-family: var(--f-display); font-weight: 800; font-size: 130px; line-height: 1; color: color-mix(in srgb, var(--tc, var(--fg-3)) 45%, var(--bg-2)); }
.s-hero-track { position: absolute; left: 44%; top: 50%; width: min(72%, 300px); transform: translate(-50%, -50%); }
.s-hero-art > .s-hero-flag { position: absolute; left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: 132px; height: auto; max-width: 50%; border: 1px solid var(--line-2); box-shadow: var(--shadow-float); }
.s-hero-logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 12px; box-shadow: var(--shadow-float); }
.s-hero--circuit .s-hero-mark, .s-hero--race .s-hero-mark { color: color-mix(in srgb, var(--tc) 22%, var(--bg-2)); }
.s-hero-tx { padding: 14px 16px; display: grid; gap: 4px; border-left: 4px solid var(--tc, var(--accent)); }
.s-hero-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.s-hero-first { font-family: var(--f-display); font-weight: 700; font-size: 20px; text-transform: uppercase; color: var(--fg-2); line-height: 1; }
.s-hero-last { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 52px; text-transform: uppercase; line-height: 0.88; overflow-wrap: break-word; }
.s-hero-last--m { font-size: 44px; }
.s-hero-last--s { font-size: 36px; }
.s-hero-meta { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--f-mono); font-size: 12px; color: var(--fg-3); }
.s-hero-meta .flag-img { height: 14px; width: auto; }
.s-hero-meta a { color: var(--fg-2); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
.s-hero-meta a:hover { color: var(--fg-1); text-decoration-color: currentColor; }
.s-hero .s-big { margin-top: 6px; }
@media (min-width: 721px) {
  .s-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .s-hero--noart { grid-template-columns: minmax(0, 1fr); }
  .s-hero-art { grid-row: span 2; height: auto; min-height: 280px; border-bottom: 0; border-right: 1px solid var(--line-1); }
  .s-hero-track { width: min(82%, 380px); left: 50%; }
  .s-hero-art > img { height: 92%; }
  .s-hero-last { font-size: 58px; }
  .s-hero-last--m { font-size: 50px; }
  .s-hero-last--s { font-size: 42px; }
}

/* ── MediaFallback ──────────────────────────────────────────────────── */
/* Ink panel in both themes: a faint diagonal weave, the circuit outline (or
   the flag, or the F1GURES mark) and a mono "R9 · 2026" label. Fills its
   positioned parent (ArticleCard, PostHero) or takes a 16:9 box on its own. */
.s-mfb {
  position: relative; overflow: hidden; aspect-ratio: 16 / 9; width: 100%;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, var(--ink-2) 14px 15px),
    radial-gradient(120% 90% at 70% 20%, var(--ink-2), var(--ink) 70%);
  color: var(--ink-fg);
}
.s-mfb-art { position: absolute; inset: 10% 12%; display: grid; place-items: center; }
.s-mfb-track { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.s-mfb-track path { fill: none; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.s-mfb-track-glow { stroke: var(--ink-line); stroke-width: 12px; }
.s-mfb-track-line { stroke: var(--ink-fg); stroke-width: 3px; }
.s-mfb-track-start { fill: var(--accent); stroke: none; }
.s-mfb-flag-big { height: 46%; max-width: 70%; width: auto; box-shadow: 0 0 0 1px var(--ink-line); }
.s-mfb-mark {
  font-family: var(--f-display); font-weight: 800; font-size: clamp(28px, 9cqw, 72px); letter-spacing: 0.04em;
  color: var(--ink-dim); text-transform: uppercase; line-height: 1;
}
.s-mfb-mark b { color: var(--ink-fg); font-weight: 800; }
.s-mfb--brand { container-type: inline-size; }
.s-mfb-meta {
  position: absolute; left: 12px; top: 10px; margin: 0; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: var(--fs-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-fg);
}
.s-mfb-flag { width: 20px; height: auto; box-shadow: 0 0 0 1px var(--ink-line); }

/* ── ArticleCard ────────────────────────────────────────────────────── */
/* MediaFallback always sits under the picture; a broken <img> (data-broken,
   set by its own onerror) is hidden so the art shows through. */
.s-post { display: grid; min-width: 0; overflow: hidden; isolation: isolate; }
.s-post-im { position: relative; overflow: hidden; background: var(--ink); }
.s-post-im > .s-mfb { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; }
.s-post-img { position: absolute; inset: 0; }
.s-post-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.s-post-img img[data-broken] { display: none; }
.s-post-tx { display: grid; gap: 5px; align-content: start; }
.s-post-cat {
  margin: 0; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: var(--fs-label); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.s-post-cat::before { content: ''; width: 14px; height: var(--rule-h); background: var(--accent); flex: none; }
.s-post-title { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 20px; line-height: 1.08; }
.s-post-title a { color: inherit; text-decoration: none; }
.s-post-title a::after { content: ''; position: absolute; inset: 0; z-index: var(--z-raised); }
.s-post:hover .s-post-title a { text-decoration: underline; text-underline-offset: 3px; }
.s-post:has(.s-post-title a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.s-post-title a:focus-visible { outline: none; }
.s-post-dek { margin: 0; font-size: 14.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.s-post-dt { font-family: var(--f-mono); font-size: 10.5px; }

/* Overlay ('list', 'lede'): the image is the card's background. The ink
   scrim belongs to the text block and turns near solid 56px above the
   category, so the text sits on ink whatever the picture is (AA in both
   themes; the card is ink in both themes, like the chrome). */
.s-post--over { position: relative; background: var(--ink); color: var(--ink-fg); border-top-color: var(--ink); aspect-ratio: 4 / 3; grid-template: minmax(0, 1fr) auto / minmax(0, 1fr); }
.s-post--over > .s-post-im { position: absolute; inset: 0; z-index: -1; }
.s-post--over > .s-post-tx {
  grid-row: 2; padding: 64px 14px 14px;
  background: linear-gradient(180deg,
    transparent 0,
    color-mix(in srgb, var(--ink) 72%, transparent) 30px,
    color-mix(in srgb, var(--ink) 94%, transparent) 60px,
    var(--ink) 100%);
}
.s-post--over .s-post-cat, .s-post--over .s-post-title, .s-post--over .s-post-dek { color: var(--ink-fg); }
.s-post--over .s-post-dt { color: var(--ink-dim); }
.s-post--over:hover .s-post-img img { transform: scale(1.03); }
.s-post-img img { transition: transform 600ms var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .s-post-img img { transition: none; } .s-post--over:hover .s-post-img img { transform: none; } }
/* No picture: the art takes the top of the card, the text the rest. */
.s-post--over.s-post--noimg > .s-post-im, .s-post--over:has(img[data-broken]) > .s-post-im { bottom: 30%; }
.s-post--lede { aspect-ratio: 16 / 9; }
.s-post--lede > .s-post-tx { padding: 90px 22px 20px; max-width: 760px; }
.s-post--lede .s-post-title { font-size: 32px; line-height: 1.02; }
.s-post--lede .s-post-dek { font-size: 16px; }

/* Band: a strong image band on top, the text below on the card surface. */
.s-post--band { align-content: start; }
.s-post--band > .s-post-im { aspect-ratio: 2 / 1; }
.s-post--band > .s-post-tx { padding: 12px 14px 14px; }
.s-post--band .s-post-cat { color: var(--fg-1); }
.s-post--band .s-post-dek { color: var(--fg-2); }
.s-post--band .s-post-dt { color: var(--fg-3); }

@media (max-width: 720px) {
  .s-post--over { aspect-ratio: 5 / 4; }
  .s-post--lede { aspect-ratio: 1 / 1; }
  .s-post--lede > .s-post-tx { padding: 80px 16px 16px; }
  .s-post--lede .s-post-title { font-size: 26px; }
  .s-post--lede .s-post-dek { font-size: 15px; }
}

/* ── PostHero ───────────────────────────────────────────────────────── */
.s-hero-media { position: relative; margin: 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink); }
.s-hero-media > .s-mfb { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; }
.s-hero-media .s-mfb-art { inset: 14% 20%; }
.s-hero-media .s-mfb-meta { left: 16px; top: 14px; }
.s-hero-media-img { position: absolute; inset: 0; }
.s-hero-media-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.s-hero-media-img img[data-broken] { display: none; }

/* ── Prose / Quote / Byline ─────────────────────────────────────────── */
.s-prose { font-size: 17px; line-height: 1.62; color: var(--fg-1); max-width: var(--w-read); }
/* Every element rule below is scoped to the body's own children (or MDX's
   unclassed lists and tables), at :where() specificity, so a library
   component dropped into an article (.s-card, .s-tbl, .s-ll, .s-callout)
   keeps its own look. */
:where(.s-prose) > * + * { margin-top: 1em; }
:where(.s-prose) > :is(h2, h3) { scroll-margin-top: calc(var(--nav-h) + 20px); }
:where(.s-prose) > h2 { margin-top: 1.8em; font-family: var(--f-display); font-weight: 800; font-size: 28px; text-transform: uppercase; line-height: 1;
  background: linear-gradient(90deg, var(--accent) var(--rule-accent-w), var(--line-2) var(--rule-accent-w)) bottom / 100% var(--rule-h) no-repeat; padding-bottom: 12px; }
:where(.s-prose) > h3 { margin-top: 1.4em; font-family: var(--f-display); font-weight: 800; font-size: 20px; text-transform: uppercase; line-height: 1.1; }
:where(.s-prose) > :is(p, ul:not([class]), ol:not([class]), blockquote, table:not([class])) a { color: var(--fg-1); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
:where(.s-prose) > :is(p, ul:not([class]), ol:not([class]), blockquote, table:not([class])) a:hover { text-decoration-thickness: 2px; }
:where(.s-prose) > :is(p, ul:not([class]), ol:not([class]), blockquote, table:not([class])) strong { font-weight: 700; color: var(--fg-1); }
:where(.s-prose) > :is(ul, ol):not([class]) { padding-left: 1.3em; }
:where(.s-prose) > :is(ul, ol):not([class]) li + li { margin-top: 0.4em; }
:where(.s-prose) > :is(ul, ol):not([class]) li > :is(ul, ol) { margin-top: 0.4em; padding-left: 1.2em; }
:where(.s-prose) > :is(ul, ol):not([class]) li::marker { color: var(--fg-3); font-family: var(--f-mono); font-size: 0.85em; }
/* blockquote: the Callout info look (grey left rule on the raised surface) */
:where(.s-prose) > blockquote { margin-left: 0; margin-right: 0; padding: 12px 14px; background: var(--bg-2); border-left: 3px solid var(--fg-2); font-size: 15px; line-height: 1.55; color: var(--fg-2); }
:where(.s-prose) > blockquote > * + * { margin-top: 0.6em; }
:where(.s-prose) > blockquote > :first-child { margin-top: 0; }
/* table: the DataTable look, full width; cells wrap on a phone (an MDX
   table has no wrapper to scroll in) */
:where(.s-prose) > table:not([class]) { width: 100%; border-collapse: collapse; background: var(--bg-2); border-top: 2px solid var(--card-rule); font-size: 14px; line-height: 1.4; }
:where(.s-prose) > table:not([class]) th { text-align: left; white-space: nowrap; padding: 9px 12px; background: var(--tbl-head-bg); color: var(--fg-3);
  font-family: var(--f-mono); font-weight: 500; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
:where(.s-prose) > table:not([class]) td { padding: 10px 12px; overflow-wrap: anywhere; border-top: 1px solid var(--line-1); vertical-align: top; }
:where(.s-prose) > table:not([class]) :is(th, td)[align="right"] { text-align: right; font-variant-numeric: tabular-nums; }
:where(.s-prose) > table:not([class]) :is(th, td)[align="center"] { text-align: center; }
:where(.s-prose) > :is(img, p > img, figure > img) { display: block; max-width: 100%; height: auto; }
:where(.s-prose) > figure { margin-left: 0; margin-right: 0; }
:where(.s-prose) > figure > figcaption { margin-top: 6px; font-family: var(--f-mono); font-size: 11px; color: var(--fg-3); }
:where(.s-prose) > hr { height: 1px; margin: 2em 0; border: 0; background: var(--line-2); }
:where(.s-prose) > :is(p, ul:not([class]), ol:not([class]), blockquote, table:not([class]), h2, h3) code { padding: 1px 5px; background: var(--surface-sunk); font-family: var(--f-mono); font-size: 0.86em; }
:where(.s-prose) > pre { padding: 12px 14px; overflow-x: auto; background: var(--surface-sunk); border-left: 3px solid var(--line-2); font-family: var(--f-mono); font-size: 13px; line-height: 1.5; }
:where(.s-prose) > pre code { padding: 0; background: none; font-size: inherit; }
.s-quote { margin: 1.4em 0; padding: 4px 0 4px 16px; border-left: 4px solid var(--fg-1); }
.s-quote blockquote { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 24px; line-height: 1.15; }
.s-quote figcaption { margin-top: 8px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); }
.s-byline { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; color: var(--fg-3); }
.s-byline b { color: var(--fg-1); font-weight: 600; }
.s-byline-mark { width: 30px; height: 30px; display: grid; place-items: center; background: var(--ink); color: var(--ink-fg); font-family: var(--f-display); font-weight: 800; font-size: 12px; }

/* ── Article surface (.s-article) ───────────────────────────────────── */
/* Long-form on paper, like the driver bio card: add s-article to the page's
   own <article> (blog post, guide chapter, Fantasy rules / tiers). Header,
   byline, hero and body sit in one --bg-2 panel with the card top rule; the
   body keeps a ~68 character line. A PostHero runs to the panel's edges.
   Inside the panel, prose blockquotes, tables and callouts and nested cards
   step down to --surface-sunk so they still read as separate blocks. */
.s-article {
  --art-pad: 40px;
  display: block; min-width: 0; background: var(--bg-2); color: var(--fg-1);
  border-top: 2px solid var(--card-rule); padding: 32px var(--art-pad) 40px;
}
.s-article .s-prose { max-width: 68ch; }
.s-article > .s-ph { margin-bottom: 14px; }
.s-article > .s-hero-media { margin: 20px calc(-1 * var(--art-pad)) 28px; }
.s-article :where(.s-prose) > :is(blockquote, table:not([class])),
.s-article :where(.s-prose) .s-callout,
.s-article :where(.s-prose) .s-card { background: var(--surface-sunk); }
@media (max-width: 720px) {
  .s-article { --art-pad: 16px; padding: 18px var(--art-pad) 24px; margin-inline: -6px; }
  .s-article > .s-hero-media { margin: 14px calc(-1 * var(--art-pad)) 20px; }
}

/* ── Callout ────────────────────────────────────────────────────────── */
.s-callout { --c: var(--fg-2); display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 12px 14px; background: var(--bg-2); border-left: 3px solid var(--c); font-size: 14px; color: var(--fg-2); }
.s-callout--warn { --c: var(--warn); }
.s-callout--error { --c: var(--neg); }
.s-callout--ok { --c: var(--pos); }
.s-callout--provisional { --c: var(--warn); background: color-mix(in srgb, var(--warn) 7%, var(--bg-2)); }
.s-callout-icon { color: var(--c); margin-top: 1px; }
.s-callout-title { display: block; font-family: var(--f-display); font-weight: 800; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-1); margin-bottom: 2px; }

/* ── EmptyState / Skeleton ──────────────────────────────────────────── */
.s-empty { display: grid; justify-items: center; gap: 6px; padding: 28px 16px; text-align: center; color: var(--fg-3); background: var(--bg-2); border-top: 2px solid var(--card-rule); }
.s-empty b { font-family: var(--f-display); font-weight: 800; font-size: 18px; text-transform: uppercase; color: var(--fg-1); }
.s-empty p { margin: 0; max-width: 44ch; font-size: 14px; }
.s-empty--error .icon { color: var(--neg); }
.s-skel-lines { display: grid; gap: 8px; }
.s-skel { display: block; height: 12px; background: linear-gradient(90deg, var(--bg-3), var(--bg-hover), var(--bg-3)) 0 0 / 200% 100%; animation: s-shimmer 1.4s linear infinite; }
.s-skel--block { height: 120px; }
@keyframes s-shimmer { to { background-position: -200% 0; } }

/* ── Sheet ──────────────────────────────────────────────────────────── */
.s-sheet-root { position: fixed; inset: 0; z-index: var(--z-sheet); display: flex; align-items: flex-end; justify-content: center; }
.s-sheet-root[hidden] { display: none; }
.s-scrim { position: absolute; inset: 0; background: var(--scrim); animation: s-fade 160ms ease-out; }
.s-sheet { position: relative; width: 100%; max-height: 86vh; overflow: auto; overscroll-behavior: contain; background: var(--bg-2); color: var(--fg-1);
  border-top: 3px solid var(--card-rule); box-shadow: var(--shadow-float); animation: s-sheet-up 220ms var(--ease-out); padding-bottom: env(safe-area-inset-bottom); }
.s-sheet:focus { outline: none; }
.s-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-1); position: sticky; top: 0; background: var(--bg-2); z-index: 1; }
.s-sheet-title { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 18px; letter-spacing: 0.06em; text-transform: uppercase; }
.s-sheet-body { padding: 14px; display: grid; gap: 12px; }
.s-sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line-1); }
@media (min-width: 721px) {
  .s-sheet-root--auto, .s-sheet-root--modal { align-items: center; padding: 24px; }
  .s-sheet-root--auto .s-sheet, .s-sheet-root--modal .s-sheet { max-width: 560px; animation: s-fade 160ms ease-out; }
}
@keyframes s-fade { from { opacity: 0; } }
@keyframes s-sheet-up { from { transform: translateY(100%); } }
/* App feel (9 Nov): grab handle on bottom sheets, drag to dismiss and the
   snap back (sharp.js), one scroll lock while any sheet is open. */
.s-sheet { transition: transform 200ms var(--ease-out); }
.s-sheet-grab { display: none; }
@media (max-width: 720px) {
  .s-sheet-grab { display: block; width: 36px; height: 4px; margin: 8px auto 0; background: var(--line-3); touch-action: none; }
  .s-sheet-root .s-sheet-head { touch-action: none; }
  .s-sheet-root--auto .s-sheet, .s-sheet-root--sheet .s-sheet { max-height: calc(100dvh - var(--topbar-h) - 8px); }
}
@media (min-width: 721px) {
  .s-sheet-root--sheet .s-sheet-grab { display: block; width: 36px; height: 4px; margin: 8px auto 0; background: var(--line-3); }
}
html.s-sheet-lock { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .s-sheet { transition: none; } }
.s-share-preview { display: grid; place-items: center; padding: 10px; background: var(--bg-0); min-height: 160px; }

/* ── Toc ────────────────────────────────────────────────────────────── */
.s-toc { display: grid; gap: 8px; }
.s-toc--sticky { position: sticky; top: calc(var(--nav-h) + 16px); align-self: start; }
.s-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line-2); }
.s-toc a { display: block; padding: 6px 12px; margin-left: -2px; border-left: 2px solid transparent; font-size: 13.5px; color: var(--fg-3); text-decoration: none; }
.s-toc a:hover { color: var(--fg-1); }
.s-toc a[aria-current="true"] { color: var(--fg-1); border-left-color: var(--accent); font-weight: 600; }

/* ── Reveal / count-up / grow (sharp.js) ────────────────────────────────
   Visible at rest. Only elements sharp.js marked .is-pending (below the
   fold on load) start hidden, and they animate in once on entry. */
[data-reveal].is-pending { opacity: 0; transform: translateY(14px); }
[data-reveal].is-in { animation: s-rise var(--mo-enter) var(--ease-out) both; }
@keyframes s-rise { from { opacity: 0; transform: translateY(14px); } }
[data-grow].is-pending { transform: scaleX(0); transform-origin: left; }
[data-grow].is-in { animation: s-grow var(--mo-grow) var(--ease-out) both; transform-origin: left; }
@keyframes s-grow { from { transform: scaleX(0); } }

/* ── Reduced motion: no entrance, no pulse, no marquee, no shimmer ─── */
@media (prefers-reduced-motion: reduce) {
  [data-reveal].is-pending, [data-grow].is-pending { opacity: 1; transform: none; }
  [data-reveal].is-in, [data-grow].is-in, .s-badge-dot, .s-ses .is-next .s-ses-dot, .s-skel, .s-scrim, .s-sheet { animation: none; }
  .s-lr-x, .s-lr-chev, .s-rail-dot::before, .s-chart-line { transition: none; }
  .s-rail--marquee { overflow-x: auto; }
  .s-rail--marquee .s-rail-track { animation: none; }
  .s-rail--marquee .s-rail-dup { display: none; }
}
