/* Home pública — mobile first */

.page-home .main-wrap {
  padding-bottom: var(--space-3);
}

.home-public {
  padding-top: var(--space-2);
}

/* Mobile: menos scroll hasta el mapa, más protagonismo del mapa */
@media (max-width: 639px) {
  .home-hero {
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-2);
  }

  .home-hero-title {
    font-size: 1.0625rem;
    margin-bottom: 0.25rem;
  }

  .home-hero-lead {
    font-size: 0.75rem;
    line-height: 1.35;
  }

  .home-kpis {
    margin-bottom: var(--space-3);
    padding-top: 0;
  }

  .home-kpi-grid {
    gap: var(--space-2);
  }

  .home-kpi-card {
    padding: var(--space-2) var(--space-3);
  }

  .home-kpi-value {
    font-size: 1.35rem;
  }

  .home-kpi-label {
    font-size: 0.6875rem;
  }

  .home-map-layout {
    gap: var(--space-3);
  }

  #mapa-publico {
    height: min(58vh, 500px);
    min-height: 320px;
  }

  .home-map-hint {
    margin-top: var(--space-2);
    font-size: 0.6875rem;
  }
}

.home-hero {
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  border-radius: 0.75rem;
  background: linear-gradient(
      135deg,
      rgba(241, 245, 249, 0.98) 0%,
      rgba(226, 232, 240, 0.95) 55%,
      rgba(203, 213, 225, 0.88) 100%
    )
    border-box;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

@media (min-width: 768px) {
  .home-hero {
    padding-inline: var(--space-5);
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
  }
}

.home-hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 3vw, 1.375rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.375rem;
  color: var(--color-text);
  line-height: 1.25;
}

.home-hero-lead {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  max-width: 42rem;
  line-height: 1.4;
}

/* KPIs (debajo del mapa y tipos; en móvil van dentro de <details>) */
.home-kpis {
  margin-top: 0;
  margin-bottom: var(--space-4);
  padding-top: 0;
}

.home-map-section + .home-tipos-resumen {
  margin-top: var(--space-2);
}

.home-tipos-resumen + .home-kpis {
  margin-top: var(--space-3);
}

.home-kpis-details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.home-kpis-details__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  user-select: none;
}

.home-kpis-details__summary::-webkit-details-marker {
  display: none;
}

.home-kpis-details__summary::after {
  content: "";
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.home-kpis-details[open] .home-kpis-details__summary::after {
  transform: rotate(-135deg);
}

.home-kpis-details__panel {
  padding: 0 var(--space-4) var(--space-4);
}

@media (min-width: 768px) {
  .home-kpis-details {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .home-kpis-details__summary {
    display: none;
  }

  .home-kpis-details__panel {
    padding: 0;
  }
}

.home-kpi-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .home-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.home-kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.home-kpi-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-brand);
  line-height: 1;
}

.home-kpi-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.3;
}

/* Mapa + sidebar — KPIs van después del mapa */
.home-map-section {
  padding-bottom: var(--space-3);
}

.home-map-shell {
  padding-left: 0;
  padding-right: 0;
  position: relative;
}

/* Leaflet usa z-index altos en los paneles; el layout del mapa va después en el DOM y tapaba los desplegables de filtros */
.home-map-shell > .home-map-filters {
  position: relative;
  z-index: 100;
}

.home-map-shell > .home-map-layout {
  position: relative;
  z-index: 1;
}

@media (min-width: 960px) {
  .home-map-shell {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

.home-map-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (min-width: 960px) {
  .home-map-layout {
    flex-direction: row;
    align-items: stretch;
    gap: var(--space-5);
  }

  .home-map-main {
    flex: 1;
    min-width: 0;
  }

  .home-sidebar {
    width: min(100%, 320px);
    flex-shrink: 0;
  }
}

.home-map-main .mapa-wrapper {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

#mapa-publico {
  width: 100%;
  height: min(56vh, 460px);
  min-height: 300px;
}

@media (min-width: 640px) {
  #mapa-publico {
    height: min(62vh, 560px);
    min-height: 400px;
  }
}

@media (min-width: 960px) {
  #mapa-publico {
    height: min(72vh, 640px);
    min-height: 440px;
  }
}

.home-map-hint {
  margin: var(--space-3) 0 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding: 0 var(--space-1);
}

@media (min-width: 960px) {
  .home-map-hint {
    padding: 0;
  }
}

/* Sidebar lista */
.home-sidebar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.home-sidebar-head {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.home-sidebar-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 var(--space-2);
  color: var(--color-text);
}

.home-sidebar-sub {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.home-incident-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.home-incident-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid #f1f4f8;
}

.home-incident-item__row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.home-incident-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.home-incident-thumb {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 0.4rem;
  overflow: hidden;
  cursor: pointer;
  background: #f1f5f9;
  transition:
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.home-incident-thumb:hover {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 1px rgba(13, 79, 139, 0.15);
}

.home-incident-thumb:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.home-incident-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-incident-item--interactive {
  margin: 0 calc(var(--space-2) * -1);
  padding: var(--space-2) var(--space-2) var(--space-3);
  border-radius: 0.5rem;
  border-bottom: 1px solid #f1f4f8;
  cursor: pointer;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.home-incident-item--interactive:hover {
  background: #f8fafc;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.home-incident-item--interactive:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.home-incident-item--interactive.is-active {
  background: rgba(13, 79, 139, 0.06);
  box-shadow: 0 0 0 1px rgba(13, 79, 139, 0.2);
}

.home-incident-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.home-incident-item--interactive:last-child {
  padding-bottom: var(--space-2);
  border-bottom: none;
}

.home-incident-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.45rem;
  border-radius: 0.25rem;
}

.home-incident-badge--vial {
  background: #fff7ed;
  color: #c2410c;
}

.home-incident-badge--servicios {
  background: #eff6ff;
  color: #1d4ed8;
}

.home-incident-badge--infra {
  background: #ecfdf5;
  color: #047857;
}

.home-incident-badge--infraestructura {
  background: #ecfdf5;
  color: #047857;
}

.home-sidebar-empty {
  margin: 0;
  padding: var(--space-3) 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.home-incident-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}

.home-incident-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}

.home-incident-ficha-link {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--color-brand);
  text-decoration: none;
  border: 1px solid rgba(13, 79, 139, 0.22);
  background: rgba(13, 79, 139, 0.05);
  border-radius: 0.3rem;
  padding: 0.2rem 0.38rem;
}

.home-incident-ficha-link:hover {
  text-decoration: none;
  border-color: rgba(13, 79, 139, 0.42);
  background: rgba(13, 79, 139, 0.09);
}

.home-incident-share-btn {
  flex-shrink: 0;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #f8fafc;
  color: var(--color-text-muted);
  border-radius: 0.3rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 0.2rem 0.38rem;
  cursor: pointer;
}

.home-incident-share-btn:hover {
  border-color: rgba(13, 79, 139, 0.45);
  color: var(--color-brand);
}

.home-incident-share-btn:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.home-incident-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.32rem;
  padding-top: 0.32rem;
  border-top: 1px solid #eef2f7;
}

.home-incident-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.home-incident-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  margin-top: 0.125rem;
}

.home-incident-tag {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  background: rgba(15, 23, 42, 0.06);
  color: var(--color-text-muted);
  max-width: 100%;
}

.home-incident-tag--resuelto {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
  font-weight: 700;
}

.home-incident-fotos {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  background: rgba(13, 79, 139, 0.1);
  color: var(--color-brand);
  border: 1px solid rgba(13, 79, 139, 0.2);
}

.home-incident-validaciones {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: #0f766e;
  line-height: 1.3;
}

.home-incident-validaciones--empty {
  display: none;
  margin-top: 0;
}

.home-incident-place {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--color-text-muted);
}

.home-incident-place__line {
  display: block;
  word-break: break-word;
}

.home-incident-place__line--barrio {
  font-weight: 600;
  color: var(--color-text);
}

.home-incident-place__line--dir {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-incident-time {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* Leaflet: z-index bajo el header sticky */
.leaflet-container {
  font-family: var(--font-sans);
}

/* Leyenda coropleta barrios (control inferior derecha) */
.home-barrios-legend-stack {
  margin-bottom: 2.25rem;
  margin-right: 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 11.75rem;
}

.home-barrios-legend-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 999px;
  box-shadow:
    0 2px 12px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.55) inset;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.home-barrios-legend-toggle:hover {
  background: #fff;
  border-color: rgba(59, 130, 246, 0.4);
}

.home-barrios-legend-toggle:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.home-barrios-legend {
  margin-bottom: 0;
  margin-right: 0;
  margin-top: 0;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 0.5rem;
  padding: 0.45rem 0.55rem 0.5rem;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--color-text);
  box-shadow:
    0 2px 10px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  max-width: 11.5rem;
  align-self: flex-end;
}

@media (max-width: 639px) {
  .home-barrios-legend-toggle {
    display: inline-flex;
    align-self: flex-end;
  }

  .home-barrios-legend-stack .home-barrios-legend {
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin-top: 0;
    overflow: hidden;
    border-width: 0;
    pointer-events: none;
    visibility: hidden;
    box-shadow: none;
    transition:
      max-height 0.28s ease,
      opacity 0.22s ease,
      padding 0.22s ease,
      border-width 0.18s ease,
      box-shadow 0.22s ease,
      visibility 0s linear 0.28s;
  }

  .home-barrios-legend-stack--open .home-barrios-legend {
    max-height: 280px;
    opacity: 1;
    margin-top: 0.35rem;
    padding: 0.45rem 0.55rem 0.5rem;
    border-width: 1px;
    pointer-events: auto;
    visibility: visible;
    box-shadow:
      0 2px 10px rgba(15, 23, 42, 0.08),
      0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    transition:
      max-height 0.28s ease,
      opacity 0.22s ease,
      padding 0.22s ease,
      border-width 0.18s ease,
      box-shadow 0.22s ease,
      visibility 0s linear 0s;
  }
}

@media (min-width: 640px) {
  .home-barrios-legend-toggle {
    display: none !important;
  }

  .home-barrios-legend-stack .home-barrios-legend {
    max-height: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    margin-top: 0 !important;
    border-width: 1px !important;
    padding: 0.45rem 0.55rem 0.5rem !important;
    box-shadow:
      0 2px 10px rgba(15, 23, 42, 0.08),
      0 0 0 1px rgba(255, 255, 255, 0.6) inset !important;
  }
}

.home-barrios-legend-title {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  color: var(--color-text);
}

.home-barrios-legend-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-barrios-legend-rows li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.home-barrios-legend-rows li:last-child {
  margin-bottom: 0;
}

.home-barrios-legend-swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 0.15rem;
  border: 1px solid rgba(59, 130, 246, 0.35);
  flex-shrink: 0;
}

/* Popup compacto y fino */
.page-home .leaflet-popup.home-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 0.5rem;
  box-shadow:
    0 4px 14px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.page-home .leaflet-popup.home-popup .leaflet-popup-content {
  margin: 0;
  min-width: 0;
  line-height: 1.35;
  width: min(18.75rem, calc(100vw - 2.25rem));
}

.page-home .leaflet-popup.home-popup .leaflet-popup-tip {
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.page-home .home-popup-inner {
  padding: 0.5rem 0.625rem 0.5625rem;
}

.page-home .home-popup-title {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.25rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-home .home-popup-ficha-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
}

.page-home .home-popup-ficha {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-brand);
  text-decoration: none;
}

.page-home .home-popup-ficha:hover {
  text-decoration: underline;
}

.page-home .home-popup-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid rgba(148, 163, 184, 0.65);
  background: #f8fafc;
  color: var(--color-text-muted);
  border-radius: 0.3rem;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.22rem 0.34rem;
  cursor: pointer;
}

.page-home .home-popup-share-btn:hover {
  border-color: rgba(13, 79, 139, 0.45);
  color: var(--color-brand);
}

.page-home .home-popup-share-btn:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.page-home .home-popup-share-btn__icon {
  flex-shrink: 0;
}

.page-home .home-popup-meta {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-home .home-popup-meta--muted {
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
  line-height: 1.35;
}

.page-home .home-popup-meta--estado {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--color-text);
  margin-top: 0.15rem;
  line-height: 1.35;
}

.page-home .home-popup-resuelto {
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 999px;
  color: #166534;
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  margin-top: 0.25rem;
  padding: 0.08rem 0.45rem;
}

.page-home .home-popup-detail {
  display: block;
  font-size: 0.625rem;
  line-height: 1.35;
  color: var(--color-text-muted);
  margin-top: 0.28rem;
  word-break: break-word;
}

.page-home .home-popup-detail__label {
  font-weight: 700;
  color: var(--color-text-muted);
  margin-right: 0.15rem;
}

.page-home .home-popup-detail--direccion span:last-child {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-home .home-popup-detail--fotos {
  font-weight: 600;
  color: var(--color-brand);
  margin-top: 0.32rem;
}

.page-home .home-popup-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.page-home .home-popup-thumb {
  display: block;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: 0.35rem;
  overflow: hidden;
  cursor: pointer;
  background: #f8fafc;
  line-height: 0;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.page-home .home-popup-thumb:hover {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.page-home .home-popup-thumb:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.page-home .home-popup-thumb img {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  display: block;
}

.page-home .home-popup-validaciones {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.page-home .home-popup-validaciones__resumen {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(2 * 1.35em);
}

.page-home .home-popup-validar-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.55rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  color: #0f172a;
  background: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.65);
  border-radius: 0.35rem;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease;
}

.page-home .home-popup-validar-btn__inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  pointer-events: none;
}

.page-home .home-popup-validar-btn__icon {
  flex-shrink: 0;
  color: #0f172a;
  opacity: 0.88;
}

.page-home .home-popup-validar-btn--busy .home-popup-validar-btn__icon {
  animation: home-validar-pulse 0.85s ease-in-out infinite;
}

@keyframes home-validar-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

.page-home .home-popup-validar-btn:hover {
  background: #e2e8f0;
  border-color: rgba(100, 116, 139, 0.75);
}

.page-home .home-popup-validar-btn:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.page-home .home-popup-validar-btn:disabled {
  opacity: 0.72;
  cursor: default;
}

.page-home .home-popup-validar-btn--busy:disabled {
  cursor: wait;
}

.page-home .home-popup-validaciones__feedback {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--color-text-muted);
}

.page-home .home-popup-validaciones__feedback.is-success {
  color: #0f766e;
  font-weight: 600;
}

.page-home .home-popup-validaciones__feedback.is-warn {
  color: #b45309;
}

body.reporte-foto-lightbox-open {
  overflow: hidden;
}

/* —— Escritorio: al reportar, el mapa es el protagonista (menos scroll “perdido” arriba) —— */
@media (min-width: 640px) {
  body.reporte-modal-map-active.page-home .home-public {
    padding-top: var(--space-1);
  }

  body.reporte-modal-map-active.page-home .main-wrap {
    padding-bottom: var(--space-2);
  }

  body.reporte-modal-map-active .home-public > section.home-hero,
  body.reporte-modal-map-active .home-public > section.home-kpis,
  body.reporte-modal-map-active .home-public > section.home-tipos-resumen {
    display: none !important;
  }

  body.reporte-modal-map-active .home-map-section {
    padding-top: 0;
    padding-bottom: var(--space-2);
  }

  body.reporte-modal-map-active .home-map-shell {
    padding-top: 0;
  }

  body.reporte-modal-map-active .home-map-layout {
    gap: var(--space-3);
  }

  /* Lista lateral: durante el reporte priorizamos superficie del mapa + panel del formulario */
  body.reporte-modal-map-active .home-sidebar {
    display: none !important;
  }

  body.reporte-modal-map-active .home-map-hint {
    display: none;
  }

  body.reporte-modal-map-active .home-map-filters {
    margin-bottom: var(--space-2);
    padding-top: var(--space-2);
    padding-bottom: var(--space-1);
  }

  body.reporte-modal-map-active .home-map-filters__row {
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
    flex-wrap: wrap;
  }

  body.reporte-modal-map-active .home-map-filters__field {
    min-width: min(100%, 8rem);
  }

  body.reporte-modal-map-active .home-map-filters__label {
    font-size: 0.625rem;
  }

  body.reporte-modal-map-active .home-map-filters__select {
    font-size: 0.75rem;
    padding: 0.3rem 0.45rem;
  }

  body.reporte-modal-map-active .home-map-filters__actions {
    padding-bottom: 0;
  }

  body.reporte-modal-map-active #mapa-publico {
    height: min(82vh, 780px);
    min-height: 480px;
  }
}

@media (min-width: 960px) {
  body.reporte-modal-map-active #mapa-publico {
    height: min(86vh, 880px);
    min-height: 520px;
  }
}

/* —— Móvil: al reportar, misma lógica que escritorio (mapa protagonista, menos ruido arriba) —— */
@media (max-width: 639px) {
  body.reporte-modal-map-active.page-home .home-public {
    padding-top: 0;
  }

  body.reporte-modal-map-active.page-home .main-wrap {
    padding-bottom: var(--space-2);
  }

  body.reporte-modal-map-active .home-public > section.home-hero,
  body.reporte-modal-map-active .home-public > section.home-kpis,
  body.reporte-modal-map-active .home-public > section.home-tipos-resumen {
    display: none !important;
  }

  body.reporte-modal-map-active .home-map-section {
    padding-top: 0;
    padding-bottom: var(--space-2);
  }

  body.reporte-modal-map-active .home-map-shell {
    padding-top: 0;
  }

  body.reporte-modal-map-active .home-map-layout {
    gap: var(--space-2);
  }

  body.reporte-modal-map-active .home-sidebar {
    display: none !important;
  }

  body.reporte-modal-map-active .home-map-hint {
    display: none;
  }

  body.reporte-modal-map-active .home-map-filters {
    margin-bottom: var(--space-2);
    padding-top: var(--space-1);
    padding-bottom: 0;
  }

  body.reporte-modal-map-active .home-map-filters__mobile-bar {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  body.reporte-modal-map-active .home-map-filters__toggle {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    font-size: 0.8125rem;
  }

  body.reporte-modal-map-active #mapa-publico {
    height: min(68vh, 540px);
    min-height: 340px;
  }
}
