/* App-only TV layout, calibrated against Firestick's 960x540 WebView. */
.tv-pair-card[hidden],.tv-remote-hint[hidden]{display:none!important}
.tv-pair-card,.phone-pair-card{padding:24px;border:1px solid #a78bfa55;border-radius:18px;background:#12131b;max-width:620px}
.phone-pair-card{margin:24px auto}.phone-pair-card input{text-transform:uppercase;letter-spacing:.2em}
.tv-pair-card img{display:block;width:160px;height:160px;margin:12px auto;background:white;border:8px solid white;border-radius:10px}
.tv-pair-card strong{display:block;font-size:22px;letter-spacing:.14em;text-align:center}
.tv-pair-card a{display:block;margin:10px 0;overflow-wrap:anywhere}
body.tv-mode{font-size:14px}
body.tv-mode.signed-out>aside,body.tv-mode.signed-out>main{display:none}
body.tv-mode aside{position:fixed;inset:0 auto 0 0;width:164px;padding:18px 12px;overflow:auto;display:flex;flex-direction:column;align-items:stretch;gap:0;flex-wrap:nowrap}
body.tv-mode main{margin-left:164px;padding:20px 24px 44px;max-width:none}
body.tv-mode main>header,body.tv-mode.tv-details #controls,body.tv-mode .title-toolbar{display:none}
body.tv-mode nav{display:grid;flex:0 0 auto;align-content:start;order:0;width:auto;margin:14px 0 0;padding:0;gap:3px;overflow:visible}
body.tv-mode nav button,body.tv-mode .watch-nav{font-size:14px;padding:8px 10px;min-height:34px}
body.tv-mode .brand{font-size:20px;gap:7px}body.tv-mode .brand img{width:27px;height:27px}body.tv-mode .brand small{font-size:10px}
body.tv-mode .portal-purpose{display:none}
body.tv-mode .account{display:grid;margin:auto 0 0;padding:16px 0 0;gap:3px}
body.tv-mode .account #account-name{font-size:13px}body.tv-mode .account #account-role{font-size:10px}
body.tv-mode .account button{font-size:12px;padding:6px 8px;min-height:28px;margin-top:0}
body.tv-mode .watch-nav{white-space:normal;overflow-wrap:anywhere}
body.tv-mode button,body.tv-mode input,body.tv-mode select,body.tv-mode summary{font-size:14px;min-height:34px}
body.tv-mode button,body.tv-mode input,body.tv-mode select{padding:8px 11px}
body.tv-mode .meta,body.tv-mode .muted,body.tv-mode .summary,body.tv-mode label,body.tv-mode .release-name{font-size:12px;line-height:1.5}
body.tv-mode :is(button,a,input,select,textarea,summary,[tabindex="0"]):focus{outline:3px solid #d5c4ff!important;outline-offset:3px!important;box-shadow:0 0 0 6px #a78bfa33!important}
body.tv-mode .grid,body.tv-mode .catalogue-grid{grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:18px 14px;padding:6px}
body.tv-mode .discovery-rail{grid-auto-columns:132px;gap:16px;padding:8px 6px 16px}
body.tv-mode .landscape-rail{grid-auto-columns:190px}
body.tv-mode .card h2{font-size:13px;margin:8px 0 4px}
body.tv-mode .card>.meta{font-size:10px}
body.tv-mode .card>button{font-size:11px;padding:6px 9px;min-height:28px}
body.tv-mode .row{padding:16px;gap:16px}body.tv-mode .row h2{font-size:17px}
body.tv-mode dialog{width:min(760px,86vw);max-height:86vh;padding:22px;scroll-padding:12px}
body.tv-mode .dialog-head h2{font-size:22px}
body.tv-mode .episode-controls,body.tv-mode .actions{flex-wrap:wrap}
body.tv-mode .title-hero{grid-template-columns:120px minmax(0,1fr);padding:20px;gap:24px}
body.tv-mode .title-info h2{font-size:27px;margin:4px 0 10px}
body.tv-mode .title-info .summary{font-size:13px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5;overflow:hidden}
body.tv-mode .hero-backdrop{display:none}
body.tv-mode .show-hero{grid-template-columns:100px minmax(0,1fr);padding:18px;gap:20px}
body.tv-mode .show-hero h2{font-size:25px;margin:0 0 8px}
body.tv-mode .discovery-section{margin:24px 0}body.tv-mode .discovery-section>h2{font-size:18px}
body.tv-mode .cast-rail{grid-auto-columns:80px;gap:14px}
body.tv-mode #login-screen{padding:20px;gap:24px;align-items:center;justify-content:center}
body.tv-mode.signed-out #login-screen{display:flex}
body.tv-mode #login-form{width:350px;margin:0;padding:22px}
body.tv-mode .login-brand{font-size:27px}body.tv-mode .login-brand img{width:44px;height:44px}
body.tv-mode .login-tagline{font-size:11px;margin:10px 0 16px}
body.tv-mode .login-card h1{font-size:21px}body.tv-mode .login-card label{margin-top:10px}
body.tv-mode .tv-pair-card{width:350px;padding:22px}body.tv-mode .tv-pair-card h2{font-size:22px;margin:0 0 10px}
body.tv-mode .tv-pair-card p{font-size:12px;margin:8px 0}
body.tv-mode .tv-remote-hint{position:fixed;bottom:0;left:164px;right:0;margin:0;padding:6px 16px;background:#08090df2;border-top:1px solid #ffffff18;color:#ccc3dc;font-size:11px;text-align:center;z-index:100;pointer-events:none}
body.tv-mode.signed-out .tv-remote-hint{left:0}body.tv-mode footer{font-size:10px}
body.tv-mode .poster-link,body.tv-mode .discovery-rail{scroll-margin:16px;scroll-padding:8px}
.tv-download-summary[hidden],body:not(.tv-mode) .tv-download-summary{display:none!important}
body.tv-mode #download-form.tv-confirm>label,body.tv-mode #download-form.tv-confirm>.pair{display:none}
body.tv-mode .tv-download-summary{padding:8px 0 18px}
body.tv-mode .tv-download-summary h3{font-size:22px;margin:6px 0 12px}
@media(prefers-reduced-motion:reduce){body.tv-mode *{scroll-behavior:auto!important;transition:none!important}}

body.tv-mode #add{font-size:14px;min-height:34px;padding:8px 10px}
body.tv-mode .brand-copy{min-width:0}body.tv-mode .brand small{white-space:normal;font-size:9px}
body.tv-mode .title-search input{font-size:14px}

/* V1.1.2: horizontal TV navigation and remote-friendly genre shelves. */
body.tv-mode aside{inset:0 0 auto;width:auto;height:72px;padding:12px 24px;flex-direction:row;align-items:center;gap:24px;overflow:visible;background:#09090ded;border-bottom:1px solid #ffffff12;z-index:90}
body.tv-mode main{margin-left:0;padding:90px 28px 44px}
body.tv-mode .brand{flex:0 0 auto;font-size:21px}body.tv-mode .brand small{display:none}
body.tv-mode nav{display:flex;align-items:center;flex:1;min-width:0;margin:0;gap:4px;overflow-x:auto;scrollbar-width:none}
body.tv-mode nav button{white-space:nowrap;border-radius:5px;background:transparent;border-color:transparent;padding:8px 11px;font-weight:600}
body.tv-mode nav button.active{color:#c5afff;border-bottom:2px solid #a78bfa}
body.tv-mode #add,body.tv-mode #watch-link,body.tv-mode [data-page=watch]{display:none!important}
body.tv-mode .account{position:relative;display:block;flex:0 0 auto;margin:0;padding:0}
body.tv-mode .account>:not(.tv-account-toggle){display:none}
body.tv-mode .account.tv-account-open>:not(.tv-account-toggle){display:block}
body.tv-mode .account.tv-account-open{position:absolute;right:24px;top:12px;width:160px;background:#17151f;padding:0 12px 12px;border:1px solid #ffffff20;border-radius:8px}
body.tv-mode .account .tv-account-toggle{font-size:12px;min-height:34px;margin:0}
body.tv-mode .account.tv-account-open #account-name{margin-top:12px}
body.tv-mode .account #account-role{display:none!important}
body.tv-mode .tv-remote-hint{left:0}
body.tv-mode .grid,body.tv-mode .catalogue-grid{grid-template-columns:repeat(auto-fill,minmax(132px,1fr))}
body.tv-mode .tv-genres{margin:0 0 20px;min-width:0}
body.tv-mode .tv-genres h2{font-size:17px;margin:0 0 10px}
body.tv-mode .tv-genre-rail{display:flex;gap:12px;overflow-x:auto;padding:6px 6px 10px;scrollbar-width:none;scroll-padding:8px}
body.tv-mode .tv-genre-tile{flex:0 0 132px;height:58px;min-height:58px;border-radius:8px;border:1px solid #ffffff20;background:linear-gradient(120deg,#30243f,#171b2b);font-size:14px;font-weight:600;white-space:normal}
body.tv-mode .tv-genre-tile:nth-child(3n+2){background:linear-gradient(120deg,#193c42,#172632)}
body.tv-mode .tv-genre-tile:nth-child(3n){background:linear-gradient(120deg,#40302a,#25202c)}
body.tv-mode .tv-genre-tile[aria-pressed=true]{border-color:#b69bff;background:#493568}
body.tv-mode .tv-genre-original{display:none}
body.tv-mode :is(.poster-link,.tv-genre-tile,button,input,select,summary){scroll-margin-top:88px;scroll-margin-bottom:40px}
body.tv-mode #controls{display:flex;flex-wrap:wrap;gap:12px;align-items:start}
body.tv-mode .tv-genres{flex:0 0 100%;width:100%;order:-1}
body.tv-mode.tv-details #controls{display:none}

body.tv-mode .browse-filters{padding:8px 12px;border-radius:8px}
body.tv-mode .tv-genres{margin-bottom:4px}

/* V1.1.3: focus-first details and one clear action per release row. */
body.tv-mode aside .brand{pointer-events:none}
body.tv-mode footer,body.tv-mode .credits,body.tv-mode .tv-secondary,body.tv-mode .freshness,body.tv-mode .library-available{display:none!important}
body.tv-mode .release-row{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:14px 6px;border-bottom:1px solid #ffffff18;scroll-margin:100px 0 46px}
body.tv-mode .release-row .release-name{margin:0;flex:1}
body.tv-mode .release-row>button{flex:0 0 auto;min-width:150px}
body.tv-mode .release-row:focus-within{background:#a78bfa18;border-radius:8px}
body.tv-mode .title-info .actions{gap:12px}
body.tv-mode .browse-filters{display:none}
body.tv-mode #content{scroll-margin-top:88px}

body.tv-mode .card>button,body.tv-mode .discovery-card>button,body.tv-mode .card>details,body.tv-mode .card>select,body.tv-mode [data-close],body.tv-mode .tv-download-summary>button{display:none!important}

body.tv-mode #title-releases{scroll-margin-top:88px}
