:root {
  --ink: #17221d;
  --muted: #637069;
  --paper: #f5f3ed;
  --card: #fffefa;
  --line: #dcded7;
  --forest: #174a34;
  --forest-dark: #0b2e20;
  --lime: #d9f26a;
  --rust: #b94c2e;
  --shadow: 0 18px 50px rgb(20 51 36 / 8%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", sans-serif;
  line-height: 1.55;
}
a { color: inherit; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

.hero {
  color: #f9f8f2;
  background:
    radial-gradient(circle at 86% 18%, rgb(217 242 106 / 15%), transparent 28%),
    linear-gradient(135deg, var(--forest-dark), var(--forest));
  border-bottom: 5px solid var(--lime);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding-block: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 38px;
  aspect-ratio: 1;
  place-items: center;
  color: var(--forest-dark);
  background: var(--lime);
  border-radius: 50%;
  font-size: 12px;
  letter-spacing: -.05em;
}
.nav-links { display: flex; gap: 22px; color: #c8d8cf; font-size: 14px; }
.nav-links a { text-underline-offset: 4px; }
.nav-links a:hover { color: white; }
.hero-content { padding: 88px 0 96px; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--rust);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero .eyebrow { color: var(--lime); }
h1, h2, h3 { font-family: "Newsreader", serif; line-height: 1.05; }
h1 { max-width: 900px; margin: 0; font-size: clamp(52px, 8vw, 96px); letter-spacing: -.045em; }
h1 em { color: var(--lime); font-weight: 600; }
.lede { max-width: 750px; margin: 34px 0 30px; color: #d9e5de; font-size: clamp(17px, 2vw, 21px); }
.run-status { display: flex; align-items: center; gap: 10px; color: #bcd0c4; font-size: 14px; }
.pulse { width: 9px; height: 9px; background: var(--lime); border-radius: 50%; box-shadow: 0 0 0 5px rgb(217 242 106 / 13%); }
.pulse.error { background: #ff9477; box-shadow: 0 0 0 5px rgb(255 148 119 / 13%); }

.main-layout { padding-block: 48px 80px; }
.intelligence { margin-bottom: 54px; padding: 38px; background: #fffefa; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.intelligence-heading, .matrix-heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.intelligence-heading h2 { max-width: 850px; margin: 0; font-size: clamp(38px, 6vw, 66px); }
.assessment-mode { flex: none; padding: 7px 12px; color: var(--forest-dark); background: var(--lime); border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.assessment-mode.fallback { color: #69402e; background: #f6d9bf; }
.brief-summary { max-width: 900px; margin: 24px 0 30px; color: #46534c; font-size: 18px; }
.readability-line { margin: -20px 0 26px; color: var(--muted); font-size: 11px; }
.readability-line.miss { color: #8b3f2a; }
.assessment-stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.assessment-stats > div { display: grid; gap: 2px; padding: 20px; border-right: 1px solid var(--line); }
.assessment-stats > div:last-child { border-right: 0; }
.assessment-stats strong { color: var(--forest); font: 700 32px "Newsreader", serif; }
.assessment-stats span { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.brief-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 34px; margin-top: 38px; }
.brief-grid h3, .matrix-heading h3 { margin: 0 0 18px; font-size: 27px; }
.municipality-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.municipality-grid > div { display: grid; padding: 15px; background: #f3f4ee; border-radius: 10px; }
.municipality-grid span { color: var(--muted); font-size: 12px; }
.watch-panel { padding: 22px; color: #eef6f1; background: var(--forest); border-radius: 14px; }
.watch-panel ol { display: grid; gap: 12px; margin: 0; padding-left: 22px; color: #d9e5de; font-size: 13px; }
.matrix-heading { align-items: end; margin-top: 46px; padding-top: 35px; border-top: 1px solid var(--line); }
.secondary-matrix-heading { margin-top: 34px; }
.matrix-heading h3 { margin-bottom: 0; font-size: 32px; }
.matrix-heading > p { max-width: 280px; margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.matrix-wrap { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; min-width: 1480px; border-collapse: collapse; font-size: 12px; }
th { padding: 13px 14px; color: var(--muted); background: #f0f1eb; font-size: 10px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 16px 14px; border-top: 1px solid var(--line); vertical-align: top; }
td a { display: block; color: var(--forest); font-weight: 700; text-decoration: none; }
td a:hover { text-decoration: underline; }
td small { display: -webkit-box; max-width: 420px; margin-top: 5px; overflow: hidden; color: var(--muted); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.matrix-place { color: var(--rust); font-weight: 700; }
.tier-badge { display: inline-block; width: fit-content; margin-top: 7px; padding: 3px 6px; color: var(--muted); background: #edf0eb; border-radius: 4px; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.tier-badge.deep { color: var(--forest-dark); background: var(--lime); }
td small.deep-note { padding: 8px 10px; color: var(--forest-dark); background: #f0f5ed; border-left: 2px solid var(--lime); -webkit-line-clamp: 4; }
.matrix-copy { min-width: 180px; max-width: 260px; line-height: 1.45; }
.matrix-lenses { min-width: 300px; max-width: 390px; }
.matrix-lenses p { margin: 0 0 8px; line-height: 1.4; }
.matrix-lenses p:last-child { margin-bottom: 0; }
.matrix-lenses strong { color: var(--forest); }
.score-dots { display: flex; gap: 3px; padding-top: 3px; }
.score-dots i { width: 7px; height: 7px; background: #d9ddd7; border-radius: 50%; }
.score-dots i.filled { background: var(--forest); }
.assessment-warning { margin: 16px 0 0; padding: 12px 15px; color: #7b452e; background: #f8e6d7; border-radius: 8px; font-size: 12px; }
#signals { scroll-margin-top: 20px; }
.controls { position: sticky; z-index: 5; top: 0; padding: 18px; background: rgb(245 243 237 / 94%); border: 1px solid var(--line); border-radius: 18px; backdrop-filter: blur(16px); }
.search-box { display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.search-box:focus-within { border-color: var(--forest); box-shadow: 0 0 0 3px rgb(23 74 52 / 10%); }
.search-box svg { width: 20px; fill: none; stroke: var(--muted); stroke-linecap: round; stroke-width: 1.8; }
.search-box input { width: 100%; padding: 15px 0; color: var(--ink); background: none; border: 0; outline: 0; font: inherit; }
.filter-row { display: flex; gap: 16px; justify-content: space-between; margin-top: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, select, .load-more {
  min-height: 40px;
  padding: 8px 14px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 600 13px "DM Sans", sans-serif;
  cursor: pointer;
}
.chip:hover, .chip.active { color: white; background: var(--forest); border-color: var(--forest); }
select { border-radius: 10px; }
.results-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 58px 0 24px; }
.results-header h2 { margin: 0; font-size: clamp(32px, 5vw, 50px); }

.record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.record-card { display: flex; flex-direction: column; min-height: 350px; padding: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.card-meta > *:not(:last-child)::after { content: "·"; margin-left: 8px; color: #a8afa9; }
.jurisdiction { color: var(--rust); }
.record-card h3 { margin: 20px 0 8px; font-size: clamp(25px, 3vw, 34px); }
.record-title { text-decoration: none; }
.record-title:hover { color: var(--forest); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.source { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.record-tldr { margin: 0 0 18px; padding: 13px; background: #f0f5ed; border-left: 3px solid var(--lime); border-radius: 0 8px 8px 0; }
.tldr-label { color: var(--forest); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.record-tldr .tldr-text { margin: 6px 0 0; color: var(--forest-dark); font-size: 14px; line-height: 1.45; }
.record-tldr .tldr-limit { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.chunks { display: grid; gap: 12px; margin-bottom: 20px; }
.chunk { margin: 0; padding-left: 15px; color: #3f4c45; border-left: 2px solid var(--lime); font-size: 14px; }
.terms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.term { padding: 4px 8px; color: var(--forest); background: #e9f0e8; border-radius: 5px; font-size: 11px; font-weight: 600; }
.read-source { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--forest); font-size: 13px; font-weight: 700; text-decoration: none; }
.read-source:hover span { transform: translate(2px, -2px); }
.read-source span { transition: transform .2s ease; }
.load-more { display: block; margin: 30px auto 0; padding-inline: 24px; color: white; background: var(--forest); }
.empty { grid-column: 1 / -1; padding: 60px 20px; color: var(--muted); text-align: center; border: 1px dashed #bbc0bb; border-radius: 16px; }

.methodology { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; margin-top: 100px; padding: 50px 0 10px; border-top: 1px solid var(--line); }
.methodology h2 { margin: 0; font-size: clamp(34px, 5vw, 54px); }
.methodology-copy { color: var(--muted); font-size: 16px; }
.methodology-copy p:first-child { margin-top: 0; }
footer { color: #b9c9c0; background: var(--forest-dark); }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; padding-block: 32px; font-size: 13px; }

@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 1180px); }
  .nav-links a:not(:last-child) { display: none; }
  .hero-content { padding: 60px 0 68px; }
  .lede { margin-top: 24px; }
  .controls { top: 8px; }
  .filter-row { align-items: stretch; flex-direction: column; }
  .filter-row select { width: 100%; }
  .record-grid, .methodology, .brief-grid { grid-template-columns: 1fr; }
  .intelligence { padding: 24px 18px; }
  .intelligence-heading, .matrix-heading { align-items: start; flex-direction: column; }
  .assessment-stats { grid-template-columns: repeat(2, 1fr); }
  .assessment-stats > div:nth-child(2) { border-right: 0; }
  .assessment-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .municipality-grid { grid-template-columns: 1fr; }
  .matrix-heading > p { text-align: left; }
  .methodology { gap: 30px; margin-top: 70px; }
  .record-card { min-height: auto; padding: 22px; }
  .results-header { align-items: start; flex-direction: column; }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
