:root {
  color-scheme: light;
  --ink: #17313a;
  --muted: #60757a;
  --paper: #f5f1e8;
  --surface: #fffdf8;
  --surface-soft: #eee8dc;
  --line: #ddd7ca;
  --aid: #1d827e;
  --aid-dark: #135b59;
  --need: #dc5d45;
  --need-dark: #933c2c;
  --offer: #efbd52;
  --offer-dark: #654b12;
  --affected: #b93f35;
  --affected-soft: #f6ded9;
  --response: #326d9e;
  --response-dark: #254f74;
  --focus: #176fb0;
  --shadow-sm: 0 8px 24px rgb(23 49 58 / 12%);
  --shadow-lg: 0 20px 56px rgb(23 49 58 / 20%);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  border-radius: 9px;
  background: var(--ink);
  color: var(--surface);
  padding: 12px 16px;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  position: relative;
  height: 100%;
}

.control-panel {
  position: absolute;
  z-index: 20;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.control-panel.is-suspended-for-map {
  visibility: hidden;
  pointer-events: none;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px 8px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 50% 50% 50% 15%;
  background: var(--need);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  transform: rotate(-5deg);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.98rem;
  letter-spacing: -0.025em;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.66rem;
}

.community-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.66rem;
  white-space: nowrap;
}

.community-label i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--aid);
}

.account-access-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--aid-dark);
  padding: 8px 12px;
  font-size: 0.7rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.account-access-link:hover,
.account-access-link:focus-visible {
  border-color: var(--aid-dark);
  background: var(--aid-soft);
}

.hero {
  display: none;
}

.event-summary {
  display: grid;
  gap: 2px;
  margin: 18px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.event-summary strong {
  color: var(--ink);
  font-size: 0.76rem;
}

.missing-persons-link {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #d3e4e1;
  border-radius: 12px;
  background: #f0f8f6;
  color: var(--ink);
  font-size: 0.76rem;
  line-height: 1.35;
}

.missing-persons-link a {
  color: var(--aid-dark);
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--need-dark);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero-report-button {
  display: grid;
  width: 100%;
  min-height: 58px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin-top: 16px;
  border: 0;
  border-radius: 13px;
  background: var(--need);
  color: #fff;
  padding: 10px 13px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 9px 20px rgb(147 60 44 / 18%);
  transition: transform 140ms var(--ease-out), background 140ms var(--ease-out);
}

.hero-report-button:hover {
  background: var(--need-dark);
  transform: translateY(-1px);
}

.hero-report-button:active {
  transform: translateY(0);
}

.hero-report-button > span:nth-child(2),
.hero-report-button strong,
.hero-report-button small {
  display: block;
}

.hero-report-button strong {
  font-size: 0.84rem;
}

.hero-report-button small {
  margin-top: 2px;
  color: rgb(255 255 255 / 84%);
  font-size: 0.66rem;
  line-height: 1.3;
}

.hero-report-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: rgb(255 255 255 / 16%);
}

.hero-report-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

h1,
h2,
p {
  margin-top: 0;
}

.finder {
  display: grid;
  gap: 8px;
  padding: 4px 14px 10px;
}

.finder h2 {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: -0.01em;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  position: relative;
  z-index: 5;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}

.city-combobox {
  position: relative;
  min-width: 0;
}

.city-combobox-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.search-form:focus-within {
  border-color: var(--aid);
  box-shadow: 0 0 0 4px rgb(29 130 126 / 14%);
}

.search-icon {
  padding-left: 13px;
  color: var(--muted);
  font-size: 1.35rem;
  transform: rotate(-18deg);
}

.search-form input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 8px;
  font-size: 0.86rem;
}

.search-form input::placeholder {
  color: #6c7d81;
  opacity: 1;
}

.search-form > button {
  align-self: stretch;
  border: 0;
  background: var(--ink);
  color: #fff;
  padding: 0 13px;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
}

.city-suggestions {
  position: absolute;
  z-index: 120;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  max-height: min(300px, 42vh);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  padding: 6px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  overscroll-behavior: contain;
}

.city-suggestions[hidden] {
  display: none;
}

.city-suggestion {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  padding: 8px 10px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.city-suggestion:hover,
.city-suggestion[aria-selected="true"] {
  background: var(--surface-soft);
}

.city-suggestion strong {
  font-size: 0.82rem;
  line-height: 1.25;
}

.city-suggestion small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 14px 13px;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  display: inline-flex;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  padding: 0 12px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 780;
  transition: transform 120ms var(--ease-out), background 120ms var(--ease-out);
}

.filter-icon {
  display: grid;
  place-items: center;
  line-height: 0;
}

.filter-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.filter-chip:active {
  transform: scale(0.97);
}

.filter-chip.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.filter-chip[data-filter="affected"].is-active {
  border-color: var(--affected);
  background: var(--affected);
}

.desktop-actions,
.nearby-feed,
.panel-footer {
  display: none;
}

.map-stage,
.map {
  position: relative;
  min-width: 0;
  width: 100%;
  height: 100%;
}

.map-stage {
  isolation: isolate;
  overflow: hidden;
  background: #dbe8e5;
}

/* El mapa es su propio nivel visual. Los z-index internos de MapLibre y de los
   marcadores nunca deben escapar por encima de buscadores, tarjetas o botones. */
.map {
  z-index: 0;
  isolation: isolate;
}

.map-loading {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-content: center;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.84rem;
}

.map-loading[hidden],
.map-fallback[hidden] {
  display: none;
}

.map-fallback {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 32px;
  background: var(--paper);
  text-align: center;
}

.map-context {
  position: absolute;
  z-index: 4;
  top: 246px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgb(255 255 255 / 80%);
  border-radius: 999px;
  background: var(--surface);
  padding: 8px 11px;
  box-shadow: var(--shadow-sm);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.map-picker,
.map-picker-pin {
  position: absolute;
  z-index: 80;
}

.map-picker[hidden],
.map-picker-pin[hidden] {
  display: none;
}

.map-picker {
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  left: 14px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  flex-direction: column;
  gap: 14px;
  border: 1px solid rgb(255 255 255 / 78%);
  border-radius: 16px;
  background: rgb(255 253 248 / 96%);
  padding: 12px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

.map-picker > div:first-child {
  min-width: 0;
}

.map-picker .eyebrow {
  margin-bottom: 2px;
}

.map-picker strong,
.map-picker small {
  display: block;
}

.map-picker strong {
  font-size: 0.86rem;
  line-height: 1.25;
}

.map-picker small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.map-picker-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.map-picker-actions .secondary-action {
  min-height: 44px;
  flex: 1 1 0;
  padding-inline: 13px;
}

.map-picker-pin {
  top: 50%;
  left: 50%;
  width: 34px;
  height: 42px;
  transform: translate(-50%, -100%);
  pointer-events: none;
}

.map-picker-pin::before {
  position: absolute;
  inset: 0 0 8px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 6px;
  background: var(--need);
  box-shadow: 0 8px 20px rgb(23 49 58 / 28%);
  content: "";
  transform: rotate(-45deg);
}

.map-picker-pin span {
  position: absolute;
  z-index: 1;
  top: 9px;
  left: 11px;
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  border-radius: 50%;
}

.map-stage.is-picking-location .map-context,
.map-stage.is-picking-location .map-locate-button,
.map-stage.is-picking-location .seismic-summary,
.map-stage.is-picking-location .map-key,
.map-stage.is-picking-location .detail-card,
.map-stage.is-picking-location .moderator-entry,
.map-stage.is-picking-location .missing-persons-entry,
.map-stage.is-picking-location .primary-actions {
  visibility: hidden;
  pointer-events: none;
}

.map-stage.is-picking-location .map-marker {
  opacity: 0.28;
  pointer-events: none;
}

.map-locate-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--aid-dark);
  cursor: pointer;
}

.map-locate-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.map-locate-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.map-locate-button.is-locating {
  background: rgb(23 111 176 / 12%);
}

.context-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--aid);
}

.seismic-summary {
  position: absolute;
  z-index: 4;
  top: 286px;
  left: 14px;
  display: grid;
  width: min(300px, calc(100% - 28px));
  min-height: 56px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid rgb(255 255 255 / 82%);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 11px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
}

.seismic-summary-ring {
  position: relative;
  width: 31px;
  height: 31px;
  border: 2px solid var(--affected);
  border-radius: 50%;
  background: var(--affected-soft);
}

.seismic-summary-ring::before,
.seismic-summary-ring::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.seismic-summary-ring::before {
  inset: 6px;
  border: 1px solid var(--affected);
}

.seismic-summary-ring::after {
  inset: 12px;
  background: var(--affected);
}

.seismic-summary strong,
.seismic-summary small {
  display: block;
}

.seismic-summary strong {
  font-size: 0.72rem;
  line-height: 1.25;
}

.seismic-summary small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.3;
}

.seismic-summary-action {
  color: var(--affected);
  font-size: 0.64rem;
  font-weight: 850;
  white-space: nowrap;
}

.map-key {
  position: absolute;
  z-index: 4;
  right: 10px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgb(255 255 255 / 80%);
  border-radius: 12px;
  background: var(--surface);
  padding: 7px;
  box-shadow: var(--shadow-sm);
  color: var(--muted);
  font-size: 0.64rem;
}

.map-key > span {
  display: none;
}

.map-key button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
}

.key-icon {
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  line-height: 0;
}

.key-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.key-affected { color: var(--affected); }
.key-aid { color: var(--aid-dark); }
.key-response { color: var(--response-dark); }
.key-need { color: var(--need); }
.key-offer { color: var(--offer-dark); }

.maplibregl-ctrl-bottom-right {
  bottom: 133px;
}

.maplibregl-ctrl-group button {
  width: 42px;
  height: 42px;
}

.map-location-control {
  overflow: hidden;
}

.maplibregl-ctrl-attrib {
  font-size: 0.6rem;
}

.map-marker {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--surface);
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
}

.map-marker > .category-icon {
  width: 32px;
  height: 32px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--marker-color, var(--aid-dark));
  box-shadow: 0 4px 12px rgb(23 49 58 / 20%);
  color: var(--marker-ink, var(--surface));
  opacity: 0.92;
  transform: translateY(0);
  transition: opacity 160ms var(--ease-out), transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.category-icon {
  display: grid;
  place-items: center;
  line-height: 0;
}

.category-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.map-marker .category-icon svg {
  width: 16px;
  height: 16px;
}

.map-marker.need {
  --marker-color: var(--need);
}

.map-marker.response {
  --marker-color: var(--response-dark);
}

.map-marker.affected {
  --marker-color: var(--affected);
}

.map-marker.offer {
  --marker-color: var(--offer);
  --marker-ink: var(--offer-dark);
}

.map-marker.tone-planned {
  --marker-color: var(--offer);
  --marker-ink: var(--offer-dark);
}

/* Reporte comunitario todavía sin verificar: borde discontinuo, mismo color de categoría. */
.map-marker.is-pending > .category-icon {
  border-style: dashed;
  box-shadow: 0 0 0 1px rgb(101 75 18 / 28%), 0 4px 12px rgb(23 49 58 / 18%);
}

.map-marker:hover > .category-icon,
.map-marker:focus-visible > .category-icon,
.map-marker.is-selected > .category-icon {
  opacity: 1;
  transform: scale(1.12) translateY(-2px);
  box-shadow: 0 6px 16px rgb(23 49 58 / 26%);
}

.map-marker:active > .category-icon {
  transform: scale(1.04);
}

/* En la vista nacional se conserva el área táctil accesible de 44 px, pero el
   símbolo visible se compacta para dejar respirar nombres, vías y municipios. */
.map-stage.is-map-overview .map-marker > .category-icon {
  width: 26px;
  height: 26px;
  border-width: 2px;
  box-shadow: 0 3px 9px rgb(23 49 58 / 17%);
  opacity: 0.86;
}

.map-stage.is-map-overview .map-marker .category-icon svg {
  width: 13px;
  height: 13px;
}

.map-stage.is-map-overview .map-marker:hover > .category-icon,
.map-stage.is-map-overview .map-marker:focus-visible > .category-icon,
.map-stage.is-map-overview .map-marker.is-selected > .category-icon {
  opacity: 1;
  transform: scale(1.16) translateY(-2px);
}

.user-marker {
  width: 20px;
  height: 20px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--focus);
  box-shadow: 0 0 0 7px rgb(23 111 176 / 20%);
}

.primary-actions {
  position: absolute;
  z-index: 5;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(10px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 8px;
}

.moderator-entry {
  position: absolute;
  z-index: 5;
  bottom: calc(92px + env(safe-area-inset-bottom));
  left: max(10px, env(safe-area-inset-left));
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgb(255 255 255 / 80%);
  border-radius: 999px;
  background: var(--surface);
  color: var(--aid-dark);
  padding: 7px 11px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
}

.missing-persons-entry {
  position: absolute;
  z-index: 5;
  bottom: calc(142px + env(safe-area-inset-bottom));
  left: max(10px, env(safe-area-inset-left));
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgb(255 255 255 / 80%);
  border-radius: 999px;
  background: var(--surface);
  color: var(--aid-dark);
  padding: 6px 10px;
  box-shadow: var(--shadow-sm);
  font-size: 0.64rem;
  font-weight: 800;
  text-decoration: none;
}

.action {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 14px;
  padding: 9px 12px;
  box-shadow: 0 12px 32px rgb(23 49 58 / 20%);
  cursor: pointer;
  text-align: left;
  transition: transform 120ms var(--ease-out), filter 120ms var(--ease-out);
}

.action:active {
  transform: translateY(1px) scale(0.99);
}

.action-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 1.15rem;
  font-weight: 500;
}

.action-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.action > span:not(.action-icon),
.action small {
  display: block;
}

.action > span:nth-child(2) {
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.15;
}

.action small {
  margin-bottom: 2px;
  font-size: 0.6rem;
  font-weight: 650;
  opacity: 0.8;
}

.action-arrow {
  margin-left: auto;
  font-size: 1.15rem;
}

.action-need {
  background: var(--need);
  color: #fff;
}

.action-offer {
  background: var(--offer);
  color: var(--offer-dark);
}

.feed-list {
  display: grid;
}

.feed-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  width: 100%;
  min-height: 86px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 13px 0;
  text-align: left;
  cursor: pointer;
}

.feed-symbol {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--aid);
  color: var(--surface);
  font-weight: 900;
}

.feed-symbol.need {
  background: var(--need);
}

.feed-symbol.response {
  background: var(--response-dark);
}

.feed-item:has(.feed-symbol.response) .feed-badge {
  color: var(--response-dark);
}

.feed-symbol.affected {
  border: 2px solid var(--affected);
  background: var(--affected-soft);
  color: var(--affected);
}

.feed-item:has(.feed-symbol.affected) .feed-badge {
  color: var(--affected);
}

.feed-symbol.offer {
  background: var(--offer);
  color: var(--offer-dark);
}

.feed-copy,
.feed-badge,
.feed-title,
.feed-meta,
.feed-distance {
  display: block;
}

.feed-badge {
  margin-bottom: 4px;
  color: var(--aid-dark);
  font-size: 0.62rem;
  font-weight: 820;
  letter-spacing: 0.02em;
}

.feed-badge.is-pending {
  color: var(--offer-dark);
}

.feed-title {
  margin-bottom: 3px;
  font-size: 0.82rem;
  font-weight: 820;
  line-height: 1.25;
}

.feed-meta,
.feed-distance {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.feed-distance {
  padding-top: 22px;
  white-space: nowrap;
}

.detail-card {
  position: absolute;
  z-index: 7;
  right: 10px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  left: 10px;
  max-height: min(55vh, 460px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  animation: detail-in 300ms var(--ease-out) both;
}

.detail-card[hidden] {
  display: none;
}

.detail-card .icon-button {
  position: absolute;
  top: 10px;
  right: 10px;
}

.detail-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 46px);
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 780;
}

.trust-badge {
  border-radius: 999px;
  background: #e1f0eb;
  color: var(--aid-dark);
  padding: 5px 8px;
}

.trust-badge.is-pending {
  background: #fbf0d2;
  color: var(--offer-dark);
}

.detail-card h2 {
  max-width: calc(100% - 42px);
  margin-bottom: 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.detail-card p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.detail-location {
  font-weight: 720;
}

.current-state {
  display: grid;
  gap: 3px;
  margin: 14px 0 10px;
  border-radius: 10px;
  background: #e7f2ee;
  padding: 11px 12px;
  color: var(--aid-dark);
  font-size: 0.73rem;
  line-height: 1.45;
}

.current-state.need {
  background: #f7e4df;
  color: var(--need-dark);
}

.current-state.planned {
  background: #fbf0d2;
  color: var(--offer-dark);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.detail-actions a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 800;
}

.detail-actions a:first-child,
.detail-actions .detail-secondary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

@keyframes detail-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

body:has(.detail-card:not([hidden])) .moderator-entry {
  display: none;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 30px 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.empty-state > span:last-child {
  max-width: 270px;
  font-size: 0.76rem;
  line-height: 1.5;
}

.empty-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--aid-dark);
  font-size: 1.2rem;
}

dialog {
  width: min(520px, calc(100% - 24px));
  max-height: calc(100% - 28px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background: rgb(23 49 58 / 58%);
}

.report-dialog form,
.moderator-dialog .moderator-body,
.about-dialog,
.list-dialog {
  padding: 22px;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dialog-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-soft);
  cursor: pointer;
  font-size: 1.35rem;
}

.dialog-notice,
.privacy-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.dialog-notice {
  margin-bottom: 18px;
  border-left: 4px solid var(--offer);
  border-radius: 8px;
  background: #fbf2dc;
  padding: 12px 13px;
  color: var(--offer-dark);
}

.report-dialog fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.report-dialog label {
  display: block;
  margin: 14px 0 6px;
  font-size: 0.8rem;
  font-weight: 800;
}

.report-dialog input,
.report-dialog select,
.report-dialog textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 11px 12px;
}

.report-dialog .city-combobox-report {
  z-index: 4;
}

.report-dialog .city-combobox-report input {
  margin: 0;
}

.report-dialog textarea {
  min-height: 105px;
  resize: vertical;
}

.report-dialog fieldset:disabled {
  opacity: 0.64;
}

/* Formulario público de publicación */

.report-dialog form {
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.form-intro {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.report-dialog legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 800;
}

.report-dialog .type-fieldset,
.report-dialog .category-fieldset,
.report-dialog .scope-fieldset,
.report-dialog .location-fieldset {
  margin-top: 18px;
}

.label-hint {
  color: var(--muted);
  font-weight: 650;
}

.field-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.field-status {
  min-height: 1.3em;
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.4;
}

.type-options {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.type-option {
  display: flex;
  min-height: 60px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  cursor: pointer;
  padding: 10px 12px;
}

/* Sin min-height propio, el radio heredaría los 48px de .report-dialog input. */
.type-option input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  flex: 0 0 20px;
  accent-color: var(--aid-dark);
}

.type-option strong,
.type-option small {
  display: block;
}

.type-option strong {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
}

.type-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.3;
}

.type-option:has(input:checked) {
  border-color: var(--aid-dark);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--aid-dark);
}

.type-option:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.scope-options {
  display: grid;
  gap: 8px;
}

.scope-option {
  display: flex;
  min-height: 56px;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  cursor: pointer;
  padding: 11px 12px;
}

/* Igual que en los tipos: sin altura propia el radio heredaría los 48px de
   .report-dialog input. */
.scope-option input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  flex: 0 0 20px;
  accent-color: var(--aid-dark);
}

.scope-option strong,
.scope-option small {
  display: block;
}

.scope-option strong {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
}

.scope-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.scope-option:has(input:checked) {
  border-color: var(--aid-dark);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--aid-dark);
}

.scope-option:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.category-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-option {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  cursor: pointer;
  padding: 6px 14px 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.category-option input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: var(--aid-dark);
}

.category-option:has(input:checked) {
  border-color: var(--aid-dark);
  background: var(--surface);
  color: var(--aid-dark);
}

.category-option:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.5;
}

.category-option:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.location-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.selected-map-point {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  padding: 0 12px 12px;
}

.selected-map-point[hidden] {
  display: none;
}

.selected-map-point input[readonly] {
  background: var(--surface);
  color: var(--ink);
  cursor: default;
}

.secondary-action {
  min-height: 46px;
  border: 1px solid var(--aid-dark);
  border-radius: 11px;
  background: var(--surface);
  color: var(--aid-dark);
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 800;
}

.secondary-action.quiet {
  border-color: var(--line);
  color: var(--muted);
}

.secondary-action:disabled {
  cursor: wait;
  opacity: 0.6;
}

/* Trampa antispam: fuera del foco, del tabulador y de los lectores. */
.honeypot-field {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
}

.turnstile-container:not(:empty) {
  margin-top: 18px;
}

.form-status {
  min-height: 1.35em;
  margin: 14px 0 10px;
  color: var(--need-dark);
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.45;
}

.form-status.is-success {
  color: var(--aid-dark);
}

.report-dialog input[aria-invalid="true"],
.report-dialog textarea[aria-invalid="true"],
.report-dialog button[aria-invalid="true"] {
  border-color: var(--need-dark);
  box-shadow: 0 0 0 2px rgb(147 60 44 / 18%);
}

.moderator-intro {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.submit-button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 11px;
  background: var(--ink);
  color: #fff;
  font-weight: 820;
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.moderator-access-link {
  display: grid;
  place-items: center;
  color: #fff;
  text-decoration: none;
}

.moderator-steps {
  display: grid;
  gap: 9px;
  margin: 0 0 20px;
  padding-left: 22px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.moderator-secondary-link {
  display: grid;
  min-height: 50px;
  margin-top: 10px;
  border: 1px solid var(--aid);
  border-radius: 11px;
  color: var(--aid-dark);
  font-size: 0.9rem;
  font-weight: 800;
  place-items: center;
  text-align: center;
  text-decoration: none;
}

.about-dialog ol {
  display: grid;
  gap: 12px;
  padding-left: 22px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.about-dialog > p:last-child {
  margin: 20px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.toast {
  position: fixed;
  z-index: 500;
  right: 14px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  left: 14px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  padding: 13px 15px;
  box-shadow: var(--shadow-lg);
  font-size: 0.78rem;
  line-height: 1.4;
  pointer-events: none;
  animation: toast-in 300ms var(--ease-out) both;
}

.toast[hidden] {
  display: none;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 900px) {
  .map-picker {
    right: 22px;
    left: auto;
    width: min(620px, calc(100% - 44px));
    align-items: center;
    flex-direction: row;
  }

  .app-shell {
    display: grid;
    grid-template-columns: minmax(390px, 430px) 1fr;
  }

  .control-panel {
    position: relative;
    inset: auto;
    height: 100%;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: var(--paper);
    box-shadow: none;
  }

  .brand-row {
    padding: 22px 28px 16px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    font-size: 0.72rem;
  }

  .brand strong {
    font-size: 1.05rem;
  }

  .brand small,
  .community-label {
    font-size: 0.7rem;
  }

  .hero {
    display: block;
    padding: 18px 28px 20px;
  }

  .hero h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.55rem, 3.5vw, 3.4rem);
    font-weight: 600;
    letter-spacing: -0.055em;
    line-height: 0.96;
  }

  .hero-copy {
    max-width: 340px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .finder {
    gap: 10px;
    padding: 0 28px 16px;
  }

  .finder h2 {
    font-size: 0.83rem;
  }

  .search-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .filters {
    flex-wrap: wrap;
    padding: 0 28px 18px;
  }

  .desktop-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    padding: 0 28px 20px;
  }

  .desktop-actions-heading {
    display: grid;
    grid-column: 1 / -1;
    gap: 2px;
    color: var(--ink);
    font-size: 0.74rem;
  }

  .desktop-actions-heading span {
    color: var(--muted);
    font-size: 0.67rem;
    line-height: 1.4;
  }

  .desktop-actions .action {
    min-height: 78px;
    box-shadow: none;
  }

  .desktop-actions .action > span:nth-child(2) {
    font-size: 0.8rem;
  }

  .desktop-actions .action:hover {
    transform: translateY(-2px);
    filter: saturate(1.06);
  }

  .nearby-feed {
    display: block;
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    border-top: 1px solid var(--line);
    padding: 17px 28px 20px;
  }

  .section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
  }

  .section-heading h2 {
    margin: 0;
    font-size: 0.88rem;
  }

  .section-heading span {
    color: var(--muted);
    font-size: 0.72rem;
  }

  .panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding: 13px 28px;
    color: var(--muted);
    font-size: 0.66rem;
  }

  .panel-footer button {
    min-height: 36px;
    border: 0;
    background: transparent;
    color: var(--aid-dark);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 800;
  }

  .panel-footer .moderator-link {
    color: var(--need-dark);
  }

  .primary-actions {
    display: none;
  }

  .moderator-entry {
    display: none;
  }

  .missing-persons-entry {
    display: none;
  }

  .detail-card {
    right: 20px;
    bottom: 22px;
    left: auto;
    width: min(390px, calc(100% - 40px));
    max-height: calc(100% - 94px);
    padding: 22px;
  }

  .map-context {
    top: 18px;
    left: 18px;
    padding: 9px 12px;
    font-size: 0.72rem;
  }

  .seismic-summary {
    top: 62px;
    left: 18px;
    width: 300px;
  }

  .map-key {
    top: 18px;
    right: 18px;
    bottom: auto;
    gap: 13px;
    padding: 10px 12px;
    font-size: 0.68rem;
  }

  .map-key > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .map-key button {
    display: none;
  }

  .maplibregl-ctrl-bottom-right {
    bottom: 24px;
  }

  .toast {
    right: 22px;
    bottom: 22px;
    left: auto;
    width: min(390px, calc(100% - 44px));
  }
}

@media (max-height: 720px) and (min-width: 900px) {
  .brand-row {
    padding-block: 14px 10px;
  }

  .hero {
    padding-block: 8px 14px;
  }

  .hero h1 {
    font-size: 2.35rem;
  }

  .hero-copy {
    margin-top: 10px;
  }

  .hero-report-button {
    min-height: 52px;
    margin-top: 11px;
  }

  .hero-report-button small {
    display: none;
  }

  .desktop-actions {
    padding-bottom: 14px;
  }
}

@media (max-width: 360px) {
  .community-label,
  .action small {
    display: none;
  }

  .control-panel {
    left: 8px;
    right: 8px;
  }

  .action {
    gap: 7px;
    padding-inline: 9px;
  }

  .action-icon {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
  }

  .seismic-summary {
    width: min(274px, calc(100% - 28px));
  }

  .seismic-summary-action {
    display: none;
  }
}

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