:root {
  --fondo: rgba(255, 255, 255, .94);
  --texto: #1d2329;
  --suave: #5d6873;
  --linea: rgba(0, 0, 0, .12);
  --acento: #1f6feb;
  --sombra: 0 2px 10px rgba(0, 0, 0, .18);
}
@media (prefers-color-scheme: dark) {
  :root { --fondo: rgba(28, 32, 36, .94); --texto: #eef1f4; --suave: #a3adb7; --linea: rgba(255, 255, 255, .14); --acento: #5aa2ff; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #20262b; font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texto); }
#mapa { position: fixed; inset: 0; }

.marca { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 12px; padding: 6px 12px; border-radius: 10px; background: var(--fondo); box-shadow: var(--sombra); font-weight: 700; letter-spacing: .2px; }
.marca span { color: var(--acento); }

.boton { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--fondo); color: var(--texto); box-shadow: var(--sombra); display: grid; place-items: center; cursor: pointer; }
.boton:hover { filter: brightness(.97); }
.boton.texto { font-weight: 700; font-size: 14px; }
.boton[aria-expanded="true"] { color: var(--acento); }

#btnCapas { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; }
.panel { position: fixed; top: calc(max(12px, env(safe-area-inset-top)) + 54px); right: 12px; width: min(290px, calc(100vw - 24px)); max-height: calc(100vh - 140px); overflow: auto; padding: 12px 14px; border-radius: 14px; background: var(--fondo); box-shadow: var(--sombra); }
.panel h2 { margin: 10px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--suave); }
.panel h2:first-child { margin-top: 0; }
.opciones { display: grid; gap: 4px; }
.opcion { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--linea); cursor: pointer; }
.opcion input { accent-color: var(--acento); }
.opcion:has(input:checked) { border-color: var(--acento); }
.opcion small { display: block; color: var(--suave); font-size: 12px; }
.casilla { display: flex; gap: 8px; align-items: center; padding: 5px 2px; cursor: pointer; }
.casilla input { accent-color: var(--acento); }
.nota { margin: 0; font-size: 13px; color: var(--suave); }

.controles { position: fixed; right: 12px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 28px); display: grid; gap: 8px; }
.estado { position: fixed; left: 12px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 28px); padding: 5px 10px; border-radius: 8px; background: var(--fondo); box-shadow: var(--sombra); font-size: 12px; color: var(--suave); }
.estado:empty { display: none; }
.maplibregl-ctrl-attrib { font-size: 11px; }
