/*
 * Motion Events — shared foundation stylesheet, loaded by every boundary (Site, Checkout, Admin, generic errors).
 * Vanilla CSS served as written: no build step, no @import, no inline styles anywhere (CSP).
 *
 * M14-A Design System (T1 «LÍNEA DE SALIDA»: docs/m14/CREATIVE-DIRECTION.md; contract: docs/09 ADR-005 amendment).
 *  - One cascade-layer order for every bundle: reset → tokens → base → layout → components → patterns → pages →
 *    utilities. Boundary bundles (site.css, and later checkout.css/admin.css) add rules to the same layers; page art
 *    direction lives in `pages` and consumes tokens only.
 *  - The design system applies to surfaces that opt in with `class="ds"` on <body>: the public Site since M14-A,
 *    Checkout in M14-E, Admin in M14-H. Surfaces that have not opted in keep the pre-M14 functional palette of :root
 *    and the system font, exactly as before.
 *  - Naming: `l-` layout, `c-` components, `t-` type roles, `u-` utilities, `is-` states, `p-` page scopes; scripts
 *    hook onto `data-*` attributes only and never write styles, only classes (and custom properties for motion state).
 */
@layer reset, tokens, base, layout, components, patterns, pages, utilities;

/*
 * M14-D (OD-33, corporate identity manual 2026): two families, both SIL Open Font License 1.1 (licences beside the
 * files), self-hosted — nothing is requested from Google Fonts at run time.
 *  - Oxanium, the PRINCIPAL typeface (titles, headings, race data, times): an owner-approved substitute of Clonoid, the
 *    family printed in the manual — NOT the manual's own typeface. © 2019 The Oxanium Project Authors
 *    (/assets/fonts/oxanium/OFL.txt). Official upstream release 2.000 (github.com/sevmeyer/oxanium), its own
 *    `webfonts/variable/Oxanium[wght].woff2`, unmodified (weight 200–800, full Latin + Spanish, 17 820 B). Its figures
 *    are tabular by default.
 *  - Montserrat, the SECONDARY typeface (text, event information, labels): © The Montserrat Project Authors
 *    (/assets/fonts/montserrat/OFL.txt). Google Fonts release (css2 v31, google/fonts Montserrat[wght].ttf 9.000,
 *    upstream JulietaUla/Montserrat cc8daf2e), latin subset, weight 100–900 (37 956 B).
 * The URLs carry each file's content hash (the immutable asset contract, see Assets::url()); a test recomputes them.
 */
@font-face {
    font-family: "Oxanium";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("/assets/fonts/oxanium/oxanium-variable.3301a72ebc.woff2") format("woff2");
}

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/assets/fonts/montserrat/montserrat-latin-variable.06b16db7a9.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/*
 * Metric-compatible fallbacks (CLS protection while the web fonts load): a local Arial (Windows, macOS, iOS) or Roboto
 * (Android) scaled to each family's average advance on Spanish text, measured in Chrome with the shipped files (M14-D):
 * Oxanium 700 0.4707 em vs Arial 700 0.4770 em; Montserrat 500 0.5027 em vs Arial 400 0.4434 em; and given the family's
 * vertical metrics (hhea; Oxanium ascent 0.790 / descent 0.210 / gap 0.250, Montserrat 0.968 / 0.251 / 0) divided by
 * that scale. Browsers without the override descriptors simply use the local font as it is.
 */
@font-face {
    font-family: "Oxanium Fallback";
    src: local("Arial"), local("ArialMT"), local("Roboto"), local("Helvetica Neue"), local("Helvetica");
    size-adjust: 98.7%;
    ascent-override: 80.04%;
    descent-override: 21.28%;
    line-gap-override: 25.33%;
}

@font-face {
    font-family: "Montserrat Fallback";
    src: local("Arial"), local("ArialMT"), local("Roboto"), local("Helvetica Neue"), local("Helvetica");
    size-adjust: 113.4%;
    ascent-override: 85.36%;
    descent-override: 22.13%;
    line-gap-override: 0%;
}

/* ==== reset ======================================================================================================= */
@layer reset {
    /* Conservative normalisation, only for design-system surfaces (pre-M14 surfaces keep their own rules). No margin
       reset: documents keep their natural rhythm; layout primitives own spacing between their children. */
    :where(.ds),
    :where(.ds) *,
    :where(.ds) *::before,
    :where(.ds) *::after {
        box-sizing: border-box;
    }

    :where(.ds) :where(img, video) {
        max-width: 100%;
        height: auto;
    }

    :where(.ds) :where(input, button, textarea, select) {
        font: inherit;
        letter-spacing: inherit;
        color: inherit;
    }

    :where(.ds) :where(p, li, dd, dt, figcaption, blockquote, h1, h2, h3, h4) {
        overflow-wrap: break-word;
    }

    /* Reduced motion, safety net: whatever a component declares, nothing moves or loops. The motion tokens already
       collapse to zero (see `tokens`); this also covers anything that forgot to use them. */
    @media (prefers-reduced-motion: reduce) {
        :where(.ds) *,
        :where(.ds) *::before,
        :where(.ds) *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
            scroll-behavior: auto !important;
        }
    }
}

/* ==== tokens ====================================================================================================== */
@layer tokens {
    :root {
        /* ---- Pre-M14 functional palette: surfaces that have not opted into the design system (Checkout until M14-E,
           Admin until M14-H, the generic error page). Values unchanged; contrast pinned by PublicStylesTest. */
        --color-bg: #ffffff;
        --color-text: #111111;
        --color-muted: #555555;
        --color-link: #0b57d0;
        --color-focus: #0b57d0;
        font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

        /* ---- Brand references (M14-D): the corporate identity manual 2026 (OD-33), p. 14 — purple #2D1D47 (C94 M100
           Y36 K41, PANTONE 2695 C) and turquoise #0091B3 (C89 M18 Y23 K2, PANTONE 632 C) — and its complementary scales
           (p. 15, subordinate to the two primaries, light → dark). Components never use these directly; they feed the
           semantic tokens of `.ds`. (The manual's own logo artwork renders its purple ≈ #27224F; the declared value is
           used here — owner question MQ-1, docs/m14/M14-D-IMPLEMENTATION.md §3.) */
        --brand-purple: #2d1d47;
        --brand-turquoise: #0091b3;
        --brand-night: #0c0712; /* the darkest step of the purple scale: night surfaces */
        --purple-50: #f1edf8;
        --purple-100: #d8ccea;
        --purple-200: #bfacdd;
        --purple-300: #a58bd0;
        --purple-400: #8c6bc2;
        --purple-500: #734ab5;
        --purple-600: #5e3d94;
        --purple-700: #4a2f74;
        --purple-800: #2d1d47;
        --purple-900: #201533;
        --purple-950: #0c0712;
        --turquoise-50: #e6faff;
        --turquoise-100: #b8f2ff;
        --turquoise-200: #8ae9ff;
        --turquoise-300: #5ce1ff;
        --turquoise-400: #2ed9ff;
        --turquoise-500: #00d0ff;
        --turquoise-600: #00abd1;
        --turquoise-700: #0091b3;
        --turquoise-800: #006075;
        --turquoise-900: #003a47;
        --turquoise-950: #00151a;

        /* ---- Typography (M14-D, OD-33): Oxanium — the manual's principal role (Bold 700 / Regular 400) — for titles,
           headings, race data and times; Montserrat — the secondary family — for text, labels and forms. */
        --font-display: "Oxanium", "Oxanium Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
        --font-sans: "Montserrat", "Montserrat Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
        --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
        /* Fluid scale between a 375 px and a 1440 px viewport (rem-based, so zoom and text resizing still work). */
        --text-xs: 0.75rem; /* 12 px: micro-labels and credits, never smaller */
        --text-s: clamp(0.875rem, 0.853rem + 0.0939vw, 0.9375rem); /* 14 → 15 */
        --text-m: clamp(1rem, 0.956rem + 0.1878vw, 1.125rem); /* 16 → 18: body */
        --text-l: clamp(1.125rem, 1.037rem + 0.3756vw, 1.375rem); /* 18 → 22: lead, h4 */
        --text-xl: clamp(1.25rem, 1.162rem + 0.3756vw, 1.5rem); /* 20 → 24: h3 */
        --text-2xl: clamp(1.5rem, 1.2799rem + 0.939vw, 2.125rem); /* 24 → 34: h2 */
        --text-3xl: clamp(2rem, 1.6479rem + 1.5023vw, 3rem); /* 32 → 48: h1 */
        --text-4xl: clamp(2.5rem, 1.6197rem + 3.7559vw, 5rem); /* 40 → 80: display, data as typography */
        --text-5xl: clamp(3rem, 1.5915rem + 6.0094vw, 7rem); /* 48 → 112: one cinematic headline per page at most */
        --leading-display: 1.02;
        --leading-heading: 1.15;
        --leading-tight: 1.3;
        --leading-body: 1.55;
        --tracking-display: -0.015em;
        --tracking-heading: -0.01em;
        --tracking-label: 0.1em;
        --weight-regular: 400;
        --weight-medium: 500;
        --weight-semibold: 600;
        --weight-bold: 700;
        --weight-heavy: 800;
        --weight-text: 500; /* Montserrat body text: between Regular and the manual's Semibold */
        --tracking-caps: 0.04em; /* upper-case Oxanium headings (the manual's heading style) */
        --measure: 66ch;
        --measure-narrow: 48ch;

        /* ---- Spacing: a 4 px based scale for components, fluid rhythm for sections. */
        --space-3xs: 0.25rem;
        --space-2xs: 0.5rem;
        --space-xs: 0.75rem;
        --space-s: 1rem;
        --space-m: 1.5rem;
        --space-l: 2rem;
        --space-xl: 3rem;
        --space-2xl: 4rem;
        --space-3xl: 6rem;
        --rhythm-s: clamp(2rem, 1.6479rem + 1.5023vw, 3rem); /* 32 → 48 */
        --rhythm-m: clamp(3rem, 2.1197rem + 3.7559vw, 5.5rem); /* 48 → 88 */
        --rhythm-l: clamp(4rem, 2.4155rem + 6.7606vw, 8.5rem); /* 64 → 136 */

        /* ---- Grid and containers: 4 columns (mobile), 8 (≥ 48rem), 12 (≥ 64rem). Breakpoints (media queries cannot
           read custom properties): 30rem · 48rem · 64rem · 90rem. */
        --container: 80rem;
        --container-wide: 96rem;
        --gutter: clamp(1rem, 0.4718rem + 2.2535vw, 2.5rem); /* 16 → 40 */
        --grid-gap: clamp(1rem, 0.6479rem + 1.5023vw, 2rem); /* 16 → 32 */

        /* ---- Surfaces: minimal radii, hairlines, shadows only for real layering (menus, dialogs). */
        --radius-s: 2px;
        --radius-m: 4px;
        --border-hairline: 1px;
        --border-strong: 2px;
        --shadow-overlay: 0 1px 2px rgb(12 7 18 / 0.12), 0 12px 32px -8px rgb(12 7 18 / 0.28);
        --z-raised: 1;
        --z-sticky: 100;
        --z-header: 200;
        --z-overlay: 300;
        --z-dialog: 400;
        --z-skip: 1000;

        /* ---- Interaction. */
        --focus-width: 3px;
        --focus-offset: 2px;
        --control-height: 2.75rem; /* 44 px touch target */
        --icon-size: 1.25em;

        /* ---- Motion (docs/m14/MOTION-SYSTEM-PROPOSAL.md): every duration and travel is multiplied by
           --motion-scale, which reduced motion sets to 0. Intensities: STATIC (none) · SUBTLE (≤ --dur-base, ≤ 8 px)
           · INTERACTIVE (input only) · CINEMATIC (≤ 2 per page, none in Checkout/Admin). Only transform and opacity
           move; colours may cross-fade; layout properties never animate. */
        --motion-scale: 1;
        --dur-instant: 0ms;
        --dur-fast: calc(120ms * var(--motion-scale));
        --dur-base: calc(200ms * var(--motion-scale));
        --dur-moderate: calc(320ms * var(--motion-scale));
        --dur-slow: calc(480ms * var(--motion-scale));
        --dur-cinematic: calc(900ms * var(--motion-scale));
        --ease-standard: cubic-bezier(0.2, 0, 0, 1);
        --ease-enter: cubic-bezier(0.05, 0.7, 0.1, 1);
        --ease-exit: cubic-bezier(0.3, 0, 0.8, 0.15);
        --ease-linear: linear;
        --travel-xs: calc(4px * var(--motion-scale));
        --travel-s: calc(8px * var(--motion-scale));
        --travel-m: calc(16px * var(--motion-scale));
        --travel-l: calc(32px * var(--motion-scale));
        --stagger: calc(50ms * var(--motion-scale)); /* at most 6 steps */
    }

    /* Reduced motion removes all non-essential movement: durations and travels collapse to zero. The same state can
       be forced with `is-motion-reduced` on <html> (used by the local specimen to show it; the class must sit on the
       root element because the tokens are computed there). */
    @media (prefers-reduced-motion: reduce) {
        :root {
            --motion-scale: 0;
        }
    }

    :root.is-motion-reduced {
        --motion-scale: 0;
    }

    /* M14-J2 review round 4: the visitor's explicit theme (<html data-theme>, theme.js) wins over the system's. */
    @media (prefers-color-scheme: dark) {
        :root:not([data-theme="light"]) {
            --color-bg: #111111;
            --color-text: #f2f2f2;
            --color-muted: #b5b5b5;
            --color-link: #8ab4f8;
            --color-focus: #ffdd57;
        }
    }

    :root[data-theme="dark"] {
        --color-bg: #111111;
        --color-text: #f2f2f2;
        --color-muted: #b5b5b5;
        --color-link: #8ab4f8;
        --color-focus: #ffdd57;
    }

    :root[data-theme="light"] {
        color-scheme: light;
    }

    :root[data-theme="dark"] {
        color-scheme: dark;
    }

    /* ---- Design-system semantic colours. Each value is a light-dark() pair resolved by the element's color-scheme:
       `.ds` follows the visitor's preference; the tone classes (l-band--paper / --night / --ink) fix it for
       art-directed sections, so photography and brand compositions are never inverted by dark mode. Text pairs are
       ≥ 4.5:1 and focus/boundaries ≥ 3:1 on every surface and tone (PublicStylesTest computes each pair). M14-D: every
       value is one of the manual's two primaries or a step of its complementary scales (no invented hue); the brand
       turquoise #0091b3 is a signal colour (3.7:1 on white): large accents, icons, rules — never small text; links and
       actions use turquoise 800 #006075 (7.2:1). The semantic state colours (success/warning/error) are not brand
       colours and keep their M14-A values. */
    .ds {
        color-scheme: light dark;
        --color-bg: light-dark(#ffffff, #0c0712);
        --color-surface-alt: light-dark(#f1edf8, #201533);
        --color-text: light-dark(#2d1d47, #f1edf8);
        --color-muted: light-dark(#5e3d94, #bfacdd);
        --color-border: light-dark(#d8ccea, #4a2f74);
        --color-border-strong: light-dark(#8c6bc2, #8c6bc2);
        --color-link: light-dark(#006075, #5ce1ff);
        --color-link-hover: light-dark(#003a47, #b8f2ff);
        --color-focus: light-dark(#006075, #5ce1ff);
        --color-focus-gap: light-dark(#ffffff, #0c0712);
        --color-signal: light-dark(#0091b3, #00abd1);
        --color-primary: light-dark(#006075, #5ce1ff);
        --color-primary-hover: light-dark(#003a47, #8ae9ff);
        --color-on-primary: light-dark(#ffffff, #0c0712);
        --color-success: light-dark(#1b6b3a, #86dba0);
        --color-success-bg: light-dark(#e6f3ea, #12301f);
        --color-warning: light-dark(#8a5000, #f2c66b);
        --color-warning-bg: light-dark(#fdf0d5, #372a09);
        --color-error: light-dark(#b3261e, #ffb4ab);
        --color-error-bg: light-dark(#fbe9e7, #3d1714);
        --color-error-hover: light-dark(#8f1d17, #ffcdc6);
        --color-on-error: light-dark(#ffffff, #0c0712);
        --color-info: light-dark(#006075, #5ce1ff);
        --color-info-bg: light-dark(#e6faff, #003a47);
        --color-selection: light-dark(#b8f2ff, #006075);
        /* Text over photography only on designed zones, over this scrim (≥ 4.5:1 for white text). */
        --color-scrim: rgb(12 7 18 / 0.62);
    }

    /* M14-J2 review round 4: an explicit theme fixes the scheme the light-dark() pairs resolve with (native controls and
       scrollbars follow it too); the art-directed tones (l-band--paper / --night / --ink) keep fixing their own. */
    :root[data-theme="light"] .ds {
        color-scheme: light;
    }

    :root[data-theme="dark"] .ds {
        color-scheme: dark;
    }

    /* Browsers without light-dark() (before Chrome 123, Firefox 120, Safari 17.5) would drop every colour above and,
       with them, the focus ring. They get the same values as plain hex (BROWSER-COMPATIBILITY: hex fallbacks first):
       the light palette — no automatic dark mode there — and the dark values on the night and ink tones.
       DesignSystemTest keeps these lists equal to the pairs above. */
    @supports not (color: light-dark(#000, #fff)) {
        .ds,
        .ds .l-band--paper {
            color-scheme: light;
            --color-bg: #ffffff;
            --color-surface-alt: #f1edf8;
            --color-text: #2d1d47;
            --color-muted: #5e3d94;
            --color-border: #d8ccea;
            --color-border-strong: #8c6bc2;
            --color-link: #006075;
            --color-link-hover: #003a47;
            --color-focus: #006075;
            --color-focus-gap: #ffffff;
            --color-signal: #0091b3;
            --color-primary: #006075;
            --color-primary-hover: #003a47;
            --color-on-primary: #ffffff;
            --color-success: #1b6b3a;
            --color-success-bg: #e6f3ea;
            --color-warning: #8a5000;
            --color-warning-bg: #fdf0d5;
            --color-error: #b3261e;
            --color-error-bg: #fbe9e7;
            --color-error-hover: #8f1d17;
            --color-on-error: #ffffff;
            --color-info: #006075;
            --color-info-bg: #e6faff;
            --color-selection: #b8f2ff;
        }

        .ds .l-band--night,
        .ds .l-band--ink {
            --color-bg: #0c0712;
            --color-surface-alt: #201533;
            --color-text: #f1edf8;
            --color-muted: #bfacdd;
            --color-border: #4a2f74;
            --color-border-strong: #8c6bc2;
            --color-link: #5ce1ff;
            --color-link-hover: #b8f2ff;
            --color-focus: #5ce1ff;
            --color-focus-gap: #0c0712;
            --color-signal: #00abd1;
            --color-primary: #5ce1ff;
            --color-primary-hover: #8ae9ff;
            --color-on-primary: #0c0712;
            --color-success: #86dba0;
            --color-success-bg: #12301f;
            --color-warning: #f2c66b;
            --color-warning-bg: #372a09;
            --color-error: #ffb4ab;
            --color-error-bg: #3d1714;
            --color-error-hover: #ffcdc6;
            --color-on-error: #0c0712;
            --color-info: #5ce1ff;
            --color-info-bg: #003a47;
            --color-selection: #006075;
        }
    }
}

/* ==== base ======================================================================================================== */
@layer base {
    /* ---- Pre-M14 functional base, shared by every surface (unchanged). */
    body {
        margin: 0;
        background: var(--color-bg);
        color: var(--color-text);
        line-height: 1.5;
    }

    a {
        color: var(--color-link);
    }

    a:focus-visible,
    summary:focus-visible {
        outline: 3px solid var(--color-focus);
        outline-offset: 2px;
    }

    main {
        max-width: 40rem;
        margin: 0 auto;
        padding: 4rem 1rem;
    }

    .error-page__status {
        margin: 0;
        color: var(--color-muted);
        font-size: 1rem;
        letter-spacing: 0.08em;
    }

    .error-page__id {
        color: var(--color-muted);
        font-size: 0.875rem;
    }

    /* ---- Design-system element defaults (opt-in surfaces). Headings are document-level sizes; display sizes are
       explicit type roles (t-display…) chosen by page art direction. `.ds` (not `:where`) so it outranks the
       pre-M14 `body` rule above. */
    .ds {
        font-family: var(--font-sans);
        font-size: var(--text-m);
        font-weight: var(--weight-text);
        line-height: var(--leading-body);
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    /* Headings: the manual's principal role — Oxanium Bold (M14-D). Upper case and tracking are page art direction
       (`.t-display`, section headers), never forced on every heading: long race names and modules stay readable. */
    :where(.ds) :where(h1, h2, h3, h4) {
        font-family: var(--font-display);
        font-weight: var(--weight-bold);
        line-height: var(--leading-heading);
        letter-spacing: var(--tracking-heading);
        text-wrap: balance;
    }

    :where(.ds) h1 {
        font-size: var(--text-3xl);
    }

    :where(.ds) h2 {
        font-size: var(--text-2xl);
    }

    :where(.ds) h3 {
        font-size: var(--text-xl);
    }

    :where(.ds) h4 {
        font-size: var(--text-l);
        letter-spacing: 0;
    }

    :where(.ds) :where(p, li, dd, figcaption) {
        text-wrap: pretty;
    }

    :where(.ds) small {
        font-size: var(--text-s);
    }

    :where(.ds) :where(strong, b) {
        font-weight: var(--weight-bold);
    }

    /* Dates, times and tables are data: tabular lining figures keep columns and countdowns aligned. */
    :where(.ds) :where(time, table) {
        font-variant-numeric: tabular-nums lining-nums;
    }

    :where(.ds) :where(code, kbd, samp) {
        font-family: var(--font-mono);
        font-size: 0.9em;
    }

    :where(.ds) abbr[title] {
        text-decoration: underline dotted;
        cursor: help;
    }

    :where(.ds) hr {
        margin-block: var(--space-l);
        border: 0;
        border-block-start: var(--border-hairline) solid var(--color-border);
    }

    :where(.ds) ::selection {
        background: var(--color-selection);
    }

    /* Links are underlined (never identified by colour alone); the underline thickens on hover. */
    :where(.ds) a {
        color: var(--color-link);
        text-decoration-thickness: max(1px, 0.0625em);
        text-underline-offset: 0.18em;
    }

    :where(.ds) a:hover {
        color: var(--color-link-hover);
        text-decoration-thickness: max(2px, 0.125em);
    }

    :where(.ds) a[aria-current="page"] {
        font-weight: var(--weight-semibold);
        text-decoration-thickness: max(2px, 0.125em);
    }

    /* ONE focus system: a 3 px ring in the focus colour, separated from the element by a 2 px gap in the surface
       colour, so it reads on light, dark and photographic backgrounds alike. Never removed without this replacement. */
    :where(.ds) :focus-visible {
        outline: var(--focus-width) solid var(--color-focus);
        outline-offset: var(--focus-offset);
        box-shadow: 0 0 0 var(--focus-offset) var(--color-focus-gap);
    }

    /* A skip-link target is not a control: it takes focus only to move the reading position. */
    :where(.ds) main:focus {
        outline: none;
        box-shadow: none;
    }

    /* ---- Type roles: page art direction picks them. Display roles are the manual's heading style: Oxanium Bold, upper
       case (the wordmark's own voice is never re-set: the logo is an image). */
    .t-display,
    .t-display-xl {
        font-family: var(--font-display);
        font-size: var(--text-4xl);
        font-weight: var(--weight-bold);
        line-height: var(--leading-display);
        letter-spacing: var(--tracking-caps);
        text-transform: uppercase;
        text-wrap: balance;
    }

    .t-display-xl {
        font-size: var(--text-5xl);
    }

    .t-lead {
        font-size: var(--text-l);
        line-height: 1.45;
        max-inline-size: var(--measure);
    }

    .t-label {
        font-size: var(--text-xs);
        font-weight: var(--weight-semibold);
        line-height: var(--leading-tight);
        letter-spacing: var(--tracking-label);
        text-transform: uppercase;
    }

    .t-caption {
        font-size: var(--text-s);
        line-height: 1.45;
        color: var(--color-muted);
    }

    .t-data {
        font-variant-numeric: tabular-nums lining-nums;
    }

    /* Data as typography: distances, dates, times and prices set large in Oxanium, tabular (T1 «race data as typography»). */
    .t-data-xl {
        font-family: var(--font-display);
        font-size: var(--text-4xl);
        font-weight: var(--weight-bold);
        line-height: 1;
        letter-spacing: var(--tracking-display);
        font-variant-numeric: tabular-nums lining-nums;
    }
}

/* ==== layout ====================================================================================================== */
@layer layout {
    /* Centred content column with fluid side gutters; `--wide` for media-led sections, `--text` for reading. */
    .l-container {
        width: min(100% - 2 * var(--gutter), var(--container));
        margin-inline: auto;
    }

    .l-container--wide {
        width: min(100% - 2 * var(--gutter), var(--container-wide));
    }

    .l-container--text {
        width: min(100% - 2 * var(--gutter), var(--measure));
    }

    /* Vertical rhythm between siblings (the owl): the stack owns the spacing, its children keep none of their own. */
    .l-stack > * {
        margin-block: 0;
    }

    .l-stack > * + * {
        margin-block-start: var(--stack-space, var(--space-m));
    }

    .l-stack--s {
        --stack-space: var(--space-s);
    }

    .l-stack--l {
        --stack-space: var(--space-l);
    }

    .l-stack--xl {
        --stack-space: var(--space-xl);
    }

    /* Inline groups (actions, labels) that wrap on small screens. */
    .l-cluster {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--cluster-space, var(--space-s));
    }

    /* The editorial grid: 4 → 8 → 12 columns. Children span the full width unless page art direction places them
       (`grid-column` in the `pages` layer); the approved splits below cover the recurring compositions. */
    .l-grid,
    .l-split {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: var(--space-l) var(--grid-gap);
    }

    .l-grid > *,
    .l-split > * {
        grid-column: 1 / -1;
        min-inline-size: 0;
    }

    .l-split {
        align-items: start;
    }

    .l-split--center {
        align-items: center;
    }

    /* Repeated independent units (race cards, albums): as many columns as fit, never narrower than --tile-min. */
    .l-tiles {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--tile-min, 16rem)), 1fr));
        gap: var(--grid-gap);
    }

    @media (min-width: 48rem) {
        .l-grid,
        .l-split {
            grid-template-columns: repeat(8, minmax(0, 1fr));
        }

        .l-split--7-5 > :first-child,
        .l-split--8-4 > :first-child,
        .l-split--5-7 > :last-child,
        .l-split--4-8 > :last-child {
            grid-column: span 5;
        }

        .l-split--7-5 > :last-child,
        .l-split--8-4 > :last-child,
        .l-split--5-7 > :first-child,
        .l-split--4-8 > :first-child {
            grid-column: span 3;
        }

        .l-split--6-6 > * {
            grid-column: span 4;
        }
    }

    @media (min-width: 64rem) {
        .l-grid,
        .l-split {
            grid-template-columns: repeat(12, minmax(0, 1fr));
        }

        .l-split--7-5 > :first-child,
        .l-split--5-7 > :last-child {
            grid-column: span 7;
        }

        .l-split--7-5 > :last-child,
        .l-split--5-7 > :first-child {
            grid-column: span 5;
        }

        .l-split--8-4 > :first-child,
        .l-split--4-8 > :last-child {
            grid-column: span 8;
        }

        .l-split--8-4 > :last-child,
        .l-split--4-8 > :first-child {
            grid-column: span 4;
        }

        .l-split--6-6 > * {
            grid-column: span 6;
        }

        /* Offset content: starts one grid column in (12-column math, gaps included). */
        .l-offset {
            padding-inline-start: calc((100% - 11 * var(--grid-gap)) / 12 + var(--grid-gap));
        }
    }

    /* Full-width section with fluid vertical rhythm. Media placed in a band without a container is full-bleed. The
       tone modifiers set a colour scheme for the whole section, so every component inside adapts: `--alt` follows the
       visitor's scheme; `--paper`, `--night` and `--ink` are fixed-contrast art direction. */
    .l-band {
        padding-block: var(--band-space, var(--rhythm-m));
        background: var(--color-bg);
        color: var(--color-text);
    }

    .l-band--tight {
        --band-space: var(--rhythm-s);
    }

    .l-band--loose {
        --band-space: var(--rhythm-l);
    }

    .l-band--flush {
        --band-space: 0;
    }

    .l-band--alt {
        --color-focus-gap: var(--color-surface-alt);
        background: var(--color-surface-alt);
    }

    .l-band--paper {
        color-scheme: light;
    }

    .l-band--night {
        color-scheme: dark;
    }

    /* The manual's purple sections (dividers, applications): white/lavender type on #2D1D47 (M14-D). */
    .l-band--ink {
        color-scheme: dark;
        --color-bg: var(--brand-purple);
        --color-focus-gap: var(--brand-purple);
    }

    /* Editorial rule line above a block (thin rules frame race data, T1). */
    .l-ruled {
        padding-block-start: var(--space-m);
        border-block-start: var(--border-hairline) solid var(--color-text);
    }
}

/* ==== components (boundary-neutral primitives; markup in templates/ui/) ============================================== */
/* A component never sets its own outer block margins: the parent (l-stack, a grid gap) owns the spacing between blocks. */
@layer components {
    /* ---- Icon: inline SVG on a 24 px grid, 2 px stroke in the current text colour. */
    .c-icon {
        display: inline-block;
        flex: none;
        width: var(--icon-size);
        height: var(--icon-size);
        vertical-align: -0.2em;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        overflow: visible;
    }

    .c-icon--s {
        --icon-size: 1em;
    }

    .c-icon--l {
        --icon-size: 1.5em;
    }

    /* Text beside an icon shrinks and wraps (a long word, an e-mail address, 200 % text on a narrow screen) instead of
       widening its component past the container. */
    :where(.c-button, .c-status, .c-field__error, .c-error-summary__title, .c-choice) > :not(.c-icon, .c-choice__input) {
        min-inline-size: 0;
        overflow-wrap: break-word;
    }

    /* ---- Button: <button> for actions, <a> for navigation. One primary per view. ≥ 44 px. */
    .c-button {
        --_bg: var(--color-primary);
        --_fg: var(--color-on-primary);
        --_border: var(--color-primary);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-2xs);
        min-block-size: var(--control-height);
        min-inline-size: var(--control-height);
        max-inline-size: 100%;
        padding: 0.625em 1.25em;
        border: var(--border-strong) solid var(--_border);
        border-radius: var(--radius-s);
        background: var(--_bg);
        color: var(--_fg);
        font: inherit;
        font-weight: var(--weight-semibold);
        line-height: 1.2;
        text-align: center;
        text-decoration: none;
        cursor: pointer;
        transition:
            background-color var(--dur-fast) var(--ease-standard),
            border-color var(--dur-fast) var(--ease-standard),
            color var(--dur-fast) var(--ease-standard),
            transform var(--dur-fast) var(--ease-standard);
    }

    .c-button:hover {
        --_bg: var(--color-primary-hover);
        --_border: var(--color-primary-hover);
        color: var(--_fg);
    }

    .c-button:active {
        transform: translateY(1px);
    }

    .c-button .c-icon {
        --icon-size: 1.1em;
        transition: transform var(--dur-fast) var(--ease-standard);
    }

    .c-button:hover .c-icon--trailing {
        transform: translateX(var(--travel-xs));
    }

    .c-button--secondary {
        --_bg: transparent;
        --_fg: var(--color-text);
        --_border: var(--color-text);
    }

    .c-button--secondary:hover {
        --_bg: var(--color-surface-alt);
        --_border: var(--color-text);
    }

    .c-button--quiet {
        --_bg: transparent;
        --_fg: var(--color-link);
        --_border: transparent;
        padding-inline: 0.5em;
        text-decoration: underline;
        text-decoration-thickness: max(1px, 0.0625em);
        text-underline-offset: 0.18em;
    }

    .c-button--quiet:hover {
        --_bg: transparent;
        --_border: transparent;
        --_fg: var(--color-link-hover);
        text-decoration-thickness: max(2px, 0.125em);
    }

    .c-button--danger {
        --_bg: var(--color-error);
        --_fg: var(--color-on-error);
        --_border: var(--color-error);
    }

    .c-button--danger:hover {
        --_bg: var(--color-error-hover);
        --_border: var(--color-error-hover);
    }

    .c-button--block {
        inline-size: 100%;
    }

    /* Selected (toggle) state: inverted, plus a check icon from the macro — never colour alone. */
    .c-button[aria-pressed="true"] {
        --_bg: var(--color-text);
        --_fg: var(--color-bg);
        --_border: var(--color-text);
    }

    /* Disabled: muted colours, a dashed border (a cue that is not colour) and no pointer. */
    .c-button:disabled,
    .c-button[aria-disabled="true"] {
        --_bg: var(--color-surface-alt);
        --_fg: var(--color-muted);
        --_border: var(--color-border-strong);
        border-style: dashed;
        cursor: not-allowed;
        transform: none;
    }

    .c-button[aria-busy="true"] {
        border-style: solid;
        cursor: progress;
    }

    .c-button[aria-busy="true"] .c-icon--trailing {
        transform: none;
    }

    /* Loading indicator (one per view): the label always states what is happening, the ring only accompanies it. */
    .c-spinner {
        flex: none;
        inline-size: 1em;
        block-size: 1em;
        border: 2px solid currentColor;
        border-inline-end-color: transparent;
        border-radius: 50%;
        animation: c-spin var(--dur-cinematic) var(--ease-linear) infinite;
    }

    /* ---- Link: underlined everywhere; standalone links carry an arrow, external ones say so. */
    .c-link--standalone {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2xs);
        min-block-size: var(--control-height);
        font-weight: var(--weight-semibold);
    }

    .c-link .c-icon {
        --icon-size: 1em;
        transition: transform var(--dur-fast) var(--ease-standard);
    }

    .c-link--standalone:hover .c-icon--trailing {
        transform: translateX(var(--travel-xs));
    }

    .c-link--external .c-icon {
        margin-inline-start: 0.15em;
    }

    /* ---- Form field: label, optional hint, error message (text + icon), native control. */
    .c-field {
        display: grid;
        grid-template-columns: minmax(0, 1fr); /* a long word or e-mail wraps instead of widening the field (text zoom) */
        gap: var(--space-2xs);
        max-inline-size: var(--field-width, 32rem);
    }

    .c-field--s {
        --field-width: 10rem;
    }

    .c-field--m {
        --field-width: 18rem;
    }

    .c-field--full {
        --field-width: none;
    }

    .c-field__label,
    .c-fieldset__legend {
        font-weight: var(--weight-semibold);
        line-height: var(--leading-tight);
    }

    .c-field__optional {
        font-weight: var(--weight-regular);
        color: var(--color-muted);
    }

    .c-field__hint {
        margin: 0;
        font-size: var(--text-s);
        line-height: 1.45;
        color: var(--color-muted);
    }

    .c-field__error {
        display: flex;
        align-items: flex-start;
        gap: var(--space-2xs);
        margin: 0;
        font-size: var(--text-s);
        font-weight: var(--weight-semibold);
        line-height: 1.45;
        color: var(--color-error);
    }

    .c-field__error .c-icon {
        margin-block-start: 0.1em;
    }

    .c-input,
    .c-select__control,
    .c-textarea {
        inline-size: 100%;
        min-block-size: var(--control-height);
        padding: 0.5em 0.75em;
        border: var(--border-hairline) solid var(--color-border-strong);
        border-radius: var(--radius-s);
        background: var(--color-bg);
        color: var(--color-text);
        font: inherit;
        line-height: 1.4;
        transition: border-color var(--dur-fast) var(--ease-standard);
    }

    .c-input:hover,
    .c-select__control:hover,
    .c-textarea:hover {
        border-color: var(--color-text);
    }

    .c-input::placeholder,
    .c-textarea::placeholder {
        color: var(--color-muted);
        opacity: 1;
    }

    .c-textarea {
        min-block-size: 8rem;
        resize: vertical;
    }

    .is-invalid .c-input,
    .is-invalid .c-select__control,
    .is-invalid .c-textarea,
    .c-input[aria-invalid="true"] {
        border-color: var(--color-error);
        box-shadow: inset 0 0 0 1px var(--color-error);
    }

    .c-input:disabled,
    .c-select__control:disabled,
    .c-textarea:disabled {
        border-style: dashed;
        background: var(--color-surface-alt);
        color: var(--color-muted);
        cursor: not-allowed;
    }

    .c-select {
        position: relative;
    }

    .c-select__control {
        appearance: none;
        padding-inline-end: 2.5em;
        cursor: pointer;
    }

    .c-select::after {
        content: "";
        position: absolute;
        inset-block-start: 50%;
        inset-inline-end: 1em;
        inline-size: 0.5em;
        block-size: 0.5em;
        border-inline-end: 2px solid currentColor;
        border-block-end: 2px solid currentColor;
        transform: translateY(-70%) rotate(45deg);
        pointer-events: none;
    }

    .c-fieldset {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-2xs);
        min-inline-size: 0;
        margin-inline: 0;
        padding: 0;
        border: 0;
    }

    .c-fieldset__legend {
        margin-block-end: var(--space-2xs);
        padding: 0;
    }

    .c-choice {
        display: flex;
        align-items: flex-start;
        gap: var(--space-xs);
        min-block-size: var(--control-height);
        padding-block: var(--space-2xs);
    }

    .c-choice__input {
        flex: none;
        inline-size: 1.375rem;
        block-size: 1.375rem;
        margin: 0.08em 0 0;
        accent-color: var(--color-primary);
        cursor: pointer;
    }

    /* Label and hint are siblings: the label is the accessible name, the hint only its description (aria-describedby),
       so a screen reader does not read the hint twice. */
    .c-choice__text {
        line-height: 1.4;
    }

    .c-choice__label {
        display: block;
        cursor: pointer;
    }

    .c-choice__hint {
        display: block;
        font-size: var(--text-s);
        color: var(--color-muted);
    }

    .c-choice__input:disabled,
    .c-choice__input:disabled + .c-choice__text,
    .c-choice__input:disabled + .c-choice__text .c-choice__label {
        color: var(--color-muted);
        cursor: not-allowed;
    }

    /* ---- Error summary: at the top of a form, links to each field; receives focus after a failed submit. */
    .c-error-summary {
        padding: var(--space-m);
        border: var(--border-strong) solid var(--color-error);
        border-inline-start-width: 6px;
        background: var(--color-error-bg);
        color: var(--color-text);
    }

    .c-error-summary:focus {
        outline: var(--focus-width) solid var(--color-focus);
        outline-offset: var(--focus-offset);
    }

    .c-error-summary__title {
        display: flex;
        align-items: center;
        gap: var(--space-2xs);
        margin: 0 0 var(--space-xs);
        font-size: var(--text-l);
        color: var(--color-error);
    }

    .c-error-summary__list {
        margin: 0;
        padding-inline-start: 1.25em;
    }

    .c-error-summary__list a {
        color: var(--color-error);
        font-weight: var(--weight-semibold);
    }

    /* ---- Status label: fixed vocabulary from the server, text + icon (never colour alone), square corners. */
    .c-status {
        --_fg: var(--color-text);
        --_bg: var(--color-surface-alt);
        --_border: var(--color-border-strong);
        display: inline-flex;
        align-items: center;
        gap: 0.4em;
        max-inline-size: 100%;
        padding: 0.2em 0.6em 0.2em 0.45em;
        border: var(--border-hairline) solid var(--_border);
        border-radius: var(--radius-s);
        background: var(--_bg);
        color: var(--_fg);
        font-size: var(--text-s);
        font-weight: var(--weight-semibold);
        line-height: var(--leading-tight);
    }

    .c-status .c-icon {
        --icon-size: 1.1em;
    }

    .c-status--success {
        --_fg: var(--color-success);
        --_bg: var(--color-success-bg);
        --_border: var(--color-success);
    }

    .c-status--warning {
        --_fg: var(--color-warning);
        --_bg: var(--color-warning-bg);
        --_border: var(--color-warning);
    }

    .c-status--error {
        --_fg: var(--color-error);
        --_bg: var(--color-error-bg);
        --_border: var(--color-error);
    }

    .c-status--info {
        --_fg: var(--color-info);
        --_bg: var(--color-info-bg);
        --_border: var(--color-info);
    }

    .c-status--signal {
        --_fg: var(--color-on-primary);
        --_bg: var(--color-primary);
        --_border: var(--color-primary);
    }

    .c-status--signal .c-icon,
    .c-status--neutral .c-icon {
        fill: currentColor;
    }

    /* ---- Media frame: <picture> with art-directed sources and real dimensions (no layout shift); optional fixed
       ratio with a cover crop for repeated units; caption and credit below, never over the image. */
    .c-media {
        margin-inline: 0;
    }

    .c-media picture,
    .c-media img {
        display: block;
    }

    .c-media img {
        inline-size: 100%;
        block-size: auto;
        background: var(--color-surface-alt);
    }

    .c-media--16x9 {
        --_ratio: 16 / 9;
    }

    .c-media--3x2 {
        --_ratio: 3 / 2;
    }

    .c-media--4x3 {
        --_ratio: 4 / 3;
    }

    .c-media--4x5 {
        --_ratio: 4 / 5;
    }

    .c-media--1x1 {
        --_ratio: 1 / 1;
    }

    .c-media--21x9 {
        --_ratio: 21 / 9;
    }

    .c-media--16x9 img,
    .c-media--3x2 img,
    .c-media--4x3 img,
    .c-media--4x5 img,
    .c-media--1x1 img,
    .c-media--21x9 img {
        aspect-ratio: var(--_ratio);
        object-fit: cover;
    }

    .c-media__caption {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: var(--space-3xs) var(--space-s);
        margin-block-start: var(--space-2xs);
        font-size: var(--text-s);
        line-height: 1.45;
        color: var(--color-muted);
    }

    .c-media__credit {
        font-size: var(--text-xs);
        letter-spacing: 0.02em;
    }

    .c-media--bleed .c-media__caption {
        padding-inline: var(--gutter);
    }

    /* ---- Section header: optional eyebrow (index + label), heading, lead. Not a card. */
    .c-section-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr); /* display titles wrap at 200 % text instead of overflowing */
        gap: var(--space-s);
        max-inline-size: 52rem;
    }

    .c-section-header--ruled {
        padding-block-start: var(--space-m);
        border-block-start: var(--border-hairline) solid var(--color-text);
    }

    .c-section-header__eyebrow {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: var(--space-xs);
        margin: 0;
        font-size: var(--text-xs);
        font-weight: var(--weight-semibold);
        line-height: var(--leading-tight);
        letter-spacing: var(--tracking-label);
        text-transform: uppercase;
        color: var(--color-muted);
    }

    .c-section-header__index {
        color: var(--color-link);
        font-variant-numeric: tabular-nums lining-nums;
    }

    .c-section-header__title {
        margin: 0;
    }

    .c-section-header--display .c-section-header__title {
        font-size: var(--text-4xl);
        font-weight: var(--weight-bold);
        line-height: var(--leading-display);
        letter-spacing: var(--tracking-caps);
        text-transform: uppercase;
    }

    /* The manual's heading mark (M14-D, identity manual pp. 4–27): an upper-case Oxanium title over two turquoise bars,
       a short one and a long one. Decorative background only (no pseudo-content, gone in forced colours). */
    .c-section-header--brand .c-section-header__title,
    .c-brand-title {
        padding-block-end: var(--space-xs);
        font-family: var(--font-display);
        letter-spacing: var(--tracking-caps);
        text-transform: uppercase;
        background:
            linear-gradient(var(--color-signal), var(--color-signal)) left bottom / 1.75rem 0.25rem no-repeat,
            linear-gradient(var(--color-signal), var(--color-signal)) 3rem bottom / min(14rem, calc(100% - 3rem)) 0.25rem no-repeat;
    }

    .c-section-header__lead {
        max-inline-size: var(--measure);
        margin: 0;
        font-size: var(--text-l);
        line-height: 1.45;
        color: var(--color-muted);
    }

    /* ---- Data rows («DATOS GENERALES»): ruled label/value pairs with tabular figures. Stacked in narrow
       containers, side by side from 36rem of available width (container query; without support they stay stacked). */
    .c-data-list {
        container-type: inline-size;
        border-block-start: var(--border-hairline) solid var(--color-text);
    }

    .c-data-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-3xs);
        padding-block: var(--space-s);
        border-block-end: var(--border-hairline) solid var(--color-border);
    }

    .c-data-row__label {
        font-size: var(--text-xs);
        font-weight: var(--weight-semibold);
        line-height: var(--leading-tight);
        letter-spacing: var(--tracking-label);
        text-transform: uppercase;
        color: var(--color-muted);
    }

    .c-data-row__value {
        margin: 0;
        font-weight: var(--weight-medium);
        font-variant-numeric: tabular-nums lining-nums;
    }

    .c-data-row__note {
        display: block;
        font-size: var(--text-s);
        font-weight: var(--weight-regular);
        color: var(--color-muted);
    }

    .c-data-list--large .c-data-row__value {
        font-size: var(--text-xl);
        font-weight: var(--weight-semibold);
        line-height: var(--leading-heading);
    }

    @container (min-width: 36rem) {
        .c-data-row {
            grid-template-columns: minmax(8rem, 1fr) minmax(0, 2fr);
            align-items: baseline;
            gap: var(--space-m);
        }
    }
}

@keyframes c-spin {
    to {
        transform: rotate(1turn);
    }
}

/* ==== utilities (intentionally few) =============================================================================== */
/* ==== M14-J2 review round 4: colour theme switch and theme-aware brand lockups ==================================== */
@layer components {
    /* The theme switch (ui/theme_toggle.twig): a 44 px icon button showing the CURRENT theme; hidden without JavaScript. */
    .c-theme {
        display: inline-grid;
        flex: none;
        place-items: center;
        inline-size: var(--control-height, 2.75rem);
        block-size: var(--control-height, 2.75rem);
        padding: 0;
        border: var(--border-hairline, 1px) solid transparent;
        border-radius: 50%;
        background: transparent;
        color: var(--color-link);
        cursor: pointer;
    }

    .c-theme[hidden] {
        display: none;
    }

    .c-theme:hover {
        border-color: var(--color-border-strong);
    }

    .c-theme:focus-visible {
        outline: 3px solid var(--color-focus);
        outline-offset: 2px;
    }

    .c-theme .c-icon {
        --icon-size: 1.25rem;
    }

    .c-theme__icon {
        display: none;
    }

    .c-theme[data-state="light"] .c-theme__icon--light,
    .c-theme[data-state="dark"] .c-theme__icon--dark {
        display: inline-grid;
    }

    /* The access control (ui/account_control.twig): the last control of every header, a 44 px target. */
    .c-account {
        position: relative;
        flex: none;
    }

    .c-account__control {
        display: inline-grid;
        place-items: center;
        inline-size: var(--control-height, 2.75rem);
        block-size: var(--control-height, 2.75rem);
        padding: 0;
        border: var(--border-hairline, 1px) solid transparent;
        border-radius: 50%;
        background: transparent;
        color: var(--color-link);
        cursor: pointer;
    }

    .c-account__control[hidden],
    .c-account__menu[hidden] {
        display: none;
    }

    .c-account__control:hover {
        border-color: var(--color-border-strong);
    }

    .c-account__control:focus-visible,
    .c-account__menu a:focus-visible {
        outline: 3px solid var(--color-focus);
        outline-offset: 2px;
    }

    .c-account__control .c-icon {
        --icon-size: 1.25rem;
    }

    .c-account__avatar {
        display: inline-grid;
        place-items: center;
        inline-size: 2rem;
        block-size: 2rem;
        overflow: hidden;
        border-radius: 50%;
        background: linear-gradient(140deg, #0091b3, #5e3d94);
        color: #ffffff;
        font-family: var(--font-display);
        font-weight: 700;
        line-height: 1;
        box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 3.5px var(--color-signal);
    }

    .c-account__avatar img {
        display: block;
        inline-size: 100%;
        block-size: 100%;
        object-fit: cover;
    }

    /* OD-126: the menu opens on the person (picture, public name), then its places with their icons; «Cerrar sesión» apart. */
    .c-account__menu {
        position: absolute;
        z-index: var(--z-overlay, 300);
        inset-block-start: calc(100% + var(--space-2xs, 0.5rem));
        inset-inline-end: 0;
        inline-size: max-content;
        min-inline-size: 16rem;
        max-inline-size: min(20rem, 100vw - 2 * var(--gutter, 1rem));
        margin: 0;
        padding: var(--space-3xs, 0.25rem);
        border: var(--border-hairline, 1px) solid var(--color-border);
        border-radius: var(--radius-m);
        background: var(--color-bg);
        box-shadow: var(--shadow-overlay);
        list-style: none;
        animation: c-account-in var(--dur-fast) var(--ease-enter);
    }

    @keyframes c-account-in {
        from {
            opacity: 0;
            transform: translateY(-4px);
        }
    }

    .c-account__menu a {
        display: flex;
        align-items: center;
        gap: var(--space-xs, 0.75rem);
        min-block-size: var(--control-height, 2.75rem);
        padding: var(--space-2xs, 0.5rem) var(--space-s, 1rem);
        border-radius: var(--radius-s);
        color: var(--color-text);
        line-height: 1.25;
        text-decoration: none;
    }

    .c-account__menu a .c-icon {
        --icon-size: 1.15rem;

        color: var(--color-muted);
    }

    .c-account__menu a:hover {
        background: var(--color-surface-alt);
    }

    .c-account__menu a:hover .c-icon {
        color: var(--color-signal);
    }

    .c-account__who a {
        margin-block-end: var(--space-3xs, 0.25rem);
        padding-block: var(--space-xs, 0.75rem);
        border-block-end: var(--border-hairline, 1px) solid var(--color-border);
        border-end-start-radius: 0;
        border-end-end-radius: 0;
    }

    .c-account__who-avatar {
        display: inline-grid;
        flex: none;
        place-items: center;
        inline-size: 2.5rem;
        block-size: 2.5rem;
        overflow: hidden;
        border-radius: 50%;
        background: linear-gradient(140deg, #0091b3, #5e3d94);
        color: #ffffff;
        font-family: var(--font-display);
        font-weight: 700;
        box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-signal);
    }

    .c-account__who-avatar img {
        inline-size: 100%;
        block-size: 100%;
        object-fit: cover;
    }

    .c-account__menu .c-account__who-avatar .c-icon {
        color: inherit;
    }

    .c-account__who-text {
        display: grid;
        min-inline-size: 0;
    }

    .c-account__who-name {
        overflow: hidden;
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .c-account__who-sub {
        color: var(--color-muted);
        font-size: var(--text-xs, 0.75rem);
    }

    .c-account__who-sub[hidden] {
        display: none;
    }

    .c-account__out {
        margin-block-start: var(--space-3xs, 0.25rem);
        padding-block-start: var(--space-3xs, 0.25rem);
        border-block-start: var(--border-hairline, 1px) solid var(--color-border);
    }

    .c-account__out a:hover,
    .c-account__out a:hover .c-icon {
        color: var(--color-error);
    }

    /* Brand lockups that follow the theme: two images, one shown (the system's scheme until the visitor chooses). A
       browser without light-dark() keeps the light palette (KL-22), so it keeps the colour lockup too. */
    img.c-brand__img--dark {
        display: none;
    }

    @supports (color: light-dark(#000, #fff)) {
        @media (prefers-color-scheme: dark) {
            :root:not([data-theme="light"]) img.c-brand__img--light {
                display: none;
            }

            :root:not([data-theme="light"]) img.c-brand__img--dark {
                display: block;
            }
        }

        :root[data-theme="dark"] img.c-brand__img--light {
            display: none;
        }

        :root[data-theme="dark"] img.c-brand__img--dark {
            display: block;
        }
    }
}

@layer utilities {
    /* M14-J round 3 (OD-44): Tag Manager's no-script frame takes no space and is never seen (no inline style: CSP). */
    .c-gtm-noscript {
        display: none;
        visibility: hidden;
    }

    .visually-hidden {
        position: absolute;
        inline-size: 1px;
        block-size: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }

    .u-tabular {
        font-variant-numeric: tabular-nums lining-nums;
    }

    .u-measure {
        max-inline-size: var(--measure);
    }

    .u-nowrap {
        white-space: nowrap;
    }
}
