/* Meteosainete — estilos
   Estructura: barra de ciudad, franja de consenso por días,
   matriz modelo × día y gráfico horario del día elegido. */

/* ---------- Tokens de color y tipografía ---------- */
:root {
  --bg: #f3f5f7; --surface: #ffffff; --ink: #14212b; --muted: #5d6b77; --line: #d9e0e6;
  --accent: #0f5f7a; --accent-ink: #ffffff;
  --ok: #2f7d4f; --warn: #a86b00; --bad: #b33a2e;
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  /* Un color por modelo (mismo orden que MODELS en app.js) */
  --m1: #1f6fb2; --m2: #c2512f; --m3: #2f8a57; --m4: #7a4fb5; --m5: #b08a12; --m6: #2a9aa3;
  /* Iconos del tiempo */
  --sun: #f2b531; --moon: #c9cfe0; --cloud: #c9d3dc; --cloud-dark: #93a1ad; --drop: #2f86d6; --snow: #9fc3e6;
}

/* Modo oscuro: automático según el sistema, salvo que el usuario elija claro
   (data-theme="light") u oscuro (data-theme="dark") con el botón de la cabecera. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e161c; --surface: #16212a; --ink: #e4ecf1; --muted: #93a3b0; --line: #2a3945;
    --accent: #5fb7d4; --accent-ink: #06222c; --ok: #6cc58f; --warn: #e2ad48; --bad: #ef7d70;
    --m1: #6aaee8; --m2: #ef8a68; --m3: #6cc58f; --m4: #b495e6; --m5: #e0c055; --m6: #5fcbd2;
    --sun: #f5c04a; --moon: #dfe4f0; --cloud: #8796a3; --cloud-dark: #5d6b77; --drop: #5fb0f0; --snow: #cfe3f6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e161c; --surface: #16212a; --ink: #e4ecf1; --muted: #93a3b0; --line: #2a3945;
  --accent: #5fb7d4; --accent-ink: #06222c; --ok: #6cc58f; --warn: #e2ad48; --bad: #ef7d70;
  --m1: #6aaee8; --m2: #ef8a68; --m3: #6cc58f; --m4: #b495e6; --m5: #e0c055; --m6: #5fcbd2;
  --sun: #f5c04a; --moon: #dfe4f0; --cloud: #8796a3; --cloud-dark: #5d6b77; --drop: #5fb0f0; --snow: #cfe3f6;
  color-scheme: dark;
}

/* ---------- Base ---------- */
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
}
.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding-block: 20px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 22px;
}
main { display: flex; flex-direction: column; gap: 22px; }
[hidden] { display: none !important; }

header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
h1 {
  font-family: var(--display); font-stretch: 125%; font-weight: 800;
  font-size: clamp(1.6rem, 5vw, 2.3rem); letter-spacing: -.01em; margin: 0; line-height: 1;
}
.place { font-family: var(--display); font-stretch: 112%; font-weight: 600; font-size: 1.05rem; color: var(--muted); margin-top: 6px; }
h2 { font-family: var(--display); font-stretch: 112%; font-weight: 600; font-size: 1.15rem; margin: 0; text-wrap: balance; }
section { display: flex; flex-direction: column; gap: 10px; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* ---------- Formulario y botones ---------- */
form { display: flex; gap: 8px; flex: 1 1 260px; max-width: 420px; }
input {
  flex: 1; min-width: 0; font: inherit; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink);
}
button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 9px 14px;
}
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.locate { display: grid; place-items: center; padding: 0 10px; background: var(--surface); color: var(--ink); border-color: var(--line); }
.locate[aria-busy="true"] { opacity: .5; cursor: progress; }
/* Buscador con sugerencias */
.combo { position: relative; flex: 1; min-width: 0; display: flex; }
.combo input { width: 100%; }
.suggest {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1100; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / .2);
  max-height: 320px; overflow-y: auto;
}
.suggest li { padding: 8px 10px; border-radius: 7px; cursor: pointer; line-height: 1.3; }
.suggest li span { color: var(--muted); font-size: .85rem; }
.suggest li:hover, .suggest li[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 16%, transparent); }

/* Estrella de favorita junto al nombre de la ciudad */
.place { display: flex; align-items: center; gap: 6px; }
.fav { background: none; border: 0; padding: 0 4px; color: var(--muted); font-size: 1.2rem; line-height: 1; }
.fav[aria-pressed="true"] { color: var(--sun); }
.share { display: inline-grid; place-items: center; }
.share:hover, .fav:hover { color: var(--ink); }
.toast { font-family: var(--body); font-stretch: 100%; font-size: .8rem; font-weight: 600; color: var(--ok); }

/* Accesos rápidos: favoritas y recientes */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-top: -10px; }
.chips:empty { display: none; }
.chip-place {
  flex: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 99px; padding: 4px 12px; font-weight: 500; font-size: .85rem;
}
.chip-place.is-fav { border-color: color-mix(in srgb, var(--sun) 60%, var(--line)); }

.results { display: flex; flex-wrap: wrap; gap: 6px; }
.results:empty { display: none; }
.results button { background: var(--surface); color: var(--ink); border-color: var(--line); font-weight: 500; padding: 6px 10px; }

/* ---------- Estados: cargando y error ---------- */
.status { margin: 0; color: var(--muted); }
.error {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--bad); border-left-width: 4px;
  border-radius: 10px; padding: 12px 14px;
}
.error p { margin: 0; flex: 1 1 260px; }

/* ---------- Franja de consenso ---------- */
.strip { display: grid; grid-template-columns: repeat(7, minmax(118px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.day {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px; text-align: left; color: var(--ink); font-weight: 400;
}
/* Separador de la segunda semana: ocupa toda la fila de la rejilla */
.week-break {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .85rem; color: var(--muted);
}
.pct.ens { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.ens-row th, .ens-row td { border-top: 1px dashed var(--line); }
.week-break b { font-family: var(--display); font-stretch: 112%; font-weight: 600; color: var(--ink); font-size: .95rem; }
.day[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.day .dname { font-family: var(--display); font-stretch: 112%; font-weight: 600; font-size: .95rem; }
.day-main { display: flex; align-items: center; gap: 6px; }
.day-main .wicon { width: 34px; height: 34px; }
.day .temps { white-space: nowrap; font-size: 1.12rem; }
.day .rel { white-space: nowrap; font-size: .74rem; }
.rain.dry { color: var(--muted); }
/* Avisos propios (heladas, calor, viento, lluvia fuerte) */
.alerts { display: flex; flex-wrap: wrap; gap: 4px; }
.alert {
  font-size: .72rem; font-weight: 700; letter-spacing: .02em; padding: 1px 8px; border-radius: 99px;
  border: 1px solid currentColor; cursor: help;
}
.a-helada { color: #3d8fd6; }
.a-calor { color: var(--bad); }
.a-viento { color: var(--warn); }
.a-lluvia { color: var(--accent); }
/* En móvil los 7 días pasan de fila horizontal con scroll a una lista vertical */
@media (max-width: 560px) {
  .strip { display: flex; flex-direction: column; gap: 6px; overflow: visible; }
  .day {
    display: grid; grid-template-columns: 5.4em 1fr auto; grid-template-areas: "name main rel" "rain rain rain";
    align-items: center; gap: 2px 10px; padding: 8px 12px;
  }
  .day .dname { grid-area: name; }
  .day .day-main { grid-area: main; }
  .day .rel { grid-area: rel; }
  .day .rain { grid-area: rain; }
  .day .rain.dry { display: none; } /* en la lista, un día seco ya se entiende por el icono */
  .day .rel-word { display: none; }   /* en la lista solo cabe "● media" */
}
.rain .agree { font-size: .76rem; }
.temps { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.25rem; font-weight: 500; }
.temps small { font-size: .85rem; color: var(--muted); }
.rain { font-size: .82rem; color: var(--muted); }
.rain .pct { color: var(--ink); font-family: var(--mono); font-weight: 500; }
.chip { align-self: flex-start; font-size: .72rem; font-weight: 600; letter-spacing: .04em; padding: 2px 8px; border-radius: 99px; border: 1px solid currentColor; }
.c-alta { color: var(--ok); }
.c-media { color: var(--warn); }
.c-baja { color: var(--bad); }

/* ---------- Botones ⓘ con explicaciones (Popover API, sin JavaScript) ---------- */
h2 { display: flex; align-items: center; gap: 8px; }
.info {
  width: 20px; height: 20px; padding: 0; border-radius: 50%; flex: none;
  background: transparent; color: var(--muted); border: 1.5px solid currentColor;
  font: italic 600 .75rem/1 Georgia, serif; display: inline-grid; place-items: center;
}
.info:hover { color: var(--accent); }
.info-pop {
  max-width: min(460px, calc(100vw - 32px)); padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px rgb(0 0 0 / .3);
  font: 400 .92rem/1.55 var(--body); text-align: left;
}
.info-pop::backdrop { background: rgb(0 0 0 / .35); }
.info-pop h3 { margin: 0 0 8px; font-family: var(--display); font-stretch: 112%; font-size: 1.05rem; }
.info-pop p { margin: 0 0 8px; }
.info-close { margin-top: 6px; }

/* ---------- Carga: esqueleto que "late" mientras llegan los datos ---------- */
.skeleton { display: flex; flex-direction: column; gap: 14px; }
.sk { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.sk-now { height: 112px; }
.sk-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.sk-day { height: 150px; }
.sk-table { height: 260px; }
@media (max-width: 560px) { .sk-row { grid-template-columns: 1fr; } .sk-day { height: 52px; } }
@media (prefers-reduced-motion: no-preference) {
  .sk { animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: .45; } }
}

/* Aviso de predicción guardada (sin conexión) */
.stale {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--warn); border-left-width: 4px; border-radius: 10px; padding: 10px 14px;
}
.stale p { margin: 0; flex: 1 1 240px; }

/* ---------- Bloque "Ahora" ---------- */
.now {
  display: grid; grid-template-columns: auto 1fr; gap: 14px 28px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px;
}
.now-main { display: flex; align-items: center; gap: 14px; }
.now-temp { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: clamp(2.6rem, 9vw, 3.6rem); line-height: 1; }
.now-cond { color: var(--muted); font-weight: 500; margin-top: 4px; }
.now-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.now-summary { margin: 0; font-size: 1.05rem; font-weight: 500; border-left: 4px solid var(--muted); padding-left: 10px; }
.now-summary.t-dry { border-left-color: var(--ok); }
.now-summary.t-rain { border-left-color: var(--accent); }
.now-summary.t-doubt { border-left-color: var(--warn); }
.now-facts { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-size: .9rem; }
.now-facts b { color: var(--ink); font-family: var(--mono); font-weight: 500; }
.hours {
  grid-column: 1 / -1; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin;
  border-top: 1px solid var(--line); padding-top: 12px; margin-top: 2px;
}
.hour {
  flex: 1 0 52px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 2px; border-radius: 8px; font-size: .8rem;
}
.hour.is-now { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.hour .h-time { color: var(--muted); font-weight: 600; }
.hour b { font-family: var(--mono); font-weight: 500; font-size: .92rem; }
.hour .h-rain { color: var(--drop); font-family: var(--mono); font-size: .72rem; min-height: 1.1em; }
@media (max-width: 560px) { .now { grid-template-columns: 1fr; padding: 14px 16px; } }
.wicon { flex: none; display: block; }

/* Fiabilidad como punto de color (en tarjetas y en "Ahora") */
.rel { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; }
.rel i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }

/* Frase resumen de la lluvia (encima de la franja) */
.headline {
  margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--muted); font-size: 1rem;
}
.chance { display: block; margin-top: 4px; font-size: .86rem; font-weight: 400; color: var(--muted); }
.headline b { font-family: var(--display); font-stretch: 112%; font-weight: 600; }
.headline.t-dry { border-left-color: var(--ok); }
.headline.t-rain { border-left-color: var(--accent); }
.headline.t-doubt { border-left-color: var(--warn); }
.rain .when { color: var(--ink); }

/* ---------- Matriz modelo × día ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.tab { background: transparent; color: var(--muted); border: 0; padding: 5px 11px; font-weight: 600; font-size: .86rem; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
/* Selectores de modelo: "chips" separados, para distinguirlos de las pestañas */
.tabs.pick { background: none; border: 0; padding: 0; gap: 6px; }
.tabs.pick .tab { border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px; font-size: .82rem; background: var(--surface); }
.tabs.pick .tab[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); }
thead th { font-size: .78rem; color: var(--muted); font-weight: 600; }
thead th:first-child { text-align: left; padding-left: 12px; }
/* Primera columna fija al hacer scroll horizontal en móvil */
tbody th { text-align: left; padding-left: 12px; white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.mname { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.mname i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.morigin { font-size: .75rem; color: var(--muted); font-weight: 400; padding-left: 18px; }
td { font-family: var(--mono); font-size: .88rem; white-space: nowrap; }
td .wicon { display: inline-block; vertical-align: middle; margin-right: 4px; }
td.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
tr.cons th, tr.cons td { border-top: 2px solid var(--ink); font-weight: 500; }
tr.cons th { font-family: var(--display); font-stretch: 112%; }
tr:last-child td, tr:last-child th { border-bottom: 0; }
td .pct { display: block; font-weight: 500; font-size: .95rem; }
td .rmm { display: block; }
td .rlab { display: block; font-family: var(--body); font-size: .72rem; color: var(--muted); }
.na { color: var(--muted); }
/* Probabilidad estimada (no publicada por el modelo): cursiva y subrayado discontinuo */
.est { font-style: italic; color: var(--muted); text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.note { margin: 0; font-size: .82rem; color: var(--muted); }
.note .est { font-family: var(--mono); }

/* ---------- Gráfico horario ---------- */
.chartbox { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: hidden; }
/* touch-action: el dedo en horizontal mueve la ficha; en vertical sigue haciendo scroll de la página */
#chart { display: block; touch-action: pan-y; cursor: crosshair; }
.chart-tip {
  position: absolute; top: 10px; z-index: 2; pointer-events: none; min-width: 150px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  box-shadow: 0 4px 14px rgb(0 0 0 / .18); font-size: .8rem;
}
.chart-tip div { display: flex; align-items: center; gap: 6px; }
.chart-tip i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chart-tip b { margin-left: auto; padding-left: 12px; font-family: var(--mono); font-weight: 500; }
.chart-tip .tip-head { font-weight: 600; margin-bottom: 4px; }
.chart-tip .tip-med { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; font-weight: 600; }
svg text { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; }
.legend i.sq { width: 14px; height: 10px; }

/* ---------- Pestañas principales (Comparativa / Mapas de lluvia) ---------- */
.views { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: -8px; overflow-x: auto; scrollbar-width: none; }
.view-tab {
  background: transparent; color: var(--muted); border: 0; border-bottom: 3px solid transparent;
  border-radius: 0; padding: 8px 14px; font-family: var(--display); font-stretch: 112%; font-size: 1.02rem;
  margin-bottom: -1px; white-space: nowrap;
}
@media (max-width: 420px) { .view-tab { padding: 8px 10px; font-size: .95rem; } }
.view-tab:hover { color: var(--ink); }
.view-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.view-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#page-forecast { display: flex; flex-direction: column; gap: 22px; }

/* ---------- Mapas de lluvia ---------- */
#page-map, .map-view { display: flex; flex-direction: column; gap: 12px; }
.map-kind { align-self: flex-start; }
.map-frame { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
/* Alto proporcional al ancho: en móvil un mapa muy alto y estrecho enseñaría muy poca zona */
#rainmap { height: clamp(260px, 60vw, 560px); background: var(--surface); }
.windy-frame::before {
  /* Aviso de carga detrás del iframe: queda tapado cuando Windy termina de pintar el mapa */
  content: "Cargando mapa…"; position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: .9rem; z-index: 0;
}
.windy-frame iframe { position: relative; z-index: 1; display: block; width: 100%; height: min(640px, 72vh); border: 0; }

/* Mensaje flotante sobre el mapa (cargando, sin lluvia, error) */
.map-msg {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 1000;
  margin: 0; max-width: calc(100% - 80px); display: flex; align-items: center; gap: 10px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 99px;
  padding: 5px 14px; font-size: .85rem; box-shadow: 0 2px 8px rgb(0 0 0 / .2);
}
.map-msg.is-error { border-color: var(--bad); border-radius: 10px; }
.map-msg button { padding: 4px 10px; font-size: .8rem; }

/* Selector de día y hora */
.time-controls { display: flex; flex-direction: column; gap: 8px; }
.daychips { position: relative; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.daychip {
  flex: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  font-weight: 500; padding: 6px 12px;
}
.daychip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.hour-row { display: flex; align-items: center; gap: 8px; }
.hour-row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); padding: 0; border: 0; background: none; }
.hour-btn { background: var(--surface); color: var(--ink); border-color: var(--line); padding: 6px 10px; line-height: 1; }
.hour-btn:disabled { opacity: .4; cursor: default; }
#map-hour-label { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 500; min-width: 11ch; text-align: right; }

/* Leyenda de colores */
.rain-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.rain-legend span { display: flex; align-items: center; gap: 5px; }
.rain-legend i { width: 18px; height: 10px; border-radius: 2px; }

/* Ajustes de Leaflet para que encaje con los colores de la web */
.leaflet-container { font-family: var(--body); }
.leaflet-popup-content { font-size: .85rem; margin: 10px 14px; }
.note a { color: var(--accent); }

/* ---------- Acierto de los modelos ---------- */
#page-accuracy { display: flex; flex-direction: column; gap: 12px; }
.acc-zone { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); }
.acc-zone select {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 8px; max-width: 220px;
}
.acc-intro { margin: 0; color: var(--muted); max-width: 75ch; }
.acc-area { margin: 0; font-size: .88rem; color: var(--muted); max-width: 75ch; }
.acc-area.is-far { color: var(--ink); border-left: 3px solid var(--warn); padding: 2px 0 2px 10px; }
.acc-summary { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; max-width: 80ch; }
.acc-table td { font-size: .9rem; }
.acc-table tr.cons th, .acc-table tr.cons td { border-top: 0; }
.acc-table thead th:not(:first-child) { white-space: nowrap; }
.acc-table tr.ref th, .acc-table tr.ref td { color: var(--muted); font-style: italic; }
.col-score { width: 34%; min-width: 180px; }
/* Barra de puntuación: relleno = valor, raya fina = margen de error */
.score { display: flex; align-items: center; gap: 8px; }
.score-track { position: relative; flex: 1; height: 10px; border-radius: 99px; background: var(--line); }
.score-fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--accent); }
tr.cons .score-fill { background: var(--ok); }
.score-range { position: absolute; top: -3px; bottom: -3px; border: 2px solid var(--ink); border-top: 0; border-bottom: 0; opacity: .55; }
.score-range::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid var(--ink); }
.score-val { font-family: var(--mono); font-weight: 500; min-width: 4ch; text-align: right; }
.acc-sub { font-family: var(--display); font-stretch: 112%; font-weight: 600; font-size: 1.05rem; margin: 10px 0 0; }
.agree { display: flex; flex-direction: column; gap: 6px; max-width: 640px; }
.ag-row { display: grid; grid-template-columns: 4.5em 1fr 6.5em 5.5em; align-items: center; gap: 10px; font-size: .88rem; }
.ag-k { font-weight: 600; }
.ag-track { height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; }
.ag-fill { display: block; height: 100%; background: var(--drop); border-radius: 99px; }
.ag-val { font-family: var(--mono); text-align: right; }
.ag-n { color: var(--muted); font-size: .78rem; text-align: right; }
.ag-row.few { color: var(--muted); }
.ag-row.few .ag-fill { opacity: .4; }
.acc-help { font-size: .88rem; color: var(--muted); max-width: 80ch; }
.acc-help h3 { font-family: var(--display); font-stretch: 112%; font-weight: 600; font-size: 1rem; color: var(--ink); margin: 14px 0 6px; }
.acc-help dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
.acc-help dt { font-weight: 600; color: var(--ink); }
.acc-help dd { margin: 0; }
.acc-help p { margin: 0 0 8px; }
.acc-help a { color: var(--accent); }
@media (max-width: 560px) { .acc-help dl { grid-template-columns: 1fr; } .acc-help dd { margin-bottom: 6px; } }

footer { font-size: .8rem; color: var(--muted); max-width: 75ch; }
footer p { margin: 0 0 6px; }
footer a { color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
  .day, .tab, .view-tab { transition: border-color .15s, background .15s, color .15s; }
}
