/* modules/tv/assets/css/tv-broadcast.css
 * Kartuli TV — "ბროწეული" (Rose linen)
 * The channel on a pale warm tint of the brand red: cream panels lifted softly
 * off a rose-linen ground, rounded shapes, one red spent only on what is on air.
 * Tokens, the night edition, the shared kino chrome and the lamp live in
 * assets/css/rose-linen.css (loaded first); this file holds the TV page itself.
 */

/* ==========================================================================
   1. Page ground
   ========================================================================== */
.tv-theater-body {
    background-color: var(--ktv-page) !important;
    color: var(--ktv-ink);
    min-height: 100vh;
    overflow-x: clip;
    font-family: var(--ktv-text);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
.tv-theater-body * {
    scrollbar-width: thin;
    scrollbar-color: var(--ktv-line) transparent;
}
.tv-theater-body :focus-visible {
    outline: 2px solid var(--ktv-red-ink);
    outline-offset: 2px;
}

.tv-top-ad-wrapper {
    margin-top: 1rem;
    margin-bottom: 1.25rem;
}
.tv-top-ad-wrapper .ad-case {
    max-width: 1480px;
    margin: 0 auto;
}

/* ==========================================================================
   2. Masthead: the day's date and the lamp
   ========================================================================== */
.tv-stage-container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.tv-masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 0 18px;
}
.tv-dateline {
    margin: 0;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 12px;
    min-width: 0;
}
.tv-dateline time {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ktv-ink);
}
.tv-date-short {
    display: none;
}
.tv-dateline-channel {
    font-size: 0.8125rem;
    color: var(--ktv-ink-3);
}

/* ==========================================================================
   3. Broadcast stage (structure unchanged: player column + today column)
   ========================================================================== */
.tv-stage-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 28px;
    align-items: start;
}
@media (max-width: 1200px) {
    .tv-stage-grid {
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 22px;
    }
}
@media (max-width: 992px) {
    .tv-stage-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.tv-stage-primary {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* The picture: rounded, lifted softly off the linen */
.tv-viewport-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--ktv-r);
    overflow: hidden;
    box-shadow: var(--ktv-shadow-lift);
}

.tv-player-host {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 5;
    background: #000;
}

#tv-yt-target,
#tv-player-target,
#tv-yt-target iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    pointer-events: none !important;
}

#tv-external-target {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 6;
    overflow: hidden;
}
#tv-external-target > iframe,
#tv-external-target > video,
.tv-external-player {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    pointer-events: auto !important;
    object-fit: contain !important;
    background: #000 !important;
}

/* Televizia.org 16:9 cropper & scaler (geometry is load-bearing — keep) */
.televizia-crop-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    pointer-events: auto !important;
}
.televizia-crop-scaler {
    position: absolute;
    top: 0;
    left: 0;
    width: 766px;
    height: 479px;
    transform-origin: top left;
    overflow: hidden;
    pointer-events: auto !important;
}
.televizia-crop-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 766px;
    height: 479px;
    overflow: hidden;
    pointer-events: auto !important;
}
.televizia-crop-mask iframe {
    position: absolute !important;
    left: -219px !important;
    top: -35px !important;
    width: 1400px !important;
    height: 800px !important;
    border: 0 !important;
    display: block !important;
    pointer-events: auto !important;
}

.tv-viewport-frame.has-televizia .tv-mobile-hud,
.tv-viewport-frame:has(.televizia-crop-container) .tv-mobile-hud,
.tv-viewport-frame.has-televizia .tv-unmute-overlay,
.tv-viewport-frame.has-televizia .tv-tap-to-play-cue {
    display: none !important;
    pointer-events: none !important;
}

/* Fullscreen button (top-right, auto-hiding with the HUD) */
.tv-floating-fs-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 100;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ktv-veil);
    color: #fff;
    border: 0;
    border-radius: 50%;
    font-size: 15px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity var(--ktv-fast) var(--ktv-ease), transform var(--ktv-fast) var(--ktv-ease),
                background-color var(--ktv-fast) var(--ktv-ease), color var(--ktv-fast) var(--ktv-ease);
}
.tv-viewport-frame.show-hud .tv-floating-fs-btn,
.tv-floating-fs-btn:hover,
.tv-floating-fs-btn:active,
.tv-floating-fs-btn:focus-visible {
    opacity: 1;
    pointer-events: auto !important;
    transform: translateY(0);
}
.tv-floating-fs-btn:hover,
.tv-floating-fs-btn:active {
    background: #fff;
    color: #2a1f1d;
}

/* Overlays layer */
.tv-overlay-layer {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    overflow: hidden;
}

.tv-admin-viewer-badge {
    position: absolute;
    top: 14px;
    right: 62px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ktv-veil);
    padding: 5px 11px;
    border-radius: 999px;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    z-index: 25;
    pointer-events: auto;
}
.tv-admin-viewer-badge i {
    color: #ff7a70;
}

/* Legacy LIVE badge */
.tv-live-indicator {
    position: absolute;
    top: 14px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ktv-veil);
    padding: 5px 12px;
    border-radius: 999px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    z-index: 25;
}
/* Nothing idles for attention: the live dot is lit, not pulsing */
.tv-live-dot {
    display: inline-block;
    flex: none;
    width: 8px;
    height: 8px;
    background-color: var(--ktv-red);
    border-radius: 50%;
}
.tv-viewer-mini {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    padding-left: 8px;
    margin-left: 2px;
}

/* Channel watermark */
.tv-corner-logo {
    position: absolute;
    height: var(--tv-logo-h-desk, 42px);
    width: auto;
    max-height: 250px;
    max-width: 350px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
    transition: opacity 0.3s ease;
    z-index: 28;
    pointer-events: none;
    user-select: none;
}
.tv-corner-logo.pos-top-left,
.tv-corner-logo.pos-top_left     { top: 18px; left: 20px; }
.tv-corner-logo.pos-top-right,
.tv-corner-logo.pos-top_right    { top: 18px; right: 20px; }
.tv-corner-logo.pos-bottom-left,
.tv-corner-logo.pos-bottom_left  { bottom: 40px; left: 20px; }
.tv-corner-logo.pos-bottom-right,
.tv-corner-logo.pos-bottom_right { bottom: 40px; right: 20px; }

/* Transition curtain (blocks YouTube end-screens between programmes) */
.tv-channel-curtain {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 22;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.tv-channel-curtain.is-active {
    opacity: 1;
    pointer-events: auto;
}
.tv-curtain-spinner {
    color: rgba(255, 255, 255, 0.85);
    font-size: 2rem;
}

/* Unmute chip — a soft pill laid on the picture */
.tv-unmute-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    z-index: 35;
    pointer-events: none;
    animation: tv-fade-in var(--ktv-fast) var(--ktv-ease);
}
.tv-unmute-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 253, 252, 0.95);
    color: #2a1f1d;
    border: 0;
    padding: 6px 20px 6px 6px;
    border-radius: 999px;
    font-family: var(--ktv-text);
    font-weight: 700;
    font-size: 0.9375rem;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 16px 36px -14px rgba(0, 0, 0, 0.65), 0 2px 6px -2px rgba(0, 0, 0, 0.3);
    transition: background-color var(--ktv-fast) var(--ktv-ease), color var(--ktv-fast) var(--ktv-ease);
    animation: tv-nudge 0.9s var(--ktv-ease) 0.4s 2;
}
.tv-unmute-btn:hover {
    background: #2a1f1d;
    color: #fff;
}
.tv-unmute-waves {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2a1f1d;
    color: #fff;
    font-size: 0.95rem;
}
.tv-unmute-btn:hover .tv-unmute-waves {
    background: #fff;
    color: #2a1f1d;
}
@keyframes tv-nudge {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-4px); }
}

/* Both cues call the same unmutePlayer(), which starts the picture with sound; when
   autoplay was blocked the play cue is the one action, so the unmute chip steps aside */
.tv-overlay-layer:has(> .tv-tap-to-play-cue:not([style*='none'])) > .tv-unmute-overlay {
    display: none !important;
}

/* Tap-to-play fallback */
.tv-tap-to-play-cue {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    z-index: 34;
    pointer-events: none;
    animation: tv-fade-in var(--ktv-fast) var(--ktv-ease);
}
.tv-play-cue-btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 253, 252, 0.96);
    color: #2a1f1d;
    border: none;
    border-radius: 999px;
    padding: 7px 24px 7px 7px;
    font-family: var(--ktv-text);
    font-size: 1.0625rem;
    font-weight: 700;
    box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.7);
    cursor: pointer;
    pointer-events: auto;
    transition: background-color var(--ktv-fast) var(--ktv-ease), color var(--ktv-fast) var(--ktv-ease);
}
.tv-play-cue-btn i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: #b40000;
    color: #fff;
    border-radius: 50%;
    font-size: 1.0625rem;
}
.tv-play-cue-btn:hover {
    background: #2a1f1d;
    color: #fff;
}

/* Gesture feedback */
.tv-gesture-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 40;
}
.tv-gesture-indicator {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--ktv-veil);
    color: #fff;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity var(--ktv-fast) var(--ktv-ease), transform var(--ktv-fast) var(--ktv-ease);
}
.tv-gesture-indicator.is-active {
    opacity: 1;
    transform: scale(1);
}
.tv-gesture-indicator i {
    font-size: 1.5rem;
    color: #fff;
}
.tv-gesture-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
}

/* Floating HUD (auto-hides) */
.tv-mobile-hud {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 32;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity var(--ktv-fast) var(--ktv-ease), transform var(--ktv-fast) var(--ktv-ease);
}
.tv-viewport-frame.show-hud .tv-mobile-hud,
.tv-mobile-hud:hover {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.tv-hud-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.tv-hud-btn {
    min-width: 40px;
    min-height: 40px;
    background: var(--ktv-veil);
    border: 0;
    color: #fff;
    padding: 0 13px;
    border-radius: 999px;
    font-family: var(--ktv-text);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color var(--ktv-fast) var(--ktv-ease), color var(--ktv-fast) var(--ktv-ease);
}
.tv-hud-btn:hover {
    background: #fff;
    color: #2a1f1d;
}
.tv-hud-btn-live .tv-live-dot {
    width: 7px;
    height: 7px;
}

/* On-screen toast */
.tv-player-toast {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--ktv-veil);
    color: #fff;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    z-index: 45;
    transition: opacity var(--ktv-fast) var(--ktv-ease), transform var(--ktv-fast) var(--ktv-ease);
}
.tv-player-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Native + pseudo fullscreen */
.tv-viewport-frame:fullscreen,
.tv-viewport-frame:-webkit-full-screen,
.tv-viewport-frame.is-pseudo-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    aspect-ratio: auto !important;
    z-index: 999999 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #000 !important;
    margin: 0 !important;
}
.tv-viewport-frame:fullscreen .tv-player-host,
.tv-viewport-frame:-webkit-full-screen .tv-player-host,
.tv-viewport-frame.is-pseudo-fullscreen .tv-player-host {
    width: 100% !important;
    height: 100% !important;
}
.tv-viewport-frame:fullscreen .tv-player-host iframe,
.tv-viewport-frame:-webkit-full-screen .tv-player-host iframe,
.tv-viewport-frame.is-pseudo-fullscreen .tv-player-host iframe {
    pointer-events: none !important;
}

/* Spacer while the player floats as a mini-player */
.tv-viewport-placeholder {
    display: none;
    width: 100%;
    aspect-ratio: 16 / 9;
    pointer-events: none;
}
.tv-viewport-frame.is-sticky-mini + .tv-viewport-placeholder {
    display: block !important;
}

/* Mini-player controls */
.tv-pip-controls {
    position: absolute;
    top: 6px;
    right: 6px;
    display: none;
    gap: 6px;
    z-index: 60;
    pointer-events: auto;
}
.tv-viewport-frame.is-sticky-mini .tv-pip-controls {
    display: flex !important;
}
.tv-pip-btn {
    background: var(--ktv-veil);
    border: 0;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color var(--ktv-fast) var(--ktv-ease), color var(--ktv-fast) var(--ktv-ease);
}
.tv-pip-btn:hover {
    background: #fff;
    color: #2a1f1d;
}
.tv-pip-btn-close:hover {
    background: #b40000;
    color: #fff;
}

/* "Next up" lower third — a soft pill with a dark label */
.tv-snype-box {
    position: absolute;
    bottom: 22px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: min(460px, calc(100% - 40px));
    padding: 5px 14px 5px 5px;
    background: rgba(255, 253, 252, 0.94);
    color: #2a1f1d;
    border-radius: 999px;
    box-shadow: 0 12px 28px -14px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
    z-index: 30;
    overflow: hidden;
}
.tv-snype-label {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #2a1f1d;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}
.tv-snype-title {
    min-width: 0;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tv-snype-time {
    flex: none;
    font-size: 0.8125rem;
    color: #5b4a46;
    font-variant-numeric: tabular-nums;
}

/* Dual-ad engine: bottom overlay ad */
.tv-ad-overlay-container {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 728px;
    width: 90%;
    height: 90px;
    z-index: 45;
    pointer-events: auto;
    border-radius: var(--ktv-r-sm);
    overflow: hidden;
    background: #000;
    box-shadow: 0 16px 36px -14px rgba(0, 0, 0, 0.8);
}
.tv-ad-close-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--ktv-veil);
    color: #fff;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    cursor: pointer;
    z-index: 10;
}
.tv-ad-badge {
    position: absolute;
    top: 6px;
    left: 8px;
    background: rgba(255, 253, 252, 0.95);
    color: #2a1f1d;
    font-size: 0.6875rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.tv-ad-overlay-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fullscreen ad takeover */
.tv-ad-takeover-screen {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 50;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}
.tv-ad-takeover-header {
    position: absolute;
    top: 18px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}
.tv-ad-takeover-badge {
    background: #b40000;
    color: #fff;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tv-ad-countdown {
    background: var(--ktv-veil);
    color: #fff;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.tv-takeover-skip-btn {
    border-radius: 999px !important;
}
.tv-ad-video-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.tv-ad-counter-badge {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
    margin-left: 8px;
}
.tv-ad-progress-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 10;
}
.tv-ad-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: #b40000;
    transition: width 0.3s linear;
}
.tv-ad-cta-container {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 15;
}
.tv-ad-cta-btn {
    display: inline-flex;
    align-items: center;
    background: #b40000;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.7);
    transition: background-color var(--ktv-fast) var(--ktv-ease);
}
.tv-ad-cta-btn:hover {
    background: #7a0000;
}
.tv-ad-coming-notice {
    position: absolute;
    bottom: 24px;
    left: 24px;
    background: var(--ktv-veil);
    color: #fff;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    animation: tv-fade-in var(--ktv-slow) var(--ktv-ease);
}
.tv-ad-coming-notice i {
    color: #ff7a70;
}

/* ==========================================================================
   4. Day ribbon — today's lineup as soft rounded segments, one red "now"
   ========================================================================== */
.tv-day-ribbon {
    margin-top: 18px;
}
.tv-ribbon-track {
    display: flex;
    gap: 3px;
    height: 6px;
}
.tv-ribbon-cell {
    position: relative;
    flex-basis: 0;
    min-width: 4px;
    border-radius: 999px;
    background: var(--ktv-film);
}
.tv-ribbon-cell.kind-music {
    background: var(--ktv-music);
}
.tv-ribbon-cell.kind-special {
    background: var(--ktv-ink-3);
}
.tv-ribbon-cell.is-past {
    background: var(--ktv-aired);
}
.tv-ribbon-cell.is-live {
    z-index: 1;
}
.tv-ribbon-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0;
    border-radius: 999px;
    background: var(--ktv-red);
}
.tv-ribbon-cell.is-live .tv-ribbon-fill::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border-radius: 50%;
    background: var(--ktv-red);
    box-shadow: 0 0 0 3px var(--ktv-page);
}
.tv-ribbon-axis {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 9px;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--ktv-ink-3);
}
.tv-ribbon-key {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}
.tv-ribbon-key span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tv-ribbon-swatch {
    display: inline-block;
    width: 14px;
    height: 6px;
    border-radius: 999px;
    background: var(--ktv-film);
}
.tv-ribbon-swatch.kind-music {
    background: var(--ktv-music);
}
.tv-ribbon-swatch.kind-now {
    background: var(--ktv-red);
}

/* The plain progress strip stays in the DOM for the engine; the ribbon replaces it */
.tv-live-progress-container {
    width: 100%;
    height: 4px;
    background: var(--ktv-line);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 14px;
}
.tv-live-progress-bar {
    height: 100%;
    background: var(--ktv-red);
}
.tv-day-ribbon + .tv-live-progress-container {
    display: none;
}

/* ==========================================================================
   5. Ticker — a soft pill
   ========================================================================== */
.tv-ticker-bar {
    position: relative;
    width: 100%;
    height: 42px;
    padding: 5px;
    background: var(--ktv-panel);
    border-radius: 999px;
    box-shadow: var(--ktv-shadow);
    display: flex;
    align-items: center;
    overflow: hidden;
    margin-top: 16px;
}
.tv-ticker-label {
    flex-shrink: 0;
    background: var(--ktv-red);
    color: #fff;
    font-size: 0.875rem;
    padding: 0 13px;
    height: 100%;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.tv-ticker-content {
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    margin-left: 12px;
}
.tv-ticker-track {
    display: inline-block;
    padding-left: 100%;
    animation: tv-marquee 25s linear infinite;
    font-size: 0.9375rem;
    color: var(--ktv-ink-2);
    will-change: transform;
}
.tv-ticker-track:hover {
    animation-play-state: paused;
}
.tv-ticker-track.speed-slow,
.tv-ticker-track.tv-speed-slow   { animation-duration: 38s; }
.tv-ticker-track.speed-normal,
.tv-ticker-track.tv-speed-normal { animation-duration: 25s; }
.tv-ticker-track.speed-fast,
.tv-ticker-track.tv-speed-fast   { animation-duration: 15s; }

@keyframes tv-marquee {
    0%   { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* ==========================================================================
   6. Now on air — the lead panel
   ========================================================================== */
.tv-now-card {
    margin-top: 18px;
    padding: 22px 24px;
    background: var(--ktv-panel);
    border-radius: var(--ktv-r);
    box-shadow: var(--ktv-shadow);
}
.tv-now-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 28px;
    flex-wrap: wrap;
}
.tv-now-title-group {
    flex: 1 1 320px;
    min-width: 0;
}
.tv-program-title {
    margin: 0;
    font-family: var(--ktv-display);
    font-weight: var(--ktv-display-weight);
    font-synthesis: none;
    font-size: clamp(1.625rem, 2.4vw, 2.125rem);
    line-height: 1.15;
    letter-spacing: 0.01em;
    color: var(--ktv-ink);
    text-wrap: balance;
}
.tv-program-type-badge {
    margin-top: 10px;
}

/* Labels: soft pills; live is a red pill with a lit dot */
.tv-program-type-badge,
.tv-sidebar-item-badge,
.tv-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    padding: 4px 10px;
    border: 0;
    border-radius: 999px;
    background: var(--ktv-soft);
    box-shadow: inset 0 0 0 1px var(--ktv-line);
    color: var(--ktv-ink-2);
    font-family: var(--ktv-text);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
}
.tv-badge-live {
    background: var(--ktv-red);
    box-shadow: none;
    color: #fff;
}
.tv-badge-live::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
}

.tv-timing-box {
    flex-shrink: 0;
    text-align: right;
}
.tv-time-range {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: var(--ktv-ink);
}
.tv-time-range .divider {
    color: var(--ktv-ink-3);
    font-weight: 400;
}
.tv-remaining-text {
    margin-top: 6px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--ktv-red-ink);
}

.tv-now-meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    row-gap: 4px;
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--ktv-line);
    font-size: 0.875rem;
    color: var(--ktv-ink-2);
}
.tv-now-meta .meta-item {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
}
.tv-now-meta .meta-item:not(:last-child)::after {
    content: '·';
    margin: 0 12px;
    color: var(--ktv-ink-3);
}
.tv-now-meta .meta-item > i {
    display: none;
}
.tv-now-meta .meta-item strong {
    font-weight: 400;
    color: var(--ktv-ink-3);
}
.tv-now-meta .meta-item.tv-now-track-item > i {
    display: inline-block;
    color: var(--ktv-red-ink);
}
.tv-now-meta .meta-item.tv-now-track-item {
    color: var(--ktv-ink);
    font-weight: 700;
}

.tv-now-desc {
    max-width: 68ch;
    margin-top: 12px;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--ktv-ink-2);
}

/* ==========================================================================
   7. Admin quick bar (admin only)
   ========================================================================== */
.tv-admin-control-bar {
    background: var(--ktv-panel);
    border-radius: var(--ktv-r-sm);
    box-shadow: var(--ktv-shadow);
    padding: 10px 14px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--ktv-ink);
}
.tv-admin-bar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.tv-admin-viewer-pill {
    background: var(--ktv-red-tint);
    color: var(--ktv-red-ink);
    font-size: 0.8125rem;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}
.tv-admin-ticker-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--ktv-ink-2);
}
.tv-admin-ticker-toggle .form-check-input:checked {
    background-color: var(--ktv-red);
    border-color: var(--ktv-red);
}
.tv-admin-control-bar .btn {
    border-radius: 999px;
}
#tvBtnAdminLaunchAd {
    background: var(--ktv-ink);
    border-color: var(--ktv-ink);
    color: var(--ktv-page) !important;
}
.tv-admin-inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
    flex-wrap: wrap;
}
.tv-admin-inline-input,
.tv-admin-select {
    background: var(--ktv-soft);
    border: 1px solid var(--ktv-line);
    color: var(--ktv-ink);
    padding: 6px 12px;
    min-height: 34px;
    border-radius: var(--ktv-r-xs);
    font-size: 0.875rem;
}
.tv-admin-inline-input {
    flex-grow: 1;
    min-width: 200px;
}
.tv-admin-select {
    width: auto;
}
.tv-admin-inline-input:focus,
.tv-admin-select:focus {
    outline: none;
    border-color: var(--ktv-red);
    box-shadow: 0 0 0 3px rgba(180, 0, 0, 0.18);
}
.tv-admin-btn {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    background: var(--ktv-ink);
    color: var(--ktv-page);
    border: 0;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color var(--ktv-fast) var(--ktv-ease), color var(--ktv-fast) var(--ktv-ease);
}
.tv-admin-btn:hover {
    background: var(--ktv-red);
    color: #fff;
}
.tv-admin-btn-ghost {
    background: var(--ktv-soft);
    color: var(--ktv-ink);
    box-shadow: inset 0 0 0 1px var(--ktv-line);
}

/* ==========================================================================
   8. Today column
   ========================================================================== */
/* The today panel takes the player column's height and scrolls inside it,
   so both stage columns end on the same line */
.tv-stage-sidebar {
    min-width: 0;
    align-self: stretch;
    position: relative;
    min-height: 520px;
}
.tv-sidebar-panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 18px 12px 12px;
    background: var(--ktv-panel);
    border-radius: var(--ktv-r);
    box-shadow: var(--ktv-shadow);
}
.tv-sidebar-header {
    flex-shrink: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 0 8px 12px;
}
.tv-sidebar-title {
    margin: 0;
    font-family: var(--ktv-display);
    font-weight: var(--ktv-display-weight);
    font-synthesis: none;
    font-size: 1.3125rem;
    letter-spacing: 0.01em;
    color: var(--ktv-ink);
}
.tv-sidebar-title-mobile {
    display: none;
}
.tv-sidebar-time-badge {
    font-size: 0.875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ktv-ink-3);
}
.tv-sidebar-time-badge i {
    display: none;
}

.tv-sidebar-list {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.tv-sidebar-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 8px;
    border-radius: var(--ktv-r-sm);
    color: inherit;
    text-decoration: none;
    transition: background-color var(--ktv-fast) var(--ktv-ease);
}
.tv-sidebar-item:hover {
    background: var(--ktv-soft);
}
.tv-sidebar-item.is-live {
    background: var(--ktv-red-tint);
}
/* The empty line is phone-only; tomorrow's opening programmes follow today's */
.tv-rail-empty {
    display: none;
}

.tv-sidebar-thumb {
    flex-shrink: 0;
    width: 88px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--ktv-r-xs);
    background: var(--ktv-soft);
    position: relative;
}
/* Images are pinned inside their fixed-ratio boxes, so a 4:3 source can
   never push a box taller through its natural height */
.tv-sidebar-thumb img,
.tv-card-thumb img,
.tv-announce-thumb img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tv-sidebar-item-info {
    flex-grow: 1;
    min-width: 0;
}
/* Time on the left, length on the right */
.tv-sidebar-item-top {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 2px;
    font-variant-numeric: tabular-nums;
}
.tv-sidebar-item-day {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ktv-ink-3);
}
.tv-sidebar-item-time {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--ktv-ink);
}
.tv-leader {
    flex: 1 1 auto;
    min-width: 12px;
}
.tv-sidebar-item-dur {
    flex: none;
    font-size: 0.8125rem;
    color: var(--ktv-ink-3);
}
.tv-sidebar-item.is-live .tv-sidebar-item-time {
    color: var(--ktv-red-ink);
}
.tv-sidebar-item-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ktv-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The label follows the title, never stands above it */
.tv-sidebar-item-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-top: 5px;
    font-size: 0.8125rem;
    color: var(--ktv-ink-3);
}
.tv-sidebar-item-sub:empty {
    display: none;
}
.tv-sidebar-item-badge {
    flex: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tv-sidebar-item-dir {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tv-sidebar-item.is-live .tv-sidebar-item-dir {
    color: var(--ktv-ink-2);
}
/* A music pause is titled by its own category: the label would only repeat it */
.tv-sidebar-item[data-badge-repeats] .tv-sidebar-item-badge:not(.tv-badge-live) {
    display: none;
}

/* Already aired: quieter text, photo in black and white */
.tv-sidebar-item.is-past .tv-sidebar-item-time,
.tv-sidebar-item.is-past .tv-sidebar-item-title {
    color: var(--ktv-ink-3);
}
.tv-sidebar-item.is-past .tv-sidebar-thumb img,
.tv-epg-card.is-past .tv-card-thumb img {
    filter: grayscale(1);
    opacity: 0.7;
}

.tv-sidebar-footer {
    flex-shrink: 0;
    margin: 10px 8px 0;
    padding-top: 10px;
    border-top: 1px solid var(--ktv-line);
}
.tv-sidebar-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    color: var(--ktv-ink-2);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    transition: color var(--ktv-fast) var(--ktv-ease);
}
.tv-sidebar-more-btn:hover {
    color: var(--ktv-ink);
}
.tv-sidebar-more-btn i {
    font-size: 0.75rem;
}

/* ==========================================================================
   9. Announcements — lifted cards
   ========================================================================== */
.tv-announce-strip {
    margin-top: 44px;
    background: transparent;
    border: 0;
}
.tv-announce-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-bottom: 16px;
}
.tv-announce-title {
    margin: 0;
    font-family: var(--ktv-display);
    font-weight: var(--ktv-display-weight);
    font-synthesis: none;
    font-size: 1.5rem;
    letter-spacing: 0.01em;
    color: var(--ktv-ink);
}
.tv-announce-title i,
.tv-epg-title i {
    display: none;
}
.tv-announce-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 16px;
    background: var(--ktv-panel);
    border-radius: 999px;
    box-shadow: var(--ktv-shadow);
    color: var(--ktv-ink-2);
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none;
    transition: box-shadow var(--ktv-fast) var(--ktv-ease), color var(--ktv-fast) var(--ktv-ease), transform var(--ktv-fast) var(--ktv-ease);
}
.tv-announce-all:hover,
.tv-announce-all:focus-visible {
    color: var(--ktv-ink);
    box-shadow: var(--ktv-shadow-lift);
    transform: translateY(-1px);
}
.tv-announce-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.tv-announce-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 8px 8px 12px;
    background: var(--ktv-panel);
    border-radius: 16px;
    box-shadow: var(--ktv-shadow);
    color: var(--ktv-ink);
    text-decoration: none;
    transition: box-shadow var(--ktv-slow) var(--ktv-ease), transform var(--ktv-slow) var(--ktv-ease);
}
.tv-announce-card:hover,
.tv-announce-card:focus-visible {
    color: var(--ktv-ink);
    box-shadow: var(--ktv-shadow-lift);
    transform: translateY(-2px);
}
.tv-announce-thumb {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 10px;
    background: var(--ktv-soft);
    color: var(--ktv-ink-3);
    font-size: 1.5rem;
}

.tv-announce-live {
    position: absolute;
    left: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--ktv-red);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.tv-announce-live .tv-live-dot {
    width: 5px;
    height: 5px;
    background-color: #fff;
}
.tv-announce-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 4px;
}
.tv-announce-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ktv-red-ink);
}
.tv-announce-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ktv-ink);
}
.tv-announce-empty {
    margin: 0;
    padding: 18px 20px;
    background: var(--ktv-panel);
    border-radius: var(--ktv-r);
    box-shadow: var(--ktv-shadow);
    font-size: 0.9375rem;
    color: var(--ktv-ink-3);
}
@media (max-width: 1100px) and (min-width: 769px) {
    .tv-announce-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==========================================================================
   10. The 7-day guide — one panel, segmented day selector
   ========================================================================== */
.tv-epg-wrapper {
    margin: 44px 0 72px;
    padding: 20px 16px 12px;
    background: var(--ktv-panel);
    border-radius: var(--ktv-r);
    box-shadow: var(--ktv-shadow);
}
.tv-epg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding: 0 8px 14px;
}
.tv-epg-title {
    margin: 0;
    font-family: var(--ktv-display);
    font-weight: var(--ktv-display-weight);
    font-synthesis: none;
    font-size: 1.5rem;
    letter-spacing: 0.01em;
    color: var(--ktv-ink);
}

/* Segmented control: a soft track, the chosen day a lifted chip */
.tv-day-selector {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: var(--ktv-soft);
    box-shadow: inset 0 0 0 1px var(--ktv-line);
    overflow-x: auto;
    scrollbar-width: none;
    max-width: 100%;
}
.tv-day-selector::-webkit-scrollbar {
    display: none;
}
.tv-day-pill {
    flex: none;
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    min-height: 36px;
    padding: 0 14px;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--ktv-ink-3);
    font-family: var(--ktv-text);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 36px;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--ktv-fast) var(--ktv-ease), background-color var(--ktv-fast) var(--ktv-ease), box-shadow var(--ktv-fast) var(--ktv-ease);
}
.tv-day-pill .tv-day-num {
    font-variant-numeric: tabular-nums;
}
.tv-day-pill:hover {
    color: var(--ktv-ink);
}
.tv-day-pill.active {
    background: var(--ktv-panel);
    color: var(--ktv-ink);
    box-shadow: var(--ktv-shadow);
}

.tv-timeline-grid {
    display: flex;
    flex-direction: column;
    transition: opacity var(--ktv-fast) var(--ktv-ease);
}
.tv-timeline-grid > .text-center {
    color: var(--ktv-ink-3) !important;
}

.tv-epg-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px;
    border-radius: var(--ktv-r-sm);
    background: transparent;
    transition: background-color var(--ktv-fast) var(--ktv-ease);
}
/* Rows are separated by an inset hairline, dropped around the tinted rows */
.tv-epg-card + .tv-epg-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 12px;
    right: 12px;
    height: 1px;
    background: var(--ktv-line);
}
.tv-epg-card:hover {
    background: var(--ktv-soft);
}
.tv-epg-card:hover::before,
.tv-epg-card:hover + .tv-epg-card::before,
.tv-epg-card.is-live-card::before,
.tv-epg-card.is-live-card + .tv-epg-card::before {
    opacity: 0;
}
.tv-epg-card.is-live-card {
    background: var(--ktv-red-tint);
}
.tv-epg-card.is-special-live .tv-card-title::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 8px;
    border-radius: 50%;
    background: var(--ktv-red);
    vertical-align: 0.1em;
}

.tv-card-time {
    flex-shrink: 0;
    width: 64px;
    font-variant-numeric: tabular-nums;
}
.tv-card-time .start {
    font-size: 1.1875rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--ktv-ink);
}
.tv-card-time .end {
    margin-top: 3px;
    font-size: 0.8125rem;
    color: var(--ktv-ink-3);
}
.tv-epg-card.is-live-card .tv-card-time .start {
    color: var(--ktv-red-ink);
}

.tv-card-thumb {
    position: relative;
    flex-shrink: 0;
    width: 96px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--ktv-r-xs);
    background: var(--ktv-soft);
}


/* Title and label, then director, year, genre, length as one aligned column */
.tv-card-details {
    flex-grow: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
    align-items: center;
    column-gap: 32px;
}
.tv-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.tv-card-title {
    order: -1;
    margin: 0;
    min-width: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ktv-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tv-epg-card.has-repeat-badge .tv-card-badge:not(.tv-badge-live) {
    display: none;
}
/* One line: a long director name gives way with an ellipsis; each separator
   belongs to the item after it, so no line can end on a dot */
.tv-card-meta {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    flex-wrap: nowrap;
    min-width: 0;
    white-space: nowrap;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
    color: var(--ktv-ink-3);
}
.tv-card-meta span {
    flex: none;
}
.tv-card-meta span:first-child {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tv-epg-card.is-live-card .tv-card-meta {
    color: var(--ktv-ink-2);
}
.tv-card-meta span i {
    display: none;
}
.tv-card-meta span + span::before {
    content: '·';
    margin: 0 9px;
}

.tv-epg-card.is-past .tv-card-time .start,
.tv-epg-card.is-past .tv-card-title {
    color: var(--ktv-ink-3);
}

.tv-card-progress-bar {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 440px;
    height: 4px;
    border-radius: 999px;
    background: rgba(180, 0, 0, 0.14);
    margin-top: 10px;
    overflow: hidden;
}
.tv-card-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--ktv-red);
}

.tv-card-actions {
    flex-shrink: 0;
}
.tv-btn-remind {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    background: var(--ktv-soft);
    border: 0;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px var(--ktv-line);
    color: var(--ktv-ink-2);
    font-family: var(--ktv-text);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color var(--ktv-fast) var(--ktv-ease), color var(--ktv-fast) var(--ktv-ease), box-shadow var(--ktv-fast) var(--ktv-ease);
}
.tv-btn-remind:hover {
    background: var(--ktv-panel);
    color: var(--ktv-ink);
    box-shadow: var(--ktv-shadow);
}

/* ==========================================================================
   10a. Single-column stage (tablets and phones) — placed after the base rules
   so these overrides win on equal specificity
   ========================================================================== */
@media (max-width: 992px) {
    .tv-stage-sidebar {
        min-height: 0;
    }
    .tv-sidebar-panel {
        position: static;
        max-height: 780px;
    }
    /* Narrow measures wrap the meta lines: spacing instead of dots, so no
       separator is ever left hanging, and the director is never cut */
    .tv-now-meta,
    .tv-card-meta {
        column-gap: 14px;
    }
    .tv-card-meta {
        flex-wrap: wrap;
        white-space: normal;
        row-gap: 2px;
    }
    .tv-card-meta span,
    .tv-card-meta span:first-child {
        flex: none;
        overflow: visible;
        text-overflow: clip;
    }
    .tv-now-meta .meta-item:not(:last-child)::after,
    .tv-card-meta span + span::before {
        content: none;
    }
}

/* ==========================================================================
   11. Phones — composed on their own, not squeezed
   ========================================================================== */
@media (max-width: 768px) {
    .tv-stage-container {
        padding: 0 14px;
    }

    /* Slim dateline: short date, lamp as a round icon button */
    .tv-masthead {
        padding: 12px 0;
    }
    .tv-date-full,
    .tv-dateline-channel {
        display: none;
    }
    .tv-date-short {
        display: inline;
    }
    .tv-dateline time {
        font-size: 0.9375rem;
    }
    .tv-lights-btn {
        width: 44px;
        min-height: 44px;
        padding: 0;
        justify-content: center;
    }
    .tv-lights-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .tv-viewport-frame {
        border-radius: 14px;
    }
    .tv-corner-logo {
        height: var(--tv-logo-h-mob, 32px) !important;
    }
    .tv-snype-box {
        left: 10px;
        bottom: 10px;
        max-width: calc(100% - 20px);
    }
    .tv-admin-viewer-badge {
        top: 10px;
        right: 58px;
    }

    .tv-day-ribbon {
        margin-top: 16px;
    }
    .tv-ribbon-key {
        display: none;
    }

    .tv-ticker-bar {
        margin-top: 14px;
    }

    .tv-now-card {
        margin-top: 14px;
        padding: 18px;
    }
    .tv-now-header {
        flex-direction: column;
        gap: 10px;
    }
    .tv-now-title-group {
        flex: none;
        width: 100%;
    }
    .tv-program-title {
        font-size: 1.5rem;
    }
    .tv-timing-box {
        display: flex;
        align-items: baseline;
        flex-wrap: wrap;
        gap: 4px 12px;
        text-align: left;
    }
    .tv-time-range {
        justify-content: flex-start;
        font-size: 1.1875rem;
    }
    .tv-remaining-text {
        margin-top: 0;
    }
    .tv-now-desc {
        font-size: 0.9375rem;
    }

    /* Mini-player keeps its behaviour, lifted like the rest */
    .tv-viewport-frame.is-sticky-mini {
        position: fixed !important;
        bottom: 20px !important;
        right: 16px !important;
        width: 240px !important;
        max-width: calc(100vw - 32px) !important;
        height: auto !important;
        margin: 0 !important;
        aspect-ratio: 16 / 9 !important;
        z-index: 9999 !important;
        border-radius: 14px !important;
        box-shadow: 0 22px 44px -14px rgba(0, 0, 0, 0.55), 0 4px 10px -4px rgba(0, 0, 0, 0.3) !important;
        animation: tv-pop-in 0.32s var(--ktv-ease);
        transition: transform 0.25s ease, opacity 0.25s ease;
        touch-action: pan-y;
    }
    .tv-viewport-frame.is-sticky-mini.is-dismissing {
        transform: translateX(120%) scale(0.8) !important;
        opacity: 0 !important;
    }
    /* In the site's phone chrome (m-view) the tab bar owns the bottom edge */
    body.m-view .tv-viewport-frame.is-sticky-mini {
        bottom: calc(var(--m-bottomnav-h, 60px) + env(safe-area-inset-bottom, 0px) + 12px) !important;
    }
    .tv-viewport-frame.is-sticky-mini .tv-corner-logo,
    .tv-viewport-frame.is-sticky-mini .tv-ticker-bar,
    .tv-viewport-frame.is-sticky-mini .tv-snype-box,
    .tv-viewport-frame.is-sticky-mini .tv-mobile-hud,
    .tv-viewport-frame.is-sticky-mini .tv-live-progress-container {
        display: none !important;
    }
    .tv-viewport-frame.is-sticky-mini .tv-live-indicator,
    .tv-viewport-frame.is-sticky-mini .tv-admin-viewer-badge {
        top: 6px !important;
        right: auto !important;
        left: 6px !important;
        padding: 2px 7px !important;
        font-size: 0.6875rem !important;
        gap: 4px !important;
    }
    .tv-viewport-frame.is-sticky-mini .tv-unmute-btn {
        padding: 4px 10px 4px 4px !important;
        font-size: 0.75rem !important;
    }
    .tv-viewport-frame.is-sticky-mini .tv-unmute-waves {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.75rem !important;
    }

    /* Today column → "up next" rail: aired and live drop out, tomorrow continues */
    .tv-sidebar-panel {
        position: static;
        max-height: none;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }
    .tv-sidebar-header {
        padding: 0 2px 10px;
    }
    .tv-sidebar-title-desk {
        display: none;
    }
    .tv-sidebar-title-mobile {
        display: inline;
    }
    .tv-sidebar-list {
        flex-direction: row;
        align-items: stretch;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        margin: 0 -14px;
        padding: 4px 14px 14px;
        scroll-padding-inline: 14px;
        scrollbar-width: none;
    }
    .tv-sidebar-list::-webkit-scrollbar {
        display: none;
    }
    .tv-sidebar-item {
        flex: 0 0 62%;
        min-width: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 9px;
        padding: 7px 7px 12px;
        background: var(--ktv-panel);
        border-radius: 16px;
        box-shadow: var(--ktv-shadow);
        scroll-snap-align: start;
    }
    .tv-sidebar-item:hover {
        background: var(--ktv-panel);
    }
    .tv-sidebar-item.is-past,
    .tv-sidebar-item.is-live {
        display: none;
    }
    .tv-sidebar-thumb {
        width: 100%;
        border-radius: 10px;
    }
    /* Every rail card has the same layout, so all come out the same height and
       none sits above empty ground: fixed-ratio image, time row, a title that
       always reserves two lines, one label line pinned to the bottom */
    .tv-sidebar-item-info {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        padding: 0 4px;
    }
    .tv-sidebar-item-title {
        min-height: 2.7em;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    .tv-sidebar-item-sub {
        margin-top: auto;
        padding-top: 6px;
        min-height: 30px;
        flex-wrap: nowrap;
        overflow: hidden;
    }
    .tv-sidebar-list:not(:has(.tv-sidebar-item:not(.is-past):not(.is-live))) .tv-rail-empty {
        display: block;
        margin: 0;
        padding: 14px 16px;
        background: var(--ktv-panel);
        border-radius: 16px;
        box-shadow: var(--ktv-shadow);
        font-size: 0.9375rem;
        color: var(--ktv-ink-3);
    }
    .tv-sidebar-footer {
        margin: 0 2px;
        padding-top: 0;
        border-top: 0;
    }

    /* Announcements rail */
    .tv-announce-strip {
        margin-top: 32px;
    }
    .tv-announce-header {
        margin-bottom: 12px;
    }
    .tv-announce-title,
    .tv-epg-title {
        font-size: 1.1875rem;
    }
    .tv-announce-list {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        margin: 0 -14px;
        padding: 4px 14px 14px;
        scroll-padding-inline: 14px;
        scrollbar-width: none;
    }
    .tv-announce-list::-webkit-scrollbar {
        display: none;
    }
    .tv-announce-card {
        flex: 0 0 66%;
        scroll-snap-align: start;
    }

    /* Guide: time | title + label + meta | bell */
    .tv-epg-wrapper {
        margin: 28px 0 48px;
        padding: 16px 8px 8px;
    }
    .tv-epg-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 0 6px 12px;
    }
    .tv-epg-card {
        align-items: flex-start;
        gap: 12px;
        padding: 12px 10px;
    }
    .tv-epg-card + .tv-epg-card::before {
        left: 10px;
        right: 10px;
    }
    .tv-card-thumb {
        display: none;
    }
    .tv-card-time {
        width: 48px;
    }
    .tv-card-time .start {
        font-size: 1.0625rem;
    }
    .tv-card-details {
        display: block;
    }
    .tv-card-header {
        flex-wrap: wrap;
        gap: 6px 8px;
        margin-bottom: 6px;
    }
    .tv-card-title {
        flex: 1 0 100%;
        white-space: normal;
    }
    .tv-card-meta {
        max-width: none;
    }
    .tv-card-actions {
        align-self: center;
    }
    .tv-btn-remind {
        width: 44px;
        min-height: 44px;
        padding: 0;
        justify-content: center;
        gap: 0;
        font-size: 0;
    }
    .tv-btn-remind i {
        font-size: 1rem;
    }
}

@keyframes tv-pop-in {
    from { transform: scale(0.7) translateY(30px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes tv-slide-up {
    from { transform: translate(-50%, 20px); opacity: 0; }
    to   { transform: translate(-50%, 0); opacity: 1; }
}
@keyframes tv-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    body.ktv-page *,
    body.ktv-page *::before,
    body.ktv-page *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .tv-ticker-track {
        animation: none !important;
        padding-left: 0;
        white-space: normal;
    }
    .tv-announce-card:hover,
    .tv-lights-btn:hover,
    .tv-announce-all:hover {
        transform: none;
    }
}
