/* One panel per viewport, with the existing video player kept alive. */
.tv-session-qr{display:none;position:absolute;right:40px;top:40px;width:180px!important;height:180px!important;max-width:none!important;padding:0!important;margin:0!important;background:white;z-index:100;object-fit:contain;pointer-events:none}
body.tv-mode .tv-session-qr{display:block}.tv-session-qr[hidden]{display:none!important}
.tv-output[hidden],.tv-face-admin[hidden],.tv-panel[hidden]{display:none!important}
body.tv-mode .shell .tv-panel-catalog button.lcd-slot{display:flex!important;pointer-events:auto}
body.tv-mode .tv-face-admin{z-index:2147483644}
body.tv-mode.tv-selector-available .tv-face-admin{bottom:64px}
.tv-format-trigger{position:fixed;bottom:0;z-index:9902;height:48px;width:130px;box-sizing:border-box;padding:0 6px;border:1px solid #d8ab58;border-bottom:0;border-radius:10px 10px 0 0;background:linear-gradient(180deg,#8b2740,#46101e);color:#fff;font-size:11px;font-weight:900;letter-spacing:.02em;box-shadow:0 -8px 25px #cf253966}
.tv-format-landscape{left:calc(50% - 260px)}.tv-format-portrait{left:calc(50% - 130px)}
body.tv-controls-enabled:not(.catalog-mode) .catalog-trigger{left:calc(50% - 390px)!important;width:130px}body.tv-controls-enabled:not(.catalog-mode) .pubcast-trigger{left:50%;width:130px}body.tv-controls-enabled:not(.catalog-mode) .queue-tab{left:calc(50% + 130px)!important;width:130px}body.tv-controls-enabled:not(.catalog-mode) .cjk-remote-open{left:calc(50% + 260px);width:130px}
body.catalog-mode .tv-format-trigger{display:none}
body.catalog-mode .selector-heading{min-width:0;flex:1}
body.catalog-mode .selector-tail{flex:none}
body.catalog-mode .selector-panel .view-switch{min-width:0;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin}
body.catalog-mode .selector-panel .view-switch button{flex:none;white-space:nowrap}
body.catalog-mode .selector-title-toggle{flex:none}
body.tv-mode{padding:0!important;background:#020303!important;overflow:hidden!important}
body.tv-mode .shell{position:fixed!important;inset:auto!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;width:var(--tv-width)!important;height:var(--tv-height)!important;max-width:none!important;max-height:none!important;min-height:0!important;margin:0!important;padding:0!important;overflow:hidden!important;border:0!important;border-radius:0;background:#101512!important;box-shadow:none;contain:layout paint;container-type:inline-size}
body.tv-mode .shell>.layout,body.tv-mode .shell>.layout>div,body.tv-mode #videoView,body.tv-mode #videoView .stage{position:static!important;margin:0!important;padding:0!important;transform:none!important;height:auto!important}
body.tv-mode #videoView{display:block!important;border:0!important}
body.tv-mode #videoView .screen{position:absolute!important;left:8%!important;top:50%!important;width:84%!important;height:auto!important;aspect-ratio:16/9!important;transform:translateY(-50%)!important;margin:0!important;z-index:25!important;border:1px solid #ffffff50!important;border-radius:6px!important;box-shadow:none!important;opacity:0;pointer-events:none}
body.tv-mode[data-tv-panel=video] #videoView .screen{opacity:1}
body.tv-mode .topbar,body.tv-mode .lower,body.tv-mode .now,body.tv-mode #videoView>.box-title,body.tv-mode #pubcastZones,body.tv-mode .music-artwork,body.tv-mode .queue,body.tv-mode .shell button,body.tv-mode .catalog-trigger,body.tv-mode .pubcast-trigger,body.tv-mode .queue-tab,body.tv-mode .cjk-remote-open,body.tv-mode .tv-format-trigger,body.tv-mode .cjk-remote-panel,body.tv-mode #resumePlayback,body.tv-mode #playCode{display:none!important}
.tv-panels{position:absolute;inset:0;z-index:20;pointer-events:none;color:#fff}
.tv-background{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;filter:brightness(.55);background-color:#182019}
.tv-heading{position:absolute;top:2%;left:3%;right:3%;text-align:center;font:800 clamp(14px,2cqw,36px)/1.2 system-ui}
.tv-panel{position:absolute;inset:8% 2% 7%;min-width:0;min-height:0}
.tv-panel-catalog>.lcd-grid{height:100%;container-type:inline-size}
.tv-panel-visuals{display:grid;grid-template-columns:1fr 1fr;align-content:center;gap:2%;inset:8% 3%}
body.tv-mode:not(.tv-portrait) .tv-panel-visuals{display:block;inset:0}
body.tv-mode:not(.tv-portrait) .tv-panel-visuals .tv-visual:nth-child(2){display:none}
body.tv-mode:not(.tv-portrait) .tv-panel-visuals .tv-visual:first-child{position:absolute;left:3%;bottom:3%;width:34%;transform:none}
body.tv-mode:not(.tv-portrait)[data-tv-panel=visuals] #videoView .screen{left:auto!important;right:3%!important;top:auto!important;bottom:3%!important;width:19.125%!important;aspect-ratio:1!important;transform:none!important;overflow:hidden;opacity:1}
body.tv-mode:not(.tv-portrait)[data-tv-panel=visuals] #videoView .screen iframe{position:absolute!important;left:50%!important;top:0!important;width:177.777778%!important;height:100%!important;max-width:none!important;transform:translateX(-50%)!important}
body.tv-mode:not(.tv-portrait)[data-tv-panel=visuals] .tv-footer{display:none}
.tv-visual{position:relative;aspect-ratio:16/9;margin:0;overflow:hidden;border:1px solid #ffffff50;border-radius:6px;background:#101512}
.tv-visual img{width:100%;height:100%;object-fit:cover}
.tv-visual figcaption{position:absolute;bottom:0;left:0;right:0;padding:12% 4% 4%;background:linear-gradient(transparent,#060807ed);font:800 clamp(14px,2cqw,38px)/1.15 system-ui;text-wrap:balance}
.tv-footer{position:absolute;left:3%;right:3%;bottom:2%;text-align:center;font:600 clamp(11px,1.2cqw,22px)/1.3 system-ui;text-shadow:0 1px 3px black}
.tv-playlist-name{display:none}
body.tv-mode:not(.tv-portrait)[data-tv-panel=visuals] .tv-visual:nth-child(2){overflow:visible}
body.tv-mode:not(.tv-portrait)[data-tv-panel=visuals] .tv-playlist-name{display:block;position:absolute;top:100%;left:0;right:0;margin:12px 0 0;text-align:center;color:#ffe2ad;font:750 clamp(16px,2cqw,32px)/1.3 system-ui;text-shadow:0 2px 5px #000;overflow-wrap:anywhere}
.tv-portrait .tv-panel-visuals{grid-template-columns:1fr;grid-template-rows:repeat(3,minmax(0,1fr));gap:1.5%;align-content:stretch}
.tv-portrait .tv-panel-visuals .tv-visual{aspect-ratio:auto;min-height:0}
.tv-portrait .tv-panel-visuals .tv-visual:first-child{grid-row:3}
.tv-portrait .tv-panel-visuals .tv-visual:nth-child(2){grid-row:1}
body.tv-mode.tv-portrait[data-tv-panel=visuals] #videoView .screen{opacity:1}
.tv-portrait .tv-visual figcaption{font-size:clamp(16px,3.8cqw,36px)}.tv-portrait .tv-heading{font-size:clamp(16px,3.5cqw,32px)}.tv-portrait .tv-footer{font-size:clamp(12px,2.3cqw,22px)}
.tv-portrait .lcd-slot strong{font-size:clamp(14px,2.4cqw,27px)}.tv-portrait .lcd-slot small{font-size:clamp(13px,2.2cqw,24px)}.tv-portrait .lcd-code{font-size:clamp(20px,3.4cqw,34px)}
.tv-face-admin{position:fixed;z-index:2147483646;bottom:3px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:6px;padding:7px;border:1px solid #d8ab58;border-radius:10px;background:#170e18ed;color:#ffe1b0;font:12px system-ui;max-width:calc(100vw - 8px);box-sizing:border-box}
.tv-face-admin button{padding:9px;border:1px solid #d8ab58;border-radius:6px;background:#432231;color:#fff;font:inherit;cursor:pointer}.tv-face-admin button[aria-pressed=true]{background:#edcf91;color:#20141c}.tv-face-admin button:disabled{opacity:.4}
@media(hover:hover) and (pointer:fine){.tv-face-admin{transform:translate(-50%,calc(100% - 7px));transition:transform .18s ease}.tv-face-admin:hover,.tv-face-admin:focus-within{transform:translate(-50%,0)}}
@media(max-width:780px){.tv-face-admin{gap:3px}.tv-face-admin button{padding:8px 5px;font-size:10px}body.tv-controls-enabled:not(.catalog-mode) .catalog-trigger,body.tv-controls-enabled:not(.catalog-mode) .pubcast-trigger,body.tv-controls-enabled:not(.catalog-mode) .queue-tab,body.tv-controls-enabled:not(.catalog-mode) .cjk-remote-open,.tv-format-trigger{width:16.6667%!important;font-size:8px!important;padding:0 3px!important}body.tv-controls-enabled:not(.catalog-mode) .catalog-trigger{left:0!important}.tv-format-landscape{left:16.6667%!important}.tv-format-portrait{left:33.3333%!important}body.tv-controls-enabled:not(.catalog-mode) .pubcast-trigger{left:50%!important}body.tv-controls-enabled:not(.catalog-mode) .queue-tab{left:66.6667%!important}body.tv-controls-enabled:not(.catalog-mode) .cjk-remote-open{left:83.3333%!important}}
body:not(.catalog-mode) #videoView .play-code{top:8px;right:8px;padding:4px 7px;font:600 11px/1.2 system-ui;background:#100c1480;border-color:#ffffff30;border-radius:4px;box-shadow:none;text-shadow:none;animation:none;opacity:.8}
body:not(.catalog-mode) #videoView .stop-encore{top:0;bottom:0;right:4px;width:42px;height:auto;padding:4px 3px;gap:2px;background:#100c1460;border-radius:6px;box-shadow:none;font:500 9px/1.1 system-ui;pointer-events:none}
body:not(.catalog-mode) #videoView .play-code{right:52px}
body:not(.catalog-mode) .stop-encore>strong{display:none}
body:not(.catalog-mode) .stop-encore::before{content:'ENCORE';flex:none;font-weight:800}
body:not(.catalog-mode) .stop-encore::after{content:'STOP';flex:none;font-weight:800}
body:not(.catalog-mode) .stop-encore .balance-actions,body:not(.catalog-mode) .stop-encore .balance-high,body:not(.catalog-mode) .stop-encore .balance-low{display:none}
body:not(.catalog-mode) .stop-encore .balance-led{width:6px;flex-basis:6px;box-shadow:none}
body.tv-mode .cjk-intro-caption{display:block;position:absolute;left:0;right:0;bottom:0;padding:30px 5% 12px;background:linear-gradient(transparent,#090709ed);color:#fff;font:700 clamp(14px,3cqw,32px)/1.18 system-ui;pointer-events:none}
#toast{z-index:2147483647!important}body.tv-mode #toast.show{display:block!important}
@media(prefers-reduced-motion:reduce){.tv-face-admin{transition:none}}
/* Photo print frame, drawn outside the crop without changing video geometry. */
body.tv-mode:not(.tv-portrait)[data-tv-panel=visuals] #videoView .screen{box-shadow:none!important;border-radius:0!important}
/* Full 9:16 visual canvas: song / video / catalog, exact thirds. */
body.tv-portrait[data-tv-panel=visuals] .tv-panel-visuals{inset:0;gap:0;opacity:1;transition:opacity .25s ease}
body.tv-portrait[data-tv-panel=visuals] .tv-visual{border:0;border-radius:0}
body.tv-portrait[data-tv-panel=visuals] .tv-heading,body.tv-portrait[data-tv-panel=visuals] .tv-footer{display:none}
body.tv-mode.tv-portrait[data-tv-panel=visuals] #videoView .screen{left:0!important;top:33.333333%!important;width:100%!important;height:33.333333%!important;aspect-ratio:auto!important;transform:none!important;border:0!important;border-radius:0!important;overflow:hidden;transition:opacity .25s ease}
body.tv-mode.tv-portrait[data-tv-panel=visuals] #videoView .screen iframe{position:absolute;left:-2.6749%;top:0;width:105.3498%!important;height:100%!important}
body.tv-intro.tv-portrait[data-tv-panel=visuals] .tv-panel-visuals,body.tv-intro.tv-portrait[data-tv-panel=visuals] #videoView .screen{opacity:0!important;transition:none}
.tv-ring-notice{position:absolute;z-index:45;left:8%;right:8%;bottom:12%;padding:14px 18px;border:2px solid #edcf91;border-radius:12px;background:#2d102bee;color:#ffe3a6;font:800 clamp(16px,2cqw,32px)/1.3 system-ui;pointer-events:none;text-align:center}
.tv-ring-notice[hidden],body:not(.tv-mode) .tv-ring-notice,body:not([data-tv-panel=video]) .tv-ring-notice{display:none}
@media(prefers-reduced-motion:reduce){body.tv-portrait[data-tv-panel=visuals] .tv-panel-visuals,body.tv-mode.tv-portrait[data-tv-panel=visuals] #videoView .screen{transition:none}}

/* SCREEN column: category, access, admin poster, then the same video iframe. */
body.tv-mode.cjk-screen-split .shell{border-radius:0!important}
body.tv-mode.cjk-screen-column-active[data-tv-panel=visuals] .tv-panel-visuals,
body.tv-mode.cjk-screen-column-active[data-tv-panel=visuals] .tv-heading,
body.tv-mode.cjk-screen-column-active[data-tv-panel=visuals] .tv-footer{display:none!important}
body.tv-mode.cjk-screen-column-active[data-tv-panel=visuals] #videoView .screen{left:auto!important;right:var(--cjk-column-right)!important;top:var(--cjk-column-top)!important;bottom:auto!important;width:var(--cjk-column-size)!important;height:var(--cjk-column-size)!important;aspect-ratio:1!important;transform:none!important;opacity:1!important;overflow:hidden;box-sizing:border-box;border:0!important;box-shadow:0 8px 24px #0006!important;border-radius:0!important;transition:none}
body.tv-mode.cjk-screen-column-active[data-tv-panel=visuals] #videoView .screen iframe{position:absolute!important;left:50%!important;top:0!important;width:177.777778%!important;height:100%!important;max-width:none!important;transform:translateX(-50%)!important}

/* RING always fills the canvas, including loading and idle phases. */
body.tv-mode[data-tv-panel=video] #videoView .screen{left:0!important;top:0!important;width:100%!important;height:100%!important;aspect-ratio:auto!important;transform:none!important;border:0!important;border-radius:0!important}
body.tv-mode[data-tv-panel=video] #videoView .screen iframe{left:0!important;top:0!important;width:100%!important;height:100%!important;transform:none!important}
body.tv-mode[data-tv-panel=video] .tv-heading,body.tv-mode[data-tv-panel=video] .tv-footer,body.tv-mode[data-tv-panel=video] .tv-ring-notice{display:none!important}
