:root {
  --paper: #f8fafc;
  --ink: #111827;
  --muted: #4b5563;
  --accent: #0f079a;
  --warning: #c2410c;
  --card: #ffffff;
  --line: #e5e7eb;
  --shadow: rgba(17, 24, 39, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

h1,
h2 {
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

p {
  margin: 0 0 1rem;
}

ul {
  margin: 0;
  padding-left: 1.1rem;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.site-header {
  background: #eef2ff;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.lead {
  font-size: 1.1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 22px var(--shadow);
}

.legal {
  background: #fdfbf7;
}

.facts-block {
  margin-top: 1.2rem;
}

.facts-heading {
  font-size: 1.1rem;
  margin-bottom: 0.9rem;
}

.facts-period {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.facts-list {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.5rem 0.8rem;
  display: grid;
  gap: 0.4rem;
}

.facts-item {
  display: grid;
  gap: 0.3rem;
  padding: 0.35rem 0;
}

.facts-item-wide {
  grid-template-columns: 1fr;
}

.facts-item-wide .facts-value {
  text-align: left;
}

.facts-item + .facts-item {
  border-top: 1px solid #e5e7eb;
}

.facts-key {
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.82rem;
}

.facts-value {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
}

.facts-note {
  grid-column: 1 / -1;
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: -0.05rem;
}

.facts-line {
  color: #374151;
  font-weight: 600;
  font-size: 0.98rem;
}

.facts-note-inline {
  font-weight: 600;
  color: var(--muted);
}

.hl {
  background: #eef2ff;
  border-radius: 6px;
  padding: 0.05rem 0.25rem;
}

.hl-warn {
  background: #fff1d6;
  color: #a16207;
}

.hl-critical {
  background: #fee2e2;
  color: #991b1b;
}


.note {
  color: var(--muted);
  font-size: 0.95rem;
}

.note.warning {
  color: var(--warning);
}

.highlight-note {
  background: #fff7cc;
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
  display: inline-block;
}

.untreated-block {
  background: #f8f9ff;
  border-top: 1px dashed #c7cbe6;
  border-bottom: 1px dashed #c7cbe6;
  padding: 0.9rem 0.9rem 0.2rem;
  margin: 0.8rem 0 1.2rem;
}

.location-consent {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0 0.6rem;
  cursor: pointer;
}

.location-note {
  margin: 0.2rem 0 0.6rem;
  font-size: 0.78rem;
}

.location-consent input {
  cursor: pointer;
}

.location-consent input:disabled {
  opacity: 0.6;
}


#map-status {
  text-align: center;
}

#submit-status {
  margin-top: 0.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  padding: 0 1.3rem;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}

.button:hover,
.button:focus {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px var(--shadow);
  background: #eef2ff;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button.primary:hover,
.button.primary:focus {
  background: #4338ca;
  border-color: #4338ca;
}

.button:disabled,
.button[disabled] {
  background: #d1d5db;
  border-color: #d1d5db;
  color: #6b7280;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.progress-block {
  margin: 1rem 0 1.25rem;
}

.photo-preview {
  margin-bottom: 0.5rem;
}

#photo-block {
  margin-bottom: 1.5rem;
}

.confirmation {
  margin-top: 1rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.progress-track {
  height: 8px;
  background: #ece4d5;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.progress-fill {
  height: 100%;
  background: #1f7a43;
  width: 0%;
  transition: width 0.2s ease;
}

.question-block {
  border: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.question-block legend {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.question-block .note {
  margin-top: -0.25rem;
  margin-bottom: 0.75rem;
}

.segmented {
  gap: 0.6rem;
  margin-bottom: 0.2rem;
}

.question-block legend::after {
  content: "";
}

.question-block.answered legend {
  color: #1f7a43;
}

.question-block.answered legend::after {
  content: " ✅";
  color: #1f7a43;
}

.segmented {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.segmented input {
  margin-right: 0.4rem;
}

.segmented label {
  border: 1px solid var(--line);
  padding: 0.6rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  min-width: 110px;
  text-align: left;
}

.step {
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line);
  margin-top: 1rem;
}

.photo-preview {
  margin-top: 0.75rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

#photo-canvas {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f2efe8;
}

.location-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.turnstile-block {
  margin-bottom: 1rem;
}

.turnstile-widget {
  min-height: 65px;
}

.status {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-weight: 600;
}

.status-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid var(--line);
}

.stats {
  margin: 1rem 0;
}

.cta-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.cta-row .button {
  min-width: 180px;
  text-align: center;
}

.cta-center {
  justify-content: center;
}

.mail-link {
  font-size: 1.5rem;
  text-decoration: none;
}

.map-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-row select {
  min-width: 180px;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 44px;
  gap: 0.35rem;
  margin: 1rem 0;
}

.map-canvas {
  height: min(70vh, 520px);
  border-radius: 16px;
  border: 1px solid var(--line);
  margin: 1rem 0;
  overflow: hidden;
}

.cluster-marker {
  background: #1f3b4d;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 2px solid #ffffff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

.cluster-marker span {
  font-size: 0.9rem;
  line-height: 1;
}

.map-popup {
  font-size: 0.85rem;
  line-height: 1.25;
  min-width: 220px;
}


.map-popup strong {
  display: inline-block;
  font-weight: 700;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.popup-score {
  font-size: 0.8rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #e5e7eb;
  color: #111827;
  font-weight: 700;
}

.popup-score.score-3 {
  background: #dcfce7;
  color: #166534;
}

.popup-score.score-2 {
  background: #fef3c7;
  color: #92400e;
}

.popup-score.score-1 {
  background: #ffedd5;
  color: #9a3412;
}

.popup-score.score-0 {
  background: #fee2e2;
  color: #991b1b;
}

.popup-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.popup-flag {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.popup-flag.score-3 {
  color: #166534;
}

.popup-flag.score-2 {
  color: #92400e;
}

.popup-flag.score-1,
.popup-flag.score-0 {
  color: #991b1b;
}

.popup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.6rem;
}

.popup-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.popup-item strong {
  font-size: 0.85rem;
}

.leaflet-popup-content {
  margin: 8px 10px;
}

.map-cell {
  border-radius: 8px;
  background: #f0ede5;
  border: 1px solid var(--line);
}

.map-cell.low {
  background: #dfe9df;
}

.map-cell.medium {
  background: #f3e0b8;
}

.map-cell.high {
  background: #f0b6a0;
}

.map-cell.critical {
  background: #e97866;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.stats-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  background: #fdfbf7;
}

.stats-item strong {
  display: block;
  margin-bottom: 0.35rem;
}

.hidden {
  display: none;
}

.site-footer {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  font-weight: 600;
}

.footer-nav a:hover,
.footer-nav a:focus {
  color: #0a4a3c;
}

@media (max-width: 540px) {
  .container {
    padding: 1.5rem 1rem;
  }

  .segmented {
    flex-direction: column;
  }

  .segmented label {
    width: 100%;
  }
}

.learn-more {
  margin-left: 0.25rem;
  font-size: 0.95em;
  color: var(--muted-text);
}
.learn-more:hover {
  color: var(--primary);
}
