/* MuniDB portal. Palette roles follow the dataviz reference instance (sequential blue). */
:root {
  color-scheme: light;
  --surface-0: #f6f6f4;
  --surface-1: #fcfcfb;
  --border: #e3e2de;
  --grid: #ecebe7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #7a7974;
  --accent: #256abf;
  --bar: #2a78d6;
  --flag-bg: #fff3d6;
  --flag-ink: #6b4a00;
  --nodata-bg: #f1f0ec;
  --nodata-line: #c9c8c2;
  --mark: #fff0a8;
  --town-stroke: #fcfcfb;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface-0: #121211;
    --surface-1: #1a1a19;
    --border: #2f2f2d;
    --grid: #2a2a28;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted: #8f8e86;
    --accent: #86b6ef;
    --bar: #3987e5;
    --flag-bg: #3a2e10;
    --flag-ink: #f3d68a;
    --nodata-bg: #222220;
    --nodata-line: #444441;
    --mark: #5a4b00;
    --town-stroke: #1a1a19;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--surface-0); color: var(--text-primary);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 12.5px ui-monospace, "Cascadia Mono", Consolas, monospace; }
h1 { font-size: 28px; line-height: 1.2; margin: 24px 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 28px 0 10px; }
h3 { font-size: 14px; margin: 18px 0 6px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

header.site { background: var(--surface-1); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
header .bar { display: flex; align-items: center; gap: 20px; height: 56px; }
.brand { font-weight: 700; color: var(--text-primary); font-size: 17px; white-space: nowrap; }
.brand span { font-weight: 400; color: var(--text-secondary); }
header .search { flex: 1; max-width: 420px; }
header .search input { width: 100%; }
header nav { display: flex; gap: 18px; margin-left: auto; }
header nav a { color: var(--text-secondary); font-weight: 500; }

input[type=search], select, button {
  font: inherit; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-1); color: var(--text-primary); }
button { background: var(--accent); color: #fff; border-color: transparent; cursor: pointer; font-weight: 600; }

.hero { padding: 28px 0 8px; max-width: 820px; }
.hero h1 { font-size: 34px; }
.lede { font-size: 17px; color: var(--text-secondary); margin: 6px 0 16px; max-width: 820px; }
.bigsearch { display: flex; gap: 8px; }
.bigsearch input { flex: 1; font-size: 16px; padding: 11px 14px; }
.bigsearch button { padding: 0 20px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 24px 0; }
.tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.tile b { display: block; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile b small { font-size: 16px; color: var(--text-muted); font-weight: 500; }
.tile span { color: var(--text-secondary); font-size: 13px; }
.tiles.small .tile b { font-size: 22px; }
a.ast { font-size: .6em; vertical-align: super; color: var(--text-muted); margin-left: 1px; }

.mapgrid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; }
.mapgrid aside ul { columns: 1; max-height: 520px; overflow: auto; }
figure { margin: 0; }
.map svg { width: 100%; max-height: 640px; display: block; }
.town { stroke: var(--town-stroke); stroke-width: 1; transition: opacity .1s; }
a:hover .town, a:focus .town { stroke: var(--text-primary); stroke-width: 1.5; }
.nodata-bg { fill: var(--nodata-bg); }
.nodata-line { stroke: var(--nodata-line); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-secondary); margin-top: 8px; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.nodata-swatch { background: repeating-linear-gradient(45deg, var(--nodata-bg) 0 3px, var(--nodata-line) 3px 5px); }

.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }
.three { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; }
.chart svg { width: 100%; display: block; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--bar); }
.chart .hit:hover .bar { opacity: .8; }

.note { color: var(--text-secondary); font-size: 13.5px; }
.footnote { color: var(--text-muted); font-size: 12.5px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 36px; max-width: 900px; }
.sub { color: var(--text-muted); font-size: 12.5px; }
.unknown { color: var(--text-muted); font-style: italic; }
.block { display: block; }
.grow { flex: 1; min-width: 0; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: var(--grid); }
a.more { font-size: 13px; font-weight: 500; }
a.actbtn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--accent);
  border-radius: 6px; color: var(--accent); font-size: 13px; font-weight: 600; line-height: 1.25; background: var(--surface-1); }
a.actbtn span { transition: transform .1s; }
a.actbtn:hover, tr.rowlink:hover a.actbtn { background: var(--accent); color: var(--surface-1); text-decoration: none; }
a.actbtn:hover span, tr.rowlink:hover a.actbtn span { transform: translateX(2px); }
a.actbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
ul.plain mark, ol.rank mark { background: none; color: inherit; font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
ol.rank .sub.block { margin-top: 1px; color: var(--text-muted); }
.flag { display: inline-block; background: var(--flag-bg); color: var(--flag-ink); font-size: 11.5px; font-weight: 600;
  padding: 1px 6px; border-radius: 4px; margin-left: 4px; white-space: nowrap; }
.count { color: var(--text-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; margin-left: 6px; }
ul.plain, ol.rank { padding: 0; margin: 0; list-style: none; }
ul.plain li, ol.rank li { padding: 5px 0; border-bottom: 1px solid var(--grid); display: flex; justify-content: space-between; gap: 10px; }
ol.rank { counter-reset: r; }
ol.rank li::before { counter-increment: r; content: counter(r); color: var(--text-muted); width: 20px; flex: none; font-size: 12.5px; }
ol.rank li a { flex: 1; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.filters input[type=search] { min-width: 240px; flex: 1; }
.filters select { max-width: 220px; }
.check { font-size: 13.5px; color: var(--text-secondary); white-space: nowrap; }
.clear { font-size: 13.5px; }
.count-line { color: var(--text-secondary); }

table { border-collapse: collapse; width: 100%; }
table.results { background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; font-size: 14px; }
table.results th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
  padding: 9px 10px; border-bottom: 1px solid var(--border); background: var(--surface-1); }
table.results td { padding: 9px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
table.results tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.purpose { color: var(--text-primary); }
.empty { text-align: center; color: var(--text-muted); padding: 30px; }
mark { background: var(--mark); color: inherit; padding: 0 1px; border-radius: 2px; }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 18px 0; color: var(--text-secondary); }
.tableview { margin-top: 8px; font-size: 13px; color: var(--text-secondary); }
.tableview summary { cursor: pointer; }
.tableview table { margin-top: 6px; max-width: 360px; }
.tableview td, .tableview th { padding: 3px 8px; border-bottom: 1px solid var(--grid); text-align: left; }

.crumbs { color: var(--text-muted); font-size: 13px; margin: 18px 0 0; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; }
dl.facts { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; margin: 0; }
dl.facts dt { color: var(--text-muted); font-size: 13px; padding-top: 1px; }
dl.facts dd { margin: 0; }
blockquote.quote { margin: 0 0 8px; padding: 12px 16px; background: var(--surface-1); border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0; font-family: Georgia, "Times New Roman", serif; font-size: 15.5px; white-space: pre-wrap; }
blockquote.quote.secondary { border-left-color: var(--border); font-size: 14px; color: var(--text-secondary); }
ul.docs { padding-left: 18px; }
ul.docs li { margin: 4px 0; word-break: break-all; }
details.tech { margin: 32px 0; }
details.tech summary { cursor: pointer; color: var(--text-secondary); }
details.tech pre { background: var(--surface-1); border: 1px solid var(--border); padding: 12px; border-radius: 6px; overflow: auto;
  max-height: 520px; font-size: 12px; }
.prose { max-width: 720px; }

footer.site { border-top: 1px solid var(--border); margin-top: 48px; padding: 20px 0 32px; color: var(--text-muted); font-size: 13px; }
#tip { position: fixed; pointer-events: none; background: var(--text-primary); color: var(--surface-1); font-size: 12.5px;
  padding: 5px 9px; border-radius: 5px; z-index: 50; max-width: 280px; }

@media (max-width: 860px) {
  .mapgrid, .detail, .three { grid-template-columns: 1fr; }
  header .search { display: none; }
  .hero h1 { font-size: 26px; }
}

.errata{border-left:4px solid #b26a00;background:#fff7e6;padding:.6rem .9rem;margin:1rem 0}
.errata p{margin:.3rem 0}
.errata-meta{color:#6b5a3a;font-size:.85em}

/* Source documents on the action page */
ul.doclist { list-style: none; padding: 0; margin: 0; }
ul.doclist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--grid); }
ul.doclist .docname { font: 13px ui-monospace, "Cascadia Mono", Consolas, monospace; word-break: break-all; }
ul.doclist .sub { grid-column: 1; }
ul.doclist .doclinks { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; align-items: center; }
a.docbtn { padding: 4px 10px; border: 1px solid var(--accent); border-radius: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
a.docbtn:hover { background: var(--accent); color: var(--surface-1); text-decoration: none; }
h1.filename { font: 600 20px ui-monospace, "Cascadia Mono", Consolas, monospace; word-break: break-all; }
pre.doctext { background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 16px 20px;
  white-space: pre-wrap; font: 13.5px/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; max-width: 980px; }
pre.doctext mark { scroll-margin-top: 120px; padding: 1px 0; }
dl.glossary { margin: 0 0 24px; }
dl.glossary dt { font-weight: 600; margin-top: 14px; }
dl.glossary dt .count { font-weight: 400; margin-left: 6px; }
dl.glossary dd { margin: 2px 0 0; }
dl.glossary dd .note { display: block; margin-top: 4px; color: var(--text-muted); font-size: 14px; }
