:root {
    --premium-accent: #FF6200;
    --premium-bg-top: #121212;
    --premium-bg-bot: #050505;
    --bg-overlay-top: rgba(0, 0, 0, 0.7);
    --bg-overlay-mid: transparent;
    --bg-overlay-bot: rgba(0, 0, 0, 0.8);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --btn-bg: rgba(255, 255, 255, 0.1);
    --btn-bg-focus: #FFFFFF;
    --btn-bg-primary: rgba(255, 255, 255, 0.2);
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('./fonts/inter/Inter-Variable.woff2') format('woff2-variations');
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: inherit;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

body,
html {
    width: 100%;
    height: 100%;
    background-color: #000;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
}

.player-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #000;
}

.player-container:focus {
    outline: none;
}

#videoPlayer {
    width: 100%;
    height: 100%;
    object-fit: fill;
    /* Stretches content to fill the screen (no black bars for 4:3) */
}

.video-loading-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    z-index: 6;
    pointer-events: none;
}

.video-loading-spinner {
    display: block;
    width: 5.3rem;
    height: 5.3rem;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 50 50' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M25 2A23 23 0 0 1 48 25' fill='none' stroke='%23FF6200' stroke-width='2' stroke-linecap='round' opacity='1'/%3E%3Cpath d='M48 25A23 23 0 0 1 25 48' fill='none' stroke='%23FF6200' stroke-width='2' stroke-linecap='round' opacity='0.6'/%3E%3Cpath d='M25 48A23 23 0 0 1 2 25' fill='none' stroke='%23FF6200' stroke-width='2' stroke-linecap='round' opacity='0.3'/%3E%3Cpath d='M2 25A23 23 0 0 1 25 2' fill='none' stroke='%23FF6200' stroke-width='2' stroke-linecap='round' opacity='0.1'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    -webkit-animation: video-loading-spin 1s linear infinite;
    animation: video-loading-spin 1s linear infinite;
    position: relative;
    border: none;
}
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.video-loading-track,
.video-loading-arc {
    fill: none;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.video-loading-track {
    stroke: rgba(255, 98, 0, 0.12);
}

.video-loading-arc {
    stroke: var(--premium-accent);
    stroke-linecap: round;
    stroke-dasharray: 58 135;
    stroke-dashoffset: 8;
}

@-webkit-keyframes video-loading-spin {
    from {
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }

    to {
        -webkit-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

@keyframes video-loading-spin {
    from {
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }

    to {
        -webkit-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

/* Equivalent to Box with background(Brush.verticalGradient) */
.controls-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(to bottom, var(--bg-overlay-top) 0%, var(--bg-overlay-mid) 50%, var(--bg-overlay-bot) 100%);
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.controls-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

body.is-vod-playback .live-badge,
body.is-vod-playback #infoBtn,
body.is-vod-playback #restartBtn,
body.is-vod-playback #goLiveBtn {
    display: none !important;
}

/* TOP BAR */
.top-bar {
    width: 100%;
    padding: 4rem 4.8rem 0 4.8rem;
    display: flex;
    align-items: center;
}

.info-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.program-title {
    color: var(--text-primary);
    font-size: 2.8rem;
    font-weight: 800;
    /* Adjusted from Black to ExtraBold for closer weight match */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.program-desc {
    color: var(--text-secondary);
    font-size: 1.6rem;
    font-weight: 500;
    /* Medium */
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.4rem;
}

/* BOTTOM PANEL */
.bottom-panel {
    width: 100%;
    padding: 3.2rem 4.8rem;
    display: flex;
    flex-direction: column;
}

/* Badge Series */
.badge-container {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.badge {
    border-radius: 0.4rem;
    padding: 0.2rem 0.8rem;
    display: flex;
    align-items: center;
}

.badge>*:not(:last-child) {
    margin-right: 0.4rem;
}

.live-badge {
    background-color: #228B22;
    /* LIVE Green */
}

.archive-badge {
    background-color: #A52A2A;
    /* Archive Brown/Red */
}

.live-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background-color: white;
}

.badge span {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    /* Adjusted from 900 to 700 */
}

/* Seeker Bar */
.seeker-bar {
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 0.8rem;
    opacity: 1;
    /* from 0.5 to 1 based on enabled state */
}

.seeker-bar:focus {
    outline: none;
}

.time-text {
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 700;
    width: 6rem;
}

.seeker-bar:focus .time-text:not(.time-end) {
    color: var(--premium-accent);
}

.time-end {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    text-align: right;
}

.track-container {
    flex: 1;
    height: 2.4rem;
    margin: 0 1.2rem;
    position: relative;
    cursor: pointer;
}

.track-bg,
.track-live,
.track-progress {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 0.6rem;
    border-radius: 0.3rem;
    transition: height 0.2s ease, border-radius 0.2s ease;
    pointer-events: none;
}

.track-bg {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    z-index: 1;
}

.track-live {
    width: 100%;
    /* Updates dynamically */
    background-color: rgba(142, 142, 142, 0.72);
    z-index: 2;
    display: none;
    /* Only show in live */
}

.track-progress {
    width: 0%;
    /* Updates dynamically */
    background-color: var(--premium-accent);
    z-index: 3;
}

.scrubber {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background-color: white;
    border: 0.15rem solid var(--premium-accent);
    z-index: 4;
    left: 0%;
    /* Updates dynamically */
    transition: width 0.2s ease, height 0.2s ease, border-width 0.2s ease;
    pointer-events: none;
}

.seeker-bar:focus .track-bg,
.seeker-bar:focus .track-live,
.seeker-bar:focus .track-progress {
    height: 1rem;
    border-radius: 0.5rem;
}

.seeker-bar:focus .scrubber {
    width: 2rem;
    height: 2rem;
    border-width: 0.2rem;
}

.seeker-bar.seek-disabled .track-container {
    cursor: default;
}

.seeker-bar.seek-disabled .scrubber {
    display: none;
}

/* Action Rows & Transport */
.action-row {
    margin-top: 2.4rem;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 5.6rem;
}

.secondary-actions-left {
    position: absolute;
    left: 0;
    display: flex;
}

.secondary-actions-left>*:not(:last-child) {
    margin-right: 1.2rem;
}

.secondary-actions-right {
    position: absolute;
    right: 0;
    display: flex;
}

.secondary-actions-right>*:not(:last-child) {
    margin-right: 1.2rem;
}

.transport-actions {
    display: flex;
    align-items: center;
}

.transport-actions>*:not(:last-child) {
    margin-right: 3.2rem;
}

/* Buttons */
.player-btn {
    background-color: var(--btn-bg);
    border: none;
    border-radius: 1.2rem;
    padding: 1rem 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

/* Buttons */
.player-btn>*:not(:last-child) {
    margin-right: 0.8rem;
}

.player-btn svg {
    width: 2rem;
    height: 2rem;
    fill: var(--text-primary);
    transition: fill 0.2s ease;
}

.player-btn span:not(.material-symbols-rounded) {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 700;
    /* Adjusted from 900 to 700 */
    transition: color 0.2s ease;
}

.player-btn:focus,
.player-btn:hover {
    background-color: var(--btn-bg-focus);
}

.player-btn:focus svg,
.player-btn:hover svg {
    fill: #000;
}

.player-btn:focus span,
.player-btn:hover span {
    color: #000;
}

/* Transport Buttons */
.transport-btn {
    background-color: var(--btn-bg);
    border: none;
    border-radius: 50%;
    width: 5.6rem;
    height: 5.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.transport-btn.primary {
    background-color: var(--btn-bg-primary);
}

.transport-btn svg {
    width: 3.3600000000000003rem;
    /* 56 * 0.6 */
    height: 3.3600000000000003rem;
    fill: var(--text-primary);
    transition: fill 0.2s ease;
}

.transport-btn:focus,
.transport-btn:hover {
    background-color: var(--btn-bg-focus);
    transform: scale(1.2);
}

.transport-btn:focus svg,
.transport-btn:hover svg {
    fill: #000;
}

/* NAVIGATION OVERLAYS (Categories & Channels) */

/* Numeric Input Overlay (Direct Channel Entry) */
.numeric-input-overlay {
    position: absolute;
    top: 4.8rem;
    right: 4.8rem;
    background-color: rgba(30, 30, 30, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 2.4rem;
    padding: 1.2rem 2.8rem;
    color: #FFFFFF;
    font-size: 5.4rem;
    font-weight: 900;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: opacity 0.3s ease, transform 0.3s ease;
    min-width: 8rem;
    text-align: center;
}

.numeric-input-overlay.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.numeric-input-overlay.error {
    background-color: rgba(139, 0, 0, 0.85);
    /* Dark Red for errors */
    border-color: rgba(255, 255, 255, 0.3);
}

/* Base Navigation Elements */
.navigation-overlays {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    display: flex;
    transform: translate3d(-100%, 0, 0);
    -webkit-transform: translate3d(-100%, 0, 0);
    transition: transform 0.28s ease-out;
}

.navigation-overlays::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -140vw;
    width: 260vw;
    background-color: #0B0B0B;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
}

body.is-vod .navigation-overlays::before {
    opacity: 1;
}

body.is-search .navigation-overlays::before {
    opacity: 1;
    background:
        radial-gradient(circle at top right, rgba(255, 98, 0, 0.14), transparent 28%),
        linear-gradient(180deg, rgba(15, 15, 15, 0.96) 0%, rgba(8, 8, 8, 0.98) 100%);
}

/* States controlled by JS */
.navigation-overlays.state-channels,
.navigation-overlays.state-epg {
    transform: translate3d(-22rem, 0, 0);
    -webkit-transform: translate3d(-22rem, 0, 0);
}

.navigation-overlays.state-vod-grid,
.navigation-overlays.state-vod-details {
    transform: translateX(0);
    /* Do not shift the global overlay anymore! */
}

.navigation-overlays.state-categories {
    transform: translateX(0);
}

.navigation-overlays.state-dashboard {
    transform: translate3d(8rem, 0, 0);
    -webkit-transform: translate3d(8rem, 0, 0);
    opacity: 1;
}

/* System Clock — native: SmallClock at Alignment.TopEnd, padding top=6dp end=6dp */
/* IMPORTANT: clock is OUTSIDE navOverlays to avoid CSS transform bug */
.system-clock {
    position: fixed;
    top: 0.4rem;
    right: 0.5rem;
    color: #FFFFFF;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.05rem;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 10000;
    pointer-events: none;
    padding: 0.4rem 0.8rem;
    display: none;
}

body.clock-visible .system-clock {
    display: block;
}

/* Sidebar Menu (Dashboard) */
.sidebar-menu {
    width: 8rem;
    height: 100%;
    background-color: #1A1A1A;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.6rem 0 2.4rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    position: absolute;
    left: -8rem;
    /* Hidden off-screen to the left */
    z-index: 20;
}

.shara-logo {
    transform: translateY(-1rem);
    -webkit-transform: translateY(-1rem);
    margin-bottom: 3.2rem;
}

.shara-logo svg {
    width: 2.4rem;
    height: 2.4rem;
}

.sidebar-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.sidebar-items>*:not(:last-child) {
    margin-bottom: 3.2rem;
}

.sidebar-item {
    width: 100%;
    height: 6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    outline: none;
}

.sidebar-item svg {
    width: 2.8rem;
    height: 2.8rem;
    fill: rgba(128, 128, 128, 0.6);
    transition: fill 0.2s, transform 0.2s;
}

/* Sidebar: icons only, no labels (as in native DashboardView) */
.sidebar-label {
    display: none;
}

.sidebar-item.active svg,
.sidebar-item:focus svg {
    fill: #FF6D00;
    /* THE_PREMIUM_ACCENT */
}

.sidebar-item:focus svg {
    transform: scale(1.1);
}

/* Underline bar for focused/active item */
.sidebar-bar {
    position: absolute;
    bottom: 0.4rem;
    width: 0;
    height: 0.3rem;
    background: linear-gradient(to right, transparent, rgba(255, 109, 0, 0.8), #FF6D00, rgba(255, 109, 0, 0.8), transparent);
    border-radius: 0.2rem;
    transition: width 0.18s ease-out;
}

.sidebar-item:focus .sidebar-bar {
    width: 3.4rem;
}

.sidebar-item.active .sidebar-bar {
    width: 2.4rem;
    /* Slightly smaller for non-focused active item */
    opacity: 0.5;
}

.sidebar-item.active:focus .sidebar-bar {
    width: 3.4rem;
    opacity: 1;
}

.sidebar-bottom {
    margin-top: auto;
    width: 100%;
}

/* Base Panel Styles */
.category-panel {
    width: 22rem;
    height: 100%;
    background-color: #0A0A0A;
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    flex-shrink: 0;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    transition: margin-left 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

/* Specific state rule for category panel when VOD grid is focused */
.navigation-overlays.state-vod-grid .category-panel,
.navigation-overlays.state-vod-details .category-panel {
    margin-left: -22rem;
    opacity: 0;
    pointer-events: none;
}

.navigation-overlays.state-search .category-panel,
.navigation-overlays.state-search .channel-panel,
.navigation-overlays.state-search .epg-details-panel,
.navigation-overlays.state-search .vod-panel,
.navigation-overlays.state-settings .category-panel,
.navigation-overlays.state-settings .channel-panel,
.navigation-overlays.state-settings .epg-details-panel,
.navigation-overlays.state-settings .vod-panel {
    opacity: 0;
    pointer-events: none;
}

/* Fixed central selection box — stays put while list transforms */
.category-needle {
    position: absolute;
    top: 50%;
    margin-top: -2.2rem;
    /* Centers perfectly for 4.4rem */
    left: 0.8rem;
    right: 0.8rem;
    height: 4.4rem;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 0.8rem;
    pointer-events: none;
    z-index: 5;
}

.category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    /* Creates exactly 4.8rem stride per item (44height + 4gap) */
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    margin: 0;
    margin-top: -2.2rem;
    /* Set AFTER margin:0 to take effect */
    padding: 0;
    z-index: 6;
    /* Hardware-accelerated smooth transition optimized for MSX/TV CPUs */
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.category-list>*:not(:last-child) {
    margin-bottom: 0.4rem;
}


.channel-panel {
    width: 30rem;
    height: 100%;
    background-color: #0F0F0F;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}

/* OSD EPG Panel (Premium Android Style) */
.osd-epg-panel {
    position: absolute;
    bottom: 2.4rem;
    left: 2.4rem;
    right: 2.4rem;
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 2.4rem;
    padding: 2.4rem;
    display: flex;
    z-index: 50;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}

.osd-epg-panel.hidden {
    opacity: 0;
    transform: translateY(2rem);
}

.osd-logo-container {
    width: 11rem;
    height: 11rem;
    background: white;
    border-radius: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem;
    flex-shrink: 0;
    margin-right: 2.4rem;
}

.osd-logo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.osd-channel-number {
    color: black;
    font-size: 3.2rem;
    font-weight: 700;
}

.osd-info-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.osd-info-column>*:not(:last-child) {
    margin-bottom: 1.2rem;
}

.osd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.osd-channel-name {
    color: white;
    font-size: 2.6rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 1.2rem;
}

.osd-metadata-badges {
    display: flex;
}

.osd-metadata-badges>*:not(:last-child) {
    margin-right: 0.8rem;
}

.osd-badge {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0.4rem;
    padding: 0.2rem 0.6rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.05rem;
    text-transform: uppercase;
}

.osd-badge.accent {
    color: var(--premium-accent);
    border-color: rgba(255, 98, 0, 0.5);
    background: rgba(255, 98, 0, 0.15);
}

.osd-program-item {
    display: flex;
    flex-direction: column;
}

.osd-program-item>*:not(:last-child) {
    margin-bottom: 0.4rem;
}

.osd-program-top {
    display: flex;
    align-items: center;
}

.osd-program-top>*:not(:last-child) {
    margin-right: 0.8rem;
}

.osd-label {
    font-size: 1.4rem;
    font-weight: 700;
    color: #999999;
}

.osd-label.current {
    color: var(--premium-accent);
}

.osd-time {
    font-size: 1.4rem;
    font-weight: 500;
    color: #CCCCCC;
}

.current .osd-time {
    color: white;
}

.osd-remaining {
    margin-left: auto;
    color: var(--premium-accent);
    font-size: 1.4rem;
    font-weight: 700;
}

.osd-program-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: #CCCCCC;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.current .osd-program-title {
    color: white;
    font-weight: 700;
}

.osd-progress-container {
    width: 100%;
    height: 0.4rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.2rem;
    overflow: hidden;
    margin-top: 0.4rem;
}

.osd-progress-bar {
    height: 100%;
    background: var(--premium-accent);
    width: 0%;
}

.osd-program-desc {
    font-size: 1.4rem;
    color: #BBBBBB;
    line-height: 2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.4rem;
}

.osd-separator {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* Native SideCategoryHeader: height=44dp, bg=#0B0B0B, Folder icon in PREMIUM_ACCENT */
.channel-panel-header {
    height: 4.4rem;
    flex-shrink: 0;
    background-color: #0B0B0B;
    display: flex;
    align-items: center;
    padding: 0 1.2rem;
}

/* Native SideCategoryHeader: height=44dp > *:not(:last-child), bg=#0B0B0B > *:not(:last-child), Folder icon in PREMIUM_ACCENT */
.channel-panel-header>*:not(:last-child) {
    margin-right: 0.8rem;
}

.channel-panel-header svg {
    width: 1.8rem;
    height: 1.8rem;
    fill: #FF6200;
    flex-shrink: 0;
}

.channel-panel-header-title {
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.epg-details-panel {
    flex-shrink: 0;
    width: 0;
    min-width: 0;
    height: 100%;
    background-color: #000;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    transition: opacity 0.2s ease;
}

.state-epg .epg-details-panel {
    width: calc(100vw - 30rem);
    /* Only account for 30rem channel-panel, sidebar is absolute */
    min-width: 45rem;
    opacity: 1;
    pointer-events: auto;
}

.epg-header {
    padding: 2rem 2.4rem;
    display: flex;
    align-items: flex-start;
    flex-shrink: 0;
}

.epg-channel-logo-container {
    width: 4.4rem;
    height: 4.4rem;
    background-color: white;
    border-radius: 1rem;
    padding: 0.6rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.epg-channel-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.epg-channel-info {
    margin-left: 1.2rem;
}

.epg-channel-name {
    color: white;
    font-size: 2rem;
    font-weight: 900;
    /* FontWeight.Black */
}

.epg-archive-info {
    color: rgba(255, 98, 0, 0.7);
    /* PREMIUM_ACCENT.copy(alpha=0.7) */
    font-size: 1.4rem;
    font-weight: 500;
    margin-top: 0.6rem;
}

/* Lists shared base */
.category-list,
.channel-list {
    list-style: none;
    overflow-y: hidden;
    padding: 0.8rem 1.2rem;
    display: flex;
    flex-direction: column;
    /* position:relative = makes THIS element the offsetParent for children.
       Without this, element.offsetTop in scrollToAnchor includes the 4.4rem header,
       causing all scroll calculations to be wrong by 4.4rem. */
    position: relative;
}

/* Lists shared base */
.category-list>*:not(:last-child),
.channel-list>*:not(:last-child) {
    margin-bottom: 0.8rem;
}

/* category-list: full height, tighter gap */
.category-list {
    height: 100%;
}

/* category-list: full height > *:not(:last-child), tighter gap */
.category-list>*:not(:last-child) {
    margin-right: 0.4rem;
}

/* channel-list: flex:1 fills remaining space after the 4.4rem SideCategoryHeader.
   (Native Compose equivalent: LazyColumn(Modifier.fillMaxSize()) inside Column)
   Extra top padding gives breathing room between header and first channel. */
.channel-list {
    flex: 1;
    min-height: 0;
    padding-top: 1.6rem;
}

.epg-list {
    list-style: none;
    overflow-y: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 2.4rem 2.4rem;
}

.epg-list>*:not(:last-child) {
    margin-bottom: 0.6rem;
}

.epg-header-item {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    padding-top: 1.4rem;
    padding-bottom: 0.6rem;
    min-height: 2.4rem;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

.epg-header-label {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.3rem;
    font-weight: 700;
    white-space: nowrap;
}

.epg-header-line {
    -webkit-flex: 1;
    flex: 1;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin-left: 1.2rem;
}

.epg-program-item {
    padding: 1.2rem;
    border-radius: 1.4rem;
    cursor: pointer;
    border: 0.05rem solid transparent;
}

.epg-program-item:focus {
    background-color: rgba(255, 255, 255, 0.08);
    /* Native 0.08 alpha */
    border-color: rgba(255, 98, 0, 0.8);
    outline: none;
}

.epg-program-collapsed {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.2rem;
}

.epg-indicator {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    margin-right: 1.2rem;
}

.live-indicator {
    background-color: #228B22;
}

.archive-indicator {
    background-color: #A52A2A;
}

.epg-time {
    color: gray;
    font-size: 1.4rem;
    width: 4.5rem;
    flex-shrink: 0;
}

.epg-title {
    color: white;
    font-size: 1.6rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.epg-expanded-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.epg-expanded-time {
    color: var(--premium-accent);
    font-weight: 700;
    font-size: 1.6rem;
    margin-right: 1rem;
}

.epg-expanded-title {
    color: var(--premium-accent);
    font-weight: 700;
    font-size: 1.6rem;
}

/* Category Item */
.category-item {
    height: 4.4rem;
    /* Native 44dp */
    padding: 0 1.2rem;
    display: flex;
    align-items: center;
    color: #888;
    font-size: 1.5rem;
    font-weight: 400;
    border-radius: 0.8rem;
    cursor: pointer;
    outline: none;
    margin: 0 0.8rem;
    /* Vertical gap handled by list */
    background: transparent !important;
    /* No individual bg */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.state-categories .category-item:focus {
    color: white;
    font-weight: 700;
    /* Bold and white on focus, background from needle */
}

/* Channel Item */
.channel-item {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    height: 8.4rem;
    margin: 0.4rem 0.8rem;
    border-radius: 0.8rem;
    cursor: pointer;
    border: 0.2rem solid transparent;
    background-color: #1A1A1A;
    flex-shrink: 0;
}

.channel-item:focus,
.navigation-overlays:not(.state-channels) .channel-item.playing {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 98, 0, 0.5);
    outline: none;
    /* No scale, no transition */
}

.channel-logo-container {
    width: 4.8rem;
    height: 4.8rem;
    background-color: white;
    border-radius: 0.6rem;
    /* Native corner radius */
    padding: 0.4rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.channel-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.channel-info {
    margin-left: 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    overflow: hidden;
}

.channel-top-row {
    display: flex;
    align-items: center;
}

.channel-number {
    color: gray;
    font-size: 1.4rem;
    font-weight: 500;
    margin-right: 0.6rem;
}

.channel-name {
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 2.2rem;
    color: white;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.channel-epg-title {
    font-size: 1.3rem;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-item:focus .channel-epg-title,
.navigation-overlays:not(.state-channels) .channel-item.playing .channel-epg-title {
    color: white;
}

.channel-epg-progress-container {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin-top: 0.6rem;
    width: 100%;
}

.channel-epg-progress-bar {
    height: 100%;
    background-color: #666666;
    /* Native default color */
    transition: background-color 0.15s ease;
}

.channel-item:focus .channel-epg-progress-bar,
.navigation-overlays:not(.state-channels) .channel-item.playing .channel-epg-progress-bar {
    background-color: var(--premium-accent);
}

/* Activation Screen */
.activation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0A0A0A;
    /* Deep dark background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.activation-overlay.hidden {
    display: none;
}

.activation-card {
    background-color: var(--surface-color);
    padding: 6rem;
    border-radius: 2.4rem;
    width: 50rem;
    text-align: center;
    box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.shara-logo {
    font-size: 4.8rem;
    font-weight: 900;
    margin: 0 0 2rem 0;
}

.shara-logo-tv {
    color: var(--premium-accent);
}

.activation-card h2 {
    font-size: 2.2rem;
    margin-bottom: 0.4rem;
    color: white;
    font-weight: 700;
}

.activation-card p {
    color: gray;
    font-size: 1.4rem;
    margin-bottom: 2.4rem;
}

.pin-boxes-container {
    display: flex;
    margin-bottom: 2.4rem;
}

.pin-boxes-container>*:not(:last-child) {
    margin-right: 1rem;
}

.pin-box {
    width: 4.86rem;
    height: 5.67rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: white;
    border: 0.3rem solid transparent;
    transition: all 0.2s ease;
}

.pin-box.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--premium-accent);
}

.virtual-keypad {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.virtual-keypad>*:not(:last-child) {
    margin-bottom: 0.8rem;
}

.keypad-row {
    display: flex;
    justify-content: center;
}

.keypad-row>*:not(:last-child) {
    margin-right: 0.8rem;
}

.keypad-btn {
    width: 6rem;
    height: 4.8rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.8rem;
    border: none;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.keypad-btn:focus,
.keypad-btn.focused {
    background-color: var(--premium-accent);
}

.keypad-btn.hidden-btn {
    background-color: transparent;
    pointer-events: none;
    cursor: default;
}

.del-btn svg {
    width: 2.4rem;
    height: 2.4rem;
    fill: white;
}

.activation-error {
    color: #EF5350;
    /* soft red */
    font-size: 1.4rem;
    margin-bottom: 1.6rem;
    font-weight: 400;
}

.activation-error.hidden {
    display: none;
}

/* Global utility classes */
.hidden {
    display: none !important;
}

/* Panel Container for VOD */
.vod-panel {
    flex: 1;
    height: 100%;
    /* Strictly viewport height */
    position: relative;
    background-color: #0F0F0F;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent page scroll */
}

.vod-panel::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: #0F0F0F;
    z-index: 0;
}

.vod-panel.hidden {
    display: none;
}

/* Spinner pseudo-elements removed for SVG approach */
el.hidden {
    display: none;
}

/* Backdrop */
.vod-backdrop-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 70vh;
    /* Match fillMaxHeight(0.7f) exactly */
    z-index: 1;
    pointer-events: none;
}

.vod-backdrop-container.hidden {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.vod-backdrop-container:not(.hidden) {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.vod-backdrop {
    position: absolute;
    top: 0;
    right: 0;
    width: 70%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.vod-backdrop-gradient-horizontal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* TiviOn Spec: 0-30% solid, 38% at 0.5 alpha, 45% transparent */
    background: linear-gradient(to right,
            #0F0F0F 0%,
            #0F0F0F 30%,
            rgba(15, 15, 15, 0.5) 38%,
            transparent 45%,
            transparent 100%);
    pointer-events: none;
}

.vod-backdrop-gradient-vertical {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* TiviOn Spec: 0-55% transparent, 70-100% solid Black */
    background: linear-gradient(to bottom,
            transparent 0%,
            transparent 55%,
            #0F0F0F 70%,
            #0F0F0F 100%);
    pointer-events: none;
}

/* Content Layout */
.vod-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 4.8rem 0 4.8rem;
    /* No top padding here as info handles it */
    background: transparent;
}

.vod-content::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(to bottom,
            rgba(15, 15, 15, 0) 0%,
            rgba(15, 15, 15, 0.08) 30%,
            rgba(15, 15, 15, 0.55) 48%,
            rgba(15, 15, 15, 0.88) 68%,
            #0F0F0F 100%);
    z-index: -1;
    pointer-events: none;
}

/* Movie Info */
.vod-info {
    flex: 0 0 45%;
    /* Fixed 45% of height for metadata and backdrop focus */
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Keep info block pinned in place like native app */
    padding-top: 3.2rem;
    padding-bottom: 0;
    overflow: hidden;
}

.vod-title {
    color: white;
    font-size: 3.6rem;
    /* Slightly larger like in native app */
    font-weight: 700;
    line-height: 4.2rem;
    min-height: 4.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.8rem;
}

.vod-meta {
    display: flex;
    align-items: center;
    min-height: 2.4rem;
    margin-bottom: 1.2rem;
}

.vod-meta>*:not(:last-child) {
    margin-right: 0.8rem;
}

.vod-rating {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.4rem;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
}

.vod-year,
.vod-duration,
.vod-genre {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    /* Better readability */
}

.vod-dot {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.4rem;
}

.vod-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    line-height: 2.2rem;
    height: 11rem;
    min-height: 11rem;
    display: -webkit-box;
    line-clamp: 5;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Grid Section */
.vod-grid-section {
    flex: 1;
    /* Take the rest of the 55% height */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
    min-height: 0;
    /* Important for flex-child scrolling */
}

.vod-grid-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.6rem;
    padding-left: 0.8rem;
}

.vod-grid-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.vod-grid-actions {
    margin-right: 1.6rem;
}

.vod-sort-btn {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    width: 4rem;
    height: 4rem;
    padding: 0;
    cursor: pointer;
    outline: none;
    transition: background-color 0.15s ease, color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vod-sort-btn:focus,
.vod-sort-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

.vod-sort-btn svg {
    width: 2.4rem;
    height: 2.4rem;
    fill: currentColor;
}

.vod-category-title {
    color: white;
    font-size: 2rem;
    font-weight: 700;
}

.vod-counter {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.6rem;
    font-weight: 500;
}

.vod-grid-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* Internal scroll only */
    position: relative;
    padding-left: 0.8rem;
    padding-right: 1.2rem;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    height: 100%;
    background: linear-gradient(to bottom, rgba(15, 15, 15, 0.72), rgba(15, 15, 15, 0.9));
    border-radius: 1.2rem;
    scrollbar-width: none;
    /* Hide scrollbar for TV look */
}

.vod-grid-container::-webkit-scrollbar {
    display: none;
}

.vod-grid {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    /* Gaps via margin on items — column-gap/row-gap not supported on old Tizen flex */
    padding: 0;
    margin: 0;
    list-style: none;
    -webkit-transition: -webkit-transform 0.3s ease;
    transition: transform 0.3s ease;
    -webkit-align-content: flex-start;
    align-content: flex-start;
}

.vod-grid>* {
    /* column-gap: 0.8rem → margin-right; row-gap: 1.6rem → margin-bottom */
    margin: 0 0.8rem 1.6rem 0;
}

.vod-grid>*:nth-child(7n) {
    margin-right: 0;
}

.vod-item {
    /* 7 items per row with 6 internal gaps */
    width: calc((100% - (0.8rem * 6)) / 7);
    /* aspect-ratio not supported on old Tizen — height set via ::before trick */
    background-color: #222;
    border-radius: 0.8rem;
    position: relative;
    outline: none;
    cursor: pointer;
    overflow: hidden;
}

/* 2:3 aspect ratio via padding-top — compatible with all Tizen versions */
.vod-item::before {
    content: '';
    display: block;
    padding-top: 150%;
}

.vod-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.8rem;
    opacity: 0;
    -webkit-transition: opacity 0.3s ease;
    transition: opacity 0.3s ease;
    display: block;
}

.vod-item img.loaded {
    opacity: 1;
}

.vod-item:focus {
    -webkit-transform: scale(1.05);
    transform: scale(1.05);
    box-shadow: 0 0 0 0.3rem #FF6D00;
    z-index: 10;
}

/* =========================================================================
   VOD Details Panel (Movie and Series Native-like UI)
   ========================================================================= */
.vod-details-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    padding: 0 4.8rem;
    /* Matches .vod-content padding */
    z-index: 100;
}

.vod-details-panel.hidden {
    display: none !important;
}

/* Base text styles shared between layouts */
.movie-title,
.series-title {
    color: white;
    font-size: 3.6rem;
    font-weight: 700;
    line-height: 4.2rem;
    min-height: 4.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.8rem;
}

.movie-title-container,
.series-title-container {
    overflow: hidden;
    /* Margin moved directly to title, like native vod-title */
}

.movie-meta,
.series-meta {
    display: flex;
    align-items: center;
    min-height: 2.4rem;
    margin-bottom: 1.2rem;
}

.movie-meta>*:not(:last-child),
.series-meta>*:not(:last-child) {
    margin-right: 0.8rem;
}

.movie-rating,
.series-rating {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.4rem;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
}

.movie-year,
.movie-duration,
.movie-genre,
.series-year,
.series-genre {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
}

.movie-dot,
.series-dot {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.4rem;
}

.movie-description,
.series-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    line-height: 2.2rem;
    height: 11rem;
    min-height: 11rem;
    display: -webkit-box;
    line-clamp: 5;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------------- MOVIE LAYOUT (70 / 30) ---------------- */
.movie-details-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.movie-details-layout.hidden {
    display: none !important;
}

.movie-info-section {
    flex: 0 0 45%;
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 3.2rem;
    padding-bottom: 0;
    overflow: hidden;
}

.movie-actions-section {
    flex: 0.3;
    display: flex;
    align-items: center;
    padding: 1.6rem 0;
    /* Horizontal padding handled by scroll container or items later */
}

/* ---------------- SERIES LAYOUT (60 / 40) ---------------- */
.series-details-layout {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    height: 100%;
}

.series-details-layout.hidden {
    display: none !important;
}

.series-info-section {
    flex: 0 0 45%;
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 3.2rem;
    padding-bottom: 0;
    overflow: hidden;
}

.series-interactive-section {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    margin-top: auto;
    min-height: 0;
    padding-bottom: 2.4rem;
    position: relative;
    transition: transform 0.3s ease;
}

/* ---------------- SHARED / HORIZONTAL SCROLL LISTS ---------------- */
.actions-row,
.seasons-row-container,
.episodes-row-container {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 1.2rem;
}

.movie-actions {
    padding-left: 4.8rem;
}

.series-actions {
    padding-left: 4.8rem;
    padding-top: 1.6rem;
    margin-bottom: 0;
}

/* Premium Button */
.premium-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 0.8rem;
    padding: 0.8rem 2.4rem;
    font-size: 1.6rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, background-color 0.15s, color 0.15s;
    outline: none;
    margin-right: 1.6rem;
    white-space: nowrap;
}

.premium-btn.hidden {
    display: none !important;
}

.premium-btn svg {
    margin-right: 1rem;
}

.premium-btn:focus,
.premium-btn.active-focus {
    transform: scale(1.1);
    background-color: white;
    color: black;
    z-index: 10;
}

/* Seasons Tab List */
.seasons-list {
    list-style: none;
    padding: 2.4rem 4.8rem 1.2rem 4.8rem;
    /* Enough padding to not clip focused items */
    margin: 0;
    display: flex;
    flex-direction: row;
    overflow-x: hidden;
    transition: transform 0.3s ease;
}

.season-tab {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 0.8rem;
    padding: 0.8rem 2.4rem;
    font-size: 1.6rem;
    font-weight: 700;
    margin-right: 1.2rem;
    cursor: pointer;
    outline: none;
    white-space: nowrap;
}

.season-tab.selected {
    background-color: rgba(255, 255, 255, 0.3);
}

.season-tab:focus,
.season-tab.active-focus {
    background-color: white;
    color: black;
    z-index: 10;
}

/* Episodes List */
.episodes-list {
    list-style: none;
    padding: 1.2rem 4.8rem;
    /* Padding for focus scaling */
    margin: 0;
    display: flex;
    flex-direction: row;
    overflow-x: hidden;
    height: 22rem;
    /* Enough height for 16:9 + title + scaling */
    align-items: flex-start;
    transition: transform 0.3s ease;
}

.episode-card {
    width: 22rem;
    flex-shrink: 0;
    margin-right: 1.6rem;
    outline: none;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
    opacity: 1;
    /* changes to 0.5 if fully watched */
}

.episode-card.watched {
    opacity: 0.5;
}

.episode-card:focus,
.episode-card.active-focus {
    transform: scale(1.05);
    z-index: 10;
}

.episode-thumbnail-container {
    width: 100%;
    height: 12.4rem;
    /* 16:9 for 22rem is ~12.4rem */
    position: relative;
    border-radius: 0.8rem;
    background-color: rgba(0, 0, 0, 0.3);
    border: 0.3rem solid transparent;
    overflow: hidden;
    transition: border-color 0.15s;
}

.episode-card:focus .episode-thumbnail-container,
.episode-card.active-focus .episode-thumbnail-container {
    border-color: var(--premium-accent);
}

.episode-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.episode-badge-number {
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 0 0 0.8rem 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.episode-watched-icon {
    position: absolute;
    bottom: 0.8rem;
    right: 0.8rem;
    width: 2.4rem;
    height: 2.4rem;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    padding: 0.4rem;
    fill: white;
}

.episode-progress-bar-container {
    position: absolute;
    bottom: 0.8rem;
    left: 0.8rem;
    right: 0.8rem;
    height: 0.3rem;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 0.15rem;
}

.episode-progress-fill {
    height: 100%;
    background-color: var(--premium-accent);
    border-radius: 0.15rem;
    width: 0%;
}

.episode-title {
    margin-top: 0.8rem;
    color: gray;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.episode-card:focus .episode-title,
.episode-card.active-focus .episode-title {
    color: white;
}


/* Track Selection Overlay (Android Floating Card) */
.track-selection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    padding: 1.6rem;
    z-index: 2000;
    pointer-events: none;
}

.track-selection-overlay.hidden {
    display: none;
}

.search-panel {
    position: absolute;
    top: 0;
    right: 8rem;
    bottom: 0;
    left: 0;
    z-index: 12;
    padding: 3.2rem 2.4rem 2.4rem 2.4rem;
    pointer-events: auto;
    display: flex;
    opacity: 1;
    background: #0f0f0f;
    box-sizing: border-box;
    overflow: visible;
    /* Prevent glow/scale clipping */
}

.search-panel.hidden {
    display: none;
}

.search-shell {
    width: 100%;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    box-sizing: border-box;
    overflow: visible;
    /* Prevent glow/scale clipping */
}

.search-shell>*:not(:last-child) {
    margin-bottom: 2rem;
}

.search-header-block {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.search-header-block>*:not(:last-child) {
    margin-bottom: 0.8rem;
}

.search-input-shell {
    min-height: 6.4rem;
    border-radius: 3.2rem;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 0;
    background: #1f1f1f;
    border: 0.1rem solid rgba(255, 255, 255, 0.08);
}

.search-input-shell>*:not(:last-child) {
    margin-right: 1.2rem;
}

.search-input-shell svg {
    width: 2.4rem;
    height: 2.4rem;
    fill: #808080;
    flex-shrink: 0;
}

.search-input-copy {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

.search-input-text {
    position: relative;
    color: #fff;
    font-size: 2rem;
    font-weight: 500;
    line-height: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.search-input-text.placeholder {
    display: block;
    color: rgba(255, 255, 255, 0.25);
    padding-left: 0.4rem;
}

/* Logical cursor for search input - Restored legacy premium aesthetics */
.search-cursor {
    display: inline-block;
    width: 0.2rem;
    /* Thinner for elegance */
    height: 2.2rem;
    background-color: #FFFFFF;
    margin-left: 0.4rem;
    /* Spacing for beauty */
    margin-right: 0.1rem;
    border-radius: 0.1rem;
    animation: cursor-blink 1s step-end infinite;
    vertical-align: middle;
}

@keyframes cursor-blink {

    from,
    to {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* =========================================================================
   PREMIUM VIRTUAL KEYBOARD (Simple-Keyboard Customization)
   ========================================================================= */
.search-keyboard-wrap {
    width: 100%;
    max-width: 108rem;
    /* Safe width for 13 keys (12*6.5 + 12 + gaps) */
    margin: 0 auto;
    padding: 2.4rem 4rem;
    /* More horizontal padding to avoid edge clipping */
    background: rgba(255, 255, 255, 0.05);
    /* The "zadnik" */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2.4rem;
    box-sizing: border-box;
    overflow: visible;
}

.search-keyboard.hg-theme-default {
    background-color: transparent !important;
    padding: 0;
}

.search-keyboard.hg-theme-default .hg-row {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.search-keyboard.hg-theme-default .hg-button {
    display: -webkit-flex;
    display: flex;
    -webkit-flex: 1;
    flex: 1;
    height: 5.4rem;
    min-width: 3.5rem;
    background: #2a2a2a;
    /* Consistent solid background for clarity */
    border: none;
    border-radius: 0.8rem !important;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    padding: 0;
    margin: 0.2rem !important;
    /* Managed gap for separation without clutter */
    box-shadow: none !important;
}

.search-keyboard.hg-theme-default .hg-row {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    margin-bottom: 0.6rem !important;
    width: 100%;
}

/* Perfect alignment for SVG icons inside buttons */
.search-keyboard.hg-theme-default .hg-button svg {
    width: 2.4rem;
    /* Slightly smaller for more elegance */
    height: 2.4rem;
    fill: currentColor;
    pointer-events: none;
    display: block;
}

/* Special buttons width */
.search-keyboard.hg-theme-default .hg-button[data-skbtn="{space}"] {
    max-width: 32rem;
}

.search-keyboard.hg-theme-default .hg-button[data-skbtn="{bksp}"] {
    max-width: 12rem;
    /* Reduced from 18rem */
    background: rgba(255, 255, 255, 0.1);
}

.search-keyboard.hg-theme-default .hg-button[data-skbtn="{shift}"],
.search-keyboard.hg-theme-default .hg-button[data-skbtn="{numbers}"] {
    max-width: 12rem;
    font-size: 1.6rem;
    background: rgba(255, 255, 255, 0.05);
}

.search-keyboard.hg-theme-default .hg-button[data-skbtn="{en}"],
.search-keyboard.hg-theme-default .hg-button[data-skbtn="{ru}"] {
    max-width: 10rem;
    /* Reduced from 12rem */
    font-size: 1.6rem;
    background: rgba(255, 255, 255, 0.05);
}

/* Focused state - Pure Minimalist */
.search-keyboard.hg-theme-default .hg-button:focus,
.search-keyboard.hg-theme-default .hg-button.active-focus {
    background: #FFFFFF;
    color: #000000;
    border-color: #FFFFFF;
    /* Removed scale and glow */
}

/* Pressed state simulation - Minimalist B&W */
.search-keyboard.hg-theme-default .hg-button:active,
.search-keyboard.hg-theme-default .hg-button.hg-activeButton {
    background: #e0e0e0 !important;
    color: #000000 !important;
    transform: none !important;
}

/* Layout Specific Overrides to fix "merged" lines */
.hg-theme-default .hg-button.hg-standardBtn {
    width: auto;
}

.hg-theme-default .hg-row:last-child {
    margin-bottom: 0;
}

.search-meta-line {
    display: none;
}

.search-keyboard-wrap {
    position: absolute;
    bottom: 2.4rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 4.8rem);
    max-width: 74rem;
    z-index: 100;
    border-radius: 1.8rem;
    padding: 1rem;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-sizing: border-box;
    min-width: 0;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.6);
}

.search-panel.keyboard-hidden .search-keyboard-wrap {
    opacity: 0;
    transform: translate(-50%, 2rem);
    pointer-events: none;
}

.search-keyboard.hg-theme-default {
    background: transparent;
}

.search-keyboard .hg-row {
    justify-content: center;
    gap: 0;
    margin-bottom: 0.5rem;
}

.search-keyboard .hg-row>*:not(:last-child) {
    margin-right: 0.5rem;
}

.search-keyboard .hg-row:last-child {
    margin-bottom: 0;
}

.search-keyboard .hg-button {
    height: 3.4rem;
    min-width: 0;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    font-size: 1.2rem;
    font-weight: 700;
    flex: 1 1 0;
    margin: 0 !important;
    padding: 0 0.5rem;
    outline: none;
}

.search-keyboard .hg-button:focus,
.search-keyboard .hg-button:focus-visible {
    outline: none;
    box-shadow: none;
}

.search-keyboard .hg-button:active {
    background: rgba(255, 109, 0, 0.28);
}

/* Enforcing B&W focus for the keyboard tracking classes */
.search-keyboard .hg-button.hg-focused,
.search-keyboard .hg-button.search-key-focused {
    background: #FFFFFF !important;
    color: #000000 !important;
    border-color: #FFFFFF !important;
}

.search-keyboard .hg-button[data-skbtn="{space}"],
.search-keyboard .hg-button[data-skbtn="пробел"] {
    min-width: 18rem;
    flex: 2 1 0;
}

.search-keyboard .hg-button[data-skbtn="{shift}"],
.search-keyboard .hg-button[data-skbtn="{bksp}"],
.search-keyboard .hg-button[data-skbtn="{numbers}"],
.search-keyboard .hg-button[data-skbtn="{abc}"],
.search-keyboard .hg-button[data-skbtn="{ru}"],
.search-keyboard .hg-button[data-skbtn="{en}"] {
    flex: 1.4 1 0;
}

.search-results-area {
    flex: 1;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    overflow-y: auto;
    padding-right: 0.4rem;
    box-sizing: border-box;
}

.search-results-area.hidden {
    display: none;
}

.search-results-area::-webkit-scrollbar {
    display: none;
}

.search-empty-state {
    min-height: 10rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.38);
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    border-radius: 1.6rem;
    background: rgba(255, 255, 255, 0.02);
}

.search-empty-state.hidden {
    display: none;
}

.search-sections {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    max-width: 100%;
}

.search-sections>*:not(:last-child) {
    margin-bottom: 2rem;
}

.search-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    max-width: 100%;
}

.search-section>*:not(:last-child) {
    margin-bottom: 1rem;
}

.search-section-header {
    display: flex;
    align-items: baseline;
    gap: 0;
}

.search-section-header>*:not(:last-child) {
    margin-right: 1rem;
}

.search-section-title {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
}

.search-section-count {
    color: rgba(255, 255, 255, 0.45);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.04rem;
    text-transform: uppercase;
}

.search-row {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    max-width: 100%;
    overflow-x: auto;
    padding: 0.8rem 0;
    margin: 0;
}

.search-row>* {
    margin-right: 0.8rem;
}

.search-row>*:last-child {
    margin-right: 0;
}

.search-row::-webkit-scrollbar {
    display: none;
}

.search-card,
.search-tv-card {
    flex: 0 0 auto;
    outline: none;
    background: transparent;
    border: none;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.search-card {
    width: 14rem;
}

.search-card-poster {
    width: 100%;
    height: 21rem;
    border-radius: 1.2rem;
    background-color: #1a1a1a;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 0.2rem solid transparent;
    transition: border-color 0.15s ease;
}

.search-card:focus .search-card-poster,
.search-card.search-card-focused .search-card-poster {
    border-color: var(--premium-accent);
}

.search-card-title {
    margin-top: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    font-size: 1.4rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.search-card-title span {
    display: inline-block;
    will-change: transform;
}

.search-card:focus .search-card-title,
.search-card.search-card-focused .search-card-title {
    color: #fff;
    text-overflow: clip;
}

.search-card.search-card-focused .search-card-title span {
    animation: none;
}

.search-tv-card {
    width: 12.8rem;
    min-height: 11.5rem;
    border-radius: 1.4rem;
    border: 0.2rem solid transparent;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.search-tv-card>*:not(:last-child) {
    margin-bottom: 0.8rem;
}

.search-tv-card:focus,
.search-tv-card.search-card-focused {
    border-color: #bbbbbb;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
    box-shadow: none;
}

.search-tv-logo-shell {
    width: 6.8rem;
    height: 6.8rem;
    border-radius: 1.2rem;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0.4rem;
}

.search-tv-logo-shell img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.search-tv-title {
    width: 100%;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-tv-title span {
    display: inline-block;
    width: 100%;
    will-change: transform;
}

.search-tv-card.search-card-focused .search-tv-title {
    display: block;
    white-space: nowrap;
    text-overflow: clip;
    text-align: left;
}

.search-tv-card.search-card-focused .search-tv-title span {
    width: auto;
    animation: none;
}

@keyframes marquee-scroll {

    0%,
    20% {
        transform: translateX(0);
    }

    80%,
    100% {
        transform: translateX(min(0px, calc(-100% + 13.6rem)));
    }
}

@keyframes marquee-scroll-tv {

    0%,
    20% {
        transform: translateX(0);
    }

    80%,
    100% {
        transform: translateX(min(0px, calc(-100% + 11.2rem)));
    }
}

.search-tv-progress {
    width: 90%;
    height: 0.3rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.search-tv-progress-bar {
    height: 100%;
    background: var(--premium-accent);
    width: 0%;
}

.track-selection-overlay.sort-mode {
    align-items: stretch;
    padding: 1.6rem;
    background-color: transparent;
}

.track-card {
    background-color: rgba(10, 10, 10, 0.92);
    padding: 2.4rem;
    border-radius: 1.6rem;
    width: 36rem;
    height: 100%;
    box-shadow: 0 1.2rem 3.2rem rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    border: none;
    animation: none;
}

.track-card.sort-mode {
    width: 36rem;
    height: 100%;
    margin: 0;
    border-radius: 1.6rem;
    background-color: rgba(10, 10, 10, 0.92);
    border: none;
    box-shadow: 0 1.2rem 3.2rem rgba(0, 0, 0, 0.5);
    padding: 2.4rem;
    animation: none;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.track-header {
    display: flex;
    align-items: center;
    margin-bottom: 2.8rem;
}

.track-header-icon {
    width: 3.2rem;
    height: 3.2rem;
    margin-right: 1.6rem;
}

.track-card h2 {
    color: white;
    font-size: 2.6rem;
    font-weight: 700;
    margin: 0;
}

.track-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.track-card.sort-mode .track-list {
    overflow-y: auto;
    scrollbar-width: none;
}

.track-card.sort-mode .track-list::-webkit-scrollbar {
    display: none;
}

.track-item {
    padding: 1.4rem 2.4rem;
    border-radius: 1.2rem;
    background-color: rgba(255, 255, 255, 0.03);
    color: #CCC;
    margin-bottom: 1rem;
    outline: none;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
    border: 2px solid transparent;
}

.track-item:focus {
    background-color: #D1E2FF !important;
    /* Android-style light blue focus */
    color: #1A1A1A !important;
    transform: scale(1.02);
}

.track-card.sort-mode .track-item:focus {
    transform: none;
}

.track-item-title-row {
    display: flex;
    flex-direction: column;
}

.track-item-title {
    font-size: 1.8rem;
    font-weight: 500;
}

.track-item:focus .track-item-title {
    color: #000;
}

.track-item-check {
    width: 2.4rem;
    height: 2.4rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.track-item.selected .track-item-check {
    opacity: 0.6;
}

.track-item:focus.selected .track-item-check {
    opacity: 1;
}

.track-item:focus .track-item-check svg {
    fill: #000;
}

/* EPG DETAILED INFO PANEL (Premium Right Side Panel) */
.epg-info-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 35%;
    max-width: 55rem;
    height: 100%;
    z-index: 60;
    background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.95) 5%, rgba(0, 0, 0, 1) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 4.8rem;
    transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.28s ease;
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.epg-info-panel.hidden {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

.epg-info-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.epg-info-poster-container {
    width: 18rem;
    height: 10rem;
    border-radius: 0.8rem;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.05);
    margin-bottom: 2.4rem;
}

.epg-info-poster-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.epg-info-title {
    color: #FFFFFF;
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.8rem;
}

.epg-info-meta {
    color: var(--premium-accent);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 2.4rem;
}

.epg-info-divider {
    width: 4rem;
    height: 0.2rem;
    background-color: var(--premium-accent);
    margin-bottom: 1.6rem;
}

.epg-info-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.7rem;
    line-height: 1.5;
    font-weight: 400;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 1.2rem;
}

/* Scrollbar styling for description */
.epg-info-description::-webkit-scrollbar {
    width: 0.4rem;
}

.epg-info-description::-webkit-scrollbar-track {
    background: transparent;
}

.epg-info-description::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.2rem;
}

/* WATCH HISTORY PANEL (TiviOn Android Replica) */
.watch-history-panel {
    position: absolute;
    bottom: 1.2rem;
    left: 4.0rem;
    right: 4.0rem;
    width: auto;
    height: auto;
    min-height: 16rem;
    z-index: 55;
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 2.4rem;
    padding: 0.8rem 0;
    /* Vertical padding only, horizontal handled by list */
    display: flex;
    align-items: center;
    overflow: hidden !important;
    /* BACK TO HIDDEN: Maintain panel shape and rounded corners */
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
    transform: translateY(0);
    opacity: 1;
}

.watch-history-panel.hidden {
    transform: translateY(150%);
    opacity: 0;
    pointer-events: none;
}

.history-content-box {
    flex: 1;
    width: 100%;
    overflow: visible !important;
}

.history-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: visible;
    gap: 1.2rem;
    scrollbar-width: none;
    align-items: center;
    padding: 1.5rem 3.2rem;
    /* Increased vertical padding to 1.5rem to prevent top/bottom clipping */
    width: 100%;
    box-sizing: border-box;
}

.history-list::-webkit-scrollbar {
    display: none;
}

.history-list::after {
    content: '';
    flex: 0 0 2.8rem;
    /* Ensuring right-side padding is actually rendered in flex scroll */
    height: 1rem;
}

.history-item {
    min-width: 12.8rem;
    width: 12.8rem;
    height: 12.5rem;
    /* Added even more breathing room as requested */
    background: transparent;
    border-radius: 1.4rem;
    border: 2px solid transparent;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    outline: none;
    cursor: pointer;
    background-clip: padding-box;
}

.history-item:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: #BBBBBB;
    transform: scale(1.02);
}

.history-item-logo-box {
    width: 6.8rem;
    height: 6.8rem;
    background: #FFFFFF;
    border-radius: 1.2rem;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
}

.history-item-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.history-item-epg {
    color: #FFFFFF;
    font-size: 1.2rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    width: 100%;
    margin-bottom: 0.6rem;
}

.history-progress-container {
    width: 90%;
    height: 0.3rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.15rem;
    overflow: hidden;
}

.history-progress-bar {
    height: 100%;
    background: var(--premium-accent);
    width: 0%;
}

.clear-history-item {
    min-width: 11.0rem;
    width: 11.0rem;
    height: 12.5rem;
    background: transparent;
    border-radius: 1.4rem;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
    outline: none;
    cursor: pointer;
    background-clip: padding-box;
}

.clear-history-item:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: #BBBBBB;
    transform: scale(1.02);
}

.clear-history-icon {
    width: 3.2rem;
    height: 3.2rem;
    fill: rgba(255, 255, 255, 0.4);
    transition: fill 0.2s ease;
}

.clear-history-item:focus .clear-history-icon {
    fill: #FFFFFF;
}

.clear-history-text {
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.3rem;
    font-weight: 700;
    transition: color 0.2s ease;
}

.clear-history-item:focus .clear-history-text {
    color: #FFFFFF;
}

/* EXIT CONFIRMATION DIALOG (Premium Frosted Glass) */
.exit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(1.2rem);
    -webkit-backdrop-filter: blur(1.2rem);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.exit-dialog {
    background: rgba(40, 40, 40, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3.2rem;
    padding: 4.8rem;
    width: 48rem;
    text-align: center;
    box-shadow: 0 2.4rem 4.8rem rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

.exit-overlay:not(.hidden) .exit-dialog {
    transform: scale(1);
    opacity: 1;
}

.exit-title {
    color: #FFFFFF;
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 4rem;
}

.exit-buttons {
    display: flex;
    gap: 2.4rem;
    justify-content: center;
}

.exit-btn {
    flex: 1;
    height: 6rem;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    border-radius: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 1.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 16rem;
}

.exit-btn:focus,
.exit-btn.focus {
    background: #FFFFFF;
    color: #000000;
    transform: scale(1.05);
    border-color: #FFFFFF;
    box-shadow: 0 0 2rem rgba(255, 255, 255, 0.3);
}

.exit-overlay.hidden {
    display: none;
}

exit-overlay.hidden {
    display: none;
}

/* SETTINGS PANEL */
.settings-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: flex;
    background: #0d0d0d;
    z-index: 10;
    color: #FFFFFF;
}

.settings-panel.hidden {
    display: none;
}

.settings-sidebar {
    width: 38rem;
    height: 100%;
    padding: 6.4rem 3.2rem;
    display: flex;
    flex-direction: column;
}

.settings-main-title {
    font-size: 3.6rem;
    font-weight: 400;
    margin-bottom: 3.2rem;
    padding-left: 1.6rem;
}

.settings-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.settings-category-item {
    display: flex;
    align-items: center;
    padding: 1.2rem 1.6rem;
    border-radius: 1.2rem;
    border: 2px solid transparent;
    font-size: 2.2rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    outline: none;
}

.settings-category-item svg {
    width: 2.8rem;
    height: 2.8rem;
    margin-right: 1.6rem;
    fill: currentColor;
}

.settings-category-item.disabled {
    color: rgba(255, 255, 255, 0.3);
}

.settings-category-item.active {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
}

.settings-category-item:focus {
    background: #FFFFFF;
    color: #000000;
    font-weight: 400;
    border: 2px solid transparent;
}

.settings-content {
    flex: 1;
    height: 100%;
    padding: 6.4rem 0 0 0;
    display: flex;
    flex-direction: column;
    background: transparent;
    box-sizing: border-box;
}

.settings-category-title {
    font-size: 1.8rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 1.6rem;
    padding-left: 0;
}

.settings-items-container {
    flex: 1;
    overflow: hidden;
    background: #151515;
    border-radius: 1.6rem;
    padding: 2.4rem 3.2rem;
    margin-right: 6.4rem;
    margin-bottom: 6.4rem;
}

.settings-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

/* SETTINGS ITEMS */
.settings-item {
    display: flex;
    align-items: center;
    padding: 1.6rem 2.4rem;
    border-radius: 1.6rem;
    background: transparent;
    transition: all 0.2s ease;
    outline: none;
    cursor: pointer;
}

.settings-item:focus {
    background: #FFFFFF;
    transform: none;
    /* No scale to match screenshot flat design */
}

.settings-item-icon {
    width: 3.6rem;
    height: 3.6rem;
    margin-right: 2.4rem;
    fill: #FFFFFF;
    color: #FFFFFF;
}

.settings-item.danger .settings-item-icon {
    fill: #EF5350;
    color: #EF5350;
}

.settings-item.acc-verified .settings-item-icon {
    fill: #FF6D00;
    color: #FF6D00;
}

.settings-item:focus .settings-item-icon,
.settings-item:focus.danger .settings-item-icon,
.settings-item:focus.acc-verified .settings-item-icon {
    fill: #000000;
    color: #000000;
}

.settings-item-texts {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.settings-item-title {
    font-size: 2.2rem;
    font-weight: 400;
    color: #FFFFFF;
}

.settings-item.danger .settings-item-title {
    color: #EF5350;
}

.settings-item.acc-verified .settings-item-title {
    font-weight: 400;
}

.settings-item:focus .settings-item-title,
.settings-item:focus.danger .settings-item-title,
.settings-item:focus.acc-verified .settings-item-title {
    color: #000000;
}

.settings-item-desc {
    font-size: 1.6rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.8rem;
    line-height: 1.4;
}

.settings-item:focus .settings-item-desc {
    color: rgba(0, 0, 0, 0.6);
}

.settings-item-value {
    font-size: 2.4rem;
    font-weight: 700;
    color: #FF6200;
    margin-left: 1.6rem;
}

.settings-item:focus .settings-item-value {
    color: #000000;
}

/* PREMIUM SWITCH (iOS / Android style) */
.premium-switch {
    width: 6.4rem;
    height: 3.6rem;
    border-radius: 1.8rem;
    background: rgba(255, 255, 255, 0.3);
    position: relative;
    transition: background 0.3s ease;
    margin-left: 1.6rem;
}

.premium-switch.checked {
    background: #FF6200;
}

.premium-switch-thumb {
    width: 3rem;
    height: 3rem;
    background: #FFFFFF;
    border-radius: 50%;
    position: absolute;
    top: 0.3rem;
    left: 0.3rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.premium-switch.checked .premium-switch-thumb {
    transform: translateX(2.8rem);
}