/* Stacking timeline (home, after the hero). Scoped under .stk. */

    /* ---------- Section ---------- */

    .stk {
      position: relative;
      isolation: isolate;
      padding: clamp(80px, 11vw, 160px) var(--gutter);
      overflow-x: clip;
    }
    .stk::before {
      content: ''; position: absolute; z-index: -1;
      inset: 4% -10% 8%;
      background: url("../assets/algorithms/ladybird-glow.webp") center / cover;
      filter: blur(80px) saturate(1.1);
      opacity: .26;
      -webkit-mask-image: radial-gradient(closest-side, #000 25%, transparent);
      mask-image: radial-gradient(closest-side, #000 25%, transparent);
    }

    .stk__heading { max-width: 860px; margin: 0 auto clamp(56px, 7vw, 96px); text-align: center; }
    .stk__heading .hud-label { color: var(--accent); }
    .stk__heading h2 {
      margin: 16px 0 0;
      font-size: clamp(34px, 5.4vw, 64px);
      letter-spacing: -0.035em; line-height: 1.02; text-wrap: balance;
      background: linear-gradient(180deg, #ffffff 30%, #aab5b0);
      -webkit-background-clip: text; background-clip: text; color: transparent;
    }
    .stk__heading p {
      max-width: 660px; margin: 22px auto 0;
      color: var(--muted); font-size: clamp(16px, 1.5vw, 18px); line-height: 1.6; text-wrap: pretty;
    }

    /* ---------- Timeline: the rail and its nodes ---------- */

    .stk .tl { --node: 56px; --rail-x: 50%; position: relative; max-width: var(--max); margin: 0 auto; }
    .stk .tl__rail {
      position: absolute; left: var(--rail-x); top: 0; height: 0;
      width: 2px; margin-left: -1px;
      border-radius: 1px;
      background: #ffffff17;
      pointer-events: none;
    }
    .stk .tl__rail span {
      position: absolute; inset: 0;
      border-radius: inherit;
      background: linear-gradient(180deg, #f1f4f2e6, #f1f4f2);
      box-shadow: 0 0 12px #ffffff40;
      transform: scaleY(var(--p, 0)); transform-origin: top;
    }

    /* Numbered circles, as in the inspector's rail. Lit once the line reaches them. */
    .stk .node {
      position: relative; z-index: 1;
      display: grid; place-items: center;
      width: var(--node); height: var(--node);
      border-radius: 50%;
      border: 1px solid #ffffff2e;
      background: #121413;
      box-shadow: inset 0 1px 0 #ffffff14, 0 0 0 8px var(--bg);
      color: var(--muted); font: 600 19px var(--font); font-variant-numeric: tabular-nums;
      transition: background .4s, color .4s, border-color .4s, box-shadow .4s;
    }
    .stk .node.is-lit {
      background: #f1f4f2; color: #0b0c0c; border-color: transparent;
      box-shadow: 0 0 0 8px var(--bg), 0 0 0 9px #ffffff1f, 0 0 30px #ffffff38;
    }

    /* A tl-chapter: visual on one side of the line, words on the other; flipped every other step. */
    .stk .tl-chapter {
      display: grid;
      grid-template-columns: minmax(0, 1fr) calc(var(--node) + 56px) minmax(0, 1fr);   /* symmetric: nodes sit on the centre line */
      grid-template-areas: "visual node head" "visual node ctrl";
      grid-template-rows: auto 1fr;
      align-items: start;
    }
    .stk .tl-chapter--flip {
      grid-template-areas: "head node visual" "ctrl node visual";
    }
    .stk .tl-chapter + .tl-chapter, .stk .tl-chapter + .finale { margin-top: clamp(96px, 12vw, 168px); }
    .stk .tl-chapter > .node { grid-area: node; justify-self: center; align-self: center; }
    .stk .tl-chapter__head { grid-area: head; align-self: start; min-width: 0; }   /* the words start on the photo's top edge */
    .stk .tl-chapter__ctrl { grid-area: ctrl; min-width: 0; margin-top: 24px; }
    .stk .tl-chapter__visual { grid-area: visual; min-width: 0; align-self: start; }

    .stk .step-label { color: var(--muted); }
    .stk .tl-chapter h3, .stk .finale h3 {
      margin: 12px 0 14px;
      font-size: clamp(28px, 3.2vw, 42px); font-weight: 650;
      letter-spacing: -0.03em; line-height: 1.08; text-wrap: balance;
    }
    .stk .tl-chapter__head p, .stk .finale__head p { color: var(--muted); font-size: 16px; line-height: 1.6; text-wrap: pretty; }
    .stk .fact { margin-top: 16px; color: var(--muted); font-size: 14px; line-height: 1.5; }
    .stk .fact b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

    /* ---------- Shared glass pieces ---------- */

    .stk .glass {
      min-width: 0;
      padding: 10px;
      border-radius: 28px;
      background: linear-gradient(180deg, #ffffff17, #ffffff09);
      border: 1px solid #ffffff21;
      -webkit-backdrop-filter: blur(30px) saturate(1.5);
      backdrop-filter: blur(30px) saturate(1.5);
      box-shadow: inset 0 1px 0 #ffffff24, 0 50px 120px #00000080, 0 0 0 1px #00000040;
    }

    .stk .segments {
      --n: 3;
      position: relative;
      display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr));
      padding: 4px;
      border: 1px solid #ffffff1a;
      border-radius: 999px;
      background: linear-gradient(180deg, #ffffff0d, #ffffff05);
      -webkit-backdrop-filter: blur(20px) saturate(1.5);
      backdrop-filter: blur(20px) saturate(1.5);
      box-shadow: inset 0 1px 0 #ffffff0d, 0 4px 14px #0002;
    }
    .stk .segments--4 { --n: 4; }
    .stk .segments--2 { --n: 2; }
    .stk .segments__thumb {
      position: absolute; top: 4px; bottom: 4px; left: 4px;
      width: calc((100% - 8px) / var(--n));
      border-radius: 999px;
      background: linear-gradient(180deg, #ffffff26, #ffffff14);
      box-shadow: inset 0 1px 0 #ffffff38, inset 0 -1px 0 #ffffff0a, 0 2px 8px #0005;
      transform: translateX(calc(var(--selected, 0) * 100%));
      transition: transform .16s ease-in-out;
      pointer-events: none;
    }
    .stk .segments button {
      position: relative; z-index: 1;
      min-width: 0; min-height: 36px; padding: 0 6px;
      border: 0; border-radius: 999px;
      background: transparent;
      color: var(--muted); font: 500 13px var(--font);
      cursor: pointer;
    }
    .stk .segments button[aria-selected="true"], .stk .segments button:hover { color: var(--text); }
    .stk .segments button:focus-visible { outline-offset: -2px; }

    /* Captions that swap with a control; all share one cell so the tallest reserves the space. */
    .stk .swap { display: grid; margin-top: 12px; }
    .stk .swap > * { grid-area: 1 / 1; transition: opacity .25s; }
    .stk .swap > [hidden] { display: block; visibility: hidden; opacity: 0; }
    .stk .swap p { color: var(--muted); font-size: 13px; line-height: 1.5; }

    .stk .chip {
      position: absolute;
      display: inline-flex; align-items: center; gap: 8px;
      padding: 6px 12px;
      border-radius: 999px;
      border: 1px solid #ffffff26;
      background: #0b0c0c8c;
      -webkit-backdrop-filter: blur(16px) saturate(1.4);
      backdrop-filter: blur(16px) saturate(1.4);
      box-shadow: inset 0 1px 0 #ffffff14;
      color: #f1f4f2; font-size: 12px; line-height: 1.3;
      white-space: nowrap;
      pointer-events: none;
    }
    .stk .chip[hidden] { display: none; }
    .stk .chip svg[hidden] { display: none; }
    .stk button.chip { pointer-events: auto; cursor: pointer; font: inherit; font-size: 12px; transition: background .15s; }
    .stk button.chip:hover { background: #1b1e1dcc; }

    .stk .photo {
      position: relative;
      width: 100%;
      aspect-ratio: 3 / 2;
      margin: 0;
      overflow: hidden;
      border-radius: 19px;
      background: #1d2412;
    }
    .stk .photo > img, .stk .photo__layer img {
      position: absolute; inset: 0;
      width: 100%; height: 100%; object-fit: cover;
      opacity: 0;
      transition: opacity .45s ease;
      -webkit-user-drag: none;
    }
    .stk .photo img.is-on { opacity: 1; }

    /* ---------- 1 · RAW development ---------- */

    .stk .raw-photo > img { object-position: 44% 50%; }
    .stk .raw-photo .tag { left: 14px; top: 14px; }
    .stk .raw-photo .foot { left: 14px; bottom: 14px; max-width: calc(100% - 28px); white-space: normal; color: #d6dbd8; }

    /* ---------- 2 · Alignment ---------- */

    .stk .al-photo > img { transition: none; }
    .stk .al-photo > svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
    .stk .al-grid line { stroke: #ffffff26; stroke-width: 1; vector-effect: non-scaling-stroke; }
    .stk .al-footprint { fill: none; stroke: #f1f4f2; stroke-width: 1.5; vector-effect: non-scaling-stroke; transition: opacity .3s; }
    .stk .al-crop { fill: none; stroke: #f1f4f2b3; stroke-width: 1.2; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; transition: opacity .3s; }
    .stk .al-photo:not([data-aligned]) .al-footprint, .stk .al-photo:not([data-aligned]) .al-crop { opacity: 0; }
    .stk .al-photo .tag { left: 14px; top: 14px; }
    .stk .al-photo .play { left: 14px; bottom: 14px; padding: 7px 12px 7px 10px; }
    .stk .al-photo .crop-tag { right: 14px; bottom: 14px; transition: opacity .3s; }
    .stk .al-photo:not([data-aligned]) .crop-tag { opacity: 0; }

    .stk .anchor { margin-top: 22px; }
    .stk .anchor__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; }
    .stk .anchor__head b { font-weight: 600; }
    .stk .anchor__head span { color: var(--muted); font-variant-numeric: tabular-nums; }
    .stk .strip { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; margin-top: 22px; padding: 0; list-style: none; }
    .stk .strip button {
      position: relative; display: block; width: 100%;
      aspect-ratio: 3 / 4;
      padding: 0; border: 0; border-radius: 5px;
      background: #1d2412 center / cover no-repeat;
      box-shadow: inset 0 0 0 1px #ffffff1a;
      opacity: .55;
      cursor: pointer;
      transition: opacity .15s, box-shadow .15s;
    }
    .stk .strip button:hover { opacity: .85; }
    .stk .strip button[aria-current="true"] { opacity: 1; box-shadow: inset 0 0 0 1.5px #f1f4f2; }
    .stk .strip .is-anchor::before {
      content: ''; position: absolute; left: 50%; top: -15px;
      width: 12px; height: 12px; margin-left: -6px;
      background: currentColor;
      -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 1.6a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4zM6 4v6.6M3.6 5.6h4.8M2 7.4c.4 2 2 3.2 4 3.2s3.6-1.2 4-3.2' fill='none' stroke='black' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 1.6a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4zM6 4v6.6M3.6 5.6h4.8M2 7.4c.4 2 2 3.2 4 3.2s3.6-1.2 4-3.2' fill='none' stroke='black' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
      color: #f1f4f2;
    }
    .stk .anchor > p { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }

    /* ---------- 3 · Stacking options: one frame vs. the stack ---------- */

    .stk .cmp {
      --pos: 50%;
      position: relative;
      container-type: size;
      cursor: ew-resize;
      touch-action: pan-y;
      user-select: none; -webkit-user-select: none;
    }
    .stk .photo__layer { position: absolute; inset: 0; pointer-events: none; }
    .stk .photo__layer--before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
    .stk .cmp__marker {
      position: absolute;
      left: 39.1%; top: 14.5%; width: 10.1%; height: 15.2%;
      border: 1.5px solid #ffffffd9; border-radius: 6px;
      box-shadow: 0 0 0 1px #00000040;
    }
    .stk .cmp__marker span {
      position: absolute; left: 50%; top: 100%;
      margin-top: 6px; transform: translateX(-50%);
      padding: 2px 7px; border-radius: 999px;
      background: #0b0c0cb3; color: #f1f4f2; font: 10px var(--mono);
    }
    .stk .cmp__handle {
      position: absolute; top: 0; bottom: 0; left: var(--pos);
      width: 2px; margin-left: -1px;
      background: #ffffffe6; box-shadow: 0 0 12px #00000059;
      pointer-events: none;
    }
    .stk .cmp__knob {
      position: absolute; left: 50%; top: 50%;
      display: grid; place-items: center;
      width: 44px; height: 44px; margin: -22px 0 0 -22px;
      border-radius: 50%;
      background: #14161573; border: 1px solid #ffffff8c;
      -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
      color: #fff; box-shadow: 0 6px 20px #00000059;
      transition: transform .2s cubic-bezier(.2,.7,.2,1);
    }
    .stk .cmp.is-dragging .cmp__knob { transform: scale(1.08); }
    .stk .cmp__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
    .stk .cmp:has(.cmp__range:focus-visible) .cmp__knob { outline: 2px solid var(--accent); outline-offset: 3px; }
    .stk .cmp .before { left: 14px; top: 14px; opacity: clamp(0, (var(--pos-n, 50) - 17) / 6, 1); }
    .stk .cmp .after { right: 14px; top: 14px; opacity: clamp(0, (78 - var(--pos-n, 50)) / 6, 1); }

    .stk .loupe {
      position: absolute; right: 14px; bottom: 14px;
      width: 172px; margin: 0; padding: 6px;
      border-radius: 20px; border: 1px solid #ffffff2e;
      background: #0b0c0c80;
      -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
      box-shadow: inset 0 1px 0 #ffffff1a, 0 18px 40px #00000080;
      pointer-events: none;
    }
    .stk .loupe__view { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 14px; background: #1d2412; }
    .stk .loupe__view img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .3s; }
    .stk .loupe__view img.is-on { opacity: 1; }
    .stk .cmp[data-loupe-frame] .loupe__view img[data-algo] { opacity: 0; }
    .stk .cmp[data-loupe-frame] .loupe__view .loupe__frame { opacity: 1; }
    .stk .loupe figcaption { display: flex; justify-content: space-between; gap: 8px; padding: 7px 6px 1px; color: var(--muted); font-size: 11px; }
    .stk .loupe figcaption b { color: var(--text); font-weight: 500; }

    .stk .algo-panels { display: grid; margin-top: 20px; }
    .stk .algo-panels > div { grid-area: 1 / 1; transition: opacity .3s; }
    .stk .algo-panels > [hidden] { display: block; visibility: hidden; opacity: 0; pointer-events: none; }
    .stk .algo-panels .tagline { color: var(--muted); font-size: 13px; }
    .stk .algo-panels h4 { margin: 4px 0 8px; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
    .stk .algo-panels p { color: var(--muted); font-size: 14px; line-height: 1.55; text-wrap: pretty; }
    .stk .specs { display: grid; gap: 2px; margin: 14px 0 0; padding: 6px; border-radius: 14px; background: #ffffff08; box-shadow: inset 0 1px 0 #ffffff0a; }
    .stk .specs > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 8px; font-size: 12px; }
    .stk .specs dt { color: var(--muted); }
    .stk .specs dd { margin: 0; text-align: right; }
    .stk .pips { display: inline-flex; gap: 3px; vertical-align: middle; }
    .stk .pips i { width: 16px; height: 5px; border-radius: 3px; background: #ffffff1f; }
    .stk .pips i.on { background: #f1f4f2; }

    /* ---------- 4 · Stack: the finale ---------- */

    .stk .finale { display: grid; justify-items: center; }
    .stk .finale__head { max-width: 700px; margin-top: 26px; text-align: center; }
    .stk .finale__head .step-label { display: block; }
    .stk .finale__card { width: 100%; margin-top: clamp(32px, 4vw, 48px); display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 10px; }
    .stk .run { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
    .stk .side { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 12px 8px 4px; }
    .stk .side .algo-panels { margin-top: 0; }
    .stk .side .race { flex: 1; }

    /* The photo runs in two phases: "map" (focus map building, divider hidden), then "compare". */
    .stk .cmp__map { transition: opacity .6s ease-in-out; }
    .stk .cmp__map img { transition: opacity .1s linear; }
    .stk .cmp[data-phase="compare"] .cmp__map { opacity: 0; }
    .stk .cmp__handle, .stk .cmp__marker, .stk .loupe, .stk .cmp .before, .stk .cmp .after { transition: opacity .4s ease; }
    .stk .cmp[data-phase="map"] :is(.cmp__handle, .cmp__marker, .loupe, .before, .after) { opacity: 0; }
    .stk .cmp[data-phase="map"] { cursor: pointer; }
    .stk .cmp__replay { left: 14px; bottom: 14px; padding: 7px 12px 7px 10px; opacity: 0; pointer-events: none !important; transition: opacity .3s, background .15s; }
    .stk .cmp[data-done] .cmp__replay { opacity: 1; pointer-events: auto !important; }

    .stk .live { display: flex; flex-direction: column; gap: 10px; min-width: 0; margin: 0; }
    .stk .live__map { position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 19px; background: #000; }
    .stk .live__map img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .12s linear; }
    .stk .live__map img.is-on { opacity: 1; }
    .stk .live__map .live__result { transition: opacity .9s ease-in-out; }   /* fadeOutInfernoMap: 0.9 s */
    .stk .live__replay { right: 12px; top: 12px; padding: 7px 12px 7px 10px; opacity: 0; pointer-events: none !important; transition: opacity .3s, background .15s; }
    .stk .live[data-done] .live__replay { opacity: 1; pointer-events: auto !important; }
    .stk .live__card { padding: 14px 16px 15px; border-radius: 18px; background: #ffffff0a; box-shadow: inset 0 1px 0 #ffffff12; }
    .stk .live__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
    .stk .live__title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
    .stk .live__photos { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
    .stk .live__detail { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; min-height: 2.9em; }
    .stk .live__bar { display: flex; gap: 3px; height: 6px; margin: 12px 0 8px; }
    .stk .live__bar span { position: relative; overflow: hidden; border-radius: 3px; background: #ffffff1a; }
    .stk .live__bar span::after { content: ''; position: absolute; inset: 0; background: #f1f4f2; transform: scaleX(var(--fill, 0)); transform-origin: left; transition: transform .25s linear; }
    .stk .live__row--foot { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

    .stk .race { display: flex; flex-direction: column; min-width: 0; padding: 18px 16px 12px; border-radius: 19px; background: #ffffff08; box-shadow: inset 0 1px 0 #ffffff0d; }
    .stk .race__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
    .stk .race h4 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
    .stk .race__sub { margin-top: 3px; color: var(--muted); font-size: 12px; }
    .stk .segments--small { flex: none; width: 132px; }
    .stk .segments--small button { min-height: 28px; font-size: 12px; }
    .stk .bars { flex: 1; display: grid; align-content: center; gap: 14px; margin: 24px 0; padding: 0; list-style: none; }
    .stk .bar { display: grid; grid-template-columns: 100px minmax(0, 1fr) 50px; align-items: center; gap: 12px; font-size: 13px; }
    .stk .bar__name { color: var(--muted); }
    .stk .bar--us .bar__name { color: var(--text); font-weight: 600; }
    .stk .bar__track { position: relative; height: 28px; }
    .stk .bar__fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--w, 0) * 100%); border-radius: 0 6px 6px 0; background: #8d9591; transition: width .9s cubic-bezier(.2,.7,.2,1); }
    .stk .bar--us .bar__fill { background: #f1f4f2; }
    .stk .race:not([data-shown]) .bar:not(.bar--todo) .bar__fill { width: 0; }
    .stk .bar--todo .bar__fill { width: 100%; background: none; border: 1px dashed #ffffff33; border-radius: 6px; }
    .stk .bar--todo .bar__fill::after { content: 'Not measured yet'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 11px; white-space: nowrap; }
    .stk .bar__value { text-align: right; font-variant-numeric: tabular-nums; }
    .stk .bar--todo .bar__value { color: var(--faint); }
    .stk .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .stk .stat { padding: 12px 12px 11px; border-radius: 14px; background: #ffffff08; box-shadow: inset 0 1px 0 #ffffff0a; }
    .stk .stat b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
    .stk .stat span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }
    .stk .race__note { padding-top: 14px; color: var(--faint); font-size: 11px; line-height: 1.5; }
    .stk .live__caption { padding: 2px 6px 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
    .stk .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

    .stk__foot { max-width: 600px; margin: clamp(40px, 5vw, 56px) auto 0; text-align: center; }
    .stk__foot h4 { font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; text-wrap: balance; }
    .stk__foot p { margin: 10px 0 16px; color: var(--muted); font-size: 15px; line-height: 1.6; text-wrap: pretty; }
    .stk__foot a { color: var(--accent); font-size: 14px; text-decoration: none; }
    .stk__foot a:hover { text-decoration: underline; text-underline-offset: 4px; }

    /* ---------- Narrow: the line moves to the left edge ---------- */

    @media (max-width: 960px) {
      .stk .tl { --node: 40px; --rail-x: 20px; max-width: 720px; }
      .stk .tl-chapter, .stk .tl-chapter--flip {
        grid-template-columns: var(--node) minmax(0, 1fr);
        grid-template-areas: "node head" ". visual" ". ctrl";
        grid-template-rows: auto;
        column-gap: 16px;
      }
      .stk .tl-chapter > .node { align-self: start; margin-top: 2px; }
      .stk .tl-chapter__visual { margin-top: 22px; }
      .stk .tl-chapter__ctrl { margin-top: 18px; }
      .stk .node { font-size: 15px; box-shadow: inset 0 1px 0 #ffffff14, 0 0 0 6px var(--bg); }
      .stk .node.is-lit { box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px #ffffff1f, 0 0 24px #ffffff38; }
      .stk .finale { grid-template-columns: var(--node) minmax(0, 1fr); column-gap: 16px; justify-items: stretch; }
      .stk .finale > .node { grid-column: 1; grid-row: 1; }
      .stk .finale__head { grid-column: 2; grid-row: 1; margin-top: 0; text-align: left; }
      .stk .finale__card { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr); }
      /* One column: keep the picker right under the photo it changes, speed figures after it. */
      .stk .run, .stk .side, .stk .live { display: contents; }
      .stk .finale__card > *, .stk .finale__card .live > *, .stk .finale__card .side > * { min-width: 0; }
      .stk .cmp { order: 1; }
      .stk .live__card { order: 2; }
      .stk .side > .segments { order: 3; margin-top: 8px; }
      .stk .side > .algo-panels { order: 4; padding: 0 4px; }
      .stk .live > .stats { order: 5; margin-top: 8px; }
      .stk .side > .race { order: 6; }
      .stk .live__caption { order: 7; }
    }
    @media (max-width: 600px) {
      .stk .tl-chapter h3, .stk .finale h3 { font-size: 27px; margin: 8px 0 10px; }
      .stk .tl-chapter__head p, .stk .finale__head p { font-size: 15px; }
      .stk .glass { padding: 6px; border-radius: 22px; }
      .stk .photo { border-radius: 16px; }
      .stk .chip { font-size: 11px; padding: 5px 10px; }
      .stk .raw-photo .tag, .stk .al-photo .tag, .stk .cmp .before { left: 10px; top: 10px; }
      .stk .cmp__replay { left: 10px; bottom: 10px; }
      .stk .side { padding: 10px 4px 2px; }
      .stk .cmp .after { right: 10px; top: 10px; }
      .stk .raw-photo .foot { left: 10px; bottom: 10px; max-width: calc(100% - 20px); }
      .stk .al-photo .play { left: 10px; bottom: 10px; }
      .stk .al-photo .crop-tag { display: none; }
      .stk .cmp__marker { display: none; }
      .stk .cmp__knob { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
      .stk .loupe { right: 10px; bottom: 10px; width: 104px; padding: 4px; border-radius: 14px; }
      .stk .loupe__view { border-radius: 10px; }
      .stk .loupe figcaption { display: none; }
      .stk .segments button { min-height: 40px; }
      .stk .strip { gap: 2px; }
      .stk .race { padding: 14px 10px 10px; }
      .stk .race__top { flex-direction: column; }
      .stk .bar { grid-template-columns: 84px minmax(0, 1fr) 44px; gap: 10px; font-size: 12px; }
      .stk .stats { grid-template-columns: minmax(0, 1fr); gap: 6px; }
      .stk .stat { display: flex; align-items: center; gap: 14px; }
      .stk .stat b { flex: none; min-width: 82px; font-size: 21px; }
      .stk .stat span { margin: 0; }
    }

    @media (prefers-reduced-motion: reduce) {
      .stk *, .stk *::before, .stk *::after { transition: none !important; }
    }
  