@font-face { font-family: 'Archivo'; src: url('archivo-e3a28ead.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
/*
 * Design tokens (ADR 0003, decision 3, as amended for the approved design),
 * the single source: no build step.
 *
 * Two layers, all prefixed --ui- so they never meet an app's own properties:
 * - primitives: the palette of concept A ("the recording"), named by colour;
 * - semantic tokens, the only ones components and apps use.
 * Themes switch only the semantic layer. `theme.js` sets <html data-theme>
 * before first paint; without JS, the media query below follows the system.
 *
 * The --ui-part-* colours always mean the same part of the system: the main
 * thread and host, the bus, an isolate on its own worker, a pool. --ui-rule is
 * for decorative rules and grid lines; --ui-border is for the edges of
 * controls and holds 3:1 (decision 8).
 *
 * contrast.test.ts checks every declared pair against WCAG AA in both themes,
 * and that the two dark blocks match. Hex equivalents are in ADR 0003.
 */

:root {
  /* neutrals, light to dark */
  --ui-white: oklch(1 0 0);
  --ui-paper: oklch(0.976 0.003 264.5); /* #f6f7f9 */
  --ui-mist: oklch(0.943 0.01 267.4); /* #e9ecf3 */
  --ui-haze: oklch(0.887 0.012 259.8); /* #d5dae2 */
  --ui-slate-1: oklch(0.763 0.026 265.5); /* #aab2c3 */
  --ui-slate-2: oklch(0.711 0.025 264.4); /* #9aa2b2 */
  --ui-slate-3: oklch(0.619 0.026 264.4); /* #7e8696 */
  --ui-slate-4: oklch(0.572 0.047 264.1); /* #6a7894 */
  --ui-slate-5: oklch(0.502 0.024 264.3); /* #5d6472 */
  --ui-slate-6: oklch(0.434 0.026 265.5); /* #4a5160 */
  --ui-navy-1: oklch(0.373 0.048 265.1); /* #34405a */
  --ui-navy-2: oklch(0.262 0.035 267.6); /* #1d2436 */
  --ui-navy-3: oklch(0.229 0.032 268); /* #161c2c */
  --ui-navy-4: oklch(0.186 0.034 269.8); /* #0d1222 */
  --ui-ink: oklch(0.201 0.012 270.7); /* #14161c */
  /* the dark theme's neutral greys (2026-11-21): less blue than the navy */
  --ui-graphite-1: oklch(0.57 0.022 266); /* #717785 */
  --ui-graphite-2: oklch(0.345 0.022 268); /* #343945 */
  --ui-graphite-3: oklch(0.256 0.021 269); /* #1f232d */
  --ui-graphite-4: oklch(0.223 0.022 269); /* #171b26 */
  /* running text, a step softer than the headings in each theme */
  --ui-fog: oklch(0.85 0.016 267); /* #c9ced9 */
  --ui-ink-soft: oklch(0.3 0.02 267); /* #292e38 */

  /* hues, each a light-theme and a dark-theme step */
  --ui-blue-1: oklch(0.501 0.187 265.6); /* #2f57cc */
  --ui-blue-2: oklch(0.739 0.134 270.2); /* #8aa5ff */
  --ui-teal-1: oklch(0.512 0.086 207.7); /* #0b7480 */
  --ui-teal-2: oklch(0.764 0.108 205.1); /* #4cc6d3 */
  --ui-violet-1: oklch(0.507 0.184 293.6); /* #6e46c2 */
  --ui-violet-2: oklch(0.747 0.132 297.6); /* #b79af6 */
  --ui-magenta-1: oklch(0.503 0.163 355.4); /* #a62f68 */
  --ui-magenta-2: oklch(0.741 0.121 351.3); /* #e58ab4 */
  --ui-red-1: oklch(0.501 0.178 28.7); /* #b3261e */
  --ui-red-2: oklch(0.768 0.137 25.6); /* #ff8f86 */
  --ui-orange-1: oklch(0.56 0.15 50); /* #b75400 */
  --ui-orange-2: oklch(0.8 0.13 62); /* #f9aa60 */
  --ui-green-1: oklch(0.52 0.13 150); /* #23793f */
  --ui-green-2: oklch(0.79 0.15 150); /* #6fcf87 */

  --ui-space-1: 0.25rem;
  --ui-space-2: 0.5rem;
  --ui-space-3: 0.75rem;
  --ui-space-4: 1rem;
  --ui-space-5: 1.5rem;
  --ui-space-6: 2rem;
  --ui-space-7: 3rem;
  --ui-space-8: 5rem;

  --ui-radius-s: 0.25rem;
  --ui-radius-m: 0.4rem;
  --ui-radius-l: 0.6rem;

  /* Archivo, self-hosted; ui/vite adds its @font-face on the site's pages only. */
  --ui-font-sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ui-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  /* A 1.25 scale from 1.0625rem; the largest steps scale with the viewport. */
  --ui-text-xs: 0.8rem;
  --ui-text-s: 0.9rem;
  --ui-text-m: 1.0625rem;
  --ui-text-l: 1.25rem;
  --ui-text-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.563rem);
  --ui-text-2xl: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  --ui-text-3xl: clamp(2.4rem, 1.4rem + 4.2vw, 4.6rem);

  /* The page column; the site's one left column (the gutter: section headings,
     the opening's mark, the rails, the docs' sidebar) and the gap after it, so
     every page's content starts at the same x; a figure's label column; the
     sticky header's height. */
  --ui-page: 96rem;
  --ui-gutter: 16rem;
  --ui-gutter-gap: 3rem;
  --ui-label: 13rem;
  --ui-bar-h: 4.75rem;
}

/* Between the full page and the mobile layout the left column steps down, so
   the text beside it keeps its width; the 760px block below overrides these. */
@media (max-width: 1280px) {
  :root {
    --ui-gutter: 13rem;
    --ui-gutter-gap: 2.5rem;
  }
}
@media (max-width: 1100px) {
  :root {
    --ui-gutter: 10.5rem;
    --ui-gutter-gap: 2rem;
  }
}
@media (max-width: 900px) {
  :root {
    --ui-gutter: 8rem;
    --ui-gutter-gap: 1rem;
  }
}

@media (max-width: 760px) {
  :root {
    --ui-gutter: 7.5rem;
    --ui-gutter-gap: 0rem;
    --ui-label: 7.5rem;
    --ui-bar-h: 5.7rem;
  }
}

/* light */
:root,
[data-theme='light'] {
  color-scheme: light;
  --ui-bg: var(--ui-paper);
  --ui-surface: var(--ui-white);
  --ui-text: var(--ui-ink);
  --ui-prose: var(--ui-ink-soft);
  --ui-text-muted: var(--ui-slate-6);
  --ui-rule: var(--ui-haze);
  --ui-border: var(--ui-slate-3);
  --ui-accent: var(--ui-blue-1);
  --ui-on-accent: var(--ui-white);
  --ui-focus: var(--ui-blue-1);
  --ui-part-host: var(--ui-slate-5);
  --ui-part-bus: var(--ui-magenta-1);
  --ui-part-isolate: var(--ui-teal-1);
  --ui-part-pool: var(--ui-violet-1);
  --ui-bad: var(--ui-red-1);
  --ui-experimental: var(--ui-orange-1);
  /* A chart's "worse" bar (PairedBars): a cost, not an error, so not --ui-bad. */
  --ui-worse: var(--ui-orange-1);
  --ui-released: var(--ui-green-1);
}

/* dark */
[data-theme='dark'] {
  color-scheme: dark;
  --ui-bg: var(--ui-graphite-4);
  --ui-surface: var(--ui-graphite-3);
  --ui-text: var(--ui-mist);
  --ui-prose: var(--ui-fog);
  --ui-text-muted: var(--ui-slate-1);
  --ui-rule: var(--ui-graphite-2);
  --ui-border: var(--ui-graphite-1);
  --ui-accent: var(--ui-blue-2);
  --ui-on-accent: var(--ui-navy-4);
  --ui-focus: var(--ui-blue-2);
  --ui-part-host: var(--ui-slate-2);
  --ui-part-bus: var(--ui-magenta-2);
  --ui-part-isolate: var(--ui-teal-2);
  --ui-part-pool: var(--ui-violet-2);
  --ui-bad: var(--ui-red-2);
  --ui-experimental: var(--ui-orange-2);
  --ui-worse: var(--ui-orange-2);
  --ui-released: var(--ui-green-2);
}

/* dark, without JS: the same block as above (contrast.test.ts checks they match) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ui-bg: var(--ui-graphite-4);
    --ui-surface: var(--ui-graphite-3);
    --ui-text: var(--ui-mist);
    --ui-prose: var(--ui-fog);
    --ui-text-muted: var(--ui-slate-1);
    --ui-rule: var(--ui-graphite-2);
    --ui-border: var(--ui-graphite-1);
    --ui-accent: var(--ui-blue-2);
    --ui-on-accent: var(--ui-navy-4);
    --ui-focus: var(--ui-blue-2);
    --ui-part-host: var(--ui-slate-2);
    --ui-part-bus: var(--ui-magenta-2);
    --ui-part-isolate: var(--ui-teal-2);
    --ui-part-pool: var(--ui-violet-2);
    --ui-bad: var(--ui-red-2);
    --ui-experimental: var(--ui-orange-2);
    --ui-worse: var(--ui-orange-2);
    --ui-released: var(--ui-green-2);
  }
}

/*
 * Element rules for pages that are the site's own (the site, the hub, basic):
 * ui({ header }) adds this file; ui({ bar }) doesn't, so a dashboard keeps
 * its own body and link styles. In @layer ui, like shell.css.
 *
 * Type is one family, Archivo, used across its width axis (ADR 0003, as
 * amended): the headline at 68% and weight 820, section headings at 80%,
 * labels at 87% (in shell.css), body text at 100%.
 */
@layer ui {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    scroll-padding-top: calc(var(--ui-bar-h) + 0.75rem);
  }

  body {
    margin: 0;
    background: var(--ui-bg);
    color: var(--ui-text);
    font: 400 var(--ui-text-m) / 1.55 var(--ui-font-sans);
    font-stretch: 100%;
  }

  h1 {
    margin: 0;
    max-width: 22ch;
    font-size: var(--ui-text-3xl);
    font-weight: 820;
    font-stretch: 68%;
    line-height: 0.95;
    letter-spacing: -0.012em;
    text-wrap: balance;
  }

  h2 {
    font-size: 1.15rem;
    font-weight: 700;
    font-stretch: 80%;
    line-height: 1.25;
  }

  h3 {
    font-stretch: 87%;
  }

  a {
    color: var(--ui-accent);
    text-underline-offset: 0.18em;
  }
  a:hover {
    text-decoration-thickness: 2px;
  }

  :focus-visible {
    outline: 3px solid var(--ui-focus);
    outline-offset: 2px;
  }

  code,
  pre,
  .ui-code {
    font-family: var(--ui-font-mono);
    font-size: 0.92rem;
  }
  /* Code inside prose: a chip, so it reads apart from the words around it.
     Code blocks (pre) keep their own frame. */
  :not(pre) > code {
    padding: 0.05em 0.35em;
    border: 1px solid var(--ui-rule);
    border-radius: 0.3rem;
    background: color-mix(in oklch, var(--ui-text) 7%, transparent);
    font-size: 0.86em;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
  }

  [data-embed] body {
    background: transparent;
  }

  @media (max-width: 760px) {
    h2 {
      font-size: 1.35rem;
    }
  }
}

/*
 * The shell (ADR 0003, decision 6, as amended for the approved design): the
 * ui- classes, all in @layer ui, so an app's own unlayered CSS always wins
 * without specificity fights. Colours, spacing and type come only from the
 * semantic tokens (tokens.css). Rules on plain elements (body, headings,
 * links, focus) are in base.css, which only pages with the full header get,
 * so the dashboards' bar adds no global styles.
 *
 * The layout is a gutter of labels: section headings sit in a left column and
 * stay in view as their section scrolls past, the way the recording's tracks
 * hold their names. No card grids, eyebrow labels or numbered markers.
 * Archivo's width axis carries the hierarchy: 68% headline, 80% section
 * headings, 87% labels, 100% body.
 */
@layer ui {
  .ui-shell {
    max-width: var(--ui-page);
    margin: 0 auto;
    padding: 0 var(--ui-space-5);
  }

  /* The full header: sticky, full width, contents aligned with the page column. */
  .ui-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ui-space-2) var(--ui-space-6);
    padding-block: 1.1rem;
    padding-inline: max(var(--ui-space-5), calc((100% - var(--ui-page)) / 2 + var(--ui-space-5)));
    background: var(--ui-bg);
    border-bottom: 1px solid var(--ui-rule);
  }
  .ui-wordmark {
    display: inline-flex;
    align-items: center;
    color: var(--ui-text);
    font-size: 1.6rem;
    font-weight: 800;
    font-stretch: 75%;
    letter-spacing: -0.01em;
    text-decoration: none;
  }
  .ui-wordmark {
    gap: 0.5rem;
    font-weight: 820;
    font-stretch: 68%;
  }
  .ui-mark {
    display: block;
    width: 1.9rem;
    height: 1.9rem;
  }
  /* The mark for the theme: light by default, dark when the page is. */
  .ui-mark[data-for='dark'],
  [data-theme='dark'] .ui-mark[data-for='light'] {
    display: none;
  }
  [data-theme='dark'] .ui-mark[data-for='dark'] {
    display: block;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .ui-mark[data-for='light'] {
      display: none;
    }
    :root:not([data-theme]) .ui-mark[data-for='dark'] {
      display: block;
    }
  }
  .ui-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ui-space-2) 1.4rem;
    font-stretch: 87%;
    font-weight: 500;
  }
  .ui-nav a {
    color: var(--ui-text);
    text-decoration: none;
  }
  .ui-nav a:hover,
  .ui-nav a[aria-current='page'] {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.3em;
  }

  /* The far end of the header: links that aren't pages of the site, and the theme switch. */
  .ui-header-end {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin-left: auto;
  }
  /* The library version the site is built from: a quiet pill that opens the changelog. */
  /* Centred optically: equal padding on a line box of 1, the text box
     trimmed to the cap height and baseline where the engine supports it. */
  .ui-version {
    display: inline-flex;
    align-items: center;
    padding: 0.3em 0.65em;
    text-box: trim-both cap alphabetic;
    border: 1px solid var(--ui-border);
    border-radius: 999px;
    color: var(--ui-text-muted);
    font-size: 0.8rem;
    font-stretch: 87%;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
  }
  /* A release, not a preview: the outline in the released green. */
  .ui-version[data-release='stable'] {
    border-color: var(--ui-released);
  }
  .ui-version:hover {
    color: var(--ui-text);
    border-color: var(--ui-text);
  }
  .ui-github {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--ui-text);
    font-stretch: 87%;
    font-weight: 500;
    text-decoration: none;
  }
  .ui-github:hover span {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.3em;
  }
  .ui-github svg {
    display: block;
  }

  /* The theme switch: a sun and a moon, and a knob behind the active one. */
  .ui-toggle {
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 3.75rem;
    height: 2rem;
    padding: 0 0.5rem;
    background: var(--ui-surface);
    color: var(--ui-text-muted);
    border: 1px solid var(--ui-border);
    border-radius: 999px;
    cursor: pointer;
  }
  .ui-toggle[hidden] {
    display: none;
  }
  .ui-toggle svg {
    position: relative;
    z-index: 1;
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: color 0.2s;
  }
  /* Centred on the icon it sits behind: the icons are 1rem, 0.5rem in from
     the padding edge, so a 1.5rem knob starts 0.25rem in and moves by the
     distance between the two icons' centres (the inner width, which the 1px
     border takes from, less the padding and one icon). */
  .ui-toggle-knob {
    position: absolute;
    top: calc(50% - 0.75rem);
    left: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--ui-text);
    transition: transform 0.2s ease;
  }
  .ui-toggle[aria-checked='true'] .ui-toggle-knob {
    transform: translateX(calc(3.75rem - 2px - 2rem));
  }
  .ui-toggle[aria-checked='false'] .ui-toggle-sun,
  .ui-toggle[aria-checked='true'] .ui-toggle-moon {
    color: var(--ui-bg);
  }

  /* The thin bar on the dashboards, fixed dark by its own data-theme. Unchanged. */
  .ui-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ui-space-4);
    padding: var(--ui-space-1) var(--ui-space-4);
    background: var(--ui-bg);
    color: var(--ui-text);
    font:
      var(--ui-text-s) / 1.5 system-ui,
      sans-serif;
    border-bottom: 1px solid var(--ui-rule);
  }
  .ui-bar a {
    color: var(--ui-text);
  }

  /* The Devtools switch (shared/devtools-switch.ts, and the examples hub's
     frames): a checkbox, its label and the compact experimental mark. On the
     dashboards' bar it sits at the far end. */
  .ui-devtools-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--ui-text-muted);
    font-size: var(--ui-text-s);
    cursor: pointer;
    white-space: nowrap;
  }
  .ui-devtools-switch input {
    margin: 0;
    accent-color: var(--ui-accent);
  }
  .ui-devtools-switch[hidden] {
    display: none;
  }
  .ui-bar .ui-devtools-switch {
    margin-left: auto;
    color: var(--ui-text);
  }

  /* Its rule spans the content column, as the sections' rules do (the page's
     width less its side padding); the links are centred under it. */
  .ui-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--ui-space-2) var(--ui-space-5);
    width: min(calc(100% - 2 * var(--ui-space-5)), calc(var(--ui-page) - 2 * var(--ui-space-5)));
    margin: 6rem auto 0;
    padding: var(--ui-space-5) 0;
    color: var(--ui-text-muted);
    font-size: var(--ui-text-s);
    font-stretch: 87%;
    text-align: center;
    border-top: 1px solid var(--ui-rule);
  }
  .ui-footer a {
    color: var(--ui-text-muted);
  }

  /* The page's opening: the headline across, the text in the body column. */
  .ui-intro {
    display: grid;
    grid-template-columns: var(--ui-gutter) minmax(0, 1fr);
    column-gap: var(--ui-gutter-gap);
    row-gap: 1.25rem;
    margin-top: 2.5rem;
  }
  .ui-intro h1 {
    grid-column: 1 / -1;
  }
  .ui-intro > :not(h1) {
    grid-column: 2;
    max-width: 44rem;
  }

  /* A section: its heading in the gutter, sticky below the header. */
  .ui-gutter {
    display: grid;
    grid-template-columns: var(--ui-gutter) minmax(0, 1fr);
    column-gap: var(--ui-gutter-gap);
    margin-top: var(--ui-space-8);
    padding-top: 1.25rem;
    border-top: 1px solid var(--ui-rule);
  }
  .ui-gutter > h2 {
    margin: 0;
    padding-right: var(--ui-space-5);
    align-self: start;
    position: sticky;
    top: calc(var(--ui-bar-h) + 1rem);
  }
  .ui-gutter > h2[data-part] {
    padding-left: 0.75rem;
    border-left: 4px solid var(--part, var(--ui-text));
  }
  .ui-body {
    min-width: 0;
  }
  .ui-body > p,
  .ui-body > ul,
  .ui-body > ol,
  .ui-body > dl {
    max-width: 44rem;
  }
  .ui-body > :first-child {
    margin-top: 0;
  }

  [data-part='host'] {
    --part: var(--ui-part-host);
  }
  [data-part='bus'] {
    --part: var(--ui-part-bus);
  }
  [data-part='isolate'] {
    --part: var(--ui-part-isolate);
  }
  [data-part='pool'] {
    --part: var(--ui-part-pool);
  }
  [data-part='cost'] {
    --part: var(--ui-text);
  }

  /* Lists with rules: uses, examples. */
  .ui-uses {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 44rem;
  }
  .ui-uses > li {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--ui-rule);
  }
  .ui-uses > li:first-child {
    padding-top: 0;
  }
  .ui-uses b {
    font-weight: 650;
  }

  /* The features strip: one line per feature, a bar in its part's colour. */
  .ui-strip > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    /* A grid, not CSS columns: the rows line up across the two columns, and
       no margin is cut at a column's top. */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(22rem, 100%), 1fr));
    column-gap: 2.5rem;
    border-top: 2px solid var(--ui-text);
  }
  .ui-strip li {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--ui-rule);
  }
  .ui-strip li a {
    display: block;
    flex: 1;
    padding: 0.75rem 0 0.75rem 0.9rem;
    border-left: 4px solid var(--part, var(--ui-text));
    color: var(--ui-text);
    text-decoration: none;
  }
  .ui-strip li a:hover b {
    text-decoration: underline;
  }
  .ui-strip b {
    font-weight: 700;
    font-stretch: 87%;
  }
  /* The item's line starts below its name (and pill), on every item. */
  .ui-strip-line {
    display: block;
    margin-top: 0.3rem;
  }
  /* A status mark next to a name: an outlined pill, e.g. "Experimental". */
  /* Centred optically, as the version pill: equal padding on a line box of 1,
     the text box trimmed to the cap height and baseline where supported. */
  .ui-pill {
    display: inline-flex;
    align-items: center;
    margin-left: 0.2em;
    padding: 0.32em 0.6em;
    text-box: trim-both cap alphabetic;
    border: 1px solid var(--ui-experimental);
    border-radius: 999px;
    color: var(--ui-experimental);
    font-size: 0.72rem;
    font-weight: 650;
    font-stretch: 87%;
    letter-spacing: 0.03em;
    line-height: 1;
    text-transform: uppercase;
    vertical-align: 0.2em;
    white-space: nowrap;
  }
  /* A plain fact rather than a status, e.g. "CLI": the same pill, muted. */
  .ui-pill-neutral {
    border-color: var(--ui-border);
    color: var(--ui-text-muted);
  }
  /* The compact form in navigation lists: a round "!" with a hidden label. */
  .ui-experimental-mark {
    position: relative;
    display: inline-flex;
    flex: none;
    align-items: center;
    color: var(--ui-experimental);
  }
  .ui-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .ui-strip > a {
    display: inline-block;
    margin-top: 1.2rem;
    font-weight: 650;
    font-stretch: 87%;
  }

  /* The recording: track names in the gutter, a canvas beside them. */
  .ui-recording {
    margin: 2.5rem 0 0;
  }
  .ui-try {
    margin: 0 0 1rem;
    color: var(--ui-text-muted);
    max-width: 44rem;
  }
  .ui-panel {
    display: grid;
    grid-template-columns: var(--ui-label) minmax(0, 1fr);
    background: var(--ui-surface);
    border: 1px solid var(--ui-rule);
    border-radius: var(--ui-radius-l);
    overflow: hidden;
  }
  .ui-tracks {
    list-style: none;
    margin: 0;
    padding: 0;
    border-right: 1px solid var(--ui-rule);
  }
  .ui-tracks::after {
    content: '';
    display: block;
    height: 1.75rem;
  }
  .ui-track {
    height: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 1rem;
    border-bottom: 1px solid var(--ui-rule);
    border-left: 4px solid var(--part);
    line-height: 1.15;
  }
  .ui-track[data-rows='2'] {
    height: 5rem;
  }
  .ui-track b {
    font-weight: 650;
    font-stretch: 87%;
  }
  .ui-track span {
    color: var(--ui-text-muted);
    font-size: 0.85rem;
    font-stretch: 87%;
  }
  /* The canvas fills its cell without sizing it: the tracks set the height. */
  .ui-trace-cell {
    position: relative;
    min-height: 10rem;
  }
  .ui-trace {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
  }
  .ui-legend {
    list-style: none;
    margin: 0.9rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 2rem;
    color: var(--ui-text-muted);
    font-size: 0.9rem;
    font-stretch: 87%;
  }
  .ui-legend li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
  }
  .ui-legend li::before {
    content: '';
    flex: none;
    width: 1.6rem;
    height: 0.8rem;
    border-radius: 2px;
  }
  .ui-legend [data-mark='task']::before {
    background: var(--ui-part-isolate);
  }
  .ui-legend [data-mark='stuck']::before {
    background: repeating-linear-gradient(135deg, var(--ui-part-pool) 0 3px, transparent 3px 6px);
    outline: 1px solid var(--ui-part-pool);
  }
  .ui-legend [data-mark='reaction']::before {
    height: 0.6rem;
    width: 0.7rem;
    margin: 0 0.45rem;
    border: 1.5px solid var(--ui-part-pool);
    background: transparent;
  }
  .ui-legend [data-mark='note']::before {
    width: 0;
    margin: 0 0.8rem 0 0;
  }
  .ui-legend [data-mark='restart']::before {
    width: 2px;
    height: 1.1rem;
    background: var(--ui-text);
    margin: 0 0.8rem;
  }
  .ui-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 0.75rem;
    margin-top: 1.25rem;
  }
  .ui-status {
    margin: 0 0 0 0.5rem;
    color: var(--ui-text-muted);
    font-stretch: 87%;
    min-height: 1.55em;
  }

  .ui-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
    align-items: center;
    margin-top: 1.3rem;
  }

  .ui-button[hidden] {
    display: none;
  }
  .ui-button {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    font-stretch: 87%;
    padding: 0.55rem 1rem;
    border-radius: var(--ui-radius-m);
    border: 1px solid var(--ui-text);
    background: transparent;
    color: var(--ui-text);
    text-decoration: none;
    cursor: pointer;
  }
  .ui-button[data-primary] {
    background: var(--ui-accent);
    border-color: var(--ui-accent);
    color: var(--ui-on-accent);
    padding: 0.7rem 1.15rem;
  }
  .ui-button[data-strong] {
    background: var(--ui-text);
    border-color: var(--ui-text);
    color: var(--ui-bg);
  }
  .ui-button:disabled {
    opacity: 0.45;
    cursor: default;
  }

  .ui-table-wrap {
    overflow-x: auto;
    margin: 0;
  }
  .ui-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.97rem;
    font-variant-numeric: tabular-nums;
  }
  .ui-table caption {
    text-align: left;
    color: var(--ui-text-muted);
    font-size: 0.9rem;
    padding-bottom: 0.9rem;
    max-width: 44rem;
  }
  .ui-table th,
  .ui-table td {
    text-align: left;
    vertical-align: top;
    padding: 0.7rem 1rem 0.7rem 0;
    border-bottom: 1px solid var(--ui-rule);
  }
  .ui-table thead th {
    font-weight: 650;
    font-stretch: 87%;
    border-bottom: 2px solid var(--ui-text);
  }
  .ui-table tbody th {
    font-weight: 600;
    font-stretch: 87%;
    width: 22%;
  }
  .ui-table[data-mark-last] td:last-child {
    border-left: 4px solid var(--ui-part-pool);
    padding-left: 0.8rem;
  }

  /* Examples as a list with rules. */
  .ui-examples {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .ui-examples > li {
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--ui-rule);
    max-width: 52rem;
  }
  .ui-examples > li:first-child {
    padding-top: 0;
  }
  .ui-examples h3 {
    margin: 0 0 0.3rem;
    font-size: 1.35rem;
    font-stretch: 75%;
    font-weight: 750;
  }
  .ui-examples h3 a {
    color: var(--ui-text);
  }
  .ui-examples p {
    margin: 0.25rem 0;
  }
  .ui-examples .ui-result {
    color: var(--ui-text-muted);
    font-size: 0.95rem;
  }
  .ui-examples img {
    display: block;
    width: min(100%, 36rem);
    height: auto;
    margin: 0.6rem 0;
    border: 1px solid var(--ui-rule);
    border-radius: var(--ui-radius-m);
  }
  .ui-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
    font-stretch: 87%;
  }

  .ui-frame {
    margin: var(--ui-space-4) 0;
  }
  .ui-frame iframe {
    display: block;
    width: 100%;
    border: 1px solid var(--ui-rule);
    border-radius: var(--ui-radius-l);
    background: var(--ui-bg);
  }
  .ui-frame figcaption {
    margin-top: var(--ui-space-2);
    font-size: var(--ui-text-s);
  }

  /* Rendered and running, but out of view: not display: none, which stops its frames. */
  .ui-offstage {
    position: absolute;
    left: -10000px;
    top: 0;
    width: 960px;
    height: 720px;
    border: 0;
    pointer-events: none;
  }

  .ui-code {
    display: block;
    overflow-x: auto;
    background: var(--ui-surface);
    border: 1px solid var(--ui-rule);
    border-radius: var(--ui-radius-m);
    padding: 1rem 1.2rem;
    line-height: 1.6;
    max-width: 52rem;
  }

  .ui-callout {
    border-left: 4px solid var(--ui-accent);
    background: var(--ui-surface);
    padding: var(--ui-space-3) var(--ui-space-4);
  }

  /* Kept for the specimens and older pages; the site uses lists, not card grids. */
  .ui-card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-rule);
    border-radius: var(--ui-radius-m);
    padding: var(--ui-space-4);
  }
  .ui-card-image {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: var(--ui-space-3);
    border-radius: var(--ui-radius-s);
    border: 1px solid var(--ui-rule);
  }
  .ui-card > h2,
  .ui-card > h3 {
    margin-top: 0;
  }
  .ui-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: var(--ui-space-4);
  }
  .ui-section {
    padding: var(--ui-space-6) 0;
  }
  .ui-hero {
    padding: var(--ui-space-7) 0 var(--ui-space-6);
  }

  /* Inside an iframe (?embed=1, set by theme.js): content only. */
  [data-embed] .ui-header,
  [data-embed] .ui-footer {
    display: none;
  }

  @media (max-width: 760px) {
    .ui-header {
      gap: var(--ui-space-2) var(--ui-space-4);
      padding-block: 0.6rem;
      row-gap: 0.45rem;
    }
    .ui-github span {
      display: none;
    }
    .ui-nav {
      order: 3;
      width: 100%;
      gap: var(--ui-space-4);
      font-size: 0.95rem;
    }
    .ui-intro,
    .ui-gutter {
      grid-template-columns: 1fr;
    }
    .ui-intro > :not(h1) {
      grid-column: 1;
    }
    .ui-gutter {
      margin-top: 3.5rem;
    }
    .ui-gutter > h2 {
      position: static;
      margin-bottom: var(--ui-space-4);
    }
    .ui-track {
      padding: 0 0.6rem;
    }
    .ui-track span {
      display: none;
    }
    .ui-status {
      margin: 0;
      width: 100%;
    }
    .ui-table {
      display: block;
      overflow-x: auto;
    }
  }

  /* Paired bars (PairedBars.tsx): grey for the baseline, the accent when
     Isoloop is better, --ui-worse (orange: a cost, not an error) when it's
     worse; the delta says it in words.
     Bars are SVG sized by a width attribute, so no inline style is needed. */
  .ui-chart {
    margin: 0;
    font-variant-numeric: tabular-nums;
  }
  .ui-chart + .ui-chart {
    margin-top: var(--ui-space-6);
  }
  .ui-chart figcaption {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.8rem;
    margin-bottom: 0.7rem;
  }
  .ui-chart-title {
    color: var(--ui-text);
    font-weight: 650;
    font-stretch: 87%;
  }
  .ui-chart-note {
    color: var(--ui-text-muted);
    font-size: var(--ui-text-xs);
  }
  .ui-chart-rows {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
  }
  /* A row is a grid: the series names in the first column, the tracks and
     the delta in the second; compact charts drop the names' column. */
  .ui-chart-row {
    display: grid;
    grid-template-columns: minmax(6rem, 11rem) 1fr;
    align-items: center;
    gap: 2px 0.75rem;
    font-size: var(--ui-text-s);
  }
  .ui-chart-line {
    display: contents;
  }
  .ui-chart-label {
    grid-column: 1 / -1;
    margin: 0 0 0.3rem;
    color: var(--ui-text);
    font-stretch: 87%;
  }
  .ui-chart-delta {
    grid-column: 2;
    margin: 0.3rem 0 0;
    color: var(--ui-text-muted);
    font-size: var(--ui-text-xs);
  }
  .ui-chart[data-compact] .ui-chart-row {
    grid-template-columns: 1fr;
  }
  .ui-chart[data-compact] .ui-chart-delta {
    grid-column: 1;
  }
  .ui-chart[data-compact] .ui-chart-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .ui-chart-name {
    color: var(--ui-text-muted);
    font-stretch: 87%;
  }
  /* The track keeps room after the longest bar for its value. */
  .ui-chart-track {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    padding-right: 5.5rem;
    border-left: 1px solid var(--ui-rule);
  }
  .ui-chart-svg {
    flex: none;
    display: block;
  }
  .ui-chart-value {
    flex: none;
    color: var(--ui-text);
    white-space: nowrap;
  }
  .ui-chart-line[data-series='base'] rect {
    fill: var(--ui-border);
  }
  .ui-chart-line[data-verdict='better'] rect {
    fill: var(--ui-accent);
  }
  .ui-chart-line[data-verdict='worse'] rect {
    fill: var(--ui-worse);
  }
  .ui-chart-line[data-verdict='same'] rect {
    fill: var(--ui-text-muted);
  }
  .ui-chart-legend {
    list-style: none;
    margin: 0.9rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
    color: var(--ui-text-muted);
    font-size: var(--ui-text-xs);
    font-stretch: 87%;
  }
  .ui-chart-legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .ui-chart-legend li::before {
    content: '';
    flex: none;
    width: 1.2rem;
    height: 0.7rem;
    border-radius: 0 2px 2px 0;
    background: var(--ui-border);
  }
  .ui-chart-legend [data-verdict='better']::before {
    background: var(--ui-accent);
  }
  .ui-chart-legend [data-verdict='worse']::before {
    background: var(--ui-worse);
  }
  .ui-chart-legend [data-verdict='same']::before {
    background: var(--ui-text-muted);
  }
  @media (max-width: 760px) {
    .ui-chart-row {
      grid-template-columns: 1fr;
    }
    .ui-chart-name {
      margin-top: 0.3rem;
    }
    .ui-chart-delta {
      grid-column: 1;
    }
  }

  @media (forced-colors: active) {
    .ui-chart-line[data-series='base'] rect {
      fill: GrayText;
    }
    .ui-chart-line[data-series='value'] rect {
      fill: CanvasText;
    }
    .ui-chart-legend li::before {
      background: GrayText;
      forced-color-adjust: none;
    }
    .ui-chart-legend [data-series='value']::before {
      background: CanvasText;
    }
    .ui-header,
    .ui-bar,
    .ui-footer,
    .ui-panel,
    .ui-card,
    .ui-table th,
    .ui-table td,
    .ui-frame iframe,
    .ui-button,
    .ui-toggle {
      border-color: CanvasText;
    }
    .ui-toggle-knob {
      background: CanvasText;
    }
    :focus-visible {
      outline-color: Highlight;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    * {
      animation-duration: 0.01ms !important;
      transition-duration: 0.01ms !important;
    }
  }
}
