@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700&family=Public+Sans:wght@400;500;600&display=swap");

:root {
  --bg: #f3efe3;
  --panel: rgba(255, 252, 247, 0.92);
  --panel-strong: #fffdf8;
  --ink: #173033;
  --muted: #5f7274;
  --line: rgba(23, 48, 51, 0.14);
  --accent: #0f766e;
  --accent-deep: #0a4f4b;
  --good: #2d7b57;
  --bad: #b6423c;
  --shadow: 0 20px 45px rgba(20, 37, 38, 0.16);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Public Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 28rem),
    radial-gradient(circle at bottom right, rgba(182, 66, 60, 0.12), transparent 24rem),
    linear-gradient(180deg, #f8f4ea 0%, #efe8db 100%);
}

a {
  color: var(--accent-deep);
}

.page-shell {
  width: min(1360px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 1.5rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 360px);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.eyebrow,
.section-label {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

h1,
h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

h2 {
  font-size: 1.5rem;
}

.lede {
  max-width: 52rem;
  margin: 0.75rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-note {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(160deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.4));
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 18px;
}

.hero-note p,
.hero-note span {
  margin: 0;
  color: var(--muted);
}

.workspace {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
}

.controls {
  display: grid;
  gap: 1rem;
  align-content: start;
  padding: 1.25rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field span {
  font-size: 0.95rem;
  font-weight: 600;
}

.field select,
.field input,
.button {
  width: 100%;
  border: 1px solid rgba(23, 48, 51, 0.16);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  font: inherit;
  color: var(--ink);
  background: var(--panel-strong);
}

.button {
  cursor: pointer;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border: none;
}

.summary-card,
.legend {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(23, 48, 51, 0.08);
}

#summary {
  line-height: 1.6;
  color: var(--muted);
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.55rem;
  color: var(--muted);
}

.swatch {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  display: inline-block;
}

.swatch-good {
  background: var(--good);
}

.swatch-bad {
  background: var(--bad);
}

.swatch-unknown {
  background: #68747d;
}

.map-wrap {
  padding: 0.75rem;
}

#map {
  min-height: 72vh;
  border-radius: 18px;
  overflow: hidden;
}

.popup h3 {
  margin: 0 0 0.4rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.1rem;
}

.popup p {
  margin: 0.25rem 0;
  line-height: 1.45;
}

.report-shell {
  max-width: 900px;
}

.report-content {
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.report-content h2 {
  margin-top: 2rem;
}

.violations-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.violations-list p {
  white-space: pre-wrap;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100% - 1rem, 1360px);
    padding-top: 0.5rem;
  }

  #map {
    min-height: 60vh;
  }
}

.explore-column { display: grid; gap: 1rem; min-width: 0; align-content: start; }
.results-panel { padding: 1.25rem; }
.results-header { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; }
.results-header .field { min-width: 10rem; }
.result-list { list-style: none; padding: 0; margin: 0; }
.result-card { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding: 1.15rem 0; }
.result-card h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.result-card p { margin: .35rem 0; line-height: 1.5; color: var(--muted); }
.result-actions { display: flex; flex-direction: column; gap: .75rem; align-items: start; flex: 0 0 10rem; }
.button.secondary { color: var(--accent-deep); background: var(--panel-strong); border: 1px solid var(--line); }
.button:disabled { opacity: .55; cursor: default; }
.status-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; }
.location-note { font-style: italic; }
.result-card, .history-list, .report-content { overflow-wrap: anywhere; }
.history-list { padding-left: 1.25rem; line-height: 1.5; }
.history-list li { margin: .75rem 0; }
.history-list a[aria-current] { font-weight: 700; color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
@media (max-width: 600px) {
  .result-card { flex-direction: column; }
  .result-actions { flex-basis: auto; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .result-actions .button { width: auto; }
}
.admin-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem; gap: 1rem; }
.admin-header .button { width: auto; }
.admin-login { max-width: 26rem; margin: 2rem auto; padding: 1.5rem; display: grid; gap: 1rem; }
#pinMap { height: 450px; border-radius: 14px; margin: 1rem 0; }
.pin-form { display: grid; gap: 1rem; }
.coordinate-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field textarea { font: inherit; padding: .85rem; border: 1px solid var(--line); border-radius: 14px; width: 100%; }
.error-message { color: var(--bad); font-weight: 600; }
#facilitySelect { max-width: 100%; font-size: .85rem; }
@media (max-width: 600px) { .coordinate-fields { grid-template-columns: 1fr; } #pinMap { height: 350px; } }
.controls, .pin-form .field { min-width: 0; }
