/* live-v2.css — three-column Live TV layout
   ┌──────────┬─────────────────────────┬──────────────┐
   │ Groups   │ Preview video (16:9)    │ Channels     │
   │ (left)   ├─────────────────────────┤ for selected │
   │          │ EPG for selected ch     │ group        │
   └──────────┴─────────────────────────┴──────────────┘ */

#page-live.page.active .live-v2 { display: grid; }

.live-v2 {
    display: grid;
    grid-template-columns: 320px 1fr 380px;
    grid-template-rows: 1fr;
    gap: 1px;
    height: calc(100vh - 60px);
    background: var(--color-border);
    overflow: hidden;
}

/* ===== Shared panel structure ===== */
.lv2-panel {
    background: var(--color-bg-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.lv2-panel-head {
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    flex-shrink: 0;
}

.lv2-panel-head h3 {
    margin: 0 0 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--color-text-secondary);
}

.lv2-search {
    width: 100%;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 13px;
}

.lv2-search:focus { outline: none; border-color: var(--color-accent); }

.lv2-panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

/* ===== Groups column (left) ===== */
.lv2-group-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background .12s;
}
.lv2-group-item:hover { background: var(--color-bg-hover); }
.lv2-group-item.active {
    background: var(--color-accent-dim);
    box-shadow: inset 3px 0 0 var(--color-accent);
}
.lv2-group-name { font-size: 13px; color: var(--color-text-primary); }
.lv2-group-count { font-size: 11px; color: var(--color-text-muted); }

/* ===== Channels column (right) ===== */
.lv2-channel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    transition: background .12s;
}
.lv2-channel-item:hover { background: var(--color-bg-hover); }
.lv2-channel-item.active {
    background: var(--color-accent-dim);
    box-shadow: inset 3px 0 0 var(--color-accent);
}
.lv2-channel-logo {
    width: 32px; height: 32px;
    object-fit: contain;
    background: var(--color-bg-tertiary);
    border-radius: 4px;
    flex-shrink: 0;
}
.lv2-channel-meta { flex: 1 1 auto; min-width: 0; }
.lv2-channel-name {
    font-size: 13px;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.lv2-channel-now {
    font-size: 11px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin-top: 2px;
}
.lv2-channel-num {
    font-size: 11px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.lv2-channel-fav {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    margin-left: 4px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color .12s, transform .08s;
}
.lv2-channel-fav:hover { color: #f5c518; transform: scale(1.15); }
.lv2-channel-fav.is-on { color: #f5c518; }

/* ===== Main area (center): preview top + epg bottom ===== */
.lv2-main {
    background: var(--color-bg-primary);
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 1px;
    min-width: 0;
    overflow: hidden;
}

.lv2-preview {
    position: relative;
    background: #000;
    overflow: hidden;
    cursor: pointer;
}

/* Our own <video id="lv2-video"> — fill the preview slot, centered. */
.lv2-preview > #lv2-video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: #000;
    display: block;
}

.lv2-preview-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
}

.lv2-preview-empty {
    color: var(--color-text-secondary);
    font-size: 14px;
    text-align: center;
}

.lv2-preview-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 18px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,.7);
}

.lv2-preview-hint {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity .2s;
}
.lv2-preview:hover .lv2-preview-hint { opacity: 1; }

/* ===== EPG list (center bottom) ===== */
.lv2-epg {
    background: var(--color-bg-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.lv2-epg-head {
    padding: 10px 18px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.lv2-epg-head h3 {
    margin: 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--color-text-secondary);
}
.lv2-epg-body {
    flex: 1 1 auto;
    overflow-y: auto;
}
.lv2-epg-item {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    gap: 14px;
    align-items: start;
    padding: 9px 18px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background .12s;
}
.lv2-epg-item:hover { background: var(--color-bg-hover); }
.lv2-epg-item.is-live {
    background: var(--color-accent-dim);
    box-shadow: inset 3px 0 0 var(--color-accent);
}
.lv2-epg-item.is-past { opacity: .55; }
.lv2-epg-time {
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
}
.lv2-epg-title {
    font-size: 13px;
    color: var(--color-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lv2-epg-subtitle {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lv2-epg-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.lv2-epg-tag {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: .3px;
}
.lv2-epg-tag.is-category { background: rgba(99, 102, 241, .18); color: var(--color-accent); }
.lv2-epg-tag.is-episode { background: rgba(245, 197, 24, .18); color: #f5c518; }
.lv2-epg-item.is-expanded .lv2-epg-desc {
    display: block;
}
.lv2-epg-desc {
    display: none;
    grid-column: 1 / -1;
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--color-bg-secondary);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-secondary);
    white-space: normal;
}
.lv2-epg-desc small {
    display: block;
    margin-top: 6px;
    color: var(--color-text-muted);
    font-size: 11px;
}
.lv2-epg-rich {
    grid-column: 1 / -1;
    display: none;
    margin-top: 10px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 12px;
    gap: 14px;
}
.lv2-epg-item.is-expanded .lv2-epg-rich { display: grid; grid-template-columns: 110px 1fr; }
.lv2-epg-rich.is-loading { color: var(--color-text-secondary); }
.lv2-epg-rich-poster {
    aspect-ratio: 2/3;
    background: #0a0a0f center/cover no-repeat;
    border-radius: 6px;
}
.lv2-epg-rich-body h4 {
    margin: 0 0 4px;
    color: var(--color-text-primary);
    font-size: 15px;
}
.lv2-epg-rich-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    align-items: center;
}
.lv2-epg-rich-rating {
    background: rgba(245, 197, 24, .18);
    color: #f5c518;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}
.lv2-epg-rich-overview {
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-text-secondary);
    white-space: normal;
}
.lv2-epg-rich-cast-btn {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.lv2-epg-rich-cast-btn:hover { background: var(--color-bg-hover); }
.lv2-epg-now-badge {
    background: var(--color-error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
    padding: 2px 7px;
    border-radius: 4px;
}
/* Yellow timeline at the bottom of the NOW row — shows elapsed/total */
.lv2-epg-item.is-live { position: relative; }
.lv2-epg-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,.08);
    z-index: 2;
}
.lv2-epg-progress-fill {
    height: 100%;
    background: #f5c518;
    position: relative;
    transition: width .6s ease;
}
.lv2-epg-progress-fill::after {
    content: '';
    position: absolute;
    right: -5px;
    top: -3px;
    width: 9px;
    height: 9px;
    background: #f5c518;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(245, 197, 24, .9);
}

.lv2-empty {
    padding: 40px 20px;
    color: var(--color-text-secondary);
    text-align: center;
    font-size: 13px;
}

/* Loading spinner shown while groups/channels load */
.lv2-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    padding: 40px 20px;
    color: var(--color-text-secondary);
    font-size: 13px;
}
.lv2-spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: lv2-spin .8s linear infinite;
}
@keyframes lv2-spin { to { transform: rotate(360deg); } }

/* Hide the OLD legacy live layout so v2 is the only one */
#page-live .home-layout { display: none !important; }

/* Mobile collapse */
@media (max-width: 900px) {
    .live-v2 {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: auto;
        /* Mobile: let the outer #page-live handle scroll. Without this the desktop
           rule `overflow: hidden` clips the stacked panels so the page can't scroll. */
        overflow: visible;
    }
    .lv2-panel { max-height: 200px; }
    .lv2-main { grid-template-rows: auto auto; overflow: visible; }
    .lv2-preview { aspect-ratio: 16/9; }
    .lv2-epg { overflow: visible; }
}

/* ============================================================
   FULLSCREEN MODE — toggled by .lv2-fs on .live-v2
   ============================================================ */
.live-v2.lv2-fs > aside, .live-v2.lv2-fs .lv2-epg { display: none !important; }
.live-v2.lv2-fs {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: 100vh;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: #000;
}
.live-v2.lv2-fs .lv2-main { grid-template-rows: 1fr; }
.live-v2.lv2-fs .lv2-preview { cursor: default; }
.live-v2.lv2-fs .lv2-preview-hint { display: none; }
.live-v2.lv2-fs #lv2-video { height: 100vh; }

.lv2-fs-overlay {
    position: fixed;
    inset: 0;
    z-index: 9100;
    pointer-events: none;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    transition: opacity .2s;
    opacity: 1;
}
.live-v2.lv2-fs .lv2-fs-overlay { display: flex; }
.lv2-fs-overlay.is-hidden { opacity: 0; }

.lv2-fs-top, .lv2-fs-bottom {
    pointer-events: auto;
    color: #fff;
    padding: 16px 22px;
}
.lv2-fs-top {
    background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    display: flex;
    align-items: center;
    gap: 14px;
}
/* Channel name now lives centered at the top of the bottom control panel. */
.lv2-fs-bottom .lv2-fs-channel {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.lv2-fs-bottom .lv2-fs-channel small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255,255,255,.6);
    letter-spacing: .3px;
    margin-top: 2px;
}
.lv2-fs-body {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: end;
}
/* Top timeline row: start · yellow progress bar · end · live clock */
.lv2-fs-timeline {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,.85);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    margin: 0 0 14px;
}
.lv2-fs-tl-start, .lv2-fs-tl-end { color: #f5c518; font-weight: 600; }
.lv2-fs-tl-bar {
    position: relative;
    height: 5px;
    background: rgba(255,255,255,.12);
    border-radius: 3px;
    overflow: hidden;
}
.lv2-fs-tl-fill {
    height: 100%;
    background: #f5c518;
    transition: width 1s linear;
    position: relative;
}
.lv2-fs-tl-fill::after {
    content: '';
    position: absolute;
    right: -5px;
    top: -3px;
    width: 11px;
    height: 11px;
    background: #f5c518;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(245,197,24,.9);
}
.lv2-fs-tl-clock {
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    padding-left: 14px;
    border-left: 1px solid rgba(255,255,255,.15);
}
.lv2-fs-back {
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    width: 44px; height: 44px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.lv2-fs-back:hover { background: rgba(255,255,255,0.15); }
.lv2-fs-channel { font-size: 18px; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,0.8); }
.lv2-fs-channel small { display: block; font-size: 12px; font-weight: 400; opacity: .75; margin-top: 2px; }

.lv2-fs-bottom {
    /* Real semi-transparent panel so you can SEE that controls are sitting on a bar,
       not just floating over the video. backdrop-filter blurs the video behind it.
       Inset a bit from the edges so it doesn't run all the way to the screen border. */
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    /* Poster left-edge + everything else right. The poster column is invisible (no
       width) until TMDB returns an image, then it expands to 120px so it doesn't
       leave dead space for channels without artwork. */
    display: grid;
    grid-template-columns: 0 1fr;
    gap: 0;
    margin: 0 18px 18px;
    border-radius: 10px;
    padding: 14px 28px 14px 22px;
    transition: grid-template-columns .25s;
}
.lv2-fs-bottom:has(.lv2-fs-poster.has-img) { grid-template-columns: 120px 1fr; gap: 18px; }
.lv2-fs-poster {
    aspect-ratio: 2/3;
    background: center / cover no-repeat #1a1a22;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.08);
    align-self: end;
    opacity: 0;
    transition: opacity .25s;
}
.lv2-fs-poster.has-img { opacity: 1; }
.lv2-fs-content { min-width: 0; } /* let inner grids shrink */
/* Two-column EPG in fullscreen: NOW (with details) | NEXT SHOW (3 titles) */
.lv2-fs-progs {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 24px;
    max-width: 980px;
}
.lv2-fs-now { color: #fff; }
.lv2-fs-now-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 12px;
}
.lv2-fs-now-badge {
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
    padding: 2px 7px;
    border-radius: 4px;
}
.lv2-fs-next-tag {
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.7);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .5px;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
}
.lv2-fs-dur { color: rgba(255,255,255,.55); font-size: 11px; }
.lv2-fs-now-title { font-size: 18px; font-weight: 600; line-height: 1.25; }
.lv2-fs-now-sub { font-size: 13px; color: rgba(255,255,255,.7); margin-top: 2px; font-style: italic; }
.lv2-fs-now-desc {
    font-size: 12px;
    color: rgba(255,255,255,.7);
    line-height: 1.45;
    margin-top: 8px;
    max-height: 4.8em;
    overflow: hidden;
}
.lv2-fs-next {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    padding: 10px 12px;
    align-self: start;
}
.lv2-fs-next-head {
    font-size: 11px;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: rgba(255,255,255,.55);
    margin-bottom: 6px;
}
.lv2-fs-next-row {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 8px;
    font-size: 13px;
    color: #d4d4d4;
    padding: 3px 0;
}
.lv2-fs-next-row + .lv2-fs-next-row { border-top: 1px solid rgba(255,255,255,.05); }
.lv2-fs-next-title { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv2-fs-next-empty { color: rgba(255,255,255,.4); font-size: 12px; font-style: italic; }
.lv2-fs-progs .lv2-fs-time { color: #f5c518; font-variant-numeric: tabular-nums; }
.lv2-fs-controls { display: flex; gap: 10px; align-items: center; }

.lv2-fs-btn {
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    height: 40px;
    padding: 0 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.lv2-fs-btn:hover { background: rgba(255,255,255,0.15); }
.lv2-fs-btn.is-on { background: var(--color-accent); border-color: var(--color-accent); }
.lv2-fs-iconbtn {
    width: 40px; padding: 0; justify-content: center;
}

.lv2-fs-menu {
    position: absolute;
    bottom: 60px;
    right: 22px;
    background: rgba(20,20,25,0.96);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    min-width: 180px;
    max-width: 260px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 6px;
    pointer-events: auto;
    display: none;
}
.lv2-fs-menu.is-open { display: block; }
.lv2-fs-menu-option {
    background: transparent;
    border: none;
    color: #fff;
    text-align: left;
    width: 100%;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}
.lv2-fs-menu-option:hover { background: rgba(255,255,255,0.08); }
.lv2-fs-menu-option.is-active { background: var(--color-accent); }

.lv2-fs-hint {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: rgba(255,255,255,.55);
    pointer-events: none;
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,.9);
    z-index: 9200;
    background: rgba(0,0,0,.5);
    padding: 4px 14px;
    border-radius: 999px;
    backdrop-filter: blur(6px);
}
/* Leave room above the hint pill so EPG/controls don't collide with it */
.lv2-fs-bottom { padding-bottom: 22px; }
.live-v2.lv2-fs .lv2-fs-hint { bottom: 4px; }

/* === Fullscreen player console — compact mobile === */
@media (max-width: 900px), (max-height: 540px) {
    .live-v2.lv2-fs .lv2-fs-bottom {
        margin: 0 10px 10px;
        padding: 8px 12px 12px;
        border-radius: 8px;
    }
    /* Channel title row */
    .lv2-fs-bottom .lv2-fs-channel { font-size: 13px; margin-bottom: 6px; }
    .lv2-fs-bottom .lv2-fs-channel small { font-size: 10px; margin-top: 1px; }

    /* Poster column — shrink + always invisible until image, no reserved space. */
    .lv2-fs-poster { display: none; }
    .lv2-fs-bottom { grid-template-columns: 1fr !important; padding-left: 12px; }

    /* Timeline row */
    .lv2-fs-timeline {
        gap: 6px;
        font-size: 10px;
        margin: 0 0 8px;
    }
    .lv2-fs-tl-clock { font-size: 11px; padding-left: 8px; }
    .lv2-fs-tl-bar { height: 3px; }
    .lv2-fs-tl-fill::after { width: 7px; height: 7px; right: -3px; top: -2px; }

    /* NOW + NEXT grid: stack vertically on phones (was 1.4fr | 1fr) */
    .lv2-fs-progs { grid-template-columns: 1fr; gap: 8px; }
    .lv2-fs-now-title { font-size: 14px; }
    .lv2-fs-now-sub { font-size: 11px; }
    .lv2-fs-now-desc { font-size: 11px; max-height: 3.6em; margin-top: 4px; }
    .lv2-fs-now-head { font-size: 10px; gap: 6px; margin-bottom: 3px; }
    .lv2-fs-now-badge, .lv2-fs-next-tag { font-size: 9px; padding: 1px 5px; }

    .lv2-fs-next {
        padding: 6px 8px;
        border-radius: 6px;
    }
    .lv2-fs-next-head { font-size: 9px; margin-bottom: 3px; }
    .lv2-fs-next-row { font-size: 11px; padding: 2px 0; gap: 6px; grid-template-columns: 40px 1fr; }

    /* Body: stack info + controls so buttons fit phone width */
    .lv2-fs-body { grid-template-columns: 1fr; gap: 8px; }
    .lv2-fs-controls { gap: 6px; flex-wrap: wrap; justify-content: center; }
    .lv2-fs-btn { height: 32px; padding: 0 10px; font-size: 11px; }
    .lv2-fs-iconbtn { width: 32px; }

    /* Top back-button + bottom hint compact */
    .lv2-fs-top { padding: 8px 12px; }
    .lv2-fs-back { width: 36px; height: 36px; font-size: 18px; }
    .lv2-fs-hint { font-size: 9px; padding: 3px 10px; }
}

/* === Fix: clicks pass through to video when fullscreen panel is hidden === */
/* Panel pieces have pointer-events:auto so their buttons work. But when the
   overlay is .is-hidden the panel is invisible yet still steals clicks. Disable
   pointer-events on the panel pieces when hidden so a tap reaches #lv2-video
   and the toggle-click logic in JS can re-open the panel. */
.lv2-fs-overlay.is-hidden .lv2-fs-top,
.lv2-fs-overlay.is-hidden .lv2-fs-bottom,
.lv2-fs-overlay.is-hidden .lv2-fs-hint {
    pointer-events: none !important;
}

/* === Picture-in-Picture button on the small Live TV preview === */
.lv2-preview-pip {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(6px);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    opacity: .85;
    transition: opacity .12s, background .12s;
}
.lv2-preview-pip:hover { opacity: 1; background: rgba(0,0,0,0.75); }
.lv2-preview-pip svg { display: block; }
/* Hide it once the user is in fullscreen — the bigger ⛶ PiP button in the
   control panel takes over. */
.live-v2.lv2-fs .lv2-preview-pip { display: none; }
