/**
 * DVR transport bar. This is the app's signature control — worth the most
 * visual craft of any component. The jog-wheel/barrel shuttle infrastructure
 * (.jogWheel, .jogBarrel*) exists fully built but stays feature-flagged off
 * exactly as before; see the design brief for why this pass didn't revive
 * it. Everything below is the classic scrub bar, substantially elevated.
 *
 * --pct is written by ui_playback.js (updatePlaybackUi) as a percentage
 * string ("42%") — the fill gradient below reads it live every frame.
 */

.playbackBar {
  position: absolute;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  z-index: var(--z-panel);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--hairline);
  background: var(--scrim-strong);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: var(--shadow-float);
  max-width: min(880px, calc(100% - 28px));
  width: 700px;
  touch-action: none;
  transition: transform var(--ease-emphasized), opacity var(--ease-emphasized);
}
.playbackBar.pb-hidden,
.playbackBar.pb-ss-hidden {
  transform: translateX(-50%) translateY(40px);
  opacity: 0;
  pointer-events: none;
}

.pbRow1 {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
}
.pbRow1 input[type="range"] { flex: 1; }

.pbRow2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-500);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  padding: 0 calc(64px + var(--space-2) - 28px);
  gap: 2px;
}
.pbRow2 .sep { opacity: 0.5; }
#pbLeft, #pbNow, #pbRight {
  display: inline-block;
  min-width: 10ch;
  font-variant-numeric: tabular-nums;
}
#pbLeft { text-align: left; }
#pbNow  { text-align: center; color: var(--ink-300); font-weight: var(--weight-medium); }
#pbRight { text-align: right; }

.pbPageBtn {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-500);
  font-size: var(--text-md);
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color var(--ease-standard), border-color var(--ease-standard);
  flex-shrink: 0;
}
.pbPageBtn:hover:not(:disabled) { color: var(--ink-100); border-color: var(--hairline-strong); }
.pbPageBtn:disabled { opacity: 0.25; cursor: default; }
.pbPageBtn.hidden { display: none; }

/* ── Transport button: the single most-touched control in the app.
   Server-sync mode = lit (accent-live). "Live" at 1x, "Pause" above 1x —
   the label/lit state is computed by PlaybackUI.computeButtonState (JS,
   untouched); this is purely its visual expression. ── */
button#pbPlay {
  height: 34px;
  min-width: 68px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline);
  background: var(--ink-850);
  color: var(--ink-100);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  cursor: pointer;
  text-align: center;
  line-height: 32px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background var(--ease-standard), border-color var(--ease-standard),
              color var(--ease-standard), box-shadow var(--ease-standard);
}
button#pbPlay * { pointer-events: none !important; }
button#pbPlay:hover { border-color: var(--hairline-strong); }
button#pbPlay.isLive {
  background: var(--accent-live-dim);
  border-color: var(--accent-live-line);
  color: var(--accent-live);
  text-shadow: 0 0 10px var(--accent-live-line);
  box-shadow: 0 0 0 1px var(--accent-live-line) inset, 0 0 16px -4px var(--accent-live-line);
}

/* ── Scrub track: a real progress fill with a glow at the playhead, not a
   flat native slider. Colors shift live→time when scrubbed into the past
   is expressed by JS via .isLive on the button; the track itself always
   uses the live hue for its fill since it's a position gauge, not a mode
   indicator. ── */
.playbackBar input[type="range"] {
  flex: 1;
  min-width: 140px;
  touch-action: none;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(to right,
    var(--accent-live) 0%, var(--accent-live) var(--pct, 0%),
    var(--ink-700) var(--pct, 0%), var(--ink-700) 100%);
  outline: none;
  cursor: pointer;
}
.playbackBar input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  background: var(--ink-100);
  border: 2px solid var(--accent-live);
  box-shadow: 0 1px 4px oklch(0% 0 0 / 0.4), 0 0 10px -2px var(--accent-live-line);
  transition: transform var(--ease-standard);
}
.playbackBar input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
.playbackBar input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--ink-700);
  border: none;
}
.playbackBar input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
  background: var(--accent-live);
}
.playbackBar input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  background: var(--ink-100);
  border: 2px solid var(--accent-live);
  box-shadow: 0 1px 4px oklch(0% 0 0 / 0.4);
}

.pbSpeed {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink-500);
  font-size: var(--text-xs);
  white-space: nowrap;
}
.pbSpeed select {
  height: 30px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--ink-850);
  color: var(--ink-100);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.pbSpeed select:hover { border-color: var(--hairline-strong); }

/* ── iOS toggle switch (barrel A/B — still shunted, kept as-is) ── */
.iosToggle { display: inline-flex; cursor: pointer; }
.iosToggleTrack {
  width: 36px; height: 20px;
  border-radius: var(--radius-pill);
  background: var(--ink-700);
  position: relative;
  transition: background var(--ease-standard);
}
.iosToggleThumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: var(--radius-pill);
  background: var(--ink-100);
  transition: transform var(--ease-standard);
}
.iosToggle input { display: none; }
.iosToggle input:checked + .iosToggleTrack { background: var(--accent-live); }
.iosToggle input:checked + .iosToggleTrack .iosToggleThumb { transform: translateX(16px); }
.pbToggleLabel { font-size: var(--text-xs); color: var(--ink-500); }

/* Screen-reader-only: hide the native slider visually, keep for a11y + JS */
.playbackBar .srOnly {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
