:root {
  color-scheme: light;
  --ink: #222620;
  --muted: #686f66;
  --paper: #f4f4f0;
  --surface: #ffffff;
  --line: #d7d7cf;
  --primary: #315f43;
  --primary-dark: #1f4931;
  --accent: #6f5c3e;
  --soft: #eef2ea;
  --danger: #a33a2a;
  --shadow: 0 8px 24px rgba(40, 42, 35, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}

a {
  color: var(--primary-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  font-size: clamp(1.9rem, 3.2vw, 3.3rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(1.25rem, 2vw, 1.85rem);
  line-height: 1.18;
  letter-spacing: 0;
}

select,
input,
textarea,
button {
  font: inherit;
  font-size: 16px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem max(1rem, calc((100vw - 1180px) / 2));
  background: rgba(244, 244, 240, 0.98);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}

.brand,
.top-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 4px;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary-dark);
  font-size: 0.82rem;
  letter-spacing: 0;
}

.top-nav {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-nav a,
.site-footer a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 410px);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 1rem;
  background: transparent;
}

.hero-copy p {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow {
  margin-bottom: 0.75rem;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.search-panel,
.form-card,
.side-panel,
.info-block,
.result-card,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: none;
}

.search-panel,
.form-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

label span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

select,
input,
textarea {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  padding: 0.7rem 0.8rem;
  -webkit-text-size-adjust: 100%;
}

textarea {
  resize: vertical;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border: 0;
  border-radius: 4px;
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  background: var(--soft);
  color: var(--primary-dark);
}

.band {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3.5rem) 1rem;
}

.band.compact {
  padding-block: 1rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.result-grid,
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.result-card,
.empty-state,
.info-block,
.side-panel {
  padding: 1.25rem;
}

.result-card h2,
.result-card h3 {
  font-size: 1.15rem;
  line-height: 1.25;
}

.muted {
  color: var(--muted);
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 0.85fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: stretch;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3.5rem) 1rem;
  background: transparent;
  min-width: 0;
}

.detail-hero h1 {
  font-size: clamp(1.9rem, 3vw, 3rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.map-actions a,
.side-panel > a {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.55rem 0.7rem;
  text-decoration: none;
}

.map,
.map-placeholder {
  min-height: 380px;
  width: 100%;
  max-width: 100%;
  border-radius: 4px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.map-placeholder {
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    linear-gradient(135deg, rgba(49, 95, 67, 0.08), rgba(111, 92, 62, 0.08)),
    #f7f7f2;
  text-align: center;
}

.map-placeholder h2 {
  margin-bottom: 0.35rem;
}

.map iframe {
  width: 100%;
  height: 100%;
  min-height: 380px;
  border: 0;
  display: block;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 1.25rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1rem clamp(1.5rem, 4vw, 3.5rem);
}

.content-stack {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.facts {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.facts div {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.facts dt {
  color: var(--muted);
  font-weight: 800;
}

.facts dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.tag-list li {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #f8f8f5;
  padding: 0.45rem 0.75rem;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.tag-list a {
  text-decoration: none;
}

.side-panel {
  align-self: start;
  display: grid;
  gap: 0.9rem;
  box-shadow: none;
  min-width: 0;
}

.link-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  padding: 1rem;
  text-decoration: none;
}

.link-grid small {
  color: var(--muted);
  white-space: nowrap;
}

.ad-slot {
  max-width: 1180px;
  margin: clamp(1rem, 3vw, 2rem) auto;
  min-height: 110px;
  border: 1px dashed var(--line);
  width: calc(100% - 2rem);
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.62);
}

.detail-layout .ad-slot {
  margin-inline: 0;
  max-width: 100%;
}

.narrow {
  max-width: 760px;
}

.notice {
  border-radius: 8px;
  padding: 1rem;
  background: var(--soft);
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice.error {
  color: var(--danger);
  background: #fff4f1;
  border: 1px solid #f0c7be;
}

.disclaimer,
.footer-disclaimer {
  border: 1px solid #d8c6a7;
  border-left: 4px solid var(--accent);
  border-radius: 3px;
  background: #fffaf0;
  padding: 1rem;
}

.disclaimer summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 750;
}

.disclaimer summary::marker {
  color: var(--accent);
}

.disclaimer p:first-of-type {
  margin-top: 0.75rem;
}

.footer-disclaimer h2 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.disclaimer p,
.footer-disclaimer p {
  color: #514736;
}

.disclaimer p:last-child,
.footer-disclaimer p:last-child {
  margin-bottom: 0;
}

.hidden-field {
  position: absolute;
  left: -9999px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem max(1rem, calc((100vw - 1180px) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer > div {
  max-width: 760px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

main,
section,
article,
aside,
div {
  min-width: 0;
}

.lede {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 720px;
}

.guide-index .section-heading {
  align-items: start;
}

.residue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.residue-card {
  background: var(--surface);
  padding: 1rem;
}

.residue-card small {
  color: var(--accent);
  font-weight: 800;
}

.residue-card h2 {
  margin-top: 0.35rem;
  font-size: 1.1rem;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(240px, 320px);
  gap: 1.25rem;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1rem clamp(1.5rem, 4vw, 3.5rem);
}

.article-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: clamp(1rem, 3vw, 2rem);
}

.check-list {
  display: grid;
  gap: 0.55rem;
  padding-left: 1.15rem;
}

.checklist-block .check-list {
  margin-bottom: 0;
}

.municipality-summary {
  margin-bottom: 1rem;
}

.municipality-summary .tag-list li {
  display: inline-grid;
  gap: 0.2rem;
}

.municipality-summary small {
  color: var(--muted);
}

.check-fieldset {
  display: grid;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.9rem;
}

.check-fieldset legend {
  color: var(--muted);
  font-weight: 750;
  padding: 0 0.35rem;
}

.check-fieldset label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.check-fieldset input {
  width: auto;
  min-height: auto;
}

.check-fieldset span {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
}

.legal-page .narrow,
.article-page .narrow {
  max-width: 820px;
}

.legal-page h2,
.article-body h2 {
  margin-top: 2rem;
  font-size: 1.35rem;
}

.legal-page {
  max-width: 940px;
}

.legal-page .narrow {
  max-width: none;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: clamp(1rem, 3vw, 2rem);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.96rem;
}

.legal-table th,
.legal-table td {
  border: 1px solid var(--line);
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  background: var(--soft);
  color: var(--ink);
}

.legal-list {
  display: grid;
  gap: 0.5rem;
  padding-left: 1.2rem;
}

@media (max-width: 820px) {
  .site-header,
  .site-footer,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .detail-hero,
  .detail-layout,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .facts div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .map {
    min-height: 300px;
  }

  .ad-slot {
    width: calc(100% - 2rem);
  }
}

@media (max-width: 520px) {
  .top-nav {
    gap: 0.55rem;
  }

  .top-nav a {
    font-size: 0.92rem;
  }

  .detail-hero,
  .detail-layout,
  .band,
  .article-layout {
    padding-inline: 1rem;
  }

  select,
  input,
  textarea,
  button {
    font-size: 16px;
  }

  .actions .button {
    width: 100%;
  }
}
