/* ══ VARIABLES ════════════════════════════════════════════════════════════════ */
:root {
    --bg:          #fafaf7;
    --ink:         #1a1a1a;
    --ink-dim:     #4a4a4a;
    --ink-faint:   #888;
    --accent:      #c2410c;
    --accent-pale: #fef3ee;
    --green:       #65a30d;
    --orange:      #ea580c;
    --ticker-bg:   #111111;
    --ticker-fg:   #f0f0ec;
    --border:      2px solid #1a1a1a;
    --dash:        1.5px dashed #ccc;
    --r:           4px;

    /* layout heights */
    --h-header:  80px;
    --h-kiosko:  230px;
    --h-ticker:  68px;
    /* main fills the rest: 1080 - 80 - 230 - 68 = 702px */

    /* fonts */
    --f-display: 'Space Grotesk', sans-serif;
    --f-body:    'DM Sans', sans-serif;
    --f-mono:    'Space Mono', monospace;
}

/* ══ RESET ════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width:  100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    color: var(--ink);
    font-family: var(--f-body);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: none;
    /* Improve rendering at distance */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ══ PAGE GRID ════════════════════════════════════════════════════════════════ */
/* Lienzo lógico fijo 1920×1080, escalado por fitStage() para caber en la ventana */
#stage {
    position: absolute;
    width:  1920px;
    height: 1080px;
    transform-origin: top left;
    overflow: hidden;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

body.cursor-active { cursor: default; }

/* ══ HEADER ══════════════════════════════════════════════════════════════════ */
header {
    height: var(--h-header);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    border-bottom: var(--border);
    background: var(--bg);
    position: relative;
    z-index: 10;
}

.hdr-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 30px;
    letter-spacing: -0.5px;
    color: var(--ink);
}

.hdr-credit {
    display: block;
    font-family: var(--f-body);
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.3px;
    margin-top: 1px;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}
.hdr-credit:hover {
    color: var(--ink-dim);
    text-decoration: underline;
}

.hdr-right {
    display: flex;
    align-items: center;
    gap: 44px;
}

/* ── Header action buttons ───────────────────────────────────────────────── */
.hdr-btns {
    display: flex;
    gap: 6px;
    align-self: stretch;
    align-items: stretch;
}

.hdr-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    color: #ccc;
    font-family: var(--f-display);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.2px;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    white-space: nowrap;
}
.hdr-btn:hover,
.hdr-btn:focus {
    color: #fff;
    outline: none;
}

.hdr-btn--cam { opacity: 0.45; }

/* ══ FOCO UNIFICADO (remoto) ═════════════════════════════════════════════════ */
/* Un solo lenguaje visual de foco para todas las zonas y overlays */
.nav-focus,
.cover-card--focused,
.fo-day--focused {
    outline: 2.5px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 22px rgba(194, 65, 12, 0.35);
}

.nav-focus,
.cover-card--focused {
    border-radius: var(--r);
}

.rail-item--focused {
    outline: 2.5px solid var(--accent);
    outline-offset: -2.5px;   /* inset: los items del rail van de borde a borde */
}

.news-rail--selected .rail-tab--active {
    outline: 2.5px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r);
}

.ticker-bar--active {
    outline: 2.5px solid var(--accent);
    outline-offset: -2.5px;
}

/* ══ SEARCH OVERLAY ══════════════════════════════════════════════════════════ */
.search-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(5,5,5,0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 130;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}
.search-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

.so-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg);
    padding: 0;
}

/* Input bar */
.so-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 32px;
    border-bottom: var(--border);
    flex-shrink: 0;
}

.so-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--accent-pale);
    border: 2px solid var(--ink-faint);
    border-radius: var(--r);
    padding: 10px 20px;
    transition: border-color 0.15s;
}
.so-input-wrap:focus-within { border-color: var(--accent); }

.so-input-icon { font-size: 20px; opacity: 0.6; }

.so-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--f-display);
    font-size: 22px;
    font-weight: 500;
    color: var(--ink);
    outline: none;
    -webkit-appearance: none;
}
.so-input::placeholder { color: var(--ink-faint); }
.so-input::-webkit-search-cancel-button { display: none; }

.so-count {
    font-family: var(--f-mono);
    font-size: 13px;
    color: var(--ink-faint);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Body: list + viewer */
.so-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Results list */
.so-list {
    width: 42%;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: var(--border);
    scroll-behavior: smooth;
}
.so-list::-webkit-scrollbar { width: 4px; }
.so-list::-webkit-scrollbar-thumb { background: var(--ink-faint); border-radius: 2px; }

.so-empty {
    padding: 40px 28px;
    font-family: var(--f-display);
    font-size: 15px;
    color: var(--ink-faint);
    letter-spacing: 1px;
}

.so-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px 24px;
    border-bottom: var(--dash);
    cursor: pointer;
    transition: background 0.12s;
}
.so-item:hover { background: var(--accent-pale); }
.so-item--focused {
    background: var(--accent-pale);
    border-left: 4px solid var(--accent);
    padding-left: 20px;
}

.so-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.so-item-title {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: 15px;
    color: var(--ink);
    line-height: 1.35;
}
.so-item--focused .so-item-title { color: var(--ink); }

/* Viewer panel */
.so-viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 32px 40px;
    overflow-y: auto;
}

.so-viewer-img-wrap {
    width: 100%;
    border-radius: var(--r);
    overflow: hidden;
    max-height: 340px;
    background: var(--accent-pale);
    flex-shrink: 0;
}
.so-viewer-img {
    width: 100%;
    height: 340px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.so-viewer-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}
.so-viewer-source {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    color: var(--ink-dim);
}
.so-viewer-time { color: var(--ink-faint); font-size: 13px; }

.so-viewer-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 28px;
    line-height: 1.25;
    color: var(--ink);
    letter-spacing: -0.5px;
}

.so-viewer-desc {
    font-family: var(--f-body);
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink-dim);
}

.so-viewer-url {
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--ink-faint);
    word-break: break-all;
}

.so-viewer-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-family: var(--f-display);
    font-size: 16px;
    color: var(--ink-faint);
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.5;
}

/* Footer */
.so-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 14px 32px;
    border-top: var(--dash);
    font-family: var(--f-display);
    font-size: 13px;
    color: var(--ink-faint);
    flex-shrink: 0;
}
.so-footer strong {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 11px;
    background: var(--ink);
    color: var(--bg);
    padding: 3px 10px;
    border-radius: 3px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Extended forecast strip — header center */
.forecast-strip {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fc-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 5px 14px 6px;
    border: 1.5px solid var(--ink-faint);
    border-radius: var(--r);
    min-width: 68px;
}

.fc-label {
    font-family: var(--f-display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink-dim);
}

.fc-icon { font-size: 18px; line-height: 1.2; }

.fc-temps {
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--ink);
    white-space: nowrap;
}

.fc-lo { color: var(--ink-faint); }

/* Weather */
.weather-widget {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--f-display);
    padding: 6px 10px;
}

.w-icon { font-size: 40px; line-height: 1; flex-shrink: 0; }

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

.w-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.w-temp { font-size: 38px; font-weight: 700; letter-spacing: -1.5px; line-height: 1; }
.w-city {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.w-sub {
    font-family: var(--f-mono);
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.5px;
    white-space: nowrap;
    margin-top: 3px;
}

/* Clock */
.clock-widget { text-align: right; }

.clock-time {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 50px;
    line-height: 1;
    letter-spacing: -2px;
}

.clock-date {
    font-family: var(--f-body);
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-dim);
    text-transform: capitalize;
    letter-spacing: 0.2px;
    margin-top: 1px;
}

/* ══ MAIN (Hero + Rail) ══════════════════════════════════════════════════════ */
main {
    flex: 1;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    overflow: hidden;
    min-height: 0;
    position: relative; /* needed for loading-screen absolute positioning */
}

/* ══ LOADING SCREEN ══════════════════════════════════════════════════════════ */
.loading-screen {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.8s ease;
    /* span both grid columns */
    grid-column: 1 / -1;
    pointer-events: none;
}
.loading-screen.gone { opacity: 0; }

/* Skeleton shimmer */
@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

.rail-item--skeleton {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid #e0dfd9;
    pointer-events: none;
}

.skel-line {
    border-radius: 3px;
    background: linear-gradient(90deg, #e8e7e2 25%, #f0efea 50%, #e8e7e2 75%);
    background-size: 600px 100%;
    animation: shimmer 1.4s infinite linear;
}

.skel-line--short { height: 12px; width: 35%; }
.skel-line--long  { height: 16px; width: 90%; }

.ls-time {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 200px;
    letter-spacing: -10px;
    line-height: 1;
    color: var(--ink);
    animation: ls-pulse 2.4s ease-in-out infinite;
}

@keyframes ls-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

.ls-label {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.ls-d1, .ls-d2, .ls-d3 { animation: dot-in 1.5s infinite; }
.ls-d2 { animation-delay: 0.25s; }
.ls-d3 { animation-delay: 0.5s; }
@keyframes dot-in {
    0%, 60%, 100% { opacity: 0; }
    30%            { opacity: 1; }
}

/* ── Featured (left) ─────────────────────────────────────────────────────── */
.featured {
    display: flex;
    flex-direction: column;
    padding: 24px 32px 20px;
    border-right: var(--border);
    overflow: hidden;
    gap: 10px;
}

.feat-top {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.feat-badge {
    background: var(--accent);
    color: #fff;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 2.5px;
    padding: 4px 12px 3px;
    border-radius: var(--r);
    flex-shrink: 0;
    text-transform: uppercase;
}

.feat-source {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 15px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.feat-time {
    font-family: var(--f-mono);
    font-size: 13px;
    color: var(--ink-faint);
}

/* Image — foto entera (contain) sobre fondo de la misma foto difuminada:
   el contenedor es muy apaisado (~3:1) y con cover siempre se cortan caras. */
.feat-img-wrap {
    width: 100%;
    border: var(--border);
    background: #101010;
    overflow: hidden;
    position: relative;
    flex: 1 1 290px;      /* absorbe el espacio libre del hero */
    min-height: 240px;
    max-height: 430px;
}

.feat-img-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(26px) brightness(0.5) saturate(1.1);
    transform: scale(1.15);   /* esconde los bordes del blur */
}

.feat-img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.feat-img.hidden { display: none; }

/* Image placeholder */
.img-placeholder {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.img-placeholder svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.img-placeholder-label {
    font-family: var(--f-body);
    font-size: 15px;
    color: var(--ink-faint);
    position: relative;
}

/* Headline & dek */
.feat-headline {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 46px;
    line-height: 1.15;
    color: var(--ink);
    flex-shrink: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.5px;
}

.feat-dek {
    font-family: var(--f-body);
    font-weight: 400;
    font-size: 19px;
    color: var(--ink-dim);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.feat-dek--empty::after {
    content: 'SIN MÁS INFORMACIÓN';
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: 1.5px;
    color: #3a3a3a;
}

/* ── News Rail (right) ──────────────────────────────────────────────────── */
.news-rail {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Rail tabs ───────────────────────────────────────────────────────────── */
.rail-tabs {
    display: flex;
    align-items: stretch;
    border-bottom: var(--border);
    flex-shrink: 0;
    height: 54px;
    min-width: 0;
}

/* Contenedor scrolleable de pestañas — sin barra visible (estilo TV);
   la pestaña activa se auto-scrollea a la vista al cambiar de sección */
.rail-tabs-scroll {
    position: relative;   /* offsetLeft de las tabs relativo a este contenedor */
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    min-width: 0;
    scrollbar-width: none;
}
.rail-tabs-scroll::-webkit-scrollbar { display: none; }

.rail-tabs-scroll .rail-tab { flex-shrink: 0; white-space: nowrap; }

.rail-tab {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 0 22px;
    display: flex;
    align-items: center;
    color: var(--ink-dim);
    border-right: var(--border);
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}

.rail-tab--active {
    color: var(--ink);
    background: var(--accent-pale);
    box-shadow: inset 0 -3px 0 var(--accent);
}

.rail-tab { position: relative; }

.rail-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    background: var(--accent);
    color: #fff;
    font-family: var(--f-mono);
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.rail-hdr-hint {
    font-family: var(--f-body);
    font-size: 13px;
    color: var(--ink-faint);
    padding: 0 16px;
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* ── Rail sliding panels ─────────────────────────────────────────────────── */
.rail-panels {
    flex: 1;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

.rail-track {
    display: flex;
    width: 400%;
    height: 100%;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.rail-panel {
    width: 25%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.live-dot {
    color: var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
}

.rail-list {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;   /* ancla de los indicadores .rail-more */
}

/* Indicadores de más noticias arriba/abajo de la ventana visible */
.rail-more {
    position: absolute;
    right: 12px;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--ink-dim);
    background: var(--bg);
    border: 1.5px solid var(--ink-faint);
    border-radius: var(--r);
    padding: 3px 9px;
    pointer-events: none;
}
.rail-more--up   { top: 8px; }
.rail-more--down {
    bottom: 8px;
    animation: rail-more-nudge 2.6s ease-in-out infinite;
}
@keyframes rail-more-nudge {
    0%, 100% { opacity: 0.9; transform: translateY(0); }
    50%      { opacity: 0.55; transform: translateY(3px); }
}

.rail-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 20px;
    border-bottom: var(--dash);
    flex-shrink: 0;
}

.rail-item:last-child { border-bottom: none; }

.rail-time {
    font-family: var(--f-mono);
    font-size: 14px;
    color: var(--ink-faint);
    min-width: 52px;
    flex-shrink: 0;
    padding-top: 2px;
}

.rail-pill {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border: 1.5px solid var(--ink);
    border-radius: var(--r);
    padding: 3px 8px 2px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 78px;
    text-align: center;
}

.rail-title {
    font-family: var(--f-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.45;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ══ KIOSKO STRIP ════════════════════════════════════════════════════════════ */
.kiosko-strip {
    height: var(--h-kiosko);
    flex-shrink: 0;
    border-top: var(--border);
    overflow: hidden;
}

.kiosko-track {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 12px;
    animation: kiosko-scroll 90s linear infinite;
    width: max-content;
    will-change: transform;
}

.kiosko-track:hover { animation-play-state: paused; }
.kiosko-track--frozen { animation-play-state: paused; }

@keyframes kiosko-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Cover card */
.cover-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.cover-img-wrap {
    width:  140px;
    height: 184px;
    border: 2px solid var(--ink);
    overflow: hidden;
    background: #e8e7e2;
    position: relative;
    flex-shrink: 0;
}

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

/* Cover placeholder */
.cover-ph {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cover-ph svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.cover-ph-label {
    font-family: var(--f-body);
    font-size: 12px;
    color: var(--ink-faint);
    position: relative;
    text-align: center;
    padding: 0 6px;
}

.cover-caption {
    width: 140px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cover-name {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 12px;
    color: var(--ink);
    letter-spacing: 0.3px;
}

.cover-city {
    font-family: var(--f-mono);
    font-size: 10px;
    color: var(--ink-faint);
}

/* ══ KIOSKO — focus state ════════════════════════════════════════════════════ */
.cover-card { cursor: pointer; }

.cover-card--focused .cover-name { color: var(--accent); }

/* Strip glows when in kiosko navigation zone */
.kiosko-strip--active {
    box-shadow: inset 0 4px 0 var(--accent);
}

/* Preview de tapa al hacer hover — solo la imagen, sin decoración */
.cover-hover {
    position: fixed;              /* relativo a #stage (transform crea containing block) */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 918px;                /* 85% de 1080 */
    max-width: 90%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 30px 90px rgba(0,0,0,0.7);
    z-index: 95;                  /* sobre el contenido (header z10), bajo los overlays (110+) */
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}
.cover-hover.show { opacity: 1; visibility: visible; }

/* ══ FORECAST OVERLAY ════════════════════════════════════════════════════════ */
.forecast-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(4,4,4,0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.forecast-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

/* Panel is always dark — weather panels read better on dark */
.fo-panel {
    background: #0e0e0d;
    width: 1856px;
    height: 1016px;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 16px;
    padding: 40px 52px 28px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    box-shadow: 0 48px 120px rgba(0,0,0,0.85);
}

/* Override the shared ao-close style for the dark panel */
.fo-panel .ao-close {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.5);
}
.fo-panel .ao-close:hover,
.fo-panel .ao-close:focus {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* ── Current conditions header ──────────────────────────────────────────── */
.fo-header {
    display: flex;
    align-items: center;
    gap: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.fo-current {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 1;
}

.fo-now-icon {
    font-size: 96px;
    line-height: 1;
}

.fo-now-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fo-now-location {
    font-family: var(--f-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}

.fo-now-temp {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 120px;
    letter-spacing: -5px;
    color: #fff;
    line-height: 0.9;
}

.fo-now-feels {
    font-family: var(--f-body);
    font-size: 15px;
    color: rgba(255,255,255,0.4);
    margin-top: 6px;
    letter-spacing: 0.3px;
}

/* Stat boxes — humidity & wind */
.fo-now-stats {
    display: flex;
    gap: 14px;
    margin-left: auto;
}

.fo-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 22px 30px;
    min-width: 120px;
}

.fo-stat-icon { font-size: 28px; line-height: 1; }

.fo-stat-value {
    font-family: var(--f-mono);
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.fo-stat-label {
    font-family: var(--f-display);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
}

/* ── Section label ──────────────────────────────────────────────────────── */
.fo-section-label {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
    margin-bottom: -16px;
}

/* ── Day cards ──────────────────────────────────────────────────────────── */
.fo-days {
    display: flex;
    gap: 14px;
    flex: 0 0 auto;   /* columnas compactas — el espacio libre lo usa la franja horaria */
}

/* ── Franja horaria del día enfocado ─────────────────────────────────────── */
.fo-hourly {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 12px;
}

.fo-hour {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 12px 8px;
}

.fo-hour-time {
    font-family: var(--f-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
}

.fo-hour-icon { font-size: 34px; line-height: 1; }

.fo-hour-temp {
    font-family: var(--f-mono);
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.fo-hour-rain {
    font-family: var(--f-mono);
    font-size: 13px;
    color: rgba(255,255,255,0.45);
}

.fo-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 26px 10px 20px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    text-align: center;
    transition: border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s;
    flex: 1;
    cursor: pointer;
}

.fo-day:hover:not(.fo-day--focused) {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.16);
}

/* "Hoy" card gets a brighter top bar */
.fo-day:first-child {
    border-top: 3px solid rgba(255,255,255,0.22);
}

.fo-day--focused {
    border-color: var(--accent);
    border-top-color: var(--accent);
    background: rgba(220,40,30,0.13);
    transform: translateY(-4px);
}

.fo-day-name {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.38);
}

.fo-day--focused .fo-day-name { color: var(--accent); }

.fo-day-icon { font-size: 60px; line-height: 1.1; }

.fo-day-temps {
    font-family: var(--f-mono);
    font-size: 26px;
    font-weight: 700;
    color: #fff;
}

.fo-day-lo { color: rgba(255,255,255,0.3); font-weight: 400; }

/* Rain probability bar */
.fo-day-rain-bar {
    width: 80%;
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
}
.fo-day-rain-fill {
    height: 100%;
    background: #60a5fa;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.fo-day-extra {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-family: var(--f-body);
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    line-height: 1.6;
}

/* ── Cambio de ciudad ────────────────────────────────────────────────────── */
.fo-city-row {
    display: flex;
    gap: 14px;
}

.fo-city-btn {
    font-family: var(--f-display);
    font-size: 16px;
    font-weight: 500;
    padding: 12px 26px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
}
.fo-city-btn--ghost { opacity: 0.55; }

.fo-city-search { display: none; flex-direction: column; gap: 12px; }
.fo-city-search.open { display: flex; }

.fo-city-input {
    font-family: var(--f-display);
    font-size: 22px;
    padding: 14px 20px;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.18);
    border-radius: 10px;
    color: #fff;
    outline: none;
}

.fo-city-results { display: flex; flex-direction: column; gap: 4px; }

.fo-city-result {
    font-family: var(--f-body);
    font-size: 19px;
    padding: 10px 20px;
    border-radius: 8px;
    color: rgba(255,255,255,0.75);
}
.fo-city-result--focused {
    background: rgba(255,255,255,0.10);
    color: #fff;
    outline: 2.5px solid var(--accent);
    outline-offset: -2.5px;
}
.fo-city-empty { color: rgba(255,255,255,0.35); font-size: 16px; padding: 10px 20px; }

.fo-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.07);
    font-family: var(--f-display);
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}
.fo-footer strong {
    font-weight: 700;
    font-size: 11px;
    background: rgba(255,255,255,0.85);
    color: #0e0e0d;
    padding: 3px 10px;
    border-radius: 3px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ══ MARKETS OVERLAY ════════════════════════════════════════════════════════ */
.markets-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #080809;
    z-index: 120;   /* above all other overlays */
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.markets-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

.mo-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 28px 16px;
    gap: 14px;
}

.mo-header {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.mo-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}

/* 4×2 chart grid */
.mo-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    min-height: 0;
}

.mo-chart-cell {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

/* TradingView widget fills the cell */
.mo-chart-cell .tradingview-widget-container,
.mo-chart-cell .tradingview-widget-container__widget {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* Hide TradingView copyright bar to save space */
.mo-chart-cell .tradingview-widget-copyright { display: none !important; }

.mo-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--f-display);
    font-size: 13px;
    color: rgba(255,255,255,0.2);
    flex-shrink: 0;
}

.mo-footer strong {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 11px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    padding: 4px 12px;
    border-radius: 4px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ══ COVER OVERLAY ═══════════════════════════════════════════════════════════ */
.cover-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(5, 5, 5, 0.94);
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}
.cover-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.co-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.co-img-wrap {
    /* image sizes itself; constrain to fit screen */
}

.co-img {
    max-height: 820px;
    max-width:  560px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    box-shadow: 0 24px 80px rgba(0,0,0,0.8);
    border: 3px solid rgba(255,255,255,0.12);
}

.co-meta {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.co-name {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 28px;
    color: #f0efe8;
    letter-spacing: -0.3px;
}

.co-city {
    font-family: var(--f-mono);
    font-size: 16px;
    color: #888;
}

.co-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--f-display);
    font-size: 15px;
    color: #666;
}

.co-footer strong {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 12px;
    background: rgba(255,255,255,0.15);
    color: #f0efe8;
    padding: 3px 10px;
    border-radius: 3px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ══ TICKER ══════════════════════════════════════════════════════════════════ */
.ticker-bar {
    height: var(--h-ticker);
    flex-shrink: 0;
    background: var(--ticker-bg);
    color: var(--ticker-fg);
    display: flex;
    align-items: center;
    overflow: hidden;
    transition: box-shadow 0.15s;
    cursor: pointer;
}

/* ── Mini-player de radio (estilo Spotify compacto) ─────────────────────────── */
.radio-mini {
    display: none;
    align-items: center;
    gap: 4px;
    height: 100%;
    padding: 0 12px 0 16px;
    background: #1c1c1a;
    border-right: 1px solid rgba(255,255,255,0.14);
    flex-shrink: 0;
    cursor: default;
}
.radio-mini.show { display: flex; }

.rm-name {
    font-family: var(--f-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #a3e635;
    white-space: nowrap;
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    margin-right: 6px;
}
.rm-name:hover { text-decoration: underline; }
.radio-mini--paused .rm-name { color: rgba(255,255,255,0.45); }

.rm-btn {
    background: transparent;
    border: none;
    color: var(--ticker-fg);
    font-size: 15px;
    line-height: 1;
    padding: 6px 5px;
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.12s;
}
.rm-btn:hover { opacity: 1; }
.rm-btn--stop { font-size: 11px; opacity: 0.45; margin-left: 2px; }

.ticker-label {
    background: var(--accent);
    color: #fff;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2.5px;
    height: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
    border-right: 1px solid #333;
    text-transform: uppercase;
}

.ticker-overflow {
    flex: 1;
    overflow: hidden;
    height: 100%;
    position: relative;
}

.ticker-track {
    display: flex;
    align-items: center;
    height: 100%;
    animation: ticker-scroll 70s linear infinite;
    will-change: transform;
    white-space: nowrap;
}

.ticker-track:hover { animation-play-state: paused; }

@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Quote pill */
.q-pill {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 0 28px;
    height: 100%;
    border-right: 1px solid #222;
    flex-shrink: 0;
    transition: background 0.6s ease;
}

.q-sym {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1.5px;
    color: #777;
    text-transform: uppercase;
}

.q-price {
    font-family: var(--f-mono);
    font-size: 22px;
    color: var(--ticker-fg);
    letter-spacing: -0.5px;
}

.q-chg {
    font-family: var(--f-mono);
    font-size: 14px;
    letter-spacing: -0.3px;
}

.q-up   { color: var(--green); }
.q-dn   { color: var(--orange); }
.q-flat { color: #555; }

/* Flash animations on price change */
@keyframes flash-up { 0%,100%{background:transparent} 40%{background:#162b06} }
@keyframes flash-dn { 0%,100%{background:transparent} 40%{background:#2d1200} }

.flash-up { animation: flash-up 0.9s ease; }
.flash-dn { animation: flash-dn 0.9s ease; }

/* ══ DARK THEME (default) — key D toggles, ?theme=light overrides ═══════════ */
body.dark {
    --bg:          #0f0f0e;
    --ink:         #f0efe8;
    --ink-dim:     #9a9990;
    --ink-faint:   #55544f;
    --accent-pale: #1e0d06;
    --border:      2px solid #f0efe8;
    --dash:        1.5px dashed #2a2a28;
}
body.dark .feat-img-wrap,
body.dark .ao-img-wrap,
body.dark .cover-img-wrap  { background: #1c1b18; }
body.dark .rail-item:hover:not(.rail-item--focused) { background: #191815; }
body.dark .ao-sep          { color: #444; }

/* ══ STALE DATA INDICATOR ════════════════════════════════════════════════════ */
.stale { opacity: 0.5; }

/* ══ CATEGORY PILLS — colored fills in rail ══════════════════════════════════ */
.cat-pill--cordoba   { background: #0369a1; color: #fff; border-color: #0369a1; }
.cat-pill--nacional  { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.cat-pill--bitcoin   { background: #f7931a; color: #fff; border-color: #f7931a; }
.cat-pill--tech      { background: #0d9488; color: #fff; border-color: #0d9488; }
.cat-pill--social    { background: #1d9bf0; color: #fff; border-color: #1d9bf0; }
.cat-pill--default   { background: #6b7280; color: #fff; border-color: #6b7280; }

/* ══ CATEGORY BADGES — feat-badge + ao-badge ═════════════════════════════════ */
.cat-badge--cordoba   { background: #0369a1; color: #fff; }
.cat-badge--nacional  { background: #7c3aed; color: #fff; }
.cat-badge--bitcoin   { background: #f7931a; color: #fff; }
.cat-badge--tech      { background: #0d9488; color: #fff; }
.cat-badge--social    { background: #1d9bf0; color: #fff; }
.cat-badge--default   { background: #6b7280; color: #fff; }

/* ── Bitcoin tab accent ──────────────────────────────────────────────────────── */
.rail-tab--bitcoin       { color: #f7931a; }
.rail-tab--bitcoin.rail-tab--active { background: #f7931a; color: #fff; }

/* ── Tech tab accent ─────────────────────────────────────────────────────────── */
.rail-tab--tech       { color: #0d9488; }
.rail-tab--tech.rail-tab--active { background: #0d9488; color: #fff; }


/* ══ RAIL FOCUS — remote control navigation ══════════════════════════════════ */
.rail-item { cursor: pointer; transition: background 0.12s; }
.rail-item:hover:not(.rail-item--focused) { background: #f4f3ef; }

.rail-item--focused {
    background: var(--accent-pale);
    border-bottom-color: transparent;
}
.rail-item--focused .rail-time  { color: var(--ink-dim); }
.rail-item--focused .rail-title { color: var(--ink); font-weight: 500; }

/* Featured is also clickable */
.featured { cursor: pointer; }

/* Tabs zone: news block is "selected" — visible accent border before entering */
.news-rail--selected {
    outline: 3px solid var(--accent);
    outline-offset: -3px;
}

/* List zone: actively navigating inside the list */
.news-rail--active {
    outline: 3px solid var(--accent);
    outline-offset: -3px;
    box-shadow: inset 4px 0 0 var(--accent);
}

/* ══ ARTICLE OVERLAY ═════════════════════════════════════════════════════════ */
.article-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 10, 0.92);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.article-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Panel */
.ao-panel {
    background: var(--bg);
    width: 1680px;
    max-height: 880px;
    border: 3px solid var(--ink);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 36px 52px 28px;
    gap: 18px;
    box-shadow: 0 32px 100px rgba(0,0,0,0.6);
}

/* Header row */
.ao-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    padding-bottom: 18px;
    border-bottom: var(--border);
}

.ao-badge {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 2.5px;
    padding: 5px 14px 4px;
    border-radius: var(--r);
    flex-shrink: 0;
    text-transform: uppercase;
    background: #6b7280;
    color: #fff;
}

.ao-source {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 20px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ao-time {
    font-family: var(--f-mono);
    font-size: 15px;
    color: var(--ink-faint);
}

.ao-close {
    margin-left: auto;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: transparent;
    border: 2px solid var(--ink);
    border-radius: var(--r);
    padding: 8px 22px;
    cursor: pointer;
    color: var(--ink);
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.ao-close:hover,
.ao-close:focus { background: var(--ink); color: var(--bg); outline: none; }

/* Body */
.ao-body {
    display: flex;
    gap: 44px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    align-items: flex-start;
}

.ao-img-wrap {
    width: 480px;
    height: 330px;
    flex-shrink: 0;
    border: var(--border);
    background: #eae9e4;
    overflow: hidden;
}

.ao-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ao-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    overflow: hidden;
}

.ao-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 48px;
    line-height: 1.12;
    letter-spacing: -0.5px;
    color: var(--ink);
    flex-shrink: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ao-desc {
    font-family: var(--f-body);
    font-size: 21px;
    line-height: 1.65;
    color: var(--ink-dim);
    flex: 1;
    min-height: 0;
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ao-url {
    font-family: var(--f-mono);
    font-size: 13px;
    color: var(--ink-faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-top: 10px;
    border-top: var(--dash);
    flex-shrink: 0;
}

/* Footer */
.ao-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-family: var(--f-display);
    font-size: 15px;
    color: var(--ink-faint);
    letter-spacing: 0.3px;
    flex-shrink: 0;
    padding-top: 14px;
    border-top: var(--dash);
}

.ao-sep { color: #ccc; }

.ao-footer strong {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 13px;
    background: var(--ink);
    color: var(--bg);
    padding: 3px 10px;
    border-radius: 3px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ══ CAMERA OVERLAY ══════════════════════════════════════════════════════════ */
.camera-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(5,5,5,0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 125;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
}
.camera-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cam-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 28px 40px 20px;
    gap: 16px;
    overflow: hidden;
}

.cam-header {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.cam-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.3px;
    color: var(--ink);
}

.cam-status {
    font-family: var(--f-mono);
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 0.5px;
    flex: 1;
}

/* 4-column grid; images keep 4:3 ratio */
.cam-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: var(--ink-faint) transparent;
}

.cam-card {
    position: relative;
    border-radius: calc(var(--r) + 2px);
    border: 2px solid var(--ink-faint);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #111;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}
.cam-card--focused {
    border-color: var(--accent);
    transform: scale(1.03);
    z-index: 1;
    box-shadow: 0 0 0 2px var(--accent);
}
.cam-card:hover { border-color: var(--ink-dim); }

/* Spinner sobre el card hasta que la imagen termine de cargar */
.cam-card::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 34px; height: 34px;
    margin: -17px 0 0 -17px;
    border: 3px solid rgba(255,255,255,0.12);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: cam-spin 0.85s linear infinite;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.2s;
}
.cam-card--loaded::after { opacity: 0; animation: none; }
@keyframes cam-spin { to { transform: rotate(360deg); } }

/* Shimmer placeholder mientras se obtienen los tokens */
.cam-card--skeleton {
    background: linear-gradient(90deg, #141414 0%, #232323 50%, #141414 100%);
    background-size: 200% 100%;
    animation: cam-shimmer 1.4s linear infinite;
    border-color: #1f1f1f;
}
.cam-card--skeleton::after { display: none; }
@keyframes cam-shimmer {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}

.cam-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    image-rendering: auto;
}
.cam-img--error {
    opacity: 0.25;
    filter: grayscale(1);
}

.cam-label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 18px 10px 7px;
    background: linear-gradient(transparent, rgba(0,0,0,0.82));
    font-family: var(--f-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #fff;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

.cam-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    font-family: var(--f-display);
    font-size: 13px;
    color: var(--ink-faint);
    letter-spacing: 0.3px;
    padding-top: 12px;
    border-top: var(--dash);
}
.cam-attr {
    margin-left: auto;
    font-size: 11px;
    opacity: 0.5;
}

/* ══ CAMERA FULLSCREEN ═══════════════════════════════════════════════════════ */
.cam-full-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000;
    z-index: 135;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
}
.cam-full-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cam-full-img {
    max-width: 100%;
    max-height: 1000px;
    object-fit: contain;
    display: block;
    image-rendering: auto;
    transition: opacity 0.18s;
}
.cam-full-img--loading {
    opacity: 0;
}

/* Spinner centrado en el overlay mientras carga la imagen ampliada */
.cam-full-overlay::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 56px; height: 56px;
    margin: -28px 0 0 -28px;
    border: 4px solid rgba(255,255,255,0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: cam-spin 0.85s linear infinite;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}
.cam-full-overlay--loading.open::before {
    opacity: 1;
}

.cam-full-name {
    font-family: var(--f-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin-top: 14px;
    text-align: center;
    letter-spacing: -0.2px;
}

.cam-full-footer {
    position: absolute;
    bottom: 18px;
    left: 0; right: 0;
    text-align: center;
    font-family: var(--f-display);
    font-size: 13px;
    color: var(--ink-faint);
}

/* ══ TV CHANNELS OVERLAY ═════════════════════════════════════════════════════ */

.tv-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000;
    z-index: 126;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
}
.tv-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

.tv-panel {
    position: relative;   /* ancla de .tv-manage y .tv-toast */
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 18px 28px 16px;
    gap: 14px;
}

.tv-header {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.tv-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 20px;
    color: #fff;
    letter-spacing: -0.2px;
    flex-shrink: 0;
}

.tv-hint {
    font-family: var(--f-display);
    font-size: 13px;
    color: #555;
    flex: 1;
}

/* Grid: 4 cols fijas, cada card 16:9 — scroll vertical si hace falta */
.tv-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: max-content;
    align-content: start;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
}

.tv-card {
    position: relative;
    aspect-ratio: 16 / 9;
    border: 2px solid #222;
    border-radius: 4px;
    overflow: hidden;
    background: #0a0a0a;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s, transform 0.15s;
}
.tv-card--focused {
    border-color: var(--accent);
    transform: scale(1.03);
    z-index: 1;
    box-shadow: 0 0 0 2px var(--accent);
}

.tv-card iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    pointer-events: none; /* remote nav handles interaction */
}

.tv-label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 14px 8px 5px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    font-family: var(--f-display);
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    pointer-events: none;
}

/* ── Audio individual en la grilla ────────────────────────────────────────── */
.tv-audio-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    background: rgba(0,0,0,0.55);
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    z-index: 2;
}
.tv-card:hover .tv-audio-btn,
.tv-card--focused .tv-audio-btn,
.tv-card--audio .tv-audio-btn { opacity: 1; }

.tv-card--audio {
    border-color: var(--green);
    box-shadow: 0 0 0 2px var(--green), 0 0 20px rgba(101, 163, 13, 0.4);
}
.tv-card--audio .tv-audio-btn {
    background: var(--green);
    border-color: var(--green);
}

/* ✕ de eliminar canal — chiquita, arriba a la derecha */
.tv-close-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    background: rgba(0,0,0,0.55);
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: 6px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    z-index: 2;
}
.tv-card:hover .tv-close-btn { opacity: 1; }
.tv-close-btn:hover {
    background: #c0281c;
    border-color: #c0281c;
    color: #fff;
}

/* Botón ⧉ de la tarjeta — mismo patrón que .tv-audio-btn, al lado del 🔊 */
.tv-pip-btn {
    position: absolute;
    top: 6px;
    left: 46px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    background: rgba(0,0,0,0.55);
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 2;
}
.tv-card:hover .tv-pip-btn,
.tv-card--focused .tv-pip-btn { opacity: 1; }
.tv-card--dead .tv-pip-btn    { display: none; }

/* Tarjeta apagada mientras su canal está en PiP */
.tv-card--pip iframe { visibility: hidden; }
.tv-card--pip::after {
    content: '▶ En PiP';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.72);
    color: rgba(255,255,255,0.75);
    font-size: 15px;
    letter-spacing: .04em;
    cursor: pointer;
    z-index: 1;
}

/* Mini-ventana interna — por encima de todos los overlays (110-136).
   El bottom despeja el ticker, que aloja el mini-player de la radio:
   con bottom: 18px la mini-ventana lo taparía. */
#tv-pip {
    position: fixed;
    right: 18px;
    bottom: calc(var(--h-ticker) + 18px);
    width: 360px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.65);
    z-index: 140;
    display: flex;
    flex-direction: column;
}
/* La pantalla completa (136) queda por debajo del PiP (140): sin esto, el
   recuadro flotante se ve encima del canal a pantalla completa. openTvFull()
   ya mutea el PiP; acá sólo falta esconderlo mientras dure. #tv-pip se cuelga
   siempre al final de #stage (ver openTvPipInline), así que el combinador ~
   lo alcanza sin importar si se abrió antes o después de la pantalla completa. */
.tv-full-overlay.open ~ #tv-pip { display: none; }
/* Misma razón con la cámara a pantalla completa (135): el PiP sobrevive al cierre
   del overlay de TV, así que puede seguir flotando cuando se abre una cámara. */
.cam-full-overlay.open ~ #tv-pip { display: none; }
#tv-pip iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    display: block;
}
.tv-pip-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #111;
    color: #fff;
    font-size: 13px;
}
.tv-pip-bar span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tv-pip-bar button {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 4px 9px;
    cursor: pointer;
    font-size: 13px;
}

/* Drag & drop de tarjetas */
.tv-card--dragging   { opacity: 0.45; }
.tv-card--droptarget { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

/* ✕ armada esperando confirmación */
.tv-card--confirm .tv-close-btn {
    opacity: 1;
    background: #c0281c;
    border-color: #c0281c;
    color: #fff;
}

/* Botones ↑↓ de mover en el gestor */
.tvm-move {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}
.tvm-move:hover {
    background: rgba(255,255,255,0.16);
    color: #fff;
}

/* ── Tarjeta "＋ Canales" ─────────────────────────────────────────────────── */
.tv-card--add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-style: dashed;
    border-color: rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.04);
}
.tv-card--add .tv-add-plus {
    font-size: 44px;
    line-height: 1;
    color: rgba(255,255,255,0.65);
    font-family: var(--f-display);
}
.tv-card--add .tv-add-label {
    font-family: var(--f-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
}

/* ── Panel de gestión de canales ─────────────────────────────────────────── */
.tv-manage {
    display: none;
    position: absolute;
    top: 70px; bottom: 40px;
    left: 22%; right: 22%;
    background: #0e0e0d;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 26px 30px 18px;
    flex-direction: column;
    gap: 12px;
    z-index: 5;
    box-shadow: 0 40px 100px rgba(0,0,0,0.85);
}
.tv-manage.open { display: flex; }

.tv-panel-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.10);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
}
.tv-panel-close:hover { background: rgba(255,255,255,0.22); }

.tv-manage-title {
    font-family: var(--f-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
}

.tv-add-input {
    font-family: var(--f-display);
    font-size: 19px;
    padding: 12px 18px;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.18);
    border-radius: 10px;
    color: #fff;
    outline: none;
}

.tv-add-status {
    font-family: var(--f-mono);
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    min-height: 16px;
}

.tv-manage-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tv-manage-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 9px 16px;
    border-radius: 8px;
    font-family: var(--f-body);
    font-size: 17px;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
}
.tv-manage-item--focused {
    background: rgba(255,255,255,0.10);
    color: #fff;
    outline: 2.5px solid var(--accent);
    outline-offset: -2.5px;
}
.tv-manage-item--removed .tv-manage-name {
    text-decoration: line-through;
    opacity: 0.45;
}
.tv-manage-name { flex: 1; }
.tv-manage-tag {
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}
.tv-manage-action { color: rgba(255,255,255,0.5); font-size: 14px; }

.tv-manage-footer {
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.07);
    font-family: var(--f-display);
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    text-align: center;
}
.tv-manage-footer strong { color: rgba(255,255,255,0.75); }

/* ══ GESTOR DE FUENTES DE NOTICIAS ═══════════════════════════════════════════ */
.rail-tab--plus {
    opacity: 0.4;
    font-size: 17px;
    padding-left: 16px;
    padding-right: 16px;
}
.rail-tab--plus:hover, .rail-tab--plus.nav-focus { opacity: 1; }

.news-manage-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(4,4,4,0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 125;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}
.news-manage-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

.nm-panel {
    position: relative;
    background: #0e0e0d;
    width: 1180px;
    height: 940px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 26px 30px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.85);
}

.nm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nm-title {
    font-family: var(--f-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
}

.nm-cats-label {
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}

.nm-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nm-chip {
    font-family: var(--f-display);
    font-size: 15px;
    font-weight: 500;
    padding: 8px 18px;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(255,255,255,0.14);
    border-radius: 20px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
}
.nm-chip--selected {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.nm-chip--new { border-style: dashed; opacity: 0.8; }

.nm-newcat { display: none; }
.nm-newcat.open { display: block; }

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

/* Banda de sección — color de la categoría, bien distinguible de las fuentes */
.nm-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 8px;
    margin-top: 10px;
    cursor: pointer;
}
.nm-group:first-child { margin-top: 0; }
.nm-group--focused {
    outline: 2.5px solid var(--accent);
    outline-offset: -2.5px;
}

.nm-group-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1.5px rgba(255,255,255,0.25);
}

.nm-group-label {
    flex: 1;
    font-family: var(--f-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

/* ── Cartel rojo de error (3 s) ──────────────────────────────────────────── */
.tv-toast {
    position: absolute;
    top: 78px;
    left: 50%;
    transform: translateX(-50%);
    background: #c0281c;
    color: #fff;
    font-family: var(--f-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 13px 28px;
    border-radius: 8px;
    z-index: 6;
    box-shadow: 0 14px 44px rgba(0,0,0,0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}
.tv-toast.show { opacity: 1; visibility: visible; }

/* ══ COUNTRY OVERLAY ══════════════════════════════════════════════════════════ */
.country-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 10, 0.92);
    z-index: 130;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}
.country-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

.cn-panel {
    background: var(--bg);
    width: 560px;
    border: 3px solid var(--ink);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 28px 32px 22px;
    gap: 16px;
    box-shadow: 0 32px 100px rgba(0,0,0,0.6);
}

.cn-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: var(--border);
}

.cn-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 18px;
}

.cn-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cn-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--f-body);
    font-size: 19px;
    padding: 12px 20px;
    border-radius: 8px;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
}
.cn-item:hover { background: rgba(255,255,255,0.06); }
.cn-item--focused {
    background: rgba(255,255,255,0.10);
    color: #fff;
    outline: 2.5px solid var(--accent);
    outline-offset: -2.5px;
}
.cn-item-code {
    font-family: var(--f-mono);
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1px;
}
.cn-item--active .cn-item-code { color: var(--accent); font-weight: 700; }

.cn-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.07);
    font-family: var(--f-display);
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}
.cn-footer strong {
    font-weight: 700;
    font-size: 11px;
    background: rgba(255,255,255,0.85);
    color: #0e0e0d;
    padding: 3px 10px;
    border-radius: 3px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ══ TV FULLSCREEN ════════════════════════════════════════════════════════════ */
.tv-full-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000;
    z-index: 136;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
}
.tv-full-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

.tv-full-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
}
.tv-full-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.tv-full-bar {
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: #0d0d0d;
    border-top: 1px solid #222;
}
.tv-full-name {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.tv-full-hint {
    font-family: var(--f-display);
    font-size: 13px;
    color: #444;
}

/* ══ RADIO OVERLAY ═══════════════════════════════════════════════════════════ */

.radio-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000;
    z-index: 126;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
}
.radio-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

.radio-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 18px 28px 16px;
    gap: 14px;
}

.radio-header {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.radio-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 20px;
    color: #fff;
    letter-spacing: -0.2px;
    flex-shrink: 0;
}

.radio-hint {
    font-family: var(--f-display);
    font-size: 13px;
    color: #555;
    flex: 1;
}

/* Container for player bar + all sections */
.radio-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    overflow-y: auto;
}

/* ── Sections (Favoritas / Explorar) ──────────────────────────── */
.radio-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.radio-section-hdr {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 4px;
    border-bottom: 1px solid #242424;
}

.radio-section-title {
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #666;
    flex: 1;
}

.radio-toggle-btn {
    background: none;
    border: 1px solid #333;
    border-radius: 4px;
    color: #666;
    font-family: var(--f-mono);
    font-size: 10px;
    padding: 3px 10px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.radio-toggle-btn:hover { color: #ccc; border-color: #555; }

.radio-stations--hidden { display: none !important; }

/* ── Now-playing bar ───────────────────────────────────────────── */
.radio-player {
    background: #1a1a1a;
    border: 1px solid #2c2c2c;
    border-radius: 10px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.radio-player--empty { opacity: 0.45; }

.radio-now-info { flex: 1; min-width: 0; }

.radio-now-label {
    font-family: var(--f-mono);
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 5px;
}

.radio-now-name {
    font-family: var(--f-display);
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
}

.radio-now-meta {
    font-family: var(--f-mono);
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Equalizer */
.radio-eq {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 36px;
    flex-shrink: 0;
}

.radio-eq-bar {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 3px 3px 0 0;
    background: var(--accent);
}

@keyframes eq-bounce {
    from { height: 4px; }
    to   { height: 30px; }
}

.radio-eq--playing .radio-eq-bar:nth-child(1) { animation: eq-bounce 0.75s ease-in-out infinite alternate; }
.radio-eq--playing .radio-eq-bar:nth-child(2) { animation: eq-bounce 0.50s ease-in-out 0.10s infinite alternate; }
.radio-eq--playing .radio-eq-bar:nth-child(3) { animation: eq-bounce 0.65s ease-in-out 0.25s infinite alternate; }
.radio-eq--playing .radio-eq-bar:nth-child(4) { animation: eq-bounce 0.55s ease-in-out 0.05s infinite alternate; }

/* Controls */
.radio-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.radio-play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s, background 0.15s;
    flex-shrink: 0;
}
.radio-play-btn:hover  { background: #b01a23; transform: scale(1.08); }
.radio-play-btn:focus  { outline: 2px solid #fff; outline-offset: 2px; }
.radio-play-btn:disabled { background: #333; cursor: default; transform: none; opacity: 0.5; }

.radio-vol-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.radio-vol-icon { font-size: 16px; color: #888; }

.radio-vol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 130px;
    height: 4px;
    border-radius: 2px;
    background: #333;
    outline: none;
    cursor: pointer;
}
.radio-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.radio-loading-dot {
    font-size: 14px;
    color: #888;
    font-family: var(--f-mono);
    min-width: 18px;
    text-align: center;
}

/* ── Station cards grid ────────────────────────────────────────── */
.radio-stations {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    align-content: start;
}

.radio-station-card {
    background: #1a1a1a;
    border: 1.5px solid #2a2a2a;
    border-radius: 8px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
    display: flex;
    flex-direction: column;
    gap: 3px;
    user-select: none;
    position: relative;
    overflow: hidden;
}
.radio-station-card:hover    { border-color: #555; background: #222; }
.radio-station-card--focused { border-color: #fff; background: #222; }
.radio-station-card--active  { border-color: var(--accent) !important; background: #1e0a0b !important; }

/* Logo background with gradient */
.rs-logo-bg {
    position: absolute;
    inset: 0;
    background-size: 65%;
    background-repeat: no-repeat;
    background-position: center 38%;
    opacity: 0;
    transition: opacity 0.3s;
    filter: blur(0px) saturate(1.2);
}
.rs-logo-bg.loaded { opacity: 0.07; }
.rs-logo-grad {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(26,26,26,0.25) 0%,
        rgba(26,26,26,0.55) 45%,
        rgba(26,26,26,0.96) 100%
    );
}
/* Make text sit above logo layers */
.rs-name, .rs-freq, .rs-city { position: relative; z-index: 1; }
.radio-station-card--active .rs-logo-bg.loaded  { opacity: 0.11; }
.radio-station-card--active .rs-logo-grad {
    background: linear-gradient(
        to bottom,
        rgba(30,10,11,0.2) 0%,
        rgba(30,10,11,0.55) 45%,
        rgba(30,10,11,0.96) 100%
    );
}

.rs-name {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rs-freq {
    font-family: var(--f-mono);
    font-size: 11px;
    color: #888;
}
.rs-city {
    font-family: var(--f-mono);
    font-size: 10px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.radio-station-card--active .rs-name { color: var(--accent); }
.radio-station-card--active .rs-freq { color: #b03038; }

/* ── Explore section ───────────────────────────────────────────── */
.radio-explore { flex-shrink: 0; }

.radio-browse-search {
    background: #111;
    border: 1px solid #333;
    border-radius: 6px;
    color: #ccc;
    font-family: var(--f-mono);
    font-size: 12px;
    padding: 6px 12px;
    outline: none;
    width: 220px;
    transition: border-color 0.15s;
}
.radio-browse-search:focus { border-color: #666; }

/* Province chips */
.radio-prov-chips {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    padding: 2px 0 4px;
}

.radio-prov-chip {
    background: #1a1a1a;
    border: 1px solid #2c2c2c;
    border-radius: 20px;
    color: #888;
    font-family: var(--f-mono);
    font-size: 10px;
    padding: 4px 12px;
    cursor: pointer;
    transition: border-color 0.12s, color 0.12s, background 0.12s;
    white-space: nowrap;
    flex-shrink: 0;
}
.radio-prov-chip:hover        { border-color: #555; color: #ccc; }
.radio-prov-chip--active      { border-color: var(--accent); color: #fff; background: #1e0a0b; }

.radio-prov-loading {
    font-family: var(--f-mono);
    font-size: 11px;
    color: #555;
    padding: 4px 0;
}

/* Browse results grid */
.radio-browse-results {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    align-content: start;
}

.radio-browse-card { cursor: pointer; }
.radio-browse-card .rs-name { font-size: 12px; }
.radio-browse-card .rs-city { color: #666; font-size: 10px; }

.radio-browse-empty {
    font-family: var(--f-mono);
    font-size: 12px;
    color: #444;
    padding: 12px 0;
}
