/* Self-hosted fonts (SIL OFL): Public Sans variable, Source Serif 4. */
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/public-sans-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 400; font-display: swap; src: url("/fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }
/* OpenGeocoder.net — technical-editorial, cartographic blue on white. */
:root {
  --bg: #ffffff;
  --bg-2: #f3f5f7;
  --ink: #14202b;
  --ink-2: #4a5866;
  --line: #d9dfe5;
  --accent: #1f5fa8;
  --accent-ink: #174a84;
  --accent-soft: #e3edf8;
  --warn: #a15c00;
  --ok: #1d6b3a;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 68ch;
  --wrap: 72rem;
  --r: 6px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.6 var(--sans); font-variant-numeric: tabular-nums; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 1000; }
.skip:focus { left: 1rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 48rem) { .wrap { padding: 0 2rem; } }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; font-size: 1.125rem; }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand:hover { color: var(--ink); }
.nav-toggle { display: none; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; flex-wrap: wrap; }
.primary-nav a { display: block; padding: .5rem .7rem; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .95rem; border-radius: var(--r); }
.primary-nav a:hover { color: var(--ink); background: var(--bg-2); }
.primary-nav a[aria-current="page"], .primary-nav a[aria-current="true"] { color: var(--accent-ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
@media (max-width: 60rem) {
  .nav-toggle { display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-weight: 600; background: none; border: 1px solid var(--line); border-radius: var(--r); padding: .45rem .75rem; color: var(--ink); cursor: pointer; }
  .primary-nav { display: none; position: absolute; left: 0; right: 0; top: 4rem; background: var(--bg); border-bottom: 1px solid var(--line); z-index: 900; }
  .primary-nav.open { display: block; }
  .primary-nav ul { flex-direction: column; padding: .5rem 1rem 1rem; }
  .primary-nav a { padding: .75rem .5rem; font-size: 1rem; }
  .primary-nav a[aria-current="page"], .primary-nav a[aria-current="true"] { box-shadow: inset 3px 0 0 var(--accent); padding-left: .9rem; }
  .site-header { position: relative; }
}

/* Breadcrumbs */
.crumbs { font-size: .875rem; color: var(--ink-2); padding-top: 1.25rem; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.crumbs li + li::before { content: "/"; margin-right: .25rem; color: var(--line); }
.crumbs a { color: var(--ink-2); }

/* Type scale (1.25) */
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.05rem); font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 1.6rem; font-weight: 700; margin-top: 2.5rem; }
h3 { font-size: 1.2rem; font-weight: 600; margin-top: 1.75rem; }
p { margin: 1rem 0 0; }
.lede { font-size: 1.2rem; color: var(--ink-2); max-width: 46rem; margin-top: 1rem; line-height: 1.5; }
.muted { color: var(--ink-2); }
small, .small { font-size: .875rem; }
code, pre { font-family: var(--mono); font-size: .9em; }
:not(pre) > code { background: var(--bg-2); padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: #0f1b26; color: #e6edf3; padding: 1rem 1.1rem; border-radius: var(--r); overflow-x: auto; line-height: 1.5; margin: 1.25rem 0 0; font-size: .85rem; }
pre code { background: none; padding: 0; color: inherit; }

.page-head { padding-top: 1.25rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.page-head h1 { max-width: 22ch; margin-top: .75rem; }
main { display: block; padding-bottom: 4rem; }
.section { padding-top: 3rem; }

/* Buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: 600 1rem/1 var(--sans); padding: .8rem 1.15rem; border-radius: var(--r); border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn.secondary { background: var(--bg); color: var(--accent-ink); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn[disabled] { opacity: .55; cursor: progress; }
label { font-weight: 600; font-size: .95rem; display: block; }
.hint { font-weight: 400; color: var(--ink-2); font-size: .875rem; margin-top: .2rem; }
input[type="text"], input[type="search"], input[type="number"], select, textarea {
  font: 400 1rem/1.4 var(--sans); color: var(--ink); background: var(--bg); width: 100%;
  border: 1px solid #b9c3cd; border-radius: var(--r); padding: .7rem .8rem; min-height: 44px; margin-top: .35rem;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.field { margin-top: 1rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.row > .grow { flex: 1 1 14rem; }

/* Hero (home) */
.hero { padding: 2.5rem 0 3rem; border-bottom: 1px solid var(--line); background:
  linear-gradient(var(--bg), var(--bg)) padding-box; }
.hero-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 60rem) { .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3rem; } }
.hero h1 { max-width: 15ch; }
.searchbar { display: flex; gap: .5rem; margin-top: 1.5rem; flex-wrap: wrap; }
.searchbar input { flex: 1 1 16rem; margin: 0; font-size: 1.1rem; padding: .85rem .9rem; }
.examples { margin-top: .75rem; font-size: .9rem; color: var(--ink-2); }
.examples button { font: inherit; background: none; border: 0; padding: .2rem .1rem; color: var(--accent); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }

/* Map + bbox frame */
.mapframe { position: relative; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); overflow: hidden; }
.mapframe .map { height: 360px; width: 100%; }
@media (min-width: 60rem) { .hero .mapframe .map { height: 440px; } }
.map-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-2); font-size: .9rem; pointer-events: none; }
.map-placeholder svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-placeholder.preview { pointer-events: auto; place-items: end center; padding-bottom: 1rem; }
.map-placeholder.preview svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-activate { position: relative; }
.map-placeholder span { position: relative; background: var(--bg); padding: .35rem .7rem; border-radius: var(--r); border: 1px solid var(--line); }
.edge-label { background: var(--accent); color: #fff; font: 600 11px/1 var(--sans); padding: 3px 5px; border-radius: 3px; white-space: nowrap; box-shadow: none; border: 0; }
.edge-label::before { display: none; }
.leaflet-container { font-family: var(--sans); }
.leaflet-tooltip.edge-label { background: var(--accent); color: #fff; border: 0; box-shadow: none; }
.leaflet-tooltip.edge-label::before { display: none; }

/* Result readout */
.readout { margin-top: 1.25rem; }
.readout[hidden] { display: none; }
.readout h2 { font-size: 1.15rem; margin: 0; }
.readout .place { font-size: 1.05rem; margin-top: .3rem; color: var(--ink); }
.coords { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0; margin-top: 1rem; border-top: 1px solid var(--line); }
.coords div { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.coords dt { font-size: .8rem; color: var(--ink-2); }
.coords dd { margin: .15rem 0 0; font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; }
.copy { font: 500 .8rem var(--sans); background: none; border: 1px solid var(--line); border-radius: 4px; padding: .2rem .45rem; margin-left: .35rem; cursor: pointer; color: var(--ink-2); vertical-align: middle; }
.copy:hover { border-color: var(--accent); color: var(--accent-ink); }
.status { margin-top: 1rem; font-size: .95rem; }
.status.error { color: #9b1c1c; }
.notice { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: .75rem 1rem; margin-top: 1rem; border-radius: 0 var(--r) var(--r) 0; }
.attribution { font-size: .8rem; color: var(--ink-2); margin-top: .75rem; }

/* Candidate list */
.candidates { list-style: none; padding: 0; margin: 1rem 0 0; border-top: 1px solid var(--line); }
.candidates li { border-bottom: 1px solid var(--line); }
.candidates button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: .8rem .25rem; cursor: pointer; }
.candidates button:focus-visible { outline: 3px solid var(--accent); }
.candidates button[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); padding-left: .75rem; }
.candidates .t { font-weight: 600; }
.candidates .m { font-size: .85rem; color: var(--ink-2); margin-top: .15rem; }

/* Home sections */
.split { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 52rem) { .split { grid-template-columns: 1fr 1fr; gap: 3rem; } }
.tool-index { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); }
@media (min-width: 40rem) { .tool-index { grid-template-columns: 1fr 1fr; column-gap: 2rem; } }
@media (min-width: 64rem) { .tool-index { grid-template-columns: 1fr 1fr 1fr; } }
.tool-index li { border-bottom: 1px solid var(--line); padding: 1rem 0 1.1rem; }
.tool-index a { font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.tool-index a:hover { text-decoration: underline; }
.tool-index p { margin: .3rem 0 0; color: var(--ink-2); font-size: .95rem; }
.link-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.link-list li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.link-list li:first-child { border-top: 1px solid var(--line); }
.link-list .d { display: block; color: var(--ink-2); font-size: .9rem; }

/* Pipeline figure on home */
.figure-plain { margin: 1.5rem 0 0; }
.figure-plain figcaption, figure.diagram figcaption { font-size: .875rem; color: var(--ink-2); margin-top: .6rem; }

/* Articles */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
@media (min-width: 64rem) { .article-layout { grid-template-columns: minmax(0, var(--measure)) 15rem; justify-content: space-between; } }
.prose { font-family: var(--serif); font-size: 1.1rem; line-height: 1.7; max-width: var(--measure); }
.prose h2, .prose h3 { font-family: var(--sans); scroll-margin-top: 1rem; }
.prose h2 { font-size: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 1rem 0 0; }
.prose li + li { margin-top: .35rem; }
.prose blockquote { margin: 1.5rem 0 0; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--ink-2); }
.prose aside.note { font-family: var(--sans); font-size: .98rem; line-height: 1.6; background: var(--bg-2); border-left: 3px solid var(--accent); padding: .9rem 1.1rem; margin: 1.5rem 0 0; border-radius: 0 var(--r) var(--r) 0; }
.prose aside.note > :first-child { margin-top: 0; }
.prose pre { font-size: .82rem; }
.prose dl { margin: 1rem 0 0; }
.prose dt { font-family: var(--sans); font-weight: 700; margin-top: .9rem; }
.prose dd { margin: .2rem 0 0 0; }
figure.diagram { margin: 2rem 0 0; padding: 1rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); font-family: var(--sans); }
figure.diagram svg { display: block; width: 100%; height: auto; font-family: var(--sans); }
.table-scroll { overflow-x: auto; margin-top: 1.25rem; -webkit-overflow-scrolling: touch; }
table.data { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .92rem; line-height: 1.45; }
table.data th, table.data td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data thead th { border-bottom: 2px solid var(--ink); font-weight: 700; white-space: nowrap; }
.prose > table.data { display: block; overflow-x: auto; margin-top: 1.25rem; }
.article-meta { font-size: .9rem; color: var(--ink-2); margin-top: 1rem; }
.toc { font-size: .9rem; position: sticky; top: 1.25rem; align-self: start; }
.toc h2 { font-size: .95rem; margin: 0 0 .5rem; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: .3rem 0 .3rem .8rem; color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent-ink); }
@media (max-width: 63.99rem) { .toc { display: none; } }
.related { margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 1.5rem; max-width: var(--measure); }
.related h2 { font-size: 1.15rem; margin: 0; }

/* Tools */
.tool-layout { display: grid; gap: 2rem; grid-template-columns: 1fr; margin-top: 2rem; }
@media (min-width: 60rem) { .tool-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2.5rem; } }
.tool-layout .mapframe .map { height: 420px; }
.tool-about { max-width: var(--measure); }
.out { width: 100%; font-family: var(--mono); font-size: .85rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: .7rem; margin-top: .35rem; min-height: 4.5rem; resize: vertical; color: var(--ink); }
.conv-table { width: 100%; border-collapse: collapse; margin-top: 1.25rem; }
.conv-table th, .conv-table td { text-align: left; padding: .7rem .5rem .7rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.conv-table th { width: 38%; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.conv-table td { font-weight: 600; overflow-wrap: anywhere; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-top: 1.25rem; flex-wrap: wrap; }
.tabs button { font: 600 .9rem var(--sans); background: none; border: 0; padding: .6rem .8rem; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; min-height: 44px; }
.tabs button[aria-selected="true"] { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* Archive / unmatched */
.archive-list { list-style: none; padding: 0; margin: 1rem 0 0; columns: 1; column-gap: 2rem; }
@media (min-width: 40rem) { .archive-list { columns: 2; } }
@media (min-width: 64rem) { .archive-list { columns: 3; } }
.archive-list li { break-inside: avoid; padding: .3rem 0; border-bottom: 1px solid var(--bg-2); font-size: .95rem; }

/* Timeline (About) */
.timeline { list-style: none; padding: 0; margin: 1.5rem 0 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.5rem 1.25rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.timeline time { font-weight: 700; display: block; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 2.5rem 0 3rem; font-size: .9rem; color: var(--ink-2); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer h2 { font-size: .95rem; color: var(--ink); margin: 0 0 .5rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: .2rem 0; }
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--accent-ink); }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media print { .site-header, .site-footer, .toc, .mapframe { display: none; } }
