/* Design-system components for Checkpoint 1 (DESIGN_SYSTEM.md §4, §7, §9, §10, §13, §15, §24).
   Built by src/ds-components.ts; route-independent; no colour or breakpoint literals (tokens only).
   State is expressed with ARIA attributes, never with --active/--selected classes. */
@layer legacy, tokens, base, components;
@layer components {
  /* ================= shared: slanted shapes + focus drawn inside the clip ================= */
  .ds-slant { --ds-slant: var(--ds-slant-button); position: relative; clip-path: polygon(var(--ds-slant) 0, 100% 0, calc(100% - var(--ds-slant)) 100%, 0 100%); }
  .ds-slant:focus-visible { outline: none; }
  .ds-slant::after {
    content: ""; position: absolute; pointer-events: none;
    inset: 3px calc(var(--ds-slant) + 2px);
    box-shadow: 0 0 0 var(--ds-focus-width) var(--ds-focus-ring);
    opacity: 0;
  }
  .ds-slant:focus-visible::after { opacity: 1; }

  /* ================= identity ================= */
  .ds-brand { display: inline-flex; align-items: center; gap: var(--ds-space-md); color: var(--ds-text-primary); text-decoration: none; }
  .ds-brand__mark { flex: none; width: 40px; height: 40px; }
  .ds-brand__lettering { flex: none; height: 32px; width: auto; }
  .ds-brand[data-size="compact"] { gap: var(--ds-space-xs); }
  .ds-brand[data-size="compact"] .ds-brand__mark { width: 40px; height: 40px; }
  .ds-brand[data-size="compact"] .ds-brand__lettering { height: 24px; }
  .ds-brand__copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
  .ds-brand__wordmark {
    font-family: var(--ds-font-display); font-size: 19px; line-height: 19px; font-weight: 800;
    font-style: italic; font-synthesis: style; letter-spacing: .02em; color: var(--ds-text-primary);
  }
  .ds-brand__product {
    font-size: 9px; line-height: 11px; font-weight: 700; letter-spacing: .06em;
    color: var(--ds-text-secondary);
  }
  .ds-brand__platform {
    margin-top: 3px; padding: 1px 5px; border: 1px solid var(--ds-border-subtle);
    font-size: 8px; line-height: 9px; font-weight: 700; letter-spacing: .08em;
    color: var(--ds-text-tertiary);
  }
  .ds-brand [data-forced-colors-only] { display: none; }
  @media (forced-colors: active) {
    .ds-brand [data-colour-only] { display: none; }
    .ds-brand [data-forced-colors-only] { display: block; }
    .ds-brand__lettering { filter: grayscale(1); }
  }

  /* ================= stopwatch icon ================= */
  .ds-icon { flex: none; width: 20px; height: 20px; }

  /* ================= buttons (§9) ================= */
  .ds-button {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--ds-space-sm);
    min-height: var(--ds-button-height-secondary); padding: 0 var(--ds-space-lg);
    border: 0; background: none; color: var(--ds-text-body);
    font-family: var(--ds-font-ui); font-size: 0.90625rem; font-weight: 600; line-height: 1.1;
    text-align: center; text-decoration: none; cursor: pointer;
    transition: background-color var(--ds-motion-state), color var(--ds-motion-state), box-shadow var(--ds-motion-state);
  }
  .ds-button[data-variant="primary"] {
    background: var(--ds-action-primary); color: var(--ds-action-on-primary);
    font-weight: 700; font-size: 1.0625rem;
    min-height: var(--ds-button-height-md); padding: 0 26px 0 20px;
  }
  .ds-button[data-variant="primary"][data-size="sm"] { min-height: var(--ds-button-height-sm); font-size: 0.96875rem; padding: 0 20px 0 16px; --ds-slant: var(--ds-slant-button-small); }
  .ds-button[data-variant="primary"][data-size="lg"] { min-height: var(--ds-button-height-lg); font-size: 1.15625rem; padding: 0 30px 0 22px; }
  .ds-button[data-variant="primary"] .ds-icon { width: 20px; height: 20px; }
  .ds-button[data-variant="primary"][data-size="sm"] .ds-icon { width: 18px; height: 18px; }
  .ds-button[data-variant="primary"][data-size="lg"] .ds-icon { width: 22px; height: 22px; }
  .ds-button[data-variant="primary"]:hover { background: color-mix(in oklab, var(--ds-action-primary) 88%, var(--ds-text-primary)); }
  .ds-post__actions .ds-button[data-variant="primary"][data-engine="150"] {
    background: var(--ds-engine-150); color: var(--ds-engine-on-fill);
  }
  .ds-post__actions .ds-button[data-variant="primary"][data-engine="200"] {
    background: var(--ds-engine-200); color: var(--ds-engine-on-fill);
  }
  .ds-post__actions .ds-button[data-variant="primary"][data-engine]:hover {
    background: color-mix(in oklab, var(--ds-c, var(--ds-engine-150)) 88%, var(--ds-text-primary));
  }
  .ds-post__actions .ds-button[data-variant="primary"][data-engine="150"] { --ds-c: var(--ds-engine-150); }
  .ds-post__actions .ds-button[data-variant="primary"][data-engine="200"] { --ds-c: var(--ds-engine-200); }
  .ds-button[data-variant="global"] {
    min-height: var(--ds-control-height); color: var(--ds-action-primary);
    box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--ds-action-primary) 60%, transparent);
  }
  .ds-button[data-variant="global"] .ds-icon { width: 17px; height: 17px; }
  .ds-button[data-variant="secondary"] { background: var(--ds-surface-control); color: var(--ds-text-body); box-shadow: inset 0 0 0 1px var(--ds-border-strong); }
  .ds-button[data-variant="secondary"]:hover { background: var(--ds-surface-hover); }
  .ds-button[data-variant="quiet"] {
    min-height: var(--ds-target-min-dense); padding: 0 var(--ds-space-xs); color: var(--ds-text-secondary);
    text-decoration: underline; text-decoration-color: color-mix(in oklab, currentColor 50%, transparent); text-underline-offset: 4px;
  }
  .ds-button[data-variant="quiet"]:hover { color: var(--ds-text-primary); }
  .ds-button[data-variant="danger"] { color: var(--ds-status-error); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--ds-status-error) 70%, transparent); }
  .ds-button[data-variant="danger"]:hover { background: color-mix(in oklab, var(--ds-status-error) var(--ds-tint), var(--ds-surface-raised)); }
  .ds-button:where([data-variant="global"], [data-variant="secondary"], [data-variant="quiet"], [data-variant="danger"]):focus-visible { outline: var(--ds-focus-width) solid var(--ds-focus-ring); outline-offset: 2px; }
  /* disabled: never without a reason (the reason line is linked with aria-describedby) */
  .ds-button[aria-disabled="true"] {
    background: transparent; color: var(--ds-text-tertiary); box-shadow: inset 0 0 0 1px var(--ds-border-strong);
    font-weight: 500; cursor: not-allowed; clip-path: none;
  }
  .ds-button[aria-disabled="true"]::after { inset: 3px; }
  .ds-button-reason { display: block; margin-top: var(--ds-space-xs); font-size: var(--ds-type-label-size); line-height: var(--ds-type-label-line); color: var(--ds-text-tertiary); }
  /* loading */
  .ds-button[aria-busy="true"] { cursor: progress; }
  .ds-spinner {
    flex: none; width: 16px; height: 16px; border-radius: var(--ds-radius-round);
    box-shadow: inset 0 0 0 2px color-mix(in oklab, currentColor 30%, transparent);
    border-top: 2px solid currentColor; animation: ds-spin calc(var(--ds-motion-reveal) * 3) linear infinite;
  }
  @keyframes ds-spin { to { transform: rotate(1turn); } }
  /* armed (two-press): a 3 px flare halo, drawn outside the clip on the wrapper */
  .ds-armed { display: inline-grid; gap: var(--ds-space-xs); justify-items: start; }
  .ds-armed[data-armed="true"] .ds-button { filter: drop-shadow(0 0 0 var(--ds-action-primary)) drop-shadow(0 0 3px var(--ds-action-primary)); }
  .ds-armed__next { font-size: var(--ds-type-label-size); line-height: var(--ds-type-label-line); font-weight: 600; color: var(--ds-text-primary); }
  .ds-armed:not([data-armed="true"]) .ds-armed__next { display: none; }

  /* ================= engine (§7): colour + text + shape + ✓ ================= */
  .ds-engine-mark {
    --ds-c: var(--ds-engine-150);
    display: inline-flex; align-items: center; gap: 6px; min-height: var(--ds-chip-height); padding: 0 8px 0 9px;
    font-family: var(--ds-font-ui); font-size: 0.78125rem; font-weight: 600; line-height: 1; white-space: nowrap;
    color: var(--ds-c); background: color-mix(in oklab, var(--ds-c) var(--ds-tint), var(--ds-surface-raised));
    box-shadow: inset 3px 0 0 var(--ds-c);
  }
  .ds-engine-mark[data-engine="200"], .ds-engine-option[data-engine="200"] { --ds-c: var(--ds-engine-200); }
  .ds-engine-mark[data-size="lg"] { min-height: 28px; padding: 0 11px 0 12px; font-size: 0.875rem; box-shadow: inset 4px 0 0 var(--ds-c); }
  .ds-engine-mark[data-size="plain"] { background: transparent; box-shadow: none; padding: 0; min-height: 0; }
  .ds-engine-shape { flex: none; }
  .ds-engine-selector {
    display: inline-flex; gap: 2px; padding: 2px; background: var(--ds-surface-raised);
    box-shadow: inset 0 0 0 1px var(--ds-border-subtle);
  }
  .ds-engine-option {
    --ds-c: var(--ds-engine-150);
    display: inline-flex; align-items: center; gap: 7px; min-height: var(--ds-segment-height); padding: 0 14px;
    border: 0; background: transparent; color: var(--ds-text-secondary); cursor: pointer;
    font-family: var(--ds-font-ui); font-size: 0.875rem; font-weight: 500; line-height: 1;
  }
  .ds-engine-option .ds-engine-shape { color: var(--ds-c); }
  .ds-engine-option:hover { background: var(--ds-surface-hover); }
  .ds-engine-option[aria-checked="true"] {
    background: color-mix(in oklab, var(--ds-c) var(--ds-tint), var(--ds-surface-raised));
    color: var(--ds-c); font-weight: 700; box-shadow: inset 0 calc(-1 * var(--ds-engine-selector-underline)) 0 var(--ds-c);
  }
  .ds-engine-option[aria-checked="true"]::before { content: "✓"; font-weight: 700; }
  .ds-engine-selector[data-size="lg"] .ds-engine-option { min-height: 42px; padding: 0 18px; font-size: 0.96875rem; }
  .ds-engine-rule { justify-self: stretch; width: 100%; height: var(--ds-engine-selector-underline); background: var(--ds-engine-150); }
  .ds-engine-rule[data-engine="200"] { background: var(--ds-engine-200); }

  /* ================= selection (§9, §24) ================= */
  .ds-segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; background: var(--ds-surface-raised); box-shadow: inset 0 0 0 1px var(--ds-border-subtle); }
  .ds-segment {
    min-height: var(--ds-segment-height); padding: 0 12px; border: 0; background: transparent; cursor: pointer;
    color: var(--ds-text-secondary); font-size: 0.84375rem; font-weight: 500; line-height: 1;
  }
  .ds-segment:hover { background: var(--ds-surface-hover); }
  .ds-segment[aria-checked="true"] { background: var(--ds-surface-selected); color: var(--ds-text-primary); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ds-action-primary); }
  .ds-segment[aria-checked="true"]::before { content: "✓ "; color: var(--ds-text-secondary); font-weight: 500; }
  .ds-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--ds-border-subtle); scrollbar-width: thin; }
  .ds-tab {
    display: inline-flex; align-items: center; gap: var(--ds-space-sm); min-height: var(--ds-target-min); padding: 0 14px;
    color: var(--ds-text-secondary); font-size: 0.875rem; font-weight: 500; text-decoration: none; white-space: nowrap;
  }
  .ds-tab:hover { color: var(--ds-text-primary); }
  .ds-tab[aria-current="page"] { color: var(--ds-text-primary); font-weight: 600; box-shadow: inset 0 -3px 0 var(--ds-action-primary); }
  .ds-tab:focus-visible { outline-offset: -3px; }
  .ds-filter-chips { display: flex; flex-wrap: wrap; gap: var(--ds-space-xs); }
  .ds-filter-chip {
    min-height: 32px; padding: 0 12px; border: 0; cursor: pointer; background: var(--ds-surface-control);
    color: var(--ds-text-secondary); font-size: 0.8125rem; font-weight: 500; box-shadow: inset 0 0 0 1px var(--ds-border-strong);
  }
  .ds-filter-chip[aria-pressed="true"] { background: var(--ds-surface-selected); color: var(--ds-text-primary); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--ds-text-primary); }
  .ds-filter-chip[aria-pressed="true"]::before { content: "✓ "; }
  .ds-removable {
    display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 4px 0 10px;
    background: var(--ds-surface-selected); color: var(--ds-text-primary);
    font-family: var(--ds-font-ui); font-size: 0.8125rem; font-weight: 600;
  }
  .ds-removable__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 18ch; }
  .ds-removable__remove {
    display: inline-grid; place-items: center; min-width: var(--ds-target-min-dense); min-height: var(--ds-target-min-dense);
    border: 0; background: transparent; color: var(--ds-text-secondary); cursor: pointer; font-size: 1.05rem; line-height: 1;
  }
  .ds-removable__remove:hover { color: var(--ds-text-primary); }

  /* ================= status (§6 tints, §7 hidden ≠ zero) ================= */
  .ds-chip {
    --ds-c: var(--ds-text-secondary); --ds-slant: var(--ds-slant-tag);
    display: inline-flex; align-items: center; gap: 5px; min-height: var(--ds-chip-height); padding: 0 8px;
    font-size: var(--ds-type-micro-size); font-weight: 600; line-height: 1; white-space: nowrap;
    color: var(--ds-c); background: color-mix(in oklab, var(--ds-c) var(--ds-tint), var(--ds-surface-raised));
  }
  .ds-chip[data-tone="success"] { --ds-c: var(--ds-status-success); }
  .ds-chip[data-tone="warning"] { --ds-c: var(--ds-status-warning); }
  .ds-chip[data-tone="error"] { --ds-c: var(--ds-status-error); }
  .ds-chip[data-tone="info"] { --ds-c: var(--ds-status-info); }
  .ds-chip[data-tone="advanced"] { --ds-c: var(--ds-tier-advanced); }
  .ds-chip[data-tone="intermediate"] { --ds-c: var(--ds-tier-intermediate); }
  .ds-chip[data-tone="beginner"] { --ds-c: var(--ds-tier-beginner); }
  .ds-chip[data-tone="race-direction"] { --ds-c: var(--ds-mode-race-direction); }
  .ds-chip[data-tone="combined"] { background: transparent; color: var(--ds-text-body); box-shadow: inset 0 0 0 1px var(--ds-border-strong); clip-path: none; }
  .ds-chip[data-tone="live"] { background: var(--ds-live); color: var(--ds-live-on); font-weight: 700; }
  .ds-chip[data-tone="live"]::before { content: ""; width: 6px; height: 6px; border-radius: var(--ds-radius-round); background: currentColor; }
  .ds-you-chip {
    --ds-slant: 3px; display: inline-flex; align-items: center; padding: 3px 7px;
    font-size: 0.6875rem; font-weight: 700; line-height: 1; letter-spacing: 0.06em; text-transform: uppercase;
    background: var(--ds-personal-accent); color: var(--ds-personal-on-accent);
  }
  .ds-combined { display: inline-grid; gap: 2px; min-width: 0; max-width: 100%; white-space: normal; }
  .ds-combined > span:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ds-space-xs); min-width: 0; }
  .ds-combined[data-wrap-total] .ds-data-m { white-space: normal; overflow-wrap: anywhere; }
  .ds-combined__breakdown { font-size: var(--ds-type-label-size); line-height: var(--ds-type-label-line); color: var(--ds-text-tertiary); overflow-wrap: anywhere; }
  .ds-hidden-pref {
    display: grid; gap: var(--ds-space-xs); justify-items: start; padding: var(--ds-space-md) var(--ds-space-lg);
    background: var(--ds-surface-raised); box-shadow: inset 0 0 0 1px var(--ds-border-subtle);
  }
  .ds-hidden-pref__text { color: var(--ds-text-secondary); font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line); }
  .ds-status { display: flex; gap: var(--ds-space-sm); align-items: flex-start; padding: var(--ds-space-md) var(--ds-space-lg); background: var(--ds-surface-raised); color: var(--ds-text-body); box-shadow: inset 3px 0 0 var(--ds-c, var(--ds-status-info)); }
  .ds-status[data-tone="success"] { --ds-c: var(--ds-status-success); }
  .ds-status[data-tone="warning"] { --ds-c: var(--ds-status-warning); }
  .ds-status[data-tone="error"] { --ds-c: var(--ds-status-error); }
  .ds-status__icon { flex: none; color: var(--ds-c, var(--ds-status-info)); font-weight: 700; }

  /* ================= data (§10, §15) ================= */
  /* Every column that holds numbers is sized in ch from the dataset (set by dataTable), so all rows
     align and one table has one size. --ds-cols is the whole desktop template. */
  .ds-table {
    --ds-cols: minmax(0, 1fr); --ds-cols-phone: minmax(0, 1fr);
    display: grid; grid-template-columns: 0 var(--ds-cols) 0; column-gap: var(--ds-space-md);
    background: var(--ds-surface-raised);
    font-family: var(--ds-font-data); font-size: var(--ds-type-data-size); min-width: 0;
  }
  .ds-table__row {
    display: grid; align-items: center;
    grid-column: 1 / -1; grid-template-columns: subgrid;
    min-height: var(--ds-table-row); border-bottom: 1px solid var(--ds-border-subtle);
    color: var(--ds-text-body);
  }
  .ds-table__row::before, .ds-table__row::after { content: ""; }
  .ds-table[data-density="timing"] .ds-table__row { min-height: var(--ds-table-row-timing); }
  .ds-table[data-density="dense"] .ds-table__row { min-height: var(--ds-table-row-dense); }
  .ds-table__row > * { min-width: 0; }
  /* Keep the grid row in the table's data font: its `ch` tracks must resolve to exactly the same
     lengths as the body rows. Head typography belongs on the cells, otherwise every heading uses a
     subtly different grid from its data. */
  .ds-table__row[data-head] { min-height: 34px; font-weight: 500; color: var(--ds-text-tertiary); }
  .ds-table__row[data-head] > .ds-table__cell { font-family: var(--ds-font-ui); font-size: var(--ds-type-label-size); }
  .ds-table__row[data-head-extra] { min-height: var(--ds-target-min); }
  .ds-table__cell[data-align="num"], .ds-table__cell[data-align="rank"], .ds-table__cell[data-align="delta"] { text-align: right; }
  .ds-table__rank { font-family: var(--ds-font-data); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
  .ds-table__row[data-podium="1"] { box-shadow: inset 3px 0 0 var(--ds-rank-gold); }
  .ds-table__row[data-podium="2"] { box-shadow: inset 3px 0 0 var(--ds-rank-silver); }
  .ds-table__row[data-podium="3"] { box-shadow: inset 3px 0 0 var(--ds-rank-bronze); }
  .ds-table__row[data-podium="1"] .ds-table__rank { color: var(--ds-rank-gold); }
  .ds-table__row[data-podium="2"] .ds-table__rank { color: var(--ds-rank-silver); }
  .ds-table__row[data-podium="3"] .ds-table__rank { color: var(--ds-rank-bronze); }
  .ds-table__row[data-kind="you"] { background: var(--ds-personal-wash); box-shadow: inset 4px 0 0 var(--ds-personal-edge); color: var(--ds-text-primary); }
  .ds-table__row[data-kind="reference"] { background: transparent; color: var(--ds-text-tertiary); font-style: normal; }
  .ds-table__row[data-kind="reference"] .ds-table__rank { font-weight: 500; }
  /* Names ellipsise first (§10). The text is the only part of the cell that may shrink, and a tag
     beside it (tier, "You", "reference · no rank") wraps to a second line rather than being cut:
     at 320 px a name, a tier chip and a You chip do not fit one line, and a clipped label is worse
     than a taller row. */
  .ds-table__name { display: flex; align-items: center; min-width: 0; overflow: hidden; }
  .ds-table__name > .ds-table__name-inner { flex: 1 1 auto; }
  .ds-table__name-inner {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm);
    min-width: 0; max-width: 100%;
  }
  .ds-table__name-inner > * { flex: 0 0 auto; max-width: 100%; }
  /* A tag that is wider than the whole name column (the reference row's "reference · no rank" at
     600 px) breaks its own line rather than losing half its words. */
  .ds-table__name-inner > .ds-chip { white-space: normal; min-width: 0; }
  .ds-table__name-text {
    flex: 0 1 auto; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--ds-font-ui); font-weight: 500;
  }
  .ds-table__cell[data-align="text"] { font-family: var(--ds-font-ui); font-size: var(--ds-type-body-s-size); }
  .ds-tournament-standing__scroll { min-width: 0; }
  .ds-tournament-standing__phone-intro,
  .ds-tournament-standing__phone-away,
  .ds-tournament-standing__phone-rivals,
  .ds-tournament-standing__phone-away-mark,
  .ds-tournament-standing__phone-rank { display: none; }
  .ds-table__num, .ds-table__num-inner { font-family: var(--ds-font-data); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .ds-table__num[data-strong], .ds-table__num-inner[data-strong] { font-weight: 600; color: var(--ds-text-primary); }
  .ds-delta, .ds-delta__value { font-family: var(--ds-font-data); font-variant-numeric: tabular-nums; font-size: var(--ds-type-data-s-size); font-weight: 500; white-space: nowrap; }
  /* One size per table (§10): inside a table the gap is the table's size, not the smaller step. */
  .ds-table .ds-delta, .ds-table .ds-delta__value { font-size: inherit; }
  .ds-delta[data-direction="faster"], .ds-delta__value[data-direction="faster"] { color: var(--ds-delta-faster); }
  .ds-delta[data-direction="slower"], .ds-delta__value[data-direction="slower"] { color: var(--ds-delta-slower); }
  .ds-delta[data-direction="even"], .ds-delta__value[data-direction="even"] { color: var(--ds-text-tertiary); }
  /* SortHeader: the head cell is the control; the direction is stated in the mark and in aria-sort. */
  .ds-sort {
    display: inline-flex; align-items: center; gap: 5px; min-height: var(--ds-target-min-dense); padding: 0 2px;
    border: 0; background: transparent; cursor: pointer; color: inherit;
    font: inherit; font-family: var(--ds-font-ui); text-align: inherit;
  }
  .ds-sort:hover { color: var(--ds-text-primary); }
  .ds-sort[data-direction="ascending"], .ds-sort[data-direction="descending"] { color: var(--ds-text-primary); font-weight: 600; }
  .ds-sort__phone-label { display: none; }
  .ds-sort__mark { font-size: 0.6875rem; }
  /* A finger needs the full target even where a mouse is content with the dense one (§21). */
  @media (pointer: coarse) {
    .ds-sort, .ds-removable__remove, .ds-button[data-variant="quiet"] { min-height: var(--ds-target-min); }
  }
  /* phone: two-line rows, the same font size; ≤ 359 three lines. Numbers never clip or wrap. */
  /* tablet: the declared column-drop order takes the least important columns out before the row
     would rather run off the page: below the desktop breakpoint the table keeps the columns that
     answer the question and leaves the secondary ones to the full width. The template is rebuilt
     from the columns that stay, so no value lands in another column's track. */
  @media (min-width: 600px) and (max-width: 1099px) {
    .ds-table { grid-template-columns: 0 var(--ds-cols-tablet, var(--ds-cols)) 0; }
    .ds-table__cell[data-tablet="drop"] { display: none; }
  }
  @media (max-width: 599px) {
    .ds-root.ds-page-title.ds-page-title--ranking::before {
      content: "RANK"; display: block; margin-bottom: var(--ds-space-md);
      color: var(--ds-text-secondary); font-family: var(--ds-font-ui);
      font-size: var(--ds-type-label-size); font-style: normal; font-weight: 700;
      line-height: var(--ds-type-label-line); letter-spacing: .08em;
    }
    .subnav--ranking {
      width: 100%; gap: 0; padding: 1px; border-color: var(--ds-border-subtle);
      border-radius: 0;
    }
    .subnav--ranking .subnav__tab {
      display: inline-flex; align-items: center; min-height: var(--ds-target-min);
      padding: 0 var(--ds-space-md); border-radius: 0;
      color: var(--ds-text-secondary); font-size: var(--ds-type-body-s-size);
    }
    .subnav--ranking .subnav__tab[aria-current="page"] {
      background: var(--ds-surface-selected); color: var(--ds-text-primary);
      box-shadow: inset 0 -3px 0 var(--ds-action-primary);
    }
    .subnav--ranking .subnav__tab[aria-current="page"]::before {
      content: "✓"; margin-inline-end: var(--ds-space-xs); color: var(--ds-text-secondary);
    }
    .ds-root.ds-page-title.ds-page-title--ranking {
      max-width: 100%;
      font-size: 1.15rem;
      text-align: left;
      white-space: normal;
    }
    .ds-root.ds-page-status.ds-page-status--ranking { font-weight: 400; text-align: left; }
    .ds-table { grid-template-columns: minmax(0, 1fr); column-gap: 0; }
    .ds-table__row {
      grid-template-columns: var(--ds-cols-phone); grid-template-rows: auto auto; column-gap: var(--ds-space-md); row-gap: 4px;
      min-height: var(--ds-table-row-phone); padding: var(--ds-space-sm) var(--ds-space-md);
    }
    .ds-table__row::before, .ds-table__row::after { display: none; }
    .ds-table__row[data-head] { display: none; }
    .ds-table__cell[data-phone="rank"] { grid-column: 1; grid-row: 1 / -1; }
    .ds-table__cell[data-phone="name"] { grid-column: 2; grid-row: 1; }
    .ds-table__cell[data-phone="drop"] { display: none; }
    .ds-table__cell[data-phone="1"] { grid-row: 1; }
    .ds-table__cell[data-phone="2"] { grid-row: 2; }
    .ds-table__cell[data-phone="3"] { grid-row: 3; }
    .ds-table__cell[data-phone-col="2"] { grid-column: 2; }
    .ds-table__cell[data-phone-col="3"] { grid-column: 3; }
    .ds-table__cell[data-phone-col="4"] { grid-column: 4; }
    .ds-table__cell[data-phone-col="5"] { grid-column: 5; }
    .ds-table__cell[data-phone-col="6"] { grid-column: 6; }
    .ds-table__cell[data-phone-span] { grid-column: 2 / -1; }
    .ds-table__row { grid-auto-rows: auto; }
    .ds-table__cell[data-phone="2"][data-phone-col="2"], .ds-table__cell[data-phone="3"][data-phone-col="2"] { text-align: left; }
  }
  @media (max-width: 599px) {
    /* At the APK's 360 dp phone width the fourth Ranking view starts a second row. */
    .ds-rank__tabs .ds-tabs { flex-wrap: wrap; overflow-x: visible; }
  }
  @media (max-width: 359px) {
    .ds-table__row { min-height: var(--ds-table-row-phone-compact); grid-template-rows: auto auto auto; grid-template-columns: var(--ds-cols-compact, var(--ds-cols-phone)); }
    .ds-table__cell[data-compact="drop"] { display: none; }
    .ds-table__cell[data-compact="1"] { grid-row: 1; }
    .ds-table__cell[data-compact="2"] { grid-row: 2; }
    .ds-table__cell[data-compact="3"] { grid-row: 3; }
    .ds-table__cell[data-compact-col="2"] { grid-column: 2; text-align: left; }
    .ds-table__cell[data-compact-col="3"] { grid-column: 3; }
    .ds-table__cell[data-compact-col="4"] { grid-column: 4; }
    .ds-table__cell[data-compact-col="5"] { grid-column: 5; }
    .ds-table__cell[data-compact-col="6"] { grid-column: 6; }
    .ds-table__cell[data-compact-span] { grid-column: 2 / -1; }
  }

  /* ================= StatBlock, PodiumStrip, bars, chart (§15) ================= */
  .ds-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--ds-space-lg); }
  .ds-stat { display: grid; gap: 2px; min-width: 0; }
  .ds-stat__label { font-family: var(--ds-font-ui); font-size: var(--ds-type-label-size); font-weight: 600; color: var(--ds-text-secondary); }
  .ds-stat__value {
    font-family: var(--ds-font-data); font-variant-numeric: tabular-nums; white-space: nowrap;
    font-size: var(--ds-type-data-l-size); line-height: var(--ds-type-data-l-line); font-weight: 600; color: var(--ds-text-primary);
  }
  .ds-stat[data-size="lg"] .ds-stat__value { font-size: var(--ds-type-data-xl-size); line-height: var(--ds-type-data-xl-line); }
  .ds-stat__note { font-family: var(--ds-font-ui); font-size: var(--ds-type-label-size); line-height: var(--ds-type-label-line); color: var(--ds-text-tertiary); }
  .ds-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ds-space-sm); margin: 0; padding: 0; list-style: none; }
  .ds-podium__cell {
    --ds-c: var(--ds-rank-gold);
    display: flex; align-items: center; gap: var(--ds-space-sm); min-width: 0;
    padding: var(--ds-space-sm) var(--ds-space-md); background: var(--ds-surface-raised); box-shadow: inset 3px 0 0 var(--ds-c);
  }
  .ds-podium__cell[data-podium="2"] { --ds-c: var(--ds-rank-silver); }
  .ds-podium__cell[data-podium="3"] { --ds-c: var(--ds-rank-bronze); }
  .ds-podium__cell[data-kind="you"] { background: var(--ds-personal-wash); }
  .ds-podium__rank { flex: none; font-family: var(--ds-font-data); font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ds-c); }
  .ds-podium__art { flex: none; width: 44px; height: 28px; object-fit: cover; }
  .ds-podium__art[data-shape="square"] { width: 44px; height: 44px; object-fit: contain; }
  .ds-podium__copy { display: grid; gap: 1px; min-width: 0; }
  .ds-podium__cell { min-width: 0; }
  .ds-podium__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--ds-font-ui); font-weight: 600; color: var(--ds-text-primary); }
  .ds-podium__value { font-family: var(--ds-font-data); font-variant-numeric: tabular-nums; font-size: var(--ds-type-data-s-size); color: var(--ds-text-secondary); white-space: nowrap; }
  .ds-rank__headline-panel .ds-stat > .ds-engine-mark, .ds-rank__hero-explainer { display: none; }
  @media (max-width: 599px) { .ds-podium { grid-template-columns: minmax(0, 1fr); } }
  .ds-bar-row { display: flex; align-items: center; gap: var(--ds-space-sm); min-width: 0; }
  .ds-bar { flex: 1 1 auto; min-width: 2rem; height: 4px; background: var(--ds-surface-hover); }
  .ds-bar__fill { display: block; height: 100%; width: var(--ds-bar-share, 0%); background: var(--ds-bar-colour, var(--ds-text-secondary)); }
  .ds-bar-row[data-tone="personal"] .ds-bar__fill { background: var(--ds-personal-edge); }
  .ds-bar-row__value { flex: none; font-family: var(--ds-font-data); font-variant-numeric: tabular-nums; font-size: var(--ds-type-data-s-size); white-space: nowrap; color: var(--ds-text-body); }
  .ds-rank-mastery__help::before { content: "ⓘ"; margin-inline-end: var(--ds-space-xs); }
  .ds-rank-mastery__formula {
    justify-self: start; max-width: 100%; padding: var(--ds-space-xs) var(--ds-space-sm);
    background: var(--ds-surface-hover); color: var(--ds-text-primary);
    white-space: normal; overflow-wrap: anywhere;
  }
  .ds-dialog.ds-rank-mastery-help {
    width: min(720px, calc(100vw - 2 * var(--ds-gutter-phone)));
    overflow-y: auto;
  }
  /* ADR-0224 "Add another device": the QR keeps its own white field in either appearance. */
  .ds-device-card { min-width: 0; }
  .ds-device-card__code { display: flex; justify-content: center; }
  .ds-device-card__qr { display: block; width: min(260px, 100%); height: auto; aspect-ratio: 1; }
  .ds-device-card .ds-text-input { width: 100%; min-width: 0; }
  .ds-rank-mastery-help__tiers {
    display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: var(--ds-space-xs) var(--ds-space-md);
    margin: 0;
  }
  .ds-rank-mastery-help__tiers dt { font-weight: 600; color: var(--ds-text-primary); }
  .ds-rank-mastery-help__tiers dd {
    margin: 0; font-family: var(--ds-font-data); font-variant-numeric: tabular-nums;
    color: var(--ds-text-body); overflow-wrap: anywhere;
  }
  .ds-rank-mastery-help__examples { display: grid; gap: var(--ds-space-sm); }
  .ds-rank-mastery-help__examples > * { margin: 0; }
  .ds-rank-mastery-help__heading { font-weight: 600; color: var(--ds-text-primary); }
  .ds-rank-mastery .ds-bar { min-width: 5rem; height: 10px; }
  .ds-rank-mastery .ds-bar__fill { min-width: 3px; }
  .ds-rank-mastery .ds-bar__fill[data-empty] { min-width: 0; }
  .ds-rank-track { flex-wrap: nowrap; }
  .ds-rank-track .ds-thumb { flex: 0 0 auto; }
  .ds-rank-tracks .ds-table__row:not([data-head]) { min-height: 44px; }
  /* Delta per track from 600 px (owner 2026-09-26): time, gap and Mastery label were three bare
     inline spans in a column sized by character count, so they ran into each other and into the
     next Player. The view sizes each Player column to its content; here the parts get real spacing
     and Players a wider gutter. Desktop keeps one line; tablet stacks the gap and label under the
     time so three Players still fit. Phones (< 600 px) keep their own stacked APK layout. */
  @media (min-width: 600px) {
    .ds-rank-tracks { column-gap: var(--ds-space-md); }
    /* Each Player is its own column: a thin rule and padding before it. */
    .ds-rank-tracks .ds-table__num {
      padding-inline-start: var(--ds-space-md); border-inline-start: 1px solid var(--ds-border-subtle);
    }
    .ds-rank-tracks .ds-rank__track-value {
      display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--ds-space-sm);
      white-space: nowrap;
    }
    /* Fixed slots, so times, gaps and labels line up down the column whatever the label says. */
    .ds-rank-tracks .ds-rank__track-value > .ds-table__num-inner { min-width: 8ch; text-align: end; }
    .ds-rank-tracks .ds-rank__track-value > .ds-delta__value { min-width: 7ch; text-align: end; }
    .ds-rank-tracks .ds-rank__track-value > .ds-tier-chip { min-width: 3.6rem; justify-content: center; }
  }
  @media (min-width: 600px) and (max-width: 1099px) {
    .ds-rank-tracks { column-gap: var(--ds-space-lg); }
    .ds-rank-tracks .ds-rank__track-value {
      display: inline-grid; grid-template-columns: auto auto; justify-content: end; justify-items: end;
      column-gap: var(--ds-space-xs); row-gap: 2px;
    }
    .ds-rank-tracks .ds-rank__track-value > .ds-table__num-inner,
    .ds-rank-tracks .ds-rank__track-value > .ds-rank__track-position { grid-column: 1 / -1; }
  }
  .ds-rank__track-mobile-heading, .ds-rank__track-focus-mobile,
  .ds-rank__track-sort-hint { display: none; }
  .ds-rank__track-focus-desktop { display: contents; }
  .ds-tournament-picker { display: none; }
  .ds-tournament-finishes__phone-intro { display: none; }
  .ds-tournament-outcomes__phone { display: none; }
  .ds-tournament-points__phone { display: none; }
  /* The active-filter summary is one bordered bar at every width (owner 2026-09-26): parts wrap with
     " · " separators and Filters sits at its end; on desktop they used to run into one line. */
  .ds-rank__summary .ds-filter-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px var(--ds-space-md);
    align-items: center;
    padding: var(--ds-space-sm) var(--ds-space-md);
    border: 1px solid var(--ds-border-subtle);
    background: var(--ds-surface-raised);
  }
  .ds-rank__summary-parts {
    display: flex;
    grid-column: 1;
    flex-wrap: wrap;
    gap: 2px 0;
    min-width: 0;
  }
  .ds-rank__summary .ds-filter-summary__part { white-space: nowrap; flex-wrap: wrap; max-width: 100%; }
  /* A long translated value (Russian "Глобально + Среди соперников") wraps instead of widening a 320 px page. */
  .ds-rank__summary .ds-filter-summary__value { white-space: normal; overflow-wrap: anywhere; }
  .ds-rank__summary .ds-filter-summary__label,
  .ds-rank__summary .ds-filter-summary__value {
    color: var(--ds-text-secondary); font-weight: 400;
  }
  .ds-rank__summary .ds-filter-summary__part:not(:last-child)::after {
    content: " · ";
    margin-inline-end: 4px;
    color: var(--ds-text-tertiary);
  }
  .ds-rank__summary .ds-filter-summary > .ds-button { grid-column: 2; grid-row: 1; align-self: center; }
  @media (max-width: 599px) {
    /* Compose orders Ranking as engine, active filters, tabs and content. Keep that same reading
       order on the mobile Web without changing the more spacious desktop composition. */
    .ds-rank { display: flex; flex-direction: column; }
    .ds-rank__controls { display: contents; }
    .ds-rank__engine { order: 1; }
    .ds-rank__summary { order: 2; }
    .ds-rank__tabs { order: 3; margin-top: var(--ds-space-md); }
    .ds-rank__tabs .ds-tabs {
      border: 1px solid var(--ds-border-subtle);
      background: var(--ds-surface-raised);
    }
    .ds-rank__tabs .ds-tab[aria-current="page"] { background: var(--ds-surface-selected); }
    .ds-rank__tabs .ds-tab[aria-current="page"]::before {
      content: "✓"; color: var(--ds-text-secondary); font-weight: 500;
    }
    .ds-rank__headline { order: 4; }
    .ds-rank__comparison { display: none; order: 5; }
    .ds-rank__status {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip: rect(0 0 0 0);
      clip-path: inset(50%);
      white-space: nowrap;
      order: 6;
    }
    .ds-rank__content { order: 7; }
    .ds-rank[data-tab="medals"] .ds-rank__content,
    .ds-rank[data-tab="mastery"] .ds-rank__content,
    .ds-rank[data-tab="tracks"] .ds-rank__content {
      margin-top: calc(var(--ds-space-sm) + var(--ds-space-xxs));
    }
    /* Android's Mastery matrix and per-track cells use solid rectangular level labels. */
    .ds-rank .ds-tier-chip {
      min-height: auto; padding: 2px var(--ds-space-xs); clip-path: none; box-shadow: none;
      border: 1px solid var(--ds-border-strong); background: var(--ds-tier-colour);
      color: var(--ds-tier-ink, var(--ds-text-primary)); line-height: 14px;
    }
    .ds-rank[data-tab="mastery"] .ds-rank__headline { display: none; }

    /* The Home journey opens straight into the same compact destination card as Compose. Do not
       repeat the selected tab and engine in a second large header before the actual comparison. */
    .ds-rank__track-panel {
      gap: var(--ds-space-md);
      padding: var(--ds-space-md);
    }
    .ds-rank__track-panel > .ds-panel__header,
    .ds-rank__track-panel > .ds-panel__note { display: none; }
    .ds-rank__track-mobile-heading {
      display: block;
      margin: 0;
      color: var(--ds-text-secondary);
      font-weight: 700;
      letter-spacing: .08em;
      text-transform: uppercase;
    }
    .ds-rank__track-panel .ds-text-input {
      border: 1px solid var(--ds-border-strong); box-shadow: none;
    }
    .ds-rank__track-panel .ds-text-input::placeholder { color: transparent; }
    .ds-rank__track-sort-hint {
      display: block; margin: 0; color: var(--ds-text-secondary);
      font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line);
    }
    .ds-rank__track-focus-desktop { display: none; }
    .ds-rank__track-focus-mobile {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: var(--ds-space-sm);
      align-items: center;
      padding: var(--ds-space-sm);
      background: var(--ds-surface-selected);
    }
    .ds-rank__track-focus-copy { display: grid; gap: 2px; min-width: 0; }
    .ds-rank__track-focus-copy > * { margin: 0; }
    .ds-rank__track-focus-clear { align-self: center; white-space: nowrap; }

    /* Total is the other journey destination. Compose treats its standing as a compact section,
       not as another full panel with a duplicate engine badge. */
    .ds-rank__headline-panel {
      gap: var(--ds-space-md);
      padding: calc(var(--ds-space-sm) + var(--ds-space-xxs));
      border-bottom: 0;
    }
    .ds-rank[data-tab="total"][data-total-hero] .ds-rank__headline {
      margin-bottom: calc(var(--ds-space-lg) * -1);
    }
    .ds-rank__headline-panel .ds-panel__header { gap: 0; }
    .ds-rank__headline-panel .ds-panel__title {
      color: var(--ds-text-secondary);
      font-size: var(--ds-type-micro-size);
      line-height: var(--ds-type-micro-line);
      font-weight: 700;
      letter-spacing: .08em;
      text-transform: uppercase;
    }
    .ds-rank__headline-panel .ds-panel__actions { display: none; }
    .ds-rank__headline-panel .ds-stat-grid { grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-sm); }
    .ds-rank__headline-panel .ds-stat:first-child .ds-stat__label { display: none; }
    .ds-rank__headline-panel .ds-stat > .ds-engine-mark { display: inline-flex; justify-self: start; font-size: var(--ds-type-label-size); }
    .ds-rank__hero-explainer { display: block; margin: 0; color: var(--ds-text-secondary); }
    .ds-rank[data-tab="total"][data-scope="base"] .ds-rank__headline-panel .ds-stat__note,
    .ds-rank[data-tab="total"][data-scope="bcp"] .ds-rank__headline-panel .ds-stat__note,
    .ds-rank[data-tab="total"][data-scope="base"] .ds-rank__headline-panel .ds-stat:nth-child(2),
    .ds-rank[data-tab="total"][data-scope="bcp"] .ds-rank__headline-panel .ds-stat:nth-child(2) { display: none; }
    .ds-rank[data-tab="total"][data-scope="all"] .ds-rank__hero-explainer { display: none; }

    /* Ranking controls get their own last line. The identity can therefore use the complete first
       line instead of sharing or overlapping it with Compare / Main Player. */
    .ds-rank-standing .ds-table__cell[data-phone="name"],
    .ds-tournament-standing .ds-table__cell[data-phone="name"] { grid-column: 2 / -1; }

    /* The APK is the phone reference for shared Ranking surfaces. Its Total rows are two lines
       (Player, then total) and its medal board remains a labelled one-line table. The Web-only
       quick Compare control is intentionally absent here: the shared Filters / Comparison path
       still provides that action without making every result row three times as tall. */
    .ds-rank__standing-panel {
      gap: var(--ds-space-sm);
      padding: var(--ds-space-md);
    }
    .ds-rank[data-total-hero] .ds-rank__standing-panel[data-standing-kind="total"] {
      border-top: 0; padding: 0 calc(var(--ds-space-sm) + var(--ds-space-xxs))
        calc(var(--ds-space-sm) + var(--ds-space-xxs)); gap: var(--ds-space-md);
    }
    .ds-rank[data-total-hero] .ds-rank__standing-panel[data-standing-kind="total"] > .ds-panel__header {
      display: none;
    }
    .ds-rank__standing-panel[data-standing-kind="total"] .ds-podium {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .ds-rank__standing-panel[data-standing-kind="total"] .ds-podium__cell {
      display: grid; align-content: start; gap: 2px; padding: var(--ds-space-sm);
      background: var(--ds-surface-control);
    }
    .ds-rank__standing-panel[data-standing-kind="total"] .ds-podium__cell[data-kind="you"] {
      background: var(--ds-personal-wash);
    }
    .ds-rank__standing-panel[data-standing-kind="total"] .ds-podium__name,
    .ds-rank__standing-panel[data-standing-kind="total"] .ds-podium__value {
      font-size: var(--ds-type-micro-size); line-height: var(--ds-type-micro-line);
    }
    .ds-rank__standing-panel[data-standing-kind="total"] .ds-podium__name {
      text-decoration: none; font-weight: 400; color: var(--ds-text-body);
    }
    .ds-rank__standing-panel[data-standing-kind="total"] .ds-podium .ds-you-chip { display: none; }
    .ds-rank__standing-panel[data-standing-kind="total"] .ds-text-input {
      border: 1px solid var(--ds-border-strong); box-shadow: none;
    }
    .ds-rank__standing-panel[data-standing-kind="total"] .ds-text-input::placeholder { color: transparent; }
    .ds-rank-standing[data-standing-kind="total"] .ds-table__row { column-gap: var(--ds-space-sm); }
    .ds-rank__standing-panel .ds-panel__title {
      color: var(--ds-text-secondary);
      font-size: var(--ds-type-micro-size);
      line-height: var(--ds-type-micro-line);
      font-weight: 700;
      letter-spacing: .08em;
      text-transform: uppercase;
    }
    .ds-rank-standing[data-standing-kind="total"] .ds-tier-chip { display: none; }
    .ds-rank-standing[data-standing-kind="total"] .ds-table__name-text,
    .ds-rank-standing[data-standing-kind="medals"] .ds-table__name-text { text-decoration: none; }
    .ds-rank__standing-panel[data-standing-kind="medals"] {
      gap: var(--ds-space-sm);
      padding: var(--ds-space-md);
      border: 0;
      box-shadow: inset 0 0 0 1px var(--ds-border-subtle);
    }
    .ds-rank__standing-panel[data-standing-kind="medals"] .ds-panel__actions { display: none; }
    .ds-rank-standing[data-standing-kind="medals"] { row-gap: var(--ds-space-sm); }
    .ds-rank-standing[data-standing-kind="medals"] .ds-table__row {
      grid-template-columns: .45fr 1.6fr repeat(3, .5fr);
      grid-template-rows: auto;
      column-gap: var(--ds-space-sm);
      row-gap: 0;
      min-height: var(--ds-target-min-dense);
      padding: 0;
      border-bottom: 0;
      box-shadow: none;
    }
    .ds-rank-standing[data-standing-kind="medals"] .ds-table__row[data-head] {
      display: grid;
      min-height: var(--ds-target-min-dense);
      color: var(--ds-text-secondary);
    }
    .ds-rank-standing[data-standing-kind="medals"] .ds-table__cell[data-phone="rank"],
    .ds-rank-standing[data-standing-kind="medals"] .ds-table__cell[data-phone="name"],
    .ds-rank-standing[data-standing-kind="medals"] .ds-table__cell[data-phone="1"] {
      grid-row: 1;
    }
    .ds-rank-standing[data-standing-kind="medals"] .ds-table__cell[data-phone="name"] { grid-column: 2; }
    .ds-rank-standing[data-standing-kind="medals"] .ds-table__cell { text-align: left; }
    .ds-rank-standing[data-standing-kind="medals"] .ds-table__cell[data-key="gold"] { color: var(--ds-text-primary); }
    .ds-rank-standing[data-standing-kind="medals"] .ds-table__row[data-kind="you"] {
      background: transparent;
      color: var(--ds-text-body);
    }
    .ds-rank-standing[data-standing-kind="medals"] .ds-table__rank { color: var(--ds-text-secondary); }
    .ds-rank-standing[data-standing-kind="medals"] .ds-you-chip { display: none; }

    /* Values are stacked exactly like the APK. The view supplies two equal inline grid tracks when
       two Players share a line; one comparison keeps the generic full-width template. */
    .ds-rank__track-value {
      display: grid; align-content: center; justify-items: end; gap: 2px;
      max-width: 100%;
    }

    /* Mastery is a compact comparison matrix in Compose. Its bar is the background of the count
       cell, rather than a second row underneath every level. */
    .ds-rank__mastery-distribution {
      gap: var(--ds-space-sm);
      padding: calc(var(--ds-space-sm) + var(--ds-space-xxs));
    }
    .ds-rank__mastery-distribution > .ds-panel__header {
      display: grid; grid-template-columns: minmax(0, 1fr) auto;
      align-items: center; gap: var(--ds-space-sm);
    }
    .ds-rank__mastery-distribution .ds-panel__title {
      color: var(--ds-text-secondary); font-size: var(--ds-type-micro-size);
      line-height: var(--ds-type-micro-line); font-weight: 700;
      letter-spacing: .08em; text-transform: uppercase;
    }
    .ds-rank__mastery-distribution .ds-panel__actions > .ds-engine-mark,
    .ds-rank__mastery-distribution .ds-rank-mastery__help::before { display: none; }
    .ds-rank__mastery-distribution > .ds-panel__note { margin: 0; }
    .ds-rank-mastery .ds-table__row {
      grid-template-rows: auto;
      grid-template-columns: 82px repeat(1, minmax(0, 1fr));
      min-height: 42px;
      padding: 0;
      column-gap: 0;
    }
    .ds-rank-mastery[data-comparison-columns="2"] .ds-table__row {
      grid-template-columns: 82px repeat(2, minmax(0, 1fr));
    }
    .ds-rank-mastery[data-comparison-columns="3"] .ds-table__row {
      grid-template-columns: 4.5rem repeat(3, minmax(0, 1fr));
    }
    .ds-rank-mastery .ds-table__row[data-head] {
      display: grid; min-height: var(--ds-target-min); background: var(--ds-surface-control);
    }
    .ds-rank-mastery .ds-table__cell { grid-row: 1; min-width: 0; padding: 0 var(--ds-space-xs); }
    .ds-rank-mastery .ds-table__row:not([data-head]) .ds-table__cell:first-child { padding-left: 0; }
    .ds-rank-mastery .ds-table__cell[data-phone="name"] { grid-column: 1; }
    .ds-rank-mastery .ds-bar-row {
      position: relative;
      display: grid;
      place-items: center;
      width: 100%;
      min-height: 32px;
      overflow: hidden;
      background: var(--ds-surface-hover);
    }
    .ds-rank-mastery .ds-bar {
      position: absolute;
      inset: 0;
      width: 100%;
      min-width: 0;
      height: 100%;
      background: transparent;
    }
    .ds-rank-mastery .ds-bar__fill { min-width: 0; opacity: .38; }
    .ds-rank-mastery .ds-bar-row__value {
      position: relative; z-index: 1; width: 100%; padding-inline: var(--ds-space-sm);
      text-align: left; font-weight: 500;
    }

    /* Delta per track uses the same one-row identity/value matrix as Compose. The track title is
       kept to one line over the artwork, leaving the comparison columns alongside it. */
    .ds-rank-tracks .ds-table__row {
      grid-template-rows: auto;
      grid-template-columns: 6rem minmax(0, 1fr);
      min-height: 4.25rem;
      padding: 0;
      column-gap: var(--ds-space-xs);
    }
    .ds-rank-tracks[data-comparison-columns="2"] .ds-table__row {
      grid-template-columns: 6rem repeat(2, minmax(0, 1fr));
    }
    .ds-rank-tracks[data-comparison-columns="3"] .ds-table__row {
      grid-template-columns: 5.25rem repeat(3, minmax(0, 1fr));
    }
    .ds-rank-tracks .ds-table__row[data-head] {
      display: grid; min-height: var(--ds-target-min); padding-block: 0;
      background: var(--ds-surface-control);
    }
    .ds-rank-tracks .ds-sort--phone-label .ds-sort__label { display: none; }
    .ds-rank-tracks .ds-sort__phone-label { display: inline; min-width: 0; }
    .ds-rank-tracks .ds-sort { min-width: 0; line-height: 1.15; }
    .ds-rank-tracks .ds-table__cell { grid-row: 1; min-width: 0; }
    .ds-rank-tracks .ds-table__cell[data-phone="name"] { grid-column: 1; }
    .ds-rank-track { position: relative; display: block; width: 100%; overflow: hidden; }
    /* Match Compose's fixed 96 dp lead artwork. The size-qualified selector must outrank the
       later global 4.5rem `sm` rule or every track silently shrinks back to 72 px. */
    .ds-rank-track .ds-thumb[data-size="sm"] { width: 100%; }
    .ds-rank-track .ds-thumb__badge {
      inset: var(--ds-space-xxs) auto auto var(--ds-space-xxs);
      width: 18px; height: 18px;
    }
    .ds-rank-track > a {
      position: absolute;
      inset-inline: 0;
      bottom: 0;
      overflow: hidden;
      padding: 2px 4px;
      background: color-mix(in srgb, var(--ds-surface-app) 78%, transparent);
      color: var(--ds-text-primary);
      font-size: var(--ds-type-micro-size);
      line-height: var(--ds-type-micro-line);
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .ds-rank-track__engine.ds-engine-mark {
      position: absolute;
      top: 2px;
      right: 2px;
      min-height: 16px; gap: 2px; padding: 0 3px;
      background: var(--ds-engine-150);
      color: var(--ds-engine-on-fill);
      font-family: var(--ds-font-data);
      font-size: 10px;
      font-weight: 800;
      box-shadow: none;
    }
    .ds-rank-track__engine.ds-engine-mark .ds-engine-shape { width: 8px; height: 10px; }
    .ds-rank-track__engine[data-engine="200"] { background: var(--ds-engine-200); }
    .ds-rank__track-value { align-self: center; }
    .ds-rank__track-position { display: none; }

    /* The phone standing is the Compose four-column selector, not a condensed desktop record. */
    .ds-tournament-skill .ds-stat-grid { grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-md); }
    .ds-tournament-skill .ds-stat {
      display: flex;
      align-items: baseline;
      gap: 0;
    }
    .ds-tournament-skill .ds-stat__label {
      margin-inline-end: auto; font-weight: 400;
      font-size: var(--ds-type-body-s-size);
    }
    .ds-tournament-skill .ds-stat__value,
    .ds-tournament-skill .ds-stat[data-size="lg"] .ds-stat__value {
      font-size: var(--ds-type-data-l-size);
      line-height: var(--ds-type-data-l-line);
    }
    .ds-tournament-skill .ds-stat__note {
      color: var(--ds-text-primary);
      font-family: var(--ds-font-data);
      font-size: var(--ds-type-data-l-size);
      font-weight: 600;
    }
    .ds-tournament-skill .ds-stat__note::before { content: " · "; }
    .ds-tournament-skill .ds-stat[data-size="lg"] .ds-stat__note { display: none; }
    .ds-tournament-skill__profile {
      justify-self: start;
      color: var(--ds-action-primary);
      font-size: var(--ds-type-body-size); font-weight: 600;
      text-decoration: none;
    }
    .ds-rank .ds-tournament-picker__summary { display: none; }
    .ds-rank--tournament .ds-rank__status {
      position: static; order: 0; width: auto; height: auto; overflow: visible;
      clip: auto; clip-path: none; white-space: normal;
      margin: var(--ds-space-md) 0;
    }
    .ds-rank--tournament .ds-rank__content {
      display: grid; gap: var(--ds-space-md);
    }
    .ds-tournament-picker {
      display: grid;
      gap: var(--ds-space-sm);
      padding: var(--ds-space-md);
      margin-bottom: calc(var(--ds-space-md) + var(--ds-space-xs));
      border: 1px solid var(--ds-border-subtle);
      background: var(--ds-surface-raised);
    }
    .ds-tournament-picker > * { margin: 0; }
    .ds-tournament-picker .ds-panel__title,
    .ds-tournament-skill .ds-panel__title {
      color: var(--ds-text-secondary); font-size: var(--ds-type-micro-size);
      line-height: var(--ds-type-micro-line); font-weight: 700;
      letter-spacing: .08em; text-transform: uppercase;
    }
    .ds-tournament-picker .ds-tournament-picker__search {
      width: 100%;
      min-height: 54px;
      margin-top: var(--ds-space-sm);
      border: 1px solid var(--ds-border-strong); border-radius: 4px;
      box-shadow: none;
      color: var(--ds-text-primary);
      text-align: left;
    }
    .ds-tournament-picker__matches:empty { display: none; }
    .ds-tournament-picker__match {
      display: flex; justify-content: space-between; align-items: center;
      gap: var(--ds-space-sm); width: 100%; min-height: var(--ds-target-min);
      padding: var(--ds-space-xs); border: 0; border-bottom: 1px solid var(--ds-border-subtle);
      background: transparent; text-align: left;
    }
    .ds-tournament-picker__match > span { color: var(--ds-text-secondary); white-space: nowrap; }
    .ds-tournament-skill { gap: var(--ds-space-sm); padding: var(--ds-space-md); }
    .ds-tournament-skill .ds-rank__hero {
      display: flex; align-items: center; gap: var(--ds-space-sm);
      margin-bottom: 10px;
    }
    .ds-rank--tournament .ds-tournament-skill .ds-hero-rank {
      font-family: var(--ds-font-data); font-size: var(--ds-type-data-l-size);
      line-height: var(--ds-type-data-l-line); font-style: normal; font-weight: 600;
    }
    .ds-tournament-skill .ds-stat__value,
    .ds-tournament-skill .ds-stat[data-size="lg"] .ds-stat__value,
    .ds-tournament-skill .ds-stat__note {
      font-size: var(--ds-type-body-size); line-height: var(--ds-type-body-line);
    }
    /* Tournament track record follows the compact Compose panel and row rhythm. */
    .ds-rank--tournament .track-record { gap: var(--ds-space-sm); padding: var(--ds-space-md); }
    .ds-rank--tournament .track-record .ds-panel__title {
      color: var(--ds-text-secondary); font-size: var(--ds-type-micro-size);
      line-height: var(--ds-type-micro-line); font-weight: 700;
      letter-spacing: .08em; text-transform: uppercase;
    }
    .ds-rank--tournament .track-record__column { gap: var(--ds-space-xs); }
    .ds-rank--tournament .track-record__heading {
      font-size: var(--ds-type-body-size); line-height: var(--ds-type-body-line);
    }
    .ds-rank--tournament .track-record__hint { display: none; }
    .ds-rank--tournament .track-record__list { gap: 0; }
    .ds-rank--tournament .track-record__row {
      display: flex; gap: 10px; min-height: 62px; padding: 4px 0; border: 0;
    }
    .ds-rank--tournament .track-record__row > .activity-list__thumb {
      flex: 0 0 6rem; width: 6rem; box-sizing: border-box;
      border: 1px solid var(--ds-border-strong); border-radius: 4px;
    }
    .ds-rank--tournament .track-record__row .activity-list__cup {
      width: 1.25rem; height: 1.25rem;
    }
    .ds-rank--tournament .track-record__row .activity__mode {
      top: 1px; right: 1px; display: inline-flex; align-items: center;
      gap: 3px; min-width: 0; padding: 1px 3px; font-size: 10px;
    }
    .ds-rank--tournament .track-record__row .activity__mode::before {
      content: "›"; font-size: 1.5em; font-weight: 900; line-height: .8;
    }
    .ds-rank--tournament .track-record__text {
      display: block; flex: 1 1 0; min-width: 0;
    }
    .ds-rank--tournament .track-record__name {
      display: block; overflow: visible; font-size: var(--ds-type-body-s-size);
      line-height: var(--ds-type-body-s-line); text-overflow: clip; white-space: normal;
    }
    .ds-rank--tournament .track-record__facts {
      display: block; font-size: var(--ds-type-micro-size);
      line-height: var(--ds-type-micro-line);
    }
    .ds-rank--tournament .track-record__verdict {
      font-size: var(--ds-type-micro-size); line-height: var(--ds-type-micro-line);
    }
    .ds-rank--tournament .track-record__note--desktop { display: none; }
    .ds-rank--tournament .track-record__note--phone {
      display: block; margin: 0; color: var(--ds-text-secondary);
      font-size: var(--ds-type-micro-size); line-height: var(--ds-type-micro-line);
    }
    .ds-rank--tournament .track-record__deep-dive {
      margin: var(--ds-space-md) 0 0; border: 0; background: transparent;
    }
    .ds-rank--tournament .track-record__deep-dive[open] { border: 0; }
    .ds-rank--tournament .track-record__deep-dive > summary {
      justify-content: flex-start; min-height: var(--ds-target-min);
      padding: 0 var(--ds-space-sm); color: var(--ds-action-primary);
    }
    .ds-rank--tournament .track-record__deep-dive-heading { display: block; }
    .ds-rank--tournament .track-record__deep-dive-title,
    .ds-rank--tournament .track-record__deep-dive-subtitle,
    .ds-rank--tournament .track-record__deep-dive-chevron { display: none; }
    .ds-rank--tournament .track-record__deep-dive-phone-title {
      display: block; color: var(--ds-action-primary); font-size: var(--ds-type-body-s-size);
      line-height: var(--ds-type-body-s-line); font-weight: 600;
    }
    .ds-rank--tournament .track-record__deep-dive > summary:hover .track-record__deep-dive-phone-title,
    .ds-rank--tournament .track-record__deep-dive > summary:focus-visible .track-record__deep-dive-phone-title {
      text-decoration: underline;
    }
    .ds-rank--tournament .track-record__deep-dive-bar { padding: 0; }
    .ds-rank--tournament .track-record__count {
      margin: 0 0 4px; font-size: var(--ds-type-micro-size);
    }
    .ds-rank--tournament .track-record__share { display: none; }
    .ds-rank--tournament .track-record__deep-dive .track-record__scroller { padding: 0; }
    .ds-rank--tournament .track-record__table {
      width: 720px; table-layout: fixed; font-size: var(--ds-type-micro-size);
    }
    .ds-rank--tournament .track-record__table th,
    .ds-rank--tournament .track-record__table td {
      box-sizing: border-box; padding: 3px 4px; border: 0;
    }
    .ds-rank--tournament .track-record__table :is(th, td):first-child { padding-left: 0; }
    .ds-rank--tournament .track-record__table thead tr:first-child th:first-child { padding-left: 12px; }
    .ds-rank--tournament .track-record__table :is(th, td):nth-child(1) { width: 190px; }
    .ds-rank--tournament .track-record__table :is(th, td):nth-child(2) { width: 110px; }
    .ds-rank--tournament .track-record__table :is(th, td):nth-child(3),
    .ds-rank--tournament .track-record__table :is(th, td):nth-child(4),
    .ds-rank--tournament .track-record__table :is(th, td):nth-child(5) { width: 76px; }
    .ds-rank--tournament .track-record__table :is(th, td):nth-child(6) { width: 88px; }
    .ds-rank--tournament .track-record__table :is(th, td):nth-child(7) { width: 104px; }
    .ds-rank--tournament .track-record__table thead th {
      font-size: var(--ds-type-micro-size); letter-spacing: 0; text-transform: none;
    }
    .ds-rank--tournament .track-record__table th[scope="row"] { display: table-cell; }
    .ds-rank--tournament .track-record__track-link { gap: 6px; white-space: nowrap; }
    .ds-rank--tournament .track-record__track-link > span:last-child {
      overflow: hidden; text-overflow: ellipsis; text-decoration: underline;
    }
    .ds-rank--tournament .track-record__track-icon { width: 52px; height: 29px; }
    .ds-rank--tournament .track-record__track-mode {
      position: absolute; top: 0; left: 0; display: block;
      box-sizing: border-box; width: 100%; padding: 0 2px; background: var(--ds-engine-150);
      color: var(--ds-engine-on-fill); font-size: 10px; line-height: 14px;
      font-weight: 800; white-space: nowrap;
    }
    .ds-rank--tournament .track-record__track-mode::before { content: "› 150cc"; }
    .ds-rank--tournament .track-record__cup-icon { display: none; }
    .ds-rank--tournament .track-record__filter {
      min-height: 54px; padding: var(--ds-space-sm);
      font-size: var(--ds-type-body-s-size);
    }
    .ds-rank--tournament .ds-tournament-competitors {
      gap: var(--ds-space-md); padding: var(--ds-space-md);
    }
    .ds-rank--tournament .ds-tournament-competitors .ds-panel__title {
      color: var(--ds-text-secondary); font-size: var(--ds-type-micro-size);
      line-height: var(--ds-type-micro-line); font-weight: 700;
      letter-spacing: .08em; text-transform: uppercase;
    }
    .ds-tournament-competitors > .ds-table { display: block; margin-top: var(--ds-space-sm); }
    .ds-tournament-competitors .ds-table__row:not([data-head]) {
      display: grid; grid-template-columns: minmax(0, 1fr) auto;
      grid-template-rows: auto 5px auto; column-gap: var(--ds-space-sm);
      row-gap: var(--ds-space-sm); min-height: 0; padding: var(--ds-space-sm) 0;
      margin-bottom: var(--ds-space-md); border: 0;
    }
    .ds-tournament-competitors .ds-table__cell[data-key="player"] {
      grid-column: 1; grid-row: 1; font-weight: 700;
    }
    .ds-tournament-competitors .ds-table__cell[data-key="player"] a { text-decoration: none; }
    .ds-tournament-competitors .ds-table__cell[data-key="player"] a:focus-visible { text-decoration: underline; }
    .ds-tournament-competitors .ds-table__cell[data-key="record"] {
      grid-column: 2; grid-row: 1; color: var(--ds-text-primary); font-weight: 700;
    }
    .ds-tournament-competitors .ds-table__cell[data-key="share"] {
      grid-column: 1 / -1; grid-row: 2; align-self: stretch;
    }
    .ds-tournament-competitors .ds-table__cell[data-key="share"] .ds-bar-row,
    .ds-tournament-competitors .ds-table__cell[data-key="share"] .ds-bar { height: 5px; }
    .ds-tournament-competitors .ds-table__cell[data-key="share"] .ds-bar__fill {
      background: var(--ds-delta-faster);
    }
    .ds-tournament-competitors .ds-table__cell[data-key="share"] .ds-bar-row__value { display: none; }
    .ds-tournament-competitors .ds-table__cell[data-key="shared"] {
      grid-column: 1; grid-row: 3; color: var(--ds-text-secondary);
      font-family: var(--ds-font-ui); font-size: var(--ds-type-body-s-size);
    }
    .ds-tournament-competitors .ds-table__cell[data-key="shared"]::after { content: " races"; }
    .ds-tournament-competitors .ds-table__cell[data-key="delta"] {
      grid-column: 2; grid-row: 3; font-weight: 700;
    }
    .ds-rank--tournament .ds-tournament-finishes {
      gap: var(--ds-space-md); padding: var(--ds-space-md);
    }
    .ds-rank--tournament .ds-tournament-finishes .ds-panel__title {
      color: var(--ds-text-secondary); font-size: var(--ds-type-micro-size);
      line-height: var(--ds-type-micro-line); font-weight: 700;
      letter-spacing: .08em; text-transform: uppercase;
    }
    .ds-tournament-finishes .ds-tournament-finishes__phone-intro { display: block; margin: 0; }
    .ds-tournament-finishes .ds-chart-block { gap: 6px; }
    .ds-tournament-finishes .ds-chart {
      gap: 2px; min-height: 96px; overflow-x: visible;
    }
    .ds-tournament-finishes .ds-chart[data-group-spacing="wide"] { gap: 2px; }
    .ds-tournament-finishes .ds-chart__column { min-width: 0; gap: 2px; }
    .ds-tournament-finishes .ds-chart__bars { height: 78px; gap: 1px; }
    .ds-tournament-finishes .ds-chart__label { font-size: 9px; }
    .ds-rank--tournament .ds-tournament-outcomes {
      gap: var(--ds-space-md); padding: var(--ds-space-md);
    }
    .ds-rank--tournament .ds-tournament-outcomes .ds-panel__title {
      color: var(--ds-text-secondary); font-size: var(--ds-type-micro-size);
      line-height: var(--ds-type-micro-line); font-weight: 700;
      letter-spacing: .08em; text-transform: uppercase;
    }
    .ds-tournament-outcomes > .ds-table { display: none; }
    .ds-tournament-outcomes .ds-tournament-outcomes__phone {
      display: grid; gap: 6px; margin-top: var(--ds-space-sm);
    }
    .ds-tournament-outcomes__legend { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
    .ds-tournament-outcomes__legend-item {
      display: inline-flex; align-items: center; gap: 4px;
      color: var(--ds-text-secondary); font-size: var(--ds-type-micro-size);
    }
    .ds-tournament-outcomes__swatch { width: 9px; height: 9px; border-radius: 2px; }
    .ds-tournament-outcomes__swatch[data-tone="win"] { background: var(--ds-rank-gold); }
    .ds-tournament-outcomes__swatch[data-tone="podium"] { background: var(--ds-rank-silver); }
    .ds-tournament-outcomes__swatch[data-tone="rest"] { background: var(--ds-surface-selected); }
    .ds-tournament-outcomes__row {
      display: grid; grid-template-columns: 72px minmax(0, 1fr) 78px;
      align-items: center; min-height: 30px;
    }
    .ds-tournament-outcomes__name {
      overflow: hidden; color: var(--ds-text-primary); font-size: var(--ds-type-body-s-size);
      font-weight: 700; text-overflow: ellipsis; white-space: nowrap;
    }
    .ds-tournament-outcomes__row .ds-split {
      width: 100%; height: 12px; min-width: 0; overflow: hidden; border-radius: 3px;
    }
    .ds-tournament-outcomes__rates {
      padding-left: 6px; color: var(--ds-text-secondary); font-size: var(--ds-type-body-s-size);
      text-align: left; white-space: nowrap;
    }
    .ds-rank--tournament .ds-tournament-points {
      gap: var(--ds-space-md); padding: var(--ds-space-md);
    }
    .ds-rank--tournament .ds-tournament-points .ds-panel__title {
      color: var(--ds-text-secondary); font-size: var(--ds-type-micro-size);
      line-height: var(--ds-type-micro-line); font-weight: 700;
      letter-spacing: .08em; text-transform: uppercase;
    }
    .ds-tournament-points > .ds-table { display: none; }
    .ds-tournament-points .ds-tournament-points__phone {
      display: grid; gap: 6px; margin-top: var(--ds-space-sm);
    }
    .ds-tournament-points__row {
      display: grid; grid-template-columns: 72px minmax(0, 1fr) 44px;
      align-items: center; min-height: 30px;
    }
    .ds-tournament-points__name {
      overflow: hidden; color: var(--ds-text-primary); font-size: var(--ds-type-body-s-size);
      font-weight: 700; text-overflow: ellipsis; white-space: nowrap;
    }
    .ds-tournament-points__bar {
      position: relative; display: block; height: 12px; min-width: 0;
      overflow: hidden; border-radius: 3px; background: var(--ds-surface-selected);
    }
    .ds-tournament-points__fill {
      display: block; width: var(--ds-point-share); height: 100%; background: var(--ds-group-champion);
    }
    .ds-tournament-points__fill[data-series="2"] { background: var(--ds-group-talent); }
    .ds-tournament-points__fill[data-series="3"] { background: var(--ds-group-wild); }
    .ds-tournament-points__average {
      position: absolute; top: 0; bottom: 0; left: var(--ds-point-average);
      width: 2px; background: var(--ds-text-secondary);
    }
    .ds-tournament-points__rate {
      padding-left: 6px; color: var(--ds-text-secondary);
      font-size: var(--ds-type-body-s-size); white-space: nowrap;
    }
    .ds-rank--tournament .ds-tournament-standing-panel { gap: var(--ds-space-md); padding: 12px; }
    .ds-tournament-standing-panel .ds-panel__title {
      color: var(--ds-text-secondary); font-size: var(--ds-type-micro-size);
      line-height: var(--ds-type-micro-line); font-weight: 700;
      letter-spacing: .08em; text-transform: uppercase;
    }
    .ds-tournament-standing__desktop-intro,
    .ds-tournament-standing__desktop-away { display: none; }
    .ds-tournament-standing__phone-intro,
    .ds-tournament-standing__phone-away,
    .ds-tournament-standing__phone-rivals { display: block; margin: 0; color: var(--ds-text-secondary); }
    .ds-tournament-standing__scroll {
      max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin;
    }
    .ds-tournament-standing {
      display: block; width: max-content; min-width: 100%; font-size: 11px;
    }
    .ds-tournament-standing .ds-table__row {
      display: grid; grid-template-columns: 28px 220px 60px 46px 50px 46px 48px 48px;
      grid-template-rows: auto; width: max-content; min-width: 100%; min-height: 54px;
      padding: 3px 0; column-gap: 0; row-gap: 0; border-bottom: 0;
    }
    .ds-tournament-standing .ds-table__row[data-head] {
      display: grid; min-height: 28px; padding-bottom: 4px; border-bottom: 0;
    }
    .ds-tournament-standing .ds-table__cell {
      display: block; grid-row: 1; min-width: 0; padding: 0 3px;
    }
    .ds-tournament-standing .ds-table__row[data-head] > .ds-table__cell {
      font-size: 10px; font-weight: 700;
    }
    .ds-tournament-standing .ds-table__cell[data-align="num"] { text-align: right; }
    .ds-tournament-standing .ds-table__cell[data-key="rank"] { grid-column: 1; }
    .ds-tournament-standing .ds-table__cell[data-key="player"] { grid-column: 2; }
    .ds-tournament-standing .ds-table__cell[data-key="score"] { grid-column: 3; }
    .ds-tournament-standing .ds-table__cell[data-key="score"] { padding-right: 6px; }
    .ds-tournament-standing .ds-table__cell[data-key="tournaments"] { grid-column: 4; }
    .ds-tournament-standing .ds-table__cell[data-key="races"] { grid-column: 5; }
    .ds-tournament-standing .ds-table__cell[data-key="wins"] { grid-column: 6; }
    .ds-tournament-standing .ds-table__cell[data-key="podiums"] { grid-column: 7; }
    .ds-tournament-standing .ds-table__cell[data-key="average"] { grid-column: 8; }
    .ds-tournament-standing .ds-table__cell[data-key="pick"] {
      display: flex; align-items: center; grid-column: 2; grid-row: 1; z-index: 1;
    }
    .ds-tournament-standing .ds-table__row[data-head] .ds-table__cell[data-key="pick"] { display: none; }
    .ds-tournament-standing .ds-table__row:not([data-head]) .ds-table__cell[data-key="player"] {
      padding-left: 52px;
    }
    .ds-tournament-standing .ds-table__row .ds-table__rank { color: var(--ds-text-body); font-weight: 400; }
    .ds-tournament-standing__desktop-rank { display: none; }
    .ds-tournament-standing__phone-rank { display: inline; }
    .ds-tournament-standing .ds-table__name-inner { gap: 4px; }
    .ds-tournament-standing .ds-table__name-text { font-size: 11px; font-weight: 600; }
    .ds-tournament-standing .ds-table__name-inner > .ds-chip[data-tone="warning"] { display: none; }
    .ds-tournament-standing .ds-tournament-standing__phone-away-mark { display: inline; margin-left: -4px; }
    .ds-tournament-standing .ds-tier-chip { font-size: 10px; text-transform: uppercase; }
    .ds-tournament-standing .ds-you-chip { display: none; }
    .ds-tournament-standing .ds-table__row[data-podium] { box-shadow: none; }
    .ds-tournament-standing .ds-table__row[data-compare-series="1"] { box-shadow: inset 2px 0 0 var(--ds-group-champion); }
    .ds-tournament-standing .ds-table__row[data-compare-series="2"] { box-shadow: inset 2px 0 0 var(--ds-group-talent); }
    .ds-tournament-standing .ds-table__row[data-compare-series="3"] { box-shadow: inset 2px 0 0 var(--ds-group-wild); }
    .ds-tournament-standing .ds-table__row[data-rival="true"]:not([data-selected="true"]) {
      box-shadow: inset 2px 0 0 var(--ds-status-info);
    }
    .ds-tournament-standing .ds-table__cell[data-key="pick"] > [data-phone-symbol] {
      display: grid; place-items: center; width: 40px; min-width: 40px; height: 32px;
      overflow: hidden; padding: 0; border-radius: 9px; clip-path: none;
      color: transparent; font-size: 0; box-shadow: inset 0 0 0 1px var(--ds-border-strong);
    }
    .ds-tournament-standing .ds-table__cell[data-key="pick"] > .ds-filter-chip[aria-pressed="true"] {
      background: color-mix(in srgb,
        color-mix(in srgb, var(--ds-surface-raised) 70%, var(--ds-text-secondary) 30%) 93%,
        var(--ds-action-primary) 7%);
      box-shadow: none;
    }
    [data-appearance="light"] .ds-tournament-standing .ds-table__cell[data-key="pick"] > .ds-filter-chip[aria-pressed="true"] {
      background: color-mix(in srgb, var(--ds-surface-raised) 82%, var(--ds-group-wild) 18%);
    }
    .ds-tournament-standing .ds-table__cell[data-key="pick"] > .ds-chip[data-phone-symbol] {
      background: color-mix(in srgb, var(--ds-personal-wash) 78%, var(--ds-text-secondary) 22%);
      box-shadow: none;
    }
    .ds-tournament-standing .ds-table__cell[data-key="pick"] > [data-phone-symbol][aria-pressed="true"]::before { display: none; }
    .ds-tournament-standing .ds-table__cell[data-key="pick"] > [data-phone-symbol]::after {
      content: attr(data-phone-symbol); color: var(--ds-text-primary);
      position: static; opacity: 1; box-shadow: none; font-size: 12px; line-height: 1;
    }
    .ds-tournament-standing .ds-table__cell[data-key="pick"] > .ds-chip[data-phone-symbol]::after {
      color: var(--ds-group-champion);
    }
  }
  .ds-split { display: flex; height: 10px; min-width: 3rem; background: var(--ds-surface-hover); }
  .ds-split__part { display: block; width: var(--ds-split-share, 0%); height: 100%; background: var(--ds-text-tertiary); }
  .ds-split__part[data-tone="win"] { background: var(--ds-rank-gold); }
  .ds-split__part[data-tone="podium"] { background: var(--ds-rank-silver); }
  .ds-split__part[data-tone="rest"] { background: var(--ds-surface-selected); }
  .ds-chart-block { display: grid; gap: var(--ds-space-md); min-width: 0; }
  .ds-chart { position: relative; display: flex; align-items: flex-end; gap: 3px; min-height: 120px; overflow-x: auto; }
  .ds-chart[data-group-spacing="wide"] { gap: var(--ds-space-sm); }
  .ds-chart__column { display: grid; gap: 4px; justify-items: center; flex: 1 1 0; min-width: 18px; }
  .ds-chart__bars { display: flex; align-items: flex-end; gap: 2px; width: 100%; height: 96px; }
  .ds-chart__bar { flex: 1 1 0; height: var(--ds-chart-height, 0%); min-height: 1px; background: var(--ds-group-champion); }
  .ds-chart__bar[data-series="2"] { background: var(--ds-group-talent); }
  .ds-chart__bar[data-series="3"] { background: var(--ds-group-wild); }
  .ds-chart__label { font-family: var(--ds-font-data); font-size: var(--ds-type-micro-size); color: var(--ds-text-tertiary); }
  .ds-chart__average {
    position: absolute; left: 0; right: 0; bottom: calc(var(--ds-chart-average, 0%) * 0.8);
    border-top: 1px dashed var(--ds-border-strong); font-family: var(--ds-font-ui);
    font-size: var(--ds-type-micro-size); color: var(--ds-text-tertiary); pointer-events: none;
  }

  /* One trajectory language (§15, OD-03): rating history and career use the same chart. */
  .ds-line-chart { display: grid; gap: var(--ds-space-xs); min-width: 0; }
  .ds-line {
    display: block; width: 100%; height: auto; min-height: 8rem; overflow: visible;
    color: var(--ds-text-tertiary); touch-action: pan-y;
  }
  .ds-line:focus-visible { outline: var(--ds-focus-width) solid var(--ds-focus-ring); outline-offset: 2px; }
  .ds-line__tick { stroke: var(--ds-border-subtle); stroke-width: 1; }
  .ds-line__tick-label {
    fill: var(--ds-text-tertiary); font-family: var(--ds-font-data);
    font-size: var(--ds-type-micro-size);
  }
  .ds-line__path {
    fill: none; stroke: var(--ds-personal-edge); stroke-width: 2.5;
    stroke-linecap: round; stroke-linejoin: round;
  }
  .ds-line__dot {
    fill: var(--ds-surface-raised); stroke: var(--ds-personal-edge); stroke-width: 2;
  }
  .ds-line[data-density="dense"] .ds-line__dot { stroke-width: 1; }
  .ds-line__dot[data-kind="seed"] { fill: var(--ds-rank-gold); stroke: var(--ds-surface-app); }
  .ds-line__marker {
    fill: var(--ds-action-primary); stroke: var(--ds-action-on-primary); stroke-width: 2;
    pointer-events: none;
  }
  .ds-line__readout {
    min-height: var(--ds-type-body-s-line); margin: 0; color: var(--ds-text-secondary);
    font-family: var(--ds-font-data); font-size: var(--ds-type-body-s-size);
    font-variant-numeric: tabular-nums;
  }
  .ds-profile-career { min-width: 0; }
  .ds-profile-career > [role="status"]:empty { display: none; }
  .ds-profile-career__rating-summary {
    margin: 0; color: var(--ds-text-secondary); font-family: var(--ds-font-data);
    font-size: var(--ds-type-body-s-size); font-variant-numeric: tabular-nums;
  }
  .ds-profile { padding: 0; border: 0; border-radius: 0; background: transparent; }
  .ds-profile-actions { margin-bottom: var(--ds-space-lg); }
  .ds-profile-actions .ds-button[aria-pressed="true"] {
    color: var(--ds-text-primary); background: var(--ds-personal-wash);
    box-shadow: inset 3px 0 0 var(--ds-personal-edge);
  }
  .ds-profile .ds-hero__thumb { width: 7rem; }
  .ds-profile :where(.ds-hero__thumb-art) {
    object-fit: contain; background: color-mix(in oklab, var(--ds-surface-raised) 82%, transparent);
  }
  .ds-profile__handle {
    margin: 0; color: var(--ds-text-secondary); font-family: var(--ds-font-data);
    font-size: var(--ds-type-label-size); font-variant-numeric: tabular-nums;
  }
  .ds-profile__flag { width: 1.5rem; height: auto; border: 1px solid var(--ds-border-subtle); }
  .ds-profile__rating {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-xs);
    align-self: stretch; max-width: 100%; margin: 0; color: var(--ds-text-primary);
    /* This is a sentence with tabular values, not one indivisible number. Override the global
       ds-data-m nowrap rule so Dutch copy and the tier can take a second line on a 320 px phone. */
    white-space: normal; overflow-wrap: anywhere;
  }
  .ds-profile__rating[hidden] { display: none; }
  .ds-profile__loadout {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: var(--ds-space-sm); min-width: 0;
  }
  .ds-profile__loadout-item {
    display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); align-items: center;
    gap: var(--ds-space-sm); min-width: 0; margin: 0; padding: var(--ds-space-sm);
    background: var(--ds-surface-control); border: 1px solid var(--ds-border-subtle);
  }
  .ds-profile__loadout-item img { width: 3.5rem; height: 3.5rem; object-fit: contain; }
  .ds-profile__loadout-item figcaption {
    min-width: 0; overflow-wrap: anywhere; color: var(--ds-text-primary);
    font-size: var(--ds-type-label-size); font-weight: 600;
  }
  .ds-profile__aliases {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    gap: var(--ds-space-sm); margin: 0; padding: 0; list-style: none;
  }
  .ds-profile__aliases li {
    display: grid; gap: var(--ds-space-xxs); min-width: 0; padding: var(--ds-space-md);
    background: var(--ds-surface-control); border: 1px solid var(--ds-border-subtle);
  }
  .ds-profile__aliases strong { overflow-wrap: anywhere; color: var(--ds-text-primary); }
  .ds-profile__aliases span { color: var(--ds-text-secondary); font-size: var(--ds-type-label-size); }
  .ds-profile-results__identity { flex-wrap: wrap; }
  .ds-profile-results__track {
    display: inline-flex; align-items: center; gap: var(--ds-space-sm); min-width: 0; max-width: 100%;
  }
  .ds-profile-results__track .ds-thumb { flex: 0 0 auto; }
  .ds-profile-results__actions { display: inline-flex; align-items: center; flex: 0 0 auto; }
  .ds-profile-results__time { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--ds-space-xs); }

  /* Profile Time Trial management (W26): one modal task, not a legacy panel nested in a row. */
  .ds-manage__status { margin: 0; min-height: var(--ds-type-body-s-line); }
  /* ADR-0225: "Carried from <community> - originally <date>"; a long address wraps instead of widening the panel. */
  .ds-chip.ds-carried-from {
    justify-self: start; align-self: flex-start; max-width: 100%; padding-block: 4px;
    line-height: 1.3; white-space: normal; overflow-wrap: anywhere;
  }
  .ds-manage__facts {
    display: grid; grid-template-columns: minmax(8rem, auto) minmax(0, 1fr);
    gap: var(--ds-space-xs) var(--ds-space-lg); margin: 0;
  }
  .ds-manage__facts dt { color: var(--ds-text-tertiary); }
  .ds-manage__facts dd { margin: 0; color: var(--ds-text-primary); font-family: var(--ds-font-data); overflow-wrap: anywhere; }
  .ds-manage__history { display: grid; gap: var(--ds-space-xs); margin: 0; padding: 0; list-style: none; }
  .ds-manage__history li {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--ds-space-sm);
    padding-block: var(--ds-space-xs); border-bottom: 1px solid var(--ds-border-subtle);
  }
  .ds-manage__when { color: var(--ds-text-tertiary); font-family: var(--ds-font-data); white-space: nowrap; }
  .ds-manage__form { padding-top: var(--ds-space-lg); border-top: 1px solid var(--ds-border-subtle); }
  .ds-manage__form > h3 { color: var(--ds-text-primary); }
  /* ADR-0225: "Publish" a run waiting for review, behind one short confirmation line. */
  .ds-manage__confirmation { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm); }
  .ds-manage__confirmation[hidden] { display: none; }
  .ds-manage__confirm { margin: 0; flex: 1 1 100%; color: var(--ds-text-primary); }
  .ds-manage__laps { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: var(--ds-space-sm); }
  /* Fix this result is the Post a Time form in a dialog: one column (the checks under the form),
     never the page layout's side-by-side columns (owner 2026-09-28). */
  .ds-manage__edit .ds-post__columns { grid-template-columns: minmax(0, 1fr); }
  @media (max-width: 599px) {
    .ds-profile-results__track .ds-thumb { display: none; }
    .ds-profile-results__time { justify-content: flex-start; }
    .ds-manage__facts { grid-template-columns: minmax(0, 1fr); }
    .ds-manage__facts dd { margin-bottom: var(--ds-space-xs); }
  }

  /* Track Mastery (W27): calm profile data, one engine context and a readable 96-track grid. */
  .ds-mastery__status { margin: 0; }
  .ds-mastery__detail[hidden] { display: none; }
  .ds-mastery__detail-identity { display: flex; align-items: center; gap: var(--ds-space-md); min-width: 0; }
  .ds-mastery__detail-summary { margin: 0; color: var(--ds-text-secondary); }
  .ds-mastery__next-tier { white-space: normal; overflow-wrap: anywhere; }
  .ds-mastery__cup { display: grid; gap: var(--ds-space-sm); min-width: 0; }
  .ds-mastery__cup-title {
    display: flex; align-items: center; gap: var(--ds-space-sm); margin: 0;
    color: var(--ds-text-primary); font-size: var(--ds-type-body-size); font-weight: 600;
  }
  .ds-mastery__cup-icon { width: 2rem; height: 2rem; object-fit: contain; }
  .ds-mastery__tracks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
  .ds-mastery__track {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto;
    align-items: center; gap: 4px var(--ds-space-xs); min-height: var(--ds-target-min); min-width: 0;
    padding: var(--ds-space-sm); border: 0; text-align: left; cursor: pointer;
    background: var(--ds-surface-control); color: var(--ds-text-body);
    box-shadow: inset 0 0 0 1px var(--ds-border-subtle);
  }
  .ds-mastery__track:hover, .ds-mastery__track:focus-visible { background: var(--ds-surface-hover); }
  .ds-mastery__track[aria-expanded="true"] { box-shadow: inset 3px 0 0 var(--ds-personal-edge), inset 0 0 0 1px var(--ds-border-strong); }
  .ds-mastery__track[data-unplayed] { color: var(--ds-text-tertiary); }
  .ds-mastery__track-name {
    grid-column: 1 / -1; min-width: 0; overflow-wrap: anywhere;
    font-family: var(--ds-font-ui); font-size: var(--ds-type-label-size); font-weight: 600;
  }
  .ds-mastery__track .ds-tier-chip { justify-self: start; max-width: 100%; }
  .ds-mastery__track .ds-data-s { justify-self: end; white-space: nowrap; }
  @media (max-width: 1099px) { .ds-mastery__tracks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 359px) { .ds-mastery__tracks { grid-template-columns: minmax(0, 1fr); } }
  @media (forced-colors: active) { .ds-mastery__track { border: 1px solid CanvasText; } }

  /* W05 · Onboarding. Workflow hooks remain local; all visual primitives are the shared system. */
  .ds-welcome {
    box-sizing: border-box;
    width: 100%;
    max-width: 38rem;
    margin: var(--ds-space-2xl) auto var(--ds-space-3xl);
    padding-inline: var(--ds-gutter-phone);
  }
  .ds-welcome .welcome__stepper { margin: 0; color: var(--ds-action-primary); }
  .ds-welcome .welcome__stepper[hidden],
  .ds-welcome .welcome__flag[hidden],
  .ds-welcome .welcome__icon[hidden],
  .ds-welcome .welcome__handle-edit[hidden] { display: none; }
  .ds-welcome .welcome__heading { margin: 0; text-wrap: balance; }
  .ds-welcome .welcome__lede { margin: 0; color: var(--ds-text-secondary); }
  .ds-welcome .welcome__status { margin: 0; color: var(--ds-text-secondary); }
  .ds-welcome .welcome__status:empty,
  .ds-welcome .welcome__error:empty { display: none; }
  .ds-welcome .welcome__stage,
  .ds-welcome .welcome__form { gap: var(--ds-space-lg); }
  .ds-welcome .welcome__panel { gap: var(--ds-space-md); }
  .ds-welcome .welcome__body { margin: 0; color: var(--ds-text-secondary); }
  .ds-welcome .welcome__field { gap: var(--ds-space-xs); }
  .ds-welcome .welcome__row { display: flex; align-items: center; gap: var(--ds-space-sm); }
  .ds-welcome .welcome__row .welcome__control { flex: 1 1 auto; min-width: 0; }
  .ds-welcome .welcome__control { width: 100%; }
  .ds-welcome .welcome__control--name {
    min-height: var(--ds-button-height-lg);
    padding-inline: var(--ds-space-lg);
    font-family: var(--ds-font-display);
    font-size: var(--ds-type-title-size);
    font-weight: 700;
  }
  .ds-welcome .welcome__control--handle { max-width: 14rem; }
  .ds-welcome .welcome__flag { width: 2rem; height: auto; }
  .ds-welcome .welcome__icon { width: 2.5rem; height: 2.5rem; object-fit: contain; }
  .ds-welcome .welcome__handle { font-size: var(--ds-type-body-s-size); color: var(--ds-text-secondary); }
  .ds-welcome .welcome__handle[data-state="good"] { color: var(--ds-status-success); font-weight: 700; }
  .ds-welcome .welcome__handle[data-state="bad"] { color: var(--ds-status-warning); }
  .ds-welcome .welcome__choices {
    display: grid;
    gap: var(--ds-space-sm);
    margin: 0;
    padding: 0;
    border: 0;
  }
  .ds-welcome .welcome__choice {
    display: flex;
    gap: var(--ds-space-sm);
    align-items: flex-start;
    padding: var(--ds-space-md);
    background: var(--ds-surface-raised);
    color: var(--ds-text-body);
    box-shadow: inset 0 0 0 1px var(--ds-border-subtle);
    cursor: pointer;
  }
  .ds-welcome .welcome__choice:has(input:checked) {
    background: var(--ds-personal-wash);
    box-shadow: inset 3px 0 0 var(--ds-personal-edge), inset 0 0 0 1px var(--ds-border-strong);
  }
  .ds-welcome .welcome__choice input {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: var(--ds-space-xxs);
    accent-color: var(--ds-action-primary);
  }
  .ds-welcome .welcome__choice-text { display: grid; gap: var(--ds-space-xxs); }
  .ds-welcome .welcome__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ds-space-sm);
    align-items: center;
  }
  .ds-welcome .welcome__actions--stacked { flex-direction: column; align-items: stretch; }
  .ds-welcome .welcome__actions--stacked > .welcome__button { width: 100%; }
  .ds-welcome .welcome__button:disabled,
  .ds-welcome .welcome__link:disabled { opacity: .5; cursor: not-allowed; }
  .ds-welcome .welcome__link { align-self: flex-start; }
  .ds-welcome .welcome__results {
    display: grid;
    gap: var(--ds-space-xs);
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .ds-welcome .welcome__result {
    display: grid;
    gap: var(--ds-space-xxs);
    width: 100%;
    min-height: var(--ds-target-min);
    padding: var(--ds-space-sm) var(--ds-space-md);
    border: 0;
    background: var(--ds-surface-raised);
    color: var(--ds-text-body);
    box-shadow: inset 0 0 0 1px var(--ds-border-subtle);
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .ds-welcome .welcome__result:hover,
  .ds-welcome .welcome__result:focus-visible { background: var(--ds-surface-hover); }
  .ds-welcome .welcome__result-name { font-size: var(--ds-type-body-size); }
  .ds-welcome .welcome__result-detail,
  .ds-welcome .welcome__result-context,
  .ds-welcome .welcome__empty { color: var(--ds-text-tertiary); font-size: var(--ds-type-body-s-size); }
  .ds-welcome .welcome__result-context { overflow-wrap: anywhere; }
  .ds-welcome .welcome__group {
    margin-top: var(--ds-space-xs);
    color: var(--ds-text-secondary);
    font-size: var(--ds-type-body-s-size);
    font-weight: 600;
  }
  .ds-welcome .welcome__confirm {
    display: grid;
    gap: var(--ds-space-sm);
    padding: var(--ds-space-lg);
    background: var(--ds-personal-wash);
    box-shadow: inset 3px 0 0 var(--ds-personal-edge), inset 0 0 0 1px var(--ds-border-subtle);
  }
  .ds-welcome .welcome__confirm-name { margin: 0; font-family: var(--ds-font-display); font-size: var(--ds-type-title-size); }
  @media (max-width: 599px) {
    .ds-welcome { margin-block: var(--ds-space-lg) var(--ds-space-2xl); }
    .ds-welcome .welcome__actions > .ds-button { width: 100%; }
  }
  @media (min-width: 600px) { .ds-welcome { padding-inline: var(--ds-gutter-tablet); } }
  @media (forced-colors: active) {
    .ds-welcome .welcome__choice,
    .ds-welcome .welcome__result,
    .ds-welcome .welcome__confirm { border: 1px solid CanvasText; }
  }

  /* W29 · Notifications and the shared per-device Web Push panel. */
  .ds-notifications-page {
    box-sizing: border-box;
    width: min(100%, 64rem);
    margin-inline: auto;
    padding: var(--ds-space-2xl) var(--ds-gutter-phone) var(--ds-space-4xl);
    gap: var(--ds-space-lg);
  }
  .ds-notifications {
    display: grid;
    gap: var(--ds-space-md);
    padding: var(--ds-space-lg);
    background: var(--ds-surface-raised);
    box-shadow: inset 0 0 0 1px var(--ds-border-subtle);
  }
  .ds-notifications .notifications__header { display: grid; align-items: start; gap: var(--ds-space-sm); }
  .ds-notifications .notifications__title-block { display: grid; gap: var(--ds-space-xs); }
  .ds-notifications .notifications__title-block > :is(h1, h2, p) { margin: 0; }
  .ds-notifications .notifications__summary {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm);
  }
  .ds-notifications .notifications__mark-all { min-height: var(--ds-target-min); }
  .ds-notifications .notifications__badge:empty { display: none; }
  .ds-notifications .notifications__status:empty { display: none; }
  .ds-notifications .notifications__list {
    gap: var(--ds-space-xs);
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .ds-notifications .notifications__item {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: var(--ds-space-sm);
    min-height: var(--ds-table-row-phone);
    padding: var(--ds-space-sm);
    background: var(--ds-surface-raised);
    box-shadow: inset 0 0 0 1px var(--ds-border-subtle);
  }
  .ds-notifications .notifications__item[data-unread] {
    background: var(--ds-personal-wash);
    box-shadow: inset 3px 0 0 var(--ds-personal-edge), inset 0 0 0 1px var(--ds-border-subtle);
  }
  .ds-notifications__art { position: relative; display: block; width: 7rem; min-width: 0; }
  .ds-notifications__art .ds-thumb { width: 100%; }
  .ds-notifications__art .activity-list__track-label { left: 0; right: 0; bottom: 0; }
  .ds-notifications__art .activity-list__track-copy {
    width: 100%; gap: 0; padding: 2px 5px; border: 0; border-radius: 0;
  }
  .ds-notifications__art .activity-list__track-copy strong { font-size: .68rem; line-height: 1.1; }
  .ds-notifications__art .activity-list__track-copy small { display: none; }
  .ds-notifications__art .ds-engine-mark {
    position: absolute;
    top: var(--ds-space-xs);
    left: var(--ds-space-xs);
  }
  .ds-notifications .notifications__body {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ds-space-xs) var(--ds-space-sm);
    min-width: 0;
  }
  .ds-notifications .notifications__title-row {
    display: flex; flex: 1 1 100%; align-items: flex-start; gap: var(--ds-space-sm); min-width: 0;
  }
  .ds-notifications .notifications__title { flex: 1 1 auto; min-width: 0; }
  .ds-notifications .notifications__unread { flex: none; }
  .ds-notifications .notifications__engine { justify-self: start; }
  .ds-notifications .notifications__detail { flex-basis: 100%; margin: 0; }
  .ds-notifications .notifications__actions {
    display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm);
  }
  .ds-notifications .notifications__actions > :is(.notifications__open, .notifications__mark-read) { flex: 1 1 10rem; }
  .ds-notifications .notifications__link { flex: 1 1 14rem; min-width: 0; color: var(--ds-text-body); }
  .ds-notifications .notifications__item[data-unread] .notifications__link { color: var(--ds-text-primary); font-weight: 600; }
  .ds-notifications .notifications__when { margin-left: auto; }
  .ds-notifications .notifications__mark-read { flex: 0 1 auto; min-width: 0; max-width: 100%; white-space: normal; }
  .ds-notifications .notifications__group { flex-basis: 100%; }
  .ds-notifications .notifications__group-summary {
    min-height: var(--ds-target-min);
    padding-block: var(--ds-space-sm);
    color: var(--ds-text-secondary);
    font-size: var(--ds-type-label-size);
    font-weight: 600;
    cursor: pointer;
  }
  .ds-notifications .notifications__group-body { padding: var(--ds-space-xs) 0 0 var(--ds-space-md); }
  .ds-notifications .notifications__group-list {
    display: grid;
    gap: var(--ds-space-xs);
    margin: 0;
    padding: 0 0 0 var(--ds-space-md);
    border-left: 2px solid var(--ds-border-subtle);
    list-style: none;
  }
  .ds-notifications .notifications__group-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--ds-space-sm);
    font-size: var(--ds-type-body-s-size);
  }
  .ds-notifications .notifications__group-note { color: var(--ds-text-tertiary); font-size: var(--ds-type-label-size); }
  .ds-notifications .notifications__group-list li > span:empty { display: none; }

  .ds-notifications-page .notification-settings { gap: var(--ds-space-md); }
  .ds-notifications-page .notification-settings__collapse > .notification-settings__collapse-summary {
    min-height: var(--ds-target-min);
  }
  .ds-notifications-page .notification-settings__status:empty { display: none; }
  .ds-notifications-page .notification-settings__scope { margin-block: var(--ds-space-md); }
  .ds-notifications-page .notification-settings__scope-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    gap: var(--ds-space-xs);
  }
  .ds-notifications-page .notification-settings__scope-button[aria-pressed="true"] {
    background: var(--ds-personal-wash);
    box-shadow: inset 3px 0 0 var(--ds-personal-edge), inset 0 0 0 1px var(--ds-border-strong);
  }
  .ds-notifications-page .notification-settings__preference {
    display: flex;
    align-items: center;
    gap: var(--ds-space-sm);
    min-height: var(--ds-target-min);
  }
  .ds-notifications-page .notification-settings__preference input {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--ds-action-primary);
  }
  .ds-notifications-page .notification-settings__push {
    gap: var(--ds-space-sm);
    margin-top: var(--ds-space-md);
    padding-top: var(--ds-space-md);
    border-top: 1px solid var(--ds-border-subtle);
  }
  .ds-notifications-page .notification-settings__guide { gap: var(--ds-space-xs); }
  .ds-notifications-page .notification-settings__guide-block > summary { min-height: var(--ds-target-min); cursor: pointer; }
  .ds-notifications-page .notification-settings__guide-block ol {
    display: grid;
    gap: var(--ds-space-xs);
    padding-left: var(--ds-space-xl);
  }
  @media (min-width: 600px) {
    .ds-notifications-page { padding-inline: var(--ds-gutter-tablet); }
  }
  @media (max-width: 599px) {
    .ds-notifications-page {
      width: 100vw;
      max-width: none;
      margin-top: calc(var(--ds-space-md) * -1 - var(--ds-space-xxs));
      margin-inline: calc(var(--ds-gutter-phone) * -1 - var(--ds-space-sm));
      padding: var(--ds-space-lg) var(--ds-gutter-phone)
        calc(var(--ds-space-4xl) + var(--ds-bottom-nav-height, 0px));
      gap: var(--ds-space-md);
    }
    .ds-notifications-page .ds-notifications {
      gap: var(--ds-space-md); padding: 0; background: transparent; box-shadow: none;
    }
    .ds-notifications .notifications__title-block { gap: calc(var(--ds-space-sm) + var(--ds-space-xxs)); }
    .ds-notifications .notifications__title-block h1 {
      font-size: var(--ds-type-display-6-size); line-height: var(--ds-type-display-6-line);
    }
    .ds-notifications .notifications__badge {
      margin-inline-start: var(--ds-space-xs); font-family: var(--ds-font-ui);
      clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
    }
    .ds-notifications .notifications__mark-all {
      padding-inline: var(--ds-space-md); background: var(--ds-surface-control);
      box-shadow: inset 0 0 0 1px var(--ds-border-strong); text-decoration: none;
    }
    .ds-notifications .notifications__list { gap: var(--ds-space-md); }
    .ds-notifications .notifications__item {
      grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-md); padding: var(--ds-space-md);
      background: var(--ds-surface-raised);
    }
    .ds-notifications .notifications__item[data-unread] {
      background: var(--ds-surface-raised);
      box-shadow: inset 3px 0 0 var(--ds-action-primary), inset 0 0 0 1px var(--ds-border-subtle);
    }
    .ds-notifications__art {
      box-sizing: border-box; width: 10rem; border: 2px solid var(--ds-engine-150);
    }
    .ds-notifications__art.activity-list__thumb--200 { border-color: var(--ds-engine-200); }
    .ds-notifications__art .activity-list__cup {
      top: auto; bottom: var(--ds-space-xxs); left: var(--ds-space-xxs);
      width: 1.1875rem; height: 1.1875rem;
    }
    .ds-notifications__art > .activity__mode {
      top: var(--ds-space-xxs); right: auto; left: var(--ds-space-xxs);
      display: inline-flex; align-items: center; gap: 3px; min-width: 0;
      min-height: 1rem; padding: 1px var(--ds-space-xs); font-size: .625rem; line-height: .75rem;
    }
    .ds-notifications__art > .activity__mode::before {
      content: "›"; font-size: 1.25em; font-weight: 900; line-height: .8;
    }
    .ds-notifications__art .activity-list__track-label {
      left: 1.75rem; right: var(--ds-space-xxs); bottom: var(--ds-space-xxs);
    }
    .ds-notifications__art .activity-list__track-copy {
      width: auto; max-width: 100%; box-sizing: border-box; padding: 2px 3px;
    }
    .ds-notifications__art .activity-list__track-copy strong {
      font-size: .6875rem; line-height: .8125rem;
    }
    .ds-notifications__art .activity-list__track-copy small {
      display: block; font-size: .5625rem; line-height: .8125rem;
    }
    .ds-notifications .notifications__body { display: grid; align-items: start; gap: var(--ds-space-sm); }
    .ds-notifications .notifications__title {
      font-size: var(--ds-type-title-size); line-height: var(--ds-type-title-line);
    }
    .ds-notifications .notifications__link { min-width: 0; }
    .ds-notifications .notifications__actions { flex-wrap: nowrap; }
    .ds-notifications .notifications__actions > :is(.notifications__open, .notifications__mark-read) {
      width: auto; min-width: 0; max-width: 100%; min-height: var(--ds-target-min); flex: 0 1 auto;
    }
    .ds-notifications .notifications__group-summary { list-style: none; text-decoration: underline; }
    .ds-notifications .notifications__group-summary::-webkit-details-marker { display: none; }
    .ds-notifications .notifications__when { margin-left: 0; }
    .ds-notifications .notifications__group-list li { grid-template-columns: minmax(0, 1fr) auto; }
    .ds-notifications .notifications__group-list .ds-notifications__art { grid-column: 1 / -1; width: 5rem; }
  }
  @media (max-width: 359px) {
    .ds-notifications-page { padding-inline: 14px; }
  }
  @media (forced-colors: active) {
    .ds-notifications .notifications__item,
    .ds-notifications-page .notification-settings__scope-button[aria-pressed="true"] { border: 1px solid CanvasText; }
  }
  .ds-tournament-career__nemesis { margin: 0; color: var(--ds-text-body); }
  .ds-tournament-career__list {
    display: grid; gap: var(--ds-space-xs); margin: 0; padding: 0; list-style: none;
    color: var(--ds-text-secondary); font-family: var(--ds-font-data);
    font-size: var(--ds-type-data-s-size); font-variant-numeric: tabular-nums;
  }
  .ds-tournament-career__list li {
    padding: var(--ds-space-sm) 0; border-bottom: 1px solid var(--ds-border-subtle);
  }
  .ds-tournament-career__list li:last-child { border-bottom: 0; }
  @media (max-width: 599px) {
    .ds-profile .ds-hero__thumb { width: 5rem; }
    .ds-profile__loadout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ds-profile__loadout-item { grid-template-columns: 2.75rem minmax(0, 1fr); }
    .ds-profile__loadout-item img { width: 2.75rem; height: 2.75rem; }
  }
  .ds-legend { display: flex; flex-wrap: wrap; gap: var(--ds-space-md); margin: 0; padding: 0; list-style: none; }
  .ds-legend__item { display: inline-flex; align-items: center; gap: 6px; font-family: var(--ds-font-ui); font-size: var(--ds-type-label-size); color: var(--ds-text-secondary); }
  .ds-legend__swatch { width: 10px; height: 10px; flex: none; background: var(--ds-group-champion); }
  .ds-legend__swatch[data-series="2"] { background: var(--ds-group-talent); }
  .ds-legend__swatch[data-series="3"] { background: var(--ds-group-wild); }
  /* The APK's Mastery label at every width (owner 2026-09-26): a solid rectangle in the level's own
     colour with the contrast ink tierChip() computes, not a tinted slanted tag with an edge. */
  .ds-tier-chip, .ds-tier-chip.ds-slant {
    display: inline-flex; align-items: center; min-height: auto; padding: 2px var(--ds-space-sm);
    font-family: var(--ds-font-ui); font-size: var(--ds-type-micro-size); font-weight: 700; line-height: 14px; white-space: nowrap;
    clip-path: none; box-shadow: none; border: 1px solid var(--ds-border-strong);
    background: var(--ds-tier-colour, var(--ds-surface-control));
    color: var(--ds-tier-ink, var(--ds-text-primary));
  }

  /* ================= states (W34) ================= */
  .ds-state { display: grid; gap: var(--ds-space-sm); justify-items: start; padding: var(--ds-space-xl); background: var(--ds-surface-raised); box-shadow: inset 0 0 0 1px var(--ds-border-subtle); }
  .ds-state[data-state="error"] { box-shadow: inset 3px 0 0 var(--ds-status-error), inset 0 0 0 1px var(--ds-border-subtle); }
  .ds-state[data-state="not-authorised"] { box-shadow: inset 3px 0 0 var(--ds-status-warning), inset 0 0 0 1px var(--ds-border-subtle); }
  .ds-state__title { font-family: var(--ds-font-ui); font-size: var(--ds-type-body-size); font-weight: 600; color: var(--ds-text-primary); }
  .ds-state__body { font-family: var(--ds-font-ui); font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line); color: var(--ds-text-secondary); max-width: 62ch; }
  .ds-skeleton { display: grid; gap: 2px; }
  .ds-skeleton__row { display: block; height: var(--ds-table-row); background: var(--ds-surface-raised); box-shadow: inset 0 -1px 0 var(--ds-border-subtle); }
  .ds-hero-rank {
    font-family: var(--ds-font-display); font-weight: 800; font-style: italic; font-synthesis: style;
    font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ds-text-primary);
    font-size: var(--ds-type-display-2-size); line-height: var(--ds-type-display-2-line);
  }
  .ds-hero-rank[data-step="display-3"] { font-size: var(--ds-type-display-3-size); line-height: var(--ds-type-display-3-line); }
  .ds-hero-rank[data-step="display-4"] { font-size: var(--ds-type-display-4-size); line-height: var(--ds-type-display-4-line); }
  .ds-hero-rank[data-step="display-5"] { font-size: var(--ds-type-display-5-size); line-height: var(--ds-type-display-5-line); }

  /* ================= forms (§13, §14) ================= */
  .ds-field { display: grid; gap: 6px; min-width: 0; }
  .ds-field__label { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-sm); font-size: var(--ds-type-label-size); font-weight: 600; color: var(--ds-text-body); }
  /* TextField (§24 Forms): the one plain input. Rectangular, like every input (§8). */
  .ds-input {
    width: 100%; min-width: 0; min-height: var(--ds-control-height);
    padding: 0 var(--ds-space-md);
    background: var(--ds-surface-control);
    color: var(--ds-text-primary);
    border: 1px solid var(--ds-border-control);
    border-radius: var(--ds-radius-none);
  }
  .ds-input::placeholder { color: var(--ds-text-tertiary); }
  .ds-input:disabled { color: var(--ds-text-tertiary); border-color: var(--ds-border-subtle); }
  .ds-input[aria-invalid="true"] { border-color: var(--ds-status-error); }
  @media (forced-colors: active) { .ds-input { border: 1px solid CanvasText; } }
  .ds-field__hint { font-size: var(--ds-type-label-size); line-height: var(--ds-type-label-line); color: var(--ds-text-tertiary); }
  .ds-field__error { display: flex; gap: 6px; font-size: var(--ds-type-label-size); line-height: var(--ds-type-label-line); font-weight: 600; color: var(--ds-status-error); }
  .ds-field__error::before { content: "!"; flex: none; }
  .ds-field__doubt { display: flex; gap: 6px; font-size: var(--ds-type-label-size); line-height: var(--ds-type-label-line); color: var(--ds-status-warning); }
  .ds-source { display: inline-flex; align-items: center; gap: 4px; font-size: 0.71875rem; font-weight: 500; line-height: 1; color: var(--ds-text-tertiary); }
  .ds-source::before { content: ""; width: 7px; height: 7px; border-radius: var(--ds-radius-round); }
  .ds-source[data-source="scan"]::before { background: var(--ds-status-info); }
  .ds-source[data-source="edited"]::before { box-shadow: inset 0 0 0 1.5px var(--ds-text-secondary); }
  .ds-text-input {
    min-height: var(--ds-target-min); width: 100%; padding: 0 var(--ds-space-md); border: 0;
    background: var(--ds-surface-control); color: var(--ds-text-primary); box-shadow: inset 0 -2px 0 var(--ds-border-control);
  }
  .ds-select {
    min-height: var(--ds-target-min); width: 100%; max-width: 22rem; padding: 0 var(--ds-space-md); border: 0;
    background: var(--ds-surface-control); color: var(--ds-text-primary); box-shadow: inset 0 -2px 0 var(--ds-border-control);
  }
  @media (forced-colors: active) { .ds-select { border: 1px solid CanvasText; } }
  /* TimeInput: one real input (numeric, labelled) with visual digit cells; one compact step below 360 px */
  .ds-time-input { position: relative; display: inline-flex; align-items: center; gap: 4px; }
  .ds-time-input__cells { display: inline-flex; align-items: center; gap: 4px; pointer-events: none; }
  .ds-time-input__cell {
    display: grid; place-items: center; width: var(--ds-time-input-cell-width); height: var(--ds-time-input-cell-height);
    font-family: var(--ds-font-data); font-size: 2rem; font-weight: 600; line-height: 1;
    background: var(--ds-surface-control); color: var(--ds-text-primary); box-shadow: inset 0 -2px 0 var(--ds-border-control);
  }
  .ds-time-input__cell[data-empty] { color: var(--ds-text-tertiary); font-weight: 400; }
  .ds-time-input__sep { font-family: var(--ds-font-data); font-size: 1.625rem; font-weight: 600; color: var(--ds-text-tertiary); }
  .ds-time-input__native {
    position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0;
    font-size: 1rem; caret-color: transparent; cursor: text;
  }
  .ds-time-input:focus-within .ds-time-input__cell[data-cursor] { box-shadow: inset 0 0 0 var(--ds-focus-width) var(--ds-focus-ring); }
  .ds-time-input:focus-within { outline: var(--ds-focus-width) solid var(--ds-focus-ring); outline-offset: 3px; }
  .ds-time-input[data-invalid] .ds-time-input__cell { box-shadow: inset 0 -2px 0 var(--ds-status-error); }
  .ds-time-input[data-doubt] .ds-time-input__cell { box-shadow: inset 0 -2px 0 var(--ds-status-warning); }
  .ds-time-input[data-size="compact"] .ds-time-input__cell { width: 26px; height: 36px; font-size: 1.0625rem; }
  .ds-time-input[data-size="compact"] .ds-time-input__sep { font-size: 1rem; }
  @media (max-width: 599px) {
    /* The six-digit input has one deliberate phone composition. Switching back to the desktop
       cells at 360 px made the field exactly 364 px wide until the viewport caught up at 364. */
    .ds-time-input:not([data-size="compact"]) .ds-time-input__cell { width: var(--ds-time-input-cell-width-compact); height: var(--ds-time-input-cell-height-compact); font-size: 1.5rem; }
    .ds-time-input:not([data-size="compact"]) .ds-time-input__sep { font-size: 1.25rem; }
  }
  .ds-lap-rows { display: grid; gap: 2px; }
  .ds-lap-row {
    display: grid; grid-template-columns: 5ch auto minmax(0, 1fr) minmax(0, 1fr); gap: var(--ds-space-md); align-items: center;
    padding: var(--ds-space-sm) 10px; background: var(--ds-surface-raised);
  }
  .ds-lap-row > * { justify-self: start; }
  .ds-lap-row__label { font-size: var(--ds-type-label-size); font-weight: 600; color: var(--ds-text-secondary); }
  .ds-stepper { display: inline-flex; align-items: center; gap: 2px; }
  .ds-stepper__button { min-width: var(--ds-target-min); min-height: var(--ds-target-min); border: 0; background: var(--ds-surface-control); color: var(--ds-text-body); cursor: pointer; font-size: 1.125rem; box-shadow: inset 0 0 0 1px var(--ds-border-strong); }
  .ds-stepper__value { min-width: 5ch; text-align: center; font-family: var(--ds-font-data); font-weight: 600; color: var(--ds-text-primary); }
  @media (max-width: 599px) {
    .ds-lap-row { grid-template-columns: 5ch minmax(0, 1fr); }
    .ds-lap-row > :nth-child(n + 3) { grid-column: 1 / -1; }
  }
  .ds-setup { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  @media (max-width: 599px) { .ds-setup { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .ds-setup-part {
    display: grid; justify-items: center; gap: 6px; min-width: 0; padding: 10px 10px 12px; border: 0; cursor: pointer;
    background: var(--ds-surface-control); box-shadow: inset 0 0 0 1px var(--ds-border-subtle); text-align: center;
  }
  .ds-setup-part__art { width: 72px; height: 58px; object-fit: contain; }
  .ds-setup-part__placeholder { width: 72px; height: 58px; display: grid; place-items: center; color: var(--ds-text-tertiary); font-size: 1.75rem; font-weight: 300; }
  .ds-setup-part__kind { font-size: 0.71875rem; font-weight: 500; color: var(--ds-text-tertiary); }
  .ds-setup-part__name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ds-type-body-s-size); font-weight: 600; color: var(--ds-text-primary); }
  .ds-setup-part[data-empty] { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ds-border-strong); }
  .ds-setup-part[data-doubt] { box-shadow: inset 0 0 0 1.5px var(--ds-status-warning); }
  .ds-setup-part__doubt { font-size: 0.71875rem; font-weight: 600; color: var(--ds-status-warning); }
  .ds-picker { display: grid; gap: var(--ds-space-md); background: var(--ds-surface-raised); padding: var(--ds-space-md); }
  .ds-picker__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
  .ds-picker__option {
    display: grid; justify-items: center; gap: 4px; min-width: 0; padding: 6px 4px; border: 0; cursor: pointer;
    background: var(--ds-surface-control); color: var(--ds-text-body); text-align: center;
  }
  .ds-picker__option img { width: min(80px, 100%); height: 65px; object-fit: contain; }
  .ds-picker__option span {
    max-width: 100%; overflow: hidden; font-size: 0.78125rem; font-weight: 500;
    white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  }
  .ds-picker__option[aria-checked="true"] { background: var(--ds-surface-selected); box-shadow: inset 0 0 0 2px var(--ds-text-primary); }
  .ds-picker__option[aria-checked="true"] span { color: var(--ds-text-primary); font-weight: 600; }
  .ds-picker__option[aria-checked="true"] span::before { content: "✓ "; }
  .ds-picker__option:focus-visible { outline-offset: -3px; }
  .ds-part-picker .ds-dialog__body { position: relative; }
  .ds-part-picker .ds-dialog__body > .ds-title { padding-inline-end: 5rem; }
  .ds-part-picker .ds-picker { padding: 0; }
  .ds-part-picker .ds-dialog__actions {
    position: absolute; inset-block-start: var(--ds-space-xl); inset-inline-end: var(--ds-space-xl);
  }

  /* ================= Post a time (§14, POST_A_TIME_ARCHITECTURE) =================
     One task, one column on the phone; the form and the prediction stand side by side from the
     desktop step. Every value is a design-system control, so there is nothing route-specific here. */
  .ds-post { display: grid; gap: var(--ds-space-lg); }
  .ds-post__title { margin: 0; }
  .ds-post__status { margin: 0; font-size: var(--ds-type-body-s-size); color: var(--ds-text-secondary); }
  .ds-post__columns { display: grid; gap: var(--ds-space-lg); align-items: start; }
  @media (min-width: 1100px) { .ds-post__columns { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } }
  .ds-post__form, .ds-post__prediction { display: grid; gap: var(--ds-space-lg); min-width: 0; }
  @media (min-width: 1100px) { .ds-post__prediction { position: sticky; top: var(--ds-space-lg); } }
  .ds-post__hint { margin: 0; color: var(--ds-text-secondary); }
  .ds-post__search { max-width: 28rem; }
  .ds-post__track-count { margin: 0; }
  .ds-post__tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: var(--ds-space-xs); max-height: 26rem; overflow-y: auto; }
  .ds-post__track {
    display: grid; gap: var(--ds-space-xxs); justify-items: start; text-align: left;
    min-height: var(--ds-target-min); padding: var(--ds-space-sm) var(--ds-space-md); border: 0; cursor: pointer;
    background: var(--ds-surface-control); color: var(--ds-text-body); box-shadow: inset 0 0 0 1px var(--ds-border-subtle);
  }
  .ds-post__track:hover { background: var(--ds-surface-hover); }
  .ds-post__track-name { font-weight: 600; color: var(--ds-text-primary); }
  /* ScanAction and ScanSourcePicker (POST_A_TIME §6). The action is secondary inside the form and
     never competes with Publish; the picker's cards carry their state in text and outline, never in
     colour alone (§21). */
  .ds-scan { display: grid; gap: var(--ds-space-xs); justify-items: start; }
  .ds-scan .ds-button {
    border-color: var(--ds-action-primary);
    background: color-mix(in srgb, var(--ds-action-primary) 12%, var(--ds-surface-control));
    box-shadow: inset 0 0 0 1px var(--ds-action-primary), var(--ds-elevation-docked);
    font-weight: 700;
  }
  .ds-scan__note { margin: 0; }
  .ds-scan-sources { display: grid; gap: var(--ds-space-md); }
  .ds-scan-source {
    display: grid; grid-template-columns: minmax(7rem, 42%) minmax(0, 1fr); gap: var(--ds-space-md);
    align-items: center; width: 100%; padding: var(--ds-space-sm); border: 0; cursor: pointer;
    text-align: left; font: inherit;
    background: var(--ds-surface-control); color: var(--ds-text-body);
    box-shadow: inset 0 0 0 1px var(--ds-border-subtle);
  }
  .ds-scan-source:hover { background: var(--ds-surface-hover); }
  .ds-scan-source:focus-visible { outline: var(--ds-focus-ring); outline-offset: 2px; }
  .ds-scan-source__image {
    display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
    box-shadow: inset 0 0 0 1px var(--ds-border-subtle);
  }
  .ds-scan-source__body { display: grid; gap: var(--ds-space-xxs); min-width: 0; }
  .ds-scan-source__title { font-weight: 600; color: var(--ds-text-primary); }
  .ds-scan-source__last {
    justify-self: start; padding: 0 var(--ds-space-xs);
    font-size: var(--ds-type-micro-size); line-height: var(--ds-type-micro-line);
    color: var(--ds-text-primary); box-shadow: inset 0 0 0 1px var(--ds-border-strong);
  }
  @media (max-width: 599px) {
    .ds-scan-source { grid-template-columns: 1fr; }
  }
  .ds-post__details { display: grid; gap: var(--ds-space-sm); }
  .ds-post__disclosure {
    display: flex; align-items: center; gap: var(--ds-space-sm); min-height: var(--ds-target-min);
    padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
    font-size: var(--ds-type-title-size); font-weight: var(--ds-type-title-weight); color: var(--ds-text-primary);
  }
  .ds-post__disclosure::before { content: "›"; display: inline-block; color: var(--ds-text-tertiary); }
  .ds-post__disclosure[aria-expanded="true"]::before { transform: rotate(90deg); }
  .ds-post__laps-summary { margin: 0; }
  .ds-post__laps { display: grid; gap: var(--ds-space-md); }
  .ds-post__laps[hidden] { display: none; }
  .ds-post__lap {
    display: grid; gap: var(--ds-space-md); align-items: end;
    padding: var(--ds-space-md); background: var(--ds-surface-control); box-shadow: inset 0 0 0 1px var(--ds-border-subtle);
  }
  .ds-post__lap-head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-md);
    grid-column: 1 / -1;
  }
  .ds-post__lap-title { font-weight: 700; color: var(--ds-text-primary); }
  @media (min-width: 600px) { .ds-post__lap { grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto); } }
  .ds-post__track-context {
    display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); gap: var(--ds-space-lg);
    align-items: center; padding: var(--ds-space-md); background: var(--ds-surface-raised);
    border: 1px solid var(--ds-border-subtle);
  }
  .ds-post__track-context .ds-thumb { width: 100%; }
  .ds-post__track-copy { display: grid; gap: var(--ds-space-xxs); min-width: 0; }
  .ds-post__track-copy .ds-post__track-name { font-size: var(--ds-type-title-size); }
  @media (max-width: 599px) {
    .ds-post__track-context { grid-template-columns: minmax(6.5rem, 8.5rem) minmax(0, 1fr); gap: var(--ds-space-md); }
  }
  .ds-post__coins { display: inline-flex; align-items: center; gap: var(--ds-space-sm); flex-wrap: wrap; }
  .ds-post__coin-icon { width: 20px; height: 20px; object-fit: contain; }
  .ds-post__balance { font-size: var(--ds-type-label-size); color: var(--ds-text-tertiary); }
  .ds-post__mushrooms { display: inline-flex; align-items: center; gap: var(--ds-space-xs); flex-wrap: wrap; }
  .ds-post__count {
    min-width: var(--ds-target-min); min-height: var(--ds-target-min); border: 0; cursor: pointer;
    background: var(--ds-surface-raised); color: var(--ds-text-body); font-family: var(--ds-font-data); font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--ds-border-strong);
  }
  .ds-post__count[aria-pressed="true"] { background: var(--ds-surface-selected); color: var(--ds-text-primary); box-shadow: inset 0 0 0 2px var(--ds-text-primary); }
  .ds-post__actions { display: grid; gap: var(--ds-space-sm); justify-items: start; }
  .ds-post__confirmation[hidden], .ds-post__form > .ds-panel[hidden], .ds-post__prediction[hidden], .ds-post__track-context[hidden] { display: none; }
  .ds-post__confirmation { min-width: 0; }
  .ds-post__confirm-track { display: grid; grid-template-columns: minmax(5.5rem, 7rem) minmax(0, 1fr); align-items: center; gap: var(--ds-space-md); }
  .ds-post__confirm-track .ds-thumb { width: 100%; }
  .ds-post__confirm-track > div { display: grid; gap: var(--ds-space-xxs); min-width: 0; }
  .ds-post__confirm-total { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-md); flex-wrap: wrap; }
  .ds-post__confirm-total > div, .ds-post__confirm-block { display: grid; gap: var(--ds-space-xs); min-width: 0; }
  .ds-post__confirm-laps { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--ds-space-xs); }
  .ds-post__confirm-lap { display: grid; gap: 2px; padding: var(--ds-space-xs) var(--ds-space-sm); background: var(--ds-surface-control); box-shadow: inset 3px 0 0 var(--ds-border-strong); }
  .ds-post__confirm-setup { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-space-xs); }
  .ds-post__confirm-part { display: grid; grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: var(--ds-space-sm); align-items: center; min-width: 0; }
  .ds-post__confirm-part img { grid-row: 1 / 3; width: 32px; height: 32px; object-fit: contain; }
  .ds-post__confirm-part strong { overflow-wrap: anywhere; }
  /* A part without a picture keeps its label above the value instead of squeezed into the picture column. */
  .ds-post__confirm-part > :not(img) { grid-column: 2; }
  .ds-post__confirm-ok { margin: 0; color: var(--ds-status-success); font-weight: 700; }
  .ds-post__completion-note { margin: 0; color: var(--ds-text-secondary); }
  @media (max-width: 359px) { .ds-post__confirm-setup { grid-template-columns: minmax(0, 1fr); } }
  .ds-post__publish-reason { margin: 0; }
  .ds-post__big { display: flex; align-items: baseline; gap: var(--ds-space-md); flex-wrap: wrap; margin: 0; }
  .ds-post__pb { margin: 0; font-weight: 600; color: var(--ds-text-body); }
  .ds-post__pb[data-outcome="improved"] { color: var(--ds-personal-edge); }
  .ds-post__pb[data-outcome="slower"] { color: var(--ds-text-secondary); }
  .ds-post__rank { margin: 0; color: var(--ds-text-primary); }
  .ds-post__neighbour { display: flex; align-items: baseline; gap: var(--ds-space-sm); flex-wrap: wrap; margin: 0; }
  .ds-post__neighbour-name { color: var(--ds-text-body); }
  .ds-post__neighbour-name--rival { font-weight: 600; color: var(--ds-text-primary); }
  .ds-post__neighbour-gap { font-family: var(--ds-font-data); font-weight: 600; }
  .ds-post__neighbour-gap[data-direction="faster"] { color: var(--ds-status-success); }
  .ds-post__neighbour-gap[data-direction="slower"] { color: var(--ds-status-error); }
  .ds-post__passed { margin: 0; color: var(--ds-text-body); }
  .ds-post__again { margin: 0; color: var(--ds-text-secondary); }
  .ds-post__feedback { display: grid; gap: var(--ds-space-sm); }
  .ds-post__checks { display: grid; gap: var(--ds-space-xs); margin: 0; padding-left: var(--ds-space-xl); }
  .ds-post__check { font-size: var(--ds-type-body-s-size); color: var(--ds-status-warning); }
  .ds-post__check[data-ok] { color: var(--ds-status-success); }
  .ds-post__picker { max-height: 24rem; overflow-y: auto; }

  /* ================= overlays (§24): dialog, sheet, menu, filter sheet ================= */
  .ds-dialog {
    width: min(560px, calc(100vw - 2 * var(--ds-gutter-phone))); max-height: calc(100dvh - 2 * var(--ds-space-3xl));
    padding: 0; border: 0; background: var(--ds-surface-raised); color: var(--ds-text-body);
    box-shadow: var(--ds-elevation-overlay), inset 0 0 0 1px var(--ds-border-strong);
  }
  .ds-dialog::backdrop { background: var(--ds-scrim); }
  .ds-dialog__body { display: grid; gap: var(--ds-space-lg); padding: var(--ds-space-2xl); overflow: auto; }
  .ds-dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--ds-space-sm); }
  .ds-dialog[data-kind="sheet"] {
    width: 100%; max-width: 100%; margin: auto 0 0; max-height: 85dvh;
    box-shadow: var(--ds-elevation-overlay), inset 0 3px 0 var(--ds-action-primary);
    animation: ds-sheet-in var(--ds-motion-panel) ease-out;
  }
  @keyframes ds-sheet-in { from { transform: translateY(24px); opacity: 0; } }
  @media (min-width: 600px) {
    .ds-dialog[data-kind="sheet"] { width: min(640px, 100%); margin: auto; }
  }
  .ds-menu { position: relative; display: inline-block; }
  .ds-menu__list {
    position: absolute; z-index: 20; top: calc(100% + 4px); right: 0; min-width: 220px; padding: var(--ds-space-xs) 0; margin: 0; list-style: none;
    background: var(--ds-surface-raised); box-shadow: var(--ds-elevation-overlay), inset 0 0 0 1px var(--ds-border-strong);
  }
  .ds-menu__list[hidden] { display: none; }
  .ds-menu__item {
    display: flex; width: 100%; align-items: center; gap: 10px; min-height: var(--ds-target-min); padding: 0 14px; border: 0;
    background: transparent; color: var(--ds-text-body); text-align: left; cursor: pointer; font-size: 0.875rem;
  }
  .ds-menu__item:hover, .ds-menu__item:focus-visible { background: var(--ds-surface-hover); outline-offset: -3px; }
  .ds-menu__item[data-tone="danger"] { color: var(--ds-status-error); }
  .ds-filter-summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-md); color: var(--ds-text-secondary); font-family: var(--ds-font-ui); font-size: var(--ds-type-body-s-size); }
  .ds-filter-summary__part { display: inline-flex; align-items: baseline; gap: 4px; }
  .ds-filter-summary__label { color: var(--ds-text-tertiary); }
  .ds-filter-summary__value { color: var(--ds-text-primary); font-weight: 600; }

  /* ================= Panel (§24 Content): the one grouped surface ================= */
  .ds-panel {
    display: grid; gap: var(--ds-space-lg);
    padding: var(--ds-space-2xl);
    background: var(--ds-surface-raised);
    border: 1px solid var(--ds-border-subtle);
    border-radius: var(--ds-radius-hairline);
    min-width: 0;
  }
  /* Grid items keep an automatic min-content width by default. WebKit used that width for long
     Dutch journey copy and expanded the Panel track beyond a 320 px viewport. Panel content must
     be allowed to wrap inside the grouped surface instead of defining a wider page. */
  .ds-panel > * { min-width: 0; }
  .ds-panel__header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--ds-space-md); }
  .ds-panel__title {
    font-family: var(--ds-type-title-family); font-size: var(--ds-type-title-size);
    line-height: var(--ds-type-title-line); font-weight: var(--ds-type-title-weight); color: var(--ds-text-primary);
  }
  .ds-panel__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm); }
  .ds-panel__note { font-family: var(--ds-font-ui); font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line); color: var(--ds-text-secondary); max-width: 68ch; }
  @media (max-width: 599px) { .ds-panel { padding: var(--ds-space-lg); } }

  /* ================= Settings -> Appearance (DESIGN_SYSTEM §19, ADR-0205) ================= */
  .ds-appearance__group { display: grid; gap: var(--ds-space-sm); justify-items: start; }
  .ds-appearance__label { color: var(--ds-text-secondary); }
  .ds-appearance__intro, .ds-appearance__note { margin: 0; max-width: 60ch; }
  .ds-appearance .ds-segmented { flex-wrap: wrap; }

  /* ================= forced colours: system colours, ✓ + underline kept as borders ================= */
  @media (forced-colors: active) {
    .ds-button, .ds-segment, .ds-engine-option, .ds-filter-chip, .ds-picker__option, .ds-setup-part, .ds-stepper__button { border: 1px solid ButtonText; }
    .ds-segment[aria-checked="true"], .ds-engine-option[aria-checked="true"], .ds-tab[aria-current="page"], .ds-filter-chip[aria-pressed="true"], .ds-picker__option[aria-checked="true"] { border-bottom: 3px solid Highlight; }
    .ds-slant { clip-path: none; }
    .ds-slant:focus-visible { outline: 2px solid Highlight; }
    .ds-time-input__cell { border: 1px solid CanvasText; }
    .ds-chip, .ds-you-chip, .ds-engine-mark, .ds-tier-chip { border: 1px solid CanvasText; }
    .ds-table__row[data-kind="you"] { border: 2px solid Highlight; }
    .ds-chart__bar, .ds-legend__swatch, .ds-split__part, .ds-bar__fill { background: CanvasText; border: 1px solid CanvasText; }
    .ds-chart__bar[data-series="2"], .ds-legend__swatch[data-series="2"] { background: Canvas; }
    .ds-chart__bar[data-series="3"], .ds-legend__swatch[data-series="3"] { background: Highlight; }
    .ds-line__tick, .ds-line__path, .ds-line__dot, .ds-line__marker { stroke: CanvasText; }
    .ds-line__dot, .ds-line__marker { fill: Canvas; }
    .ds-line__dot[data-kind="seed"] { fill: Highlight; stroke: HighlightText; }
    .ds-line__tick-label { fill: CanvasText; }
    .ds-podium__cell, .ds-state, .ds-panel { border: 1px solid CanvasText; }
  }
  @media (prefers-reduced-motion: reduce) {
    .ds-dialog[data-kind="sheet"] { animation: none; }
  }

  /* ================= content surfaces: hero, art, journey, focus, story, inbox, card ================= */
  .ds-hero {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-lg);
    align-items: end;
    padding: var(--ds-space-xl);
    background: var(--ds-surface-raised);
    border: 1px solid var(--ds-border-subtle);
    border-radius: var(--ds-radius-hairline);
  }
  .ds-hero__art {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    display: block; overflow: hidden;
  }
  .ds-hero__backdrop {
    width: 100%; height: 100%; object-fit: cover;
    opacity: var(--ds-art-opacity);
    /* No transform: a scaled backdrop reaches past the viewport even though its frame clips it,
       and a measurement that has to know the difference is a measurement that can be wrong. */
    filter: blur(16px) saturate(1.1);
  }
  /* The copy never sits on bare art (§16): the shade covers the whole strip, heavier where the
     words are, so a number on the far side stays as readable as the title on the near side. */
  .ds-hero__art::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, var(--ds-surface-raised) 18%,
      color-mix(in srgb, var(--ds-surface-raised) 62%, transparent) 100%);
  }
  .ds-hero[data-spectacle="high"] .ds-hero__art::after {
    background: linear-gradient(180deg, color-mix(in srgb, var(--ds-surface-raised) 45%, transparent) 0%,
      var(--ds-surface-raised) 92%);
  }
  .ds-hero__body {
    position: relative; z-index: 1;
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-lg);
    min-width: 0;
  }
  .ds-hero__copy { display: flex; flex-direction: column; align-items: flex-start; gap: var(--ds-space-sm); min-width: 0; flex: 1 1 16rem; }
  .ds-hero__eyebrow {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm);
    font-size: var(--ds-type-label-size); line-height: var(--ds-type-label-line);
    font-weight: var(--ds-type-label-weight); color: var(--ds-text-secondary);
  }
  .ds-hero__title {
    font-family: var(--ds-font-display); font-weight: 800; font-style: italic; font-synthesis: style;
    text-transform: uppercase; color: var(--ds-text-primary);
    overflow-wrap: anywhere; hyphens: auto; margin: 0;
  }
  .ds-hero__title[data-step="display-1"] { font-size: var(--ds-type-display-1-size); line-height: var(--ds-type-display-1-line); }
  .ds-hero__title[data-step="display-2"] { font-size: var(--ds-type-display-2-size); line-height: var(--ds-type-display-2-line); }
  .ds-hero__title[data-step="display-3"] { font-size: var(--ds-type-display-3-size); line-height: var(--ds-type-display-3-line); }
  .ds-hero__title[data-step="display-4"] { font-size: var(--ds-type-display-4-size); line-height: var(--ds-type-display-4-line); }
  .ds-hero__thumb { position: relative; flex: none; display: block; width: 8.5rem; }
  .ds-hero__thumb-art { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--ds-border-subtle); }
  .ds-hero__thumb[data-shape="square"] .ds-hero__thumb-art { aspect-ratio: 1 / 1; object-fit: contain; }
  .ds-hero__thumb-badge { position: absolute; inset: var(--ds-space-xxs) auto auto var(--ds-space-xxs); width: 1.75rem; height: 1.75rem; }
  .ds-hero__aside {
    position: relative; z-index: 1;
    display: flex; flex-wrap: wrap; gap: var(--ds-space-lg) var(--ds-space-xl);
    align-items: flex-end; min-width: 0;
  }
  @media (min-width: 1100px) {
    .ds-hero { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
    .ds-hero__aside { justify-content: flex-end; }
    .ds-track .ds-hero__thumb { width: 12rem; }
    .ds-track .ds-hero__thumb-badge { width: 2.5rem; height: 2.5rem; }
  }
  /* The previous track, the cup and the next track on one row; a phone uses the short wording. */
  .ds-track__nav {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: var(--ds-space-sm); align-items: center;
  }
  .ds-track__nav-previous { justify-self: start; min-width: 0; }
  .ds-track__nav-all { justify-self: center; text-align: center; }
  .ds-track__nav-next { justify-self: end; min-width: 0; text-align: end; }
  .ds-track__nav-short { display: none; }
  @media (max-width: 599px) {
    .ds-track__nav-full { display: none; }
    .ds-track__nav-short { display: inline; white-space: nowrap; }
  }
  @media (max-width: 599px) {
    .ds-hero { padding: var(--ds-space-lg); }
    .ds-hero__thumb { width: 6rem; }
  }

  .ds-thumb { position: relative; flex: none; display: block; width: 100%; }
  .ds-thumb[data-size="sm"] { width: 4.5rem; }
  .ds-thumb__art { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--ds-border-subtle); }
  .ds-thumb__badge { position: absolute; inset: var(--ds-space-xxs) auto auto var(--ds-space-xxs); width: 1.5rem; height: 1.5rem; }

  /* Home's HIGH hero identifies the Player with their latest submitted track.
     Keep that track recognisable, as it is in the Android hero: the generic
     backdrop blur is useful as atmosphere elsewhere, but erased the circuit
     here once the HIGH shade was placed over it. */
  .ds-home__hero .ds-hero__backdrop {
    opacity: min(1, calc(var(--ds-art-opacity) + .2));
    filter: saturate(1.04) contrast(.96);
  }
  .ds-home__hero .ds-hero__art::after {
    background: linear-gradient(90deg,
      color-mix(in srgb, var(--ds-surface-raised) 64%, transparent) 0%,
      color-mix(in srgb, var(--ds-surface-raised) 48%, transparent) 100%);
  }

  .ds-disclosure { border-top: 1px solid var(--ds-border-subtle); padding-top: var(--ds-space-sm); }
  .ds-disclosure__summary {
    cursor: pointer; list-style: none;
    display: flex; align-items: center; gap: var(--ds-space-xs);
    min-height: var(--ds-target-min-dense);
    font-size: var(--ds-type-label-size); font-weight: var(--ds-type-label-weight);
    color: var(--ds-text-secondary);
  }
  .ds-disclosure__summary::-webkit-details-marker { display: none; }
  .ds-disclosure__summary::before { content: "›"; display: inline-block; transition: transform var(--ds-motion-state) ease-out; }
  .ds-disclosure[open] > .ds-disclosure__summary::before { transform: rotate(90deg); }
  .ds-disclosure__body { display: flex; flex-direction: column; gap: var(--ds-space-sm); padding: var(--ds-space-sm) 0; }

  .ds-journey {
    display: flex; flex-direction: column; gap: var(--ds-space-xs);
    padding: var(--ds-space-sm) 0; text-decoration: none; color: inherit;
    min-height: var(--ds-target-min-dense);
  }
  a.ds-journey:hover .ds-journey__label { color: var(--ds-text-primary); text-decoration: underline; }
  .ds-journey__copy { display: flex; align-items: baseline; gap: var(--ds-space-sm); min-width: 0; }
  .ds-journey__label {
    flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: var(--ds-type-body-s-size); color: var(--ds-text-body);
  }
  .ds-journey__value { flex: none; color: var(--ds-text-primary); }
  .ds-journey__note {
    color: var(--ds-text-tertiary); font-size: var(--ds-type-micro-size);
    line-height: var(--ds-type-micro-line);
  }
  .ds-journey__done { flex: none; color: var(--ds-status-success); }
  .ds-journey__bar { display: block; height: 4px; background: var(--ds-surface-hover); }
  .ds-journey__fill { display: block; height: 100%; width: var(--ds-bar-share, 0%); background: var(--ds-personal-edge); }
  .ds-journey__percentage { display: none; }
  .ds-journey[data-complete] .ds-journey__fill { background: var(--ds-status-success); }
  .ds-journey[data-target] { border-top: 1px solid var(--ds-border-subtle); }
  .ds-journey[data-target] .ds-journey__copy { align-items: center; }
  .ds-journey[data-target] .ds-journey__value { display: flex; align-items: center; gap: var(--ds-space-xs); }
  .ds-home__away-list { display: grid; gap: var(--ds-space-sm); margin: 0; padding: 0; list-style: none; }
  .ds-home__key-event { min-width: 0; }
  .ds-home__key-event-link {
    display: grid; gap: var(--ds-space-xxs); min-width: 0; padding-block: var(--ds-space-xs);
    color: inherit; text-decoration: none;
  }
  .ds-home__key-event-link:hover { background: var(--ds-surface-hover); }
  .ds-home__key-event-head { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-sm); min-width: 0; }
  .ds-home__key-event-track { display: inline-flex; align-items: center; gap: var(--ds-space-xs); min-width: 0; color: var(--ds-text-primary); }
  .ds-home__key-event-track strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ds-home__key-event-cup { flex: none; width: 1.5rem; height: 1.5rem; object-fit: contain; }
  .ds-home__key-event-detail { color: var(--ds-text-body); }
  .ds-home__key-event-primary { display: flex; align-items: baseline; gap: var(--ds-space-xs); min-width: 0; }
  .ds-home__key-event-secondary {
    display: grid; gap: var(--ds-space-xxs); margin: 0; padding: 0 0 0 var(--ds-space-sm);
    list-style: none; color: var(--ds-text-tertiary); font-size: var(--ds-type-micro-size);
    line-height: var(--ds-type-micro-line);
  }
  .ds-home__key-event-secondary > li { display: flex; align-items: baseline; gap: var(--ds-space-xs); min-width: 0; }
  .ds-home__key-event-secondary .ds-home__key-event-detail { color: inherit; }
  .ds-home__key-event-bullet { flex: none; color: var(--ds-text-tertiary); }
  .ds-home__key-event-meta { display: flex; align-items: center; gap: var(--ds-space-xs); color: var(--ds-text-tertiary); }
  .ds-home__key-history > summary { min-height: var(--ds-target-min); cursor: pointer; }
  .ds-home__notice-row {
    display: grid; grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: var(--ds-space-sm); align-items: start;
  }
  .ds-home__notice-row .activity-list__thumb { width: 100%; }
  .ds-home__notice-row--text > * { grid-column: 1 / -1; }
  .ds-home__notice-art .activity-list__cup { width: 1rem; height: 1rem; top: 3px; left: 3px; }
  .ds-home__notice-art > .activity__mode { min-width: 2rem; padding: 1px 3px; top: 3px; right: 3px; font-size: .58rem; }
  .ds-home__notice-art .activity-list__track-label { left: 0; right: 0; bottom: 0; }
  .ds-home__notice-art .activity-list__track-copy { width: 100%; gap: 0; padding: 1px 3px; border: 0; border-radius: 0; }
  .ds-home__notice-art .activity-list__track-copy strong { font-size: .62rem; line-height: 1.05; }
  .ds-home__notice-art .activity-list__track-copy small { display: none; }
  .ds-home__inbox-compact { display: none; }
  @media (max-width: 359px) {
    .ds-home__notice-row { grid-template-columns: 4.25rem minmax(0, 1fr); gap: var(--ds-space-xs); }
  }
  @media (max-width: 359px) {
    .ds-journey[data-target] .ds-journey__copy {
      align-items: flex-start; flex-direction: column; gap: var(--ds-space-xxs);
    }
  }

  .ds-focus {
    display: flex; flex-direction: column; gap: var(--ds-space-sm);
    padding: 0 0 var(--ds-space-md); text-decoration: none; color: inherit;
    background: var(--ds-surface-raised); border: 1px solid var(--ds-border-subtle);
    min-width: 0;
  }
  .ds-focus:hover { background: var(--ds-surface-hover); }
  .ds-focus .ds-thumb__badge {
    width: 2.25rem;
    height: 2.25rem;
    inset: var(--ds-space-xs) auto auto var(--ds-space-xs);
  }
  .ds-focus .ds-focus__engine {
    position: absolute; inset: var(--ds-space-xs) var(--ds-space-xs) auto auto;
    z-index: 1;
  }
  .ds-focus__body { display: flex; flex-direction: column; gap: var(--ds-space-xs); padding: 0 var(--ds-space-md); min-width: 0; }
  .ds-focus__label {
    align-self: flex-start;
    font-size: var(--ds-type-micro-size); line-height: var(--ds-type-micro-line);
    font-weight: 600; text-transform: none; letter-spacing: normal;
  }
  .ds-focus__track { display: flex; align-items: baseline; gap: var(--ds-space-xs); min-width: 0; }
  .ds-focus__origin {
    flex: none; font-size: var(--ds-type-micro-size); font-weight: var(--ds-type-micro-weight);
    color: var(--ds-text-tertiary);
  }
  .ds-focus__name {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: var(--ds-type-title-size); font-weight: var(--ds-type-title-weight);
    color: var(--ds-text-primary);
  }
  .ds-focus__headline, .ds-focus__delta, .ds-focus__bullets {
    font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line); color: var(--ds-text-secondary);
  }
  .ds-focus__bullets { display: flex; flex-wrap: wrap; gap: var(--ds-space-xs); }
  .ds-focus__facts { display: grid; gap: 2px; }
  .ds-focus__fact { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--ds-space-sm); }
  .ds-focus__fact-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ds-text-secondary); }
  .ds-focus__fact-value { color: var(--ds-text-primary); }
  @media (max-width: 599px) {
    .ds-home__focus > .ds-panel { gap: var(--ds-space-md); padding: var(--ds-space-md); }
    .ds-home__focus .ds-tiles { gap: var(--ds-space-sm); }
    .ds-home__focus .ds-focus {
      display: grid; grid-template-columns: 6rem minmax(0, 1fr); align-items: center;
      gap: var(--ds-space-sm); padding: var(--ds-space-sm);
    }
    /* Android's Focus art keeps the small cup at top left and a filled Art engine mark
       at top right. The generic FocusTile badges are sized for roomier artwork. */
    .ds-home__focus .ds-focus > .ds-thumb {
      width: 6rem; aspect-ratio: 16 / 9; box-sizing: border-box; overflow: hidden;
      border: 1px solid var(--ds-border-subtle); border-radius: 4px;
    }
    .ds-home__focus .ds-thumb__art {
      position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
    }
    .ds-home__focus .ds-focus .ds-thumb__badge {
      width: 18px; height: 18px; inset: 3px auto auto 3px;
    }
    .ds-home__focus .ds-focus .ds-focus__engine {
      inset: 0 0 auto auto; gap: 3px; min-height: 16px; padding: 1px 4px;
      background: var(--ds-c); color: var(--ds-engine-on-fill); box-shadow: none;
      font-size: 10px; line-height: 12px; font-weight: 700;
    }
    .ds-home__focus .ds-focus__engine .ds-engine-shape { width: 8px; height: 10px; }
    .ds-home__focus .ds-focus__body { padding: 0; }
    .ds-home__focus .ds-focus__label { order: -1; }
    .ds-home__focus .ds-focus__track { display: block; }
    .ds-home__focus .ds-focus__origin {
      font-size: var(--ds-type-title-size); font-weight: var(--ds-type-title-weight);
      color: var(--ds-text-primary);
    }
    .ds-home__focus .ds-focus__name {
      display: inline; white-space: normal; overflow: visible; text-overflow: clip;
    }
    .ds-home__journey .ds-tier-chip,
    .ds-home__focus .ds-tier-chip {
      min-height: auto; padding: 2px var(--ds-space-sm); clip-path: none; box-shadow: none;
      border: 1px solid var(--ds-border-strong); background: var(--ds-tier-colour);
      color: var(--ds-tier-ink, var(--ds-text-primary)); line-height: 14px;
    }
    .ds-home__focus .ds-focus__bullets > .ds-cluster {
      width: 100%; flex-wrap: nowrap; justify-content: space-between;
    }
  }

  .ds-story {
    display: flex; align-items: center; gap: var(--ds-space-md);
    padding: var(--ds-space-sm) var(--ds-space-md); text-decoration: none; color: inherit;
    border-bottom: 1px solid var(--ds-border-subtle); min-height: var(--ds-table-row); min-width: 0;
  }
  .ds-story:hover { background: var(--ds-surface-hover); }
  .ds-story[data-kind="you"] { background: var(--ds-personal-wash); box-shadow: inset 4px 0 0 var(--ds-personal-edge); }
  /* The Activity outcome keyline is shared product meaning with Android: the viewer is ahead in
     green, was beaten in red, and a PB without a comparison keeps the positive keyline. */
  .ds-story[data-outcome="won"], .ds-story[data-outcome="record"] { box-shadow: inset 3px 0 0 var(--ds-delta-faster); }
  .ds-story[data-outcome="lost"] { box-shadow: inset 3px 0 0 var(--ds-delta-slower); }
  .ds-story[data-outcome="none"] { box-shadow: none; }
  .ds-story__copy { display: flex; flex-direction: column; gap: var(--ds-space-xxs); min-width: 0; flex: 1 1 auto; }
  .ds-story__identity, .ds-story__context, .ds-story__meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-xs);
    min-width: 0; max-width: 100%;
  }
  .ds-story__identity-meta { flex: none; margin-inline-start: auto; color: var(--ds-text-secondary); font-size: var(--ds-type-micro-size); }
  .ds-story__actor {
    font-weight: 600; color: var(--ds-text-primary);
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .ds-story__context { flex-wrap: nowrap; }
  .ds-story__where {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--ds-text-secondary); font-size: var(--ds-type-body-s-size);
  }
  .ds-story__meta { color: var(--ds-text-tertiary); font-size: var(--ds-type-body-s-size); }
  .ds-story__when { white-space: nowrap; }
  .ds-story__when:not(:first-child)::before { content: "·"; margin-inline-end: var(--ds-space-xs); }
  .ds-story__result {
    display: flex; flex: none; flex-direction: column; align-items: flex-end;
    gap: var(--ds-space-xxs); margin-inline-start: auto;
  }
  .ds-story__value { color: var(--ds-text-primary); }
  .ds-story__delta { font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line); }
  .ds-story__result-note {
    color: var(--ds-text-tertiary); font-size: var(--ds-type-micro-size);
    line-height: var(--ds-type-micro-line); white-space: nowrap;
  }
  .ds-story__summary { color: var(--ds-text-tertiary); font-size: var(--ds-type-body-s-size); }
  @media (max-width: 599px) {
    .ds-story { gap: var(--ds-space-sm); }
    .ds-story__copy { flex: 1 1 8rem; }
    /* The result column may give way to a long translated note rather than push the row past the page. */
    .ds-story__result { flex: 0 1 auto; min-width: 0; }
    .ds-story__result-note, .ds-story__delta { white-space: normal; text-align: end; overflow-wrap: anywhere; }
  }
  @media (max-width: 359px) {
    .ds-story { padding-inline: var(--ds-space-sm); }
    .ds-story > .ds-thumb[data-size="sm"] { width: 3.5rem; }
  }

  .ds-notice {
    display: flex; align-items: baseline; gap: var(--ds-space-sm);
    padding: var(--ds-space-sm) 0; text-decoration: none; color: inherit;
    border-bottom: 1px solid var(--ds-border-subtle); min-height: var(--ds-target-min-dense);
  }
  .ds-notice:hover .ds-notice__copy { text-decoration: underline; }
  .ds-notice__dot { flex: none; width: 8px; height: 8px; border-radius: var(--ds-radius-round); background: var(--ds-action-primary); }
  .ds-notice__copy { flex: 1 1 auto; min-width: 0; font-size: var(--ds-type-body-s-size); color: var(--ds-text-body); }
  .ds-notice[data-unread] .ds-notice__copy { color: var(--ds-text-primary); font-weight: 600; }
  .ds-notice__when { flex: none; font-size: var(--ds-type-micro-size); color: var(--ds-text-tertiary); }

  .ds-card {
    display: flex; flex-direction: column; gap: var(--ds-space-sm);
    padding: var(--ds-space-md); text-decoration: none; color: inherit;
    background: var(--ds-surface-raised); border: 1px solid var(--ds-border-subtle); min-width: 0;
  }
  .ds-card:hover { background: var(--ds-surface-hover); }
  .ds-card[data-accent] { border-color: var(--ds-action-primary); }
  .ds-card__copy { display: flex; flex-direction: column; gap: var(--ds-space-xxs); min-width: 0; }
  .ds-card__title { font-size: var(--ds-type-title-size); font-weight: var(--ds-type-title-weight); color: var(--ds-text-primary); }
  .ds-card__body { font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line); color: var(--ds-text-secondary); }

  /* ---- the grids these surfaces sit in (§12: two column -> stacked) ---- */
  .ds-tiles { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-md); }
  @media (min-width: 600px) { .ds-tiles { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); } }
  .ds-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-xl); align-items: start; min-width: 0; }
  @media (min-width: 1100px) { .ds-columns { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); } }
  .ds-stack { display: flex; flex-direction: column; gap: var(--ds-space-lg); min-width: 0; }
  .ds-stack[data-gap="sm"] { gap: var(--ds-space-sm); }
  .ds-stack[data-gap="md"] { gap: var(--ds-space-md); }
  .ds-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-md); min-width: 0; }
  .ds-cluster[data-gap="sm"] { gap: var(--ds-space-sm); }

  @media (forced-colors: active) {
    .ds-hero, .ds-focus, .ds-card, .ds-story, .ds-notice { border: 1px solid CanvasText; }
    .ds-hero__art { display: none; }
    .ds-journey__fill, .ds-notice__dot { background: Highlight; }
    .ds-journey__bar { border: 1px solid CanvasText; }
  }

  /* ================= board extras: combos, flags, references, row details ================= */
  .ds-combo { display: inline-flex; align-items: center; gap: 2px; text-decoration: none; }
  .ds-combo__icon { height: 18px; width: auto; }
  .ds-combo:hover { outline: 1px solid var(--ds-border-strong); outline-offset: 2px; }
  .ds-flag { flex: none; width: 20px; height: auto; border: 1px solid var(--ds-border-subtle); }
  .ds-ref-name { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 var(--ds-space-sm); min-width: 0; }
  .ds-ref-logo { flex: none; width: 18px; height: 18px; object-fit: contain; }
  .ds-missing { color: var(--ds-text-tertiary); }
  .ds-evidence { display: inline-flex; align-items: center; gap: var(--ds-space-xxs); }
  .ds-evidence__link { text-decoration: none; color: var(--ds-text-secondary); min-height: var(--ds-target-min-dense); display: inline-flex; align-items: center; }
  .ds-evidence__link:hover { color: var(--ds-text-primary); }
  /* A run's video: a TV with a play button, in the row and in front of the Details link. */
  .ds-video-mark { width: 22px; height: 22px; }
  .ds-track-detail__video { margin: 0; }
  .ds-track-detail__video .ds-link { gap: var(--ds-space-xs); }
  .ds-track-detail__video .ds-video-mark { width: 20px; height: 20px; }
  .ds-link { color: var(--ds-text-secondary); text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: var(--ds-target-min-dense); }
  .ds-link:hover { color: var(--ds-text-primary); }
  /* A row's own details open under it, spanning the whole table (§15 row actions at A0). */
  .ds-table__row[data-detail] { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-bottom: var(--ds-space-sm); background: var(--ds-surface-control); }
  .ds-table__row[data-detail] .ds-table__cell { grid-column: 1 / -1; grid-row: auto; text-align: left; }
  .ds-table__row[data-detail] .ds-table__cell:empty { display: none; }
  .ds-detail { display: flex; flex-direction: column; gap: var(--ds-space-xxs); padding: var(--ds-space-sm) 0; }
  .ds-track-detail {
    margin-inline: var(--ds-space-lg) var(--ds-space-md);
    padding: var(--ds-space-md);
    gap: var(--ds-space-sm);
    background: var(--ds-surface-control);
    border: 1px solid var(--ds-border-subtle);
  }
  .ds-track-detail__comparison, .ds-track-detail__build, .ds-track-detail__lap, .ds-track-detail__source {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm); margin: 0;
  }
  .ds-track-detail__comparison .ds-delta__value { margin-inline-start: auto; }
  .ds-track-detail__build .ds-combo { flex: none; }
  /* The details sit in a table cell, which does not wrap; the part names are one long line that
     widened the page on a phone (owner 2026-09-28), so the panel wraps its own text. */
  .ds-track-detail { white-space: normal; min-width: 0; }
  .ds-track-detail__build > .ds-body-s { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
  /* A kart part in a Details panel or run summary: its name, then its picture (owner 2026-09-29). */
  .ds-parts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-xs) var(--ds-space-md); min-width: 0; }
  .ds-part { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
  .ds-part__name {
    color: var(--ds-text-body); font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line);
    overflow-wrap: anywhere;
  }
  .ds-part__icon { flex: none; width: auto; height: 24px; object-fit: contain; }
  .ds-track-detail__laps { display: grid; gap: var(--ds-space-xs); }
  .ds-track-detail__lap { padding-block: var(--ds-space-xs); border-top: 1px solid var(--ds-border-subtle); }
  .ds-track-detail__lap > :last-child { margin-inline-start: auto; }
  /* Share run: the button, and what happened beside it. */
  .ds-track-detail__share { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm); margin: 0; }
  .ds-track-detail__shared { color: var(--ds-text-secondary); overflow-wrap: anywhere; min-width: 0; }
  /* Mushrooms and coins per lap: the column head names them from 600 px up; on a phone the icon does. */
  .ds-track__phone-combo { display: none; }
  .ds-per-lap { display: inline-flex; align-items: center; gap: var(--ds-space-xxs); white-space: nowrap; }
  .ds-per-lap__icon { display: none; flex: none; width: 16px; height: 16px; object-fit: contain; }
  @media (max-width: 599px) {
    /* The name line is the name and, at its end, the combo: it spans the row, so the columns below
       only hold the time, the gap and Details, and a whole in-game name fits (owner 2026-09-28). */
    .ds-track__board .ds-table__row:not([data-detail]) > .ds-table__cell[data-phone="name"] { grid-column: 2 / -1; }
    .ds-track__phone-combo { display: inline-flex; margin-inline-start: auto; }
    .ds-per-lap__icon { display: inline-block; }
    .ds-track-detail { margin-inline: var(--ds-space-sm) var(--ds-space-xs); }
    .ds-track-detail__lap > :last-child { margin-inline-start: 0; flex-basis: 100%; }
  }
  @media (pointer: coarse) { .ds-link, .ds-evidence__link { min-height: var(--ds-target-min); } }
  @media (pointer: coarse) { .ds-evidence__link { min-width: var(--ds-target-min); justify-content: center; } }
  @media (forced-colors: active) {
    .ds-table__row[data-detail] { border: 1px solid CanvasText; }
    .ds-flag { border: 1px solid CanvasText; }
  }

  /* ================= Tracks & Cups (W06) =================
     A directory: the cup icons and the track thumbnails are the art, the cards are the action.
     Nothing here is sized per value, so the grid simply reflows by width (§12). */
  .ds-cups__lede { margin: 0; color: var(--ds-text-secondary); max-width: 46rem; }
  .ds-cups__mobile-heading, .ds-cups__search-label { display: none; }
  .ds-cups__track-cup { display: none; }
  .ds-cups__engine { display: flex; flex-direction: column; gap: var(--ds-space-xs); align-items: flex-start; }
  .ds-cups__engine-label {
    font-size: var(--ds-type-label-size); line-height: var(--ds-type-label-line);
    font-weight: var(--ds-type-label-weight); color: var(--ds-text-secondary);
  }
  .ds-cups__controls { display: flex; flex-direction: column; gap: var(--ds-space-xs); min-width: 0; }
  .ds-cups__search { max-width: 28rem; }
  .ds-cups__status { margin: 0; }
  .ds-cups__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: var(--ds-space-sm); }
  .ds-cups__grid-cell { display: block; min-width: 0; }
  .ds-cups__cup {
    display: flex; flex-direction: column; align-items: center; gap: var(--ds-space-xs);
    width: 100%; min-height: var(--ds-target-min); padding: var(--ds-space-md) var(--ds-space-sm);
    background: var(--ds-surface-raised); border: 1px solid var(--ds-border-subtle);
    color: var(--ds-text-primary); cursor: pointer;
  }
  .ds-cups__cup:hover { background: var(--ds-surface-hover); }
  .ds-cups__cup-icon { flex: none; width: 3.25rem; height: 3.25rem; object-fit: contain; }
  .ds-cups__cup-name {
    min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: var(--ds-type-label-size); line-height: var(--ds-type-label-line);
    font-weight: var(--ds-type-label-weight); color: var(--ds-text-body); text-align: center;
  }
  .ds-cups__cup-head { display: flex; align-items: center; gap: var(--ds-space-md); }
  .ds-cups__cup-head-icon { flex: none; width: 2.5rem; height: 2.5rem; object-fit: contain; }
  .ds-cups__tracks { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-md); }
  @media (min-width: 600px) { .ds-cups__tracks { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); } }
  @media (max-width: 599px) {
    /* Compose's chooser starts with its compact title, count and search. The Web-only engine
       choice sits beside the title (owner 02-11: "at the top next to Choose a Cup"). */
    .tt-auth:has(.ds-cups) { padding-top: var(--ds-space-md); }
    .ds-cups {
      display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--ds-space-sm);
      row-gap: var(--ds-space-sm); align-items: center;
    }
    .ds-cups > * { grid-column: 1 / -1; }
    .ds-cups > .ds-hero { display: contents; overflow: visible; }
    .ds-cups > .ds-hero .ds-hero__body { display: none; }
    .ds-cups > .ds-hero .ds-hero__aside {
      grid-column: 2; grid-row: 1; display: block; padding: var(--ds-space-sm) var(--ds-space-md) 0 0;
    }
    .ds-cups > .ds-hero .ds-hero__aside:empty { display: none; }
    .ds-cups .ds-cups__engine { align-items: flex-end; }
    .ds-cups .ds-cups__engine-label { font-size: var(--ds-type-micro-size); }
    .ds-cups__mobile-heading {
      grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: var(--ds-space-sm);
      padding: var(--ds-space-sm) 0 0 var(--ds-space-md);
    }
    .ds-cups:not(:has(.ds-cups__engine)) .ds-cups__mobile-heading { grid-column: 1 / -1; padding-right: var(--ds-space-md); }
    .ds-cups__mobile-icon:empty, .ds-cups__mobile-back:empty { display: none; }
    .ds-cups__mobile-cup { display: block; width: 34px; height: 34px; object-fit: contain; }
    .ds-cups__mobile-copy { display: grid; gap: var(--ds-space-xs); flex: 1 1 auto; min-width: 0; }
    .ds-cups__mobile-back { flex: none; }
    .ds-cups__mobile-title {
      margin: 0; font-family: var(--ds-font-display); font-size: var(--ds-type-display-6-size);
      line-height: var(--ds-type-display-6-line); font-style: italic; font-synthesis: style; font-weight: 800;
      text-transform: uppercase; color: var(--ds-text-primary);
    }
    .ds-cups__mobile-meta { margin: 0; color: var(--ds-text-secondary); }
    .ds-cups__controls { order: 2; padding-inline: var(--ds-space-md); }
    .ds-cups__search-label { display: block; color: var(--ds-text-body); font-weight: 600; }
    .ds-cups__search {
      max-width: none; min-height: var(--ds-target-min); background: var(--ds-surface-control);
      border: 1px solid var(--ds-border-strong); box-shadow: none;
    }
    .ds-cups[data-view="grid"] .ds-cups__status,
    .ds-cups[data-view="detail"] .ds-cups__status { display: none; }
    .ds-cups > .ds-stack { order: 3; margin-top: var(--ds-space-sm); }
    .ds-cups__grid {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: var(--ds-space-sm);
      margin-inline: calc(var(--ds-space-md) * -1);
    }
    .ds-cups__cup { height: 100%; padding: var(--ds-space-xs) 2px; gap: 2px; }
    .ds-cups__cup-name {
      white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere;
    }
    .ds-cups:is([data-view="detail"], [data-view="search"]) { margin-inline: -12px; }
    .ds-cups:is([data-view="detail"], [data-view="search"]) .ds-cups__mobile-heading { padding-inline: 0; }
    .ds-cups:is([data-view="detail"], [data-view="search"]) .ds-cups__controls { padding-inline: 0; }
    .ds-cups[data-view="detail"] .ds-cups__search::placeholder { opacity: 0; }
    .ds-cups[data-view="search"] .ds-cups__status { margin-top: 12px; }
    .ds-cups[data-view="search"] > .ds-stack { margin-top: 0; }
    .ds-cups[data-view="detail"] .ds-panel {
      padding: 0; gap: 0; border: 0; background: transparent;
    }
    .ds-cups[data-view="detail"] .ds-panel__header,
    .ds-cups[data-view="detail"] .ds-cups__cup-head { display: none; }
    .ds-cups__tracks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-space-sm); }
    .ds-cups__tracks .ds-card { padding: 0; gap: 0; }
    .ds-cups__tracks .ds-thumb__art { display: block; border: 0; }
    .ds-cups__tracks .ds-thumb__badge { display: none; }
    .ds-cups__tracks .ds-card__copy { gap: var(--ds-space-xxs); padding: var(--ds-space-sm); }
    .ds-cups__tracks .ds-card__title {
      display: flex; align-items: center; gap: var(--ds-space-xs); min-width: 0;
      font-size: var(--ds-type-label-size); line-height: var(--ds-type-label-line);
      font-weight: 600; overflow-wrap: anywhere;
    }
    .ds-cups__track-cup { display: block; flex: none; width: 20px; height: 20px; object-fit: contain; }
    .ds-cups__tracks .ds-card__body {
      font-size: var(--ds-type-micro-size); line-height: var(--ds-type-micro-line);
    }
  }
  @media (forced-colors: active) { .ds-cups__cup { border: 1px solid CanvasText; } }

  /* ================= data screens (W12, W13, W15, W28) =================
     LOW/MEDIUM routes: no accent surfaces, no art backdrops. The only pictures are the identities
     and the flags, which are the data. Every value is printed beside its bar (§15). */
  .ds-mystats__status, .ds-community__status, .ds-records__status, .ds-compare__status { margin: 0; }
  .ds-community__lede { margin: 0; color: var(--ds-text-secondary); max-width: 46rem; }
  /* W28 My records & stats, MEDIUM since the owner's redesign (2026-09-26): the header carries your
     strongest track's art, Mastery is drawn in its own colours, and the record book is cup cards
     with track thumbnails instead of a bare table. */
  .ds-mystats__hero { display: grid; }
  /* The hero's copy column hugs its content; the stat row takes the full width beside the title. */
  .ds-mystats__hero .ds-hero__copy > .ds-stat-grid { align-self: stretch; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr)); gap: var(--ds-space-md); }
  .ds-mystats__strongest { font-family: var(--ds-font-ui); font-size: var(--ds-type-body-size); font-weight: 600; }
  .ds-mystats__rank { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--ds-space-sm); }
  .ds-mystats__mastery, .ds-mystats__strongest { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-xs); }
  .ds-mystats__overview { display: grid; gap: var(--ds-space-lg); grid-template-columns: minmax(0, 1fr); }
  .ds-mystats__overview > * { min-width: 0; }
  @media (min-width: 1100px) { .ds-mystats__overview { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); } }
  .ds-mystats__level-bar {
    display: flex; height: 14px; overflow: hidden; border-radius: var(--ds-radius-hairline);
    background: var(--ds-surface-hover);
  }
  .ds-mystats__level-segment { flex: 0 0 var(--ds-share); min-width: 2px; background: var(--ds-tier-colour, var(--ds-surface-hover)); }
  .ds-mystats__level-segment[data-open] { background: var(--ds-surface-hover); }
  .ds-mystats__levels { display: flex; flex-wrap: wrap; gap: var(--ds-space-xs); }
  .ds-mystats__level {
    display: inline-flex; align-items: center; gap: var(--ds-space-xs); min-height: var(--ds-target-min);
    padding: 0 var(--ds-space-sm); border: 1px solid var(--ds-border-subtle); background: var(--ds-surface-control);
    color: var(--ds-text-primary); font: inherit; cursor: pointer;
  }
  .ds-mystats__level[aria-pressed="true"] { border-color: var(--ds-text-primary); background: var(--ds-surface-hover); }
  .ds-mystats__open-chip { color: var(--ds-text-secondary); font-size: var(--ds-type-micro-size); font-weight: 600; }
  .ds-mystats__momentum-line { margin: 0; color: var(--ds-text-body); }
  .ds-mystats__section-label { margin: 0; }
  .ds-mystats__highlights { display: grid; gap: var(--ds-space-sm); }
  .ds-mystats__highlights:empty { display: none; }
  .ds-mystats__highlight-grid { display: grid; gap: var(--ds-space-sm); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
  .ds-mystats__highlight {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--ds-space-sm);
    padding: var(--ds-space-sm) var(--ds-space-md); border: 1px solid var(--ds-border-subtle);
    background: var(--ds-surface-raised); color: var(--ds-text-body); text-decoration: none;
  }
  .ds-mystats__highlight[data-kind="combo"] { grid-template-columns: minmax(0, 1fr); }
  a.ds-mystats__highlight:hover, a.ds-mystats__track:hover { background: var(--ds-surface-hover); }
  .ds-mystats__highlight-copy, .ds-mystats__track-copy { display: grid; gap: 2px; min-width: 0; }
  .ds-mystats__highlight-track, .ds-mystats__track-name {
    color: var(--ds-text-primary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .ds-mystats__highlight-headline { display: inline-flex; align-items: center; gap: var(--ds-space-xs); font-family: var(--ds-font-data); font-weight: 600; color: var(--ds-text-primary); }
  .ds-mystats__combo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-space-xs) var(--ds-space-sm); }
  .ds-mystats__combo-part { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); align-items: center; gap: var(--ds-space-xs); min-width: 0; }
  .ds-mystats__combo-art { width: 2.5rem; height: 2.5rem; object-fit: contain; }
  .ds-mystats__combo-copy { display: grid; min-width: 0; }
  .ds-mystats__combo-copy > .ds-micro { color: var(--ds-text-secondary); }
  .ds-mystats__combo-name { color: var(--ds-text-primary); font-weight: 600; overflow-wrap: anywhere; }
  /* Week labels under the momentum columns stay on one line, so every column shares one baseline. */
  .ds-mystats .ds-chart { overflow: visible; }
  .ds-mystats .ds-chart__column { min-width: 0; }
  /* The label is centred on a zero-width box, so it never sets its column's width. */
  .ds-mystats .ds-chart__label { display: flex; justify-content: center; width: 0; white-space: nowrap; }
  /* Twelve weeks on a narrow phone: label every other week so no two labels touch. */
  @media (max-width: 599px) { .ds-mystats .ds-chart__column:nth-child(even) .ds-chart__label { visibility: hidden; } }
  .ds-mystats__cups { display: grid; gap: var(--ds-space-lg); }
  .ds-mystats__cup { display: grid; gap: var(--ds-space-xs); min-width: 0; }
  .ds-mystats__cup-title { display: flex; align-items: center; gap: var(--ds-space-xs); margin: 0; font-size: var(--ds-type-body-size); color: var(--ds-text-primary); }
  .ds-mystats__cup-icon { width: 24px; height: 24px; object-fit: contain; }
  .ds-mystats__cup-tracks, .ds-mystats__track-list {
    display: grid; gap: var(--ds-space-xs); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  }
  .ds-mystats__track {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--ds-space-sm);
    min-height: var(--ds-target-min); padding: var(--ds-space-xs) var(--ds-space-sm);
    border: 1px solid var(--ds-border-subtle); background: var(--ds-surface-raised); color: var(--ds-text-body); text-decoration: none;
  }
  .ds-mystats__track[data-raced="false"] { border-style: dashed; background: transparent; }
  .ds-mystats__track[data-raced="false"] .ds-mystats__track-name { color: var(--ds-text-secondary); }
  .ds-mystats__track-line { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-sm); color: var(--ds-text-primary); }
  .ds-mystats__track-facts { color: var(--ds-text-secondary); overflow-wrap: anywhere; }
  .ds-mystats__clear { margin-inline-start: var(--ds-space-xs); padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
  .ds-mystats__footer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-xs) var(--ds-space-md); margin: 0; color: var(--ds-text-secondary); }
  .ds-mystats__total { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-xs); }

  .ds-community__countries { display: flex; flex-direction: column; gap: var(--ds-space-xs); margin: 0; padding: 0; list-style: none; }
  .ds-community__country { display: grid; grid-template-columns: auto minmax(0, 9rem) minmax(0, 1fr); align-items: center; gap: var(--ds-space-sm); min-height: var(--ds-target-min-dense); }
  .ds-community__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ds-text-body); }
  @media (max-width: 599px) {
    .ds-community__country { grid-template-columns: auto minmax(0, 1fr); }
    .ds-community__country .ds-bar-row { grid-column: 1 / -1; }
  }

  .ds-records__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-lg); }
  .ds-records__champions-panel { grid-column: 1 / -1; }
  @media (min-width: 1100px) {
    .ds-records__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  .ds-records__champions { --ds-cols-tablet: var(--ds-cols); }
  .ds-records__champion-character {
    display: inline-flex; align-items: center; gap: var(--ds-space-sm);
    min-width: 0; max-width: 12rem;
  }
  .ds-records__champion-character-icon {
    flex: none; width: 2.5rem; height: 2.5rem; object-fit: contain;
  }
  .ds-records__champion-character-name {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .ds-records__champion-character-missing { color: var(--ds-text-tertiary); }

  .ds-compare__identity { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm); margin: 0 0 var(--ds-space-sm); min-width: 0; }
  .ds-compare__avatar { flex: none; width: 2.5rem; height: 2.5rem; object-fit: contain; }
  .ds-compare__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
  .ds-compare__sides { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-md); }
  @media (min-width: 600px) { .ds-compare__sides { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .ds-compare__score { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: var(--ds-space-md); }
  .ds-compare__versus { font-size: var(--ds-type-label-size); font-weight: var(--ds-type-label-weight); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ds-text-tertiary); }
  .ds-compare__cup-icon { width: 1.75rem; height: 1.75rem; object-fit: contain; }
  .ds-compare__picker { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--ds-space-md); }
  .ds-compare__nights { display: flex; flex-wrap: wrap; gap: var(--ds-space-sm) var(--ds-space-lg); margin: 0; padding: 0; list-style: none; }
  .ds-compare__night { display: inline-flex; align-items: baseline; gap: var(--ds-space-xs); }
  .ds-combined__note { font-size: var(--ds-type-label-size); line-height: var(--ds-type-label-line); color: var(--ds-text-tertiary); overflow-wrap: anywhere; }

  /* ================= Activity (W16) and the reaction control =================
     A feed of sessions: the card is the system's StoryCard, and everything a session recorded sits
     under it behind a Disclosure. LOW: no art backdrop, no accent surfaces. */
  .ds-activity__status, .ds-activity__applied, .ds-activity__rank-note { margin: 0; }
  .ds-activity__list { display: flex; flex-direction: column; min-width: 0; }
  .ds-activity__list > :last-child { border-bottom: 0; }
  .ds-activity__item { display: flex; flex-direction: column; min-width: 0; border-bottom: 1px solid var(--ds-border-subtle); }
  .ds-activity__item .ds-story { border-bottom: 0; }
  .ds-activity__under { display: flex; flex-direction: column; gap: var(--ds-space-xs); padding: 0 var(--ds-space-md) var(--ds-space-sm); min-width: 0; }
  .ds-panel .ds-activity__item .ds-story, .ds-panel .ds-activity__under { padding-inline: 0; }
  .ds-activity__action, .ds-activity__gap {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ds-space-xs); margin: 0;
    font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line); color: var(--ds-text-secondary);
  }
  .ds-activity__run { display: flex; flex-direction: column; gap: var(--ds-space-xs); min-width: 0; }
  .ds-activity__run-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ds-space-sm); margin: 0; }
  /* Activity run summary = the APK's ActivityStoryDetailDialog (Mk8dxDialog + Mk8dxPanel runs):
     94% wide up to 720, app surface, strong 1 px edge, lg padding; title and a quiet Close share
     the header; the feed's 104 px track art beside the time; a raised, bordered panel per run. */
  .ds-dialog.ds-activity-summary {
    /* The UA's modal max-width (100% - 2em - 6px) would hold a phone at 322 px, not the APK's 94%. */
    width: min(720px, 94vw); max-width: 94vw; max-height: calc(100dvh - 2 * var(--ds-space-md));
    background: var(--ds-surface-app);
    box-shadow: var(--ds-elevation-overlay), inset 0 0 0 1px var(--ds-border-strong);
  }
  .ds-activity-summary .ds-dialog__body {
    grid-template-columns: minmax(0, 1fr) auto; align-items: start;
    gap: var(--ds-space-sm); padding: var(--ds-space-lg);
  }
  .ds-activity-summary .ds-dialog__body > * { grid-column: 1 / -1; min-width: 0; margin: 0; }
  .ds-activity-summary .ds-dialog__body > .ds-title {
    grid-column: 1; align-self: center; margin-block-end: calc(var(--ds-space-md) - var(--ds-space-sm));
  }
  .ds-activity-summary .ds-dialog__body > .ds-dialog__actions {
    grid-column: 2; grid-row: 1; align-self: center; margin-block-end: calc(var(--ds-space-md) - var(--ds-space-sm));
  }
  .ds-activity-summary__identity { display: flex; align-items: center; gap: var(--ds-space-sm); min-width: 0; }
  .ds-activity-summary__identity > .activity-list__thumb {
    flex: none; width: 6.5rem; box-sizing: border-box; border: 2px solid var(--ds-activity-engine);
  }
  .ds-activity-summary .activity-list__thumb--150 { --ds-activity-engine: var(--ds-engine-150); }
  .ds-activity-summary .activity-list__thumb--200 { --ds-activity-engine: var(--ds-engine-200); }
  .ds-activity-summary .activity-list__thumb > .activity__mode {
    top: var(--ds-space-xxs); right: auto; left: var(--ds-space-xxs);
    display: inline-flex; align-items: center; gap: 3px; min-width: 0;
    min-height: 1rem; padding: 1px var(--ds-space-xs); font-size: .625rem; line-height: .75rem;
  }
  .ds-activity-summary .activity-list__thumb > .activity__mode::before {
    content: "›"; font-size: 1.25em; font-weight: 900; line-height: .8;
  }
  .ds-activity-summary .activity-list__source {
    position: absolute; z-index: 2; top: var(--ds-space-xxs); right: var(--ds-space-xxs);
    box-sizing: border-box; width: 1.1875rem; height: 1.1875rem; padding: 2px;
    background: var(--ds-surface-app); border: 1px solid var(--ds-border-subtle);
  }
  .ds-activity-summary .activity-list__cup {
    top: auto; bottom: var(--ds-space-xxs); left: var(--ds-space-xxs); width: 1.1875rem; height: 1.1875rem;
  }
  .ds-activity-summary .activity-list__track-label { left: 1.75rem; right: var(--ds-space-xxs); bottom: var(--ds-space-xxs); }
  .ds-activity-summary .activity-list__track-copy {
    width: auto; max-width: 100%; box-sizing: border-box; gap: 0; padding: 2px 3px; border: 0; border-radius: 0;
  }
  .ds-activity-summary .activity-list__track-copy strong { font-size: .6875rem; line-height: .8125rem; }
  .ds-activity-summary .activity-list__track-copy small { font-size: .5625rem; line-height: .8125rem; }
  .ds-activity-summary__headline { display: grid; gap: 2px; min-width: 0; }
  .ds-activity-summary__time { margin: 0; color: var(--ds-text-primary); }
  .ds-activity-summary__byline, .ds-activity-summary__setup {
    margin: 0; color: var(--ds-text-body);
    font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line);
  }
  .ds-activity-summary__setup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .ds-activity-summary__comparison { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-xs); }
  .ds-activity-summary__comparison .ds-delta__value { font-weight: 600; }
  .ds-activity-summary__comparison-label, .ds-activity-summary__note {
    margin: 0; color: var(--ds-text-secondary);
    font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line);
  }
  .ds-activity-summary__run {
    display: grid; gap: var(--ds-space-sm); min-width: 0; padding: var(--ds-space-md);
    background: var(--ds-surface-raised); border: 1px solid var(--ds-border-subtle);
  }
  .ds-activity-summary__run-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm); min-width: 0; }
  .ds-activity-summary__run-name {
    color: var(--ds-text-primary); font-weight: 600;
    font-size: var(--ds-type-title-size); line-height: var(--ds-type-title-line);
  }
  .ds-activity-summary__gap { color: var(--ds-text-secondary); }
  .ds-activity-summary__run-time { margin-inline-start: auto; font-weight: 600; color: var(--ds-text-primary); white-space: nowrap; }
  .ds-activity-summary__cta { display: flex; }
  /* Mk8dxTableHeader + weighted rows: micro bold header, data-style lines, no rules. */
  .ds-activity-summary__laps { width: 100%; table-layout: fixed; border-collapse: collapse; }
  .ds-activity-summary__laps :is(th, td):not(:last-child) { padding-inline-end: var(--ds-space-sm); }
  .ds-activity-summary__laps th {
    padding-block: 0 var(--ds-space-xs); text-align: start; color: var(--ds-text-secondary);
    font-size: var(--ds-type-micro-size); line-height: var(--ds-type-micro-line); font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .ds-activity-summary__laps td { padding-block: 0; text-align: start; color: var(--ds-text-body); white-space: nowrap; }
  .ds-activity-summary__laps :is(th, td):nth-child(1) { width: 14%; }
  .ds-activity-summary__laps :is(th, td):nth-child(2) { width: 34%; }
  .ds-activity-summary__laps :is(th, td):nth-child(3) { width: 22%; }
  .ds-activity-summary__laps :is(th, td):nth-child(4) { width: 30%; }
  .ds-activity__loadout { display: flex; flex-wrap: wrap; gap: var(--ds-space-xs) var(--ds-space-md); margin: 0; font-size: var(--ds-type-body-s-size); }
  .ds-activity__loadout-part { display: inline-flex; align-items: baseline; gap: var(--ds-space-xxs); min-width: 0; }
  .ds-activity__group { display: flex; flex-direction: column; min-width: 0; }

  .ds-reactions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-xs); position: relative; min-width: 0; }
  .ds-reactions__pills { display: flex; flex-wrap: wrap; gap: var(--ds-space-xxs); min-width: 0; }
  .ds-reactions__pill, .ds-reactions__toggle, .ds-reactions__option {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--ds-space-xxs);
    min-height: var(--ds-target-min-dense); padding: 0 var(--ds-space-sm);
    background: var(--ds-surface-control); border: 1px solid var(--ds-border-subtle);
    color: var(--ds-text-body); cursor: pointer;
  }
  .ds-reactions__pill:hover, .ds-reactions__toggle:hover, .ds-reactions__option:hover { background: var(--ds-surface-hover); }
  .ds-reactions__pill[aria-pressed="true"], .ds-reactions__option[aria-pressed="true"] {
    background: var(--ds-surface-selected); box-shadow: inset 0 0 0 2px var(--ds-text-primary); color: var(--ds-text-primary);
  }
  .ds-reactions__picker {
    position: absolute; inset-block-start: 100%; inset-inline-start: 0; z-index: 2;
    display: flex; flex-wrap: wrap; gap: var(--ds-space-xxs); max-width: 18rem; padding: var(--ds-space-xs);
    background: var(--ds-surface-raised); border: 1px solid var(--ds-border-strong);
  }
  .ds-reactions__picker[hidden] { display: none; }
  .ds-reactions__hint { font-size: var(--ds-type-label-size); color: var(--ds-text-tertiary); }
  @media (pointer: coarse) {
    .ds-reactions__pill, .ds-reactions__toggle, .ds-reactions__option { min-height: var(--ds-target-min); }
  }
  @media (forced-colors: active) {
    .ds-reactions__pill, .ds-reactions__toggle, .ds-reactions__option, .ds-reactions__picker { border: 1px solid CanvasText; }
  }

  /* ================= Build (W14) =================
     The four part colours are the builder's KEY, not decoration: the same value is the slot's edge,
     the legend's swatch and the meter's segment, and every segment prints its own contribution. They
     are product data (§6), handed in per element; everything else on this route is tokens. */
  .ds-build__lede { margin: 0; color: var(--ds-text-secondary); max-width: 46rem; }
  .ds-build__explanation, .ds-build__guide { margin: 0; color: var(--ds-text-secondary); }
  .ds-build__shared:empty { display: none; }
  .ds-build > .ds-kicker, .ds-build > .ds-display-6 { margin: 0; }
  .ds-build__loadout { padding: var(--ds-space-md); }
  .ds-build .ds-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-build .ds-setup { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--ds-space-sm); }
  .ds-build .ds-setup-part { padding: var(--ds-space-xs); }
  .ds-build .ds-setup-part__art { width: 100%; height: 70px; }
  .ds-build .ds-setup-part__kind { font-weight: 700; }
  .ds-build .ds-setup-part__name { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
  .ds-setup-part[data-build-part] { border-top: 3px solid var(--ds-build-part); }
  .ds-build__legend { margin-block: 0 var(--ds-space-md); }
  .ds-build__swatch { flex: none; width: 12px; height: 12px; background: var(--ds-build-part); }
  .ds-build__groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-lg); }
  .ds-build__group { display: grid; gap: var(--ds-space-xs); }
  .ds-build__group-title { margin: 0; }
  .ds-build__rows { display: flex; flex-direction: column; gap: var(--ds-space-xs); }
  .ds-build__row { display: grid; grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr) 5.5rem; align-items: center; gap: var(--ds-space-sm); }
  .ds-build__row { min-height: var(--ds-target-min-dense); }
  .ds-build__row-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ds-type-label-size); color: var(--ds-text-secondary); }
  .ds-build__row-value { flex: none; font-size: var(--ds-type-data-s-size); }
  .ds-build__meter {
    position: relative; min-width: 0; height: 1.75rem; background: var(--ds-surface-control);
    overflow: hidden; border: 1px solid var(--ds-border-strong);
  }
  .ds-build__fill { display: flex; width: var(--ds-build-share, 0%); height: 100%; }
  /* A contribution is centred on its own segment (§10). Android deliberately keeps even a very
     small contribution visible across the segment edge, so the Web value may overflow its colour
     block too; the meter's accessible name also retains the complete attribution. */
  .ds-build__segment {
    display: flex; align-items: center; justify-content: center; min-width: 0; overflow: visible;
    container-type: inline-size;
    background: var(--ds-build-part); color: var(--ds-build-ink);
  }
  .ds-build__contribution {
    position: relative; z-index: 1; font-family: var(--ds-font-data);
    font-variant-numeric: tabular-nums; font-size: 0.6875rem; font-weight: 600; white-space: nowrap;
  }
  .ds-build__tick {
    position: absolute; inset-block-start: 0; inset-inline-start: var(--ds-build-tick);
    width: 2px; height: 0.375rem; color: var(--ds-text-primary); background: currentColor;
    box-shadow: 0 1.25rem 0 currentColor; opacity: 0.72;
  }
  .ds-build__share > .ds-button { width: 100%; }
  @media (max-width: 599px) {
    .ds-build__loadout, .ds-build__stats { padding: var(--ds-space-md); }
    .ds-build .ds-setup-part { gap: var(--ds-space-xxs); padding: var(--ds-space-xxs); }
    .ds-build .ds-setup-part__art { height: 70px; }
    .ds-build .ds-setup-part__kind { font-size: var(--ds-type-micro-size); }
    .ds-build .ds-setup-part__name { font-size: var(--ds-type-body-s-size); }
    .ds-build__row { grid-template-columns: minmax(0, 1fr) auto; }
    .ds-build__row-label { grid-column: 1; grid-row: 1; }
    .ds-build__row-value { grid-column: 2; grid-row: 1; }
    .ds-build__meter { grid-column: 1 / -1; grid-row: 2; }
    .ds-build__contribution { font-size: 0.5rem; }
  }
  @media (forced-colors: active) {
    .ds-build__meter, .ds-build__swatch { border: 1px solid CanvasText; }
    .ds-build__segment { border-inline-end: 1px solid CanvasText; }
  }

  /* The page frame's own heading and live region, on a design-system surface (see the product
     page): two classes so an unmigrated route's more specific legacy rules still win. */
  .ds-root.ds-page-title {
    font-family: var(--ds-font-display); font-weight: 800; font-style: italic; font-synthesis: style;
    text-transform: uppercase; color: var(--ds-text-primary);
    font-size: var(--ds-type-display-4-size); line-height: var(--ds-type-display-4-line);
    margin: 0 0 var(--ds-space-sm);
  }
  .ds-root.ds-page-status {
    font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line);
    color: var(--ds-text-secondary); margin: 0 0 var(--ds-space-lg);
  }
  .ds-root.ds-page-status:empty { display: none; }

  /* ================= sign-in, device approval, legacy published (W03, W04, W22) =================
     MINIMAL routes: no art, one panel, one field, one action at a time. */
  .ds-signin__status:empty, .ds-published__status:empty { display: none; }
  .ds-signin__status, .ds-published__status { margin: 0; }
  .ds-signin, .ds-device, .ds-published { display: flex; flex-direction: column; gap: var(--ds-space-lg); min-width: 0; }
  .ds-signin .ds-panel, .ds-device .ds-panel { max-width: 40rem; }
  /* The A2 onboarding steps (1 Trust, 2 Scan sign-in card, 3 Done) on /device, worded as on /setup. */
  .ds-onboarding-steps {
    display: flex; flex-wrap: wrap; gap: var(--ds-space-xxs) var(--ds-space-sm); margin: 0; padding: 0;
    list-style: none; min-width: 0;
  }
  .ds-onboarding-steps__step {
    display: inline-flex; align-items: center; gap: var(--ds-space-xxs); min-width: 0;
    font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line); color: var(--ds-text-secondary);
  }
  .ds-onboarding-steps__mark {
    display: inline-grid; place-items: center; min-width: 1.75em; height: 1.75em; border-radius: 999px;
    border: 1px solid var(--ds-border-subtle); font-weight: 700;
  }
  .ds-onboarding-steps__step[data-state="done"] .ds-onboarding-steps__mark {
    background: color-mix(in srgb, var(--ds-status-success) 22%, transparent);
  }
  .ds-onboarding-steps__step[data-state="current"] { color: var(--ds-text-primary); font-weight: 700; }
  .ds-onboarding-steps__step[data-state="current"] .ds-onboarding-steps__mark {
    background: var(--ds-action-primary); color: var(--ds-action-on-primary); border-color: transparent;
  }
  .ds-device__next { margin: 0; padding-left: 1.5em; }
  .ds-device__next > li { overflow-wrap: anywhere; }
  .ds-signin__account { display: flex; flex-direction: column; gap: var(--ds-space-xs); align-items: flex-start; }

  /* ================= Home compositions (W01, W02) ================= */
  @media (max-width: 1099px) {
    .ds-home__side-column { display: none; }
    .ds-home__main-column > :empty { display: none; }
    .ds-home__focus .ds-panel__actions { display: none; }
  }
  .ds-home__standing {
    display: flex; flex-direction: column; align-items: flex-start; gap: var(--ds-space-xxs);
    text-decoration: none; color: inherit; min-width: 0;
    padding: var(--ds-space-xs) var(--ds-space-sm);
    background: color-mix(in srgb, var(--ds-surface-raised) 72%, transparent);
    border: 1px solid var(--ds-border-subtle);
  }
  .ds-home__standing:hover { background: var(--ds-surface-hover); }
  .ds-home__standing-label { display: inline-flex; align-items: center; gap: var(--ds-space-xs); }
  .ds-home__standing-value { display: inline-flex; align-items: baseline; gap: var(--ds-space-xs); }
  .ds-home__standing-badge { display: inline-flex; align-items: center; gap: var(--ds-space-xs); }
  .ds-home__standing-hint { color: var(--ds-text-secondary); }
  .ds-home__moved { color: var(--ds-text-secondary); }
  @media (max-width: 599px) {
    .ds-home__journey .ds-panel__title,
    .ds-home__focus .ds-panel__title,
    .ds-home__away .ds-panel__title,
    .ds-home__inbox .ds-panel__title,
    .ds-home__feed .ds-panel__title,
    .ds-home__places .ds-panel__title {
      font-family: var(--ds-font-ui); font-size: var(--ds-type-micro-size);
      line-height: var(--ds-type-micro-line); font-weight: 700;
      color: var(--ds-text-secondary); text-transform: uppercase; letter-spacing: 0.08em;
    }
    .ds-home__inbox > .ds-panel { gap: var(--ds-space-sm); padding: var(--ds-space-md); }
    .ds-home__inbox .ds-panel__note, .ds-home__inbox-detail { display: none; }
    .ds-home__inbox-compact { display: flex; align-items: flex-start; }
    .ds-home__hero .ds-hero__copy > .ds-cluster {
      display: flex; flex-wrap: wrap; gap: var(--ds-space-md) var(--ds-space-lg); width: 100%;
    }
    .ds-home__standing { min-width: 8.75rem; padding: 0; gap: var(--ds-space-xs); background: transparent; border: 0; }
    .ds-home__standing-value {
      font-family: var(--ds-font-data); font-size: var(--ds-type-data-l-size);
      line-height: var(--ds-type-data-l-line); font-weight: var(--ds-type-data-l-weight);
      font-variant-numeric: tabular-nums; white-space: nowrap;
    }
    .ds-home__standing-hint {
      font-family: var(--ds-font-data); font-size: var(--ds-type-data-s-size);
      line-height: var(--ds-type-data-s-line); font-weight: var(--ds-type-data-s-weight);
      white-space: nowrap;
    }
    .ds-home__standing-badge { gap: var(--ds-space-sm); }
    .ds-home__standing .ds-tier-chip {
      min-height: auto; padding: 2px var(--ds-space-sm); clip-path: none; box-shadow: none;
      border: 1px solid var(--ds-border-strong); background: var(--ds-tier-colour);
      color: var(--ds-tier-ink, var(--ds-text-primary)); line-height: 14px;
    }
    .ds-home__hero .ds-hero__aside, .ds-home__hero .ds-hero__aside > .ds-stack { width: 100%; }
    .ds-home__hero .ds-button[data-variant="primary"] { width: 100%; }
  }
  .ds-home__counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-space-sm); }
  .ds-home__targets { display: flex; flex-direction: column; }
  .ds-home__count {
    display: flex; flex-direction: column; gap: var(--ds-space-xxs);
    padding: var(--ds-space-sm); text-decoration: none; color: inherit;
    background: var(--ds-surface-control); border: 1px solid var(--ds-border-subtle);
    min-height: var(--ds-target-min);
  }
  .ds-home__count:hover { background: var(--ds-surface-hover); }
  .ds-home__journey-grid { display: flex; flex-direction: column; }
  /* APK Journey at every width (owner 2026-09-26): two-column progress cards with the level in the
     bar, 2-column counts and raised target cards, on desktop as on the phone. */
  .ds-home__journey > .ds-panel { gap: var(--ds-space-md); padding: var(--ds-space-md); }
  .ds-home__journey-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-space-sm); }
  .ds-home__journey-grid .ds-journey {
    gap: var(--ds-space-sm); min-height: 9.5rem; padding: var(--ds-space-md);
    background: var(--ds-surface-raised); border: 1px solid var(--ds-border-subtle);
  }
  .ds-home__journey-grid .ds-journey__copy {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start;
    gap: var(--ds-space-xs);
  }
  .ds-home__journey-grid .ds-journey__label {
    overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere;
    color: var(--ds-text-secondary); font-weight: 700; text-transform: uppercase;
  }
  .ds-home__journey-grid .ds-journey__value {
    grid-column: 1 / -1; grid-row: 2; font-size: var(--ds-type-data-m-size);
  }
  .ds-home__journey-grid .ds-journey__done {
    grid-column: 2; grid-row: 1; padding: 2px var(--ds-space-sm);
    background: color-mix(in srgb, var(--ds-status-success) 14%, transparent);
    clip-path: polygon(var(--ds-slant-tag) 0, 100% 0, calc(100% - var(--ds-slant-tag)) 100%, 0 100%);
    font-size: var(--ds-type-micro-size); font-weight: 700;
  }
  .ds-home__journey-grid .ds-journey__bar {
    position: relative; height: 1.5rem; margin-block-start: auto;
    background: var(--ds-surface-control);
  }
  .ds-home__journey-grid .ds-journey:not([data-complete]) .ds-journey__fill {
    background: color-mix(in srgb, var(--ds-status-info) 48%, var(--ds-surface-control));
  }
  .ds-home__journey-grid .ds-journey[data-complete] .ds-journey__fill {
    background: color-mix(in srgb, var(--ds-status-success) 48%, var(--ds-surface-control));
  }
  .ds-home__journey-grid .ds-journey__percentage {
    position: absolute; inset: 0; display: flex; align-items: center;
    padding-inline: var(--ds-space-sm); color: var(--ds-text-primary);
    font-size: var(--ds-type-data-s-size); font-weight: 600;
  }
  .ds-home__count { background: var(--ds-surface-raised); }
  .ds-home__targets { gap: var(--ds-space-sm); }
  .ds-home__targets .ds-journey {
    gap: var(--ds-space-xs); padding: var(--ds-space-md); background: var(--ds-surface-raised);
    border: 1px solid var(--ds-border-subtle);
  }
  .ds-home__targets .ds-journey[data-target] .ds-journey__copy {
    flex-direction: column; align-items: flex-start; gap: var(--ds-space-xs);
  }
  .ds-home__targets .ds-journey__label {
    overflow: visible; text-overflow: clip; white-space: normal;
    color: var(--ds-text-secondary); font-size: var(--ds-type-micro-size);
    line-height: var(--ds-type-micro-line); font-weight: 600; text-transform: uppercase;
  }
  .ds-home__targets .ds-journey__value {
    width: 100%; justify-content: flex-start;
    font-size: var(--ds-type-data-m-size); line-height: var(--ds-type-data-m-line);
    font-weight: 600;
  }
  .ds-home__targets .ds-journey__note {
    color: var(--ds-text-secondary); font-size: var(--ds-type-body-s-size);
    line-height: var(--ds-type-body-s-line);
  }
  /* A grid/flex item is as wide as its content unless it is told it may shrink; without this the
     story list kept its widest row's min-content width and pushed the page sideways (360 px, NL). */
  .ds-home__stories, .ds-home__notices { display: flex; flex-direction: column; min-width: 0; }
  .ds-home__reactable { min-width: 0; }
  /* "You and <Player>" on a profile (owner 2026-09-26): record, your turn, four actions with their
     own rule and state, then the history both ways. */
  .ds-profile__interactions-slot:empty { display: none; }
  .ds-interactions { display: grid; gap: var(--ds-space-md); min-width: 0; scroll-margin-top: 5rem; }
  .ds-interactions p { margin: 0; }
  .ds-interactions__record, .ds-interactions__status { color: var(--ds-text-secondary); }
  .ds-interactions__status:empty { display: none; }
  .ds-interactions__turn { display: grid; gap: var(--ds-space-sm); }
  .ds-interactions__turn:empty { display: none; }
  .ds-interactions__turn-item {
    display: grid; gap: var(--ds-space-xs); padding: var(--ds-space-sm) var(--ds-space-md);
    background: var(--ds-surface-control); box-shadow: inset 3px 0 0 var(--ds-status-warning);
  }
  .ds-interactions__actions {
    display: grid; gap: var(--ds-space-sm); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  }
  .ds-interactions__action {
    display: grid; align-content: start; gap: var(--ds-space-xs); min-width: 0;
    padding: var(--ds-space-sm) var(--ds-space-md); border: 1px solid var(--ds-border-subtle);
  }
  .ds-interactions__action-title { font-weight: 600; color: var(--ds-text-primary); }
  .ds-interactions__action-explain, .ds-interactions__action-note { color: var(--ds-text-secondary); }
  .ds-interactions__action[data-available="false"] .ds-interactions__action-note { color: var(--ds-text-primary); font-weight: 600; }
  .ds-interactions__select {
    min-width: 0; max-width: 100%; min-height: var(--ds-target-min); flex: 1 1 12rem;
    font: inherit; color: var(--ds-text-primary); background: var(--ds-surface-control); border: 1px solid var(--ds-border-strong);
  }
  .ds-interactions__history-title { margin: 0; }
  .ds-interactions__history { display: grid; margin: 0; padding: 0; list-style: none; }
  .ds-interactions__entry {
    display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto auto; align-items: center;
    gap: var(--ds-space-xs) var(--ds-space-sm); padding-block: var(--ds-space-xs);
    border-bottom: 1px solid var(--ds-border-subtle);
  }
  .ds-interactions__entry:last-child { border-bottom: 0; }
  .ds-interactions__text { min-width: 0; overflow-wrap: anywhere; color: var(--ds-text-body); }
  .ds-interactions__link { margin-inline-start: var(--ds-space-sm); white-space: nowrap; }
  .ds-interactions__when { color: var(--ds-text-secondary); white-space: nowrap; }
  @media (max-width: 599px) {
    .ds-interactions__entry { grid-template-columns: 1.5rem minmax(0, 1fr); }
    .ds-interactions__entry > .ds-chip, .ds-interactions__entry > .ds-interactions__when { grid-column: 2; justify-self: start; }
  }
  .ds-home__stories > :last-child, .ds-home__notices > :last-child { border-bottom: 0; }
  .ds-home__away-list { display: flex; flex-direction: column; gap: var(--ds-space-xs); margin: 0; padding-left: var(--ds-space-lg); }
  .ds-home__night-name { color: var(--ds-text-primary); text-decoration: none; }
  .ds-home__night-name:hover { text-decoration: underline; }
  /* Without a night tonight the slot is empty; hidden, so its column gap cannot push Journey 16 px
     below Focus on desktop. */
  .ds-home__night:empty { display: none; }
  .ds-home__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-space-md); }
  @media (min-width: 600px) { .ds-home__facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .ds-home__fact { display: flex; flex-direction: column; gap: var(--ds-space-xxs); }
  /* The Home stories sit inside a Panel, which already pads its content. */
  .ds-panel .ds-home__stories .ds-story, .ds-panel .ds-home__notices .ds-notice { padding-inline: 0; }
  .ds-home__activity-actor { display: inline-flex; align-items: center; gap: var(--ds-space-xs); min-width: 0; }
  .ds-home__activity-actor strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ds-activity-quick { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, .8fr) minmax(0, .8fr); align-items: center; gap: var(--ds-space-xs); min-width: 0; }
  .ds-activity-quick__combo, .ds-activity-quick__metric { display: flex; align-items: center; justify-content: center; min-width: 0; }
  /* A long lap pattern (seven laps) wraps inside its cell at 320 px instead of widening the card. */
  .ds-activity-quick__metric .ds-data-s { min-width: 0; white-space: normal; overflow-wrap: anywhere; text-align: center; }
  .ds-activity-quick__combo { gap: 2px; }
  .ds-activity-quick__part { width: 1.35rem; height: 1.2rem; object-fit: contain; }
  .ds-activity-quick__icon { width: 1.2rem; height: 1.1rem; object-fit: contain; margin-inline-end: 3px; }
  /* APK Home Activity rows at every width (owner 2026-09-26): the 106 px track art with its engine
     edge and compact labels, identity row, result, metrics and unboxed reactions. They were phone-only
     and desktop squeezed the art to 72 px under the full-size badges. Scoped to the signed-in feed; the signed-out
     feed keeps its own row with the track name. */
  .ds-home__stories--apk { gap: var(--ds-space-sm); }
  .ds-home__stories--apk .ds-story {
    display: grid; grid-template-columns: 6.625rem minmax(0, 1fr); align-items: start;
    gap: var(--ds-space-xs) var(--ds-space-sm); padding: var(--ds-space-sm);
    background: var(--ds-surface-raised); border: 1px solid var(--ds-border-subtle);
  }
  .ds-home__stories--apk .ds-story[data-kind="you"] { background: var(--ds-surface-raised); }
  .ds-home__stories--apk .ds-story > .activity-list__thumb {
    grid-column: 1; grid-row: 1 / span 2; width: 6.625rem;
  }
  .ds-home__stories--apk .ds-story__copy { grid-column: 2; grid-row: 1; }
  .ds-home__stories--apk .ds-story__context { display: none; }
  .ds-home__stories--apk .ds-story__result {
    grid-column: 2; grid-row: 2; align-items: flex-end; margin: 0;
  }
  .ds-home__stories--apk .ds-activity-quick { grid-column: 1 / -1; grid-row: 3; }
  .ds-home__stories--apk .ds-story > .activity-list__thumb {
    grid-column: 1; grid-row: 1 / span 3; width: 6.625rem;
    box-sizing: border-box; border: 2px solid var(--ds-activity-engine);
  }
  .ds-home__stories--apk .activity-list__thumb--150 { --ds-activity-engine: var(--ds-engine-150); }
  .ds-home__stories--apk .activity-list__thumb--200 { --ds-activity-engine: var(--ds-engine-200); }
  .ds-home__stories--apk .activity-list__thumb > .activity__mode {
    top: var(--ds-space-xxs); right: auto; left: var(--ds-space-xxs);
    display: inline-flex; align-items: center; gap: 3px; min-width: 0;
    min-height: 1rem; padding: 1px var(--ds-space-xs); font-size: .625rem; line-height: .75rem;
  }
  .ds-home__stories--apk .activity-list__thumb > .activity__mode::before {
    content: "›"; font-size: 1.25em; font-weight: 900; line-height: .8;
  }
  .ds-home__stories--apk .activity-list__source {
    position: absolute; z-index: 2; top: var(--ds-space-xxs); right: var(--ds-space-xxs);
    box-sizing: border-box; width: 1.1875rem; height: 1.1875rem; padding: 2px;
    background: var(--ds-surface-app); border: 1px solid var(--ds-border-subtle);
  }
  .ds-home__stories--apk .activity-list__cup {
    top: auto; bottom: var(--ds-space-xxs); left: var(--ds-space-xxs);
    width: 1.1875rem; height: 1.1875rem;
  }
  .ds-home__stories--apk .activity-list__track-label {
    left: 1.75rem; right: var(--ds-space-xxs); bottom: var(--ds-space-xxs);
  }
  .ds-home__stories--apk .activity-list__track-copy {
    width: auto; max-width: 100%; box-sizing: border-box;
    gap: 0; padding: 2px 3px; border: 0; border-radius: 0;
  }
  .ds-home__stories--apk .activity-list__track-copy strong {
    font-size: .6875rem; line-height: .8125rem;
  }
  .ds-home__stories--apk .activity-list__track-copy small {
    font-size: .5625rem; line-height: .8125rem;
  }
  .ds-home__stories--apk .ds-story__copy { display: contents; }
  .ds-home__stories--apk .ds-story__identity {
    grid-column: 2; grid-row: 1; flex-wrap: nowrap; width: 100%;
  }
  .ds-home__stories--apk .ds-story__actor { flex: 1 1 auto; }
  /* APK identity row: secondary rank · SemiBold name filling the row · 22×15 flag beside the age. */
  .ds-home__stories--apk .ds-story__actor:has(> .ds-home__activity-actor),
  .ds-home__stories--apk .ds-home__activity-actor { display: contents; }
  .ds-home__stories--apk .ds-home__activity-actor > .ds-data {
    flex: none; color: var(--ds-text-secondary); font-weight: 400;
  }
  .ds-home__stories--apk .ds-home__activity-actor > strong {
    flex: 1 1 auto; min-width: 0; font-weight: 600; color: var(--ds-text-primary);
  }
  .ds-home__stories--apk .ds-home__activity-actor > .ds-flag { flex: none; width: 22px; height: 15px; }
  .ds-home__stories--apk .ds-story__identity-meta { margin-inline-start: 0; }
  .ds-home__stories--apk .ds-story__meta {
    grid-column: 2; grid-row: 2; align-self: center; justify-self: start;
  }
  .ds-home__stories--apk .ds-story__summary { grid-column: 2; grid-row: 3; }
  .ds-home__stories--apk .ds-home__story-rank-mark {
    display: flex; grid-column: 2; grid-row: 4; justify-self: start;
  }
  .ds-home__stories--apk .ds-story:has(> .ds-home__story-rank-mark) .ds-activity-quick { grid-row: 5; }
  .ds-home__stories--apk .ds-story__result {
    grid-column: 2; grid-row: 2; align-self: center; justify-self: end;
    flex-direction: row; align-items: baseline; gap: var(--ds-space-xs);
  }
  .ds-home__stories--apk .ds-activity-quick { grid-column: 1 / -1; grid-row: 4; }
  .ds-home__stories--apk .ds-story[data-activity-layout="community"] > .activity-list__thumb {
    grid-row: 1 / span 2;
  }
  .ds-home__stories--apk .ds-story[data-activity-layout="community"] .ds-activity-quick {
    grid-row: 3;
  }
  .ds-home__stories--apk .ds-story__result-note { display: none; }
  /* Reactions belong to the run above them (owner 2026-09-26): the run and its reaction row share
     one bordered card, the row set off by a thin rule, so no reaction reads as the next card's. */
  .ds-home__stories--apk .ds-home__reactable {
    border: 1px solid var(--ds-border-subtle); background: var(--ds-surface-raised);
  }
  .ds-home__stories--apk .ds-home__reactable > .ds-story { border: 0; }
  .ds-home__reactable > .ds-reactions {
    margin-inline: var(--ds-space-sm); padding: var(--ds-space-xs) 0;
    border: 0; border-top: 1px solid var(--ds-border-subtle); background: transparent;
  }
  .ds-home__reactable .ds-reactions__toggle {
    padding-inline: 0; border-color: transparent; background: transparent;
    color: var(--ds-text-primary); text-decoration: underline; text-underline-offset: 3px;
  }
  @media (max-width: 599px) {
    .ds-home :is(.ds-segment, .ds-engine-option) { min-height: var(--ds-target-min); }
    .ds-home__feed-scope {
      display: flex; gap: var(--ds-space-xs); align-self: flex-start; max-width: 100%;
      overflow-x: auto;
    }
    .ds-home__feed-scope .ds-filter-chip { flex: none; min-height: var(--ds-target-min); }
    .ds-home__feed-scope .ds-filter-chip[aria-pressed="true"] {
      box-shadow: inset 0 0 0 1px var(--ds-border-strong);
    }
    .ds-home__feed-controls .ds-segmented { align-self: flex-start; }
    .ds-home__feed > .ds-panel { gap: var(--ds-space-md); padding: var(--ds-space-md); }
    .ds-home__feed .ds-panel__header { align-items: center; }
    .ds-home__feed-group { margin: var(--ds-space-sm) 0 0; }
  }

  /* The installed app uses the complete phone canvas for Home. Its section surfaces begin at a
     12 px inset, instead of nesting a second Panel inset inside the page's 16 px content gutter.
     Keep the desktop composition untouched and remove that frame only on phones; this also gives
     the two-column Journey cards their native width. */
  @media (max-width: 599px) {
    .ds-home {
      margin-block-start: calc(var(--ds-space-md) * -1);
      /* Home alone owns the complete phone canvas. Its normal content origin includes the page's
         16 px gutter and the browser's established 8 px frame. */
      margin-inline: calc(var(--ds-gutter-phone) * -1 - 8px);
      gap: var(--ds-space-sm);
    }
    .ds-home__columns, .ds-home__main-column { gap: var(--ds-space-sm); }

    .ds-home__hero .ds-hero {
      gap: var(--ds-space-md); padding: 0 var(--ds-space-md) var(--ds-space-xxs);
      border-inline: 0;
    }
    /* APK Home shades the whole track strip evenly, then ends it sharply. */
    .ds-home__hero .ds-hero__art { height: 8rem; }
    .ds-home__hero .ds-hero__backdrop { opacity: 1; filter: none; }
    .ds-home__hero .ds-hero[data-spectacle="high"] .ds-hero__art::after {
      background: color-mix(in srgb, var(--ds-surface-app) 72%, transparent);
    }
    .ds-home__hero .ds-hero__body {
      display: grid; grid-template-columns: 3rem minmax(0, 1fr);
      grid-template-rows: 3.75rem 2.75rem auto; gap: 0 var(--ds-space-md);
      align-items: center; padding-top: var(--ds-space-lg);
    }
    .ds-home__hero .ds-hero__thumb {
      grid-column: 1; grid-row: 1 / span 2; width: 3rem;
    }
    .ds-home__hero .ds-hero__copy { display: contents; }
    .ds-home__hero .ds-hero__title {
      grid-column: 2; grid-row: 1; align-self: end;
      font-size: var(--ds-type-display-2-size); line-height: var(--ds-type-display-2-line);
    }
    .ds-home__hero .ds-hero__eyebrow {
      grid-column: 2; grid-row: 2; align-self: start; padding-top: var(--ds-space-xs);
      font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line);
      font-weight: var(--ds-type-body-s-weight);
    }
    .ds-home__hero .ds-hero__copy > .ds-cluster {
      grid-column: 1 / -1; grid-row: 3; margin-top: calc(var(--ds-space-lg) + var(--ds-space-md));
    }
    /* A plain line (the no-Player welcome) spans the hero, never the 3rem thumb column. */
    .ds-home__hero .ds-hero__copy > .ds-body { grid-column: 1 / -1; }
    .ds-home__hero .ds-hero__aside { padding-inline: 0; }
    .ds-home__hero .ds-hero__aside > .ds-stack { align-items: flex-start; gap: 14px; }
    .ds-home__hero .ds-button[data-variant="primary"] {
      width: auto; min-width: 0; padding: 0 26px 0 20px;
    }
    .ds-home__hero-records { min-height: 3rem; padding-inline: 3px; }
    .ds-home__standing-label {
      font-size: var(--ds-type-micro-size); line-height: var(--ds-type-micro-line);
    }

    .ds-home__journey > .ds-panel,
    .ds-home__focus > .ds-panel,
    .ds-home__feed > .ds-panel,
    .ds-home__places > .ds-panel {
      gap: var(--ds-space-sm); padding: var(--ds-space-md);
      background: transparent; border: 0;
    }
    .ds-home__away > .ds-panel, .ds-home__inbox > .ds-panel {
      gap: var(--ds-space-sm); padding: var(--ds-space-md); border-inline: 0;
    }
    .ds-home__journey-grid .ds-journey {
      min-height: 8rem; padding: var(--ds-space-md); gap: var(--ds-space-sm);
    }
    .ds-home__journey-grid .ds-journey__label {
      font-size: var(--ds-type-micro-size); line-height: var(--ds-type-micro-line);
      overflow-wrap: normal;
    }
    .ds-home__away-list { gap: var(--ds-space-xs); padding-left: 0; }
    .ds-home__focus .ds-focus__native-extra { display: none; }

  }

  /* ================= SectionHeader, GroupBoard, WinnerCard, SectionIndex, ShareButton, StepChevron
     (§15, §24 Content/Operator) — the tournament family's shared vocabulary, the twin of the
     Android `Mk8dxSectionLabel` / `Mk8dxGroupBoard` / `Mk8dxLiveTag` set ================= */
  .ds-section-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ds-space-sm) var(--ds-space-md); min-width: 0; }
  .ds-section-label__text {
    margin: 0; font-family: var(--ds-font-display); font-weight: 800; font-style: italic; font-synthesis: style;
    text-transform: uppercase; color: var(--ds-text-primary);
    font-size: var(--ds-type-display-6-size); line-height: var(--ds-type-display-6-line);
  }
  .ds-section-label__note { flex: 1 0 100%; margin: 0; color: var(--ds-text-secondary); font-family: var(--ds-font-ui); font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line); max-width: 68ch; }

  /* One group's standing. The group's colour is the top edge and is never the only carrier: the
     group is always named in words beside it. */
  .ds-board {
    display: grid; gap: var(--ds-space-sm); min-width: 0;
    padding: var(--ds-space-lg); background: var(--ds-surface-raised);
    border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-radius-hairline);
    border-top: 3px solid var(--ds-board-accent, var(--ds-border-strong));
  }
  .ds-board__header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm) var(--ds-space-md); min-width: 0; }
  .ds-board__title { margin: 0; flex: 1 1 auto; min-width: 0; color: var(--ds-text-primary); font-style: italic; font-synthesis: style; text-transform: uppercase; font-family: var(--ds-font-display); font-weight: 800; }
  .ds-board__meta { margin: 0; color: var(--ds-text-secondary); font-family: var(--ds-font-ui); font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line); }
  .ds-board__rows { --ds-board-rank: 3; display: grid; min-width: 0; font-family: var(--ds-font-data); font-size: var(--ds-type-data-size); }
  .ds-board__row {
    display: grid; align-items: center; column-gap: var(--ds-space-md);
    grid-template-columns: calc(var(--ds-board-rank) * 1ch + 8px) minmax(6ch, 1fr) auto;
    min-height: var(--ds-table-row-dense); padding: 0 var(--ds-space-sm);
    border-bottom: 1px solid var(--ds-border-subtle); color: var(--ds-text-body);
  }
  .ds-board__row > * { min-width: 0; }
  .ds-board__row:last-child { border-bottom: 0; }
  .ds-board__row[data-head] { font-family: var(--ds-font-ui); font-size: var(--ds-type-micro-size); font-weight: var(--ds-type-micro-weight); color: var(--ds-text-secondary); min-height: 30px; }
  .ds-board__row[data-wash] { background: color-mix(in srgb, var(--ds-board-wash) 45%, transparent); }
  .ds-board__rank { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; text-align: right; }
  .ds-board__value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; text-align: right; color: var(--ds-text-primary); }
  .ds-board__name { display: flex; align-items: center; gap: var(--ds-space-xs); min-width: 0; font-family: var(--ds-font-ui); font-size: var(--ds-type-body-size); }
  .ds-board__name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ds-board__name a { color: inherit; }
  .ds-board__face { flex: none; width: 24px; height: 24px; object-fit: contain; }
  /* §15/§17: the podium is a numeral in its rank colour and a 3 px edge — never a medal glyph. */
  .ds-board__row[data-podium="1"] { box-shadow: inset 3px 0 0 var(--ds-rank-gold); }
  .ds-board__row[data-podium="2"] { box-shadow: inset 3px 0 0 var(--ds-rank-silver); }
  .ds-board__row[data-podium="3"] { box-shadow: inset 3px 0 0 var(--ds-rank-bronze); }
  .ds-board__row[data-podium="1"] .ds-board__rank { color: var(--ds-rank-gold); }
  .ds-board__row[data-podium="2"] .ds-board__rank { color: var(--ds-rank-silver); }
  .ds-board__row[data-podium="3"] .ds-board__rank { color: var(--ds-rank-bronze); }
  /* On a 45 % group wash the medal colours fall below 3:1; the edge keeps the medal, the numeral the text colour. */
  .ds-board__row[data-wash][data-podium] .ds-board__rank { color: var(--ds-text-primary); }
  .ds-board__row[data-kind="you"] { background: var(--ds-personal-wash); box-shadow: inset 4px 0 0 var(--ds-personal-edge); color: var(--ds-text-primary); }
  @media (max-width: 599px) {
    .ds-board__row { grid-template-columns: calc(var(--ds-board-rank) * 1ch + 8px) minmax(0, 1fr); grid-auto-rows: auto; padding-block: var(--ds-space-xxs); }
    .ds-board__value { grid-column: 2; text-align: left; white-space: normal; overflow-wrap: anywhere; }
    .ds-board__row[data-head] .ds-board__value { display: none; }
  }

  .ds-winner {
    display: flex; align-items: center; gap: var(--ds-space-lg); min-width: 0;
    padding: var(--ds-space-lg) var(--ds-space-xl); background: var(--ds-surface-raised);
    border: 1px solid var(--ds-border-subtle);
    box-shadow: inset 4px 0 0 var(--ds-rank-gold);
  }
  .ds-winner[data-podium="2"] { box-shadow: inset 4px 0 0 var(--ds-rank-silver); }
  .ds-winner[data-podium="3"] { box-shadow: inset 4px 0 0 var(--ds-rank-bronze); }
  .ds-winner__rank { flex: none; font-size: var(--ds-type-data-l-size); line-height: 1; font-weight: 600; color: var(--ds-rank-gold); }
  .ds-winner[data-podium="2"] .ds-winner__rank { color: var(--ds-rank-silver); }
  .ds-winner[data-podium="3"] .ds-winner__rank { color: var(--ds-rank-bronze); }
  .ds-winner__art { flex: none; width: 44px; height: 44px; object-fit: contain; }
  .ds-winner__copy { display: flex; flex-direction: column; gap: var(--ds-space-xxs); min-width: 0; }
  .ds-winner__label { font-family: var(--ds-font-ui); font-size: var(--ds-type-micro-size); font-weight: var(--ds-type-micro-weight); text-transform: uppercase; letter-spacing: .06em; color: var(--ds-text-secondary); }
  .ds-winner__name { font-family: var(--ds-font-display); font-style: italic; font-synthesis: style; font-weight: 800; text-transform: uppercase; font-size: var(--ds-type-display-6-size); line-height: var(--ds-type-display-6-line); color: var(--ds-text-primary); overflow-wrap: break-word; }
  .ds-winner__link { color: inherit; }
  .ds-winner__value { color: var(--ds-text-primary); font-weight: 600; }
  .ds-winner__meta { font-family: var(--ds-font-ui); font-size: var(--ds-type-body-s-size); line-height: var(--ds-type-body-s-line); color: var(--ds-text-secondary); }

  /* The bar that says which chapter of a long page the reader is inside (§12). */
  .ds-index {
    position: sticky; top: var(--ds-index-top, 0px); z-index: 3;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--ds-space-xs) var(--ds-space-md);
    padding: var(--ds-space-sm) var(--ds-space-lg); text-align: center;
    background: var(--ds-surface-raised); border: 1px solid var(--ds-border-subtle);
  }
  .ds-index__where { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--ds-space-xs) var(--ds-space-sm); min-width: 0; }
  .ds-index__title { display: inline-flex; align-items: center; gap: var(--ds-space-xs); font-family: var(--ds-font-ui); font-size: var(--ds-type-label-size); font-weight: 700; color: var(--ds-text-primary); }
  .ds-index__icon { width: 20px; height: 20px; object-fit: contain; }
  .ds-index__subtitle { font-family: var(--ds-font-ui); font-size: var(--ds-type-body-s-size); color: var(--ds-text-secondary); }
  .ds-index__jumps { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--ds-space-xs); }

  .ds-share { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm) var(--ds-space-md); }
  .ds-share__note { margin: 0; min-height: 1.2em; font-family: var(--ds-font-ui); font-size: var(--ds-type-body-s-size); color: var(--ds-text-secondary); }

  .ds-steps { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-xxs); margin: 0; padding: 0; list-style: none; }
  .ds-steps__step {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; min-height: 22px; padding: 0 var(--ds-space-xxs);
    background: var(--ds-surface-control); color: var(--ds-text-tertiary);
    font-size: var(--ds-type-data-s-size); font-weight: 600;
    clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 50%, calc(100% - 5px) 100%, 0 100%, 5px 50%);
  }
  .ds-steps__step[data-state="done"] { background: color-mix(in srgb, var(--ds-status-success) 22%, transparent); color: var(--ds-text-body); }
  .ds-steps__step[data-state="current"] { background: var(--ds-mode-race); color: var(--ds-mode-race-on, var(--ds-surface-app)); }

  /* ================= Tournaments (W17) and the night (W19, W20, W21) =================
     The list is MEDIUM and the night HIGH (§5). Every colour here is a token; the only product
     colours in the family are the group ladder, which the tier chips carry. */
  .ds-tournaments__lede, .ds-tournaments__overview { margin: 0; }
  .ds-tournaments__none, .ds-tournaments__note, .ds-night__status { margin: 0; }
  .ds-tournaments__shelf, .ds-tournaments__statistics { min-width: 0; }
  /* "Request to host" for a signed-in non-Director (ADR-0220). */
  .ds-host-request { min-width: 0; overflow-wrap: anywhere; }
  .ds-host-request > p, .ds-host-request__feedback { margin: 0; }
  .ds-host-request__input { width: 100%; max-width: 40rem; min-height: 4.5rem; resize: vertical; }
  .ds-host-request__note { white-space: pre-line; }
  /* Open sign-up and the player's status line (ADR-0222): a night's page and the Step 2 panel. */
  .ds-signup, .ds-signup-board { min-width: 0; overflow-wrap: anywhere; }
  .ds-signup p, .ds-signup__feedback, .ds-signup__heading { margin: 0; }
  .ds-signup__heading { font-size: var(--ds-type-body-size, 1rem); }
  .ds-signup__consoles { border: 0; margin: 0; padding: 0; display: grid; gap: var(--ds-space-xxs); min-width: 0; }
  .ds-signup__console { display: flex; gap: var(--ds-space-xs); align-items: center; }
  .ds-signup__actions, .ds-signup-board__actions { display: flex; flex-wrap: wrap; gap: var(--ds-space-xs); }
  .ds-signup__list, .ds-signup-board__entries { margin: 0; padding-inline-start: var(--ds-space-lg); display: grid; gap: var(--ds-space-xxs); }
  .ds-signup__seed { word-break: break-all; }
  .ds-signup-board__settings { display: grid; gap: var(--ds-space-xs); grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
  .ds-signup-board__field { display: grid; gap: var(--ds-space-xxs); min-width: 0; }
  .ds-signup-board__field .ds-input { width: 100%; min-width: 0; }
  .ds-signup-board__entry { display: grid; gap: var(--ds-space-xxs); min-width: 0; }
  .ds-signup-board__name { font-weight: 700; }
  .ds-tournaments__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ds-space-sm); }
  .ds-tournaments__item { display: grid; gap: var(--ds-space-xs); min-width: 0; justify-items: start; }
  .ds-tournaments__item > * { max-width: 100%; }
  .ds-tournaments__row {
    display: grid; gap: var(--ds-space-xxs); width: 100%; min-width: 0;
    padding: var(--ds-space-md) var(--ds-space-lg);
    background: var(--ds-surface-raised); border: 1px solid var(--ds-border-subtle);
    color: var(--ds-text-body); text-decoration: none;
  }
  .ds-tournaments__row:hover, .ds-tournaments__row:focus-visible { background: var(--ds-surface-hover); }
  .ds-tournaments__item[data-kind="you"] .ds-tournaments__row { box-shadow: inset 4px 0 0 var(--ds-personal-edge); }
  .ds-tournaments__row-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm); min-width: 0; }
  .ds-tournaments__row-title { font-weight: 600; color: var(--ds-text-primary); min-width: 0; }
  .ds-tournaments__row-meta { color: var(--ds-text-secondary); }
  .ds-tournaments__row-meta--phone, .ds-tournaments__mobile-create,
  .ds-tournaments__edit-mobile { display: none; }
  .ds-tournaments__row-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-xs); }
  /* "You raced in this one" is a phrase, not an indicator: the volt is the row's own edge (§15
     YouRow), and the words are read in the ink every other phrase is read in. On Light the volt
     edge is a 3:1 non-text token, so using it as ink failed contrast at 1440 and 390 (axe). */
  .ds-tournaments__mine { color: var(--ds-text-primary); font-weight: 600; font-size: var(--ds-type-body-s-size); }
  .ds-tournaments__item[data-kind="you"] .ds-tournaments__row { background: var(--ds-personal-wash); }
  .ds-tournaments__id { font-family: var(--ds-font-data); font-size: var(--ds-type-data-s-size); color: var(--ds-text-tertiary); overflow-wrap: anywhere; }
  .ds-tournaments__clock { font-variant-numeric: tabular-nums; color: var(--ds-text-primary); white-space: nowrap; }
  .ds-tournaments__when { margin: 0; color: var(--ds-text-body); }
  .ds-tournaments__meta, .ds-tournaments__result { margin: 0; color: var(--ds-text-secondary); }
  .ds-tournaments__result { font-variant-numeric: tabular-nums; }
  .ds-tournaments__seat {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-xs);
    margin: 0; color: var(--ds-text-body);
  }
  .ds-tournaments__console { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0; }
  .ds-tournaments__dot { opacity: .55; }
  .ds-tournaments__player { color: inherit; }
  .ds-tournaments__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm); }
  .ds-tournaments__progress { display: grid; gap: var(--ds-space-xs); }
  .ds-tournaments__progress-head, .ds-tournaments__progress-groups { margin: 0; }
  .ds-tournaments__progress-groups { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-xs); }
  .ds-tournaments__boards {
    display: grid; gap: var(--ds-space-lg); min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  }
  .ds-tournaments__races { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ds-space-sm); }
  .ds-tournaments__race { display: grid; gap: var(--ds-space-xxs); }
  .ds-tournaments__race[data-counted="no"] { opacity: .65; }
  .ds-tournaments__race-title { font-weight: 600; }
  .ds-tournaments__race-order { overflow-wrap: anywhere; }
  .ds-tournaments__control { margin: 0; }
  .ds-tournaments__picture { overflow-x: auto; }
  .ds-tournaments__picture canvas { display: block; max-width: 100%; height: auto; }
  .ds-tournaments__picture-tabs { display: flex; flex-wrap: wrap; gap: var(--ds-space-sm); }
  .ds-tournaments__context { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-md); }
  .ds-night__back { color: var(--ds-text-secondary); justify-self: start; }
  @media (max-width: 599px) {
    /* The installed app gives this route the complete phone canvas, then applies its one 16 px
       content inset. The legacy page wrapper otherwise adds a second frame around every shelf. */
    .ds-tournaments {
      margin-block-start: calc(var(--ds-space-lg) * -1);
      margin-inline: calc(var(--ds-space-2xl) * -1);
      padding-inline: var(--ds-gutter-phone);
      gap: var(--ds-space-md);
    }
    /* Android's MEDIUM hero is an identity line, not a card. Let its title, lede and count line
       participate directly in the page stack while desktop keeps the bordered art surface. */
    .ds-tournaments > .ds-hero {
      display: flex; flex-direction: column; align-items: stretch; gap: var(--ds-space-md); overflow: visible;
      padding: 0; background: transparent; border: 0;
    }
    .ds-tournaments > .ds-hero > .ds-hero__body,
    .ds-tournaments > .ds-hero .ds-hero__copy { display: contents; }
    .ds-tournaments__mobile-create {
      display: inline-flex; justify-self: start; width: fit-content; min-height: var(--ds-button-height-md);
    }
    .ds-tournaments__row-meta--desktop, .ds-tournaments__edit-desktop { display: none; }
    .ds-tournaments__row-meta--phone, .ds-tournaments__edit-mobile { display: inline-flex; }
    .ds-tournaments__shelf .ds-section-label__text {
      font-family: var(--ds-font-ui); font-style: normal; font-size: var(--ds-type-micro-size);
      line-height: var(--ds-type-micro-line); letter-spacing: .08em; color: var(--ds-text-secondary);
    }
    .ds-tournaments__item:not([data-card]) {
      grid-template-columns: minmax(0, 1fr) auto; gap: 0;
      width: 100%; min-height: 6rem; justify-items: stretch; align-items: start;
      background: var(--ds-surface-raised); border: 1px solid var(--ds-border-subtle);
    }
    .ds-tournaments__item:not([data-card]) > .ds-tournaments__row {
      border: 0; background: transparent; padding: var(--ds-space-md);
    }
    .ds-tournaments__item:not([data-card]) > .ds-tournaments__edit-mobile {
      min-height: var(--ds-button-height-md); margin: var(--ds-space-sm) var(--ds-space-sm) 0 0;
    }
    .ds-tournaments__item[data-card] > .ds-panel {
      gap: var(--ds-space-sm); padding: var(--ds-space-md);
    }
    .ds-tournaments__item[data-card] > .ds-panel > .ds-panel__header {
      display: grid; justify-content: stretch; gap: var(--ds-space-sm);
    }
    .ds-tournaments__item[data-card] .ds-panel__title {
      font-family: var(--ds-font-display); font-size: var(--ds-type-display-6-size);
      line-height: var(--ds-type-display-6-line); font-weight: 800; font-style: italic;
      font-synthesis: style; text-transform: uppercase;
    }
    .ds-tournaments__item[data-card] .ds-tournaments__actions > .ds-button {
      min-height: var(--ds-button-height-md);
    }
    .ds-tournaments__seat .ds-tier-chip {
      min-height: auto; padding: 1px 4px; clip-path: none; box-shadow: none;
      border: 1px solid var(--ds-border-strong); background: var(--ds-tier-colour);
      color: color-mix(in srgb, black 88%, var(--ds-tier-colour));
      font-size: 10px; line-height: 12px;
    }
    /* Like the installed night screen, this route owns the full phone canvas and applies one
       16 px content inset. Its standings keep all three columns visible at phone widths. */
    .ds-night {
      margin-block-start: calc(var(--ds-space-lg) * -1);
      margin-inline: calc(var(--ds-space-2xl) * -1);
      padding-inline: var(--ds-gutter-phone);
      gap: var(--ds-space-md);
    }
    .ds-night > .ds-stack { gap: var(--ds-space-md); }
    .ds-night .ds-hero { min-height: 0; padding: var(--ds-space-md); }
    .ds-night .ds-hero__title { order: 1; font-size: 42px; }
    .ds-night .ds-hero__eyebrow { order: 2; }
    .ds-night .ds-hero__backdrop { filter: none; opacity: .44; }
    .ds-night .ds-hero__eyebrow, .ds-night .ds-board__meta {
      font-size: var(--ds-type-micro-size); line-height: var(--ds-type-micro-line);
    }
    .ds-night .ds-night__edit { display: none; }
    .ds-night .ds-board { padding: var(--ds-space-md); }
    .ds-night .ds-board[data-tournament-stage="qualifier"] { border-top-width: 1px; }
    /* The name keeps at least 8ch: a long value ("12 pnt · 3 races · 3 overwinningen") wraps instead of
       squeezing the leader's name to nothing. */
    .ds-night .ds-board__row {
      grid-template-columns: calc(var(--ds-board-rank) * 1ch + 8px) minmax(8ch, 1fr) minmax(0, auto);
      grid-auto-rows: auto; padding-block: 0;
    }
    .ds-night .ds-board__value {
      grid-column: 3; text-align: right; white-space: normal; overflow-wrap: normal;
    }
    .ds-night .ds-board__row[data-head] .ds-board__value { display: block; }
    .ds-night .ds-tournaments__player { text-decoration: none; }
  }
  @media (forced-colors: active) {
    .ds-tournaments__row { border: 1px solid CanvasText; }
  }


  /* ================= Tournament statistics (W18) =================
     LOW (§5): no backdrops, small art, calm tables. The two chart series are the group tokens, each
     named in the legend with a swatch and a word - never "yellow", which stops being true the
     moment the appearance changes. */
  .ds-tstats__subtitle, .ds-tstats__note, .ds-tstats__count { margin: 0; }
  .ds-tstats__heading {
    margin: 0; color: var(--ds-text-secondary); text-transform: uppercase; letter-spacing: .06em;
  }
  .ds-tstats__growth { display: grid; gap: var(--ds-space-sm); min-width: 0; }
  .ds-tstats__svg { display: block; width: 100%; height: auto; }
  .ds-tstats__rule { stroke: var(--ds-border-subtle); stroke-width: 1; }
  .ds-tstats__axis { fill: var(--ds-text-tertiary); font-size: 13px; font-family: var(--ds-font-data); }
  .ds-tstats__line { fill: none; stroke: var(--ds-group-talent); stroke-width: 2.5; stroke-linejoin: round; }
  .ds-tstats__line--seen { stroke: var(--ds-group-champion); stroke-dasharray: 7 5; }
  .ds-tstats__dot { fill: var(--ds-group-talent); }
  .ds-tstats__dot--seen { fill: var(--ds-group-champion); }
  .ds-tstats__value { fill: var(--ds-text-primary); font-size: 13px; font-weight: 700; font-family: var(--ds-font-data); }
  .ds-tstats__value--seen { fill: var(--ds-group-champion); }
  /* A dashed line's swatch is dashed: the mask cuts the gaps out of the series colour, so the
     legend says which line it means by shape as well as by hue. */
  .ds-legend__swatch--dashed {
    mask-image: repeating-linear-gradient(90deg, black 0 4px, transparent 4px 7px);
    -webkit-mask-image: repeating-linear-gradient(90deg, black 0 4px, transparent 4px 7px);
  }
  .ds-tstats__tiles-block { display: grid; gap: var(--ds-space-sm); min-width: 0; }
  .ds-tstats__tiles {
    list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ds-space-md); min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  }
  .ds-tstats__tile {
    position: relative; display: grid; gap: var(--ds-space-xxs); justify-items: center; text-align: center;
    padding: var(--ds-space-md); min-width: 0;
    background: var(--ds-surface-raised); border: 1px solid var(--ds-border-subtle);
  }
  .ds-tstats__tile-button {
    display: grid; gap: var(--ds-space-xxs); justify-items: center; text-align: center;
    width: 100%; min-width: 0; padding: 0; border: 0; background: none; color: inherit;
    font: inherit; cursor: pointer;
  }
  .ds-tstats__tile-rank { color: var(--ds-text-secondary); }
  .ds-tstats__tile-name { font-weight: 600; color: var(--ds-text-primary); overflow-wrap: anywhere; }
  .ds-tstats__tile-note { color: var(--ds-text-tertiary); }
  .ds-tstats__tile-icon { width: 34px; height: 34px; object-fit: contain; }
  .ds-tstats__tile-picture { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--ds-border-subtle); }
  .ds-tstats__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ds-space-md); }
  .ds-tstats__table { min-width: 0; overflow-x: auto; }
  .ds-tstats__filter { width: 100%; min-width: 5ch; }
  .ds-tstats__cell-name, .ds-tstats__cell-cup { display: flex; align-items: center; gap: var(--ds-space-xs); min-width: 0; overflow: hidden; }
  /* The cup's name is a name too: it ellipsises rather than pushing itself out of its cell. */
  .ds-tstats__cell-cup > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* The track's name is the door to its own page and therefore essential information. It wraps
     inside its cell instead of either pushing the button outside the table or hiding the name
     behind an ellipsis. The row is allowed to grow; the numeric cells keep their own exact width. */
  .ds-tstats__cell-name .ds-button-wrap { display: block; min-width: 0; overflow: visible; }
  .ds-tstats__cell-name .ds-button {
    display: block; width: 100%; min-width: 0; max-width: 100%; padding: 0;
    min-height: var(--ds-target-min); text-align: left;
  }
  .ds-tstats__cell-name .ds-button__label {
    display: block; min-width: 0; white-space: normal; overflow-wrap: anywhere;
  }
  .ds-tstats__icon { flex: none; width: 34px; height: 20px; object-fit: cover; }
  /* Below the tablet breakpoint the name cell is a phone line, and a 34 px decorative picture in
     front of a Dutch track name left 4 px of the name hidden at 320 px (range gate, NL). The name
     is the information; the picture is not (§16). */
  @media (max-width: 599px) { .ds-tstats__icon { display: none; } }
  @media (max-width: 359px) {
    /* At the narrowest supported width the identity owns the complete first line. Secondary
       statistics use the lines below it instead of reducing a Dutch track name to a few pixels. */
    .ds-tstats__cell-name { grid-column: 2 / -1; }
  }
  .ds-tstats__icon--cup { width: 20px; height: 20px; object-fit: contain; }
  .ds-tstats__track-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--ds-space-lg); min-width: 0; }
  .ds-tstats__track-head .ds-thumb { width: 12rem; flex: none; }
  .ds-tstats__track-copy { display: grid; gap: var(--ds-space-sm); min-width: 0; flex: 1 1 16rem; }
  .ds-tstats__track-title {
    margin: 0; font-family: var(--ds-font-display); font-weight: 800; font-style: italic;
    font-synthesis: style; text-transform: uppercase; color: var(--ds-text-primary);
    font-size: var(--ds-type-display-6-size); line-height: var(--ds-type-display-6-line);
  }
  .ds-tstats__skill { display: grid; gap: var(--ds-space-sm); min-width: 0; }
  .ds-tstats__player { color: inherit; }
  @media (max-width: 599px) {
    .ds-tstats__track-head .ds-thumb { width: 8rem; }
  }

  /* ================= Apps / private downloads (W31) =================
     LOW spectacle: device identity is a quiet edge and a line mark, never a second product
     palette. Download actions use the outlined global tier so a page with several devices does
     not present several filled A4 actions at once. */
  .ds-apps__intro { max-width: 68ch; margin: 0; color: var(--ds-text-secondary); }
  .ds-apps__signed-out { max-width: 42rem; justify-items: start; }
  .ds-app-downloads { max-width: 66rem; }
  .ds-app-downloads__status { margin: 0; }
  .ds-apps .app-download { position: relative; overflow: hidden; }
  .ds-apps .app-download::before {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
    background: var(--ds-status-info);
  }
  .ds-apps .app-download--android::before { background: var(--ds-status-success); }
  .ds-apps .app-download__header { display: flex; align-items: center; gap: var(--ds-space-lg); min-width: 0; }
  .ds-apps .app-download__identity { display: grid; gap: var(--ds-space-xxs); min-width: 0; }
  .ds-apps .app-download__platform,
  .ds-apps .app-download__product {
    margin: 0; color: var(--ds-text-secondary); font-size: var(--ds-type-micro-size);
    font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  }
  .ds-apps .app-download__meta, .ds-apps .app-download__device {
    margin: 0; color: var(--ds-text-tertiary); font-size: var(--ds-type-label-size);
  }
  .ds-apps .app-download__platform-mark {
    flex: none; width: 4rem; height: 4rem; display: grid; place-items: center;
    color: var(--ds-text-secondary); background: var(--ds-surface-control);
    box-shadow: inset 0 0 0 1px var(--ds-border-subtle);
  }
  .ds-apps .app-download__platform-mark--windows {
    grid-template-columns: repeat(2, .9rem); grid-template-rows: repeat(2, .9rem); gap: 3px;
  }
  .ds-apps .app-download__platform-mark--windows > span { width: .9rem; height: .9rem; background: currentColor; }
  .ds-apps .app-download__platform-mark--android { position: relative; display: block; }
  .ds-apps .app-download__android-head,
  .ds-apps .app-download__android-body {
    position: absolute; left: 50%; transform: translateX(-50%); background: currentColor;
  }
  .ds-apps .app-download__android-head { top: 1rem; width: 2rem; height: 1rem; border-radius: 1rem 1rem 2px 2px; }
  .ds-apps .app-download__android-head::before,
  .ds-apps .app-download__android-head::after {
    content: ""; position: absolute; top: -.42rem; width: 2px; height: .65rem;
    border-radius: var(--ds-radius-round); background: currentColor;
  }
  .ds-apps .app-download__android-head::before { left: .38rem; transform: rotate(-28deg); }
  .ds-apps .app-download__android-head::after { right: .38rem; transform: rotate(28deg); }
  .ds-apps .app-download__android-body { top: 2.13rem; width: 2rem; height: 1rem; border-radius: 2px 2px .42rem .42rem; }
  .ds-apps .app-download__action { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-md); }
  .ds-apps .app-download__button { justify-content: space-between; gap: var(--ds-space-xl); min-width: min(100%, 20rem); }
  .ds-apps .app-download__button-kind {
    padding-left: var(--ds-space-md); border-left: 1px solid currentColor;
    font-size: var(--ds-type-micro-size); letter-spacing: .08em; white-space: nowrap;
  }
  .ds-apps .app-download__section > .ds-disclosure__summary {
    width: 100%; padding-inline: 0; border: 0; background: none; text-align: left;
  }
  .ds-apps .app-download__section > .ds-disclosure__summary[aria-expanded="true"]::before { transform: rotate(90deg); }
  .ds-apps .app-download__section > .ds-disclosure__body[hidden] { display: none; }
  .ds-apps .app-download__intro-summary { margin: 0; color: var(--ds-text-body); }
  .ds-apps .app-download__flow {
    display: grid; grid-template-columns: max-content minmax(0, 1fr);
    gap: var(--ds-space-xs) var(--ds-space-md); margin: 0; padding: var(--ds-space-md);
    background: var(--ds-surface-control);
  }
  .ds-apps .app-download__flow dt {
    padding-top: 2px; color: var(--ds-text-tertiary); font-size: var(--ds-type-micro-size);
    font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  }
  .ds-apps .app-download__flow dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
  .ds-apps .app-download__section ul { margin: 0; padding-left: var(--ds-space-xl); }
  .ds-apps .app-download__checksum {
    margin: 0; color: var(--ds-text-tertiary); font-family: var(--ds-font-data);
    font-size: var(--ds-type-micro-size); overflow-wrap: anywhere;
  }
  @media (max-width: 599px) {
    .ds-apps .app-download__header { align-items: flex-start; gap: var(--ds-space-md); }
    .ds-apps .app-download__platform-mark { width: 3.25rem; height: 3.25rem; transform: scale(.86); transform-origin: top left; margin-right: -.45rem; margin-bottom: -.45rem; }
    .ds-apps .app-download__button { width: 100%; min-width: 0; }
    .ds-apps .app-download__device { width: 100%; }
    .ds-apps .app-download__flow { grid-template-columns: minmax(0, 1fr); }
    .ds-apps .app-download__flow dd { margin-bottom: var(--ds-space-xs); }
  }

  /* ================= Settings (W30) =================
     LOW spectacle and today's independent-save semantics (OD-08). The local navigation groups a
     long account surface without pretending the groups are separate routes. */
  .ds-settings__intro { max-width: 68ch; margin: 0; color: var(--ds-text-secondary); }
  .ds-settings__nav {
    display: flex; flex-wrap: wrap; gap: var(--ds-space-sm);
    padding-block: var(--ds-space-xs); border-block: 1px solid var(--ds-border-subtle);
  }
  .ds-settings__group { scroll-margin-top: var(--ds-space-2xl); }
  .ds-settings__group > h2 { margin: 0; color: var(--ds-text-secondary); }
  .ds-settings__group-body {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ds-space-lg); align-items: start; min-width: 0;
  }
  .ds-settings__group-body > *, .ds-settings__group-body > * > .ds-panel { min-width: 0; }
  .ds-settings .settings__account { grid-column: 1 / -1; justify-items: start; }
  .ds-settings .settings__appearance { min-width: 0; }
  .ds-settings .country-settings,
  .ds-settings .language-settings,
  .ds-settings .player-claim,
  .ds-settings .player-visibility,
  .ds-settings .profile-aliases,
  .ds-settings .rival-settings { gap: var(--ds-space-md); }
  .ds-settings .country-settings__note,
  .ds-settings .country-settings__status,
  .ds-settings .player-claim__status,
  .ds-settings .player-visibility__status,
  .ds-settings .profile-aliases__status,
  .ds-settings .rival-settings__note { margin: 0; color: var(--ds-text-secondary); }
  .ds-settings .country-settings label,
  .ds-settings .profile-preferences__part { display: grid; gap: var(--ds-space-xs); min-width: 0; }
  .ds-settings .country-settings__select { min-width: 0; }
  .ds-settings .profile-preferences,
  .ds-settings .profile-preferences__part { gap: var(--ds-space-sm); }
  .ds-settings .profile-preferences__row,
  .ds-settings .country-settings__row,
  .ds-settings .rival-settings__add,
  .ds-settings .profile-aliases__add {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm); min-width: 0;
  }
  .ds-settings .profile-preferences__row .ds-select,
  .ds-settings .rival-settings__add .ds-select,
  .ds-settings .profile-aliases__add .ds-input { flex: 1 1 14rem; }
  .ds-settings .profile-preferences__icon { width: 3rem; height: 3rem; object-fit: contain; }
  .ds-settings .country-settings__flag,
  .ds-settings .rival-settings__avatar { width: 2rem; height: 2rem; object-fit: contain; flex: none; }
  .ds-settings-choices {
    display: grid; gap: var(--ds-space-sm); margin: 0; padding: var(--ds-space-md);
    border: 1px solid var(--ds-border-subtle); min-width: 0;
  }
  .ds-settings-choice {
    display: grid; grid-template-columns: auto minmax(0, 1fr);
    gap: var(--ds-space-xxs) var(--ds-space-sm); align-items: start; min-width: 0;
  }
  .ds-settings-choice > :not(input) { grid-column: 2; }
  .ds-settings__nested,
  .ds-settings .player-claim__panel {
    display: grid; gap: var(--ds-space-md); padding: var(--ds-space-md);
    background: var(--ds-surface-control); border: 1px solid var(--ds-border-subtle); min-width: 0;
  }
  .ds-settings .player-claim__required-note { margin: 0; color: var(--ds-status-warning); }
  .ds-settings .player-claim__paths { display: flex; flex-wrap: wrap; gap: var(--ds-space-sm); }
  .ds-settings .player-claim__path[aria-pressed="true"] {
    color: var(--ds-text-primary); box-shadow: inset 0 -3px 0 var(--ds-personal);
  }
  .ds-settings .player-claim__panel[hidden] { display: none; }
  .ds-settings .player-claim__results,
  .ds-settings .profile-aliases__list,
  .ds-settings .rival-settings__list {
    display: grid; gap: var(--ds-space-sm); margin: 0; padding: 0; list-style: none;
  }
  .ds-settings .player-claim__result { width: 100%; justify-content: flex-start; text-align: left; }
  .ds-settings .profile-aliases__players { display: grid; gap: var(--ds-space-lg); }
  .ds-settings .profile-aliases__list li,
  .ds-settings .rival-settings__rival {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm);
    padding: var(--ds-space-sm); background: var(--ds-surface-control);
    border: 1px solid var(--ds-border-subtle); min-width: 0;
  }
  .ds-settings .profile-aliases__text { font-weight: 600; }
  .ds-settings .profile-aliases__kind { color: var(--ds-text-tertiary); font-size: var(--ds-type-label-size); }
  .ds-settings .profile-aliases__empty { color: var(--ds-text-tertiary); }
  .ds-settings .rival-settings__remove { margin-left: auto; }
  .ds-settings .settings-card { padding: var(--ds-space-md); }
  .ds-settings .settings-card > h4 { margin: 0; }
  .ds-settings .settings-card > ul { display: grid; gap: var(--ds-space-sm); padding-left: var(--ds-space-lg); }
  .ds-settings .settings-card > ul li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm); }
  @media (max-width: 1099px) {
    .ds-settings__group-body { grid-template-columns: minmax(0, 1fr); }
    .ds-settings .settings__account { grid-column: auto; }
  }
  @media (max-width: 599px) {
    .ds-settings__nav { flex-wrap: nowrap; overflow-x: auto; }
    .ds-settings__nav .ds-button { flex: none; }
    .ds-settings .profile-preferences__row > :where(.ds-select, .ds-button),
    .ds-settings .rival-settings__add > :where(.ds-select, .ds-button),
    .ds-settings .profile-aliases__add > :where(.ds-input, .ds-button) { width: 100%; flex: 1 1 100%; }
  }

  /* ---------------------------------------------------------------------------
     W23 Race Direction · tokenized presentation (Phase 14)

     The source-shaped Step 0–10 workflow remains intact. This system layer changes
     presentation only; OD-09 keeps every operator interaction and native prompt/confirm.
     --------------------------------------------------------------------------- */

  .ds-race-direction {
    /* Structural operator rules predate the token adapter. Keep their public custom-property API
       while resolving every role from the active appearance; this is what makes all ten existing
       step compositions Light/Dark/HC capable without changing their workflow DOM. */
    --bg: var(--ds-surface-app);
    --surface-1: var(--ds-surface-raised);
    --surface-2: var(--ds-surface-control);
    --surface-3: var(--ds-surface-hover);
    --text: var(--ds-text-body);
    --text-muted: var(--ds-text-secondary);
    --border: var(--ds-border-subtle);
    --border-strong: var(--ds-border-strong);
    --accent: var(--ds-mode-race-direction);
    --accent-ink: var(--ds-mode-race-on);
    --good: var(--ds-status-success);
    --warn: var(--ds-status-warning);
    --danger: var(--ds-status-error);
    --rc-asphalt: var(--ds-surface-app);
    --rc-panel: var(--ds-surface-raised);
    --rc-panel-raised: var(--ds-surface-control);
    --rc-seam: var(--ds-border-subtle);
    --rc-seam-strong: var(--ds-border-strong);
    --rc-copy: var(--ds-text-body);
    --rc-muted: var(--ds-text-secondary);
    --rc-cyan: var(--ds-mode-race-direction);
    --rc-cyan-soft: var(--ds-surface-selected);
    --rc-success: var(--ds-status-success);
    --rc-danger: var(--ds-status-error);
    --sp-1: var(--ds-space-xs);
    --sp-2: var(--ds-space-sm);
    --sp-3: var(--ds-space-md);
    --sp-4: var(--ds-space-lg);
    --sp-5: var(--ds-space-xl);
    --sp-6: var(--ds-space-2xl);
    --r-sm: var(--ds-radius-none);
    --r-md: var(--ds-radius-none);
    --rc-radius-sm: var(--ds-radius-none);
    --rc-radius-md: var(--ds-radius-none);
    --rc-time-font: var(--ds-font-data);
    --tournament-bg: var(--ds-surface-app);
    --tournament-panel: var(--ds-surface-raised);
    --tournament-elevated: var(--ds-surface-control);
    --tournament-line: var(--ds-border-subtle);
    --tournament-line-strong: var(--ds-border-strong);
    --tournament-text: var(--ds-text-body);
    --tournament-soft: var(--ds-text-secondary);
    --tournament-accent: var(--ds-mode-race-direction);
    --tournament-accent-alt: var(--ds-mode-race-direction);
    --tournament-success: var(--ds-status-success);
    --tournament-warning: var(--ds-status-warning);
    --tournament-danger: var(--ds-status-error);
  }

  .ds-race-direction .tt-auth {
    padding-block-start: var(--ds-space-lg);
  }

  .ds-race-direction .tt-auth > h1 {
    max-width: none;
    font-size: clamp(1.55rem, 3.5vw, 2.25rem);
  }

  .ds-race-direction .tt-auth > .tt-auth__status {
    max-width: none;
    margin-bottom: var(--ds-space-lg);
  }

  .ds-race-direction .tt-auth > .tt-auth__status:empty {
    display: none;
  }

  .ds-race-direction.tournament-op {
    width: 100%;
    max-width: var(--page-max);
    margin-inline: auto;
    gap: var(--ds-space-md);
    color: var(--ds-text-body);
  }

  .ds-race-direction .tournament-op__content {
    gap: var(--ds-space-lg);
  }

  .ds-race-direction .tournament-op__toolbar {
    display: grid;
    grid-template-columns: auto auto minmax(8rem, 1fr) auto;
    gap: var(--ds-space-sm) var(--ds-space-lg);
    min-height: 3.25rem;
    padding: .55rem .75rem;
    border: 1px solid var(--ds-border-subtle);
    border-radius: var(--ds-radius-none);
    background: var(--ds-surface-raised);
  }

  .ds-race-direction .tournament-op__toolbar .tt-auth__link {
    color: var(--ds-text-body);
    font-size: .78rem;
  }

  .ds-race-direction .tournament-op__stage {
    justify-self: end;
    color: var(--ds-text-secondary);
    font-family: var(--ds-font-data);
    font-size: .7rem;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .ds-race-direction .tournament-op__delete {
    min-height: 2.25rem;
    padding: .4rem .7rem;
    border-color: color-mix(in srgb, var(--ds-status-error) 55%, var(--ds-border-subtle));
    background: transparent;
    color: var(--ds-status-error);
    font-size: .72rem;
  }

  .ds-race-direction .tournament-op__delete:hover:not(:disabled) {
    border-color: var(--ds-status-error);
    background: color-mix(in srgb, var(--ds-status-error) 10%, transparent);
  }

  .ds-race-direction .tournament-op__steps {
    gap: 1px;
    padding: 0 0 .35rem;
    scroll-snap-type: inline proximity;
    scrollbar-color: var(--ds-border-strong) transparent;
    scrollbar-width: thin;
  }

  .ds-race-direction .tournament-op__step {
    min-height: 2rem;
    padding: .4rem .65rem;
    border-color: var(--ds-border-subtle);
    border-radius: 0;
    background: var(--ds-surface-raised);
    color: var(--ds-text-secondary);
    font-size: .7rem;
    line-height: 1.15;
    scroll-snap-align: center;
  }

  .ds-race-direction .tournament-op__step:first-child {
    border-radius: var(--ds-radius-none) 0 0 var(--ds-radius-none);
  }

  .ds-race-direction .tournament-op__step:last-child {
    border-radius: 0 var(--ds-radius-none) var(--ds-radius-none) 0;
  }

  .ds-race-direction .tournament-op__step--done {
    border-color: var(--ds-border-subtle);
    background: color-mix(in srgb, var(--ds-status-success) 7%, var(--ds-surface-raised));
    color: var(--ds-status-success);
  }

  .ds-race-direction .tournament-op__step--done::before {
    content: "✓ ";
    font-weight: 900;
  }

  .ds-race-direction .tournament-op__step[aria-current="step"] {
    border-color: var(--ds-mode-race-direction);
    background: var(--ds-surface-selected);
    color: var(--ds-mode-race-direction);
    box-shadow: inset 0 -2px var(--ds-mode-race-direction);
  }

  .ds-race-direction .tournament-op__panel {
    gap: var(--ds-space-md);
    padding: clamp(var(--ds-space-md), 2vw, var(--ds-space-lg));
  }

  .ds-race-direction .tournament-op__panel > :is(h2, h3, h4):first-child,
  .ds-race-direction .tournament-op__incoming h3,
  .ds-race-direction .tournament-score-step__group-header h3 {
    color: var(--ds-text-body);
    font-size: .92rem;
    font-weight: 780;
    letter-spacing: -.01em;
  }

  .ds-race-direction :is(
    .tournament-op__intro,
    .tournament-op__hint,
    .tournament-op__stage,
    .tournament-op__layout-export-audit p,
    .tournament-op__history ul,
    .tournament-score-step__errors,
    .tournament-export-preview__standings li small
  ) {
    color: var(--ds-text-secondary);
  }

  .ds-race-direction .tournament-op__score-guide {
    gap: var(--ds-space-sm);
    padding: .75rem .85rem;
    border: 1px solid var(--ds-status-info);
    border-radius: 12px;
    background: color-mix(in srgb, var(--ds-status-info) 12%, var(--ds-surface-raised));
  }

  .ds-race-direction .tournament-op__score-guide > h4 {
    color: var(--ds-mode-race-direction);
    font-size: .78rem;
  }

  .ds-race-direction .tournament-op__incoming {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .ds-race-direction .tournament-op__incoming > .tournament-op__section {
    gap: 9px;
  }

  .ds-race-direction .tournament-score-incoming > :is(h3, h4) { margin: 0; }
  .ds-race-direction .tournament-score-incoming > p { margin: 0; color: var(--ds-text-secondary); font-size: .78rem; line-height: 1.4; }
  .ds-race-direction .tournament-score-incoming__empty {
    padding: 12px; border: 1px solid var(--ds-border-subtle); border-radius: 12px;
    background: var(--ds-surface-raised);
  }

  .ds-race-direction .tournament-op__incoming-card {
    padding: var(--ds-space-md);
    background: var(--ds-surface-control);
  }

  .ds-race-direction .tournament-op__warning,
  .ds-race-direction .tournament-op__gate-reason {
    border-inline-start: 2px solid var(--ds-status-warning);
    color: var(--ds-status-warning);
  }

  .ds-race-direction.tournament-op :is(input, select, textarea) {
    border-color: var(--ds-border-strong);
    border-radius: var(--ds-radius-none);
    background: var(--ds-surface-control);
    color: var(--ds-text-body);
    box-shadow: none;
  }

  .ds-race-direction.tournament-op :is(input, select, textarea):focus {
    border-color: var(--ds-mode-race-direction);
    outline: 2px solid color-mix(in srgb, var(--ds-mode-race-direction) 35%, transparent);
    outline-offset: 1px;
  }

  .ds-race-direction.tournament-op .tt-auth__button {
    min-height: 2.5rem;
    border-color: var(--ds-border-strong);
    border-radius: var(--ds-radius-none);
    background: var(--ds-surface-control);
    color: var(--ds-text-body);
    box-shadow: none;
  }

  .ds-race-direction.tournament-op .tt-auth__button:hover:not(:disabled) {
    border-color: var(--ds-mode-race-direction);
    background: var(--ds-surface-control);
    color: var(--ds-mode-race-direction);
  }

  .ds-race-direction.tournament-op .tt-auth__button--primary,
  .ds-race-direction .tournament-op__gate--ready,
  .ds-race-direction .tournament-score-step__checkpoint .tt-auth__button {
    border-color: var(--ds-mode-race-direction);
    background: var(--ds-mode-race-direction);
    color: var(--ds-mode-race-on);
  }

  .ds-race-direction .tournament-op__checkpoint .tt-auth__button:not(.tt-auth__button--primary) {
    border-color: var(--ds-border-strong);
    background: transparent;
    color: var(--ds-text-secondary);
  }

  /* Android's export checkpoint uses the success action, not the orange
     race-direction primary used by ordinary form submissions. */
  .ds-race-direction .tournament-layout-step__continue .tt-auth__button {
    border-color: var(--ds-status-success);
    background: color-mix(in srgb, var(--ds-status-success) 28%, var(--ds-surface-control));
    color: var(--ds-text-primary);
  }

  .ds-race-direction .tournament-op__report-link > .tt-auth__button--primary {
    border-color: var(--ds-action-primary);
    background: var(--ds-action-primary);
    color: var(--ds-action-on-primary);
  }

  .ds-race-direction.tournament-op .tt-auth__button:disabled {
    border-color: var(--ds-border-subtle);
    background: var(--ds-surface-raised);
    color: var(--ds-text-secondary);
    opacity: 1;
    cursor: not-allowed;
  }

  /* Missing is conveyed by the warning edge and the copy. Warning yellow is
     deliberately not body text in Light, where it cannot meet AA on paper. */
  .ds-race-direction .tournament-op__edition--missing {
    border-color: var(--ds-status-warning);
    color: var(--ds-text-body);
  }

  .ds-race-direction .tournament-director-step {
    min-height: 0;
    padding: 0;
    border: 1px solid var(--ds-border-subtle);
    border-radius: var(--ds-radius-none);
    background: var(--ds-surface-raised);
    color: var(--ds-text-body);
  }

  .ds-race-direction .tournament-director-step__phase,
  .ds-race-direction .tournament-score-step__phase {
    margin: var(--ds-space-md) var(--ds-space-lg) 0;
    padding: .35rem .65rem;
    border: 1px solid var(--ds-mode-race-direction);
    border-radius: var(--ds-radius-none);
    background: var(--ds-surface-selected);
    color: var(--ds-mode-race-direction);
    font-family: var(--ds-font-data);
    font-size: .68rem;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  .ds-race-direction .tournament-director-step > h2 {
    margin: 0;
    padding: var(--ds-space-lg);
    border-color: var(--ds-border-subtle);
    font-size: clamp(1.2rem, 3vw, 1.55rem);
  }

  .ds-race-direction .tournament-director-step__intro {
    padding: var(--ds-space-md) var(--ds-space-lg);
    border-bottom: 1px solid var(--ds-border-subtle);
    background: transparent;
    color: var(--ds-text-secondary);
    font-size: .88rem;
  }

  .ds-race-direction .tournament-director-step__card {
    margin: var(--ds-space-lg);
    padding: var(--ds-space-lg);
    border: 1px solid var(--ds-border-subtle);
    border-radius: var(--ds-radius-none);
    background: var(--ds-surface-control);
  }

  .ds-race-direction .tournament-director-step__card h3 {
    font-size: 1rem;
  }

  .ds-race-direction .tournament-director-step select,
  .ds-race-direction .tournament-director-step input,
  .ds-race-direction .tournament-director-step input[type="time"] {
    min-height: 2.75rem;
    padding-inline: .75rem;
    border-color: var(--ds-border-strong);
    border-radius: var(--ds-radius-none);
    background: var(--ds-surface-raised);
    color: var(--ds-text-body);
    font-size: .9rem;
  }

  .ds-race-direction .tournament-director-step__hint {
    min-height: 0;
    margin: var(--ds-space-md) 0;
    color: var(--ds-text-secondary);
    font-size: .8rem;
  }

  .ds-race-direction .tournament-director-step .tt-auth__button {
    min-height: 2.75rem;
    font-size: .86rem;
  }

  .ds-race-direction .tournament-director-step--start {
    gap: 0;
    border-color: var(--ds-border-subtle);
    background: var(--ds-surface-raised);
  }

  .ds-race-direction .tournament-director-step--start > h2,
  .ds-race-direction .tournament-director-step--start .tournament-director-step__intro,
  .ds-race-direction .tournament-director-step--start .tournament-director-step__card {
    border-color: var(--ds-border-subtle);
    background: var(--ds-surface-control);
  }

  .ds-race-direction .tournament-score-step {
    gap: var(--ds-space-md);
  }

  .ds-race-direction .tournament-score-step__details > summary {
    padding: .7rem .8rem;
    font-size: .8rem;
  }

  .ds-race-direction .tournament-score-step__tie-card,
  .ds-race-direction .tournament-score-step__excel-group,
  .ds-race-direction .tournament-score-step__row {
    border-color: var(--ds-border-subtle);
    border-radius: var(--ds-radius-none);
    background: var(--ds-surface-control);
  }

  .ds-race-direction .tournament-score-step__group {
    box-shadow: none;
  }

  .ds-race-direction .tournament-score-step__rank,
  .ds-race-direction .tournament-score-step__group-header h4,
  .ds-race-direction .tournament-export-preview__group h5,
  .ds-race-direction .tournament-op__layout-export-audit h5 {
    color: var(--ds-mode-race-direction);
  }

  .ds-race-direction .tournament-score-step__checkpoint {
    position: static;
    padding: var(--ds-space-md);
    border: 1px solid var(--ds-mode-race-direction);
    border-radius: var(--ds-radius-none);
    background: var(--ds-surface-raised);
    box-shadow: none;
  }

  .ds-race-direction .tournament-export-tabs {
    gap: 1px;
  }

  .ds-race-direction .tournament-export-tabs .tt-auth__button {
    border-radius: 0;
  }

  .ds-race-direction .tournament-export-tabs .tt-auth__button:first-child {
    border-radius: var(--ds-radius-none) 0 0 var(--ds-radius-none);
  }

  .ds-race-direction .tournament-export-tabs .tt-auth__button:last-child {
    border-radius: 0 var(--ds-radius-none) var(--ds-radius-none) 0;
  }

  .ds-race-direction .tournament-export-tabs .tt-auth__button[aria-pressed="true"] {
    border-color: var(--ds-mode-race-direction);
    background: var(--ds-surface-selected);
    color: var(--ds-mode-race-direction);
    box-shadow: inset 0 -2px var(--ds-mode-race-direction);
  }

  .ds-race-direction .tournament-export-preview > header {
    border-color: var(--ds-border-subtle);
    background: var(--ds-surface-control);
  }

  .ds-race-direction .tournament-export-preview > header p,
  .ds-race-direction .tournament-export-preview__standings li strong {
    color: var(--ds-mode-race-direction);
  }

  .ds-race-direction .tournament-export-preview__group,
  .ds-race-direction .tournament-export-preview__standings li {
    border-color: var(--ds-border-subtle);
    background: var(--ds-surface-control);
  }

  .ds-race-direction .tournament-export-controls .tournament-export-controls__whatsapp {
    border-color: var(--ds-border-strong);
    background: var(--ds-surface-control);
    color: var(--ds-text-body);
  }

  .ds-race-direction :is(
    .tournament-op__status-board,
    .tournament-op__status-board-head,
    .tournament-op__attendance-board,
    .tournament-op__participant-card,
    .tournament-board__group,
    .tournament-board__group-header,
    .tournament-board__slot,
    .tournament-board__station,
    .tournament-board__parking-zone,
    .tournament-board__status
  ) {
    border-color: var(--ds-border-subtle);
    background: var(--ds-surface-control);
  }

  .ds-race-direction [data-drop-active="true"] {
    border-color: var(--ds-mode-race-direction);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-mode-race-direction) 24%, transparent);
  }

  .ds-race-direction .tournament-board__seat {
    border-color: var(--ds-border-strong);
  }

  .ds-race-direction .tournament-board__group-title h3,
  .ds-race-direction .tournament-board__station-title {
    color: var(--ds-text-body);
  }

  .ds-race-direction .tournament-board__utp,
  .ds-race-direction .tournament-board__seat-hint {
    color: var(--ds-text-secondary);
  }

  .ds-race-direction :is(
    .tournament-board__handle,
    .tournament-board__park,
    .tournament-board__swap-badge
  ) {
    min-width: 2.25rem;
    min-height: 2.25rem;
  }

  .ds-race-direction .tournament-op__layout-export-audit {
    border-inline-start: 2px solid var(--ds-mode-race-direction);
    background: var(--ds-surface-control);
  }

  .ds-race-direction .tournament-layout-step .tournament-op__layout-export-audit {
    border-inline-start: 1px solid var(--ds-border-subtle);
    border-radius: 10px;
    background: var(--ds-surface-raised);
  }

  .ds-race-direction .tournament-op__admin,
  .ds-race-direction .tournament-op__admin-section {
    border-color: var(--ds-border-subtle);
    border-radius: var(--ds-radius-none);
    background: var(--ds-surface-raised);
    color: var(--ds-text-body);
  }

  .ds-race-direction .tournament-op__admin-section {
    background: var(--ds-surface-control);
  }

  .ds-race-direction .tournament-op__admin > summary {
    color: var(--ds-text-body);
  }

  .ds-race-direction .tournament-op__admin-badge,
  .ds-race-direction .tournament-op__admin-field,
  .ds-race-direction .tournament-op__admin-history {
    border-color: var(--ds-border-subtle);
    background: var(--ds-surface-control);
    color: var(--ds-text-secondary);
  }

  .ds-race-direction .tournament-op__history {
    border-top: 1px solid var(--ds-border-subtle);
    padding-top: var(--ds-space-md);
  }

  .ds-race-direction .tournament-op__helpers > summary {
    width: fit-content;
    color: var(--ds-text-secondary);
    font-size: .78rem;
  }

  .ds-race-direction .tournament-op__helpers[open] {
    gap: var(--ds-space-md);
  }

  .ds-race-direction .tournament-op__utp p {
    border-inline-start-color: var(--ds-mode-race-direction);
    background: var(--ds-surface-control);
  }

  .ds-race-direction .tournament-report {
    gap: var(--ds-space-lg);
  }

  @media (min-width: 600px) and (max-width: 1099px) {

    .ds-race-direction .tournament-op__toolbar {
      grid-template-columns: auto auto 1fr;
    }

    .ds-race-direction .tournament-op__delete {
      grid-column: 3;
      grid-row: 1;
      justify-self: end;
    }

    .ds-race-direction .tournament-op__stage {
      grid-column: 1 / -1;
      justify-self: start;
    }

    .ds-race-direction .tournament-score-step__row {
      grid-template-columns: 2rem minmax(7rem, 1fr) minmax(7rem, auto) 3.5rem;
    }

    .ds-race-direction :is(
      .tournament-board__handle,
      .tournament-board__park,
      .tournament-board__swap-badge
    ) {
      min-width: 2.5rem;
      min-height: 2.5rem;
    }

    .ds-race-direction .tournament-op__incident-form {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ds-race-direction .tournament-op__incident-form .tt-auth__button {
      grid-column: 1 / -1;
      justify-self: end;
    }}

  @media (max-width: 599px) {

    .ds-race-direction .tt-auth {
      padding: var(--ds-space-md) var(--ds-space-md) calc(5.25rem + env(safe-area-inset-bottom));
    }

    .ds-race-direction .tt-auth > h1 {
      font-size: 1.45rem;
    }

    .ds-race-direction .tt-auth > .tt-auth__status {
      margin-bottom: var(--ds-space-md);
    }

    .ds-race-direction .tournament-op__toolbar {
      grid-template-columns: minmax(0, 1fr) auto;
      gap: var(--ds-space-xs) var(--ds-space-md);
      padding: .65rem;
    }

    /* A seated participant's tier, name and rank badge could not wrap, so one
       group card required 327 px and pushed the whole workspace 3 px past a
       320 px viewport. The badges keep their full text. */
    .ds-race-direction .tournament-board__player,
    .ds-race-direction .tournament-board__station-title {
      flex-wrap: wrap;
      min-width: 0;
    }

    .ds-race-direction .tournament-board__player .tournament-op__roster-badge {
      white-space: normal;
    }

    .ds-race-direction .tournament-op__toolbar .tt-auth__link {
      white-space: nowrap;
    }

    .ds-race-direction .tournament-op__stage {
      grid-column: 1;
      justify-self: start;
    }

    .ds-race-direction .tournament-op__delete {
      grid-column: 2;
      grid-row: 2;
    }

    .ds-race-direction .tournament-op__step {
      min-height: 2.2rem;
      font-size: .66rem;
    }

    .ds-race-direction .tournament-op__incoming,
    .ds-race-direction .tournament-op__panel {
      padding: var(--ds-space-md);
    }

    .ds-race-direction .tournament-op__incoming { padding: 0; }

    .ds-race-direction .tournament-score-step__details,
    .ds-race-direction .tournament-score-step__group {
      border-color: var(--ds-border-subtle);
      border-radius: 12px;
      background: var(--ds-surface-raised);
    }

    .ds-race-direction .tournament-score-step__group { padding: 11px; }

    .ds-race-direction .tournament-score-step__group-header span {
      color: var(--ds-text-primary);
      font-variant-numeric: tabular-nums;
    }

    .ds-race-direction .tournament-score-step__row {
      grid-template-columns: 44px minmax(0, 1fr) 84px;
      gap: 6px;
      min-height: 44px;
      padding: 2px 0;
      border: 0;
      border-radius: 0;
      background: transparent;
    }

    .ds-race-direction .tournament-score-step__rank {
      color: var(--ds-text-primary);
      background: var(--ds-surface-selected);
    }

    .ds-race-direction .tournament-director-step__phase,
    .ds-race-direction .tournament-score-step__phase {
      margin: var(--ds-space-md) var(--ds-space-md) 0;
    }

    .ds-race-direction .tournament-director-step__card {
      margin: var(--ds-space-md);
      padding: var(--ds-space-md);
    }

    .ds-race-direction .tournament-director-step--start > .tournament-director-step__hint,
    .ds-race-direction .tournament-director-step--start > .tt-auth__button {
      margin-inline: var(--ds-space-md);
    }

    .ds-race-direction .tournament-score-step__checkpoint {
      position: static;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
    }

    .ds-race-direction .tournament-score-step__checkpoint--ready .tt-auth__button {
      border-color: var(--ds-status-success);
      background: color-mix(in srgb, var(--ds-status-success) 28%, var(--ds-surface-control));
      color: var(--ds-text-primary);
    }

    .ds-race-direction.tournament-op .tournament-score-step__checkpoint--blocked .tt-auth__button:disabled {
      border-color: var(--ds-status-error);
      background: color-mix(in srgb, var(--ds-status-error) 20%, var(--ds-surface-control));
      color: var(--ds-text-secondary);
    }

    .ds-race-direction .tournament-score-step > .tt-auth__button,
    .ds-race-direction .tournament-score-step__save { width: 100%; }

    .ds-race-direction .tournament-export-controls,
    .ds-race-direction .tournament-export-excel {
      gap: var(--ds-space-sm);
    }

    .ds-race-direction .tournament-export-controls .tt-auth__button,
    .ds-race-direction .tournament-export-excel .tt-auth__button,
    .ds-race-direction .tournament-op__checkpoint .tt-auth__button {
      min-height: 2.75rem;
    }

    .ds-race-direction .tournament-op__checkpoint {
      justify-content: stretch;
    }

    .ds-race-direction .tournament-op__checkpoint .tt-auth__button {
      width: 100%;
    }

    .ds-race-direction :is(
      .tournament-board__handle,
      .tournament-board__park,
      .tournament-board__swap-badge
    ) {
      min-width: 2.75rem;
      min-height: 2.75rem;
    }

    .ds-race-direction .tournament-op__history {
      margin-top: var(--ds-space-sm);
    }

    /* Step 10 contains long explanatory Dutch and English copy. Let the
       content yield inside the card instead of enlarging the 320 px page. */
    .ds-race-direction :is(
      .tournament-op__checklist-item > *,
      .tournament-op__checklist-head,
      .tournament-op__checklist-head > *,
      .tournament-op__report-link,
      .tournament-op__finalize,
      .tournament-op__detail,
      .tournament-op__caption
    ) {
      min-width: 0;
      max-width: 100%;
      overflow-wrap: anywhere;
    }

    .ds-race-direction .tournament-op__grants-form {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      min-width: 0;
      max-width: 100%;
    }

    .ds-race-direction .tournament-op__report-link .tt-auth__button,
    .ds-race-direction .tournament-op__finalize .tt-auth__button {
      max-width: 100%;
      white-space: normal;
    }}

  /* W24 · report writing is an operator surface, not the paper it produces. The preview below it
     remains the real W21 report; these rules only frame the writing controls in MINIMAL Showtime. */
  .ds-report-editor { gap: var(--ds-space-xl); min-width: 0; }
  .ds-report-editor .tournament-report-edit__head { display: grid; gap: var(--ds-space-sm); }
  .ds-report-editor .tournament-report-edit__head h1 { margin: 0; }
  .ds-report-editor .tournament-report-edit__head .ds-button { justify-self: start; }
  .ds-report-editor .tournament-report-edit__status {
    min-height: var(--ds-type-body-s-line); margin: 0; color: var(--ds-text-secondary);
  }
  .ds-report-editor .tournament-report-edit__status:empty { display: none; }
  .ds-report-editor .tournament-report-edit__state { margin: 0; font-weight: 700; }
  .ds-report-editor .tournament-report-edit__form { gap: var(--ds-space-md); }
  .ds-report-editor .tournament-report-edit__form h2 { margin: var(--ds-space-sm) 0 0; font-size: var(--ds-type-title-size); }
  .ds-report-editor .tournament-report-edit__field { display: grid; gap: var(--ds-space-xs); }
  .ds-report-editor .tournament-report-edit__label { font-weight: 700; }
  .ds-report-editor .tournament-report-edit__hint { color: var(--ds-text-secondary); font-size: var(--ds-type-body-s-size); }
  .ds-report-editor .tournament-report-edit__title,
  .ds-report-editor .tournament-report-edit__area { width: 100%; resize: vertical; }
  .ds-report-editor .tournament-report-edit__flags { display: grid; gap: var(--ds-space-sm); }
  .ds-report-editor .tournament-report-edit__flag {
    display: flex; align-items: center; gap: var(--ds-space-sm); min-height: var(--ds-target-min);
  }
  .ds-report-editor .tournament-report-edit__flag input { width: 1.25rem; height: 1.25rem; }
  .ds-report-editor .tournament-report-edit__upload { display: none; }
  .ds-report-editor .tournament-report-edit__actions {
    display: flex; flex-wrap: wrap; gap: var(--ds-space-sm); align-items: center;
  }
  .ds-report-editor .tournament-report-edit__wordpress {
    padding: var(--ds-space-md); background: var(--ds-surface-raised); border: 1px solid var(--ds-border-subtle);
  }
  .ds-report-editor .tournament-report-edit__wordpress summary { cursor: pointer; color: var(--ds-text-secondary); }
  .ds-report-editor .tournament-report-edit__preview-title { margin: 0; }
  .ds-report-editor .tournament-report-edit__preview {
    min-width: 0; padding: 2px; border: 1px dashed var(--ds-border-strong);
  }
  .ds-report-editor .tournament-report-edit__preview--editable .tournament-report__block {
    padding: var(--ds-space-sm); border: 1px dashed transparent;
    transition: border-color var(--ds-motion-state);
  }
  .ds-report-editor .tournament-report-edit__preview--editable .tournament-report__block:hover { border-color: var(--ds-action-primary); }
  .ds-report-editor .tournament-report-edit__placeholder { color: var(--ds-text-secondary); font-style: italic; }
  .ds-report-editor .tournament-report-edit__open {
    justify-self: start; min-height: var(--ds-target-min); padding-inline: var(--ds-space-md);
    border: 1px solid var(--ds-border-control); background: transparent; color: var(--ds-text-body);
    font: 700 var(--ds-type-body-s-size)/var(--ds-type-body-s-line) var(--ds-font-ui); cursor: pointer;
  }
  .ds-report-editor .tournament-report-edit__open:hover { background: var(--ds-surface-hover); }
  .ds-report-editor .report-editor {
    display: grid; gap: var(--ds-space-sm); padding: var(--ds-space-md);
    background: var(--ds-surface-control); border-color: var(--ds-mode-race-direction);
  }
  .ds-report-editor .report-editor__label { color: var(--ds-text-primary); font-weight: 800; font-size: var(--ds-type-body-s-size); }
  .ds-report-editor .report-editor__toolbar { display: grid; gap: var(--ds-space-sm); }
  .ds-report-editor .report-editor__row,
  .ds-report-editor .report-editor__group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-xs); }
  .ds-report-editor .report-editor__group { margin-inline-end: var(--ds-space-md); }
  .ds-report-editor .report-editor__group-label,
  .ds-report-editor .report-editor__hint,
  .ds-report-editor .report-editor__count { color: var(--ds-text-secondary); font-size: var(--ds-type-body-s-size); }
  .ds-report-editor .report-editor__tool {
    min-width: var(--ds-target-min); min-height: var(--ds-target-min); padding-inline: var(--ds-space-sm);
    border: 1px solid var(--ds-border-control); background: var(--ds-surface-raised);
    color: var(--ds-text-primary); font-weight: 700; cursor: pointer;
  }
  .ds-report-editor .report-editor__tool:hover { border-color: var(--ds-action-primary); }
  .ds-report-editor .report-editor__tool--italic { font-style: italic; }
  .ds-report-editor .report-editor__tool--underline { text-decoration: underline; }
  .ds-report-editor .report-editor__tool--strikeThrough { text-decoration: line-through; }
  .ds-report-editor .report-editor__swatch {
    width: var(--ds-target-min); height: var(--ds-target-min); padding: .6rem;
    border: 1px solid var(--ds-border-control); cursor: pointer; background-clip: content-box;
  }
  .ds-report-editor .report-editor__swatch[class*="rt-color-"] { background-color: currentColor; }
  .ds-report-editor .report-editor__swatch[class*="rt-bg-"] { color: transparent; }
  .ds-report-editor .report-editor__surface {
    min-height: 8rem; padding: var(--ds-space-md); border: 1px solid var(--ds-border-control);
    background: var(--ds-surface-raised); color: var(--ds-text-body); outline: none;
  }
  .ds-report-editor .report-editor__surface:focus {
    border-color: var(--ds-focus-ring); box-shadow: 0 0 0 var(--ds-focus-width) var(--ds-focus-ring);
  }
  .ds-report-editor .report-editor__surface p { margin: 0 0 var(--ds-space-sm); }
  .ds-report-editor .report-editor__surface :is(ul, ol) { margin: var(--ds-space-xs) 0 var(--ds-space-sm); padding-left: var(--ds-space-lg); }
  .ds-report-editor .report-editor__surface blockquote {
    margin: var(--ds-space-sm) 0; padding: var(--ds-space-xs) var(--ds-space-md);
    border-left: 3px solid var(--ds-border-strong);
  }
  .ds-report-editor .report-editor__hint { margin: 0; }
  .ds-report-editor .report-editor__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm); }
  .ds-report-editor .report-editor__count { margin-inline-end: auto; }
  .ds-report-editor .report-editor__count--over { color: var(--ds-status-error); font-weight: 700; }
  @media (max-width: 599px) {
    .ds-report-editor .tournament-report-edit__actions > .ds-button,
    .ds-report-editor .report-editor__foot > .ds-button { width: 100%; }
    .ds-report-editor .report-editor__group { width: 100%; margin-inline-end: 0; }
  }

  /* ================= W32 Administration: calm operations, no second palette ================= */
  .ds-admin { gap: var(--ds-space-xl); }
  .ds-admin > h1 { margin: 0; }
  .ds-admin__intro { margin: calc(-1 * var(--ds-space-md)) 0 0; max-width: 72ch; color: var(--ds-text-secondary); }
  .ds-admin > .ds-tabs { position: sticky; top: var(--ds-shell-sticky-offset, 0); z-index: 3; background: var(--ds-surface-app); }
  .ds-admin__section { min-width: 0; gap: var(--ds-space-xl); }
  .ds-admin__section > .ds-panel { gap: var(--ds-space-md); }
  .ds-admin .ds-panel > :is(h2, h3):first-child { margin: 0; }
  .ds-admin :is(p, ul, ol, fieldset) { max-width: 100%; }
  .ds-admin [role="status"] { margin: 0; color: var(--ds-text-secondary); overflow-wrap: anywhere; }

  .ds-admin__section :is(.tt-auth__button, button:not(.ds-tab), a.tt-auth__button) {
    box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
    min-height: var(--ds-target-min); max-width: 100%; padding: var(--ds-space-sm) var(--ds-space-lg);
    border: 0; border-radius: var(--ds-radius-hairline); background: var(--ds-surface-control);
    color: var(--ds-text-body); box-shadow: inset 0 0 0 1px var(--ds-border-strong);
    font: inherit; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer;
  }
  .ds-admin__section :is(.tt-auth__button, button:not(.ds-tab), a.tt-auth__button):hover { background: var(--ds-surface-hover); color: var(--ds-text-primary); }
  .ds-admin__section :is(.tt-auth__button, button:not(.ds-tab), a.tt-auth__button):focus-visible { outline: var(--ds-focus-width) solid var(--ds-focus-ring); outline-offset: 2px; }
  .ds-admin__section :is(.tt-auth__button, button:not(.ds-tab), a.tt-auth__button):disabled { cursor: not-allowed; color: var(--ds-text-tertiary); box-shadow: inset 0 0 0 1px var(--ds-border-subtle); }
  .ds-admin__section [data-variant="danger"] { color: var(--ds-status-error); box-shadow: inset 0 0 0 1px var(--ds-status-error); }

  .ds-admin__section :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    box-sizing: border-box; width: 100%; min-width: 0; min-height: var(--ds-target-min);
    padding: var(--ds-space-sm) var(--ds-space-md); border: 1px solid var(--ds-border-control);
    border-radius: var(--ds-radius-hairline); background: var(--ds-surface-control);
    color: var(--ds-text-primary); font: inherit;
  }
  .ds-admin__section textarea { min-height: 7rem; resize: vertical; }
  .ds-admin__section :is(input, select, textarea):focus-visible { outline: var(--ds-focus-width) solid var(--ds-focus-ring); outline-offset: 2px; }
  .ds-admin__section :is(input[type="checkbox"], input[type="radio"]) { inline-size: 1.25rem; block-size: 1.25rem; accent-color: var(--ds-action-primary); }
  .ds-admin__section label { color: var(--ds-text-body); }

  .ds-admin .admin-overview__grid { margin-top: var(--ds-space-md); }
  .ds-admin .admin-overview__tile { padding: var(--ds-space-lg); background: var(--ds-surface-control); box-shadow: inset 0 0 0 1px var(--ds-border-subtle); }
  .ds-admin .admin-overview__figure, .ds-admin .admin-overview__label, .ds-admin .admin-overview__note { margin: 0; }
  .ds-admin .admin-overview__link { justify-self: start; margin-top: var(--ds-space-sm); }

  .ds-admin .admin-installations__scroller { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
  .ds-admin .admin-installations__table { width: 100%; border-collapse: collapse; min-width: 48rem; }
  .ds-admin .admin-installations__table :is(th, td) { padding: var(--ds-space-sm) var(--ds-space-md); border-bottom: 1px solid var(--ds-border-subtle); text-align: left; }
  .ds-admin .admin-installations__table thead { color: var(--ds-text-tertiary); font-size: var(--ds-type-label-size); }
  .ds-admin .admin-installations__table tbody { color: var(--ds-text-body); font-family: var(--ds-font-data); font-variant-numeric: tabular-nums; }
  .ds-admin .admin-installations__row--behind { box-shadow: inset 3px 0 0 var(--ds-status-warning); }

  .ds-admin :is(.administrator-claim-review ol, .administrator-time-trials__list, .rating-admin__list,
    .alias-admin__list, .alias-admin__results, .identity-link-list, .observed-identities__list,
    .operator-access__grants, .operator-access__results, .tournament-canonical-import__outcomes,
    .tournament-canonical-import__participants ul) {
    display: grid; gap: var(--ds-space-sm); margin: 0; padding: 0; list-style: none;
  }
  .ds-admin :is(.administrator-claim-review__item, .administrator-time-trials__row,
    .rating-admin__item, .identity-link-row, .observed-identity-row, .operator-access__request,
    .tournament-publication__candidate, .tournament-canonical-import__participants li) {
    min-width: 0; padding: var(--ds-space-md); background: var(--ds-surface-control);
    box-shadow: inset 0 0 0 1px var(--ds-border-subtle); overflow-wrap: anywhere;
  }
  .ds-admin :is(.administrator-claim-review__item, .administrator-time-trials__row,
    .identity-link-row, .observed-identity-row, .operator-access__request) { display: grid; gap: var(--ds-space-sm); }
  .ds-admin :is(.administrator-claim-review__summary, .administrator-time-trials__summary,
    .identity-link-who, .observed-identity-row__name, .rating-admin__title) { margin: 0; font-weight: 600; color: var(--ds-text-primary); }
  .ds-admin :is(.administrator-claim-review__hint, .administrator-time-trials__field,
    .administrator-time-trials__presence-status, .rating-admin__hint, .rating-admin__meta,
    .identity-link-current, .identity-link-orphans, .observed-identities__explain,
    .observed-identities__count, .observed-identity-row__where, .observed-identity-row__evidence,
    .operator-access__hint) { color: var(--ds-text-secondary); font-size: var(--ds-type-label-size); }
  .ds-admin :is(.administrator-claim-review__actions, .administrator-time-trials__filters,
    .administrator-time-trials__presence, .tournament-publication__controls,
    .observed-identities__controls, .operator-access__actions) { display: flex; flex-wrap: wrap; align-items: end; gap: var(--ds-space-sm); }
  .ds-admin :is(.administrator-claim-review__field, .administrator-time-trials__field,
    .operator-access__field, .tournament-publication__form label) { display: grid; gap: var(--ds-space-xs); min-width: min(100%, 14rem); }
  .ds-admin .administrator-claim-review__confirmation,
  .ds-admin .observed-identities__toggle { display: flex; align-items: flex-start; gap: var(--ds-space-sm); }
  /* The claim review card (ADR-0216): label above value, the conversation as quoted lines. */
  .ds-admin .administrator-claim-review__item h3 { margin: 0; }
  .ds-admin .administrator-claim-review__meta { margin: 0; color: var(--ds-text-secondary); }
  .ds-admin .administrator-claim-review__facts { display: grid; gap: var(--ds-space-xs); margin: 0; }
  .ds-admin .administrator-claim-review__facts dt { color: var(--ds-text-tertiary); font-size: var(--ds-type-label-size); font-weight: 600; }
  .ds-admin .administrator-claim-review__facts dd { margin: 0 0 var(--ds-space-xs); color: var(--ds-text-body); }
  .ds-admin .administrator-claim-review__conflict { margin: 0; padding: var(--ds-space-sm); color: var(--ds-text-primary); box-shadow: inset 3px 0 0 var(--ds-status-error); }
  .ds-admin .administrator-claim-review__linked-list { display: grid; gap: var(--ds-space-xs); margin: 0; padding: 0; list-style: none; }
  .ds-admin .administrator-claim-review__linked-item { display: grid; gap: var(--ds-space-xs); padding-block: var(--ds-space-sm); border-bottom: 1px solid var(--ds-border-subtle); overflow-wrap: anywhere; }
  .ds-admin .administrator-claim-review__linked-item > p { margin: 0; }
  :is(.ds-admin .administrator-claim-review__notes, .player-claim-walk__notes) { display: grid; gap: var(--ds-space-xs); margin: 0; padding: 0; list-style: none; }
  :is(.administrator-claim-review__note, .player-claim-walk__note) { padding: var(--ds-space-xs) var(--ds-space-sm); box-shadow: inset 3px 0 0 var(--ds-border-strong); overflow-wrap: anywhere; }
  :is(.administrator-claim-review__note--reviewer, .player-claim-walk__note--reviewer) { box-shadow: inset 3px 0 0 var(--ds-border-control); background: var(--ds-surface-raised); }
  :is(.administrator-claim-review__note-meta, .player-claim-walk__note-meta) { color: var(--ds-text-tertiary); font-size: var(--ds-type-label-size); }
  :is(.administrator-claim-review__note-body, .player-claim-walk__note-body) { margin: 0; white-space: pre-line; }
  .player-claim-walk__list { margin: 0; padding: 0; list-style: none; }
  .player-claim-walk__item { min-width: 0; padding-block: var(--ds-space-sm); border-bottom: 1px solid var(--ds-border-subtle); }
  .player-claim-walk__line { margin: 0; font-weight: 600; color: var(--ds-text-primary); }
  .player-claim-walk__actions { display: flex; flex-wrap: wrap; gap: var(--ds-space-sm); }

  .ds-admin .rating-admin__item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--ds-space-sm); align-items: center; }
  .ds-admin .rating-admin__meta { grid-column: 1 / -1; }
  .ds-admin .alias-admin { margin-top: 0; }
  .ds-admin .alias-admin__search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--ds-space-sm); }
  .ds-admin .alias-admin__results { display: flex; flex-wrap: wrap; }
  .ds-admin .alias-admin__item { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm); padding-block: var(--ds-space-sm); border-bottom: 1px solid var(--ds-border-subtle); }
  .ds-admin .alias-admin__form { display: grid; gap: var(--ds-space-sm); max-width: 42rem; }

  .ds-admin .identity-link-row { grid-template-columns: minmax(10rem, 1fr) minmax(12rem, 2fr); align-items: start; }
  .ds-admin .identity-link-choose { display: grid; gap: var(--ds-space-sm); }
  .ds-admin .observed-identities__controls { margin-block: var(--ds-space-sm); }
  .ds-admin .observed-identities__search { flex: 1 1 14rem; }
  .ds-admin .observed-identity-row { grid-template-columns: minmax(8rem, 1fr) minmax(10rem, 1fr) minmax(12rem, 2fr); align-items: center; }
  .ds-admin .observed-identity-row--review { box-shadow: inset 3px 0 0 var(--ds-status-warning), inset 0 0 0 1px var(--ds-border-subtle); }
  .ds-admin .observed-identity-row--manual { box-shadow: inset 3px 0 0 var(--ds-personal-edge), inset 0 0 0 1px var(--ds-border-subtle); }
  .ds-admin .observed-identity-row__manual, .ds-admin .observed-identity-row__undo { grid-column: 1 / -1; }

  .ds-admin .tournament-removal__form,
  .ds-admin .tournament-publication__form,
  .ds-admin .tournament-canonical-import,
  .ds-admin .operator-access__form { display: grid; gap: var(--ds-space-md); }
  .ds-admin .tournament-removal__form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .ds-admin .tournament-removal__form > :is(input, select) { grid-column: 1 / -1; }
  .ds-admin .tournament-publication__form fieldset { display: grid; gap: var(--ds-space-sm); margin: 0; padding: 0; border: 0; }
  .ds-admin .tournament-publication__candidate { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: var(--ds-space-sm); }
  .ds-admin .operator-access__results { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
  /* ADR-0220: requests to host above the Directors; the note keeps the person's line breaks. */
  .ds-admin .operator-access__heading { margin: var(--ds-space-md) 0 0; font-size: var(--ds-type-label-size); color: var(--ds-text-secondary); }
  .ds-admin .operator-access__note { margin: 0; white-space: pre-line; color: var(--ds-text-body); }
  .ds-admin details.ds-panel > summary { min-height: var(--ds-target-min); cursor: pointer; font-weight: 600; color: var(--ds-text-primary); }

  @media (max-width: 599px) {
    .ds-admin { gap: var(--ds-space-lg); }
    .ds-admin__section { gap: var(--ds-space-lg); }
    .ds-admin .rating-admin__item,
    .ds-admin .identity-link-row,
    .ds-admin .observed-identity-row,
    .ds-admin .tournament-removal__form { grid-template-columns: minmax(0, 1fr); }
    .ds-admin .alias-admin__search { grid-template-columns: minmax(0, 1fr); }
    .ds-admin__section :is(.tt-auth__button, button:not(.ds-tab), a.tt-auth__button) { width: 100%; }
  }

  /* `hidden` is a behaviour contract, not a presentation suggestion. Component display rules
     such as `.ds-stack`, `.ds-button` and `.ds-chip` otherwise outrank the user-agent rule: that
     once laid out four inactive Admin datasets, exposed an unnamed denied-notification button and
     made every retired-result marker consume width. */
  .ds-root [hidden] { display: none; }

  @media (forced-colors: active) {
    .ds-board, .ds-winner, .ds-index, .ds-tstats__tile, .ds-apps .app-download__platform-mark,
    .ds-admin .admin-overview__tile, .ds-admin .administrator-claim-review__item,
    .ds-admin .administrator-time-trials__row, .ds-admin .rating-admin__item,
    .ds-admin .identity-link-row, .ds-admin .observed-identity-row { border: 1px solid CanvasText; }
    .ds-board__row[data-kind="you"] { border: 2px solid Highlight; }
    .ds-steps__step { border: 1px solid CanvasText; }
    .ds-steps__step[data-state="current"] { border: 2px solid Highlight; }
  }
}
