:root {
  --ink: #071729;
  --ink-soft: #41516a;
  --muted: #6b7890;
  --line: #dfe7f1;
  --line-strong: #cad6e3;
  --panel: #fff;
  --page: #f7fafc;
  --dark: #03111f;
  --green: #07946d;
  --green-bright: #08c693;
  --green-soft: #eaf8f3;
  --blue: #2478e8;
  --orange: #ef861f;
  --red: #e33c45;
  --radius: 10px;
  --shadow: 0 14px 42px rgba(7, 23, 41, .055);
  --section: min(1280px, calc(100vw - 64px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.geo-public { margin: 0; background: var(--page); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
svg:not(.echart svg):not(.leaflet-container svg) { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.section-inner, .geo-shell { width: var(--section); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Public navigation: calm, readable and shared by every territorial page. */
/* Header público: siempre blanco y siempre pegado arriba. Cada página lo
   repintaba a su gusto y el menú cambiaba de color según dónde estuvieras. */
.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); background: #fff; }
.site-header-inner { width: var(--section); min-height: 76px; margin: 0 auto; display: flex; align-items: center; gap: 34px; }
.brand { display: inline-flex; align-items: center; gap: 11px; flex: none; }
.brand-mark { position: relative; width: 39px; height: 39px; display: grid; place-items: center; border: 3px solid var(--green); border-radius: 10px 10px 10px 3px; transform: rotate(30deg); }
.brand-mark::before { content: ""; width: 15px; height: 15px; border: 3px solid var(--green); border-radius: 50%; }
.brand-mark-inner { position: absolute; inset: 5px; border: 1px solid rgba(7,148,109,.28); border-radius: 7px; }
.brand-copy { transform: none; }
.brand strong { display: block; color: var(--ink); font-size: 21px; line-height: 1; letter-spacing: -.035em; }
.brand small { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 10px; line-height: 1; }
.primary-nav { display: flex; justify-content: center; align-items: center; flex: 1; }
.nav-enlaces { display: flex; align-items: center; gap: 30px; }
.primary-nav a { color: #17243a; font-size: 14px; font-weight: 700; white-space: nowrap; transition: color .2s; }
.primary-nav a:hover { color: var(--green); }
/* Copia de los botones de sesion para el desplegable: en ancho completo sobran. */
.menu-panel-actions { display: none; }
.header-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.btn, .button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 7px; padding: 0 19px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.btn-ghost, .button-outline { color: var(--ink); border-color: var(--line-strong); background: #fff; }
.btn-primary, .button-primary { color: #fff; border-color: var(--green); background: var(--green); box-shadow: 0 8px 18px rgba(7,148,109,.16); }
.btn:hover, .button:hover { transform: translateY(-1px); }
.menu-button { display: none; }

.geo-shell { padding: 0 0 34px; }
.breadcrumbs { min-height: 62px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.breadcrumbs a:hover { color: var(--green); }
.breadcrumbs span[aria-current] { color: var(--ink-soft); font-weight: 700; }
.eyebrow, .card-kicker { margin: 0 0 7px; color: var(--green); font-size: 11px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.place-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(350px, .65fr); gap: 26px; align-items: stretch; padding: 15px 0 28px; }
.place-hero > *, .province-hero > * { min-width: 0; }
.place-intro { padding: 8px 0 0; }
.title-line { display: flex; align-items: center; gap: 16px; }
h1, h2, h3, p { overflow-wrap: break-word; }
.title-line h1 { margin: 0; font-size: clamp(35px, 4vw, 52px); line-height: 1.05; letter-spacing: -.045em; }
.save-button { min-height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; color: var(--green); border: 1px solid #a9dacb; border-radius: 7px; background: #fff; font-size: 12px; font-weight: 800; cursor: pointer; }
.save-button svg { width: 15px; height: 15px; }
.save-button[aria-pressed="true"] { color: #fff; background: var(--green); }
.place-meta { margin: 10px 0 0; color: var(--ink); font-size: 16px; font-weight: 800; }
.hero-description { max-width: 680px; margin: 15px 0 22px; color: var(--ink-soft); font-size: 15px; }
.fact-row { display: flex; flex-wrap: wrap; gap: 9px; }
.fact-chip { min-width: 148px; display: flex; gap: 10px; align-items: center; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.fact-icon { width: 28px; height: 28px; display: grid; place-items: center; color: var(--blue); border-radius: 7px; background: #eef4ff; font-size: 18px; }
.fact-chip small, .fact-chip strong { display: block; }
.fact-chip small { margin-bottom: 2px; color: var(--muted); font-size: 10px; }
.fact-chip strong { font-size: 13px; }

.coverage-card { padding: 21px; }
.card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-heading h2, .section-title h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-live { background: var(--green-bright); box-shadow: 0 0 0 5px rgba(8,198,147,.11); }
.coverage-body { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 18px; margin: 18px 0 12px; }
.coverage-gauge { width: 142px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--green) 0 var(--coverage), #e3e9ef var(--coverage) 100%); position: relative; }
.coverage-gauge::after { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: #fff; }
.coverage-gauge > div { z-index: 1; text-align: center; }
.coverage-gauge strong, .coverage-gauge span { display: block; }
.coverage-gauge strong { font-size: 30px; letter-spacing: -.05em; }
.coverage-gauge span { color: var(--muted); font-size: 11px; font-weight: 800; }
.coverage-copy strong { display: block; font-size: 14px; }
.coverage-copy p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.text-link { color: #096bd8; font-size: 12px; font-weight: 900; }

.section-tabs { display: flex; gap: 34px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.section-tabs a { flex: none; padding: 15px 3px 14px; color: var(--ink-soft); border-bottom: 2px solid transparent; font-size: 12px; font-weight: 800; }
.section-tabs a:hover, .section-tabs a.active { color: var(--green); border-bottom-color: var(--green); }
.summary-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; padding: 23px 0 13px; }
.summary-main { display: grid; grid-template-columns: 76px 1fr; gap: 18px; align-items: start; padding: 22px; }
.summary-main h2, .data-key-card h2, .detail-card h2, .locked-card h2, .notice h2, .notice h3 { margin: 0 0 8px; font-size: 16px; }
.summary-main p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.illustration-badge { width: 70px; height: 70px; display: grid; place-items: center; color: var(--green); border-radius: 50%; background: var(--green-soft); }
.illustration-badge svg { width: 48px; height: 48px; }
.data-key-card { padding: 20px; }
.data-row { min-height: 34px; display: flex; justify-content: space-between; gap: 16px; align-items: center; border-bottom: 1px solid #edf1f5; color: var(--ink-soft); font-size: 12px; }
.data-row:last-child { border-bottom: 0; }
.data-row strong { color: var(--ink); text-align: right; }

.notice { display: grid; grid-template-columns: 40px 1fr auto; gap: 16px; align-items: center; margin: 0 0 14px; padding: 17px 20px; border: 1px solid #f0d8aa; border-radius: var(--radius); background: #fffaf0; }
.notice > svg { width: 30px; height: 30px; color: #bd7a0e; }
.notice h2, .notice h3 { margin-bottom: 3px; }
.notice p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.compact-notice { grid-template-columns: 34px 1fr; margin-top: 12px; }
.section-block { padding: 22px 0 4px; }
.section-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 22px; margin-bottom: 13px; }
.section-title p { margin: 0; color: var(--muted); font-size: 12px; }
.section-title.compact { align-items: center; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.metric-card { min-height: 150px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 8px 24px rgba(7,23,41,.035); }
.metric-card small { min-height: 36px; display: block; color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.metric-card > strong { display: block; margin: 5px 0; font-size: 25px; letter-spacing: -.04em; }
.metric-card strong em { font-size: 12px; font-style: normal; letter-spacing: 0; }
.metric-card p { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.trend { display: block; color: var(--green); font-size: 11px; font-weight: 800; }
.trend.negative { color: var(--red); }
.metric-locked { border-style: dashed; background: #fbfcfd; }
.metric-locked svg { width: 24px; height: 24px; color: var(--muted); }
.metric-locked > strong { font-size: 14px; letter-spacing: 0; }
.metric-locked a { color: var(--green); font-size: 11px; font-weight: 900; }
.sample-note { margin-top: 14px; padding: 6px 8px; color: #95600d; border-radius: 5px; background: #fff6df; font-size: 10px; font-weight: 800; }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 22px 0 13px; }
.detail-card { padding: 18px; }
.detail-head { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; margin-bottom: 8px; }
.detail-head h2 { margin: 0; }
.detail-head > span:last-child { color: var(--muted); font-size: 10px; }
.mini-icon { width: 28px; height: 28px; display: grid; place-items: center; color: var(--blue); border-radius: 7px; background: #eef4ff; font-size: 12px; font-weight: 900; }
.locked-card { display: grid; grid-template-columns: 46px 1fr; gap: 14px; padding: 20px; border-style: dashed; background: #fbfcfd; }
.lock-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--muted); border-radius: 50%; background: #eef1f4; }
.lock-icon svg { width: 22px; height: 22px; }
.locked-card p { margin: 0 0 7px; color: var(--muted); font-size: 12px; }

.signals-panel, .municipalities-panel { margin-top: 10px; padding: 20px; }
.section-note { margin: 4px 0 12px; color: var(--muted); font-size: 11px; }
.signal-list { display: grid; }
.signal-row { min-height: 50px; display: grid; grid-template-columns: 9px 84px 1fr auto; gap: 12px; align-items: center; border-top: 1px solid #edf1f5; font-size: 11px; }
.signal-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.signal-positivo { background: var(--green); }
.signal-negativo, .signal-riesgo { background: var(--red); }
.signal-mixto { background: var(--orange); }
.signal-row time { color: var(--muted); }
.signal-row strong { font-size: 11px; font-weight: 700; }
.signal-tag, .data-status { padding: 4px 8px; color: var(--green); border-radius: 12px; background: var(--green-soft); font-size: 9px; font-weight: 900; text-transform: capitalize; }
.limited-note { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; padding: 10px 12px; color: #8c6218; border: 1px solid #f0dfb8; border-radius: 7px; background: #fffbf1; font-size: 10px; }
.limited-note a { color: var(--green); font-weight: 900; }
.related-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.related-card { display: grid; min-height: 112px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.related-card span { color: var(--muted); font-size: 10px; }
.related-card em { align-self: end; color: #096bd8; font-size: 11px; font-style: normal; font-weight: 900; }
.echart-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.province-echart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.echart-card { min-width: 0; overflow: hidden; background: linear-gradient(180deg, #fff, #fbfdff); }
.echart-card header { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 48px; padding: 13px 15px 6px; border-bottom: 1px solid #eef3f7; }
.echart-card h3 { margin: 0; color: #102238; font-size: 12px; line-height: 1.25; }
.echart-card header span { color: var(--muted); font-size: 9px; text-align: right; }
.echart { width: 100%; height: 230px; }
.echart svg, .echart svg * { vector-effect: non-scaling-stroke; }
.province-echart-grid .echart { height: 290px; }

.public-map-panel { padding: 0; overflow: hidden; }
.public-map-head { display: flex; justify-content: space-between; gap: 18px; align-items: end; padding: 18px 20px 14px; border-bottom: 1px solid #eef3f7; }
.public-map-head h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.public-map-head p { max-width: 560px; margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.public-map-badge { flex: none; padding: 6px 9px; color: #16725b; border: 1px solid #b8ded2; border-radius: 999px; background: #effaf6; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.public-map-canvas { position: relative; z-index: 0; width: 100%; height: 390px; background: #eaf0f5; }
.public-map-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 11px 20px; border-top: 1px solid #eef3f7; background: #fff; color: var(--ink-soft); font-size: 10px; }
.public-map-legend strong { margin-right: 4px; color: var(--ink); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.public-map-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.public-map-legend i { width: 10px; height: 10px; display: inline-block; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 0 0 3px rgba(7,23,41,.08); }
.public-map-status { min-height: 35px; display: flex; align-items: center; padding: 0 20px; color: var(--muted); border-top: 1px solid #eef3f7; background: #fbfdff; font-size: 11px; font-weight: 700; }
.public-map-status[data-state="warning"] { color: #96610c; background: #fff8e8; }
.public-map-status[data-state="error"], .public-map-status[data-state="empty"] { color: #9c2f38; background: #fff1f2; }
.public-map-popup { display: grid; gap: 3px; min-width: 160px; color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.public-map-popup strong { font-size: 13px; }
.public-map-popup span, .public-map-popup small { color: var(--muted); font-size: 11px; }
.public-map-popup a { margin-top: 4px; color: #096bd8; font-size: 11px; font-weight: 900; }
.leaflet-container { font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.leaflet-control-attribution { font-size: 9px; }

.alert-band { display: grid; grid-template-columns: 54px 1fr minmax(340px, .8fr); gap: 18px; align-items: center; margin-top: 26px; padding: 20px 25px; border: 1px solid #d9eee7; border-radius: var(--radius); background: linear-gradient(90deg, #f2faf7, #fff); }
.alert-icon { width: 48px; height: 48px; display: grid; place-items: center; color: var(--green); border: 1px solid #94d3bf; border-radius: 50%; font-size: 20px; font-weight: 900; }
.alert-band h2 { margin: 0; font-size: 15px; }
.alert-band p { margin: 3px 0 0; color: var(--ink-soft); font-size: 11px; }
.alert-band form { display: flex; }
.alert-band input { min-width: 0; flex: 1; height: 42px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 7px 0 0 7px; outline: none; }
.alert-band form .button { border-radius: 0 7px 7px 0; }
.public-alert-modal[hidden] { display: none; }
.public-alert-modal { position: fixed; inset: 0; z-index: 2500; display: grid; place-items: center; padding: 20px; background: rgba(4, 20, 36, .64); backdrop-filter: blur(4px); }
.public-alert-dialog { position: relative; width: min(100%, 450px); padding: 32px; border-radius: 16px; background: #fff; box-shadow: 0 28px 80px rgba(0, 20, 40, .28); text-align: center; }
.public-alert-dialog h2 { margin: 12px 0 8px; font-size: 23px; }
.public-alert-dialog p { color: var(--muted); line-height: 1.55; }
.public-alert-dialog-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto; border-radius: 50%; background: #e8f8f2; color: #087a5b; font-size: 23px; }
.public-alert-close { position: absolute; top: 12px; right: 14px; border: 0; background: none; color: #64748b; font-size: 28px; cursor: pointer; }
.public-alert-dialog form[hidden] { display: none; }
.public-alert-dialog form { display: grid; gap: 10px; margin-top: 20px; text-align: left; }
.public-alert-dialog form label { font-size: 12px; font-weight: 800; }
.public-alert-dialog form input { height: 48px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 15px; }
.public-alert-dialog form input[name="code"] { height: 52px; padding: 0; text-align: center; font-size: 24px; font-weight: 800; letter-spacing: 7px; }
.public-alert-dialog .public-alert-consent { display: grid; grid-template-columns: 18px 1fr; gap: 9px; align-items: start; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.5; }
.public-alert-dialog .public-alert-consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: #087a5b; }
.public-alert-dialog .public-alert-consent a { color: #087a5b; font-weight: 700; text-decoration: underline; }
.public-alert-dialog form button[type="submit"] { margin-top: 6px; }
.public-alert-resend { margin-top: 16px; border: 0; background: none; color: #087a5b; font-weight: 800; cursor: pointer; }
.public-alert-feedback { min-height: 21px; margin: 12px 0 0 !important; font-size: 12px; font-weight: 800; }
.public-alert-feedback[data-state="success"] { color: #087a5b; }
.public-alert-feedback[data-state="error"] { color: #b4232d; }
body.public-alert-open { overflow: hidden; }

/* Province */
.province-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(390px, .7fr); gap: 28px; align-items: center; padding: 16px 0 29px; }
.province-hero h1, .ccaa-hero h1 { max-width: 700px; margin: 0; font-size: clamp(38px, 4.5vw, 59px); line-height: 1.03; letter-spacing: -.052em; }
.province-hero h1 span, .ccaa-hero h1 span { display: block; color: var(--green); }
.province-hero > div > p:not(.eyebrow), .ccaa-hero > p:not(.eyebrow) { max-width: 690px; margin: 17px 0; color: var(--ink-soft); font-size: 15px; }
.hero-actions { display: flex; gap: 10px; margin: 19px 0 15px; }
.trust-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.trust-chips span { padding: 5px 8px; color: #26725d; border-radius: 5px; background: var(--green-soft); font-size: 10px; font-weight: 800; }
.province-summary { padding: 23px; background: linear-gradient(145deg, #fff, #f3faf7); }
.province-summary h2 { margin: 2px 0 18px; font-size: 22px; }
.province-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.province-facts div { padding: 13px; border: 1px solid #dfeae6; border-radius: 8px; background: rgba(255,255,255,.8); }
.province-facts strong, .province-facts span { display: block; }
.province-facts strong { font-size: 21px; }
.province-facts span { color: var(--muted); font-size: 9px; }
.honesty-note { margin: 14px 0 0; color: var(--muted); font-size: 10px; }
.province-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.market-sample { padding-top: 27px; }
.province-dashboard-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; padding: 24px 0 4px; }
.coverage-detail, .methodology-card { padding: 20px; }
.coverage-bars { display: grid; gap: 13px; margin-top: 18px; }
.coverage-bars > div { display: grid; grid-template-columns: 90px 1fr 64px; gap: 12px; align-items: center; font-size: 11px; }
.coverage-bars strong { text-align: right; }
progress { width: 100%; height: 8px; border: 0; border-radius: 20px; overflow: hidden; background: #e5ebf0; }
progress::-webkit-progress-bar { background: #e5ebf0; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #0bab82, #37cda5); border-radius: 20px; }
progress::-moz-progress-bar { background: #0bab82; }
.methodology-card > .mini-icon { margin-bottom: 12px; }
.methodology-card h2 { margin: 0; font-size: 17px; }
.methodology-card p, .methodology-card li { color: var(--ink-soft); font-size: 11px; }
.methodology-card ul { padding-left: 18px; }
.table-tools { display: flex; gap: 8px; }
.table-tools input, .table-tools select { min-height: 37px; padding: 0 10px; color: var(--ink-soft); border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; font-size: 11px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 10px 9px; color: var(--muted); background: #f5f8fa; text-align: left; white-space: nowrap; }
td { padding: 10px 9px; border-bottom: 1px solid #edf1f5; white-space: nowrap; }
td:first-child strong, td:first-child small { display: block; }
td:first-child small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.municipality-link { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(9,107,216,.28); text-underline-offset: 3px; }
.municipality-link:hover { color: #096bd8; text-decoration-color: currentColor; }
.data-status.partial { color: #9b650e; background: #fff4dc; }
.data-status.basic { color: #516079; background: #eef2f6; }
.soon { color: var(--muted); font-size: 9px; }
.table-foot { display: flex; justify-content: space-between; margin-top: 12px; color: var(--muted); font-size: 10px; }
tr[hidden] { display: none; }

/* Autonomous community */
.ccaa-hero { padding: 35px 0 30px; }
.ccaa-hero .fact-row { margin-top: 25px; }
.ccaa-metrics { grid-template-columns: repeat(4, 1fr); }
.province-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.province-card { min-height: 150px; display: grid; grid-template-columns: 45px 1fr; gap: 14px; align-items: start; padding: 20px; transition: transform .2s, border-color .2s; }
.province-card:hover { transform: translateY(-3px); border-color: #a8dccc; }
.province-card-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--green); border-radius: 10px; background: var(--green-soft); font-weight: 900; }
.province-card h3 { margin: 1px 0 3px; }
.province-card p { margin: 0; color: var(--muted); font-size: 12px; }
.province-card > strong { grid-column: 2; align-self: end; color: #096bd8; font-size: 11px; }
.geo-search-panel { display: grid; grid-template-columns: 1fr minmax(380px, .8fr); gap: 28px; align-items: center; margin-top: 28px; padding: 25px; }
.geo-search-panel h2 { margin: 0; }
.geo-search-panel p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.geo-search { position: relative; }
.geo-filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 9px; }
.geo-field { display: grid; gap: 5px; }
.geo-field label { color: var(--ink-soft); font-size: 9px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.geo-field select { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); outline: 0; font-size: 11px; }
.geo-field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(7,148,109,.1); }
.geo-search input { width: 100%; min-height: 48px; padding: 0 42px 0 15px; border: 1px solid var(--line-strong); border-radius: 8px; outline: 0; }
.geo-search input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(7,148,109,.1); }
.search-spinner { position: absolute; top: 17px; right: 16px; width: 15px; height: 15px; border: 2px solid #d5dee7; border-top-color: var(--green); border-radius: 50%; opacity: 0; }
.geo-search .geo-main-search { position: relative; }
.geo-search .geo-main-search .search-spinner { top: 17px; right: 16px; }
.geo-search.loading .search-spinner { opacity: 1; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.geo-search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 10; display: none; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 18px 45px rgba(7,23,41,.15); }
.geo-search-results.open { display: grid; }
.search-result { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; padding: 10px; border-radius: 6px; }
.search-result:hover { background: var(--green-soft); }
.search-result strong { font-size: 12px; }
.search-result span { color: var(--muted); font-size: 10px; }
.search-result em { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--green); font-size: 9px; font-style: normal; font-weight: 900; text-transform: uppercase; }

/* Footer */
.public-footer { margin-top: 0; padding: 37px 0 24px; color: rgba(255,255,255,.76); background: #031525; }
.public-footer .brand-mark { border-color: #fff; }
.public-footer .brand-mark::before { border-color: #fff; }
.public-footer .brand strong { color: #fff; }
.public-footer .brand small { color: rgba(255,255,255,.65); }
.footer-grid { display: grid; grid-template-columns: 1.55fr repeat(4,1fr); gap: 38px; padding-bottom: 28px; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer-brand p { max-width: 260px; margin: 18px 0; color: rgba(255,255,255,.6); font-size: 11px; }
.social-links { display: flex; gap: 13px; }
.social-links a { font-size: 12px; font-weight: 800; }
.footer-grid nav { display: grid; align-content: start; gap: 7px; }
.footer-grid nav strong { margin-bottom: 6px; color: #fff; font-size: 12px; }
.footer-grid nav a { color: rgba(255,255,255,.62); font-size: 11px; }
.footer-grid nav a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 18px; color: rgba(255,255,255,.55); font-size: 10px; }

@media (max-width: 1080px) {
  :root { --section: min(960px, calc(100vw - 40px)); }
  /* Sin sitio para todos los enlaces: menu hamburguesa con un desplegable
     pequeño anclado al boton, en vez de una fila con scroll que escondia
     enlaces visibles. «Cerrar sesion» se mete dentro; el boton principal se
     queda fuera hasta que la pantalla ya no da ni para eso (560px). */
  .site-header-inner { position: relative; gap: 14px; }
  .header-actions { margin-left: auto; }
  .header-actions .btn-ghost { display: none; }
  .menu-button { display: grid; gap: 4px; align-content: center; justify-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; cursor: pointer; transition: border-color .2s, background .2s; }
  .menu-button:hover { border-color: var(--green); background: rgba(7,148,109,.06); }
  .menu-button span { width: 17px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .22s, opacity .18s; }
  .menu-button.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-button.is-open span:nth-child(2) { opacity: 0; }
  .menu-button.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .primary-nav { position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; display: none; flex-direction: column; align-items: stretch; min-width: 232px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 18px 44px rgba(15,32,54,.18), 0 2px 6px rgba(15,32,54,.06); }
  .primary-nav.is-open { display: flex; animation: menu-abre .16s ease-out; }
  .nav-enlaces { display: grid; gap: 1px; }
  .primary-nav a { display: block; padding: 10px 12px; border-radius: 9px; color: var(--ink-soft); font-size: 13.5px; font-weight: 600; transition: background .16s, color .16s; }
  .primary-nav a:hover { color: var(--green); background: rgba(7,148,109,.08); }
  .menu-panel-actions { display: grid; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
  .menu-panel-actions .btn { width: 100%; min-height: 40px; font-size: 13px; }
  .menu-panel-actions .btn:hover { transform: none; }
  .menu-panel-actions .btn-primary { display: none; }
  .place-hero, .province-hero { grid-template-columns: 1fr; }
  .province-summary { max-width: 700px; }
  .metric-grid, .province-metrics { grid-template-columns: repeat(3, 1fr); }
  .echart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .related-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr repeat(2,1fr); }
}

@media (max-width: 760px) {
  :root { --section: min(100vw - 26px, 620px); }
  /* En móvil sigue pegado arriba: es donde más falta hace para volver al menú
     sin subir toda la página. */
  .site-header-inner { min-height: 70px; }
  .breadcrumbs { min-height: 52px; white-space: nowrap; overflow-x: auto; }
  .title-line { align-items: flex-start; }
  .hero-actions { flex-wrap: wrap; }
  .title-line h1, .province-hero h1, .ccaa-hero h1 { font-size: 38px; }
  .coverage-body, .summary-grid, .detail-grid, .province-dashboard-grid, .geo-search-panel { grid-template-columns: 1fr; }
  .geo-filter-grid { grid-template-columns: 1fr; }
  .coverage-body { justify-items: center; text-align: center; }
  .metric-grid, .province-metrics, .ccaa-metrics { grid-template-columns: repeat(2, 1fr); }
  .public-map-head { align-items: flex-start; flex-direction: column; }
  .public-map-canvas { height: 330px; }
  .notice { grid-template-columns: 34px 1fr; }
  .notice .button { grid-column: 1 / -1; }
  .section-title { align-items: flex-start; flex-direction: column; }
  .section-tabs { gap: 22px; }
  .signal-row { grid-template-columns: 8px 1fr auto; padding: 9px 0; }
  .signal-row time { grid-column: 2; grid-row: 2; }
  .signal-row strong { grid-column: 2; grid-row: 1; }
  .signal-tag { grid-column: 3; grid-row: 1 / 3; }
  .alert-band { grid-template-columns: 44px 1fr; }
  .alert-band form, .alert-band > .button { grid-column: 1 / -1; }
  .province-card-grid { grid-template-columns: 1fr; }
  .table-tools { width: 100%; flex-direction: column; }
  .table-tools input, .table-tools select { width: 100%; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}

/* Ya no cabe ni el boton principal al lado del logo: los dos al desplegable. */
@media (max-width: 560px) {
  .header-actions { display: none; }
  .menu-panel-actions .btn-primary { display: inline-flex; }
}

@media (max-width: 470px) {
  .brand strong { font-size: 18px; }
  .brand small { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .header-actions .btn { min-height: 38px; padding: 0 12px; font-size: 11px; }
  .fact-chip { flex: 1 1 140px; }
  .save-button span { display: none; }
  .metric-grid, .province-metrics, .ccaa-metrics, .related-grid { grid-template-columns: 1fr; }
  .public-map-canvas { height: 300px; }
  .echart-grid, .province-echart-grid { grid-template-columns: 1fr; }
  .summary-main { grid-template-columns: 1fr; }
  .illustration-badge { width: 55px; height: 55px; }
  .alert-band form { flex-direction: column; gap: 8px; }
  .alert-band input, .alert-band form .button { border-radius: 7px; }
  .coverage-bars > div { grid-template-columns: 75px 1fr 55px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { flex-direction: column; gap: 6px; }
}

/* Informe de pago unico (pagina publica /informe/) */
.informe-paquetes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.informe-paquete { display: block; cursor: pointer; }
.informe-paquete input { position: absolute; opacity: 0; }
.informe-paquete span { display: grid; gap: 3px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; }
.informe-paquete input:checked + span { border-color: var(--green); box-shadow: 0 0 0 3px rgba(7,148,109,.12); }
.informe-paquete strong { font-size: 14px; }
.informe-paquete small { color: var(--muted); font-size: 11px; }
.informe-paquete b { margin-top: 4px; color: var(--green); font-size: 17px; }

/* Selector de uso: mismo patrón de radio oculto + tarjeta que los paquetes,
   pero en fila y sin precio -- no es otro producto, es una opción del mismo.
   Sin estas reglas los radios salían con el estilo del navegador y el texto
   pegado al título («GeneralSin lectura por uso»). */
.informe-usos { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 8px; }
.informe-uso { display: block; cursor: pointer; }
.informe-uso input { position: absolute; opacity: 0; }
.informe-uso span { display: grid; gap: 2px; min-height: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; }
.informe-uso input:checked + span { border-color: var(--green); box-shadow: 0 0 0 3px rgba(7,148,109,.12); }
.informe-uso input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.informe-uso strong { font-size: 13px; }
.informe-uso small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.informe-nota { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.informe-subpaso { margin: 20px 0 4px; font-size: 13px; font-weight: 600; }
.informe-zonas { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; min-height: 26px; }
.informe-zona { display: inline-flex; gap: 8px; align-items: center; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; font-size: 12px; }
.informe-zona small { color: var(--muted); font-size: 10px; }
.informe-zona button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; }
.informe-zona button:hover { color: #b3261e; }
.informe-faltan { color: var(--muted); font-size: 11px; }
.informe-aviso { margin: 8px 0 0; color: #b3261e; font-size: 12px; }
.informe-aviso[hidden] { display: none; }
.geo-search input:disabled { background: var(--green-soft, #f1f5f9); cursor: not-allowed; }

/* Los <span data-var> son envoltorios que añade el editor de bloques alrededor
   de un texto: no son parte del diseño. Selectores descendientes de las hojas
   públicas (`.capital-actions span`, `.capital-report__questions span`…) los
   pillaban y les daban layout o color propios, partiendo el texto en columnas
   o pintándolo del color del eyebrow. `!important` porque esos selectores
   tienen la misma especificidad y ganan por orden de carga. */
span[data-var] {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  font: inherit !important;
  color: inherit !important;
  letter-spacing: inherit !important;
  text-transform: inherit !important;
  transform: none !important;
}

/* Logo propio subido en /panel/sitio/: sustituye a la marca dibujada. */
.brand-logo { max-height: 40px; width: auto; display: block; }

@keyframes menu-abre { from { opacity: 0; transform: translateY(-6px); } }
