/* SpotRaces — component styles for both appearances. Plain CSS for the server-rendered pages: no framework, minimal vanilla JS.
   Every value comes from tokens.css (load it first). Prefix: sr-.
   No filled cards: blocks are separated by hairlines and space. Secondary font Roboto Mono (--font-mono) for digits.
   Layout reacts to its container (container queries): .sr-shell is the page container (container: shell). */

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
:where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: var(--focus-width) solid var(--focus);
  outline-offset: var(--focus-offset);
}
.sr-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.sr-visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Icons: CSS masks, so they take currentColor in both themes ───────────── */
.sr-icon { display: inline-block; flex: none; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--sr-i) center / contain no-repeat; mask: var(--sr-i) center / contain no-repeat; }
.sr-icon--search { --sr-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E"); }
.sr-icon--pin { --sr-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M12 2a8 8 0 0 0-8 8c0 5.6 6.4 11.3 7.3 12a1 1 0 0 0 1.4 0c.9-.7 7.3-6.4 7.3-12a8 8 0 0 0-8-8Zm0 5a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z'/%3E%3C/svg%3E"); }
.sr-icon--chevron-right { --sr-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 5 7 7-7 7'/%3E%3C/svg%3E"); }
.sr-icon--chevron-left { --sr-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 5-7 7 7 7'/%3E%3C/svg%3E"); }
.sr-icon--chevron-down { --sr-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E"); }
.sr-icon--external { --sr-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 16 17 7M9 7h8v8'/%3E%3C/svg%3E"); }
.sr-icon--close { --sr-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 7 10 10M17 7 7 17'/%3E%3C/svg%3E"); }
.sr-icon--filters { --sr-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h9M17 7h3M4 17h3M11 17h9'/%3E%3Ccircle cx='15' cy='7' r='2'/%3E%3Ccircle cx='9' cy='17' r='2'/%3E%3C/svg%3E"); }
.sr-icon--ruler { --sr-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='10' rx='1.5'/%3E%3Cpath d='M6 7v3M10 7v4M14 7v3M18 7v4'/%3E%3C/svg%3E"); }
/* «Más información»: what each row is. */
.sr-icon--organizer { --sr-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 3.6-7 8-7s8 3 8 7'/%3E%3C/svg%3E"); }
.sr-icon--website { --sr-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.5 2.7 3.8 5.7 3.8 9s-1.3 6.3-3.8 9c-2.5-2.7-3.8-5.7-3.8-9S9.5 5.7 12 3Z'/%3E%3C/svg%3E"); }
.sr-icon--social { --sr-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75'%3E%3Ccircle cx='18' cy='5' r='2.5'/%3E%3Ccircle cx='6' cy='12' r='2.5'/%3E%3Ccircle cx='18' cy='19' r='2.5'/%3E%3Cpath d='m8.2 10.8 7.6-4.4M8.2 13.2l7.6 4.4'/%3E%3C/svg%3E"); }
.sr-icon--regulation { --sr-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h6'/%3E%3C/svg%3E"); }
.sr-icon--circuit { --sr-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 4h8v5a4 4 0 0 1-8 0Z'/%3E%3Cpath d='M8 6H5a3 3 0 0 0 3 4M16 6h3a3 3 0 0 1-3 4M12 13v4M10 17h4M8 21h8'/%3E%3C/svg%3E"); }
.sr-icon--places { --sr-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M3 20c0-3.3 2.7-6 6-6s6 2.7 6 6M16 4.5a3.5 3.5 0 0 1 0 7M18 14c2 .6 3.5 3 3.5 6'/%3E%3C/svg%3E"); }
.sr-icon--federation { --sr-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E"); }
.sr-icon--lg { width: 20px; height: 20px; }

/* ── Button ─────────────────────────────────────────────────────────────── */
.sr-button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  box-sizing: border-box; min-height: var(--control-height); padding: 0 var(--space-4);
  border: var(--border-width) solid var(--line-strong); border-radius: var(--radius-full);
  background: transparent; color: var(--ink); font: 500 14px/1.25 var(--font-sans);
  text-decoration: none; white-space: nowrap; cursor: pointer; }
.sr-button:hover { background: var(--surface-2); }
.sr-button--primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 600; }
.sr-button--primary:hover { background: var(--accent); filter: brightness(1.08); }
.sr-button--quiet { border-color: transparent; padding: 0 var(--space-2); color: var(--ink-muted); }
.sr-button--quiet:hover { background: transparent; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.sr-button--lg { min-height: 48px; padding: 0 var(--space-6); font-size: 16px; }
.sr-button--block { display: flex; width: 100%; }
/* Icon only, with a --touch-target hit area; the button needs an aria-label. */
.sr-button--icon { width: var(--touch-target); min-height: var(--touch-target); padding: 0; border-color: transparent;
  color: var(--ink-muted); font-size: var(--icon-button-glyph); }
.sr-button--icon:hover { color: var(--ink); }
/* Round, icon only: «Añadir al calendario» and «Compartir» in the event's header, and the poster viewer's download,
   share and close buttons. One rule for all, so they stay alike; each needs an aria-label. Its height is fixed, not a
   minimum, and it sits at the centre of its row: a row made taller (a main button on two lines) must not stretch it out
   of round. */
.sr-button--round { flex: none; align-self: center; width: 48px; height: 48px; min-height: 0; padding: 0; }
.sr-button--round .sr-symbol { width: 20px; height: 20px; }
.sr-button:disabled, .sr-button[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }

/* ── SiteHeader ─────────────────────────────────────────────────────────── */
/* The height is --header-h whatever the content, so the calendar's normal and compact states match. */
.sr-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  box-sizing: border-box; height: var(--header-h); border-bottom: var(--border-width) solid var(--line); }
.sr-header__actions { display: flex; flex: none; align-items: center; gap: var(--space-2); }
.sr-theme-label { position: relative; flex: none; }
.sr-theme-label:has([hidden]) { display: none; }
.sr-theme-label > span { position: absolute; top: var(--space-1); left: var(--space-3);
  font: 500 var(--text-theme-label)/1 var(--font-sans); color: var(--ink-muted); pointer-events: none; }
.sr-theme { flex: none; min-height: var(--touch-target); max-width: 100%; padding: var(--space-3) var(--space-2) 0;
  border: var(--border-width) solid var(--line-strong); border-radius: var(--radius-full);
  background: var(--bg); color: var(--ink); font: 500 var(--text-small)/1.25 var(--font-sans); cursor: pointer; }
.sr-theme[hidden] { display: none; }
.sr-theme:hover { background: var(--surface-2); }
.sr-theme option { background: var(--surface); color: var(--ink); }
/* Footer theme preference: native radios retain keyboard and screen-reader behaviour. */
.sr-theme-switch { display: inline-flex; flex: none; align-items: center; gap: var(--space-3); }
.sr-theme-switch > span { font: 600 var(--text-theme-label)/1 var(--font-sans);
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-subtle); }
.sr-theme-switch__options { display: flex; padding: var(--border-width); border: var(--border-width) solid var(--line-strong);
  border-radius: var(--radius-full); background: var(--bg); }
.sr-theme-switch__option { position: relative; display: grid; place-items: center; width: var(--theme-option);
  height: var(--theme-option); color: var(--ink-subtle); cursor: pointer; }
.sr-theme-switch__option input { appearance: none; position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  border: 0; border-radius: var(--radius-full); background: transparent; cursor: pointer; }
.sr-theme-switch__option input:hover { background: var(--surface-2); }
.sr-theme-switch__option input:checked { background: var(--ink); }
.sr-theme-switch__option:has(input:checked) { color: var(--bg); }
.sr-theme-switch__option svg { position: relative; width: var(--space-4); height: var(--space-4); pointer-events: none; }
.sr-brand { --brand-gap: 10px; position: relative; display: inline-flex; align-items: center; gap: var(--brand-gap);
  color: var(--ink); text-decoration: none; font: 800 20px/1 var(--font-sans); letter-spacing: -0.02em; }
.sr-mark { width: 24px; height: 24px; flex: none; }
.sr-mark .on { fill: var(--ink); } .sr-mark .off { fill: var(--dot-off); } .sr-mark .spot { fill: var(--accent); }
/* Calendar page: the header stays at the top. Compact mode (.is-compact, set by the calendar script once the page's
   search scrolls under the header) swaps «SpotRaces» for a compact search and, below 960 px, a filters button.
   The pieces cross-fade in place; hidden ones are visibility: hidden, so they leave the tab order. */
.sr-header--fixed { position: sticky; top: 0; z-index: 2; background: var(--bg); }
/* Whatever the page scrolls to (focus, scrollIntoView) clears the header. Not scroll-padding on the page: browsers
   would then scroll to reveal the header's own controls whenever they take focus. */
.sr-header--fixed ~ .sr-main, .sr-header--fixed ~ .sr-main * { scroll-margin-top: var(--header-h); }
.sr-header__compact { display: flex; flex: 1; min-width: 0; align-items: center; justify-content: flex-end; gap: var(--space-2); }
.sr-header__compact, .is-compact .sr-brand__name { visibility: hidden; opacity: 0; transform: translateY(var(--space-1)); }
.is-compact .sr-header__compact { visibility: visible; opacity: 1; transform: none; }
/* Out of the flow, the name fades where it stood while the compact controls take its space. */
.is-compact .sr-brand__name { position: absolute; left: 100%; margin-left: var(--brand-gap); white-space: nowrap;
  transform: translateY(calc(-1 * var(--space-1))); }
@media (prefers-reduced-motion: no-preference) {
  .sr-header__compact, .sr-brand__name { transition: opacity var(--duration-base) ease, transform var(--duration-base) ease,
    visibility var(--duration-base); }
}
.sr-header__compact .sr-searchfield { flex: 0 1 var(--compact-search-max); min-width: 0; }
.sr-header__filters { position: relative; }
.sr-header__filters .sr-count { position: absolute; top: 0; right: 0; }
/* Narrow: a search button expands the field over the free space; the filters button opens the in-place form. */
@container shell (max-width: 959px) {
  .sr-header__compact .sr-searchfield { flex: 1; }
  .sr-header__compact:not(:has(.sr-header__search[aria-expanded="true"])) .sr-searchfield { display: none; }
}
@container shell (min-width: 960px) {
  .sr-header__search, .sr-header__filters { display: none; }
}
/* Smallest headers cannot fit a usable text field beside the mark, Tema and three icon controls.
   Expand search into a floating row without hiding controls or changing the sticky header height. */
@container shell (max-width: 479px) {
  .sr-header { gap: var(--space-2); }
  .is-compact .sr-brand { flex: none; }
  .is-compact .sr-header__compact .sr-searchfield { position: absolute; top: calc(100% + var(--space-2));
    left: 0; right: 0; min-height: var(--touch-target); background: var(--surface); }
}
/* Edition variant: the back button is the arrow alone below 960 px and reads «Calendario» from there. Its aria-label
   names it either way, so below 960 px the label is simply not displayed. */
.sr-header__back-label { font-size: var(--text-small); }
@container shell (max-width: 959px) {
  .sr-header__back-label { display: none; }
}
@container shell (min-width: 960px) {
  .sr-header__back { width: auto; padding: 0 var(--space-4) 0 var(--space-2); }
}

/* ── SearchField ────────────────────────────────────────────────────────── */
.sr-searchfield { display: flex; align-items: center; gap: var(--space-3); box-sizing: border-box;
  min-height: 52px; padding: 0 var(--space-5); border: var(--border-width) solid var(--line-strong);
  border-radius: var(--radius-full); background: transparent; color: var(--ink-subtle); }
.sr-searchfield input { flex: 1; min-width: 0; border: 0; padding: 0; background: none; color: var(--ink);
  font: 400 17px/1.4 var(--font-sans); outline: none; }
.sr-searchfield input::placeholder { color: var(--ink-subtle); }
.sr-searchfield input::-webkit-search-cancel-button { display: none; }
.sr-searchfield:focus-within { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
/* Compact: control height, for the fixed calendar header. */
.sr-searchfield--compact { min-height: var(--control-height); padding: 0 var(--space-4); gap: var(--space-2); }
.sr-searchfield--compact input { font-size: var(--text-field); }
.sr-searchfield kbd { font: 500 12px/1 var(--font-sans); color: var(--ink-subtle); border: var(--border-width) solid var(--line);
  border-radius: var(--radius-sm); padding: 4px 6px; }

/* ── Choice (checkbox / radio as a pill) ────────────────────────────────── */
.sr-choices { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.sr-choice { position: relative; display: inline-flex; align-items: center; box-sizing: border-box; min-height: 28px;
  padding: 0 9px; border: var(--border-width) solid var(--line-strong); border-radius: var(--radius-full);
  color: var(--ink); font: 500 14px/1.2 var(--font-sans); cursor: pointer; user-select: none; }
.sr-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sr-choice:hover { background: var(--surface-2); }
.sr-choice:has(input:checked) { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.sr-choice:has(input:focus-visible) { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
.sr-choice small { margin-left: 6px; font: 400 12px/1 var(--font-sans); opacity: .7; }

/* ── FilterForm ─────────────────────────────────────────────────────────── */
.sr-filters__toggle { display: none; }
.sr-filters__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--space-2); }
.sr-filters__title { margin: 0; font: 700 18px/1.25 var(--font-sans); letter-spacing: -0.01em; }
.sr-filters__body { display: grid; gap: 0; }
.sr-fieldset { margin: 0; padding: var(--space-5) 0; border: 0; border-top: var(--border-width) solid var(--line); min-width: 0; }
.sr-fieldset legend { float: left; display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3);
  width: 100%; padding: 0; margin-bottom: var(--space-3);
  font: 600 12px/1.33 var(--font-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-subtle); }
/* At the right of a filter's heading, what it is set to and how many events that takes: «Hoy – 18 dic · 29». */
/* At the right of a filter's heading while it is set: the calendar without it. */
.sr-fieldset__clear { font: 500 13px/1.33 var(--font-sans); letter-spacing: 0; text-transform: none; color: var(--ink);
  text-decoration: underline; text-decoration-thickness: var(--border-width); text-underline-offset: 3px; }
/* Under a filter's heading, what it is set to and how many events that takes: «Hoy – 31 ene  58 carreras». */
.sr-filter-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); margin: 0 0 var(--space-3); }
.sr-filter-summary b { font: 700 20px/1.25 var(--font-sans); letter-spacing: -0.01em; color: var(--ink); }
.sr-filter-summary b output { font: inherit; }
.sr-filter-summary > span { font: 400 13px/1.33 var(--font-mono); color: var(--ink-subtle); }
.sr-fieldset legend + * { clear: both; }
/* «Desde» and «Hasta» side by side where both fit whole (a phone), else one over the other (the filter column on wide
   pages): a native date field does not shrink below its date and icon. */
.sr-dates { display: none; grid-template-columns: repeat(auto-fit, minmax(var(--date-field-min-w), 1fr)); gap: var(--space-2);
  margin-top: var(--space-3); }
.sr-filters:not(.has-script) .sr-fieldset:has(input[value="custom"]:checked) .sr-dates { display: grid; }
/* With the script the fields open when «Elegir…» is tapped, not when the slider sets their dates. */
.sr-dates.is-open { display: grid; }
.sr-field { display: grid; gap: 6px; font: 500 12px/1.33 var(--font-sans); color: var(--ink-subtle); }
.sr-input { box-sizing: border-box; width: 100%; min-height: var(--control-height); padding: 0 var(--space-3);
  border: var(--border-width) solid var(--line-strong); border-radius: var(--radius-md); background: transparent;
  color: var(--ink); font: 400 15px/1.4 var(--font-sans); }
.sr-filters__apply { display: none; }
/* Narrow pages (< 960px of .sr-shell): the search is compact, and the form folds behind a toggle button beside it, as tall as it, and
   opens in place, pushing the list down. No modal. A 6-line script flips data-open and aria-expanded (see FilterForm
   README). The button is the icon alone on the narrowest pages, where the search needs the width, with the number of
   active filters at its corner; the folded form takes no room. */
@container shell (max-width: 959px) {
  .sr-calendar__search { display: flex; gap: var(--space-2); }
  /* The search and its button at the touch target's height, the search's text at 16 px: any smaller and iOS zooms
     the page in when the field takes focus. */
  .sr-calendar__search .sr-searchfield { flex: 1; min-width: 0; min-height: var(--touch-target); padding: 0 var(--space-4); gap: var(--space-2); }
  .sr-calendar__search .sr-searchfield input { font-size: 16px; }
  .sr-calendar__search .sr-icon--lg { width: 18px; height: 18px; }
  .sr-filters__toggle { position: relative; display: inline-flex; flex: none; min-height: var(--touch-target); }
  /* Filled while the filters are open. */
  .sr-filters__toggle[aria-expanded="true"] { background: var(--surface-2); }
  .sr-filters__head { display: none; }
  .sr-calendar__aside:has(.sr-filters[data-open="false"]) { display: none; }
  .sr-filters[data-open="true"] .sr-fieldset:first-child { padding-top: 0; border-top: 0; }
  /* Closer pills, so that each filter's shortcuts share a line on a phone. */
  .sr-filters .sr-choices { gap: 6px; }
  /* «Limpiar» and «Ver N carreras», held at the foot of the screen while the open filters scroll by, over a hairline
     and across the page's gutters. */
  .sr-filters__apply { position: sticky; bottom: 0; z-index: 2; display: flex; gap: var(--space-2); margin: 0 calc(-1 * var(--space-4));
    padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
    border-top: var(--border-width) solid var(--line); background: var(--bg); }
  /* Tighter than a large button: their borders hug the text. */
  .sr-filters__apply > .sr-button { min-height: 40px; padding: 0 var(--space-3); font-size: 15px; }
  .sr-filters__apply > .sr-button:not(#calendar-apply) { flex: none; }
  .sr-filters__apply > #calendar-apply { flex: 1; width: auto; }
}
@container shell (max-width: 479px) {
  .sr-filters__toggle { width: var(--touch-target); padding: 0; }
  .sr-filters__toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sr-filters__toggle .sr-count { position: absolute; top: -4px; right: -4px; }
}
.sr-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box;
  border-radius: var(--radius-full); background: var(--accent); color: var(--on-accent); font: 700 12px/1 var(--font-mono); }

/* ── Range (two native range inputs, one track): distance and dates ───────── */
/* A histogram as a matrix of dots, the mark's: a column a bar, its dots stacked from the bottom, orange where the range
   takes it, grey elsewhere. Over it, the track: two thin orange lines on the range's outer edges, standing out of the
   matrix above and below, each the thumb of its range input, invisible and as tall as the line, so the line is what is
   grabbed. The columns line up with the thumbs' travel (inset as their half width) and touch, so a line on a column's
   edge stands between its dots. Each dot's cell is square, a row as tall as a column is wide, so the dots are as far
   apart across as up at any width: the histogram grows with the page. Under it, the axis. The page gives each its
   columns (--bars) and its rows (--dot-rows, the dots of the tallest column). */
.sr-range { --inset: calc(var(--range-thumb-w) / 2); --dot-pitch: calc((100cqw - 2 * var(--inset)) / var(--bars));
  --dot-size: calc(var(--dot-pitch) * var(--dot-ratio)); --matrix-h: calc(var(--dot-rows) * var(--dot-pitch));
  --track-h: calc(var(--matrix-h) + 2 * var(--range-line-overshoot)); container-type: inline-size; display: grid; grid-template-columns: minmax(0, 1fr);
  gap: calc(var(--range-line-overshoot) + var(--space-1)); margin-top: var(--space-4); }
.sr-histogram { grid-area: 1 / 1; display: flex; align-items: flex-end; height: var(--matrix-h); padding: 0 var(--inset); }
.sr-histogram__bar { --dot: var(--line-strong); flex: 1; height: calc(var(--dots) * var(--dot-pitch));
  background: radial-gradient(circle, var(--dot) 0 calc(var(--dot-size) / 2), transparent calc(var(--dot-size) / 2 + 0.5px)) center bottom / 100% var(--dot-pitch) repeat-y; }
.sr-histogram__bar.is-taken { --dot: var(--accent); }
/* With the script a tap on the matrix moves the nearer end there, and a drag carries it, without scrolling the page. */
.has-script .sr-histogram { touch-action: none; cursor: pointer; }
.sr-range__axis { grid-row: 2; position: relative; height: 14px; margin: 0 var(--inset); font: 400 11px/14px var(--font-mono); color: var(--ink); }
.sr-range__axis span { position: absolute; left: calc(var(--at) * 100%); translate: -50% 0; }
.sr-range__track { --lo: 0; --hi: 1; grid-area: 1 / 1; position: relative; height: var(--track-h);
  margin-block: calc(-1 * var(--range-line-overshoot)); pointer-events: none; }
.sr-range__track::before, .sr-range__track::after { content: ""; position: absolute; top: 0; bottom: 0; width: var(--range-line-w);
  left: calc(var(--inset) + (100% - 2 * var(--inset)) * var(--at)); translate: -50% 0; border-radius: var(--radius-full); background: var(--accent); }
.sr-range__track::before { --at: var(--lo); }
.sr-range__track::after { --at: var(--hi); }
/* The focused input's line takes the focus ring. */
.sr-range__track:has(input:first-of-type:focus-visible)::before,
.sr-range__track:has(input:last-of-type:focus-visible)::after { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
.sr-range input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.sr-range input:focus-visible { outline: none; }
.sr-range input::-webkit-slider-runnable-track { height: 100%; background: none; }
.sr-range input::-moz-range-track { height: 100%; background: none; }
.sr-range input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: var(--range-thumb-w);
  height: var(--track-h); border: 0; background: none; cursor: ew-resize; }
.sr-range input::-moz-range-thumb { pointer-events: auto; width: var(--range-thumb-w); height: 100%; border: 0; border-radius: 0; background: none; cursor: ew-resize; }

/* ── ActiveFilters ──────────────────────────────────────────────────────── */
.sr-active { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.sr-active__total { margin-right: var(--space-2); font: 700 15px/1.3 var(--font-sans); color: var(--ink); }
.sr-active__total b { font: 600 15px/1.3 var(--font-mono); }
.sr-active__total span { font-weight: 400; color: var(--ink-muted); }
.sr-chip { display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; min-height: 30px; padding: 0 6px 0 12px;
  border: var(--border-width) solid var(--line-strong); border-radius: var(--radius-full); background: transparent; color: var(--ink); font: 500 13px/1 var(--font-sans); }
.sr-chip button, .sr-chip a { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0;
  border-radius: var(--radius-full); background: transparent; color: var(--ink-muted); cursor: pointer; }
.sr-chip button:hover, .sr-chip a:hover { background: var(--surface-2); color: var(--ink); }
.sr-chip .sr-icon { width: 14px; height: 14px; }

/* ── DayDivider ─────────────────────────────────────────────────────────── */
/* 11  Octubre            ───────────────  02 carreras
       Domingo · 2026                                    */
/* Each day is a group (li.sr-daygroup: the divider, then ul.sr-daygroup__races). The divider sticks under the
   fixed header inside its own group, so when the group ends the next day's divider pushes it out. */
/* Gone (faded and lifted by --space-2) is defined once here, for both the scroll-driven and the fallback fade below. */
.sr-day { --day-bg: var(--bg); --day-gone-opacity: 0; --day-gone-transform: translateY(calc(-1 * var(--space-2)));
  position: sticky; top: var(--header-h); z-index: 1; display: flex; align-items: center; gap: var(--space-4);
  margin: 0; padding: var(--space-6) 0 var(--space-3); background: var(--day-bg); }
/* Rows fade out under the divider instead of being cut off: a --space-5 gradient hangs from the divider's last
   --space-1, over the first row's top padding only, so no text is dimmed at rest. It never takes clicks. */
.sr-day::after { content: ""; position: absolute; top: calc(100% - var(--space-1)); left: 0; right: 0;
  height: var(--space-5); background: linear-gradient(var(--day-bg), transparent); pointer-events: none; }
/* While stuck under the header (.is-stuck, set by the calendar script) the divider and its fade are layered: a slightly
   translucent --bg with a blur behind it. A blur is not motion, so this holds under reduced motion too; without
   backdrop-filter the divider stays solid. */
@supports (backdrop-filter: blur(1px)) {
  .sr-day.is-stuck { --day-bg: color-mix(in srgb, var(--bg) var(--day-stuck-alpha), transparent); backdrop-filter: blur(var(--space-2)); }
}
/* While it is pushed out the divider fades and lifts: over the group's last --space-16 under the header where
   scroll-driven animations exist, otherwise on .is-leaving (set by the calendar script). */
@keyframes sr-day-leave { to { opacity: var(--day-gone-opacity); transform: var(--day-gone-transform); } }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .sr-daygroup { view-timeline: --sr-daygroup block; view-timeline-inset: var(--header-h) 0; }
    /* Longhands only: the build would fold a shorthand and the timeline into one `animation`, which drops it. */
    .sr-day { animation-name: sr-day-leave; animation-timing-function: linear; animation-fill-mode: both;
      animation-timeline: --sr-daygroup; animation-range: cover calc(100% - var(--space-16)) cover 100%; }
  }
  @supports not (animation-timeline: view()) {
    .sr-day { transition: opacity var(--duration-base) ease, transform var(--duration-base) ease; }
    .sr-day.is-leaving { opacity: var(--day-gone-opacity); transform: var(--day-gone-transform); }
  }
}
.sr-day__date { min-width: 0; display: flex; align-items: center; gap: var(--space-4); }
.sr-day__num { min-width: 2ch; font: 500 34px/1 var(--font-mono); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--accent); }
.sr-day__text { min-width: 0; display: grid; gap: 4px; }
.sr-day__month { font: 700 17px/1.1 var(--font-sans); letter-spacing: -0.01em; color: var(--ink); }
.sr-day__sub { font: 400 13px/1.2 var(--font-sans); color: var(--ink-muted); }
.sr-day__sub strong { font-weight: 600; color: var(--ink); }
.sr-day__rule { flex: 1; min-width: var(--space-6); height: var(--border-width); background: var(--line); }
.sr-day__count { white-space: nowrap; font: 400 13px/1 var(--font-sans); color: var(--ink-muted); }
.sr-day__count b { margin-right: 6px; font: 500 13px/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
/* Narrow lists (a 320 px screen, or 200 % zoom): tighter gaps and a shorter rule, so the subtitle only wraps
   when it must and the divider never widens the page. */
@container (max-width: 359px) {
  .sr-day, .sr-day__date { gap: var(--space-2); }
  .sr-day__rule { min-width: var(--space-2); }
}

/* ── StatusBadge ────────────────────────────────────────────────────────── */
.sr-status { display: inline-flex; align-items: center; gap: var(--space-2); box-sizing: border-box; min-height: 26px;
  padding: 0 10px; border: var(--border-width) solid var(--line-strong); border-radius: var(--radius-full);
  font: 500 13px/1 var(--font-sans); color: var(--ink); white-space: nowrap; }
.sr-status::before { content: ""; width: var(--status-dot); height: var(--status-dot); box-sizing: border-box;
  border-radius: var(--radius-full); background: var(--accent); }
.sr-status--closed { color: var(--ink-muted); }
.sr-status--closed::before { background: transparent; border: 1.5px solid var(--ink-subtle); }

/* ── RaceRow (inside .sr-racelist) ──────────────────────────────────────── */
.sr-racelist { container-type: inline-size; list-style: none; margin: 0; padding: 0; }
/* Changing page focuses the list (tabindex="-1") as a reading point, not a control: no ring around the whole list.
   The next Tab lands on its first race link, which shows the ring. */
.sr-racelist:focus-visible { outline: none; }
/* A day's rows: no container of its own, so rows keep the outer list's container queries. */
.sr-daygroup__races { list-style: none; margin: 0; padding: 0; }
/* A row: the event's name, its place, and what it is (terrain, distances, start, route) on one line whose parts a «·»
   separates; then its registration (badge, when it closes, what it costs today). Narrow: the registration is the
   row's last line, the price at its right. Wide: a column of its own under the caption «Inscripción». */
.sr-race { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main chevron" "signup chevron";
  align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-4) 0; border-bottom: var(--border-width) solid var(--line); }
.sr-race:hover .sr-race__chevron { color: var(--accent); }
.sr-race__main { grid-area: main; min-width: 0; display: grid; gap: 2px; }
.sr-race__title { margin: 0 0 2px; font: 700 18px/1.25 var(--font-sans); letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
.sr-race__title a { color: inherit; text-decoration: none; }
.sr-race:hover .sr-race__title a, .sr-race__title a:focus-visible, .sr-race__title a:active {
  color: var(--title-active); text-decoration: var(--title-decoration); text-underline-offset: var(--space-1); }
@media (prefers-reduced-motion: no-preference) { .sr-race__title a { transition: color var(--duration-fast) ease; } }
/* Preserve interaction easing, but never animate a palette change. */
.sr-theme-changing .sr-race__title a { transition: none; }
.sr-race__title a::after { content: ""; position: absolute; inset: 0; } /* whole row clickable */
.sr-race__place, .sr-race__meta { margin: 0; font: 400 14px/1.4 var(--font-sans); color: var(--ink-muted); }
.sr-race__meta { display: flex; flex-wrap: wrap; align-items: center; }
.sr-race__meta > * + *::before { content: "·"; margin: 0 6px; font-family: var(--font-sans); color: var(--ink-subtle); }
.sr-race__km, .sr-race__deadline, .sr-race__price { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0; }
/* «Recorrido»: the edition has a route map. */
.sr-race__route { display: inline-flex; align-items: center; }
.sr-race__route .sr-symbol { flex: none; width: var(--icon-small); height: var(--icon-small); margin-right: var(--space-1); color: var(--ink-subtle); }
.sr-race__signup { grid-area: signup; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3);
  margin: 0; font: 400 14px/1.4 var(--font-sans); color: var(--ink-muted); }
.sr-race__signup .sr-caption { display: none; }
/* Open or closed, the row's state reads in grey, as the lines beside it; the dot tells them apart. */
.sr-race__signup .sr-status { color: var(--ink-muted); }
/* The deadline and the price in grey too, as the distances, closing soon or not. */
.sr-race__price { margin-left: auto; white-space: nowrap; }
.sr-race__chevron { grid-area: chevron; color: var(--ink-subtle); }
@container (min-width: 640px) {
  .sr-race { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; grid-template-areas: "main signup chevron"; gap: var(--space-6); }
  .sr-race__signup .sr-caption { display: block; width: 100%; }
  .sr-race__price { margin-left: 0; }
  /* «hasta 11 abr · desde 9 €»: the «·» of the distances, 6 px each side (the gap gives 12, less 6). */
  .sr-race__deadline + .sr-race__price { margin-left: -6px; }
  .sr-race__deadline + .sr-race__price::before { content: "·"; margin-right: 6px; font-family: var(--font-sans); color: var(--ink-subtle); }
}
/* Narrow, the row keeps only the registration's state, in the place's line, before it: «○ Cerrada · Ferrol · A Coruña».
   Its price and how long it stays open are on the event's page. */
@container (max-width: 639px) {
  .sr-race { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "title title chevron" "signup place chevron" "meta meta chevron";
    gap: 2px 0; }
  .sr-race__main { display: contents; }
  .sr-race__title { grid-area: title; }
  .sr-race__place { grid-area: place; }
  .sr-race__meta { grid-area: meta; }
  .sr-race__chevron { margin-left: var(--space-4); }
  /* The state in grey, as the place beside it. */
  .sr-race__signup { flex-wrap: nowrap; gap: var(--space-1); color: var(--ink-muted); }
  .sr-race__signup .sr-status { min-height: 0; padding: 0; border: 0; font: inherit; color: inherit; gap: 6px; }
  /* The «·» between its parts and before the place, 6 px each side (the flex gap gives 4 of them). */
  .sr-race__signup [data-full]::before { content: "·"; margin: 0 6px 0 2px; color: var(--ink-subtle); }
  .sr-race:has(.sr-race__place) .sr-race__signup::after { content: "·"; margin: 0 6px 0 2px; color: var(--ink-subtle); }
  .sr-race__deadline, .sr-race__price { display: none; }
  /* A price alone, with no state to tell, leaves nothing to show. */
  .sr-race__signup:not(:has(.sr-status)) { display: none; }
}
.sr-caption { font: 500 12px/1.33 var(--font-sans); color: var(--ink-subtle); }

/* ── Pagination ─────────────────────────────────────────────────────────── */
.sr-pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-top: var(--space-6); }
.sr-pagination p { margin: 0; font: 400 13px/1.4 var(--font-mono); color: var(--ink-muted); }

/* ── PageHead (what a calendar page lists) and Crumbs ───────────────────── */
/* The way back up, as small links between «/», or «Calendario» where there is none (--here); and the heading. When the
   filters change the heading, calendar.js eases its height on narrow pages, where a title takes one line or two. */
.sr-crumbs { margin: 0 0 var(--space-2); font: 500 12px/1.33 var(--font-mono); letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-subtle); }
.sr-crumbs ol { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.sr-crumbs li + li::before { content: "/"; margin: 0 var(--space-2); color: var(--line-strong); }
.sr-crumbs a, .sr-crumbs--here { color: var(--ink-muted); text-decoration: none; }
.sr-crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: var(--space-1); }
.sr-calendar__head h1 { margin: 0; font: 800 28px/1.1 var(--font-sans); letter-spacing: -0.025em; text-wrap: balance; }
@container shell (min-width: 960px) {
  .sr-calendar__head h1 { font-size: 40px; }
}

/* ── Page layouts ───────────────────────────────────────────────────────── */
.sr-page { box-sizing: border-box; max-width: var(--container); margin: 0 auto; padding: 0 var(--space-4); }
.sr-shell { container: shell / inline-size; }
/* Narrow, its parts (the heading, the search, the folded filters and the list) close together; wide, apart. It ends
   --space-8 above the footer's hairline, as an event page does. */
.sr-calendar { display: grid; gap: var(--space-4); padding: var(--space-4) 0 var(--space-8); }
.sr-calendar__aside { min-width: 0; }
.sr-calendar__main { min-width: 0; display: grid; align-content: start; gap: var(--space-2); }
@container shell (min-width: 960px) {
  .sr-page { padding: 0 var(--space-6); }
  .sr-calendar { grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: var(--space-12); padding-top: var(--space-6); }
  /* Fixed beside the list, and scrolled on its own when taller than the screen, so its last filters are in reach
     without scrolling the whole list. It pads (and pulls back) the room its controls' focus rings take. */
  .sr-calendar__aside { position: sticky; top: calc(var(--header-h) + var(--space-6) - var(--space-1)); align-self: start;
    max-height: calc(100svh - var(--header-h) - var(--space-6) + var(--space-1)); overflow-y: auto;
    scrollbar-width: thin; margin: calc(-1 * var(--space-1)); padding: var(--space-1) var(--space-1) var(--space-6); }
}

/* ── RacePage ───────────────────────────────────────────────────────────── */
/* Over a rule that parts it from the page's sections, --space-6 on either side of it (.sr-racepage gives the one
   below); on wide screens the poster takes most of the padding above it. */
.sr-racehead { display: grid; gap: var(--space-6); padding: var(--space-6) 0; border-bottom: var(--border-width) solid var(--line); }
.sr-racehead__date { display: flex; align-items: center; gap: var(--space-2); margin: 0; font: 500 12px/1.33 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.sr-racehead__date::before { content: ""; width: var(--status-dot); height: var(--status-dot); border-radius: var(--radius-full); background: var(--accent); }
/* After the date, how long until the race («En 4 días») or what became of it («Cancelada»), in --ink. Under the
   title, which edition it is. An event that will not take place on its date has the dot off and the date struck. */
.sr-racehead__countdown { color: var(--ink); }
.sr-racehead__date > * + .sr-racehead__countdown::before { content: "·"; margin-right: var(--space-2); color: var(--ink-subtle); }
.sr-racehead__date--off::before { box-sizing: border-box; border: 1.5px solid var(--ink-subtle); background: none; }
.sr-racehead__date--off time { text-decoration: line-through; }
.sr-racehead h1 { margin: var(--space-3) 0 0; font: 800 32px/1.05 var(--font-sans); letter-spacing: -0.025em; max-width: 18ch; text-wrap: balance; }
.sr-racehead__edition { margin: var(--space-2) 0 0; font: 400 14px/1.4 var(--font-sans); color: var(--ink-muted); }
/* Under the title, the poster's thumbnail (when downloaded) beside three facts with their label above: Lugar,
   Modalidad and Inscripción. The poster is as tall as what it sits beside and as wide as its ratio (`--poster-ratio`)
   gives, uncropped (CSS sizes it once, so poster-fit.js sizes it again when a title wraps for the width the poster took,
   and makes it shorter when its max-width holds it narrower; without the script the image is contained in its box, so
   it may leave a band but is never cropped): on narrow screens the facts stacked at its side and
   the actions below, full width. From 960 px the poster is a column of its own at the right, as tall as what sits at
   its left: the date and the title (one or two lines), the facts in a row and the actions under them. Without
   poster that column takes the width. */
.sr-racehead__main { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "facts" "cta"; gap: var(--space-4); }
.sr-racehead__main--poster { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "top top" "poster facts" "cta cta"; }
.sr-racehead__top { grid-area: top; }
.sr-racehead__poster { grid-area: poster; position: relative; display: block; align-self: stretch; aspect-ratio: var(--poster-ratio, 3 / 4);
  max-width: min(40vw, 100%); border-radius: var(--radius-sm, 4px); overflow: hidden; }
.sr-racehead__poster img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.sr-racehead__poster:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
.sr-racehead__facts { grid-area: facts; display: grid; align-content: space-between; gap: var(--space-3); margin: 0; }
.sr-racehead__facts dt { font: 400 12px/1.33 var(--font-sans); color: var(--ink-subtle); }
.sr-racehead__facts dd { margin: 2px 0 0; font: 600 15px/1.3 var(--font-sans); color: var(--ink); }
/* A fact that leads somewhere (the place, the terrain) is a link, underlined with a hairline. */
.sr-racehead__facts a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-decoration-thickness: var(--border-width); text-underline-offset: 3px; }
.sr-racehead__facts a:hover { text-decoration-color: currentColor; }
.sr-racehead__signup { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); }
/* When an open registration closes; soon, in --title-active as on the calendar. */
.sr-racehead__deadline { font: 400 13px/1.3 var(--font-mono); color: var(--ink-muted); }
.sr-racehead__deadline.is-urgent { font-weight: 600; color: var(--title-active); }
.sr-racehead__dot { flex: none; width: var(--status-dot); height: var(--status-dot); border: 1.5px solid var(--ink-subtle); border-radius: var(--radius-full); box-sizing: border-box; }
.sr-racehead__signup[data-registration-state="open"] .sr-racehead__dot { border-color: var(--accent); background: var(--accent); }
.sr-racehead__cta { grid-area: cta; display: grid; gap: var(--space-2); margin-top: var(--space-2); }
/* The edition's actions share one row: the registration (or official site) button takes the width the share button leaves. */
.sr-racehead__cta-row { display: flex; gap: var(--space-2); }
.sr-racehead__cta-row > .sr-button--block { flex: 1; width: auto; min-width: 0; }
/* Beside the share button the label may wrap onto two lines on the narrowest screens rather than overflow. */
.sr-racehead__cta-row > .sr-button--lg { padding: var(--space-2) var(--space-4); white-space: normal; text-align: center; }
/* Its sections apart by --space-8, without a rule between them, the first one --space-6 under the header's rule; it
   ends --space-8 from the footer's hairline. */
.sr-racepage { display: grid; gap: var(--space-8); padding: var(--space-6) 0 var(--space-8); }/* From 960 px the sections take two halves, in the same order as on narrow screens: «Pruebas» on the left, and on the
   right «Inscripción», or «Recorrido» when some race has a route, with «Inscripción» then below «Pruebas». «Sobre la
   carrera» spans both below. The columns stay when the chosen race has nothing to show on the right, so that choosing
   another race never reshapes the page. The left column's second row takes the route's spare height, so that «Pruebas»
   keeps its own. */
@container shell (min-width: 960px) {
  .sr-racepage { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-12); align-items: start; }
  .sr-racepage__races { grid-area: 1 / 1; }
  .sr-racepage__signup { grid-area: 1 / 2; }
  .sr-racepage__about, .sr-racepage__day, .sr-racepage__more, .sr-racepage__related { grid-column: 1 / -1; }
  .sr-racepage--route { grid-template-rows: auto 1fr; }
  .sr-racepage--route > .sr-racepage__signup { grid-area: 2 / 1; }
  .sr-racepage__route { grid-area: 1 / 2 / span 2; }
}
/* A section's title is a heading-2; beside it, a note or the race the section shows («● Relevos»). The race's dot flows
   with its text, so that a name on two lines keeps it beside its first. */
.sr-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.sr-section h2 { margin: 0; font: 700 22px/1.2 var(--font-sans); letter-spacing: -0.01em; color: var(--ink); }
.sr-section__note { display: none; margin: 0; font: 400 13px/1.4 var(--font-sans); color: var(--ink-subtle); }
.sr-section__race { margin: 0; font: 600 14px/1.3 var(--font-sans); color: var(--ink); text-align: right; }
.sr-section__dot { display: inline-block; width: var(--status-dot); height: var(--status-dot); margin-right: var(--space-2); vertical-align: middle;
  border-radius: var(--radius-full); background: var(--accent); }
/* Under a section, where its facts come from. */
.sr-prose { max-width: var(--measure); font: 400 17px/1.6 var(--font-sans); color: var(--ink); }
.sr-prose p { margin: 0 0 var(--space-4); }
@container shell (min-width: 960px) {
  .sr-racehead h1 { font-size: 48px; max-width: none; }
  .sr-racehead__main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "facts" "cta";
    column-gap: var(--space-8); row-gap: var(--space-5); }
  .sr-racehead__main--poster { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "top poster" "facts poster" "cta poster"; }
  .sr-racehead__top { padding-bottom: var(--space-3); }
  /* The poster also takes most of the header's top and bottom padding, all but 10 px, to be larger without leaving
     a gap beside the title. */
  .sr-racehead__poster { max-width: 30vw; margin: calc(10px - var(--space-6)) 0; }
  .sr-racehead__facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-12); padding-top: var(--space-6); }
  .sr-racehead__cta { justify-self: start; margin-top: 0; }
  .sr-racehead__cta-row > .sr-button--block { flex: none; }
  .sr-section h2 { font-size: 28px; }
  .sr-section__note { display: block; }
}

/* ── Facts (a list of labelled facts) and TextLink ──────────────────────── */
/* Each fact: its label over its text, which may run long (the aid stations of an ultra). Spaced as the day of the race's
   blocks, with the same label: */
.sr-facts { display: grid; gap: var(--space-6); margin: 0; }
.sr-facts > div { display: grid; gap: var(--space-2); }
/* The label of a fact, of a block of the day of the race or of a group of other races: small caps, which a hairline
   follows to the edge, 12 px over what it labels (--space-1 here and --space-2 there). */
.sr-facts dt, .sr-dayinfo h3, .sr-related h3 { display: flex; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-1);
  font: 600 12px/1.33 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-subtle); }
.sr-facts dt::after, .sr-dayinfo h3::after, .sr-related h3::after { content: ""; flex: 1; height: var(--border-width); background: var(--line); }
.sr-facts dd { margin: 0; font: 400 15px/1.5 var(--font-sans); color: var(--ink); overflow-wrap: anywhere; }
.sr-route + .sr-facts, .sr-facts + .sr-route { margin-top: var(--space-6); }
.sr-textlink { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--ink); font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--line-strong); text-decoration-thickness: var(--border-width); text-underline-offset: 3px; }
.sr-textlink:hover { text-decoration-color: currentColor; }
.sr-textlink .sr-icon { width: var(--icon-small); height: var(--icon-small); color: var(--ink-muted); }

/* ── Info («Más información»: where to read more about the event) ───────── */
/* Each row: its icon, its title over what it is, and, when it links somewhere, a ↗ at its right; the whole row is the
   link. From 640 px, in two columns. */
.sr-info { display: grid; gap: var(--space-1) var(--space-12); margin: 0; padding: 0; list-style: none; }
.sr-info__row { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: var(--space-3); padding: var(--space-2) 0; }
.sr-info__icon { width: 20px; height: 20px; color: var(--ink); }
.sr-info__text { min-width: 0; display: grid; gap: 2px; }
.sr-info__text :is(a, strong) { font: 600 15px/1.3 var(--font-sans); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.sr-info__text a::after { content: ""; position: absolute; inset: 0; } /* whole row clickable */
.sr-info__text > span { font: 400 13px/1.35 var(--font-sans); color: var(--ink-muted); overflow-wrap: anywhere; }
.sr-info__arrow { width: var(--icon-small); height: var(--icon-small); color: var(--ink-subtle); }
.sr-info__row:hover a, .sr-info__text a:focus-visible { color: var(--title-active); text-decoration: var(--title-decoration); text-underline-offset: var(--space-1); }
.sr-info__row:hover .sr-info__arrow { color: var(--accent); }
@container shell (min-width: 640px) {
  .sr-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── DayInfo (the day of the race) — Timeline and Flags ─────────────────── */
/* Blocks under their label, which a hairline follows to the block's edge; from 640 px, in two columns. */
.sr-dayinfo { display: grid; gap: var(--space-6) var(--space-12); }
.sr-dayinfo__block { display: grid; align-content: start; gap: var(--space-2); font: 400 15px/1.5 var(--font-sans); color: var(--ink); }
.sr-timeline__start { font-size: 15px; line-height: var(--row); }
.sr-dayinfo__block p { max-width: var(--measure); margin: 0; overflow-wrap: anywhere; }
.sr-dayinfo__strong { font-weight: 600; }
.sr-dayinfo__address .sr-textlink { white-space: nowrap; }
@container shell (min-width: 640px) {
  .sr-dayinfo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* The starts of the day, in order: the time in mono, a dot on the line that runs down the day, and the race. A start
   that still takes place has an orange dot; a past or cancelled one, a hollow one. */
.sr-timeline { --time: 3.25rem; --row: 1.5em; position: relative; display: grid; margin: 0; padding: 0; list-style: none; }
/* The line runs from the first dot to the last one's row, behind the dots. */
.sr-timeline::before { content: ""; position: absolute; top: calc(var(--space-1) + var(--row) / 2); bottom: calc(var(--space-1) + var(--row) / 2);
  left: calc(var(--time) + var(--space-3) + var(--status-dot) / 2); width: var(--border-width); translate: -50% 0; background: var(--line-strong); }
.sr-timeline__day { font: 500 12px/1.33 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.sr-timeline + .sr-timeline__day { margin-top: var(--space-3); }
.sr-timeline__start { position: relative; display: grid; grid-template-columns: var(--time) var(--status-dot) minmax(0, 1fr); align-items: start;
  gap: var(--space-3); padding: var(--space-1) 0; }
.sr-timeline__start time { font: 500 14px/var(--row) var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
/* Each dot sits on its row's first line, whatever lines its race takes. */
.sr-timeline__dot { position: relative; width: var(--status-dot); height: var(--status-dot); margin-top: calc((var(--row) - var(--status-dot)) / 2);
  border-radius: var(--radius-full); background: var(--accent); }
.sr-timeline__label { min-width: 0; }
.sr-timeline__label small { margin-left: var(--space-2); font: 600 11px/1 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-subtle); }
.sr-timeline__start:is(.is-past, .is-off) :is(time, .sr-timeline__label) { color: var(--ink-muted); }
.sr-timeline__start:is(.is-past, .is-off) .sr-timeline__dot { box-sizing: border-box; border: 1.5px solid var(--ink-subtle); background: var(--bg); }
.sr-timeline__start.is-off .sr-timeline__label { text-decoration: line-through; }
.sr-timeline__start.is-off .sr-timeline__label small { display: inline-block; text-decoration: none; }
/* What the event has or lacks, as the mark's dots: on (--accent) or off (a hollow ring, the text muted). */
.sr-flags { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin: 0; padding: 0; list-style: none; }
.sr-flag { display: inline-flex; align-items: center; gap: var(--space-2); }
.sr-flag::before { content: ""; flex: none; box-sizing: border-box; width: var(--status-dot); height: var(--status-dot); border-radius: var(--radius-full); background: var(--accent); }
.sr-flag--off { color: var(--ink-muted); }
.sr-flag--off::before { border: 1.5px solid var(--ink-subtle); background: transparent; }

/* ── Related (other events to go on to) ─────────────────────────────────── */
/* Each group under its heading, its events by day as in the calendar: a compact divider (the dot, the day's number in
   orange, its weekday and month, and a hairline; no count, as the list is cut), then each event with its municipality and
   distances in mono and a chevron at its right. */
.sr-related { display: grid; gap: var(--space-6) var(--space-12); }
/* Each group's heading: the label of the facts and blocks above it (a hairline after it), in orange. */
.sr-related h3 { color: var(--accent); }
.sr-related h3 a { color: inherit; text-decoration: none; }
.sr-related h3 a:hover { text-decoration: underline; text-underline-offset: var(--space-1); }
.sr-related__days { display: grid; gap: var(--space-4); margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.sr-related__day { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.sr-related__day::before { content: ""; flex: none; width: var(--status-dot); height: var(--status-dot); border-radius: var(--radius-full); background: var(--accent); }
.sr-related__day time { display: flex; align-items: baseline; gap: var(--space-2); font: 400 13px/1 var(--font-sans); color: var(--ink-muted); }
.sr-related__num { font: 500 18px/1 var(--font-mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--accent); }
.sr-related__day strong { font: 600 14px/1 var(--font-sans); color: var(--ink); }
.sr-related__rule { flex: 1; min-width: var(--space-4); height: var(--border-width); background: var(--line); }
.sr-related__list { display: grid; gap: var(--space-1); margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.sr-related__list li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name chevron" "meta chevron";
  column-gap: var(--space-3); padding: var(--space-2) 0; }
.sr-related__list a { grid-area: name; color: var(--ink); font: 700 16px/1.3 var(--font-sans); letter-spacing: -0.01em; text-decoration: none; text-wrap: balance; }
.sr-related__list a::after { content: ""; position: absolute; inset: 0; } /* whole row clickable */
.sr-related__list li:hover a, .sr-related__list a:focus-visible { color: var(--title-active); text-decoration: var(--title-decoration); text-underline-offset: var(--space-1); }
.sr-related__meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: var(--space-1) 0 0;
  font: 400 13px/1.4 var(--font-mono); color: var(--ink-muted); }
.sr-related__meta > span { display: inline-flex; align-items: center; gap: var(--space-1); }
.sr-related__meta .sr-icon { width: var(--icon-small); height: var(--icon-small); color: var(--ink-subtle); }
/* The last event of a group ends the group, without the padding under it. */
.sr-related__days > li:last-child .sr-related__list li:last-child { padding-bottom: 0; }
.sr-related__chevron { grid-area: chevron; align-self: center; color: var(--ink-subtle); }
.sr-related__list li:hover .sr-related__chevron { color: var(--accent); }
@container shell (min-width: 960px) {
  .sr-related { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── ActionBar (the registration at the foot of a narrow screen) ────────── */
/* Off the screen until the header's button has scrolled away (.is-shown, set by action-bar.js): what the registration
   says today and, at the right, the share button (round, as in the header) and the registration button, as tall as it,
   as low as they let it be. Above it the page fades into its background (::before, which lets clicks through) rather
   than being cut by a rule. It sits in the viewport, so it follows the screen, not the shell; its share menu opens
   upwards. */
.sr-actionbar { display: none; }
@media (max-width: 959px) {
  .sr-actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
    padding: var(--space-2) var(--space-4) calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
    background: var(--bg); transform: translateY(100%); visibility: hidden; }
  .sr-actionbar::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: var(--space-4);
    background: linear-gradient(to bottom, transparent, var(--bg)); pointer-events: none; }
  .sr-actionbar.is-shown { transform: none; visibility: visible; }
  .sr-actionbar__status { min-width: 0; display: grid; gap: 2px; margin: 0; font: 600 14px/1.3 var(--font-sans); color: var(--ink); }
  .sr-actionbar__price { font: 400 13px/1.3 var(--font-mono); color: var(--ink-muted); }
  .sr-actionbar__actions { flex: none; display: flex; align-items: center; gap: var(--space-2); }
  .sr-actionbar .sr-button:not(.sr-button--round) { flex: none; min-height: 48px; padding: 0 var(--space-5); font-size: 15px; }
  /* The page ends above the bar (48 px buttons and its padding), so the footer is never under it. */
  .sr-page:has(.sr-actionbar:not([hidden])) { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}
/* From 640 px the share menu hangs from its button; in the bar, above it. Narrower, it rises from the screen's foot. */
@media (min-width: 640px) and (max-width: 959px) {
  .sr-actionbar .sr-share__menu { top: auto; bottom: calc(100% + var(--space-2)); }
}
@media (max-width: 959px) and (prefers-reduced-motion: no-preference) {
  .sr-actionbar { transition: transform var(--duration-base) ease, visibility var(--duration-base); }
}

/* ── RaceEvents (the races of one edition, the page's race choice) ─────────── */
/* A radio group: each race is a row-wide radio ending in a dot, solid orange for the chosen race and a hollow ring
   otherwise; the other races' distance and title are muted. A row has the distance, the title and one mono line
   «07:30 · +3628 m · Relevos» (the view writes it, with the day only when the races fall on several), the same at
   every width. The distance column fits decimal distances such as «21,1km».
   While some main race takes place the secondary ones are folded under «Otras pruebas», a row of its own that opens
   them below it (open from the start when one of them is the chosen race). */
.sr-events__more > summary { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-4) 0;
  border-bottom: var(--border-width) solid var(--line); list-style: none; cursor: pointer;
  font: 600 14px/1.3 var(--font-sans); color: var(--ink-muted); }
.sr-events__more > summary::-webkit-details-marker { display: none; }
.sr-events__more > summary:hover { color: var(--ink); }
.sr-events__count { font: 400 13px/1.4 var(--font-mono); color: var(--ink-subtle); }
/* «Otras pruebas» and its count, then a hairline bridging them to the chevron, in place of a rule above the row. */
.sr-events__more > summary::after { content: ""; order: 1; flex: 1; height: var(--border-width); background: var(--line); }
.sr-events__more > summary .sr-icon { order: 2; transition: transform .15s; }
.sr-events__more[open] > summary .sr-icon { transform: rotate(180deg); }
/* The list ends at its last row without a rule: the next section brings its own. With no rule above it either, its
   first row starts right under the section's heading; the row before «Otras pruebas» has its hairline instead. */
.sr-events > .sr-event:last-child, .sr-events__more:not([open]) > summary, .sr-events__more > .sr-event:last-child,
  .sr-events > .sr-event:has(+ .sr-events__more) { border-bottom: 0; }
.sr-events > .sr-event:first-child { padding-top: 0; }
.sr-event { box-sizing: border-box; display: grid; width: 100%; grid-template-columns: 5.5rem minmax(0, 1fr) auto auto;
  grid-template-areas: "km name state pick" "km line state pick"; align-items: center; gap: 2px var(--space-4);
  padding: var(--space-4) 0; border: 0; border-bottom: var(--border-width) solid var(--line); background: none;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.sr-event:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
.sr-event__km { grid-area: km; font: 800 28px/1 var(--font-sans); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.sr-event__km small { margin-left: 2px; font-size: 14px; font-weight: 700; color: var(--ink-muted); letter-spacing: 0; }
.sr-event__name { grid-area: name; min-width: 0; }
.sr-event__name strong { font: 600 15px/1.3 var(--font-sans); color: var(--ink); }
.sr-event__line { grid-area: line; font: 400 13px/1.4 var(--font-mono); color: var(--ink-muted); }
.sr-event__state { grid-area: state; justify-self: end; font: 600 12px/1.33 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-subtle); }
.sr-event__pick { grid-area: pick; display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); }
.sr-event__dot { width: var(--status-dot); height: var(--status-dot); border: 1.5px solid var(--ink-subtle); border-radius: var(--radius-full); }
.sr-event[aria-checked="true"] .sr-event__dot { border-color: var(--accent); background: var(--accent); }
.sr-event[aria-checked="false"] :is(.sr-event__km, .sr-event__km small, .sr-event__name strong) { color: var(--ink-muted); }
.sr-event[aria-checked="false"]:hover :is(.sr-event__km, .sr-event__name strong) { color: var(--ink); }
.sr-event--off .sr-event__km, .sr-event--off .sr-event__km small { color: var(--ink-subtle); }
.sr-event--off .sr-event__name strong { color: var(--ink-muted); text-decoration: line-through; }
.sr-tag { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border: var(--border-width) solid var(--line-strong);
  border-radius: var(--radius-full); font: 700 10px/1 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); vertical-align: 2px; margin-left: 6px; }
.sr-tag--accent { border-color: var(--accent); }

/* ── PriceLine (the price tiers of the chosen race) — not yet in the design system ── */
/* One segment per tier, of equal width: its price above (past ones in --ink-subtle, the current one large, the coming
   ones --ink-muted), its bar (past --dot-off; current --accent up to today's mark, in --ink, and --dot-off after it;
   coming dashed --line-strong) and its start date below, after a hairline. The last tier's end sits a line lower, at its right, before a hairline,
   so that it never meets its start, however narrow. The line is inset a little from the section's edges. Once closed,
   every bar is off. The message is --title-active: orange on dark, --ink on light, where orange text would not reach the
   contrast. */
.sr-prices__summary { display: grid; gap: var(--space-1); margin-bottom: var(--space-8); }
.sr-prices__message { margin: 0; font: 600 15px/1.4 var(--font-mono); color: var(--title-active); }
.sr-prices--not-yet-open .sr-prices__message, .sr-prices--closed .sr-prices__message { color: var(--ink-muted); }
.sr-prices__detail { margin: 0; font: 400 13px/1.4 var(--font-mono); color: var(--ink-muted); }
.sr-prices__tiers { display: grid; grid-template-columns: repeat(var(--tiers), minmax(0, 1fr)); gap: 4px; align-items: end;
  margin: 0 var(--space-4); padding: 0; list-style: none; }
.sr-prices__tier { display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; row-gap: var(--space-2); }
.sr-prices__price { font: 600 13px/1.2 var(--font-mono); color: var(--ink-muted); white-space: nowrap; }
.sr-prices__tier--past .sr-prices__price { color: var(--ink-subtle); }
.sr-prices__tier--current .sr-prices__price { font: 800 30px/1 var(--font-sans); letter-spacing: -0.02em; color: var(--ink); }
.sr-prices__bar { position: relative; box-sizing: border-box; height: 8px; border: 1px dashed var(--line-strong); }
.sr-prices__tier--past .sr-prices__bar, .sr-prices__tier--closed .sr-prices__bar { border: 0; background: var(--dot-off); }
/* Up to today's mark (--at, from the page; the whole bar without it) in the accent, and what is left of the tier in the
   past tiers' grey. */
.sr-prices__tier--current .sr-prices__bar { border: 0;
  background: linear-gradient(to right, var(--accent) var(--at, 100%), var(--dot-off) var(--at, 100%)); }
.sr-prices__today { position: absolute; top: -5px; bottom: -5px; left: var(--at); width: 2px; margin-left: -1px; background: var(--ink); }
.sr-prices__from, .sr-prices__end { grid-row: 3; grid-column: 1; font: 400 12px/1.3 var(--font-mono); color: var(--ink-subtle); }
.sr-prices__from { min-height: 3.1em; padding: var(--space-1) 0 0 var(--space-2); border-left: var(--border-width) solid var(--line-strong); }
.sr-prices__tier--current .sr-prices__from { color: var(--ink); }
.sr-prices__end { align-self: stretch; display: flex; align-items: flex-end; justify-content: flex-end; padding: 0 var(--space-2);
  border-right: var(--border-width) solid var(--line-strong); white-space: nowrap; }
@container shell (min-width: 960px) {
  .sr-prices__tier--current .sr-prices__price { font-size: 44px; }
}

/* ── PosterViewer — not yet in the design system ───────────────────────── */
/* A modal dialog: on wide screens over the page, on --bg at 94 %, with the poster at the height left by its bar; on
   narrow ones full screen, closing at the top left and «Descargar cartel» at the bottom, full width. */
.sr-viewer { box-sizing: border-box; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--bg); color: var(--ink); }
.sr-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.sr-viewer::backdrop { background: color-mix(in srgb, var(--bg) 94%, transparent); }
.sr-viewer__bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-bottom: var(--border-width) solid var(--line); }
.sr-viewer__title { text-align: center; }
.sr-viewer__title p { margin: 0; }
.sr-viewer__title p:first-child { font: 700 17px/1.3 var(--font-sans); }
.sr-viewer__sub { font: 400 12px/1.4 var(--font-mono); color: var(--ink-muted); }
.sr-viewer__download { display: none; }
.sr-viewer__image { display: grid; place-items: center; min-height: 0; padding: var(--space-6) var(--space-4); }
/* Its height is what the bar and the foot (on narrow screens) leave of the viewport. */
.sr-viewer__image img { max-width: 100%; max-height: calc(100dvh - 220px); width: auto; height: auto; object-fit: contain; }
.sr-viewer__foot { padding: var(--space-4); border-top: var(--border-width) solid var(--line); }
/* The dialog sits in the top layer, so it follows the viewport rather than the shell. */
@media (min-width: 960px) {
  .sr-viewer { background: transparent; }
  .sr-viewer__bar { grid-template-columns: minmax(0, 1fr) auto auto auto; padding: var(--space-4) var(--space-8); background: var(--bg); }
  .sr-viewer__title { order: -1; text-align: left; }
  .sr-viewer__close { order: 1; }
  .sr-viewer__download { display: inline-flex; }
  .sr-viewer__foot { display: none; }
  .sr-viewer__image img { max-height: calc(100dvh - 140px); }
}

/* ── Message (loading, empty, error, no-JS) — not yet in the design system ── */
.sr-message { padding: var(--space-8) 0; border-top: var(--border-width) solid var(--line); font: 400 14px/1.5 var(--font-sans); color: var(--ink-muted); }

/* ── ShareButton ────────────────────────────────────────────────────────── */
/* A secondary action: --line-strong border, never the accent. The fallback menu floats under the button, aligned
   right; on narrow screens it is anchored to the bottom, full width, with 48 px rows within reach of the thumb. */
.sr-share { position: relative; flex: none; align-self: center; }
.sr-share__menu { position: absolute; top: calc(100% + var(--space-2)); right: 0; z-index: 3; width: var(--share-menu-w);
  padding: var(--space-2) 0; border: var(--border-width) solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); box-shadow: 0 12px 32px rgb(0 0 0 / .24); }
.sr-share__title { padding: var(--space-2) var(--space-4); font: 600 11px/1.33 var(--font-sans); letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-subtle); }
.sr-share__option, .sr-share__option > span { display: flex; align-items: center; gap: var(--space-3); }
.sr-share__option { box-sizing: border-box; width: 100%; min-height: var(--control-height); padding: 0 var(--space-4);
  border: 0; background: transparent; color: var(--ink); font: 400 14px/1.25 var(--font-sans); text-align: left;
  text-decoration: none; cursor: pointer; }
.sr-share__option:hover, .sr-share__option:focus-visible { background: var(--surface-2); }
.sr-share__option:focus-visible { outline-offset: calc(-1 * var(--focus-width)); }
.sr-share__option .sr-symbol { flex: none; width: var(--icon-small); height: var(--icon-small); color: var(--ink-muted); }
.sr-share__copy { margin-top: var(--space-2); border-top: var(--border-width) solid var(--line); min-height: calc(var(--control-height) + var(--space-2)); }
@media (max-width: 639px) {
  .sr-share__menu { position: fixed; top: auto; left: var(--space-4); right: var(--space-4);
    bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px)); width: auto; max-height: calc(100dvh - 2 * var(--space-4)); overflow-y: auto; }
  .sr-share__option { min-height: 48px; }
}
