/* Site styles of the LB Omgevingsadvies tools, taken from the NIBM-check (2026-11-20) and trimmed
   to what the starter uses. Hand-written CSS, self-hosted variable font, no framework. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin.477b564b86e0.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}


/* ---------- Tokens ---------- */
:root {
  --paper: #f6f6f2;
  --ground: #ffffff;
  --ink: #16201a;
  --ink-2: #3d4a42;
  --muted: #5f6c65;
  --line: #dcdfd8;
  --line-2: #c3c9c0;
  --n2k-deep: #1f5c38;
  --n2k-soft: #e3efe6;
  --signal: #bf3a1d;
  --signal-2: #a3301a;
  --signal-soft: #fbe9e4;
  --font: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --r: 4px;
  --shadow-panel: 0 24px 48px -28px rgba(22, 32, 26, 0.38), 0 3px 8px -3px rgba(22, 32, 26, 0.14);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 72px;
  --container: 1240px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --shadow-label: 0 6px 14px -8px rgba(22, 32, 26, 0.4), 0 1px 2px rgba(22, 32, 26, 0.12);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: var(--line-2) var(--paper); }
body {
  margin: 0; font-family: var(--font); font-optical-sizing: auto; font-size: 17px; line-height: 1.6; color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-variant-numeric: tabular-nums; caret-color: var(--signal);
}
h1, h2, h3 { margin: 0 0 0.5em; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
h1, h2 { font-stretch: 100%; letter-spacing: -0.008em; font-variation-settings: "opsz" 96; }
h1 { font-size: clamp(1.9rem, 2.6vw, 2.5rem); }
h2 { font-size: clamp(1.55rem, 2.4vw, 2.1rem); }
h3 { font-size: 1.12rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--line-2); transition: text-decoration-color 0.2s; }
a:hover { text-decoration-color: var(--signal); }
ol, ul { margin: 0; padding: 0; }
strong { font-weight: 650; }
img, svg { max-width: 100%; }
::selection { background: var(--signal-soft); color: var(--signal-2); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 2px; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.lead { font-size: clamp(1.05rem, 1.3vw, 1.2rem); line-height: 1.55; color: var(--ink-2); max-width: 38rem; }
.eyebrow { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); margin: 0 0 0.5rem; }
.page-title { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: 0.6rem 0.9rem; background: var(--ink); color: #fff; border-radius: var(--r); }
.skip-link:focus { top: 1rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; height: var(--header-h); background: rgba(246, 246, 242, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); transition: box-shadow 0.4s var(--ease); }
.nav { display: flex; align-items: center; gap: 2rem; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; flex: none; }
.brand-mark circle { fill: var(--signal); stroke: none; }
.brand-name { font-size: 1.08rem; font-weight: 650; letter-spacing: -0.015em; white-space: nowrap; }
.brand-name span { font-weight: 400; }
.nav-links { display: flex; gap: 1.6rem; margin-left: auto; }
.nav-links a { white-space: nowrap; color: var(--ink-2); font-size: 0.95rem; font-weight: 500; text-decoration: none; padding: 0.3rem 0; border-bottom: 1.5px solid transparent; transition: border-color 0.25s var(--ease), color 0.25s; }
.nav-links a:hover { color: var(--ink); border-color: var(--signal); }
.nav-links a[aria-current] { color: var(--ink); border-color: var(--signal); }
/* The tools domain (stikstoftool.nl): its own wordmark, the same system */
.brand-stack { display: flex; flex-direction: column; line-height: 1.05; }
.brand-tools .brand-name { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.025em; }
.brand-by { margin-top: 0.2rem; font-size: 0.72rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
/* A link that leaves for the company site: a small outward arrow after its text */
.link-out svg { width: 0.72em; height: 0.72em; margin-left: 0.3em; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.85rem 1.35rem; border: 1px solid transparent; border-radius: var(--r); font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background 0.2s var(--ease), border-color 0.2s, color 0.2s, box-shadow 0.25s var(--ease), transform 0.25s var(--ease); }
.btn-primary { background: var(--signal); color: #fff; box-shadow: 0 8px 18px -12px rgba(191, 58, 29, 0.9); }
.btn-primary:hover { background: var(--signal-2); box-shadow: 0 12px 22px -12px rgba(163, 48, 26, 0.9); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); box-shadow: none; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--paper); border-top: 1px solid var(--line); padding: 3.5rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; }
.footer-about p { margin: 1rem 0 0; font-size: 0.95rem; color: var(--ink-2); max-width: 36rem; }
.footer-title { font-size: 0.95rem; font-weight: 650; margin: 0 0 0.6rem; }
.footer-grid p { font-size: 0.95rem; color: var(--ink-2); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }
.footer-attrib { flex-basis: 100%; }
.site-footer-slim { padding-top: 2rem; }
.footer-slim { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2.5rem; }
.footer-owner { display: inline-flex; align-items: center; gap: 0.6rem; margin: 0; font-size: 0.95rem; color: var(--ink-2); }
.footer-owner .brand-mark { width: 22px; height: 22px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-size: 0.95rem; }
.footer-links a { color: var(--ink-2); }
.site-footer-slim .footer-bottom { margin-top: 1.5rem; }

/* ---------- Forms ---------- */
.form-section { background: var(--paper); }
.form-head { max-width: 40rem; margin-bottom: 2rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: 0.93rem; margin-bottom: 0.35rem; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="number"], .field input[type="url"], .field select, .field textarea { width: 100%; padding: 0.72rem 0.85rem; font: inherit; font-size: 1rem; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: var(--r); transition: border-color 0.2s, box-shadow 0.2s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22, 32, 26, 0.12); }
.field .help { font-size: 0.85rem; color: var(--muted); margin: 0.3rem 0 0; }
.field .error { font-size: 0.85rem; color: var(--signal-2); margin: 0.3rem 0 0; font-weight: 600; }
.field-error input, .field-error select, .field-error textarea { border-color: var(--signal); }
.field-checkbox label { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 500; }
.field-checkbox input { margin-top: 0.3rem; accent-color: var(--signal); }
.form-actions { display: grid; gap: 0.75rem; }
.form-foot { margin-top: 2rem; }
.form-switch { margin: 0.9rem 0 0; font-size: 0.95rem; color: var(--ink-2); }
.alert { padding: 1rem 1.25rem; border-radius: var(--r); margin-bottom: 1.5rem; border: 1px solid; }
.alert-error { background: var(--signal-soft); color: #7a2a1b; border-color: #efc6bb; }
.alert-success { background: var(--n2k-soft); color: var(--n2k-deep); border-color: #bcd9c6; }
.lookup ~ .alert { margin-top: 1.25rem; }
.card { background: #fff; border: 1px solid var(--line-2); border-radius: 6px; padding: 1.5rem 1.75rem; margin: 1.5rem 0; }
.card ol { padding-left: 1.2rem; }
.card li { margin-bottom: 0.5rem; }


/* ---------- The tool page ---------- */
main > .form-section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.field textarea { font-family: var(--font); }
.result { margin-top: 2.5rem; padding: 1.5rem clamp(1.25rem, 3vw, 2rem); background: var(--ground); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: var(--shadow-panel); }
.result h2 { font-size: 1.2rem; }
.result-value { margin: 0 0 0.5rem; font-size: 1.2rem; color: var(--ink-2); }
.result-number { font-size: clamp(2.6rem, 6vw, 3.6rem); font-weight: 700; letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
.notice { margin: 1.25rem 0 0; padding: 0.8rem 1rem; border-left: 3px solid var(--signal); background: var(--signal-soft); border-radius: 0 var(--r) var(--r) 0; font-size: 0.95rem; color: var(--ink-2); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .nav { gap: 1.25rem; }
  .nav-links { gap: 1.15rem; }
}
@media (max-width: 760px) {
  :root { --header-h: 62px; }
  body { font-size: 16px; }
  .nav { gap: 1rem; }
  .nav-links { gap: 0.9rem; }
  .nav-links a { font-size: 0.88rem; }
  .nav-links a:last-child { display: none; } /* the footer holds the company link too */
  .brand-by { display: none; }
}
/* A phone: "Bureaus vergelijken" ran off the screen at 390 px; the footer holds it too */
@media (max-width: 480px) {
  .nav-links a:nth-child(2) { display: none; }
}

/* ---------- Result table and choices ---------- */
.table-wrap { overflow-x: auto; margin: 1rem 0 0; }
.values { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.values caption { text-align: left; font-weight: 600; padding-bottom: 0.5rem; }
.values th, .values td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.values thead th { font-size: 0.85rem; color: var(--muted); border-bottom-color: var(--line-2); }
.values td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.choices { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.choices form { margin: 0; }
.choices .btn { white-space: normal; text-align: left; justify-content: flex-start; width: 100%; }
.result .small { font-size: 0.9rem; }
.result .fold { margin-top: 1rem; }
.result .fold summary { cursor: pointer; font-weight: 600; }
/* Under the map: the explanation folded, the sources in one line */
.result-values > .container > .fold { padding: 0.9rem 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line); }
.result-values > .container > .fold summary { cursor: pointer; font-weight: 600; }
.result-values > .container > .fold[open] summary { margin-bottom: 0.6rem; }
.result-values > .container > .fold .small { color: var(--ink-2); }
.source-line { margin: 0.8rem 0 0; }
.result-values { padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.result-values .result { margin-top: 0; }
.values caption { font-size: 0.95rem; }
/* The dikes as a table under the map (the map's accessible equivalent): name, category, distance
   in sight; what a layman cannot use (statuses, type, pieces) in the fold under it */
.values-dikes th[scope="row"] { font-weight: 600; }
.values-name { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 0.6rem; align-items: start; overflow-wrap: break-word; }
.values-note { display: block; margin: 0.1rem 0 0 calc(22px + 0.6rem); font-size: 0.82rem; font-weight: 400; color: var(--muted); }
.values-dikes td { color: var(--ink-2); }
.values-dikes td.num strong { color: var(--ink); }
.values-after { margin: 0.6rem 0 1.25rem; }
.result-values > .container > .fold + .fold { border-top: 0; }
.result-values > .container > .fold .table-wrap { margin-top: 0.4rem; }
.result-values > .container > .fold .gk-quote { margin-top: 0.9rem; }

/* The table under the map on a phone: one block per line, each value with its column's name
   (data-label), so nothing runs off the screen */
@media (max-width: 560px) {
  .values-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .values-stack, .values-stack caption, .values-stack tbody, .values-stack tr, .values-stack th, .values-stack td { display: block; }
  .values-stack tr { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
  .values-stack th, .values-stack td { padding: 0.1rem 0; border: 0; }
  .values-stack td { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); column-gap: 0.75rem; font-size: 0.93rem; }
  .values-stack td::before { content: attr(data-label); color: var(--muted); font-size: 0.85rem; }
}

/* ---------- The map (templates/tool/_map.html, static/js/kaart.js) ----------
   The family's map, copied from "Geluid op adres" and "Natura 2000 bij een adres" (2026-11-20).
   The company's map conventions (the stikstofkaart, LBO-website DESIGN.md): a white legend panel
   over the left of the map on wide screens and under it on phones, white controls with a strong
   hairline and the label shadow, stickers for labels, the credit on the map. The map itself: the
   grey BRT Achtergrondkaart. Drawn on it: the dikes in ink (a line style and an ink tone per
   category), the zones as ink hatches with an outline style per type and the dike bodies as a
   flat ink tint, the measured line in the company's dashed ink. Red is the address only. */

/* With a map on the page the search steps back, so the map starts high on the screen */
.form-section.has-map { padding: clamp(1.25rem, 3vw, 2rem) 0 clamp(1rem, 2.5vw, 1.5rem); }
.has-map .form-head { margin-bottom: 0.9rem; }
.has-map .page-title { margin-bottom: 0.2rem; font-size: clamp(1.45rem, 2.2vw, 1.85rem); }
.has-map .lead { margin: 0; font-size: 1rem; }
.has-map .lookup .field { margin-bottom: 0.75rem; }
#resultaat { scroll-margin-top: calc(var(--header-h) + 0.75rem); }

.gk-section { padding: 0 0 clamp(1.75rem, 4vw, 3rem); }
.gk { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); }

/* The head: where, the answer, how it was measured */
.gk-head { padding: 0 0 0.8rem; }
.gk-head h2 { margin: 0.15rem 0 0; font-size: clamp(1.3rem, 5.2vw, 1.55rem); line-height: 1.15; }
.gk-place { margin: 0; font-size: 0.95rem; line-height: 1.4; color: var(--ink-2); }
.gk-measure { margin: 0.5rem 0 0; font-size: 0.9rem; line-height: 1.45; color: var(--ink-2); }

/* The sheet: the map, live or drawn by the server */
.gk-sheet { position: relative; height: clamp(320px, 58svh, 520px); height: round(down, clamp(320px, 58svh, 520px), 1px); overflow: hidden; isolation: isolate; background: #f1f1ee; border: 1px solid var(--line-2); border-radius: 6px 6px 0 0; }
.gk-map { position: absolute; inset: 0; background: #f1f1ee; }
.gk-credit { position: absolute; z-index: 1000; right: 0; bottom: 0; max-width: 100%; margin: 0; padding: 2px 7px; background: rgba(255, 255, 255, 0.86); border-top-left-radius: 3px; font-size: 0.68rem; font-stretch: 90%; line-height: 1.4; color: var(--ink-2); }

/* The body of the panel: the lines, the quote, the notice, station and crossing, the key */
.gk-body { padding: 1rem 1rem 1.1rem; background: var(--ground); border: 1px solid var(--line-2); border-top: 0; border-radius: 0 0 6px 6px; }
.gk-body fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }

/* The lines: legend rows, the shown one pressed */
.gk-label { display: block; padding: 0; margin: 0 0 0.35rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.gk-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.gk-rows li { border-bottom: 1px solid var(--line); }
.gk-src { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: start; column-gap: 0.7rem; min-height: 2.75rem; padding: 0.5rem 0.55rem; font-size: 0.95rem; line-height: 1.3; color: var(--ink-2); cursor: pointer; transition: background 0.15s; }
.gk-src input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: inherit; }
.gk-src:hover { background: var(--paper); color: var(--ink); }
.gk-src:has(input:checked) { background: var(--paper); color: var(--ink); }
.gk-src:has(input:checked) .gk-src-name { font-weight: 650; }
.gk-src:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: -2px; }
.gk-src:has(input:disabled) { cursor: default; }
.gk-src-name { min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.gk-src-note { display: block; margin-top: 0.1rem; font-size: 0.78rem; font-weight: 400; line-height: 1.35; color: var(--muted); }
.gk-src-val { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.gk-src-val strong { font-weight: 650; color: var(--ink); }
.gk-hint { font-weight: 400; }
.gk-aside { margin: 0.6rem 0 0; padding: 0 0.55rem; font-size: 0.8rem; line-height: 1.45; color: var(--ink-2); }

/* The government's sentence, short and plain, right under the lines */
.gk-guide { margin: 1rem 0 0; padding: 0 0.55rem; }
.gk-guide-lead { margin: 0 0 0.3rem; font-size: 0.85rem; color: var(--ink-2); }
.gk-quote { margin: 0; padding: 0.1rem 0 0.1rem 0.85rem; border-left: 1px solid var(--ink); font-size: 0.88rem; line-height: 1.5; color: var(--ink); }
.gk-quote p { margin: 0; }
.gk-quote-src { margin: 0.35rem 0 0; padding-left: 0.85rem; font-size: 0.78rem; line-height: 1.4; color: var(--muted); }
.gk-quote-src a { color: var(--ink-2); }
.gk-head .notice { margin: 0.7rem 0 0; padding: 0.55rem 0.8rem; font-size: 0.86rem; line-height: 1.45; }


/* The lead (apps/tool/lead.py): the zone answer first where the board publishes zones, the
   nearest dike beside it; the distance first where the data gives no zone answer, with the
   zone line in an open, dashed box (no answer looks like neither inside nor outside) */
.gk-near { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; align-items: end; margin: 0.85rem 0 0; padding: 0.65rem 0 0; border-top: 1px solid var(--line); }
.gk-near-label { grid-column: 1 / -1; margin: 0 0 0.2rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.gk-near-name { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 0.6rem; align-items: start; margin: 0; font-size: 0.98rem; font-weight: 650; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
.gk-near-note { display: block; margin-top: 0.1rem; font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.gk-near-val { margin: 0; white-space: nowrap; font-size: 0.85rem; line-height: 1.1; color: var(--ink-2); text-align: right; }
.gk-near-val strong { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.gk-near-none { grid-column: 1 / -1; margin: 0; font-size: 0.9rem; line-height: 1.45; color: var(--ink-2); }
.gk-sub { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 0.6rem; align-items: start; margin: 0.5rem 0 0; font-size: 0.95rem; line-height: 1.4; color: var(--ink-2); overflow-wrap: anywhere; }
.gk-zoneline { margin: 0.85rem 0 0; padding: 0.65rem 0 0; border-top: 1px solid var(--line); }
.gk-zoneline-text { margin: 0; font-size: 0.98rem; font-weight: 650; line-height: 1.35; color: var(--ink); }
.gk-open { margin: 0.85rem 0 0; padding: 0.65rem 0.85rem 0.7rem; border: 1.5px dashed var(--line-2); border-radius: var(--r); background: var(--paper); }
.gk-open-label { margin: 0 0 0.2rem; font-size: 0.93rem; font-weight: 650; line-height: 1.35; color: var(--ink); }
.gk-open-text { margin: 0; font-size: 0.86rem; line-height: 1.5; color: var(--ink-2); }

/* The schematic section of a dike beside the answer (templates/tool/_scheme.html): the map's
   hatches and address marker, the bands the point lies in outlined and named in ink, a band
   without data open and dashed. Not to scale, and it says so under it. */
.gk-scheme { margin: 0.7rem 0 0; }
.gk-scheme-svg { display: block; width: 100%; max-width: 360px; height: auto; overflow: visible; }
.gk-sch-zone { stroke: none; }
.gk-sch-zone.is-in { stroke: var(--ink); stroke-width: 1.5; stroke-opacity: 0.85; }
.gk-sch-zone.is-open { fill: none; stroke: var(--muted); stroke-width: 1.25; stroke-dasharray: 4 3; stroke-opacity: 0.7; }
.gk-sch-edge { fill: none; stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 2 3; }
.gk-sch-dike { fill: var(--ink); fill-opacity: 0.14; stroke: var(--ink); stroke-opacity: 0.7; stroke-width: 1.5; stroke-linejoin: round; }
.gk-sch-dike.is-in { fill-opacity: 0.26; stroke-opacity: 0.95; stroke-width: 2; }
.gk-sch-dike.is-unknown { fill: none; stroke-dasharray: 4 3; }
.gk-sch-ground { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.gk-sch-break { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-linecap: round; }
.gk-sch-label { font-family: var(--font); font-size: 12px; font-weight: 500; fill: var(--muted); }
.gk-sch-label.is-in { fill: var(--ink); font-weight: 700; }
.gk-sch-here { font-family: var(--font); font-size: 12px; font-weight: 650; fill: var(--signal-2); }
.gk-sch-mark .gk-mark-halo { stroke-width: 4; }
.gk-sch-mark .gk-mark-ring { stroke-width: 2; }
.gk-sch-mark .gk-mark-dot { stroke-width: 1.5; }
.gk-scheme-note { margin: 0.15rem 0 0; font-size: 0.75rem; line-height: 1.4; color: var(--muted); }
.gk-open .gk-scheme { margin: 0.45rem 0 0.5rem; }

/* What the answer is not, short, in the panel */
.gk-not-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; font-size: 0.8rem; line-height: 1.45; color: var(--ink-2); }
.gk-not-list li { position: relative; padding-left: 0.95rem; }
.gk-not-list li::before { content: ""; position: absolute; left: 0; top: 0.68em; width: 0.45rem; border-top: 1.5px solid var(--muted); }
.gk-not-list a { color: var(--ink); }

/* The water board and the zone, in the panel */
.gk-facts-block { margin: 0.85rem 0 0; padding: 0 0.55rem; }
.gk-facts-block + .gk-lines { margin-top: 1rem; }
.gk-facts-block .gk-label { margin-bottom: 0.15rem; }
.gk-board { margin: 0; font-size: 0.95rem; line-height: 1.35; color: var(--ink); }
.gk-board a { color: var(--ink); }
.gk-zone { margin: 0; font-size: 0.88rem; line-height: 1.45; color: var(--ink); }
.gk-small { margin: 0.3rem 0 0; font-size: 0.8rem; line-height: 1.45; color: var(--ink-2); }

/* The key, and the symbols as the map draws them */
.gk-key-list { display: grid; gap: 0.35rem; list-style: none; margin: 0.85rem 0 0; padding: 0.7rem 0.55rem 0; border-top: 1px solid var(--line); font-size: 0.8rem; line-height: 1.35; color: var(--ink-2); }
.gk-key-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 0.7rem; align-items: start; }
.gk-tip-hint { margin: 0.6rem 0 0; padding: 0 0.55rem; font-size: 0.8rem; color: var(--muted); }
.gk-sym { display: block; width: 22px; height: 14px; margin-top: 0.15rem; }
/* a line style per category, so the categories differ without colour (the map uses the same) */
.gk-sym.is-track, .gk-sym.is-cat-p { height: 0; margin-top: 0.5rem; border-top: 4px solid var(--ink); border-radius: 2px; }
.gk-sym.is-cat-r { height: 0; margin-top: 0.55rem; border-top: 3px dashed var(--ink-2); }
.gk-sym.is-cat-o { height: 0; margin-top: 0.55rem; border-top: 3px dotted var(--muted); }
.gk-sym.is-cat-x { height: 0; margin-top: 0.55rem; border-top: 2px dashed var(--muted); }
/* The zones in ink, never in the signal red (that is the address only, and a red zone would read
   as a warning): zone A a close hatch "/" with a solid outline, zone B a wider, lighter hatch "\"
   with a dashed outline, the dike body a flat tint. Where they overlap (Kampen: all three) the
   hatches cross over the tint, so each stays readable, also in greyscale. The map draws the
   same hatches (the patterns in templates/tool/_map.html). */
.gk-sym.is-zone-a, .gk-sym.is-zone-b, .gk-sym.is-zone-w, .gk-sym.is-body { width: 22px; height: 13px; margin-top: 0.15rem; }
.gk-sym.is-zone-a { border: 1.5px solid rgba(22, 32, 26, 0.8); background: repeating-linear-gradient(-45deg, rgba(22, 32, 26, 0.42) 0 1.2px, transparent 1.2px 4.2px), rgba(22, 32, 26, 0.05); }
.gk-sym.is-zone-b { border: 1.5px dashed rgba(22, 32, 26, 0.7); background: repeating-linear-gradient(45deg, rgba(22, 32, 26, 0.3) 0 1px, transparent 1px 7px), rgba(22, 32, 26, 0.02); }
.gk-sym.is-zone-w { border: 1.25px dotted var(--ink-2); background: rgba(61, 74, 66, 0.04); }
.gk-sym.is-body { border: 1px solid rgba(22, 32, 26, 0.6); background: rgba(22, 32, 26, 0.14); }
.gk-sym.is-line { height: 0; margin-top: 0.55rem; border-top: 2.5px dashed var(--ink); }
.gk-sym.is-circle { width: 14px; height: 14px; margin: 0.05rem 4px 0; border: 1.5px dotted var(--ink-2); border-radius: 50%; }
.gk-note { max-width: 46rem; margin: 0.85rem 0 0; font-size: 0.82rem; line-height: 1.5; color: var(--muted); }

/* Without script there is nothing to switch or click: the drawn map, the list and the key */
@media (scripting: none) {
  .gk-hint, .gk-tip-hint { display: none; }
}

/* Leaflet, in the company's map chrome. leaflet.css loads before this file. */
.gk .leaflet-container { font-family: var(--font); background: #f1f1ee; }
/* Leaflet focuses the map from script on every click, so the ring follows the keyboard
   (kaart.js sets .is-keys) rather than :focus-visible */
.gk .leaflet-container:focus { outline: none; }
.gk .leaflet-container.is-keys:focus { outline: 2px solid var(--signal); outline-offset: -2px; }
.gk .leaflet-top.leaflet-right { top: 2px; right: 2px; }
.gk .leaflet-bar, .gk .leaflet-touch .leaflet-bar { border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow-label); background-clip: border-box; }
.gk .leaflet-bar a, .gk .leaflet-touch .leaflet-bar a { width: 34px; height: 34px; line-height: 32px; color: var(--ink); font: 500 19px/32px var(--font); border-bottom-color: var(--line); }
.gk .leaflet-bar a:hover { background: var(--paper); color: var(--ink); }
.gk .leaflet-bar a:focus-visible { outline: 2px solid var(--signal); outline-offset: 1px; }
.gk .leaflet-bar a.leaflet-disabled { color: var(--line-2); background: var(--ground); }
.gk .leaflet-control-scale { margin: 0 0 10px 10px; }
.gk .leaflet-control-scale-line { border-color: var(--ink); border-width: 0 1.5px 1.5px; color: var(--ink); background: rgba(255, 255, 255, 0.82); font: 600 11px/1.4 var(--font); text-shadow: none; }

/* leaflet.css adds plus-lighter to every tile against seams; over this map's backdrop a tile edge
   on half a device pixel then turned into a white line. Plain painting keeps the edge grey. */
.gk .gk-bg img.leaflet-tile { mix-blend-mode: normal; }

.leaflet-gk-zones-pane { z-index: 385; } /* zones and dike bodies, under the dikes */
/* The hatch patterns of the zones (templates/tool/_map.html): an SVG of no size, never hidden with
   display: none (a pattern in such an SVG does not paint in every browser) */
.gk-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* The dikes within the search distance and the search circle */
.leaflet-gk-tracks-pane { z-index: 390; } /* under the measured line and the address (overlay 400) */
.gk .gk-track { stroke-linejoin: round; } /* the caps are set per category by the script */
.gk .gk-track-hit { cursor: pointer; }
.gk .leaflet-pane > svg { max-width: none; max-height: none; }
.gk .gk-circle { pointer-events: none; }

/* Stickers on the sheet: the address, the distance on the line, the dike's name */
.leaflet-tooltip.gk-label { padding: 4px 9px; background: #fff; color: var(--signal-2); border: 1px solid var(--line-2); border-radius: 3px; box-shadow: var(--shadow-label); font: 650 13px/1.25 var(--font); white-space: nowrap; }
.leaflet-tooltip-top.gk-label::before { border-top-color: var(--line-2); }
.leaflet-tooltip-bottom.gk-label::before { border-bottom-color: var(--line-2); }
.leaflet-tooltip-right.gk-label::before { border-right-color: var(--line-2); }
.leaflet-tooltip-center.gk-label::before { display: none; }
.leaflet-tooltip.gk-label-distance { padding: 4px 9px 5px; color: var(--ink-2); font-weight: 500; font-size: 13px; }
.leaflet-tooltip.gk-label-distance strong { margin-right: 0.25em; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.leaflet-tooltip.gk-label-line { max-width: 15rem; padding: 3px 8px; color: var(--ink); font-weight: 600; font-size: 12.5px; white-space: normal; width: max-content; }
/* What a dike or a zone is, on hover or tap */
.leaflet-tooltip.gk-tip { display: grid; gap: 1px; width: max-content; max-width: 16rem; padding: 6px 9px; white-space: normal; background: #fff; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 3px; box-shadow: var(--shadow-label); font: 500 13px/1.35 var(--font); }
.leaflet-tooltip.gk-tip strong { color: var(--ink); font-weight: 650; font-size: 14px; }
.leaflet-tooltip.gk-tip em { font-style: normal; color: var(--muted); font-size: 12px; }
.leaflet-tooltip-right.gk-tip::before { border-right-color: var(--line-2); }
.leaflet-tooltip-left.gk-tip::before { border-left-color: var(--line-2); }
.leaflet-tooltip-top.gk-tip::before { border-top-color: var(--line-2); }
.leaflet-tooltip-bottom.gk-tip::before { border-bottom-color: var(--line-2); }

/* Stickers on the sheet: the way back, the region, a status, the touch hint */
.gk-topbar { position: absolute; z-index: 1000; top: 12px; right: 52px; display: flex; gap: 6px; pointer-events: none; }
.gk-topbar > * { pointer-events: auto; }
.gk-home { min-height: 34px; padding: 0.35rem 0.75rem; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow-label); font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.gk-home:hover { border-color: var(--ink); }
.gk-status { position: absolute; z-index: 1000; left: 50%; bottom: 14px; max-width: calc(100% - 2rem); margin: 0; padding: 5px 10px; transform: translateX(-50%); background: #fff; border: 1px solid var(--line-2); border-radius: 3px; box-shadow: var(--shadow-label); font-size: 0.85rem; color: var(--ink-2); text-align: center; }
.gk-status.is-wait { animation: gk-appear 0.2s var(--ease) 0.5s both; }
/* What the map lacks (the zones' read failed): one sticker, with or without script */
.gk-missing { position: absolute; z-index: 1000; left: 50%; bottom: 34px; width: max-content; max-width: calc(100% - 2rem); margin: 0; padding: 5px 10px; transform: translateX(-50%); background: #fff; border: 1px solid var(--line-2); border-radius: 3px; box-shadow: var(--shadow-label); font-size: 0.85rem; line-height: 1.35; color: var(--ink); text-align: center; }
.gk-touch { position: absolute; z-index: 1001; left: 50%; top: 50%; margin: 0; padding: 7px 12px; transform: translate(-50%, -50%); background: #fff; border: 1px solid var(--line-2); border-radius: 3px; box-shadow: var(--shadow-label); font-size: 0.9rem; font-weight: 600; color: var(--ink); pointer-events: none; }
@keyframes gk-appear { from { opacity: 0; } to { opacity: 1; } }

/* The drawn map for a page without script: the same tiles, stacked by the server, and the same
   drawing in SVG */
.gk-static { position: absolute; inset: 0; }
.gk-static-svg { display: block; width: 100%; height: 100%; }
.gk-static-paper { fill: #f1f1ee; }
.gk-mark-halo { fill: none; stroke: #fff; stroke-width: 9; stroke-opacity: 0.9; }
.gk-mark-ring { fill: none; stroke: var(--ink); stroke-width: 3.5; }
.gk-mark-dot { fill: var(--signal); stroke: #fff; stroke-width: 3; }
.gk-static-label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, calc(-100% - 26px)); padding: 4px 9px; background: #fff; color: var(--signal-2); border: 1px solid var(--line-2); border-radius: 3px; box-shadow: var(--shadow-label); font-size: 13px; font-weight: 650; line-height: 1.25; white-space: nowrap; }
.gk-static-label.is-below { transform: translate(-50%, 26px); }
.gk-static-circle { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; opacity: 0.8; }
.gk-static-dike { fill: none; stroke: var(--ink); stroke-width: 4.5; stroke-opacity: 0.65; stroke-linejoin: round; }
.gk-static-dike.is-r { stroke: var(--ink-2); stroke-width: 3.5; stroke-dasharray: 11 6; }
.gk-static-dike.is-o { stroke: var(--muted); stroke-width: 3; stroke-dasharray: 1.5 6; stroke-linecap: round; }
.gk-static-dike.is-x { stroke: var(--muted); stroke-width: 2.5; stroke-dasharray: 10 4 2 4; }
.gk-static-dike.is-chosen { stroke-opacity: 1; }
.gk-static-track-halo { fill: none; stroke: #fff; stroke-width: 10; stroke-opacity: 0.9; stroke-linecap: round; stroke-linejoin: round; }
/* zones A and B take their hatch from the fill attribute (url(#gk-hatch-a), url(#gk-hatch-b)), so
   no fill is set here for them */
.gk-static-zone { fill-rule: evenodd; stroke: var(--ink); stroke-width: 1.5; stroke-opacity: 0.8; stroke-linejoin: round; }
.gk-static-zone.is-b { stroke-dasharray: 6 4; stroke-opacity: 0.7; }
.gk-static-zone.is-w, .gk-static-zone.is-x { fill: var(--ink-2); fill-opacity: 0.04; stroke: var(--ink-2); stroke-width: 1.25; stroke-dasharray: 2 4; }
.gk-static-zone.is-in { stroke-width: 3; stroke-opacity: 0.9; }
.gk-static-body { fill-rule: evenodd; fill: var(--ink); fill-opacity: 0.14; stroke: var(--ink); stroke-width: 1; stroke-opacity: 0.6; }
.gk-static-halo { stroke: #fff; stroke-width: 11; stroke-opacity: 0.85; stroke-linecap: round; }
.gk-static-dash { stroke: var(--ink); stroke-width: 3.5; stroke-dasharray: 13 10; stroke-linecap: round; }
.gk-static-tick { stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; }
.gk-static-text { font-family: var(--font); font-size: 20px; font-weight: 600; fill: var(--ink-2); paint-order: stroke; stroke: #fff; stroke-width: 7px; stroke-linejoin: round; }
.gk-static-figure { font-size: 29px; font-weight: 700; fill: var(--ink); }

/* Phones: the map from edge to edge, the panel under it */
@media (max-width: 760px) {
  .gk-sheet, .gk-body { margin-inline: calc(-1 * var(--gutter)); border-left: 0; border-right: 0; border-radius: 0; }
  .gk-body { padding-inline: var(--gutter); border-bottom: 1px solid var(--line-2); }
  .gk .leaflet-control-scale { display: none; }
}
@media (pointer: fine) and (min-width: 900px) {
  .gk-src { min-height: 2.45rem; padding-block: 0.3rem; }
}
/* Touch: the controls at the company's 40px */
@media (pointer: coarse) {
  .gk .leaflet-touch .leaflet-bar a { width: 40px; height: 40px; line-height: 38px; }
  .gk-topbar { right: 58px; }
  .gk-home { min-height: 40px; }
  .gk-src { min-height: 3rem; }
}

/* Wide screens: the legend panel lies over the left of the map, as on the stikstofkaart */
@media (min-width: 900px) {
  .gk { height: clamp(580px, calc(100svh - var(--header-h) - 3rem), 760px); height: round(down, clamp(580px, calc(100svh - var(--header-h) - 3rem), 760px), 1px); grid-template-columns: minmax(360px, 37%) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .gk-sheet { grid-column: 1 / -1; grid-row: 1 / -1; height: auto; border-radius: 6px; }
  .gk-head, .gk-body { position: relative; z-index: 2; grid-column: 1; margin-left: 1rem; background: var(--ground); border: 1px solid var(--line-2); box-shadow: var(--shadow-panel); }
  .gk-head { grid-row: 1; margin-top: 1rem; padding: 1.2rem 1.35rem 0.85rem; border-bottom: 0; border-radius: 6px 6px 0 0; }
  .gk-head h2 { font-size: clamp(1.3rem, 1.55vw, 1.5rem); }
  /* The head never pushes the panel's body out of the map: on a short screen it keeps at least
     9rem for the body and scrolls itself past that (the height is that of .gk, below) */
  .gk-head { max-height: calc(clamp(580px, calc(100svh - var(--header-h) - 3rem), 760px) - 1rem - 9rem); overflow-y: auto; scrollbar-width: thin; background: linear-gradient(var(--ground) 30%, rgba(255, 255, 255, 0)) top / 100% 2.5rem no-repeat local, linear-gradient(rgba(255, 255, 255, 0), var(--ground) 70%) bottom / 100% 2.5rem no-repeat local, radial-gradient(farthest-side at 50% 100%, rgba(22, 32, 26, 0.16), rgba(22, 32, 26, 0)) bottom / 100% 0.9rem no-repeat scroll, var(--ground); }
  .gk-head .gk-scheme-svg { max-width: 330px; }
  /* the open box's drawing is for the narrow page, where the panel does not share the map's
     height; on a wide screen the label and its line say it */
  .gk-open .gk-scheme { display: none; }
  .gk-body { grid-row: 2; align-self: start; max-height: 100%; margin-bottom: 1rem; overflow-y: auto; padding: 0.1rem 1.35rem 1.2rem; border-top: 0; border-radius: 0 0 6px 6px; scrollbar-width: thin; }
  /* the panel scrolls when the lines are many: a soft ink shade at the bottom edge says there is
     more, and goes when the end is reached (the white cover scrolls with the content) */
  .gk-body { background: linear-gradient(var(--ground) 30%, rgba(255, 255, 255, 0)) top / 100% 2.5rem no-repeat local, linear-gradient(rgba(255, 255, 255, 0), var(--ground) 70%) bottom / 100% 2.5rem no-repeat local, radial-gradient(farthest-side at 50% 100%, rgba(22, 32, 26, 0.16), rgba(22, 32, 26, 0)) bottom / 100% 0.9rem no-repeat scroll, var(--ground); }
  .gk-credit { right: 6px; bottom: 6px; border-radius: 3px; font-size: 0.7rem; }
  /* in the middle of the part of the map the panel leaves free */
  .gk-missing { left: calc(max(360px, 37%) + 1rem + 16px); top: 14px; bottom: auto; max-width: calc(100% - max(360px, 37%) - 20rem); transform: none; text-align: left; }
  /* the picture without script: its middle (the address) in the middle of the part beside the
     panel, which takes max(360px, 37%) plus its 1rem margin */
  .gk-static { right: auto; width: calc(100% + max(360px, 37%) + 1rem); }
  .gk .leaflet-bottom.leaflet-right { bottom: 22px; } /* the scale bar, above the credit */
  .gk .leaflet-control-scale { margin: 0 8px 6px 0; }
}
@media (min-width: 761px) {
  .has-map .lookup { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.75rem; align-items: start; }
  .has-map .lookup > .alert, .has-map .lookup > .error { grid-column: 1 / -1; }
  .has-map .lookup .form-actions { padding-top: calc(0.93rem * 1.6 + 0.35rem); }
}
