/* ==========================================================================
   Orbis design system. One stylesheet for every page.
   HTML and CSS only: no scripts, no external URLs, every asset is local.

   Contents
     fonts        Poppins 400 / 500 / 600 / 700, self-hosted
     reset        small element reset (no universal selector)
     tokens       palette, semantic colours, materials, type, space, radii
     base         page ground, type, links, focus, lists, the uppercase label
     layout       app shell, page, section, grid, board, narrow, stack, cluster, split
     components   nav, card, well, btn, keys, shortcut, pill, badge, chips, rating, tile,
                  field, check, range, ring, meters, bar, stat, legend, chart,
                  destination, scene, hero, review, facts, timeline, rows, breadcrumb, tabs,
                  details, table
     icons        mask icons, one class per glyph
     utilities    visually-hidden, lead, small, num, center, span-all, middle
     preferences  reduced motion, forced colours

   Conventions
     One class per component, plain modifier classes beside it: "btn primary", "ring violet", "card lg".
     Tone modifiers warm / violet / cyan recolour any data graphic, tile, badge or legend entry.
     State comes from attributes and pseudo-classes: aria-current, aria-pressed, :checked, :disabled,
     :user-invalid (or aria-invalid="true").
     Data values travel as custom properties: style="--value: 80" beside value="80".

   Materials (the whole look is built from these five)
     panel    raised card, lit from the top-left          var(--panel) + var(--raised)
     key      raised button face with a darker lower lip  var(--key) + var(--lip-shadow)
     field    outlined input                              var(--field) + 1.5px var(--line)
     well     recessed track                              var(--track) + var(--sunken)
     warm     the one call-to-action gradient             var(--warm), text in var(--on-warm)
   ========================================================================== */

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

/* ---------- fonts -------------------------------------------------------- */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/poppins-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/poppins-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/poppins-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/poppins-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/poppins-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/poppins-600-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/poppins-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/poppins-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- reset -------------------------------------------------------- */

@layer reset {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { margin: 0; }
  :where(a, button, input, select, textarea, progress, label, span, div, p, li, ul, ol, dl, dt, dd,
         section, article, aside, header, footer, nav, main, search, form, figure, fieldset, legend,
         details, summary, table, img, svg, strong, small, blockquote) { box-sizing: border-box; }
  :where(h1, h2, h3, h4, p, figure, blockquote, dl, dd) { margin: 0; }
  :where(ul, ol)[class] { margin: 0; padding: 0; list-style: none; }
  :where(img, svg) { display: block; max-inline-size: 100%; }
  :where(img) { block-size: auto; }
  :where(button, input, select, textarea) { margin: 0; font: inherit; letter-spacing: inherit; color: inherit; }
  :where(fieldset) { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
  :where(legend) { padding: 0; }
  :where(table) { border-collapse: collapse; border-spacing: 0; }
  :where(search) { display: block; }
  :where([hidden]) { display: none; }
}

/* ---------- tokens ------------------------------------------------------- */

@layer tokens {
  :root {
    color-scheme: dark;

    /* Palette. Literal values, sampled from the reference. */
    --night: #18183e;                 /* page ground */
    --night-edge: #16163a;
    --glow-1: #4a43db;                /* corner glow, brightest */
    --glow-2: #3c36ae;
    --glow-3: #292570;
    --indigo-1: #5552d1;              /* panel, lit corner: the lightest surface text ever sits on */
    --indigo-2: #4543b8;
    --indigo-3: #2e2c80;
    --indigo-4: #1f1d5a;
    --indigo-5: #1a184d;              /* panel, shaded corner */
    --key-1: #5758db;                 /* key face, top */
    --key-2: #332e83;                 /* key face, bottom */
    --key-lip: #1c1c56;
    --field-1: #3f39b4;
    --field-2: #2a2878;
    --track: #17175f;                 /* recessed: wells, slider, meter and ring tracks */
    --periwinkle: #bcbaff;            /* glyphs, outlines, placeholders (the reference #9e9dfc lifted to 3:1) */
    --lavender: #e4e3ff;
    --white: #fff;
    --peach-pale: #f4ceba;
    --peach: #e9a671;
    --coral: #e58a77;
    --rose: #de6c80;
    --lilac: #ba88f4;
    --violet: #7c5cf0;                /* reference #6946e8 lifted to 3:1 on the track */
    --ice: #b2fcfc;
    --azure: #76a5fc;
    --gold: #f1cf78;
    --blush: #ffd9dd;                 /* error text and outline */

    /* Semantic colours. */
    --bg: var(--night);
    --text: var(--white);             /* headings, values, control text */
    --text-soft: var(--lavender);     /* body, labels, captions: 4.76:1 on --indigo-1 */
    --accent: var(--periwinkle);      /* glyphs and placeholders */
    --line: var(--periwinkle);        /* control outlines: 3.3:1 on --indigo-1 */
    --line-soft: rgb(188 186 255 / .24);  /* decorative separators only */
    --on-warm: var(--indigo-5);       /* text on the warm gradient: 5.1:1 to 11:1 */
    --link: #ffe1cf;
    --danger: var(--blush);
    --focus: var(--white);

    /* Materials. */
    --panel: linear-gradient(90deg, rgb(26 24 77 / 0), rgb(26 24 77 / .6)),
             linear-gradient(180deg, var(--indigo-1), var(--indigo-2) 34%, var(--indigo-3) 68%, var(--indigo-4));
    --key: linear-gradient(90deg, rgb(26 24 77 / 0) 30%, rgb(26 24 77 / .32)),
           linear-gradient(180deg, var(--key-1), var(--key-2));
    --field: linear-gradient(180deg, var(--field-1), var(--field-2));
    --warm: linear-gradient(180deg, var(--peach), var(--coral) 50%, var(--rose));
    --warm-x: linear-gradient(90deg, var(--peach-pale), var(--coral));

    /* Tone: the two stops every data graphic is drawn with. Changed by .warm / .violet / .cyan. */
    --tone-a: var(--peach);
    --tone-b: var(--rose);

    /* Elevation: one drop shadow, one lit edge, one inset. */
    --shadow: .375rem .625rem 1.5rem rgb(6 6 26 / .6);
    --edge: inset 1px 1px 0 rgb(255 255 255 / .14);
    --raised: var(--edge), var(--shadow);
    --sunken: inset .125rem .1875rem .5rem rgb(5 5 28 / .7);
    --lip: .25rem;
    --lip-shadow: var(--edge), 0 var(--lip) 0 var(--key-lip), var(--shadow);

    /* Radii. */
    --r-1: .5rem;                     /* checkboxes, table wrap */
    --r-2: .875rem;                   /* fields, buttons, keys, tiles */
    --r-3: 1.25rem;                   /* wells, media inside cards */
    --r-4: 1.75rem;                   /* cards */
    --r-pill: 999px;

    /* Type. */
    --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --fs-xs: .8125rem;                /* uppercase labels, axis labels */
    --fs-sm: .875rem;
    --fs-md: 1rem;
    --fs-lg: 1.125rem;
    --fs-h4: 1.0625rem;
    --fs-h3: 1.3125rem;
    --fs-h2: clamp(1.5rem, 1.3rem + .9vw, 1.875rem);
    --fs-h1: clamp(1.875rem, 1.45rem + 1.9vw, 2.75rem);
    --fs-stat: clamp(2rem, 1.6rem + 1.4vw, 2.625rem);
    --caps: .12em;                    /* letter-spacing for uppercase labels */

    /* Space. */
    --s-1: .25rem;
    --s-2: .5rem;
    --s-3: .75rem;
    --s-4: 1rem;
    --s-5: 1.5rem;
    --s-6: 2rem;
    --s-7: 3rem;
    --s-8: clamp(3rem, 2rem + 4vw, 5rem);
    --gap: clamp(1rem, .6rem + 1.6vw, 2rem);
    --pad: clamp(1.25rem, 1rem + 1vw, 1.875rem);
    --gutter: clamp(1rem, .25rem + 3.2vw, 2.5rem);

    /* Sizes. */
    --control: 3.25rem;               /* field and button height */
    --key-size: 4rem;                 /* raised square icon button */
    --sidebar: 15rem;
    --rail: 5.75rem;
    --tabbar: 5.25rem;
    --speed: .14s;

    /* Slider knob. */
    --knob-core: #a9a8f0;
    --knob-face: #f6f5ff;
    --knob-glow: rgb(246 245 255 / .34);

    /* Glyphs that components draw themselves. Every other icon lives in the icons layer. */
    --glyph-check: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
    --glyph-chevron-down: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E");
    --glyph-chevron-right: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
    /* The tick inside a checked box. Its stroke is --on-warm written out, because a data URI cannot read a variable. */
    --glyph-check-on-warm: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%231a184d' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  }
}

/* ---------- base --------------------------------------------------------- */

@layer base {
  html {
    background-color: var(--bg);
    color: var(--text-soft);
    font-family: var(--font);
    font-size: 100%;
    line-height: 1.6;
    accent-color: var(--peach);
    scroll-padding-block: 1.5rem;
  }

  body { min-block-size: 100dvh; overflow-wrap: break-word; }

  /* Page ground: the corner glow stays put while the page scrolls. */
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
      radial-gradient(ellipse max(44%, 24rem) max(72%, 28rem) at 2% -4%,
        var(--glow-1), var(--glow-2) 28%, var(--glow-3) 56%, rgb(28 26 74 / 0)),
      radial-gradient(ellipse 62% 55% at 100% 100%, #1e1d52, rgb(30 29 82 / 0) 72%),
      linear-gradient(90deg, var(--night-edge), var(--night) 22%, var(--night) 78%, var(--night-edge));
  }

  h1, h2, h3, h4, .h1, .h2, .h3, .h4 {
    color: var(--text);
    font-weight: 700;
    line-height: 1.2;
    text-wrap: balance;
  }
  h1, .h1 { font-size: var(--fs-h1); line-height: 1.12; letter-spacing: -.01em; }
  h2, .h2 { font-size: var(--fs-h2); }
  h3, .h3 { font-size: var(--fs-h3); line-height: 1.25; }
  h4, .h4 { font-size: var(--fs-h4); font-weight: 600; line-height: 1.35; }

  p { max-inline-size: 68ch; text-wrap: pretty; }
  strong, b { color: var(--text); font-weight: 600; }
  small { font-size: var(--fs-sm); }

  a {
    color: var(--link);
    text-decoration-line: underline;
    text-decoration-thickness: .08em;
    text-underline-offset: .22em;
  }
  a:hover { text-decoration-thickness: .16em; }

  :focus-visible {
    outline: .1875rem solid var(--focus);
    outline-offset: .1875rem;
  }

  ::selection { background: var(--peach); color: var(--on-warm); }

  /* Plain lists keep their markers. Lists with a class are reset and styled as components. */
  :where(ul, ol):not([class]) { margin-block: 0; padding-inline-start: 1.25rem; }
  :where(ul):not([class]) { list-style: disc; }
  :where(ul, ol):not([class]) > li + li { margin-block-start: var(--s-1); }
  li::marker { color: var(--accent); }

  hr { margin-block: var(--s-5); border: 0; border-block-start: 1px solid var(--line-soft); }

  /* Uppercase, letter-spaced caption. Only where the reference has one:
     field labels, meter and scale captions, the caption beside a big number. */
  .label,
  .field > label,
  .field > legend,
  .chips > legend {
    color: var(--text-soft);
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: var(--caps);
    line-height: 1.3;
    text-transform: uppercase;
  }

  legend { margin-block-end: var(--s-2); }
}

/* ---------- layout ------------------------------------------------------- */

@layer layout {
  /* App shell.
     under 40rem   top bar (brand) + fixed bottom tab bar
     40rem-64rem   sticky icon rail on the inline-start edge
     64rem and up  sticky sidebar                                             */
  .app {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-block-size: 100dvh;
    padding-block-end: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px));
  }

  .shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-3) var(--gutter);
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: .625rem;
    min-block-size: 2.75rem;
    color: var(--text);
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1;
    text-decoration: none;
  }
  .brand img { inline-size: 2.5rem; block-size: 2.5rem; }

  .page, .footer { grid-column: -2 / -1; min-inline-size: 0; }

  .page {
    container-type: inline-size;
    inline-size: 100%;
    max-inline-size: 82rem;
    padding: var(--s-4) var(--gutter) var(--s-7);
  }

  .footer {
    padding: var(--s-5) var(--gutter) var(--s-6);
    border-block-start: 1px solid var(--line-soft);
    font-size: var(--fs-sm);
  }

  @media (width < 40rem) {
    html { scroll-padding-block-end: calc(var(--tabbar) + 1.5rem); }
    .shell .nav {
      position: fixed;
      inset-inline: 0;
      inset-block-end: 0;
      z-index: 20;
      padding: var(--s-2) max(var(--s-2), env(safe-area-inset-left, 0px)) calc(var(--s-2) + env(safe-area-inset-bottom, 0px));
      border-block-start: 1px solid var(--line-soft);
      background: rgb(22 22 58 / .98);
      -webkit-backdrop-filter: blur(14px);
      backdrop-filter: blur(14px);
    }
  }

  @media (width >= 40rem) {
    .app { grid-template-columns: var(--rail) minmax(0, 1fr); padding-block-end: 0; }
    .shell {
      grid-row: 1 / span 2;
      position: sticky;
      inset-block-start: 0;
      align-self: start;
      flex-direction: column;
      justify-content: flex-start;
      gap: var(--s-6);
      block-size: 100dvh;
      padding: var(--s-5) var(--s-2);
      overflow-y: auto;
    }
    .page { padding-block-start: var(--s-5); }
  }

  @media (40rem <= width < 64rem) {
    /* On the rail the wordmark is kept for screen readers only. */
    .shell .brand span { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  }

  @media (width >= 64rem) {
    .app { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
    .shell { align-items: stretch; padding: var(--s-5) var(--s-4); }
    .shell .brand { padding-inline: var(--s-2); }
  }

  /* Page header: title, search, avatar. */
  .topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-4) var(--s-5);
    margin-block-end: var(--s-5);
  }
  .topbar > :first-child { flex: 1 1 auto; min-inline-size: 0; }
  .topbar search { flex: 1 1 14rem; max-inline-size: 24rem; }
  @media (width < 40rem) {
    .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .topbar search { grid-column: 1 / -1; grid-row: 2; max-inline-size: none; }
  }

  /* Vertical rhythm. A section is a column of blocks; a section-head is a title with an optional link. */
  .section {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-5);
    margin-block-start: var(--s-8);
    scroll-margin-block-start: var(--s-5);
  }
  .section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-1) var(--s-5);
  }

  /* Grid: as many equal columns as fit. Modifiers change the minimum column or name a fixed split. */
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--col, 17rem)), 1fr));
    gap: var(--gap);
  }
  .grid > * { min-inline-size: 0; }
  .grid.tight { --col: 10.5rem; gap: var(--s-4); }
  .grid.halves, .grid.aside { grid-template-columns: minmax(0, 1fr); }
  @container (inline-size >= 48rem) {
    .grid.halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid.aside { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
  }

  /* Board: the dashboard arrangement of the reference. Six cells: wide, narrow, medium, twice. */
  .board {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gap);
  }
  .board > * { min-inline-size: 0; }
  @container (inline-size >= 36rem) {
    .board { --key-size: clamp(4.5rem, 8.5cqi, 6rem); grid-template-columns: auto minmax(0, 1fr); }
    .board > :nth-child(3n + 1) { grid-column: 1 / -1; }
  }
  @container (inline-size >= 58rem) {
    .board { grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr); }
    .board > :nth-child(3n + 1) { grid-column: auto; }
  }

  /* Narrow: a centred column for a single form or a short read. */
  .narrow { inline-size: 100%; max-inline-size: 30rem; margin-inline: auto; }

  /* Stack: a column. Cluster: a wrapping row. Split: a row pushed to both ends. */
  .stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: var(--s-4);
  }
  .stack.tight { gap: var(--s-2); }
  .stack.loose { gap: var(--gap); }
  .stack.fill { grid-template-rows: 1fr; grid-auto-rows: auto; align-content: stretch; }   /* first child takes the spare height */
  .stack.spread { align-content: space-between; }                                         /* children pushed to both ends */

  .cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-3) var(--s-4);
  }

  .split {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3) var(--s-4);
  }
}

/* ---------- components --------------------------------------------------- */

@layer components {

  /* Tone modifiers. Any data graphic, tile, badge or legend entry takes one: "ring violet", "meter cyan". */
  .warm   { --tone-a: var(--peach); --tone-b: var(--rose); }
  .violet { --tone-a: var(--lilac); --tone-b: var(--violet); }
  .cyan   { --tone-a: var(--ice);   --tone-b: var(--azure); }

  /* ---- Skip link ---- */
  .skip-link {
    position: fixed;
    inset-block-start: var(--s-3);
    inset-inline-start: var(--s-3);
    z-index: 50;
    padding: var(--s-3) var(--s-5);
    border: 1.5px solid var(--peach-pale);
    border-radius: var(--r-pill);
    background: var(--warm) border-box;
    color: var(--on-warm);
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-200%);
  }
  .skip-link:focus { transform: none; }

  /* ---- Nav: one item design (a key with a label), three arrangements ----
     bar   keys in a row, label under each       (default; the bottom tab bar)
     rail  keys in a column, label under each    (40rem and up inside .shell)
     side  key and label side by side            (64rem and up inside .shell)
     The current page is the pressed key: sunk into a well, glyph turns warm, label turns bold white. */
  .nav {
    --nav-list: row;
    --nav-item: "key" auto "label" auto / minmax(0, 1fr);
    --nav-key: 2.5rem;
    --nav-fs: .75rem;
    --nav-gap: var(--s-1);
    --nav-grow: 1;
    --nav-justify: center;
  }
  .nav.rail {
    --nav-list: column;
    --nav-key: 3.5rem;
    --nav-gap: var(--s-5);
    --nav-grow: 0;
  }
  .nav.side {
    --nav-list: column;
    --nav-item: "key label" auto / auto minmax(0, 1fr);
    --nav-key: 2.75rem;
    --nav-fs: 1rem;
    --nav-gap: var(--s-4);
    --nav-grow: 0;
    --nav-justify: start;
  }
  @media (width >= 40rem) {
    .shell .nav { --nav-list: column; --nav-key: 3.5rem; --nav-gap: var(--s-5); --nav-grow: 0; }
  }
  @media (width >= 64rem) {
    .shell .nav {
      --nav-item: "key label" auto / auto minmax(0, 1fr);
      --nav-key: 2.75rem; --nav-fs: 1rem; --nav-gap: var(--s-4); --nav-justify: start;
    }
  }

  .nav ul {
    display: flex;
    flex-direction: var(--nav-list);
    gap: var(--nav-gap);
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .nav li { flex: var(--nav-grow) 1 0; min-inline-size: 0; margin: 0; }
  .nav a {
    display: grid;
    grid-template: var(--nav-item);
    align-items: center;
    justify-items: var(--nav-justify);
    gap: .375rem var(--s-3);
    min-block-size: 2.75rem;
    padding-block-end: var(--lip);
    border-radius: var(--r-2);
    color: var(--text-soft);
    font-size: var(--nav-fs);
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
  }
  .nav a::before {
    content: "";
    grid-area: key;
    justify-self: center;
    box-sizing: border-box;
    inline-size: var(--nav-key);
    aspect-ratio: 1;
    border: 1px solid transparent;
    border-radius: var(--r-2);
    background: var(--key) border-box;
    box-shadow: var(--lip-shadow);
    transition: transform var(--speed), box-shadow var(--speed);
  }
  .nav a > .icon {
    grid-area: key;
    place-self: center;
    z-index: 1;
    inline-size: calc(var(--nav-key) * .46);
    color: var(--accent);
    transition: transform var(--speed);
  }
  .nav a > :last-child { grid-area: label; }
  .nav a:hover { color: var(--text); }
  .nav a:hover::before, .nav a:hover > .icon { transform: translateY(-1px); }
  .nav a:active::before,
  .nav a[aria-current="page"]::before {
    background: var(--track);
    box-shadow: var(--sunken);
    transform: translateY(var(--lip));
  }
  .nav a:active > .icon,
  .nav a[aria-current="page"] > .icon { color: var(--peach); transform: translateY(var(--lip)); }
  .nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

  /* ---- Surfaces ---- */
  .card {
    position: relative;
    padding: var(--pad);
    border: 1px solid transparent;
    border-radius: var(--r-4);
    background: var(--panel) border-box;
    box-shadow: var(--raised);
  }
  .card.sm { --pad: var(--s-4); border-radius: var(--r-3); }
  .card.lg { --pad: clamp(1.5rem, 1rem + 2.4vw, 2.75rem); }
  .card.capsule { padding: var(--s-2) var(--s-5); border-radius: var(--r-pill); }

  .well {
    padding: var(--s-4);
    border: 1px solid transparent;
    border-radius: var(--r-3);
    background: var(--track);
    box-shadow: var(--sunken);
  }

  /* ---- Buttons ----
     btn            raised indigo key (the secondary action)
     btn primary    warm gradient, uppercase
     btn quiet      outline only
     btn square     icon only, the raised key of the reference
     sm / lg / block change size. :disabled, [aria-disabled], [aria-pressed], [aria-current] change state. */
  .btn {
    --btn-h: var(--control);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    min-block-size: var(--btn-h);
    padding: var(--s-2) var(--s-5);
    border: 1px solid transparent;
    border-radius: 0;
    background: var(--key) border-box;
    box-shadow: var(--lip-shadow);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--speed), box-shadow var(--speed), opacity var(--speed);
  }
  .btn > .icon { flex: none; inline-size: 1.25em; }
  .btn:hover { transform: translateY(-1px); }
  .btn:active { box-shadow: var(--edge), 0 0 0 var(--key-lip), 0 .125rem .5rem rgb(6 6 26 / .5); transform: translateY(var(--lip)); }

  .btn.primary {
    border: 1.5px solid var(--peach-pale);
    background: var(--warm) border-box;
    box-shadow: var(--shadow);
    color: var(--on-warm);
    font-weight: 700;
    letter-spacing: var(--caps);
    text-transform: uppercase;
  }
  .btn.primary:active { box-shadow: 0 .125rem .5rem rgb(6 6 26 / .5); transform: translateY(.125rem); }

  .btn.quiet {
    border: 1.5px solid var(--line);
    background: none;
    box-shadow: none;
  }
  .btn.quiet:hover { box-shadow: inset 0 0 0 100vmax rgb(255 255 255 / .08); transform: none; }
  .btn.quiet:active { box-shadow: inset 0 0 0 100vmax rgb(255 255 255 / .16); transform: none; }

  .btn.sm { --btn-h: 2.75rem; padding-inline: var(--s-4); font-size: var(--fs-sm); }
  .btn.lg { --btn-h: var(--key-size); padding-inline: var(--s-6); font-size: 1.25rem; }
  .btn.block { display: flex; inline-size: 100%; }

  .btn.square {
    --btn-h: var(--key-size);
    --lip: calc(var(--btn-h) * .07);
    flex: none;
    inline-size: var(--btn-h);
    padding: 0;
    color: var(--accent);
  }
  .btn.square > .icon { inline-size: 50%; }
  .btn.square.sm { --btn-h: 2.75rem; }

  .btn[aria-pressed="true"],
  .btn[aria-current]:not([aria-current="false"]) {
    background: var(--track);
    box-shadow: var(--sunken);
    transform: translateY(var(--lip));
  }
  .btn[aria-pressed="true"] > .icon,
  .btn[aria-current]:not([aria-current="false"]) > .icon { color: var(--peach); }

  .btn:disabled,
  .btn[aria-disabled="true"] {
    box-shadow: var(--edge);
    opacity: .45;
    transform: none;
    cursor: not-allowed;
  }
  .btn.quiet:disabled, .btn.quiet[aria-disabled="true"], .btn.primary:disabled, .btn.primary[aria-disabled="true"] { box-shadow: none; }

  /* Keys: a set of square buttons or shortcuts. Three across, six across from 36rem; "pair" keeps two across. */
  .keys {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-items: center;
    align-content: space-between;
    gap: var(--s-5) var(--s-4);
  }
  @container (inline-size >= 36rem) {
    .keys { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .keys.pair { grid-template-columns: repeat(2, max-content); justify-content: space-between; gap: var(--s-5); }
  }

  /* Shortcut: a key with its label underneath, all one link. */
  .shortcut {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: var(--s-3);
    color: var(--text-soft);
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
  }
  .shortcut:hover { color: var(--text); }
  .shortcut:hover > .btn { transform: translateY(-1px); }
  .shortcut:active > .btn { box-shadow: var(--edge), 0 0 0 var(--key-lip), 0 .125rem .5rem rgb(6 6 26 / .5); transform: translateY(var(--lip)); }

  /* ---- Pills, badges, chips, rating ---- */
  .pill {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: .3125rem var(--s-4);
    border: 1.5px solid var(--peach-pale);
    border-radius: var(--r-pill);
    background: var(--warm-x) border-box;
    box-shadow: 0 .25rem .75rem rgb(6 6 26 / .35);
    color: var(--on-warm);
    font-size: var(--fs-lg);
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
  }
  .pill.sm { padding: .125rem var(--s-3); font-size: var(--fs-sm); }

  .badge {
    display: inline-flex;
    align-items: center;
    gap: .4375rem;
    padding: .25rem var(--s-3);
    border: 1px solid var(--line-soft);
    border-radius: 1rem;                 /* a full pill on one line, a soft box if the text wraps */
    background: var(--track);
    color: var(--text);
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 1.4;
  }
  .badge::before {
    content: "";
    flex: none;
    inline-size: .5625rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--tone-a), var(--tone-b));
  }
  .badge:has(> .icon)::before { display: none; }
  .badge > .icon { inline-size: 1rem; color: var(--tone-a); }

  .chips { display: flex; flex-wrap: wrap; gap: var(--s-2) .625rem; }
  .chips > legend { margin-block-end: var(--s-2); }
  .chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    min-block-size: 2.75rem;
    padding: .25rem 1.125rem;
    border: 1.5px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--text);
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: box-shadow var(--speed);
  }
  .chip > input {
    position: absolute;
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
    margin: 0;
    opacity: 0;
    cursor: inherit;
  }
  .chip:hover { box-shadow: inset 0 0 0 100vmax rgb(255 255 255 / .08); }
  .chip:has(> input:checked) {
    border-color: var(--peach-pale);
    background: var(--warm) border-box;
    box-shadow: none;
    color: var(--on-warm);
    font-weight: 600;
  }
  .chip:has(> input:checked)::before {
    content: "";
    flex: none;
    inline-size: 1.125rem;
    aspect-ratio: 1;
    background: currentColor;
    -webkit-mask: var(--glyph-check) center / contain no-repeat;
    mask: var(--glyph-check) center / contain no-repeat;
  }
  .chip:has(> input:focus-visible) { outline: .1875rem solid var(--focus); outline-offset: .1875rem; }
  .chip:has(> input:disabled) { opacity: .45; cursor: not-allowed; }

  .rating {
    display: inline-flex;
    align-items: center;
    gap: .3125rem;
    color: var(--text);
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
  }
  .rating > .icon { inline-size: 1.2em; color: var(--gold); }
  .rating.lg { gap: var(--s-2); font-size: var(--fs-stat); }
  .rating.lg > .icon { inline-size: 1.3em; }

  /* ---- Tile: a rounded square that holds a glyph, a number or initials ----
     Plain tiles are wells. With a tone they are the gradient tile of the reference ("tile violet" is the avatar). */
  .tile {
    --tile: 3rem;
    display: inline-grid;
    place-items: center;
    flex: none;
    inline-size: var(--tile);
    aspect-ratio: 1;
    border: 1px solid transparent;
    border-radius: var(--r-2);
    background: var(--track);
    box-shadow: var(--sunken);
    color: var(--accent);
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
  }
  .tile > .icon { inline-size: 50%; }
  .tile:is(.warm, .violet, .cyan) {
    background: linear-gradient(145deg, var(--tone-a), var(--tone-b)) border-box;
    box-shadow: var(--edge), 0 .25rem .75rem rgb(6 6 26 / .4);
    color: var(--on-warm);
  }
  .tile.violet {                         /* the avatar: white glyph, so the light stop is pulled back to keep 3:1 */
    background: linear-gradient(145deg, var(--tone-a) -44%, var(--tone-b)) border-box;
    color: var(--white);
  }
  .tile.sm { --tile: 2.5rem; }
  .tile.lg { --tile: clamp(3.75rem, 2.5rem + 6vw, 5rem); border-radius: var(--r-3); }
  .tile.lg > .icon { inline-size: 62%; }
  a.tile, button.tile { min-inline-size: 2.75rem; cursor: pointer; }

  /* ---- Form fields ----
     field          label, control (input / select / textarea), optional <small> help and <small class="error">
     field inset    the reference look: the label sits inside the field, centred, and lifts when there is a value
     A leading .icon inside .field is laid over the control. */
  .field {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "label" "control" "help";
  }
  .field > label,
  .field > legend { grid-area: label; margin-block-end: var(--s-2); }
  .field > :is(input:not([type="range"], [type="checkbox"], [type="radio"]), select, textarea) {
    grid-area: control;
    inline-size: 100%;
    min-block-size: var(--control);
    padding: var(--s-3) 1.125rem;
    border: 1.5px solid var(--line);
    border-radius: var(--r-2);
    background: var(--field) border-box;
    box-shadow: 0 0 .875rem rgb(126 118 255 / .28);
    color: var(--text);
    font-weight: 500;
    line-height: 1.4;
  }
  .field > textarea { min-block-size: 7rem; resize: vertical; }
  .field > input[type="password"] { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: .12em; }   /* Poppins has no bullet for the mask */
  .field > select {
    -webkit-appearance: none;
    appearance: none;
    padding-inline-end: 3rem;
    cursor: pointer;
  }
  .field:has(> select)::after {
    content: "";
    grid-area: control;
    place-self: center end;
    inline-size: 1.25rem;
    aspect-ratio: 1;
    margin-inline-end: var(--s-4);
    background: var(--accent);
    -webkit-mask: var(--glyph-chevron-down) center / contain no-repeat;
    mask: var(--glyph-chevron-down) center / contain no-repeat;
    pointer-events: none;
  }
  .field ::placeholder { color: var(--accent); opacity: 1; }
  .field > small { grid-area: help; margin-block-start: var(--s-2); line-height: 1.45; }
  .field > .icon {
    grid-area: control;
    place-self: center start;
    z-index: 1;
    inline-size: 1.375rem;
    margin-inline-start: var(--s-4);
    color: var(--accent);
    pointer-events: none;
  }
  .field:has(> .icon) > input { padding-inline-start: 3.125rem; }

  /* Search inputs: drop the engine's own decorations, keep the clear button usable. */
  .field > input[type="search"] { -webkit-appearance: none; appearance: none; }
  .field > input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }

  /* Inset label (needs placeholder=" " on the input so :placeholder-shown can tell empty from filled). */
  .field.inset > label {
    grid-area: control;
    place-self: center;
    z-index: 1;
    margin: 0;
    font-size: var(--fs-md);
    pointer-events: none;
    transition: transform var(--speed);
  }
  .field.inset > input {
    min-block-size: var(--key-size);
    padding-block: 1.5rem .375rem;
    text-align: center;
  }
  .field.inset:focus-within > label { transform: translateY(-1.0625rem) scale(.82); }
  .field.inset:has(> input:not(:placeholder-shown)) > label { transform: translateY(-1.0625rem) scale(.82); }
  .field.inset:has(> input:autofill) > label { transform: translateY(-1.0625rem) scale(.82); }
  .field.inset:has(> input:-webkit-autofill) > label { transform: translateY(-1.0625rem) scale(.82); }

  /* States. */
  .field > :is(input, select, textarea):disabled { opacity: .45; cursor: not-allowed; }
  .field:has(> :disabled) > label { opacity: .6; }

  .field > .error { display: none; align-items: flex-start; gap: var(--s-2); color: var(--danger); font-weight: 500; }
  .field > .error > .icon { flex: none; inline-size: 1.25rem; margin-block-start: .0625rem; }
  .field > [aria-invalid="true"] { border-color: var(--danger); border-width: .1875rem; box-shadow: 0 0 .875rem rgb(255 150 165 / .35); }
  .field > :user-invalid { border-color: var(--danger); border-width: .1875rem; box-shadow: 0 0 .875rem rgb(255 150 165 / .35); }
  .field:has(> [aria-invalid="true"]) > .error { display: flex; }
  .field:has(> :user-invalid) > .error { display: flex; }

  /* Autofill: the engine paints its own background, so the fill is redrawn with an inset shadow.
     Three cues: ice outline, thicker outline, flat fill. [data-autofill-preview] forces the look in the kit. */
  .field > input:-webkit-autofill {
    border-color: var(--ice);
    border-width: .1875rem;
    box-shadow: 0 0 0 100vmax var(--field-2) inset, 0 0 .875rem rgb(149 214 253 / .4);
    -webkit-text-fill-color: var(--text);
    caret-color: var(--text);
  }
  .field > input:autofill,
  .field > input[data-autofill-preview] {
    border-color: var(--ice);
    border-width: .1875rem;
    box-shadow: 0 0 0 100vmax var(--field-2) inset, 0 0 .875rem rgb(149 214 253 / .4);
    -webkit-text-fill-color: var(--text);
    caret-color: var(--text);
  }

  /* Checkbox and radio. */
  .check {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    min-block-size: 2.75rem;
    color: var(--text);
    cursor: pointer;
  }
  .check > input {
    -webkit-appearance: none;
    appearance: none;
    flex: none;
    inline-size: 1.625rem;
    block-size: 1.625rem;
    margin: 0;
    border: 1.5px solid var(--line);
    border-radius: var(--r-1);
    background: var(--track) border-box;
    box-shadow: var(--sunken);
    cursor: inherit;
  }
  .check > input[type="radio"] { border-radius: 50%; }
  .check > input:checked {
    border-color: var(--peach-pale);
    background: var(--glyph-check-on-warm) center / 78% no-repeat, var(--warm) border-box;
    box-shadow: none;
  }
  .check > input[type="radio"]:checked {
    background: radial-gradient(circle, var(--on-warm) 0 30%, rgb(26 24 77 / 0) 34%), var(--warm) border-box;
  }
  .check:has(> input:disabled) { opacity: .45; cursor: not-allowed; }

  .checklist > li + li { border-block-start: 1px solid var(--line-soft); }
  .checklist .check { display: flex; padding-block: var(--s-1); }

  /* Range slider.
     The input is the track. Firefox fills it with ::-moz-range-progress. WebKit and Chromium have no
     such part, so the input carries the warm gradient and the thumb paints the unfilled track to its
     right (half inside the thumb's own background, the rest as a border-image outset). The fill
     therefore follows the thumb while it is dragged. A clip-path keeps that paint inside the pill.   */
  .range {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    min-block-size: 2.75rem;
    border-radius: var(--r-pill);
    color: var(--accent);
  }
  .range > .icon { flex: none; inline-size: 1.5rem; }
  .range:has(> input:focus-visible) { outline: .1875rem solid var(--focus); outline-offset: .25rem; }

  input[type="range"] {
    --range-h: 1.25rem;                                     /* track thickness */
    --thumb: 2.75rem;                                       /* hit area; the knob is drawn 2rem wide inside it */
    --range-over: calc((var(--thumb) - var(--range-h)) / 2);
    --knob-ring: transparent;
    --knob-art:
      radial-gradient(circle closest-side, transparent 82%, var(--knob-ring) 85%, var(--knob-ring) 96%, transparent 99%),
      radial-gradient(circle closest-side, var(--knob-core), var(--knob-face) 36%, var(--knob-face) 70%, var(--knob-glow) 74%, transparent 96%);
    -webkit-appearance: none;
    appearance: none;
    direction: ltr;                                         /* the fill is drawn physically, so the slider always runs left to right */
    display: block;
    flex: 1 1 auto;
    inline-size: 100%;
    min-inline-size: 0;
    block-size: var(--range-h);
    margin: var(--range-over) 0;
    padding: 0;
    border: 0;
    border-radius: var(--r-pill);
    background: var(--track);
    cursor: pointer;
  }
  input[type="range"]:focus-visible { --knob-ring: var(--focus); outline: none; }   /* the ring is drawn around the knob */
  input[type="range"]:disabled { opacity: .45; cursor: not-allowed; }

  @supports not (-moz-appearance: none) {
    input[type="range"] {
      background: linear-gradient(90deg, var(--peach), var(--rose) 85%) border-box;
      clip-path: polygon(
        0 calc(var(--range-over) * -1),
        100% calc(var(--range-over) * -1),
        100% 0,
        calc(100% - var(--range-h) * .5) 0,
        calc(100% - var(--range-h) * .3706) calc(var(--range-h) * .017),
        calc(100% - var(--range-h) * .25) calc(var(--range-h) * .067),
        calc(100% - var(--range-h) * .1464) calc(var(--range-h) * .1464),
        calc(100% - var(--range-h) * .067) calc(var(--range-h) * .25),
        calc(100% - var(--range-h) * .017) calc(var(--range-h) * .3706),
        100% calc(var(--range-h) * .5),
        calc(100% - var(--range-h) * .017) calc(var(--range-h) * .6294),
        calc(100% - var(--range-h) * .067) calc(var(--range-h) * .75),
        calc(100% - var(--range-h) * .1464) calc(var(--range-h) * .8536),
        calc(100% - var(--range-h) * .25) calc(var(--range-h) * .933),
        calc(100% - var(--range-h) * .3706) calc(var(--range-h) * .983),
        calc(100% - var(--range-h) * .5) 100%,
        100% 100%,
        100% calc(100% + var(--range-over)),
        0 calc(100% + var(--range-over)));
    }
  }
  input[type="range"]::-webkit-slider-runnable-track {
    block-size: var(--range-h);
    border: 0;
    background: none;
  }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    inline-size: var(--thumb);
    block-size: var(--thumb);
    margin-block-start: calc(var(--range-over) * -1);
    border: 0 solid transparent;
    border-radius: 0;
    background:
      var(--knob-art),
      linear-gradient(var(--track), var(--track)) right center / 50% var(--range-h) no-repeat;
    border-image: linear-gradient(var(--track), var(--track)) 0 1 0 0 / var(--range-over) 100vmax var(--range-over) 0 / 0 100vmax 0 0;
  }
  input[type="range"]::-moz-range-track {
    block-size: var(--range-h);
    border: 0;
    border-radius: 999px;
    background: var(--track);
  }
  input[type="range"]::-moz-range-progress {
    block-size: var(--range-h);
    border-radius: 999px;
    background: linear-gradient(90deg, var(--peach), var(--rose));
  }
  input[type="range"]::-moz-range-thumb {
    box-sizing: border-box;
    inline-size: var(--thumb);
    block-size: var(--thumb);
    border: 0;
    border-radius: 50%;
    background: var(--knob-art);
  }

  /* Scale under a slider: evenly spaced captions. */
  .scale {
    display: flex;
    justify-content: space-between;
    margin-block-start: var(--s-1);
    font-size: var(--fs-xs);
    font-variant-numeric: tabular-nums;
  }
  .range + .scale { padding-inline: calc(1.5rem + var(--s-3)); }

  /* ---- Data ---- */

  /* Ring: <progress> is the semantic base and draws the ring; --value mirrors its value attribute. */
  .ring {
    --ring: 7rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    justify-self: center;
    gap: var(--s-2);
    inline-size: var(--ring);
    max-inline-size: 100%;
    text-align: center;
  }
  .ring.sm { --ring: 4.5rem; }
  .ring.lg { --ring: 9rem; }
  .ring > progress {
    -webkit-appearance: none;
    appearance: none;
    grid-area: 1 / 1;
    display: block;
    inline-size: 100%;
    block-size: auto;
    aspect-ratio: 1;
    border: 0;
    border-radius: 50%;
    background: conic-gradient(var(--tone-a), var(--tone-b) calc(var(--value) * 1%), var(--track) 0);
    -webkit-mask: radial-gradient(closest-side, rgb(0 0 0 / 0) calc(78% - 1px), #000 78%);
    mask: radial-gradient(closest-side, rgb(0 0 0 / 0) calc(78% - 1px), #000 78%);
  }
  .ring > progress::-webkit-progress-bar { background: transparent; }
  .ring > progress::-webkit-progress-value { background: transparent; }
  .ring > progress::-moz-progress-bar { background: transparent; }
  .ring > strong {
    grid-area: 1 / 1;
    align-self: center;
    font-size: var(--fs-lg);
    font-variant-numeric: tabular-nums;
    line-height: 1;
  }
  .ring.sm > strong { font-size: var(--fs-sm); }
  .ring.lg > strong { font-size: 1.5rem; }
  .ring > label { font-size: var(--fs-sm); line-height: 1.3; }

  .rings {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: var(--s-4);
  }

  /* Meters: vertical pill bars with a caption above and below the group.
     .meters > p.label, ul > li.meter (label, progress, span value), p.label                          */
  .meters {
    --meter-w: 1.5rem;
    --meter-h: 9rem;
    --pad: var(--s-5);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(var(--meter-h), 1fr) auto auto auto;
    row-gap: var(--s-2);
    text-align: center;
  }
  .meters > .label { grid-column: 1; grid-row: 1; }
  .meters > ul ~ .label { grid-row: 3; }
  .meters > ul {
    grid-column: 1;
    grid-row: 1 / -1;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    grid-template-rows: subgrid;
    column-gap: var(--s-1);
  }
  .meter {
    grid-row: 1 / -1;
    display: grid;
    grid-template-rows: subgrid;
    justify-items: center;
  }
  .meter::before {
    content: "";
    grid-area: 2 / 1;
    inline-size: var(--meter-w);
    border-radius: var(--r-pill);
    background: var(--track);
    box-shadow: var(--sunken);
  }
  .meter > progress {
    -webkit-appearance: none;
    appearance: none;
    grid-area: 2 / 1;
    display: block;
    inline-size: var(--meter-w);
    block-size: 100%;
    border: 0;
    background: linear-gradient(180deg, var(--tone-a), var(--tone-b)) bottom / 100% calc(var(--value) * 1%) no-repeat;
    clip-path: inset(calc(100% - var(--value) * 1%) 0 0 0 round 999px);
  }
  .meter > progress::-webkit-progress-bar { background: transparent; }
  .meter > progress::-webkit-progress-value { background: transparent; }
  .meter > progress::-moz-progress-bar { background: transparent; }
  .meter > label { grid-row: 4; margin-block-start: var(--s-1); font-size: var(--fs-xs); line-height: 1.3; }
  .meter > span { grid-row: 5; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }

  /* Bar: horizontal progress, drawn with the engines' own parts. */
  progress.bar {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    inline-size: 100%;
    block-size: .875rem;
    border: 0;
    border-radius: 999px;
    background: var(--track);
    box-shadow: var(--sunken);
    overflow: hidden;
  }
  progress.bar::-webkit-progress-bar { border-radius: 999px; background: var(--track); box-shadow: var(--sunken); }
  progress.bar::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, var(--tone-a), var(--tone-b)); }
  progress.bar::-moz-progress-bar { border-radius: 999px; background: linear-gradient(90deg, var(--tone-a), var(--tone-b)); }

  /* Stat: caption, big number, note. */
  .stat { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--s-1); }
  .stat > strong {
    font-size: var(--fs-stat);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.01em;
    line-height: 1.1;
  }

  /* Legend: tone dots with names. */
  .legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: var(--fs-sm); }
  .legend > li { display: inline-flex; align-items: center; gap: var(--s-2); }
  .legend > li::before {
    content: "";
    flex: none;
    inline-size: .875rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--tone-a), var(--tone-b));
  }

  /* Chart: a figure with an inline SVG plot. Axis captions are HTML so they never scale with the SVG.
     figure.chart > .plot ( ol.y , svg , ol.x ) , figcaption , details (the data table)               */
  .chart {
    container-type: inline-size;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-3);
  }
  .chart > .plot {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--s-3) var(--s-3);
    padding-block-start: var(--s-3);
  }
  .chart > .plot > svg {
    grid-area: 1 / 2;
    inline-size: 100%;
    block-size: clamp(9.5rem, 46cqi, 17rem);
    overflow: visible;
  }
  .chart .y, .chart .x {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--fs-xs);
    font-variant-numeric: tabular-nums;
    line-height: 1;
  }
  .chart .y { grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: space-between; }
  .chart .y > li { display: flex; align-items: center; justify-content: flex-end; block-size: 0; }
  .chart .x { grid-area: 2 / 2; display: flex; justify-content: space-between; }
  .chart .x > li { flex: 1 1 0; text-align: center; }
  .chart .x.ticks { padding-inline-end: 4.667%; }               /* points sit on the ticks, edge to edge */
  .chart .x.ticks > li { flex: 0 0 0; display: flex; justify-content: center; white-space: nowrap; }
  .chart .x span { display: none; }                             /* J, F, M on narrow plots; Jan, Feb, Mar when there is room */
  @container (inline-size >= 24rem) { .chart .x span { display: inline; } }
  .chart > figcaption { color: var(--text-soft); font-size: var(--fs-lg); text-align: center; }

  .chart .axis { fill: none; stroke: #eef0ff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
  .chart > .plot > svg.rules {                                  /* five horizontal rules, one per y caption */
    background: linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px) 0 0 / 100% calc((100% - 1px) / 4);
  }

  /* Gradient stops for inline SVG. Paste the <svg class="defs"> block once per page. */
  .defs { position: absolute; inline-size: 0; block-size: 0; overflow: hidden; }
  .stop-ice { stop-color: #b4fdfc; }
  .stop-azure { stop-color: var(--azure); }
  .stop-azure-fade { stop-color: #6f86d6; stop-opacity: .12; }
  .stop-peach { stop-color: #f6d69e; }
  .stop-coral { stop-color: #dc928f; }
  .stop-plum-fade { stop-color: #54387e; stop-opacity: .3; }
  .stop-tone-a { stop-color: var(--tone-a); }
  .stop-tone-b { stop-color: var(--tone-b); }

  /* ---- Content ---- */

  /* Destination card: illustration, then name, country, one line, facts row, price pill.
     The media and the text sit side by side when the card is wide enough and stack when it is not. */
  .destination {
    display: flex;
    flex-wrap: wrap;
    align-content: start;
    gap: var(--s-4) var(--s-5);
    transition: transform var(--speed);
  }
  .destination > img {
    flex: 1 1 14rem;
    align-self: stretch;
    inline-size: 100%;
    min-inline-size: 0;
    aspect-ratio: 16 / 10;
    border-radius: var(--r-3);
    object-fit: cover;
  }
  .destination > div {
    flex: 1.3 1 14rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: var(--s-2);
    min-inline-size: 0;
  }
  .destination h3 a { color: inherit; text-decoration: none; }
  .destination h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }   /* whole card is the link */
  .destination h3 a:focus-visible { outline: none; }
  .destination:has(h3 a:focus-visible) { outline: .1875rem solid var(--focus); outline-offset: .1875rem; }
  .destination:has(h3 a:hover) { transform: translateY(-.125rem); }

  /* Scene: a destination illustration on its own. */
  .scene {
    inline-size: 100%;
    aspect-ratio: 16 / 10;
    border-radius: var(--r-3);
    box-shadow: var(--raised);
    object-fit: cover;
  }

  /* Hero: a card with full-bleed media on top. */
  .hero { padding: 0; overflow: hidden; }
  .hero > img { inline-size: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
  .hero > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); padding: var(--pad); }
  @container (inline-size >= 48rem) { .hero > img { aspect-ratio: 21 / 8; } }

  /* Review: tile, name and quote, then a footer with a caption and the rating.
     The text sits beside the tile when there is room for it and drops underneath when there is not. */
  .review {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: space-between;
    gap: var(--s-4);
  }
  .review > div {
    flex: 1 1 10rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: var(--s-2);
    min-inline-size: 0;
  }
  .review > footer {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-2) var(--s-4);
    margin-block-start: var(--s-2);
  }

  /* Facts: a definition list. Put the icon inside the dt. */
  .facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: var(--s-5) var(--s-5);
  }
  .facts > div { position: relative; min-block-size: 2.75rem; padding-inline-start: 3.625rem; }
  .facts > div::before {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    inline-size: 2.75rem;
    aspect-ratio: 1;
    border-radius: var(--r-2);
    background: var(--track);
    box-shadow: var(--sunken);
  }
  .facts dt { font-size: var(--fs-sm); line-height: 1.35; }
  .facts dt > .icon {
    position: absolute;
    inset-block-start: .6875rem;
    inset-inline-start: .6875rem;
    inline-size: 1.375rem;
    color: var(--accent);
  }
  .facts dd { color: var(--text); font-weight: 600; line-height: 1.4; }

  /* Timeline: an ordered list of days. li > .tile (the number) + div (heading, date, stops). */
  .timeline > li {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: var(--s-4);
    padding-block-end: var(--s-6);
  }
  .timeline > li:last-child { padding-block-end: 0; }
  .timeline > li::before {
    content: "";
    position: absolute;
    inset-block: 3.5rem .5rem;
    inset-inline-start: calc(1.5rem - .125rem);
    inline-size: .25rem;
    border-radius: 999px;
    background: var(--track);
    box-shadow: var(--sunken);
  }
  .timeline > li:last-child::before { display: none; }
  .timeline > li > div { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--s-2); padding-block-start: var(--s-1); }

  /* Rows: a leading tile, text, then a trailing value or badge that wraps under the text when space is short. */
  .rows > li {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-2) var(--s-4);
    min-block-size: calc(3rem + var(--s-3) * 2);
    padding-block: var(--s-3);
    border-block-end: 1px solid var(--line-soft);
  }
  .rows > li:has(> .tile) { padding-inline-start: calc(3rem + var(--s-4)); }
  .rows > li > .tile { position: absolute; inset-block-start: var(--s-3); inset-inline-start: 0; }
  .rows > li:first-child { min-block-size: calc(3rem + var(--s-3)); padding-block-start: 0; }
  .rows > li:first-child > .tile { inset-block-start: 0; }
  .rows > li:last-child { min-block-size: calc(3rem + var(--s-3)); padding-block-end: 0; border-block-end: 0; }
  .rows > li > div { flex: 1 1 10rem; display: grid; grid-template-columns: minmax(0, 1fr); min-inline-size: 0; line-height: 1.4; }

  /* Breadcrumb. */
  .breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 var(--s-2);
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--fs-sm);
  }
  .breadcrumb li { display: inline-flex; align-items: center; gap: var(--s-2); min-block-size: 2.75rem; margin: 0; }
  .breadcrumb li + li::before {
    content: "";
    flex: none;
    inline-size: 1rem;
    aspect-ratio: 1;
    background: var(--accent);
    -webkit-mask: var(--glyph-chevron-right) center / contain no-repeat;
    mask: var(--glyph-chevron-right) center / contain no-repeat;
  }
  .breadcrumb li:dir(rtl)::before { transform: scaleX(-1); }
  .breadcrumb a { display: inline-flex; align-items: center; min-block-size: 2.75rem; color: var(--text-soft); }
  .breadcrumb [aria-current="page"] { color: var(--text); font-weight: 600; text-decoration: none; }

  /* Tabs: in-page section links in a well. The current one is raised. */
  .tabs ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-1);
    margin: 0;
    padding: var(--s-1);
    list-style: none;
    border: 1px solid transparent;
    border-radius: var(--r-3);
    background: var(--track);
    box-shadow: var(--sunken);
  }
  .tabs li { flex: 1 1 auto; margin: 0; }
  .tabs a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-block-size: 2.75rem;
    padding: var(--s-1) var(--s-4);
    border: 1px solid transparent;
    border-radius: var(--r-2);
    color: var(--text-soft);
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
  }
  .tabs a:hover { color: var(--text); box-shadow: inset 0 0 0 100vmax rgb(255 255 255 / .07); }
  .tabs a[aria-current]:not([aria-current="false"]) {
    background: var(--key) border-box;
    box-shadow: var(--edge), inset 0 -.1875rem 0 var(--peach), 0 .125rem .5rem rgb(6 6 26 / .55);
    color: var(--text);
    font-weight: 600;
  }

  /* Details: every <details> is an accordion row in a well. */
  details {
    border: 1px solid transparent;
    border-radius: var(--r-3);
    background: var(--track);
    box-shadow: var(--sunken);
  }
  summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    min-block-size: 3rem;
    padding: var(--s-2) 1.125rem;
    border-radius: var(--r-3);
    color: var(--text);
    font-weight: 600;
    line-height: 1.3;
    list-style: none;
    cursor: pointer;
  }
  summary::-webkit-details-marker { display: none; }
  summary::after {
    content: "";
    flex: none;
    inline-size: 1.25rem;
    aspect-ratio: 1;
    background: var(--accent);
    -webkit-mask: var(--glyph-chevron-down) center / contain no-repeat;
    mask: var(--glyph-chevron-down) center / contain no-repeat;
    transition: transform var(--speed);
  }
  details[open] > summary::after { transform: rotate(180deg); }
  details > :not(summary) { margin: 0 1.125rem 1.125rem; }
  details + details { margin-block-start: var(--s-2); }

  /* Tables. Wrap wide ones in .table-wrap (tabindex="0", role="region", an aria-label) so they scroll inside. */
  .table-wrap { overflow-x: auto; border-radius: var(--r-1); }
  table { inline-size: 100%; font-variant-numeric: tabular-nums; line-height: 1.4; }
  caption { padding-block-end: var(--s-2); color: var(--text); font-weight: 600; text-align: start; }
  th, td {
    padding: .625rem var(--s-3);
    border-block-end: 1px solid var(--line-soft);
    text-align: start;
    vertical-align: baseline;
  }
  thead th { color: var(--text-soft); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }
  tbody th { color: var(--text); font-weight: 500; }
  tbody tr:last-child > * { border-block-end: 0; }
  :is(th, td).num { text-align: end; }
  :is(th, td):first-child { padding-inline-start: 0; }
  :is(th, td):last-child { padding-inline-end: 0; }
}

/* ---------- icons -------------------------------------------------------- */
/* Mask icons: <span class="icon icon-plane" aria-hidden="true"></span>, always next to real text.
   24 x 24, 2px round strokes; a few glyphs are solid, as in the reference. Colour follows the text colour.
   This layer is declared before components (see the @layer line at the top), so a component can
   resize or recolour the icons it holds without a specificity fight. */

@layer icons {
  .icon {
    display: inline-block;
    flex: none;
    inline-size: 1.5em;
    aspect-ratio: 1;
    vertical-align: -.35em;
    background: currentColor;
    -webkit-mask: var(--icon, none) center / contain no-repeat;
    mask: var(--icon, none) center / contain no-repeat;
  }
  .icon.sm { inline-size: 1.125em; vertical-align: -.2em; }
  .icon.lg { inline-size: 2em; }

  .icon-home { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10.5 12 4l8 6.5V19a1 1 0 0 1-1 1h-4.5v-5.5h-5V20H5a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
  .icon-compass { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z'/%3E%3Cpath d='m15.6 8.4-2.1 5.1-5.1 2.1 2.1-5.1z'/%3E%3C/svg%3E"); }
  .icon-suitcase { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8h14a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2z'/%3E%3Cpath d='M9 8V6a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2M8 12v4M16 12v4'/%3E%3C/svg%3E"); }
  .icon-user { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8z'/%3E%3Cpath d='M4.5 20a7.5 7.5 0 0 1 15 0'/%3E%3C/svg%3E"); }
  .icon-person { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='7.5' r='4.25' fill='%23000'/%3E%3Cpath d='M4 20.5v-1.5a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1.5a.5.5 0 0 1-.5.5h-15a.5.5 0 0 1-.5-.5z' fill='%23000'/%3E%3C/svg%3E"); }
  .icon-sign-in { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-4M4 12h10M10.5 8l4 4-4 4'/%3E%3C/svg%3E"); }
  .icon-search { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM20 20l-4-4'/%3E%3C/svg%3E"); }
  .icon-menu { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E"); }
  .icon-more { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='5' cy='12' r='2' fill='%23000'/%3E%3Ccircle cx='12' cy='12' r='2' fill='%23000'/%3E%3Ccircle cx='19' cy='12' r='2' fill='%23000'/%3E%3C/svg%3E"); }
  .icon-plus { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
  .icon-minus { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E"); }
  .icon-x { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E"); }
  .icon-check { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
  .icon-return { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6h6a4 4 0 0 1 0 8H4M8 10l-4 4 4 4'/%3E%3C/svg%3E"); }
  .icon-chevron-left { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E"); }
  .icon-chevron-right { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E"); }
  .icon-chevron-down { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E"); }
  .icon-filter { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16l-6.2 7.4V18l-3.6 1.5v-7.1z'/%3E%3C/svg%3E"); }
  .icon-info { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 11v5.5M12 7.75h.01'/%3E%3C/svg%3E"); }
  .icon-plane { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg transform='rotate%2845 12 12%29'%3E%3Cpath d='M12 2.2c1 0 1.7 1.3 1.7 3v4l7.3 4.4v2l-7.3-2.1v3.8l2.3 1.7v1.6L12 19.5l-4 1.1V19l2.3-1.7v-3.8L3 15.6v-2l7.3-4.4v-4c0-1.7.7-3 1.7-3z' fill='%23000' stroke='%23000' stroke-width='1' stroke-linejoin='round'/%3E%3C/g%3E%3C/svg%3E"); }
  .icon-bed { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6v13M3 15h18M21 19v-4a4 4 0 0 0-4-4h-6v4'/%3E%3Ccircle cx='7' cy='11' r='1.75' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E"); }
  .icon-utensils { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 3v4.5a2.5 2.5 0 0 0 5 0V3M7 3v18M17 21V3c-1.7.7-3 2.6-3 5.2V13h3'/%3E%3C/svg%3E"); }
  .icon-camera { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l1.5-2.5h7L17 8h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1z'/%3E%3Ccircle cx='12' cy='13.25' r='3.25' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E"); }
  .icon-train { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3.5h10A2.5 2.5 0 0 1 19.5 6v8.5A2.5 2.5 0 0 1 17 17H7a2.5 2.5 0 0 1-2.5-2.5V6A2.5 2.5 0 0 1 7 3.5zM4.5 10.5h15M8.5 17l-2 3.5M15.5 17l2 3.5M8.5 13.75h.01M15.5 13.75h.01'/%3E%3C/svg%3E"); }
  .icon-pin { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s7-6.1 7-11.5a7 7 0 1 0-14 0C5 14.9 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E"); }
  .icon-globe { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM3 12h18M12 3c2.5 2.6 3.7 5.6 3.7 9s-1.2 6.4-3.7 9c-2.5-2.6-3.7-5.6-3.7-9S9.5 5.6 12 3z'/%3E%3C/svg%3E"); }
  .icon-calendar { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 6h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2zM3 11h18M8 3.5v4M16 3.5v4'/%3E%3C/svg%3E"); }
  .icon-clock { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7.5V12l3 2'/%3E%3C/svg%3E"); }
  .icon-wallet { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7.5A2.5 2.5 0 0 1 6.5 5H17v3M4 7.5V17a2 2 0 0 0 2 2h13a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1H6.5A2.5 2.5 0 0 1 4 7.5zM16 13.5h.01'/%3E%3C/svg%3E"); }
  .icon-ticket { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16a1 1 0 0 1 1 1v2.2a2 2 0 0 0 0 3.6V16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-2.2a2 2 0 0 0 0-3.6V8a1 1 0 0 1 1-1zM14 7.5V9M14 11.25v1.5M14 15v1.5'/%3E%3C/svg%3E"); }
  .icon-chat { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5h14a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-6.5L8 20.5V17H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z'/%3E%3C/svg%3E"); }
  .icon-plug { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 3v5M15 3v5M6.5 8h11v3.5a5.5 5.5 0 0 1-11 0zM12 17v4'/%3E%3C/svg%3E"); }
  .icon-sun { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4'/%3E%3C/svg%3E"); }
  .icon-cloud-rain { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 15.5a4 4 0 0 1-.6-7.95 5.5 5.5 0 0 1 10.7 1.2A3.4 3.4 0 0 1 17 15.5zM8 18.75v2M12 18.75v2M16 18.75v2'/%3E%3C/svg%3E"); }
  .icon-thermometer { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13.5V5a2 2 0 0 1 4 0v8.5a4 4 0 1 1-4 0zM12 9v7.5'/%3E%3C/svg%3E"); }
  .icon-star { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.2l2.65 5.4 5.95.85-4.3 4.2 1 5.95L12 16.8l-5.3 2.8 1-5.95-4.3-4.2 5.95-.85z' fill='%23000' stroke='%23000' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  .icon-heart { --icon: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20s-7.5-4.6-7.5-10A4.25 4.25 0 0 1 12 7.25 4.25 4.25 0 0 1 19.5 10c0 5.4-7.5 10-7.5 10z'/%3E%3C/svg%3E"); }
}

/* ---------- utilities ---------------------------------------------------- */

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

  .lead { font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); line-height: 1.55; }
  .small { font-size: var(--fs-sm); line-height: 1.5; }
  .num { font-variant-numeric: tabular-nums; }
  .center { text-align: center; }

  .span-all { grid-column: 1 / -1; }
  .middle { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; }
}

/* ---------- preferences -------------------------------------------------- */

@layer preferences {
  @media (prefers-reduced-motion: reduce) {
    :root { --speed: 0s; }
  }

  /* Forced colours: gradients and shadows go, real borders and system colours take over. */
  @media (forced-colors: active) {
    :root {
      --panel: none; --key: none; --field: none; --warm: none; --warm-x: none;
      --peach: Highlight; --coral: Highlight; --rose: Highlight;
      --lilac: Highlight; --violet: Highlight; --ice: Highlight; --azure: Highlight;
      --track: GrayText;
      --knob-core: CanvasText; --knob-face: CanvasText; --knob-glow: transparent;
      --focus: Highlight;
    }
    body::before { display: none; }

    /* Anything drawn with background: currentColor needs its colour back. */
    .icon,
    .chip:has(> input:checked)::before,
    .field:has(> select)::after,
    .breadcrumb li + li::before,
    summary::after { forced-color-adjust: none; background-color: CanvasText; }
    a .icon { background-color: LinkText; }
    button .icon { background-color: ButtonText; }

    .tile { background-image: none; }
    .ring > progress { forced-color-adjust: none; background: conic-gradient(Highlight calc(var(--value) * 1%), GrayText 0); }
    .meter::before, progress.bar { border: 1px solid CanvasText; }
    .timeline > li::before { border-inline-start: .125rem solid GrayText; }
    .chart .axis { stroke: CanvasText; }

    /* Native checkboxes and radios. */
    .check > input { -webkit-appearance: auto; appearance: auto; inline-size: 1.25rem; block-size: 1.25rem; background: none; }

    /* Selected and current states get a thick system-colour border. */
    .chip:has(> input:checked),
    .btn[aria-pressed="true"],
    .btn[aria-current]:not([aria-current="false"]),
    .tabs a[aria-current]:not([aria-current="false"]),
    .nav a[aria-current="page"]::before { border: .1875rem solid Highlight; }
  }
}
