/* CheckNews — portada pública.
   Sala de monitoreo global: fondo claro, mapa como protagonista y tarjetas
   fotográficas donde el número de fuentes es el dato con más peso. */

:root {
    --breaking:   #E5342A;
    --developing: #F5921E;
    --updates:    #EDC02A;
    --quiet:      #8B7BD8;

    --ink:        #16181D;
    --ink-2:      #3D434E;
    --ink-3:      #6B7280;
    --line:       #E3E6EB;
    --line-2:     #EFF1F4;
    --canvas:     #F7F8FA;
    --white:      #FFFFFF;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-pill: 999px;

    --shadow-card: 0 1px 2px rgba(16, 20, 28, .06), 0 4px 12px rgba(16, 20, 28, .05);
    --shadow-pop:  0 4px 16px rgba(16, 20, 28, .10), 0 12px 32px rgba(16, 20, 28, .08);

    --maxw: 1480px;
    --pad: 24px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2;
      stroke-linecap: round; stroke-linejoin: round; }

.sr, .skip {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip:focus {
    position: fixed; top: 12px; left: 12px;
    width: auto; height: auto; clip: auto;
    background: var(--white); padding: 10px 16px;
    border-radius: var(--r-sm); box-shadow: var(--shadow-pop); z-index: 999;
}

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* --- Marca ---------------------------------------------------------------- */

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 9px;
    line-height: 1;
}

/* Los dos tramos van pegados: el wordmark es una sola palabra. */
.wordmark {
    font-size: 1.62rem;
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1;
    white-space: nowrap;
}
.brand-check { color: var(--ink); }
.brand-news  { color: var(--breaking); }

.live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--breaking);
    align-self: center;
    padding-bottom: 1px;
}

.live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--breaking);
    flex: none;
    animation: pulse 2.4s ease-in-out infinite;
}

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

.brand-tag {
    color: var(--ink-3);
    font-size: 0.82rem;
    margin-top: 4px;
}

/* --- Cabecera ------------------------------------------------------------- */

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 14px var(--pad);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

.mainnav { display: flex; gap: 30px; justify-self: center; }

.mainnav a {
    position: relative;
    padding: 8px 2px;
    font-size: 0.94rem;
    font-weight: 500;
    color: var(--ink-3);
}
.mainnav a:hover { color: var(--ink); }

.mainnav a.is-active { color: var(--ink); font-weight: 600; }
.mainnav a.is-active::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: var(--breaking);
    border-radius: 2px;
}

.topbar-tools { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }

.langbox select {
    appearance: none;
    height: 40px;
    padding: 0 30px 0 14px;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    font: inherit; font-size: .88rem; font-weight: 500; color: var(--ink);
}
.card-title.is-translated, .story-title.is-translated, .gcard-title.is-translated { animation: fadein .35s ease; }
@keyframes fadein { from { opacity: .4; } to { opacity: 1; } }

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 40px;
    width: 230px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
}
.search:focus-within { border-color: var(--ink-3); }
.search svg { font-size: 1.05rem; color: var(--ink-3); flex: none; }
.search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.88rem;
    color: var(--ink);
    outline: none;
}
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--ink);
}
.icon-btn:hover { border-color: var(--ink-3); }
.icon-btn svg { font-size: 1.05rem; }

.icon-btn-square {
    padding: 9px;
    border-radius: var(--r-sm);
}
.icon-btn-square svg { fill: currentColor; stroke: none; }

/* --- Mapa ----------------------------------------------------------------- */

.hero { padding: 18px var(--pad) 0; }

.hero-inner {
    position: relative;
    max-width: var(--maxw);
    margin: 0 auto;
    height: 340px;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: #E8EEF5;
    border: 1px solid var(--line);
}

.hero.is-hidden { display: none; }

.map {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.leaflet-container {
    background: #DDE6F0;
    font: inherit;
}

.map.is-failed::after {
    content: "No se pudo cargar el mapa.";
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    color: var(--ink-3);
    font-size: 0.86rem;
}

/* Controles de Leaflet con el lenguaje visual del resto de la interfaz. */
.leaflet-control-zoom {
    border: 0 !important;
    border-radius: var(--r-sm) !important;
    overflow: hidden;
    box-shadow: var(--shadow-card) !important;
}

.leaflet-control-zoom a {
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    color: var(--ink-2) !important;
    background: var(--white) !important;
    border-bottom: 1px solid var(--line) !important;
    font-size: 1.05rem !important;
    font-weight: 500;
}
.leaflet-control-zoom a:last-child { border-bottom: 0 !important; }
.leaflet-control-zoom a:hover { background: #F4F6F9 !important; color: var(--ink) !important; }

.leaflet-control-attribution {
    background: rgba(255, 255, 255, .78) !important;
    color: var(--ink-3);
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px 0 0 0;
}
.leaflet-control-attribution a { color: var(--ink-2); }

.leaflet-popup-content-wrapper {
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-pop);
}
.leaflet-popup-content { margin: 11px 14px; font-size: 0.82rem; line-height: 1.45; }
.leaflet-popup-content strong { font-weight: 600; }
.leaflet-popup-content a { color: var(--breaking); font-weight: 500; }

/* Burbujas de país */
.cn-pin-wrap { background: none; border: 0; }

.cn-pin {
    display: grid;
    place-items: center;
    width: 100%; height: 100%;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    border: 2px solid rgba(255, 255, 255, .92);
    box-shadow: 0 2px 8px rgba(16, 20, 28, .22);
    transition: transform .16s ease;
}
.cn-pin-wrap:hover .cn-pin { transform: scale(1.12); }

.cn-pin-breaking   { background: var(--breaking); }
.cn-pin-developing { background: var(--developing); }
.cn-pin-updates    { background: var(--updates); color: #4A3B00; }
.cn-pin-quiet      { background: var(--quiet); }

.livepanel {
    position: absolute;
    top: 18px; left: 18px;
    z-index: 10;
    width: 292px;
    background: var(--white);
    border-radius: var(--r-md);
    padding: 16px 18px;
    box-shadow: var(--shadow-pop);
}

.livepanel-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--ink-2);
    margin-bottom: 10px;
}

.livepanel-count {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.livepanel-sub {
    color: var(--ink-3);
    font-size: 0.86rem;
    margin-top: 2px;
    margin-bottom: 14px;
}

.livepanel-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px 12px;
    font-size: 0.74rem;
    color: var(--ink-2);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-2);
}

.livepanel-legend li {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.livepanel-legend span[data-count] { font-weight: 600; color: var(--ink); }

.livepanel-countries {
    font-size: 0.8rem;
    color: var(--ink-3);
    padding: 11px 0;
    border-bottom: 1px solid var(--line-2);
}

.livepanel-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 11px;
    font-size: 0.86rem;
    font-weight: 500;
}
.livepanel-link svg { font-size: 0.95rem; color: var(--ink-3); }
.livepanel-link:hover svg { color: var(--ink); }

.maplegend {
    position: absolute;
    right: 18px; bottom: 18px;
    z-index: 10;
    background: var(--white);
    border-radius: var(--r-sm);
    padding: 10px 13px;
    box-shadow: var(--shadow-card);
    font-size: 0.76rem;
    color: var(--ink-2);
}
.maplegend li { display: flex; align-items: center; gap: 7px; padding: 2px 0; }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-breaking   { background: var(--breaking); }
.dot-developing { background: var(--developing); }
.dot-updates    { background: var(--updates); }
.dot-quiet      { background: var(--quiet); }

/* Burbujas del mapa */
.cn-pin {
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 600;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    border: 2px solid rgba(255, 255, 255, .9);
    box-shadow: 0 2px 8px rgba(16, 20, 28, .25);
    transition: transform .15s ease;
}
.cn-pin:hover { transform: scale(1.12); }

.cn-pin-breaking   { background: var(--breaking); }
.cn-pin-developing { background: var(--developing); }
.cn-pin-updates    { background: var(--updates); color: #4A3B00; }
.cn-pin-quiet      { background: var(--quiet); }

/* --- Filtros -------------------------------------------------------------- */

.filters { padding: 18px var(--pad) 0; }

.filters-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    font-size: 0.87rem;
    font-weight: 500;
    color: var(--ink-2);
    white-space: nowrap;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip svg { font-size: 0.95rem; fill: currentColor; stroke: none; }

.chip.is-on {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--white);
}

.chip-flag { font-size: 1rem; }
.chip-count {
    font-size: 0.76rem;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}
.chip.is-on .chip-count { color: rgba(255,255,255,.7); }

.filters-right { display: flex; align-items: center; gap: 10px; flex: none; }

.sortbox select {
    appearance: none;
    padding: 9px 34px 9px 15px;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    font-size: 0.87rem;
    font-weight: 500;
    color: var(--ink);
}

/* --- Rejilla de tarjetas -------------------------------------------------- */

.feed { padding: 18px var(--pad) 40px; }
.feed-inner { max-width: var(--maxw); margin: 0 auto; }

.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.grid.is-list { grid-template-columns: 1fr; }

.card {
    position: relative;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--ink);
    min-height: 230px;
    box-shadow: var(--shadow-card);
    isolation: isolate;
}

.card-tall { min-height: 296px; }

.card-link {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: inherit;
    padding: 12px;
    position: relative;
    z-index: 2;
}

.card-image {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
    transition: transform .4s ease;
}
.card:hover .card-image { transform: scale(1.04); }

/* Capas dentro de la tarjeta, de abajo arriba:
   imagen (0) → degradado (1) → texto (2). Todo dentro de .card-link para que
   compartan contexto de apilamiento y el orden sea el previsto. */
.card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(10, 12, 16, .45) 0%,
        rgba(10, 12, 16, .10) 32%,
        rgba(10, 12, 16, .62) 68%,
        rgba(10, 12, 16, .88) 100%
    );
}

.card-top, .card-body {
    position: relative;
    z-index: 2;
}

/* Sin foto: la tipografía y el color de la categoría sostienen la tarjeta. */
.card-flat { background: #232833; }
.card-flat .card-link::after {
    background:
        radial-gradient(120% 90% at 15% 0%, rgba(255,255,255,.10), transparent 60%),
        linear-gradient(160deg, var(--cat, #2C3340) 0%, #171B23 100%);
}

.cat-politica   { --cat: #34405C; }
.cat-negocios   { --cat: #1F4A42; }
.cat-tecnologia { --cat: #2E3A63; }
.cat-clima      { --cat: #1D4B57; }
.cat-deportes   { --cat: #35502C; }
.cat-ciencia    { --cat: #3F3663; }
.cat-cultura    { --cat: #5A3348; }
.cat-general    { --cat: #2C3340; }

.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.badge {
    padding: 3px 9px;
    border-radius: 5px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
}
.badge-breaking   { background: var(--breaking); }
.badge-developing { background: var(--developing); }
.badge-updates    { background: var(--updates); color: #4A3B00; }
.badge-quiet      { background: var(--quiet); }

.card-ago {
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .82);
    padding: 3px 7px;
    background: rgba(10, 12, 16, .35);
    border-radius: 5px;
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

.card-body { margin-top: auto; }

.card-place {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .88);
    margin-bottom: 5px;
}
.card-flag { font-size: 0.95rem; }

.card-title {
    color: #fff;
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.28;
    letter-spacing: -0.015em;
    text-shadow: 0 1px 12px rgba(0, 0, 0, .35);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tall .card-title { font-size: 1.1rem; }

.card-foot {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 11px;
}

.stack { display: flex; }

.avatar {
    width: 21px; height: 21px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.55rem;
    font-weight: 700;
    color: #fff;
    background: hsl(var(--hue, 210) 42% 42%);
    border: 1.5px solid rgba(255, 255, 255, .85);
    margin-left: -6px;
    flex: none;
}
.stack .avatar:first-child { margin-left: 0; }

.avatar-more {
    background: rgba(255, 255, 255, .22);
    backdrop-filter: blur(4px);
    font-size: 0.58rem;
}

.card-sources {
    font-size: 0.76rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .88);
}

.bookmark {
    position: absolute;
    right: 10px; bottom: 10px;
    z-index: 3;
    width: 28px; height: 28px;
    display: grid;
    place-items: center;
    background: none;
    border: 0;
    padding: 0;
    color: rgba(255, 255, 255, .78);
    border-radius: 6px;
}
.bookmark svg { width: 17px; height: 17px; stroke-width: 1.7; }
.bookmark:hover { color: #fff; background: rgba(255,255,255,.14); }
.bookmark.is-saved svg { fill: #fff; color: #fff; }

/* Vista de lista */
.grid.is-list .card {
    min-height: 0;
    background: var(--white);
    box-shadow: none;
    border: 1px solid var(--line);
}
.grid.is-list .card-image { display: none; }
.grid.is-list .card-link::after { display: none; }
.grid.is-list .card-link { flex-direction: row; align-items: center; gap: 16px; padding: 14px 16px; }
.grid.is-list .card-top { flex: none; width: 150px; flex-direction: column; align-items: flex-start; gap: 5px; }
.grid.is-list .card-body { margin-top: 0; flex: 1; }
.grid.is-list .card-title { color: var(--ink); text-shadow: none; -webkit-line-clamp: 2; font-size: 0.98rem; }
.grid.is-list .card-place { color: var(--ink-3); }
.grid.is-list .card-sources { color: var(--ink-3); }
.grid.is-list .card-ago { background: none; color: var(--ink-3); padding: 0; }
.grid.is-list .bookmark { color: var(--ink-3); position: static; }

/* --- Cargar más ----------------------------------------------------------- */

.loadmore-wrap { display: flex; flex-direction: column; align-items: center; margin-top: 26px; position: relative; }
.sentinel { width: 1px; height: 1px; }
/* Con scroll infinito el botón se oculta; reaparece solo si falla la carga. */
.loadmore.is-auto { position: absolute; opacity: 0; pointer-events: none; }

.loadmore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    font-size: 0.89rem;
    font-weight: 500;
    box-shadow: var(--shadow-card);
}
.loadmore:hover { border-color: var(--ink-3); }
.loadmore[disabled] { opacity: .55; cursor: default; }
.loadmore svg { font-size: 1rem; }

/* --- Vacío ---------------------------------------------------------------- */

.empty-state {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 44px 32px;
    text-align: center;
}
.empty-state h2 { font-size: 1.1rem; margin-bottom: 8px; }
.empty-state p { color: var(--ink-3); max-width: 44ch; margin: 0 auto 18px; }

.btn-plain {
    display: inline-block;
    padding: 9px 18px;
    background: var(--ink);
    color: #fff;
    border-radius: var(--r-pill);
    font-size: 0.88rem;
    font-weight: 500;
}

/* --- Adaptación ----------------------------------------------------------- */

@media (max-width: 1280px) {
    .grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1024px) {
    .grid { grid-template-columns: repeat(3, 1fr); }

    .topbar-inner { grid-template-columns: 1fr auto; row-gap: 12px; }
    .search { width: 170px; }
    .mainnav { grid-column: 1 / -1; justify-self: start; gap: 22px; overflow-x: auto; }
    .brand-tag { display: none; }
}

@media (max-width: 720px) {
    :root { --pad: 14px; }

    .grid { grid-template-columns: repeat(2, 1fr); }
    .card, .card-tall { min-height: 210px; }
    .card-title { font-size: 0.92rem; -webkit-line-clamp: 3; }
    .card-tall .card-title { font-size: 0.95rem; }


    .livepanel {
        position: static;
        width: auto;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid var(--line);
    }
    .hero-inner { display: flex; flex-direction: column; height: auto; }
    .map { position: relative; inset: auto; height: 250px; }
    .maplegend { display: none; }

    .filters-inner { flex-direction: column; align-items: stretch; }
    .chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .filters-right { justify-content: space-between; flex-wrap: wrap; }
    .topbar-tools { flex-wrap: wrap; }
    .search { width: 100%; }

    .grid.is-list .card-link { flex-direction: column; align-items: flex-start; }
    .grid.is-list .card-top { width: auto; flex-direction: row; }
}

@media (max-width: 420px) {
    .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}


/* --- Banderas SVG -------------------------------------------------------- */

.flag {
    display: inline-block;
    vertical-align: -2px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0,0,0,.08);
    margin-right: 6px;
    object-fit: cover;
}
.card-place .flag { vertical-align: -3px; }

/* --- Globo 3D (vista Mundo) --------------------------------------------- */

/* Vista Mundo: el globo ocupa toda la pantalla bajo la cabecera. */
.hero-globe { padding: 0; }
.hero-globe .hero-inner {
    max-width: none;
    height: calc(100vh - 82px);
    min-height: 520px;
    border-radius: 0;
    border: 0;
    background: radial-gradient(ellipse at 50% 40%, #F3F6FA 0%, #E6ECF4 60%, #DDE5EF 100%);
}
.hero-globe .livepanel { top: 22px; left: 24px; }
.hero-globe .maplegend { right: 24px; bottom: 22px; }
.globe { position: absolute; inset: 0; z-index: 1; cursor: grab; }
.globe:active { cursor: grabbing; }
.globe canvas { outline: none; }
.globe-hint {
    position: absolute;
    left: 50%; bottom: 14px;
    transform: translateX(-50%);
    z-index: 5;
    font-size: 0.74rem;
    color: var(--ink-3);
    background: rgba(255,255,255,.75);
    padding: 4px 10px;
    border-radius: var(--r-pill);
    pointer-events: none;
}
.globe.is-failed::after {
    content: "Tu navegador no puede mostrar el globo 3D.";
    position: absolute; inset: 0; display: grid; place-items: center;
    color: var(--ink-3); font-size: .9rem;
}
.globe-tip {
    background: var(--ink); color: #fff;
    padding: 7px 11px; border-radius: 8px;
    font: 500 .8rem/1.35 Inter, system-ui, sans-serif;
    box-shadow: var(--shadow-pop);
}
.globe-tip strong { display: block; font-weight: 600; }

/* --- Vistas agrupadas (Países / Temas) ---------------------------------- */

.group { margin-bottom: 30px; }
.group-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 14px; margin-bottom: 12px;
}
.group-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em;
}
.group-count {
    font-size: .8rem; font-weight: 600; color: var(--ink-3);
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--r-pill); padding: 2px 9px;
}
.group-more { font-size: .87rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.group-more:hover { color: var(--ink); }

@media (max-width: 720px) {
    .hero-globe .hero-inner { height: 420px; }
}


/* --- Fichas flotantes del globo ---------------------------------------- */

.gcard {
    display: block;
    width: 150px;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 22px rgba(16,20,28,.18), 0 0 0 1px rgba(16,20,28,.06);
    transform: translate(-50%, -100%) translateY(-10px);
    font-family: Inter, system-ui, sans-serif;
    color: var(--ink);
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}
.gcard:hover { transform: translate(-50%, -100%) translateY(-14px) scale(1.04); box-shadow: 0 10px 30px rgba(16,20,28,.24); z-index: 5; }
.gcard::after {
    content: ""; position: absolute; left: 50%; bottom: -7px;
    width: 12px; height: 12px; background: var(--white);
    transform: translateX(-50%) rotate(45deg);
    box-shadow: 2px 2px 3px rgba(16,20,28,.08);
}
.gcard-img { display: block; width: 100%; height: 74px; object-fit: cover; }
.gcard-flat .gcard-body { padding-top: 12px; }
.gcard-body { padding: 8px 10px 9px; position: relative; }
.gcard-head {
    display: flex; align-items: center; gap: 5px;
    font-size: .66rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
    color: var(--ink-3); margin-bottom: 4px;
}
.gcard-flag { width: 16px; height: 12px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.gcard-n {
    margin-left: auto; font-size: .64rem; padding: 1px 6px; border-radius: 9px;
    background: var(--updates); color: #4A3B00;
}
.status-breaking .gcard-n { background: var(--breaking); color: #fff; }
.status-developing .gcard-n { background: var(--developing); color: #fff; }
.status-quiet .gcard-n { background: var(--quiet); color: #fff; }
.gcard-title {
    font-size: .8rem; font-weight: 600; line-height: 1.28; letter-spacing: -.01em;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.gcard-meta { margin-top: 5px; font-size: .68rem; color: var(--ink-3); }

@media (max-width: 720px) {
    .hero-globe .hero-inner { height: calc(100vh - 120px); min-height: 420px; }
    .gcard { width: 140px; }
    .gcard-img { height: 70px; }
}


/* --- Fichas de país / tema --------------------------------------------- */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 26px;
}
.tile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    font: inherit;
    text-align: left;
    color: var(--ink);
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); border-color: var(--ink-3); }
.tile.is-on { border-color: var(--ink); background: var(--ink); color: #fff; }
.tile .flag { width: 30px; height: 22px; margin: 0; flex: none; border-radius: 3px; }
.tile-icon {
    flex: none; width: 30px; height: 30px; border-radius: 8px;
    display: grid; place-items: center;
    background: var(--line-2); font-weight: 700; font-size: .95rem; color: var(--ink-2);
}
.tile.is-on .tile-icon { background: rgba(255,255,255,.18); color: #fff; }
.tile-name { flex: 1; min-width: 0; font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-count { font-size: .76rem; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tile.is-on .tile-count { color: rgba(255,255,255,.75); }
.tile-breaking .tile-count { color: var(--breaking); }
.tile-developing .tile-count { color: var(--developing); }

.drill { margin-top: 6px; }
.drill-loading { color: var(--ink-3); padding: 20px 0; text-align: center; }

/* --- Detalle de historia ------------------------------------------------ */

body.has-overlay { overflow: hidden; }

.story-overlay { position: fixed; inset: 0; z-index: 100; }
.story-backdrop { position: absolute; inset: 0; background: rgba(16,20,28,.55); backdrop-filter: blur(2px); }
.story-panel {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: min(720px, 100%);
    background: var(--canvas);
    box-shadow: -12px 0 40px rgba(16,20,28,.25);
    display: flex; flex-direction: column;
    animation: slidein .22s ease;
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.story-close {
    position: absolute; top: 14px; right: 14px; z-index: 2;
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--line); background: var(--white);
    font-size: .95rem; color: var(--ink-2); cursor: pointer;
}
.story-close:hover { color: var(--ink); border-color: var(--ink-3); }
.story-body { overflow-y: auto; padding: 22px 26px 40px; }

.story-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-3); margin-bottom: 10px; padding-right: 48px; }
.story-cat { padding: 2px 8px; border: 1px solid var(--line); border-radius: var(--r-pill); font-size: .74rem; background: var(--white); }
.story-title { font-size: 1.35rem; font-weight: 700; line-height: 1.25; letter-spacing: -.02em; margin-bottom: 14px; padding-right: 30px; }
.story-hero { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--r-md); margin-bottom: 18px; }
.story-h3 { font-size: .95rem; font-weight: 600; margin: 18px 0 10px; }

.src-list { display: flex; flex-direction: column; gap: 8px; }
.src {
    display: flex; gap: 12px; align-items: flex-start;
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--r-sm); padding: 11px 13px;
}
.src .avatar { width: 30px; height: 30px; font-size: .7rem; margin: 0; border-color: var(--line); }
.src-body { min-width: 0; flex: 1; }
.src-pub { font-size: .76rem; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; }
.src-ago { font-weight: 400; color: var(--ink-3); }
.src-title { display: block; font-size: .9rem; font-weight: 500; color: var(--ink); line-height: 1.35; }
.src-title:hover { text-decoration: underline; }

.grid-related { grid-template-columns: repeat(3, 1fr); }
.grid-related .card { min-height: 190px; }
.grid-related .card-title { font-size: .88rem; -webkit-line-clamp: 3; }

@media (max-width: 720px) {
    .story-body { padding: 18px 16px 40px; }
    .grid-related { grid-template-columns: repeat(2, 1fr); }
    .tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}


/* --- Análisis con IA en el detalle -------------------------------------- */

.ai-block {
    background: var(--white);
    border: 1px solid var(--line);
    border-left: 3px solid var(--signal, #0C6157);
    border-radius: var(--r-md);
    padding: 14px 18px 12px;
    margin: 6px 0 14px;
}
.ai-loading { color: var(--ink-3); font-size: .88rem; display: flex; align-items: center; gap: 8px; }
.ai-loading::after {
    content: ""; width: 12px; height: 12px; border-radius: 50%;
    border: 2px solid var(--line); border-top-color: var(--ink-3);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-block .story-h3 { margin: 0 0 6px; display: flex; align-items: center; gap: 7px; }
.ai-block .story-h3 + .ai-summary + .story-h3 { margin-top: 16px; }
.ai-tag {
    font-size: .6rem; font-weight: 800; letter-spacing: .06em;
    padding: 2px 6px; border-radius: 4px;
    background: #0C6157; color: #fff;
}
.ai-summary { font-size: .92rem; line-height: 1.55; color: var(--ink-2); margin: 0 0 6px; }
.ai-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.ai-col { border-radius: var(--r-sm); padding: 10px 12px; }
.ai-agree { background: #EEF6F2; }
.ai-differ { background: #FDF2E7; }
.ai-col h4 { margin: 0 0 6px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ai-agree h4 { color: #16744A; }
.ai-differ h4 { color: #B26A00; }
.ai-col ul { margin: 0; padding-left: 16px; font-size: .84rem; line-height: 1.45; color: var(--ink-2); }
.ai-col li { margin-bottom: 3px; }
.ai-note { margin: 10px 0 0; font-size: .74rem; color: var(--ink-3); }
@media (max-width: 720px) { .ai-cols { grid-template-columns: 1fr; } }


/* --- Vídeos en el detalle ------------------------------------------------ */

.videos { display: flex; flex-direction: column; gap: 8px; }
.video {
    display: flex; gap: 12px; align-items: center;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm);
    padding: 8px; color: var(--ink);
}
.video:hover { border-color: var(--ink-3); }
.video-thumb { position: relative; flex: none; width: 128px; height: 72px; border-radius: 6px; overflow: hidden; background: #000; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-play {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 34px; height: 34px; border-radius: 50%; background: rgba(229,52,42,.95); color: #fff;
    display: grid; place-items: center; font-size: .8rem; padding-left: 3px;
}
.video-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.video-title { font-size: .88rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { font-size: .76rem; color: var(--ink-3); }
.video-frame { aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; background: #000; }
.video-frame iframe { width: 100%; height: 100%; border: 0; }


/* --- Vista Vídeo: canal continuo ----------------------------------------- */

.tv { padding: 18px var(--pad) 0; }
.tv-inner {
    max-width: var(--maxw); margin: 0 auto;
    display: grid; grid-template-columns: 1fr 340px;
    border-radius: var(--r-lg); overflow: hidden;
    background: #0F1116; border: 1px solid #1C1F27;
}
.tv-player { position: relative; aspect-ratio: 16 / 9; background: #000; }
.tv-player iframe, .tv-player #ytFrame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tv-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: #AEB6C4; padding: 24px; }
.tv-empty p { margin: 0 0 6px; }
.tv-unmute {
    position: absolute; left: 14px; bottom: 14px; z-index: 3;
    padding: 8px 14px; border-radius: var(--r-pill); border: 0;
    background: rgba(255,255,255,.92); color: var(--ink); font: 600 .84rem Inter, sans-serif; cursor: pointer;
}
.tv-side { display: flex; flex-direction: column; min-height: 0; color: #E6EAF0; }
.tv-head {
    display: flex; align-items: center; gap: 7px; padding: 14px 16px 6px;
    font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #AEB6C4;
}
.tv-now { padding: 0 16px; font-size: .98rem; font-weight: 600; line-height: 1.3; }
.tv-now-meta { padding: 3px 16px 12px; font-size: .76rem; color: #8C95A6; border-bottom: 1px solid #1C1F27; }
.tv-list { overflow-y: auto; flex: 1; padding: 6px 0; max-height: 420px; }
.tv-item {
    display: flex; gap: 10px; padding: 8px 16px; cursor: pointer; align-items: center;
}
.tv-item:hover { background: #171A22; }
.tv-item.is-now { background: #1F2430; box-shadow: inset 3px 0 0 var(--breaking); }
.tv-item img { width: 76px; height: 43px; object-fit: cover; border-radius: 4px; flex: none; }
.tv-item > span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tv-item-title { font-size: .8rem; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tv-item-meta { font-size: .7rem; color: #8C95A6; display: flex; align-items: center; gap: 4px; }
.tv-item-meta .flag { margin-right: 2px; }

.vgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.vcard { display: flex; flex-direction: column; gap: 8px; color: var(--ink); }
.vcard-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; background: #000; box-shadow: var(--shadow-card); }
.vcard-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.vcard:hover .vcard-thumb img { transform: scale(1.04); }
.vcard-ago { position: absolute; right: 8px; bottom: 8px; font-size: .7rem; font-weight: 600; color: #fff; background: rgba(0,0,0,.7); padding: 2px 6px; border-radius: 4px; }
.vcard-title { font-size: .92rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard-meta { font-size: .78rem; color: var(--ink-3); display: flex; align-items: center; gap: 4px; }

@media (max-width: 1024px) { .vgrid { grid-template-columns: repeat(3, 1fr); } .tv-inner { grid-template-columns: 1fr 280px; } }
@media (max-width: 720px) {
    .tv-inner { grid-template-columns: 1fr; }
    .tv-list { max-height: 260px; }
    .vgrid { grid-template-columns: repeat(2, 1fr); }
}


/* --- TV en vivo ---------------------------------------------------------- */

.tv-player video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.live-status {
    position: absolute; left: 14px; top: 14px; z-index: 3;
    padding: 6px 12px; border-radius: var(--r-pill);
    background: rgba(0,0,0,.65); color: #fff; font-size: .78rem;
}
.live-logo { width: 44px; height: 30px; object-fit: contain; flex: none; background: #fff; border-radius: 4px; padding: 2px; }
.live-geo { font-style: normal; font-size: .62rem; color: #F5921E; font-weight: 700; margin-left: 4px; }

.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.lcard {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 14px 10px; background: var(--white); border: 1px solid var(--line);
    border-radius: var(--r-md); cursor: pointer; font: inherit; color: var(--ink);
    box-shadow: var(--shadow-card); transition: transform .12s ease, border-color .12s ease;
}
.lcard:hover { transform: translateY(-2px); border-color: var(--ink-3); }
.lcard-logo { width: 100%; height: 44px; display: grid; place-items: center; }
.lcard-logo img { max-width: 90px; max-height: 44px; object-fit: contain; }
.lcard-name { font-size: .84rem; font-weight: 600; text-align: center; line-height: 1.25; }
.lcard-meta { font-size: .72rem; color: var(--ink-3); display: flex; align-items: center; gap: 3px; }


/* --- Temas por cobertura ------------------------------------------------- */

.topics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    margin-bottom: 26px;
}
.topic {
    display: flex; flex-direction: column;
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--r-md); overflow: hidden;
    font: inherit; text-align: left; color: var(--ink); cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.topic:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); border-color: var(--ink-3); }
.topic.is-on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }

/* Los tres primeros ocupan más y llevan foto */
.topic-lead { grid-column: span 2; }
.topic-img { display: block; height: 160px; background: var(--line-2); }
.topic-img img { width: 100%; height: 100%; object-fit: cover; }
.topic.no-img .topic-img { display: none; }

.topic-body { padding: 12px 14px 13px; display: flex; flex-direction: column; gap: 6px; }
.topic-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.topic-cat {
    font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--ink-3); background: var(--line-2); padding: 2px 7px; border-radius: 4px;
}
.topic-name {
    font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2;
    text-transform: capitalize;
}
.topic-lead .topic-name { font-size: 1.25rem; }
.topic-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); }
.topic-sources strong { font-size: 1.02rem; font-weight: 700; color: var(--ink); }
.topic-meta { font-size: .74rem; color: var(--ink-3); display: flex; align-items: center; gap: 3px; }

/* La barra de color del estado, a la izquierda */
.topic.status-breaking   { border-left: 3px solid var(--breaking); }
.topic.status-developing { border-left: 3px solid var(--developing); }
.topic.status-updates    { border-left: 3px solid var(--updates); }
.topic.status-quiet      { border-left: 3px solid var(--quiet); }

@media (max-width: 720px) {
    .topics { grid-template-columns: 1fr 1fr; }
    .topic-lead { grid-column: span 2; }
    .topic-name { font-size: .95rem; }
}


/* --- Temas: contenido de la tarjeta -------------------------------------- */

.topic { cursor: default; }
.topic-name { text-transform: none; }
.trend { font-size: .66rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; letter-spacing: .02em; }
.trend-up   { background: #EEF6F2; color: #16744A; }
.trend-new  { background: #EEF2FD; color: #2E4FB5; }
.trend-down { background: var(--line-2); color: var(--ink-3); }

.topic-headline {
    display: block; margin-top: 4px;
    font-size: .95rem; font-weight: 600; line-height: 1.3; color: var(--ink);
}
.topic-lead .topic-headline-lead { font-size: 1.05rem; }
.topic-headline:hover { text-decoration: underline; }
.topic-pub {
    display: inline-flex; align-items: center; gap: 3px;
    margin-left: 6px; font-size: .72rem; font-weight: 500; color: var(--ink-3); white-space: nowrap;
}
.topic-pub .flag { margin-right: 1px; }
.topic-list { margin: 6px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line-2); }
.topic-list li { padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: .86rem; line-height: 1.3; }
.topic-list li:last-child { border-bottom: 0; }
.topic-list a { color: var(--ink-2); }
.topic-list a:hover { color: var(--ink); text-decoration: underline; }
.topic-all {
    align-self: flex-start; margin-top: 8px; padding: 0;
    background: none; border: 0; font: inherit; font-size: .82rem; font-weight: 600;
    color: var(--breaking); cursor: pointer;
}
.topic-all:hover { text-decoration: underline; }


/* --- Tendencias ---------------------------------------------------------- */

.tsrc { font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; color: #fff; }
.tsrc-google { background: #4285F4; } .tsrc-reddit { background: #FF4500; } .tsrc-wikipedia { background: #333; }
.tsrc-bluesky { background: #1185FE; } .tsrc-mastodon { background: #6364FF; }

.trend-group { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; }
.trend-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 28px; }
.trend { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); break-inside: avoid; }
.trend:last-child { border-bottom: 0; }
.trend-rank { flex: none; width: 24px; font-size: .8rem; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; padding-top: 2px; }
.trend-body { min-width: 0; flex: 1; }
.trend-title { font-size: .95rem; font-weight: 600; line-height: 1.3; }
.trend-title a:hover { text-decoration: underline; }
.trend-extra { font-size: .74rem; color: var(--ink-3); margin-top: 2px; }
.trend-stories { list-style: none; margin: 6px 0 0; padding: 6px 0 0 10px; border-left: 2px solid var(--signal, #0C6157); }
.trend-stories li { font-size: .82rem; line-height: 1.3; padding: 2px 0; }
.trend-story { color: var(--ink-2); display: inline; }
.trend-story:hover { color: var(--ink); text-decoration: underline; }
.trend-src { margin-left: 6px; font-size: .7rem; font-weight: 700; color: #0C6157; white-space: nowrap; }
.trend-none { margin-top: 5px; font-size: .74rem; color: var(--ink-3); font-style: italic; }
@media (max-width: 900px) { .trend-list { columns: 1; } }


/* --- Mundo: modos y ficha de país --------------------------------------- */

.globe-modes { position: absolute; top: 22px; right: 24px; z-index: 12; display: flex; gap: 6px; }
.globe-modes .chip { font-size: .78rem; padding: 6px 12px; }

.gpanel {
    position: absolute; top: 22px; left: 24px; bottom: 22px; z-index: 15;
    width: 360px; max-width: calc(100% - 48px);
    background: var(--white); border-radius: var(--r-md); box-shadow: var(--shadow-pop);
    overflow-y: auto; padding: 18px 18px 20px;
    animation: slidein .22s ease;
}
.hero-globe .livepanel { transition: opacity .2s; }
.gpanel:not([hidden]) ~ .livepanel, .gpanel:not([hidden]) + * .livepanel { opacity: 0; pointer-events: none; }
.gp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding-right: 36px; }
.gp-head h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; }
.gp-act { font-size: .82rem; color: var(--ink-2); background: var(--line-2); padding: 7px 10px; border-radius: 6px; margin-bottom: 10px; }
.gp-act.gp-hot { background: #FDF1F0; color: #A81E14; }
.gp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: .78rem; color: var(--ink-3); margin-bottom: 12px; }
.gp-stats strong { color: var(--ink); font-size: .95rem; }
.gp-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gp-story { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); }
.gp-story img, .gp-noimg { width: 64px; height: 46px; border-radius: 5px; object-fit: cover; flex: none; background: var(--line-2); }
.gp-story > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gp-title { font-size: .84rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gp-story:hover .gp-title { text-decoration: underline; }
.gp-meta { font-size: .72rem; color: var(--ink-3); }
@media (max-width: 720px) { .gpanel { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-width: none; max-height: 60%; border-radius: var(--r-md) var(--r-md) 0 0; } .globe-modes { top: 12px; right: 12px; } }


/* ==========================================================================
   Móvil y PWA
   ========================================================================== */

/* Barra inferior de pestañas (solo en pantallas pequeñas) */
.tabbar {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, 1fr);
}
.tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px; min-height: 48px;
    font: 500 .66rem/1 Inter, system-ui, sans-serif; color: var(--ink-3);
    background: none; border: 0; text-decoration: none;
}
.tabbar svg { width: 22px; height: 22px; stroke-width: 1.9; }
.tabbar .is-on { color: var(--breaking); }
.tabbar .is-on svg { stroke: var(--breaking); }

/* Hoja "Más" */
.sheet { position: fixed; inset: 0; z-index: 90; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(16,20,28,.45); }
.sheet-panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: var(--white); border-radius: 18px 18px 0 0;
    padding: 8px 12px calc(16px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 30px rgba(16,20,28,.2);
    animation: sheetin .22s ease;
}
@keyframes sheetin { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 6px auto 12px; }
.sheet-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 10px; font-size: 1rem; font-weight: 500; color: var(--ink);
    border-bottom: 1px solid var(--line-2);
}
.sheet-item:last-child { border-bottom: 0; }
.sheet-item svg { width: 22px; height: 22px; color: var(--ink-2); }

/* Aviso de instalación */
.install-banner {
    position: fixed; left: 12px; right: 12px; z-index: 70;
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex; align-items: center; gap: 12px;
    background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 14px;
    box-shadow: var(--shadow-pop);
}
.install-banner img { border-radius: 10px; flex: none; }
.install-banner div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: .82rem; }
.install-banner div span { color: rgba(255,255,255,.7); font-size: .74rem; }
.install-banner .btn-plain { background: #fff; color: var(--ink); padding: 8px 14px; flex: none; }
.install-x { background: none; border: 0; color: rgba(255,255,255,.7); font-size: .9rem; padding: 6px; cursor: pointer; }

/* Guía iOS */
.ios-guide { max-width: 440px; left: auto; }
.ios-steps { list-style: none; margin: 16px 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ios-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; line-height: 1.45; }
.ios-steps li span { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.ios-steps em { display: block; font-style: normal; color: var(--ink-3); font-size: .84rem; }

/* Toast */
.toast {
    position: fixed; left: 50%; transform: translate(-50%, 20px); opacity: 0;
    bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 95;
    display: flex; align-items: center; gap: 14px;
    background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px;
    font-size: .86rem; box-shadow: var(--shadow-pop); transition: .25s;
    max-width: calc(100% - 24px);
}
.toast.is-in { transform: translate(-50%, 0); opacity: 1; }
.toast button { background: var(--breaking); color: #fff; border: 0; border-radius: 8px; padding: 7px 12px; font: 600 .82rem Inter, sans-serif; cursor: pointer; }

.install-btn { display: none; }
@media (min-width: 1025px) { .install-btn:not([hidden]) { display: inline-flex; } }

/* Como app instalada: sin barra del navegador, más aire arriba en iOS */
.is-standalone .topbar { padding-top: env(safe-area-inset-top); }

/* ---- Teléfonos ---------------------------------------------------------- */
@media (max-width: 720px) {
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    .tabbar { display: grid; }

    /* Cabecera compacta: marca + idioma; el menú vive en la barra inferior */
    .topbar-inner { grid-template-columns: 1fr auto; row-gap: 0; padding: 10px 14px; }
    .mainnav { display: none; }
    .brand-tag { display: none; }
    .wordmark { font-size: 1.4rem; }
    .topbar-tools { gap: 8px; flex-wrap: nowrap; }
    .search { display: none; width: 100%; }
    .topbar.show-search .search { display: flex; }
    .topbar.show-search .topbar-inner { grid-template-columns: 1fr; row-gap: 10px; }
    #toggleMap { display: none; }
    .langbox select { height: 36px; padding: 0 26px 0 12px; font-size: .84rem; }

    /* Mapa más bajo, panel en vivo compacto */
    .hero { padding: 10px 10px 0; }
    .hero-inner { height: auto; min-height: 0; }
    .map { height: 220px; }
    .livepanel { padding: 12px 14px; }
    .livepanel-count { font-size: 2rem; }
    .livepanel-legend { font-size: .7rem; }
    .livepanel-link, .livepanel-countries { display: none; }

    /* Filtros: una fila deslizable, sin envolver */
    .filters { padding: 10px 0 0; }
    .filters-inner { flex-direction: row; overflow-x: auto; gap: 8px; padding: 0 14px 6px; scrollbar-width: none; }
    .filters-inner::-webkit-scrollbar { display: none; }
    .chips { flex-wrap: nowrap; }
    .chip { padding: 8px 13px; font-size: .84rem; }
    .filters-right { flex: none; }
    #toggleDensity { display: none; }

    /* Tarjetas: una columna, foto grande, tipografía legible */
    .feed { padding: 12px 12px 30px; }
    .grid { grid-template-columns: 1fr; gap: 12px; }
    .card, .card-tall { min-height: 250px; }
    .card-title { font-size: 1.08rem; -webkit-line-clamp: 3; }
    .card-link { padding: 14px; }
    .bookmark { width: 40px; height: 40px; }

    /* Detalle a pantalla completa */
    .story-panel { width: 100%; }
    .story-body { padding: 16px 16px calc(40px + env(safe-area-inset-bottom)); }
    .story-close { top: 10px; right: 10px; }

    /* Temas, tendencias, vídeo, TV */
    .topics { grid-template-columns: 1fr; }
    .topic-lead { grid-column: auto; }
    .trend-group { padding: 12px; }
    .tv { padding: 10px 10px 0; }
    .tv-inner { grid-template-columns: 1fr; }
    .tv-list { max-height: 240px; }
    .vgrid { grid-template-columns: 1fr; }
    .lgrid { grid-template-columns: repeat(2, 1fr); }
    .tiles { grid-template-columns: 1fr 1fr; }

    /* Globo */
    .hero-globe { padding: 0; }
    .hero-globe .hero-inner { height: calc(100vh - 140px); }
    .globe-modes { top: 10px; right: 10px; flex-direction: column; }
    .globe-modes .chip { font-size: .72rem; padding: 5px 10px; }
    .hero-globe .livepanel { top: 10px; left: 10px; width: 200px; }
}

@media (max-width: 400px) {
    .wordmark { font-size: 1.25rem; }
    .live { display: none; }
}
