:root {
    --bg: #080a0d;
    --bg-panel: #101319;
    --bg-elev: #181c25;
    --bg-hover: #212734;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #f3f5f9;
    --text-muted: #9aa4b5;
    --accent: #0a84ff;
    --accent-hover: #2994ff;
    --accent-soft: rgba(10, 132, 255, 0.16);
    --danger: #e11d48;
    --success: #10b981;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 13.5px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }

button, input { font-family: inherit; }

/* Emil Kowalski UI polish: tactile press, tabular numbers, eased modals */
button:not(:disabled):active { transform: scale(0.97); }
.ch-num, .cat-count, .page-btn, .page-info, .now-num, .cat-tab span, #currentCatCount, #gridCatCount {
    font-variant-numeric: tabular-nums;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.mobile-topbar, .mobile-bottom-nav { display: none; }

.app-shell {
    display: grid;
    grid-template-columns: 76px 300px 1fr;
    height: 100vh;
    width: 100vw;
}
.app-shell.vod-mode {
    grid-template-columns: 76px 1fr;
}
.app-shell.vod-mode .channels-col {
    display: none;
}

/* Coluna 1: Nav Rail (Icon Rail Minimalista) */
.nav-rail {
    background: #0b0e13;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 10px;
    z-index: 20;
}

.brand-mini, .badge-18 {
    background: linear-gradient(135deg, #f43f5e, #be123c);
    color: #fff;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 999px;
    letter-spacing: 0.03em;
}
.brand-mini { margin-bottom: 10px; }

.nav-group { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: #8c96a8;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.16s, color 0.16s, transform 0.12s;
}
.nav-item svg { width: 21px; height: 21px; }
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item.active {
    background: #ffffff;
    color: #0b0e13;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.18);
}
.nav-item[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: 56px;
    top: 50%;
    transform: translateY(-50%);
    background: #1a1f2b;
    color: #fff;
    border: 1px solid var(--border-strong);
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    z-index: 80;
}
.nav-spacer { flex: 1; }

/* Botão Gatilho de Categorias + Popup */
.cat-trigger-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--bg-elev);
    border: 1px solid var(--border-strong);
    color: var(--text);
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: border-color 0.15s, background 0.15s;
}
.cat-trigger-btn:hover { background: var(--bg-hover); border-color: var(--accent); }
.cat-trigger-btn.inline { width: auto; margin-bottom: 0; white-space: nowrap; font-weight: 600; }
.cat-trigger-btn strong { font-weight: 600; }
.cat-trigger-btn .caret { color: var(--text-muted); font-size: 11px; }

.cat-sheet {
    width: 440px;
    max-width: 100%;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    background: #12151c;
    border: none;
    border-radius: 16px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 60px rgba(0, 0, 0, 0.78);
}
.cat-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
}
.cat-sheet-head h2 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
}
.cat-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
}
.cat-close-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.cat-sheet-body {
    padding: 0 14px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cat-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #0b0d12;
    padding: 4px;
    border-radius: 10px;
    gap: 4px;
}
.cat-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 6px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.cat-tab span { opacity: 0.65; font-weight: 500; margin-left: 3px; }
.cat-tab:hover { color: #fff; }
.cat-tab.active { background: #1e232f; color: #fff; }

.cat-list-clean {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cat-list-clean .cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    color: #c5ccd8;
    padding: 11px 12px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, color 0.12s;
}
.cat-list-clean .cat-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.cat-list-clean .cat-item.active { background: rgba(255, 255, 255, 0.1); color: #fff; font-weight: 600; }
.cat-list-clean .cat-count {
    background: transparent;
    padding: 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

.cat-lists-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 10px;
}
.cat-lists-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 12px 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.link-btn {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.categories-col {
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 14px 12px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.pill-adult {
    font-size: 10px;
    font-weight: 700;
    background: rgba(225, 29, 72, 0.16);
    color: #fb7185;
    border: 1px solid rgba(225, 29, 72, 0.35);
    padding: 2px 8px;
    border-radius: 999px;
}

.cat-list { display: flex; flex-direction: column; padding: 8px; gap: 3px; }
.scrollable { overflow-y: auto; flex: 1; min-height: 0; }

.cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.cat-item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item:hover { background: var(--bg-hover); color: var(--text); }
.cat-item.active { background: var(--bg-elev); color: #fff; font-weight: 600; border: 1px solid var(--border); }
.cat-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 7px;
    border-radius: 999px;
    flex-shrink: 0;
}

.cat-divider {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.icon-mini {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--text);
    width: 24px;
    height: 24px;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.icon-mini:hover { background: var(--bg-hover); }

/* Coluna 3: Canais */
.channels-col {
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.search-wrap { padding: 11px 10px; border-bottom: 1px solid var(--border); }
.search-wrap input {
    width: 100%;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.channels-subheader {
    display: flex;
    justify-content: space-between;
    padding: 9px 12px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.channel-list { display: flex; flex-direction: column; padding: 6px; gap: 3px; }

.channel-row {
    display: grid;
    grid-template-columns: 28px 44px 1fr;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: background 0.14s, border-color 0.14s;
}
.channel-row:hover { background: var(--bg-hover); }
.channel-row.active { background: var(--bg-elev); border-color: var(--border-strong); }

.ch-num { font-size: 11px; font-weight: 600; color: var(--text-muted); text-align: right; }
.ch-thumb {
    width: 44px;
    height: 30px;
    border-radius: 6px;
    background: #1b202b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fb7185;
    overflow: hidden;
}
.ch-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ch-meta { min-width: 0; }
.ch-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Coluna 4: Stage / Player */
.stage-col {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    padding: 16px 20px;
    min-width: 0;
    min-height: 0;
}

.status-banner {
    display: none;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fcd34d;
    padding: 8px 12px;
    border-radius: 9px;
    margin-bottom: 10px;
    font-size: 12.5px;
}
.status-banner.visible { display: flex; justify-content: space-between; align-items: center; }

.stage-view { display: none; flex-direction: column; height: 100%; min-height: 0; }
.stage-view.active { display: flex; }

.player-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.now-playing { display: flex; align-items: center; gap: 10px; min-width: 0; }
.now-num { color: var(--text-muted); font-weight: 700; font-size: 13px; }
.now-logo {
    width: 40px; height: 28px; border-radius: 6px; background: var(--bg-elev);
    display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fb7185;
    overflow: hidden; flex-shrink: 0;
}
.now-logo img { width: 100%; height: 100%; object-fit: cover; }
.now-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-sub { font-size: 11.5px; color: var(--text-muted); }

.sync-pill {
    font-size: 11.5px;
    font-weight: 500;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--text-muted);
    white-space: nowrap;
}

.video-box {
    position: relative;
    flex: 1;
    min-height: 240px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.video-box video { width: 100%; height: 100%; object-fit: contain; background: #000; }

.video-overlay-msg {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.58);
    color: var(--text-muted);
    pointer-events: none;
    padding: 16px;
    text-align: center;
}
.video-overlay-msg.hidden { display: none; }

.spinner {
    width: 34px; height: 34px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.player-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 2px;
    gap: 10px;
    flex-wrap: wrap;
}
.controls-left, .controls-right { display: flex; align-items: center; gap: 8px; }
.live-badge {
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
}
.ctrl-btn {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 11px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    transition: background 0.15s;
}
.ctrl-btn:hover { background: var(--bg-hover); }

.info-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    gap: 12px;
}
.info-text { color: var(--text-muted); font-size: 13px; }
.info-actions { display: flex; gap: 8px; flex-shrink: 0; }

.action-btn {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 13px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
}
.action-btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.action-btn.active { border-color: var(--accent); color: #60a5fa; background: var(--accent-soft); }

.shortcuts-bar {
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Grade de Filmes / Capas lado a lado */
.grid-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.grid-title { font-family: var(--font-display); font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.grid-controls { display: flex; align-items: center; gap: 10px; }
.grid-search {
    width: 300px;
    max-width: 100%;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 14px;
    border-radius: 9px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.grid-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.poster-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-auto-rows: max-content;
    gap: 12px;
    align-content: start;
    padding-right: 4px;
}

.poster-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 0;
    margin: 0;
    font-family: inherit;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    min-height: 210px;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.poster-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}
.poster-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}

.poster-cover {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #161a24, #0f1218);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fb7185;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 18px;
}
.poster-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.28s ease;
}
.poster-card:hover .poster-cover img { transform: scale(1.05); }

.poster-play-hover {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    opacity: 0;
    transition: opacity 0.16s;
    z-index: 3;
}
.poster-card:hover .poster-play-hover { opacity: 1; }

.poster-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.14);
    color: #fbbf24;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    z-index: 2;
}

.poster-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 48px 10px 14px;
    /* Eased gradient stops to avoid a visible edge */
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.96) 0%,
        rgba(0, 0, 0, 0.88) 28%,
        rgba(0, 0, 0, 0.62) 56%,
        rgba(0, 0, 0, 0.24) 80%,
        rgba(0, 0, 0, 0) 100%
    );
    z-index: 2;
}
.poster-name {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    padding-bottom: 2px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 1);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 0 4px;
    border-top: 1px solid var(--border);
    margin-top: 12px;
}
.page-btn {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
}
.page-btn:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn:disabled { opacity: 0.35; cursor: default; }
.page-info { font-size: 12px; color: var(--text-muted); margin: 0 8px; }

/* Multitela */
.multi-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    min-height: 0;
}
.multi-slot {
    position: relative;
    background: #000;
    border: 2px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}
.multi-slot.active { border-color: var(--accent); }
.multi-slot video { width: 100%; height: 100%; object-fit: contain; }
.slot-label {
    position: absolute;
    top: 8px; left: 8px; z-index: 2;
    background: rgba(0,0,0,0.75);
    padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 600;
}

/* Modais */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.76);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 120;
    padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-backdrop.open .modal-card {
    animation: modalIn 180ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.modal-card {
    width: 520px; max-width: 100%;
    background: var(--bg-panel);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
}
.modal-card.small { width: 360px; }

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; }

.modal-body {
    padding: 18px;
    display: flex; flex-direction: column; gap: 12px;
}
.modal-body label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-muted); }
.modal-body input[type="text"],
.modal-body input[type="url"],
.modal-body input[type="password"] {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 13px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkbox-row { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--text) !important; }

.sync-status-box {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 12px;
    color: var(--text-muted);
}

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.primary-btn {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 9px 15px;
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
}
.primary-btn:hover { background: var(--accent-hover); }
.list-picker { display: flex; flex-direction: column; gap: 6px; }

/* Tablet */
@media (max-width: 1280px) {
    .poster-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
    .app-shell { grid-template-columns: 76px 240px 1fr; }
    .app-shell.vod-mode { grid-template-columns: 76px 1fr; }
    .poster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Mobile */
@media (max-width: 768px) {
    html, body { overflow: hidden; }

    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 52px;
        padding: 0 12px;
        background: #0b0e13;
        border-bottom: 1px solid var(--border);
        position: fixed;
        top: 0; left: 0; right: 0;
        z-index: 50;
    }
    .mobile-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: 15px; }
    .mobile-brand .brand-name { display: inline; }
    .mobile-icon-btn {
        background: var(--bg-elev);
        border: 1px solid var(--border);
        color: var(--text);
        width: 36px; height: 36px;
        border-radius: 9px;
        font-size: 16px;
        cursor: pointer;
    }

    .nav-rail { display: none; }
    .cat-popup-grid { grid-template-columns: 1fr; }

    .app-shell, .app-shell.vod-mode {
        display: flex;
        flex-direction: column;
        height: 100vh;
        padding-top: 52px;
        padding-bottom: 58px;
    }

    /* Na TV ao vivo mobile: Player em cima, lista de canais embaixo */
    .stage-col {
        order: 1;
        padding: 10px 12px;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }
    .channels-col {
        order: 2;
        height: 42vh;
        flex-shrink: 0;
        border-right: none;
        border-top: 1px solid var(--border);
    }
    .app-shell.vod-mode .stage-col { height: 100%; }

    .video-box { min-height: 200px; max-height: 36vh; }
    .shortcuts-bar, .sync-pill { display: none; }
    .info-card { flex-direction: column; align-items: flex-start; padding: 10px 12px; }

    .grid-topbar { flex-direction: column; align-items: stretch; gap: 10px; }
    .grid-controls { width: 100%; }
    .grid-search { width: 100%; flex: 1; }
    #viewGrid { height: auto; min-height: 100%; }
    .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; flex: none; overflow: visible; }
    .poster-card { min-height: 230px; }

    .form-row { grid-template-columns: 1fr; }

    .mobile-bottom-nav {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 60px;
        background: #0b0e13;
        border-top: 1px solid var(--border);
        z-index: 50;
    }
    .mob-nav-btn {
        background: transparent;
        border: none;
        color: #8c96a8;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        cursor: pointer;
    }
    .mob-nav-btn svg { width: 20px; height: 20px; }
    .mob-nav-btn small { font-size: 10.5px; font-weight: 600; }
    .mob-nav-btn.active { color: #ffffff; }
    .mob-nav-btn.active svg {
        background: #ffffff;
        color: #0b0e13;
        padding: 4px;
        width: 28px;
        height: 28px;
        border-radius: 50%;
    }
}
