/* The capture scrubber — style E "Cloud" (delysium accordion), in this product's tokens.
 *
 * The reference is pure #000 with a #1E50FF wash. Dropped into a light dashboard that would be a
 * foreign panel, so the surface is `--nav` (the rail's own ink) and the text tiers are
 * `--on-nav` / `--on-nav-strong` — the pair `audit()` has already proven on that background.
 * Sitting directly under the stage, a dark band reads as part of the 3D surface rather than as a
 * second card, which is what the accordion wants anyway.
 *
 * 🔴 Namespaced `sc*`, every name grepped against app.css, screens.css AND spine.css first.
 * `.band`, `.body`, `.cap` and `.pill` are all already taken by other components — inheriting one
 * of those is trap 5 and trap 15, which each cost a pass: `screens.css`'s 14x3px `.legend .lg`
 * silently collapsed the spine's legend while still looking almost right.
 *
 * 🔴 The glow MUST also set a real background-color where it tints text's backdrop, or `audit()`
 * computes it transparent and walks past the check (trap 14). It does not: it is a decorative
 * wash over an opaque `--nav` column, and no text sits on the wash alone — the active column's
 * label reads against the column, and the wash only ever appears on INACTIVE columns.
 */

.scrub {
  --scbw: 260px;          /* the expanded column's content width — content is clipped, not squished */
  --scstrip: 36px;        /* a collapsed strip: index on top, date set vertical */
  --scglow: oklch(0.55 0.21 264);
  --scease: cubic-bezier(.22, .8, .2, 1);
  margin-top: var(--sp-3);
}

/* ------------------------------------------------------------- accordion */
.scacc {
  display: flex;
  height: 104px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--nav);
  cursor: crosshair;              /* the cursor IS the scrubber — rule 1 */
  touch-action: pan-y;            /* a vertical page scroll must still start on the band */
}

.sccol {
  position: relative;
  flex: 0 0 var(--scstrip);
  min-width: 0;
  overflow: hidden;               /* clipped, never squished — the delysium behaviour */
  border-inline-start: 1px solid oklch(1 0 0 / .14);
  cursor: pointer;
  /* 🔴 THE WASH IS A REAL background-color, NOT AN OVERLAY. An absolutely-positioned child span
     tinting the column is invisible to `audit()`, which composites only the PARENT chain: the
     strip's text would be checked against bare `--nav` while sitting on nav-plus-blue on screen.
     That is trap 14 ("any gradient fill must ALSO set background-color") in its other direction.
     Mixing into the column's own background-color keeps the audited number and the rendered
     pixel the same thing. `--sclit` is written per column by the component: 0 on the active one
     and on every column before it, rising toward the later dates. */
  background-color: color-mix(in oklab, var(--nav),
                              var(--scglow) calc(var(--sclit, 0) * 34%));
  /* A fixed sheen, identical on every column, so it carries no state and needs no audit. */
  background-image: linear-gradient(180deg, oklch(1 0 0 / 0) 45%, oklch(0.55 0.21 264 / .14) 100%);
  transition: flex-grow .6s var(--scease), flex-basis .6s var(--scease),
              background-color .6s var(--scease);
}
.sccol:first-child { border-inline-start: 0; }
.sccol.on { flex: 1 1 var(--scbw); }

.sccol:focus-visible {
  outline: 2px solid var(--on-nav-strong);
  outline-offset: -3px;
}

.scn {
  position: absolute;
  inset-block-start: var(--sp-3);
  inset-inline-start: var(--sp-4);
  opacity: 0;                     /* collapsed: the vertical date owns the strip, alone */
  transition: opacity .3s;
  font: 500 var(--t-label)/1 var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--on-nav);
  transition: color .3s;
  /* 🔴 trap 16: a numeric run needs its own base direction, or `01` renders mirrored in HE and
     `unicode-bidi: isolate` alone does not set it. */
  direction: ltr;
  unicode-bidi: isolate;
}
.sccol.on .scn { color: var(--on-nav-strong); opacity: 1; }

/* Rule 2: at rest a column says only WHEN, and says it vertically. */
.scvt {
  position: absolute;
  inset-block: var(--sp-3);
  inset-inline-start: 11px;
  max-height: calc(100% - var(--sp-5));
  overflow: hidden;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  font: 400 11px/1 var(--font);
  color: var(--on-nav);
  transition: opacity .25s;
  direction: ltr;
  unicode-bidi: isolate;
}
.sccol.on .scvt { opacity: 0; }

/* The active column's content is laid out at the FULL expanded width and revealed, so it never
   reflows as the column grows — a body that relayouts mid-transition reads as a stutter. */
.scbody {
  position: absolute;
  inset: 0;
  padding: var(--sp-6) var(--sp-4) var(--sp-3);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  opacity: 0;
  transition: opacity .35s .1s;
  pointer-events: none;
}
.scwho { display: grid; gap: 2px; min-width: 0; }
.sccol.on .scbody { opacity: 1; }

.sch {
  font: 500 var(--t-h2)/1.1 var(--font);
  letter-spacing: -.01em;
  color: var(--on-nav-strong);
}
.scd {
  font: 400 var(--t-label)/1.3 var(--font);
  color: var(--on-nav);
  direction: ltr;
  unicode-bidi: isolate;
}
.scsrc {
  flex: none;
  align-self: flex-end;
  padding: 3px 9px;
  border: 1px solid oklch(1 0 0 / .28);
  border-radius: var(--r-pill);
  font: 500 11px/1.3 var(--font);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--on-nav);
}

/* ------------------------------------------------------------------ foot */
.scfoot {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

.scnav { display: flex; gap: var(--sp-1); flex: none; }
.scnav button {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--slate);
  cursor: pointer;
}
.scnav button:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.scnav button:disabled { opacity: .35; cursor: default; }
.scnav svg {
  width: 13px; height: 13px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
/* I.chev points right; prev is the same glyph turned over. In RTL the whole pair turns, because
   "previous" follows the reading direction, not the screen. */
.scnav .scprev svg { transform: rotate(180deg); }
[dir="rtl"] .scnav .scprev svg { transform: none; }
[dir="rtl"] .scnav .scnext svg { transform: rotate(180deg); }

.scnote {
  margin: 0;
  font: 400 var(--t-label)/1.35 var(--font);
  color: var(--stone-text);
}

/* --------------------------------------------------------------- narrow */
@media (max-width: 720px) {
  .scrub { --scbw: 200px; --scstrip: 32px; }
  .scacc { height: 96px; }
  .sch { font-size: 17px; }
}

/* No reduced-motion block here on purpose: app.css:520 already sets
   `* { transition-duration: 0.01ms !important }` under the query, and `!important` beats anything
   this file could declare. A rule that can never win is a dead rule, and a dead rule is the same
   class of thing as a dead control - it reads as cover that is not there. */

/* The scrubber host, under the stage inside the same panel. `.pjscrub` grepped against all
   three stylesheets plus this one before use. */
.pjscrub { padding: 0 var(--sp-2) var(--sp-2); }

/* ------------------------------------------- footage stages in the stage
 * Every clip of a capture is resident and preloaded; a scrub flips `hidden`. That is locked rule
 * 3 verbatim - the picture swaps on the same frame, nothing fetches, nothing seeks from cold. */
.stagemedia { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.stagemedia video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  background: var(--ink);
}
.stagemedia video[hidden] { display: none !important; }

/* A rendered stage says so on its own column. It is a statement about provenance, so it does not
   get the quiet treatment the "showing above" chip gets. */
.scsrc.gen {
  border-color: var(--brand-yellow);
  color: var(--brand-yellow);
}

/* The published date's link to the real tier-3 viewer. Only the stage that IS published carries
   one — scrubbing here and opening the full viewer are not alternatives, and removing this was
   the regression that made a multi-date capture reachable only as a preview. */
.scwrap { display: flex; align-items: flex-end; gap: var(--sp-2); flex: none; }
.scopen {
  padding: 3px 9px;
  border: 1px solid oklch(1 0 0 / .55);
  border-radius: var(--r-pill);
  font: 500 11px/1.3 var(--font);
  color: var(--on-nav-strong);
  text-decoration: none;
  white-space: nowrap;
  pointer-events: auto;          /* .scbody is pointer-events:none so the band keeps scrubbing */
}
.scopen:hover { background: var(--on-nav-strong); color: var(--nav); }
.sccol.on .scbody { pointer-events: none; }
.sccol.on .scbody .scopen { pointer-events: auto; }
