/* QuéTiempoHará — estilos (sin dependencias externas) */

:root {
  --bg: #f2f6fb;
  --surface: #ffffff;
  --surface-2: #eaf2fb;
  --text: #15233b;
  --muted: #5a6a82;
  --border: #d9e3ef;
  --primary: #1565c0;
  --primary-2: #1e88e5;
  --primary-ink: #ffffff;
  --accent: #ff9800;
  --link: #1458a8;
  --hero-1: #1976d2;
  --hero-2: #4fa8f0;
  --shadow: 0 1px 2px rgba(16, 38, 70, .06), 0 6px 18px rgba(16, 38, 70, .07);
  --radius: 14px;
  --map-land: #dbe8f6;
  --map-land-hover: #bcd5f1;
  --map-main: #c6dcf4;
  --map-nb: #e7eef6;
  --map-stroke: #ffffff;
  --map-sea: #f4f9ff;
  --halo: #ffffff;
  --ok: #1f9d63;
  --err: #c62828;
  --warn-bg: #fff6e0;
  --w1: #ffd600;
  --w2: #ff8f00;
  --w3: #e53935;
  --t0: #5e35b1; --t1: #3949ab; --t2: #1e6fd9; --t3: #0288b5; --t4: #00897b;
  --t5: #558b2f; --t6: #b7860b; --t7: #e07000; --t8: #e64a19; --t9: #c62828;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #131c2e; --surface-2: #1a2742; --text: #e6edf7; --muted: #9db0ca; --border: #27354f;
    --primary: #5aa9f4; --primary-2: #3d8fe0; --primary-ink: #0b1220; --link: #8cc4ff; --hero-1: #123a6b; --hero-2: #1d5aa0;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.28);
    --map-land: #22324d; --map-land-hover: #2e4568; --map-main: #2c4166; --map-nb: #1a2740; --map-stroke: #0f1a2c; --map-sea: #0f192b;
    --halo: #131c2e; --warn-bg: #3a2c0b;
    --t0: #b39ddb; --t1: #9fa8da; --t2: #82b4f5; --t3: #4fc3f7; --t4: #4db6ac; --t5: #9ccc65; --t6: #ffd54f; --t7: #ffb74d; --t8: #ff8a65; --t9: #ef5350;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --surface: #131c2e; --surface-2: #1a2742; --text: #e6edf7; --muted: #9db0ca; --border: #27354f;
  --primary: #5aa9f4; --primary-2: #3d8fe0; --primary-ink: #0b1220; --link: #8cc4ff; --hero-1: #123a6b; --hero-2: #1d5aa0;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.28);
  --map-land: #22324d; --map-land-hover: #2e4568; --map-main: #2c4166; --map-nb: #1a2740; --map-stroke: #0f1a2c; --map-sea: #0f192b;
  --halo: #131c2e; --warn-bg: #3a2c0b;
  --t0: #b39ddb; --t1: #9fa8da; --t2: #82b4f5; --t3: #4fc3f7; --t4: #4db6ac; --t5: #9ccc65; --t6: #ffd54f; --t7: #ffb74d; --t8: #ff8a65; --t9: #ef5350;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: clamp(1.15rem, 2.6vw, 1.4rem); }
h3 { font-size: 1.08rem; }
img, svg { max-width: 100%; }
small { font-size: .82em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--primary-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.ico { width: 1.1em; height: 1.1em; vertical-align: -.18em; flex: none; }
.wx { width: 44px; height: 44px; flex: none; }
.wx-sm { width: 32px; height: 32px; }
.wx-xl { width: 104px; height: 104px; }

/* Cabecera */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-size: 1.2rem; white-space: nowrap; }
.brand-logo { width: 36px; height: 36px; }
.brand-name strong, .footer-brand strong { color: var(--primary); }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a { text-decoration: none; color: var(--text); padding: 8px 10px; border-radius: 8px; font-weight: 500; }
.main-nav a:hover { background: var(--surface-2); }
.header-tools { display: flex; align-items: center; gap: 6px; }
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); font-weight: 600; font-size: .9rem; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); list-style: none; margin: 0; padding: 6px; min-width: 160px; z-index: 30; }
.lang-menu a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
.lang-menu a:hover, .lang-menu a[aria-current] { background: var(--surface-2); }
.theme-toggle { border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 8px; width: 40px; height: 38px; cursor: pointer; display: inline-grid; place-items: center; }
.theme-toggle .ico-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ico-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .ico-moon { display: none; }
}
@media (max-width: 760px) {
  .main-nav { display: none; }
  .header-tools { margin-left: auto; }
  .brand-name { font-size: 1.05rem; }
}

/* Estructura */
main.wrap { padding-top: 18px; padding-bottom: 32px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 0 0 18px; }
@media (max-width: 560px) { .card { padding: 16px 14px; border-radius: 12px; } }
.hero { background: linear-gradient(135deg, var(--hero-1), var(--hero-2)); color: #fff; border-radius: var(--radius); padding: 28px 24px; margin-bottom: 18px; box-shadow: var(--shadow); }
.hero h1 { color: #fff; margin-bottom: .3em; }
.hero .lead { color: rgba(255,255,255,.92); margin: 0 0 16px; max-width: 760px; }
.hero-sm { padding: 22px 22px; }
.lead { font-size: 1.05rem; }
.notice { background: var(--warn-bg); border-radius: 10px; padding: 10px 14px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 12px; font-size: .9rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 4px; }
.breadcrumbs a { color: var(--muted); }
.explain-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.aside-ad:empty { display: none; }
@media (max-width: 900px) { .explain-grid { grid-template-columns: 1fr; } }
.ad { margin: 0 auto 18px; text-align: center; max-width: 1180px; overflow: hidden; }
.prose p, .prose li { max-width: 78ch; }
.prose ol, .prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }

/* Botones */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--surface-2); color: var(--text); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--link); }
.btn-sm { padding: 6px 10px; font-size: .85rem; }

/* Buscador */
.search { position: relative; display: flex; gap: 8px; max-width: 680px; }
.search input { flex: 1; min-width: 0; font: inherit; padding: 13px 14px 13px 42px; border-radius: 12px; border: 1px solid transparent; background: #fff; color: #15233b; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.search .search-ico { position: absolute; left: 14px; top: 15px; width: 20px; height: 20px; color: #5a6a82; pointer-events: none; }
.search .btn { background: var(--accent); color: #1d1300; }
.card .search input, .notfound .search input { border-color: var(--border); }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); list-style: none; margin: 0; padding: 6px; z-index: 40; max-height: 360px; overflow-y: auto; }
.search-results a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.search-results a small { color: var(--muted); }
.search-results a:hover, .search-results [aria-selected="true"] a { background: var(--surface-2); }
.search-results .empty { padding: 9px 10px; color: var(--muted); }
@media (max-width: 480px) { .search .btn { padding: 10px 12px; } }

/* Pestañas de día */
.map-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.map-head h2 { margin: 0; }
.daytabs { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 2px; }
.daytab { border: 0; background: transparent; color: var(--text); font: inherit; border-radius: 9px; padding: 6px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.daytab-rel { font-weight: 600; font-size: .92rem; }
.daytab-date { font-size: .75rem; color: var(--muted); }
.daytab[aria-selected="true"] { background: var(--primary); color: var(--primary-ink); }
.daytab[aria-selected="true"] .daytab-date { color: inherit; opacity: .85; }
[data-day="0"] [data-day]:not([data-day="0"]),
[data-day="1"] [data-day]:not([data-day="1"]),
[data-day="2"] [data-day]:not([data-day="2"]) { display: none; }

/* Mapas */
.map-box { overflow-x: auto; border-radius: 12px; background: var(--map-sea); }
.map { display: block; width: 100%; height: auto; }
.map-box > .map:not(.map-prov) { min-width: 540px; }
.map-box-prov .map { max-height: 620px; }
.map .prov { fill: var(--map-land); stroke: var(--map-stroke); stroke-width: .8; transition: fill .15s; }
.map a:hover .prov, .map a:focus .prov { fill: var(--map-land-hover); }
.map .nb .prov { fill: var(--map-nb); stroke-width: .4; }
.map-prov .prov { stroke-width: .3; }
.map .prov-main { fill: var(--map-main); stroke: var(--primary); stroke-width: .35; }
.map .canary-box { fill: none; stroke: var(--border); stroke-width: 1; stroke-dasharray: 4 3; }
.map .w { stroke-width: .6; pointer-events: visibleFill; }
.map-prov .w { stroke-width: .2; }
.map .w1 { fill: rgba(255, 214, 0, .55); stroke: #d4b000; }
.map .w2 { fill: rgba(255, 143, 0, .6); stroke: #d17400; }
.map .w3 { fill: rgba(229, 57, 53, .62); stroke: #b71c1c; }
.hide-warn .warn-layer { display: none; }
.map .mk { text-decoration: none; }
.map .mk-dot { fill: var(--text); opacity: .55; }
.map .mk-t { font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: var(--halo); stroke-width: 3px; stroke-linejoin: round; fill: var(--text); }
.map-prov .mk-t { stroke-width: .5px; }
.map .mk-t .tx { fill: var(--text); }
.map .mk-t .tn { fill: var(--muted); font-weight: 600; font-size: .82em; }
.map .mk:hover .mk-t { fill: var(--link); }
.map .mk-pin .mk-dot { fill: var(--accent); opacity: 1; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: .88rem; margin-top: 10px; color: var(--muted); }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; }
.lg.w1 { background: var(--w1); } .lg.w2 { background: var(--w2); } .lg.w3 { background: var(--w3); }
.lg-toggle { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; color: var(--text); }
.map-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 12px 0 0; }
.warn-summary { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* Temperaturas */
.t-na { color: var(--muted); }
.t0 { color: var(--t0); } .t1 { color: var(--t1); } .t2 { color: var(--t2); } .t3 { color: var(--t3); } .t4 { color: var(--t4); }
.t5 { color: var(--t5); } .t6 { color: var(--t6); } .t7 { color: var(--t7); } .t8 { color: var(--t8); } .t9 { color: var(--t9); }
.map .tx.t0 { fill: var(--t0); } .map .tx.t1 { fill: var(--t1); } .map .tx.t2 { fill: var(--t2); } .map .tx.t3 { fill: var(--t3); } .map .tx.t4 { fill: var(--t4); }
.map .tx.t5 { fill: var(--t5); } .map .tx.t6 { fill: var(--t6); } .map .tx.t7 { fill: var(--t7); } .map .tx.t8 { fill: var(--t8); } .map .tx.t9 { fill: var(--t9); }

/* Capitales */
.city-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.city { display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); text-decoration: none; color: var(--text); background: var(--surface); }
.city:hover { border-color: var(--primary-2); background: var(--surface-2); }
.city .wx { width: 38px; height: 38px; }
.city-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-t b { font-size: 1.05rem; }
.city-t small, .day-t small, .days-strip small { color: var(--muted); }
.city-pp { font-size: .82rem; color: var(--muted); white-space: nowrap; }

/* Provincias por comunidad */
.regions { columns: 4 220px; column-gap: 24px; }
.region { break-inside: avoid; margin-bottom: 14px; }
.region h3 { font-size: .95rem; color: var(--muted); margin-bottom: 4px; }
.region ul { list-style: none; margin: 0; padding: 0; }
.region li { padding: 2px 0; }
.link-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 16px; }

/* Compartir */
.share { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 18px; }
.share-title { font-size: 1rem; margin-bottom: 4px; }
.share-preview { color: var(--muted); font-size: .92rem; margin: 0 0 10px; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: .92rem; border: 0; cursor: pointer; font-family: inherit; }
.share-btn .ico { width: 18px; height: 18px; }
.share-facebook { background: #1877f2; } .share-whatsapp { background: #1fa855; } .share-x { background: #111; }
.share-telegram { background: #229ed9; } .share-copy { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
:root[data-theme="dark"] .share-x { background: #000; border: 1px solid #333; }
.share-btn:hover { filter: brightness(1.1); }

/* Avisos */
.warn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.warn-item { border: 1px solid var(--border); border-left: 6px solid var(--w1); border-radius: 10px; padding: 10px 14px; background: var(--surface); }
.warn-item.lvl2 { border-left-color: var(--w2); }
.warn-item.lvl3 { border-left-color: var(--w3); }
.warn-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.warn-badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--w1); color: #2b2100; }
.warn-badge.lvl2 { background: var(--w2); color: #2b1600; }
.warn-badge.lvl3 { background: var(--w3); color: #fff; }
.warn-area { color: var(--muted); font-size: .92rem; }
.warn-time { margin: 4px 0 0; font-size: .88rem; color: var(--muted); }
.warn-desc { margin: 6px 0 0; }
.warn-instr { margin: 4px 0 0; font-size: .86rem; color: var(--muted); }
.empty-state { display: flex; gap: 8px; align-items: center; color: var(--muted); margin: 0; }

/* Municipio: ahora */
.now-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
.now-grid > .card { margin: 0 0 18px; }
@media (max-width: 860px) { .now-grid { grid-template-columns: 1fr; gap: 0; } }
.now-when { margin: 0 0 6px; color: var(--muted); font-weight: 600; }
.now-main { display: flex; align-items: center; gap: 18px; }
.now-temp { font-size: 3.4rem; font-weight: 800; line-height: 1; margin: 0; }
.now-sky { font-size: 1.1rem; font-weight: 600; margin: 4px 0; }
.now-range { margin: 0; color: var(--muted); }
.now-facts, .day-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 16px 0 10px; }
.now-facts div, .day-facts div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.now-facts dt, .day-facts dt { font-size: .78rem; color: var(--muted); }
.now-facts dd, .day-facts dd { margin: 0; font-weight: 700; }

/* Por horas */
.hours-scroll { overflow-x: auto; scrollbar-width: thin; padding-bottom: 6px; }
.hours { list-style: none; display: flex; margin: 0; padding: 22px 0 0; gap: 0; }
.hour { position: relative; flex: none; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-left: 1px solid transparent; font-size: .86rem; }
.hour.newday { border-left-color: var(--border); }
.hour-day { position: absolute; top: -20px; left: 6px; font-size: .78rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
.hour-h { font-weight: 600; color: var(--muted); }
.hour-t { font-weight: 800; font-size: 1.05rem; }
.hour-pr, .hour-pp, .hour-w { color: var(--muted); white-space: nowrap; font-size: .8rem; }
.wind-arrow { color: var(--text); }
.rot-0 { transform: rotate(0deg); } .rot-45 { transform: rotate(45deg); } .rot-90 { transform: rotate(90deg); } .rot-135 { transform: rotate(135deg); }
.rot-180 { transform: rotate(180deg); } .rot-225 { transform: rotate(225deg); } .rot-270 { transform: rotate(270deg); } .rot-315 { transform: rotate(315deg); }

/* 7 días */
.days { display: grid; gap: 8px; }
.day { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.day summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 110px 44px minmax(0, 1fr) auto 70px 150px; align-items: center; gap: 10px; padding: 8px 12px; }
.day summary::-webkit-details-marker { display: none; }
.day[open] summary { border-bottom: 1px solid var(--border); }
.day-name { display: flex; flex-direction: column; line-height: 1.2; }
.day-name small { color: var(--muted); }
.day-sky { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-t b { font-size: 1.15rem; }
.day-pp, .day-w { font-size: .88rem; color: var(--muted); white-space: nowrap; }
.day-body { padding: 10px 12px 4px; }
.periods { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.periods li { display: grid; grid-template-columns: 160px 34px minmax(0, 1fr) 70px 150px; align-items: center; gap: 10px; font-size: .9rem; }
.per-name { font-weight: 600; }
@media (max-width: 720px) {
  .day summary { grid-template-columns: 82px 40px 1fr auto; }
  .day-sky, .day-w { display: none; }
  .day-pp { grid-column: 4; }
  .day summary .day-t { grid-column: 3; text-align: right; }
  .periods li { grid-template-columns: 1fr 30px auto; }
  .periods li > span:nth-child(3), .periods li > span:nth-child(5) { display: none; }
}

/* Próximos días (provincia) */
.days-strip { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; padding: 0; margin: 0 0 14px; }
.days-strip li { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 6px; }
.ds-day { font-weight: 600; font-size: .9rem; }
.ds-pp { font-size: .8rem; color: var(--muted); }

/* Tablas */
.table-wrap { overflow-x: auto; }
.wx-table, .admin-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.wx-table th, .wx-table td, .admin-table th, .admin-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.wx-table thead th, .admin-table thead th { font-size: .82rem; color: var(--muted); font-weight: 600; }
.wx-table tbody th { font-weight: 500; }
.wx-table .c-ic { width: 40px; padding-right: 0; }
.wx-table .pp { color: var(--muted); font-size: .8rem; margin-left: 4px; }
.wx-table tbody tr:hover { background: var(--surface-2); }
.filter input { font: inherit; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); min-width: 220px; }

/* FAQ */
.faq details { border-top: 1px solid var(--border); padding: 4px 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.faq p { margin: 0 0 12px; color: var(--muted); }

/* Formularios */
.form { display: grid; gap: 14px; max-width: 640px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field textarea {
  font: inherit; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 100%;
}
.field textarea { resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--err); }
.field-error { color: var(--err); font-size: .88rem; }
.field.check label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
.captcha-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.captcha-row img { border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.captcha input { max-width: 220px; text-transform: uppercase; letter-spacing: .2em; font-weight: 700; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.alert { border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }
.alert p { margin: 0; }
.alert-ok { background: rgba(31, 157, 99, .12); border: 1px solid rgba(31, 157, 99, .4); }
.alert-error { background: rgba(198, 40, 40, .1); border: 1px solid rgba(198, 40, 40, .4); }
.alert-warn { background: var(--warn-bg); border: 1px solid #e0b400; }

/* Legal */
.legal h2 { margin-top: 1.4em; }
.legal-box { display: grid; gap: 6px; background: var(--surface-2); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.legal-box div { display: grid; grid-template-columns: 170px 1fr; gap: 10px; }
.legal-box dt { font-weight: 600; }
.legal-box dd { margin: 0; }
@media (max-width: 560px) { .legal-box div { grid-template-columns: 1fr; gap: 0; } }
.email-img { vertical-align: middle; height: 22px; width: auto; }
:root[data-theme="dark"] .email-img { filter: invert(1) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .email-img { filter: invert(1) hue-rotate(180deg); } }
.notfound { text-align: center; }
.notfound .search { margin: 16px auto; }

/* Pie */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 28px 0 18px; margin-top: 12px; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 12px; } }
.footer-brand { font-size: 1.15rem; margin: 0 0 8px; }
.disclaimer, .attribution { color: var(--muted); margin: 0 0 8px; }
.footer-links, .footer-langs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-langs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.copyright { color: var(--muted); margin: 18px 0 0; font-size: .82rem; }

/* Panel privado */
.admin-main { padding-top: 18px; padding-bottom: 40px; }
.admin-login { max-width: 420px; padding-top: 10vh; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.admin-cards .card { margin: 0; }
.kpi h2 { font-size: .95rem; color: var(--muted); margin-bottom: 4px; }
.kpi p { margin: 2px 0; }
.kpi-big { font-size: 2rem; font-weight: 800; }
.kpi-ok { border-top: 5px solid var(--ok); }
.kpi-warn { border-top: 5px solid var(--w2); }
.kpi-bad { border-top: 5px solid var(--err); }
.code { display: inline-block; min-width: 34px; text-align: center; font-weight: 700; font-size: .8rem; padding: 1px 6px; border-radius: 6px; color: #fff; font-style: normal; }
i.code { min-width: 14px; height: 14px; padding: 0; vertical-align: -2px; }
.c200 { background: var(--ok); } .c401 { background: #8e24aa; } .c404 { background: #607d8b; } .c429 { background: var(--err); } .cother { background: #f57c00; }
.admin-log td { font-size: .85rem; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.bar { flex: 1; width: 100%; display: flex; flex-direction: column-reverse; justify-content: flex-start; }
.bar .seg { display: block; width: 100%; }
.bar .seg:last-child { border-radius: 3px 3px 0 0; }
.bar-label { font-size: .68rem; color: var(--muted); }
.h4{height:4%}.h8{height:8%}.h12{height:12%}.h16{height:16%}.h20{height:20%}.h24{height:24%}.h28{height:28%}.h32{height:32%}.h36{height:36%}.h40{height:40%}.h44{height:44%}.h48{height:48%}.h52{height:52%}.h56{height:56%}.h60{height:60%}.h64{height:64%}.h68{height:68%}.h72{height:72%}.h76{height:76%}.h80{height:80%}.h84{height:84%}.h88{height:88%}.h92{height:92%}.h96{height:96%}.h100{height:100%}
.legend-codes { display: flex; flex-wrap: wrap; gap: 14px; font-size: .85rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .share, .ad, .search, .daytabs, .site-footer nav { display: none !important; } .card { box-shadow: none; } }
