/* ============================================================
   BASE
   ============================================================ */
:root {
    color-scheme: dark;
    --bg: #050505;
    --bg-soft: #0b0b0f;
    --surface: #121217;
    --surface-2: #19191f;
    --line: rgba(255,255,255,.11);
    --line-strong: rgba(255,255,255,.18);
    --text: #f5f5f7;
    --muted: #a8a8b3;
    --muted-2: #777783;
    --red: #e50914;
    --red-2: #b20710;
    --green: #3ddc84;
    --shadow: 0 24px 70px rgba(0,0,0,.48);
    --mobile-nav-height: 60px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { border: 0; }
[hidden] { display: none !important; }

/* ============================================================
   VIEWER LAYOUT
   ============================================================ */
.viewer-body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(180deg, rgba(229,9,20,.13) 0, rgba(5,5,5,0) 340px),
        radial-gradient(circle at 72% 0%, rgba(229,9,20,.13), transparent 28rem),
        linear-gradient(180deg, #050505 0%, #09090d 44%, #050505 100%);
    color: var(--text);
}
.viewer-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255,255,255,.018) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.4), transparent 60%);
}

/* Navbar */
.viewer-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 60px;
    padding: 0 4%;
    background: linear-gradient(180deg, rgba(0,0,0,.88) 0%, transparent 100%);
    transition: background .3s ease;
}
.viewer-nav.scrolled {
    background: rgba(5,5,5,.97);
    backdrop-filter: blur(22px) saturate(1.3);
    -webkit-backdrop-filter: blur(22px) saturate(1.3);
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.viewer-nav-inner {
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}
.viewer-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 900;
}
.viewer-logo-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background:
        radial-gradient(circle at 30% 18%, rgba(255,255,255,.24), transparent 32%),
        linear-gradient(135deg, var(--red), var(--red-2));
    color: #fff;
    font-weight: 950;
    font-size: .88rem;
    box-shadow: 0 8px 24px rgba(229,9,20,.38);
}

/* Nav links: hidden on mobile, shown on desktop */
.viewer-nav-links {
    display: none;
    align-items: center;
    gap: 2px;
    flex: 1;
}
.viewer-nav-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 8px;
    color: rgba(255,255,255,.72);
    font-size: .88rem;
    font-weight: 800;
    white-space: nowrap;
    transition: color .18s ease, background .18s ease;
}
.viewer-nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.viewer-nav-link.active { color: #fff; background: rgba(255,255,255,.1); position: relative; }
.viewer-nav-link.active::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 5px;
    height: 2px;
    border-radius: 999px;
    background: var(--red);
    box-shadow: 0 0 12px rgba(229,9,20,.7);
}
.viewer-nav-right {
    display: none;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}
.viewer-admin-btn {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid rgba(229,9,20,.45);
    border-radius: 7px;
    background: rgba(229,9,20,.1);
    color: #ffb4b9;
    font-size: .8rem;
    font-weight: 850;
    transition: background .18s ease, border-color .18s ease;
}
.viewer-admin-btn:hover { background: rgba(229,9,20,.2); border-color: rgba(229,9,20,.75); color: #fff; }
.viewer-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255,255,255,.16), transparent), #18181f;
    color: #fff;
    font-size: .82rem;
    font-weight: 900;
    border: 1px solid rgba(255,255,255,.13);
    cursor: default;
    flex-shrink: 0;
}
.viewer-logout-btn {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 7px;
    background: rgba(255,255,255,.035);
    color: var(--muted);
    cursor: pointer;
    font-size: .82rem;
    font-weight: 820;
    transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.viewer-logout-btn:hover { border-color: rgba(229,9,20,.48); background: rgba(229,9,20,.13); color: #fff; }
.viewer-flash {
    position: fixed;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid rgba(61,220,132,.35);
    background: rgba(61,220,132,.15);
    color: #dfffee;
    font-size: .9rem;
    font-weight: 800;
    white-space: nowrap;
    animation: flash-in .25s ease;
    pointer-events: none;
}
.viewer-flash.error { border-color: rgba(229,9,20,.44); background: rgba(229,9,20,.18); color: #ffd7d9; }
@keyframes flash-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.viewer-main {
    position: relative;
    z-index: 1;
    padding-top: 60px;
    padding-bottom: calc(var(--mobile-nav-height) + 16px + env(safe-area-inset-bottom, 0px));
    min-height: 100vh;
}

/* ============================================================
   BOTTOM NAV — mobile by default, hidden on desktop
   ============================================================ */
.mobile-bottom-nav {
    display: flex;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    background: rgba(8,8,12,.96);
    border-top: 1px solid rgba(255,255,255,.09);
    z-index: 120;
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    backdrop-filter: blur(20px) saturate(1.4);
    transform: translateZ(0);
    will-change: transform;
}
.mobile-nav-btn {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(255,255,255,.38);
    text-decoration: none;
    font-size: .58rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 8px 2px calc(8px + env(safe-area-inset-bottom, 0px));
    min-height: var(--mobile-nav-height);
    transition: color .2s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.mobile-nav-icon {
    width: 40px;
    height: 26px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    transition: background .2s ease, transform .18s ease;
    position: relative;
    overflow: hidden;
}
.mobile-nav-icon svg { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }
.mobile-nav-label { line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Active state: pill background on icon */
.mobile-nav-btn.active { color: #fff; }
.mobile-nav-btn.active .mobile-nav-icon { background: rgba(229,9,20,.22); }
.mobile-nav-btn.active .mobile-nav-icon svg { fill: var(--red); }
/* Avatar icon in Conta button */
.mobile-nav-avatar-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,.16), transparent), #18181f;
    border: 1.5px solid rgba(255,255,255,.16);
    font-size: .72rem;
    font-weight: 900;
    color: rgba(255,255,255,.7);
}
.mobile-nav-btn.active .mobile-nav-avatar-icon {
    border-color: var(--red);
    background: rgba(229,9,20,.18);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(229,9,20,.3);
}
.mobile-nav-btn:not(.active):active .mobile-nav-icon { transform: scale(.88); background: rgba(255,255,255,.07); }

/* ============================================================
   MOBILE ACCOUNT SHEET
   ============================================================ */
.mobile-account-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 130;
    background: rgba(0,0,0,.6);
    opacity: 0;
    transition: opacity .28s ease;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.mobile-account-backdrop.open { display: block; opacity: 1; }
.mobile-control-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 130;
    background: rgba(0,0,0,.6);
    opacity: 0;
    transition: opacity .28s ease;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.mobile-control-backdrop.open { display: block; opacity: 1; }

.mobile-account-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 140;
    background: var(--surface);
    border-top: 1px solid var(--line-strong);
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.32,1,.23,1);
    box-shadow: 0 -24px 80px rgba(0,0,0,.6);
    max-height: 85vh;
    overflow-y: auto;
}
.mobile-account-sheet.open { transform: translateY(0); }
.mobile-control-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 140;
    max-height: 85vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--line-strong);
    border-radius: 20px 20px 0 0;
    background: var(--surface);
    box-shadow: 0 -24px 80px rgba(0,0,0,.6);
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.32,1,.23,1);
}
.mobile-control-sheet.open { transform: translateY(0); }

.mobile-account-handle {
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    margin: 12px auto 0;
}
.mobile-account-user {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--line);
}
.mobile-account-avatar {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(229,9,20,.28), rgba(18,18,23,.9));
    border: 2px solid rgba(229,9,20,.4);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 900;
    box-shadow: 0 0 0 4px rgba(229,9,20,.12);
}
.mobile-account-info { min-width: 0; }
.mobile-account-info strong { display: block; font-size: 1rem; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-account-info span { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mobile-account-nav { padding: 10px 12px; }
.mobile-account-item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 52px;
    padding: 0 10px;
    border-radius: 10px;
    color: var(--text);
    font-size: .96rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .16s ease, color .16s ease;
    position: relative;
}
.mobile-account-item:hover,
.mobile-account-item:active { background: rgba(255,255,255,.07); }
.mobile-account-item.active { color: var(--red); background: rgba(229,9,20,.1); }
.mobile-account-item-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 9px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
}
.mobile-account-item-icon svg { width: 18px; height: 18px; fill: currentColor; }
.mobile-account-item.active .mobile-account-item-icon { background: rgba(229,9,20,.15); border-color: rgba(229,9,20,.3); }
.mobile-account-badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(229,9,20,.16);
    border: 1px solid rgba(229,9,20,.35);
    color: #ffb4b9;
    font-size: .68rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.mobile-account-footer {
    padding: 10px 12px 16px;
    border-top: 1px solid var(--line);
    margin-top: 4px;
}
.mobile-account-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(229,9,20,.28);
    background: rgba(229,9,20,.08);
    color: #ffb4b9;
    font-size: .96rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.mobile-account-logout:hover,
.mobile-account-logout:active { background: rgba(229,9,20,.18); border-color: rgba(229,9,20,.55); color: #fff; }
.mobile-account-logout svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.mobile-control-head {
    display: grid;
    gap: 5px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--line);
}
.mobile-control-head h2 {
    font-size: 1.28rem;
}
.mobile-control-head .subtitle {
    font-size: .88rem;
}
.mobile-control-list {
    display: grid;
    gap: 8px;
    padding: 12px;
}
.mobile-control-device {
    min-height: 64px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 12px;
    background: rgba(255,255,255,.055);
}
.mobile-control-device:active {
    background: rgba(229,9,20,.12);
}
.mobile-control-device-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    border: 1px solid rgba(229,9,20,.28);
    background: rgba(229,9,20,.14);
    color: #ffb4b9;
}
.mobile-control-device-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
.mobile-control-device-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}
.mobile-control-device-copy strong {
    overflow: hidden;
    color: var(--text);
    font-size: .98rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mobile-control-device-copy span {
    overflow: hidden;
    color: var(--muted);
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mobile-control-arrow {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255,255,255,.07);
}
.mobile-control-arrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-top: 2px solid rgba(255,255,255,.72);
    border-right: 2px solid rgba(255,255,255,.72);
    transform: translateX(-1px) rotate(45deg);
}
.mobile-control-empty {
    display: grid;
    justify-items: stretch;
    gap: 8px;
    padding: 14px;
    text-align: center;
}
.mobile-control-empty strong {
    color: var(--text);
}

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-body {
    min-height: 100vh;
    margin: 0;
    background: #09090d;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    display: flex;
}
.admin-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .26s ease;
}
.admin-sidebar.open { transform: translateX(0); }
.admin-sidebar-top {
    padding: 20px 16px 14px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}
.admin-brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 900; font-size: .95rem; }
.admin-brand-mark {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 8px;
    background: radial-gradient(circle at 30% 18%, rgba(255,255,255,.24), transparent 32%), linear-gradient(135deg, var(--red), var(--red-2));
    color: #fff; font-weight: 950; font-size: .82rem;
    box-shadow: 0 6px 18px rgba(229,9,20,.32);
}
.admin-badge-pill {
    padding: 2px 8px; border-radius: 999px;
    background: rgba(229,9,20,.16); border: 1px solid rgba(229,9,20,.38);
    color: #ffb4b9; font-size: .68rem; font-weight: 850; text-transform: uppercase; letter-spacing: .07em;
}
.admin-nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 3px; }
.admin-nav-item {
    display: flex; align-items: center; gap: 10px;
    min-height: 44px; padding: 0 12px;
    border-radius: 8px; border: 1px solid transparent;
    color: var(--muted); font-size: .9rem; font-weight: 800;
    transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.admin-nav-item:hover { background: rgba(255,255,255,.07); color: var(--text); }
.admin-nav-item.active { background: rgba(229,9,20,.13); border-color: rgba(229,9,20,.28); color: #fff; }
.admin-nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .75; }
.admin-sidebar-bottom { padding: 14px 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.admin-watch-btn {
    display: flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 0 14px;
    border-radius: 8px; border: 1px solid rgba(229,9,20,.38);
    background: rgba(229,9,20,.1); color: #ffb4b9; font-size: .88rem; font-weight: 850;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.admin-watch-btn:hover { background: rgba(229,9,20,.22); border-color: rgba(229,9,20,.7); color: #fff; }
.admin-user-row { display: flex; align-items: center; gap: 9px; padding: 2px; }
.admin-user-avatar {
    width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px;
    background: linear-gradient(135deg, rgba(255,255,255,.16), transparent), #18181f;
    color: #fff; font-size: .72rem; font-weight: 900; border: 1px solid rgba(255,255,255,.13); flex-shrink: 0;
}
.admin-user-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .82rem; font-weight: 760; }
.admin-logout-btn {
    width: 28px; height: 28px; display: grid; place-items: center;
    border: 1px solid rgba(255,255,255,.09); border-radius: 6px;
    background: rgba(255,255,255,.04); color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1;
    transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.admin-logout-btn:hover { border-color: rgba(229,9,20,.48); background: rgba(229,9,20,.12); color: #fff; }
.admin-layout { flex: 1; margin-left: 0; min-height: 100vh; display: flex; flex-direction: column; }
.admin-flash {
    margin: 18px 20px 0; padding: 11px 14px; border-radius: 8px;
    border: 1px solid rgba(61,220,132,.35); background: rgba(61,220,132,.12); color: #dfffee; font-size: .9rem; font-weight: 800;
}
.admin-flash.error { border-color: rgba(229,9,20,.44); background: rgba(229,9,20,.13); color: #ffd7d9; }
.admin-content { flex: 1; padding: 20px 20px 40px; max-width: 1440px; }

/* ============================================================
   MODE SELECT PAGE
   ============================================================ */
.mode-select-body {
    min-height: 100vh; margin: 0;
    background: linear-gradient(180deg, rgba(229,9,20,.14) 0, rgba(5,5,5,0) 320px), radial-gradient(circle at 65% 10%, rgba(229,9,20,.12), transparent 28rem), #050505;
    color: var(--text); font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    display: grid; place-items: center; padding: 32px 20px;
}
.mode-select-wrap { width: min(640px, 100%); text-align: center; }
.mode-select-header { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 40px; }
.mode-select-logo-mark {
    width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
    background: radial-gradient(circle at 30% 18%, rgba(255,255,255,.24), transparent 32%), linear-gradient(135deg, var(--red), var(--red-2));
    color: #fff; font-size: 1rem; font-weight: 950; box-shadow: 0 12px 32px rgba(229,9,20,.42);
}
.mode-select-logo-text { font-size: 1.4rem; font-weight: 900; letter-spacing: 0; }
.mode-select-greeting { margin: 0 0 8px; color: var(--muted); font-size: 1.05rem; }
.mode-select-greeting strong { color: var(--text); }
.mode-select-title { margin: 0 0 32px; font-size: clamp(1.6rem, 5vw, 2.8rem); font-weight: 900; line-height: .96; letter-spacing: -.01em; }
.mode-select-cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
.mode-card {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 28px 20px; border-radius: 12px; border: 1px solid var(--line);
    background: rgba(18,18,23,.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 18px 50px rgba(0,0,0,.38);
    transition: transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease;
    cursor: pointer;
}
.mode-card:hover, .mode-card:focus-visible {
    transform: translateY(-7px); border-color: rgba(229,9,20,.55); background: rgba(24,12,16,.95);
    box-shadow: 0 32px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(229,9,20,.18); outline: none;
}
.mode-card-icon {
    width: 68px; height: 68px; display: grid; place-items: center; border-radius: 999px;
    background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.22), transparent 40%), linear-gradient(135deg, var(--red), var(--red-2));
    color: #fff; box-shadow: 0 18px 44px rgba(229,9,20,.38);
}
.mode-card-title { font-size: 1.4rem; font-weight: 900; color: var(--text); }
.mode-card-desc { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }

/* ============================================================
   GUEST LAYOUT
   ============================================================ */
.guest-body { min-height: 100vh; margin: 0; background: #050505; color: var(--text); font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.guest-header { position: relative; z-index: 10; padding: 14px 20px; display: flex; align-items: center; }
.guest-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-size: 1rem; font-weight: 900; }
.guest-brand-mark {
    width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px;
    background: radial-gradient(circle at 30% 18%, rgba(255,255,255,.24), transparent 32%), linear-gradient(135deg, var(--red), var(--red-2));
    color: #fff; font-weight: 950; box-shadow: 0 8px 24px rgba(229,9,20,.38);
}
.guest-main { padding: 0; }

/* ============================================================
   SHARED CONTROLS & TYPOGRAPHY
   ============================================================ */
h1 { margin: 0 0 10px; font-size: clamp(1.7rem, 4vw, 4.2rem); line-height: .96; letter-spacing: 0; max-width: 980px; }
h2 { margin: 0; font-size: clamp(1.25rem, 2vw, 1.75rem); line-height: 1.1; letter-spacing: 0; }
.subtitle { margin: 0; color: var(--muted); line-height: 1.55; }
.eyebrow { margin: 0 0 11px; color: #ffb4b9; font-size: .78rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.btn {
    min-height: 44px; max-width: 100%;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 0 16px; border: 1px solid rgba(255,255,255,.12); border-radius: 7px;
    background: rgba(255,255,255,.075); color: var(--text); cursor: pointer;
    font-size: .92rem; font-weight: 760; line-height: 1.1; text-align: center; white-space: normal;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.13); }
.btn.primary { border-color: rgba(229,9,20,.72); background: linear-gradient(180deg, var(--red), var(--red-2)); color: #fff; box-shadow: 0 14px 34px rgba(229,9,20,.24); }
.btn.primary:hover { border-color: rgba(229,9,20,.9); }
.btn.ghost { background: rgba(255,255,255,.055); }
.btn.danger { border-color: rgba(229,9,20,.45); color: #ffb8bc; }

/* ============================================================
   FOCUS STYLES (remote control / keyboard)
   ============================================================ */
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.poster:focus-visible { outline: none; }
.poster:focus-visible .poster-img { outline: 3px solid var(--red); outline-offset: 3px; box-shadow: 0 0 0 6px rgba(229,9,20,.18); }
.tile:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-color: rgba(229,9,20,.6); }
.episode-row:focus-visible { outline: 3px solid var(--red); outline-offset: -2px; border-color: rgba(229,9,20,.7); }
.btn:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

/* ============================================================
   PAGE SHELL
   ============================================================ */
.shell {
    width: min(1440px, calc(100vw - 24px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 14px 0 40px;
}

/* ============================================================
   LAYOUT SECTIONS
   ============================================================ */
.section-head {
    display: flex; align-items: stretch; flex-direction: column;
    justify-content: space-between; gap: 14px; margin: 16px 0 18px;
}
.hero {
    display: flex; align-items: center; flex-direction: column; gap: 16px;
    min-height: 300px; padding: clamp(26px, 5vw, 58px); border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(0,0,0,.88) 0%, rgba(0,0,0,.64) 46%, rgba(0,0,0,.16) 100%),
        linear-gradient(135deg, rgba(229,9,20,.88), rgba(22,22,28,.92) 55%, rgba(5,5,5,.96));
    box-shadow: var(--shadow); overflow: hidden; position: relative;
}
.hero::after {
    content: ""; position: absolute; right: 0; bottom: -2px; left: 0;
    height: 42%; background: linear-gradient(180deg, transparent, rgba(5,5,5,.82)); pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-copy { max-width: 720px; }
.hero-actions, .actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.content-section { margin: 28px 0 0; }
.content-section .section-head { margin: 0 0 15px; }

/* ============================================================
   GRIDS
   ============================================================ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }

/* ============================================================
   CONTINUE WATCHING
   ============================================================ */
.continue-head { display: flex; align-items: stretch; flex-direction: column; gap: 10px; }
.continue-actions { display: flex; gap: 8px; align-items: center; }
.continue-nav { width: 42px; padding: 0; font-size: 1.4rem; line-height: 1; }
.continue-rail {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(132px, 42vw);
    gap: 13px; overflow-x: auto; overflow-y: hidden;
    padding: 2px 2px 16px; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.continue-rail::-webkit-scrollbar { display: none; }
.continue-card, .continue-load-card { scroll-snap-align: start; }
.continue-load-card {
    min-height: 230px; align-items: center; justify-content: center; text-align: center;
    border-style: dashed;
    background: linear-gradient(135deg, rgba(229,9,20,.2), transparent 62%), rgba(18,18,23,.7);
    cursor: pointer;
}
.continue-load-card:hover { transform: translateY(-5px) scale(1.015); border-color: rgba(229,9,20,.46); }
.continue-load-icon {
    width: 54px; height: 54px; display: grid; place-items: center; border-radius: 999px;
    background: rgba(229,9,20,.92); color: #fff; font-size: 2rem; font-weight: 760; line-height: 1;
    box-shadow: 0 18px 42px rgba(229,9,20,.3);
}

/* ============================================================
   CATALOG RAILS
   ============================================================ */
.category-rails { display: grid; gap: 10px; }
.catalog-rail-section { margin-top: 26px; }
.catalog-rail-head { display: flex; align-items: stretch; flex-direction: column; gap: 10px; }
.catalog-rail {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(132px, 42vw);
    gap: 13px; overflow-x: auto; overflow-y: hidden;
    padding: 2px 2px 16px; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.catalog-rail::-webkit-scrollbar { display: none; }
.catalog-rail-card, .catalog-more-card { width: auto; scroll-snap-align: start; }
.catalog-more-card { min-height: 276px; }

/* Scroll fade on rails (mobile) */
[data-continue-section], .catalog-rail-section { position: relative; }
[data-continue-section]::after, .catalog-rail-section::after {
    content: ''; position: absolute; top: 0; right: 0; bottom: 0;
    width: 48px; pointer-events: none; z-index: 2;
    background: linear-gradient(to right, transparent, var(--bg, #050505));
}

/* ============================================================
   TILES & PANELS
   ============================================================ */
.tile, .panel { border: 1px solid var(--line); border-radius: 8px; background: rgba(18,18,23,.78); box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.tile {
    min-height: 132px; display: flex; flex-direction: column; justify-content: space-between;
    gap: 18px; padding: 18px; overflow: hidden;
    transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.tile:hover { transform: translateY(-5px) scale(1.015); border-color: rgba(255,255,255,.24); background: rgba(29,29,36,.92); box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.tile strong { display: block; font-size: 1.08rem; line-height: 1.22; overflow-wrap: anywhere; }
.tile span { color: var(--muted); font-size: .9rem; line-height: 1.4; }
.category-card {
    min-height: 154px;
    background: linear-gradient(135deg, rgba(229,9,20,.36), transparent 58%), linear-gradient(180deg, #1a1a21, #101014);
}
.category-card::before { content: ""; width: 42px; height: 4px; border-radius: 999px; background: var(--red); box-shadow: 0 0 24px rgba(229,9,20,.65); }
.panel { padding: 20px; background: rgba(18,18,23,.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

/* Mobile channel browsing */
.channel-category-grid {
    grid-template-columns: 1fr;
    gap: 9px;
}
.channel-category-card {
    min-height: 72px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background:
        linear-gradient(135deg, rgba(229,9,20,.18), transparent 58%),
        rgba(18,18,23,.86);
}
.channel-category-card::before { display: none; }
.channel-category-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(229,9,20,.18);
    border: 1px solid rgba(229,9,20,.28);
    color: #ffb4b9;
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: .04em;
}
.channel-category-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}
.channel-category-copy strong {
    color: var(--text);
    font-size: .98rem;
    line-height: 1.22;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.channel-category-copy span {
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.2;
}
.channel-card-arrow {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255,255,255,.07);
}
.channel-card-arrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-top: 2px solid rgba(255,255,255,.72);
    border-right: 2px solid rgba(255,255,255,.72);
    transform: translateX(-1px) rotate(45deg);
}
.channel-grid {
    grid-template-columns: 1fr;
    gap: 9px;
}
.channel-card {
    min-height: 76px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 4px 12px;
    align-items: center;
    padding: 10px 12px;
    border-color: rgba(255,255,255,.09);
    background: rgba(18,18,23,.82);
}
.channel-card:hover {
    transform: none;
    background: rgba(27,27,34,.94);
}
.channel-card .poster-img {
    grid-row: 1 / span 2;
    width: 58px;
    aspect-ratio: 1;
    margin: 0;
    border-radius: 12px;
    box-shadow: none;
}
.channel-card .poster-title {
    min-height: 0;
    display: block;
    color: var(--text);
    font-size: .96rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.channel-card .poster-meta {
    min-height: 0;
    justify-content: flex-start;
    gap: 7px;
    margin: 0;
}
.channel-card .poster-meta > span:first-child {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(61,220,132,.12);
    color: #9ff0c3;
    font-size: .72rem;
    font-weight: 850;
}
.channel-card .rating-mini { display: none; }
.channel-card .watch-badge { margin: 0; }

/* ============================================================
   HOME SELECTION
   ============================================================ */
.home-page {
    min-height: calc(100vh - 60px - var(--mobile-nav-height) - env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    padding: 12px 0 18px;
}
.home-welcome { display: grid; gap: 7px; }
.home-welcome h1 { max-width: 360px; margin-bottom: 0; font-size: clamp(2rem, 10vw, 3.3rem); line-height: .96; }
.home-welcome .subtitle { max-width: 320px; font-size: .94rem; }
.home-selection-grid { width: 100%; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 10px; }
.home-selection-card {
    min-height: 118px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    justify-content: initial;
    text-align: left;
    gap: 13px;
    padding: 15px 14px;
    border-color: rgba(255,255,255,.12);
    background:
        radial-gradient(circle at 100% 0%, rgba(255,255,255,.09), transparent 34%),
        linear-gradient(135deg, rgba(229,9,20,.28), transparent 58%),
        linear-gradient(180deg, rgba(26,26,33,.96), rgba(14,14,18,.98));
}
.home-selection-card::before { display: none; }
.home-selection-card strong { margin-top: 2px; color: var(--text); font-size: 1.18rem; }
.home-selection-card:active { transform: scale(.985); }
.home-card-copy { min-width: 0; display: grid; gap: 2px; }
.home-card-eyebrow { color: #ffb4b9; font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.home-card-hint { color: rgba(255,255,255,.62); font-size: .84rem; line-height: 1.35; }
.home-card-action {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.11);
    color: transparent;
    overflow: hidden;
}
.home-card-action::before {
    content: "";
    width: 9px;
    height: 9px;
    border-top: 2px solid rgba(255,255,255,.86);
    border-right: 2px solid rgba(255,255,255,.86);
    transform: translateX(-1px) rotate(45deg);
}
.selection-icon {
    width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px;
    border: 1px solid rgba(255,255,255,.16);
    background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.2), transparent 34%), linear-gradient(135deg, var(--red), var(--red-2));
    box-shadow: 0 18px 42px rgba(229,9,20,.34); color: #fff; position: relative;
}
.selection-icon::before, .selection-icon::after { content: ""; position: absolute; display: block; }
.selection-icon-tv::before { width: 27px; height: 18px; border: 3px solid currentColor; border-radius: 5px; }
.selection-icon-tv::after { width: 16px; height: 3px; border-radius: 999px; background: currentColor; transform: translateY(15px); }
.selection-icon-movie::before { width: 27px; height: 21px; border: 3px solid currentColor; border-radius: 5px; background: linear-gradient(90deg, currentColor 2px, transparent 2px 7px, currentColor 7px 9px, transparent 9px 14px, currentColor 14px 16px, transparent 16px); opacity: .95; }
.selection-icon-movie::after { width: 11px; height: 13px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); transform: translateX(2px); }
.selection-icon-series::before { width: 27px; height: 22px; border: 3px solid currentColor; border-radius: 5px; box-shadow: -6px -6px 0 -3px rgba(255,255,255,.72), 6px 6px 0 -3px rgba(255,255,255,.72); }
.selection-icon-series::after { width: 11px; height: 13px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); transform: translateX(2px); }

/* ============================================================
   POSTERS
   ============================================================ */
.poster { min-height: 285px; padding: 0; background: transparent; border-color: transparent; box-shadow: none; }
.poster:hover { background: transparent; border-color: transparent; box-shadow: none; }
.poster-img {
    width: 100%; aspect-ratio: 2 / 3; display: grid; place-items: center; overflow: hidden;
    border-radius: 8px; background: linear-gradient(145deg, rgba(229,9,20,.34), rgba(27,27,34,.82)), #15151b;
    margin-bottom: 11px; border: 1px solid rgba(255,255,255,.09); box-shadow: 0 20px 50px rgba(0,0,0,.42);
    color: rgba(255,255,255,.76); font-weight: 950; letter-spacing: .08em;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.poster-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease, filter .28s ease; }
.poster-img img[data-fallback-image], .watch-poster img[data-fallback-image], .login-backdrop img[data-fallback-image] { object-fit: cover; filter: none; }
.poster:hover .poster-img img { transform: scale(1.05); filter: saturate(1.08) contrast(1.05); }
.poster:hover .poster-img { border-color: rgba(255,255,255,.22); box-shadow: 0 24px 60px rgba(0,0,0,.58); }
.poster-title { min-height: 42px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); line-height: 1.28; font-weight: 820; }
.poster-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; min-height: 26px; flex-wrap: wrap; }

.movie-head {
    gap: 12px;
    margin-top: 10px;
}
.movie-head h1 {
    font-size: clamp(1.85rem, 9vw, 3rem);
}
.movie-head .subtitle {
    font-size: .92rem;
}
.movie-filter-bar {
    position: sticky;
    top: 60px;
    z-index: 20;
    margin: 0 -2px 16px;
    padding: 8px 2px;
    background: linear-gradient(180deg, rgba(5,5,5,.98), rgba(5,5,5,.82));
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}
.movie-filter-bar .btn {
    min-height: 40px;
    border-radius: 999px;
}
.movie-filter-panel {
    margin: -6px 0 18px;
    padding: 12px;
    border-radius: 14px;
}
.movie-filter-panel .filter-input-row {
    align-items: stretch;
    flex-direction: column;
}
.movie-filter-panel .filter-input-row .btn {
    width: 100%;
}
.movie-rails {
    display: grid;
    gap: 2px;
}
.movie-rail-section {
    margin-top: 20px;
}
.movie-rail-section .catalog-rail-head {
    gap: 8px;
}
.movie-rail-section .catalog-rail-head h2 {
    font-size: 1.15rem;
}
.movie-catalog-rail {
    grid-auto-columns: calc((100% - 11px) / 2);
    gap: 11px;
    padding-bottom: 12px;
    scroll-padding-inline: 2px;
}
.movie-catalog-rail .catalog-rail-card { scroll-snap-align: start; }
.movie-poster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
}
.movie-poster-card.poster {
    min-height: 0;
}
.movie-poster-card .poster-img {
    margin-bottom: 8px;
    border-radius: 10px;
}
.movie-poster-card .poster-title {
    min-height: 38px;
    font-size: .9rem;
    line-height: 1.22;
}
.movie-poster-card .poster-meta {
    gap: 6px;
    margin-top: 5px;
}
.movie-poster-card .poster-meta > span:first-child {
    max-width: 100%;
    overflow: hidden;
    color: var(--muted);
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.movie-poster-card .rating-mini {
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255,209,102,.1);
    font-size: .72rem;
}

.channel-card.poster {
    min-height: 76px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 4px 12px;
    align-items: center;
    padding: 10px 12px;
    border-color: rgba(255,255,255,.09);
    background: rgba(18,18,23,.82);
    box-shadow: 0 12px 32px rgba(0,0,0,.22);
}
.channel-card.poster.live-cast-card {
    grid-template-columns: 58px minmax(0, 1fr) auto;
}
.live-card-link {
    display: contents;
    color: inherit;
    text-decoration: none;
}
.live-cast-button {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    padding: 7px 10px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 7px;
    background: rgba(229,9,20,.14);
    color: #fff;
    font-size: .76rem;
    font-weight: 850;
    cursor: pointer;
}
.live-cast-button:hover,
.live-cast-button:focus {
    border-color: rgba(229,9,20,.55);
    background: rgba(229,9,20,.24);
    outline: none;
}
.channel-card.poster:hover {
    transform: none;
    border-color: rgba(255,255,255,.16);
    background: rgba(27,27,34,.94);
    box-shadow: 0 14px 36px rgba(0,0,0,.3);
}
.channel-card.poster .poster-img {
    grid-row: 1 / span 2;
    width: 58px;
    aspect-ratio: 1;
    margin: 0;
    border-radius: 12px;
    box-shadow: none;
}
.channel-card.poster .poster-img img { transform: none; object-fit: contain; padding: 6px; }
.channel-card.poster:hover .poster-img img { transform: none; filter: none; }
.channel-card.poster .poster-title {
    min-height: 0;
    display: block;
    color: var(--text);
    font-size: .96rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.channel-card.poster .poster-meta {
    min-height: 0;
    justify-content: flex-start;
    gap: 7px;
    margin: 0;
}
.channel-card.poster .poster-meta > span:first-child {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(61,220,132,.12);
    color: #9ff0c3;
    font-size: .72rem;
    font-weight: 850;
}
.channel-card.poster .rating-mini { display: none; }

/* ============================================================
   BADGES
   ============================================================ */
.rating-mini { display: inline-flex; align-items: center; gap: 4px; color: #ffd166; font-size: .78rem; font-weight: 900; line-height: 1; }
.rating-mini.muted { color: rgba(255,255,255,.42); }
.watch-badge, .status-badge {
    width: fit-content; max-width: 100%; display: inline-flex; align-items: center;
    min-height: 25px; padding: 0 9px; border: 1px solid rgba(61,220,132,.35); border-radius: 999px;
    background: rgba(61,220,132,.12); color: #baf8d4; font-size: .76rem; font-weight: 850; line-height: 1.15;
}
.watch-badge.muted, .status-badge.muted { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.07); color: var(--muted); }
.status-badge.off { border-color: rgba(229,9,20,.42); background: rgba(229,9,20,.12); color: #ffbdc1; }

/* ============================================================
   FORMS
   ============================================================ */
.form-grid { display: grid; gap: 15px; }
.form-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.filter-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.filter-toggle-btn { display: flex; align-items: center; gap: 7px; }
.filter-active-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); flex-shrink: 0; }
.filter-active-chip { font-size: .84rem; color: var(--muted); background: rgba(255,255,255,.07); padding: 4px 12px; border-radius: 20px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-panel { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 18px 20px; margin: 0 0 24px; }
.filter-tabs { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.filter-tab { padding: 9px 16px; min-height: 40px; border-radius: 20px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); cursor: pointer; font-size: .88rem; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.filter-tab.is-active { background: var(--red); border-color: transparent; color: #fff; }
.filter-input-row { display: flex; gap: 10px; align-items: center; }
.filter-input-row input { flex: 1; min-width: 0; margin: 0; }
.search-row { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0 0 24px; align-items: center; }
.search-row--dual { grid-template-columns: 1fr; }
label { display: grid; gap: 7px; color: #d8d8df; font-size: .92rem; font-weight: 700; }
input, textarea, select {
    width: 100%; min-height: 44px; border: 1px solid rgba(255,255,255,.13); border-radius: 7px;
    background: rgba(5,5,7,.86); color: #fff; padding: 11px 12px; outline: none;
    font-size: 16px; /* prevent iOS auto-zoom */
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input:focus, textarea:focus, select:focus { border-color: rgba(229,9,20,.72); box-shadow: 0 0 0 3px rgba(229,9,20,.16); background: rgba(10,10,13,.96); }
textarea { min-height: 120px; resize: vertical; }
input[type="checkbox"] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--red); }
.check-row { display: flex; align-items: center; gap: 9px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 480px; }
th, td { padding: 14px 12px; border-bottom: 1px solid rgba(255,255,255,.08); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .78rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
tbody tr { transition: background .18s ease; }
tbody tr:hover { background: rgba(255,255,255,.04); }

/* ============================================================
   DEVICES
   ============================================================ */
.devices-head h1 { font-size: clamp(2rem, 11vw, 3.4rem); }
.devices-head .subtitle { max-width: 560px; font-size: .92rem; }
.device-pair-panel {
    padding: 14px;
    border-color: rgba(229,9,20,.2);
    background:
        radial-gradient(circle at 100% 0%, rgba(229,9,20,.16), transparent 36%),
        rgba(18,18,23,.84);
}
.device-code-form {
    grid-template-columns: 1fr;
    gap: 12px;
}
.device-code-form input {
    min-height: 54px;
    border-radius: 10px;
    text-align: center;
    letter-spacing: .22em;
    font-size: 1.25rem;
    font-weight: 900;
}
.device-code-form .actions,
.device-code-form .btn {
    width: 100%;
}
.device-list-panel {
    margin-top: 14px;
    padding: 14px;
}
.device-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.device-section-head h2 {
    font-size: 1.05rem;
    font-weight: 850;
}
.device-section-head span {
    flex-shrink: 0;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,.07);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 850;
}
.device-table-wrap {
    overflow: visible;
}
.device-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
}
.device-table thead {
    display: none;
}
.device-table,
.device-table tbody,
.device-table tr,
.device-table td {
    display: block;
    width: 100%;
}
.device-table tr {
    padding: 13px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.055), transparent 54%),
        rgba(12,12,16,.82);
    box-shadow: 0 14px 36px rgba(0,0,0,.24);
}
.device-table tr:hover {
    background:
        linear-gradient(135deg, rgba(255,255,255,.07), transparent 54%),
        rgba(16,16,21,.9);
}
.device-table td {
    min-width: 0;
    padding: 0;
    border: 0;
}
.device-table td + td {
    margin-top: 10px;
}
.device-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted-2);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.device-table td[data-label="Dispositivo"] strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.2;
}
.device-name-form {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}
.device-name-form label {
    gap: 5px;
}
.device-name-form label span {
    color: var(--muted-2);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.device-name-form input {
    min-height: 42px;
    border-radius: 9px;
    font-weight: 800;
}
.device-name-form .btn {
    width: 100%;
    min-height: 40px;
}
.device-uuid {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    color: rgba(255,255,255,.48);
    font-size: .78rem;
    line-height: 1.35;
}
.device-table td[data-label="Acoes"] form,
.device-table td[data-label="Acoes"] .btn {
    width: 100%;
}
.device-action-stack {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}
.remote-page {
    min-height: calc(100vh - 60px - var(--mobile-nav-height) - env(safe-area-inset-bottom, 0px));
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 6px 0 16px;
}
.remote-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.remote-topbar .btn {
    min-height: 36px;
}
.remote-hero {
    display: grid;
    justify-items: center;
    gap: 5px;
    padding: 10px 16px;
    text-align: center;
}
.remote-hero h1 {
    max-width: 100%;
    margin-bottom: 0;
    font-size: clamp(1.6rem, 9vw, 2.8rem);
    overflow-wrap: anywhere;
}
.remote-status {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    margin-top: 2px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: #ffb4b9;
    font-size: .75rem;
    font-weight: 900;
}
.remote-panel {
    width: min(100%, 520px);
    margin: 0 auto;
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 0%, rgba(229,9,20,.18), transparent 42%),
        rgba(18,18,23,.86);
    box-shadow: 0 24px 70px rgba(0,0,0,.38);
}
.remote-progress-card {
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    background: rgba(255,255,255,.045);
}
.remote-time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255,255,255,.78);
    font-size: .82rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}
.remote-progress {
    width: 100%;
    min-height: 36px;
    padding: 0;
    accent-color: var(--red);
    cursor: pointer;
}
.remote-progress:disabled {
    cursor: not-allowed;
    opacity: .45;
}
.remote-progress-hint {
    min-height: 22px;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.4;
    text-align: center;
}
.remote-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 12px;
    background: rgba(255,255,255,.07);
    color: var(--text);
    cursor: pointer;
    font-size: .86rem;
    font-weight: 900;
    line-height: 1.1;
}
.remote-btn:active {
    transform: scale(.98);
    background: rgba(229,9,20,.18);
}
.remote-btn:disabled {
    opacity: .56;
    cursor: wait;
}
.remote-btn-main {
    width: 100%;
    min-height: 58px;
    border-color: rgba(229,9,20,.58);
    background: rgba(229,9,20,.86);
    color: #fff;
    font-size: .96rem;
}
.remote-play-btn {
    border-radius: 16px;
}
.remote-episode-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.remote-btn-episode {
    font-size: .82rem;
    border-color: rgba(255,255,255,.15);
}
.remote-skip-confirm {
    padding: 12px;
    border: 1px solid rgba(229,9,20,.28);
    border-radius: 14px;
    background: rgba(229,9,20,.07);
    animation: remoteSkipIn .18s ease;
}
@keyframes remoteSkipIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.remote-skip-confirm-text {
    font-size: .84rem;
    color: rgba(255,255,255,.78);
    margin-bottom: 10px;
    line-height: 1.45;
}
.remote-skip-confirm-text strong { color: #fff; }
.remote-skip-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 8px;
}
.remote-btn-skip-save {
    background: rgba(229,9,20,.78);
    border-color: rgba(229,9,20,.6);
    color: #fff;
}
.remote-volume-card {
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    background: rgba(255,255,255,.045);
}
.remote-volume-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255,255,255,.78);
    font-size: .82rem;
    font-weight: 900;
}
.remote-volume {
    width: 100%;
    min-height: 36px;
    accent-color: var(--red);
}
.remote-volume-actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 8px;
}
.remote-volume-actions .remote-btn {
    min-height: 38px;
}
.device-empty-panel {
    display: grid;
    gap: 5px;
    margin-top: 14px;
    padding: 18px;
    text-align: center;
}
.device-empty-panel strong {
    color: var(--text);
    font-size: 1rem;
}

/* Flash */
.flash, .error-box { margin: 18px 0; padding: 12px 14px; border-radius: 8px; border: 1px solid rgba(61,220,132,.34); background: rgba(61,220,132,.11); color: #dfffee; }
.error-box { border-color: rgba(229,9,20,.44); background: rgba(229,9,20,.13); color: #ffd7d9; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-view { min-height: 100vh; position: relative; display: grid; place-items: center; isolation: isolate; overflow: hidden; background: #050505; }
.login-view::before, .login-view::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.login-view::before {
    background:
        radial-gradient(circle at 50% 45%, rgba(229,9,20,.14), transparent 22rem),
        linear-gradient(90deg, rgba(5,5,5,.92) 0%, rgba(5,5,5,.48) 34%, rgba(5,5,5,.58) 66%, rgba(5,5,5,.93) 100%),
        linear-gradient(180deg, rgba(5,5,5,.78), rgba(5,5,5,.22) 45%, rgba(5,5,5,.86));
}
.login-view::after { background: linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(180deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 92px 138px; opacity: .34; }
.login-backdrop {
    position: absolute; inset: -12px; z-index: -2;
    display: grid; grid-template-columns: repeat(6, minmax(84px, 1fr));
    gap: 0; opacity: .9; filter: saturate(.9) contrast(1.05); overflow: hidden;
}
.login-backdrop img, .login-backdrop span { width: 100%; height: 100%; min-height: 150px; display: block; object-fit: cover; border: 1px solid rgba(5,5,5,.72); }
.login-backdrop span { background: linear-gradient(145deg, rgba(229,9,20,.18), rgba(27,27,34,.86)), #08080b; }
.login-card {
    width: min(100%, calc(100vw - 28px)); padding: 22px;
    border: 1px solid rgba(255,255,255,.18); border-radius: 12px;
    background: linear-gradient(180deg, rgba(18,18,23,.92), rgba(7,7,10,.88)), rgba(5,5,5,.8);
    box-shadow: 0 26px 80px rgba(0,0,0,.68); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    display: flex; flex-direction: column; gap: 18px;
}
.login-card-brand { display: flex; align-items: center; gap: 10px; }
.login-brand-mark {
    width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto;
    border-radius: 10px; background: var(--red, #e50914);
    color: #fff; font-size: .9rem; font-weight: 900; letter-spacing: .04em;
}
.login-brand-name { font-size: 1.15rem; font-weight: 800; color: rgba(255,255,255,.92); letter-spacing: -.01em; }
.login-card-intro { display: flex; flex-direction: column; gap: 4px; }
.login-card-intro h1 { margin: 0; font-size: 1.55rem; font-weight: 900; letter-spacing: -.02em; color: #fff; }
.login-card-intro p { margin: 0; font-size: .9rem; color: rgba(255,255,255,.52); }
.login-error {
    padding: 10px 14px; border-radius: 8px;
    background: rgba(229,9,20,.14); border: 1px solid rgba(229,9,20,.35);
    color: #ff8a90; font-size: .88rem; font-weight: 700;
}
.login-fields { display: flex; flex-direction: column; gap: 12px; }
.login-fields label { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; font-weight: 700; color: rgba(255,255,255,.7); }
.login-fields input {
    width: 100%; padding: 10px 13px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06);
    color: #fff; font-size: .95rem; outline: none; box-sizing: border-box;
    transition: border-color .18s ease;
}
.login-fields input:focus { border-color: rgba(229,9,20,.7); background: rgba(255,255,255,.09); }
.login-fields input::placeholder { color: rgba(255,255,255,.28); }
.login-password-wrap { position: relative; }
.login-password-wrap input { padding-right: 44px; }
.login-toggle-pwd {
    position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
    width: 30px; height: 30px; display: grid; place-items: center;
    border: 0; background: transparent; color: rgba(255,255,255,.45); cursor: pointer;
    transition: color .16s ease;
}
.login-toggle-pwd:hover { color: rgba(255,255,255,.8); }
.login-remember { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: rgba(255,255,255,.58); cursor: pointer; }
.login-remember input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--red, #e50914); cursor: pointer; }
.login-submit {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; border-radius: 9px; border: 0;
    background: var(--red, #e50914); color: #fff;
    font-size: 1rem; font-weight: 800; letter-spacing: .01em; cursor: pointer;
    transition: background .18s ease, transform .14s ease;
}
.login-submit:hover { background: #c4080f; transform: translateY(-1px); }
.login-submit:active { transform: translateY(0); }
.login-card-footer { margin: 0; font-size: .78rem; color: rgba(255,255,255,.3); text-align: center; }

/* ============================================================
   ADMIN CATALOG PAGE
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-tile strong { font-size: clamp(1.7rem, 3vw, 2.35rem); }
.admin-catalog-settings-grid { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; margin-bottom: 28px; }
.admin-catalog-settings-grid h2, .admin-catalog-sync-section h2 { margin: 0 0 8px; font-size: 1.18rem; }
.admin-catalog-quality-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.admin-catalog-sync-section { margin-top: 6px; }
.admin-catalog-sync-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
.admin-catalog-sync-card { display: grid; gap: 15px; min-height: 100%; }
.admin-catalog-sync-head { display: grid; gap: 10px; }
.admin-catalog-sync-head div { display: grid; gap: 10px; }
.admin-catalog-sync-head strong { font-size: 1.35rem; line-height: 1.1; }
.admin-catalog-sync-head > span, .admin-catalog-sync-time span { color: var(--muted); font-size: .84rem; font-weight: 760; }
.admin-catalog-sync-card input[readonly] { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; }
.admin-catalog-sync-time { display: grid; gap: 5px; padding: 12px; border: 1px solid rgba(255,255,255,.09); border-radius: 8px; background: rgba(255,255,255,.045); }
.admin-catalog-sync-time strong { font-size: 1rem; }

/* ============================================================
   DOMAIN PAGE
   ============================================================ */
.domain-star-button {
    width: 40px; height: 40px; display: inline-grid; place-items: center;
    border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: rgba(255,255,255,.055);
    color: rgba(255,255,255,.55); cursor: pointer; font-size: 1.25rem; line-height: 1;
}
.domain-star-button:hover, .domain-star-button.active { border-color: rgba(255,209,102,.5); background: rgba(255,209,102,.12); color: #ffd166; }
.log-details { max-width: min(680px, 100%); }
.log-details summary { cursor: pointer; color: #ffb4b9; font-weight: 850; }
.log-details dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 12px; margin: 12px 0 0; padding: 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; background: rgba(0,0,0,.24); }
.log-details dt { color: var(--muted); font-size: .78rem; font-weight: 900; text-transform: uppercase; }
.log-details dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.log-details pre { max-height: 240px; margin: 0; overflow: auto; white-space: pre-wrap; color: #d7dbe4; font-size: .78rem; }

/* ============================================================
   PLAYER PAGE
   ============================================================ */
.player-page { width: 100%; max-width: 1336px; margin: 0 auto; }

/* Watch Hero */
.watch-hero { position: relative; border-radius: 16px; overflow: hidden; margin: 4px 0 20px; border: 1px solid var(--line-strong); }
.watch-hero-backdrop { position: absolute; inset: 0; background-size: cover; background-position: center 20%; filter: blur(40px) saturate(1.3); transform: scale(1.12); opacity: .28; pointer-events: none; }
.watch-hero-scrim {
    position: absolute; inset: 0;
    background: linear-gradient(to right, rgba(5,5,7,.98) 38%, rgba(5,5,7,.55) 72%, rgba(5,5,7,.2) 100%), linear-gradient(to top, rgba(5,5,7,.7) 0%, transparent 35%);
    pointer-events: none;
}
.watch-hero-layout { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr; gap: 20px; align-items: end; padding: 22px 20px; }
.watch-hero-info { min-width: 0; }
.watch-hero-info h1 { margin: 4px 0 6px; font-size: clamp(1.5rem, 5vw, 3.8rem); line-height: 1; letter-spacing: -.02em; }
.watch-original-title { color: var(--muted); font-size: .9rem; margin: 0 0 10px; }
.watch-meta-pills { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.watch-meta-pills span { font-size: .78rem; font-weight: 700; color: var(--muted); background: rgba(255,255,255,.07); border: 1px solid var(--line); padding: 3px 11px; border-radius: 20px; letter-spacing: .02em; }
.watch-director { font-size: .88rem; color: var(--muted); margin: 0 0 10px; }
.watch-director strong { color: var(--text); font-weight: 700; }
.watch-synopsis-text { color: #bfc4d0; font-size: .94rem; line-height: 1.68; max-width: 580px; margin: 0 0 16px; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.watch-hero-poster { display: none; }

/* Meta line: "2016 · Crime · 1h42m" */
.watch-meta-line { color: var(--muted); font-size: .82rem; font-weight: 700; margin: 6px 0 10px; letter-spacing: .01em; }

/* Rating compacto */
.watch-rating-compact { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.watch-rating-avg { color: #ffd166; font-size: .82rem; font-weight: 900; }
.watch-rating-count { color: var(--muted); font-size: .78rem; font-weight: 700; }
.rating-stars { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; }
.rating-star { width: 28px; height: 30px; display: grid; place-items: center; border: 0; background: transparent; color: rgba(255,255,255,.35); cursor: pointer; font-size: 1.35rem; line-height: 1; transition: color .14s ease; -webkit-tap-highlight-color: transparent; }
.rating-star:hover, .rating-star.active { color: #ffd166; }

/* Reduz espaçamento do hero-info */
.watch-hero-info h1 { margin: 2px 0 4px; }
.watch-synopsis-text { -webkit-line-clamp: 3; line-clamp: 3; margin: 0; }

.watch-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.watch-button { min-width: 0; flex: 1; font-size: 1.05rem; padding: 13px 28px; }

/* Player Shell */
.player-shell { overflow: hidden; border: 1px solid rgba(255,255,255,.13); border-radius: 16px; background: #080810; box-shadow: 0 48px 128px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.05) inset; }
.player-heading { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 12px 0 16px; border-bottom: 1px solid rgba(255,255,255,.07); background: rgba(6,6,12,.97); }
.player-heading strong { min-width: 0; overflow: hidden; color: rgba(255,255,255,.88); font-size: .9rem; font-weight: 700; letter-spacing: .01em; text-overflow: ellipsis; white-space: nowrap; }
.player-close { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; background: rgba(255,255,255,.06); color: rgba(255,255,255,.7); cursor: pointer; font-size: 1.15rem; line-height: 1; transition: background .16s ease, border-color .16s ease, color .16s ease; }
.player-close:hover { border-color: rgba(229,9,20,.5); background: rgba(229,9,20,.18); color: #fff; }

/* Video Frame */
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.video-frame::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(180deg, rgba(0,0,0,.22), rgba(0,0,0,.5)), var(--player-poster); background-position: center; background-size: cover; filter: blur(2px) saturate(.9); opacity: .85; transition: opacity .4s ease; }
.video-frame.is-loaded::before { opacity: 0; }
video { position: relative; z-index: 1; width: 100%; height: 100%; background: transparent; display: block; object-fit: contain; }
.player-overlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; background: radial-gradient(ellipse at center, rgba(0,0,0,.08) 0%, rgba(0,0,0,.38) 100%); opacity: 1; transition: opacity .22s ease; }
.player-overlay.hidden { opacity: 0; }
.player-loader { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; gap: 14px; align-content: center; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); color: rgba(255,255,255,.9); font-size: .82rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; pointer-events: none; }
.loader-spinner { width: 52px; height: 52px; border-radius: 999px; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--red); box-shadow: 0 0 28px rgba(229,9,20,.24); animation: player-spin .78s linear infinite; }
@keyframes player-spin { to { transform: rotate(360deg); } }

/* Resume & Next Episode */
.next-episode-prompt { position: absolute; right: 10px; bottom: 10px; left: 10px; z-index: 5; display: flex; align-items: stretch; flex-direction: column; gap: 12px; max-width: none; padding: 14px 16px; border: 1px solid rgba(255,255,255,.13); border-radius: 12px; background: rgba(8,8,16,.88); box-shadow: 0 20px 60px rgba(0,0,0,.6); backdrop-filter: blur(20px) saturate(1.2); -webkit-backdrop-filter: blur(20px) saturate(1.2); color: var(--text); font-weight: 700; }
.next-episode-prompt span { min-width: 0; }
.next-episode-prompt strong { color: #ffb4b9; }
.resume-prompt { position: absolute; top: 50%; left: 50%; z-index: 5; width: min(400px, calc(100% - 20px)); transform: translate(-50%, -50%); display: grid; gap: 8px; padding: 20px 22px; border: 1px solid rgba(255,255,255,.13); border-radius: 14px; background: rgba(8,8,16,.9); box-shadow: 0 28px 80px rgba(0,0,0,.7); backdrop-filter: blur(20px) saturate(1.2); -webkit-backdrop-filter: blur(20px) saturate(1.2); color: var(--text); }
.resume-prompt strong { font-size: 1rem; font-weight: 900; }
.resume-prompt span { color: var(--muted); font-size: .88rem; }
.resume-actions { display: flex; gap: 9px; flex-wrap: wrap; flex-direction: column; align-items: stretch; margin-top: 4px; }

/* Play button */
.player-play { width: clamp(64px, 8vw, 96px); height: clamp(64px, 8vw, 96px); display: grid; place-items: center; border-radius: 999px; background: rgba(229,9,20,.92); color: #fff; box-shadow: 0 0 0 10px rgba(229,9,20,.12), 0 16px 60px rgba(229,9,20,.5), 0 24px 60px rgba(0,0,0,.6); pointer-events: auto; cursor: pointer; transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
.player-play:hover { transform: scale(1.08); background: var(--red); box-shadow: 0 0 0 14px rgba(229,9,20,.14), 0 20px 70px rgba(229,9,20,.6), 0 28px 70px rgba(0,0,0,.6); }
.player-play::before { content: ""; width: 0; height: 0; margin-left: 6px; border-top: 16px solid transparent; border-bottom: 16px solid transparent; border-left: 26px solid currentColor; }

/* Seek bar — large touch target on mobile */
.player-seek { width: 100%; display: block; padding: 8px 0 2px; cursor: pointer; }
.player-seek input[type="range"] {
    --progress: 0%; --buffer: 0%;
    display: block; width: 100%; height: 28px; margin: 0; padding: 0; border: 0;
    background: transparent; cursor: pointer; appearance: none; -webkit-appearance: none; outline: none; min-height: 0;
}
.player-seek input[type="range"]:disabled { cursor: wait; opacity: .5; }
.player-seek input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 999px; background: linear-gradient(90deg, var(--red) 0 var(--progress), rgba(255,255,255,.22) var(--progress) var(--buffer), rgba(255,255,255,.1) var(--buffer) 100%); }
.player-seek input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.6); }
.player-seek input[type="range"]::-moz-range-track { height: 5px; border-radius: 999px; background: linear-gradient(90deg, var(--red) 0 var(--progress), rgba(255,255,255,.22) var(--progress) var(--buffer), rgba(255,255,255,.1) var(--buffer) 100%); }
.player-seek input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }

/* Player controls — 44px touch targets by default */
.player-controls { position: absolute; right: 0; bottom: 0; left: 0; z-index: 4; display: flex; flex-direction: column; gap: 2px; padding: 40px 8px 8px; background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.2) 20%, rgba(0,0,0,.65) 60%, rgba(0,0,0,.92) 100%); opacity: 0; pointer-events: none; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease; }
.video-frame.controls-visible .player-controls, .video-frame:focus-within .player-controls { opacity: 1; pointer-events: auto; transform: translateY(0); }
.player-control-row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 36px; }
.player-control-group { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0; }
.player-control-group.right { justify-content: flex-end; }
.player-icon-button { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border: 0; border-radius: 8px; background: transparent; color: rgba(255,255,255,.9); cursor: pointer; transition: transform .14s ease, background .14s ease, color .14s ease; }
.player-icon-button:hover { background: rgba(255,255,255,.1); color: #fff; }
.player-icon-button:active { transform: scale(.91); }

/* Volume/status hidden on mobile */
.player-volume, .player-volume-percent, .player-status { display: none; }

.player-toggle-icon { display: block; width: 0; height: 0; margin-left: 3px; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 11px solid currentColor; }
.player-toggle.is-playing .player-toggle-icon { width: 12px; height: 14px; margin-left: 0; border-top: 0; border-bottom: 0; border-left: 4px solid currentColor; border-right: 4px solid currentColor; }
.player-mute-icon { position: relative; width: 16px; height: 14px; display: block; background: currentColor; clip-path: polygon(0 32%, 34% 32%, 72% 0, 72% 100%, 34% 68%, 0 68%); }
.player-mute-icon::after { content: ""; position: absolute; top: 1px; right: -7px; width: 7px; height: 11px; border: 2px solid currentColor; border-left: 0; border-radius: 0 999px 999px 0; }
.player-mute.is-muted .player-mute-icon::before { content: ""; position: absolute; top: -4px; right: -7px; width: 3px; height: 24px; border-radius: 999px; background: currentColor; transform: rotate(45deg); }
.player-time, .player-status { color: rgba(255,255,255,.92); font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px rgba(0,0,0,.9); white-space: nowrap; letter-spacing: .02em; }
.player-time { margin-left: 6px; }
.player-status { max-width: 140px; overflow: hidden; color: rgba(255,255,255,.62); text-overflow: ellipsis; font-size: .74rem; }
.player-reload span, .player-fullscreen span { position: relative; width: 16px; height: 16px; display: block; }
.player-reload span::before { content: ""; position: absolute; inset: 2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 999px; }
.player-reload span::after { content: ""; position: absolute; top: 1px; right: 1px; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid currentColor; transform: rotate(20deg); }
.player-fullscreen span::before, .player-fullscreen span::after { content: ""; position: absolute; width: 8px; height: 8px; border-color: currentColor; }
.player-fullscreen span::before { top: 1px; left: 1px; border-top: 2px solid; border-left: 2px solid; }
.player-fullscreen span::after { right: 1px; bottom: 1px; border-right: 2px solid; border-bottom: 2px solid; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { margin-top: 24px; color: var(--muted); }
.pag-nav {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 12px;
    background: rgba(18,18,23,.7);
}
.pag-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    color: rgba(255,255,255,.84);
    font-size: .84rem;
    font-weight: 850;
}
.pag-summary small {
    color: var(--muted);
    font-size: .74rem;
    font-weight: 760;
    white-space: nowrap;
}
.pag-mobile-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.pag-pages {
    display: none;
    gap: 6px;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}
.pag-pages::-webkit-scrollbar { display: none; }
.pag-btn {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 9px;
    background: rgba(255,255,255,.055);
    color: var(--text);
    font-size: .86rem;
    font-weight: 850;
    text-align: center;
    white-space: nowrap;
}
.pag-btn:hover {
    border-color: rgba(255,255,255,.22);
    background: rgba(255,255,255,.1);
}
.pag-primary,
.pag-active {
    border-color: rgba(229,9,20,.62);
    background: rgba(229,9,20,.9);
    color: #fff;
}
.pag-disabled {
    opacity: .42;
    pointer-events: none;
}
.pag-arrow {
    min-width: 42px;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
}
.pag-dots {
    min-width: 28px;
    color: var(--muted);
    text-align: center;
}

/* ============================================================
   SERIES
   ============================================================ */
.season-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.season-tab { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(255,255,255,.07); color: var(--text); cursor: pointer; font-weight: 800; white-space: nowrap; }
.season-tab.active { border-color: rgba(229,9,20,.68); background: var(--red); color: #fff; }
.season-panel[hidden] { display: none; }
.episode-list { display: grid; gap: 9px; }
.player-episodes { margin-top: 26px; }
.episode-row { display: grid; grid-template-columns: 1fr; align-items: center; gap: 8px; padding: 14px; min-height: 52px; border: 1px solid rgba(255,255,255,.10); border-radius: 8px; background: rgba(255,255,255,.045); transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.episode-row:hover { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.075); }
.episode-row.current { border-color: rgba(229,9,20,.64); background: rgba(229,9,20,.12); }
.episode-number { color: #ffb4b9; font-weight: 900; }
.episode-title { min-width: 0; overflow-wrap: break-word; font-weight: 760; }

/* ============================================================
   CAST MODAL — bottom sheet on mobile
   ============================================================ */
.cast-modal { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: flex; align-items: flex-end; justify-content: center; z-index: 320; padding: 0 12px calc(var(--mobile-nav-height) + 12px + env(safe-area-inset-bottom, 0px)); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.cast-modal[hidden] { display: none; }
.cast-modal-box { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; padding: 22px 18px; width: 100%; max-width: 480px; max-height: calc(100vh - var(--mobile-nav-height) - 32px - env(safe-area-inset-bottom, 0px)); overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.cast-modal-title { font-size: 1.1rem; font-weight: 700; text-align: center; }
.cast-modal-options { display: flex; flex-direction: column; gap: .5rem; }
.cast-option-btn { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .875rem 1rem; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); font-size: .95rem; font-weight: 500; cursor: pointer; text-align: left; min-height: 52px; transition: background .15s, border-color .15s; }
.cast-option-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(229,9,20,.5); }
.cast-option-btn:active { background: rgba(229,9,20,.12); }
.cast-option-here { color: rgba(255,255,255,.6); }
.cast-icon { font-size: 1.25rem; flex-shrink: 0; }
.cast-sending { text-align: center; color: rgba(255,255,255,.55); font-size: .9rem; }

/* ============================================================
   TABLET  (min-width: 640px)
   ============================================================ */
@media (min-width: 640px) {
    .shell { width: min(1440px, calc(100vw - 36px)); }
    .grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 14px; }
    .poster-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
    .channel-category-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
    .channel-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .continue-rail { grid-auto-columns: minmax(160px, 25vw); }
    .catalog-rail { grid-auto-columns: minmax(160px, 25vw); }
    .home-selection-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .home-selection-card { min-height: 150px; padding: 20px; }
    .movie-poster-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px 14px; }
    .movie-catalog-rail { grid-auto-columns: minmax(150px, 24vw); }
    .mode-select-cards { grid-template-columns: 1fr 1fr; }
    .watch-hero-layout { padding: 26px 24px; }
    .episode-row { grid-template-columns: 72px minmax(0, 1fr) auto auto; gap: 12px; }
    .admin-catalog-quality-grid { grid-template-columns: 1fr 1fr; }
    .pag-nav {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        padding: 10px 12px;
    }
    .pag-mobile-controls { display: none; }
    .pag-pages {
        display: flex;
        justify-content: flex-end;
    }
    .device-code-form {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }
    .device-code-form .actions,
    .device-code-form .btn {
        width: auto;
    }
    .device-table-wrap {
        overflow-x: auto;
    }
    .device-table {
        display: table;
        width: 100%;
        min-width: 760px;
        border-collapse: collapse;
        border-spacing: 0;
    }
    .device-table thead {
        display: table-header-group;
    }
    .device-table tbody {
        display: table-row-group;
    }
    .device-table tr {
        display: table-row;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    .device-table tr:hover {
        background: rgba(255,255,255,.04);
    }
    .device-table td {
        display: table-cell;
        width: auto;
        padding: 14px 12px;
        border-bottom: 1px solid rgba(255,255,255,.08);
        vertical-align: middle;
    }
    .device-table td + td {
        margin-top: 0;
    }
    .device-table td::before {
        display: none;
    }
    .device-table td[data-label="Acoes"] form,
    .device-table td[data-label="Acoes"] .btn {
        width: auto;
    }
    .device-name-form {
        grid-template-columns: minmax(180px, 1fr) auto;
        align-items: end;
    }
    .device-name-form .btn {
        width: auto;
    }
    .remote-page { min-height: calc(100vh - 60px); align-content: center; }
    .remote-panel { padding: 16px; }
    .remote-btn { min-height: 48px; }
    .cast-modal { align-items: center; padding: 0; }
    .cast-modal-box { border-radius: 16px; padding: 2rem; width: min(380px, 90vw); max-height: min(640px, 90vh); }
    .resume-actions { flex-direction: row; align-items: center; }
}

/* ============================================================
   DESKTOP  (min-width: 1024px)
   ============================================================ */
@media (min-width: 1024px) {
    /* Nav */
    .viewer-nav { height: 68px; }
    .viewer-nav-links { display: flex; }
    .viewer-nav-right { display: flex; }
    .viewer-main { padding-top: 68px; padding-bottom: 0; }
    .mobile-bottom-nav { display: none !important; }
    .mobile-account-sheet,
    .mobile-control-sheet,
    .mobile-control-backdrop,
    .mobile-account-backdrop { display: none !important; }

    /* Shell */
    .shell { width: min(1440px, calc(100vw - 48px)); padding: 20px 0 56px; }

    /* Sections */
    .section-head { flex-direction: row; align-items: end; margin: 22px 0 24px; }
    .hero { flex-direction: row; align-items: center; min-height: 340px; }

    /* Grids */
    .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
    .poster-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
    .channel-category-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
    .channel-category-card { min-height: 86px; padding: 16px; }
    .channel-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
    .channel-card.poster { min-height: 84px; grid-template-columns: 64px minmax(0, 1fr); padding: 12px 14px; }
    .channel-card.poster.live-cast-card { grid-template-columns: 64px minmax(0, 1fr) auto; }
    .channel-card.poster .poster-img { width: 64px; }
    .channel-card.poster .poster-title { font-size: 1rem; }
    .home-page { min-height: calc(100vh - 68px); gap: 32px; padding: 0 0 56px; text-align: center; }
    .home-welcome { justify-items: center; }
    .home-welcome h1 { max-width: 760px; font-size: clamp(2.8rem, 5vw, 4.2rem); }
    .home-welcome .subtitle { max-width: 520px; font-size: 1rem; }
    .home-selection-grid { width: min(980px, 100%); grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
    .home-selection-card { min-height: 225px; grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 14px; padding: 28px 20px; }
    .home-selection-card strong { font-size: clamp(1.35rem, 2vw, 1.8rem); }
    .home-card-copy { justify-items: center; }
    .home-card-action { width: auto; min-width: 116px; padding: 0 14px; color: rgba(255,255,255,.84); font-size: .78rem; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
    .home-card-action::before { display: none; }
    .selection-icon { width: 66px; height: 66px; border-radius: 999px; }
    .selection-icon-tv::before { width: 34px; height: 23px; }
    .selection-icon-tv::after { width: 20px; transform: translateY(18px); }
    .selection-icon-movie::before { width: 34px; height: 26px; background: linear-gradient(90deg, currentColor 2px, transparent 2px 8px, currentColor 8px 10px, transparent 10px 16px, currentColor 16px 18px, transparent 18px); }
    .selection-icon-movie::after { width: 13px; height: 15px; }
    .selection-icon-series::before { width: 33px; height: 27px; box-shadow: -7px -7px 0 -3px rgba(255,255,255,.72), 7px 7px 0 -3px rgba(255,255,255,.72); }
    .selection-icon-series::after { width: 13px; height: 14px; }
    .mode-select-cards { grid-template-columns: repeat(2, 1fr); gap: 18px; }
    .mode-select-header { margin-bottom: 56px; }
    .mode-select-title { margin: 0 0 44px; }

    /* Rails */
    .continue-rail { grid-auto-columns: minmax(150px, 180px); gap: 16px; padding-bottom: 24px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.24) transparent; }
    .continue-rail::-webkit-scrollbar { height: 8px; display: block; }
    .continue-rail::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(255,255,255,.24); }
    .continue-head { flex-direction: row; align-items: center; }
    .continue-load-card { min-height: 276px; }
    .catalog-rail { grid-auto-columns: calc((100% - 112px) / 8); }
    .catalog-rail-head { flex-direction: row; align-items: center; }
    [data-continue-section]::after, .catalog-rail-section::after { display: none; }

    /* Player */
    .player-page { margin-left: 50%; transform: translateX(-50%); }
    .watch-hero { margin: 8px 0 28px; }
    .watch-hero-layout { grid-template-columns: 1fr auto; gap: 40px; padding: clamp(28px, 4vw, 52px); }
    .watch-hero-poster { display: block; width: clamp(130px, 14vw, 210px); aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.1); flex-shrink: 0; align-self: end; }
    .watch-hero-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .watch-synopsis-text { -webkit-line-clamp: 4; }
    .watch-button { min-width: 150px; flex: none; }
    .next-episode-prompt { right: 16px; bottom: 72px; left: auto; max-width: min(480px, calc(100% - 32px)); flex-direction: row; align-items: center; }
    .resume-actions { flex-direction: row; align-items: center; }
    .episode-row { grid-template-columns: 86px minmax(0, 1fr) auto auto; gap: 14px; padding: 13px; }
    .episode-row:hover { transform: translateX(4px); }
    .episode-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: initial; }
    .rating-star { width: 30px; height: 32px; }
    .movie-head { margin-top: 22px; }
    .movie-filter-bar {
        position: static;
        margin: 0 0 18px;
        padding: 0;
        background: transparent;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    .movie-filter-panel { margin-bottom: 24px; padding: 18px 20px; }
    .movie-filter-panel .filter-input-row {
        align-items: center;
        flex-direction: row;
    }
    .movie-filter-panel .filter-input-row .btn { width: auto; }
    .movie-catalog-rail { grid-auto-columns: calc((100% - 112px) / 8); gap: 16px; }
    .movie-poster-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
    .movie-poster-card .poster-title { font-size: initial; }

    /* Player controls */
    .player-controls { padding: 40px 16px 14px; }
    .player-control-row { gap: 6px; }
    .player-control-group { gap: 2px; }
    .player-icon-button { width: 36px; height: 36px; }
    .player-seek { padding: 6px 0 2px; }
    .player-seek input[type="range"] { height: 14px; }
    .player-seek input[type="range"]::-webkit-slider-runnable-track { height: 4px; transition: height .15s ease; }
    .player-seek:hover input[type="range"]::-webkit-slider-runnable-track { height: 6px; }
    .player-seek input[type="range"]::-webkit-slider-thumb { background: transparent; transition: background .15s ease, box-shadow .15s ease; }
    .player-seek:hover input[type="range"]::-webkit-slider-thumb { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.6); }
    .player-seek input[type="range"]::-moz-range-track { height: 4px; }
    .player-seek input[type="range"]::-moz-range-thumb { background: transparent; }
    .player-seek:hover input[type="range"]::-moz-range-thumb { background: #fff; }
    .player-volume {
        --volume: 100%;
        display: block; width: 60px; max-width: 0; height: 14px; margin: 0; padding: 0; border: 0;
        background: transparent; cursor: pointer; appearance: none; -webkit-appearance: none;
        opacity: 0; min-height: 0; transition: max-width .18s ease, opacity .18s ease;
    }
    .player-control-group:hover .player-volume, .player-volume:focus { max-width: 60px; opacity: 1; }
    .player-volume::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(90deg, rgba(255,255,255,.9) 0 var(--volume), rgba(255,255,255,.2) var(--volume) 100%); }
    .player-volume::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
    .player-volume::-moz-range-track { height: 4px; border-radius: 999px; background: linear-gradient(90deg, rgba(255,255,255,.9) 0 var(--volume), rgba(255,255,255,.2) var(--volume) 100%); }
    .player-volume::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
    .player-volume-percent { display: block; width: 34px; color: rgba(255,255,255,.8); font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: left; text-shadow: 0 1px 3px rgba(0,0,0,.9); white-space: nowrap; }
    .player-status { display: block; }

    /* Login */
    .login-backdrop { grid-template-columns: repeat(14, minmax(86px, 1fr)); inset: -18px; }
    .login-backdrop img { min-height: 170px; }
    .login-card { width: min(440px, calc(100vw - 40px)); padding: 30px; }

    /* Admin */
    .admin-sidebar { transform: translateX(0); transition: none; }
    .admin-layout { margin-left: 240px; }
    .admin-content { padding: 28px 32px 56px; }
    .admin-flash { margin: 18px 28px 0; }
    .admin-catalog-settings-grid { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); }
    .admin-catalog-sync-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .admin-catalog-quality-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-catalog-sync-head { display: flex; justify-content: space-between; align-items: start; }

    /* Search */
    .search-row { grid-template-columns: minmax(0, 520px) auto auto; }
    .search-row--dual { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; }
}

/* ============================================================
   MOBILE REDESIGN — appended 2026-06-28
   All rules are mobile-first (no desktop breakpoints here).
   ============================================================ */

/* ── Browse pages (filmes / séries) ──────────────────────── */
.browse-page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; padding: 0 16px 16px;
}
.browse-page-head h1 { font-size: 1.4rem; font-weight: 900; margin: 0 0 2px; }
.browse-page-head .eyebrow { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 4px; }
.browse-empty { padding: 16px; color: var(--muted); font-size: .9rem; }

/* Grid of home-rail-cards for browse/search results */
.home-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 8px;
    padding: 0 16px;
}
.home-card-grid .home-rail-card { width: 100%; }
.home-card-grid .home-rail-poster {
    width: 100%; height: 0; padding-bottom: 150%;
    position: relative;
}
.home-card-grid .home-rail-poster img {
    position: absolute; inset: 0; width: 100%; height: 100%;
}

/* ── Viewer main: 30px breathing room, no fixed header above */
.viewer-main { padding-top: 50px !important; }

/* -- Mobile account divider --------------------------------- */
/* Section label inside account sheet */
.mobile-account-section-label {
    font-size: .65rem; font-weight: 900; text-transform: uppercase;
    letter-spacing: .1em; color: var(--muted);
    padding: 14px 10px 4px; margin: 0;
}

/* Per-device online dot */
.mobile-device-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255,255,255,.2); flex-shrink: 0;
    margin-left: auto;
}
.mobile-device-dot.online {
    background: var(--green);
    box-shadow: 0 0 6px rgba(61,220,132,.7);
}
.mobile-device-status-badge.online::before { background: var(--green); box-shadow: 0 0 5px rgba(61,220,132,.6); }

/* ============================================================
   ADMIN — topbar + bottom nav (replaces sidebar on mobile)
   ============================================================ */
.admin-body { flex-direction: column; }

.admin-topbar {
    position: sticky; top: 0; z-index: 60;
    display: flex; align-items: center; justify-content: space-between;
    height: 52px; padding: 0 16px;
    background: rgba(9,9,13,.95);
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    flex-shrink: 0;
}
.admin-topbar-right { display: flex; align-items: center; gap: 10px; }
.admin-brand-text { font-size: .9rem; font-weight: 900; color: var(--text); }

.admin-bottom-nav {
    position: fixed; inset-inline: 0; bottom: 0;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    display: flex; align-items: stretch;
    background: rgba(9,9,13,.96);
    border-top: 1px solid var(--line);
    z-index: 120;
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    backdrop-filter: blur(20px) saturate(1.4);
}
.admin-bottom-btn {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding: 0 4px;
    color: var(--muted); font-size: .68rem; font-weight: 800;
    border: 0; background: transparent; cursor: pointer; text-decoration: none;
    transition: color .18s ease;
    -webkit-tap-highlight-color: transparent;
}
.admin-bottom-btn.active,
.admin-bottom-btn:active { color: var(--red); }
.admin-bottom-icon { width: 24px; height: 24px; display: grid; place-items: center; }
.admin-bottom-label { font-size: .65rem; font-weight: 800; line-height: 1; }
.admin-bottom-user { gap: 2px; }
.admin-bottom-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center;
    background: #1e1e28;
    border: 1.5px solid rgba(255,255,255,.15);
    font-size: .7rem; font-weight: 900; color: #fff;
}
.admin-bottom-logout {
    font-size: .65rem; font-weight: 800; color: var(--muted);
    background: transparent; border: 0; cursor: pointer; padding: 0;
}
.admin-layout { display: flex; flex-direction: column; min-height: 100vh; margin-left: 0; }
.admin-content { flex: 1; padding: 30px 16px calc(60px + env(safe-area-inset-bottom,0px) + 16px); }
.admin-flash { margin: 12px 16px 0; }

/* ============================================================
   HOME v2
   ============================================================ */
.home-v2 { padding: 0 0 8px; }

.home-quick-section,
.home-rail-section,
.home-live-section { padding: 0 0 20px; }

.home-section-title {
    padding: 0 16px 10px;
    font-size: .8rem; font-weight: 900; text-transform: uppercase;
    letter-spacing: .07em; color: var(--muted);
}

/* 2x2 quick actions */
.home-quick-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
    padding: 0 16px;
}
.home-quick-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--line);
    color: var(--text); text-decoration: none;
    font-weight: 800; font-size: .9rem;
    transition: background .15s ease, border-color .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.home-quick-card:active { background: var(--surface-2); }
.home-quick-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center; flex-shrink: 0;
    font-size: 1.1rem;
}
.home-quick-live .home-quick-icon { background: rgba(229,9,20,.18); }
.home-quick-movies .home-quick-icon { background: rgba(99,102,241,.18); }
.home-quick-series .home-quick-icon { background: rgba(245,158,11,.14); }
.home-quick-search .home-quick-icon { background: rgba(255,255,255,.09); }
.home-quick-text { font-size: .88rem; font-weight: 800; display: flex; flex-direction: column; gap: 1px; }
.home-quick-text strong { font-size: .88rem; font-weight: 900; }
.home-quick-text span { font-size: .73rem; font-weight: 700; color: var(--muted); }

/* Horizontal rail */
.home-rail-head {
    display: flex; align-items: baseline; justify-content: space-between;
    padding: 0 16px 10px;
}
.home-rail-more { font-size: .8rem; font-weight: 800; color: var(--red); }
.home-catalog-rail {
    display: flex; gap: 10px;
    padding: 0 16px 4px 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.home-catalog-rail::-webkit-scrollbar { display: none; }
.home-catalog-rail > :first-child { margin-inline-start: 16px; }
.home-rail-card {
    flex: 0 0 auto; width: 110px;
    scroll-snap-align: start;
    display: flex; flex-direction: column; gap: 6px;
    text-decoration: none; color: var(--text);
    -webkit-tap-highlight-color: transparent;
}
.home-rail-poster {
    width: 110px; height: 165px; border-radius: 8px;
    background: var(--surface-2); overflow: hidden;
    border: 1px solid var(--line);
    flex-shrink: 0;
}
.home-rail-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-rail-title {
    font-size: .78rem; font-weight: 800; line-height: 1.3;
    overflow: hidden; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.home-rail-rating { font-size: .7rem; color: var(--muted); font-weight: 700; }
.home-rail-date { font-size: .7rem; color: var(--muted-2); font-weight: 700; }
.home-rail-ep-badge {
    position: absolute; bottom: 6px; left: 6px;
    padding: 2px 6px; border-radius: 4px;
    background: rgba(0,0,0,.72); color: #fff;
    font-size: .65rem; font-weight: 900; letter-spacing: .04em;
    pointer-events: none;
}
.home-rail-poster { position: relative; }

/* Live channels — single-column list (channel names with timestamps are too long for 2-col) */
.home-live-grid {
    display: flex; flex-direction: column; gap: 6px;
    padding: 0 16px;
}
.home-live-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px;
    background: var(--surface); border: 1px solid var(--line);
    text-decoration: none; color: var(--text);
    transition: background .15s ease;
    -webkit-tap-highlight-color: transparent;
    min-width: 0; overflow: hidden;
}
.home-live-card:active { background: var(--surface-2); }
.home-live-logo {
    width: 40px; height: 40px; border-radius: 6px;
    background: var(--surface-2); overflow: hidden; flex-shrink: 0;
    border: 1px solid var(--line);
}
.home-live-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.home-live-name {
    flex: 1; min-width: 0; font-size: .82rem; font-weight: 800;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.home-live-badge {
    display: inline-block; padding: 2px 6px;
    border-radius: 4px; background: rgba(229,9,20,.2); border: 1px solid rgba(229,9,20,.38);
    color: #ffb4b9; font-size: .62rem; font-weight: 900; text-transform: uppercase;
    flex-shrink: 0;
}

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.search-page { padding: 30px 16px calc(var(--mobile-nav-height) + 24px + env(safe-area-inset-bottom,0px)); }

.search-input-wrap { position: relative; margin-bottom: 14px; }
.search-label {
    position: absolute; inset-block: 0; left: 14px;
    display: flex; align-items: center; pointer-events: none;
}
.search-label-icon { width: 18px; height: 18px; fill: var(--muted); }
.search-input {
    width: 100%; height: 48px; padding: 0 44px 0 44px;
    border-radius: 12px; border: 1.5px solid var(--line);
    background: var(--surface); color: var(--text);
    font-size: 1rem; font-weight: 700;
    outline: none; appearance: none; -webkit-appearance: none;
    transition: border-color .18s ease;
}
.search-input:focus { border-color: rgba(229,9,20,.55); }
.search-clear {
    position: absolute; inset-block: 0; right: 4px;
    width: 40px; display: grid; place-items: center;
    background: transparent; border: 0; color: var(--muted); cursor: pointer;
    font-size: 1.1rem; line-height: 1;
}
.search-clear[hidden] { display: none !important; }

/* Filter chips */
.search-filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search-filter-chip {
    padding: 6px 14px; border-radius: 999px;
    border: 1.5px solid var(--line); background: transparent;
    color: var(--muted); font-size: .8rem; font-weight: 800;
    cursor: pointer; transition: color .15s ease, border-color .15s ease, background .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.search-filter-chip.active {
    border-color: rgba(229,9,20,.5); background: rgba(229,9,20,.14); color: var(--text);
}

.search-status { font-size: .8rem; color: var(--muted); margin-bottom: 10px; min-height: 20px; }

/* Results */
.search-results { display: flex; flex-direction: column; gap: 2px; }
.search-result-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 8px; border-radius: 10px; text-decoration: none; color: var(--text);
    transition: background .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.search-result-item:active { background: var(--surface); }
.search-result-thumb {
    width: 48px; height: 48px; border-radius: 8px;
    background: var(--surface-2); overflow: hidden; flex-shrink: 0;
    border: 1px solid var(--line);
}
.search-result-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.search-result-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.search-result-title { font-size: .9rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-meta { display: flex; align-items: center; gap: 8px; }
.search-result-type {
    font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    padding: 2px 6px; border-radius: 4px; background: var(--surface-2); color: var(--muted);
}
.search-result-rating { font-size: .72rem; color: #f59e0b; font-weight: 700; }
.search-result-arrow { color: var(--muted); flex-shrink: 0; }

/* Empty / initial state */
.search-empty { display: flex; flex-direction: column; align-items: center; padding: 48px 24px; gap: 12px; text-align: center; }
.search-empty-icon { opacity: .25; }
.search-empty-text { color: var(--muted); font-size: .9rem; font-weight: 700; }

/* Recent searches */
.search-recents { margin-bottom: 16px; }
.search-recents-label {
    display: flex; align-items: center; justify-content: space-between;
    font-size: .75rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .07em; color: var(--muted); margin-bottom: 8px;
}
.search-recents-clear { font-size: .75rem; font-weight: 800; color: var(--red); background: transparent; border: 0; cursor: pointer; }
.search-recents-list { display: flex; flex-wrap: wrap; gap: 8px; }
.search-recent-item {
    padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface);
    color: var(--muted); font-size: .82rem; font-weight: 800;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: color .15s ease, border-color .15s ease;
}
.search-recent-item:active { color: var(--text); border-color: var(--line-strong); }

/* ============================================================
   DEVICES PAGE
   ============================================================ */
/* viewer-main + shell already handle top/bottom spacing — no double-stacking */
.devices-page { padding: 0 16px; }

.devices-page-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 0 18px; gap: 12px;
    border-bottom: 1px solid var(--line); margin-bottom: 24px;
}
.devices-page-head h1 { font-size: clamp(1.45rem, 6.5vw, 1.9rem); font-weight: 900; margin: 0 0 2px; line-height: 1.15; }
.devices-page-head .eyebrow { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 4px; }
.devices-page-head .subtitle { font-size: .8rem; color: var(--muted); margin: 0; }
.devices-add-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 0 16px; height: 44px; border-radius: 10px;
    background: var(--red); color: #fff;
    font-size: .85rem; font-weight: 900; border: 0; cursor: pointer;
    white-space: nowrap; flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s ease;
}
.devices-add-btn:active { background: var(--red-2); }

.device-cards-section { margin-bottom: 28px; }
.device-cards-label {
    font-size: .68rem; font-weight: 900; text-transform: uppercase;
    letter-spacing: .09em; color: var(--muted-2); margin: 0 0 12px;
    display: flex; align-items: center; gap: 6px;
}
.device-cards-list { display: flex; flex-direction: column; gap: 10px; }

.device-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
    padding: 16px; display: flex; flex-direction: column; gap: 0;
    transition: border-color .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.device-card-main { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; }
.device-card-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: grid; place-items: center; flex-shrink: 0;
    background: var(--surface-2); border: 1px solid var(--line);
}
.device-card-icon svg { opacity: .7; }
.device-card-info { flex: 1; min-width: 0; }
.device-card-info strong { display: block; font-size: .97rem; font-weight: 900; margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.device-status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .72rem; font-weight: 800; color: var(--muted);
}
.device-status-badge::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex-shrink: 0;
}
.device-status-badge.online { color: var(--green); }
.device-status-badge.online::before { background: var(--green); box-shadow: 0 0 6px rgba(61,220,132,.6); }
.device-card-seen { font-size: .72rem; color: var(--muted-2); }

.device-card-actions { display: flex; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.device-card-control {
    flex: 1; height: 42px; border-radius: 10px;
    background: var(--red); color: #fff;
    font-size: .85rem; font-weight: 900; border: 0; cursor: pointer;
    text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: background .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.device-card-control:active { background: var(--red-2); }
.device-card-edit-btn {
    height: 42px; width: 42px; padding: 0; border-radius: 10px;
    border: 1.5px solid var(--line); background: transparent;
    color: var(--muted); font-size: .85rem; font-weight: 800; cursor: pointer;
    display: grid; place-items: center;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.device-card-edit-btn.has-label { flex: 1; padding: 0 14px; gap: 6px; display: flex; align-items: center; justify-content: center; }
.device-card-edit-btn:active { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }

.device-edit-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.device-edit-field label { font-size: .8rem; font-weight: 800; color: var(--muted); }
.device-edit-field input {
    width: 100%; height: 48px; padding: 0 14px;
    border-radius: 10px; border: 1.5px solid var(--line);
    background: var(--surface-2); color: var(--text);
    font-size: 1rem; outline: none;
}
.device-edit-field input:focus { border-color: rgba(229,9,20,.5); }
.device-edit-divider { height: 1px; background: var(--line); margin: 12px 0; }

/* ============================================================
   GUIDED ADD SHEET (device pairing)
   ============================================================ */
.guided-backdrop {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,.72);
    display: none; opacity: 0; transition: opacity .25s ease;
}
.guided-backdrop.open { display: block; opacity: 1; }

.guided-sheet {
    position: fixed; inset-inline: 0;
    bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    z-index: 201;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    border-top: 1px solid var(--line);
    padding: 0 20px 28px;
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.32,1.2,.4,1);
    max-height: calc(92vh - var(--mobile-nav-height) - env(safe-area-inset-bottom, 0px)); overflow-y: auto;
}
.guided-sheet.open { transform: translateY(0); }

.guided-handle {
    width: 36px; height: 4px; border-radius: 2px;
    background: rgba(255,255,255,.2);
    margin: 10px auto 20px;
}
.guided-sheet-close {
    position: absolute; top: 16px; right: 16px;
    width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(255,255,255,.07); border: 0; cursor: pointer;
    color: var(--muted); font-size: 1.1rem;
}

/* Step dots */
.guided-steps { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 24px; }
.guided-step {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    background: var(--surface-2); border: 1.5px solid var(--line);
    font-size: .72rem; font-weight: 900; color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.guided-step.active { background: var(--red); border-color: var(--red); color: #fff; }
.guided-step-line { display: block; height: 1px; width: 24px; background: var(--line); flex-shrink: 0; }

/* Panels */
.guided-panel { text-align: center; }
.guided-title { font-size: 1.2rem; font-weight: 900; margin: 0 0 6px; }
.guided-subtitle { font-size: .85rem; color: var(--muted); margin: 0 0 22px; }
.guided-instruction {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 20px; border-radius: 14px;
    background: var(--bg-soft); border: 1px solid var(--line);
    margin-bottom: 20px;
}
.guided-instruction-icon { font-size: 2.4rem; }
.guided-instruction-text { font-size: .88rem; color: var(--muted); line-height: 1.5; }

.guided-next {
    width: 100%; height: 50px; border-radius: 12px;
    background: var(--red); color: #fff;
    font-size: 1rem; font-weight: 900; border: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: background .15s ease;
    margin-bottom: 10px;
    -webkit-tap-highlight-color: transparent;
}
.guided-next:active { background: var(--red-2); }
.guided-next:disabled { background: var(--surface-2); color: var(--muted); cursor: default; }
.guided-back {
    width: 100%; height: 44px; border-radius: 10px;
    background: transparent; border: 1.5px solid var(--line);
    color: var(--muted); font-size: .9rem; font-weight: 800; cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.guided-back:active { color: var(--text); border-color: var(--line-strong); }
.guided-error { margin-bottom: 12px; padding: 10px 14px; border-radius: 8px; background: rgba(229,9,20,.12); border: 1px solid rgba(229,9,20,.35); color: #ffd7d9; font-size: .85rem; }

/* Step 2: PIN digits */
.pin-input-wrap { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px; }
.pin-digit {
    width: 44px; height: 56px; border-radius: 10px;
    border: 2px solid var(--line);
    background: var(--bg-soft); color: var(--text);
    font-size: 1.4rem; font-weight: 900; text-align: center;
    outline: none; caret-color: var(--red);
    transition: border-color .18s ease;
}
.pin-digit:focus { border-color: rgba(229,9,20,.6); }

/* Step 3: success */
.guided-panel-success { display: flex; flex-direction: column; align-items: center; padding: 16px 0; }
.guided-success-icon {
    width: 64px; height: 64px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(61,220,132,.18); border: 2px solid rgba(61,220,132,.4);
    margin-bottom: 16px;
}

/* ============================================================
   SERIES SHOW PAGE
   ============================================================ */
.series-show-page { padding: 30px 16px calc(var(--mobile-nav-height) + 24px + env(safe-area-inset-bottom,0px)); }

.series-show-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; margin-bottom: 18px;
}
.series-show-head h1 { font-size: 1.35rem; font-weight: 900; margin: 0 0 2px; }
.series-show-head .eyebrow { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 4px; }
.series-show-head .subtitle { font-size: .82rem; color: var(--muted); margin: 0; }

/* Season chips */
.season-chips {
    display: flex; gap: 8px;
    padding: 0 0 14px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.season-chips::-webkit-scrollbar { display: none; }
.season-chip {
    flex: 0 0 auto; height: 34px; padding: 0 14px;
    border-radius: 999px; border: 1.5px solid var(--line);
    background: transparent; color: var(--muted);
    font-size: .82rem; font-weight: 900; cursor: pointer;
    scroll-snap-align: start;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.season-chip.active {
    border-color: rgba(229,9,20,.55); background: rgba(229,9,20,.14); color: var(--text);
}

/* Episode list v2 */
.episode-list-v2 { display: flex; flex-direction: column; }
.episode-row-v2 {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 8px; border-radius: 10px;
    text-decoration: none; color: var(--text);
    transition: background .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.episode-row-v2:active,
.episode-row-v2.current { background: var(--surface); }

.ep-thumb {
    width: 80px; height: 50px; border-radius: 8px;
    background: var(--surface-2); overflow: hidden;
    border: 1px solid var(--line); flex-shrink: 0;
    display: grid; place-items: center; position: relative;
}
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-thumb-placeholder { font-size: .72rem; font-weight: 900; color: var(--muted); }
.ep-playing-indicator {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: rgba(0,0,0,.55); color: #fff;
}

.ep-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ep-code { font-size: .7rem; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ep-title { font-size: .88rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-badge {
    display: inline-block; padding: 2px 7px; border-radius: 4px;
    font-size: .65rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em;
    align-self: flex-start;
}
.ep-badge-playing { background: rgba(229,9,20,.18); border: 1px solid rgba(229,9,20,.35); color: #ffb4b9; }
.ep-badge-watched { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); color: var(--muted); }

.ep-action { display: grid; place-items: center; width: 30px; height: 30px; color: var(--muted); flex-shrink: 0; }
.ep-action-ghost { color: rgba(255,255,255,.25); }

/* ============================================================
   REMOTE — device online badge
   ============================================================ */
.device-online-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px;
    font-size: .72rem; font-weight: 800;
    border: 1px solid transparent;
}
.device-online-badge.online {
    background: rgba(61,220,132,.12); border-color: rgba(61,220,132,.35); color: var(--green);
}
.device-online-badge.offline {
    background: rgba(255,255,255,.05); border-color: var(--line); color: var(--muted);
}
.device-online-badge::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0;
}
.device-online-badge.online::before { box-shadow: 0 0 5px rgba(61,220,132,.6); }

/* ============================================================
   PLAYER — touch overlay zones
   ============================================================ */
.player-touch-overlay {
    position: absolute; inset: 0; z-index: 5;
    display: flex; pointer-events: auto;
}
.player-touch-zone {
    flex: 1; display: flex; align-items: center; justify-content: center;
    position: relative; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.player-touch-center { flex: 2; }

/* seek bar 48px touch target */
.player-seek { padding-top: 10px; padding-bottom: 10px; }

/* Skip hint */
.player-touch-hint {
    position: absolute; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: #fff; opacity: 0; pointer-events: none;
    transition: opacity .15s ease;
    text-shadow: 0 1px 4px rgba(0,0,0,.8);
    font-size: .7rem; font-weight: 900;
}
.player-touch-hint-left { left: 12px; }
.player-touch-hint-right { right: 12px; }
.player-touch-hint.active { opacity: 1; }

/* ============================================================
   PLAYER — cast picker integrado no hero
   ============================================================ */
.watch-cast-section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.watch-cast-label {
    display: flex; align-items: center; gap: 6px;
    font-size: .68rem; font-weight: 900; text-transform: uppercase;
    letter-spacing: .1em; color: var(--muted);
    margin-bottom: 10px;
}
.watch-cast-list { display: flex; flex-direction: column; gap: 8px; }
.watch-cast-btn {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 13px 16px; border-radius: 12px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
    color: #fff; font-size: .92rem; font-weight: 800;
    text-align: left; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s, border-color .12s;
}
.watch-cast-btn:active, .watch-cast-btn:focus-visible {
    background: rgba(229,9,20,.16); border-color: rgba(229,9,20,.5);
    outline: none;
}
.watch-cast-btn:disabled { opacity: .45; }
.watch-cast-btn-icon { color: rgba(255,255,255,.6); flex-shrink: 0; display: flex; }
.watch-cast-btn-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-cast-btn-arrow { color: rgba(255,255,255,.25); flex-shrink: 0; display: flex; }
.watch-cast-empty { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }

/* Canal ao vivo — hero adaptado */
.watch-live-layout {
    grid-template-columns: 80px 1fr !important;
    align-items: flex-start !important;
    gap: 16px !important;
}
.watch-live-logo-wrap { padding-top: 4px; }
.watch-live-logo {
    display: block; width: 80px; height: 80px;
    border-radius: 14px; overflow: hidden;
    border: 1px solid rgba(255,255,255,.12);
    background: var(--surface-2);
}
.watch-live-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.watch-hero--live .watch-hero-info h1 { font-size: 1.3rem; }

/* ============================================================
   BROWSE — lista de categorias de canais ao vivo
   ============================================================ */
.live-category-list { display: flex; flex-direction: column; gap: 2px; padding: 0 16px; }
.live-category-row {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 12px; border-radius: 10px;
    text-decoration: none; color: var(--text);
    -webkit-tap-highlight-color: transparent;
    transition: background .12s;
}
.live-category-row:active { background: rgba(255,255,255,.06); }
.live-category-icon { color: var(--muted); flex-shrink: 0; display: flex; }
.live-category-name { flex: 1; font-size: .95rem; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-category-count { font-size: .78rem; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.live-category-arrow { color: rgba(255,255,255,.2); flex-shrink: 0; }

/* ============================================================
   BROWSE — live cast card in home-card-grid
   ============================================================ */
.live-cast-link {
    display: flex; flex-direction: column; gap: 6px;
    text-decoration: none; color: inherit; min-width: 0;
}
.home-card-grid .live-cast-button {
    grid-column: unset; grid-row: unset; align-self: auto;
    width: 100%; padding: 6px 8px; border-radius: 6px;
}

/* ============================================================
   ADMIN — mobile layout improvements
   ============================================================ */

/* Section head: stack action buttons vertically */
.admin-body .section-head { margin: 12px 0 20px; }
.admin-body .section-head .actions { flex-direction: column; gap: 8px; }
.admin-body .section-head .actions .btn,
.admin-body .section-head > .btn {
    width: 100%; text-align: center; justify-content: center;
}

/* Reduce panel padding on mobile */
.admin-body .panel { padding: 16px; }

/* Heading sizes */
.admin-body h1 { font-size: clamp(1.55rem, 8vw, 2.2rem); line-height: 1.15; margin: 0 0 4px; }
.admin-body h2 { font-size: 1.05rem; word-break: break-word; margin: 0 0 6px; }

/* ── User card list ─────────────────────────────────────────── */
.admin-user-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.admin-user-card {
    display: flex; flex-direction: column; gap: 0;
    padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface); color: var(--text); text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s ease, border-color .15s ease;
}
.admin-user-card:active { background: var(--surface-2); border-color: rgba(255,255,255,.18); }
.admin-user-card-top {
    display: flex; align-items: flex-start; gap: 10px;
    padding-bottom: 12px; margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.admin-user-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.admin-user-card-info strong { font-size: .97rem; font-weight: 800; line-height: 1.2; }
.admin-user-card-info span {
    font-size: .81rem; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin-user-card-iptv { display: flex; align-items: center; gap: 10px; min-width: 0; }
.admin-user-card-label {
    font-size: .68rem; font-weight: 900; text-transform: uppercase;
    letter-spacing: .08em; color: var(--muted); flex-shrink: 0;
}
.admin-user-card-iptv-value {
    flex: 1; min-width: 0;
    font-size: .84rem; color: var(--text);
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin-user-card-iptv-empty { font-size: .84rem; color: var(--muted-2); font-style: italic; }
.admin-empty { color: var(--muted); padding: 24px 0; text-align: center; margin: 0; }

/* ── Admin tables: compact + hide non-essential columns ──────── */
.admin-body .table-wrap {
    border-radius: 8px; border: 1px solid var(--line);
    overflow: hidden; overflow-x: auto;
}
.admin-body table { min-width: 0; }
.admin-body th, .admin-body td { padding: 10px 8px; font-size: .82rem; }
.admin-body th { font-size: .7rem; }

/* Column visibility */
.admin-col-hide { display: none; }

/* Domain URL: truncate in narrow cells */
.admin-domain-url {
    display: block; max-width: 160px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Catalog: compact read-only sync URL inputs */
.admin-catalog-sync-card input[readonly] {
    font-size: .75rem; min-height: 38px; padding: 8px 10px;
}

/* ── Wider screens: restore columns ─────────────────────────── */
@media (min-width: 640px) {
    .admin-col-hide { display: table-cell; }
    .admin-body .section-head .actions { flex-direction: row; }
    .admin-body .section-head .actions .btn,
    .admin-body .section-head > .btn { width: auto; }
    .admin-body .table-wrap { border-radius: 0; border: none; }
    .admin-body table { font-size: inherit; }
    .admin-body th, .admin-body td { padding: 14px 12px; font-size: inherit; }
    .admin-body th { font-size: .78rem; }
    .admin-domain-url { max-width: none; }
}

/* ============================================================
   DEVICES PAGE — v2 improvements
   ============================================================ */

/* Count badge pill */
.device-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--surface-2); border: 1px solid var(--line);
    font-size: .65rem; font-weight: 900; color: var(--muted);
}

/* Empty state */
.device-empty {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: 52px 24px 32px; gap: 10px;
}
.device-empty-icon {
    width: 68px; height: 68px; border-radius: 18px;
    display: grid; place-items: center;
    background: var(--surface-2); border: 1px solid var(--line);
    color: var(--muted); margin-bottom: 8px;
}
.device-empty strong { font-size: 1rem; font-weight: 900; display: block; }
.device-empty p {
    font-size: .84rem; color: var(--muted); line-height: 1.55;
    max-width: 280px; margin: 0;
}
.device-empty .btn { margin-top: 8px; min-height: 48px; padding: 0 24px; }

