/* TV Guide — matches reference design (black header, purple panel, green grid) */

.guide-page {
    --guide-header-bg: #000000;
    --guide-ticker-bg: #1a0033;
    --guide-accent-green: #1cde02;
    --guide-channel-bg: #4527a0;
    --guide-channel-gradient: linear-gradient(90deg, #1636a8 0%, #4527a0 100%);
    --guide-program-bg: #6d4fc4;
    --guide-shopping-bg: #3a2066;
    --guide-program-border: rgba(255, 255, 255, 0.7);
    --guide-weather-bg: #14521f;
    --guide-game-bg: #14521f;
    --guide-footer-bg: linear-gradient(90deg, rgba(42, 16, 85, 0.95) 0%, rgba(0, 0, 0, 0.95) 50%, rgba(42, 16, 85, 0.95) 100%);
    --guide-now-playing-height: 360px;
    --guide-now-playing-poster-col: 132px;
    /* Hard cable-guide bevel (light top/left, black bottom/right) */
    --guide-bevel-top: 3px;
    --guide-bevel-left: 3px;
    --guide-bevel-right: 4px;
    --guide-bevel-bottom: 4px;
    --guide-bevel-light: #b8b8c6;
    --guide-bevel-light-bright: #f2f2f8;
    --guide-bevel-dark: #000000;
    --guide-bevel-light-strong: #ffffff;
    --guide-bevel-left-strong: #d0d0dc;
}

.guide-page .top-bar {
    background: var(--guide-ticker-bg);
    border: none;
    border-bottom: 1px solid rgba(99, 27, 168, 0.45);
    flex-shrink: 0;
}

.guide-page .nowplay-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 6px;
    flex-shrink: 0;
    width: 100%;
}

.guide-page .nowplay-brand .logo-container {
    max-width: none;
    height: auto;
    justify-content: flex-start;
}

.guide-page .nowplay-brand .logo-image {
    height: 58px;
    max-width: 260px;
}

.guide-page .info-box > .date-display,
.guide-page .date-display {
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: none;
    letter-spacing: 0.4px;
    margin: 0 0 8px;
    flex-shrink: 0;
}

.guide-page .guide-breadcrumb {
    background: var(--guide-ticker-bg);
    height: 28px;
    border: none;
    box-shadow: none;
}

.guide-page .guide-breadcrumb .ticker-viewport {
    height: 100%;
}

.guide-page .guide-breadcrumb .ticker-content {
    padding-left: 0;
    animation: none;
}

@keyframes guide-scroll-ticker {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-1 * var(--ticker-distance, 50%)));
    }
}

.guide-page .guide-breadcrumb .ticker-item {
    font-family: 'Barlow', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: rgba(221, 208, 255, 0.82);
    text-shadow: none;
    filter: none;
    padding: 0;
    flex-shrink: 0;
    text-decoration: none;
}

.guide-page .guide-breadcrumb a.ticker-item-link {
    color: rgba(221, 208, 255, 0.92);
    cursor: pointer;
}

.guide-page .guide-breadcrumb a.ticker-item-link:hover,
.guide-page .guide-breadcrumb a.ticker-item-link:focus-visible {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.guide-page .guide-breadcrumb:hover .ticker-content,
.guide-page .guide-breadcrumb:focus-within .ticker-content {
    animation-play-state: paused;
}

.guide-page .guide-breadcrumb .ticker-sep {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: rgba(221, 208, 255, 0.45);
    padding: 0 14px;
    font-size: 12px;
    line-height: 1;
}

/* Now playing + preview row */
.guide-page.screen-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.crt-screen:has(.guide-page) {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

.guide-page .info-section.nowplay-preview {
    height: var(--guide-now-playing-height);
    min-height: var(--guide-now-playing-height);
    max-height: var(--guide-now-playing-height);
    flex: 0 0 var(--guide-now-playing-height);
    align-items: stretch;
    background: linear-gradient(
        to right,
        rgb(72, 22, 118) 0%,
        rgb(52, 18, 92) 22%,
        rgb(28, 10, 48) 38%,
        rgb(12, 4, 20) 46%,
        #000000 52%,
        #000000 100%
    );
    border: none;
    overflow: hidden;
}

.guide-page .info-section.nowplay-preview .info-box {
    padding: 16px 24px 18px;
    border-right: none;
    background: transparent;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
    align-self: stretch;
    align-items: stretch;
    justify-content: flex-start;
    position: relative;
}

.guide-page .info-box:has(.has-channel-graphic),
.guide-page .info-box:has(.has-poster) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 1.35fr);
    grid-template-rows: auto auto auto minmax(0, 1fr);
    column-gap: 16px;
    align-items: start;
}

.guide-page .info-box:has(.has-channel-graphic) .nowplay-brand,
.guide-page .info-box:has(.has-channel-graphic) .info-title,
.guide-page .info-box:has(.has-channel-graphic) > .date-display,
.guide-page .info-box:has(.has-poster) .nowplay-brand,
.guide-page .info-box:has(.has-poster) .info-title,
.guide-page .info-box:has(.has-poster) > .date-display {
    grid-column: 1;
}

.guide-page .info-box:has(.has-channel-graphic) .info-body.has-channel-graphic,
.guide-page .info-box:has(.has-poster) .info-body.has-poster {
    display: contents;
}

.guide-page .info-box:has(.has-channel-graphic) .info-content,
.guide-page .info-box:has(.has-poster) .info-content {
    grid-column: 1;
    grid-row: 4;
    min-height: 0;
}

.guide-page .info-box:has(.has-channel-graphic) .program-poster-frame.channel-graphic,
.guide-page .info-box:has(.has-poster) .program-poster-frame {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: center;
    justify-self: center;
    width: 100%;
    max-width: 300px;
    height: auto;
    max-height: calc(var(--guide-now-playing-height) - 36px);
    min-height: 0;
    margin: 0;
    padding: 0;
}

.guide-page .info-section.nowplay-preview .commercial-box {
    flex: 1.1;
    background: #000;
    padding: 0;
    position: relative;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    align-self: stretch;
    box-sizing: border-box;
}

.guide-page .info-section.nowplay-preview .commercial-content,
.guide-page .info-section.nowplay-preview .commercial-video-frame,
.guide-page .info-section.nowplay-preview .weather-preview-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    aspect-ratio: auto;
    border: none;
    box-shadow: none;
    background: #000;
}

.guide-page .info-section.nowplay-preview .weather-preview-frame {
    background: linear-gradient(180deg, #d94a1a 0%, #e87828 22%, #2f6bc4 58%, #1e4a9e 100%);
}

.guide-page .weather-preview-title {
    font-family: 'Barlow', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #f9d326;
    margin-bottom: 10px;
}

.guide-page .info-section.nowplay-preview .commercial-video {
    object-fit: contain;
    background: #000;
}

.guide-page .info-title {
    font-family: 'Barlow', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.85);
    border-bottom: none;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.guide-page .current-time {
    font-family: 'Barlow', sans-serif;
    font-size: 34px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.guide-page .timezone-info,
.guide-page .current-channel,
.guide-page .current-window,
.guide-page .program-description {
    font-family: 'Barlow', sans-serif;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: none;
}

.guide-page .current-program {
    font-family: 'Barlow', sans-serif;
    font-size: 17px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    margin-top: 4px;
}

.guide-page .program-poster-frame {
    background: transparent;
    border: none;
    padding: 0;
    width: var(--guide-now-playing-poster-col);
    min-width: var(--guide-now-playing-poster-col);
    max-width: var(--guide-now-playing-poster-col);
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    overflow: hidden;
}

.guide-page .program-poster-frame:not([hidden]) {
    visibility: visible;
}

.guide-page .program-poster-frame img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 0 10px rgba(99, 27, 168, 0.45));
}

/* Channel logos + movie posters: larger, vertically centered in now-playing */
.guide-page .info-body.has-channel-graphic,
.guide-page .info-body.has-poster {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 1.45fr);
    gap: 10px;
}

.guide-page .info-body.has-channel-graphic .program-poster-frame.channel-graphic,
.guide-page .info-body.has-poster .program-poster-frame {
    width: 100%;
    min-width: 0;
    max-width: none;
    align-self: center;
    justify-content: center;
    align-items: center;
}

.guide-page .info-body.has-channel-graphic .program-poster-frame.channel-graphic img,
.guide-page .info-body.has-poster .program-poster-frame img {
    max-height: min(240px, calc(var(--guide-now-playing-height) - 48px));
    max-width: min(280px, 92%);
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}

.guide-page .info-body,
.guide-page .info-body.has-poster {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--guide-now-playing-poster-col);
    gap: 14px;
    align-items: stretch;
    width: 100%;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow: hidden;
}

.guide-page .info-content {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.guide-page .current-program,
.guide-page #now-program {
    overflow: hidden;
}

.guide-page .current-program .program-title,
.guide-page #now-program {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guide-page .program-description,
.guide-page #now-description {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.guide-page .current-channel,
.guide-page .current-window,
.guide-page #now-channel,
.guide-page #now-window {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Grid */
.guide-page .tv-guide-container {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.98) 0%, rgba(26, 0, 51, 0.95) 100%);
    border: none;
}

.guide-page .time-header {
    flex-shrink: 0;
}

/* Grid fills all the way to the footer; channel column stays locked
   while each row's programs strip scrolls horizontally behind it. */
.guide-page .channels-container {
    flex: 1 1 0;
    min-height: 0;
    height: 0;
    max-height: none !important;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    scroll-padding-bottom: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.guide-page .channels-container::-webkit-scrollbar {
    display: none;
}

/* The slot gridline overlay is anchored to the fixed row, so it would
   misalign with the scrolling timeline; program borders mark slots instead. */
.guide-page .channel-row::after {
    display: none;
}

.guide-page .channel-row {
    min-width: 0;
}

.guide-page .channel-row:last-child {
    margin-bottom: 0 !important;
}

.guide-page .programs-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    height: 100%;
    min-height: 0;
    align-self: stretch;
}

.guide-page .programs-scroll::-webkit-scrollbar {
    display: none;
}

.guide-page .time-track-wrapper {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.guide-page .time-track-wrapper::-webkit-scrollbar {
    display: none;
}

.guide-page .time-header {
    background: rgba(26, 0, 51, 0.98);
}

.guide-page .time-header-inner {
    border-bottom: none;
    align-items: stretch;
}

.guide-page .time-label,
.guide-page .time-marker {
    font-family: 'Barlow', sans-serif;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
    text-shadow: none;
    box-sizing: border-box;
    min-height: 40px;
    height: 100%;
    padding: 8px 6px;
}

.guide-page .time-label {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 0, 51, 0.98);
}

.guide-page .time-scale {
    gap: 0;
    align-items: stretch;
    flex-wrap: nowrap;
    height: 100%;
}

.guide-page .time-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 0, 51, 0.98);
}

.guide-page .time-scale::after,
.guide-page .time-marker::before {
    display: none;
}

.guide-page .channel-row {
    background: transparent;
    border: none;
    margin-bottom: 0 !important;
    box-shadow: none;
    transform: none !important;
    align-items: stretch;
    height: var(--channel-row-height);
    min-height: var(--channel-row-height);
    max-height: var(--channel-row-height);
}

.guide-page .channel-row:hover,
.guide-page .channel-row.selected {
    transform: none !important;
    outline: none;
    box-shadow: none;
}

.guide-page .channel-row:hover .channel-info,
.guide-page .channel-row:hover .program-block,
.guide-page .channel-row.selected .channel-info,
.guide-page .channel-row.selected .program-block {
    border-top-color: var(--guide-bevel-light-strong) !important;
    border-left-color: var(--guide-bevel-left-strong) !important;
    border-right-color: var(--guide-bevel-dark) !important;
    border-bottom-color: var(--guide-bevel-dark) !important;
}

.guide-page .channel-info,
.guide-page .program-block,
.guide-page .time-label,
.guide-page .time-marker {
    border-style: solid !important;
    border-width:
        var(--guide-bevel-top)
        var(--guide-bevel-right)
        var(--guide-bevel-bottom)
        var(--guide-bevel-left) !important;
    border-color:
        var(--guide-bevel-light-bright)
        var(--guide-bevel-dark)
        var(--guide-bevel-dark)
        var(--guide-bevel-light) !important;
    box-shadow: none !important;
    border-radius: 0;
    box-sizing: border-box;
}

.guide-page .channel-info {
    background: var(--guide-channel-bg);
    height: 100%;
    align-self: stretch;
    box-sizing: border-box;
}

.guide-page .channel-number-badge {
    background: rgba(0, 0, 0, 0.22);
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: none;
    width: 56px;
}

.guide-page .channel-number {
    font-family: 'Barlow', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: #b8a4e8;
    text-shadow: none;
}

.guide-page .channel-name,
.guide-page .channel-name-top,
.guide-page .channel-name-bottom {
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    color: #fff;
    text-shadow: none;
    text-transform: uppercase;
}

.guide-page .programs-row {
    background: #000;
    padding: 0;
    height: 100%;
    min-height: 100%;
    box-sizing: border-box;
}

.guide-page .program-block {
    top: 0;
    bottom: 0;
    box-sizing: border-box;
    background: var(--guide-program-bg) !important;
    transform: none !important;
}

.guide-page .program-block .program-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 15px;
    font-weight: 700;
    color: #fff !important;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.55);
    text-transform: uppercase;
}

.guide-page .program-block .program-time {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: #fff !important;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.45);
}

.guide-page .program-block.now-playing {
    background: #7a5cd6 !important;
    border-top-color: var(--guide-accent-green) !important;
    border-left-color: #9dff82 !important;
    border-right-color: var(--guide-bevel-dark) !important;
    border-bottom-color: var(--guide-bevel-dark) !important;
}

.guide-page .program-block.weather-program {
    background: var(--guide-weather-bg) !important;
}

.guide-page .program-block.weather-program .program-title {
    color: #fff !important;
}

.guide-page .program-block.weather-program .program-time {
    color: #fff !important;
}

.guide-page .program-block.shopping-program {
    background: var(--guide-shopping-bg) !important;
}

.guide-page .program-block.static-program {
    background: var(--guide-game-bg) !important;
}

.guide-page .program-block.static-program .program-title,
.guide-page .program-block.static-program .program-time {
    color: #fff !important;
}

.guide-page .program-block .live-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 3;
    background: #d62828;
    color: #fff;
    padding: 1px 5px;
    font-family: 'Barlow', sans-serif;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
    border-radius: 2px;
    pointer-events: none;
    letter-spacing: 0.4px;
}

.guide-page .tv-guide-footer {
    flex-shrink: 0;
    margin-top: 0;
    background: var(--guide-footer-bg);
    border-top: 1px solid rgba(99, 27, 168, 0.45);
}

.guide-page .footer-copy,
.guide-page .footer-social,
.guide-page .footer-social a {
    font-family: 'Barlow', sans-serif;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.82);
    letter-spacing: 0.4px;
}

.guide-page .footer-social,
.guide-page .footer-social a {
    text-transform: uppercase;
}

.guide-page .footer-social a:hover {
    color: #fff;
}

/* Desktop — preserve original channel column + ticker (never apply mobile overrides) */
@media (min-width: 769px) {
    .guide-page .guide-breadcrumb {
        display: block;
    }

    .guide-page .channel-info {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        justify-content: flex-start;
        background: var(--guide-channel-bg);
        padding: 0;
        height: 100%;
        min-height: 0;
        max-height: none;
    }

    .guide-page .channel-number-badge {
        display: flex;
        width: 56px;
        min-width: 56px;
        background: rgba(0, 0, 0, 0.22);
        border-right: 1px solid rgba(255, 255, 255, 0.18);
        padding: 0;
    }

    .guide-page .channel-number {
        font-size: 18px;
        color: #b8a4e8;
        letter-spacing: normal;
        text-transform: none;
    }

    .guide-page .channel-number::before {
        content: none;
    }

    .guide-page .channel-meta {
        flex: 1;
        padding: 8px 12px;
        text-align: left;
    }

    .guide-page .channel-name,
    .guide-page .channel-name-top,
    .guide-page .channel-name-bottom {
        font-size: inherit;
        letter-spacing: 0.6px;
        line-height: 1.1;
    }

    .guide-page .channel-row {
        display: grid;
        grid-template-columns: var(--channel-info-width) 1fr;
        align-items: stretch;
        height: var(--channel-row-height);
        min-height: var(--channel-row-height);
        max-height: var(--channel-row-height);
        margin-bottom: 0;
    }

    .guide-page .info-section.nowplay-preview {
        height: var(--guide-now-playing-height);
        min-height: var(--guide-now-playing-height);
        max-height: var(--guide-now-playing-height);
        flex: 0 0 var(--guide-now-playing-height);
    }

    .guide-page .info-section.nowplay-preview .info-box,
    .guide-page .info-section.nowplay-preview .commercial-box {
        height: 100%;
        min-height: 0;
        max-height: none;
        overflow: hidden;
        align-self: stretch;
    }

    .guide-page .info-section.nowplay-preview .commercial-box {
        flex: 1.1;
    }
}

@media (max-width: 768px) {
    .guide-page {
        --channel-info-width: 88px;
        --channel-row-height: 72px;
        --guide-mobile-channel-bg: var(--guide-channel-bg);
        --guide-now-playing-height: 220px;
        --guide-now-playing-poster-col: 72px;
    }

    .guide-page .info-section.nowplay-preview {
        flex-direction: column;
    }

    .guide-page .info-section.nowplay-preview .info-box {
        border-right: none;
        border-bottom: none;
        flex: 1 1 auto;
        padding: 8px 12px 10px;
        width: 100%;
        height: 100%;
        box-sizing: border-box;
        align-self: stretch;
    }

    .guide-page .info-section.nowplay-preview .commercial-box {
        display: none !important;
    }

    .guide-page .nowplay-brand {
        gap: 0;
        margin-bottom: 2px;
    }

    .guide-page .nowplay-brand .logo-image {
        height: 36px;
        max-width: 170px;
    }

    .guide-page .info-box > .date-display {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .guide-page .info-body,
    .guide-page .info-body.has-poster {
        grid-template-columns: minmax(0, 1fr) var(--guide-now-playing-poster-col);
        gap: 8px;
        height: auto;
        flex: 1 1 auto;
    }

    .guide-page .info-title {
        margin-bottom: 2px;
        font-size: 9px;
    }

    .guide-page .current-time {
        font-size: 22px;
        margin-bottom: 2px;
        line-height: 1.05;
    }

    .guide-page .timezone-info {
        font-size: 10px;
        line-height: 1.2;
        margin-bottom: 2px;
    }

    .guide-page .current-program,
    .guide-page #now-program {
        font-size: 13px;
        line-height: 1.15;
        margin-top: 0;
    }

    .guide-page .program-description,
    .guide-page #now-description {
        font-size: 10px;
        line-height: 1.25;
        margin-top: 2px;
    }

    .guide-page .current-channel,
    .guide-page .current-window,
    .guide-page #now-channel,
    .guide-page #now-window {
        font-size: 10px;
        line-height: 1.2;
        margin-top: 1px;
    }

    .guide-page .program-poster-frame img {
        max-height: 100%;
        max-width: 100%;
    }

    .guide-page .info-body.has-channel-graphic,
    .guide-page .info-body.has-poster {
        grid-template-columns: minmax(0, 1fr) minmax(100px, 1.25fr);
        gap: 6px;
    }

    .guide-page .info-box:has(.has-channel-graphic),
    .guide-page .info-box:has(.has-poster) {
        grid-template-columns: minmax(0, 1fr) minmax(96px, 0.9fr);
        column-gap: 8px;
    }

    .guide-page .info-box:has(.has-channel-graphic) .program-poster-frame.channel-graphic,
    .guide-page .info-box:has(.has-poster) .program-poster-frame {
        max-width: 150px;
        max-height: calc(var(--guide-now-playing-height) - 28px);
    }

    .guide-page .info-body.has-channel-graphic .program-poster-frame.channel-graphic img,
    .guide-page .info-body.has-poster .program-poster-frame img {
        max-height: min(140px, calc(var(--guide-now-playing-height) - 36px));
        max-width: min(150px, 92%);
    }

    .guide-page .tv-guide-container {
        overflow: hidden;
        padding: 6px 8px 8px;
        flex: 1 1 auto;
        min-height: 0;
    }

    .guide-page .tv-guide-footer {
        flex-shrink: 0;
    }

    .screen-content.guide-page {
        height: 100%;
        max-height: 100%;
        min-height: 0;
    }

    .guide-page .time-header {
        overflow: hidden !important;
    }

    .guide-page .time-header-inner {
        display: grid !important;
        grid-template-columns: var(--channel-info-width) 1fr;
        overflow: hidden !important;
        min-width: 0;
    }

    .guide-page .time-label {
        width: var(--channel-info-width);
        min-width: var(--channel-info-width);
        font-size: 10px;
        padding: 8px 4px;
        min-height: 40px;
        height: 100%;
        box-sizing: border-box;
    }

    .guide-page .time-track-wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        min-width: 0;
    }

    .guide-page .channels-container {
        display: block !important;
        flex-direction: unset !important;
        gap: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto;
        flex: 1 1 0;
        min-height: 0;
        height: 0;
        max-height: none !important;
        padding-bottom: 12px;
        scroll-padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
    }

    .guide-page .channel-row {
        display: grid !important;
        grid-template-columns: var(--channel-info-width) minmax(0, 1fr) !important;
        grid-template-rows: 1fr;
        flex-direction: row !important;
        align-items: stretch;
        height: var(--channel-row-height);
        min-height: var(--channel-row-height);
        max-height: var(--channel-row-height);
        min-width: 0;
        margin-bottom: 0 !important;
        padding: 0 !important;
        gap: 0 !important;
    }

    .guide-page .channel-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: var(--channel-info-width);
        min-width: var(--channel-info-width);
        max-width: var(--channel-info-width);
        height: 100%;
        padding: 4px 5px;
        gap: 2px;
        background: var(--guide-mobile-channel-bg);
        position: sticky;
        left: 0;
        z-index: 4;
    }

    .guide-page .channel-number-badge {
        width: 100%;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        justify-content: center;
    }

    .guide-page .channel-number {
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.3px;
        color: #b8a4e8;
        text-transform: uppercase;
    }

    .guide-page .channel-number::before {
        content: 'CH ';
    }

    .guide-page .channel-meta {
        width: 100%;
        padding: 0;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .guide-page .channel-name,
    .guide-page .channel-name.multi-line,
    .guide-page .channel-name.single-line,
    .guide-page .channel-name-top,
    .guide-page .channel-name-bottom {
        font-size: 8px;
        letter-spacing: 0.2px;
        line-height: 1.12;
        text-align: center;
        width: 100%;
    }

    .guide-page .channel-name.multi-line {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .guide-page .programs-scroll {
        overflow-x: auto;
        overflow-y: hidden;
        min-width: 0;
        height: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .guide-page .programs-row {
        height: 100%;
        min-height: 100%;
        max-height: 100%;
        padding: 0;
    }

    .guide-page .program-block {
        top: 0;
        bottom: 0;
        padding: 4px 8px;
    }

    .guide-page .program-block .program-title {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .guide-page .program-block .program-time {
        font-size: 9px;
    }

    .guide-page .program-block.shopping-program {
        background: var(--guide-shopping-bg) !important;
    }

    .guide-page .program-block.weather-program {
        background: var(--guide-weather-bg) !important;
    }

    .guide-page .program-block.weather-program .program-title,
    .guide-page .program-block.weather-program .program-time {
        color: #fff !important;
    }
}

@media (max-width: 540px) {
    .guide-page {
        --channel-info-width: 76px;
    }

    .guide-page .channel-name,
    .guide-page .channel-name-top,
    .guide-page .channel-name-bottom {
        font-size: 7px;
    }
}

/* Add to Home Screen prompt (mobile, first visit) */
.a2hs-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.a2hs-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.a2hs-overlay[hidden] {
    display: none !important;
}

.a2hs-dialog {
    position: relative;
    width: min(100%, 340px);
    background: #eeeeee;
    color: #333333;
    padding: 36px 28px 28px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.a2hs-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #222;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.a2hs-message {
    margin: 8px 0 22px;
    font-family: 'Barlow', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
    color: #444444;
}

.a2hs-action {
    display: inline-block;
    width: 100%;
    max-width: 260px;
    padding: 14px 18px;
    border: 1px solid #d0d0d0;
    background: #ffffff;
    color: #111111;
    font-family: 'Barlow', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.a2hs-action:active {
    transform: translateY(1px);
}

.a2hs-hint {
    margin: 14px 0 0;
    font-family: 'Barlow', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.35;
    color: #555555;
}

@media (min-width: 901px) {
    .a2hs-overlay {
        display: none !important;
    }
}
