/* Tremo v2 — sistema de diseño. Amable como Duolingo, serio cuando hay alerta.
   Tokens en :root; modo oscuro por preferencia del sistema o elección del usuario. */
@font-face{font-family:'Nunito';font-style:normal;font-weight:500 900;font-display:swap;src:url(/fonts/nunito-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Nunito';font-style:normal;font-weight:500 900;font-display:swap;src:url(/fonts/nunito-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root {
  --bg: #F3F6FA; --surface: #FFFFFF; --surface-2: #EDF2F7; --line: #DCE4EE; --line-2: #C9D4E2;
  --text: #15203A; --muted: #56627C; --faint: #647088;
  --brand: #12B3A3; --brand-d: #0A8A7E; --brand-soft: #DDF5F2; --brand-ink: #06594F;
  /* Botón principal más profundo que la marca: texto blanco legible (4,9:1). */
  --btn: #0A7F74; --btn-d: #065F56;
  --sun: #FFB43F; --sun-d: #DA8E12; --sun-soft: #FFF2DB; --sun-ink: #94600A;
  --sky: #1F6FD8; --sky-d: #1552A8; --sky-soft: #E2EEFD; --sky-ink: #1552A8; --link: var(--sky);
  --danger: #D42D31; --danger-d: #A91F26; --danger-soft: #FDE4E4; --danger-ink: #A91F26;
  --warn: #F29A0E; --ok: #137A3A; --ok-soft: #DDF6E6;
  --m-micro: #69758B; --m-minor: #15803D; --m-light: #D9A70B; --m-moderate: #F07B16; --m-strong: #E23B3B; --m-major: #A61E2D; --m-great: #6D35D9;
  --radius: 18px; --radius-s: 12px; --radius-xs: 8px;
  --shadow: 0 2px 0 var(--line), 0 10px 28px rgba(21, 32, 58, .06);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --tabbar-h: 66px; --topbar-h: 60px; --side-w: 236px;
  /* Bordes del sistema. En la app Android, Capacitor da los reales en --safe-area-inset-*: el env() de algunas
     WebView llega en 0 arriba y el encabezado quedaba debajo de la barra de estado. */
  --sat: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --sab: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --head-h: calc(var(--topbar-h) + var(--sat));
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0C1220; --surface: #131B2E; --surface-2: #1A2440; --line: #25314E; --line-2: #32406A;
  --text: #E6ECF8; --muted: #A2AECB; --faint: #8591AE;
  --brand-soft: #0D3A36; --brand-ink: #7BE5D9; --sun-soft: #3A2A0E; --sky-soft: #132A4A; --danger-soft: #3D1418; --ok-soft: #0F3320;
  --link: #6FA8FF; --sky-ink: #8CB8FF; --sun-ink: #F5B545; --danger-ink: #FF7A7D; --ok: #4ADE80;
  --shadow: 0 2px 0 #080C16, 0 10px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1220; --surface: #131B2E; --surface-2: #1A2440; --line: #25314E; --line-2: #32406A;
    --text: #E6ECF8; --muted: #A2AECB; --faint: #8591AE;
    --brand-soft: #0D3A36; --brand-ink: #7BE5D9; --sun-soft: #3A2A0E; --sky-soft: #132A4A; --danger-soft: #3D1418; --ok-soft: #0F3320;
    --link: #6FA8FF; --sky-ink: #8CB8FF; --sun-ink: #F5B545; --danger-ink: #FF7A7D; --ok: #4ADE80;
    --shadow: 0 2px 0 #080C16, 0 10px 28px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; font-weight: 900; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
small, .small { font-size: .84rem; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; inset-inline-start: 8px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; transform: translateY(-200%); }
.skip:focus { transform: none; }
svg.i { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Estructura ─────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--head-h); display: flex; align-items: center; gap: 8px;
  padding: 0 12px; padding-top: var(--sat); background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.25rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img, .brand svg { width: 34px; height: 34px; }
.brand img { border-radius: 10px; }
@media (max-width: 479px) { .brand span { display: none; } } /* de 400 a 460 px «Tremo» quedaba cortado por «En vivo» (medido) */
@media (max-width: 439px) { .topbar { gap: 6px; } }
.topbar .spacer { flex: 1; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; padding: 4px 10px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); white-space: nowrap; }
.live-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.8s infinite; will-change: opacity; }
.live-pill.is-stale { background: var(--sun-soft); color: var(--sun-ink); }
.live-pill.is-down { background: var(--danger-soft); color: var(--danger-ink); }
.live-pill.is-stale::before, .live-pill.is-down::before { animation: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; position: relative; font: inherit;
}
.icon-btn:hover { border-color: var(--line-2); text-decoration: none; }
.icon-btn .dot { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 900; display: grid; place-items: center; }
.sos-btn { background: var(--danger); border-color: var(--danger-d); color: #fff; box-shadow: 0 3px 0 var(--danger-d); font-weight: 900; font-size: .8rem; }
.sos-btn:hover { border-color: var(--danger-d); }
.avatar-btn { font-size: 1.3rem; }
/* Tremo Plus siempre a la vista (se oculta si ya lo tienes): dorado, con su precio. */
.plus-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px 0 9px; border-radius: 14px; flex: none;
  background: linear-gradient(135deg, #FFE38F, #F5B545); border: 2px solid #D99A1E; box-shadow: 0 3px 0 #B97F0E; color: #3A2600;
}
.plus-btn:hover { text-decoration: none; filter: brightness(1.04); }
.plus-star { font-size: 1.05rem; line-height: 1; }
.plus-txt { display: flex; flex-direction: column; line-height: 1.05; white-space: nowrap; }
.plus-txt b { font-size: .84rem; font-weight: 900; }
.plus-txt small { font-size: .68rem; font-weight: 800; direction: ltr; unicode-bidi: isolate; } /* "2 USD", "COP 8.900": igual en árabe y persa */
.plus-txt small:empty { display: none; }
/* Móvil y tableta: idioma y descargar pasan al menú (☰), que además lleva lo que en escritorio está en la barra lateral. */
@media (max-width: 1023px) { .topbar .wide-only { display: none; } }
@media (min-width: 1024px) { .topbar .narrow-only { display: none; } }
@media (max-width: 419px) {
  .topbar { padding-inline: 10px; }
  .live-pill { font-size: 0; gap: 0; padding: 8px; } /* solo el punto de color; el texto sigue para lectores de pantalla */
  .live-pill::before { width: 10px; height: 10px; }
  .topbar .icon-btn { width: 40px; height: 40px; }
  .tab { font-size: .62rem; letter-spacing: 0; }
}
.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.menu-sep { grid-column: 1 / -1; height: 2px; background: var(--line-2); margin: 2px 4px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 800; text-align: start; cursor: pointer;
}
.menu-item:hover { border-color: var(--line-2); text-decoration: none; }
.menu-item svg.i { width: 24px; height: 24px; color: var(--brand-ink); }
.menu-item.is-active { border-color: var(--sky); background: var(--sky-soft); }
.menu-item.is-plus { color: #3A2600; background: linear-gradient(135deg, #FFE38F, #F5B545); border-color: #D99A1E; }
.menu-item.is-plus svg.i { color: #3A2600; }
.menu-item.is-sos svg.i { color: var(--danger-ink); }

.layout { display: grid; grid-template-columns: 1fr; min-height: calc(100dvh - var(--head-h)); }
.sidenav { display: none; }
main#app { padding: 14px 14px calc(var(--tabbar-h) + 28px + var(--sab)); max-width: 880px; width: 100%; min-width: 0; margin: 0 auto; outline: none; }
.rightrail { display: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tabbar-h) + var(--sab));
  padding-bottom: var(--sab); display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 2px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--faint);
  font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em;
}
.tab svg.i { width: 26px; height: 26px; }
.tab span { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab:hover { text-decoration: none; color: var(--muted); }
.tab.is-active { color: var(--brand-d); }
.tab.is-active svg.i { stroke-width: 2.6; }
:root[data-theme="dark"] .tab.is-active { color: var(--brand); }

@media (min-width: 1024px) {
  .layout { grid-template-columns: var(--side-w) 1fr; }
  .sidenav {
    display: flex; flex-direction: column; gap: 2px; position: sticky; top: var(--head-h); height: calc(100dvh - var(--head-h));
    padding: 10px 12px; border-right: 2px solid var(--line); overflow-y: auto;
  }
  .sidenav a {
    display: flex; align-items: center; gap: 12px; padding: 7px 12px; border-radius: 14px; border: 2px solid transparent;
    color: var(--muted); font-weight: 800; text-transform: uppercase; font-size: .86rem; letter-spacing: .03em;
  }
  .sidenav a svg.i { width: 22px; height: 22px; } /* 13 opciones en tres grupos: caben sin desplazar en un portátil (1366×657) */
  .sidenav a:hover { background: var(--surface-2); text-decoration: none; }
  .sidenav a.is-active { color: var(--sky); background: var(--sky-soft); border-color: color-mix(in srgb, var(--sky) 45%, transparent); }
  .sidenav .sep { flex: none; height: 2px; background: var(--line-2); margin: 6px 6px; }
  .tabbar { display: none; }
  main#app { padding: 22px 24px 48px; max-width: 900px; }
}
@media (min-width: 1320px) {
  .layout { grid-template-columns: var(--side-w) 1fr 340px; }
  .rightrail { display: flex; flex-direction: column; gap: 14px; padding: 22px 18px; position: sticky; top: var(--head-h); height: calc(100dvh - var(--head-h)); overflow-y: auto; }
}

/* ── Componentes ────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; } /* 150: de a dos también en las tarjetas anidadas del teléfono (Red Tremo iba de a uno) */
.divider { height: 2px; background: var(--line); margin: 14px 0; border: 0; }

.btn {
  --b: var(--btn); --bd: var(--btn-d); --c: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border: 0; border-radius: 14px; background: var(--b); color: var(--c); box-shadow: 0 4px 0 var(--bd);
  font: inherit; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; font-size: .9rem; cursor: pointer;
  transition: transform .06s, box-shadow .06s, filter .15s; text-align: center; user-select: none;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--bd); }
.btn[disabled] { --b: var(--surface-2); --bd: var(--line); --c: var(--faint); cursor: not-allowed; }
.btn.sky { --b: var(--sky); --bd: var(--sky-d); }
.btn.sun { --b: var(--sun); --bd: var(--sun-d); --c: #3B2500; }
.btn.danger { --b: var(--danger); --bd: var(--danger-d); }
.btn.ghost { --b: var(--surface); --bd: var(--line-2); --c: var(--text); border: 2px solid var(--line-2); box-shadow: 0 3px 0 var(--line-2); }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .78rem; border-radius: 11px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); font: inherit; font-weight: 800; cursor: pointer; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; border: 2px solid var(--line);
  background: var(--surface); color: var(--muted); font: inherit; font-size: .85rem; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--line-2); text-decoration: none; }
.chip.is-on { background: var(--sky-soft); border-color: var(--sky); color: var(--sky-d); }
:root[data-theme="dark"] .chip.is-on { color: #9CC4FF; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .chips { flex-wrap: wrap; overflow-x: visible; } } /* en pantallas anchas nada queda escondido */

.seg { display: inline-flex; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 800; font-size: .84rem; padding: 7px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.seg button.is-on { background: var(--surface); color: var(--text); box-shadow: 0 2px 0 var(--line); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span, .label { font-weight: 800; font-size: .88rem; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 600;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--sky); outline: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: .92rem; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; margin-top: 1px; }
.switch { position: relative; display: inline-block; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 3px solid var(--sky); outline-offset: 2px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 2px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .txt { flex: 1; min-width: 0; }
.setting .txt b { display: block; }
.setting .txt small { color: var(--muted); }
/* Un <select> mide lo que su opción más larga ("San Vicente y las Granadinas"): sin esto no encoge y, en una fila, empuja el
   texto a una columna de una palabra y se sale de la pantalla (Mi Tremo → Mi país, en el teléfono). */
select.input { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.setting > select.input { max-width: 58%; }
/* Si no caben en una línea, la lista baja bajo el texto, a todo el ancho (en un teléfono). */
.setting.wrap { flex-wrap: wrap; }
.setting.wrap .txt { flex: 1 1 160px; }
.setting.wrap > select.input { flex: 1 1 220px; max-width: 100%; }
input[type=range] { width: 100%; accent-color: var(--brand); height: 28px; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row output { min-width: 72px; text-align: end; font-weight: 900; }

/* Magnitud e intensidad */
.mag {
  --c: var(--m-micro); display: inline-grid; place-items: center; min-width: 52px; height: 52px; padding: 0 6px; border-radius: 16px;
  background: var(--c); color: #fff; font-weight: 900; font-size: 1.15rem; box-shadow: 0 3px 0 color-mix(in srgb, var(--c) 70%, #000);
  flex: none; font-variant-numeric: tabular-nums;
}
.mag.sm { min-width: 40px; height: 40px; font-size: .95rem; border-radius: 12px; }
.c-micro { --c: var(--m-micro); } .c-minor { --c: var(--m-minor); } .c-light { --c: var(--m-light); }
.mag.c-light, .mag.c-moderate { color: #2B1A00; } /* texto oscuro sobre amarillo y naranja: legible (auditoría) */
.c-moderate { --c: var(--m-moderate); } .c-strong { --c: var(--m-strong); } .c-major { --c: var(--m-major); } .c-great { --c: var(--m-great); }
.mmi { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px; font-size: .78rem; font-weight: 900; background: var(--c, var(--surface-2)); color: #13203A; }
.mmi-1 { --c: #E9EEF5; } .mmi-2 { --c: #BFD0FF; } .mmi-3 { --c: #A6E8FF; } .mmi-4 { --c: #89FFF0; } .mmi-5 { --c: #8BFF9E; }
.mmi-6 { --c: #FFF15C; } .mmi-7 { --c: #FFC43D; } .mmi-8 { --c: #FF8F2E; } .mmi-9 { --c: #FF4B3A; color: #fff; } .mmi-10 { --c: #C81E1E; color: #fff; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px; font-size: .74rem; font-weight: 900; background: var(--surface-2); color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--sun-soft); color: var(--sun-ink); }
.badge.bad { background: var(--danger-soft); color: var(--danger-ink); } .badge.info { background: var(--sky-soft); color: var(--sky-ink); }

/* Lista de sismos */
.quake-list { display: flex; flex-direction: column; }
.quake {
  display: flex; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 2px solid var(--line); cursor: pointer; color: inherit;
  border-radius: 12px;
}
.quake:hover { background: var(--surface-2); text-decoration: none; }
.quake:last-child { border-bottom: 0; }
.quake .info { flex: 1; min-width: 0; }
.quake .place { font-weight: 800; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.quake .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .8rem; color: var(--muted); margin-top: 3px; }
.quake .side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: end; font-size: .78rem; color: var(--muted); flex: none; }
.quake.is-new .place::after { content: " ●"; color: var(--danger); }
.empty { text-align: center; padding: 26px 12px; color: var(--muted); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; height: 60px; margin: 8px 0; }

/* Estado / héroe con mascota */
.hero { display: flex; gap: 14px; align-items: center; }
.hero .mascot { width: 104px; height: 104px; flex: none; }
.bubble {
  position: relative; flex: 1; background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 12px 14px;
  font-weight: 700;
}
.bubble::before { content: ""; position: absolute; left: -11px; top: 26px; border: 10px solid transparent; border-right-color: var(--line); border-left: 0; }
.bubble::after { content: ""; position: absolute; left: -7px; top: 28px; border: 8px solid transparent; border-right-color: var(--surface); border-left: 0; }
[dir="rtl"] .bubble::before { left: auto; right: -11px; border-right-color: transparent; border-left-color: var(--line); border-left: 10px solid var(--line); border-right: 0; }
[dir="rtl"] .bubble::after { left: auto; right: -7px; border-right: 0; border-left: 8px solid var(--surface); }
.status-calm { background: linear-gradient(135deg, var(--brand-soft), var(--surface) 70%); }
.status-watch { background: linear-gradient(135deg, var(--sun-soft), var(--surface) 70%); }
.status-alert { background: linear-gradient(135deg, var(--danger-soft), var(--surface) 70%); border-color: var(--danger); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stat { background: var(--surface-2); border-radius: 14px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 1.35rem; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { display: block; font-size: .7rem; line-height: 1.3; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }

/* Mascota */
.tremo-svg { overflow: visible; }
/* Parpadeo: lo dispara un solo temporizador (mascot.js) 0,3 s cada ~5 s; una animación SVG continua mantenía
   el hilo principal recalculando estilos en cada fotograma. */
.tremo-svg .blink { transform-origin: center 46%; transform-box: fill-box; }
.tremo.blink-now .blink { animation: blink .3s; }
/* Envoltorio HTML: salto, temblor y sismógrafo con transform (los mueve la tarjeta gráfica, no la CPU). */
.tremo { position: relative; display: inline-block; flex: none; line-height: 0; }
.tremo.is-alert { animation: shake .45s infinite; will-change: transform; }
.tremo.is-happy { animation: hop 1.2s ease-in-out infinite; will-change: transform; }
.tremo-ecg { position: absolute; left: 27.5%; top: 53.08%; width: 42.5%; height: 30.77%; overflow: hidden; }
.tremo-ecg i { position: absolute; inset: 0 auto 0 0; width: 200%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 51 40'%3E%3Cpath d='M0 20h8l4-8 6 16 6-20 6 20 5-12 4 4h12' stroke='%230A8A7E' stroke-width='3' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 0 0 / 50% 100% repeat-x; animation: wave 2.4s linear infinite; will-change: transform; }

/* Alertas / overlay: cabe en cualquier pantalla (tamaños por ancho Y alto; si aun así no cabe, se
   desplaza sin cortar arriba: margin:auto en flex centra solo cuando sobra espacio). */
.alert-overlay {
  position: fixed; inset: 0; z-index: 90; display: none; padding: calc(16px + var(--sat)) 16px calc(16px + var(--sab)); overflow-y: auto; overscroll-behavior: contain;
  background: radial-gradient(circle at 50% 30%, rgba(229,56,59,.96), rgba(120,12,20,.97));
  color: #fff; text-align: center;
}
.alert-overlay.is-open { display: flex; animation: flash 1s ease-in-out 3; }
.alert-overlay .box { max-width: 560px; width: 100%; margin: auto; }
.alert-overlay h2 { font-size: clamp(1.25rem, min(1.2rem + 3vw, 5.5vh), 2.6rem); margin: 6px 0; }
.alert-overlay .big { font-size: clamp(2.4rem, min(2rem + 8vw, 12vh), 5.6rem); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.alert-overlay .kicker { font-weight: 900; letter-spacing: .12em; text-transform: uppercase; opacity: .9; }
.alert-overlay .facts { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: min(12px, 1.6vh) 0; }
.alert-overlay .facts span { background: rgba(255,255,255,.16); padding: 5px 12px; border-radius: 12px; font-weight: 800; }
.alert-overlay .count { margin: min(14px, 1.8vh) auto; width: clamp(96px, 19vh, 150px); height: clamp(96px, 19vh, 150px); border-radius: 50%; border: 6px solid rgba(255,255,255,.85); display: grid; place-items: center; font-size: clamp(2.2rem, 6.5vh, 3.4rem); font-weight: 900; }
.alert-overlay .count small { display: block; font-size: .8rem; font-weight: 800; }
.alert-overlay .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: min(16px, 2vh); }
.alert-overlay .note { font-size: .8rem; opacity: .85; margin: min(12px, 1.5vh) 0 0; }
.alert-overlay .note-cta { display: block; width: 100%; background: none; border: 0; color: inherit; font: inherit; font-size: .85rem; font-weight: 800; text-decoration: underline; cursor: pointer; opacity: 1; }
.alert-overlay .btn.ghost { --b: rgba(255,255,255,.14); --bd: rgba(0,0,0,.25); --c: #fff; border-color: rgba(255,255,255,.5); }
@media (min-width: 720px) { .alert-overlay .box { max-width: 760px; } .alert-overlay .actions { grid-template-columns: repeat(4, 1fr); } }
.alert-overlay.is-info { background: radial-gradient(circle at 50% 30%, #1d5fbf, #0c2a5c); }
.alert-overlay.is-crowd { animation: none; } /* informativo: sin el parpadeo de la alerta roja */
.drop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.drop div { background: rgba(255,255,255,.15); border-radius: 14px; padding: 10px 6px; font-weight: 900; font-size: .9rem; }
.drop div span { display: block; font-size: clamp(1.3rem, 4vh, 1.8rem); }

.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; margin-bottom: 12px; font-weight: 700; border: 2px solid transparent; }
.banner.info { background: var(--sky-soft); border-color: color-mix(in srgb, var(--sky) 40%, transparent); }
.banner.warning { background: var(--sun-soft); border-color: color-mix(in srgb, var(--sun) 50%, transparent); }
.banner.danger { background: var(--danger-soft); border-color: var(--danger); }
.banner .grow { flex: 1; }

/* Hojas (bottom sheet) y diálogos */
.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(8, 12, 22, .55); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet {
  width: 100%; max-width: 620px; max-height: 88dvh; overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(20px + var(--sab)); animation: up .2s ease-out;
}
.sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 12px; }
@media (min-width: 720px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 22px; } .sheet::before { display: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sheet-head h2 { margin: 0; }
.toasts { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + var(--sab)); transform: translateX(-50%); z-index: 95; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-weight: 800; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: up .2s; pointer-events: auto; }
.toast.err { background: var(--danger); color: #fff; }
@media (min-width: 1024px) { .toasts { bottom: 24px; } }

/* Mapa */
.map-wrap { position: relative; isolation: isolate; border-radius: var(--radius); overflow: hidden; border: 2px solid var(--line); background: var(--surface-2); } /* isolation: la leyenda (z 500) no se monta sobre las pestañas */
#quake-map { height: min(68dvh, 620px); min-height: 360px; }
.map-full #quake-map { height: calc(100dvh - var(--head-h) - var(--tabbar-h) - var(--sab) - 40px); }
.map-tools { position: absolute; z-index: 500; top: 10px; left: 10px; right: 60px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.map-tools > * { pointer-events: auto; }
.map-tools .chip { box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.map-legend { position: absolute; z-index: 500; bottom: 10px; left: 10px; background: var(--surface); border-radius: 12px; padding: 6px 10px; font-size: .74rem; font-weight: 800; display: flex; gap: 8px; flex-wrap: wrap; box-shadow: 0 2px 8px rgba(0,0,0,.15); max-width: calc(100% - 20px); }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 4px; vertical-align: -1px; }
.maplibregl-map { font-family: var(--font); background: var(--surface-2); }
/* Un selector más fuerte que el de MapLibre: su CSS carga después y dejaba el fondo blanco con el texto claro del
   modo oscuro encima (casi no se leía). */
.maplibregl-popup .maplibregl-popup-content { background: var(--surface); color: var(--text); border-radius: 16px; padding: 14px 14px 12px; font-size: .9rem; box-shadow: 0 8px 24px rgba(0,0,0,.3); border: 1px solid var(--line); }
.maplibregl-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--surface); }
.maplibregl-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--surface); }
.maplibregl-popup.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--surface); }
.maplibregl-popup.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--surface); }
.maplibregl-popup .maplibregl-popup-close-button { color: var(--muted); font-size: 22px; padding: 2px 8px; }
.qpop { display: grid; gap: 10px; min-width: 250px; }
.qpop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qpop-actions .btn { font-size: .74rem; line-height: 1.15; white-space: normal; padding: 8px 8px; min-height: 44px; }
.qpop-head { display: flex; gap: 10px; align-items: center; padding-right: 18px; }
.qpop-head b { display: block; line-height: 1.25; }
.qpop-head small { color: var(--muted); }
.qpop-facts { display: flex; gap: 6px; margin: 0; }
.qpop-facts div { flex: 1; background: var(--surface-2); border-radius: 10px; padding: 6px 8px; min-width: 0; }
.qpop-facts dt { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.qpop-facts dd { margin: 0; font-weight: 800; }
.maplibregl-ctrl-group { border-radius: 12px !important; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.18) !important; }
.maplibregl-ctrl-attrib { font-size: 10px; }
.map-key { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; font-weight: 800; margin: -8px 0 14px; }
.map-key i { display: inline-block; width: 18px; height: 0; border-top: 2px dashed #F07B16; vertical-align: middle; margin-inline-end: 6px; }
.map-key b { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #E23B3B; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); vertical-align: -2px; margin-inline-end: 6px; }
.calc-panel { position: absolute; z-index: 700; left: 10px; top: 10px; width: min(320px, calc(100% - 64px)); max-height: calc(100% - 20px); overflow-y: auto; background: var(--surface); border-radius: 16px; padding: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: .88rem; } /* arriba a la izquierda, sobre todo lo demás (fichas, leyenda); a la derecha quedan los botones del mapa */
@media (max-width: 480px) { .calc-panel { padding: 10px; font-size: .8rem; } }
.panel-close { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #E23B3B; color: #fff; cursor: pointer; box-shadow: 0 3px 10px rgba(226,59,59,.4); transition: transform .15s ease; will-change: transform; }
.panel-close:active { transform: scale(.92); }
.panel-close svg { width: 16px; height: 16px; }
.q-pulse { width: var(--s); height: var(--s); border-radius: 50%; pointer-events: none; }
.q-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--c); animation: qpulse 1.8s ease-out infinite; will-change: transform, opacity; }
@keyframes qpulse { from { transform: scale(1); opacity: .8; } to { transform: scale(3.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .q-pulse::after { animation: none; opacity: .6; } }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--sky); border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(47,127,234,.3); }
.place-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: 0 0 0 3px rgba(18,179,163,.3); }

/* Tabla */
/* Tablas que no caben: se desplazan de lado y una sombra en el borde avisa que hay más (sombras «locales», sin JS). */
.table-wrap { overflow-x: auto; border-radius: 12px;
  background: linear-gradient(to right, var(--surface) 30%, transparent) left / 28px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .16), transparent) left / 10px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .16), transparent) right / 10px 100% no-repeat scroll; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: start; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
/* Teléfono (auditoría del 30-10-2026: la última columna quedaba cortada): letra y márgenes más justos, y las columnas
   secundarias (.opt) se esconden. */
@media (max-width: 600px) {
  table.tbl { font-size: .8rem; }
  .tbl th { font-size: .68rem; letter-spacing: 0; padding: 7px 5px; }
  .tbl td { padding: 8px 5px; }
  .tbl .opt { display: none; }
}

/* Laboratorio */
.gauge { position: relative; width: 190px; margin: 0 auto; text-align: center; }
.gauge svg { width: 190px; height: 110px; }
.gauge .val { position: absolute; left: 0; right: 0; top: 52px; font-size: 2.1rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.gauge .lbl { font-size: .74rem; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin-top: -6px; }
.method { display: grid; grid-template-columns: 92px 1fr 64px; gap: 10px; align-items: center; margin: 8px 0; font-weight: 800; font-size: .88rem; }
.method .bar { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.method .bar i { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--sky)); transition: width .5s; }
.method output { text-align: end; font-variant-numeric: tabular-nums; }
.scan-group { margin: 16px 0 8px; font-size: 1rem; }
.scan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.scan-card { display: grid; gap: 8px; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface-2);
  color: inherit; font: inherit; text-align: start; cursor: pointer; }
.scan-card:hover, .scan-card:focus-visible { border-color: var(--sky); }
.scan-card.is-up { border-color: var(--warn); }
.scan-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.scan-name { font-weight: 800; line-height: 1.3; }
.scan-p { font-size: 1.15rem; font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums; }
.scan-bar { display: block; height: 8px; border-radius: 99px; background: var(--surface); overflow: hidden; }
.scan-bar i { display: block; height: 100%; border-radius: 99px; background: var(--sky); }
.scan-card.is-up .scan-bar i { background: var(--warn); }
.scan-meta { font-size: .78rem; color: var(--muted); line-height: 1.35; }
.spark { width: 100%; height: 90px; display: block; }
.spark rect { fill: var(--sky); } .spark rect.hi { fill: var(--danger); }
.gr-plot { width: 100%; height: 200px; display: block; }
.gr-plot .pt { fill: var(--sky); } .gr-plot .fit { stroke: var(--danger); stroke-width: 2; fill: none; stroke-dasharray: 5 4; }
.gr-plot .ax { stroke: var(--line-2); stroke-width: 1; } .gr-plot text { fill: var(--muted); font-size: 10px; font-family: var(--font); font-weight: 700; }
.kpi { background: var(--surface-2); border-radius: 14px; padding: 12px; }
.kpi b { display: block; font-size: 1.4rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .76rem; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
/* Red Tremo (/red) */
.red-steps { margin: 6px 0 10px; padding-inline-start: 22px; }
.red-steps li { margin: 6px 0; }
a.link-card { display: block; color: inherit; text-decoration: none; }
a.link-card:hover { border-color: var(--line-2); text-decoration: none; }

/* Comunidad */
.chat { display: flex; flex-direction: column; height: min(62dvh, 620px); min-height: 380px; }
.chat-feed { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 6px 2px 10px; overscroll-behavior: contain; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.msg .av { width: 34px; height: 34px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-size: 1.2rem; flex: none; cursor: pointer; border: 0; }
.msg .body { background: var(--surface-2); border-radius: 16px 16px 16px 4px; padding: 8px 12px; cursor: pointer; min-width: 0; }
.msg .who { font-size: .76rem; font-weight: 900; color: var(--sky-d); display: flex; gap: 6px; align-items: center; }
:root[data-theme="dark"] .msg .who { color: #8DB8FF; }
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .time { font-size: .7rem; color: var(--faint); }
.msg .quote { border-inline-start: 3px solid var(--brand); padding: 2px 8px; margin: 2px 0 4px; font-size: .8rem; color: var(--muted); background: color-mix(in srgb, var(--brand) 8%, transparent); border-radius: 6px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg.mine .body { background: var(--brand-soft); border-radius: 16px 16px 4px 16px; }
.msg.pending { opacity: .65; }
.post-hero { display: block; width: 100%; height: auto; border-radius: 16px; margin: 6px 0 14px; background: var(--surface-2); }
.post-thumb { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; margin-bottom: 8px; background: var(--surface-2); }
.post-fig { margin: 4px 0 16px; }
.post-fig img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; background: var(--surface-2); }
.post-video { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 14px; }
/* Anti-spam: el reto de Turnstile y el campo trampa (invisible para las personas). */
.captcha { margin: 10px 0; min-height: 65px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.composer { display: flex; gap: 8px; align-items: flex-end; border-top: 2px solid var(--line); padding-top: 10px; }
.composer textarea { min-height: 46px; max-height: 120px; resize: none; }
.composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* en el teléfono se partía en dos líneas cortadas */
.reply-bar { display: flex; align-items: center; gap: 8px; font-size: .82rem; background: var(--surface-2); border-radius: 10px; padding: 6px 10px; margin-bottom: 6px; }
.people { display: flex; flex-direction: column; gap: 4px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; cursor: pointer; border: 0; background: none; font: inherit; color: inherit; text-align: start; width: 100%; }
.person:hover { background: var(--surface-2); }
.person .av { width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-size: 1.3rem; }
.online-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); display: inline-block; }
.avatar-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.avatar-pick button { height: 48px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font-size: 1.5rem; cursor: pointer; }
.avatar-pick button.is-on { border-color: var(--brand); background: var(--brand-soft); }

/* Aprende: camino tipo Duolingo */
.path { display: flex; flex-direction: column; align-items: center; gap: 46px; padding: 10px 0 40px; }
.unit-head { width: 100%; border-radius: 18px; padding: 14px 16px; color: #fff; background: var(--u, var(--brand)); box-shadow: 0 4px 0 color-mix(in srgb, var(--u, var(--brand)) 70%, #000); }
.unit-head small { opacity: .9; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.node {
  --n: var(--brand); width: 78px; height: 72px; border-radius: 50%; border: 0; background: var(--n); color: #fff; cursor: pointer; display: grid; place-items: center;
  font-size: 1.9rem; box-shadow: 0 7px 0 color-mix(in srgb, var(--n) 68%, #000); transition: transform .08s; position: relative;
}
.node:active { transform: translateY(5px); box-shadow: 0 2px 0 color-mix(in srgb, var(--n) 68%, #000); }
.node.locked { --n: var(--line-2); cursor: not-allowed; filter: grayscale(1); }
.node.quiz { border-radius: 26px; }
.node.done { --n: var(--sun); }
.node .lbl { position: absolute; top: 100%; margin-top: 12px; font-size: .78rem; font-weight: 800; color: var(--muted); width: 150px; text-align: center; line-height: 1.2; }
.path .node:nth-of-type(4n+1) { transform: translateX(-54px); } .path .node:nth-of-type(4n+3) { transform: translateX(54px); }
.path-gap { height: 22px; }
.xpbar { height: 16px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; }
.lesson { max-width: 620px; margin: 0 auto; }
.lesson-card { min-height: 240px; }
.choice { display: block; width: 100%; text-align: start; padding: 14px 16px; margin: 8px 0; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 3px 0 var(--line); color: var(--text); }
.choice:hover { background: var(--surface-2); }
.choice.is-right { border-color: var(--ok); background: var(--ok-soft); box-shadow: 0 3px 0 var(--ok); }
.choice.is-wrong { border-color: var(--danger); background: var(--danger-soft); box-shadow: 0 3px 0 var(--danger); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.badge-item { text-align: center; font-size: .74rem; font-weight: 800; color: var(--muted); }
.badge-item .medal { width: 64px; height: 64px; margin: 0 auto 4px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; background: var(--sun-soft); border: 3px solid var(--sun); }
.badge-item.locked .medal { filter: grayscale(1); opacity: .45; border-color: var(--line-2); background: var(--surface-2); }
.prose { font-size: 1.04rem; line-height: 1.7; overflow-wrap: break-word; }
/* Las tablas de los artículos: si no caben, se desliza solo la tabla (antes corría toda la página en el teléfono). */
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1em 0; font-size: .9rem; line-height: 1.45; }
.prose th, .prose td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; min-width: 110px; }
.prose th { color: var(--muted); font-size: .8rem; border-bottom-width: 2px; }
.prose h2 { margin-top: 1.4em; } .prose ul, .prose ol { padding-inline-start: 1.3em; } .prose li { margin: .3em 0; }
.prose blockquote { margin: 1em 0; padding: 10px 14px; border-inline-start: 4px solid var(--brand); background: var(--surface-2); border-radius: 10px; }
.prose .lead { font-size: 1.12rem; color: var(--muted); }
.post-card { display: block; color: inherit; }
.post-card:hover { text-decoration: none; border-color: var(--line-2); }

/* Emergencia */
.sos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sos-big { min-height: 120px; flex-direction: column; font-size: 1rem; border-radius: 22px; }
.sos-big span { font-size: 2.4rem; line-height: 1; }
.numbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.number { display: block; padding: 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); color: var(--text); box-shadow: 0 3px 0 var(--line); }
.number b { display: block; font-size: 1.5rem; font-weight: 900; color: var(--danger); }
.number:hover { text-decoration: none; background: var(--surface-2); }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.steps3 div { background: var(--surface-2); border-radius: 16px; padding: 12px 8px; font-weight: 900; }
.steps3 div span { display: block; font-size: 2rem; }
.steps3 div small { display: block; font-weight: 600; color: var(--muted); margin-top: 4px; }
.strobe { position: fixed; inset: 0; z-index: 99; background: #fff; display: grid; place-items: center; color: #000; font-weight: 900; }
.strobe.off { background: #000; color: #333; }
/* Modo atrapado: negro fijo (en pantallas OLED el negro casi no gasta batería) y botones grandes. */
.trapped { position: fixed; inset: 0; z-index: 95; overflow-y: auto; background: #000; color: #E6ECF8; }
.trapped-in { max-width: 560px; margin: 0 auto; padding: calc(16px + var(--sat)) 16px calc(24px + var(--sab)); display: grid; gap: 12px; }
.trapped .icon-btn { color: #E6ECF8; background: #111; border-color: #333; }
.trapped ol { margin: 0; padding-left: 20px; color: #C9D1E3; }
.trapped ol li { margin-bottom: 6px; }
.tr-btn { display: grid; gap: 4px; width: 100%; min-height: 64px; padding: 14px 16px; border: 2px solid #3A2226; border-radius: 16px; background: #140A0C; color: #fff; font: inherit; font-size: 1.05rem; text-align: start; cursor: pointer; }
.tr-btn small { color: #B9A4A8; font-size: .8rem; font-weight: 600; }
.tr-btn[aria-pressed="true"] { background: #7A1020; border-color: #FF4D5E; }
.tr-msg { margin: 0 0 8px; padding: 10px; border-radius: 10px; background: #111; overflow-wrap: anywhere; }

/* Diagnóstico */
.check-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 2px solid var(--line); }
.check-item:last-child { border-bottom: 0; }
.check-item .st { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; flex: none; }
.check-item .st.ok { background: var(--ok-soft); color: var(--ok); } .check-item .st.bad { background: var(--danger-soft); color: var(--danger-ink); } .check-item .st.warn { background: var(--sun-soft); color: var(--sun-ink); }
.check-item .txt { flex: 1; min-width: 0; } .check-item .txt small { display: block; color: var(--muted); }

.cookie { position: fixed; z-index: 80; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 12px + var(--sab)); max-width: 560px; margin: 0 auto; background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
@media (min-width: 1024px) { .cookie { bottom: 20px; } }
/* Bloque de AdSense: rotulado, al final de la página; si Google no tiene anuncio, desaparece. */
.ad-slot { margin: 18px 0; text-align: center; }
.ad-slot small { display: block; margin-bottom: 4px; color: var(--faint); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
.footer { margin: 26px 0 8px; padding-top: 16px; border-top: 2px solid var(--line); color: var(--faint); font-size: .82rem; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.footer a { color: var(--muted); font-weight: 700; }
.prerendered { display: block; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes blink { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px) rotate(-2deg); } 75% { transform: translateX(3px) rotate(2deg); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes wave { to { transform: translateX(-50%); } }
@keyframes flash { 50% { filter: brightness(1.35); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
[dir="rtl"] .path .node:nth-of-type(4n+1) { transform: translateX(54px); } [dir="rtl"] .path .node:nth-of-type(4n+3) { transform: translateX(-54px); }

/* Perfil público, amigos y clasificación */
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile-av { width: 84px; height: 84px; border-radius: 26px; background: var(--brand-soft); display: grid; place-items: center; font-size: 3rem; flex: none; }
.profile-bio { font-size: 1.05rem; margin: 0 0 14px; }
.link-kpi { border: 0; font: inherit; color: inherit; text-align: start; cursor: pointer; text-decoration: none; }
.link-kpi:hover { outline: 2px solid var(--brand); }
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.board li { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.board li.is-me { background: var(--brand-soft); }
.board li a { flex: 1; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; }
.board .rank { width: 28px; text-align: center; font-weight: 900; }
.board .av { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 1.15rem; }
.board b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.points-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.points-list div { display: flex; gap: 10px; align-items: baseline; }
.points-list b { color: var(--brand-d); min-width: 42px; }

/* Curso: libro, meta diaria, examen, diploma */
.book-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.book-card img { width: 120px; height: auto; border-radius: 8px; box-shadow: 0 10px 24px rgba(0,0,0,.28); }
.book-card > div { flex: 1; min-width: 220px; }
.goal-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.goal-dots { display: flex; gap: 6px; }
.goal-dots i { width: 16px; height: 16px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--line-2); }
.goal-dots i.on { background: var(--sun); border-color: var(--sun-d); }
.choice.is-picked { border-color: var(--sky); background: var(--sky-soft); }
.diploma-card { padding: 10px; }
.diploma-card canvas { width: 100%; height: auto; display: block; border-radius: 10px; }
@media print {
  body * { visibility: hidden; }
  #diploma-canvas, #diploma-canvas * { visibility: visible; }
  #diploma-canvas { position: fixed; inset: 0; width: 100%; }
  @page { size: landscape; margin: 0; }
}

/* ── Visitantes: qué se gana con una cuenta ── */
.gate .hero { margin-bottom: 12px; }
.gate-perks { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.gate-perks li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: .9rem; }

/* ── Apoyar (mismos métodos que Arkemu) ── */
.support-hero h1 { margin: 2px 0 6px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; color: var(--brand-ink); }
.support-methods { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: stretch; margin-bottom: 14px; }
.support-methods .way { margin: 0; display: grid; gap: 10px; align-content: start; }
.support-methods .way h2 { margin: 0; }
.way-paypal { text-align: center; border-color: var(--sun); align-content: center !important; }
.bn-pay { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.bn-id { flex: 1 1 170px; display: grid; gap: 6px; min-width: 0; }
.bn-id .copy-row code { white-space: nowrap; } /* el Pay ID es corto: en una línea */
.wallets summary { cursor: pointer; font-weight: 800; padding: 8px 2px; color: var(--brand-ink); }
.wallets[open] summary { margin-bottom: 6px; }
.wallets .copy-row + .copy-row { margin-top: 8px; }
.way-free { border-color: var(--ok); }
.amounts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.amount { min-width: 58px; padding: 8px 12px; border-radius: var(--radius-xs); border: 2px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 800; cursor: pointer; transition: transform .12s, border-color .12s; }
.amount:hover { transform: translateY(-1px); border-color: var(--sun); }
.amount.is-on { border-color: var(--sun-d); background: var(--sun-soft); }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 8px 10px; border-radius: var(--radius-xs); background: var(--surface-2); border: 1px solid var(--line); }
.copy-label { grid-column: 1 / -1; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.copy-row code { min-width: 0; overflow-wrap: anywhere; font-size: .82rem; line-height: 1.35; color: var(--brand-ink); }
.bn-pay .qr { width: 132px; height: 132px; flex: none; object-fit: contain; border-radius: var(--radius-s); background: #fff; padding: 6px; }
.support-thanks { text-align: center; color: var(--muted); margin: 18px 0 8px; }

/* ── Pantalla de carga (antes de que arranque la app; main.js la quita) ── */
/* Solo transform/opacity en elementos HTML (regla 10). Si la app no arrancara, se retira sola a los 12 s. */
.splash { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--bg); transition: opacity .35s ease; animation: splash-failsafe 0s 12s forwards; }
.splash.out { opacity: 0; pointer-events: none; }
@keyframes splash-failsafe { to { opacity: 0; visibility: hidden; } }
.splash-in { display: grid; justify-items: center; gap: 12px; }
.splash-mascot { width: 120px; height: 130px; animation: splash-hop 1.1s ease-in-out infinite; will-change: transform; }
@keyframes splash-hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.splash-bubble { position: relative; margin-bottom: 4px; padding: 8px 18px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow); color: var(--text); font-weight: 800; }
.splash-bubble::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 14px; height: 14px; background: var(--surface); border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.splash-bar { width: 180px; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.splash-bar i { display: block; width: 45%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--sky)); animation: splash-bar 1.2s ease-in-out infinite; will-change: transform; }
@keyframes splash-bar { from { transform: translateX(-110%); } to { transform: translateX(240%); } }
@media (prefers-reduced-motion: reduce) { .splash-mascot, .splash-bar i { animation: none; } }
/* Navegador o WebView viejos (js/old.js): el aviso se queda (sin el retiro de los 12 s) y con propiedades que entienden. */
.splash.is-old { top: 0; left: 0; right: 0; bottom: 0; animation: none; text-align: center; padding: 24px; }
.splash.is-old .splash-bar { display: none; }
.splash.is-old .splash-bubble { max-width: 420px; line-height: 1.4; }
.splash-old-btn { display: inline-block; margin-top: 8px; padding: 12px 22px; border-radius: 14px; background: #12B3A3; color: #fff; font-weight: 800; text-decoration: none; }

/* Avatar con foto o con la mascota: suelto mide lo que un emoji; dentro de su caja la llena. */
.av-img { width: 1.15em; height: 1.15em; border-radius: 30%; object-fit: cover; vertical-align: -0.2em; }
.av .av-img, .profile-av .av-img, .avatar-pick .av-img { width: 100%; height: 100%; border-radius: inherit; vertical-align: top; }
.av, .profile-av, .avatar-pick button { overflow: hidden; }
.avatar-pick button { padding: 0; }

/* Laboratorio: lo que explica la IA (resumen de la semana y "Explícamelo"). */
.lab-ai { display: flex; gap: 12px; align-items: flex-start; background: var(--brand-soft); border-radius: 16px; padding: 12px 14px; margin: 10px 0; }
.lab-ai img { flex: none; }
.lab-ai p { margin: 0 0 4px; }

/* Histórico en CSV (mapa): un botón por periodo; el número de sismos y la magnitud mínima, en pequeño. */
.hist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.hist-grid .btn { justify-content: flex-start; text-align: start; white-space: normal; }
.hist-grid .btn small { font-weight: 600; text-transform: none; letter-spacing: 0; }

/* ── App móvil (Capacitor) y Tremo Plus ────────────────────────────────────
   El banner de AdMob va justo encima de la barra de pestañas; core/native.js pone su alto en --app-ad y el contenido
   deja ese espacio. Con una hoja o una alerta abiertas el banner se oculta. */
.is-app main#app { padding-bottom: calc(var(--tabbar-h) + 28px + var(--sab) + var(--app-ad, 0px)); }
.is-app .toasts { bottom: calc(var(--tabbar-h) + 18px + var(--sab) + var(--app-ad, 0px)); }
.is-app .cookie { bottom: calc(var(--tabbar-h) + 12px + var(--sab) + var(--app-ad, 0px)); }
.way-plus, .support-methods .way.is-mine { border-color: var(--sun); }
.plus-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.plus-list li { display: flex; gap: 10px; align-items: baseline; }
.plus-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--sun-soft); color: var(--text); font-size: .8rem; font-weight: 800; text-decoration: none; vertical-align: middle; }
.avatar-pick button.is-locked { opacity: .45; position: relative; }
.avatar-pick button.is-locked::after { content: "⭐"; position: absolute; right: 2px; bottom: 0; font-size: .7rem; }
/* Ordenar columnas: zona táctil de 32 px sin mover la tabla (auditoría de la ronda 9, mínimo WCAG 24 px). */
th .link-btn { min-height: 32px; padding: 6px 2px; margin: -6px -2px; }

/* ── Guía de uso (views/guide.js) ─────────────────────────────────────────── */
.guide-head h1 { display: flex; gap: 10px; align-items: center; margin: 0 0 6px; }
.guide-head .lead { font-size: 1.08rem; color: var(--muted); margin: 0 0 6px; }
.guide-head #g-q { margin: 10px 0 4px; }
.g-toc-title { font-size: 1rem; margin: 14px 0 8px; }
.g-toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.g-toc button { display: flex; gap: 8px; align-items: center; text-align: start; min-height: 42px; padding: 6px 12px; border-radius: var(--radius-s);
  border: 2px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.g-toc button[hidden] { display: none; }
.guide-sec { scroll-margin-top: calc(var(--head-h) + 12px); }
.guide-sec h2 { display: flex; gap: 10px; align-items: center; margin-top: 0; }
.g-steps { counter-reset: g; list-style: none; padding-inline-start: 0 !important; }
.g-steps li { counter-increment: g; position: relative; padding-inline-start: 40px; margin: .7em 0; }
.g-steps li::before { content: counter(g); position: absolute; inset-inline-start: 0; top: 1px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; font-size: .9rem; line-height: 1; }
.g-note { padding: 10px 14px; border-radius: var(--radius-s); background: var(--brand-soft); border-inline-start: 4px solid var(--brand); }
.g-note.is-warn { background: var(--sun-soft); border-color: var(--sun); }
.g-faq { border-bottom: 1px solid var(--line); padding: 10px 0; }
.g-faq summary { font-weight: 800; cursor: pointer; }
.g-faq p { margin: 8px 0 0; }
.g-shot, .g-dia { margin: 1.2em 0; text-align: center; }
.g-shot img { width: min(280px, 78%); height: auto; border-radius: 26px; border: 4px solid var(--line-2); background: var(--surface-2);
  box-shadow: var(--shadow); }
.g-shot figcaption, .g-dia figcaption { font-size: .88rem; color: var(--muted); margin-top: 8px; }
.g-dia svg { width: 100%; max-width: 460px; height: auto; display: block; margin: 0 auto; }
.g-dia text { font: 800 11px var(--font); fill: var(--text); }
.g-dia text.sub { font-weight: 700; font-size: 9.5px; fill: var(--muted); }
.g-dia .ln { stroke: var(--line-2); stroke-width: 2; fill: none; }
.g-dia .tip { fill: var(--line-2); }
.g-dia .b-main { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.5; }
.g-dia .b-brand { fill: var(--brand-soft); stroke: var(--brand); stroke-width: 1.5; }
.g-dia .b-danger, .g-dia .p-danger { fill: var(--danger-soft); stroke: var(--danger); stroke-width: 1.5; }
.g-dia .b-sky, .g-dia .p-sky { fill: var(--sky-soft); stroke: var(--sky); stroke-width: 1.5; }
.g-dia .p-sun { fill: var(--sun-soft); stroke: var(--sun); stroke-width: 1.5; }
.g-dia .b-no { fill: none; stroke: var(--danger); stroke-width: 1.5; stroke-dasharray: 4 3; }
.g-dia .no-txt { fill: var(--danger-ink); font-size: 9.5px; }
.g-dia .wave-p { fill: none; stroke: var(--sky); stroke-width: 2; stroke-dasharray: 5 4; opacity: .8; }
.g-dia .wave-s { fill: none; stroke: var(--danger); stroke-width: 3; opacity: .85; }
.g-dia .epi { fill: var(--danger); stroke: var(--surface); stroke-width: 2; }
.g-dia .you { fill: var(--brand); } .g-dia .bg { fill: var(--surface); }
.g-dia .p-txt { fill: var(--sky-ink); } .g-dia .s-txt { fill: var(--danger-ink); }
.g-dia .dot { fill: var(--text); }
.g-dia .warn { fill: var(--sun-soft); stroke: var(--sun); stroke-width: 1.5; } .g-dia .warn-txt { fill: var(--sun-ink); font-size: 10px; }
.g-dia .num { fill: var(--brand); } .g-dia .num-txt { fill: #fff; }
.g-top { text-align: end; margin: 1em 0 0; }

/* Panel: semáforo de fuentes y servicios (admin.js watchRow) */
.watch { display: grid; gap: 8px; margin: 8px 0 12px; }
.watch-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius-s); border: 2px solid var(--line); }
.watch-row .grow { display: grid; gap: 2px; min-width: 0; }
.watch-row small { color: var(--muted); overflow-wrap: anywhere; }
.watch-row.is-yellow { border-color: var(--sun); background: var(--sun-soft); }
.watch-row.is-red { border-color: var(--danger); background: var(--danger-soft); }
.watch-row .watch-hint { color: var(--text); }
/* Admin → IA: una tarjeta por proveedor con su semáforo y sus barras de 14 días. */
.ai-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.ai-card { margin: 0; }
.ai-card.is-yellow { border-color: var(--sun); }
.ai-card.is-red { border-color: var(--danger); }
.ai-card.is-gray { opacity: .75; }
.ai-spark { height: 44px; margin-top: 8px; }
.ai-spark .bad { fill: var(--danger); }
.watch-dot { font-size: 1.1rem; }

/* Chat: emojis, fotos y notas de voz temporales (views/community.js mediaTools) */
.composer-tools { display: flex; gap: 2px; align-self: center; }
.tool-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; font-size: 1.15rem; cursor: pointer; }
.tool-btn:hover { background: var(--surface-2); }
.tool-btn:disabled { opacity: .4; cursor: wait; }
.emoji-panel { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; padding: 8px 0; border-top: 2px solid var(--line); }
.emoji-panel[hidden] { display: none; }
.emoji-panel button { height: 38px; border: 0; border-radius: 10px; background: transparent; font-size: 1.3rem; cursor: pointer; }
.emoji-panel button:hover { background: var(--surface-2); }
.rec-bar { display: flex; gap: 8px; align-items: center; border-top: 2px solid var(--line); padding-top: 10px; font-weight: 800; }
.rec-bar[hidden] { display: none; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; will-change: opacity; }
.msg .media { position: relative; display: inline-block; margin: 2px 0 4px; max-width: 100%; }
.msg .media-img { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; }
.msg .media-img img { display: block; max-width: min(240px, 100%); max-height: 260px; min-width: 120px; min-height: 80px; border-radius: 12px; object-fit: cover; }
.msg .media audio { display: block; width: min(260px, 70vw); height: 40px; }
.msg .media .ttl { position: absolute; top: 6px; inset-inline-end: 6px; padding: 1px 7px; border-radius: 99px; background: rgba(12, 18, 32, .78); color: #fff; font-size: .7rem; font-weight: 800; }
.msg .media audio + .ttl { position: static; display: inline-block; margin-top: 4px; background: var(--surface); color: var(--muted); }
.msg .media.gone { color: var(--faint); font-size: .85rem; font-style: italic; }
.media-full { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: 12px; }

/* Aviso de un sismo que no llega a tu alarma (lo sentirías) o que no se sentiría: tarjeta arriba, sin tapar la pantalla. */
.quake-notice {
  position: fixed; z-index: 85; top: calc(var(--head-h, 64px) + 8px); left: 12px; right: 12px; max-width: 520px; margin: 0 auto;
  background: var(--surface); border: 2px solid var(--line); border-inline-start: 6px solid var(--sky-d, #2D7FF9);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; will-change: transform, opacity;
  animation: notice-in .28s ease-out both;
}
.quake-notice.is-felt { border-inline-start-color: var(--sun-d); }
.quake-notice .kicker { font-size: .74rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.quake-notice .head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin: 2px 0 6px; }
.quake-notice .head b { font-size: 1.35rem; }
.quake-notice .facts { display: flex; flex-wrap: wrap; gap: 6px; font-size: .82rem; }
.quake-notice .facts span { background: var(--surface-2); border-radius: 99px; padding: 2px 9px; }
.quake-notice p { margin: 8px 0 0; font-size: .86rem; color: var(--muted); }
.quake-notice .actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.quake-notice .actions .icon-btn { margin-inline-start: auto; }
@keyframes notice-in { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
/* Panel → Analítica: barra de proporción (escala con transform, sin animar el ancho). */
.meter { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--sky); transform-origin: 0 50%; }
/* Asistente de la protección (red.wizard): «Paso n de N» y su barra; la barra avanza con transform. */
.wiz-top { display: grid; gap: 6px; margin-bottom: 12px; }
.wiz-top .meter i { transition: transform .3s ease; will-change: transform; }
#wiz .banner { margin: 12px 0; }
/* Panel: aire entre los bloques de Analítica y de Plus (los indicadores quedaban pegados a la siguiente fila). */
.adm-gap { gap: 14px; margin-bottom: 14px; }
.adm-gap > .card { margin-bottom: 0; }
/* Laboratorio → ¿Acierto o azar?: la cifra grande al lado de la frase. */
.luck-out { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.luck-p { font-size: 2.4rem; line-height: 1; color: var(--brand); font-variant-numeric: tabular-nums; }
.luck-out span { flex: 1; min-width: 180px; }
.luck-why { margin-top: 12px; }
/* Buscador de zona: una lista que se abre bajo el campo, encima de lo demás. */
/* Listas largas: los 12 primeros y «Ver todo (N)» debajo (parts.seeAll; pedido del 03-11-2026) */
.clip > :nth-child(n+13) { display: none; }
.see-all { margin-top: 10px; }
.luck-field { position: relative; }
.luck-list { position: absolute; inset-inline: 0; top: 100%; z-index: 30; margin-top: 4px; padding: 6px; max-height: 320px; overflow-y: auto;
  background: var(--surface); border: 2px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.luck-list .person.is-on { background: var(--surface-2); }
.luck-group { margin: 6px 8px 2px; }
.luck-why p { margin: 8px 0 0; }
