/* The top-bar sections (screens/section.js and the screens built on it): Library, Guide, Webcams, Radio,
   My Cameras and Browser, and the video player they share. Kept apart from styles.css so the main screen's
   look can change without touching these. */

/* ---------- The frame ---------- */
.section { position: absolute; inset: 0; z-index: 10; background: var(--bg); color: var(--text); display: flex; flex-direction: column; }
.section-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px; min-height: 60px; flex: none; }
.section-name { display: flex; flex-direction: column; min-width: 0; }
.section-title { margin: 0; font-size: 22px; font-weight: 700; white-space: nowrap; }
.section-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-sub:empty { display: none; }
.section-actions { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; flex-wrap: wrap; }
.section-body { position: relative; flex: 1; min-height: 0; overflow: hidden; display: flex; }
.section-loading, .section-message { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); text-align: center; padding: 24px; font-size: 17px; }
.spinner.static { position: static; margin: 0; }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.small.on { background: var(--glass-focus, var(--focus)); color: var(--on-glass-focus, #000); }
.btn:disabled { opacity: .4; cursor: default; }

/* ---------- One video over the whole window ---------- */
.vplayer { position: absolute; inset: 0; z-index: 20; background: #000; }
.vplayer-web { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vplayer-top { position: absolute; left: 0; right: 0; top: 0; z-index: 6; display: flex; align-items: center; gap: 8px; padding: 8px 12px 24px; color: #fff;
  background: linear-gradient(rgba(0,0,0,.7), transparent); }
.vplayer-title { font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Library ---------- */
.library .section-body { flex-direction: column; }
.vod-search { max-width: 360px; }
.vod-chips { display: flex; gap: 8px; padding: 4px 14px 8px; overflow-x: auto; scrollbar-width: none; flex: none; }
.vod-chip { background: var(--glass, var(--surface)); border: 1px solid var(--glass-edge, transparent); border-radius: 999px; padding: 6px 14px; white-space: nowrap; font-weight: 600; font-size: 14px; }
.vod-chip.on { background: var(--glass-focus, var(--accent-blue)); color: var(--on-glass-focus, #fff); }
.vod-chip.outlined { background: transparent; border-color: var(--muted); }
.vod-chip:focus { transform: scale(1.06); }
.vod-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; padding: 8px 16px 20px; align-content: start; }
.vod-grid.main { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.vod-poster { position: relative; display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 4px; padding: 6px; border-radius: var(--radius); background: transparent; }
.vod-poster:hover { background: rgba(255,255,255,.06); }
.vod-poster:focus { transform: scale(1.04); }
.vod-poster.tile { min-height: 110px; justify-content: center; align-items: center; text-align: center; background: var(--surface2); cursor: pointer; overflow: visible; }
.vod-poster.tile:focus { box-shadow: 0 0 0 3px var(--glass-focus, var(--focus)); }
.vod-poster.tile .vod-name { font-size: 18px; -webkit-line-clamp: 2; }
.vod-pic { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; background: var(--surface); display: block; }
.vod-pic.initials { display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 800; color: var(--muted); }
.vod-new { position: absolute; top: 12px; right: 12px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 800; border-radius: 6px; padding: 2px 6px; }
.vod-new.inline { position: static; margin-left: 6px; vertical-align: middle; }
.vod-name { font-weight: 700; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vod-sub, .vod-added { color: var(--muted); font-size: 12px; }
.vod-more { grid-column: 1 / -1; justify-self: center; background: var(--surface2); border-radius: 999px; padding: 10px 22px; font-weight: 700; }
.vod-about { padding: 0 16px 8px; color: var(--muted); line-height: 1.45; flex: none; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vod-episodes { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 20px; display: flex; flex-direction: column; gap: 6px; }
.vod-episode { display: flex; align-items: center; gap: 14px; text-align: left; background: var(--surface); border-radius: var(--radius); padding: 10px 14px; }
.vod-episode:hover { background: var(--surface2); }
.vod-ep-play { font-size: 20px; color: var(--muted); }
.vod-ep-label { min-width: 70px; }
.vod-ep-text { flex: 1; min-width: 0; }
.vod-ep-name { font-weight: 600; }
.vod-ep-desc { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vod-ep-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.vod-watch { background: var(--surface); border-radius: 24px; padding: 22px 24px; max-width: 560px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.vod-watch h2 { margin: 0 0 10px; }
.vod-watch p { color: var(--muted); line-height: 1.45; max-height: 40vh; overflow-y: auto; }

/* ---------- Guide ---------- */
.guide .section-body { flex-direction: column; }
.guide-info { padding: 0 16px 8px; color: var(--muted); min-height: 26px; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guide-times, .guide-row { display: flex; align-items: stretch; gap: 4px; padding: 0 16px; }
.guide-times { flex: none; padding-bottom: 6px; }
.guide-time { flex: 1 0 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.guide-name { width: 200px; flex: none; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: center; }
.guide-rows { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-bottom: 16px; }
.guide-line { flex: 1; display: flex; gap: 4px; min-width: 0; }
.guide-gap { min-width: 0; }
.guide-cell { min-width: 0; height: 44px; padding: 0 10px; text-align: left; background: var(--surface); border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.guide-cell.live { background: var(--surface2); font-weight: 700; }
.guide-cell.bell { color: var(--secondary); }
.guide-cell:hover { background: rgba(255,255,255,.14); }
.guide-cell:focus { background: var(--glass-focus, var(--focus)); color: var(--on-glass-focus, #000); }
.guide-more { height: 1px; flex: none; }
.reminder { position: fixed; right: 24px; top: 24px; z-index: 66; width: min(380px, 90vw); background: var(--surface); border: 1px solid var(--glass-edge, transparent); border-radius: 20px; padding: 16px 20px; box-shadow: 0 8px 30px rgba(0,0,0,.6); }
.reminder-head { font-weight: 800; color: var(--secondary); }
.reminder-when { color: var(--muted); margin-top: 6px; }
.reminder-title { font-size: 19px; font-weight: 700; margin-top: 4px; }

/* ---------- Webcams ---------- */
.cam-menu { width: 230px; flex: none; overflow-y: auto; padding: 4px 8px 16px 14px; display: flex; flex-direction: column; gap: 4px; }
.cam-menu-item { display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 12px; border-radius: 10px; font-weight: 600; }
.cam-menu-item:hover { background: rgba(255,255,255,.08); }
.cam-menu-item.on { background: var(--surface2); }
.cam-menu-item:focus { background: var(--glass-focus, var(--focus)); color: var(--on-glass-focus, #000); }
.cam-icon { width: 22px; text-align: center; }
.cam-credit { color: var(--muted); font-size: 12px; margin: 12px 4px 0; }
.cam-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 16px 0 8px; }
.cam-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex: none; padding-bottom: 6px; }
.cam-country { font-size: 20px; font-weight: 700; }
.cam-city { color: var(--muted); }
.cam-time { font-size: 20px; font-weight: 700; }
.cam-top { display: flex; gap: 16px; flex: none; }
.cam-screen { position: relative; width: min(52%, 640px); aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.cam-about { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cam-live { color: var(--primary); font-weight: 800; font-size: 13px; }
.cam-name { font-size: 19px; font-weight: 700; }
.cam-place { color: var(--muted); }
.cam-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.cam-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; color: var(--muted); }
.cam-countries { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 10px 0 6px; flex: none; }
.cam-country-chip { background: var(--surface); border-radius: 999px; padding: 6px 14px; white-space: nowrap; font-weight: 600; font-size: 14px; }
.cam-country-chip.on { background: var(--surface2); box-shadow: inset 0 0 0 1px var(--muted); }
.cam-country-chip:focus { background: var(--glass-focus, var(--focus)); color: var(--on-glass-focus, #000); }
.cam-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-bottom: 16px; }
.cam-group { color: var(--muted); font-weight: 700; font-size: 13px; padding: 8px 4px 2px; }
.cam-row { display: flex; align-items: center; gap: 12px; text-align: left; padding: 6px 10px; border-radius: 10px; }
.cam-row:hover { background: rgba(255,255,255,.08); }
.cam-row.on { background: var(--surface2); }
.cam-thumb { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; background: var(--surface); flex: none; }
.cam-flag { font-size: 20px; }
.cam-row-text { flex: 1; min-width: 0; }
.cam-row-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam-row-city { color: var(--muted); font-size: 13px; }
.cam-fav { color: var(--secondary); }

/* ---------- Radio ---------- */
.radio-frame { flex: 1; width: 100%; border: 0; background: var(--bg); }

/* ---------- My Cameras ---------- */
.cam-count { color: var(--muted); font-size: 14px; }
.cam-empty-page { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 24px; max-width: 760px; margin: 0 auto; }
.cam-empty-page p { color: var(--muted); line-height: 1.45; }
.cam-big { font-size: 64px; }
.cam-wall { flex: 1; display: grid; gap: 4px; padding: 4px; background: #000; }
.cam-tile { position: relative; overflow: hidden; background: #111; min-height: 0; padding: 0; }
.cam-tile:focus { box-shadow: inset 0 0 0 3px var(--glass-focus, var(--focus)); }
.cam-tile .player { position: absolute; inset: 0; }
.cam-note { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px; color: #fff; font-weight: 600; }
.cam-label, .cam-full-label { position: absolute; left: 10px; bottom: 8px; z-index: 4; display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.6); color: #fff; font-weight: 700; font-size: 14px; padding: 4px 10px; border-radius: 10px; }
.cam-full-label { left: 16px; bottom: 16px; font-size: 17px; }
.cam-dot { width: 9px; height: 9px; border-radius: 50%; background: #2ecc71; display: inline-block; }
.cam-dot.off { background: #888; }
.cam-change { position: absolute; right: 10px; top: 8px; z-index: 4; background: var(--secondary); color: #000; font-weight: 800; padding: 3px 10px; border-radius: 8px; }
.cam-form { display: flex; flex-direction: column; gap: 10px; }
.cam-kinds { display: flex; flex-direction: column; gap: 6px; }
.cam-field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.cam-input { background: var(--bg); color: var(--text); border: 1px solid var(--glass-edge, var(--surface2)); border-radius: 10px; padding: 9px 12px; font: inherit; outline: none; }
.cam-input:focus { border-color: var(--glass-focus, var(--focus)); }
.cam-help { color: var(--muted); font-size: 13px; margin: 0; }
.cam-mjpeg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.cam-full { position: absolute; inset: 0; z-index: 20; background: #000; }
.cam-full-hint { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 10px; white-space: pre; }
.wyze-page { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.wyze-cover { position: absolute; inset: 0; z-index: 3; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff; }
.wyze-note { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 5; max-width: 70%; background: rgba(0,0,0,.8); color: #fff; padding: 10px 18px; border-radius: 12px; text-align: center; }

/* ---------- Browser ---------- */
.browser-address { max-width: none; min-width: 200px; }
.browser .section-actions { flex-wrap: nowrap; }
.browser-start { flex: 1; overflow-y: auto; padding: 0 24px 24px; }
.browser-start h1 { margin: 6px 0 2px; font-size: 26px; }
.browser-start h3 { margin: 20px 0 8px; }
.browser-page { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
/* Hidden, not display:none: a webview that isn't laid out may not load. */
.browser-page.off { visibility: hidden; pointer-events: none; }
.browser-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.browser-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; background: var(--surface); border-radius: var(--radius); text-align: center; }
.browser-tile:hover { background: var(--surface2); }
.browser-tile:focus { transform: scale(1.05); }
.browser-icon { font-size: 26px; }
.browser-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* 🦉 Nexi's chat (owner, 2026-10-27): the same Nexi as the TV's browser and every website. */
.nexi { display: flex; flex-direction: column; gap: 10px; }
.nexi-log { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; min-height: 160px; overflow-y: auto; padding: 4px 2px; }
.nexi-msg { align-self: flex-start; max-width: 88%; padding: 9px 12px; border-radius: 14px; background: var(--surface2); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.nexi-msg.me { align-self: flex-end; background: var(--primary); color: #fff; }
.nexi-msg.muted { color: var(--muted); }
.nexi-msg .btn { margin-top: 8px; }
.nexi-form { display: flex; gap: 8px; }
.nexi-input { flex: 1; max-width: none; }
