/* EliMeteo — sistema visual. Oscuro por defecto; [data-theme=light] para el claro. */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --em-bg: #0A0F1C;
    --em-bg-2: #0D1424;
    --em-surface: #111A2C;
    --em-surface-2: #16213A;
    --em-surface-3: #1C2946;
    --em-border: rgba(148, 163, 184, 0.12);
    --em-border-strong: rgba(148, 163, 184, 0.22);
    --em-text: #E6ECF5;
    --em-muted: #8C9AB3;
    --em-faint: #5E6B84;
    --em-accent: #22D3A6;
    --em-accent-2: #7C8CFF;
    --em-accent-soft: rgba(34, 211, 166, 0.12);
    --em-good: #22C55E;
    --em-warn: #F59E0B;
    --em-bad: #F43F5E;
    --em-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px -12px rgba(0, 0, 0, 0.55);
    --em-shadow-hover: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 18px 40px -14px rgba(0, 0, 0, 0.7);
    --em-radius: 18px;
    --em-radius-sm: 12px;
    --em-sidebar: 248px;
    --em-topbar: 64px;
    --em-bottomnav: 68px;
    --em-hero: radial-gradient(1200px 400px at 0% 0%, rgba(34, 211, 166, 0.18), transparent 60%), radial-gradient(900px 380px at 100% 0%, rgba(124, 140, 255, 0.18), transparent 60%), linear-gradient(160deg, #13203A 0%, #0F1830 100%);
    color-scheme: dark;
}

[data-theme="light"] {
    --em-bg: #F4F6FA;
    --em-bg-2: #ECEFF5;
    --em-surface: #FFFFFF;
    --em-surface-2: #F6F8FC;
    --em-surface-3: #EDF1F8;
    --em-border: rgba(15, 23, 42, 0.08);
    --em-border-strong: rgba(15, 23, 42, 0.14);
    --em-text: #0F172A;
    --em-muted: #5B6B84;
    --em-faint: #94A3B8;
    --em-accent: #0FA884;
    --em-accent-2: #5B6CFF;
    --em-accent-soft: rgba(15, 168, 132, 0.10);
    --em-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
    --em-shadow-hover: 0 2px 4px rgba(15, 23, 42, 0.05), 0 16px 36px -14px rgba(15, 23, 42, 0.2);
    --em-hero: radial-gradient(1200px 400px at 0% 0%, rgba(15, 168, 132, 0.14), transparent 60%), radial-gradient(900px 380px at 100% 0%, rgba(91, 108, 255, 0.12), transparent 60%), linear-gradient(160deg, #FFFFFF 0%, #F1F5FB 100%);
    color-scheme: light;
}

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

html, body {
    margin: 0;
    background: var(--em-bg);
    color: var(--em-text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'cv11', 'ss01', 'tnum' 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a { color: var(--em-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.num, .em-num { font-variant-numeric: tabular-nums; }

/* ───────── Shell ───────── */

.em-shell { min-height: 100vh; min-height: 100dvh; }

.em-sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--em-sidebar);
    display: flex; flex-direction: column; gap: 8px;
    padding: 18px 14px;
    background: linear-gradient(180deg, var(--em-bg-2), var(--em-bg));
    border-right: 1px solid var(--em-border);
    z-index: 30;
}

.em-main {
    margin-left: var(--em-sidebar);
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column;
}

.em-brand { display: flex; align-items: center; gap: 10px; color: var(--em-text); text-decoration: none !important; padding: 4px 8px 14px; }
.em-brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, #22D3A6, #7C8CFF); box-shadow: 0 6px 20px -6px rgba(34, 211, 166, 0.6); }
.em-brand-mark img { width: 22px; height: 22px; }
.em-brand-text { font-size: 1.15rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; display: flex; flex-direction: column; }
.em-brand-text b { font-weight: 800; }
.em-brand-text small { font-size: .72rem; color: var(--em-muted); font-weight: 500; letter-spacing: 0; margin-top: 2px; }
.em-brand-mobile { display: none; padding: 0; }

.em-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.em-nav-label { font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--em-faint); padding: 14px 12px 6px; }
.em-nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: 11px;
    color: var(--em-muted) !important; font-weight: 550; font-size: .9rem;
    text-decoration: none !important;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.em-nav-item:hover { background: var(--em-surface-2); color: var(--em-text) !important; }
.em-nav-item.active { background: var(--em-accent-soft); color: var(--em-accent) !important; }
.em-nav-item.active .mud-icon-root { color: var(--em-accent); }
.em-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--em-warn); color: #1A1204; font-size: .72rem; font-weight: 800; display: inline-grid; place-items: center; }
.em-sidebar-foot { padding: 10px 6px 4px; border-top: 1px solid var(--em-border); }

.em-topbar {
    position: sticky; top: 0; z-index: 20;
    height: var(--em-topbar);
    display: flex; align-items: center; gap: 10px;
    padding: 0 24px;
    background: color-mix(in srgb, var(--em-bg) 78%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--em-border);
}
.em-topbar-spacer { flex: 1; }
.em-avatar { border: none; font: inherit; padding: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #05130F; background: linear-gradient(135deg, #22D3A6, #7CF0CF); cursor: pointer; margin-left: 4px; }
.em-menu-head { padding: 10px 16px 8px; display: flex; flex-direction: column; border-bottom: 1px solid var(--em-border); margin-bottom: 4px; }
.em-menu-head small { color: var(--em-muted); }
.em-logout button { all: unset; display: flex; align-items: center; gap: 12px; padding: 8px 16px; width: 100%; cursor: pointer; font-size: .9rem; box-sizing: border-box; }
.em-logout button:hover { background: var(--em-surface-2); }

.em-content { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 24px 24px 32px; animation: em-fade-in .35s ease both; }
.em-footer { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 24px 26px; color: var(--em-faint); font-size: .78rem; }
.em-footer-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.em-footer-label { font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--em-faint); margin-right: 4px; }
.em-footer-src { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--em-border); background: var(--em-surface); color: var(--em-muted); font-weight: 600; font-size: .74rem; text-decoration: none !important; transition: border-color .15s ease, color .15s ease; }
.em-footer-src:hover { border-color: var(--em-border-strong); color: var(--em-text); }
.em-footer-note a { color: var(--em-muted); }

.em-banner {
    display: flex; align-items: center; gap: 10px; margin: 16px 24px 0; padding: 10px 14px;
    border-radius: 14px; background: color-mix(in srgb, var(--em-warn) 12%, var(--em-surface)); border: 1px solid color-mix(in srgb, var(--em-warn) 30%, transparent);
    color: var(--em-text); font-size: .88rem; animation: em-slide-down .35s ease both;
}
.em-banner .mud-icon-root { color: var(--em-warn); }
.em-banner a { font-weight: 700; margin-left: auto; }
.em-banner-x { all: unset; cursor: pointer; padding: 0 6px; color: var(--em-muted); font-size: 1.2rem; }

/* Navegación inferior (móvil) */
.em-bottomnav { display: none; }
.em-sheet-backdrop { position: fixed; inset: 0; background: rgba(5, 8, 15, .55); z-index: 40; animation: em-fade-in .2s ease both; }
.em-sheet {
    position: fixed; left: 8px; right: 8px; bottom: calc(var(--em-bottomnav) + 8px + env(safe-area-inset-bottom));
    background: var(--em-surface); border: 1px solid var(--em-border-strong); border-radius: 22px; padding: 8px; z-index: 41;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .35); animation: em-slide-up .25s cubic-bezier(.2, .9, .3, 1.1) both;
}
.em-sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--em-border-strong); margin: 4px auto 8px; }
.em-sheet-item { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; color: var(--em-text) !important; text-decoration: none !important; }
.em-sheet-item:active { background: var(--em-surface-2); }
.em-sheet-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--em-surface-2); color: var(--em-accent); }
.em-sheet-text { display: flex; flex-direction: column; }
.em-sheet-text small { color: var(--em-muted); }

/* Indicador en vivo */
.em-live { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; color: var(--em-muted); padding: 6px 12px; border-radius: 999px; background: var(--em-surface); border: 1px solid var(--em-border); white-space: nowrap; }
.em-live-long { background: transparent; border: none; padding: 6px 8px; font-weight: 500; white-space: normal; }
.em-live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; position: relative; flex: none; }
.em-live.ok .em-live-dot { color: var(--em-good); }
.em-live.warn .em-live-dot { color: var(--em-warn); }
.em-live.bad .em-live-dot { color: var(--em-bad); }
.em-live.ok .em-live-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: em-pulse 2s ease-out infinite; }

/* ───────── Componentes ───────── */

.em-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.em-page-head h1 { font-size: 1.65rem; font-weight: 750; letter-spacing: -0.03em; margin: 0; line-height: 1.15; }
.em-page-head p { margin: 4px 0 0; color: var(--em-muted); font-size: .92rem; }
.em-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--em-accent); margin-bottom: 4px; }

.em-card {
    background: var(--em-surface); border: 1px solid var(--em-border); border-radius: var(--em-radius);
    box-shadow: var(--em-shadow); padding: 18px 20px;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    animation: em-rise .45s cubic-bezier(.2, .8, .2, 1) both;
    min-width: 0;
}
.em-card.hover:hover { transform: translateY(-2px); box-shadow: var(--em-shadow-hover); border-color: var(--em-border-strong); }
.em-card.flush { padding: 0; overflow: hidden; }
.em-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.em-card-title { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; margin: 0; display: flex; align-items: center; gap: 8px; }
.em-card-sub { color: var(--em-muted); font-size: .82rem; margin: 2px 0 0; }
.em-hero { background: var(--em-hero); border-color: var(--em-border-strong); }

.em-grid { display: grid; gap: 16px; align-items: stretch; }
.em-grid > .em-card { display: flex; flex-direction: column; }
.em-grid > .em-card > .em-chart, .em-grid > .em-card > .em-table-wrap { flex: 1; }
.em-stack { height: 100%; }
.em-stack > :last-child { flex: 1; }
.em-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.em-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.em-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.em-grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.em-span-2 { grid-column: span 2; }
.em-stack { display: flex; flex-direction: column; gap: 16px; }
.em-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.em-spacer { flex: 1; }
.em-muted { color: var(--em-muted); }
.em-faint { color: var(--em-faint); }
.em-small { font-size: .82rem; }
.em-tiny { font-size: .74rem; }
.em-strong { font-weight: 700; }
.em-good { color: var(--em-good) !important; }
.em-warn { color: var(--em-warn) !important; }
.em-bad { color: var(--em-bad) !important; }
.em-accent { color: var(--em-accent) !important; }
.em-mt { margin-top: 16px; }
.em-mb { margin-bottom: 16px; }
.em-divider { height: 1px; background: var(--em-border); margin: 14px 0; border: none; }

.em-stat { display: flex; flex-direction: column; gap: 2px; }
.em-stat-label { font-size: .74rem; color: var(--em-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.em-stat-value { font-size: 1.45rem; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.em-stat-value small { font-size: .8rem; font-weight: 600; color: var(--em-muted); margin-left: 2px; }
.em-stat-hint { font-size: .78rem; color: var(--em-muted); }

.em-big-temp { font-size: clamp(3.4rem, 9vw, 5.4rem); font-weight: 800; letter-spacing: -0.06em; line-height: .95; font-variant-numeric: tabular-nums; }
.em-big-temp sup { font-size: .38em; font-weight: 700; letter-spacing: 0; vertical-align: top; position: relative; top: .35em; margin-left: 2px; color: var(--em-muted); }

.em-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .76rem; font-weight: 650; background: var(--em-surface-2); border: 1px solid var(--em-border); color: var(--em-muted); white-space: nowrap; }
.em-chip.accent { background: var(--em-accent-soft); color: var(--em-accent); border-color: transparent; }
.em-chip.good { background: color-mix(in srgb, var(--em-good) 14%, transparent); color: var(--em-good); border-color: transparent; }
.em-chip.warn { background: color-mix(in srgb, var(--em-warn) 16%, transparent); color: var(--em-warn); border-color: transparent; }
.em-chip.bad { background: color-mix(in srgb, var(--em-bad) 14%, transparent); color: var(--em-bad); border-color: transparent; }
.em-chip.info { background: color-mix(in srgb, #4F8EF7 15%, transparent); color: #6FA3FA; border-color: transparent; }

.em-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--em-warn); display: inline-block; }
.em-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.em-swatch.lg { width: 12px; height: 12px; border-radius: 4px; }

.em-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--em-surface-2); border: 1px solid var(--em-border); gap: 2px; flex-wrap: wrap; }
.em-seg button { all: unset; cursor: pointer; padding: 6px 12px; border-radius: 9px; font-size: .82rem; font-weight: 650; color: var(--em-muted); transition: background .15s ease, color .15s ease; white-space: nowrap; }
.em-seg button:hover { color: var(--em-text); }
.em-seg button.on { background: var(--em-surface); color: var(--em-text); box-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 0 0 1px var(--em-border); }
[data-theme="light"] .em-seg button.on { box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

.em-btn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 12px; font-weight: 650; font-size: .88rem; background: var(--em-accent); color: #05130F; transition: transform .12s ease, filter .15s ease, box-shadow .15s ease; box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--em-accent) 80%, transparent); white-space: nowrap; }
.em-btn:hover { filter: brightness(1.08); }
.em-btn:active { transform: scale(.97); }
.em-btn.ghost { background: var(--em-surface-2); color: var(--em-text); box-shadow: none; border: 1px solid var(--em-border); }
.em-btn.ghost:hover { border-color: var(--em-border-strong); }
.em-btn.danger { background: color-mix(in srgb, var(--em-bad) 14%, transparent); color: var(--em-bad); box-shadow: none; }
.em-btn[disabled], .em-btn.disabled { opacity: .5; pointer-events: none; }
.em-btn.sm { padding: 6px 11px; font-size: .8rem; border-radius: 10px; }

.em-select, .em-input { all: unset; box-sizing: border-box; padding: 8px 12px; border-radius: 11px; background: var(--em-surface-2); border: 1px solid var(--em-border); color: var(--em-text); font-size: .86rem; font-weight: 550; min-height: 38px; }
.em-select { max-width: 100%; text-overflow: ellipsis; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238C9AB3' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
.em-select option { background: var(--em-surface); color: var(--em-text); }
.em-input:focus, .em-select:focus { border-color: var(--em-accent); box-shadow: 0 0 0 3px var(--em-accent-soft); }
.em-field { display: flex; flex-direction: column; gap: 5px; }
.em-field > label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--em-faint); }
.em-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }

/* Tablas */
.em-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.em-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .86rem; }
.em-table th { text-align: left; font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--em-faint); padding: 10px 12px; border-bottom: 1px solid var(--em-border); white-space: nowrap; position: sticky; top: 0; background: var(--em-surface); }
.em-table td { padding: 11px 12px; border-bottom: 1px solid var(--em-border); vertical-align: middle; }
.em-table tr:last-child td { border-bottom: none; }
.em-table tbody tr { transition: background .15s ease; }
.em-table tbody tr:hover { background: var(--em-surface-2); }
.em-table .r { text-align: right; font-variant-numeric: tabular-nums; }
.em-table .c { text-align: center; }
.em-table tr.own td { background: var(--em-accent-soft); }

.em-src { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.em-src.own { color: var(--em-accent); font-weight: 800; }

/* Barras de puntuación */
.em-score { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.em-score-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--em-surface-3); overflow: hidden; }
.em-score-bar > span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--em-accent-2), var(--em-accent)); transform-origin: left; animation: em-grow .7s cubic-bezier(.2, .8, .2, 1) both; }
.em-score b { min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

/* Podio */
.em-podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 10px; }
.em-podium-step { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.em-podium-block { width: 100%; border-radius: 14px 14px 6px 6px; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; color: #fff; animation: em-rise-tall .6s cubic-bezier(.2, .8, .2, 1) both; }
.em-podium-name { font-weight: 700; font-size: .86rem; line-height: 1.2; }
.em-podium-score { font-size: .78rem; color: var(--em-muted); }

/* Días del comparador */
.em-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.em-day { border-radius: 16px; padding: 12px; background: var(--em-surface-2); border: 1px solid var(--em-border); display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; transition: transform .2s ease, border-color .2s ease; }
.em-day:hover { transform: translateY(-2px); border-color: var(--em-border-strong); }
.em-day.sel { border-color: var(--em-accent); box-shadow: 0 0 0 3px var(--em-accent-soft); }
.em-day-name { font-weight: 700; font-size: .82rem; text-transform: capitalize; }
.em-day-temps { font-weight: 750; font-variant-numeric: tabular-nums; }
.em-day-temps .lo { color: var(--em-muted); font-weight: 600; margin-left: 6px; }

.em-matrix { width: 100%; border-collapse: separate; border-spacing: 0; }
.em-matrix th, .em-matrix td { padding: 8px 10px; border-bottom: 1px solid var(--em-border); text-align: center; white-space: nowrap; }
.em-matrix th:first-child, .em-matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--em-surface); z-index: 1; }
.em-matrix thead th { font-size: .74rem; font-weight: 700; color: var(--em-muted); text-transform: capitalize; }
.em-matrix tr.own td { background: var(--em-accent-soft); }
.em-matrix tr.own td:first-child { background: color-mix(in srgb, var(--em-accent) 10%, var(--em-surface)); }
.em-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 76px; }
.em-cell .t { font-weight: 750; font-size: .88rem; font-variant-numeric: tabular-nums; }
.em-cell .t .lo { color: var(--em-muted); font-weight: 600; }
.em-cell .m { font-size: .72rem; color: var(--em-muted); display: flex; gap: 6px; }
.em-cell .rain { color: #5BA8FF; font-weight: 650; }

/* Iconos meteorológicos */
.em-wx { display: inline-block; flex: none; }
.em-wx svg { width: 100%; height: 100%; overflow: visible; }

/* Calendario de cobertura */
.em-cal { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.em-cal span { width: 12px; height: 12px; border-radius: 3px; background: var(--em-surface-3); }
.em-cal span.l1 { background: color-mix(in srgb, var(--em-accent) 30%, var(--em-surface-3)); }
.em-cal span.l2 { background: color-mix(in srgb, var(--em-accent) 60%, var(--em-surface-3)); }
.em-cal span.l3 { background: var(--em-accent); }
.em-cal span.gap { background: color-mix(in srgb, var(--em-bad) 55%, var(--em-surface-3)); }
.em-cal span.none { background: transparent; }

/* Progreso */
.em-progress { height: 8px; border-radius: 4px; background: var(--em-surface-3); overflow: hidden; }
.em-progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--em-accent-2), var(--em-accent)); border-radius: 4px; transition: width .6s ease; }
.em-progress.indeterminate > span { width: 35% !important; animation: em-indet 1.3s ease-in-out infinite; }

/* Log en vivo */
.em-log { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .76rem; line-height: 1.55; background: var(--em-bg); border: 1px solid var(--em-border); border-radius: 12px; padding: 10px 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.em-log .w { color: var(--em-warn); }
.em-log .e { color: var(--em-bad); }
.em-log .t { color: var(--em-faint); margin-right: 8px; }

/* Esqueletos de carga */
.em-skel { position: relative; overflow: hidden; background: var(--em-surface-2); border-radius: 10px; }
.em-skel::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--em-text) 6%, transparent), transparent); animation: em-shimmer 1.4s ease-in-out infinite; }
.em-skel.line { height: 12px; margin: 8px 0; }
.em-skel.title { height: 20px; width: 40%; margin-bottom: 14px; }
.em-skel.block { height: 220px; }
.em-skel.circle { border-radius: 50%; }

.em-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 34px 16px; color: var(--em-muted); }
.em-empty .mud-icon-root { font-size: 2.4rem; color: var(--em-faint); }
.em-empty b { color: var(--em-text); }

.em-chart { width: 100%; min-height: 160px; }

.em-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .86rem; }
.em-kv dt { color: var(--em-muted); }
.em-kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.em-task { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; }
.em-task-n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--em-surface-2); color: var(--em-muted); }
.em-steps { white-space: pre-wrap; font-size: .85rem; color: var(--em-muted); background: var(--em-surface-2); border-radius: 12px; padding: 10px 12px; margin: 8px 0 0; border: 1px solid var(--em-border); }
.em-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; background: var(--em-surface-2); border: 1px solid var(--em-border); padding: 1px 6px; border-radius: 6px; }

.em-formula { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; background: var(--em-surface-2); border-radius: 10px; padding: 8px 12px; border: 1px solid var(--em-border); display: inline-block; }

/* Arranque */
.em-boot { min-height: 60vh; display: grid; place-items: center; }
.em-boot-logo { width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(135deg, #22D3A6, #7C8CFF); animation: em-breathe 1.2s ease-in-out infinite; }

/* Login */
.em-login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--em-hero); }
.em-login-card { width: 100%; max-width: 400px; background: color-mix(in srgb, var(--em-surface) 88%, transparent); backdrop-filter: blur(16px); border: 1px solid var(--em-border-strong); border-radius: 24px; padding: 30px 26px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .6); animation: em-rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.em-login-card h1 { font-size: 1.5rem; margin: 18px 0 4px; letter-spacing: -0.03em; }
.em-login-card p { color: var(--em-muted); margin: 0 0 22px; font-size: .9rem; }
.em-login-card .em-field { margin-bottom: 14px; }
.em-login-card .em-input { width: 100%; padding: 12px 14px; font-size: .95rem; }
.em-login-card .em-btn { width: 100%; padding: 12px; font-size: .95rem; margin-top: 6px; }
.em-login-error { background: color-mix(in srgb, var(--em-bad) 14%, transparent); color: var(--em-bad); padding: 10px 12px; border-radius: 12px; font-size: .86rem; margin-bottom: 14px; }
.em-check { display: flex; align-items: center; gap: 8px; color: var(--em-muted); font-size: .86rem; margin: 4px 0 10px; }
.em-check input { accent-color: var(--em-accent); width: 16px; height: 16px; }
.em-login-foot { text-align: center; color: var(--em-faint); font-size: .74rem; margin-top: 18px; }

/* MudBlazor: integración con el sistema */
.mud-popover { border-radius: 14px !important; border: 1px solid var(--em-border); box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .45) !important; }
.mud-dialog { border-radius: 20px !important; border: 1px solid var(--em-border-strong); background: var(--em-surface) !important; }
.mud-snackbar { border-radius: 14px !important; font-weight: 550; }
.mud-tooltip { border-radius: 8px !important; font-size: .76rem !important; }

#blazor-error-ui { display: none; position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 1000; background: var(--em-bad); color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
#blazor-error-ui a { color: #fff; font-weight: 700; margin-left: 8px; }
#blazor-error-ui .dismiss { cursor: pointer; margin-left: 10px; }

/* ───────── Animaciones ───────── */
@keyframes em-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes em-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes em-rise-tall { from { opacity: 0; transform: scaleY(.3); transform-origin: bottom; } to { opacity: 1; transform: none; } }
@keyframes em-slide-down { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes em-slide-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes em-pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes em-shimmer { 100% { transform: translateX(100%); } }
@keyframes em-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes em-indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
@keyframes em-breathe { 0%, 100% { transform: scale(.92); opacity: .7; } 50% { transform: scale(1); opacity: 1; } }
@keyframes em-spin { to { transform: rotate(360deg); } }
@keyframes em-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes em-drop { 0% { transform: translateY(-2px); opacity: .55; } 50% { opacity: 1; } 100% { transform: translateY(3px); opacity: .55; } }

.em-stagger > * { animation: em-rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.em-stagger > *:nth-child(2) { animation-delay: .04s; }
.em-stagger > *:nth-child(3) { animation-delay: .08s; }
.em-stagger > *:nth-child(4) { animation-delay: .12s; }
.em-stagger > *:nth-child(5) { animation-delay: .16s; }
.em-stagger > *:nth-child(6) { animation-delay: .20s; }
.em-stagger > *:nth-child(n+7) { animation-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ───────── Responsive (mobile-first en el contenido, escritorio con barra lateral) ───────── */
@media (max-width: 1100px) {
    .em-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1280px) {
    .em-grid-main { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 959.98px) {
    .em-sidebar { display: none; }
    .em-main { margin-left: 0; padding-bottom: calc(var(--em-bottomnav) + env(safe-area-inset-bottom)); }
    .em-brand-mobile { display: flex; }
    .em-brand-mobile .em-brand-mark { width: 32px; height: 32px; border-radius: 10px; }
    .em-topbar { padding: 0 14px; height: 58px; }
    .em-topbar .em-live { padding: 5px 10px; font-size: .74rem; }
    .em-content { padding: 16px 16px 24px; }
    .em-banner { margin: 12px 16px 0; }
    .em-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .em-grid-2 { grid-template-columns: minmax(0, 1fr); }
    .em-span-2 { grid-column: auto; }
    .em-page-head h1 { font-size: 1.4rem; }
    .em-card-head > .em-select, .em-card-head > .em-seg { width: 100%; }
    .em-page-head > .em-row { width: 100%; }
    .em-page-head > .em-row .em-btn { flex: 1 1 auto; }
    .em-card { padding: 16px; border-radius: 16px; }

    .em-bottomnav {
        display: grid; grid-template-columns: repeat(5, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
        height: calc(var(--em-bottomnav) + env(safe-area-inset-bottom));
        padding: 6px 6px env(safe-area-inset-bottom);
        background: color-mix(in srgb, var(--em-surface) 86%, transparent);
        backdrop-filter: saturate(160%) blur(16px);
        -webkit-backdrop-filter: saturate(160%) blur(16px);
        border-top: 1px solid var(--em-border);
    }
    .em-bottom-item { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 14px; color: var(--em-muted) !important; font-size: .68rem; font-weight: 650; text-decoration: none !important; transition: color .15s ease, background .15s ease; -webkit-tap-highlight-color: transparent; }
    .em-bottom-item .mud-icon-root { font-size: 1.45rem; transition: transform .2s cubic-bezier(.2, .9, .3, 1.4); }
    .em-bottom-item.active { color: var(--em-accent) !important; }
    .em-bottom-item.active .mud-icon-root { transform: translateY(-1px) scale(1.08); }
    .em-bottom-icon-wrap { position: relative; display: grid; place-items: center; }
    .em-bottom-icon-wrap .em-dot { position: absolute; top: -1px; right: -4px; }
    .em-footer { padding-bottom: 18px; }
}

@media (max-width: 520px) {
    .em-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .em-stat-value { font-size: 1.2rem; }
    .em-podium-name { font-size: .78rem; }
    .em-topbar { gap: 4px; }
    .em-topbar .em-live-prefix { display: none; }
}

/* Matriz de progreso del histórico (fuente × ubicación) */
.em-pmatrix { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: .8rem; }
.em-pmatrix th { font-size: .7rem; font-weight: 700; color: var(--em-faint); text-transform: uppercase; letter-spacing: .05em; padding: 4px; white-space: nowrap; }
.em-pmatrix td:first-child { white-space: nowrap; padding-right: 8px; }
.em-pcell { position: relative; height: 30px; min-width: 70px; border-radius: 9px; background: var(--em-surface-2); overflow: hidden; display: grid; place-items: center; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--em-text); }
.em-pcell > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, color-mix(in srgb, var(--em-accent-2) 45%, transparent), color-mix(in srgb, var(--em-accent) 55%, transparent)); }
.em-pcell > b { position: relative; font-size: .76rem; }
.em-pcell.full > i { background: color-mix(in srgb, var(--em-accent) 60%, transparent); }
.em-pcell.none { background: transparent; border: 1px dashed var(--em-border); color: var(--em-faint); }
.em-pcell.err { box-shadow: inset 0 0 0 2px var(--em-bad); }

/* Ayuda plegable */
.em-help { border: 1px solid var(--em-border); border-radius: 14px; background: var(--em-surface); padding: 0; }
.em-help summary { cursor: pointer; list-style: none; padding: 10px 14px; font-weight: 650; font-size: .86rem; color: var(--em-muted); display: flex; align-items: center; gap: 8px; }
.em-help summary::-webkit-details-marker { display: none; }
.em-help[open] summary { color: var(--em-text); border-bottom: 1px solid var(--em-border); }
.em-help-body { padding: 4px 16px 12px; font-size: .86rem; line-height: 1.6; }
.em-help-body ul { padding-left: 18px; margin: 6px 0; }
.em-help-body li { margin: 6px 0; }
.em-rank { width: 28px; height: 28px; border-radius: 9px; display: inline-grid; place-items: center; font-weight: 800; font-size: .8rem; background: var(--em-surface-2); color: var(--em-muted); }
.em-rank.r1 { background: linear-gradient(135deg, #F5C451, #E89B1A); color: #2A1A00; }
.em-rank.r2 { background: linear-gradient(135deg, #D7DEE8, #9AA7B8); color: #1A2230; }
.em-rank.r3 { background: linear-gradient(135deg, #E3A27A, #B86B3E); color: #2A1405; }
.em-trait { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--em-border); font-size: .88rem; }
.em-trait:last-child { border-bottom: none; }
.em-trait .mud-icon-root { margin-top: 1px; }

@media (max-width: 640px) {
    .em-hide-sm { display: none; }
    .em-table td, .em-table th { padding: 10px 8px; }
    .em-score { min-width: 96px; }
}

/* Animaciones de los iconos meteorológicos */
.em-wx-spin { animation: em-spin 40s linear infinite; }
.em-wx-drop { animation: em-drop 1.4s ease-in infinite; }
.em-wx-drift { animation: em-float 4s ease-in-out infinite; }
.em-wx-flash { animation: em-breathe 1.6s ease-in-out infinite; }
button.em-day { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.em-consensus-row { display: grid; grid-template-columns: 74px 1fr auto; gap: 4px 10px; align-items: center; padding: 6px 0; font-size: .82rem; border-bottom: 1px solid var(--em-border); }
.em-consensus-row:last-child { border-bottom: none; }
.em-consensus-row .em-chip { justify-self: end; }
.em-consensus-row .sub { grid-column: 2 / 3; color: var(--em-muted); font-size: .76rem; }

/* Inicio: tarjeta "ahora" */
.em-now { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: center; padding: 24px; }
.em-now-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.em-now-stats .em-stat { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--em-surface) 55%, transparent); border: 1px solid var(--em-border); }
@media (max-width: 959.98px) {
    .em-now { grid-template-columns: minmax(0, 1fr); padding: 18px; }
    .em-now-stats { gap: 10px; }
}

/* ───────── Rediseño: selector de población, sello EliMeteo, tira horaria, pipeline ───────── */
.em-place { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 8px; border-radius: 999px; background: var(--em-surface); border: 1px solid var(--em-border); color: var(--em-text); font-weight: 650; font-size: .86rem; transition: border-color .15s ease, background .15s ease; white-space: nowrap; }
.em-place:hover { border-color: var(--em-border-strong); background: var(--em-surface-2); }
.em-place .mud-icon-root:first-child { color: var(--em-accent); }
.em-place-chevron { color: var(--em-faint); }
.em-brand-mobile { display: none; }

.em-own { position: relative; border-color: color-mix(in srgb, var(--em-accent) 45%, var(--em-border)) !important; box-shadow: var(--em-shadow), 0 0 0 1px color-mix(in srgb, var(--em-accent) 25%, transparent), 0 20px 60px -30px color-mix(in srgb, var(--em-accent) 70%, transparent); }
.em-seal { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 7px; border-radius: 999px; background: var(--em-accent-soft); color: var(--em-accent); font-weight: 750; font-size: .78rem; letter-spacing: .01em; border: 1px solid color-mix(in srgb, var(--em-accent) 30%, transparent); white-space: nowrap; }
.em-seal-mark { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; background: linear-gradient(135deg, #22D3A6, #7C8CFF); }
.em-seal-mark img { width: 12px; height: 12px; }
.em-seal small { font-weight: 550; color: var(--em-muted); }

.em-hours { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.em-hour { flex: 0 0 76px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; border-radius: 14px; background: var(--em-surface-2); border: 1px solid var(--em-border); text-align: center; }
.em-hour.now { border-color: var(--em-accent); background: var(--em-accent-soft); }
.em-hour.day0 { }
.em-hour-t { font-weight: 750; font-variant-numeric: tabular-nums; font-size: .98rem; }
.em-hour-h { font-size: .74rem; color: var(--em-muted); font-weight: 650; }
.em-hour-p { font-size: .7rem; color: #5BA8FF; font-weight: 650; min-height: 1em; }
.em-hour-sep { flex: 0 0 auto; writing-mode: vertical-rl; transform: rotate(180deg); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--em-faint); font-weight: 700; padding: 6px 2px; }

.em-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.em-kpi { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--em-surface) 55%, transparent); border: 1px solid var(--em-border); }
.em-kpi .em-stat-value { font-size: 1.3rem; }

.em-compare { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.em-compare th { text-align: center; font-size: .72rem; color: var(--em-muted); font-weight: 700; text-transform: capitalize; padding: 0 6px 2px; }
.em-compare th:first-child { text-align: left; }
.em-compare td { text-align: center; padding: 8px 6px; font-variant-numeric: tabular-nums; font-size: .9rem; background: var(--em-surface-2); }
.em-compare td:first-child { text-align: left; border-radius: 12px 0 0 12px; padding-left: 12px; white-space: nowrap; }
.em-compare td:last-child { border-radius: 0 12px 12px 0; }
.em-compare tr.own td { background: var(--em-accent-soft); font-weight: 750; }
.em-compare .lo { color: var(--em-muted); font-weight: 500; }
.em-compare .rain { display: block; font-size: .7rem; color: #5BA8FF; font-weight: 650; }

.em-pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; counter-reset: step; }
.em-step { position: relative; padding: 16px 16px 14px; border-radius: 16px; background: var(--em-surface-2); border: 1px solid var(--em-border); counter-increment: step; }
.em-step::before { content: counter(step, decimal-leading-zero); position: absolute; top: 12px; right: 14px; font-size: .7rem; font-weight: 800; color: var(--em-faint); letter-spacing: .08em; }
.em-step .mud-icon-root { color: var(--em-accent); font-size: 1.6rem; }
.em-step b { display: block; margin: 8px 0 4px; font-size: .95rem; letter-spacing: -0.01em; }
.em-step p { margin: 0; font-size: .82rem; color: var(--em-muted); line-height: 1.5; }
.em-step .tag { display: inline-block; margin-top: 8px; font-size: .7rem; font-weight: 700; color: var(--em-accent); background: var(--em-accent-soft); padding: 2px 8px; border-radius: 999px; }
.em-step.final { background: var(--em-accent-soft); border-color: color-mix(in srgb, var(--em-accent) 40%, transparent); }

.em-medal { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: .74rem; font-weight: 800; background: var(--em-surface-3); color: var(--em-muted); }
.em-medal.m1 { background: linear-gradient(135deg, #F5C451, #E89B1A); color: #2A1A00; }
.em-medal.m2 { background: linear-gradient(135deg, #D7DEE8, #9AA7B8); color: #1A2230; }
.em-medal.m3 { background: linear-gradient(135deg, #E3A27A, #B86B3E); color: #2A1405; }
.em-delta { font-size: .74rem; font-weight: 700; }
.em-delta.up { color: var(--em-good); }
.em-delta.down { color: var(--em-bad); }
.em-delta.same { color: var(--em-faint); }

.em-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.em-source { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--em-surface-2); border: 1px solid var(--em-border); }
.em-source-dot { width: 12px; height: 12px; border-radius: 4px; flex: none; margin-top: 4px; }
.em-source b { display: block; font-size: .9rem; }
.em-source small { color: var(--em-muted); font-size: .78rem; line-height: 1.45; display: block; }

.em-hero-model { background: var(--em-hero); border-color: var(--em-border-strong); }
.em-bignum { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.em-bignum small { font-size: .9rem; font-weight: 600; color: var(--em-muted); letter-spacing: 0; margin-left: 4px; }

@media (max-width: 959.98px) {
    .em-brand-mobile { display: flex; padding: 0; }
    .em-place { padding: 6px 8px; font-size: .82rem; }
    .em-place-chevron { display: none; }
    .em-topbar .em-live { padding: 5px 8px; font-size: .72rem; }
    .em-hour { flex-basis: 68px; }
    .em-pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 959.98px) { .em-hide-mobile { display: none !important; } }
@media (max-width: 420px) {
    .em-place-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
    .em-topbar .em-live span:last-child { display: none; }
    .em-topbar .em-live { padding: 6px; }
}
.em-table tr.em-ref td { color: var(--em-muted); }
.em-table tr.em-ref .em-src { font-weight: 500; }
.em-compare td { white-space: nowrap; }
@media (max-width: 640px) { .em-compare td { font-size: .84rem; padding: 8px 4px; } .em-compare td:first-child { padding-left: 8px; } }

/* Ajustes del rediseño tras la revisión */
.em-hero-model .em-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1100px) {
    .em-pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .em-step.final { grid-column: span 2; }
}
@media (max-width: 640px) {
    .em-compare th.em-hide-xs, .em-compare td.em-hide-xs { display: none; }
}

/* ── Aviso para instalar la app (PWA), solo en móvil ── */
.em-install {
    position: fixed; z-index: 1400; left: 12px; right: 12px;
    bottom: calc(var(--em-bottomnav) + 12px + env(safe-area-inset-bottom));
    display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px;
    background: var(--em-surface-2); border: 1px solid var(--em-border); border-radius: 16px;
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.55);
    transform: translateY(16px); opacity: 0; transition: transform .25s ease, opacity .25s ease;
}
.em-install.show { transform: none; opacity: 1; }
.em-install img { border-radius: 10px; flex: none; }
.em-install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: .84rem; line-height: 1.35; }
.em-install-text span { color: var(--em-muted); }
.em-install-text svg { vertical-align: -3px; color: var(--em-accent); }
.em-install-go { font: inherit; font-size: .84rem; font-weight: 700; color: #0A0F1C; background: var(--em-accent); border: 0; border-radius: 10px; padding: 9px 14px; cursor: pointer; flex: none; }
.em-install-x { font: inherit; font-size: 1.3rem; line-height: 1; color: var(--em-muted); background: none; border: 0; padding: 4px 6px; cursor: pointer; flex: none; }
