/*
 * =====================================================================
 *  SismoBolivia · styles.css — todos los estilos de la aplicación
 * =====================================================================
 *
 *  Organización (busca "/* =====" para saltar entre secciones):
 *   - Variables de color y tipografía (:root)
 *   - Iconos SVG (.ico) — la app no usa emojis
 *   - Paneles de pestañas, Mapa, Cabecera flotante (panel "Sismos y filtros")
 *   - Leyenda (con interruptor "Sismos"), Tipo de mapa, Loader
 *   - Popup de Leaflet, Consultar zona (radar), Satélite antes/después
 *   - Compartir ficha (ficha de predio + impresión)
 *   - Evaluar · Portada común Técnica/Aprende · Técnica · Aprende · Registro
 *   - Responsive: menú desplegable (≤ 860 px)
 *   - Inicio (menú de 6 accesos, aviso de entrada, simulación de sismo)
 *   - Botones Atrás / Sismos
 *   - Acerca de (norma, fuentes de datos y límites de la herramienta)
 *   - Capas temáticas (panel, interruptores, popup y bloque de la ficha)
 *
 *  Convenciones:
 *   - Colores SIEMPRE con variables (--accent, --panel, --muted…), no valores sueltos,
 *     salvo colores de datos (magnitudes, niveles de riesgo).
 *   - Cada sección trae sus @media al final del bloque.
 *   - El tema activo es oscuro (index.html fija data-theme="dark"); el tema
 *     claro queda definido por si se quiere reactivar.
 * =====================================================================
 */

/* ===== Variables de color y tipografía ===== */
/* --m2…--m5: colores por magnitud; deben coincidir con colorForMag() en app.js. */
:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10131a;
  --panel: rgba(22, 27, 36, 0.94);
  --panel-solid: #161b24;
  --border: #2c3444;
  --text: #eef1f6;
  --muted: #93a0b5;
  --accent: #e8a33d;
  --accent-strong: #f3b65a;
  --accent-ink: #1a1204;
  --accent-soft: rgba(232, 163, 61, 0.16);
  --ok: #7dcea0;
  --glow: rgba(232, 163, 61, 0.22);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  --overlay: rgba(8, 10, 14, 0.7);
  --nav-icon-bg: #1e2532;

  --m2: #f0b429;
  --m3: #f97316;
  --m4-color: #e0492f;
  --m5: #9b1c1c;

  --nav-w: 0px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Space Grotesk", system-ui, sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #efe8dc;
  --panel: rgba(255, 251, 245, 0.96);
  --panel-solid: #fffbf5;
  --border: #ddd2c2;
  --text: #1c1915;
  --muted: #6d6458;
  --accent: #b97812;
  --accent-strong: #9a620c;
  --accent-ink: #fff8ee;
  --accent-soft: rgba(185, 120, 18, 0.14);
  --ok: #2f7d4a;
  --glow: rgba(185, 120, 18, 0.18);
  --shadow: 0 10px 28px rgba(80, 60, 30, 0.12);
  --overlay: rgba(40, 32, 22, 0.45);
  --nav-icon-bg: #f3eadc;
}

* {
  box-sizing: border-box;
}

/* La página nunca se desplaza entera: cada pestaña (.tab-panel, position: fixed)
   tiene su propio scroll. Sin esto, el margin-top de la cabecera sticky (.home-top)
   hacía la página unos píxeles más alta y aparecía una segunda barra. */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 12% -8%, var(--glow), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--mono);
  transition: background 0.2s ease, color 0.2s ease;
}

/* ===== Iconos SVG (.ico) ===== */
/* Los iconos vienen del sprite <svg class="ico-sprite"> de index.html (trazos tipo Lucide).
   Miden 1em: para agrandarlos se sube el font-size del contenedor.
   Toman el color del texto (currentColor): para cambiarlo, se cambia `color`. */
.ico-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ico {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.14em;
}

/* Contenedores grandes de icono: el icono va en color de acento y con trazo más fino. */
.eval-hero-icon,
.pro-hero-icon,
.learn-ico,
.tech-empty-icon,
.reg-hero-icon,
.reg-demo-icon,
.reg-phone-icon,
.reg-for-icon,
.home-info-icon {
  color: var(--accent);
}

.reg-card-icon {
  color: var(--tone, var(--accent));
}

.eval-hero-icon .ico,
.pro-hero-icon .ico,
.reg-hero-icon .ico,
.tech-empty-icon .ico {
  stroke-width: 1.6;
}

/* ===== Paneles de pestañas ===== */
/* Cada pestaña empieza debajo de la cabecera #appTop: --top-h lo calcula
   syncTopHeight() en app.js (alto real de la cabecera + 10 px). */
.tab-panel {
  position: fixed;
  inset: var(--top-h, 60px) 0 0 var(--nav-w);
  overflow: hidden;
}

.tab-panel[hidden] {
  display: none;
}

/* ===== Mapa ===== */
#map {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 0;
}

/* Oscuro solo en OSM. El satélite Esri no se invierte. */
.osm-filter {
  filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.9) saturate(0.8);
}

html[data-theme="light"] .osm-filter {
  filter: none;
}

.leaflet-container {
  background: var(--bg);
  font-family: var(--mono);
}

/* ===== Cabecera flotante ===== */
.map-header {
  position: absolute;
  top: 10px;
  left: 10px;
  right: auto;
  width: min(248px, calc(100% - 20px));
  z-index: 500;
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  max-height: min(52vh, calc(100% - 88px));
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.map-header[hidden] {
  display: none;
}

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.map-header h1 {
  font-family: var(--display);
  font-size: 0.92rem;
  margin: 0;
  letter-spacing: 0.3px;
}

.drawer-close {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.drawer-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.subtitle {
  display: none;
}

.mode-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.mode-btn {
  flex: 1;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.mode-btn.is-active {
  background: var(--accent);
  border-color: var(--accent-strong);
  color: var(--accent-ink);
  font-weight: 600;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-bar[hidden] {
  display: none;
}

.status-text {
  flex: 1;
  text-align: left;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--muted);
  cursor: pointer;
}

.status-text:hover,
.status-text[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--text);
}

.status-text strong {
  color: var(--text);
}

.status-text em {
  display: block;
  font-style: normal;
  font-size: 0.7rem;
  color: var(--accent);
  margin-top: 2px;
}

.reload-btn {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.72rem;
  cursor: pointer;
}

.reload-btn:hover {
  border-color: var(--accent);
}

.filters-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.filters-panel[hidden] {
  display: none;
}

.filters-panel label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--muted);
  flex: 1 1 100%;
  min-width: 0;
}

.filters-panel select {
  width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}

.filters-panel select,
.period-custom input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  font-family: var(--mono);
  cursor: pointer;
}

.period-custom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.period-custom[hidden] {
  display: none;
}

.period-custom input {
  min-width: 0;
  padding: 6px;
  font-size: 0.68rem;
  color-scheme: dark;
}

[data-theme="light"] .period-custom input {
  color-scheme: light;
}

.period-error {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.66rem;
  color: #e0492f;
}

.period-apply {
  grid-column: 1 / -1;
  padding: 7px 10px;
  border-radius: 8px;
  border: 0;
  background: var(--accent);
  color: #161b24;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.status-period {
  color: var(--text);
}

.historial-actions {
  margin-top: 10px;
}

.historial-actions[hidden] {
  display: none;
}

.historial-actions .share-btn {
  width: 100%;
}

.zona-filters {
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.zona-filters .filters-panel {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 8px;
  margin-top: 6px;
  padding-top: 0;
  border-top: 0;
}

.zona-filters .filters-panel[hidden] {
  display: none;
}

.zona-filters .filters-panel > label:first-child,
.zona-filters .period-custom {
  grid-column: 1 / -1;
}

.zona-filters .filters-panel label {
  font-size: 0.6rem;
  gap: 3px;
  justify-content: flex-end;
}

.zona-filters .period-custom {
  grid-template-columns: 1fr;
  gap: 6px;
}

.zona-filters .period-custom label {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.zona-filters .period-custom input {
  flex: 1;
  max-width: 150px;
}

.zona-filters .filters-panel select {
  padding: 6px 8px;
  font-size: 0.68rem;
}

/* ===== Leyenda ===== */
.legend {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 500;
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.75rem;
  display: grid;
  gap: 8px;
}

.legend-items {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.legend-items > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-toggle {
  padding: 0;
  gap: 8px;
  font-size: 0.75rem;
}

.legend-toggle strong {
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.legend.is-off .legend-toggle strong {
  color: var(--muted);
}

.legend-items[hidden] {
  display: none;
}

.legend-live {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.live-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e0492f;
  box-shadow: 0 0 0 0 rgba(224, 73, 47, 0.65);
  animation: liveping 1.6s infinite;
  display: inline-block;
}

@keyframes liveping {
  70% {
    box-shadow: 0 0 0 10px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.live-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--accent);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow: var(--shadow);
}

.live-badge[hidden] {
  display: none;
}

.live-badge small {
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
}

.live-quake {
  background: none !important;
  border: none !important;
}

.live-dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(224, 73, 47, 0.55);
  animation: liveping 1.6s infinite;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot.m2 { background: var(--m2); }
.dot.m3 { background: var(--m3); }
.dot.m4 { background: var(--m4-color); }
.dot.m5 { background: var(--m5); }

/* ===== Tipo de mapa (Mapa / Satélite / Relieve) ===== */
.layer-switch {
  position: absolute;
  right: 54px;
  bottom: 26px;
  z-index: 600;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 8px;
}

.layer-switch[hidden] {
  display: none;
}

.layer-toggle {
  position: relative;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1f29;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.layer-toggle:hover,
.layer-toggle:focus-visible {
  border-color: var(--accent);
}

.layer-thumb {
  display: block;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.thumb-mapa {
  background-image: url("https://tile.openstreetmap.org/12/1272/2237.png");
}

html[data-theme="dark"] .thumb-mapa {
  filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.9) saturate(0.8);
}

.thumb-satelite {
  background-image: url("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/12/2237/1272");
}

.thumb-relieve {
  background-image: url("https://a.tile.opentopomap.org/12/1272/2237.png");
}

.layer-toggle-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 4px 4px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  color: #fff;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  text-align: center;
}

.layer-options {
  display: flex;
  gap: 6px;
  padding: 8px;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.layer-options[hidden] {
  display: none;
}

.layer-opt {
  width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6rem;
  cursor: pointer;
}

.layer-opt .layer-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid var(--border);
}

.layer-opt:hover {
  color: var(--text);
}

.layer-opt.is-active {
  color: var(--accent);
  font-weight: 600;
}

.layer-opt.is-active .layer-thumb {
  border-color: var(--accent);
}

/* ===== Loader ===== */
.map-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 400;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 0.85rem;
  color: var(--muted);
}

.map-loader[hidden] {
  display: none;
}

/* ===== Placeholder de pestañas vacías ===== */
.placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}

.placeholder h2 {
  font-family: var(--display);
  color: var(--text);
  margin: 0;
}

/* ===== Navegación izquierda ===== */
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--nav-w);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px 12px;
  background: var(--panel-solid);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.nav-brand {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--accent-strong), var(--accent));
  color: var(--accent-ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  box-shadow: 0 0 0 3px var(--accent-soft), 0 8px 18px rgba(232, 163, 61, 0.35);
}

.nav-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 62px;
  background: none;
  border: none;
  border-radius: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.nav-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--nav-icon-bg);
  color: var(--muted);
}

.nav-ico svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-btn:hover .nav-ico {
  color: var(--text);
}

.nav-btn:hover {
  color: var(--text);
}

.nav-btn.is-active,
.nav-btn.is-open {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-btn.is-active .nav-ico,
.nav-btn.is-open .nav-ico {
  background: linear-gradient(160deg, var(--accent-strong), var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 6px 14px rgba(232, 163, 61, 0.35);
}

.theme-switch {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 10px 0 4px;
  border: none;
  background: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.62rem;
  cursor: pointer;
}

.theme-track {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: #2a3140;
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

html[data-theme="light"] .theme-track {
  background: #e8dcc8;
}

.theme-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(160deg, #ffe08a, var(--accent));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

html[data-theme="light"] .theme-knob {
  transform: translateX(24px);
  background: linear-gradient(160deg, #fff, #f0e6d4);
}

.theme-switch:hover .theme-track {
  border-color: var(--accent);
}

.nav-toggle {
  display: none;
}

.nav-backdrop {
  display: none;
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

/* ===== Popup de Leaflet en oscuro ===== */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--panel-solid);
  color: var(--text);
  border: 1px solid var(--border);
}

.leaflet-popup-content {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.quake-popup strong {
  color: var(--accent);
}

.quake-live {
  display: inline-block;
  margin-top: 6px;
  color: #e0492f;
  font-size: 0.72rem;
}

/* ===== Consultar zona ===== */
.consulta-panel {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.consulta-panel[hidden] {
  display: none;
}

.consulta-lead {
  display: none;
}

.consulta-actions {
  display: flex;
  gap: 6px;
}

.geo-btn {
  flex: 1;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.consulta-msg {
  margin: 6px 0 0;
  font-size: 0.68rem;
  color: var(--accent);
}

.consulta-msg[hidden],
.consulta-result[hidden] {
  display: none;
}

.consulta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.consulta-grid .k,
.zona-filters > .k {
  display: block;
  font-size: 0.6rem;
  color: var(--muted);
  margin-bottom: 1px;
}

.consulta-grid strong {
  font-size: 0.7rem;
  color: var(--text);
}

.consulta-note {
  display: none;
}

.radar {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.radar .k {
  display: block;
  font-size: 0.6rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.radar-chips {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.radar-chip {
  padding: 5px 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.66rem;
  cursor: pointer;
}

.radar-chip:hover {
  border-color: var(--accent);
}

.radar-chip.is-active {
  background: var(--accent);
  border-color: var(--accent-strong);
  color: var(--accent-ink);
  font-weight: 700;
}

.radar-summary,
.radar-live {
  margin: 6px 0 0;
  font-size: 0.64rem;
  line-height: 1.35;
  color: var(--text);
}

.radar-live {
  color: var(--muted);
}

.radar-live.is-hot {
  color: #e0492f;
  font-weight: 600;
}

.radar-rings {
  list-style: none;
  margin: 8px 0;
  padding: 0;
  display: grid;
  gap: 3px;
}

.radar-rings li {
  display: grid;
  grid-template-columns: 62px 1fr 30px;
  align-items: center;
  gap: 6px;
  font-size: 0.6rem;
  color: var(--muted);
}

.radar-rings li b {
  text-align: right;
  color: var(--text);
}

.radar-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.radar-custom input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.radar-num {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  color: var(--muted);
}

.radar-num input {
  width: 52px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.68rem;
  text-align: right;
}

.radar-num input:focus {
  outline: none;
  border-color: var(--accent);
}

.radar-bar {
  height: 6px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
}

.radar-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.radar-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 3px;
}

.radar-list[hidden] {
  display: none;
}

.radar-item {
  width: 100%;
  text-align: left;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.62rem;
  cursor: pointer;
}

.radar-item:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.casos {
  margin-top: 8px;
}

.casos-label {
  display: block;
  font-size: 0.62rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.casos-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.caso-btn {
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.62rem;
  cursor: pointer;
}

.caso-btn:hover,
.caso-btn.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Satélite antes / después ===== */
.sat-label {
  position: absolute;
  top: auto;
  bottom: 86px;
  z-index: 450;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.72rem;
  letter-spacing: 0.3px;
}

.sat-label[hidden] {
  display: none;
}

.sat-label-left {
  left: 16px;
}

.sat-label-right {
  right: 16px;
}

.swipe-bar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.72rem;
  color: var(--muted);
}

.swipe-bar[hidden] {
  display: none;
}

.swipe-bar input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: ew-resize;
}

.user-pin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(232, 163, 61, 0.35);
}

.ladera-pin {
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  background: #e0492f;
  border: 2px solid #fff;
}

.leaflet-bottom.leaflet-right {
  margin-bottom: 8px;
}

@media (max-width: 640px) {
  .map-header {
    width: min(220px, calc(100% - 16px));
    padding: 7px 8px;
    max-height: min(46vh, calc(100% - 80px));
  }

  .consulta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sat-label {
    bottom: 72px;
    font-size: 0.65rem;
  }
}

/* ===== Compartir ficha ===== */
.share-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.share-btn {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.68rem;
  cursor: pointer;
}

.share-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.share-btn-main {
  grid-column: 1 / -1;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.map-header .share-btn-main {
  grid-column: auto;
}

.ficha-overlay {
  position: fixed;
  top: 64px;
  right: 12px;
  bottom: auto;
  left: auto;
  z-index: 2000;
  width: min(260px, calc(100vw - var(--nav-w) - 24px));
  max-height: min(46vh, 330px);
  background: none;
  display: block;
  padding: 0;
  overflow: visible;
  pointer-events: none;
}

.ficha-overlay[hidden] {
  display: none !important;
}

.ficha-sheet {
  width: 100%;
  max-height: min(46vh, 330px);
  overflow-y: auto;
  background: #f4f1ea;
  color: #1a1c16;
  border-radius: 12px;
  padding: 0;
  font-family: var(--display);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.ficha-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  border-bottom: 1px solid #1a1c16;
  padding: 10px 12px 6px;
  position: sticky;
  top: 0;
  background: #f4f1ea;
  z-index: 1;
}

.ficha-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ficha-head h2 {
  margin: 2px 0 0;
  font-size: 0.95rem;
}

.ficha-close {
  border: 1px solid #1a1c16;
  background: transparent;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.ficha-meta {
  display: none;
}

.ficha-block {
  margin-top: 8px;
  padding: 0 12px;
}

.ficha-block h3 {
  margin: 0 0 3px;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ficha-block p {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.3;
}

.ficha-zone {
  font-family: var(--display) !important;
  font-size: 0.92rem !important;
  font-weight: 700;
}

.ficha-compact-hide {
  display: none;
}

.ficha-quakes {
  margin: 4px 0 0;
  padding-left: 16px;
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1.3;
}

.ficha-quakes li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ficha-quakes li:nth-child(n + 3) {
  display: none;
}

.ficha-mini {
  margin: 8px 12px 0;
  font-family: var(--mono);
  font-size: 0.6rem;
  color: #5c5a54;
  line-height: 1.3;
}

.ficha-print-only {
  display: none;
}

.ficha-warn {
  background: #efe6d4;
  padding: 12px;
  border-radius: 8px;
}

.ficha-foot {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 12px 10px;
  position: sticky;
  bottom: 0;
  background: #f4f1ea;
}

.ficha-foot .share-btn {
  background: #1a1c16;
  color: #f4f1ea;
  border-color: #1a1c16;
  padding: 6px 4px;
  font-size: 0.62rem;
}

.ficha-foot .share-btn-main {
  grid-column: auto;
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* ===== Evaluar ===== */
.tab-scroll {
  overflow: auto !important;
  background: var(--bg);
}

.eval-lead {
  color: var(--muted);
  font-size: 0.85rem;
}

.eval-panel {
  background:
    radial-gradient(circle at 88% 0%, rgba(232, 163, 61, 0.12), transparent 36%),
    radial-gradient(circle at 0% 60%, rgba(56, 189, 248, 0.06), transparent 40%),
    var(--bg);
}

.eval-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* Portada */
.eval-hero {
  position: relative;
  overflow: hidden;
  margin: 16px 0 18px;
  padding: 26px 26px 22px;
  border-radius: 22px;
  border: 1px solid rgba(232, 163, 61, 0.3);
  background:
    radial-gradient(circle at 100% 0%, rgba(232, 163, 61, 0.24), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(56, 189, 248, 0.1), transparent 45%),
    linear-gradient(160deg, #1b2130, #121620);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.eval-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(90deg, transparent, #000 60%);
  pointer-events: none;
}

.eval-hero > * {
  position: relative;
  z-index: 1;
}

.eval-hero-icon {
  float: right;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 0 8px 16px;
  border-radius: 20px;
  font-size: 2.3rem;
  background: rgba(232, 163, 61, 0.14);
  border: 1px solid rgba(232, 163, 61, 0.4);
  box-shadow: 0 0 30px rgba(232, 163, 61, 0.25);
}

.eval-hero h2 {
  font-family: var(--display);
  margin: 8px 0 10px;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.1;
}

.eval-hero h2 span {
  background: linear-gradient(90deg, var(--accent-strong), #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eval-hero-lead {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.eval-hero-chips {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.eval-hero-chips li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 99px;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

/* Estructura: pasos + pregunta */
.eval-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 16px;
  align-items: start;
}

.eval-steps {
  position: sticky;
  top: 16px;
  padding: 16px 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #1a2030, #141923);
}

.eval-steps ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.eval-stepper-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 8px 0 14px;
}

.eval-stepper-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 44px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.eval-stepper-item.done:not(:last-child)::after {
  background: linear-gradient(var(--ok), var(--border));
}

.eval-stepper-dot {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  filter: grayscale(1);
  opacity: 0.6;
  transition: all 0.25s ease;
}

.eval-stepper-item.current .eval-stepper-dot {
  filter: none;
  opacity: 1;
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px rgba(232, 163, 61, 0.12), 0 0 18px rgba(232, 163, 61, 0.3);
}

.eval-stepper-item.done .eval-stepper-dot {
  filter: none;
  opacity: 1;
  color: #0f2a1b;
  font-weight: 700;
  border-color: var(--ok);
  background: var(--ok);
}

.eval-stepper-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 36px;
  min-width: 0;
}

.eval-stepper-text strong {
  font-family: var(--display);
  font-size: 0.85rem;
  color: var(--muted);
}

.eval-stepper-item.current strong,
.eval-stepper-item.done strong {
  color: var(--text);
}

.eval-stepper-text small {
  margin-top: 2px;
  font-size: 0.66rem;
  line-height: 1.35;
  color: var(--muted);
}

.eval-main {
  min-width: 0;
  padding: 20px 22px 22px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #1a2030, #141923);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
}

.eval-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.eval-step,
.eval-pct {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.eval-pct {
  font-family: var(--display);
  font-weight: 700;
  color: var(--accent-strong);
}

.eval-progress {
  height: 8px;
  margin: 8px 0 20px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.eval-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #f97316);
  box-shadow: 0 0 12px rgba(232, 163, 61, 0.5);
  transition: width 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Pregunta */
.eval-card {
  animation: eval-in 0.35s ease both;
}

@keyframes eval-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.eval-q-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.eval-q-num {
  font-family: var(--display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(180deg, var(--accent-strong), rgba(232, 163, 61, 0.25));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eval-q-topic {
  margin: 0 0 4px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.eval-q {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1.25;
}

.eval-hint {
  display: flex;
  gap: 10px;
  margin: 16px 0 18px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.eval-hint .ico {
  font-size: 1rem;
  margin-top: 1px;
  color: #38bdf8;
}

.eval-opts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.eval-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 12px 14px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  animation: eval-in 0.35s ease both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

.eval-opt:hover,
.eval-opt:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.eval-opt.is-picked {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.eval-opt.unknown {
  border-style: dashed;
  color: var(--muted);
}

.eval-opt-key {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--accent-strong);
  background: rgba(232, 163, 61, 0.1);
  border: 1px solid rgba(232, 163, 61, 0.3);
  transition: all 0.2s ease;
}

.eval-opt:hover .eval-opt-key,
.eval-opt.is-picked .eval-opt-key {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.eval-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.eval-prev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
}

.eval-prev svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eval-prev:hover:not(:disabled) {
  border-color: var(--accent);
}

.eval-prev:disabled {
  opacity: 0.35;
  cursor: default;
}

.eval-keys {
  margin: 0;
  font-size: 0.68rem;
  color: var(--muted);
}

.eval-keys kbd {
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--text);
}

/* Resultado */
.eval-result {
  --tone: var(--ok);
  --tone-soft: rgba(125, 206, 160, 0.14);
}

.eval-result.medio {
  --tone: #fb923c;
  --tone-soft: rgba(251, 146, 60, 0.14);
}

.eval-result.alto {
  --tone: #f87171;
  --tone-soft: rgba(248, 113, 113, 0.14);
}

.eval-result-top {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--tone);
  background: linear-gradient(160deg, var(--tone-soft), transparent 70%);
}

.eval-result h3 {
  font-family: var(--display);
  font-size: 1.35rem;
  margin: 0 0 8px;
}

.eval-result-top p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.eval-result-top .eval-score {
  margin-top: 10px;
  font-size: 0.7rem;
}

.eval-meter {
  margin-bottom: 18px;
}

.eval-meter-bar {
  position: relative;
  display: flex;
  height: 12px;
  border-radius: 99px;
}

.eval-meter-bar .seg {
  height: 100%;
}

.eval-meter-bar .seg.bajo {
  background: #4ade80;
  border-radius: 99px 0 0 99px;
}

.eval-meter-bar .seg.medio {
  background: #fb923c;
}

.eval-meter-bar .seg.alto {
  background: #f87171;
  border-radius: 0 99px 99px 0;
}

.eval-meter-mark {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--tone);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.35), 0 0 18px var(--tone);
  transform: translate(-50%, -50%);
  animation: eval-mark 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes eval-mark {
  from { left: 0; }
}

.eval-meter-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.66rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.eval-tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tone);
  background: var(--tone-soft);
  border: 1px solid var(--tone);
}

.eval-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.eval-box {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.eval-box h4 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 0.9rem;
}

.eval-box h4:not(:first-child) {
  margin-top: 14px;
}

.eval-factors {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.eval-factors li {
  position: relative;
  padding: 7px 10px 7px 24px;
  border-radius: 10px;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.eval-factors li::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 13px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.eval-factors li.bad::before { background: #f87171; }
.eval-factors li.good::before { background: #4ade80; }
.eval-factors li.unk::before { background: #94a3b8; }

.eval-factors li strong {
  color: var(--text);
}

.eval-factors li.none {
  padding-left: 10px;
  font-style: italic;
}

.eval-factors li.none::before {
  display: none;
}

.eval-next {
  counter-reset: eval-next;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.eval-next li {
  counter-increment: eval-next;
  position: relative;
  padding: 10px 12px 10px 44px;
  border-radius: 12px;
  font-size: 0.78rem;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.eval-next li::before {
  content: counter(eval-next);
  position: absolute;
  left: 10px;
  top: 9px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--tone);
}

.eval-disclaimer {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--muted);
  border: 1px dashed var(--border);
}

.eval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.eval-action {
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.eval-action:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.eval-action.main {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(232, 163, 61, 0.3);
}

@media (max-width: 820px) {
  .eval-shell {
    grid-template-columns: 1fr;
  }

  .eval-steps {
    position: static;
    padding: 12px;
    overflow-x: auto;
  }

  .eval-steps ol {
    display: flex;
    gap: 6px;
  }

  .eval-stepper-item {
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 40px;
    padding: 0;
  }

  .eval-stepper-item:not(:last-child)::after,
  .eval-stepper-text small {
    display: none;
  }

  .eval-stepper-text {
    min-height: 0;
    align-items: center;
  }

  .eval-stepper-text strong {
    font-size: 0.58rem;
    text-align: center;
  }

  .eval-main {
    padding: 16px;
  }

  .eval-opts,
  .eval-result-grid {
    grid-template-columns: 1fr;
  }

  .eval-keys {
    display: none;
  }
}

@media (max-width: 480px) {
  .eval-hero {
    padding: 20px 16px 18px;
  }

  .eval-hero-icon {
    width: 54px;
    height: 54px;
    font-size: 1.7rem;
  }

  .eval-stepper-text strong {
    display: none;
  }

  .eval-q-num {
    font-size: 2rem;
  }

  .eval-q {
    font-size: 1.12rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .eval-card,
  .eval-opt,
  .eval-meter-mark {
    animation: none;
  }
}

/* ===== Semáforo NBDS (evaluar + antrópico) ===== */
.eval-semaforo {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.eval-sem-dot {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-top: 3px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.eval-semaforo strong {
  display: block;
  font-family: var(--display);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.eval-semaforo p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Verde */
.eval-semaforo-verde {
  border-color: rgba(125, 206, 160, 0.4);
  background: rgba(125, 206, 160, 0.07);
}
.eval-semaforo-verde .eval-sem-dot  { background: #7dcea0; box-shadow: 0 0 0 4px rgba(125,206,160,0.2); }
.eval-semaforo-verde strong          { color: #7dcea0; }

/* Amarillo */
.eval-semaforo-amarillo {
  border-color: rgba(232, 163, 61, 0.4);
  background: rgba(232, 163, 61, 0.07);
}
.eval-semaforo-amarillo .eval-sem-dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(232,163,61,0.2); }
.eval-semaforo-amarillo strong         { color: var(--accent-strong); }

/* Rojo */
.eval-semaforo-rojo {
  border-color: rgba(224, 73, 47, 0.4);
  background: rgba(224, 73, 47, 0.07);
}
.eval-semaforo-rojo .eval-sem-dot  { background: #e0492f; box-shadow: 0 0 0 4px rgba(224,73,47,0.2); }
.eval-semaforo-rojo strong          { color: #e0492f; }

/* Agravantes del motor NBDS */
.eval-agravantes {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 5px;
}

.eval-agravantes li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.73rem;
  line-height: 1.4;
  background: rgba(224, 73, 47, 0.08);
  border: 1px solid rgba(224, 73, 47, 0.2);
  color: var(--text);
}

/* Nota de metodología (motor) */
.eval-motor-nota {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--muted);
  border: 1px dashed var(--border);
  background: rgba(255,255,255,0.02);
}

/* ===== Pestaña Antrópico ===== */
.antro-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.antro-hero {
  margin-bottom: 24px;
}

.antro-card {
  background: linear-gradient(165deg, #1a2030, #141923);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  min-height: 260px;
}

/* Paso genérico */
.antro-step-num {
  display: inline-block;
  margin: 0 0 8px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.68rem;
  color: var(--muted);
  font-family: var(--mono);
}

.antro-q {
  font-family: var(--display);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--text);
}

.antro-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 20px;
}

/* Animación de entrada para opciones (reutilizada en evaluar y antrópico) */
@keyframes eval-opt-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: none; }
}

/* Opciones de fuente (paso 1) */
.antro-opts {
  display: grid;
  gap: 10px;
}

.antro-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  animation: eval-opt-in 0.3s cubic-bezier(0.2, 0.8, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 0.06s);
}

.antro-opt:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(4px);
}

.antro-opt.is-picked {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.antro-opt-emoji {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

/* Distancia (paso 2) */
.antro-dist {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.antro-dist-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.antro-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.antro-chip:hover       { border-color: var(--accent); }
.antro-chip.is-active   { background: var(--accent); border-color: var(--accent-strong); color: var(--accent-ink); font-weight: 700; }

.antro-dist-custom label {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.antro-dist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.antro-dist-row input[type="number"] {
  width: 100px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  text-align: right;
}

.antro-dist-row input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Checkboxes síntomas (paso 3) */
.antro-checks {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.antro-check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.82rem;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.antro-check-item:hover              { border-color: var(--accent); background: var(--accent-soft); }
.antro-check-item input[type="checkbox"] { display: none; }

.antro-check-box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--panel-solid);
  margin-top: 1px;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.antro-check-item input:checked ~ .antro-check-box {
  background: var(--accent);
  border-color: var(--accent-strong);
}

.antro-check-item input:checked ~ .antro-check-box::after {
  content: "";
  position: absolute;
  inset: 3px 3px;
  background: var(--accent-ink);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

/* Navegación de pasos */
.antro-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.antro-back,
.antro-next {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.antro-back svg,
.antro-next svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.antro-back:hover  { border-color: var(--muted); }
.antro-next        { background: var(--accent); border-color: var(--accent-strong); color: var(--accent-ink); font-weight: 700; }
.antro-next:hover  { background: var(--accent-strong); }

/* Resultado antrópico */
.antro-result {
  display: grid;
  gap: 18px;
}

.antro-result-top {
  display: grid;
  gap: 10px;
}

/* Barra IRF */
.antro-irf-bar-wrap {
  display: grid;
  gap: 6px;
}

.antro-irf-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.antro-irf-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.antro-result-verde    .antro-irf-fill  { background: #7dcea0; }
.antro-result-amarillo .antro-irf-fill  { background: var(--accent); }
.antro-result-rojo     .antro-irf-fill  { background: #e0492f; }

.antro-irf-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.64rem;
  color: var(--muted);
}

/* Síntomas */
.antro-sintomas { font-size: 0.78rem; }

.antro-sintomas-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 0.74rem;
  color: var(--muted);
}

.antro-sintomas ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

/* Grid resultado */
.antro-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Contexto boliviano */
.antro-contexto {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 10px;
}

/* Responsive antrópico */
@media (max-width: 640px) {
  .antro-card {
    padding: 18px 14px;
  }

  .antro-result-grid {
    grid-template-columns: 1fr;
  }

  .antro-dist-chips {
    gap: 6px;
  }

  .antro-chip {
    padding: 6px 10px;
    font-size: 0.72rem;
  }
}

@media print {
  body * {
    visibility: hidden !important;
  }

  .ficha-overlay,
  .ficha-overlay *,
  .ficha-sheet,
  .ficha-sheet * {
    visibility: visible !important;
  }

  .ficha-overlay {
    display: block !important;
    position: static;
    inset: auto;
    width: 100%;
    max-height: none;
    background: #fff;
    padding: 0;
    overflow: visible;
    pointer-events: auto;
  }

  .ficha-sheet {
    width: 100%;
    max-height: none;
    box-shadow: none;
    border-radius: 0;
    padding: 22px;
  }

  .ficha-head h2 {
    font-size: 1.6rem;
  }

  .ficha-block {
    margin-top: 16px;
  }

  .ficha-zone {
    font-size: 1.25rem !important;
  }

  #fichaLectura {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }

  .ficha-quakes li {
    display: list-item !important;
  }

  .ficha-compact-hide,
  .ficha-print-only,
  .ficha-warn {
    display: block !important;
  }

  .ficha-meta {
    display: block !important;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: #5c5a54;
    margin: 8px 0 0;
  }

  .ficha-quakes li {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .ficha-head,
  .ficha-foot,
  .ficha-block,
  .ficha-mini {
    padding-left: 0;
    padding-right: 0;
    position: static;
  }

  .ficha-mini {
    display: none !important;
  }

  .ficha-close,
  .ficha-foot,
  .side-nav,
  .nav-toggle,
  .nav-backdrop {
    display: none !important;
  }
}

/* ===== Portada común (Técnica / Aprende) ===== */
.tech-kicker {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.pro-panel {
  background:
    radial-gradient(circle at 88% 0%, rgba(232, 163, 61, 0.12), transparent 36%),
    radial-gradient(circle at 0% 60%, rgba(56, 189, 248, 0.06), transparent 40%),
    var(--bg);
}

.pro-hero {
  position: relative;
  overflow: hidden;
  margin: 16px 0 18px;
  padding: 26px 26px 22px;
  border-radius: 22px;
  border: 1px solid rgba(232, 163, 61, 0.3);
  background:
    radial-gradient(circle at 100% 0%, rgba(232, 163, 61, 0.24), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(56, 189, 248, 0.1), transparent 45%),
    linear-gradient(160deg, #1b2130, #121620);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.pro-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(90deg, transparent, #000 60%);
  pointer-events: none;
}

.pro-hero > * {
  position: relative;
  z-index: 1;
}

.pro-hero-icon {
  float: right;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 0 8px 16px;
  border-radius: 20px;
  font-size: 2.3rem;
  background: rgba(232, 163, 61, 0.14);
  border: 1px solid rgba(232, 163, 61, 0.4);
  box-shadow: 0 0 30px rgba(232, 163, 61, 0.25);
}

.pro-hero h2 {
  font-family: var(--display);
  margin: 8px 0 10px;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.1;
}

.pro-hero h2 span {
  background: linear-gradient(90deg, var(--accent-strong), #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pro-hero-lead {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.pro-hero-chips {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.pro-hero-chips li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 99px;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

/* ===== Técnica ===== */
.tech-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.tech-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.tech-card {
  min-width: 0;
  margin: 0 0 14px;
  padding: 18px 18px 6px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #1a2030, #141923);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.tech-card-head {
  float: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.tech-card-head + * {
  clear: both;
}

.tech-card-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 0.8rem;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
}

.tech-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  min-width: 0;
}

.tech-field > span:first-child {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.tech-field select,
.tech-input {
  width: 100%;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tech-field select {
  appearance: none;
  padding: 11px 36px 11px 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8a33d' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
}

.tech-field select option {
  background: var(--panel-solid);
}

.tech-input {
  display: flex;
  align-items: center;
}

.tech-input input {
  flex: 1;
  min-width: 0;
  padding: 11px 0 11px 12px;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
}

.tech-input em {
  padding: 0 12px 0 6px;
  font-style: normal;
  font-size: 0.7rem;
  color: var(--accent-strong);
}

.tech-field select:focus,
.tech-input:focus-within {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tech-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 12px;
}

.tech-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.tech-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: var(--accent-ink);
  font-family: var(--display);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(232, 163, 61, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tech-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(232, 163, 61, 0.4);
}

.tech-submit svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tech-side {
  position: sticky;
  top: 16px;
  min-width: 0;
}

.tech-empty {
  padding: 40px 26px;
  text-align: center;
  border-radius: 18px;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.tech-empty-icon {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  border-radius: 18px;
  font-size: 2rem;
  background: var(--accent-soft);
}

.tech-empty h3 {
  margin: 0 0 6px;
  font-family: var(--display);
}

.tech-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.tech-results {
  animation: tech-in 0.35s ease both;
}

@keyframes tech-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.recs-head {
  --tone: var(--ok);
  --tone-soft: rgba(125, 206, 160, 0.14);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--tone);
  background: linear-gradient(160deg, var(--tone-soft), rgba(20, 25, 35, 0.9) 75%);
}

.recs-head.alerta {
  --tone: #fb923c;
  --tone-soft: rgba(251, 146, 60, 0.16);
}

.recs-head.critico {
  --tone: #f87171;
  --tone-soft: rgba(248, 113, 113, 0.16);
}

.recs-head-ico {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  color: #10131a;
  background: var(--tone);
  box-shadow: 0 0 22px var(--tone-soft);
}

.recs-head-kicker {
  margin: 0 0 2px !important;
  font-size: 0.66rem !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tone) !important;
}

.recs-head h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 1.15rem;
}

.recs-head p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Mensaje final para más de 12 pisos (pintarEdificioAlto en tecnica.js) */
.recs-head.info {
  --tone: #38bdf8;
  --tone-soft: rgba(56, 189, 248, 0.16);
}

.recs-head p b {
  color: var(--text);
}

.recs-head p.recs-head-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
}

/* Notas al pie del formulario de Técnica (columnas iguales, límite de pisos) */
.tech-field-note {
  display: flex;
  gap: 10px;
  margin: 2px 0 12px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: rgba(56, 189, 248, 0.06);
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--muted);
}

.tech-field-note .ico {
  margin-top: 2px;
  font-size: 0.95rem;
  color: #38bdf8;
}

.tech-field-note b {
  color: var(--text);
}

.tech-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.tech-big {
  --tone: var(--accent-strong);
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #1a2030, #141923);
}

.tech-big > span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.tech-big strong {
  display: block;
  margin: 6px 0 4px;
  font-family: var(--display);
  font-size: 1.8rem;
  line-height: 1;
  color: var(--tone);
}

.tech-big strong em {
  font-style: normal;
  font-size: 0.9rem;
  color: var(--muted);
}

.tech-big small {
  font-size: 0.66rem;
  color: var(--muted);
}

.tech-drift.ok { --tone: var(--ok); }
.tech-drift.alerta { --tone: #fb923c; }
.tech-drift.critico { --tone: #f87171; }

.tech-drift-bar {
  position: relative;
  height: 8px;
  margin: 8px 0 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.tech-drift-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--tone);
  box-shadow: 0 0 10px var(--tone);
}

.tech-drift-bar i {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: #fff;
  border-radius: 2px;
}

.tech-sub {
  margin: 20px 0 10px;
  font-family: var(--display);
  font-size: 0.95rem;
}

.rec-card {
  --tone: #6b7c99;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  margin-bottom: 8px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--tone);
  background: linear-gradient(165deg, #1a2030, #141923);
  animation: tech-in 0.35s ease both;
  animation-delay: calc(var(--i, 0) * 50ms);
}

.rec-card.ok { --tone: var(--ok); }
.rec-card.alerta { --tone: #fb923c; }
.rec-card.critico { --tone: #f87171; }

.rec-ico {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
  color: var(--tone);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--tone);
}

.rec-card h4 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 0.92rem;
}

.rec-card p {
  margin: 0;
  font-size: 0.77rem;
  line-height: 1.5;
  color: var(--muted);
}

.tech-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.tech-metric {
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.tech-metric span {
  display: block;
  margin-bottom: 3px;
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.tech-metric strong {
  font-family: var(--mono);
  font-size: 0.88rem;
}

.tech-note {
  margin-top: 14px;
}

@media (max-width: 900px) {
  .tech-shell {
    grid-template-columns: 1fr;
  }

  .tech-side {
    position: static;
  }
}

@media (max-width: 560px) {
  .tech-grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .pro-hero {
    padding: 20px 16px 18px;
  }

  .pro-hero-icon {
    width: 54px;
    height: 54px;
    font-size: 1.7rem;
  }

  .tech-big strong {
    font-size: 1.45rem;
  }
}

/* ===== Aprende ===== */
.learn-wrap,
.reg-wrap {
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.learn-wrap {
  max-width: 900px;
}

.reg-wrap h2 {
  font-family: var(--display);
}

.learn-topics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.learn-topics a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #1a2030, #141923);
  color: var(--text);
  font-size: 0.74rem;
  line-height: 1.3;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.learn-topics a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.learn-topics a span {
  font-size: 1.1rem;
}

.learn-list {
  display: grid;
  gap: 10px;
}

.learn-card {
  scroll-margin-top: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #1a2030, #141923);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.learn-card[open] {
  border-color: rgba(232, 163, 61, 0.45);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
}

.learn-card.is-flash {
  animation: learn-flash 1.2s ease;
}

@keyframes learn-flash {
  0%, 60% { box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.5); }
  100% { box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3); }
}

.learn-card summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.learn-card summary::-webkit-details-marker {
  display: none;
}

.learn-card summary::after {
  content: "";
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin: 0 4px 4px auto;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}

.learn-card[open] summary::after {
  margin-bottom: -4px;
  transform: rotate(-135deg);
}

.learn-ico {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  font-size: 1.35rem;
  background: var(--accent-soft);
  border: 1px solid rgba(232, 163, 61, 0.25);
}

.learn-title {
  display: flex;
  flex-direction: column;
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.3;
}

.learn-title small {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.learn-body {
  padding: 2px 18px 18px 74px;
  animation: tech-in 0.3s ease both;
}

.learn-body p,
.learn-body li {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.learn-body p {
  margin: 0;
}

.learn-body a {
  color: var(--accent);
}

.learn-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.learn-facts div {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.learn-facts strong {
  display: block;
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--accent-strong);
}

.learn-facts span {
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--muted);
}

.learn-steps {
  counter-reset: learn-step;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.learn-steps li {
  counter-increment: learn-step;
  position: relative;
  padding: 12px 12px 12px 46px;
  border-radius: 12px;
  background: rgba(125, 206, 160, 0.07);
  border: 1px solid rgba(125, 206, 160, 0.22);
}

.learn-steps li::before {
  content: counter(learn-step);
  position: absolute;
  left: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f2a1b;
  background: var(--ok);
}

.learn-steps strong {
  display: block;
  font-family: var(--display);
  color: var(--text);
}

.learn-steps span {
  font-size: 0.72rem;
  line-height: 1.4;
}

.learn-check {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.learn-check li {
  position: relative;
  padding: 8px 12px 8px 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.learn-check li::before {
  position: absolute;
  left: 10px;
  top: 8px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
}

.learn-check.warn li::before {
  content: "!";
  color: #2a0f0f;
  background: #f87171;
}

.learn-check.ok li::before {
  content: "";
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f2a1b' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.learn-alert {
  margin-top: 10px !important;
  padding: 10px 12px;
  border-radius: 10px;
  color: #fcd34d !important;
  background: rgba(245, 179, 1, 0.08);
  border: 1px solid rgba(245, 179, 1, 0.3);
}

.learn-sources {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.learn-sources > * {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.learn-sources a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.learn-sources strong {
  font-family: var(--display);
  font-size: 0.88rem;
  color: var(--text);
}

/* Flecha de "enlace externo" dibujada con máscara SVG (sin caracteres especiales). */
.learn-sources a strong::after {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 5px;
  vertical-align: -0.05em;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
}

.learn-sources span {
  font-size: 0.7rem;
  color: var(--muted);
}

.learn-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid transparent;
  background:
    linear-gradient(160deg, #191e2a, #12161f) padding-box,
    linear-gradient(135deg, var(--accent), #38bdf8) border-box;
}

.learn-cta h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 1.15rem;
}

.learn-cta p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.learn-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.learn-cta-btn {
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.learn-cta-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.learn-cta-btn.main {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: var(--accent-ink);
  font-weight: 700;
}

@media (max-width: 760px) {
  .learn-topics {
    grid-template-columns: repeat(2, 1fr);
  }

  .learn-body {
    padding: 2px 16px 16px;
  }

  .learn-facts,
  .learn-steps,
  .learn-sources {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tech-results,
  .rec-card,
  .learn-body,
  .learn-card.is-flash {
    animation: none;
  }
}

/* ===== Registro ===== */
.reg-panel {
  background:
    radial-gradient(circle at 12% 0%, rgba(232, 163, 61, 0.14), transparent 38%),
    radial-gradient(circle at 92% 30%, rgba(125, 206, 160, 0.08), transparent 35%),
    var(--bg);
}

.reg-wrap {
  max-width: 980px;
}

.reg-hero {
  position: relative;
  overflow: hidden;
  margin: 16px 0 18px;
  padding: 28px 26px 24px;
  border-radius: 22px;
  border: 1px solid rgba(232, 163, 61, 0.35);
  background:
    radial-gradient(circle at 100% 0%, rgba(232, 163, 61, 0.28), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(225, 29, 72, 0.12), transparent 45%),
    linear-gradient(160deg, #1b2130, #121620);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.reg-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(90deg, transparent, #000 60%);
  pointer-events: none;
}

.reg-hero > * {
  position: relative;
  z-index: 1;
}

.reg-hero-icon {
  float: right;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 0 8px 16px;
  border-radius: 20px;
  font-size: 2.3rem;
  background: rgba(232, 163, 61, 0.14);
  border: 1px solid rgba(232, 163, 61, 0.4);
  box-shadow: 0 0 30px rgba(232, 163, 61, 0.25);
}

.reg-hero h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.1;
}

.reg-hero h2 span {
  background: linear-gradient(90deg, var(--accent-strong), #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.reg-hero-lead {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.reg-hero-stats {
  clear: both;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.reg-hero-stat {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.reg-hero-stat strong {
  display: block;
  font-family: var(--display);
  font-size: 1.6rem;
  line-height: 1;
}

.reg-hero-stat span {
  font-size: 0.7rem;
  color: var(--muted);
}

.reg-hero-stat.ok strong {
  color: var(--ok);
}

.reg-hero-stat.wait strong {
  color: var(--accent-strong);
}

/* Aviso demo con borde de cinta de precaución */
.reg-demo {
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: repeating-linear-gradient(-45deg, #f5b301 0 12px, #14110a 12px 24px);
}

.reg-demo-inner {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 12px;
  background: #1d1a12;
}

.reg-demo-inner p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text);
}

.reg-demo-inner strong {
  color: #fcd34d;
}

.reg-demo-icon {
  font-size: 1.9rem;
  line-height: 1;
}

/* Llamado a publicar */
.reg-cta {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 22px;
  margin-bottom: 26px;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid transparent;
  background:
    linear-gradient(160deg, #191e2a, #12161f) padding-box,
    linear-gradient(135deg, var(--accent), #e11d48 55%, #7c3aed) border-box;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

.reg-cta-kicker {
  display: inline-block;
  margin: 0 0 8px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fda4af;
  background: rgba(225, 29, 72, 0.14);
  border: 1px solid rgba(225, 29, 72, 0.35);
}

.reg-cta h3 {
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0 0 8px;
}

.reg-cta p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
  margin: 0 0 14px;
}

.reg-phone {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 99px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(232, 163, 61, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.reg-phone::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid rgba(232, 163, 61, 0.6);
  animation: reg-ring 2.2s ease-out infinite;
  pointer-events: none;
}

.reg-phone:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(232, 163, 61, 0.45);
}

.reg-phone-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(26, 18, 4, 0.18);
}

@keyframes reg-ring {
  0% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.18); }
}

.reg-cta .reg-cta-sub {
  color: var(--text);
  font-weight: 700;
  margin-bottom: 10px;
}

.reg-who-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reg-who-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.reg-who-list li:hover {
  border-color: rgba(232, 163, 61, 0.5);
  background: rgba(232, 163, 61, 0.08);
  transform: translateY(-2px);
}

.reg-who-list li span {
  font-size: 1.15rem;
}

/* Buscador y filtros */
.reg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.reg-search-box {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reg-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.reg-search-box svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.reg-search {
  flex: 1;
  min-width: 0;
  padding: 13px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
}

.reg-filters {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel-solid);
}

.reg-filter {
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.reg-filter:hover {
  color: var(--text);
}

.reg-filter.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

/* Tarjetas de edificios */
.reg-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
  align-items: start;
}

.reg-card {
  --tone: var(--ok);
  --tone-soft: rgba(125, 206, 160, 0.14);
  position: relative;
  overflow: hidden;
  padding: 18px 16px 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #1a2030, #141923);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  animation: reg-rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.reg-card.wait {
  --tone: var(--accent-strong);
  --tone-soft: rgba(232, 163, 61, 0.14);
}

.reg-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--tone), transparent);
}

.reg-card:hover {
  transform: translateY(-4px);
  border-color: var(--tone);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--tone-soft);
}

@keyframes reg-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.reg-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.reg-card-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  font-size: 1.6rem;
  background: var(--tone-soft);
  border: 1px solid var(--tone-soft);
}

.reg-card-title {
  flex: 1;
  min-width: 0;
}

.reg-card-title h3 {
  font-family: var(--display);
  font-size: 1.02rem;
  line-height: 1.25;
  margin: 0 0 3px;
}

.reg-card-title p {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
}

.reg-seal {
  display: inline-block;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--tone);
  background: var(--tone-soft);
  border: 1px solid var(--tone);
  box-shadow: 0 0 14px var(--tone-soft);
}

.reg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 12px;
}

.reg-tags span {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.7rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.reg-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.reg-progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.reg-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tone), var(--tone-soft));
}

.reg-progress small {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

.reg-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.reg-more:hover {
  border-color: var(--tone);
  background: var(--tone-soft);
}

.reg-more svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s ease;
}

.reg-more[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.reg-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  animation: reg-rise 0.3s ease both;
}

.reg-detail[hidden] {
  display: none;
}

.reg-detail-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

.reg-docs {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.reg-docs li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}

.reg-docs li span {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
}

.reg-docs li.has span {
  color: #0f2a1b;
  background: var(--ok);
}

.reg-docs li.missing {
  color: var(--muted);
}

.reg-docs li.missing span {
  color: var(--muted);
  border: 1px dashed var(--muted);
}

.reg-docs em {
  font-style: normal;
  font-size: 0.65rem;
  padding: 1px 7px;
  border-radius: 99px;
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.reg-review {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--tone-soft);
}

.reg-empty {
  grid-column: 1 / -1;
  padding: 28px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Para quién sirve */
.reg-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 1.3rem;
  margin: 36px 0 14px;
}

.reg-for {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.reg-for-card {
  padding: 20px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #1a2030, #141923);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.reg-for-card:hover {
  transform: translateY(-4px);
  border-color: rgba(232, 163, 61, 0.5);
}

.reg-for-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 16px;
  font-size: 1.7rem;
  background: var(--accent-soft);
  border: 1px solid rgba(232, 163, 61, 0.3);
}

.reg-for-card h4 {
  font-family: var(--display);
  font-size: 1rem;
  margin: 0 0 6px;
}

.reg-for-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* Cómo se verificaría: línea de tiempo */
.reg-steps {
  counter-reset: reg-step;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reg-steps::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 16%;
  right: 16%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--ok));
  opacity: 0.6;
}

.reg-steps li {
  counter-increment: reg-step;
  position: relative;
  margin-top: 22px;
  padding: 34px 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #1a2030, #141923);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
  text-align: center;
}

.reg-steps li::before {
  content: counter(reg-step);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: var(--accent-ink);
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 0 0 6px var(--bg), 0 0 24px rgba(232, 163, 61, 0.4);
}

.reg-steps li:last-child::before {
  background: linear-gradient(135deg, #a7f3c4, var(--ok));
  box-shadow: 0 0 0 6px var(--bg), 0 0 24px rgba(125, 206, 160, 0.4);
}

.reg-steps li strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--display);
  font-size: 0.98rem;
  color: var(--text);
}

@media (max-width: 760px) {
  .reg-hero {
    padding: 22px 18px 18px;
  }

  .reg-hero-icon {
    width: 56px;
    height: 56px;
    font-size: 1.8rem;
  }

  .reg-cta {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .reg-filters {
    flex: 1 1 100%;
  }

  .reg-filter {
    flex: 1;
    padding: 9px 4px;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .reg-steps {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .reg-steps::before {
    display: none;
  }

  .reg-steps li {
    margin-top: 0;
    padding: 16px 16px 16px 70px;
    text-align: left;
  }

  .reg-steps li::before {
    top: 16px;
    left: 16px;
    transform: none;
  }
}

@media (max-width: 420px) {
  .reg-who-list {
    grid-template-columns: 1fr;
  }

  .reg-hero-stat strong {
    font-size: 1.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reg-card,
  .reg-detail,
  .reg-phone::after {
    animation: none;
  }
}

/* ===== Responsive: menú desplegable ===== */
@media (max-width: 860px) {
  :root,
  html[data-theme="dark"],
  html[data-theme="light"] {
    --nav-w: 0px;
  }

  .tab-panel {
    inset: var(--top-h, 60px) 0 0 1;
  }

  .nav-toggle {
    display: grid;
    place-items: center;
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    z-index: 1200;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-solid);
    color: var(--text);
    box-shadow: var(--shadow);
    cursor: pointer;
  }

  .nav-toggle .ico-close {
    display: none;
  }

  body.nav-open .nav-toggle .ico-menu {
    display: none;
  }

  body.nav-open .nav-toggle .ico-close {
    display: block;
  }

  body.nav-open .nav-toggle {
    border-color: var(--accent);
    color: var(--accent);
  }

  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: var(--overlay);
  }

  .nav-backdrop:not([hidden]) {
    display: block;
  }

  .side-nav {
    width: min(248px, 86vw);
    z-index: 1100;
    transform: translateX(-110%);
    transition: transform 0.22s ease;
    padding: 62px 10px max(16px, env(safe-area-inset-bottom));
    align-items: stretch;
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.28);
  }

  body.nav-open .side-nav {
    transform: translateX(0);
  }

  .nav-brand {
    margin: 0 auto 12px;
  }

  .nav-main {
    justify-content: flex-start;
    gap: 6px;
  }

  .nav-btn {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 48px;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .theme-switch {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px;
    font-size: 0.78rem;
  }

  .map-header {
    top: max(10px, env(safe-area-inset-top));
    left: calc(max(10px, env(safe-area-inset-left)) + 52px);
    width: min(240px, calc(100% - 74px));
    max-height: min(48vh, calc(100% - 96px));
  }

  .live-badge {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    padding: 6px 10px;
    font-size: 0.62rem;
    gap: 6px;
  }

  .legend {
    left: max(10px, env(safe-area-inset-left));
    bottom: max(12px, env(safe-area-inset-bottom));
    padding: 8px 10px;
    font-size: 0.68rem;
  }

  .ficha-overlay {
    top: auto;
    right: max(10px, env(safe-area-inset-right));
    left: max(10px, env(safe-area-inset-left));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    max-height: min(42vh, 320px);
  }

  .ficha-sheet {
    max-height: min(42vh, 320px);
  }

  .swipe-bar {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .sat-label {
    bottom: 72px;
  }

  .leaflet-top.leaflet-left {
    top: 52px;
  }

  .layer-switch {
    right: max(52px, calc(env(safe-area-inset-right) + 52px));
    bottom: max(26px, env(safe-area-inset-bottom));
  }

  .layer-toggle {
    width: 60px;
    height: 60px;
  }

  .eval-wrap,
  .tech-wrap,
  .learn-wrap,
  .reg-wrap {
    padding: 18px 14px 40px;
  }
}

@media (max-width: 480px) {
  .live-badge small {
    display: none;
  }

  .legend-items {
    grid-auto-flow: column;
    grid-template-rows: auto auto;
    gap: 4px 10px;
  }

  .map-header {
    width: calc(100% - 74px);
  }

  .ficha-overlay {
    max-height: min(38vh, 280px);
  }

  .ficha-sheet {
    max-height: min(38vh, 280px);
  }

  .consulta-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Inicio ===== */
.home {
  --h-text: #fff;
  --h-muted: #c4cddb;
  --h-glass: rgba(13, 17, 25, 0.62);
  --h-line: rgba(255, 255, 255, 0.1);
  --h-soft: rgba(255, 255, 255, 0.05);
  background: #05070b;
  color: var(--h-text);
}

html[data-theme="light"] .home {
  --h-text: var(--text);
  --h-muted: var(--muted);
  --h-glass: rgba(255, 251, 244, 0.8);
  --h-line: rgba(60, 45, 20, 0.14);
  --h-soft: rgba(60, 45, 20, 0.05);
}

.home-globe {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #05070b;
}

.home-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 82% 18%, rgba(240, 180, 41, 0.1), transparent 42%),
    linear-gradient(90deg, rgba(5, 7, 11, 0.88) 0%, rgba(5, 7, 11, 0.5) 45%, rgba(5, 7, 11, 0.25) 100%),
    linear-gradient(180deg, rgba(5, 7, 11, 0.1) 55%, rgba(5, 7, 11, 0.85) 100%);
}

html[data-theme="light"] .home-shade {
  background:
    radial-gradient(circle at 82% 18%, rgba(240, 180, 41, 0.25), transparent 42%),
    linear-gradient(90deg, rgba(246, 240, 230, 0.95) 0%, rgba(246, 240, 230, 0.8) 48%, rgba(246, 240, 230, 0.55) 100%),
    linear-gradient(180deg, rgba(246, 240, 230, 0.2) 55%, rgba(246, 240, 230, 0.95) 100%);
}

.home-scroll {
  position: relative;
  z-index: 2;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(16px, 4vw, 48px);
}

.home-scroll > * {
  width: min(1180px, 100%);
  margin-inline: auto;
}

/* En Inicio el menú de 6 recuadros sustituye a las pestañas de la cabecera,
   para que al entrar no haya dos filas de opciones compitiendo. */
body[data-tab="inicio"] .home-nav {
  display: none;
}

body[data-tab="inicio"] .home-top {
  flex-wrap: nowrap;
}

/* ===== Menú de acceso fácil (6 recuadros) ===== */
.home-menu-head {
  width: min(640px, 100%);
  margin: 8px auto 18px;
  text-align: center;
  animation: home-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.home-menu-title {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 700;
  color: #e8f7ff;
  letter-spacing: -0.03em;
}

.home-menu-lead {
  margin: 0;
  color: var(--h-muted);
  font-size: 0.9rem;
}

/* PC: 3 columnas × 2 filas; tablet y celular cambian en los @media de abajo.
   grid-auto-rows: 1fr deja todas las filas del mismo alto aunque un título
   ocupe dos líneas. */
.home-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 12px;
  margin: 24px auto 0;
  animation: home-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both;
}

/* Mismos colores que el recuadro "Catálogo sísmico" (.home-stats):
   vidrio oscuro (--h-glass), borde fino (--h-line), texto claro y detalles
   en ámbar (--accent). Para cambiar la paleta, cambia esas variables. */
.home-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 0;
  padding: 18px 14px 14px;
  border: 1px solid var(--h-line);
  border-radius: 18px;
  background: var(--h-glass);
  backdrop-filter: blur(14px);
  color: var(--h-text);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  font-family: var(--display);
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-tile:hover,
.home-tile:focus-visible {
  outline: none;
  transform: translateY(-4px);
  border-color: rgba(240, 180, 41, 0.55);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(240, 180, 41, 0.25);
}

.home-tile-num {
  position: absolute;
  top: 10px;
  left: 12px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}

/* Icono de vibración ≋ arriba a la derecha */
.home-tile-wave {
  position: absolute;
  top: 10px;
  right: 12px;
  color: var(--accent);
  opacity: 0.7;
}

.home-tile-wave svg {
  width: 20px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-tile-ico {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(240, 180, 41, 0.35);
  border-radius: 50%;
  color: var(--accent);
  font-size: 1.7rem;
  background: rgba(240, 180, 41, 0.12);
}

.home-tile-ico .ico {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
}

.home-tile strong {
  font-size: 0.92rem;
  line-height: 1.25;
  font-weight: 700;
  color: var(--h-text);
}

.home-tile small {
  color: var(--h-muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.home-foot-compact {
  width: min(640px, 100%);
  padding-top: 24px;
}

.home-foot-compact .home-foot-utb span {
  text-align: left;
}

/* Aviso de entrada (norma + 2 acordeones) */
.home-welcome,
.home-hub {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 10, 16, 0.62);
  backdrop-filter: blur(6px);
}

body.welcome-open {
  overflow: hidden;
}

.home-welcome[hidden],
.home-hub[hidden] {
  display: none;
}

.home-welcome-card,
.home-hub-card {
  position: relative;
  width: min(440px, 100%);
  max-height: min(92vh, 760px);
  overflow-y: auto;
  padding: 22px 18px 16px;
  border: 1px solid #2a3344;
  border-radius: 22px;
  background: #141a24;
  color: #e8edf5;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.home-welcome-x {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #9aa8bd;
  font-size: 1.1rem;
  cursor: pointer;
}

.home-welcome-x:hover,
.home-welcome-x:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.home-welcome-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-right: 36px;
}

.home-welcome-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(232, 163, 61, 0.14);
  color: var(--accent);
  font-size: 1.3rem;
}

.home-welcome-head h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.15rem;
}

.home-welcome-intro {
  margin: 12px 0 14px;
  color: #9aa8bd;
  font-size: 0.82rem;
  line-height: 1.55;
}

.home-welcome-acc {
  margin: 0 0 8px;
  border: 1px solid #2a3344;
  border-radius: 14px;
  background: #10151e;
}

.home-welcome-acc summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.88rem;
  list-style: none;
}

.home-welcome-acc summary::-webkit-details-marker {
  display: none;
}

.home-welcome-acc-ico {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(232, 163, 61, 0.12);
  color: var(--accent);
  font-size: 0.95rem;
}

.home-welcome-acc-warn {
  background: rgba(232, 163, 61, 0.08);
  color: #f0b429;
}

.home-welcome-acc-body {
  padding: 0 14px 14px 14px;
  color: #c5cedb;
  font-size: 0.8rem;
  line-height: 1.55;
}

.home-welcome-acc-body ul {
  margin: 0 0 10px;
  padding-left: 18px;
}

.home-welcome-acc-body p {
  margin: 0 0 8px;
}

.home-welcome-foot {
  margin-top: 16px;
  text-align: center;
  color: #8b98ab;
  font-size: 0.72rem;
  line-height: 1.45;
}

.home-welcome-foot p {
  margin: 0 0 6px;
}

.home-welcome-motto {
  color: #e8edf5;
  font-family: var(--display);
  font-size: 0.86rem;
  font-weight: 600;
}

.home-welcome-visits {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 12px;
  color: var(--accent);
  font-family: var(--mono);
}

.home-welcome-visits[hidden] {
  display: none;
}

.home-welcome-ok {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.home-welcome-ok:hover,
.home-welcome-ok:focus-visible {
  background: var(--accent-strong);
  outline: none;
}

.home-hub-card h2 {
  margin: 0 36px 8px 0;
  font-family: var(--display);
  font-size: 1.15rem;
}

.home-hub-card > p {
  margin: 0 0 14px;
  color: #9aa8bd;
  font-size: 0.85rem;
}

.home-hub-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 10px;
  padding: 12px;
  border: 1px solid #2a3344;
  border-radius: 16px;
  background: #10151e;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-family: var(--display);
}

.home-hub-btn:hover,
.home-hub-btn:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.home-hub-btn strong {
  display: block;
  font-size: 0.95rem;
}

.home-hub-btn small {
  display: block;
  margin-top: 2px;
  color: #9aa8bd;
  font-size: 0.75rem;
}

/* Tablet: 2 columnas */
@media (max-width: 900px) {
  .home-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Celular: lista de una columna (icono a la izquierda, texto a la derecha) */
@media (max-width: 640px) {
  .home-menu {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 18px;
  }

  .home-tile {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 2px;
    align-items: center;
    padding: 12px 44px 12px 12px;
    border-radius: 14px;
    text-align: left;
  }

  .home-tile-ico {
    grid-row: 1 / span 2;
    width: 44px;
    height: 44px;
  }

  .home-tile-ico .ico {
    width: 20px;
    height: 20px;
  }

  .home-tile strong {
    align-self: end;
    font-size: 0.86rem;
  }

  .home-tile small {
    align-self: start;
    font-size: 0.68rem;
  }

  /* El número pasa a la derecha, centrado; las ondas se ocultan para no recargar. */
  .home-tile-num {
    top: 50%;
    left: auto;
    right: 14px;
    transform: translateY(-50%);
  }

  .home-tile-wave {
    display: none;
  }

  /* En celular no se levanta el recuadro al tocarlo. */
  .home-tile:hover,
  .home-tile:focus-visible {
    transform: none;
  }
}

/* Cabecera pegada al borde superior (sin hueco arriba ni esquinas redondeadas). */
.home-top {
  position: sticky;
  top: 0;
  z-index: 5;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  margin-top: 0;
  padding: 10px 12px;
  border: 1px solid var(--h-line);
  border-radius: 0;
  background: rgba(10, 13, 19, 0.86);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

html[data-theme="light"] .home-top {
  background: rgba(255, 252, 246, 0.9);
  box-shadow: 0 14px 40px rgba(60, 40, 10, 0.12);
}

/* En la portada inicio: header transparente, sin recuadro */
/* Degradado oscuro arriba: se ve el mapa, pero el contenido que sube al
   hacer scroll se difumina y no choca con el logo. */
body[data-tab="inicio"] .home-top {
  background: linear-gradient(180deg, rgba(5, 7, 11, 0.85) 0%, rgba(5, 7, 11, 0.55) 70%, transparent 100%);
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
/* Inicio: el mapa de fondo sube detrás de la cabecera transparente;
   solo el contenido (.home-scroll) empieza debajo de ella. */
   body[data-tab="inicio"] .tab-panel[data-panel="inicio"] {
    inset: 0 0 0 var(--nav-w);
  }
  
  body[data-tab="inicio"] .home-scroll {
    padding-top: var(--top-h, 60px);
  }

.home-nav {
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.home-nav-btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--h-text);
  font-family: var(--display);
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.home-nav-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--accent);
}

.home-nav-btn:hover,
.home-nav-btn:focus-visible {
  border-color: rgba(240, 180, 41, 0.45);
  background: rgba(240, 180, 41, 0.12);
  color: var(--accent);
  outline: none;
}

.home-nav-main {
  background: linear-gradient(160deg, var(--accent-strong), var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 6px 18px rgba(240, 180, 41, 0.3);
}

.home-nav-main svg {
  color: currentColor;
}

.home-nav-main:hover,
.home-nav-main:focus-visible {
  background: linear-gradient(160deg, var(--accent-strong), var(--accent));
  color: var(--accent-ink);
  filter: brightness(1.08);
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.home-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--accent-strong), var(--accent));
  color: var(--accent-ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 6px 20px rgba(240, 180, 41, 0.35);
}

.home-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.home-brand-text strong {
  font-family: var(--display);
  font-size: 1.05rem;
}

.home-brand-text small {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--h-muted);
}

.home-top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-utb {
  display: flex;
  align-items: center;
  transition: transform 0.2s ease, filter 0.2s ease;
  filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.25));
}

.home-utb:hover {
  transform: translateY(-2px) scale(1.05);
  filter: drop-shadow(0 0 16px rgba(250, 204, 21, 0.45));
}

.home-utb img {
  display: block;
  width: auto;
  height: 46px;
}


.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  margin-top: clamp(32px, 7vh, 72px);
}

.home-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 14px 6px 10px;
  border: 1px solid rgba(240, 180, 41, 0.4);
  border-radius: 999px;
  background: rgba(240, 180, 41, 0.1);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.home-pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
}

.home-pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #ef4444;
  animation: home-ping 1.8s ease-out infinite;
}

@keyframes home-ping {
  from {
    transform: scale(0.6);
    opacity: 0.9;
  }
  to {
    transform: scale(2);
    opacity: 0;
  }
}

.home-title {
  margin: 18px 0 0;
  font-family: var(--display);
  font-size: clamp(2.1rem, 4.6vw, 3.9rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--h-text);
}

.home-title span {
  background: linear-gradient(90deg, #ffd166, var(--accent) 45%, #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme="light"] .home-title span {
  background-image: linear-gradient(90deg, #b7791f, #d97706 45%, #c2410c);
}

.home-lead {
  max-width: 560px;
  margin: 18px 0 0;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--h-muted);
}

.home-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1px solid var(--h-line);
  border-radius: 14px;
  background: var(--h-soft);
  color: var(--h-text);
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-btn:hover,
.home-btn:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  outline: none;
}

.home-btn-main {
  border-color: transparent;
  background: linear-gradient(160deg, var(--accent-strong), var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 12px 32px rgba(240, 180, 41, 0.35);
}

.home-btn-main:hover,
.home-btn-main:focus-visible {
  border-color: transparent;
  box-shadow: 0 16px 40px rgba(240, 180, 41, 0.5);
}

.home-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.home-btn:hover svg {
  transform: translateX(4px);
}

.home-stats {
  padding: 22px;
  border: 1px solid var(--h-line);
  border-radius: 22px;
  background: var(--h-glass);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.home-stats-title {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.home-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--h-line);
  border-radius: 14px;
  background: var(--h-soft);
}

.home-stat-num {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--h-text);
}

.home-stat-label {
  font-size: 0.66rem;
  line-height: 1.45;
  color: var(--h-muted);
}

.home-stats-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 14px 0 0;
  font-size: 0.62rem;
  color: var(--h-muted);
}

.home-stats-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.home-stats-legend span:first-child {
  flex-basis: 100%;
}

.home-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.home-dot-shallow {
  background: #facc15;
  box-shadow: 0 0 6px #facc15;
}

.home-dot-mid {
  background: #f97316;
  box-shadow: 0 0 6px #f97316;
}

.home-dot-deep {
  background: #e11d48;
  box-shadow: 0 0 6px #e11d48;
}

.home-stats-src {
  margin: 14px 0 0;
  font-size: 0.62rem;
  color: var(--h-muted);
}

.home-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 32px 0 20px;
  font-size: 0.68rem;
  color: var(--h-muted);
  text-align: center;
}

.home-foot p {
  margin: 0;
}

.home-foot-utb {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--h-text);
  text-decoration: none;
}

.home-foot-utb img {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 16px;
  background: #000008;
  border: 1px solid rgba(250, 204, 21, 0.45);
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-foot-utb:hover img {
  transform: scale(1.06);
  box-shadow: 0 0 22px rgba(250, 204, 21, 0.35);
}

.home-foot-utb:hover strong {
  color: var(--accent);
}

.home-credit {
  width: 100%;
  opacity: 0.7;
  font-size: 0.6rem;
}

.home-foot-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.home-visitas {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: rgba(240, 180, 41, 0.08);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: nowrap;
}

.home-visitas[hidden] {
  display: none;
}

/* Norma oficial (información) */
.home-info {
  margin-top: clamp(36px, 8vh, 80px);
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--h-line);
  border-radius: 24px;
  background: var(--h-glass);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.home-info-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.home-info-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(240, 180, 41, 0.12);
  border: 1px solid rgba(240, 180, 41, 0.35);
  font-size: 1.6rem;
}

.home-info-head h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  color: var(--h-text);
}

.home-info-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
}

.home-info-intro {
  max-width: 760px;
  margin: 16px 0 0;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--h-muted);
}

.home-info-intro b {
  color: var(--h-text);
}

/* Botón que lleva a la pestaña Acerca de (el detalle de la norma vive ahí) */
.home-info-btn {
  margin-top: 18px;
}

/* Simulación de sismo (cada 10 s, desde inicio.js) */
.home-quake {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.home-quake-ring {
  position: absolute;
  top: var(--qy, 50%);
  left: var(--qx, 50%);
  width: 160vmax;
  height: 160vmax;
  margin: -80vmax 0 0 -80vmax;
  border: 2px solid rgba(240, 180, 41, 0.7);
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(240, 180, 41, 0.25), inset 0 0 40px rgba(240, 180, 41, 0.15);
  opacity: 0;
  transform: scale(0.01);
}

.home-quake-tag {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 16px;
  border: 1px solid rgba(240, 180, 41, 0.6);
  border-radius: 999px;
  background: rgba(10, 13, 19, 0.88);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.74rem;
  white-space: nowrap;
  max-width: calc(100% - 24px);
  box-sizing: border-box;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.home-quake-tag span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-quake-tag svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home.is-quaking .home-globe {
  animation: home-quake-globe 2s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.home.is-quaking .home-quake-ring {
  animation: home-quake-ring 2.2s cubic-bezier(0.2, 0.6, 0.3, 1) both;
}

.home.is-quaking .home-quake-ring:nth-child(2) {
  animation-delay: 0.3s;
}

.home.is-quaking .home-quake-ring:nth-child(3) {
  animation-delay: 0.6s;
}

.home.is-quaking .home-quake-tag {
  animation: home-quake-tag 2.6s ease both;
}

/* La escala evita que se vean los bordes del mapa al desplazarse. */
@keyframes home-quake-globe {
  0%, 100% { transform: none; }
  4% { transform: scale(1.06) translate(-14px, 5px) rotate(-0.4deg); }
  9% { transform: scale(1.06) translate(13px, -6px) rotate(0.4deg); }
  14% { transform: scale(1.055) translate(-12px, 4px) rotate(-0.35deg); }
  20% { transform: scale(1.05) translate(11px, -5px) rotate(0.3deg); }
  27% { transform: scale(1.045) translate(-9px, 3px) rotate(-0.25deg); }
  35% { transform: scale(1.04) translate(7px, -3px) rotate(0.2deg); }
  45% { transform: scale(1.03) translate(-5px, 2px) rotate(-0.1deg); }
  57% { transform: scale(1.02) translate(4px, -1px); }
  70% { transform: scale(1.01) translate(-2px, 1px); }
  84% { transform: scale(1.004) translate(1px, 0); }
}

@keyframes home-quake-ring {
  0% { opacity: 0.9; transform: scale(0.01); }
  100% { opacity: 0; transform: scale(1); }
}

@keyframes home-quake-tag {
  0% { opacity: 0; transform: translate(-50%, 12px); }
  12%, 80% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 12px); }
}

/* Entrada escalonada */
.home-hero-text,
.home-stats,
.home-info,
.home-foot {
  animation: home-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.home-hero-text {
  animation-delay: 0.12s;
}

.home-stats {
  animation-delay: 0.22s;
}

.home-info,
.home-foot {
  animation-delay: 0.32s;
}

@keyframes home-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero-text,
  .home-stats,
  .home-info,
  .home-foot,
  .home-pulse::after,
  .home.is-quaking .home-globe,
  .home.is-quaking .home-quake-ring,
  .home.is-quaking .home-quake-tag {
    animation: none;
  }
}

/* ===== Botones Atrás / Sismos ===== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 8px 14px 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-solid);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.back-btn:hover,
.back-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.back-btn[hidden] {
  display: none;
}

.back-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.back-btn-map {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  z-index: 600;
  margin: 0;
}

.back-btn-map.map-drawer-open {
  left: calc(max(10px, env(safe-area-inset-left)) + 100px);
}

.tab-panel[data-panel="mapa"] .map-header {
  top: calc(max(10px, env(safe-area-inset-top)) + 48px);
  left: max(10px, env(safe-area-inset-left));
  max-height: calc(100% - 72px);
}

/* En el mapa la cabecera se oculta y el mapa ocupa toda la pantalla
   (tiene sus propios botones Atrás y "Sismos y filtros"). */
body[data-tab="mapa"] #appTop {
  display: none;
}

body[data-tab="mapa"] .tab-panel[data-panel="mapa"] {
  inset: 0 0 0 var(--nav-w);
}

@media (max-width: 1240px) {
  .home-brand-text {
    display: none;
  }

  /* Con 6 botones en el menú, en pantallas medianas hay que apretarlos para que entren. */
  .home-nav {
    gap: 2px;
  }

  .home-nav-btn {
    gap: 6px;
    padding: 9px 8px;
    font-size: 0.8rem;
  }
}

@media (max-width: 980px) {
  .home-brand-text {
    display: flex;
  }

  .home-brand-text small {
    display: none;
  }

  .home-top {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .home-nav {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
    padding-top: 10px;
    border-top: 1px solid var(--h-line);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .home-nav::-webkit-scrollbar {
    display: none;
  }

  .home-nav-btn:first-child {
    margin-left: auto;
  }

  .home-nav-btn:last-child {
    margin-right: auto;
  }
}

@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-shade {
    background:
      radial-gradient(circle at 82% 10%, rgba(240, 180, 41, 0.1), transparent 45%),
      linear-gradient(180deg, rgba(5, 7, 11, 0.62), rgba(5, 7, 11, 0.82));
  }

  html[data-theme="light"] .home-shade {
    background:
      radial-gradient(circle at 82% 10%, rgba(240, 180, 41, 0.2), transparent 45%),
      linear-gradient(180deg, rgba(246, 240, 230, 0.85), rgba(246, 240, 230, 0.95));
  }
}

@media (max-width: 640px) {
  .home-top {
    top: 0;
    margin-top: 0;
    padding: 8px 10px;
  }

  .home-utb img {
    height: 38px;
  }

  .home-visitas {
    gap: 4px;
    padding: 5px 10px;
    font-size: 0.68rem;
  }

  /* Una columna por botón del menú de la cabecera (hoy 7, con Antrópico). */
  .home-nav {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
  }

  .home-nav-btn,
  .home-nav-btn:first-child,
  .home-nav-btn:last-child {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    margin: 0;
    padding: 8px 2px;
    font-size: 0.66rem;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
  }

  .home-btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .home-stats {
    padding: 16px;
  }

  .home-stat {
    padding: 12px;
  }

  .tab-panel[data-panel="mapa"] .map-header {
    width: calc(100% - 20px);
  }
}

@media (max-width: 420px) {
  .home-brand-text {
    display: none;
  }
}

/* ===== Acerca de ===== */
/* Pestaña data-panel="acerca": norma, qué hace cada parte, fuentes y límites.
   Usa .pro-hero (portada común) y .learn-sources (enlaces de Aprende). */
.about-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.about-block {
  margin: 0 0 14px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #1a2030, #141923);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--muted);
}

.about-block h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 1.1rem;
  color: var(--text);
}

.about-block h3 .ico {
  color: var(--accent);
}

.about-block p {
  margin: 0 0 12px;
}

.about-block p:last-child {
  margin-bottom: 0;
}

.about-block ul {
  margin: 0 0 12px;
  padding-left: 18px;
}

.about-block li + li {
  margin-top: 8px;
}

.about-block b {
  color: var(--text);
}

.about-block a {
  color: var(--accent);
}

.about-small {
  font-size: 0.72rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.about-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.about-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 0.92rem;
  color: var(--text);
}

.about-card h4 .ico {
  color: var(--accent);
}

.about-card p {
  margin: 0;
  font-size: 0.74rem;
}

.about-warn {
  border-color: rgba(232, 163, 61, 0.45);
  background: linear-gradient(165deg, rgba(232, 163, 61, 0.1), #141923 70%);
}

.about-final {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(232, 163, 61, 0.1);
  color: var(--text);
}

@media (max-width: 640px) {
  .about-wrap {
    padding: 18px 14px 40px;
  }

  .about-grid,
  .about-block .learn-sources {
    grid-template-columns: 1fr;
  }
}

/* ===== Capas temáticas ===== */
.capas-ctl {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 650;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.tab-panel[data-panel="mapa"] .live-badge {
  top: calc(max(16px, env(safe-area-inset-top)) + 54px);
}

.capas-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.capas-btn:hover,
.capas-btn[aria-expanded="true"] {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.capas-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
}

.capas-count {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  font-size: 0.68rem;
  color: var(--accent-ink);
  background: var(--accent);
}

.capas-count[hidden] {
  display: none;
}

.capas-panel {
  width: min(330px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(16, 20, 28, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  animation: tech-in 0.2s ease both;
}

.capas-panel[hidden] {
  display: none;
}

.capas-head strong {
  display: block;
  font-family: var(--display);
  font-size: 0.95rem;
}

.capas-head span {
  font-size: 0.68rem;
  color: var(--muted);
}

.legend[hidden] {
  display: none;
}

.capas-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 12px;
  padding: 0;
  list-style: none;
}

.capa-item {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.capa-item.is-on {
  border-color: rgba(232, 163, 61, 0.45);
  background: rgba(232, 163, 61, 0.07);
}

.capa-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.capa-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.capa-switch {
  position: relative;
  flex-shrink: 0;
  width: 34px;
  height: 20px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.2s ease;
}

.capa-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.capa-row input:checked + .capa-switch {
  background: var(--accent);
}

.capa-row input:checked + .capa-switch::after {
  transform: translateX(14px);
}

.capa-row input:focus-visible + .capa-switch {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.capa-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.capa-text strong {
  font-family: var(--display);
  font-size: 0.82rem;
}

.capa-text small {
  font-size: 0.64rem;
  color: var(--muted);
}

.capa-text em {
  font-style: normal;
  color: var(--accent);
}

.capa-legend {
  display: none;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
  padding: 0 12px 10px 56px;
  list-style: none;
  font-size: 0.66rem;
  color: var(--muted);
}

.capa-item.is-on .capa-legend {
  display: flex;
}

.capa-legend li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.capa-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.capa-swatch.linea {
  height: 3px;
  border-radius: 2px;
}

.capa-swatch.punto {
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.capas-tip {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.capa-dato {
  --tone: #6b7c99;
  display: grid;
  gap: 1px;
  padding: 6px 8px 6px 10px;
  border-left: 3px solid var(--tone);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.capa-dato.ok { --tone: #4caf50; }
.capa-dato.alerta { --tone: #f59e0b; }
.capa-dato.critico { --tone: #e0492f; }

.capa-dato span {
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.75;
}

.capa-dato strong {
  font-size: 0.78rem;
  line-height: 1.3;
}

.capa-dato small {
  font-size: 0.6rem;
  opacity: 0.6;
}

.capa-dato.cargando span {
  text-transform: none;
  letter-spacing: 0;
  animation: capas-pulse 1.2s ease-in-out infinite;
}

@keyframes capas-pulse {
  50% { opacity: 0.35; }
}

.capas-pop ul,
.ficha-capas {
  display: grid;
  gap: 5px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.capas-pop-coords,
.capas-pop-load {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  opacity: 0.75;
}

.ficha-capas .capa-dato {
  font-family: var(--mono);
  background: #ebe5d8;
}

.ficha-links {
  margin-top: 6px !important;
  font-size: 0.62rem !important;
}

.ficha-links a {
  color: #8a5a12;
  font-weight: 700;
}

@media (max-width: 860px) {
  .capas-ctl {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
  }

  .tab-panel[data-panel="mapa"] .live-badge {
    top: calc(max(10px, env(safe-area-inset-top)) + 48px);
  }

  .capas-btn {
    padding: 8px 12px;
    font-size: 0.72rem;
  }
}
