/* Playback workspace: separate cards, bounded groups, one scroll surface per sheet. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.watch-heading{display:flex;align-items:center;gap:14px;margin-bottom:18px;min-width:0}
.watch-heading h1{flex:1;min-width:0;font-size:23px;line-height:1.4;margin:0;overflow-wrap:anywhere}
.watch-heading .back{margin:0;min-height:44px;white-space:nowrap}
.watch-heading .favorite{border:1px solid var(--line);border-radius:10px;min-height:44px;padding:8px 12px;white-space:nowrap;background:var(--surface);font-size:12px}
.watch-heading .favorite.active{color:var(--accent);border-color:var(--accent)}
.watch-mode .detail-grid{display:grid;grid-template-columns:minmax(0,1fr) 350px;grid-template-areas:"player selectors" "info selectors";grid-template-rows:max-content 1fr;gap:20px 24px}
.watch-main{grid-area:player;min-width:0}
.watch-mode .watch-aside{grid-area:selectors;display:grid;gap:16px;align-content:start;min-width:0;max-height:none;height:auto;overflow:visible;padding:0;border:0;background:none;border-radius:0}
.selector-card{min-width:0;padding:18px;border:1px solid var(--line);border-radius:16px;background:var(--surface)}
.selector-heading,.episode-heading{display:flex;justify-content:space-between;align-items:center;gap:8px}
.selector-heading h2,.episode-heading h2{font-size:16px;margin:0;line-height:1.5}
.selector-heading .text-button,.episode-heading .text-button{white-space:nowrap;min-height:44px;padding:8px 2px;font-size:11px}
.source-panel .source-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:8px 0 12px;overflow:visible;max-height:none}
.source-panel .source-row{align-items:flex-start;flex-wrap:wrap;min-height:88px;padding:12px;gap:6px}
.source-panel .source-row>div{flex:1 1 100%;min-width:0}.source-panel .source-row strong{font-size:13px;overflow-wrap:anywhere}.source-panel .source-row small,.source-panel .source-row .signal{font-size:11px;white-space:normal;overflow-wrap:anywhere}.source-panel .source-row>svg{margin-left:auto}
.source-note{line-height:1.7;overflow-wrap:anywhere;margin:0 0 8px}
.source-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.source-tools button{min-height:44px;font-size:11px}.source-tools label{display:flex;align-items:center;gap:4px;min-height:44px;font-size:11px;color:var(--muted)}.source-tools input{width:16px;height:16px;accent-color:var(--accent)}
.episode-controls{display:flex;gap:8px;align-items:center;margin:8px 0 12px}.episode-find{position:relative;display:block;flex:1;min-width:0}.episode-find input{width:100%;min-height:44px;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--ink);padding:10px 40px 10px 12px;font-size:12px;appearance:none}.episode-find input::-webkit-search-cancel-button{display:none}.episode-find button{position:absolute;right:0;top:0;width:40px;height:44px;font-size:20px;color:var(--muted)}.episode-controls>.text-button{min-height:44px;padding:8px;white-space:nowrap}
.episode-groups{display:flex;align-items:center;gap:8px}.episode-groups[hidden]{display:none}.episode-groups>button{flex:0 0 44px;height:44px;border:1px solid var(--line);border-radius:9px;font-size:24px;background:var(--bg)}.episode-groups label{flex:1;min-width:0;display:flex;align-items:center;gap:7px;font-size:11px;color:var(--muted)}.episode-groups label>span{white-space:nowrap}.episode-groups select{flex:1;width:0;min-width:0;min-height:44px;border:1px solid var(--line);border-radius:9px;padding:8px;color:var(--ink);background:var(--bg);font-size:12px}
.episode-meta{min-height:20px;font-size:11px;color:var(--muted);margin:10px 0}
.watch-aside .episodes,.watch-sheet .episodes{grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;max-height:none;height:auto;overflow:visible;align-items:stretch}
.watch-aside .episodes button,.watch-sheet .episodes button{height:auto;min-height:44px;max-height:none;padding:10px 5px;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;word-break:normal;line-height:1.65;font-size:12px;border:1px solid transparent;border-radius:9px}
.watch-aside .episodes.long-labels,.watch-sheet .episodes.long-labels{grid-template-columns:repeat(2,minmax(0,1fr))}
.watch-aside .episodes.long-labels button,.watch-sheet .episodes.long-labels button{padding:12px 9px;min-height:70px;text-align:left}
.episode-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid var(--line);margin-top:14px;padding-top:4px}.episode-footer button{min-height:44px;font-size:11px}
.episode-empty{grid-column:1/-1;color:var(--muted);padding:22px 12px;text-align:center;font-size:12px}.episode-empty button{display:block;margin:10px auto 0;min-height:44px}
.watch-actions{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:12px}.watch-actions button,.watch-actions select{width:100%;min-width:0;min-height:44px;padding:8px 5px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font-size:12px;text-align:center}
.watch-current{display:flex;align-items:baseline;gap:8px;margin-top:12px;font-size:12px;line-height:1.8;overflow-wrap:anywhere}.watch-current span{color:var(--muted);flex:none}.watch-current strong{min-width:0;font-weight:600}.watch-mode .stage{margin:0;width:100%;border-radius:13px;scroll-margin-top:24px}
.film-details{grid-area:info;min-width:0;border:1px solid var(--line);background:var(--surface);border-radius:14px;padding:14px 18px}.film-details summary{cursor:pointer;font-size:13px;font-weight:600;min-height:28px}.film-details .synopsis{margin-top:14px}.film-details .metadata{margin-top:12px}
.watch-dock{display:none}
.dock-context strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
dialog.watch-sheet{width:min(720px,calc(100% - 40px));max-width:720px;max-height:min(86dvh,850px);padding:0;overflow:hidden;border-radius:18px;overscroll-behavior:contain}
dialog.watch-sheet[open]{display:flex;flex-direction:column}
body.watch-mode:has(dialog.watch-sheet[open]){overflow:hidden}
.watch-sheet .dialog-top{flex:none;align-items:flex-start;padding:16px 20px 12px;margin:0;border-bottom:1px solid var(--line);gap:14px}.watch-sheet .dialog-top>div{flex:1;min-width:0}.watch-sheet .dialog-top h2{font-size:18px;margin:0}.watch-sheet .dialog-top p{font-size:11px;color:var(--muted);line-height:1.6;margin:4px 0 0;overflow-wrap:anywhere}.watch-sheet .dialog-top .icon-button{width:44px;height:44px;flex:0 0 44px}.sheet-context span{display:block}.sheet-context strong{display:block;color:var(--ink);font-weight:500}
.sheet-tools{flex:none;padding:12px 20px}.sheet-tools>input{width:100%;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--ink);font-size:13px}.source-filter{display:flex;align-items:center;gap:6px;margin-top:8px;flex-wrap:wrap}.source-filter button{min-height:44px;padding:8px 12px;border-radius:9px;font-size:12px}.source-filter button.active{background:var(--accent-wash);color:var(--accent)}.source-filter span{margin-left:auto;color:var(--muted);font-size:11px}
.sheet-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:4px 20px 16px;scrollbar-gutter:stable}
.watch-sheet .source-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.watch-sheet .source-row{display:flex;align-items:flex-start;flex-wrap:wrap;padding:12px;gap:6px;min-height:80px}.watch-sheet .source-row>div{flex:1 1 100%;min-width:0}.watch-sheet .source-row strong{font-size:13px;overflow-wrap:anywhere}.watch-sheet .source-row small{font-size:11px;white-space:normal;overflow-wrap:anywhere}.watch-sheet .source-row .signal{font-size:11px;white-space:normal;overflow-wrap:anywhere}.watch-sheet .source-row>svg{margin-left:auto}
.dialog-change-source{align-self:flex-start;flex:none;min-height:44px;margin:0 20px;padding:6px 0}.watch-sheet #dialogEpisodeControls{flex:none;padding:0 20px}.watch-sheet .episode-heading{display:flex}.watch-sheet .episode-controls{margin:0 0 10px}.watch-sheet .episode-meta{margin:8px 0}.watch-sheet .episodes{grid-template-columns:repeat(6,minmax(0,1fr))}.watch-sheet .episodes.long-labels{grid-template-columns:repeat(3,minmax(0,1fr))}
.sheet-footer{flex:none;display:flex;justify-content:flex-end;gap:8px;padding:12px 20px max(12px,env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--surface)}.sheet-footer button{min-height:44px}
@media(max-width:1000px){.watch-mode .detail-grid{grid-template-columns:minmax(0,1fr) 320px;gap:18px}.selector-card{padding:14px}}
@media(max-width:900px){.watch-mode .detail-grid{grid-template-columns:minmax(0,1fr);grid-template-areas:"player" "selectors" "info";gap:18px}.watch-mode .watch-aside{width:100%;grid-template-columns:minmax(0,1fr)}.watch-heading{gap:10px}.watch-heading h1{font-size:19px}.watch-heading .favorite{padding:8px}.watch-mode main{padding-bottom:160px}.watch-mode .bottom-nav{display:none}.watch-dock{position:fixed;z-index:20;bottom:0;left:0;right:0;display:block;border-top:1px solid var(--line);background:var(--surface);padding:9px max(16px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));box-shadow:0 -4px 20px #00000008}.dock-context{display:flex;align-items:baseline;gap:8px;font-size:11px;margin-bottom:7px;line-height:1.6}.dock-context span{color:var(--muted);flex:none}.dock-context strong{font-weight:500;overflow-wrap:anywhere;min-width:0}.dock-actions{display:grid;grid-template-columns:1fr 1fr 1.3fr;gap:8px}.dock-actions button{min-height:44px;padding:8px;border:1px solid var(--line);border-radius:10px;font-size:13px;background:var(--bg)}.dock-actions button:last-child{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}.watch-mode #toast{bottom:145px}.watch-mode .stage{scroll-margin-top:12px}.film-details{padding:14px}.watch-mode .watch-heading{margin-bottom:12px}}
@media(max-width:600px){.watch-mode main{padding-left:16px;padding-right:16px}.watch-heading h1{font-size:17px}.watch-heading .back{font-size:11px}.watch-heading .favorite{font-size:11px}.watch-actions{gap:5px}.watch-actions button,.watch-actions select{font-size:11px}.watch-current{font-size:11px}.selector-card{padding:14px}.watch-aside .episodes{grid-template-columns:repeat(5,minmax(0,1fr))}.watch-aside .episodes button{font-size:11px}.watch-aside .episodes.long-labels button{font-size:12px}.watch-sheet .episodes{grid-template-columns:repeat(5,minmax(0,1fr))}.watch-sheet .episodes.long-labels{grid-template-columns:repeat(2,minmax(0,1fr))}dialog.watch-sheet{width:100%;max-width:none;margin:auto 0 0;max-height:88dvh;border-radius:18px 18px 0 0;border-left:0;border-right:0;border-bottom:0}.watch-sheet .dialog-top{padding:12px 16px 10px}.sheet-tools{padding:10px 16px}.sheet-scroll{padding:4px 16px 12px}.dialog-change-source{margin:0 16px}.watch-sheet #dialogEpisodeControls{padding:0 16px}.sheet-footer{padding-left:16px;padding-right:16px}.watch-sheet .source-row{padding:10px}.source-filter span{font-size:10px}.watch-sheet .sheet-context strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}}
@media(max-height:480px){dialog.watch-sheet{max-height:96dvh}.watch-sheet .dialog-top{padding:8px 16px}.watch-sheet .dialog-top p{display:none}.dialog-change-source{position:absolute;right:68px;top:8px;margin:0;font-size:11px}.watch-sheet .sheet-footer{display:none}.watch-sheet .episode-controls{margin:8px 0}.watch-sheet .episode-meta{margin:4px 0}.watch-sheet .episode-heading{display:none}.watch-sheet .sheet-tools{padding-top:8px;padding-bottom:4px}}

@media(max-height:480px) and (min-width:601px){.watch-sheet .episode-heading{display:flex;position:absolute;top:8px;right:180px}.watch-sheet .episode-heading h2{display:none}}

@media(min-width:601px) and (max-width:900px){.source-panel .source-list{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Compact audio tools; source cards and episode groups keep their existing layout. */
.watch-current #playerSound{margin-left:auto;flex-shrink:0;min-height:44px;padding:6px 8px}
.audio-dialog{width:min(480px,calc(100vw - 32px));box-sizing:border-box;padding:24px;border:1px solid var(--line);border-radius:22px;background:var(--surface);color:var(--ink)}
.audio-dialog .dialog-top h2{font-size:20px;margin:0}.audio-dialog p{line-height:1.7}.audio-volume{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.audio-volume label{font-size:13px}.audio-volume input{width:100px;flex:1;min-width:70px;accent-color:var(--accent)}.audio-volume output{font-variant-numeric:tabular-nums;font-size:13px;min-width:35px}.audio-track{display:flex;gap:12px;align-items:center;margin:20px 0}.audio-track select{min-width:0;flex:1;min-height:44px;background:var(--bg);color:var(--ink);border:1px solid var(--line);border-radius:12px;padding:8px}.audio-dialog #repairAudio{width:100%}
@media(max-width:380px){.watch-current{flex-wrap:wrap}.watch-current #playerSound{font-size:12px}}

/* Shared APP-style health cards: values remain readable in both themes. */
:root{--probe-good:#4f7765}:root[data-theme="dark"]{--probe-good:#9ac6b1}
.source-panel .source-row,.watch-sheet .source-row{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;flex-wrap:nowrap;min-height:82px;padding:11px 12px;gap:0;border-radius:10px;transition:border-color .15s,background-color .15s;contain:layout style}
.source-panel .source-row>.source-information,.watch-sheet .source-row>.source-information{flex:1;min-width:0}
.source-row .source-information strong{display:block;font-size:12px;line-height:1.5;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.source-row .source-information small{display:block;margin-top:3px;font-size:10px;line-height:1.6;color:var(--muted)}
.source-panel .source-row>.source-health,.watch-sheet .source-row>.source-health{display:flex;flex:0 0 auto;align-items:center;justify-content:space-between;gap:5px;min-width:0;margin-top:7px}
.source-row .source-health .source-measure{font-size:10px;line-height:1.5;white-space:normal;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;color:var(--muted);margin:0}
.source-row[data-status="ok"] .source-health .source-measure{color:var(--probe-good)}.source-row[data-status="error"] .source-health .source-measure{color:var(--accent)}
.source-row .source-indicator{display:flex;flex:0 0 auto;align-items:center;justify-content:flex-end;font-size:9px;line-height:1.5;color:var(--muted);min-width:17px;min-height:17px}.source-row .source-indicator svg{width:17px;height:17px;color:var(--accent)}
.source-row.failed{opacity:1}.source-row:disabled{opacity:.55}.source-spinner{display:block;width:11px;height:11px;border:2px solid var(--line);border-top-color:var(--accent);border-radius:50%;animation:source-spin .8s linear infinite}@keyframes source-spin{to{transform:rotate(360deg)}}
@media(max-width:600px){.watch-mode .source-panel{padding:0;border:0;border-radius:0;background:transparent}.source-panel .source-list,.watch-sheet .source-list{gap:8px}}
@media(max-width:380px){.source-panel .source-row,.watch-sheet .source-row{padding:10px;min-height:82px}}
@media(prefers-reduced-motion:reduce){.source-spinner{animation:none}.source-panel .source-row,.watch-sheet .source-row{transition:none}}
