/* CARMIN — app. Clara u oscura según el sistema; el color lo ponen el cielo y la nota.
   Toda la paleta vive en estos tokens: el tema oscuro sólo los redefine (abajo). */
:root {
  color-scheme: light dark;
  --bg: #f6f3ee;
  --surface: #ffffff;
  --card: #ffffff;
  --card-line: rgba(31, 24, 44, .08);
  --fill: rgba(31, 24, 44, .05);
  --fill-2: rgba(31, 24, 44, .09);
  --text: #1f1a2b;
  --muted: #6f6880;
  --coral: #ff6b6b;
  --coral-ink: #c0353f;            /* ≥ 4,5:1 sobre las pastillas claras */
  --gold: #ffb454;
  --gold-ink: #9e5c00;
  /* El coral de CARMIN (el del icono, la landing y static/css/design-system.css): el color de
     las acciones, plano. Pulsado, su versión oscura. Para texto sobre claro, --coral-ink. */
  --carmin: #ff6b6b;
  --carmin-press: #e05555;
  --carmin-tint: rgba(255, 107, 107, .12);
  --sunrise: #ffd54f;
  --good: #ff8a4c;
  --bad: #9a93ad;
  --pos: #e8930c;
  --neg: #9a93ad;
  --screen: #1b1630;               /* fondo de las «pantallas» oscuras: el cielo y el diagrama */
  --radius: 20px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* iPad con la app instalada (iPadOS 26+): la página llega hasta arriba, bajo la barra de
     estado, pero env() da 0 arriba. app.html lo detecta y marca <html class="sb-under">. */
  --safe-top: max(env(safe-area-inset-top, 0px), var(--sb-top, 0px));
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --gutter-l: max(16px, var(--safe-left));
  --gutter-r: max(16px, var(--safe-right));
  --ease: cubic-bezier(.22, .61, .36, 1);
  --sheet-ease: cubic-bezier(.32, .72, 0, 1);   /* la curva de las hojas de iOS */
  --shadow: 0 2px 10px rgba(31, 24, 44, .14), 0 0 0 1px rgba(31, 24, 44, .05);
  --score-color: var(--coral);
  /* Sobre blanco, los colores de la nota se oscurecen un poco hacia --ink para leerse bien. */
  --ink: #2a1420;
  --score-ink: color-mix(in srgb, var(--score-color) 74%, var(--ink));
  --text-2: #3f3850;               /* texto de lectura, un paso por debajo de --text */
  --neg-ink: #7d7591;
  --raised: #ffffff;               /* lo elegido en un control segmentado */
  --hover: #f3f0f7;
  --line-strong: rgba(31, 24, 44, .18);
  --glass: rgba(255, 255, 255, .92);
  --ring: #ffffff;                 /* aro de las marcas sobre el mapa */
  --map-bg: #fbf8f3;               /* el fondo del estilo del mapa, mientras cargan las teselas */
  --blue: #2f7bf6;
  --ok: #2f8a4f;
  --terrain-ink: #b4561f;
  --pressed-bg: #2a1f3a;
  --pressed-fg: #ffffff;
  --pressed-ico: #ffb454;
  --backdrop: rgba(31, 24, 44, .38);
  --shadow-up: 0 -6px 28px rgba(31, 24, 44, .16);
}

/* ── Tema oscuro: el del sistema ──────────────────────── */
/* Superficies en capas (fondo < tarjeta < flotantes < elegido), sin negro puro, con el
   mismo tinte violeta del velo y del cielo; los colores de marca se aclaran un paso. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0b12;
    --surface: #1a1722;
    --card: #16131e;
    --raised: #34303f;
    --card-line: rgba(255, 255, 255, .08);
    --fill: rgba(255, 255, 255, .065);
    --fill-2: rgba(255, 255, 255, .11);
    --text: #f4f1f8;
    --text-2: #d3ccdd;
    --muted: #9e97ae;
    --coral-ink: #ff8f8f;
    --gold-ink: #ffc46e;
    --carmin: #ff6b6b;
    --carmin-press: #e05555;
    --carmin-tint: rgba(255, 107, 107, .16);
    --pos: #f5a524;
    --neg: #6f6882;
    --neg-ink: #a7a0b8;
    --bad: #7c7590;
    --shadow: 0 2px 12px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .07);
    /* Sobre oscuro, al revés: se aclaran hacia el blanco. */
    --ink: #ffffff;
    --score-ink: color-mix(in srgb, var(--score-color) 86%, #ffffff);
    --hover: #24202e;
    --line-strong: rgba(255, 255, 255, .2);
    --glass: rgba(26, 23, 34, .9);
    --ring: #15121c;
    --map-bg: #0e0e0e;
    --blue: #5b9cff;
    --ok: #5fd394;
    --terrain-ink: #ff9d61;
    --pressed-bg: #f4f1f8;
    --pressed-fg: #1a1722;
    --pressed-ico: #c47a0a;
    --backdrop: rgba(0, 0, 0, .6);
    --shadow-up: 0 -1px 0 rgba(255, 255, 255, .07), 0 -8px 30px rgba(0, 0, 0, .55);
  }
}

/* El color de la nota se funde de un valor a otro (no salta). */
@property --score-color { syntax: '<color>'; inherits: true; initial-value: #ff6b6b; }
:root { transition: --score-color .9s ease; }
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: rgba(31, 24, 44, .2) transparent; }
html:has(dialog[open]) { overflow: hidden; }
/* Fondo blanco, el de la cabecera y la hoja: si el sistema deja ver la página en algún
   borde (barra de inicio, ventana recortada), no aparece una franja gris. */
html, body { height: 100%; background: var(--surface); }
/* App instalada en iOS 26+ con la barra de estado translúcida de antes: el sistema la abre
   con la ventana recortada por abajo (WebKit 301108) mientras la página no llene la pantalla.
   Así la llena; con la barra opaca (instalaciones nuevas, Android) esto no cambia nada. */
@media (display-mode: standalone) {
  html { min-height: min(100lvh, calc(100% + env(safe-area-inset-top, 0px))); }
}
body {
  margin: 0; overflow: hidden; color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent;
}
a { color: var(--coral-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
:focus { outline: none; }
:focus-visible { outline: 2px solid rgba(255, 138, 76, .9); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
h2 { font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ── Mapa a pantalla completa ─────────────────────────── */
/* iOS 26+ ya no usa theme-color: la barra de estado toma el color del elemento «fixed»
   que hay en el borde superior. Ese elemento es .app (la cabecera va dentro), así que su
   fondo blanco da una barra blanca y sólida, sin el desenfoque de iOS 27. */
.app {
  position: fixed; inset: 0; overflow: hidden; background: var(--surface);
  --top-h: calc(64px + var(--safe-top));
  --panel-w: 420px;
}
.map { position: absolute; inset: 0; background: var(--map-bg); }
.map:focus-visible { outline: none; }

/* Punto elegido (siempre por encima de las barras: es un elemento DOM) */
.pin-wrap { width: 30px; height: 30px; display: grid; place-items: center; cursor: grab; }
.pin {
  width: 24px; height: 24px; border-radius: 50%; background: var(--sunrise); border: 4px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .1), 0 4px 14px rgba(0, 0, 0, .3);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.pin-wrap.dragging { cursor: grabbing; }
@media (hover: hover) and (pointer: fine) { .pin-wrap:hover .pin { transform: scale(1.1); } }
.pin-wrap.dragging .pin { transform: scale(1.28); box-shadow: 0 0 0 1px rgba(0, 0, 0, .1), 0 10px 24px rgba(0, 0, 0, .3); }
.pin-wrap.drop .pin { animation: pin-drop .5s var(--ease); }
@keyframes pin-drop { 0% { transform: translateY(-14px) scale(.7); opacity: .4; } 60% { transform: translateY(2px) scale(1.06); opacity: 1; } 100% { transform: none; } }
/* Etiqueta en la punta de cada barra: hora y sentido */
.sun-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 999px; border: 2px solid var(--ring);
  font: 700 12px/1 var(--font); font-variant-numeric: tabular-nums; color: #2a0f12; background: var(--coral); white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .2); pointer-events: none; transition: opacity .3s var(--ease);
}
.sun-tag.rise { background: var(--sunrise); color: #3a2a00; }
.sun-tag.off { opacity: 0; }
/* La cresta tras la que se esconde el sol */
.ridge-mk {
  display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--pressed-bg) 88%, transparent); color: var(--pressed-fg);
  font: 700 11px/1 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; border: 1.5px solid var(--ring);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25); pointer-events: none; transition: opacity .3s var(--ease);
}
.ridge-mk.off { opacity: 0; }
.mt { width: 1.05em; height: 1.05em; vertical-align: -.14em; flex: none; }

/* Spots en el mapa: los míos con estrella dorada (cuadrado redondeado), los oficiales en coral (círculo) */
.spot-mk { display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; background: none; border: 0; padding: 0; margin: 0; font: inherit; }
.spot-mk i {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal;
  background: var(--surface); color: var(--gold-ink); border: 2px solid var(--gold); box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
  font-size: 13px; line-height: 1; transition: transform .2s var(--ease);
}
.spot-mk:not(.official) i { border-radius: 9px; }
.spot-mk.official i { background: var(--coral); color: #fff; border-color: var(--ring); }
.spot-mk span {
  max-width: 130px; padding: 2px 7px; border-radius: 8px; background: var(--glass); color: var(--text);
  font: 600 11px/1.25 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
  opacity: 0; transform: translateY(-2px); transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.map.labels .spot-mk span { opacity: 1; transform: none; }
@media (hover: hover) { .spot-mk:hover i { transform: scale(1.12); } .spot-mk:hover span { opacity: 1; transform: none; } }

/* Controles del mapa */
.map .maplibregl-ctrl-top-right { top: calc(var(--top-h) + 10px + var(--bar-h, 46px) + 2px); }
.map .maplibregl-ctrl-group { border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.map .maplibregl-ctrl-group button { width: 36px; height: 36px; }
.map .maplibregl-ctrl-attrib.maplibregl-compact { margin: 6px 8px 0 0; background: rgba(255, 255, 255, .9); color: #333; border-radius: 12px; }
.map .maplibregl-ctrl-attrib a { color: #333; }

/* ── Cabecera opaca y botones flotantes ───────────────── */
/* Blanca y sólida de borde a borde, también bajo la barra de estado: el mapa nunca pasa
   bajo la hora, así que no hay nada que el sistema pueda desenfocar, e iOS y Android
   pintan la barra de estado del mismo blanco. */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 8;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + var(--safe-top)) max(12px, var(--safe-right)) 10px max(12px, var(--safe-left));
  background: var(--surface);
  box-shadow: 0 1px 0 var(--card-line), 0 4px 16px rgba(31, 24, 44, .07);
}
.brand, .place, .icon-btn, .fab, .mbtn { background: var(--surface); box-shadow: var(--shadow); border: 0; }
.topbar .brand, .topbar .icon-btn { background: transparent; box-shadow: none; }
.topbar .place { background: var(--fill); box-shadow: none; }
.brand { flex: none; color: var(--coral); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; }
.place {
  flex: 1; min-width: 0; height: 44px; display: flex; align-items: center; gap: 8px; justify-content: flex-start;
  border-radius: 14px; padding: 0 14px; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--text);
  transition: background-color .2s var(--ease), transform .15s var(--ease);
}
.place-ico { flex: none; color: var(--muted); }
.place-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: 14px; cursor: pointer; display: grid; place-items: center; color: var(--text);
  transition: background-color .2s var(--ease), transform .15s var(--ease);
}
.icon-btn:active, .place:active, .brand:active, .mbtn:active { transform: scale(.95); }
.fab:active svg { transform: scale(.9); }

/* Fila de botones del mapa: Mis spots (con su ojo), guardar y Oficiales.
   Si no caben en una línea (móvil estrecho) pasan a dos, sin esconder ninguno. */
.mapbar {
  position: absolute; z-index: 6; top: calc(var(--top-h) + 10px); left: max(12px, var(--safe-left)); right: max(12px, var(--safe-right));
  display: flex; flex-wrap: wrap; gap: 8px; pointer-events: none;
}
.mapbar > * { pointer-events: auto; flex: none; }
.mbtn {
  height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 650; color: var(--text); white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), transform .15s var(--ease);
}
.mbtn:disabled { cursor: default; opacity: .5; }
.mbtn .n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--fill-2); font-size: 12px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.mbtn .ico { color: var(--gold-ink); }
/* El ojo dice si se ven en el mapa: abierto, sí; tachado, no. */
.mbtn svg { flex: none; }
.mbtn .i-eye-off, .mbtn[aria-pressed="false"] .i-eye { display: none; }
.mbtn[aria-pressed="false"] .i-eye-off { display: block; }
/* Mis spots: una pastilla dorada. La parte de la estrella abre la lista; el ojo los muestra u oculta. */
.spots-group { display: inline-flex; border-radius: 999px; box-shadow: var(--shadow); background: var(--surface); outline: 1.5px solid rgba(255, 180, 84, .55); outline-offset: -1.5px; }
.spots-group .mbtn { box-shadow: none; background: transparent; }
.spots-group .mbtn:first-child { border-radius: 999px 0 0 999px; padding-right: 10px; }
.mbtn.mine.hidden-on-map .ico, .mbtn.mine.hidden-on-map .n { opacity: .45; }
.mbtn.eye { border-left: 1px solid rgba(255, 180, 84, .45); border-radius: 0 999px 999px 0; padding: 0 12px 0 10px; color: var(--gold-ink); }
.mbtn.eye[aria-pressed="false"] { color: var(--muted); }
/* Guardar el sitio que ves: sólo el marcador (con +); relleno de oro cuando ya está guardado. */
.mbtn.save { width: 38px; padding: 0; justify-content: center; color: var(--gold-ink); outline: 1.5px solid rgba(255, 180, 84, .55); outline-offset: -1.5px; }
.mbtn.save .bm { fill: none; stroke: currentColor; transition: fill .2s var(--ease), stroke .2s var(--ease); }
.mbtn.save .check { display: none; stroke: #4a2c00; }
.mbtn.save[aria-pressed="true"] { background: color-mix(in srgb, var(--gold) 16%, var(--surface)); }
.mbtn.save[aria-pressed="true"] .bm { fill: var(--gold); stroke: var(--gold); }
.mbtn.save[aria-pressed="true"] .plus { display: none; }
.mbtn.save[aria-pressed="true"] .check { display: inline; }
.mbtn.save.pop svg { animation: pop .42s var(--ease); }
/* Oficiales: un interruptor. Encendido, en coral y con el ojo abierto; apagado, gris y tachado. */
.mbtn.official { gap: 6px; padding: 0 12px; color: var(--muted); }
.mbtn.official .ico { color: var(--muted); font-size: 15px; opacity: .6; }
.mbtn.official[aria-pressed="true"] {
  background: color-mix(in srgb, var(--coral) 12%, var(--surface)); color: var(--coral-ink);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--coral) 55%, transparent), var(--shadow);
}
.mbtn.official[aria-pressed="true"] .ico { color: var(--coral-ink); opacity: 1; }
/* Móviles de 360 px: un poco más juntos para que quepan en una sola línea. */
@media (max-width: 374px) {
  .mapbar { gap: 6px; }
  .mbtn { gap: 6px; }
  .spots-group .mbtn:first-child { padding: 0 8px 0 11px; }
  .mbtn.eye { padding: 0 10px 0 8px; }
  .mbtn.official { padding: 0 10px; }
}
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.32); } 100% { transform: scale(1); } }

/* Flotantes del mapa (mapa de calor y mi ubicación): acompañan a la hoja (app.js los mueve
   con transform) y desaparecen con la hoja completa. */
.fabs {
  position: absolute; z-index: 5; right: max(14px, var(--safe-right)); bottom: 14px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none;
  transition: transform .38s var(--sheet-ease), opacity .25s var(--ease);
}
.fabs > * { pointer-events: auto; }
.app[data-snap="full"] .fabs { opacity: 0; pointer-events: none; }
.app[data-snap="full"] .fabs > * { pointer-events: none; }
.fab {
  width: 48px; height: 48px; border-radius: 50%; color: var(--blue); cursor: pointer; display: grid; place-items: center;
}
.fab.locating svg { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* Mapa de calor: una pastilla con su icono de colores. Apagado, blanca; encendido, con el
   color de la marca y una ✕ para quitarlo; calculando, se llena por dentro (el mapa sigue libre). */
.heat-fab {
  position: relative; overflow: hidden; height: 46px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px 0 13px;
  border: 0; border-radius: 999px; cursor: pointer; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  font: 650 14.5px/1 var(--font); white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease), transform .15s var(--ease);
}
.heat-fab:active { transform: scale(.96); }
.heat-fab .hf-ico { flex: none; transition: transform .3s var(--ease); }
.heat-fab .hf-x { display: none; flex: none; margin: 0 -4px 0 -1px; opacity: .8; }
.heat-fab .hf-txt { position: relative; z-index: 1; }
.heat-fab .hf-bar {
  position: absolute; left: 0; bottom: 0; height: 100%; width: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 34%, transparent), color-mix(in srgb, var(--coral) 34%, transparent));
  transition: width .4s var(--ease), opacity .3s var(--ease);
}
.heat-fab > svg { position: relative; z-index: 1; }
.heat-fab[aria-pressed="true"] {
  background: color-mix(in srgb, var(--coral) 13%, var(--surface)); color: var(--coral-ink);
  box-shadow: 0 0 0 2px var(--coral), var(--shadow);
}
.heat-fab[aria-pressed="true"]:not(.loading) .hf-x { display: block; }
.heat-fab.loading .hf-ico { animation: heat-spin 1.4s var(--ease) infinite; }
.heat-fab:not(.loading) .hf-bar { opacity: 0; }
@keyframes heat-spin { 0% { transform: rotate(0); } 60%, 100% { transform: rotate(180deg); } }
@media (prefers-reduced-motion: reduce) { .heat-fab.loading .hf-ico { animation: none; } }

@media (hover: hover) {
  .icon-btn:hover, .place:hover, .brand:hover, .fab:hover, .mbtn:hover { background-color: var(--hover); }
  .mbtn.official[aria-pressed="true"]:hover { background-color: color-mix(in srgb, var(--coral) 18%, var(--surface)); }
  .mbtn.save[aria-pressed="true"]:hover { background-color: color-mix(in srgb, var(--gold) 24%, var(--surface)); }
  .mbtn:disabled:hover { background-color: var(--surface); }
  .official-line:hover { background: color-mix(in srgb, var(--coral) 16%, transparent); }
  .day:hover { background: color-mix(in srgb, var(--card) 50%, var(--hover)); }
  .btn.ghost:hover { background: var(--fill-2); }
  .btn:not(.ghost):hover { filter: brightness(1.04); }
  .play:hover { background: rgba(255, 255, 255, .24); }
  .stars button:hover:not(:disabled) { border-color: var(--line-strong); }
  .results li button:hover, .fav-list li button:hover { background: var(--fill); }
  .locate:hover { background: rgba(255, 107, 107, .16); }
  .expand:hover { background: var(--fill-2); }
}

/* ── Hoja de la previsión (móvil): asoma, media, completa ─ */
.panel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 7;
  height: calc(100% - var(--top-h) + 4px);
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-up);
  transform: translate3d(0, calc(100% - 170px), 0);
  transition: transform .38s var(--sheet-ease);
  will-change: transform; contain: layout paint;
}
.panel.dragging { transition: none; }
.grab { flex: none; height: 24px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.grab span { width: 38px; height: 5px; border-radius: 3px; background: var(--line-strong); }
.summary { flex: none; padding: 0 var(--gutter-r) 14px var(--gutter-l); touch-action: none; cursor: pointer; }
.score-line { display: flex; align-items: center; gap: 12px; }
.score { display: flex; align-items: baseline; flex: none; }
/* El degradado se recorta al texto: la caja tiene que abarcar toda la tinta de las cifras.
   Con el espaciado negativo la última cifra sobresale de su caja y se cortaba (y rozaba el /100),
   así que se le devuelve ese espacio con un relleno a la derecha (y un poco arriba y abajo). */
#score {
  font-size: 54px; line-height: .9; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums;
  padding: .05em .07em .03em .01em; margin-right: -.02em;
  background: linear-gradient(180deg, #2a2236 0%, var(--score-ink) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.score .of { margin-left: 2px; font-size: 17px; font-weight: 700; color: var(--muted); letter-spacing: 0; white-space: nowrap; }
.score-meta { flex: 1; min-width: 0; }
.band { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--score-ink); line-height: 1.1; }
.kind { font-size: 14.5px; font-weight: 500; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expand {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--fill); color: var(--text); transition: transform .35s var(--ease), background-color .2s var(--ease);
}
.app[data-snap="full"] .expand { transform: rotate(180deg); }
/* Horas clave: una sola fila; si no cabe, se desliza (de borde a borde, con un fundido que lo insinúa). */
.legend {
  display: flex; gap: 6px; margin: 10px calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l)); padding: 0 var(--gutter-r) 0 var(--gutter-l);
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter-l) var(--gutter-r);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter-l), #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter-l), #000 calc(100% - 28px), transparent);
  touch-action: pan-x;
}
.legend::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px; scroll-snap-align: start;
  background: var(--fill); font-size: 12.5px; color: var(--muted); white-space: nowrap;
}
.chip b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.chip.rise i { background: var(--sunrise); }
.chip.best b { color: var(--gold-ink); }
/* En un spot oficial, bajo la nota: lleva a su ficha (qué es y por qué es oficial). */
.official-line {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 38px; margin-top: 10px; padding: 0 12px 0 7px;
  border: 0; border-radius: 12px; cursor: pointer; font: inherit; text-align: left; -webkit-tap-highlight-color: transparent;
  background: color-mix(in srgb, var(--coral) 10%, transparent); color: var(--coral-ink); transition: background-color .2s var(--ease);
}
.official-line[hidden] { display: none; }
.official-line:active { background: color-mix(in srgb, var(--coral) 18%, transparent); }
.official-line .ol-ico { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--coral); color: #fff; font-size: 13px; line-height: 1; }
.official-line .ol-txt { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.official-line .ol-more { flex: none; font-size: 13px; font-weight: 650; }
.official-line .ol-more::after { content: '›'; margin-left: 4px; font-size: 16px; line-height: 1; }
.panel-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 12px; background: var(--bg);
  padding: 12px var(--gutter-r) calc(28px + var(--safe-bottom)) var(--gutter-l);
  border-top: 1px solid var(--card-line);
  /* Asomada, bajo la nota sólo queda la franja de la barra de inicio: ahí no debe asomar el
     fondo gris ni el borde de los días. app.js lo funde con la posición de la hoja. */
  transition: opacity .38s var(--sheet-ease);
}
.panel.dragging .panel-body { transition: none; }
.panel-body > * { flex: none; }
/* Asomada o a media altura, arrastrar el contenido mueve la hoja (los días siguen deslizando en horizontal). */
.app:not([data-snap="full"]) .panel-body { overflow-y: hidden; touch-action: pan-x; }

/* ── Escena: el atardecer dibujado por el modelo ──────── */
.scene { position: relative; height: 232px; border-radius: var(--radius); overflow: hidden; background: var(--screen); isolation: isolate; box-shadow: 0 2px 10px rgba(31, 24, 44, .12); }
#sky { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, rgba(10, 8, 18, .45) 0%, rgba(10, 8, 18, 0) 26%), linear-gradient(0deg, rgba(10, 8, 18, .8) 0%, rgba(10, 8, 18, 0) 42%);
}
.when { position: absolute; z-index: 2; top: 12px; left: 14px; right: 14px; font-size: 14px; color: #f1eaf6; font-variant-numeric: tabular-nums; }

/* Línea de tiempo (dentro de la escena oscura) */
.scrub { --sl: 12px; --sr: 58px; position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 76px; color: #f6f1ec; }
#curve { position: absolute; left: var(--sl); top: 4px; height: 46px; width: calc(100% - var(--sl) - var(--sr)); pointer-events: none; }
#time {
  position: absolute; left: var(--sl); top: 0; height: 52px; width: calc(100% - var(--sl) - var(--sr));
  margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: grab; touch-action: pan-y;
}
#time::-webkit-slider-runnable-track { height: 52px; background: transparent; }
#time::-moz-range-track { height: 52px; background: transparent; }
#time::-webkit-slider-thumb {
  -webkit-appearance: none; width: 4px; height: 52px; border-radius: 2px; background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .18), 0 0 18px rgba(255, 200, 150, .7);
}
#time::-moz-range-thumb { width: 4px; height: 52px; border: 0; border-radius: 2px; background: #fff; }
.scrub-labels { position: absolute; left: var(--sl); right: var(--sr); top: 54px; height: 18px; font-size: 11px; color: #b9b1c8; font-variant-numeric: tabular-nums; }
.scrub-labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.play {
  position: absolute; right: 10px; top: 6px; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; color: #fff;
  background: rgba(255, 255, 255, .16); display: grid; place-items: center; transition: background-color .2s var(--ease), transform .15s var(--ease);
}
.play:active { transform: scale(.92); }
.play .i-pause, .play.playing .i-play { display: none; }
.play.playing .i-pause { display: block; }

/* ── Días ─────────────────────────────────────────────── */
.days {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(70px, 1fr); gap: 8px;
  margin: 0 calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l)); padding: 2px var(--gutter-r) 4px var(--gutter-l);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter-l) var(--gutter-r); overscroll-behavior-x: contain;
}
.days::-webkit-scrollbar { display: none; }
.day {
  border: 1px solid var(--card-line); background: var(--card); border-radius: 16px; padding: 10px 6px 9px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 72px; scroll-snap-align: start;
  transition: transform .15s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.day:active { transform: scale(.96); }
.day .d { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.day .s { font-size: 24px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: color-mix(in srgb, currentColor 78%, var(--ink)); }
.day .k { font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.15; min-height: 24px; }
.day .bar { width: 70%; height: 3px; border-radius: 2px; background: currentColor; }
.day[aria-current="true"] { border-color: color-mix(in srgb, currentColor 55%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 45%, transparent), 0 4px 12px rgba(31, 24, 44, .08); }
.day.past { opacity: .5; }
.day.past[aria-current="true"] { opacity: .9; }

/* ── Tarjetas ─────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 18px; box-shadow: 0 1px 2px rgba(31, 24, 44, .04); }
.skeleton { height: 90px; border-radius: 12px; background: linear-gradient(90deg, var(--fill), var(--fill-2), var(--fill)); background-size: 200% 100%; animation: sh 1.2s infinite linear; }
@keyframes sh { to { background-position: -200% 0; } }

.verdict .q { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.verdict .a { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; color: color-mix(in srgb, var(--c, var(--coral)) 74%, var(--ink)); }
.verdict .advice { margin: 0 0 14px; color: var(--text-2); }
.odds { display: flex; align-items: center; gap: 12px; }
.odds .pct { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 72px; }
.range { position: relative; height: 8px; border-radius: 4px; background: var(--fill-2); flex: 1; }
.range .fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: linear-gradient(90deg, var(--bad), var(--good), var(--coral)); }
.range .dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 3px var(--text); }
.odds-cap { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
/* Un atardecer que ya pasó: lo que dieron los modelos, y una invitación a valorarlo */
.past-note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; line-height: 1.45; }
.past-note .link { font-size: inherit; font-weight: 600; }
.models-q { margin: 14px 0 6px !important; }
.models { display: flex; flex-wrap: wrap; gap: 6px; }
.mchip { display: inline-flex; align-items: baseline; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--fill); font-size: 12.5px; color: var(--muted); line-height: 28px; }
.mchip b { font-size: 14px; font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--c, var(--text)) 74%, var(--ink)); }

/* Ficha del spot oficial: qué es, por qué es oficial y en qué meses el sol cae al mar. */
.official-info { border-color: color-mix(in srgb, var(--coral) 32%, var(--card-line)); scroll-margin-top: 8px; }
.official-info.flash { animation: oi-flash 1.3s var(--ease); }
@keyframes oi-flash { 30% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--coral) 28%, transparent); } }
.oi-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.oi-ico {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; line-height: 1;
  background: var(--coral); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 18%, transparent);
}
.oi-title { min-width: 0; }
.oi-title h2 { margin: 0 0 2px; color: var(--coral-ink); letter-spacing: .08em; }
.oi-name { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.oi-desc { margin: 0 0 14px; color: var(--text-2); line-height: 1.45; }
.oi-why { padding: 13px 14px 14px; border-radius: 14px; background: var(--fill); }
.oi-why h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 750; }
.oi-why p { margin: 0; line-height: 1.45; color: var(--text-2); }
.oi-why .oi-cap { margin: 14px 0 7px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.oi-months { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.oi-months li {
  height: 28px; border-radius: 7px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  background: var(--fill-2); color: var(--muted);
}
.oi-months li.sea { background: linear-gradient(180deg, var(--gold), var(--coral)); color: #fff; }
.oi-months li.now { outline: 2px solid var(--text); outline-offset: 1.5px; }
.oi-why .oi-now { margin-top: 9px; font-size: 13.5px; color: var(--text); }
.oi-rule { margin: 12px 2px 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }

.timing { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 12px; }
.timing h2 { grid-column: 1 / -1; margin-bottom: 0; }
.t-item .l { font-size: 12px; color: var(--muted); }
.t-item .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.t-item .s { font-size: 12px; color: var(--muted); }
.t-item.hl .v { color: var(--gold-ink); }
.t-item .dot { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: 2px; background: var(--coral); }
.t-item .dot.rise { background: var(--sunrise); }
.t-item.terrain .v { color: var(--terrain-ink); }
.t-note { grid-column: 1 / -1; font-size: 14px; color: var(--text-2); background: var(--fill); border: 1px solid var(--card-line); padding: 10px 12px; border-radius: 12px; }

.explain { margin: 0 0 14px; font-size: 16px; color: var(--text); }
.factors { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.factor { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.factor .ft { font-weight: 600; font-size: 14.5px; }
.factor .fi { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; }
.factor .fi.pos { color: var(--pos); }
.factor .fi.neg { color: var(--neg-ink); }
.factor .fx { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); }
.factor .fb { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--fill-2); position: relative; overflow: hidden; }
.factor .fb i { position: absolute; top: 0; bottom: 0; left: 50%; border-radius: 2px; }
.factor .fb i.pos { background: var(--pos); }
.factor .fb i.neg { background: var(--neg); transform: translateX(-100%); }

.btn { border: 0; border-radius: 12px; padding: 11px 14px; font-weight: 650; cursor: pointer; background: var(--carmin); color: #fff; transition: background-color .2s var(--ease), transform .15s var(--ease), filter .2s; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: var(--fill); color: var(--text); width: 100%; }
.btn.small { padding: 8px 12px; width: auto; }
.stars { display: flex; gap: 8px; }
.stars button {
  flex: 1; border: 1px solid var(--card-line); background: var(--card); border-radius: 12px; padding: 10px 0; cursor: pointer; font-size: 13px; color: var(--muted);
  transition: background-color .2s var(--ease), border-color .2s var(--ease), opacity .2s var(--ease);
}
.stars button b { display: block; font-size: 20px; color: var(--text); }
.stars button[aria-checked="true"] { background: rgba(255, 107, 107, .12); border-color: var(--coral); color: var(--coral-ink); }
.stars button:disabled { cursor: default; }
.stars.sent button:not([aria-checked="true"]) { opacity: .4; }
.stars.sending { pointer-events: none; opacity: .7; }
.report-msg { margin: 10px 0 0; display: flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; }
.report-msg.err { color: var(--coral-ink); }

.foot { text-align: center; padding: 8px 0 0; font-size: 14px; }
.foot p { margin: 6px 0; }
.link { background: none; border: 0; padding: 0; color: var(--coral-ink); cursor: pointer; text-decoration: underline; font-size: 13px; }
.seg { display: inline-flex; padding: 3px; margin: 4px 0 8px; border-radius: 999px; background: var(--fill); border: 1px solid var(--card-line); }
.seg button {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 650; cursor: pointer; transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--text); box-shadow: 0 1px 4px rgba(31, 24, 44, .12); }
@media (hover: hover) { .seg button:hover { color: var(--text); } }

/* ── Hojas modales: buscador y spots ──────────────────── */
/* Móvil: a pantalla completa. Tablet y escritorio: tarjeta flotante cuyo scroll vive
   dentro, para que las esquinas redondeadas recorten también la barra. */
/* Alto por «inset: 0», no por unidades de viewport: en la app instalada de iOS 26+, 100vh/dvh
   cuentan también la barra de estado (WebKit 316008) y cortarían el final de la lista. */
.sheet {
  border: 0; padding: 0; margin: 0; inset: 0; width: 100%; max-width: 100%; height: auto; max-height: none;
  background: var(--surface); color: var(--text); overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; animation: sheet-in .28s var(--ease); }
.sheet::backdrop { background: var(--backdrop); }
.sheet[open]::backdrop { animation: fade-in .28s var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet.closing { animation: sheet-out .2s var(--ease) forwards; }
.sheet.closing::backdrop { animation: fade-out .2s var(--ease) forwards; }
@keyframes sheet-out { to { opacity: 0; transform: translateY(10px); } }
@keyframes fade-out { to { opacity: 0; } }
.sheet-inner { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: 640px; margin: 0 auto; padding: calc(14px + var(--safe-top)) var(--gutter-r) 0 var(--gutter-l); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l)); padding: 0 var(--gutter-r) calc(24px + var(--safe-bottom)) var(--gutter-l); }
@media (min-width: 720px) and (min-height: 520px) {
  .sheet {
    inset: 10vh 0 auto; margin: 0 auto; width: min(560px, calc(100% - 48px)); height: auto; max-height: min(660px, 80vh);
    border-radius: 24px; box-shadow: 0 30px 80px rgba(31, 24, 44, .3);
  }
  .sheet-inner { padding: 18px 18px 0; }
  .sheet-body { margin: 0 -18px; padding: 0 18px 18px; }
}
.search-row, .sheet-head { display: flex; gap: 8px; flex: none; align-items: center; }
.sheet-head h1 { flex: 1; margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
#q { flex: 1; height: 46px; border-radius: 14px; border: 1px solid var(--card-line); background: var(--fill); color: var(--text); padding: 0 14px; font-size: 17px; outline: none; }
#q:focus { border-color: rgba(255, 107, 107, .6); background: var(--surface); }
.locate { flex: none; margin: 14px 0 6px; width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: rgba(255, 107, 107, .1); color: var(--coral-ink); border-radius: 14px; padding: 13px 14px; font-weight: 650; cursor: pointer; }
.results, .fav-list { list-style: none; margin: 8px 0 0; padding: 0; }
.results li button, .fav-list li button { width: 100%; text-align: left; border: 0; background: transparent; padding: 12px 8px; border-bottom: 1px solid var(--card-line); border-radius: 0; cursor: pointer; transition: background-color .15s var(--ease); }
.results li:last-child button, .fav-list li:last-child button { border-bottom: 0; }
.results .r1, .fav-list .r1 { font-weight: 600; }
.results .r2, .fav-list .r2 { font-size: 13px; color: var(--muted); }

/* Mis spots */
.sheet-head .kind-ico {
  display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 10px; vertical-align: -5px;
  border-radius: 9px; background: rgba(255, 180, 84, .18); color: var(--gold-ink); font-size: 16px;
}
.spots-lead { flex: none; margin: 8px 2px 4px; line-height: 1.45; }
/* Copia de seguridad */
.backup { margin: 18px 0 4px; padding: 14px 14px 12px; border-radius: 16px; background: var(--fill); scroll-margin-top: 8px; }
.backup h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 15px; font-weight: 750; }
.backup h2 svg { color: var(--muted); }
.backup.on h2 svg { color: var(--ok); }
.backup p { margin: 0 0 10px; line-height: 1.45; }
.backup .row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.backup .btn.ghost { width: auto; background: var(--raised); }
.backup .code {
  margin: 2px 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px dashed var(--line-strong);
  font: 700 20px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; text-align: center; user-select: all; -webkit-user-select: all;
}
.backup .status { margin: 0 0 8px; }
.backup .restore { display: flex; gap: 8px; margin-top: 4px; }
.backup .restore[hidden] { display: none; }
.backup .restore input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--card-line); background: var(--surface);
  font: 600 16px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--text);
}
.backup .restore input:focus { outline: 2px solid rgba(255, 107, 107, .5); outline-offset: 0; }
.link.danger { color: var(--coral-ink); font-size: 13px; }
.fav-add {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; margin: 10px 0 2px; padding: 0 14px;
  border: 1.5px dashed rgba(232, 147, 12, .55); border-radius: 14px; background: rgba(255, 180, 84, .1); color: var(--gold-ink); font-size: 14.5px; font-weight: 700; cursor: pointer;
  transition: background-color .2s var(--ease), transform .15s var(--ease);
}
.fav-add span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-add svg { flex: none; }
.fav-add:active { transform: scale(.98); }
.fav-empty { margin: 14px 4px 0; line-height: 1.5; }
.fav-empty .save-ico { vertical-align: -3px; color: var(--gold-ink); }
.fav-list .fav { display: flex; align-items: stretch; border-bottom: 1px solid var(--card-line); animation: fade .25s var(--ease); }
.fav-list .fav:last-child { border-bottom: 0; }
.fav-list .fav .fav-go { flex: 1; min-width: 0; width: auto; border-bottom: 0; display: flex; align-items: center; gap: 12px; }
.fav-list .fav .txt { min-width: 0; }
.fav-list .fav .r1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-list .fav .ic { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 180, 84, .14); color: var(--gold-ink); font-size: 15px; }
.fav-list .tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 107, 107, .12); color: var(--coral-ink); font-size: 11px; font-weight: 650; vertical-align: 1px; }
.fav-list .fav .act {
  flex: none; width: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 10px;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.fav-list .rename { flex: 1; min-width: 0; height: 40px; margin: 8px 0; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(255, 107, 107, .5); background: var(--surface); font: inherit; font-weight: 600; color: var(--text); outline: none; }
@media (hover: hover) {
  .fav-list .fav .act:hover { color: var(--text); background: var(--fill); }
  .fav-list .fav .act.del:hover { color: var(--coral-ink); background: rgba(255, 107, 107, .1); }
  .fav-add:hover { background: rgba(255, 180, 84, .18); }
}
/* Avisos */
.alerts { padding: 14px 16px; }
.alerts-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.alerts-ico { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 180, 84, .16); color: var(--gold-ink); }
.alerts.on .alerts-ico { background: var(--gold); color: #3a2400; }
.alerts-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alerts-txt b { font-size: 15px; }
.alerts-txt small { font-size: 12.5px; line-height: 1.35; }
.alerts-more { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 10px; padding-left: 50px; }
.alerts-more .seg { margin: 0; }
.alerts-note { margin: 10px 0 0; padding-left: 50px; line-height: 1.4; }
.alerts.blocked .switch { opacity: .4; pointer-events: none; }
.alerts.busy .switch { opacity: .6; pointer-events: none; }
.fav-list .bell { display: inline-flex; vertical-align: -1px; margin-left: 4px; color: var(--gold-ink); }

/* Abrir en mi ubicación */
.geo-pref { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px 4px; cursor: pointer; }
.geo-txt { display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 600; }
.geo-txt small { font-size: 12px; font-weight: 400; line-height: 1.35; }
.geo-pref.blocked { cursor: default; }
.geo-pref.blocked .switch { opacity: .4; pointer-events: none; }
.switch {
  -webkit-appearance: none; appearance: none; flex: none; width: 44px; height: 26px; margin: 0; border-radius: 999px; position: relative; cursor: pointer;
  background: var(--line-strong); transition: background-color .25s var(--ease);
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3); transition: transform .25s var(--ease);
}
.switch:checked { background: var(--coral); }
.switch:checked::after { transform: translateX(18px); }

/* ── Mapa de calor: leyenda y pantalla de carga ───────── */
.heat-legend {
  position: absolute; z-index: 5; left: max(12px, var(--safe-left)); top: calc(var(--top-h) + 10px + var(--bar-h, 46px) + 2px);
  padding: 8px 10px 7px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-size: 11.5px; color: var(--muted);
  width: 200px; box-sizing: border-box; animation: fade .25s var(--ease);
}
.heat-legend .hl-head {
  display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 6px; padding: 0; border: 0; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.heat-legend .hl-head b { flex: 1; min-width: 0; }
.heat-legend .hl-chev { flex: none; color: var(--muted); transition: transform .25s var(--ease); }
/* Plegada (por defecto en móvil): sólo la escala, el rango y la mejor zona. */
.heat-legend.mini .hl-more { display: none; }
.heat-legend.mini .hl-chev { transform: rotate(180deg); }
.heat-legend .hl-head b { color: var(--text); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat-legend .hl-best {
  display: flex; align-items: center; gap: 6px; width: 100%; margin-top: 7px; padding: 6px 8px; border: 0; border-radius: 10px; cursor: pointer;
  background: color-mix(in srgb, var(--coral) 12%, transparent); color: var(--coral-ink); font: 650 12px/1.2 var(--font); text-align: left;
}
.heat-legend .hl-best b { min-width: 22px; padding: 3px 4px; border-radius: 7px; color: #1d1b24; text-align: center; font-variant-numeric: tabular-nums; }
.heat-legend .hl-best[hidden], .heat-legend .ramp i[hidden] { display: none; }
.heat-legend .hl-scale { display: flex; margin: 7px 0 2px; padding: 2px; }
.heat-legend .hl-scale button { flex: 1; min-height: 28px; padding: 0 8px; font-size: 12px; }
/* Nota del cuadro bajo el ratón (escritorio). */
.heat-tip .maplibregl-popup-content {
  padding: 4px 9px; border-radius: 9px; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  font: 700 13px/1.2 var(--font); font-variant-numeric: tabular-nums;
}
.heat-tip .maplibregl-popup-tip { display: none; }
@media (hover: hover) { .heat-legend .hl-best:hover { background: color-mix(in srgb, var(--coral) 20%, transparent); } }
.heat-legend .hl-head span { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.heat-legend .ramp { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #6f6a80, #8d86a3 25%, #c8a56e 42%, #ffb454 58%, #ff8a4c 72%, #ff5a6e 85%, #e04bd8); }
/* Lo que abarca la zona visible dentro de la escala 0–100. */
.heat-legend .ramp i {
  position: absolute; top: -3px; bottom: -3px; min-width: 4px; margin-left: -2px; box-sizing: border-box; border-radius: 6px;
  border: 2px solid var(--text); box-shadow: 0 0 0 1px var(--surface); transition: left .3s var(--ease), width .3s var(--ease);
}
.heat-legend .ticks { display: flex; justify-content: space-between; margin-top: 3px; font-variant-numeric: tabular-nums; }
.heat-legend small { display: block; margin-top: 3px; line-height: 1.3; }
/* La mejor zona del mapa de calor: un toque y vas a verla. */
.heat-best {
  display: flex; align-items: center; gap: 5px; padding: 3px 9px 3px 3px; margin: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--text); box-shadow: 0 0 0 2px var(--ring), 0 3px 10px rgba(0, 0, 0, .28); font: 600 11.5px/1 var(--font);
  animation: fade .25s var(--ease);
}
.heat-best b {
  min-width: 24px; height: 24px; padding: 0 3px; box-sizing: border-box; border-radius: 12px; display: grid; place-items: center;
  color: #1d1b24; font: 700 12px/1 var(--font); font-variant-numeric: tabular-nums;
}
@media (hover: hover) { .heat-best:hover { transform: translateY(-1px); } }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + var(--safe-bottom)); z-index: 50; background: #241d33; color: #fff;
  /* «max-content»: con left: 50% el ancho natural se quedaría en media pantalla. */
  padding: 10px 16px; border-radius: 14px; font-size: 14px; width: max-content; max-width: min(520px, calc(100% - 32px)); box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  display: flex; align-items: center; gap: 14px;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast-act { border: 0; background: none; padding: 4px 2px; color: var(--gold); font-weight: 700; cursor: pointer; }

.loading #score, .loading .band, .loading .kind, .loading .legend { opacity: .45; }
.status { display: none; align-items: center; gap: 10px; min-height: 54px; font-weight: 600; color: var(--text); }
.status .btn { margin-left: auto; }
.empty .status { display: flex; }
.empty .score-line, .empty .legend, .empty .panel-body > * { display: none; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 0 rgba(255, 107, 107, .6); animation: pulse 1.4s infinite; flex: none; }
.status.err .pulse { animation: none; background: #9a93ad; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, .55); } 100% { box-shadow: 0 0 0 16px rgba(255, 107, 107, 0); } }
.err { color: var(--coral-ink); }

/* ── Compartir ────────────────────────────────────────── */
/* Sobre la escena: compartir lo que se está viendo. */
.scene .when { right: 60px; }
.scene-share {
  position: absolute; z-index: 3; top: 8px; right: 10px; width: 38px; height: 38px; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background-color .2s var(--ease), transform .15s var(--ease);
}
.scene-share:active { transform: scale(.92); }
@media (hover: hover) { .scene-share:hover { background: rgba(255, 255, 255, .26); } }
/* «¿Cómo fue?»: el mejor momento para compartir tu foto. */
.share-photo {
  margin-top: 14px; width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  border: 1.5px dashed color-mix(in srgb, var(--coral) 55%, transparent); background: rgba(255, 107, 107, .07); color: var(--coral-ink);
  border-radius: 14px; padding: 12px 14px; font: inherit; transition: background-color .2s var(--ease), transform .15s var(--ease);
}
.share-photo:active { transform: scale(.99); }
.share-photo b { display: block; font-weight: 700; font-size: 15px; }
.share-photo small { display: block; color: var(--muted); font-size: 13px; }
@media (hover: hover) { .share-photo:hover { background: rgba(255, 107, 107, .12); } }

/* La hoja: vista previa grande y, debajo (o al lado en pantallas anchas), las opciones; las
   acciones, en un pie fijo para no tener que desplazarse para compartir. */
.share-sheet .sheet-body { padding-bottom: 16px; }
.share-sheet .sheet-inner { max-width: 960px; }
.sh-body { display: flex; flex-direction: column; gap: 14px; padding-top: 12px; }
.sh-stage { flex: none; height: clamp(190px, 36svh, 560px); display: grid; place-items: center; }
.sh-frame {
  position: relative; width: 180px; height: 320px; border-radius: 16px; overflow: hidden; background: var(--screen);
  box-shadow: 0 10px 34px rgba(31, 24, 44, .22), 0 0 0 1px var(--card-line); transition: width .3s var(--ease), height .3s var(--ease);
}
.sh-frame img, .sh-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.sh-frame [hidden] { display: none; }
/* Progreso: una píldora abajo; la vista previa sigue a la vista. */
.sh-busy {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 20px);
  display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 9px; row-gap: 6px; padding: 8px 12px;
  border-radius: 14px; background: rgba(14, 11, 22, .72); color: #fff; font-size: 12.5px; font-weight: 650;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}
.sh-busy[hidden] { display: none; }
.sh-busy b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.sh-spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: sh-spin .8s linear infinite; }
@keyframes sh-spin { to { transform: rotate(360deg); } }
.sh-bar { grid-column: 1 / -1; display: block; width: 100%; min-width: 120px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.sh-bar[hidden] { display: none; }
.sh-bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--coral); transition: width .2s linear; }
.sh-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sh-lab { margin: 0; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.sh-lab small { letter-spacing: 0; text-transform: none; font-weight: 500; }
.sh-lab small::before { content: '· '; }
.sh-fmts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sh-fmts button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; min-width: 0;
  padding: 8px 11px; cursor: pointer; border: 1.5px solid var(--card-line); border-radius: 14px; background: var(--card); color: var(--text); font: inherit;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.sh-fmts b { max-width: 100%; font-size: 14px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-fmts small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.25; }
.sh-fmts button[aria-pressed="true"] { border-color: var(--coral); background: rgba(255, 107, 107, .08); }
.sh-fmts button[aria-pressed="true"] small { color: var(--coral-ink); }
.sh-type { display: flex; margin: 0; }
.sh-type button { flex: 1; }
.sh-add, .sh-own {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--fill); color: var(--text);
}
.sh-add { cursor: pointer; border: 1.5px dashed var(--line-strong); transition: border-color .2s var(--ease), background-color .2s var(--ease); }
.sh-add:focus-within { border-color: var(--coral); }
@media (hover: hover) { .sh-add:hover { background: var(--fill-2); } }
.sh-add[hidden], .sh-own[hidden] { display: none; }
/* El selector de archivos, invisible pero presente: así se puede abrir también desde otro botón. */
.sh-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sh-add-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 107, 107, .12); color: var(--coral-ink); }
.sh-add-txt { flex: 1; min-width: 0; }
.sh-add-txt b { display: block; font-size: 15px; font-weight: 700; }
.sh-add-txt small { display: block; font-size: 13px; color: var(--muted); }
.sh-plus { flex: none; color: var(--muted); }
.sh-own img { flex: none; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--fill-2); }
.sh-own .btn.ghost { background: var(--raised); }
.sh-foot {
  flex: none; display: flex; flex-direction: column; gap: 8px; margin: 0 calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l));
  padding: 10px var(--gutter-r) calc(10px + var(--safe-bottom)) var(--gutter-l); background: var(--surface); box-shadow: 0 -1px 0 var(--card-line);
}
.sh-main { display: flex; flex-direction: column; gap: 6px; }
.sh-go { width: 100%; min-height: 48px; font-size: 16.5px; border-radius: 14px; }
.sh-go:disabled { opacity: .55; cursor: progress; }
.sh-hint { margin: 0 2px; line-height: 1.35; font-size: 12.5px; }
.sh-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; }
.sh-more button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 0; border-radius: 12px; cursor: pointer; min-width: 0;
  background: var(--fill); color: var(--text); font: inherit; font-size: 11.5px; font-weight: 600; white-space: nowrap; transition: background-color .2s var(--ease);
}
.sh-more svg { width: 18px; height: 18px; }
.sh-more button[hidden] { display: none; }
.sh-more button:disabled { opacity: .5; cursor: progress; }
@media (hover: hover) { .sh-more button:hover { background: var(--fill-2); } }
.sh-hold { position: fixed; left: 0; top: 0; width: 2px; height: 2px; overflow: hidden; opacity: .01; pointer-events: none; }
.sh-hold video { width: 2px; height: 2px; }
@media (min-width: 720px) and (min-height: 520px) {
  .share-sheet { inset: 5vh 0 auto; width: min(920px, calc(100% - 48px)); max-height: min(780px, 90vh); }
  .sh-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 22px; padding-top: 14px; }
  .sh-stage { height: min(600px, calc(90vh - 230px)); position: sticky; top: 0; }
  .sh-foot { margin: 0 -18px; padding: 12px 18px 16px; flex-direction: row; align-items: center; gap: 16px; }
  .sh-main { flex: 1; flex-direction: row-reverse; align-items: center; gap: 14px; }
  .sh-go { width: auto; min-width: 230px; }
  .sh-hint { flex: 1; }
  .sh-more { display: flex; }
  .sh-more button { width: 74px; }
}

/* ── Tablet: hoja flotante a la izquierda (como un mapa de iPad) ── */
@media (min-width: 720px) and (max-width: 979px) and (min-height: 561px) {
  .panel { left: max(16px, var(--safe-left)); right: auto; width: 440px; }
}
/* ── Escritorio y móvil en horizontal: panel lateral fijo ── */
@media (min-width: 980px), (orientation: landscape) and (max-height: 560px) and (min-width: 600px) {
  .app { --panel-w: 420px; }
  .panel {
    top: 0; bottom: 0; left: 0; right: auto; width: var(--panel-w); height: auto; transform: none !important;
    border-radius: 0; padding-top: var(--top-h); box-shadow: 8px 0 30px rgba(31, 24, 44, .12);
  }
  .grab, .expand { display: none; }
  .summary { cursor: default; touch-action: auto; }
  .app .panel-body { overflow-y: auto !important; touch-action: auto !important; opacity: 1 !important; }
  .topbar { right: auto; width: var(--panel-w); box-shadow: 0 1px 0 var(--card-line); }
  /* El mapa también llega bajo la barra de estado: sus botones empiezan debajo. */
  .mapbar { left: calc(var(--panel-w) + 14px); top: calc(12px + var(--safe-top)); }
  .heat-legend { left: calc(var(--panel-w) + 14px); top: calc(12px + var(--safe-top) + var(--bar-h, 46px) + 2px); }
  .fabs { bottom: max(24px, var(--safe-bottom)); right: max(24px, var(--safe-right)); transform: none !important; }
  /* Con panel lateral la hoja siempre está «completa»: el mapa de calor sigue a mano y la
     ubicación, como antes, va en el panel. */
  .app[data-snap="full"] .fabs { opacity: 1; }
  .app[data-snap="full"] .fabs > .heat-fab { pointer-events: auto; }
  .fabs .fab { display: none; }
  .map .maplibregl-ctrl-top-right { top: var(--safe-top); right: var(--safe-right); }
}
@media (orientation: landscape) and (max-height: 560px) and (min-width: 600px) {
  .app { --panel-w: min(380px, 48vw); --top-h: calc(58px + var(--safe-top)); }
  .topbar { padding-top: calc(7px + var(--safe-top)); padding-bottom: 7px; width: calc(var(--panel-w) + var(--safe-left)); }
  .panel { left: 0; padding-left: var(--safe-left); width: calc(var(--panel-w) + var(--safe-left)); }
  /* Con el notch a la izquierda el panel es más ancho: los botones del mapa empiezan después. */
  .mapbar, .heat-legend { left: calc(var(--panel-w) + var(--safe-left) + 14px); }
  .map .maplibregl-ctrl-top-right { top: calc(12px + var(--safe-top) + var(--bar-h, 46px)); }
  #score { font-size: 44px; }
  .scene { height: 200px; }
}
/* ── Entrada y transiciones ───────────────────────────── */
.veil {
  position: fixed; inset: 0; z-index: 100; pointer-events: none;
  background: #14111f; display: grid; place-items: center;
  /* Red de seguridad: si el JS no llega, el velo se va solo. */
  animation: veil-out .7s ease 2.4s forwards;
}
.veil-ring { width: 64px; height: 64px; filter: drop-shadow(0 0 22px rgba(255, 107, 107, .55)); }
/* Instalada no se viene de la landing: el velo es blanco, como la pantalla de arranque
   (background_color del manifest). Si fuera oscuro, iOS pintaría la barra de estado de
   negro: la toma del elemento fijo de arriba, y el velo lo es. Por eso además app.js lo
   quita del todo al acabar (aun invisible, iOS 26 lo seguía tomando). */
.pwa .veil { background: var(--surface); }
.sb-under { --sb-top: 24px; }   /* la barra de estado del iPad: 24 pt */
@media (display-mode: standalone) { .veil { background: var(--surface); } }
.ready .veil { animation: veil-out .75s cubic-bezier(.6, 0, .2, 1) forwards; }
.ready .veil-ring { animation: ring-open .85s cubic-bezier(.6, 0, .2, 1) forwards; }
@keyframes veil-out { to { opacity: 0; visibility: hidden; } }
@keyframes ring-open { to { transform: scale(16); opacity: 0; } }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.revealing .score-line { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
.revealing .legend { animation: rise .6s cubic-bezier(.2, .7, .2, 1) .06s both; }
.revealing .panel-body > * { animation: rise .6s cubic-bezier(.2, .7, .2, 1) .12s both; }
.panel-body.swap > * { animation: fade .45s ease both; }
#score, .band, .kind, .legend { transition: opacity .4s ease; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .veil { display: none; }
}

/* ── Tema oscuro: lo que no es sólo cambiar un token ──── */
@media (prefers-color-scheme: dark) {
  html { scrollbar-color: rgba(255, 255, 255, .2) transparent; }
  /* La nota baja del blanco a su color (en claro, del casi negro). */
  #score { background-image: linear-gradient(180deg, #ffffff 0%, var(--score-ink) 95%); }
  /* Sobre oscuro las sombras no se ven: las piezas se separan con un filo de luz. */
  .card { box-shadow: none; }
  .scene { box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 8px 24px rgba(0, 0, 0, .45); }
  .toast { background: #2c2739; box-shadow: 0 0 0 1px rgba(255, 255, 255, .09), 0 10px 30px rgba(0, 0, 0, .55); }
  .day[aria-current="true"] { box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 45%, transparent), 0 4px 14px rgba(0, 0, 0, .35); }
  .seg button[aria-pressed="true"] { box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
  /* Controles de MapLibre (vienen en blanco con iconos oscuros). */
  .map .maplibregl-ctrl-group { background: var(--surface); }
  .map .maplibregl-ctrl-group button + button { border-top-color: var(--card-line); }
  .map .maplibregl-ctrl button:not(:disabled):hover { background-color: var(--fill); }
  .map .maplibregl-ctrl-icon, .map .maplibregl-ctrl-attrib-button { filter: invert(1); }
  .map .maplibregl-ctrl-attrib-button { background-color: transparent; }
  .map .maplibregl-ctrl-attrib.maplibregl-compact { background: var(--glass); color: var(--text-2); box-shadow: 0 0 0 1px var(--card-line); }
  .map .maplibregl-ctrl-attrib a { color: var(--text-2); }
}
@media (prefers-color-scheme: dark) and (min-width: 720px) and (min-height: 520px) {
  .sheet { box-shadow: 0 0 0 1px var(--card-line), 0 30px 80px rgba(0, 0, 0, .6); }
}
@media (prefers-color-scheme: dark) and (min-width: 980px), (prefers-color-scheme: dark) and (orientation: landscape) and (max-height: 560px) and (min-width: 600px) {
  .panel { box-shadow: 1px 0 0 var(--card-line), 8px 0 30px rgba(0, 0, 0, .35); }
}

/* App nativa (iOS / Android): sin el menú de «copiar / buscar» al mantener pulsado, ni
   selección de texto al arrastrar el mapa o la hoja; se puede escribir y copiar el código. */
.native body { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.native input, .native textarea, .native .backup .code { -webkit-touch-callout: default; -webkit-user-select: text; user-select: text; }

/* App nativa con una versión que el servidor ya no admite (native.js, GET /api/app):
   cubre la app y sólo deja ir a la tienda. */
.update-gate { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  padding: calc(24px + var(--safe-top)) var(--gutter-r) calc(24px + var(--safe-bottom)) var(--gutter-l);
  background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.update-gate > div { width: min(380px, 100%); padding: 24px; border-radius: var(--radius); background: var(--card);
  box-shadow: var(--shadow); text-align: center; }
.update-gate h2 { margin: 0 0 8px; font-size: 21px; font-weight: 750; color: var(--text); text-transform: none; letter-spacing: -.01em; }
.update-gate p { margin: 0 0 20px; color: var(--text-2); line-height: 1.45; }
.update-gate .btn { width: 100%; min-height: 48px; font-size: 16px; }

/* ── La campana junto a la nota: avisos de este sitio en un toque ── */
.bell-btn {
  position: relative; flex: none; width: 40px; height: 40px; margin-right: 6px; border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  background: var(--fill); color: var(--text); -webkit-tap-highlight-color: transparent; transition: background-color .2s var(--ease), color .2s var(--ease), transform .12s;
}
.bell-btn[hidden] { display: none; }
.bell-btn:active { transform: scale(.92); }
.bell-btn svg, .bell-btn .bb-spin { grid-area: 1 / 1; }
.bell-btn .bb-on, .bell-btn .bb-spin { display: none; }
.bell-btn[data-state="on"] { background: var(--carmin); color: #fff; }
.bell-btn[data-state="on"] .bb-off { display: none; }
.bell-btn[data-state="on"] .bb-on { display: block; }
.bell-btn[data-state="busy"] svg { display: none; }
.bell-btn[data-state="busy"] .bb-spin { display: block; width: 18px; height: 18px; color: var(--muted); }
.bell-btn[data-state="blocked"] { color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .bell-btn.ring .bb-on { transform-origin: 50% 12%; animation: bell-ring .9s cubic-bezier(.36, .07, .19, .97); }
  .bell-btn.ring::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 var(--carmin); animation: bell-pulse .9s ease-out; pointer-events: none; }
}
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
@keyframes bell-pulse { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--carmin) 55%, transparent); } to { box-shadow: 0 0 0 14px transparent; } }
.alerts-status .al-all { margin-left: auto; }

/* ── La hoja de avisos ── */
.al-body { padding-top: 4px; }
.al-intro { margin: 0 0 14px; color: var(--text-2); line-height: 1.45; }
.al-list { list-style: none; margin: 0; padding: 0; border-radius: 14px; background: var(--fill); overflow: hidden; }
.al-row { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; }
.al-row + .al-row { border-top: 1px solid var(--card-line); }
.al-ico { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--carmin); }
.al-ico svg { width: 14px; height: 14px; }
.al-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.al-name b { font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-name small { font-size: 12px; color: var(--coral-ink); font-weight: 650; }
.al-seg { flex: none; display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill-2); }
.al-seg button { border: 0; padding: 5px 8px; border-radius: 7px; background: none; font: inherit; font-size: 12.5px; font-weight: 650; color: var(--muted); cursor: pointer; font-variant-numeric: tabular-nums; }
.al-seg button[aria-pressed="true"] { background: var(--raised); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.al-rm { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; display: grid; place-items: center; background: none; color: var(--muted); cursor: pointer; }
.al-rm:active { background: var(--fill-2); }
.al-empty { margin: 0; padding: 18px 14px; border-radius: 14px; background: var(--fill); color: var(--text-2); text-align: center; line-height: 1.45; }
.al-count { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 8px 4px 0; font-size: 13px; color: var(--muted); }
.al-count .link { font-size: 13px; font-weight: 700; color: var(--coral-ink); text-decoration: none; }
.al-add { width: 100%; margin-top: 14px; padding: 13px; border-radius: 14px; font-size: 15.5px; }
.al-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 14px 2px 0; color: var(--text-2); font-size: 14px; }
.al-status .pw-spin { width: 14px; height: 14px; border-width: 2px; color: var(--muted); }
.al-acts { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.al-acts .btn.ghost { flex: 1; padding: 12px; border-radius: 12px; }
.al-offall { color: var(--muted); font-size: 14px; }
.al-fine { margin: 16px 2px 4px; font-size: 12px; line-height: 1.45; color: var(--muted); }
