/*
 * Player controls and shared channel presentation. Administration adds tools after the scene.
 * The listener hero is a real Web Audio visualiser; a huge LOCAL sound button appears on it only while
 * this device cannot actually play. Both are driven by real engine state, never by optimistic guesses.
 */
.player-panel{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-areas:"cover main" "local local";align-items:center;gap:16px 20px;padding:18px;background:var(--surface);border:0;border-radius:var(--radius);margin-bottom:16px;overflow:hidden}
.cover-block{grid-area:cover;display:flex;flex-direction:column;align-items:center;gap:8px}
.cover-frame{position:relative;width:112px;height:112px;border-radius:12px;overflow:hidden;background:var(--surface-inset);border:0;flex-shrink:0}
#cover{display:block;width:100%;height:100%}
.player-main{grid-area:main;min-width:0}
.player-panel .eyebrow{font-size:11.5px;color:var(--muted-dim);margin-bottom:6px}
.player-panel #playing{font-size:20px;line-height:1.3;overflow-wrap:anywhere;font-weight:600}
.player-panel #detail{font-size:12.5px;margin:6px 0 0;min-height:19px;max-width:64ch}
.player-controls{display:flex;align-items:center;gap:8px;margin-top:12px}
.player-controls .icon-button{width:42px;height:42px;background:var(--surface-2);color:var(--text)}
.player-controls #transport-toggle{width:52px;height:52px;border-radius:50%;border:0;color:var(--accent-ink);background:var(--accent)}
.player-controls #transport-toggle:hover{background:var(--accent-strong)}
.player-controls .icon-button:disabled{opacity:.4}
.seek-line{display:flex;align-items:center;gap:11px;font-size:12px;font-variant-numeric:tabular-nums;color:var(--muted);margin-top:12px}
.seek-line input{min-width:0;flex:1;min-height:24px}
.seek-visual{position:relative;display:flex;align-items:center;flex:1;min-width:0;height:24px;isolation:isolate}
.seek-visual>input,.seek-visual>progress{position:relative;z-index:1;width:100%;margin-inline:0}
.track-waveform{position:absolute;inset:0;width:100%;height:24px;fill:currentColor;opacity:.18;pointer-events:none;user-select:none}
.seek-visual:has(>input:not([hidden]))>.track-waveform{inset-inline:6px;width:calc(100% - 12px)}
.track-waveform[hidden]{display:none}
@media(forced-colors:active){.track-waveform{display:none}}
.seek-line>span{min-width:36px}
.seek-line>span:last-child{text-align:right}
.seek-elapsed{display:grid;align-items:center;justify-items:start;block-size:1.5em;min-block-size:18px;line-height:1.5}
.seek-elapsed>#elapsed,.seek-elapsed>.playback-loading{grid-area:1/1}
.seek-elapsed.is-buffering>#elapsed{animation:playback-elapsed-hide 0s .25s both}
.playback-loading{display:grid;place-items:center;width:18px;height:18px;color:var(--accent-strong);animation:playback-loading-appear 0s .25s both}
.playback-loading[hidden]{display:none}
.playback-loading svg{display:block;width:18px;height:18px;fill:none;animation:playback-loading-spin .85s linear infinite}
@keyframes playback-loading-spin{to{transform:rotate(360deg)}}
@keyframes playback-loading-appear{from{opacity:0}to{opacity:1}}
@keyframes playback-elapsed-hide{from{visibility:visible}to{visibility:hidden}}
@media(prefers-reduced-motion:reduce){.playback-loading svg{animation:none}.seek-elapsed.is-buffering>#elapsed{visibility:hidden}}
.seek-line input:disabled{opacity:1;cursor:default}
.seek-line progress{appearance:none;-webkit-appearance:none;flex:1;min-width:0;width:100%;height:4px;border:0;border-radius:4px;overflow:hidden;background:var(--range-rail,var(--line));color:var(--accent);cursor:default}
.seek-line progress::-webkit-progress-bar{background:var(--range-rail,var(--line));border-radius:4px}
.seek-line progress::-webkit-progress-value{background:var(--accent);border-radius:4px}
.seek-line progress::-moz-progress-bar{background:var(--accent);border-radius:4px}
.local-controls{grid-area:local;display:flex;align-items:center;justify-content:flex-end;gap:16px;flex-wrap:wrap}
.local-sound{color:var(--muted)}
.player-volume{margin:0;display:flex;align-items:center;gap:9px;font-size:11.5px;color:var(--muted-dim);white-space:nowrap}
.player-volume input{width:132px}
.player-panel .progress{position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--line-soft)}
.player-panel .progress div{height:100%;width:0;background:var(--accent);transition:width .2s linear}

/* Big local sound button: only for a device that genuinely cannot play yet. */
.big-play{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;width:100%;height:100%;min-height:0;padding:0;border:0;border-radius:0;background:var(--backdrop);color:var(--accent);backdrop-filter:blur(1px)}
.big-play:hover{background:var(--backdrop-strong);color:var(--accent-strong)}
.big-play .play-icon{width:40%;height:40%;max-width:64px;max-height:64px;fill:currentColor}
.big-play-label{font-size:11.5px;font-weight:600;color:var(--accent-strong)}
.cover-caption{font-size:11px;color:var(--muted-dim);text-align:center}

/* Playlist and library retain their own visibility and content layout. */
.channel-columns{display:grid;grid-template-columns:minmax(0,1fr);gap:24px}
.channel-columns.two-columns{grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));align-items:start}
.channel-columns .panel{min-width:0;padding:20px;margin-bottom:0}
.two-columns .panel{display:flex;flex-direction:column;min-height:0}
.channel-columns .section-head{flex-shrink:0;min-height:44px;margin-bottom:16px}
.channel-columns .section-head h2{font-size:18px;line-height:24px}
.two-columns .schedule-list,.two-columns .library{min-height:120px;padding:0 0 20px;margin:0}
.playlist-heading-copy{min-width:0;display:flex;align-items:center;gap:6px}
.playlist-heading-copy h2{margin:0}
.playlist-panel #queue-summary{margin:0;min-width:0;font-size:11px;line-height:16px;text-align:right}
#transport-repeat{width:44px;height:44px;flex:none;color:var(--muted);background:transparent}
#transport-repeat svg{display:block;fill:none;width:18px;height:18px}
#transport-repeat[aria-pressed=true]{color:var(--accent-text)}
#transport-repeat[aria-pressed=true] svg{stroke-width:2.4}
#transport-repeat:enabled:hover{background:transparent}
@media(hover:hover) and (pointer:fine) and (not (any-pointer:coarse)){
 #transport-repeat[aria-pressed=false]:enabled:hover{color:var(--text)}
}
.channel-columns .library{display:flex;flex-direction:column;gap:2px;margin:0}
.library-panel .section-head{display:block;position:relative}
.library-heading-default{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;opacity:1;transition:opacity .16s ease}
.library-heading-default.is-search-open{visibility:hidden;opacity:0}
.library-heading-title{display:flex;align-items:center;gap:14px;min-width:0;flex:1}
.library-heading-title h2,.library-heading-default .head-actions{flex:none}
.library-search-toggle{position:relative;isolation:isolate;flex:none;width:44px;height:44px;border-radius:999px;background:transparent}
.library-search-toggle::before{content:"";position:absolute;z-index:-1;width:32px;height:32px;left:6px;top:6px;border-radius:999px;background:var(--surface-2)}
.library-search-toggle:enabled:hover{background:transparent}
.library-search-toggle:enabled:hover::before{background:var(--surface-hover)}
.library-search-toggle:focus-visible{outline:none}
.library-search-toggle:focus-visible:not(.pointer-focus)::before{outline:2px solid var(--accent);outline-offset:2px}
.library-search-toggle svg{flex:none;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7}
.library-search-toggle.has-query{flex:0 1 180px;min-width:56px;width:180px;gap:6px;padding:0 10px;justify-content:flex-start;color:var(--text)}
.library-search-toggle.has-query::before{left:0;width:100%}
.library-search-query{display:none;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:400;text-align:left}
.library-search-toggle.has-query .library-search-query{display:block}
.library-search{position:absolute;left:var(--search-left,0px);top:var(--search-top,6px);width:var(--search-width,32px);height:32px;z-index:1;min-width:0;margin:0;border-radius:999px;background:var(--surface-inset);opacity:0;visibility:hidden;pointer-events:none;overflow:hidden;transition:left .22s cubic-bezier(.2,.8,.2,1),top .22s cubic-bezier(.2,.8,.2,1),width .22s cubic-bezier(.2,.8,.2,1),height .22s cubic-bezier(.2,.8,.2,1),opacity .18s ease,visibility 0s .22s}
.section-head[data-search-state=open] .library-search{left:0;top:0;width:100%;height:44px;opacity:1;visibility:visible;pointer-events:auto;transition-delay:0s}
.library-search[hidden]{display:none}
.library-search>svg{position:absolute;left:16px;top:13px;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;color:var(--muted);pointer-events:none}
.library-search input{display:block;width:100%;min-width:0;height:44px;min-height:44px;padding:10px 48px 10px 44px;font-size:16px;line-height:24px;border-radius:999px;background:transparent}
.library-search input::placeholder{color:var(--muted);opacity:1}
.library-search input::-webkit-search-cancel-button{appearance:none}
.library-search input:focus-visible{outline:none}
.section-head[data-search-state=open] .library-search:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:1px}
.library-search .library-search-clear{position:absolute;right:0;top:0;width:44px;height:44px;min-height:44px;padding:0;border:0;background:transparent;color:var(--muted);font-size:22px}
.library-search .library-search-clear{isolation:isolate;border-radius:50%}
.library-search-clear svg,.queue-remove svg{display:block;flex:none;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.library-search-clear::before{content:"";position:absolute;inset:6px;z-index:-1;border-radius:50%}
.library-search .library-search-clear:hover{color:var(--text);background:transparent}
.library-search-clear:hover::before{background:var(--surface-2)}
@media(prefers-reduced-motion:reduce){.library-search,.library-heading-default{transition:none}}
.library-search-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.library-track .library-delete{flex-shrink:0;width:44px;height:44px;min-height:44px;color:var(--muted);padding:12px}
.library-track .library-delete svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.library-track .library-delete:hover{color:var(--danger);background:transparent}
.library-delete-name{font-weight:600;overflow-wrap:anywhere;margin:0 0 12px}
.library-delete-dialog .sheet-actions{justify-content:flex-end;margin-top:18px}
#library-delete-error:empty{display:none}

/* queue rows */
.queue-row{position:relative;display:flex;align-items:center;gap:6px;min-height:64px;padding:8px 6px;margin:0 0 2px;border:0;border-radius:10px;background:transparent;isolation:isolate}
.queue-row,.library-track{-webkit-tap-highlight-color:transparent}
.queue-title{position:relative;min-width:0;flex:1}
.queue-title strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;line-height:20px;font-weight:500}
.queue-metadata{display:flex;align-items:center;gap:12px;min-height:18px;margin-top:3px}
.queue-time{white-space:nowrap;flex:none;font-size:11px;line-height:18px;font-variant-numeric:tabular-nums;color:var(--muted);text-align:left}
.row-play{position:relative;flex:none;width:44px;height:44px;min-height:44px;font-size:12px;font-variant-numeric:tabular-nums;color:var(--muted)}
.row-play:disabled{opacity:1}
.row-play:enabled:is(:hover,:focus-visible){color:transparent}
.row-play:enabled:is(:hover,:focus-visible)::after{content:"▶";position:absolute;color:var(--text);font-size:14px}
.drag-handle{flex:none;width:22px;height:44px;min-height:44px;font-size:18px;color:var(--muted);cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
.drag-handle:active{cursor:grabbing}
.queue-remove{flex:none;width:44px;height:44px;min-height:44px;font-size:20px;font-weight:400;color:var(--muted)}
.queue-remove:hover{color:var(--danger);background:transparent}
.queue-add{flex:none;width:44px;height:44px;font-size:23px;font-weight:400;color:var(--accent-text)}
.channel-columns :is(.queue-remove,.queue-add,.library-delete){position:relative;isolation:isolate}
.channel-columns :is(.queue-remove,.queue-add,.library-delete)::before{content:"";position:absolute;inset:6px;z-index:-1;border-radius:50%}
.channel-columns .queue-add:enabled:hover{background:transparent}
.channel-columns .queue-add:enabled:hover::before{background:var(--surface-hover)}
.channel-columns :is(.queue-remove,.library-delete):enabled:hover::before{background:var(--danger-bg)}
/* Every row keeps the same metadata slot as it becomes current. */
.row-progress{flex:1;min-width:12px;max-width:160px;height:3px;border-radius:999px;overflow:hidden;background:var(--line-soft);visibility:hidden}
.queue-row.is-current .row-progress{visibility:visible}
.row-progress-fill{height:100%;width:0;background:var(--secondary-line);transition:width .2s linear}
.queue-row.is-current{background:var(--surface-active);border-color:var(--accent-line);box-shadow:inset 3px 0 var(--accent)}
.queue-row.is-current .queue-title strong{color:var(--text);font-weight:600}
.queue-row.is-current .queue-time,.queue-row.is-current .row-play{color:var(--accent)}
.queue-row.is-current .row-progress-fill{background:var(--accent)}
.queue-row.is-paused .row-progress-fill{background:var(--paused)}
.queue-row.is-played .queue-title{color:var(--muted)}
.library-track{flex-shrink:0;min-height:64px;padding:8px 6px;gap:6px;background:transparent;border:0;border-radius:10px}
.library-title{min-width:0;flex:1}
.library-title .track-name{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:14px;line-height:20px;font-weight:500}
.library-title .track-info{font-size:11px;line-height:18px;margin-top:3px;color:var(--muted);font-variant-numeric:tabular-nums}
@media(hover:hover) and (pointer:fine) and (not (any-pointer:coarse)){
 .queue-row:not(.is-current):hover{background:var(--surface-hover)}
 .channel-columns :is(.drag-handle,.queue-remove,.queue-add,.library-delete){opacity:0;pointer-events:none}
 .channel-columns :is(.queue-row,.library-track):is(:hover,:focus-within) :is(.drag-handle,.queue-remove,.queue-add,.library-delete){opacity:1;pointer-events:auto}
}
.queue-empty{border:0;border-radius:var(--radius-sm);min-height:130px;display:flex;align-items:center;justify-content:center;text-align:center;font-size:12.5px;line-height:1.65;color:var(--muted);padding:22px;margin:0}

/* Drag surfaces: an unchanged-size preview, an empty slot and a highlighted valid destination.
   Sortable owns the preview's inline width, height and translation. Do not constrain or scale it. */
.role-admin .queue-row,.role-admin .library-track{cursor:grab}
.sortable-chosen,.sortable-drag{cursor:grabbing}
.sortable-ghost:not(.sortable-fallback){position:relative;opacity:1!important;background:var(--drop-ghost-bg)!important;border:1px dashed var(--drop-line)!important;border-radius:var(--radius-sm);box-shadow:none!important}
/* Keep the original geometry, but render no title, controls, timer or progress in the slot. */
.sortable-ghost:not(.sortable-fallback) *{visibility:hidden!important}
.sortable-ghost:not(.sortable-fallback)::before,.sortable-ghost:not(.sortable-fallback)::after{content:none!important}
.sortable-fallback{position:fixed;z-index:10000;pointer-events:none;opacity:.97;max-width:none;max-height:none;flex-shrink:0;box-shadow:0 12px 30px #0007;border-color:var(--secondary);background:var(--surface-2);overflow:visible}
.sortable-fallback::before,.sortable-fallback::after{content:none}
/* Highlight only the actual sortable list, not the player, library or a non-droppable header. */
.schedule-list.dnd-target-available{border-radius:var(--radius-sm);background:var(--drop-available-bg);box-shadow:inset 0 0 0 1px var(--drop-available-line);transition:background .12s ease,box-shadow .12s ease}
.schedule-list.dnd-target-over{background:var(--drop-over-bg);box-shadow:inset 0 0 0 1px var(--drop-over-line)}
.role-admin .drag-handle{cursor:grab}
.queue-row.is-pending{opacity:.72;border-style:dashed}
.queue-row.is-picked{outline:2px solid var(--accent);outline-offset:1px}
#action-status{margin:8px 0 0;flex-shrink:0}
#action-status:empty{display:none}
.track-upload-feedback{display:grid;min-width:0;margin:12px 0 16px;border-radius:var(--radius-sm);background:var(--surface-2);font-size:13px;line-height:18px}
/* An idle upload area must not reserve height or margins above either list. */
.track-upload-feedback:not(:has(> :not([hidden]))){display:none}
.track-upload-feedback[aria-busy="true"]{position:sticky;top:max(8px,var(--safe-area-top));z-index:3}
.track-upload-progress,.track-upload-result{min-width:0;padding:12px 14px}
.track-upload-progress[hidden],.track-upload-result[hidden]{display:none!important}
.track-upload-progress{display:grid;gap:8px}
.track-upload-heading{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 12px;min-width:0}
.track-upload-heading strong{min-width:0;font-size:13px;font-weight:600;color:var(--text)}
.track-upload-count{flex:none;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.track-upload-now{display:flex;align-items:baseline;gap:6px;min-width:0;color:var(--text)}
.track-upload-file-label{flex:none;font-size:12px;color:var(--muted);white-space:nowrap}
.track-upload-file-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.track-upload-state{display:flex;align-items:flex-start;gap:12px;min-width:0;min-height:18px;color:var(--muted);font-size:12px;line-height:18px}
.track-upload-stage{flex:1;min-width:0;overflow-wrap:anywhere;white-space:normal}
.track-upload-percent{flex:none;min-width:3ch;text-align:right;font-variant-numeric:tabular-nums}
.track-upload-progress progress{display:block;appearance:none;width:100%;height:6px;overflow:hidden;border:0;border-radius:999px;background:var(--bg);color:var(--accent);accent-color:var(--accent)}
.track-upload-progress progress::-webkit-progress-bar{background:var(--bg);border-radius:999px}
.track-upload-progress progress::-webkit-progress-value{background:var(--accent);border-radius:999px}
.track-upload-progress progress::-moz-progress-bar{background:var(--accent);border-radius:999px}
.track-upload-progress progress:indeterminate{background:linear-gradient(90deg,var(--bg) 0 25%,var(--accent) 45% 55%,var(--bg) 75% 100%);background-size:200% 100%;animation:track-upload-wait 1.4s linear infinite}
.track-upload-progress progress:indeterminate::-webkit-progress-bar{background:transparent}
/* Overall batch progress: one compact segmented bar of confirmed outcomes, never bytes. */
.track-upload-batch{display:grid;gap:5px;min-width:0}
.track-upload-batch[hidden]{display:none}
.track-upload-batch-label{font-size:12px;color:var(--muted)}
.track-upload-batch-bar{display:flex;min-width:0;height:10px;overflow:hidden;border-radius:999px;background:var(--bg)}
.track-upload-batch-segment{display:block;min-width:0;height:100%}
.track-upload-batch-segment[data-segment="uploaded"]{background:var(--accent)}
.track-upload-batch-segment[data-segment="skipped"]{background:var(--muted-dim,var(--muted))}
.track-upload-batch-segment[data-segment="failed"]{background:var(--danger)}
.track-upload-batch-segment[data-segment="uncertain"]{background:var(--warning)}
.track-upload-batch-segment[data-segment="remaining"]{background:transparent;box-shadow:inset 0 0 0 1px var(--line-soft)}
.track-upload-batch-legend{display:flex;flex-wrap:wrap;gap:4px 12px;min-width:0;font-size:12px;color:var(--muted)}
.track-upload-batch-legend>span{display:inline-flex;align-items:baseline;gap:5px;min-width:0;overflow-wrap:anywhere}
.track-upload-batch-legend>span::before{content:"";align-self:center;width:9px;height:9px;border-radius:3px;background:var(--bg);box-shadow:inset 0 0 0 1px var(--line-soft)}
.track-upload-batch-legend>span[data-segment="uploaded"]::before{background:var(--accent);box-shadow:none}
.track-upload-batch-legend>span[data-segment="skipped"]::before{background:var(--muted-dim,var(--muted));box-shadow:none}
.track-upload-batch-legend>span[data-segment="failed"]::before{background:var(--danger);box-shadow:none}
.track-upload-batch-legend>span[data-segment="uncertain"]::before{background:var(--warning);box-shadow:none}
#playlist-upload-status,#upload-status{margin:0;white-space:normal;overflow-wrap:anywhere;line-height:18px}
.track-upload-result{display:grid;gap:12px}
.track-upload-result[data-live="true"]{padding-top:0}
.track-upload-result-heading{display:flex;align-items:center;gap:12px;min-width:0}
.track-upload-outcome{display:grid;gap:6px;flex:1;min-width:0}
.track-upload-result-title{font-size:13px;font-weight:600;color:var(--text)}
.track-upload-stats{display:flex;flex-wrap:wrap;gap:4px 14px}
.track-upload-stat{display:inline-flex;gap:5px;align-items:baseline;font-size:12px;color:var(--muted)}
.track-upload-stat:only-child{font-size:13px;color:var(--text)}
.track-upload-stat[data-outcome="uploaded"],.track-upload-stat[data-outcome="queued"]{color:var(--text)}
.track-upload-dismiss{flex:none;width:44px;height:44px;font-size:22px;font-weight:400;margin:-6px -6px -6px 0}
.track-upload-stat[data-outcome="uncertain"]::before,.track-upload-stat[data-outcome="playlist-uncertain"]::before{content:"?";font-weight:700;color:var(--text)}
.track-upload-stat[data-outcome="failed"]::before{content:"!";font-weight:700;color:var(--text)}
/* Problems remain available until explicitly dismissed; only successful results expire. */
.track-upload-issues{min-width:0;font-size:12px}
.track-upload-issues>summary{min-height:44px;display:list-item;align-content:center;cursor:pointer;color:var(--text);padding:10px 0;overflow-wrap:anywhere}
.track-upload-issues>summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:4px}
.track-upload-issue-list{list-style:none;margin:0;padding:0;display:grid;gap:14px}
.track-upload-issue{min-width:0;display:grid;gap:4px}
.track-upload-issue-name{display:block;font-size:12px;font-weight:600;overflow-wrap:anywhere;word-break:normal;color:var(--text)}
.track-upload-issue-message{margin:0;color:var(--muted);line-height:18px;overflow-wrap:anywhere}
.track-upload-issue-names{margin:0;color:var(--muted);line-height:18px;overflow-wrap:anywhere}
@keyframes track-upload-wait{to{background-position:-200% 0}}
@media(prefers-reduced-motion:reduce){.track-upload-progress progress:indeterminate{animation:none}}
@media(forced-colors:active){.track-upload-progress progress{appearance:auto}.track-upload-stat{outline:1px solid CanvasText}.track-upload-batch-segment[data-segment="remaining"]{box-shadow:inset 0 0 0 1px CanvasText}.track-upload-batch-legend>span::before{box-shadow:inset 0 0 0 1px CanvasText}}
.channel-columns .panel{position:relative}
.channel-columns .file-drop-ready{box-shadow:inset 0 0 0 2px var(--drop-available-line)}
.channel-columns .file-drop-active{background:var(--drop-over-bg);box-shadow:inset 0 0 0 2px var(--drop-line)}
.file-drop-active>.section-head,.file-drop-active>.playlist-caption{visibility:hidden}
.file-drop-active::after{content:attr(data-file-drop-label);position:absolute;z-index:5;top:12px;left:12px;right:12px;display:block;padding:14px 16px;border-radius:var(--radius-sm);background:var(--accent);color:var(--accent-ink);font-size:14px;font-weight:600;text-align:center;pointer-events:none;box-shadow:0 6px 22px #0002}
@media(forced-colors:active){.channel-columns .file-drop-ready{outline:2px dashed Highlight}.channel-columns .file-drop-active{outline-style:solid}}
.channel-columns .schedule-list:focus-within{outline:none}

@media(max-width:720px){
  .player-panel{padding:16px}
  .player-panel #playing{font-size:18px}
  .player-controls .icon-button{width:40px;height:40px}
  .player-controls #transport-toggle{width:48px;height:48px}
  .player-volume input{width:110px}
  .local-controls{gap:12px}
  .queue-row,.library-track{gap:4px;padding:8px 0}
  .queue-title strong,.library-title .track-name{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
  .queue-metadata{gap:8px}
}
@media(hover:none),(pointer:coarse){
  /* Touch drags start only on the handle, so the handle gets a real finger-sized hit area. Row height,
     row content and the number of controls stay exactly as they are: nothing else grows. */
  .drag-handle{width:40px;min-width:40px;height:44px}
}
@media(prefers-reduced-motion:reduce){
  .row-progress-fill{transition:none}
  .sortable-fallback{transform:none}
  .sortable-ghost{transition:none}
}

/* Role controls are additive; the channel scene has one shared layout below. */
.listener-only{display:none}
.role-listener .listener-only{display:flex}
.channel-settings-button{width:44px;height:44px;min-height:44px}
.channel-settings-button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.menu-home{padding:10px 11px;color:var(--muted);text-decoration:none;font-size:13px;min-height:40px;align-items:center;border-radius:8px}
.menu-home:hover{background:var(--surface-hover);color:var(--text)}
#device-volume-slot{flex:1;min-width:0}
#device-volume-slot .player-volume{display:flex;width:100%;margin:0}
#device-volume-slot .player-volume input{width:100%;min-width:0;min-height:44px;margin:0}
#device-connection-slot{margin:8px 0 12px}
/* Individual playlist/library hidden flags preserve the shared channel controls. */

/* QR v10: the QR is the artwork; local Play/Pause occupies its small centre. */
.qr-frame{--qr-center:18%;isolation:isolate}
.qr-frame.has-qr{width:252px;height:252px;border:0;background:transparent;overflow:visible;border-radius:0;box-shadow:none}
.channel-qr{position:relative;z-index:1;width:100%;height:100%;line-height:0;pointer-events:none}
.channel-qr>svg{display:block;width:100%;height:100%;filter:drop-shadow(0 12px 30px #0002)}
.qr-frame #cover{position:absolute;inset:-26px;width:calc(100% + 52px);height:calc(100% + 52px);z-index:0;opacity:.3;pointer-events:none}
body .qr-frame .qr-center,body.role-listener .qr-frame .qr-center{position:absolute;z-index:2;inset:auto;left:50%;top:50%;transform:translate(-50%,-50%);display:grid;place-items:center;width:var(--qr-center);height:var(--qr-center);min-width:44px;min-height:44px;max-width:none;max-height:none;aspect-ratio:1;padding:0;margin:0;border:0;border-radius:50%;background:var(--accent);color:var(--accent-ink);box-shadow:none;backdrop-filter:none}
body .qr-frame .qr-center:not(.qr-rest){cursor:pointer;touch-action:manipulation;transition:background .15s ease}
body .qr-frame .qr-center:hover,body.role-listener .qr-frame .qr-center:hover{background:var(--accent-strong);color:var(--accent-ink)}
body .qr-frame .qr-center:focus-visible{outline:2px solid var(--accent-ink);outline-offset:2px}
body .qr-frame .qr-center svg,body.role-listener .qr-frame .qr-center svg{width:54%;height:54%;max-width:none;max-height:none;margin:0;fill:currentColor}
body .qr-frame .big-play .play-icon,body.role-listener .qr-frame .big-play .play-icon{margin-left:6%}
body .qr-frame .qr-rest,body.role-listener .qr-frame .qr-rest{min-width:0;min-height:0;pointer-events:none}
.qr-frame.has-channel-logo #qr-rest,.qr-frame.qr-no-center #qr-rest{display:none!important}
.qr-sound-controls{display:flex;align-items:center;justify-content:center;gap:8px;width:192px;max-width:100%;margin-top:12px;min-height:44px}
.local-sound-toggle{flex:0 0 44px;min-height:44px}
/* Buffering can hide the sound buttons, but must not recenter the title and QR. */
body .qr-sound-controls .local-sound-button{display:inline-flex;align-items:center;justify-content:center;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;border-radius:50%}
body .qr-sound-controls .local-sound-button[hidden]{display:none}
body .qr-sound-controls .local-sound-button svg{width:20px;height:20px;flex-shrink:0}
.channel-address-preview{overflow-wrap:anywhere}
.migration-notice{position:fixed;z-index:100;left:calc(16px + var(--safe-area-left));right:calc(16px + var(--safe-area-right));bottom:calc(16px + var(--safe-area-bottom));max-width:620px;margin:0 auto;padding:14px 18px;border-radius:14px;background:var(--surface);color:var(--text);box-shadow:0 4px 24px #0005}
.qr-frame .big-play-label{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
body .qr-frame .qr-center[hidden],body.role-listener .qr-frame .qr-center[hidden]{display:none}
.qr-caption{max-width:30ch;font-size:11.5px;line-height:1.5;text-align:center;color:var(--muted);margin:10px 0 0}
.qr-channel-label{display:none}
.qr-playback-hint{font-size:13px;line-height:1.5;color:var(--accent);margin:12px 0 0}
@media(prefers-reduced-motion:reduce){.qr-frame .qr-center{transition:none!important}}

/* Channel watch page: player, track title, publisher identity, sharing, then playlist. */
body.channel-minimal>main{max-width:1600px;padding:calc(12px + var(--safe-area-top)) calc(24px + var(--safe-area-right)) calc(32px + var(--safe-area-bottom)) calc(24px + var(--safe-area-left))}
body.channel-minimal .topbar{min-height:44px;height:44px;margin-bottom:16px}
body.channel-minimal #channel{display:grid;grid-template-columns:minmax(0,1fr);align-items:start;gap:24px;min-height:0}
.channel-main,.channel-stage,.channel-library-sidebar{min-width:0}
.channel-stage{display:block;position:relative}
/* A fixed-width readout belongs to the existing controls, without adding a footer. */
.sync-accuracy{display:flex;align-items:center;flex:0 0 72px;inline-size:72px;block-size:44px;margin:0 0 0 auto}
.sync-accuracy[hidden]{display:none}
.stem-selection{display:flex;align-items:center;flex:none;min-width:0}
.stem-selection[hidden]{display:none}
.stem-selection .stem-selection-trigger{display:flex;align-items:center;justify-content:center;gap:4px;min-width:70px;min-height:44px;padding:0 6px;border:0;border-radius:6px;background:transparent;color:inherit;font-size:12px;line-height:18px;white-space:nowrap}
.stem-selection-indicator{flex:none;width:4px;height:4px;border-radius:50%;background:currentColor;opacity:0}
.stem-selection-trigger[data-pending] .stem-selection-indicator{opacity:.65}
.stem-selection-trigger[data-error] .stem-selection-indicator{opacity:1}
.stem-selection-trigger[aria-expanded=true]{background:var(--surface-2)}
.stem-selection-popover{box-sizing:border-box;width:min(280px,calc(100vw - 24px));max-height:min(440px,var(--radix-popover-content-available-height));overflow-y:auto;overscroll-behavior:contain;padding:12px;background:var(--surface-2);color:var(--text);border-radius:12px;box-shadow:0 10px 32px #0005;font-size:13px;line-height:1.5}
.stem-selection-popover .stem-selection-heading{margin:0;font-weight:650;font-size:14px}
.stem-selection-popover .stem-selection-scope{margin:2px 0 8px;color:var(--muted);font-size:12px}
.stem-selection-option{display:flex;align-items:center;gap:10px;min-height:44px;margin:0;padding:4px 6px;border-radius:6px;cursor:pointer}
.stem-selection-option:hover{background:var(--surface-inset)}
.stem-selection-option:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:-2px}
.stem-selection-option input{flex:none;width:18px;height:18px;min-height:18px;margin:0;padding:0;accent-color:var(--accent);cursor:pointer}
.stem-selection-option>span{min-width:0;overflow-wrap:anywhere}
.stem-selection-all{margin-bottom:4px;border-bottom:1px solid var(--line);border-radius:0;font-weight:650}
.stem-selection-popover .stem-selection-status{min-height:18px;margin:8px 0 0;color:var(--muted);font-size:12px}
.stem-selection-popover .stem-selection-retry{min-height:44px;margin-top:4px}
/* Preserve transport and volume targets on narrow stem tracks; reuse the progress row's end. */
@media(max-width:600px){
 body.channel-minimal.role-admin .channel-transport:has(.stem-selection:not([hidden])) .sync-accuracy{position:absolute;right:0;bottom:100%;block-size:24px}
 body.channel-minimal.role-admin .channel-transport:has(.stem-selection:not([hidden])) .sync-accuracy-trigger{block-size:24px;min-height:24px}
 body.channel-minimal.role-admin .channel-transport:has(.stem-selection:not([hidden])) .seek-line{padding-right:80px}
}
.sync-accuracy .sync-accuracy-trigger{display:block;inline-size:72px;block-size:44px;min-height:44px;max-width:100%;padding:3px 0;background:transparent;border:0;border-radius:4px;color:var(--muted);font-size:11px;line-height:18px;font-weight:400;text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;cursor:pointer}
.sync-accuracy-trigger>span{display:block;overflow:hidden;text-overflow:ellipsis}
.sync-accuracy .sync-accuracy-trigger:hover{background:transparent}
.sync-accuracy .sync-accuracy-trigger:focus-visible{outline:1px solid currentColor;outline-offset:1px;background:transparent}
.channel-stage:has(> :is(.channel-video,.channel-banner-frame):not([hidden])) .sync-accuracy-trigger{color:#ffffffc7;text-shadow:0 1px 3px #000,0 0 5px #000}
.channel-stage:has(> :is(.channel-video,.channel-banner-frame):not([hidden])) .sync-accuracy-trigger:hover{color:#fff}
.sync-accuracy-popover{box-sizing:border-box;width:min(360px,calc(100vw - 24px));max-height:var(--radix-popover-content-available-height);overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:14px;background:var(--surface-2);color:var(--text);border-radius:12px;box-shadow:0 10px 32px #0005;font-size:12px;line-height:1.5}
.sync-accuracy-popover .sync-accuracy-heading{margin:0 0 4px;font-size:13px;font-weight:650}
.sync-accuracy-summary{display:grid;grid-template-columns:minmax(0,1fr) 16px minmax(0,1fr);align-items:center;block-size:28px;font-size:18px;font-weight:650;font-variant-numeric:tabular-nums}
.sync-accuracy-summary>span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sync-accuracy-summary>b{font-weight:400;color:var(--muted);text-align:center}
.sync-accuracy-summary>.sync-accuracy-distance{text-align:right}
.sync-accuracy-popover .sync-accuracy-explanation{margin:0 0 8px;font-size:11px;line-height:16px;min-height:16px}
.sync-accuracy-values{margin:0;font-variant-numeric:tabular-nums}
.sync-accuracy-values>div{display:grid;grid-template-columns:minmax(0,1fr) 126px;align-items:center;gap:8px;block-size:24px}
.sync-accuracy-values dt{min-width:0;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sync-accuracy-values dd{min-width:0;margin:0;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sync-accuracy-popover .sync-accuracy-status{margin:4px 0 10px;color:var(--muted);font-size:11px;line-height:16px;block-size:32px;white-space:nowrap}
.sync-accuracy-popover .sync-accuracy-detail{color:var(--muted);font-size:11px}
.sync-accuracy-detail dt{font-weight:400}
.sync-belief{margin-top:8px;border-top:1px solid var(--line)}
.sync-belief-switch{display:flex;gap:12px;min-width:0;height:44px;align-items:stretch}
.sync-belief-switch button{flex:0 1 auto;min-width:0;min-height:44px;margin:0;padding:0;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--muted);font:inherit;font-size:11px;white-space:nowrap}
.sync-belief-switch button[aria-pressed=true]{color:var(--text);border-bottom-color:var(--accent)}
.sync-belief-switch button:hover{background:transparent;color:var(--text)}
.sync-belief-switch button:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.sync-belief-chart{position:relative;height:114px;margin:2px 0 4px;color:var(--accent-text);overflow:hidden}
.sync-belief-chart svg{display:block;width:100%;height:114px;overflow:visible}
.sync-belief-chart text{fill:var(--muted);font:10px sans-serif;font-variant-numeric:tabular-nums}
.sync-belief-axis{stroke:var(--line);stroke-width:1}
.sync-belief-window{fill:var(--accent);opacity:.09}
.sync-belief-zero{stroke:var(--muted);stroke-width:1;stroke-dasharray:3 3;opacity:.65}
.sync-belief-area{fill:currentColor;opacity:.12}
.sync-belief-line{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round}
.sync-belief-unavailable{position:absolute;inset:0 0 20px;display:grid;place-content:center;background:var(--surface-2);color:var(--muted);font-size:11px}
.sync-belief-values>div{grid-template-columns:minmax(0,1fr) minmax(145px,1fr);font-size:11px}
.sync-belief-values dt{font-weight:400}
.sync-belief-values dd{font-weight:600}
.sync-accuracy-popover .sync-belief-note{margin:4px 0 0;height:18px;line-height:18px;font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sync-accuracy-popover .sync-belief-window-note{margin:0;height:16px;line-height:16px;font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sync-accuracy-more{margin-top:4px}
.sync-accuracy-more>summary{min-height:36px;display:flex;align-items:center;gap:6px;font-size:11px;color:var(--muted);cursor:pointer;list-style:none}
.sync-accuracy-more>summary::-webkit-details-marker{display:none}
.sync-accuracy-more>summary::before{content:'';width:5px;height:5px;border-right:1px solid currentColor;border-top:1px solid currentColor;transform:rotate(45deg);margin-right:3px}
.sync-accuracy-more[open]>summary::before{transform:rotate(135deg)}
.sync-accuracy-more>summary:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;border-radius:4px}
.sync-accuracy-popover .sync-accuracy-subheading{margin:8px 0 4px;font-size:11px;font-weight:650}
.sync-belief-detail{font-size:11px;color:var(--muted)}
.sync-belief-detail>div{grid-template-columns:minmax(0,1fr) 126px}
.sync-belief-detail>div:nth-child(4){grid-template-columns:minmax(0,1fr) 164px}
.sync-belief-detail dt{font-weight:400}
body.channel-minimal .channel-library-sidebar{display:block}
.qr-stage{display:contents}
body.channel-minimal .player-panel{display:contents}
body.channel-minimal .channel-head{grid-area:header;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;align-self:center;justify-content:space-between;gap:14px 24px;min-width:0;margin:0}
body.channel-minimal .channel-transport .player-main{min-width:0;width:100%;margin:2px 0}
body.channel-minimal .channel-transport #playing{font-size:18px;line-height:1.35;font-weight:600;letter-spacing:-.015em;color:var(--text);min-height:0;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.channel-minimal .channel-publisher{flex:1 1 220px;min-width:0}
body.channel-minimal .channel-identity{min-width:0}
body.channel-minimal .channel-title{display:block;min-width:0}
body.channel-minimal #channel-name{font-size:20px;font-weight:650;line-height:1.3;letter-spacing:-.015em;padding:0;overflow-wrap:anywhere}
body.channel-minimal .channel-name-line{justify-content:flex-start}
body.channel-minimal .channel-sub{display:none}
body.channel-minimal .channel-actions{display:flex;flex:0 1 auto;flex-wrap:wrap;align-items:center;width:auto;max-width:100%;gap:6px;justify-content:flex-start}
body.channel-minimal .channel-actions button{flex:none;min-width:44px;height:44px}
body.channel-minimal .channel-actions button svg{width:20px;height:20px;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
body.channel-minimal .channel-actions .channel-settings-button{padding:0}
/* Both labels occupy one cell so subscribing does not shift adjacent actions. */
body.channel-minimal #subscription-toggle{display:inline-grid;place-items:center;flex:none;min-height:44px;inline-size:auto;white-space:nowrap;background:var(--text);color:var(--bg);font-weight:650}
body.channel-minimal #subscription-toggle>span{grid-area:1/1}
body.channel-minimal #subscription-toggle>span[aria-hidden=true]{visibility:hidden}
body.channel-minimal #listener-link{width:44px;height:44px;padding:0}
body.channel-minimal #listener-link>span,body.channel-minimal .people-label{display:none}
body.channel-minimal #people-button{width:auto;min-width:64px;gap:6px;padding-inline:10px}
body.channel-minimal #listen-count{min-width:1ch;font-variant-numeric:tabular-nums}
body.channel-minimal .channel-transport{width:100%;margin:0;padding:2px 8px 4px;border:0;border-radius:0 0 12px 12px;background:var(--surface-inset)}
body.channel-minimal .channel-transport .seek-line{height:24px;margin:0;font-size:11px}
body.channel-minimal .channel-transport .transport-actions{position:relative;display:flex;align-items:center;gap:8px;margin:0}
body.channel-minimal .channel-transport .player-controls{flex:none;justify-content:flex-start;gap:2px;margin:0}
body.channel-minimal .channel-transport .player-controls .icon-button{width:44px;height:44px;min-width:44px;min-height:44px;background:transparent;color:var(--text)}
body.channel-minimal .channel-transport #transport-toggle{width:44px;height:44px;border-radius:6px;background:transparent;color:var(--text)}
body.channel-minimal .channel-transport .qr-sound-controls{flex:0 1 120px;width:auto;min-width:88px;margin:0;gap:4px}
body.channel-minimal .channel-transport #device-volume-slot{flex:0 1 72px;width:72px;min-width:44px}
body.channel-minimal .channel-transport .local-sound-button{background:transparent;color:var(--text)}
body.channel-minimal .channel-transport button:hover{background:var(--surface-2)}
body.channel-minimal .channel-transport input[type=range]{appearance:none;-webkit-appearance:none;background:transparent;color:var(--accent)}
body.channel-minimal .channel-transport input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:4px;background:var(--range-rail,var(--line))}
body.channel-minimal .channel-transport input[type=range]::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:12px;height:12px;margin-top:-4px;border:0;border-radius:50%;background:var(--accent)}
body.channel-minimal .channel-transport input[type=range]::-moz-range-track{height:4px;border-radius:4px;background:var(--range-rail,var(--line))}
body.channel-minimal .channel-transport input[type=range]::-moz-range-thumb{width:12px;height:12px;border:0;border-radius:50%;background:var(--accent)}
body.channel-minimal #columns{width:100%;margin:20px 0 0;display:grid;grid-template-columns:192px minmax(0,1fr);grid-template-areas:"cover header" "playlist playlist";align-items:start;gap:20px 20px}
body.channel-minimal #playlist-panel{grid-area:playlist;margin-top:8px}
body.channel-minimal .channel-columns .panel{min-width:0;padding:16px 0 0;border:0;border-top:1px solid var(--line-soft);border-radius:0;background:transparent}
body.channel-minimal .channel-columns .section-head{margin-bottom:8px;gap:8px}
body.channel-minimal .channel-columns .section-head h2{font-size:16px}
body.channel-minimal .channel-columns :is(.schedule-list,.library){min-height:0;padding:0;scrollbar-gutter:auto}
body.channel-minimal .cover-block{grid-area:cover;display:flex;flex-direction:column;align-items:flex-start;width:192px;max-width:100%;gap:0;margin:0;padding:0}
/* The same logo QR stays a compact sharing object beneath the player. */
body.channel-minimal .qr-frame.has-qr{width:192px;height:192px;max-width:100%;aspect-ratio:1;margin:0}
body.channel-minimal .qr-caption{width:auto;max-width:none;margin:6px 0 0;font-size:12px;line-height:18px;text-align:start;overflow-wrap:anywhere}
body.channel-minimal :is(#cover-caption,#detail,#qr-channel-label,.player-panel>.progress){display:none}
@media(min-width:1100px){
 body.channel-minimal.role-admin #channel{grid-template-columns:minmax(0,1fr) 320px}
 body.channel-minimal .channel-library-sidebar{position:sticky;top:calc(16px + var(--safe-area-top));padding-left:20px;border-left:1px solid var(--line-soft)}
 body.channel-minimal .channel-library-sidebar #library-panel{display:flex;flex-direction:column;max-height:calc(100svh - 96px - var(--safe-area-top) - var(--safe-area-bottom));min-height:0;padding:0;border:0;border-radius:0}
 body.channel-minimal .channel-library-sidebar .library{min-height:0;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable}
 body.channel-minimal .channel-library-sidebar .section-head,body.channel-minimal .channel-library-sidebar .track-upload-feedback{flex-shrink:0}
}
@media(max-width:720px),(max-height:500px){
 body.channel-minimal>main{padding:calc(8px + var(--safe-area-top)) calc(16px + var(--safe-area-right)) calc(24px + var(--safe-area-bottom)) calc(16px + var(--safe-area-left))}
 body.channel-minimal .topbar{margin-bottom:8px}
}
@media(max-width:720px){
 body.channel-minimal #columns{grid-template-columns:minmax(0,1fr);grid-template-areas:"cover" "header" "playlist";gap:16px}
 body.channel-minimal .cover-block{width:clamp(220px,64vw,280px);justify-self:center;align-items:center}
 body.channel-minimal .qr-frame.has-qr{width:100%;height:auto;aspect-ratio:1}
 body.channel-minimal .qr-caption{text-align:center}
 body.channel-minimal .channel-head{flex-direction:column;gap:14px;width:100%}
 body.channel-minimal .channel-publisher{flex:none;width:100%;text-align:center}
 body.channel-minimal .channel-identity{justify-content:center}
 body.channel-minimal .channel-name-line{justify-content:center}
 body.channel-minimal #channel-name{font-size:20px}
 body.channel-minimal .channel-actions{gap:4px;justify-content:center}
 body.channel-minimal #subscription-toggle{padding-inline:12px}
 body.channel-minimal #people-button{gap:4px;padding-inline:8px}
 body.channel-minimal .channel-transport #playing{font-size:16px}
 body.channel-minimal .channel-columns .panel{padding:12px 0 0}
}
@media(max-width:720px),(max-height:500px){
 body.channel-minimal .channel-banner-frame{width:calc(100% + 2*var(--channel-mobile-inset));margin:0 calc(-1*var(--channel-mobile-inset));border-radius:0}
}

.player-panel.is-disconnected{filter:grayscale(1)}
body.channel-minimal .player-panel.is-disconnected :is(.player-main,.channel-publisher,.channel-actions){filter:grayscale(1)}
.connection-details{font-size:12px;line-height:1.5;color:var(--muted)}
.connection-details::before,.connection-details::after{content:none!important}
body .qr-frame .sound-icon,body.role-listener .qr-frame .sound-icon{width:58%;height:58%;margin:0;fill:none}
.qr-caption:empty,.qr-caption[hidden]{display:none!important}
.profile-expiry-summary{color:var(--muted);font-size:11.5px;line-height:1.5;padding:0 11px 8px;margin:0}
#profile-lifetime{line-height:1.65;margin:8px 0 20px;max-width:48ch}

/* Service states retain their restrained size independently from track titles. */
html[data-theme] body .channel-transport #playing[data-title-kind="status"]{font-family:inherit;font-size:18px;font-style:normal;font-weight:450;line-height:1.45;letter-spacing:0;max-width:100%;min-height:0;color:var(--text);text-transform:none;text-shadow:none;transform:none}
html[data-theme] body .channel-transport #playing[data-title-kind="status"]::before,html[data-theme] body .channel-transport #playing[data-title-kind="status"]::after{content:none}
.oauth-page {min-height:100svh;padding:calc(24px + var(--safe-area-top)) calc(16px + var(--safe-area-right)) calc(40px + var(--safe-area-bottom)) calc(16px + var(--safe-area-left));}
.oauth-header {max-width:560px;margin:0 auto 24px;}
.oauth-card {width:100%;max-width:560px;min-height:0;margin:0 auto;padding:clamp(20px,5vw,32px);border-radius:24px;background:var(--surface);overflow-wrap:anywhere;}
.oauth-card h1 {font-size:clamp(24px,5vw,30px);margin:0 0 12px;line-height:1.2;}
.oauth-card p {margin:8px 0 16px;}
.oauth-card .oauth-status {min-height:1.4em;font-size:14px;color:var(--muted);margin-bottom:12px;}
.oauth-card .oauth-profile {font-size:20px;font-weight:650;margin:4px 0;}
.oauth-card .oauth-account-label {color:var(--muted);font-size:13px;margin:0;}
.oauth-card #oauth-email {margin:0 0 8px;font-size:14px;}
.oauth-card section + section,.oauth-card form {margin-top:24px;}
.oauth-card .field {display:grid;gap:8px;margin:16px 0;}
.oauth-card input {box-sizing:border-box;min-width:0;width:100%;font-size:16px;}
.oauth-card ul {padding-left:20px;display:grid;gap:12px;line-height:1.5;margin:16px 0 24px;}
.oauth-card .oauth-actions {display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-top:24px;}
.oauth-card .oauth-actions a {font-size:14px;color:var(--muted);}
.oauth-grant {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;padding:16px 0;}
.oauth-grant > div {flex:1 1 140px;min-width:0;}
.oauth-grant > button {flex:none;white-space:nowrap;}
.oauth-grant p {margin:4px 0 0;}
/* Streaming video shares the channel transport; it never creates a second local timeline. */
.channel-video { position:relative; width:100%; min-width:0; margin:0; overflow:hidden; border-radius:16px; background:#000; }
.channel-video[hidden] { display:none; }
/* One header media slot: the selected video's existing lifecycle owns visibility. */
.channel-stage > .channel-video:not([hidden]) + .channel-banner-frame { display:none; }
.channel-video video,.channel-video canvas { display:block; width:100%; max-height:65svh; aspect-ratio:var(--video-aspect,16/9); object-fit:contain; }
.channel-video video[hidden],.channel-video canvas[hidden] { display:none; }
.presentation-actions{display:none;align-items:center;flex:none;margin-left:0;gap:0}
.channel-stage:has(> .channel-video:not([hidden])) .presentation-actions{display:flex}
body.channel-minimal .channel-transport .presentation-actions .icon-button{position:static;flex:none;width:44px;height:44px;min-width:44px;min-height:44px;padding:12px;background:transparent;color:inherit}
.presentation-actions .icon-button svg{width:20px;height:20px;fill:none;stroke-linecap:round;stroke-linejoin:round}
.presentation-actions .icon-button:disabled{opacity:.4}
.channel-video #channel-video-presentation { display:block; width:100%; }
.channel-video #channel-video-presentation:fullscreen { height:100%; max-height:100%; }
.channel-video #channel-video-presentation-error { position:absolute; inset:auto 8px 104px; padding:8px 12px; border-radius:8px; background:rgb(0 0 0 / .8); color:#fff; font-size:14px; }
.channel-video:fullscreen { display:flex; align-items:center; justify-content:center; margin:0; border-radius:0; }
.channel-video:fullscreen video,.channel-video:fullscreen canvas { width:100%; height:100%; max-height:100%; }
@media(max-width:720px){
  .channel-video:not(:fullscreen) { border-radius:14px; margin-bottom:0; }
}
@media(max-width:720px),(max-height:500px){
  body.channel-minimal .channel-stage > .channel-video:not(:fullscreen) { width:calc(100% + 2*var(--channel-mobile-inset)); margin:0 calc(-1*var(--channel-mobile-inset)); border-radius:0; }
}
@media(min-width:1100px) and (max-height:500px){
  body.channel-minimal.role-admin .channel-stage > :is(.channel-video:not(:fullscreen),.channel-banner-frame){width:100%;margin:0;border-radius:16px}
}
@media(min-width:721px){
  body.channel-minimal .channel-stage > :is(.channel-video:not(:fullscreen),.channel-banner-frame){width:100%;margin:0;border-radius:12px}
}
@media(max-width:720px){
  body.channel-minimal .channel-stage > .channel-transport{width:calc(100% + 2*var(--channel-mobile-inset));margin:0 calc(-1*var(--channel-mobile-inset));padding-inline:16px;border-radius:0}
}

/* A private invitation QR shares the modal with its exact one-time link. */
.share-invite-qr{width:min(240px,100%);margin:16px auto;color:var(--accent)}
.share-invite-qr[hidden]{display:none}
.share-invite-qr svg{display:block;width:100%;height:auto}
.share-invite-qr .qr-center-disc{fill:currentColor}


body.channel-minimal .channel-stage > .channel-banner-frame{margin-bottom:0}

/* One readable control layer over either video or the channel poster. */
body.channel-minimal .channel-stage:has(> :is(.channel-video,.channel-banner-frame):not([hidden])) > .channel-transport{
  position:absolute;z-index:2;inset:auto 0 0;width:100%;margin:0;--transport-side-pad:12px;padding:12px var(--transport-side-pad) 6px;
  border-radius:0 0 12px 12px;background:linear-gradient(transparent,rgba(0,0,0,.72));
  --text:#fff;--accent:#fff;--accent-strong:#fff;--range-rail:rgba(255,255,255,.35);
  --line:rgba(255,255,255,.35);--surface-2:rgba(255,255,255,.16);color:#fff;
  opacity:1;transition:opacity .18s ease;pointer-events:none;
}
body.channel-minimal .channel-stage:has(> :is(.channel-video,.channel-banner-frame):not([hidden])) .channel-transport > *{pointer-events:auto}
body.channel-minimal .channel-stage:has(> :is(.channel-video,.channel-banner-frame):not([hidden])) .channel-transport .seek-line{color:#fff}
body.channel-minimal .channel-stage:has(> .channel-video:not([hidden]))[data-controls-hidden] > .channel-transport{opacity:0;pointer-events:none}
body.channel-minimal .channel-stage:has(> .channel-video:not([hidden]))[data-controls-hidden] > .channel-transport *{pointer-events:none}
body.channel-minimal .channel-stage[data-controls-keyboard]:focus-within > .channel-transport{opacity:1;pointer-events:auto}
body.channel-minimal .channel-stage[data-controls-keyboard]:focus-within > .channel-transport *{pointer-events:auto}
.channel-stage[data-controls-hidden]:has(> .channel-video:not([hidden])){cursor:none}
body.channel-minimal .channel-transport button{border-radius:6px}
body.channel-minimal .channel-transport :is(.icon-button,.local-sound-button) svg{width:20px;height:20px}
body.channel-minimal .channel-transport :is(.icon-button,.local-sound-button):hover,body.channel-minimal .channel-transport #transport-toggle:hover{background:var(--surface-2)}
body.channel-minimal .channel-transport button:focus-visible{outline:2px solid currentColor;outline-offset:-3px}
@media(max-width:720px){
  body.channel-minimal .channel-stage:has(> :is(.channel-video,.channel-banner-frame):not([hidden])) > .channel-transport{inset-inline:calc(-1*var(--channel-mobile-inset));width:calc(100% + 2*var(--channel-mobile-inset));--transport-side-pad:8px;padding-inline:var(--transport-side-pad);border-radius:0}
  body.channel-minimal .channel-transport .transport-actions{gap:4px}
  body.channel-minimal .channel-transport .player-controls{gap:0}
}
@media(max-width:359px){
  body.channel-minimal .channel-stage:has(> :is(.channel-video,.channel-banner-frame):not([hidden])) > .channel-transport{--transport-side-pad:6px;padding-inline:var(--transport-side-pad)}
  body.channel-minimal .channel-transport .transport-actions,body.channel-minimal .channel-transport .qr-sound-controls{gap:0}
}
body.channel-minimal .channel-stage:fullscreen{display:flex;align-items:center;justify-content:center;width:100%;height:100%;margin:0;background:#000;border-radius:0}
body.channel-minimal .channel-stage:fullscreen > .channel-video{width:100%;height:100%;margin:0;border-radius:0}
body.channel-minimal .channel-stage:fullscreen .channel-video video{width:100%;height:100%;max-height:100%;object-fit:contain}
body.channel-minimal .channel-stage:fullscreen:has(> .channel-video) > .channel-transport{inset:auto 0 0;width:100%;margin:0;border-radius:0;padding-right:calc(var(--transport-side-pad,12px) + var(--safe-area-right));padding-bottom:max(6px,var(--safe-area-bottom));padding-left:calc(var(--transport-side-pad,12px) + var(--safe-area-left))}
/* On narrow admin videos, use the spare end of the existing progress row.
   Transport targets and volume keep their original size and vertical position. */
@media(max-width:420px){
 body.channel-minimal.role-admin .channel-stage:has(> .channel-video:not([hidden])) .sync-accuracy{position:absolute;right:0;bottom:100%;block-size:24px}
 body.channel-minimal.role-admin .channel-stage:has(> .channel-video:not([hidden])) .sync-accuracy-trigger{block-size:24px;min-height:24px}
 body.channel-minimal.role-admin .channel-stage:has(> .channel-video:not([hidden])) .presentation-actions{margin-left:auto}
 body.channel-minimal.role-admin .channel-stage:has(> .channel-video:not([hidden])) .seek-line{padding-right:80px}
}
body.channel-minimal .channel-stage:has(#sync-accuracy [aria-expanded=true])>.channel-transport{opacity:1;pointer-events:auto}
body.channel-minimal .channel-stage:has(#sync-accuracy [aria-expanded=true])>.channel-transport *{pointer-events:auto}
body.channel-minimal .channel-stage:has(#stem-selection [aria-expanded=true])>.channel-transport{opacity:1;pointer-events:auto}
body.channel-minimal .channel-stage:has(#stem-selection [aria-expanded=true])>.channel-transport *{pointer-events:auto}
@media(prefers-reduced-motion:reduce){body.channel-minimal .channel-stage > .channel-transport{transition:none!important}}

/* Cover the browser's inline PiP message without hiding or replacing its live video. */
#channel-video-pip-placeholder{position:absolute;z-index:1;inset:0;display:grid;place-items:center;padding-bottom:104px;overflow:hidden;background:#101010;pointer-events:none}
#channel-video-pip-placeholder[hidden]{display:none}
#channel-video-pip-placeholder>img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:.25;pointer-events:none}
.channel-video #channel-video-pip-return{position:relative;z-index:1;display:grid;place-items:center;width:48px;min-width:48px;height:48px;padding:12px;border:1px solid #ffffff40;border-radius:12px;background:#ffffff0d;color:#fff;pointer-events:auto}
.channel-video #channel-video-pip-return svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.channel-video #channel-video-pip-return:hover{background:#ffffff24}
.channel-video #channel-video-pip-return:focus-visible{outline:2px solid #fff;outline-offset:3px}
body.channel-minimal .channel-transport #channel-video-pip[aria-pressed=true]{background:var(--surface-2)}
@media(max-width:720px),(max-height:500px){.channel-video #channel-video-pip-return{display:none}}

/* Selection is an explicit mode; ordinary lists retain their compact row controls. */
.channel-columns .track-selection-toggle{flex:none;width:44px;height:44px;padding:0;color:var(--muted)}
.track-selection-toggle[aria-pressed=true]{color:var(--accent-text);background:var(--surface-active)}
.track-selection-toggle svg,.track-selection-toolbar svg{display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.track-selection-toolbar{display:flex;align-items:center;gap:4px;min-height:44px;margin:0 0 6px;padding:0 4px 0 10px;background:var(--surface-2);border-radius:10px}
.track-selection-toolbar[hidden],body:not(.role-admin) .track-selection-toolbar{display:none}
.track-selection-count{flex:1;min-width:0;font-size:12px;font-variant-numeric:tabular-nums;color:var(--muted)}
.track-selection-toolbar .icon-button{flex:none;width:44px;height:44px;padding:0}
.track-selection-toolbar .icon-button[aria-pressed=true]{color:var(--accent-text)}
.track-select-control{display:flex;align-items:center;justify-content:center;flex:none;width:44px;height:44px;margin:0;cursor:pointer}
.track-select-control[hidden],.is-selecting :is(.row-play,.queue-remove,.queue-add,.library-delete)[hidden]{display:none}
.track-select-control .track-select-checkbox{flex:none;width:18px;height:18px;min-height:18px;margin:0;padding:0;cursor:pointer;accent-color:var(--accent)}
.track-select-control:has(.track-select-checkbox:focus-visible){outline:2px solid var(--accent);outline-offset:-4px;border-radius:8px}
.channel-columns :is(.queue-row,.library-track).is-selected{background:var(--surface-active);outline:1px solid var(--accent-line);outline-offset:-1px}
.channel-columns .is-selecting :is(.queue-title,.library-title){cursor:pointer;user-select:none;-webkit-user-select:none}
.channel-columns .is-selecting .drag-handle{opacity:1;pointer-events:auto}
.track-drag-count{position:absolute;right:8px;top:4px;z-index:3;display:grid;place-items:center;min-width:24px;height:24px;padding:0 6px;border-radius:12px;background:var(--accent);color:var(--accent-ink);font-size:12px;font-weight:650;box-shadow:0 1px 4px #0003}
.channel-columns .library-heading-default{gap:4px}
.channel-columns .library-heading-title{gap:4px}
.channel-columns .library-heading-title h2{margin-right:4px}
.channel-columns .library-heading-default .upload{padding-inline:10px}
@media(max-width:360px){
 .channel-columns .library-heading-title{gap:0}
 .channel-columns .library-heading-default .upload{padding-inline:8px}
}
