/* ════════════════════════════════════════════════════════════
   De Guardia · v2
   Concepto: el rótulo LED verde de la farmacia española.
   El verde encendido significa una sola cosa: "abierta ahora".
   ════════════════════════════════════════════════════════════ */

@font-face { font-family: "Atkinson Next"; src: url(fonts/atkinson-hyperlegible-next-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url(fonts/atkinson-hyperlegible-next-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url(fonts/atkinson-hyperlegible-next-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Doto"; src: url(fonts/doto-latin-900-normal.woff2) format("woff2"); font-weight: 900; font-display: swap; }

/* ── Tokens: Día ── */
:root {
  --bg: #EDF2F0;
  --surface: #FFFFFF;
  --surface-2: #F3F7F5;
  --line: #DCE5E1;
  --text: #0F2620;
  --muted: #5A6F69;
  --led: #10A862;          /* relleno: marcadores, puntos encendidos */
  --led-ink: #07804A;      /* texto verde con contraste AA sobre blanco */
  --led-glow: rgba(16,168,98,.35);
  --led-off: #D3DED9;
  --amber: #FFB547;
  --amber-ink: #8F5600;
  --closed: #8E9B97;
  --blue: #2F6BFF;
  --scrim: rgba(237,242,240,.86);
  --shadow: 0 24px 60px -20px rgba(15,38,32,.35), 0 2px 8px rgba(15,38,32,.08);
  --shadow-sm: 0 6px 18px -8px rgba(15,38,32,.30);
  --font: "Atkinson Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --led-font: "Doto", ui-monospace, monospace;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --top-h: calc(var(--sat) + 72px);
  --peek: 236px;
  --ease: cubic-bezier(.22,.8,.25,1);
  color-scheme: light;
}

/* ── Tokens: Noche ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1822; --surface: #12222E; --surface-2: #182C3A; --line: #22394A;
    --text: #E8F1EE; --muted: #8DA3A5;
    --led: #34EE8A; --led-ink: #5CF5A3; --led-glow: rgba(52,238,138,.55); --led-off: #1A3242;
    --amber: #FFC061; --amber-ink: #FFC061; --closed: #6A7E87; --blue: #5B8CFF;
    --scrim: rgba(11,24,34,.82);
    --shadow: 0 30px 70px -20px rgba(0,0,0,.7), 0 2px 10px rgba(0,0,0,.35);
    --shadow-sm: 0 8px 20px -10px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1822; --surface: #12222E; --surface-2: #182C3A; --line: #22394A;
  --text: #E8F1EE; --muted: #8DA3A5;
  --led: #34EE8A; --led-ink: #5CF5A3; --led-glow: rgba(52,238,138,.55); --led-off: #1A3242;
  --amber: #FFC061; --amber-ink: #FFC061; --closed: #6A7E87; --blue: #5B8CFF;
  --scrim: rgba(11,24,34,.82);
  --shadow: 0 30px 70px -20px rgba(0,0,0,.7), 0 2px 10px rgba(0,0,0,.35);
  --shadow-sm: 0 8px 20px -10px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
.ico { width: 22px; height: 22px; flex: none; }
[hidden] { display: none !important; }

.app { position: fixed; inset: 0; overflow: hidden; }
.map { position: absolute; inset: 0; background: var(--bg); z-index: 0; }

/* ═════════ Barra superior ═════════ */
.topbar {
  position: absolute; z-index: 30; left: 12px; right: 12px; top: calc(var(--sat) + 12px);
  display: flex; align-items: center; gap: 8px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-mark {
  width: 48px; height: 48px; padding: 13px; border-radius: 16px; color: var(--led);
  background: var(--surface); box-shadow: var(--shadow-sm);
  filter: drop-shadow(0 0 0 transparent);
}
.brand-name { display: none; font-weight: 800; font-size: 19px; letter-spacing: -.01em; }

.search {
  position: relative; flex: 1; min-width: 0; height: 48px; display: flex; align-items: center;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.search-ico { width: 20px; height: 20px; margin: 0 4px 0 14px; color: var(--muted); }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 16px; padding: 0 6px;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.icon-btn {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; flex: none;
  transition: background .2s, transform .15s;
}
.icon-btn:active { transform: scale(.94); }
.locate { color: var(--blue); width: 44px; height: 44px; border-radius: 12px; margin-right: 2px; }
.locate:hover { background: var(--surface-2); }
.locate.busy .ico { animation: spin 1s linear infinite; }
.theme { background: var(--surface); box-shadow: var(--shadow-sm); color: var(--muted); }

.suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; list-style: none; overflow: hidden;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 6px;
}
.suggest li {
  padding: 12px 14px; border-radius: 12px; cursor: pointer; display: grid; gap: 1px;
}
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--surface-2); }
.suggest .s-main { font-weight: 700; }
.suggest .s-sub { font-size: 14px; color: var(--muted); }

/* ═════════ Intro: el rótulo ═════════ */
.intro {
  position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--top-h) + 8px) 28px calc(var(--sab) + 32px); text-align: center;
  background: var(--scrim); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  transition: opacity .5s var(--ease), transform .6s var(--ease), visibility 0s linear 0s;
}
[data-stage="results"] .intro { opacity: 0; transform: scale(1.04); visibility: hidden; pointer-events: none; transition: opacity .45s var(--ease), transform .6s var(--ease), visibility 0s linear .6s; }

.sign {
  width: min(62vw, 300px, 38vh); aspect-ratio: 1; margin-bottom: clamp(20px, 5vh, 44px);
  padding: 7%; border-radius: 22%;
  background: #0A141B;  /* la carcasa del rótulo es negra de día y de noche */
  box-shadow: 0 30px 80px -30px var(--led-glow), inset 0 0 0 1px rgba(255,255,255,.04), inset 0 2px 0 rgba(255,255,255,.05);
}
.led { width: 100%; height: 100%; display: block; overflow: visible; }
.led .off circle { fill: #16262F; }
.led .lit circle { fill: #3BF08F; opacity: 0; transition: opacity .22s ease var(--d, 0s); }
.led .lit circle.on { opacity: 1; }

.intro-title {
  font-weight: 800; font-size: clamp(30px, 8.4vw, 52px); line-height: 1.04; letter-spacing: -.025em;
  max-width: 14ch; text-wrap: balance;
}
.intro-sub { margin-top: 12px; color: var(--muted); font-size: 17px; max-width: 34ch; text-wrap: balance; }
.intro .btn-xl { margin-top: 28px; }
.intro .btn-ghost { margin-top: 8px; }
.intro-msg { min-height: 22px; margin-top: 12px; font-size: 15px; color: var(--muted); max-width: 36ch; }
.intro-msg.err { color: #E25A4F; }

/* ═════════ Botones ═════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 22px;
  border-radius: 16px; font-weight: 700; font-size: 17px; transition: transform .15s, background .2s, box-shadow .2s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--led); color: #052A17; box-shadow: 0 12px 30px -12px var(--led-glow); }
.btn-primary:hover { box-shadow: 0 16px 36px -10px var(--led-glow); }
.btn-xl { height: 60px; padding: 0 30px; font-size: 18px; border-radius: 18px; min-width: min(100%, 300px); }
.btn-ghost { color: var(--text); background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; }

/* ═════════ Panel (bottom sheet) ═════════ */
.sheet {
  position: absolute; z-index: 25; left: 0; right: 0; bottom: 0; height: calc(100% - var(--top-h));
  background: var(--surface); border-radius: 28px 28px 0 0; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transform: translateY(var(--y, 100%));
  transition: transform .42s var(--ease); will-change: transform; touch-action: none;
}
.sheet.dragging { transition: none; }
[data-stage="intro"] .sheet { transform: translateY(105%); }

.sheet-grip { flex: none; height: 26px; display: grid; place-items: center; cursor: grab; }
.sheet-grip span { width: 40px; height: 5px; border-radius: 3px; background: var(--line); }

.view { display: flex; flex-direction: column; min-height: 0; flex: 1; }

.sheet-head { padding: 0 20px 4px; display: flex; flex-direction: column; gap: 12px; }
.where-label { font-weight: 800; font-size: 22px; letter-spacing: -.015em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.where-sum { color: var(--muted); font-size: 15px; margin-top: 2px; }

.radius { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; align-self: flex-start; }
.radius button { height: 32px; padding: 0 12px; border-radius: 9px; font-size: 14px; font-weight: 700; color: var(--muted); }
.radius button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

.chips { display: flex; gap: 8px; padding: 12px 20px; overflow-x: auto; scrollbar-width: none; flex: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 40px; padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: 15px;
  border: 1.5px solid var(--line); color: var(--text); display: inline-flex; align-items: center; gap: 8px;
  transition: background .2s, border-color .2s, color .2s;
}
.chip b { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-selected="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }
.chip[aria-selected="true"] b { color: inherit; opacity: .7; }
.chip-guardia::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--led); box-shadow: 0 0 0 3px var(--led-glow); }

.list-wrap { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 12px calc(var(--sab) + 24px); -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.list { list-style: none; display: flex; flex-direction: column; }

/* Destacada: la más cercana abierta */
.hero {
  margin: 4px 4px 14px; padding: 18px; border-radius: 22px; background: var(--surface-2);
  border: 1.5px solid color-mix(in srgb, var(--led) 45%, transparent); position: relative; overflow: hidden;
}
.hero-kicker { font-size: 14px; font-weight: 700; color: var(--led-ink); display: flex; align-items: center; gap: 8px; }
.hero-name { font-size: 21px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; margin-top: 6px; }
.hero-addr { color: var(--muted); margin-top: 2px; }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 14px; }
.hero-dist { font-family: var(--led-font); font-weight: 900; font-size: 34px; line-height: .9; color: var(--led-ink); letter-spacing: .02em; }
.hero-dist small { display: block; font-family: var(--font); font-size: 14px; font-weight: 700; color: var(--muted); letter-spacing: 0; margin-top: 6px; }
.hero-actions { display: flex; gap: 8px; }
.hero-actions .btn { height: 48px; padding: 0 18px; font-size: 16px; }
.hero-actions .icon-only { width: 48px; padding: 0; }

/* Filas */
.row {
  display: grid; grid-template-columns: 12px 1fr auto; gap: 14px; align-items: center; width: 100%; text-align: left;
  padding: 14px 10px; border-radius: 16px; transition: background .15s;
}
.row:hover, .row.hl { background: var(--surface-2); }
.list li + li .row { box-shadow: 0 -1px 0 var(--line); }
.list li + li .row:hover, .list li + li .row.hl { box-shadow: none; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--closed); }
.dot.s-open { background: var(--led); }
.dot.s-guardia { background: var(--led); box-shadow: 0 0 0 4px var(--led-glow); animation: breathe 2.4s ease-in-out infinite; }
.dot.s-soon { background: var(--amber); }
.dot.s-unknown { background: transparent; box-shadow: inset 0 0 0 2px var(--closed); }
.row-main { min-width: 0; }
.row-main > span { display: block; }
.row-name { font-weight: 700; font-size: 17px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-addr { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-status { font-size: 14px; font-weight: 700; margin-top: 3px; }
.t-open, .t-guardia { color: var(--led-ink); }
.t-soon { color: var(--amber-ink); }
.t-closed, .t-unknown { color: var(--muted); }
.tag { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 7px; border-radius: 6px; margin-left: 6px; vertical-align: 1px; background: var(--surface-2); color: var(--text); }
.tag-g { background: var(--led); color: #052A17; }
.row-dist { text-align: right; font-variant-numeric: tabular-nums; }
.row-dist b { display: block; font-size: 17px; }
.row-dist span { font-size: 13px; color: var(--muted); }

.banner { margin: 4px 4px 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 15px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.banner .spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--led); animation: spin .8s linear infinite; flex: none; }

.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

.skel { height: 72px; margin: 6px 4px; border-radius: 16px; background: linear-gradient(90deg, var(--surface-2) 0, var(--line) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }

.attrib { font-size: 12.5px; color: var(--muted); padding: 18px 10px 0; line-height: 1.5; }
.attrib a { color: var(--muted); }

/* ═════════ Ficha de farmacia ═════════ */
.view-detail { overflow-y: auto; overscroll-behavior: contain; padding: 0 20px calc(var(--sab) + 28px); touch-action: pan-y; }
.d-top { display: flex; align-items: center; gap: 8px; margin: 0 -8px 6px; }
.d-back { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; }
.d-back:hover { background: var(--surface-2); }
.d-name { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.12; text-wrap: balance; }
.d-addr { color: var(--muted); margin-top: 6px; font-size: 16px; }
.d-status { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.d-status .dot { flex: none; }
.d-status b { font-size: 17px; }
.d-status p { font-size: 14px; color: var(--muted); }
.d-actions { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; margin-top: 16px; }
.d-actions .btn { height: 54px; }
.d-actions .sq { width: 54px; padding: 0; background: var(--surface-2); }
.d-actions .sq:hover { background: var(--line); }
.d-eta { display: flex; gap: 18px; margin-top: 14px; color: var(--muted); font-size: 15px; }
.d-eta span { display: inline-flex; gap: 6px; align-items: center; }
.d-eta .ico { width: 18px; height: 18px; }

.d-sec { margin-top: 26px; }
.d-sec h3 { font-size: 17px; font-weight: 800; margin-bottom: 10px; }
.week { display: grid; gap: 7px; }
.wk { display: grid; grid-template-columns: 34px 1fr 108px; align-items: center; gap: 10px; font-size: 14px; }
.wk-day { font-weight: 700; color: var(--muted); }
.wk.today .wk-day, .wk.today .wk-h { color: var(--text); font-weight: 800; }
.wk-bar { position: relative; height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.wk-bar i { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: var(--led); opacity: .85; }
.wk-bar .now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); border-radius: 1px; }
.wk-h { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-scale { display: grid; grid-template-columns: 34px 1fr 108px; gap: 10px; font-size: 11px; color: var(--muted); }
.wk-scale div { display: flex; justify-content: space-between; }
.d-meta { display: grid; gap: 2px; }
.d-meta a, .d-meta p { display: flex; align-items: center; gap: 12px; padding: 12px 0; text-decoration: none; border-bottom: 1px solid var(--line); font-size: 16px; }
.d-meta .ico { color: var(--muted); width: 20px; height: 20px; }
.d-note { font-size: 13px; color: var(--muted); margin-top: 18px; line-height: 1.5; }
.d-note a { color: var(--muted); }

/* ═════════ Modal elegir mapa ═════════ */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5,15,20,.45); animation: fade .25s ease; }
.modal-card {
  position: relative; width: 100%; max-width: 440px; background: var(--surface); border-radius: 28px 28px 0 0;
  padding: 22px 18px calc(var(--sab) + 14px); box-shadow: var(--shadow); animation: rise .35s var(--ease);
}
.modal-title { font-weight: 800; font-size: 20px; padding: 0 6px; }
.modal-sub { color: var(--muted); padding: 2px 6px 14px; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-apps { display: grid; gap: 8px; }
.nav-app {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2);
  font-weight: 700; font-size: 17px; text-decoration: none; transition: transform .15s;
}
.nav-app:active { transform: scale(.98); }
.nav-app svg { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.nav-app small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.remember { display: flex; align-items: center; gap: 10px; padding: 14px 6px 8px; font-size: 15px; color: var(--muted); }
.remember input { width: 20px; height: 20px; accent-color: var(--led); }

/* ═════════ Toast ═════════ */
.toast {
  position: fixed; z-index: 80; left: 50%; bottom: calc(var(--sab) + 24px); transform: translate(-50%, 20px); opacity: 0;
  background: var(--text); color: var(--surface); padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 15px;
  transition: opacity .25s, transform .3s var(--ease); pointer-events: none; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ═════════ Mapa: marcadores ═════════ */
.leaflet-container { font-family: var(--font); background: var(--bg); }
.leaflet-control-attribution { font-size: 10px; background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--muted); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow-sm) !important; border-radius: 14px !important; overflow: hidden; }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--line) !important; width: 40px !important; height: 40px !important; line-height: 40px !important; }
.leaflet-bottom.leaflet-right { margin-bottom: calc(var(--sheet-vis, 0px) + 6px); transition: margin .42s var(--ease); }
@media (max-width: 899px) { .leaflet-control-zoom { display: none; } }
.t-muted { color: var(--muted); font-weight: 400; }

.pin { position: relative; width: 30px; height: 30px; display: grid; place-items: center; transition: transform .2s var(--ease); }
.pin svg { width: 14px; height: 14px; color: #fff; position: relative; z-index: 1; }
.pin::before { content: ""; position: absolute; inset: 3px; border-radius: 9px; background: var(--closed); box-shadow: 0 0 0 2px var(--surface), 0 4px 10px rgba(0,0,0,.25); }
.pin.s-open::before { background: var(--led); }
.pin.s-open svg { color: #052A17; }
.pin.s-soon::before { background: var(--amber); }
.pin.s-soon svg { color: #3A2300; }
.pin.s-unknown::before { background: var(--surface); box-shadow: inset 0 0 0 2px var(--closed), 0 4px 10px rgba(0,0,0,.2); }
.pin.s-unknown svg { color: var(--closed); }
.pin.s-guardia { width: 40px; height: 40px; }
.pin.s-guardia::before { inset: 2px; border-radius: 12px; background: var(--led); }
.pin.s-guardia svg { width: 18px; height: 18px; color: #052A17; }
.pin.s-guardia::after { content: ""; position: absolute; inset: -6px; border-radius: 18px; border: 2px solid var(--led); opacity: .0; animation: halo 2.4s ease-out infinite; }
.pin.sel { transform: scale(1.35) translateY(-3px); z-index: 1000; }

.me { width: 22px; height: 22px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--blue) 25%, transparent), 0 4px 10px rgba(0,0,0,.3); }

.cluster { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; background: var(--surface); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--led) 60%, transparent), var(--shadow-sm); }
.cluster.has-g { background: var(--led); color: #052A17; }

/* ═════════ Animaciones ═════════ */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { box-shadow: 0 0 0 7px transparent; } }
@keyframes halo { 0% { opacity: .9; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.25); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ═════════ Tablet / Escritorio ═════════ */
@media (min-width: 900px) {
  :root { --peek: 0px; }
  .topbar { left: 20px; right: 20px; top: 20px; }
  .brand { width: 172px; }
  .brand-mark { width: 44px; height: 44px; padding: 12px; border-radius: 14px; }
  .brand-name { display: block; }
  .search { flex: 0 1 260px; }
  .theme { margin-left: auto; }
  .sheet {
    left: 20px; right: auto; top: 84px; bottom: 20px; height: auto; width: 440px; border-radius: 26px;
    transform: none !important; transition: opacity .4s, transform .4s var(--ease); touch-action: auto;
  }
  [data-stage="intro"] .sheet { opacity: 0; transform: translateX(-20px) !important; pointer-events: none; }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 22px; }
  .view-detail { padding-top: 14px; }
  .intro { padding-top: 120px; }
  .sign { width: min(300px, 36vh); }
  .modal { align-items: center; }
  .modal-card { border-radius: 26px; padding-bottom: 18px; }
  .leaflet-bottom.leaflet-right { margin-bottom: 12px !important; }
}
@media (min-width: 900px) and (max-width: 1100px) {
  .search { flex-basis: 220px; }
}
@media (max-height: 560px) and (max-width: 899px) {
  .sign { display: none; }
}

/* Modo noche sobre teselas OSM (sin proveedor oscuro dedicado) */
.leaflet-layer.tiles-dark { filter: invert(1) hue-rotate(180deg) brightness(.88) contrast(.92) saturate(.55); }
