/* The practice-pack mixer, mounted by player.js. Colours come from the
   page's tokens (the portal's, or the dev harness's dark set). */
.practice-player { --pp-strip-bg: var(--surface, #1f2329); --pp-text: var(--text, #e8eaee); --pp-muted: var(--muted, #8b93a1); --pp-accent: var(--accent, #4fa3ff); --pp-border: var(--border, #3a414c); }
.practice-player .hidden { display: none !important; }
.practice-player .pp-status { color: var(--pp-muted); margin: 8px 0; }
.practice-player .pp-transport { display: flex; flex-direction: column; gap: 10px; background: var(--pp-strip-bg); padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
/* The transport is the remote app's TransportBanner (remote_ui/lib/src/transport_banner.dart):
   the desktop bar's fixed palette and icon geometry, so it stays dark on the light portal theme. */
.practice-player .pp-transport-row { display: flex; align-items: center; gap: 8px; }
.practice-player .pp-transport-buttons { display: flex; gap: 8px; }
.practice-player .pp-transport-buttons button, .practice-player .pp-transpose { flex: none; width: 44px; height: 44px; padding: 0; background: #3a3a3a; border: 1px solid #5a5a5a; border-radius: 8px; }
.practice-player .pp-transport-buttons button:hover, .practice-player .pp-transpose:hover { border-color: #8c8c8c; }
.practice-player .pp-transport-buttons svg, .practice-player .pp-transpose svg { display: block; width: 100%; height: 100%; }
.practice-player .pp-transpose svg { fill: #646464; }
/* Speed and Transpose show their icon at rest and their value, lit, once moved. */
.practice-player .pp-value-button .pp-value { display: none; font: 600 13px/1 ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; color: #ff8c00; }
.practice-player .pp-value-button.altered svg { display: none; }
.practice-player .pp-value-button.altered .pp-value { display: block; }
.practice-player .pp-value-button.altered { border-color: #ff8c00; }
.practice-player .pp-icon-play { fill: #00ff00; }
.practice-player .pp-icon-pause { fill: #ffa500; display: none !important; }
.practice-player #play.playing .pp-icon-play { display: none; }
.practice-player #play.playing .pp-icon-pause { display: block !important; }
.practice-player .pp-icon-stop { fill: #ff0000; }
.practice-player .pp-icon-record { fill: #646464; }
.practice-player .pp-icon-metronome { stroke: #646464; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.practice-player .pp-icon-metronome circle { fill: #646464; }
.practice-player .pp-metronome.on .pp-icon-metronome { stroke: #ff8c00; }
.practice-player .pp-metronome.on .pp-icon-metronome circle { fill: #ff8c00; }
.practice-player .pp-metronome { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
/* A level held open under its button: the click's, the speed, the transpose. */
.practice-player.pp-level-panel.pp-menu { position: fixed; z-index: 50; width: min(320px, calc(100vw - 16px)); display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--pp-strip-bg); border: 1px solid var(--pp-border); border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,0.4);
  --fader-fill: #b36200; --fader-handle: #ff8c00; --fader-highlight: #ffc266; --fader-shadow: #7a4300; }
.pp-level-panel .pp-fader { flex: 1 1 0; min-width: 0; }
.pp-level-panel-label { font-size: 12px; font-weight: 600; color: var(--pp-text); }
.pp-level-panel output { min-width: 56px; text-align: right; font-size: 12px; color: var(--pp-muted); font-variant-numeric: tabular-nums; }
.practice-player .pp-time { flex: 0 1 148px; min-width: 0; overflow: hidden; height: 44px; line-height: 42px; text-align: center; background: #3a3a3a; border: 1px solid #5a5a5a; border-radius: 8px; color: #dcdcdc; font: 24px/42px ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; }
/* Five buttons and the clock on one row of a portrait phone: the clock's digits shrink before anything wraps. */
@media (max-width: 420px) { .practice-player .pp-time { font-size: 15px; } }
/* The seek bar sits under the pictures: a timeline with a yellow playhead, not a fader. */
.practice-player .pp-seek-row { display: flex; align-items: center; gap: 8px; background: var(--pp-strip-bg); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }
.practice-player .pp-seek-row .pp-fader { flex: 1 1 0; min-width: 0; }
.practice-player #seek { --fader-track: none; }
.practice-player #seek::-webkit-slider-runnable-track { background: #1e1e23; }
.practice-player #seek::-moz-range-track { background: #1e1e23; }
.practice-player #seek::-webkit-slider-thumb { width: 3px; border-radius: 0; background: #ffd400; }
.practice-player #seek::-moz-range-thumb { width: 3px; border-radius: 0; background: #ffd400; }
.practice-player .pp-status:not(:has(:not(:empty))) { display: none; }
/* With its buttons seated in a page header, the transport box keeps only its status lines. */
.practice-player .pp-transport:not(:has(.pp-transport-row)):not(:has(.pp-transport-status :not(:empty))) { display: none; }
.practice-player .pp-transport-status:not(:has(:not(:empty))) { display: none; }
/* The remote app's HorizontalFader (remote_ui/lib/src/horizontal_fader.dart) on a native range
   input, which keeps keyboard, touch and the `input` event. */
.practice-player { --fader-fill: #505055; --fader-handle: #8c8c8c; --fader-highlight: #dcdcdc; --fader-shadow: #505050; }
.practice-player .pp-fader { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 27px; margin: 0; background: none; cursor: pointer; touch-action: pan-y; --pos: 0; --fader-track: linear-gradient(to right, color-mix(in srgb, var(--fader-fill) 70%, transparent) calc(var(--pos) * 100%), #1e1e23 0); }
.practice-player .pp-fader::-webkit-slider-runnable-track { height: 23px; border-radius: 3px; background: var(--fader-track), #1e1e23; }
.practice-player .pp-fader::-moz-range-track { height: 23px; border-radius: 3px; background: var(--fader-track), #1e1e23; }
.practice-player .pp-fader::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 27px; margin-top: -2px; border: 0; border-radius: 2px; background: linear-gradient(var(--fader-highlight), var(--fader-highlight)) top / 100% 3px no-repeat, linear-gradient(var(--fader-shadow), var(--fader-shadow)) bottom / 100% 3px no-repeat, linear-gradient(#282828, #282828) center / 1.5px calc(100% - 8px) no-repeat, var(--fader-handle); }
.practice-player .pp-fader::-moz-range-thumb { width: 14px; height: 27px; border: 0; border-radius: 2px; background: linear-gradient(var(--fader-highlight), var(--fader-highlight)) top / 100% 3px no-repeat, linear-gradient(var(--fader-shadow), var(--fader-shadow)) bottom / 100% 3px no-repeat, linear-gradient(#282828, #282828) center / 1.5px calc(100% - 8px) no-repeat, var(--fader-handle); }
.practice-player button { font: inherit; font-size: 13px; background: var(--pp-strip-bg); color: var(--pp-text); border: 1px solid var(--pp-border); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.practice-player button:hover { border-color: var(--pp-accent); }
/* A text button lit is filled; an icon button never is (a fill in the accent hides an icon drawn in it). */
.practice-player button.on:not(:has(svg)) { background: var(--pp-accent); color: #0b1320; border-color: var(--pp-accent); }
.practice-player .pp-hint { color: var(--pp-muted); font-size: 12px; }
.practice-player .pp-picture { width: 100%; max-height: 40vh; background: #000; border-radius: 8px; display: block; margin-bottom: 12px; object-fit: contain; }
.practice-player .pp-pictures { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.practice-player .pp-strips { display: flex; flex-direction: column; background: var(--pp-strip-bg); border-radius: 8px; padding: 6px 0; }
.practice-player .pp-strips:empty { display: none; }
/* Name and buttons share the top row; the fader takes a full row of its own under them. */
.practice-player .strip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 12px; }
.practice-player .strip-label { flex: 1 1 0; min-width: 0; order: 0; }
.practice-player .strip > .buttons { order: 1; margin-left: auto; }
.practice-player .strip-fader { flex: 1 0 100%; min-width: 0; order: 2; display: flex; flex-direction: column; gap: 3px; }
.practice-player .strip > .error { order: 3; }
.practice-player .buttons button.tabs { width: auto; padding: 0 10px; }
.practice-player .strip.muted .pp-fader { opacity: 0.3; }
.practice-player .name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.practice-player .role { font-size: 11px; color: var(--pp-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.practice-player .meter { height: 4px; background: rgb(0 0 0 / 45%); border-radius: 2px; overflow: hidden; }
.practice-player .meter-fill { height: 100%; width: 0; border-radius: 2px; }
.practice-player .buttons { flex: 0 0 auto; min-width: 72px; display: flex; gap: 4px; }
.practice-player .buttons button { width: 34px; height: 34px; padding: 0; }
.practice-player .mute.on { background: #ff5252; border-color: #ff5252; color: #1a0000; }
.practice-player .solo.on { background: #f5c242; border-color: #f5c242; color: #1a1200; }
.practice-player .error { flex: 1 0 100%; color: #ff7b7b; font-size: 11px; }
.practice-player .pp-record.on .pp-icon-record, .practice-player .pp-record.recording .pp-icon-record { fill: #ff0000; }
.practice-player .pp-transport-buttons .pp-record.recording { border-color: #ff0000; box-shadow: 0 0 0 1px #ff0000; }
.practice-player .pp-transport-buttons .pp-play-held { border-color: #3ddc4a; box-shadow: 0 0 0 1px #3ddc4a; }
.practice-player .pp-record:disabled { opacity: 0.4; cursor: default; }
.practice-player #recordState:not(:empty) { font-variant-numeric: tabular-nums; }
.practice-player #recordState.pp-error { color: #ff7b7b; }
.practice-player #recordState.pp-recording { color: #ff5252; font-weight: 600; }
.practice-player .pp-takes-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 12px; }
.practice-player .pp-camera, .practice-player .pp-take { background: var(--pp-strip-bg); border-radius: 8px; padding: 8px; width: 256px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--pp-border); }
.practice-player .pp-camera video, .practice-player .pp-take video { width: 240px; height: 135px; background: #000; border-radius: 6px; object-fit: cover; display: block; }
.practice-player .pp-camera video { transform: scaleX(-1); }
.practice-player .pp-take.along { border-color: var(--pp-accent); }
.practice-player .pp-tile-label { font-size: 11px; color: var(--pp-muted); }
.practice-player .pp-take-actions { display: flex; gap: 4px; align-items: center; }
.practice-player .pp-take-actions button, .practice-player .pp-take-actions a { padding: 4px 8px; font-size: 12px; }
.practice-player .pp-take-actions a { color: var(--pp-text); text-decoration: none; border: 1px solid var(--pp-border); border-radius: 6px; }
.practice-player .pp-take-actions a:hover { border-color: var(--pp-accent); }
/* The stage: the pack's picture full width, the takes under it in a zoom grid — one take full width, two or
   more all two across at one size (a portrait phone holds a pair). The take has no controls of its own — the transport is the
   only clock; the › tab collapses the takes. */
.practice-player .pp-stage { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.practice-player .pp-pack-stage { width: 100%; min-width: 0; }
.practice-player .pp-stage .pp-picture { margin-bottom: 0; }
.practice-player .pp-take-stage { width: 100%; min-width: 0; display: flex; gap: 4px; align-items: stretch; }
.practice-player .pp-take-stage.collapsed .pp-take-stage-body { display: none; }
.practice-player .pp-take-stage-body { flex: 1 1 0; min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-content: start; }
.practice-player .pp-take-window { min-width: 0; display: flex; flex-direction: column; gap: 4px; grid-column: span 2; }
.practice-player .pp-take-stage-body[data-tiles="1"] .pp-take-window { grid-column: 1 / -1; }
.practice-player .pp-take-window.pp-take-window-centred { grid-column: 2 / span 2; }
.practice-player .pp-take-window video { aspect-ratio: 16 / 9; }
.practice-player .pp-collapse { padding: 4px 6px; font-size: 16px; line-height: 1; min-height: 48px; }
.practice-player .pp-device { font-size: 11px; color: var(--pp-muted); display: flex; gap: 4px; align-items: center; }
.practice-player .pp-device select { font: inherit; font-size: 11px; flex: 1 1 0; min-width: 0; background: #0d0f12; color: var(--pp-text); border: 1px solid var(--pp-border); border-radius: 4px; padding: 2px 4px; }
.practice-player .pp-take { min-width: 256px; width: auto; max-width: 420px; }
.practice-player .pp-tile-status { font-size: 11px; color: var(--pp-muted); }
.practice-player .pp-tile-status.pp-error, .practice-player .pp-tile-label.pp-error { color: #ff7b7b; }
.practice-player .pp-take-actions { flex-wrap: wrap; }
.practice-player #audioHint:empty { display: none; }
.practice-player .pp-take-offset { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--pp-muted); }
.practice-player .pp-take-offset input { flex: 1 1 auto; min-width: 0; accent-color: var(--pp-accent); }
.practice-player .pp-take-offset output { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; color: var(--pp-text); }

/* A take's strip: eye (picture shown), turn, M, X; right-click opens Download and Latency */
.practice-player .strip.take .buttons button svg { display: block; margin: auto; }
.practice-player .strip.take .take-eye { color: var(--pp-muted); }
.practice-player .strip.take .take-eye.on { color: var(--pp-accent); border-color: var(--pp-accent); }
.practice-player .strip.take .take-remove { color: var(--pp-muted); }
.practice-player .strip.take .take-remove:hover { color: #ff5252; }
.practice-player .strip.take .take-remove.armed { color: #fff; background: #d33; border-color: #d33; }
.practice-player .strip.take .role.pp-error { color: #ff5252; }
.practice-player .pp-take-window.hidden { display: none; }
.practice-player .pp-take-window video { object-fit: contain; transition: transform 0.2s; }
/* The camera as the first tile of the takes' grid (outside the duet): the take windows' size, mirrored, filled. */
.practice-player .pp-take-stage-body .pp-camera { width: auto; padding: 0; background: none; border: 0; border-radius: 0; gap: 4px; }
.practice-player .pp-take-stage-body .pp-camera video { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.practice-player { position: relative; }
.practice-player .pp-menu { position: absolute; z-index: 40; min-width: 240px; padding: 4px; background: var(--pp-strip-bg); border: 1px solid var(--pp-border); border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,0.4); }
.practice-player .pp-menu-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; color: var(--pp-text); text-decoration: none; }
.practice-player a.pp-menu-item:hover { background: color-mix(in srgb, var(--pp-accent) 20%, transparent); }
.practice-player .pp-menu-item.disabled { color: var(--pp-muted); pointer-events: none; }
.practice-player .pp-menu-item input { flex: 1; }

/* On a phone the pack picture may take most of the screen's height. */
@media (max-width: 900px), (max-height: 500px) {
  .practice-player .pp-stage .pp-pack-stage .pp-picture { max-height: 75svh; }
}
/* The folded mixer (seated in a page header): the mixer icon beside the seek bar, and the strips' panel it unfolds. */
.practice-player .pp-mixer-toggle, .practice-player .pp-speed { flex: none; width: 44px; height: 32px; padding: 4px 10px; background: #3a3a3a; border: 1px solid #5a5a5a; border-radius: 8px; color: #dcdcdc; }
.practice-player .pp-mixer-toggle svg, .practice-player .pp-speed svg { display: block; width: 100%; height: 100%; }
.practice-player .pp-speed.altered { padding: 4px 0; }
.practice-player .pp-mixer-toggle.on { background: #dcdcdc; border-color: #dcdcdc; color: #1e1e23; }
.practice-player .pp-mix-panel { max-height: min(60dvh, 560px); overflow-y: auto; overscroll-behavior: contain; }
/* The seek bar: a seconds scale drawn in the bar, the yellow playhead over it. The scale is inset by half the
   playhead's width so a tick lines up with the playhead at that second. */
.practice-player .pp-seek-track { position: relative; flex: 1 1 0; min-width: 0; border-radius: 3px; background: #1e1e23; overflow: hidden; }
.practice-player .pp-seek-track #seek { position: relative; z-index: 1; }
.practice-player .pp-seek-track #seek::-webkit-slider-runnable-track { background: transparent; }
.practice-player .pp-seek-track #seek::-moz-range-track { background: transparent; }
.practice-player .pp-timescale { position: absolute; top: 2px; bottom: 2px; left: 1.5px; right: 1.5px; pointer-events: none; }
.practice-player .pp-timescale .tick { position: absolute; bottom: 0; width: 1px; height: 4px; background: #4a4a52; }
.practice-player .pp-timescale .tick.major { height: 9px; background: #6e6e78; }
.practice-player .pp-timescale .tick.major::after { content: attr(data-label); position: absolute; left: 3px; bottom: 7px; font: 9px/1 ui-monospace, Menlo, monospace; color: #8a8a94; white-space: nowrap; }
