/* Hoyo hoy · hoja de estilos del panel editorial atmosférico
   Rejilla de 12 columnas, cristal esmerilado adaptativo en 2 polaridades
   (claro / oscuro), barra lateral plegable y tipografía tabular. */

:root,
html[data-tono="claro"] {
    --bg-page: #8BBCE5;
    --bg-subtle: rgba(15, 23, 42, 0.048);
    --bg-hover: rgba(15, 23, 42, 0.072);

    --glass-surface: rgba(252, 253, 255, 0.66);
    --glass-sidebar: rgba(252, 253, 255, 0.76);
    --glass-tabbar: rgba(252, 253, 255, 0.80);
    --glass-modal: rgba(252, 253, 255, 0.90);
    --glass-fallback-surface: rgba(252, 253, 255, 0.93);
    --glass-fallback-sidebar: rgba(252, 253, 255, 0.96);
    --glass-fallback-tabbar: rgba(252, 253, 255, 0.96);
    --glass-border: rgba(255, 255, 255, 0.64);
    --glass-highlight: rgba(255, 255, 255, 0.74);
    --tile-border: rgba(15, 23, 42, 0.065);

    --text-primary: #0F172A;
    --text-secondary: #2B394C;
    --text-muted: #475569;

    --canvas-text-primary: #0B1424;
    --canvas-text-secondary: #1E293B;
    --canvas-text-muted: #293548;
    --canvas-text-shadow: 0 1px 14px rgba(255, 255, 255, 0.68);

    --border: rgba(15, 23, 42, 0.095);
    --border-strong: rgba(15, 23, 42, 0.17);

    --accent: #1B5AA8;
    --accent-text: var(--accent);
    --accent-soft: rgba(27, 90, 168, 0.12);
    --atmo-badge-bg: var(--accent-soft);

    --brand-bg: #0F172A;
    --brand-fg: #FFFFFF;
    --btn-primary-bg: #0F172A;
    --btn-primary-fg: #FFFFFF;
    --seg-active-bg: #0F172A;
    --seg-active-fg: #FFFFFF;
    --bar-neutral: rgba(15, 23, 42, 0.17);
    --scrim-bg: rgba(15, 23, 42, 0.36);
    --legend-dot-ring: rgba(15, 23, 42, 0.14);

    --popup-bg: rgba(252, 253, 255, 0.96);
    --popup-border: rgba(15, 23, 42, 0.12);

    --pin-bg: #FFFFFF;
    --pin-fg: #0F172A;
    --pin-border: #94A3B8;
    --pin-cheap-bg: #EAF7EF;
    --pin-cheap-fg: #166534;
    --pin-cheap-border: #166534;
    --pin-hoyo-bg: #EBF3FD;
    --pin-hoyo-fg: #1B5AA8;
    --pin-hoyo-border: #1B5AA8;

    --ok: #166534;
    --ok-bg: rgba(22, 163, 74, 0.13);
    --ok-border: rgba(22, 163, 74, 0.22);
    --warning: #854D0E;
    --warning-bg: rgba(217, 119, 6, 0.15);
    --warning-border: rgba(217, 119, 6, 0.25);
    --danger: #B91C1C;
    --danger-bg: rgba(220, 38, 38, 0.13);
    --danger-border: rgba(220, 38, 38, 0.22);
    --info: #334155;
    --info-bg: rgba(71, 85, 105, 0.12);
    --info-border: rgba(71, 85, 105, 0.18);

    --radius-card: 16px;
    --radius-tile: 10px;
    --radius-chip: 999px;

    --shadow-card: 0 8px 28px rgba(15, 28, 46, 0.08), inset 0 1px 0 var(--glass-highlight);
    --shadow-chip: 0 4px 14px rgba(15, 28, 46, 0.08);
    --shadow-modal: 0 20px 52px rgba(15, 28, 46, 0.18), inset 0 1px 0 var(--glass-highlight);
    --shadow-popup: 0 8px 24px rgba(15, 28, 46, 0.16);
    --shadow-pin: 0 1px 4px rgba(15, 23, 42, 0.22);

    --font-sans: Inter, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --atmo-trans: none;
}

/* Activar transiciones suaves solo después del primer pintado para evitar parpadeos */
html:not(.atmo-animar) *,
html:not(.atmo-animar) *::before,
html:not(.atmo-animar) *::after {
    transition: none !important;
}

html.atmo-animar {
    --atmo-trans: background-color 650ms ease, color 650ms ease, border-color 650ms ease, box-shadow 650ms ease;
}

/* Polaridad oscura: cristal ahumado profundo (lluvia, tormenta, alba, atardecer, noche) */
html[data-tono="oscuro"] {
    --bg-page: #0F1B26;
    --bg-subtle: rgba(255, 255, 255, 0.06);
    --bg-hover: rgba(255, 255, 255, 0.105);

    --glass-surface: rgba(12, 20, 28, 0.58);
    --glass-sidebar: rgba(10, 18, 26, 0.68);
    --glass-tabbar: rgba(10, 18, 26, 0.76);
    --glass-modal: rgba(13, 21, 30, 0.86);
    --glass-fallback-surface: rgba(13, 21, 29, 0.92);
    --glass-fallback-sidebar: rgba(10, 17, 24, 0.95);
    --glass-fallback-tabbar: rgba(10, 17, 24, 0.96);
    --glass-border: rgba(255, 255, 255, 0.13);
    --glass-highlight: rgba(255, 255, 255, 0.14);
    --tile-border: rgba(255, 255, 255, 0.085);

    --text-primary: #F3F6F8;
    --text-secondary: #D0DBE2;
    --text-muted: #B2C2CC;

    --canvas-text-primary: #F6F9FB;
    --canvas-text-secondary: #D4DFE6;
    --canvas-text-muted: #B2C2CC;
    --canvas-text-shadow: 0 1px 16px rgba(4, 10, 18, 0.62);

    --border: rgba(255, 255, 255, 0.11);
    --border-strong: rgba(255, 255, 255, 0.21);

    --accent: #88B8EC;
    --accent-text: var(--accent);
    --accent-soft: rgba(136, 184, 236, 0.16);
    --atmo-badge-bg: rgba(8, 16, 26, 0.38);

    --brand-bg: var(--accent);
    --brand-fg: #0A131A;
    --btn-primary-bg: var(--accent);
    --btn-primary-fg: #0A131A;
    --seg-active-bg: var(--accent);
    --seg-active-fg: #0A131A;
    --bar-neutral: rgba(255, 255, 255, 0.22);
    --scrim-bg: rgba(4, 9, 16, 0.60);
    --legend-dot-ring: rgba(255, 255, 255, 0.36);

    --popup-bg: rgba(14, 23, 32, 0.94);
    --popup-border: rgba(255, 255, 255, 0.16);

    --ok: #6EE7B7;
    --ok-bg: rgba(16, 185, 129, 0.18);
    --ok-border: rgba(110, 231, 183, 0.28);
    --warning: #FCD34D;
    --warning-bg: rgba(245, 158, 11, 0.20);
    --warning-border: rgba(252, 211, 77, 0.30);
    --danger: #FCA5A5;
    --danger-bg: rgba(239, 68, 68, 0.20);
    --danger-border: rgba(252, 165, 165, 0.30);
    --info: #CBD5E1;
    --info-bg: rgba(148, 163, 184, 0.18);
    --info-border: rgba(203, 213, 225, 0.24);

    --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.26), inset 0 1px 0 var(--glass-highlight);
    --shadow-chip: 0 4px 14px rgba(0, 0, 0, 0.24);
    --shadow-modal: 0 24px 56px rgba(0, 0, 0, 0.44), inset 0 1px 0 var(--glass-highlight);
    --shadow-popup: 0 10px 28px rgba(0, 0, 0, 0.38);
    --shadow-pin: 0 2px 6px rgba(0, 0, 0, 0.32);
}

/* Acentos y matices de cristal armonizados por clima y fase solar */
html[data-tono="claro"][data-clima="clear"] {
    --accent: #1B5AA8;
    --accent-soft: rgba(27, 90, 168, 0.12);
}

html[data-tono="claro"][data-clima="partly-cloudy"] {
    --accent: #24558A;
    --accent-soft: rgba(36, 85, 138, 0.12);
}

html[data-tono="claro"][data-clima="overcast"] {
    --accent: #2E5673;
    --accent-soft: rgba(46, 86, 115, 0.12);
}

html[data-tono="claro"][data-clima="fog"] {
    --accent: #27635E;
    --accent-soft: rgba(39, 99, 94, 0.12);
}

html[data-tono="claro"][data-clima="snow"] {
    --accent: #1E5B8C;
    --accent-soft: rgba(30, 91, 140, 0.12);
}

html[data-tono="oscuro"][data-clima="rain"] {
    --bg-page: #142124;
    --glass-surface: rgba(14, 24, 26, 0.58);
    --glass-sidebar: rgba(11, 20, 22, 0.68);
    --glass-tabbar: rgba(11, 20, 22, 0.78);
    --glass-modal: rgba(14, 24, 26, 0.88);
    --accent: #96B5AF;
    --accent-soft: rgba(150, 181, 175, 0.16);
}

html[data-tono="oscuro"][data-clima="storm"] {
    --bg-page: #111A24;
    --glass-surface: rgba(11, 18, 26, 0.60);
    --glass-sidebar: rgba(9, 15, 22, 0.70);
    --glass-tabbar: rgba(9, 15, 22, 0.80);
    --accent: #84B7CC;
    --accent-soft: rgba(132, 183, 204, 0.17);
}

html[data-tono="oscuro"][data-fase="dawn"]:not([data-clima="rain"]):not([data-clima="storm"]) {
    --bg-page: #1C2A45;
    --glass-surface: rgba(14, 21, 36, 0.68);
    --glass-sidebar: rgba(11, 17, 30, 0.74);
    --accent: #E9A065;
    --accent-text: #FFD4A3;
    --accent-soft: rgba(255, 212, 163, 0.22);
    --atmo-badge-bg: rgba(12, 18, 32, 0.48);
}

html[data-tono="oscuro"][data-fase="sunset"]:not([data-clima="rain"]):not([data-clima="storm"]),
html[data-tono="oscuro"][data-fase="dusk"]:not([data-clima="rain"]):not([data-clima="storm"]) {
    --bg-page: #0F2132;
    --glass-surface: rgba(10, 20, 31, 0.68);
    --glass-sidebar: rgba(8, 17, 27, 0.74);
    --glass-tabbar: rgba(8, 17, 27, 0.82);
    --accent: #E68834;
    --accent-text: #FFC682;
    --accent-soft: rgba(255, 198, 130, 0.22);
    --atmo-badge-bg: rgba(9, 18, 28, 0.48);
}

html[data-tono="oscuro"][data-fase="night"][data-clima="clear"],
html[data-tono="oscuro"][data-fase="night"][data-clima="partly-cloudy"] {
    --bg-page: #08111F;
    --glass-surface: rgba(9, 15, 25, 0.62);
    --glass-sidebar: rgba(7, 12, 22, 0.72);
    --accent: #88B8EC;
    --accent-soft: rgba(136, 184, 236, 0.16);
}

html[data-tono="oscuro"][data-fase="night"][data-clima="overcast"],
html[data-tono="oscuro"][data-fase="night"][data-clima="fog"],
html[data-tono="oscuro"][data-fase="night"][data-clima="snow"] {
    --bg-page: #0C1520;
    --glass-surface: rgba(11, 18, 27, 0.60);
    --glass-sidebar: rgba(9, 15, 23, 0.70);
    --accent: #9DBEE0;
    --accent-soft: rgba(157, 190, 224, 0.16);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    background: var(--bg-page);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

html.atmo-animar body {
    transition: color 650ms ease, background-color 650ms ease;
}

/* ------------------------------------------------------------------
   Capa de fondo atmosférico (pintado instantáneo CSS + lienzo WebGL)
   ------------------------------------------------------------------ */

.atmosfera-fondo {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: linear-gradient(180deg, #6298CE 0%, #A4CCEE 52%, #E4EFF9 100%);
}

html[data-tono="claro"] .atmosfera-fondo::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(244, 249, 255, 0.60) 0%,
        rgba(244, 249, 255, 0.28) 17%,
        rgba(244, 249, 255, 0) 32%
    );
}

html.atmo-animar .atmosfera-fondo {
    transition: background 650ms ease;
}

.atmosfera-canvas {
    width: 100%;
    height: 100%;
    display: block;
    transition: opacity 400ms ease;
}

/* Respaldos CSS atmosféricos de pintado instantáneo (0 ms y modo sin WebGL) */
html[data-fase="day"][data-clima="clear"] .atmosfera-fondo {
    background: radial-gradient(circle at 72% 24%, rgba(255, 250, 232, 0.48), transparent 44%),
                linear-gradient(180deg, #659DD2 0%, #A7CEEC 52%, #E4EFF9 100%);
}

html[data-fase="day"][data-clima="partly-cloudy"] .atmosfera-fondo {
    background: radial-gradient(circle at 68% 28%, rgba(255, 249, 236, 0.36), transparent 48%),
                linear-gradient(180deg, #759EC2 0%, #B1C9DF 54%, #E4EBF2 100%);
}

html[data-fase="day"][data-clima="overcast"] .atmosfera-fondo {
    background: linear-gradient(180deg, #7E90A0 0%, #A3B2BE 52%, #CFD7DF 100%);
}

html[data-fase="day"][data-clima="fog"] .atmosfera-fondo {
    background: linear-gradient(180deg, #8A9DA0 0%, #B7C6C7 52%, #DCE3E2 100%);
}

html[data-fase="day"][data-clima="snow"] .atmosfera-fondo {
    background: linear-gradient(180deg, #839AB2 0%, #B0C2D5 52%, #DEE8F2 100%);
}

html[data-fase="sunrise"] .atmosfera-fondo {
    background: radial-gradient(circle at 78% 66%, rgba(255, 214, 158, 0.52), transparent 52%),
                linear-gradient(180deg, #658DB8 0%, #ABB9CC 50%, #EED3B9 100%);
}

html[data-tono="oscuro"][data-fase="dawn"] .atmosfera-fondo {
    background: radial-gradient(circle at 78% 72%, rgba(235, 155, 98, 0.42), transparent 52%),
                linear-gradient(180deg, #1A2843 0%, #5B495F 54%, #D48A5D 100%);
}

html[data-tono="oscuro"][data-fase="sunset"] .atmosfera-fondo {
    background: radial-gradient(circle at 18% 66%, rgba(238, 134, 40, 0.56), transparent 54%),
                linear-gradient(180deg, #0E2031 0%, #274456 48%, #D67624 100%);
}

html[data-tono="oscuro"][data-fase="dusk"] .atmosfera-fondo {
    background: radial-gradient(circle at 18% 74%, rgba(214, 110, 44, 0.42), transparent 50%),
                linear-gradient(180deg, #0C1B2C 0%, #1F364B 54%, #AA602B 100%);
}

html[data-tono="oscuro"][data-clima="rain"] .atmosfera-fondo {
    background: radial-gradient(circle at 52% 42%, rgba(120, 146, 148, 0.22), transparent 56%),
                linear-gradient(180deg, #162225 0%, #2F4346 52%, #516769 100%);
}

html[data-tono="oscuro"][data-fase="night"][data-clima="rain"] .atmosfera-fondo,
html[data-tono="oscuro"][data-fase="dusk"][data-clima="rain"] .atmosfera-fondo,
html[data-tono="oscuro"][data-fase="dawn"][data-clima="rain"] .atmosfera-fondo {
    background: radial-gradient(circle at 48% 40%, rgba(86, 114, 116, 0.24), transparent 54%),
                linear-gradient(180deg, #0F191B 0%, #213234 54%, #3B4F50 100%);
}

html[data-tono="oscuro"][data-clima="storm"] .atmosfera-fondo {
    background: radial-gradient(circle at 65% 32%, rgba(114, 146, 174, 0.20), transparent 50%),
                linear-gradient(180deg, #101923 0%, #21303E 54%, #374857 100%);
}

html[data-tono="oscuro"][data-fase="night"][data-clima="clear"] .atmosfera-fondo,
html[data-tono="oscuro"][data-fase="night"][data-clima="partly-cloudy"] .atmosfera-fondo {
    background: radial-gradient(circle at 76% 22%, rgba(176, 206, 240, 0.16), transparent 40%),
                linear-gradient(180deg, #08111F 0%, #12233B 54%, #1E3552 100%);
}

html[data-tono="oscuro"][data-fase="night"][data-clima="overcast"] .atmosfera-fondo,
html[data-tono="oscuro"][data-fase="night"][data-clima="fog"] .atmosfera-fondo,
html[data-tono="oscuro"][data-fase="night"][data-clima="snow"] .atmosfera-fondo {
    background: linear-gradient(180deg, #0C1520 0%, #1B2836 54%, #2B3B4B 100%);
}

body.acerca-abierto {
    overflow: hidden;
}

[hidden] {
    display: none !important;
}

button {
    font-family: inherit;
    color: inherit;
}

a {
    color: var(--accent-text);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 2px;
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

.ico {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    display: inline-block;
}

.solo-lectores {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.saltar {
    position: absolute;
    left: 12px;
    top: -64px;
    z-index: 200;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--glass-modal);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    color: var(--accent-text);
    text-decoration: none;
}

.saltar:focus {
    top: 12px;
}

/* ------------------------------------------------------------------
   Shell principal: sidebar plegable + lienzo editorial
   ------------------------------------------------------------------ */

.app {
    position: relative;
    z-index: 1;
    background: transparent;
    display: grid;
    /* El ancho del rail suma el inset izquierdo del notch, igual que su
       padding: así el content box mide lo mismo que con insets a 0 (232 px de
       rail) y el contenido no pierde ni un píxel. */
    grid-template-columns: calc(232px + env(safe-area-inset-left, 0px)) minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns 180ms ease;
}

body.menu-plegado .app {
    grid-template-columns: calc(68px + env(safe-area-inset-left, 0px)) minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    /* Con viewport-fit=cover los insets laterales y superior del notch no
       recortan la maqueta: se suman al padding base. Con insets a 0 no
       cambia nada (18/14/16/14). */
    padding: calc(18px + env(safe-area-inset-top, 0px)) 14px 16px calc(14px + env(safe-area-inset-left, 0px));
    background: var(--glass-sidebar);
    backdrop-filter: blur(26px) saturate(145%);
    -webkit-backdrop-filter: blur(26px) saturate(145%);
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
    transition: var(--atmo-trans);
}

.sidebar-marca {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 6px 18px;
}

.marca-logo {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--brand-bg);
    color: var(--brand-fg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    transition: var(--atmo-trans);
}

.marca-txt {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.marca-nombre {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.marca-pueblo {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.nav-grupo {
    margin: 14px 10px 6px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.nav-grupo:first-child {
    margin-top: 4px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-btn[aria-current="page"] {
    background: var(--bg-hover);
    border-color: var(--border);
    color: var(--text-primary);
    font-weight: 600;
}

.nav-ico {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.nav-btn[aria-current="page"] .nav-ico {
    color: var(--text-primary);
}

.sidebar-pie {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-btn--sec {
    font-size: 13px;
    color: var(--text-muted);
}

/* Estado plegado del menú */
body.menu-plegado .marca-txt,
body.menu-plegado .nav-grupo,
body.menu-plegado .nav-label {
    display: none;
}

body.menu-plegado .sidebar {
    padding: calc(18px + env(safe-area-inset-top, 0px)) 10px 16px calc(10px + env(safe-area-inset-left, 0px));
}

body.menu-plegado .sidebar-marca,
body.menu-plegado .nav-btn {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

/* ------------------------------------------------------------------
   Área principal y cabecera de página
   ------------------------------------------------------------------ */

.principal {
    min-width: 0;
    /* La sidebar absorbe el inset izquierdo; aquí solo el derecho evita que el
       contenido entre en la zona insegura del borde. Con insets a 0 sigue
       siendo 28/36/56/36. */
    padding: 28px calc(36px + env(safe-area-inset-right, 0px)) 56px 36px;
}

.contenedor {
    max-width: 1160px;
    margin: 0 auto;
}

.cabecera {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.fecha-linea {
    margin: 0 0 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--canvas-text-muted);
    text-shadow: var(--canvas-text-shadow);
    font-variant-numeric: tabular-nums;
    transition: var(--atmo-trans);
}

.titulo-pagina {
    margin: 0 0 6px;
    font-size: 28px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--canvas-text-primary);
    text-shadow: var(--canvas-text-shadow);
    transition: var(--atmo-trans);
}

.subtitulo {
    margin: 0;
    max-width: 680px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--canvas-text-secondary);
    text-shadow: var(--canvas-text-shadow);
    transition: var(--atmo-trans);
}

.chip-salud {
    margin: 6px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: var(--radius-chip);
    background: var(--glass-surface);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--ok-border);
    color: var(--ok);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-chip);
    transition: var(--atmo-trans);
}

.chip-salud[data-estado="aviso"] {
    border-color: var(--warning-border);
    color: var(--warning);
}

.chip-salud[data-estado="sin"] {
    border-color: var(--info-border);
    color: var(--text-muted);
}

.chip-punto {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

/* ------------------------------------------------------------------
   Rejilla de 12 columnas y tarjetas
   ------------------------------------------------------------------ */

.rejilla {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.c12 { grid-column: span 12; }
.c8  { grid-column: span 8; }
.c7  { grid-column: span 7; }
.c6  { grid-column: span 6; }
.c5  { grid-column: span 5; }
.c4  { grid-column: span 4; }

.tarjeta {
    background: var(--glass-surface);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: var(--atmo-trans);
}

.tarjeta-cab {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.tarjeta-tit {
    margin: 0;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.tarjeta-ceja {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.35;
}

.tarjeta-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tarjeta-cuerpo {
    flex: 1;
}

.tarjeta-pie {
    margin: 14px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Chips de estado (compartidos por todas las vistas y noticias.js) */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-chip);
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    flex-shrink: 0;
    transition: var(--atmo-trans);
}

.chip--normal {
    background: var(--ok-bg);
    border-color: var(--ok-border);
    color: var(--ok);
}

.chip--aviso {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning);
}

.chip--informativo {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info);
}

.chip--sindatos,
.chip--cargando {
    background: var(--bg-subtle);
    border-color: var(--tile-border);
    color: var(--text-muted);
}

.sub {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.nota-suave {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-muted);
}

.nota-aviso {
    margin: 8px 0 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: var(--warning);
    font-size: 12.5px;
}

/* ------------------------------------------------------------------
   Tarjeta Tiempo (c8) y Calidad del aire (c4)
   ------------------------------------------------------------------ */

.tiempo-bento {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 24px;
    align-items: start;
}

.tiempo-hero {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tiempo-valor {
    margin: 0;
    font-size: 52px;
    line-height: 1;
    font-weight: 300;
    letter-spacing: -0.035em;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.tiempo-valor--sm {
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.tiempo-ico-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--tile-border);
    color: var(--accent-text);
    flex-shrink: 0;
}

.tiempo-svg {
    width: 30px;
    height: 30px;
    display: block;
}

.tiempo-cielo-fila {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 8px 0 2px;
}

.tiempo-cielo {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.tiempo-atmo-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-chip);
    background: var(--atmo-badge-bg);
    border: 1px solid var(--accent-soft);
    color: var(--accent-text);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.tiempo-grid-2x2 {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.metrica-mini {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metrica-k {
    font-size: 11.5px;
    color: var(--text-muted);
}

.metrica-v {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.sec-kicker {
    margin: 0 0 8px;
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.horas-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 16px;
}

.hora-tile {
    padding: 8px 4px 7px;
    border-radius: var(--radius-tile);
    background: var(--bg-subtle);
    border: 1px solid var(--tile-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-variant-numeric: tabular-nums;
}

.hora-t {
    font-size: 11px;
    color: var(--text-muted);
}

.hora-g {
    font-size: 14px;
    font-weight: 650;
    color: var(--text-primary);
}

.hora-ll {
    font-size: 11px;
    color: var(--text-secondary);
}

.hora-ll-track {
    width: 72%;
    height: 2.5px;
    margin-top: 3px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}

.hora-ll-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
    opacity: 0.85;
}

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

.dia-fila {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 44px 66px;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.dia-fila:last-child {
    border-bottom: none;
}

.dia-nom {
    font-weight: 650;
    color: var(--text-primary);
}

.dia-desc {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dia-ll {
    text-align: right;
    color: var(--text-muted);
    font-size: 12px;
}

.dia-rango {
    text-align: right;
    font-weight: 600;
    color: var(--text-primary);
}

/* Calidad del aire + KPIs */
.kpi-tit {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.kpi-tit--texto {
    font-size: 14.5px;
    font-weight: 650;
}

.aire-tiles {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.aire-tile {
    padding: 10px 12px;
    border-radius: var(--radius-tile);
    background: var(--bg-subtle);
    border: 1px solid var(--tile-border);
}

.aire-k {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.aire-v {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.aire-v strong {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Resumen transporte + botón acción */
.trans-resumen {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trans-resumen li {
    display: flex;
    gap: 8px;
    align-items: baseline;
    font-size: 13px;
    line-height: 1.4;
}

.trans-hora {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.trans-txt {
    color: var(--text-secondary);
}

.enlace-accion,
.boton-texto {
    margin-top: 12px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--accent-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.enlace-accion:hover,
.boton-texto:hover {
    text-decoration: underline;
}

/* ------------------------------------------------------------------
   Reforma Digital: Luz PVPC, Contratación y BOE
   ------------------------------------------------------------------ */

.luz-cab {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.luz-meta-der {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.luz-grafica {
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    align-items: end;
    gap: 3px;
    height: 58px;
    padding: 8px 6px 4px;
    margin-bottom: 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--tile-border);
    border-radius: var(--radius-tile);
}

.luz-barra {
    width: 100%;
    min-height: 4px;
    border-radius: 2px 2px 0 0;
    background: var(--bar-neutral);
    cursor: help;
}

.luz-barra--barata { background: var(--ok); }
.luz-barra--cara   { background: var(--danger); }
.luz-barra--actual { background: var(--text-primary); }

.luz-tramos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.luz-tramo-txt {
    margin: 2px 0 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.seg-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.seg-btn {
    padding: 5px 11px;
    border-radius: var(--radius-chip);
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.seg-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.seg-btn[aria-pressed="true"] {
    background: var(--seg-active-bg);
    border-color: var(--seg-active-bg);
    color: var(--seg-active-fg);
    font-weight: 600;
}

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

.reg-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

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

.reg-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.reg-badge {
    padding: 1px 7px;
    border-radius: var(--radius-chip);
    font-size: 10.5px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.reg-badge--lic {
    background: var(--warning-bg);
    color: var(--warning);
}

.reg-badge--boe {
    background: var(--atmo-badge-bg);
    color: var(--accent-text);
}

.reg-importe {
    color: var(--ok);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.reg-org {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.reg-tit {
    margin: 0;
    display: block;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
    text-decoration: none;
}

a.reg-tit:hover {
    color: var(--accent-text);
    text-decoration: underline;
}

/* ------------------------------------------------------------------
   Vista Noticias y agenda (clases exactas de public/js/hoyo/noticias.js)
   ------------------------------------------------------------------ */

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

.lista-noticias > li {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    align-items: start;
}

.lista-noticias > li:last-child {
    border-bottom: none;
}

.not-fecha {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}

.not-tit {
    margin: 0;
    font-size: 13.5px;
    font-weight: 550;
    line-height: 1.4;
    color: var(--text-primary);
}

.not-tit a {
    color: inherit;
    text-decoration: none;
}

.not-tit a:hover {
    color: var(--accent-text);
    text-decoration: underline;
}

.not-fuente {
    margin: 3px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.not-estado {
    padding: 12px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.not-fila-esqueleto {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.not-esqueleto-fecha,
.not-esqueleto-linea {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: var(--bg-subtle);
}

.not-esqueleto {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.not-esqueleto-linea--corta {
    width: 45%;
}

/* ------------------------------------------------------------------
   Vista Transporte y Sociedad (mapa inline, horarios, fuel, cámaras)
   ------------------------------------------------------------------ */

.mapa-inline {
    position: relative;
    z-index: 0;
    isolation: isolate;
    width: 100%;
    height: 340px;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--bg-subtle);
}

/* Atenuado sutil de teselas claras en polaridad oscura sin afectar marcadores ni popups */
html[data-tono="oscuro"] .mapa-inline .leaflet-tile-pane,
html[data-tono="oscuro"] .mapa-inline .maplibregl-canvas {
    filter: brightness(0.86) contrast(1.06) saturate(0.92);
}

.mapa-lienzo--catastro,
.mapa-lienzo--catastro .leaflet-grab {
    cursor: crosshair !important;
}

.mov-leyenda {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.mov-leyenda-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mov-leyenda-dot {
    width: 14px;
    height: 4px;
    border-radius: 999px;
    box-shadow: 0 0 0 1px var(--legend-dot-ring);
}

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

.mov-fila {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.mov-fila:last-child {
    border-bottom: none;
}

.mov-fila--btn {
    padding: 0;
}

.fila-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border: none;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
}

.fila-btn:hover {
    background: var(--bg-hover);
}

.mov-hora {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 44px;
}

.mov-linea {
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--bg-subtle);
    border: 1px solid var(--tile-border);
    font-size: 11.5px;
    font-weight: 650;
    color: var(--text-primary);
    white-space: nowrap;
}

.mov-dest {
    flex: 1;
    min-width: 0;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mov-dist {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.bus-subbloque + .bus-subbloque {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.bus-subtit {
    margin: 10px 0 6px;
    font-size: 12.5px;
    font-weight: 650;
    color: var(--text-primary);
}

/* Bloque «Próximos» de tren y bus: el foco de la tarjeta */
.proximos {
    margin: 0 0 14px;
}

.proximos-cab {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.proximos-tit,
.prox-grupo-tit {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* Etiqueta de grupo de la portada («AUTOBUSES», «TRENES»): mismo tono que
   «PRÓXIMOS», como una fila más de la lista. */
.prox-grupo-tit {
    margin: 10px 0 2px;
    padding: 0;
    list-style: none;
}

.prox-grupo-tit:first-child {
    margin-top: 0;
}

.proximos-tag {
    padding: 1px 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

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

.prox-fila {
    display: grid;
    /* H17: la parada conserva un ancho mínimo legible; la columna de la hora,
       «Primera: …» o el destino nunca la deja en una columna de letras. */
    grid-template-columns: minmax(8rem, 1fr) minmax(0, auto);
    grid-template-areas:
        "punto hora"
        "dest luego";
    align-items: baseline;
    gap: 2px 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.prox-fila:last-child {
    border-bottom: none;
}

.prox-punto {
    grid-area: punto;
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.prox-linea {
    flex: none;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--bg-subtle);
    border: 1px solid var(--tile-border);
    font-size: 11.5px;
    font-weight: 650;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* H17: el nombre de la parada no se recorta nunca. Puede pasar a dos líneas
   por espacios y, solo si una palabra no cabe, partir esa palabra; nunca una
   columna de letras. Por eso no lleva ellipsis ni nowrap. */
.prox-parada {
    min-width: 0;
    overflow-wrap: break-word;
    white-space: normal;
}

.prox-hora-bloque {
    grid-area: hora;
    display: flex;
    align-items: baseline;
    gap: 7px;
    white-space: nowrap;
}

.prox-hora {
    font-size: 19px;
    line-height: 1.1;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.prox-min {
    font-size: 15px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.prox-dest {
    grid-area: dest;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.prox-luego {
    grid-area: luego;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    text-align: right;
}

.prox-fila--vacia .prox-sin {
    grid-area: hora;
    margin: 0;
    font-size: 15px;
    font-weight: 650;
    color: var(--text-secondary);
    white-space: nowrap;
    text-align: right;
}

/* H17: en las filas vacías «Primera: …» (nowrap) necesita su ancho entero a
   390 px; el hueco entre columnas se aprieta para no dejar sin sitio al nombre. */
.prox-fila--vacia {
    column-gap: 8px;
}

.prox-fila--vacia .prox-dest {
    grid-area: luego;
    text-align: right;
}

.prox-sin {
    margin: 0;
}

.prox-horario {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.prox-toggle {
    margin: 0;
    padding: 4px 0;
    border: none;
    background: transparent;
    color: var(--accent-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.prox-toggle:hover {
    text-decoration: underline;
}

.prox-toggle:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 2px;
    border-radius: 4px;
}

.prox-panel {
    margin-top: 6px;
}

.prox-panel[hidden] {
    display: none;
}

.proximos--compacto .prox-hora {
    font-size: 17px;
}

.proximos--compacto .prox-min {
    font-size: 15px;
}

.proximos--compacto .prox-fila {
    padding: 7px 0;
}

.fuel-ahorro {
    margin: 0 0 12px;
    padding: 9px 12px;
    border-radius: 10px;
    background: var(--ok-bg);
    border: 1px solid var(--ok-border);
    color: var(--ok);
    font-size: 12.5px;
    font-weight: 500;
}

.fuel-precio {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 62px;
}

.fuel-precio--barata {
    color: var(--ok);
}

.renfe-retraso {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 46px;
    color: var(--warning);
}

.renfe-retraso--alto {
    color: var(--danger);
}

.cam-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cam-item {
    margin: 0;
    border: 1px solid var(--tile-border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-subtle);
}

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

.cam-vacia {
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-muted);
}

.cam-cap {
    padding: 6px 8px;
    font-size: 11.5px;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    border-top: 1px solid var(--tile-border);
}

/* Pines y popups de Leaflet (alto contraste garantizado en ambas polaridades) */
.capa-pin-fuel { background: none; border: none; }

.capa-pin-fuel-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--pin-bg);
    color: var(--pin-fg);
    border: 1.5px solid var(--pin-border);
    font-size: 11px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    box-shadow: var(--shadow-pin);
}

.capa-pin-fuel--barata .capa-pin-fuel-pill {
    background: var(--pin-cheap-bg);
    color: var(--pin-cheap-fg);
    border-color: var(--pin-cheap-border);
}

.capa-pin-fuel--hoyo .capa-pin-fuel-pill {
    background: var(--pin-hoyo-bg);
    color: var(--pin-hoyo-fg);
    border-color: var(--pin-hoyo-border);
}

.hoyo-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    background: var(--popup-bg);
    color: var(--text-primary);
    border: 1px solid var(--popup-border);
    box-shadow: var(--shadow-popup);
}

.hoyo-popup .leaflet-popup-tip {
    background: var(--popup-bg);
    border: 1px solid var(--popup-border);
}

.leaflet-container .hoyo-popup a.leaflet-popup-close-button {
    color: var(--text-muted);
}

.leaflet-container .hoyo-popup a.leaflet-popup-close-button:hover {
    color: var(--text-primary);
}

.hoyo-popup-cuerpo {
    font-family: var(--font-sans);
    font-size: 12.5px;
    color: var(--text-primary);
}

.hoyo-popup-titulo {
    display: block;
    font-size: 13px;
    font-weight: 650;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.hoyo-popup-lugar {
    margin: 0 0 4px;
    color: var(--text-secondary);
}

.hoyo-popup-mas {
    margin: 4px 0 0;
    font-size: 11.5px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.hoyo-popup-enlace {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-text);
}

/* Sociedad */
.soc-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.soc-val {
    margin: 0 0 2px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.serv-nom {
    font-weight: 600;
    color: var(--text-primary);
}

.curio-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.curio-item:first-child {
    padding-top: 0;
}

.curio-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.curio-tit {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 650;
}

/* ------------------------------------------------------------------
   Modal Acerca de
   ------------------------------------------------------------------ */

.acerca {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.acerca-fondo {
    position: absolute;
    inset: 0;
    background: var(--scrim-bg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.acerca-panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--glass-modal);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: var(--shadow-modal);
    transition: var(--atmo-trans);
}

.acerca-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.acerca-cuerpo h3 {
    margin: 16px 0 6px;
    font-size: 13px;
    font-weight: 650;
    color: var(--text-primary);
}

.creditos {
    margin: 0;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.acerca-nombre {
    font-size: 13px;
    color: var(--text-muted);
}

.boton-primario {
    margin-top: 14px;
    padding: 9px 16px;
    border-radius: 10px;
    border: none;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-fg);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 150ms ease;
}

html.atmo-animar .boton-primario {
    transition: opacity 150ms ease, background-color 650ms ease, color 650ms ease, border-color 650ms ease, box-shadow 650ms ease;
}

.boton-primario:hover {
    opacity: 0.92;
}

/* ------------------------------------------------------------------
   Tabbar móvil y responsive
   ------------------------------------------------------------------ */

.tabbar {
    display: none;
}

@media (max-width: 1080px) {
    .c8, .c7, .c6, .c5, .c4 {
        grid-column: span 12;
    }

    .tiempo-bento {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .app,
    body.menu-plegado .app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    /* Con viewport-fit=cover el área de maquetación llega al borde de la
       pantalla: el inset superior evita que la cabecera quede bajo el notch y
       el inferior mantiene el hueco de ~42 px sobre la tabbar (que ya suma
       su propio env(safe-area-inset-bottom)). Con insets a 0 no cambia nada. */
    .principal {
        padding: calc(20px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) calc(86px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
    }

    .cabecera {
        flex-direction: column;
        gap: 10px;
    }

    .horas-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .cam-grid {
        grid-template-columns: 1fr;
    }

    .tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 150;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        background: var(--glass-tabbar);
        backdrop-filter: blur(24px) saturate(150%);
        -webkit-backdrop-filter: blur(24px) saturate(150%);
        border-top: 1px solid var(--glass-border);
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        gap: 4px;
        transition: var(--atmo-trans);
    }

    .tabbar-btn {
        padding: 8px 4px;
        border: none;
        border-radius: 8px;
        background: transparent;
        font-size: 12px;
        font-weight: 500;
        color: var(--text-secondary);
        cursor: pointer;
    }

    .tabbar-btn[aria-current="page"] {
        background: var(--bg-hover);
        color: var(--text-primary);
        font-weight: 650;
    }
}

/* ------------------------------------------------------------------
   Respaldo sin backdrop-filter y accesibilidad de movimiento reducido
   ------------------------------------------------------------------ */

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .tarjeta,
    .chip-salud {
        background: var(--glass-fallback-surface);
    }

    .sidebar {
        background: var(--glass-fallback-sidebar);
    }

    .tabbar,
    .acerca-panel {
        background: var(--glass-fallback-tabbar);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
    }
}

/* ------------------------------------------------------------------
   Botón «Apoya este proyecto» (bloque de Acerca de y pie del menú)
   Solo tokens de hoyo.css; el único valor propio es el amarillo de
   marca, usado como filete y nunca como texto.
   ------------------------------------------------------------------ */

.apoya-bloque {
    --apoya-amarillo: #FECD0D;
    margin: 16px 0 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--apoya-amarillo);
    border-radius: var(--radius-card);
    background: var(--bg-subtle);
}

.apoya-bloque p {
    margin: 0 0 12px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.apoya-boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 10px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-fg);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 150ms ease;
}

.apoya-boton:hover {
    opacity: 0.92;
}

.apoya-boton svg.ico {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.apoya-pie {
    min-height: 44px;
    text-decoration: none;
}

.apoya-pie svg.ico {
    fill: currentColor;
    transition: transform 160ms ease-out;
}

.apoya-pie:hover svg.ico,
.apoya-pie:focus-visible svg.ico {
    transform: scale(1.12);
}

/* Mismo bloque al final de la vista «Ahora», como hermano de la rejilla:
   solo separa del último renglón de tarjetas, sin colores propios. */
.apoya-bloque--ahora {
    margin: 18px 0 0;
}

@media (prefers-reduced-motion: reduce) {
    .apoya-boton,
    .apoya-pie svg.ico {
        transition: none;
    }

    .apoya-pie:hover svg.ico,
    .apoya-pie:focus-visible svg.ico {
        transform: none;
    }
}
