/* ============================================
   Alertas de Seguridad
   Baliza ámbar sobre grafito, tarjetas en blanco cálido
   ============================================ */
@font-face { font-family: "Space Grotesk"; font-weight: 500; font-display: swap; src: url("./fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-display: swap; src: url("./fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("./fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("./fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("./fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-display: swap; src: url("./fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("./fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("./fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --ink: #14181f;
  --ink-soft: #1e2430;
  --paper: #f6f3ee;
  --paper-dim: #ece7de;
  --line: #ddd6c8;
  --line-dark: #2f3747;
  --amber: #f2a53c;
  --amber-dark: #b8720f;
  --signal: #d2412f;
  --verified: #2a7368;
  --slate: #5b6472;
  --fg: #191c22;
  --muted: var(--slate);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --toolbar-h: 98px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden;
  background: var(--ink); color: var(--fg);
  font-family: var(--font-body); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: .1px; }
a { color: var(--verified); font-weight: 600; }
button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- Botones ---------- */
.ghost {
  background: #fff; border: 1px solid var(--line); color: var(--fg);
  padding: 10px 14px; border-radius: 10px; cursor: pointer;
  font: 500 14px var(--font-body);
  transition: background .15s ease, transform .1s ease;
}
.ghost:hover { background: var(--paper-dim); }
.ghost:active { transform: scale(.98); }
.ghost.small { padding: 7px 11px; font-size: 13px; }
.ghost.danger { color: var(--signal); border-color: #efc4bd; }
.primary {
  background: var(--amber); color: var(--ink); border: 1px solid var(--amber-dark);
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
  font: 700 14px var(--font-body); letter-spacing: .2px;
  box-shadow: 0 6px 18px rgba(242,165,60,.35);
  transition: transform .12s ease, box-shadow .12s ease;
}
.primary:hover { box-shadow: 0 8px 22px rgba(242,165,60,.45); }
.primary:active { transform: scale(.98); }
.primary:disabled { opacity: .6; cursor: default; box-shadow: none; }
.primary.small { padding: 8px 14px; font-size: 13px; justify-self: end; }
.primary.wide { width: 100%; padding: 13px 16px; font-size: 15px; border-radius: 12px; }
.link-btn {
  background: none; border: 0; padding: 6px 0; cursor: pointer;
  color: var(--verified); font: 600 13px var(--font-body);
  text-decoration: underline; text-underline-offset: 3px;
}
.link-btn.danger { color: var(--signal); }
.icon-btn {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line-dark);
  background: rgba(255,255,255,.08); color: #fff; cursor: pointer; font-size: 15px;
}
.icon-btn.light { background: #fff; border-color: var(--line); color: var(--fg); width: 36px; height: 36px; }

/* ---------- Mapa ---------- */
.map-wrap { position: fixed; inset: 0; background: #e9e6df; }
#map { width: 100%; height: 100%; }
.touch-indicator {
  position: absolute; width: 22px; height: 22px; border: 2px solid var(--amber);
  border-radius: 50%; background: rgba(242,165,60,.15);
  transform: translate(-50%,-50%); pointer-events: none;
}
.maplibregl-ctrl-top-right { top: calc(var(--toolbar-h) + var(--safe-t) + 18px); }
.maplibregl-ctrl-group { background: rgba(20,24,31,.9); border: 1px solid var(--line-dark); border-radius: 10px; overflow: hidden; }
.maplibregl-ctrl-group button { background: transparent; }
.maplibregl-ctrl-group button + button { border-top-color: var(--line-dark); }
.maplibregl-ctrl-group button:not(:disabled):hover { background: rgba(255,255,255,.12); }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1) brightness(1.6); }
.maplibregl-ctrl-geolocate { display: none !important; }

/* ---------- Barra superior ---------- */
.topbar {
  position: fixed; z-index: 600;
  top: calc(8px + var(--safe-t)); left: 8px; right: 8px;
  max-width: 760px; margin: 0 auto;
  display: grid; gap: 8px; padding: 8px;
  background: rgba(20,24,31,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-dark); border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); color: #fff;
}
.topbar-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-mark { width: 20px; height: 20px; flex: none; margin: 0 4px 0 6px; background: var(--amber); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.search-group { flex: 1; min-width: 0; display: flex; align-items: center; background: rgba(255,255,255,.08); border: 1px solid var(--line-dark); border-radius: 10px; }
.search-group input { flex: 1; min-width: 0; height: 38px; padding: 0 4px 0 12px; background: transparent; border: 0; outline: none; color: #fff; font: 16px var(--font-body); -webkit-appearance: none; appearance: none; }
.search-group input::placeholder { color: rgba(255,255,255,.55); }
.search-group .icon-btn { border: 0; background: transparent; height: 38px; }
.profile-btn { position: relative; }
.profile-btn.logged { background: var(--amber); border-color: var(--amber); color: var(--ink); font: 700 16px var(--font-display); }
.profile-btn.has-alert::after { content: ""; position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--signal); border: 2px solid var(--ink); }

.filters { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filters::-webkit-scrollbar { display: none; }
.filters select {
  flex: none; height: 32px; padding: 0 10px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid var(--line-dark); color: #fff;
  font: 500 13px var(--font-body); cursor: pointer;
}
.filters select option { color: var(--fg); background: #fff; }
.chips { display: flex; gap: 6px; flex: none; }
.chips.wrap { flex-wrap: wrap; }
.chip {
  flex: none; height: 32px; padding: 0 12px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line-dark); background: transparent; color: rgba(255,255,255,.88);
  font: 500 13px var(--font-body);
}
.chip.active { background: var(--amber); border-color: var(--amber); color: var(--ink); font-weight: 600; }
.dlg .chip { height: 36px; border-color: var(--line); background: #fff; color: var(--fg); }
.dlg .chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Botones flotantes ---------- */
.fab {
  position: fixed; z-index: 500; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: #fff;
  background: rgba(20,24,31,.92); border: 1px solid var(--line-dark);
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.fab:active { transform: scale(.96); }
.fab-view { left: 12px; bottom: calc(22px + var(--safe-b)); }
.fab-view .ico-map { display: none; }
body.list-mode .fab-view .ico-map { display: block; }
body.list-mode .fab-view .ico-list { display: none; }
.fab-geolocate { right: 12px; bottom: calc(84px + var(--safe-b)); }
.fab-layers { right: 12px; bottom: calc(138px + var(--safe-b)); }
body.list-mode .fab-geolocate, body.list-mode .fab-layers { display: none; }
.fab-new-aviso {
  position: fixed; z-index: 500; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + var(--safe-b));
  padding: 14px 24px; font-size: 15px; white-space: nowrap;
}
.fab-new-aviso:active { transform: translateX(-50%) scale(.98); }

/* ---------- Listado ---------- */
.list {
  position: fixed; inset: 0; z-index: 400; overflow: auto; -webkit-overflow-scrolling: touch;
  background: var(--paper);
  padding: calc(var(--toolbar-h) + var(--safe-t) + 22px) 12px calc(100px + var(--safe-b));
}
.list-inner { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.list-count { margin: 0 2px; font: 500 12px var(--font-mono); color: var(--muted); }
.list-item {
  display: grid; gap: 6px; width: 100%; text-align: left; cursor: pointer;
  background: #fff; color: inherit; font: inherit;
  border: 1px solid var(--line); border-left: 4px solid var(--amber-dark); border-radius: 12px;
  padding: 12px 14px;
}
.list-item.sev-5 { border-left-color: var(--signal); }
.list-item.sev-1 { border-left-color: var(--verified); }
.list-item .title { font: 700 15px/1.3 var(--font-display); }
.where { font-size: 13px; color: var(--muted); margin: 0; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); margin: 0; }

/* ---------- Etiquetas ---------- */
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--paper-dim); color: var(--fg); font: 500 11px var(--font-mono); }
.pill.sev-1 { background: var(--verified); color: #fff; }
.pill.sev-3 { background: var(--amber-dark); color: #fff; }
.pill.sev-5 { background: var(--signal); color: #fff; }
.tag-prensa { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--ink); color: var(--amber); font: 500 11px var(--font-mono); }
.when { margin-left: auto; font: 12px var(--font-mono); color: var(--muted); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--signal); color: #fff; font: 600 11px var(--font-mono); }
.notice { margin: 0; padding: 9px 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 10px; font-size: 13px; }
.notice.warn { border-left-color: var(--signal); }

/* ---------- Panel de aviso (hoja inferior en móvil, tarjeta lateral en escritorio) ---------- */
.panel {
  position: fixed; z-index: 1001; left: 0; right: 0; bottom: 0;
  max-height: 74svh; display: flex; flex-direction: column;
  background: var(--paper); border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 40px rgba(0,0,0,.3);
  padding-bottom: var(--safe-b);
  transform: translateY(105%); visibility: hidden;
  transition: transform .24s ease, visibility 0s linear .24s;
}
.panel.open { transform: none; visibility: visible; transition: transform .24s ease; }
.panel-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; flex: none; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 8px 12px 10px 16px; border-bottom: 1px solid var(--line); flex: none; }
.panel-header h3 { margin: 6px 0 0; font-size: 17px; line-height: 1.25; }
.panel-content { padding: 14px 16px 20px; overflow: auto; -webkit-overflow-scrolling: touch; display: grid; gap: 14px; }
#aviso-details { display: grid; gap: 10px; }
#aviso-details p { margin: 0; }
.aviso-desc { font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }
.fuente-prensa { font-size: 13px; }
.vote-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.vote-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 8px; font-weight: 600; }
.vote-btn b { font: 500 12px var(--font-mono); color: var(--muted); }
.vote-btn.up.active { background: var(--verified); border-color: var(--verified); color: #fff; }
.vote-btn.down.active { background: var(--signal); border-color: var(--signal); color: #fff; }
.vote-btn.active b { color: #fff; }
.action-row { display: flex; flex-wrap: wrap; gap: 2px 18px; }
#comments { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 10px; }
#comments h4 { margin: 0; font-size: 15px; }
#comments-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.comment { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; overflow-wrap: anywhere; }
.comment .meta { font: 11px var(--font-mono); color: var(--muted); margin-bottom: 4px; }
.c-actions { display: flex; gap: 14px; justify-content: flex-end; }
.c-actions .link-btn { font-size: 12px; padding: 4px 0 0; }
#comment-form-wrapper { display: grid; gap: 8px; }

/* ---------- Diálogos ---------- */
dialog.dlg { border: 0; padding: 0; background: transparent; color: var(--fg); width: min(440px, calc(100vw - 20px)); max-width: none; max-height: none; overflow: visible; }
dialog.dlg.wide { width: min(640px, calc(100vw - 20px)); }
dialog::backdrop { background: rgba(10,12,16,.6); }
.dlg-box { display: flex; flex-direction: column; max-height: calc(100svh - 28px); overflow: hidden; background: var(--paper); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 10px 18px; border-bottom: 1px solid var(--line); flex: none; }
.dlg-head h3 { margin: 0; font-size: 18px; }
.dlg-body { display: grid; gap: 14px; padding: 16px 18px; overflow: auto; -webkit-overflow-scrolling: touch; }
.dlg-foot { margin: 0; padding: 12px 18px 14px; border-top: 1px solid var(--line); flex: none; }
.dlg label, .dlg .field { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.dlg input, .dlg select, .dlg textarea, .panel textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--fg); font: 16px var(--font-body);
}
.dlg textarea, .panel textarea { resize: vertical; min-height: 64px; }
.dlg label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; cursor: pointer; }
.dlg input[type="checkbox"], .dlg input[type="radio"] { width: 20px; height: 20px; flex: none; margin: 1px 0 0; padding: 0; accent-color: var(--amber-dark); }
.radios { display: grid; gap: 10px; }
.loc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: -6px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--paper-dim); border-radius: 12px; }
.seg-btn { border: 0; background: transparent; padding: 9px 8px; border-radius: 9px; cursor: pointer; color: var(--slate); font: 600 14px var(--font-body); }
.seg-btn.active { background: #fff; color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.seg-btn[data-sev="1"].active { background: var(--verified); color: #fff; }
.seg-btn[data-sev="3"].active { background: var(--amber-dark); color: #fff; }
.seg-btn[data-sev="5"].active { background: var(--signal); color: #fff; }
.error { margin: 0; color: var(--signal); font-size: 14px; font-weight: 500; }
.error.ok { color: var(--verified); }
.account-name { margin: 0; font: 700 18px var(--font-display); }
#account-view p { margin: 0; }
#btn-forgot { justify-self: center; }

/* ---------- Moderación ---------- */
.mod-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.mod-card h4 { margin: 0; font-size: 15px; }
.mod-card p { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.mod-motivos { margin: 0; padding-left: 18px; font-size: 13px; }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Avisos del sistema ---------- */
.conn-banner {
  position: fixed; z-index: 1500; left: 10px; right: 10px; margin: 0 auto; max-width: 520px;
  top: calc(var(--toolbar-h) + var(--safe-t) + 22px);
  background: var(--signal); color: #fff; border-radius: 12px; padding: 10px 14px;
  font-size: 14px; font-weight: 500; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.app-toast {
  position: fixed; z-index: 9999; left: 50%; bottom: calc(92px + var(--safe-b));
  transform: translate(-50%, 16px); max-width: calc(100vw - 32px);
  background: var(--ink); color: #fff; border: 1px solid var(--amber); border-radius: 14px;
  padding: 11px 18px; font-size: 14px; font-weight: 500; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.app-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Pantalla de carga ---------- */
.splash {
  position: fixed; inset: 0; z-index: 2000;
  display: grid; place-content: center; justify-items: center; gap: 16px;
  background: radial-gradient(circle at 50% 35%, #232a38 0%, var(--ink) 70%); color: #fff;
  transition: opacity .28s ease, visibility .28s ease;
}
.splash.hidden { display: grid !important; opacity: 0; visibility: hidden; pointer-events: none; }
.logo.big {
  width: 64px; height: 64px; display: grid; place-items: center;
  background: var(--amber); color: var(--ink); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  font: 700 26px var(--font-display); animation: beaconPop .5s ease;
}
@keyframes beaconPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.splash-title { margin: 0; max-width: 260px; text-align: center; font: 500 17px var(--font-display); color: rgba(255,255,255,.85); }

/* ---------- Escritorio ---------- */
@media (min-width: 821px) {
  .panel {
    left: auto; right: 16px; bottom: auto; top: calc(var(--toolbar-h) + 30px);
    width: 400px; max-height: calc(100svh - var(--toolbar-h) - 60px);
    border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.3); padding-bottom: 0;
    transform: translateX(24px); opacity: 0;
    transition: transform .2s ease, opacity .2s ease, visibility 0s linear .2s;
  }
  .panel.open { opacity: 1; transition: transform .2s ease, opacity .2s ease; }
  .panel-grip { display: none; }
  .panel-header { padding-top: 12px; }
}
@media (max-width: 820px) {
  .maplibregl-ctrl-top-right .maplibregl-ctrl-group { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- Página de textos legales ---------- */
body.doc { overflow: auto; height: auto; background: var(--paper); }
.doc-wrap { max-width: 760px; margin: 0 auto; padding: 28px 18px 60px; }
.doc-wrap h1 { font-size: 26px; margin: 0 0 4px; }
.doc-wrap h2 { font-size: 20px; margin: 36px 0 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.doc-wrap h3 { font-size: 16px; margin: 20px 0 6px; }
.doc-wrap p, .doc-wrap li { font-size: 15px; }
.doc-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 4px; }
.pendiente { background: #fff4d6; border-radius: 4px; padding: 0 4px; font-family: var(--font-mono); font-size: 13px; }

/* ---------- Registro: revisar correo ---------- */
.mail-icon { width: 56px; height: 56px; margin: 4px auto 0; display: grid; place-items: center; border-radius: 50%; background: var(--amber); color: var(--ink); font-size: 28px; }
.big-msg { margin: 0; text-align: center; font: 700 20px var(--font-display); }
#check-email-view p { margin: 0; }
#btn-back-login { justify-self: center; }

/* ---------- Bienvenida ---------- */
.welcome { text-align: center; justify-items: center; padding: 24px 22px 18px; }
.welcome h2 { margin: 4px 0 0; font-size: 21px; line-height: 1.2; }
.welcome .logo.big { width: 56px; height: 56px; font-size: 22px; }
.welcome-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; text-align: left; font-size: 14px; }
.welcome-list li { padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.welcome p { margin: 0; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

/* ---------- Aviso de instalar ---------- */
.install-banner {
  position: fixed; z-index: 550; left: 12px; right: 12px; max-width: 460px; margin: 0 auto;
  bottom: calc(84px + var(--safe-b));
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px;
  background: rgba(20,24,31,.96); color: #fff; border: 1px solid var(--line-dark); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.install-banner .ib-text { flex: 1; font-size: 13px; line-height: 1.3; }
.install-banner .muted-light { color: rgba(255,255,255,.65); }
.install-banner .primary.small { justify-self: auto; }
.install-banner .icon-btn { width: 34px; height: 34px; border: 0; background: transparent; }
body.list-mode .install-banner { display: none; }

.splash-title .splash-brand { display: block; margin-bottom: 2px; font: 700 30px var(--font-display); color: #fff; letter-spacing: .5px; }
.welcome-brand { margin: 0; font: 700 22px var(--font-display); }
.welcome-brand span { display: block; font: 600 12px var(--font-mono); letter-spacing: 1.5px; color: var(--amber-dark); text-transform: uppercase; }
.brand-a { color: var(--amber); font: inherit; }
.welcome-brand .brand-a { color: var(--amber-dark); }

/* ---------- Alertas / Mejoras ---------- */
:root { --blue: #3b7be0; --blue-dark: #2a5fb5; --purple: #7a5ad0; }
.pill.est-pendiente { background: var(--blue); color: #fff; }
.pill.est-en_marcha { background: var(--purple); color: #fff; }
.pill.est-resuelto { background: var(--verified); color: #fff; }
.list-item.est-pendiente { border-left-color: var(--blue); }
.list-item.est-en_marcha { border-left-color: var(--purple); }
.list-item.est-resuelto { border-left-color: var(--verified); opacity: .85; }
.apoyos { font: 600 12px var(--font-mono); color: var(--blue-dark); }
.vote-btn.afecta { width: 100%; padding: 12px; font-size: 15px; }
.vote-btn.afecta.active { background: var(--blue); border-color: var(--blue); color: #fff; }
#estado-seg .seg-btn[data-estado="pendiente"].active { background: var(--blue); color: #fff; }
#estado-seg .seg-btn[data-estado="en_marcha"].active { background: var(--purple); color: #fff; }
#estado-seg .seg-btn[data-estado="resuelto"].active { background: var(--verified); color: #fff; }
.list-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.seg.small .seg-btn { padding: 6px 10px; font-size: 13px; }

.topbar .chip.chip-mejora { border-color: rgba(59,123,224,.6); }
.topbar .chip.chip-mejora.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.chips-sub { font: 500 12px var(--font-body); color: var(--muted); margin-top: 2px; }
#mejora-tipo-chips .chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- Portadas de prensa ---------- */
.list-item.con-foto { grid-template-columns: 96px 1fr; align-items: start; column-gap: 12px; }
.li-texto { display: grid; gap: 6px; min-width: 0; }
.li-foto { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--paper-dim); grid-row: 1; }
.panel-foto { position: relative; display: block; margin: -2px 0 2px; border-radius: 12px; overflow: hidden; background: var(--paper-dim); }
.panel-foto img { display: block; width: 100%; max-height: 220px; object-fit: cover; }
.panel-foto span { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(20,24,31,.8); color: #fff; font: 500 11px var(--font-mono); }
@media (max-width: 420px) { .list-item.con-foto { grid-template-columns: 76px 1fr; } .li-foto { width: 76px; height: 60px; } }

/* ---------- Carrusel «Última hora» ---------- */
.carrusel {
  position: fixed; z-index: 450; left: 0; right: 0;
  bottom: calc(80px + var(--safe-b));
  max-width: 760px; margin: 0 auto; pointer-events: none;
}
.car-head {
  display: inline-flex; align-items: center; gap: 7px; margin: 0 0 6px 12px; padding: 4px 10px;
  background: rgba(20,24,31,.9); color: #fff; border-radius: 999px; font: 600 12px var(--font-body);
  pointer-events: auto; box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.car-n { font: 500 11px var(--font-mono); color: var(--amber); }
.car-live, .welcome-live .car-live { width: 8px; height: 8px; border-radius: 50%; background: #e0503f; box-shadow: 0 0 0 0 rgba(224,80,63,.6); animation: latido 1.6s infinite; flex: none; }
@keyframes latido { 0% { box-shadow: 0 0 0 0 rgba(224,80,63,.6); } 70% { box-shadow: 0 0 0 8px rgba(224,80,63,0); } 100% { box-shadow: 0 0 0 0 rgba(224,80,63,0); } }
.car-track {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 12px 6px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; pointer-events: auto;
}
.car-track::-webkit-scrollbar { display: none; }
.car-card {
  flex: 0 0 auto; width: min(78vw, 300px); scroll-snap-align: start;
  display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: center; text-align: left;
  padding: 8px; background: #fff; color: var(--fg); border: 1px solid var(--line); border-left: 4px solid var(--amber-dark);
  border-radius: 14px; box-shadow: 0 8px 22px rgba(0,0,0,.22); cursor: pointer; font: inherit;
}
.car-card.sev-5 { border-left-color: var(--signal); }
.car-card.sev-1 { border-left-color: var(--verified); }
.car-card.est-pendiente { border-left-color: var(--blue); }
.car-card.est-en_marcha { border-left-color: var(--purple); }
.car-card.est-resuelto { border-left-color: var(--verified); }
.car-card img, .car-ico { width: 74px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--paper-dim); }
.car-ico { display: grid; place-items: center; font: 700 26px var(--font-display); color: var(--amber-dark); }
.car-card.sev-5 .car-ico { color: var(--signal); }
.car-txt { display: grid; gap: 2px; min-width: 0; }
.car-meta { font: 500 11px var(--font-mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-tit { font: 700 13.5px/1.25 var(--font-display); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.car-lugar { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.list-mode .carrusel, body.panel-abierto .carrusel { display: none; }
/* con el carrusel, los botones flotantes y el aviso de instalar suben */
.fab-geolocate { bottom: calc(196px + var(--safe-b)); }
.fab-layers { bottom: calc(250px + var(--safe-b)); }
.install-banner { bottom: calc(196px + var(--safe-b)); }
body.list-mode .install-banner { display: none; }
.welcome-live { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; }
.welcome-live b { color: var(--amber); font-family: var(--font-mono); }
@media (min-width: 821px) { .carrusel { left: 16px; right: auto; width: min(760px, calc(100vw - 460px)); margin: 0; } }

/* ---------- WhatsApp y borrar cuenta ---------- */
.wa-btn { width: 100%; background: #25d366; border-color: #1ebe5a; color: #fff; font-weight: 600; }
.wa-btn:hover { background: #1ebe5a; }
#btn-delete-account { justify-self: center; font-size: 12px; }
.car-nuevos { margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--signal); color: #fff; font: 600 11px var(--font-body); }

/* ---------- Acceso con Google ---------- */
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--fg); font: 600 15px var(--font-body); cursor: pointer; }
.google-btn:hover { background: #f7f7f7; }
.google-legal { margin: -6px 0 0; text-align: center; }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
