.pma-map-widget,
.pma-map-widget * {
  box-sizing: border-box;
}

.pma-map-widget {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  font-family: 'Poppins', sans-serif;
}

.pma-topbar {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #e8e8e8;
}

.pma-topbar h2 {
  font-size: 22px;
  font-weight: 700;
  color: #267331;
  line-height: 1.25;
  margin: 0;
}

.pma-topbar p {
  font-size: 12px;
  color: #929292;
  margin: 4px 0 0;
}

.pma-map-ctrls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.pma-toggle-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #929292;
  cursor: pointer;
  user-select: none;
}

.pma-toggle-label input {
  accent-color: #267331;
  cursor: pointer;
  width: 14px;
  height: 14px;
}

.pma-filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.pma-filter-wrap label {
  font-size: 12px;
  font-weight: 700;
  color: #333;
  white-space: nowrap;
}

.pma-filter-select {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  padding: 6px 12px;
  border: 1.5px solid #267331;
  border-radius: 6px;
  color: #267331;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  outline: none;
}

.pma-filter-select:hover {
  background: #f0f8f0;
}

.pma-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #929292;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.pma-lbar {
  display: flex;
  height: 9px;
  width: 150px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #e8e8e8;
}

.pma-legend-metric {
  font-size: 11px;
  color: #267331;
  font-weight: 700;
  margin-left: 4px;
}

.pma-pa-map {
  width: 100%;
  height: auto;
  display: block;
}

.pma-county-path {
  cursor: pointer;
  stroke: #fff;
  stroke-width: 0.5;
  transition: fill 0.35s ease, opacity 0.12s;
}

.pma-county-path:hover {
  opacity: 0.72;
  stroke-width: 1.2;
}

.pma-county-path.is-selected {
  stroke: #267331;
  stroke-width: 2.5;
  opacity: 1;
}

.pma-county-label {
  font-size: 6.5px;
  fill: rgba(255,255,255,0.93);
  pointer-events: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: rgba(0,0,0,0.25);
  stroke-width: 2px;
  display: none;
}

.pma-tooltip {
  position: fixed;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  font-family: 'Poppins', sans-serif;
  pointer-events: none;
  display: none;
  z-index: 9999;
  min-width: 200px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.pma-tt-name {
  font-size: 13px;
  font-weight: 700;
  color: #267331;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid #e8e8e8;
}

.pma-tt-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 4px;
}

.pma-tt-label {
  color: #929292;
  font-size: 11px;
}

.pma-tt-val {
  font-weight: 700;
  color: #333;
  font-size: 11px;
}

.pma-nosel {
  font-size: 13px;
  color: #929292;
  text-align: center;
  padding: 1.25rem;
  background: #f5f5f5;
  border-radius: 8px;
  margin-top: 0.75rem;
}

.pma-detail {
  display: none;
  margin-top: 0.75rem;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 1.5rem;
}

.pma-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.pma-detail-title {
  font-size: 20px;
  font-weight: 700;
  color: #267331;
}

.pma-detail-sub {
  font-size: 12px;
  color: #929292;
  margin-top: 3px;
}

.pma-detail-close {
  background: none;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  color: #929292;
  font-family: 'Poppins', sans-serif;
  flex-shrink: 0;
  margin-left: 12px;
}

.pma-detail-close:hover {
  background: #f5f5f5;
}

.pma-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.pma-stat-card {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 12px 14px;
}

.pma-stat-label {
  font-size: 10px;
  color: #929292;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  font-weight: 600;
}

.pma-stat-val {
  font-size: 20px;
  font-weight: 700;
  color: #267331;
  line-height: 1.2;
}

.pma-stat-sub {
  font-size: 10px;
  color: #929292;
  margin-top: 3px;
}

.pma-mobile-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  align-items: flex-end;
  justify-content: center;
}

.pma-mobile-modal.is-open {
  display: flex;
}

.pma-mobile-sheet {
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 1.5rem;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  font-family: 'Poppins', sans-serif;
}

@media (max-width: 600px) {
  .pma-topbar h2 {
    font-size: 18px;
  }

  .pma-filter-wrap {
    margin-left: 0;
    width: 100%;
  }

  .pma-stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }
}