:root {
  --background: #f4f1e9;
  --card: #ffffff;
  --text: #1d2924;
  --muted: #617067;
  --border: #d7ded8;
  --green: #145c49;
  --green-dark: #0d4638;
  --green-light: #e7f1ed;
  --orange: #e89042;
  --orange-light: #fff1df;
  --danger: #a13b32;
  --shadow: 0 10px 30px rgba(20, 50, 40, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--text); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
a { color: var(--green); }
main { width: min(780px, 100%); margin: 0 auto; padding: 0 18px 48px; }
.narrow-page { width: min(680px, 100%); }
.admin-page { width: min(1380px, 100%); }

.top-nav, .admin-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; font-size: .93rem; }
.top-nav > div, .admin-nav > div { display: flex; flex-wrap: wrap; gap: 13px; }
.top-nav a, .admin-nav a { text-decoration: none; font-weight: 750; }
.brand { color: var(--text) !important; font-weight: 850 !important; }

.hero { margin: 0 -18px 18px; padding: 30px 20px; background: var(--green); color: #fff; border-radius: 0 0 26px 26px; }
.hero-kicker, .eyebrow { margin: 0 0 7px; color: var(--orange); font-size: .79rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.hero h1 { margin: 0 0 10px; max-width: 680px; font-size: clamp(2.4rem, 8vw, 4.8rem); line-height: .95; letter-spacing: -.055em; }
.hero p:last-child { max-width: 640px; margin: 0; font-size: 1.06rem; opacity: .96; }
.compact-hero h1 { font-size: clamp(2.5rem, 9vw, 4rem); }

.intro-strip { margin: 0 0 18px; padding: 15px 17px; background: var(--orange-light); border: 1px solid #efbb7c; border-radius: 16px; color: #4c361f; }
.intro-strip p { margin: 0; }
.card { margin: 16px 0; padding: 20px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.card h2 { margin-top: 0; }
.information-card p:last-child, .information-card ul:last-child { margin-bottom: 0; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { width: 100%; margin-bottom: 6px; padding: 0; font-size: 1.18rem; font-weight: 850; }
.section-number { display: inline-flex; width: 30px; height: 30px; margin-right: 8px; align-items: center; justify-content: center; background: var(--green); border-radius: 50%; color: #fff; font-size: .9rem; font-weight: 850; vertical-align: middle; }
.help, .privacy-note, .submit-note { color: var(--muted); font-size: .92rem; }
.help { margin: 0 0 14px; }
.required { margin-left: 2px; color: var(--danger); }
.optional { color: var(--muted); font-size: .88rem; font-weight: 500; }
.field { margin-top: 15px; }
.field:first-child { margin-top: 0; }
.field label { display: block; margin-bottom: 7px; font-weight: 760; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="time"], select, textarea { width: 100%; padding: 13px 14px; background: #fff; border: 1px solid var(--border); border-radius: 12px; color: var(--text); outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(20,92,73,.11); }
textarea { min-height: 100px; resize: vertical; }

.choice-grid { display: grid; gap: 10px; }
.two-choice-grid, .checkbox-grid, .setting-grid { grid-template-columns: 1fr 1fr; }
.checkbox-grid { display: grid; gap: 9px; }
.choice-card { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 14px; background: #fff; border: 1px solid var(--border); border-radius: 14px; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.choice-card:hover { border-color: #9ab8ac; transform: translateY(-1px); }
.choice-card:has(input:checked) { background: var(--green-light); border-color: var(--green); box-shadow: 0 0 0 2px rgba(20,92,73,.1); }
.choice-card input { width: 19px; height: 19px; margin: 2px 0 0; accent-color: var(--green); flex: 0 0 auto; }
.choice-title { display: block; font-weight: 780; }
.choice-description { display: block; margin-top: 2px; color: var(--muted); font-size: .89rem; }

.conditional-panel { display: none; margin-top: 14px; padding: 15px; background: #f8faf8; border: 1px solid var(--border); border-radius: 15px; }
.conditional-panel.is-visible { display: block; animation: reveal .2s ease; }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.primary-button, .secondary-button, .submit-button, .button-link { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-radius: 13px; font-weight: 820; cursor: pointer; text-decoration: none; }
.primary-button, .submit-button, .button-link { background: var(--green); border: 0; color: #fff; }
.primary-button, .submit-button { width: 100%; }
.primary-button:hover, .submit-button:hover, .button-link:hover { background: var(--green-dark); }
.secondary-button, .secondary-link { background: #fff; border: 1px solid var(--green); color: var(--green); }
.compact-button { width: auto; min-width: 110px; }
.disabled-link { opacity: .58; cursor: default; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

.location-status { display: none; margin-top: 12px; padding: 12px; background: var(--green-light); border: 1px solid #b8d5c9; border-radius: 12px; color: var(--green-dark); font-size: .94rem; }
.location-status.is-visible { display: block; }
.location-status.error-state { background: #fff0ee; border-color: #efc4bd; color: var(--danger); }
.search-row { display: flex; gap: 9px; }
.search-results { display: grid; gap: 7px; margin-top: 10px; }
.search-result { display: flex; flex-direction: column; width: 100%; padding: 11px 12px; text-align: left; background: #fff; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; }
.search-result:hover { border-color: var(--green); background: var(--green-light); }
.search-result span { color: var(--muted); font-size: .85rem; }
.search-message { margin: 4px 0; color: var(--muted); font-size: .92rem; }
.error-text { color: var(--danger); }
.location-map { height: 310px; margin-top: 14px; overflow: hidden; border: 1px solid #b8cbbf; border-radius: 15px; }

.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale label { display: block; margin: 0; padding: 11px 5px; background: #fff; border: 1px solid var(--border); border-radius: 12px; text-align: center; font-weight: 850; cursor: pointer; }
.scale label:has(input:checked) { background: var(--green); border-color: var(--green); color: #fff; }
.scale input { display: block; width: 18px; height: 18px; margin: 0 auto 6px; accent-color: var(--orange); }
.scale-help { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; margin-bottom: 0; }

.review-card { border-color: #efbb7c; background: #fffbf5; }
.review-heading, .section-heading, .map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.review-heading h2 { margin: 0; }
.review-badge { padding: 6px 10px; background: var(--orange-light); border-radius: 999px; color: #79501f; font-size: .8rem; font-weight: 800; }
.summary-list { display: grid; gap: 0; margin: 18px 0; border-top: 1px solid #ead7bc; }
.summary-list > div { display: grid; grid-template-columns: 125px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid #ead7bc; }
.summary-list dt { color: var(--muted); font-weight: 760; }
.summary-list dd { margin: 0; font-weight: 720; overflow-wrap: anywhere; }
.submit-button { margin-top: 16px; font-size: 1.06rem; }
.submit-note { margin: 9px 0 0; text-align: center; }

.error { margin: 14px 0; padding: 13px; background: #fff0ee; border: 1px solid #efc4bd; border-radius: 12px; color: var(--danger); }
.success-card { background: var(--green-light); border-color: #b8d5c9; }
.notice { margin: 14px 0; padding: 13px; background: var(--green-light); border: 1px solid #b8d5c9; border-radius: 12px; color: var(--green-dark); }
.contact-message { min-height: 190px; }
.muted-text { color: var(--muted); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.honeypot { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.plain-list { padding-left: 1.25rem; }
.plain-list li { margin: 8px 0; }
.text-link { font-weight: 800; text-decoration: none; }
.faq details { padding: 12px 0; border-top: 1px solid var(--border); }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 820; }
.faq p { margin-bottom: 0; color: var(--muted); }
.site-footer { padding: 20px 0; color: var(--muted); font-size: .88rem; text-align: center; }
.site-footer p { margin: 5px 0; }
.attribution { font-size: .8rem; }

.page-heading { padding: 28px 0 12px; }
.page-heading h1 { margin: 0 0 8px; font-size: clamp(2rem, 7vw, 3.5rem); letter-spacing: -.04em; }
.page-heading p:last-child { max-width: 680px; color: var(--muted); }
.map-card { padding: 14px; }
.public-map { height: 580px; margin-top: 13px; border-radius: 14px; }
.filter-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-buttons button { padding: 8px 11px; background: #fff; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-weight: 750; }
.filter-buttons button.active { background: var(--green); border-color: var(--green); color: #fff; }

.admin-nav { position: sticky; top: 0; z-index: 500; margin: 0 -18px; padding: 13px 18px; background: rgba(244,241,233,.96); border-bottom: 1px solid var(--border); backdrop-filter: blur(8px); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat-card { padding: 18px; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.stat-card span { display: block; color: var(--muted); font-size: .88rem; }
.stat-card strong { display: block; margin-top: 5px; font-size: 2.1rem; }
.chart-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
.chart-card { min-width: 0; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: .88rem; }
th, td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: #fff; white-space: nowrap; }
td p { margin: 7px 0 0; }
.filter-form { display: grid; grid-template-columns: 2fr 1fr auto; gap: 12px; align-items: end; }
.message-filter-form { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr auto; gap: 12px; align-items: end; }
.message-cell { min-width: 300px; max-width: 560px; overflow-wrap: anywhere; white-space: normal; }
.inline-action-form { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.inline-action-form select { min-width: 105px; padding: 8px 9px; }
.small-button { min-height: 38px; min-width: 0; padding: 8px 11px; border-radius: 10px; }
.danger-button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; padding: 8px 11px; background: #fff; border: 1px solid var(--danger); border-radius: 10px; color: var(--danger); font-weight: 820; cursor: pointer; }
.danger-button:hover { background: #fff0ee; }
.status-badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .78rem; font-weight: 850; }
.status-new { background: var(--orange-light); color: #79501f; }
.status-read { background: #edf1ef; color: #46574f; }
.status-resolved { background: var(--green-light); color: var(--green-dark); }
.login-page { display: grid; min-height: 100vh; place-items: center; }
.login-card { width: min(430px, 100%); }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  main { padding-left: 14px; padding-right: 14px; }
  .hero { margin-left: -14px; margin-right: -14px; }
  .top-nav, .admin-nav, .map-toolbar { align-items: flex-start; flex-direction: column; }
  .two-choice-grid, .checkbox-grid, .setting-grid, .two-columns, .filter-form, .message-filter-form { grid-template-columns: 1fr; }
  .search-row { flex-direction: column; }
  .compact-button { width: 100%; }
  .summary-list > div { grid-template-columns: 1fr; gap: 2px; }
  .scale-help { align-items: flex-start; flex-direction: column; }
  .location-map { height: 280px; }
  .public-map { height: 500px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr; }
}

.related-links {
  margin-top: 1.5rem;
}

.related-links h3 {
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.related-links-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-links-list a {
  display: block;
  padding: 0.85rem 1rem;
  color: inherit;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(20, 63, 50, 0.15);
  border-radius: 0.6rem;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    background 0.15s ease;
}

.related-links-list a:hover,
.related-links-list a:focus-visible {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(20, 63, 50, 0.4);
  transform: translateY(-1px);
}

.related-links-list strong {
  display: block;
  color: #123f32;
  line-height: 1.35;
}

.related-links-list span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.9rem;
  opacity: 0.72;
}
