html, body, #map { height: 100%; margin: 0; }
body { font-family: system-ui, sans-serif; }
/* --ui: escala del texto de la interfaz (botones A−/A+ del panel). */
:root { --ui: 1.3; }
#map.leaflet-container { font-size: calc(12px * var(--ui)); }
#menu-btn {
  position: absolute; top: 10px; right: 10px; z-index: 1001;
  width: 44px; height: 44px; font-size: 24px; line-height: 1; cursor: pointer;
  background: #fff; border: none; border-radius: 6px; box-shadow: 0 1px 5px rgba(0,0,0,.4);
}
#menu-btn:hover { background: #f4f4f4; }
#panel {
  position: absolute; top: 60px; right: 10px; z-index: 1000;
  max-height: calc(100% - 80px); max-width: calc(100% - 20px); box-sizing: border-box; overflow-y: auto;
  background: #fff; padding: 8px 12px; border-radius: 6px;
  box-shadow: 0 1px 5px rgba(0,0,0,.4); font-size: 14px;
}
#panel[hidden] { display: none; }
#panel > *, #alerts > * { zoom: var(--ui); }
#size-ctl button { min-width: 2.2em; cursor: pointer; }
#size-val { display: inline-block; min-width: 3em; text-align: center; font-variant-numeric: tabular-nums; }
#sources { margin-top: 6px; }
.source { display: block; cursor: pointer; margin: 6px 0; }
.source .name { font-weight: 600; }
.source .count { color: #555; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.source .updated { color: #333; font-size: 16px; font-weight: 600; margin-left: 22px; }
#error { color: #b00020; font-size: 12px; }
#clock { font-size: 18px; font-variant-numeric: tabular-nums; }
#alerts {
  position: absolute; top: 10px; left: 50px; bottom: 30px; width: min(calc(340px * var(--ui)), calc(100% - 60px)); z-index: 1000;
  background: #fff; border-radius: 6px; box-shadow: 0 1px 5px rgba(0,0,0,.4);
  display: flex; flex-direction: column; font-size: 13px;
}
#alerts[hidden] { display: none; }
#alerts h2 { margin: 0; padding: 8px 12px; font-size: 15px; border-bottom: 1px solid #ddd; }
#alerts h2 { display: flex; align-items: center; gap: 6px; }
#alerts-close {
  margin-left: auto; width: 28px; height: 28px; padding: 0; font-size: 16px; line-height: 1;
  background: none; border: none; border-radius: 4px; cursor: pointer; color: #555;
}
#alerts-close:hover { background: #eee; color: #000; }
#alerts-search { margin: 8px 12px; padding: 5px 8px; font-size: 14px; box-sizing: border-box; }
#alerts .empty { color: #666; font-style: italic; }
#alerts ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
#alerts ul { background: #f0f0f0; padding: 6px; }
#alerts li { padding: 8px 12px; margin-bottom: 6px; background: #fff; border-radius: 4px; border-left: 5px solid #bdbdbd; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
#alerts li.empty { border-left-color: transparent; box-shadow: none; background: none; }
#alerts li.locatable { cursor: pointer; border-left-color: #f9a825; }
#alerts li.locatable:hover { background: #fff8e1; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
#alerts li.locatable.selected { background: #ffecb3; outline: 2px solid #f9a825; }
#alerts li.no-map { color: #666; }
#alerts .tag { margin-top: 6px; font-size: 11px; font-weight: 600; }
#alerts li.locatable .tag { color: #b26a00; }
#alerts li.no-map .tag { color: #888; font-weight: 400; }
#alerts .when { color: #666; font-size: 11px; }
#alerts mark { background: #ffeb3b; color: inherit; padding: 0 1px; border-radius: 2px; }
#alerts p { margin: 2px 0 0; }
@media (max-width: 700px) { #alerts { width: auto; right: 10px; left: 10px; top: auto; height: 40%; } }
.option { display: block; margin-top: 8px; cursor: pointer; }
.option + .option { margin-top: 4px; }
.flecha {
  width: 0; height: 0; margin: 0 auto;
  border-left: calc(var(--s) / 2) solid transparent; border-right: calc(var(--s) / 2) solid transparent;
  border-bottom: var(--s) solid var(--c);
}
@keyframes flujo { to { stroke-dashoffset: -32; } }
.linea-destino { animation: flujo 1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .linea-destino { animation: none; } }
#search-box { position: relative; margin-top: 8px; }
#search { box-sizing: border-box; width: 100%; padding: 5px 8px; font-size: 14px; }
#suggestions {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 1001; margin: 2px 0 0; padding: 0;
  list-style: none; background: #fff; border: 1px solid #ccc; border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,.3); max-height: 260px; overflow-y: auto;
}
#suggestions[hidden] { display: none; }
#suggestions li { padding: 5px 8px; cursor: pointer; }
#suggestions li.active, #suggestions li:hover { background: #e3f2fd; }
#suggestions .kind { color: #777; font-size: 11px; margin-left: 6px; }
#suggestions .n { float: right; color: #555; font-size: 12px; }
.leaflet-tooltip.leaflet-interactive { cursor: pointer; }
.leaflet-tooltip-pane { z-index: 590; }
#area { margin-top: 8px; }
#area-count { font-weight: 600; margin-bottom: 4px; }
#area-scroll { max-height: 200px; overflow-y: auto; }
#area table { border-collapse: collapse; width: 100%; font-size: 12px; }
#area th { text-align: left; position: sticky; top: 0; background: #fff; border-bottom: 1px solid #ccc; }
#area td, #area th { padding: 2px 6px 2px 0; }
#area tbody tr { cursor: pointer; }
#area tbody tr:hover { background: #e3f2fd; }
#area-btn.active { background: #1565c0; color: #fff; }
#total { font-weight: 600; margin-top: 6px; }
.leaflet-popup.lado .leaflet-popup-tip-container { display: none; }
