/* ══════════════════════════════════════════════
   CUMBRE v2 · Móvil — estilos por sub-paso
   Cada bloque se delimita con un encabezado.
   ══════════════════════════════════════════════ */

/* Las secciones v2 se extienden edge-to-edge compensando el padding
   lateral del .app-container (16px). Las secciones tienen su propio
   padding interior, así el contenido queda igual de separado del borde
   pero las líneas/fondos llegan de extremo a extremo. */
.vc, .sb, .ns, .hh, .dg, .fs, .fl,
#sectorTopoMap {
  margin-left:  -16px;
  margin-right: -16px;
}

/* ── 2a · Verdict Card ── */
.vc {
  border-top: 3px solid var(--ok);
  border-bottom: 1px solid var(--rule);
  padding: 14px 18px 16px;
  background: var(--bg);
}
.vc[data-tone="ok"]   { border-top-color: var(--ok); }
.vc[data-tone="warn"] { border-top-color: var(--warn); }
.vc[data-tone="bad"]  { border-top-color: var(--bad); }

.vc-top {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.vc-num {
  font-family: var(--font-serif);
  font-size: 3.4rem;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.85;
  flex-shrink: 0;
}
.vc[data-tone="ok"]   .vc-num { color: var(--ok); }
.vc[data-tone="warn"] .vc-num { color: var(--warn); }
.vc[data-tone="bad"]  .vc-num { color: var(--bad); }

.vc-mid {
  flex: 1;
  min-width: 0;
}
.vc-mid .eyebrow {
  display: block;
  margin-bottom: 3px;
}
.vc-sub {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
  word-break: break-word;
}

.vc-score {
  text-align: right;
  flex-shrink: 0;
}
.vc-score .eyebrow {
  display: block;
  margin-bottom: 2px;
}
.vc-score-val {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--terra);
  letter-spacing: -0.04em;
  line-height: 1;
  display: inline-block;
}
.vc-score-val small {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--ink-3);
  margin-left: 1px;
}

/* Popup de previsualización en mapa de escuelas (panel desplegable). */
.map-prev { font-family: var(--font-sans); padding: 4px 2px; }
.map-prev-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 6px;
}
.map-prev-name {
  font-family: var(--font-serif); font-size: 0.95rem; font-weight: 700;
  color: var(--ink); letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.map-prev-score {
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 800;
  white-space: nowrap;
}
.map-prev-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.map-prev-tag {
  font-family: var(--font-mono); font-size: 0.65rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 6px; border: 1px solid var(--rule); color: var(--ink-2);
}
.map-prev-actions { display: flex; gap: 6px; }
.map-prev-btn {
  flex: 1;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 7px 8px; text-align: center; cursor: pointer;
  border: 1px solid var(--ink); background: var(--bg); color: var(--ink);
  text-decoration: none;
}
.map-prev-open { background: var(--ink); color: var(--bg); }
.map-prev-btn:hover { background: var(--paper); }
.map-prev-open:hover { background: var(--terra); border-color: var(--terra); color: var(--bg); }

/* Pildoras de factores dominantes — los 3 más críticos en una sola fila.
   Verde = factor en rango óptimo. Naranja = aceptable. Rojo = problemático. */
.vc-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 12px;
}
.vc-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem; font-weight: 600;
  padding: 4px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.vc-pill-ic { font-size: 0.78rem; }
.vc-pill-ok  { color: var(--ok);   border-color: var(--ok);   background: color-mix(in srgb, var(--ok)   8%, transparent); }
.vc-pill-mid { color: var(--warn); border-color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.vc-pill-bad { color: var(--bad);  border-color: var(--bad);  background: color-mix(in srgb, var(--bad)  8%, transparent); }

.vc-window {
  margin-top: 14px;
}
.vc-window-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.vc-window-val {
  font-size: 0.65rem;
  color: var(--ink-2);
  font-weight: 700;
}

.vc-strip {
  display: flex;
  height: 18px;
  border: 1px solid var(--rule);
}
.vc-cell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.45rem;
  color: var(--ink);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}
.vc-cell:last-child {
  border-right: none;
}
.vc-cell-empty {
  background: var(--paper);
}
.vc-cell.is-best {
  outline: 1px solid var(--ink);
  outline-offset: -2px;
  z-index: 1;
  position: relative;
}

.vc-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
}
.vc-axis .mono {
  font-size: 0.55rem;
  color: var(--ink-3);
}

/* Elementos legacy ocultos por v2 */
#climbVerdict   { display: none !important; }
.top5-banner    { display: none !important; }
.all-banner     { display: none !important; }
.no-good-warn   { display: none !important; }
/* Botón "Comparar favoritos" de arriba: el v2 ya muestra la comparativa abajo */
#compareBarBtn  { display: none !important; }
/* Títulos de sección y bloques del diseño antiguo */
.section-title  { display: none !important; }
#hourlyContainer, .hourly-scroll, .hour-col { display: none !important; }
/* Hero "Dónde escalar hoy" en Escuelas — desactivado por rendimiento */
#escuelasHeroV2 { display: none !important; }
/* Quick glance HOY/MAÑANA/FINDE — sustituido por VerdictCard */
.quick-glance, #quickGlance { display: none !important; }

/* ── 2b · Now Strip ── */
.ns {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--rule);
}
.ns-temp {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 300;
  letter-spacing: -0.06em;
  line-height: 0.9;
  flex-shrink: 0;
}
.ns-body {
  flex: 1;
  min-width: 0;
}
.ns-cond {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.ns-icon {
  color: var(--terra);
  display: inline-flex;
}
.ns-icon svg { width: 20px; height: 20px; }
.ns-desc {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
}
.ns-meta {
  font-size: 0.6rem;
  color: var(--ink-2);
  letter-spacing: 0.08em;
}

/* Oculta el hero antiguo: ya no es la fuente de verdad del "ahora". */
.main-card.glass { display: none !important; }

/* Acciones extraídas (favorito + compartir): aire alrededor del bloque y
   que el botón de favorito vuelva a ocupar el ancho disponible. */
.main-actions-v2 { padding: 0; margin: 12px 0 4px; }

/* ── 2c · Hourly Heatmap ── */
.hh {
  padding: 18px 18px 0;
}
.hh-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.hh-axis-lbl {
  font-size: 0.6rem;
  color: var(--ink-3);
}
.hh-grid {
  display: grid;
  grid-template-columns: repeat(16, minmax(52px, 1fr));
  border: 1px solid var(--rule);
  border-top: 2px solid var(--ink);
  overflow-x: auto;
  scrollbar-width: none;
}
.hh-grid::-webkit-scrollbar { display: none; }
.hh-col {
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0, 0, 0, 0.04);
  min-width: 0;
}
.hh-col:last-child { border-right: none; }

.hh-h {
  font-size: 0.55rem;
  text-align: center;
  padding: 5px 0 3px;
  color: var(--ink-2);
  font-weight: 600;
  border-bottom: 1px solid var(--rule);
}
.hh-col.is-peak .hh-h { color: var(--terra); font-weight: 800; }

.hh-icon {
  display: flex;
  justify-content: center;
  padding: 4px 0;
  color: var(--ink-2);
}
.hh-icon svg { width: 12px; height: 12px; }

.hh-score {
  height: 32px;
  font-size: 0.6rem;
}

.hh-t {
  font-size: 0.6rem;
  text-align: center;
  padding: 4px 0;
  font-weight: 700;
  color: var(--ink);
}

.hh-precip, .hh-wind {
  font-size: 0.55rem;
  text-align: center;
  padding: 3px 0;
  color: var(--ink-2);
  font-weight: 600;
}
.hh-precip.has-rain { color: var(--rain); font-weight: 800; }
.hh-col.is-peak .hh-precip, .hh-col.is-peak .hh-wind { color: inherit; }

/* (bloque horario antiguo cubierto arriba) */

/* ── 2d · Favorites Strip ── */
.fs {
  padding: 20px 18px 0;
}
.fs-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.fs-more {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.6rem;
  color: var(--terra);
  letter-spacing: 0.1em;
  font-weight: 700;
  padding: 0;
}
.fs-loading {
  font-size: 0.7rem;
  color: var(--ink-3);
  padding: 12px 0;
}
.fs-table {
  border: 1px solid var(--rule);
  border-top: 2px solid var(--ink);
}
.fs-row {
  display: grid;
  grid-template-columns: 88px repeat(7, 1fr);
  border-bottom: 1px solid var(--rule);
  align-items: stretch;
}
.fs-row:last-child { border-bottom: none; }
.fs-row-head {
  background: var(--paper);
}
.fs-d {
  font-size: 0.55rem;
  text-align: center;
  padding: 5px 0;
  color: var(--ink-3);
  font-weight: 700;
  letter-spacing: 0.06em;
}
.fs-d.is-today { color: var(--terra); }
.fs-name {
  padding: 0 8px;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--rule);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-cell {
  min-height: 26px;
}
.fs-cell-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--ink-3);
}

/* ── 2e · Forecast List ── */
.fl {
  padding: 20px 18px 0;
}
.fl-title {
  margin-bottom: 10px;
}
.fl-list {
  border-top: 2px solid var(--ink);
}
.fl-row {
  display: grid;
  grid-template-columns: 52px 22px 1fr 56px 44px 38px;
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.fl-row:hover { background: var(--paper); }

.fl-day {
  line-height: 1.1;
}
.fl-d {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.08em;
}
.fl-d.is-today { color: var(--terra); }
.fl-dl {
  font-size: 0.55rem;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.fl-icon {
  color: var(--ink-2);
  display: flex;
  justify-content: center;
}
.fl-icon svg { width: 18px; height: 18px; }

.fl-bar {
  height: 6px;
  background: var(--rule);
  position: relative;
}
.fl-bar-fill {
  height: 100%;
  display: block;
}

.fl-temps {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  align-items: baseline;
}
.fl-tmax {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
}
.fl-tmin {
  font-size: 0.6rem;
  color: var(--ink-3);
}

.fl-precip {
  font-size: 0.6rem;
  text-align: right;
  color: var(--ink-3);
  font-weight: 700;
}
.fl-precip.has-rain { color: var(--bad); }

.fl-score {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--ink);
  text-align: right;
}

/* Oculta el forecast viejo y su título */
#forecastList { display: none !important; }

/* ── 2f · Details Grid ── */
.dg {
  padding: 20px 18px 24px;
}
.dg-title {
  margin-bottom: 10px;
}
.dg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
}
.dg-cell {
  padding: 10px 6px;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}
.dg-cell:nth-child(4n) { border-right: none; }

.dg-l {
  font-size: 0.5rem;
  color: var(--ink-3);
  letter-spacing: 0.12em;
  margin-bottom: 3px;
}
.dg-v {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.1;
}
.dg-s {
  font-size: 0.55rem;
  color: var(--ink-3);
  margin-top: 2px;
}

/* "Condiciones actuales" antigua: ocultamos su section-title si existe.
   La sección con badges sueltos del viejo main-card ya queda oculta por
   #main-card.glass{display:none}. */

/* ══════════════════════════════════════════════
   PASO 3 · Escuelas móvil
   ══════════════════════════════════════════════ */

/* ── Mapa de escuelas ── */
.sectors-map-panel {
  margin-bottom: 14px;
}
.sectors-map-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.sectors-map-toggle.active {
  background: var(--ink);
  color: var(--bg);
}
.sectors-map-toggle .map-chev {
  font-size: 0.7rem;
}
.escuelas-map-popup .maplibregl-popup-content {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Hero "Dónde escalar hoy" */
.eh {
  padding: 18px 18px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.eh-eyebrow {
  margin-bottom: 6px;
}
.eh-headline {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 14px;
}
.eh-headline-sep {
  color: var(--terra);
  margin: 0 6px;
}
.eh-headline-sub {
  color: var(--ink-2);
  font-weight: 400;
  font-style: italic;
}
.eh-top3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.eh-card {
  padding: 10px 10px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.eh-card .eh-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.eh-card.is-best {
  background: var(--ink);
  color: var(--bg);
}
.eh-rank {
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}
.eh-card.is-best .eh-rank {
  color: rgba(255, 255, 255, 0.6);
}
.eh-name {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.eh-score-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.eh-score {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  padding: 2px 6px;
  min-width: 36px;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ══════════════════════════════════════════════
   PASO 4 · Detalle / Score Breakdown (mobile)
   ══════════════════════════════════════════════ */

.sb {
  margin: 0 18px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.sb-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  padding: 12px 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--ink-2);
  text-transform: uppercase;
}
.sb-chev { transition: transform 0.2s; }
.sb-factors {
  padding-bottom: 10px;
}
.sb-row {
  display: grid;
  grid-template-columns: 1fr auto 20px;
  gap: 10px;
  padding: 7px 0;
  align-items: center;
}
.sb-rule { border-top: 1px solid var(--rule); }
.sb-l { font-size: 0.65rem; color: var(--ink-2); letter-spacing: 0.06em; font-weight: 600; }
.sb-v { font-family: var(--font-serif); font-size: 0.9rem; font-weight: 600; }
.sb-sym { font-family: var(--font-mono); font-weight: 800; text-align: center; }
.sb-ok  .sb-sym { color: var(--ok); }
.sb-mid .sb-sym { color: var(--warn); }
.sb-bad .sb-sym { color: var(--bad); }

/* ══════════════════════════════════════════════
   PASO 5 · Estados (re-estilado, sin tocar lógica)
   ══════════════════════════════════════════════ */

/* Loading: spinner Cumbre y tipografía mono editorial. */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 30px;
  text-align: center;
  min-height: 60vh;
}
.loading-state .spinner,
.loading-state > .spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--rule);
  border-top-color: var(--terra);
  border-radius: 50%;
  animation: cumbre-spin 0.8s linear infinite;
}
.loading-state p {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 700;
  margin: 0;
}

/* Login: simplificamos a un panel sin glass, tipografía editorial. */
.login-screen {
  background: var(--bg);
}
.login-glow { display: none; }
.login-card.glass {
  background: var(--bg) !important;
  backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 40px 28px !important;
  max-width: 100%;
}
.login-title {
  font-family: var(--font-serif);
  font-size: 3.4rem;
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.9;
}
.login-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-2);
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  line-height: 1.4;
}
.login-google-btn {
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: 0 !important;
  text-transform: uppercase;
}
.login-footer {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  margin-top: 18px;
  line-height: 1.6;
}
