/* One scroll. On computers and tablets the watch view fits the window: header, tabs and the player stay put
   and only the guide (or the open list) scrolls. Phones and short windows use one normal page scroll instead. */
@media(min-width:901px) and (min-height:560px){
 body.webplayer-app:has(#watch:not([hidden])){height:100vh;height:100dvh;overflow:hidden;display:flex;flex-direction:column}
 body.webplayer-app:has(#watch:not([hidden]))>header{flex:none}
 body.webplayer-app:has(#watch:not([hidden]))>footer{display:none}
 body.webplayer-app:has(#watch:not([hidden]))>main{flex:1 1 auto;min-height:0;width:100%;display:flex;flex-direction:column;padding-bottom:10px!important}
 body.webplayer-app #watch:not([hidden]){flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
 body.webplayer-app #watch>.watch-bar,body.webplayer-app #profile-message{flex:none}
 body.webplayer-app #watch .watch-grid{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;flex-wrap:nowrap}
 body.webplayer-app #watch .player-area{flex:none}
 body.webplayer-app #watch .watch-grid>section.card:not(.player-area){flex:1 1 auto;min-height:0;max-height:none!important;overflow-y:auto!important;overscroll-behavior:contain;margin:0}
 /* The guide grid itself is the scroller (it keeps its sticky time row and channel column). */
 body.webplayer-app #watch #live-library{display:flex;flex-direction:column;overflow:hidden!important}
 body.webplayer-app #live-library>.guide-toolbar,body.webplayer-app #catalog-message{flex:none}
 body.webplayer-app #full-guide{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
 body.webplayer-app #full-guide>*{flex:none}
 body.webplayer-app #full-guide>.epg-scroll{flex:1 1 auto;min-height:120px;max-height:none!important}
 body.webplayer-app #catalog-message:empty,body.webplayer-app #profile-message:empty{display:none}
 /* Expanded player: the video takes the free space; "Back to guide" brings the guide back. */
 body.webplayer-app #watch.player-expanded #live-library{display:none!important}
 body.webplayer-app #watch.live-guide-mode.player-expanded .player-area{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
 body.webplayer-app #watch.live-guide-mode.player-expanded .video-shell{flex:1 1 auto;min-height:0;max-height:none!important;height:auto!important;aspect-ratio:auto!important}
 body.webplayer-app #watch.live-guide-mode.player-expanded .player-info{flex:none}
 body.webplayer-app #watch:not(.live-guide-mode) .video-shell{height:min(38vh,calc((100vw - 40px)*.5625))!important}
 /* Searching from the guide: keep the small preview so results get the room. */
 body.webplayer-app #watch.searching .player-area .controls{margin-bottom:0}
}
/* Phones and short windows: one page scroll, never a second vertical scroller inside it. */
@media(max-width:900px),(max-height:559px){
 body.webplayer-app .epg-scroll,body.webplayer-app #full-guide .epg-scroll{max-height:none!important;overflow-y:hidden;overflow-x:auto}
 body.webplayer-app #watch .watch-grid>section.card{max-height:none!important;overflow:visible!important}
}

/* Search or ask. */
body.webplayer-app .watch-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}
body.webplayer-app .watch-bar .media-tabs{order:1;margin-bottom:0!important;flex:0 1 auto;min-width:0}
body.webplayer-app .smart-search{order:2;flex:1 1 300px;min-width:0;position:relative;display:flex;align-items:center;gap:6px}
body.webplayer-app .smart-search input{flex:1;min-width:0;padding-left:30px!important;text-overflow:ellipsis}
body.webplayer-app .smart-icon{position:absolute;left:11px;color:var(--lt-accent);font-size:13px;pointer-events:none}
body.webplayer-app #smart-ask{flex:none}
body.webplayer-app .smart-note{display:none;position:absolute;left:0;right:0;top:calc(100% + 3px);z-index:20;padding:5px 10px;border-radius:8px;background:var(--lt-bottom);border:1px solid var(--lt-line);color:var(--lt-text2);font-size:11px;line-height:1.4}
body.webplayer-app .smart-search:focus-within .smart-note{display:block}
body.webplayer-app #search-results{padding:10px 12px!important;background:#0a145066!important;border:1px solid var(--lt-line)!important;border-radius:14px!important}
body.webplayer-app .smart-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:4px}
body.webplayer-app .smart-head h2{font-size:16px!important;margin:0;overflow-wrap:anywhere}
body.webplayer-app .smart-close{flex:none;font-size:12px!important;min-height:28px!important;padding:3px 12px!important}
body.webplayer-app .smart-status{margin:6px 0;font-size:12px;color:var(--lt-text2)}
body.webplayer-app .smart-section{display:flex;align-items:center;gap:8px;margin:12px 0 4px;font-size:13px;color:var(--lt-accent);text-transform:uppercase;letter-spacing:.08em}
body.webplayer-app .smart-section small{color:var(--lt-text2);letter-spacing:0}
body.webplayer-app .smart-card{background:linear-gradient(135deg,var(--lt-surface2),var(--lt-surface));border:1px solid var(--lt-line);border-radius:12px;padding:10px 12px;margin:6px 0 4px}
body.webplayer-app .smart-card-title{display:block;font-size:15px}
body.webplayer-app .smart-card p{margin:3px 0;font-size:12px}
body.webplayer-app .smart-card .smart-actions{margin-top:6px}
body.webplayer-app .smart-card-note:empty{display:none}
body.webplayer-app .smart-card-note{color:var(--lt-accent)!important}
body.webplayer-app .smart-score{padding:6px 0;border-top:1px solid var(--lt-line)}
body.webplayer-app .smart-score strong{display:block;font-size:13px}
body.webplayer-app .smart-score small{color:var(--lt-text2)}
body.webplayer-app .smart-final{font-weight:600;color:var(--lt-text)!important}
body.webplayer-app .smart-row{display:flex;align-items:center;gap:10px;padding:6px 4px;border-bottom:1px solid #ffffff12;min-width:0}
body.webplayer-app .smart-logo{flex:none;width:42px;height:28px;object-fit:contain;border-radius:5px;background:#ffffff14;padding:2px}
body.webplayer-app .smart-copy{flex:1;min-width:0}
body.webplayer-app .smart-copy strong{display:block;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.webplayer-app .smart-copy small{display:block;font-size:11px;color:var(--lt-text2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.webplayer-app .smart-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
body.webplayer-app .smart-actions button,body.webplayer-app #programme-actions button,body.webplayer-app .dvr-actions button{min-height:30px!important;padding:4px 12px!important;font-size:12px!important;white-space:nowrap}
body.webplayer-app button.smart-primary,body.webplayer-app button.dvr-play{background:var(--lt-focus)!important;color:var(--lt-on-focus)!important}
body.webplayer-app .smart-tag{font-size:12px;color:#ff8a80;white-space:nowrap}
body.webplayer-app .smart-titles{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
body.webplayer-app .smart-title{display:flex;flex-direction:column;gap:3px;background:var(--lt-card);border-radius:10px;padding:8px;min-width:0}
body.webplayer-app .smart-title img{width:100%;aspect-ratio:2/3;object-fit:cover;border-radius:6px;max-height:150px}
body.webplayer-app .smart-title strong{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.webplayer-app .smart-title small{font-size:11px;color:var(--lt-text2);min-height:14px}
body.webplayer-app .smart-title .smart-actions{justify-content:flex-start;margin-top:auto}

/* Record from the guide's program details. */
body.webplayer-app #programme-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 6px}
body.webplayer-app button.record-button{color:#ff8a80!important}
body.webplayer-app .programme-note{font-size:12px;color:var(--lt-accent)}

/* Recordings. */
body.webplayer-app #recordings{padding:10px 12px!important;background:#0a145066!important;border:1px solid var(--lt-line)!important;border-radius:14px!important}
body.webplayer-app .dvr-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
body.webplayer-app .dvr-head h2{font-size:17px!important;margin:0 auto 0 0}
body.webplayer-app .dvr-quota{font-size:12px;color:var(--lt-text2)}
body.webplayer-app .dvr-note{font-size:12px;margin:6px 0}
body.webplayer-app .dvr-note:empty{display:none}
body.webplayer-app .dvr-section{display:flex;align-items:center;gap:8px;margin:12px 0 4px;font-size:13px;color:var(--lt-accent);text-transform:uppercase;letter-spacing:.08em}
body.webplayer-app .dvr-section small{color:var(--lt-text2);letter-spacing:0}
body.webplayer-app .dvr-item{display:flex;align-items:center;gap:10px;padding:7px 4px;border-bottom:1px solid #ffffff12;min-width:0}
body.webplayer-app .dvr-copy{flex:1;min-width:0}
body.webplayer-app .dvr-copy strong{display:block;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.webplayer-app .dvr-copy small{display:block;font-size:11px;color:var(--lt-text2)}
body.webplayer-app .dvr-actions{display:flex;gap:6px;flex:none}

@media(max-width:900px){
 body.webplayer-app .watch-bar{gap:6px;margin-bottom:4px}
 body.webplayer-app .smart-search{order:0;flex:1 1 100%}
 body.webplayer-app .watch-bar .media-tabs{order:1;flex:1 1 100%;max-width:calc(100% + 20px)}
 body.webplayer-app .smart-search input{font-size:16px!important}
 body.webplayer-app .smart-titles{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}
 body.webplayer-app .smart-title img{max-height:120px}
 body.webplayer-app .smart-row{flex-wrap:wrap}
 body.webplayer-app .smart-row .smart-actions{flex:1 1 100%;justify-content:flex-start;padding-left:52px}
 body.webplayer-app .smart-row:not(:has(.smart-logo)) .smart-actions{padding-left:0}
 body.webplayer-app .dvr-item{flex-wrap:wrap}
 body.webplayer-app .dvr-actions{flex:1 1 100%}
}
