/* ============================================================
   SISMO·VE — sala de situación / dispatch humanitario
   Frontend de PREVIEW. Datos de ejemplo (placeholders).
   ============================================================ */

:root {
  --bg:        #080b12;
  --bg-2:      #0b0f1a;
  --surface:   rgba(18, 24, 38, 0.82);
  --surface-2: #141b2c;
  --line:      rgba(255, 255, 255, 0.08);
  --line-2:    rgba(255, 255, 255, 0.14);

  --text:      #e8eef6;
  --muted:     #93a0b4;
  --muted-2:   #61708a;

  --sev-colapso: #f0463a;
  --sev-rescate: #ff8a3d;
  --sev-dano:    #f4c152;
  --sev-sin:     #46c98b;
  --aid:         #34c4d6;

  --ve-y: #ffd24a;
  --ve-b: #1f5fe0;
  --ve-r: #e23b3b;

  --r: 14px;
  --shadow: 0 24px 60px -20px rgba(0,0,0,0.75), 0 8px 24px -12px rgba(0,0,0,0.6);
  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#map {
  position: fixed; inset: 0; z-index: 0;
  background: var(--bg);
}

/* subtle grain + vignette over the map for atmosphere */
#map::after {
  content: ""; position: fixed; inset: 0; z-index: 401; pointer-events: none;
  background:
    radial-gradient(120% 90% at 70% 0%, transparent 55%, rgba(0,0,0,0.45) 100%);
  mix-blend-mode: multiply;
}

/* ---------- Leaflet dark tuning ---------- */
.leaflet-container { background: var(--bg); font-family: var(--font-body); }
.leaflet-control-attribution {
  background: rgba(8,11,18,0.7) !important; color: var(--muted-2) !important;
  font-size: 10px !important; backdrop-filter: blur(6px);
}
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-bar { border: none !important; box-shadow: var(--shadow) !important; }
.leaflet-bar a {
  background: var(--surface-2) !important; color: var(--text) !important;
  border-bottom: 1px solid var(--line) !important; backdrop-filter: blur(8px);
}
.leaflet-bar a:hover { background: #1b2438 !important; }

/* ---------- Marker visuals ---------- */
.mk-report {
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 28%, transparent),
              0 0 18px 2px color-mix(in srgb, var(--c) 55%, transparent);
  transition: transform .18s ease, box-shadow .18s ease;
}
.mk-report:hover { transform: scale(1.18); }
.mk-pulse::before {
  content: ""; position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid var(--c);
  animation: ping 2.4s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes ping { 0%{transform:scale(1);opacity:.7} 80%,100%{transform:scale(2.6);opacity:0} }

.mk-aid {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  background: color-mix(in srgb, var(--aid) 22%, #0b1320);
  border: 1.5px solid var(--aid);
  border-radius: 9px;
  color: var(--aid);
  box-shadow: 0 6px 16px -6px rgba(0,0,0,.7), 0 0 14px -2px color-mix(in srgb, var(--aid) 60%, transparent);
}
.mk-aid svg { width: 17px; height: 17px; }

/* ---------- Leaflet popups ---------- */
.leaflet-popup-content-wrapper {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: var(--shadow); padding: 2px;
}
.leaflet-popup-tip { background: var(--surface-2); border: 1px solid var(--line-2); }
.leaflet-popup-content { margin: 12px 14px; font-family: var(--font-body); line-height: 1.45; }
.leaflet-popup-content h4 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 800; font-size: 15px; }
.leaflet-popup-content .pp-meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.leaflet-popup-content .pp-badge {
  display: inline-block; margin: 6px 0 2px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
}
.leaflet-popup-content p { margin: 8px 0 0; font-size: 13px; color: #cdd6e3; }
.leaflet-popup-content a.pp-src { color: var(--aid); font-weight:600; font-size:12.5px; text-decoration:none; }
.leaflet-popup-content a.pp-src:hover { text-decoration: underline; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted) !important; }

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(8,11,18,0.92) 0%, rgba(8,11,18,0.62) 70%, transparent 100%);
  backdrop-filter: blur(10px);
}
.topbar::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--ve-y) 0 33%, var(--ve-b) 33% 66%, var(--ve-r) 66% 100%);
  opacity: .9;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { display: grid; gap: 3px; }
.brand-mark span { display:block; width: 22px; height: 4px; border-radius: 2px; }
.brand-mark span:nth-child(1){ background: var(--ve-y); width: 22px; }
.brand-mark span:nth-child(2){ background: var(--ve-b); width: 15px; }
.brand-mark span:nth-child(3){ background: var(--ve-r); width: 19px; }
.brand-text h1 {
  margin: 0; font-family: var(--font-display); font-weight: 900;
  font-size: 19px; letter-spacing: .04em; line-height: 1;
}
.brand-text h1 .sep { color: var(--sev-rescate); }
.brand-text p { margin: 2px 0 0; font-size: 11px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }

.event-pill {
  margin-left: 4px; display: flex; flex-direction: column; gap: 1px;
  padding: 7px 14px; border-left: 1px solid var(--line);
}
.event-pill strong { font-family: var(--font-mono); font-size: 12.5px; color: #ffd9b0; letter-spacing: .01em; }
.event-pill span { font-size: 11px; color: var(--muted); }

.status { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.live {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: .12em; color: #ff8d6e;
}
.live i { width: 8px; height: 8px; border-radius: 50%; background: #ff5a3c; box-shadow: 0 0 10px 1px #ff5a3c; animation: blink 1.8s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.32} }
.updated { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); }
.updated b { color: var(--text); font-weight: 500; }

/* ============================================================
   Preview ribbon
   ============================================================ */
.preview-ribbon {
  position: fixed; z-index: 510; top: 64px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px; border-radius: 999px;
  background: rgba(244, 193, 82, 0.12); color: var(--ve-y);
  border: 1px solid rgba(244, 193, 82, 0.4);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .08em;
  backdrop-filter: blur(8px);
}
.preview-ribbon .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ve-y); animation: blink 2s infinite; }

/* banderín BETA junto al título */
.beta-tag { display: inline-block; margin-left: 7px; padding: 1px 7px; border-radius: 999px; vertical-align: middle;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .09em;
  background: rgba(244,193,82,0.16); color: var(--ve-y); border: 1px solid rgba(244,193,82,0.45); cursor: help; }

/* toggle claro/oscuro del mapa (arriba-derecha, visible en desktop y móvil) */
.map-theme-toggle { position: fixed; z-index: 503; top: 196px; left: 16px; width: 40px; height: 40px;
  display: grid; place-items: center; border-radius: 12px; cursor: pointer;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2);
  font-size: 17px; line-height: 1; box-shadow: var(--shadow); transition: background .15s; }
.map-theme-toggle:hover { background: #1b2438; }
body.map-light #map::after { display: none; }   /* sin viñeta oscura sobre el mapa claro */

/* popup: nota "sin verificar" de comunidad + dirección visible */
.pp-unver { margin-top: 5px; font-size: 11px; color: var(--sev-dano); font-family: var(--font-mono); }

/* footer: contacto + enlaces legales */
.foot-legal { display: block; width: 100%; font-size: 11px; color: var(--muted-2); line-height: 1.6; margin-top: 2px; }
.foot-legal a { color: var(--muted); text-decoration: none; }
.foot-legal a:hover { color: var(--aid); text-decoration: underline; }

/* aviso del enlace de fuente en los formularios */
.src-hint { font-size: 11px; color: var(--muted-2); line-height: 1.45; margin: -6px 0 6px; }
.src-hint b { color: var(--aid); font-weight: 600; }

/* ============================================================
   Side panel
   ============================================================ */
.panel {
  position: fixed; z-index: 505; top: 78px; right: 18px; bottom: 18px;
  width: 384px; display: flex; flex-direction: column;
  background: var(--surface); backdrop-filter: blur(18px);
  border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: var(--shadow); overflow: hidden;
}
.sheet-handle { display: none; }

.panel-tabs { display: flex; gap: 2px; padding: 8px 8px 0; }
.tab {
  flex: 1; appearance: none; cursor: pointer;
  background: transparent; border: none; color: var(--muted);
  font-family: var(--font-display); font-weight: 700; font-size: 12.5px;
  letter-spacing: .01em; padding: 11px 8px; border-radius: 10px 10px 0 0;
  border-bottom: 2px solid transparent; transition: color .15s, background .15s, border-color .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.tab em { font-style: normal; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,0.06); color: var(--muted); }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--sev-rescate); }
.tab.is-active em { background: color-mix(in srgb, var(--sev-rescate) 22%, transparent); color: #ffd0ad; }

.panel-controls { padding: 12px 12px 8px; border-bottom: 1px solid var(--line); }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px;
  fill: none; stroke: var(--muted-2); stroke-width: 2; stroke-linecap: round; }
.search input {
  width: 100%; padding: 10px 12px 10px 36px; border-radius: 10px;
  background: rgba(0,0,0,0.28); border: 1px solid var(--line);
  color: var(--text); font-family: var(--font-body); font-size: 13px;
}
.search input::placeholder { color: var(--muted-2); }
.search input:focus { outline: none; border-color: color-mix(in srgb, var(--aid) 60%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--aid) 16%, transparent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  cursor: pointer; appearance: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,0.04); color: var(--muted);
  border: 1px solid var(--line); transition: all .14s;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.is-active { background: rgba(255,255,255,0.1); color: var(--text); border-color: var(--line-2); }

/* ---------- list ---------- */
.panel-list { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px; display: flex; flex-direction: column; gap: 9px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.panel-list > * { min-width: 0; max-width: 100%; }
.card-zona, .card-text, .card-estado, .src { overflow-wrap: anywhere; }
.panel-list::-webkit-scrollbar { width: 8px; }
.panel-list::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }

.card {
  position: relative; cursor: pointer; text-align: left;
  appearance: none; -webkit-appearance: none; color: var(--text); font-family: var(--font-body);
  background: rgba(255,255,255,0.025); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 13px 12px 16px;
  transition: transform .14s, border-color .14s, background .14s;
  opacity: 0; transform: translateY(8px);
  animation: rise .5s forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }
.card::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--c, var(--muted)); }
.card:hover { background: rgba(255,255,255,0.055); border-color: var(--line-2); transform: translateX(2px); }

.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card-zona { font-family: var(--font-display); font-weight: 800; font-size: 14.5px; letter-spacing: .005em; color: var(--text); }
.card-estado { font-size: 11px; color: var(--muted-2); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 62%; flex: 0 1 auto; }
.card-badge {
  display: inline-block; margin-top: 7px; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
}
.card-text { margin: 8px 0 0; font-size: 12.5px; color: #c2ccdb; line-height: 1.45; }
.card-foot { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-2); }
.card-foot .src { display: inline-flex; align-items: center; gap: 5px; }
.card-foot .unv { color: var(--ve-y); }
.card-foot .ago { margin-left: auto; }

.needs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.need { font-size: 10.5px; padding: 2px 8px; border-radius: 6px; background: rgba(52,196,214,0.1);
  color: #9fe6f0; border: 1px solid rgba(52,196,214,0.25); font-family: var(--font-mono); }

.panel-foot { padding: 9px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.muted { font-size: 10.5px; color: var(--muted-2); }
.muted.warn { color: color-mix(in srgb, var(--ve-y) 80%, var(--muted)); }

.empty { text-align: center; color: var(--muted-2); font-size: 13px; padding: 36px 16px; }

/* ============================================================
   Legend
   ============================================================ */
.legend {
  position: fixed; z-index: 503; left: 18px; bottom: 18px;
  background: var(--surface); backdrop-filter: blur(16px);
  border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px;
  box-shadow: var(--shadow); min-width: 168px;
}
.legend-title { font-family: var(--font-display); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 8px; }
.legend-row { display: flex; align-items: center; gap: 9px; font-size: 12px; color: #cdd6e3; padding: 2.5px 0; }
.legend-row i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px -1px var(--c); }
.legend-row b { width: 12px; height: 12px; border-radius: 4px; background: color-mix(in srgb, var(--c) 25%, #0b1320); border: 1.5px solid var(--c); }
.legend-sep { height: 1px; background: var(--line); margin: 8px 0; }

.legend-toggle { display: none; position: fixed; z-index: 503; left: 18px; bottom: 18px;
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-2);
  font-family: var(--font-display); font-weight: 800; font-size: 16px; font-style: italic; box-shadow: var(--shadow); }

/* ============================================================
   Responsive — bottom sheet on mobile
   ============================================================ */
@media (max-width: 860px) {
  .event-pill { display: none; }
  .topbar { gap: 10px; padding: 10px 14px; }
  .preview-ribbon { top: 58px; }

  .panel {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%;
    height: 46vh; border-radius: 18px 18px 0 0;
    border-bottom: none; transition: height .3s cubic-bezier(.4,0,.2,1);
  }
  .panel.collapsed { height: 124px; }
  .panel.expanded { height: 86vh; }
  .sheet-handle { display: grid; place-items: center; width: 100%; height: 22px;
    background: transparent; border: none; cursor: pointer; padding-top: 8px; }
  .sheet-handle span { width: 42px; height: 4px; border-radius: 4px; background: var(--line-2); }
  .legend { display: none; }
  .legend.open { display: block; bottom: calc(46vh + 14px); }
  .legend-toggle { display: grid; place-items: center; bottom: calc(46vh + 14px); }
}

/* ============================================================
   Stat strip + Powered by
   ============================================================ */
.topstack { position: fixed; z-index: 504; top: 70px; left: 18px; display: flex; flex-direction: column; gap: 8px; }
.statbar { display: flex; gap: 10px; }

/* ---- Banda: reportar / buscar a un familiar desaparecido (sitio externo dedicado) ----
   Va dentro de .topstack para apilarse sola bajo el statbar. Acento cálido/humano,
   distinto del rojo de "colapso" para no leerse como alarma de peligro. */
.missing-banner {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 14px; border-radius: 12px; text-decoration: none;
  background: var(--surface); backdrop-filter: blur(16px);
  border: 1px solid color-mix(in srgb, #ff9a8b 40%, var(--line-2));
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .12s, background .15s;
}
.missing-banner:hover { border-color: color-mix(in srgb, #ff9a8b 64%, transparent); transform: translateY(-1px); }
.missing-banner:active { transform: scale(.99); }
.mb-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: color-mix(in srgb, #ff9a8b 16%, transparent); color: #ffb0a3; }
.mb-icon svg { width: 19px; height: 19px; }
.mb-text { display: flex; flex-direction: column; gap: 1px; line-height: 1.16; min-width: 0; }
.mb-text b { font-family: var(--font-display); font-weight: 800; font-size: 13.5px; color: var(--text); letter-spacing: .004em; }
.mb-text > span { font-family: var(--font-body); font-size: 11.5px; color: var(--muted); }
.mb-ext { margin-left: auto; flex: none; font-family: var(--font-body); font-size: 17px; color: var(--muted-2); }
.missing-banner:hover .mb-ext { color: var(--text); }
.stat {
  background: var(--surface); backdrop-filter: blur(16px);
  border: 1px solid var(--line-2); border-radius: 12px;
  padding: 9px 16px; min-width: 86px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px;
}
.stat-num { font-family: var(--font-display); font-weight: 900; font-size: 27px; line-height: 1; letter-spacing: -.01em; color: var(--text); }
.stat-label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.stat--crit { border-color: color-mix(in srgb, var(--sev-colapso) 40%, transparent); }
.stat--crit .stat-num { color: var(--sev-colapso); }

.powered {
  position: fixed; z-index: 504; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 15px; border-radius: 999px; text-decoration: none;
  background: var(--surface); backdrop-filter: blur(14px);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.powered:hover { border-color: var(--line-2); transform: translateX(-50%) translateY(-1px); }
.powered span { font-size: 11px; color: var(--muted-2); font-family: var(--font-body); }
.powered img { height: 13px; width: auto; opacity: .92; display: block; }
.powered strong { font-family: var(--font-display); font-weight: 800; font-size: 13.5px; color: var(--text); letter-spacing: .01em; }
.powered--foot { display: none; }

@media (max-width: 860px) {
  .topstack { top: 88px; left: 12px; right: 12px; gap: 7px; }
  .statbar { gap: 7px; }
  /* statbar full-width móvil (y≈88–148) + banda de desaparecidos debajo → el toggle día/noche baja para no solaparse */
  .map-theme-toggle { top: 214px; left: 12px; }
  .stat { min-width: 0; flex: 1; padding: 8px 8px; align-items: center; text-align: center; }
  .stat-num { font-size: 22px; }
  .stat-label { font-size: 8.5px; }
  .powered { display: inline-flex; bottom: 70px; padding: 6px 12px; gap: 6px; }
  .powered span { font-size: 10px; }
  .powered img { height: 11px; }
  .powered strong { font-size: 11.5px; }
  .powered--foot {
    display: inline-flex; position: static; transform: none; bottom: auto; left: auto;
    margin-top: 9px; padding: 4px 0; background: transparent; border: none; box-shadow: none;
  }
  .powered--foot:hover { transform: none; }
}

/* ============================================================
   State filter (select)
   ============================================================ */
.state-select { position: relative; margin-top: 9px; }
.state-select select {
  width: 100%; appearance: none; cursor: pointer;
  padding: 9px 36px 9px 12px; border-radius: 10px;
  background: rgba(0,0,0,0.28); border: 1px solid var(--line);
  color: var(--text); font-family: var(--font-body); font-size: 13px;
}
.state-select::after {
  content: ""; position: absolute; right: 14px; top: 46%; width: 7px; height: 7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-50%) rotate(45deg); pointer-events: none;
}
.state-select select:focus { outline: none; border-color: color-mix(in srgb, var(--aid) 60%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--aid) 16%, transparent); }
.state-select option { background: #141b2c; color: var(--text); }

/* ============================================================
   Share button
   ============================================================ */
.share-btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 8px 13px; border-radius: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid var(--line-2);
  transition: background .14s, border-color .14s;
}
.share-btn:hover { background: rgba(255,255,255,0.13); }
.share-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================
   Detail drawer
   ============================================================ */
/* drawer SIN oscurecer ni difuminar el mapa (queda nítido y usable) */
.drawer-backdrop { display: none; }

/* botón "Más información" dentro del popup pequeño */
.pp-more {
  display: block; width: 100%; margin-top: 11px; cursor: pointer;
  padding: 7px 10px; border-radius: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--line-2);
  transition: background .14s, border-color .14s;
}
.pp-more:hover { background: rgba(255,255,255,0.16); border-color: var(--muted); }
.leaflet-popup-content .pp-text { margin: 8px 0 0; font-size: 12.5px; color: #cdd6e3; line-height: 1.45; }
.drawer {
  position: fixed; z-index: 601; top: 0; right: 0; height: 100%;
  width: 424px; max-width: 92vw;
  background: var(--surface-2); border-left: 1px solid var(--line-2);
  box-shadow: -30px 0 70px -24px rgba(0,0,0,0.8);
  transform: translateX(101%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; overflow: hidden;
}
.drawer.open { transform: none; }
.drawer-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line);
  color: var(--muted); font-size: 16px; line-height: 1; transition: all .14s;
}
.drawer-close:hover { color: var(--text); background: rgba(255,255,255,0.13); }

.dr-head { padding: 30px 24px 20px; border-bottom: 1px solid var(--line); border-top: 3px solid var(--c, var(--muted)); }
.dr-kicker { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: .03em; }
.dr-head h2 { margin: 7px 0 0; font-family: var(--font-display); font-weight: 900; font-size: 25px; letter-spacing: -.01em; line-height: 1.1; }
.dr-badge {
  display: inline-block; margin-top: 13px; padding: 4px 13px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c);
  border: 1px solid color-mix(in srgb, var(--c) 42%, transparent);
}
.dr-scroll { flex: 1; overflow-y: auto; padding: 22px 24px 30px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.dr-text { margin: 0; font-size: 15px; line-height: 1.6; color: #d4dce8; }
.dr-warn {
  margin-top: 18px; padding: 12px 14px; border-radius: 10px;
  background: rgba(244,193,82,0.1); border: 1px solid rgba(244,193,82,0.32);
  color: color-mix(in srgb, var(--ve-y) 88%, #fff); font-size: 12.5px; line-height: 1.5;
}
.dr-warn b { color: var(--ve-y); }
.dr-section { margin-top: 24px; }
.dr-section h4 { margin: 0 0 11px; font-family: var(--font-display); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.dr-sources { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dr-sources a {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line);
  color: #cdd6e3; text-decoration: none; font-size: 13px; transition: all .14s;
}
.dr-sources a:hover { border-color: var(--line-2); background: rgba(255,255,255,0.06); }
.dr-sources .plat { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-2); margin-left: auto; }
.dr-needs { display: flex; flex-wrap: wrap; gap: 7px; }
.dr-coords { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed; z-index: 700; bottom: 74px; left: 50%;
  transform: translateX(-50%) translateY(12px); opacity: 0; visibility: hidden;
  padding: 11px 18px; border-radius: 999px;
  background: #1b2438; border: 1px solid var(--line-2); color: var(--text);
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%); }

@media (max-width: 860px) {
  .share-btn span { display: none; }
  .share-btn { padding: 8px; }
  .drawer {
    top: auto; bottom: 0; right: 0; left: 0; width: 100%; max-width: none; height: 84vh;
    border-left: none; border-top: 1px solid var(--line-2); border-radius: 18px 18px 0 0;
    transform: translateY(101%); box-shadow: 0 -30px 70px -24px rgba(0,0,0,0.8);
  }
  .drawer.open { transform: none; }
  .toast { bottom: 50vh; }
}

/* ============================================================
   Internacional: países, arcos, tooltips, stat dorado
   ============================================================ */
:root { --gold: #f5c542; }

.stat--gold { border-color: color-mix(in srgb, var(--gold) 36%, transparent); }
.stat--gold .stat-num { color: var(--gold); }

.mk-pais {
  display: grid; place-items: center; width: 34px; height: 34px; font-size: 17px; line-height: 1;
  background: color-mix(in srgb, var(--gold) 20%, #161106);
  border: 1.5px solid var(--gold); border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 16%, transparent), 0 0 16px -2px color-mix(in srgb, var(--gold) 70%, transparent);
}
.mk-dest {
  background: color-mix(in srgb, var(--sev-colapso) 22%, #160a0a); border-color: var(--sev-colapso);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--sev-colapso) 18%, transparent), 0 0 18px -2px var(--sev-colapso);
}
.mk-aid.mk-user { border-style: dashed; border-color: var(--gold); color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, #14110a); }

/* "Reportes varios": pin neutro slate con glifo de documento y borde punteado
   (= ubicación aproximada, no un punto físico confirmado como acopio/país/evento). */
.mk-zvarios {
  position: relative; display: grid; place-items: center;
  width: 32px; height: 32px;
  background: color-mix(in srgb, #94a3b8 22%, #0b1320);
  border: 1.5px dashed #94a3b8; border-radius: 50%;
  color: #cbd5e1;
  box-shadow: 0 6px 16px -6px rgba(0,0,0,.7), 0 0 14px -3px color-mix(in srgb, #94a3b8 60%, transparent);
}
.mk-zvarios svg { width: 15px; height: 15px; }
.mk-zvarios-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 16px; height: 16px; padding: 0 3px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; line-height: 1;
  color: #0b1320; background: #94a3b8; border-radius: 9px;
  box-shadow: 0 0 0 1.5px #0b1320;
}
.dr-sub { font-size: 13px; color: var(--muted-2); margin: 0 0 10px; line-height: 1.45; }

.arc-line { stroke-dasharray: 5 9; animation: arcflow 1.1s linear infinite; }
@keyframes arcflow { to { stroke-dashoffset: 14; } } /* flujo país -> Venezuela */

.leaflet-tooltip.mk-tip { background: #141b2c; border: 1px solid var(--line-2); color: var(--text); font-family: var(--font-mono); font-size: 10.5px; box-shadow: var(--shadow); padding: 3px 8px; }
.leaflet-tooltip-top.mk-tip::before { border-top-color: #141b2c; }

.list-section { font-family: var(--font-display); font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 12px 4px 4px; }
.list-section:first-child { padding-top: 2px; }

/* 3 tabs fit */
.panel-tabs .tab { font-size: 12px; padding: 11px 5px; gap: 5px; }
.panel-tabs .tab em { padding: 1px 6px; }

/* ============================================================
   Add centro (comunidad) + modal
   ============================================================ */
.add-centro {
  display: none; width: 100%; margin-top: 10px; cursor: pointer;
  padding: 10px; border-radius: 10px; font-family: var(--font-display); font-weight: 700; font-size: 12.5px;
  background: color-mix(in srgb, var(--aid) 14%, transparent); color: var(--aid);
  border: 1px dashed color-mix(in srgb, var(--aid) 50%, transparent); transition: background .14s, border-color .14s;
}
.add-centro:hover { background: color-mix(in srgb, var(--aid) 22%, transparent); border-color: var(--aid); }

.modal-backdrop { position: fixed; inset: 0; z-index: 650; background: rgba(4,6,11,0.6); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .22s, visibility .22s; }
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  position: fixed; z-index: 651; top: 50%; left: 50%; transform: translate(-50%, -48%) scale(.98);
  width: 444px; max-width: 94vw; max-height: 90vh; overflow-y: auto;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: var(--shadow); padding: 26px 24px;
  opacity: 0; visibility: hidden; transition: opacity .22s, transform .22s, visibility .22s;
}
.modal.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.modal-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 9px; cursor: pointer; background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.13); }
.modal h3 { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 21px; }
.modal-sub { margin: 7px 0 18px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.modal label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 13px; font-weight: 600; }
.modal input, .modal select { display: block; width: 100%; margin-top: 6px; padding: 9px 11px; border-radius: 9px; background: rgba(0,0,0,0.28); border: 1px solid var(--line); color: var(--text); font-family: var(--font-body); font-size: 13px; }
.modal input:focus, .modal select:focus { outline: none; border-color: color-mix(in srgb, var(--aid) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--aid) 16%, transparent); }
.modal-submit { width: 100%; margin-top: 4px; padding: 12px; border-radius: 10px; cursor: pointer; border: none; background: var(--aid); color: #042027; font-family: var(--font-display); font-weight: 800; font-size: 13.5px; transition: filter .14s; }
.modal-submit:hover { filter: brightness(1.08); }
.modal-submit:disabled { opacity: .6; cursor: wait; }

/* opciones de los <select> dentro del modal (dropdown oscuro) */
.modal select option { background: var(--surface-2); color: var(--text); }

/* fila de teléfono: prefijo +58 fijo / selector de código + número */
.modal .tel-row { display: flex; gap: 8px; margin-top: 6px; align-items: stretch; }
.modal .tel-row input { margin-top: 0; flex: 1; min-width: 0; }
.modal .tel-row .tel-prefix {
  display: inline-flex; align-items: center; flex: none; white-space: nowrap;
  padding: 9px 13px; border-radius: 9px;
  background: rgba(0,0,0,0.28); border: 1px solid var(--line);
  color: var(--text); font-family: var(--font-mono); font-size: 13px;
}
.modal .tel-row select.tel-dial { margin-top: 0; width: auto; flex: none; max-width: 48%; padding-right: 28px; }

/* botón + modal del punto internacional (tema dorado, igual layout que el nacional) */
.add-intl { background: color-mix(in srgb, var(--gold) 12%, transparent); color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.add-intl:hover { background: color-mix(in srgb, var(--gold) 20%, transparent); border-color: var(--gold); }

@media (max-width: 860px) {
  .statbar .stat { padding: 7px 5px; }
  .stat-label { line-height: 1.15; }
  .modal { top: auto; bottom: 0; left: 0; transform: translateY(101%); width: 100%; max-width: none; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .modal.open { transform: none; }
}

/* ============================================================
   Clusters de eventos + acopio por tipo (color/ícono)
   ============================================================ */
.mk-cluster {
  position: relative; display: grid; place-items: center;
  width: var(--s, 44px); height: var(--s, 44px); border-radius: 50%;
  color: #fff; font-family: var(--font-display); font-weight: 800;
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--c) 80%, #000) 0%, color-mix(in srgb, var(--c) 48%, #0a0e17) 100%);
  border: 2px solid color-mix(in srgb, var(--c) 80%, #fff);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 20%, transparent), 0 0 22px -2px var(--c);
}
.mk-cluster b { font-size: calc(var(--s, 44px) * 0.36); line-height: 1; }
.mk-cluster.mk-cluster-aid { border-radius: 30%; }
.leaflet-cluster-spider-leg { stroke: rgba(255,255,255,0.25); }

/* acopio coloreado por tipo (var --c inline) */
.mk-aid {
  background: color-mix(in srgb, var(--c, #34c4d6) 22%, #0b1320);
  border-color: var(--c, #34c4d6); color: var(--c, #34c4d6);
  box-shadow: 0 6px 16px -6px rgba(0,0,0,.7), 0 0 14px -2px color-mix(in srgb, var(--c, #34c4d6) 60%, transparent);
}
.mk-aid.mk-user {
  border-style: dashed; border-color: var(--c, #34c4d6); color: var(--c, #34c4d6);
  background: color-mix(in srgb, var(--c, #34c4d6) 16%, #0b1320);
}

/* encabezado de localidad en la lista de zonas */
.list-section.loc {
  display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: .005em;
  font-family: var(--font-display); font-weight: 800; font-size: 13.5px; color: var(--text); padding: 15px 4px 7px;
}
.list-section.loc:first-child { padding-top: 4px; }
.list-section.loc i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px -1px var(--c); flex: none; }
.list-section.loc em { font-style: normal; margin-left: auto; font-family: var(--font-mono); font-weight: 500; font-size: 11px; color: var(--muted); text-transform: none; letter-spacing: 0; }

/* ============================================================
   Móvil: panel oculto por defecto + botón hamburguesa
   ============================================================ */
.menu-fab {
  display: none; position: fixed; z-index: 506; bottom: 18px; left: 50%; transform: translateX(-50%);
  align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2);
  font-family: var(--font-display); font-weight: 700; font-size: 13px; box-shadow: var(--shadow);
}
.menu-fab svg { width: 18px; height: 18px; }
.menu-fab:active { transform: translateX(-50%) scale(.97); }

@media (max-width: 860px) {
  .panel {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: 84vh;
    border-radius: 20px 20px 0 0; border-bottom: none;
    transform: translateY(100%); transition: transform .32s cubic-bezier(.4,0,.2,1);
  }
  .panel.open { transform: none; }
  .panel.collapsed, .panel.expanded { height: 84vh; }   /* anular estados viejos */
  .menu-fab { display: inline-flex; }
  .menu-fab.hidden { display: none; }
  .legend-toggle { bottom: 18px; left: 18px; }
  .legend.open { bottom: 70px; left: 18px; display: block; }
}

/* ============================================================
   Stats clicables + X cerrar lista + refresh
   ============================================================ */
.statbar button.stat { appearance: none; -webkit-appearance: none; font-family: var(--font-body); cursor: pointer; transition: border-color .14s, transform .12s; }
.statbar button.stat:hover { border-color: var(--line-2); }
.statbar button.stat:active { transform: scale(.96); }

.panel-close { display: none; }

.refresh-btn.spin svg { animation: spin .75s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .status { gap: 10px; }
  .upd-word { display: none; }
  .panel-close {
    display: grid; place-items: center; position: absolute; top: 11px; right: 14px; z-index: 4;
    width: 32px; height: 32px; border-radius: 9px; cursor: pointer;
    background: rgba(255,255,255,0.07); border: 1px solid var(--line-2); color: var(--text); font-size: 15px;
  }
}

/* ============================================================
   Banderines (flagcdn) + ficha del drawer + textarea
   ============================================================ */
.flag-sm { width: 18px; height: 12px; border-radius: 2px; object-fit: cover; vertical-align: -1px; margin-right: 3px; display: inline-block; box-shadow: 0 0 0 1px rgba(255,255,255,0.15); }
.flag-md { width: 28px; height: 19px; border-radius: 3px; object-fit: cover; vertical-align: -4px; margin-right: 6px; box-shadow: 0 0 0 1px rgba(255,255,255,0.18); }
.mk-pais .flag-mk { width: 22px; height: 15px; border-radius: 3px; object-fit: cover; display: block; box-shadow: 0 0 0 1px rgba(255,255,255,0.2); }

.dr-fields { margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dr-field { display: flex; gap: 12px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.dr-field:last-child { border-bottom: none; }
.dr-flabel { flex: none; width: 112px; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.dr-fval { font-size: 13.5px; color: var(--text); line-height: 1.4; }
.dr-tel { color: var(--aid); text-decoration: none; font-weight: 600; }
.dr-tel:hover { text-decoration: underline; }

.modal textarea {
  display: block; width: 100%; margin-top: 6px; padding: 9px 11px; border-radius: 9px;
  background: rgba(0,0,0,0.28); border: 1px solid var(--line); color: var(--text);
  font-family: var(--font-body); font-size: 13px; resize: vertical; min-height: 64px;
}
.modal textarea:focus { outline: none; border-color: color-mix(in srgb, var(--aid) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--aid) 16%, transparent); }

/* ============================================================
   Sub-tabs de Ayuda (Nacional / Internacional)
   ============================================================ */
.subtabs { display: none; gap: 6px; padding: 2px 12px 4px; }
.subtab {
  appearance: none; -webkit-appearance: none; cursor: pointer; flex: 1;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line); color: var(--muted);
  font-family: var(--font-display); font-weight: 700; font-size: 11.5px; letter-spacing: .01em;
  padding: 8px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: color .14s, background .14s, border-color .14s;
}
.subtab em { font-style: normal; font-family: var(--font-mono); font-weight: 600; font-size: 10px; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,0.06); color: var(--muted); }
.subtab:hover { color: var(--text); border-color: var(--line-2); }
.subtab.is-active { color: var(--text); background: color-mix(in srgb, var(--aid) 14%, transparent); border-color: color-mix(in srgb, var(--aid) 45%, transparent); }
.subtab.is-active em { background: color-mix(in srgb, var(--aid) 22%, transparent); color: #bdeff6; }

/* evento reportado por la comunidad (marcador punteado) + botón reportar */
.mk-report.mk-userev { border-style: dashed; }
.add-evento { background: color-mix(in srgb, var(--sev-rescate) 12%, transparent); color: var(--sev-rescate); border-color: color-mix(in srgb, var(--sev-rescate) 45%, transparent); }
.add-evento:hover { background: color-mix(in srgb, var(--sev-rescate) 20%, transparent); border-color: var(--sev-rescate); }

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

/* ---- Corroboración comunitaria (confirmar / reportar) ---- */
.cor-box { margin-top: 24px; }
.cor-counts { display: flex; gap: 16px; margin: 0 0 13px; font-size: 12.5px; font-weight: 700; }
.cor-counts .cor-c { color: var(--sev-sin); }
.cor-counts .cor-r { color: var(--ve-r); }
.cor-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.cor-btn { flex: 1 1 auto; min-width: 142px; padding: 11px 12px; border-radius: 10px; cursor: pointer;
  font-family: var(--font-display); font-weight: 800; font-size: 12.5px; transition: filter .14s, background .14s; }
.cor-yes { background: color-mix(in srgb, var(--sev-sin) 16%, transparent); color: var(--sev-sin);
  border: 1px solid color-mix(in srgb, var(--sev-sin) 42%, transparent); }
.cor-yes:hover { background: color-mix(in srgb, var(--sev-sin) 26%, transparent); }
.cor-no { background: color-mix(in srgb, var(--ve-r) 13%, transparent); color: color-mix(in srgb, var(--ve-r) 90%, #fff);
  border: 1px solid color-mix(in srgb, var(--ve-r) 38%, transparent); }
.cor-no:hover { background: color-mix(in srgb, var(--ve-r) 23%, transparent); }
.cor-done { padding: 11px 13px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--line-2); color: var(--text); font-size: 12.5px; font-weight: 600; }
.cor-help { margin: 11px 0 0; font-size: 11px; color: var(--muted-2); line-height: 1.5; }
.cor-help b { color: var(--muted); }

/* ---- Epicentro del sismo (USGS) ---- */
.mk-epi { position: relative; width: 20px; height: 20px; }
.mk-epi .epi-core { position: absolute; inset: 0; margin: auto; width: 11px; height: 11px; border-radius: 50%;
  background: #fff; border: 2px solid #0b0f1a; box-shadow: 0 0 0 2px #fff, 0 2px 9px rgba(0,0,0,.7); }
.mk-epi .epi-wave { position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.92); animation: epiPulse 2.4s ease-out infinite; }
.mk-epi .epi-wave-2 { animation-delay: 1.2s; }
@keyframes epiPulse { 0% { transform: scale(.42); opacity: .95; } 100% { transform: scale(3.6); opacity: 0; } }
.mk-epi .epi-tag { position: absolute; top: 50%; transform: translateY(-50%); white-space: nowrap;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 800; color: #0b0f1a; background: #fff;
  padding: 1px 6px; border-radius: 6px; box-shadow: 0 2px 7px rgba(0,0,0,.55); }
.mk-epi .epi-tag-right { left: 17px; }
.mk-epi .epi-tag-left  { right: 17px; }
@media (prefers-reduced-motion: reduce) { .mk-epi .epi-wave { animation: none; opacity: .4; } }
.pp-badge.pp-epi { background: #fff; color: #0b0f1a; }
.dr-head.dr-head-epi { --c: #e8eef6; }
.legend-epi { display: inline-block; width: 13px; height: 13px; border-radius: 50%; background: #fff;
  border: 2px solid #0b0f1a; box-shadow: 0 0 0 2px rgba(255,255,255,.45); }

/* ---- Toggle del panel en DESKTOP (ocultar/mostrar la lista para ver mejor el mapa) ---- */
@media (min-width: 861px) {
  .panel { transition: transform .32s cubic-bezier(.4,0,.2,1), opacity .25s; }
  .panel.hidden { transform: translateX(calc(100% + 30px)); opacity: 0; pointer-events: none; }
  .panel-tabs { padding-right: 42px; }   /* deja sitio al ✕ */
  .panel-close {
    display: grid; place-items: center; position: absolute; top: 9px; right: 10px; z-index: 6;
    width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
    background: rgba(255,255,255,0.06); border: 1px solid var(--line-2); color: var(--muted); font-size: 13px;
    transition: color .14s, background .14s;
  }
  .panel-close:hover { color: var(--text); background: rgba(255,255,255,0.12); }
  body.panel-off .menu-fab { display: inline-flex; left: auto; right: 18px; bottom: 18px; transform: none; }
  body.panel-off .menu-fab:active { transform: scale(.97); }
}

/* ---- Autocompletado de dirección (Photon/OSM) — pin exacto por dirección ---- */
.ac-list { position: fixed; z-index: 9999; max-height: 250px; overflow-y: auto;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); }
.addr-input { padding-left: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a0b4' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M21 21l-4.3-4.3M11 19a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: 11px center !important; background-size: 15px !important;
  border-color: color-mix(in srgb, var(--aid) 45%, var(--line-2)) !important; }
.addr-hint { margin-top: 5px; font-size: 11px; color: var(--muted-2); line-height: 1.4; }
.addr-hint b { color: var(--aid); font-weight: 600; }
.ac-item { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: rgba(255,255,255,0.07); }
.ac-item b { display: block; font-size: 13px; color: var(--text); font-weight: 600; line-height: 1.25; }
.ac-item span { display: block; font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 1px; }

/* ---- Mini-mapa con pin arrastrable (confirmar/ajustar la ubicación exacta) ---- */
.mini-map-wrap { margin: -5px 0 13px; }
.mini-map-hint { font-size: 11px; color: var(--muted-2); line-height: 1.45; margin-bottom: 7px; }
.mini-map-hint b { color: var(--aid); font-weight: 600; }
.mini-map {
  width: 100%; height: 300px; border-radius: 11px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--aid) 38%, var(--line-2));
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
}
.mini-map .leaflet-container { background: #0b1320; font-family: var(--font-body); }
.mini-map .leaflet-control-zoom { box-shadow: 0 4px 14px -6px rgba(0,0,0,.7) !important; }
.mini-map .leaflet-control-zoom a { width: 26px; height: 26px; line-height: 26px; font-size: 16px; }

/* pin teardrop arrastrable (la punta marca el punto que se guarda) */
.mini-pin { position: relative; width: 28px; height: 36px; cursor: grab; }
.mini-pin:active { cursor: grabbing; }
.mini-pin::before {
  content: ""; position: absolute; left: 2px; top: 1px; width: 24px; height: 24px;
  background: var(--aid); border: 2px solid #fff; border-radius: 50% 50% 50% 0;
  transform: rotate(45deg); box-shadow: 0 6px 12px -3px rgba(0,0,0,.75);
}
.mini-pin::after {
  content: ""; position: absolute; left: 50%; top: 9px; width: 8px; height: 8px;
  border-radius: 50%; background: #06222a; transform: translateX(-50%);
}

/* ============================================================
   Editar/borrar mi aporte + motivo de reporte (migration-008/009)
   ============================================================ */
/* aviso "estás editando" arriba del form */
.edit-note {
  margin: 0 0 16px; padding: 10px 13px; border-radius: 10px;
  background: color-mix(in srgb, var(--ve-b) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--ve-b) 42%, transparent);
  color: color-mix(in srgb, var(--ve-b) 88%, #fff);
  font-size: 12.5px; font-weight: 600; line-height: 1.45;
}

/* bloque "Tu aporte" en el drawer */
.mine-box { margin-top: 24px; }
.mine-help { margin: 0 0 11px; font-size: 11.5px; color: var(--muted-2); line-height: 1.5; }
.mine-locked { margin: 0; padding: 11px 13px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--line-2); color: var(--muted); font-size: 12.5px; font-weight: 600; line-height: 1.45; }
.mine-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.mine-btn { flex: 1 1 auto; min-width: 130px; padding: 11px 12px; border-radius: 10px; cursor: pointer;
  font-family: var(--font-display); font-weight: 800; font-size: 12.5px; transition: filter .14s, background .14s; }
.mine-edit { background: color-mix(in srgb, var(--ve-b) 15%, transparent); color: color-mix(in srgb, var(--ve-b) 92%, #fff);
  border: 1px solid color-mix(in srgb, var(--ve-b) 42%, transparent); }
.mine-edit:hover { background: color-mix(in srgb, var(--ve-b) 26%, transparent); }
.mine-del { background: color-mix(in srgb, var(--ve-r) 12%, transparent); color: color-mix(in srgb, var(--ve-r) 90%, #fff);
  border: 1px solid color-mix(in srgb, var(--ve-r) 36%, transparent); }
.mine-del:hover { background: color-mix(in srgb, var(--ve-r) 22%, transparent); }

/* motivo opcional al reportar (campito inline dentro del cor-box) */
.cor-motivo { margin-top: 11px; }
.cor-mlabel { display: block; margin: 0 0 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.cor-mlabel span { color: var(--muted-2); font-weight: 500; }
.cor-minput { width: 100%; resize: vertical; min-height: 48px; padding: 9px 11px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  font-family: var(--font-body); font-size: 13px; line-height: 1.45; }
.cor-minput:focus { outline: none; border-color: color-mix(in srgb, var(--ve-r) 45%, var(--line-2)); }
.cor-mactions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 9px; }
.cor-cancel { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-2); }
.cor-cancel:hover { background: rgba(255,255,255,0.07); color: var(--text); }

/* ============================================================
   Serial visible (id corto) para ubicar/editar/borrar una fila
   ============================================================ */
.card-serial { margin-left: auto; font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em;
  color: var(--muted-2); white-space: nowrap; }
.dr-serial { font-family: var(--font-mono); font-weight: 700; color: var(--muted); letter-spacing: .04em; }

/* ============================================================
   FIX scroll del drawer en móvil: #drawer-content (que contiene dr-head + dr-scroll)
   era display:block → el flex:1 del .dr-scroll no aplicaba y el contenido se
   desbordaba bajo el drawer (recortado por overflow:hidden). Lo hacemos flex-column
   constreñido para que .dr-scroll llene la altura disponible y scrollee.
   ============================================================ */
#drawer-content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dr-scroll { min-height: 0; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

/* ============================================================
   ===== Onboarding ===== (bienvenida-hub + tour spotlight)
   ============================================================ */
.ob-veil { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.ob-veil[hidden] { display: none; }
.ob-hole {
  position: fixed; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(4, 7, 12, 0.74), 0 0 0 2px var(--gold) inset;
  transition: top .25s, left .25s, width .25s, height .25s;
}
.ob-bubble {
  position: fixed; z-index: 1010; pointer-events: auto;
  max-width: min(330px, calc(100vw - 24px));
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: var(--shadow); padding: 16px 16px 12px; color: var(--text);
}
.ob-bubble h3 { font-family: var(--font-display); font-weight: 800; font-size: 16px; margin: 0 0 6px; }
.ob-bubble p { font-family: var(--font-body); font-size: 13.5px; line-height: 1.45; color: var(--muted); margin: 0; }
.ob-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
/* --- Task 2: tour controls --- */
.ob-foot { flex-direction: column; align-items: stretch; gap: 10px; }
.ob-nav { display: flex; align-items: center; gap: 8px; }
.ob-prog { font-family: var(--font-mono); font-size: 12px; color: var(--muted-2); margin-right: auto; }
.ob-frame { font-family: var(--font-mono); font-size: 11px; color: var(--gold); text-transform: uppercase; letter-spacing: .06em; margin-right: 8px; }
.ob-btn { min-height: 44px; padding: 0 16px; border-radius: 10px; font-family: var(--font-body); font-weight: 600; font-size: 14px; cursor: pointer; border: 1px solid var(--line-2); }
.ob-next { background: var(--gold); color: #1a1206; border-color: transparent; }
.ob-ghost { background: transparent; color: var(--text); }
.ob-cta { width: 100%; background: color-mix(in srgb, #ff9a8b 18%, transparent); color: #ffb0a3; border-color: color-mix(in srgb, #ff9a8b 40%, var(--line-2)); }
.ob-skip { min-height: 44px; width: 100%; background: transparent; border: 0; color: var(--muted); font-family: var(--font-body); font-size: 14px; cursor: pointer; text-decoration: underline; }
.ob-btn:focus-visible, .ob-skip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ob-hole { transition: none; } }
/* --- Task 3: modal de bienvenida-hub --- */
.ob-wbackdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(4,7,12,0.7); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 18px; }
.ob-wbackdrop[hidden] { display: none; }
.ob-wcard { z-index: 1010; width: min(420px, 100%); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); padding: 22px 20px 16px; color: var(--text);
  background: linear-gradient(180deg, rgba(8,11,18,0.70) 0%, rgba(8,11,18,0.80) 48%, rgba(8,11,18,0.95) 100%), url("./welcome-bomberos.jpg") 50% 30%/cover no-repeat var(--surface-2); }
.ob-wcard h2 { font-family: var(--font-display); font-weight: 800; font-size: 18px; line-height: 1.25; margin: 0 0 8px; text-shadow: 0 1px 4px rgba(0,0,0,0.75); }
.ob-wcard #ob-w-sub { font-family: var(--font-body); font-size: 14px; color: #dce3ee; margin: 0 0 16px; line-height: 1.45; text-shadow: 0 1px 3px rgba(0,0,0,0.7); }
.ob-wflag { display: block; width: 48px; height: 32px; border-radius: 4px; margin: 0 0 12px; border: 1px solid rgba(255,255,255,0.22); box-shadow: 0 2px 9px rgba(0,0,0,0.5);
  background: url("./flag-ve.svg") center/cover no-repeat; }
.ob-wacts { display: flex; flex-direction: column; gap: 9px; }
.ob-wbtn { min-height: 48px; padding: 0 16px; border-radius: 12px; text-align: left; font-family: var(--font-body); font-weight: 600; font-size: 15px; cursor: pointer; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); }
.ob-wprimary { background: color-mix(in srgb, #ff9a8b 18%, transparent); border-color: color-mix(in srgb, #ff9a8b 42%, var(--line-2)); }
.ob-wfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.ob-wtour { flex: 1; min-height: 48px; padding: 0 20px; background: var(--gold); color: #1a1206; border: none; border-radius: 12px; font-family: var(--font-body); font-size: 15px; font-weight: 700; cursor: pointer; }
.ob-wskip { min-height: 44px; padding: 0 14px; background: transparent; border: 1px solid var(--line-2); border-radius: 10px; color: var(--muted); font-family: var(--font-body); font-size: 14px; cursor: pointer; }
/* --- Task 4: botón "?" de re-acceso --- */
#ob-help {
  position: fixed; z-index: 506; top: 244px; left: 16px; width: 44px; height: 44px;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  font-family: var(--font-display); font-weight: 800; font-size: 18px; box-shadow: var(--shadow);
}
#ob-help:hover { background: #1b2438; }
#ob-help:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 860px) { #ob-help { top: 262px; left: 12px; } }
.ob-wbtn:focus-visible, .ob-wtour:focus-visible, .ob-wskip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
