/* OpenKLIC's look: an orange accent on white with neutral greys, and
   the system's own fonts, so nothing is fetched. Light is the default, and for now the only theme. */

:root {
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-soft: #ffedd5;
  --ink: #1f2328;
  --ink-soft: #57606a;
  --ink-faint: #8b949e;
  --line: #d8dee4;
  --line-soft: #eaeef2;
  --panel: #ffffff;
  --page: #f6f7f9;
  --hover: #f3f4f6;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --radius: 8px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 4px 16px rgb(0 0 0 / 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  --topbar: 56px;
  --sidebar: 360px;
  --detail: 380px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.5 var(--font);
  color: var(--ink);
  background: var(--panel);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-hover); }
a:hover { color: var(--primary); }
code, pre { font-family: var(--mono); font-size: 0.88em; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; }
[hidden] { display: none !important; }

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  padding: 0.5em 1.1em;
  border-radius: var(--radius);
  font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
}
button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button:disabled { opacity: 0.55; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, canvas:focus-visible, li:focus-visible, a:focus-visible {
  outline: 3px solid var(--primary-soft);
  outline-offset: 1px;
}
button.secondary { background: var(--panel); color: var(--ink); border-color: var(--line); }
button.secondary:hover { border-color: var(--ink-faint); background: var(--page); }
button.link {
  background: none; border: none; color: var(--primary-hover); padding: 0.2em 0.3em;
  font-weight: 500; text-decoration: underline; text-underline-offset: 2px;
}
button.link:hover { color: var(--primary); background: none; }
button.small { padding: 0.15em 0.65em; font-size: 0.82rem; }
.text-button {
  background: none; border: none; padding: 0 0.15rem; color: var(--ink-faint); font-weight: 500;
  font-size: 0.78rem;
}
.text-button:hover { background: none; color: var(--primary); text-decoration: underline; }
.icon-button {
  background: none; border: none; padding: 0.2rem; color: var(--ink-faint); border-radius: 6px; line-height: 0;
}
.icon-button:hover { background: var(--line-soft); color: var(--ink); border: none; }
.icon-button svg { transition: transform 0.15s; }
.icon-button.open svg { transform: rotate(90deg); }

/* ── the top bar ───────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--ink); font-size: 1.2rem; }
.brand b { color: var(--primary); }
.levering-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.levering-title span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.levering-title small { color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 0.5rem; }
/* The top bar's own buttons, not the buttons of the menu inside it. */
.top-actions > button, .top-actions > .menu-wrap > button { padding: 0.4em 0.9em; font-size: 0.92rem; }
.top-link { color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 0.92rem; }
.top-link:hover { color: var(--primary); }
.viewer-only { display: none !important; }
.has-levering .viewer-only { display: inline-flex !important; }

/* menus: the downloads in the top bar, the map layers on the map */
.menu-wrap { position: relative; }
.menu {
  position: absolute; z-index: 40; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 8px 28px rgb(0 0 0 / 0.16); padding: 0.4rem; min-width: 280px;
}
.menu-right { right: 0; top: calc(100% + 6px); width: 340px; }
.menu-left { right: calc(100% + 8px); top: 0; width: 260px; }
.menu-heading {
  margin: 0.35rem 0.55rem 0.25rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-faint);
}
.menu-option {
  display: block; width: 100%; text-align: left; background: none; border: none; color: var(--ink);
  font-weight: 400; padding: 0.35rem 0.55rem; border-radius: 6px; font-size: 0.9rem;
}
.menu-option:hover { background: var(--hover); border: none; }
.menu-option.on { background: var(--primary-soft); color: var(--primary-hover); font-weight: 600; }
.menu-slider { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.55rem 0.55rem 0.2rem; font-size: 0.85rem; color: var(--ink-soft); }
.menu-slider input { accent-color: var(--primary); width: 100%; }
.menu-slider input:disabled { opacity: 0.4; }
.menu .fine { padding: 0 0.55rem 0.3rem; }

/* ── the welcome page ─────────────────────────────────────────────────── */
/* The page fills the window at least, so that the footer is at its bottom. */
#welcome { min-height: calc(100vh - var(--topbar)); display: flex; flex-direction: column; background: var(--panel); }
/* The logo's band: the top quarter of the window, the width of it, drawn by intro.js. */
.intro { height: 25vh; min-height: 170px; border-bottom: 1px solid var(--line-soft); background: #fff; }
.intro-logo { display: block; width: 100%; height: 100%; cursor: pointer; }
.drop-band { max-width: 1120px; width: 100%; margin: 0 auto; padding: 2rem 1rem 0; }
.dropzone {
  border: 2px dashed var(--primary); border-radius: 14px; background: #fffaf5; color: var(--primary);
  padding: 1.3rem 1.6rem; display: flex; align-items: center; gap: 1.2rem;
}
.dropzone svg { flex: none; }
.drop-text { flex: 1; min-width: 0; }
.dropzone h2 { color: var(--ink); font-size: 1.3rem; margin: 0; }
.dropzone .hint { color: var(--ink-faint); font-size: 0.86rem; margin: 0.25rem 0 0; }
.dropzone .or { color: var(--ink-soft); }
.dropzone button { flex: none; font-size: 1.05rem; padding: 0.65em 1.5em; }
/* Four cards under the drop zone, each topped in a colour of the logo. */
.welcome-cards {
  max-width: 1120px; width: 100%; margin: 0 auto; padding: 1.5rem 1rem 3rem; flex: 1;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; align-content: start;
}
.welcome-card {
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--primary);
  border-radius: var(--radius); padding: 1rem 1.15rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.4rem; min-width: 0;
}
.welcome-card:nth-child(2) { border-top-color: #ffd750; }
.welcome-card:nth-child(3) { border-top-color: #00ff00; }
.welcome-card:nth-child(4) { border-top-color: #c80000; }
.welcome-card h3 { font-size: 1rem; margin: 0; }
.welcome-card p { color: var(--ink-soft); margin: 0; font-size: 0.92rem; line-height: 1.45; }
.welcome-card pre {
  background: #1f2328; color: #f0f3f6; padding: 0.45rem 0.75rem; border-radius: 6px;
  overflow-x: auto; font-size: 0.85rem; margin: 0.35rem 0 0;
}
.repository-link { font-weight: 600; font-size: 0.9rem; margin-top: auto; padding-top: 0.25rem; }
.site-footer { background: var(--page); border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.88rem; }
.footer-inner {
  max-width: 1120px; margin: 0 auto; padding: 1.8rem 1rem 1.2rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start;
}
.footer-brand .brand { font-size: 1.05rem; }
.footer-brand p, .footer-notes p { margin: 0.5rem 0 0; line-height: 1.45; }
.footer-notes p:first-child { margin-top: 0; }
.footer-bottom {
  max-width: 1120px; margin: 0 auto; padding: 0.8rem 1rem 1.2rem;
  border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 0.8rem;
}

/* ── the viewer ───────────────────────────────────────────────────────── */
#viewer {
  position: fixed; inset: var(--topbar) 0 0 0;
  display: grid; grid-template-columns: var(--sidebar) 1fr;
}
.sidebar-closed #viewer { grid-template-columns: 0 1fr; }
.sidebar {
  border-right: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden;
}

/* the tabs: a subject each */
/* Four tabs fit on one line; where a wide system font does not, the last wraps to a second line
   and stays in sight. */
.tabs { display: flex; flex-wrap: wrap; padding: 0.4rem 0.3rem 0; border-bottom: 1px solid var(--line); flex: none; }
.tabs button {
  flex: 1 1 auto; background: none; border: none; color: var(--ink-soft); font-weight: 500; white-space: nowrap;
  padding: 0.5em 0.4em; border-radius: 6px 6px 0 0; border-bottom: 2px solid transparent; font-size: 0.86rem;
  margin-bottom: -1px;
}
.tabs button:hover { color: var(--ink); background: var(--page); border-color: transparent; }
/* The same weight on and off: a bolder tab would be wider, and push the others. */
.tabs button[aria-selected="true"] { color: var(--primary-hover); border-bottom-color: var(--primary); }
.tabs button:focus-visible { outline-offset: -3px; }
.panels { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* Each panel scrolls by itself, so a tab keeps its place when the user goes to another. */
[role="tabpanel"] { flex: 1; min-height: 0; overflow-y: auto; padding: 0 0.6rem 2rem; }
.panel-tools {
  display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0.6rem 0.4rem 0.45rem;
  position: sticky; top: 0; z-index: 2; background: var(--panel);
}
.tool-button {
  background: var(--panel); color: var(--ink-soft); border: 1px solid var(--line); font-weight: 500;
  font-size: 0.8rem; padding: 0.15rem 0.65rem; border-radius: 999px;
}
.tool-button:hover { background: var(--primary-soft); color: var(--primary-hover); border-color: var(--primary); }
.toggle-button[aria-pressed="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }
.toggle-button[aria-pressed="true"]:hover { background: var(--primary-hover); color: #fff; border-color: var(--primary-hover); }
.panel-intro { color: var(--ink-soft); font-size: 0.88rem; margin: 0.7rem 0.4rem 0.35rem; line-height: 1.4; }
.panel-tools + .panel-intro { margin-top: 0.1rem; }
.help { color: var(--ink-faint); font-size: 0.76rem; margin: 0 0.4rem 0.4rem; line-height: 1.35; }
.count { color: var(--ink-faint); font-variant-numeric: tabular-nums; font-size: 0.8rem; font-weight: 400; }

/* the layers: a group per kind of object, which folds, with a box for the whole group */
.layer-group { border-bottom: 1px solid var(--line-soft); }
.layer-group > summary {
  list-style: none; display: flex; align-items: center; gap: 0.55rem; cursor: pointer;
  padding: 0.45rem 0.4rem; font-weight: 600; font-size: 0.9rem; border-radius: 6px;
}
.layer-group > summary:hover { background: var(--hover); }
.layer-group > summary::-webkit-details-marker { display: none; }
.layer-group > summary::after {
  content: ""; width: 0.4rem; height: 0.4rem; border-right: 2px solid var(--ink-faint);
  border-bottom: 2px solid var(--ink-faint); transform: rotate(-45deg); transition: transform 0.15s;
  flex: none; margin: 0 0.25rem 0 0.1rem;
}
.layer-group[open] > summary::after { transform: rotate(45deg); }
.layer-group.all-off .group-name { color: var(--ink-soft); }
/* A long name wraps: the group's name is the one word to read in full. */
.group-name { flex: 1; min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.layer-group .zoom-hint { flex: none; }
/* The rows' boxes stand under the group's name, their counts under the group's count. */
.layer-group .drag-list { padding: 0 0 0.4rem 1.55rem; }
.layer-group .drag-row { padding-right: 1.7rem; }

/* rows that switch on and off by click or drag (drag.js) */
.drag-list { list-style: none; margin: 0; padding: 0; user-select: none; }
.drag-list.long { max-height: 19rem; overflow-y: auto; border: 1px solid var(--line-soft); border-radius: 8px; padding: 0.15rem; }
.drag-row {
  display: flex; align-items: center; gap: 0.55rem; padding: 0.28rem 0.4rem; border-radius: 6px;
  cursor: pointer; font-size: 0.9rem; touch-action: none;
}
.drag-row:hover { background: var(--hover); }
.drag-row.off .row-label { opacity: 0.45; }
.drag-row.chosen { background: var(--primary-soft); }
.drag-row.chosen .icon-button:first-child { color: var(--primary-hover); }
.drag-box, .group-box {
  flex: none; width: 1rem; height: 1rem; border-radius: 4px; border: 2px solid var(--primary);
  background: var(--primary); position: relative; padding: 0;
}
.drag-box::after, .group-box[aria-checked="true"]::after {
  content: ""; position: absolute; left: 4px; top: 0.5px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.group-box[aria-checked="mixed"]::after {
  content: ""; position: absolute; left: 2px; right: 2px; top: 5px; height: 2px; background: #fff;
}
.group-box:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.drag-row.off .drag-box, .group-box[aria-checked="false"] { background: var(--panel); border-color: var(--ink-faint); }
.group-box[aria-checked="false"]:hover { border-color: var(--ink); }
.drag-row.off .drag-box::after { display: none; }
.row-label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.5rem; }
.row-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.row-name > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-name small { color: var(--ink-faint); font-size: 0.76rem; }
.drag-extra { display: flex; gap: 0.05rem; flex: none; }
.zoom-hint {
  font-size: 0.68rem; color: var(--warn); background: var(--warn-soft); border-radius: 999px;
  padding: 0 0.4rem; white-space: nowrap;
}

.swatch { flex: none; width: 22px; height: 12px; display: inline-block; background: var(--c); border-radius: 2px; }
/* Each as the map draws it (pmkl.js shapeStyle): lines in the thema colour, the mantelbuis as a
   soft band, areas lightly filled with their outline, markers filled with a white edge. */
.swatch-kabel, .swatch-overig, .swatch-koker { height: 4px; border-radius: 2px; }
.swatch-mantelbuis { height: 9px; border-radius: 5px; background: color-mix(in srgb, var(--c) 30%, transparent); }
.swatch-container { width: 11px; height: 11px; border-radius: 0; margin: 0 5.5px; box-shadow: 0 0 0 1px #fff, 0 0 0 2px var(--line); }
.swatch-leidingelement { width: 10px; height: 10px; border-radius: 50%; margin: 0 6px; }
.swatch-annotatie, .swatch-maatvoering, .swatch-eigentopografie { height: 2px; }
.swatch-diepte { width: 10px; height: 10px; background: none; border: 2px solid var(--c); border-radius: 50%; margin: 0 6px; }
.swatch-aanvraag { background: none; border: 2px dashed var(--c); height: 12px; }
.swatch-extradetailinfo { background: rgb(0 0 0 / 0.04); border: 1px dashed #000; }
.swatch-eisvoorzorgsmaatregel { background: color-mix(in srgb, var(--c) 15%, transparent); border: 1.5px dashed var(--c); }
.swatch-extrageometrie { background: color-mix(in srgb, var(--c) 12%, transparent); border: 1.5px solid var(--c); }
.swatch-dot { width: 10px; height: 10px; border-radius: 50%; }

.chips { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.3rem 0; }
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.05rem 0.5rem;
  border-radius: 999px; background: var(--page); border: 1px solid var(--line); font-size: 0.8rem; white-space: nowrap;
  color: var(--ink); font-weight: 500;
}
.chip-button:hover { background: var(--primary-soft); border-color: var(--primary); }
.status-p { background: var(--warn-soft); border-color: #fcd34d; }
.status-b { background: #f3f4f6; color: var(--ink-soft); }
.badge { font-size: 0.68rem; padding: 0 0.4rem; border-radius: 999px; background: #f3f4f6; color: var(--ink-soft); white-space: nowrap; font-weight: 700; }
.badge-warn { background: var(--warn-soft); color: var(--warn); }

.nb-more-row { list-style: none; }
.nb-more { padding: 0.1rem 0.6rem 0.6rem 2rem; font-size: 0.88rem; }
.nb-more p { margin: 0.3rem 0; }
.nb-out { margin: 0.6rem 0.4rem 0; font-size: 0.85rem; color: var(--ink-soft); }
.nb-out summary { cursor: pointer; }
.plain { list-style: none; padding: 0.3rem 0 0 0.8rem; margin: 0; }
.plain li { padding: 0.1rem 0; }
.plain small { color: var(--ink-faint); }
.contact { border-left: 3px solid var(--line); padding: 0.15rem 0 0.15rem 0.6rem; margin: 0.45rem 0; }
.contact dl { margin: 0.2rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.7rem; }
.contact dt { color: var(--ink-faint); font-size: 0.8rem; }
.contact dd { margin: 0; overflow-wrap: anywhere; }
.warn { color: var(--warn); font-weight: 500; }
.ok { background: var(--ok-soft); color: var(--ok); padding: 0.5rem 0.75rem; border-radius: var(--radius); font-size: 0.9rem; }
.fine { margin: 0; color: var(--ink-soft); font-size: 0.78rem; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 0.6rem 0; font-size: 0.9rem; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
table.counts { border-collapse: collapse; width: 100%; font-size: 0.84rem; }
table.counts td { padding: 0.15rem 0.2rem; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.issues { padding-left: 1rem; font-size: 0.84rem; }
.issues li { margin-bottom: 0.4rem; overflow-wrap: anywhere; }
.files { list-style: none; padding: 0; margin: 0; }
.files li { display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0; border-bottom: 1px solid var(--line-soft); font-size: 0.86rem; }
.file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report { margin-top: 1.2rem; border-top: 1px solid var(--line-soft); padding-top: 0.6rem; }
.report > summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); font-size: 0.88rem; }

/* the Leveringen tab: a levering's details below the list */
/* Scrolled to from a levering's ⓘ: its heading stops below the panel's sticky buttons. */
.levering-detail { border-top: 1px solid var(--line); margin-top: 0.8rem; padding: 0.9rem 0.4rem 0; scroll-margin-top: 2.9rem; }
.levering-detail .pick { margin: 0; font-size: 0.84rem; color: var(--ink-soft); }

/* the download menu: what, which leveringen, the choices for it, one button */
.menu-right { max-height: calc(100vh - var(--topbar) - 1rem); overflow-y: auto; }
.menu-field { padding: 0.15rem 0 0.35rem; }
.menu-field + .menu-field, .menu-checks + .menu-field { border-top: 1px solid var(--line-soft); padding-top: 0.35rem; }
.menu-field.dim { opacity: 0.5; pointer-events: none; }
.menu-hint { margin: 0.25rem 0.55rem 0; color: var(--ink-soft); font-size: 0.76rem; line-height: 1.3; }
/* What to download: a radio row each, the chosen one tinted. */
.format-options { display: flex; flex-direction: column; gap: 0.1rem; }
.format-option {
  display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 0.55rem; width: 100%;
  background: none; border: 1px solid transparent; color: var(--ink); text-align: left;
  padding: 0.4rem 0.55rem; border-radius: 8px; font-weight: 400;
}
.format-option:hover { background: var(--hover); border-color: transparent; }
.format-option.on { background: var(--primary-soft); border-color: var(--primary); }
.format-option > span:last-child { display: flex; flex-direction: column; gap: 0.05rem; }
.format-option b { font-weight: 600; font-size: 0.9rem; }
.format-option small { color: var(--ink-soft); font-size: 0.76rem; line-height: 1.3; }
.radio-dot { width: 0.85rem; height: 0.85rem; margin-top: 0.2rem; border-radius: 50%; border: 1.5px solid var(--ink-faint); background: var(--panel); }
.format-option.on .radio-dot { border-color: var(--primary); background: radial-gradient(circle, var(--primary) 0 45%, var(--panel) 50%); }
/* A choice of two: side by side in one pill. */
.segmented { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0.3rem; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--page); }
.segment { background: none; border: none; color: var(--ink-soft); font-weight: 500; font-size: 0.84rem; padding: 0.3rem 0.4rem; border-radius: 6px; }
.segment:hover { background: var(--hover); color: var(--ink); border: none; }
.segment.on, .segment.on:hover { background: var(--panel); color: var(--primary-hover); font-weight: 600; box-shadow: 0 1px 3px rgb(0 0 0 / 0.14); }
.export-list { max-height: 11.5rem; overflow-y: auto; margin: 0 0.3rem; border: 1px solid var(--line-soft); border-radius: 8px; }
.export-row { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 0.5rem; padding: 0.3rem 0.5rem; font-size: 0.86rem; cursor: pointer; }
.export-row:hover { background: var(--hover); }
.export-row input { accent-color: var(--primary); margin: 0; }
.export-name { font-weight: 600; white-space: nowrap; }
.export-row small { color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.export-tools { display: flex; gap: 0.3rem; padding: 0.4rem 0.3rem 0; }
.menu-checks { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.3rem 0.3rem 0.3rem; border-top: 1px solid var(--line-soft); }
.menu-check { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 0.5rem; padding: 0.35rem 0.4rem; border-radius: 6px; cursor: pointer; }
.menu-check:hover { background: var(--hover); }
.menu-check input { accent-color: var(--primary); margin: 0.2rem 0 0; }
.menu-check span { display: flex; flex-direction: column; gap: 0.05rem; }
.menu-check b { font-size: 0.86rem; font-weight: 600; }
.menu-check small { color: var(--ink-soft); font-size: 0.74rem; line-height: 1.3; }
/* The button stays in view at the bottom while the choices scroll. */
.menu-foot {
  position: sticky; bottom: -0.4rem; margin: 0.3rem -0.4rem -0.4rem; padding: 0.55rem 0.7rem 0.6rem;
  background: var(--panel); border-top: 1px solid var(--line); border-radius: 0 0 12px 12px;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.download-go { width: 100%; font-size: 0.95rem; padding: 0.5rem; }
.download-file { color: var(--ink-faint); font-size: 0.74rem; text-align: center; overflow-wrap: anywhere; }
.download-file.saved { color: var(--primary-hover); font-weight: 600; }
/* "Met de documenten" under the GeoPackage it belongs to, with the button that shows how it works. */
.format-sub { display: flex; align-items: flex-start; gap: 0.2rem; margin: 0.1rem 0 0.25rem 1.55rem; }
.format-sub .menu-check { flex: 1; }
.format-sub .demo-button { margin-top: 0.35rem; color: var(--primary); }
/* What a download with the documents holds, beside the menu while the pointer is on its tick. */
.download-preview {
  position: fixed; z-index: 60; max-width: 360px; padding: 0.55rem 0.75rem 0.6rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgb(0 0 0 / 0.16);
  font-size: 0.8rem; color: var(--ink); pointer-events: none;
}
.download-preview > p { margin: 0 0 0.3rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); }
.download-preview ul { list-style: none; margin: 0; padding-left: 1rem; border-left: 1px solid var(--line-soft); }
.download-preview > ul { padding-left: 0; border-left: none; }
.download-preview li { padding: 0.05rem 0; }
/* How a download with the documents works in QGIS and ArcGIS Pro. */
dialog.demo { max-width: min(860px, 96vw); padding: 1rem 1.25rem 1.1rem; }
dialog.demo:focus { outline: none; }
dialog.demo[open] { display: flex; flex-direction: column; gap: 0.7rem; }
.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.demo-head h2 { margin: 0; font-size: 1.1rem; }
dialog.demo .segmented { align-self: flex-start; min-width: 260px; }
.demo-image { display: block; width: 800px; max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line-soft); }
.demo-step { display: flex; align-items: center; gap: 0.8rem; max-width: 800px; }
.demo-step p { flex: 1; margin: 0; min-height: 2.6em; font-size: 0.9rem; line-height: 1.35; }
.demo-step button { flex: none; }
.tree-folder { font-weight: 600; }
.tree-folder::before { content: "▸ "; color: var(--primary); }
.tree-file { color: var(--ink-soft); }
.download-name { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); }
.download-name input {
  font: inherit; font-size: 0.88rem; font-weight: 400; letter-spacing: normal; text-transform: none;
  color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 0.35rem 0.5rem;
}
.download-name input::placeholder { color: var(--ink-soft); }

/* the map */
.map-wrap { position: relative; min-width: 0; background: #fff; }
/* The left button selects, as in AutoCAD; the middle button (or space) moves the map. */
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: default; touch-action: none; }
#map.over-feature { cursor: pointer; }
#map.can-pan { cursor: grab; }
#map.dragging { cursor: grabbing; }
#map.measuring { cursor: crosshair; }
/* A box to the right selects what lies wholly inside (solid blue); to the left, what it touches
   (dashed green). AutoCAD's colours, which CAD users know. */
.select-box { position: absolute; z-index: 3; pointer-events: none; border: 1.5px solid #2563eb; background: rgb(37 99 235 / 0.08); }
.select-box.crossing { border: 1.5px dashed #16a34a; background: rgb(22 163 74 / 0.08); }
.map-button[aria-pressed="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }

/* the chooser at a click with several objects, and the card of the object under the pointer */
.chooser, .hover-card {
  position: absolute; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.16); font-size: 0.84rem;
}
.chooser { z-index: 9; width: 300px; max-width: calc(100% - 16px); padding: 0.35rem; }
.chooser-title { margin: 0.15rem 0.45rem 0.3rem; color: var(--ink-soft); font-size: 0.78rem; }
.chooser-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; }
.chooser-item, .sel-item {
  display: flex; align-items: center; justify-content: flex-start; gap: 0.5rem; width: 100%; text-align: left;
  background: none; border: none; color: var(--ink); font-weight: 400; padding: 0.3rem 0.45rem; border-radius: 6px;
}
.chooser-item:hover, .chooser-item:focus-visible, .sel-item:hover, .sel-item:focus-visible { background: var(--primary-soft); border: none; }
.chooser-item span:last-child, .sel-item span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch-dot { flex: none; }
.hover-card { z-index: 10; width: 272px; max-height: 300px; overflow-y: auto; padding: 0.6rem 0.75rem; }
/* The head and the foot open the details: buttons drawn as text, with a link's
   colour and underline under the pointer. */
.card-head, .card-foot {
  display: flex; justify-content: flex-start; width: 100%; text-align: left;
  background: none; border: none; padding: 0; border-radius: 4px; color: inherit; font-weight: 400;
}
.card-head { align-items: center; gap: 0.45rem; margin-bottom: 0.35rem; font-size: 0.9rem; }
.card-head:hover, .card-foot:hover { background: none; color: var(--primary); }
.card-head:hover b, .card-foot:hover { text-decoration: underline; text-underline-offset: 2px; }
.card-rows { display: grid; grid-template-columns: auto 1fr; gap: 0.12rem 0.7rem; margin: 0; }
.card-rows dt { color: var(--ink-soft); }
.card-rows dd { margin: 0; overflow-wrap: anywhere; }
.hover-card .warn { margin: 0 0 0.35rem; font-size: 0.8rem; }
.card-foot { margin: 0.45rem 0 0; color: var(--primary-hover); font-size: 0.76rem; }
.map-controls { position: absolute; top: 0.75rem; right: 0.75rem; display: flex; flex-direction: column; gap: 0.45rem; z-index: 5; }
.map-button {
  width: 38px; height: 38px; padding: 0; font-size: 1.2rem; line-height: 1;
  background: rgb(255 255 255 / 0.95); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.map-button:hover, .map-button[aria-expanded="true"] { background: var(--panel); color: var(--primary); border-color: var(--primary); }
.zoom-buttons { display: flex; flex-direction: column; }
.zoom-buttons .map-button:first-child { border-radius: var(--radius) var(--radius) 0 0; border-bottom: none; }
.zoom-buttons .map-button:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.scale {
  position: absolute; left: 0.75rem; bottom: 0.75rem; pointer-events: none;
  background: rgb(255 255 255 / 0.9); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 0.3rem 0.6rem; font-size: 0.78rem; display: flex; align-items: center; gap: 0.9rem;
  font-variant-numeric: tabular-nums;
}
#scalebar { display: flex; align-items: center; gap: 0.4rem; }
#scalebar-bar { height: 6px; border: 2px solid var(--ink); border-top: none; width: 100px; }
#coords { color: var(--ink-soft); white-space: pre; }
.map-note {
  position: absolute; top: 0.75rem; left: 50%; transform: translateX(-50%); max-width: 80%;
  background: var(--warn-soft); color: var(--warn); border: 1px solid #fcd34d; margin: 0;
  padding: 0.45rem 0.8rem; border-radius: var(--radius); font-size: 0.86rem; box-shadow: var(--shadow); z-index: 4;
}
/* what the map lacks: stays for as long as it does, each line a button to where it is told in full */
.map-warnings {
  position: absolute; top: 0.75rem; left: 0.75rem; z-index: 4; max-width: min(30rem, calc(100% - 5.5rem));
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem;
}
.map-warning {
  display: flex; align-items: flex-start; gap: 0.45rem; text-align: left; font-weight: 500;
  background: var(--warn-soft); color: var(--warn); border: 1px solid #fcd34d;
  padding: 0.4rem 0.7rem; border-radius: var(--radius); font-size: 0.84rem; box-shadow: var(--shadow);
}
.map-warning:hover { background: #fde68a; color: var(--warn); border-color: #f59e0b; }
.map-warning::before { content: "!"; font-weight: 800; flex: none; }
.sidebar-toggle {
  display: none; position: fixed; left: 0.6rem; bottom: 3.2rem; z-index: 30; width: 44px; height: 44px; padding: 0;
  box-shadow: var(--shadow);
}

/* the detail panel: over the map's right edge, so that opening it does not move the map */
.detail {
  position: absolute; z-index: 8; top: 0; right: 0; bottom: 0; width: var(--detail);
  border-left: 1px solid var(--line); background: var(--panel); box-shadow: -6px 0 18px rgb(0 0 0 / 0.08);
  overflow-y: auto; padding: 0.9rem 1rem 2rem;
}
.has-detail .map-controls { right: calc(var(--detail) + 0.75rem); }
.detail-close {
  position: absolute; top: 0.5rem; right: 0.5rem; width: 32px; height: 32px; padding: 0;
  background: none; color: var(--ink-soft); border: none; font-size: 1.5rem; line-height: 1;
}
.detail-close:hover { background: var(--page); color: var(--ink); border: none; }
.detail-head h2 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.detail .detail-head h2 { padding-right: 2rem; }
.detail-id { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.4rem; font-size: 0.8rem; margin-top: 0.2rem; }
.detail-id code { color: var(--ink-soft); overflow-wrap: anywhere; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.55rem; }
.detail .back { margin: 0 0 0.5rem; font-size: 0.84rem; }
.sel-group h3 { margin: 1rem 0 0.2rem; }
.sel-list { list-style: none; margin: 0; padding: 0; font-size: 0.86rem; }
.detail-nb { background: var(--page); border-radius: var(--radius); padding: 0.6rem 0.75rem; margin: 0.8rem 0; font-size: 0.9rem; }
.detail-nb h3 { margin: 0 0 0.2rem; font-size: 0.8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.detail-nb p { margin: 0; }
.detail-nb .contact { border-left: none; padding-left: 0; }
.detail section h3, .levering-detail section h3 { font-size: 0.8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; margin: 1.1rem 0 0.3rem; }
.detail h4, .levering-detail h4 { font-size: 0.85rem; margin: 0.8rem 0 0.25rem; }
.detail section > p, .levering-detail section > p { font-size: 0.86rem; }
table.props { width: 100%; border-collapse: collapse; font-size: 0.84rem; margin-bottom: 0.6rem; }
table.props th { text-align: left; font-weight: 500; color: var(--ink-soft); padding: 0.18rem 0.6rem 0.18rem 0; vertical-align: top; width: 42%; overflow-wrap: anywhere; }
table.props td { padding: 0.18rem 0; overflow-wrap: anywhere; }
table.props tr { border-bottom: 1px solid var(--line-soft); }
table.props tr.group th { color: var(--ink); font-weight: 600; padding-top: 0.45rem; }
.indent { display: inline-block; }
.indent-1 { width: 0.8rem; } .indent-2 { width: 1.6rem; } .indent-3 { width: 2.4rem; } .indent-4 { width: 3.2rem; }

/* loading, dropping, errors */
.loading {
  position: fixed; inset: 0; z-index: 50; background: rgb(255 255 255 / 0.85);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; font-weight: 600;
}
.spinner {
  width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--primary-soft); border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.drop-overlay {
  display: none; position: fixed; inset: 0; z-index: 60; background: rgb(234 88 12 / 0.12);
  border: 4px dashed var(--primary); align-items: center; justify-content: center; pointer-events: none;
}
.drop-overlay p { background: var(--panel); padding: 1rem 1.5rem; border-radius: 12px; font-weight: 700; font-size: 1.2rem; box-shadow: var(--shadow); }
.dropping .drop-overlay { display: flex; }
dialog { border: none; border-radius: 12px; box-shadow: var(--shadow); max-width: min(560px, 92vw); padding: 1.5rem; }

/* the documents: the list on the left, the chosen one on the right (web/js/documents.js) */
dialog.docs { max-width: none; width: min(1280px, 96vw); height: min(900px, 92vh); padding: 0; overflow: hidden; }
dialog.docs[open] { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; }
.docs-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.docs-head { padding: 0.8rem 0.9rem 0.5rem; border-bottom: 1px solid var(--line-soft); }
.docs-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.docs-title h2 { font-size: 1.05rem; margin: 0.15rem 0 0.1rem; overflow-wrap: anywhere; }
.docs-title .detail-close { position: static; flex: none; }
.docs-head .text-button { font-size: 0.82rem; }
.docs-filters { display: flex; gap: 0.4rem; margin-top: 0.5rem; }
.docs-search, .docs-levering {
  font: inherit; font-size: 0.86rem; border: 1px solid var(--line); border-radius: 6px; padding: 0.3rem 0.5rem;
  background: var(--panel); color: var(--ink); min-width: 0;
}
.docs-search { flex: 1; }
.docs-tools { display: flex; gap: 0.3rem; margin-top: 0.45rem; }
.docs-tools .tool-button { font-size: 0.78rem; padding: 0.1rem 0.6rem; }
.docs-list { overflow-y: auto; min-height: 0; flex: 1; padding: 0.4rem 0.5rem 1.5rem; }
.docs-group > summary {
  display: flex; align-items: center; gap: 0.4rem; cursor: pointer; padding: 0.35rem 0.4rem; border-radius: 6px;
  font-weight: 600; font-size: 0.88rem;
}
.docs-group > summary:hover { background: var(--hover); }
.docs-group > summary > span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.docs-group .count { color: var(--ink-faint); font-weight: 500; font-size: 0.8rem; }
.docs-sub { margin-left: 0.7rem; border-left: 1px solid var(--line); padding-left: 0.3rem; }
.docs-sub > summary { font-weight: 500; font-size: 0.84rem; color: var(--ink-soft); }
.docs-items { list-style: none; margin: 0 0 0.3rem; padding: 0; }
.doc-item {
  display: flex; align-items: flex-start; justify-content: flex-start; gap: 0.5rem; width: 100%; text-align: left; background: none; border: 1px solid transparent;
  color: var(--ink); font-weight: 400; padding: 0.35rem 0.45rem; border-radius: 6px;
}
.doc-item:hover { background: var(--hover); border-color: transparent; }
.doc-item.on { background: var(--primary-soft); border-color: var(--primary); }
.doc-icon {
  flex: none; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.03em; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 4px; padding: 0.05rem 0.25rem; margin-top: 0.15rem; background: var(--panel);
}
.doc-text { display: flex; flex-direction: column; min-width: 0; }
.doc-name { font-size: 0.86rem; overflow-wrap: anywhere; }
.doc-text small { color: var(--ink-faint); font-size: 0.75rem; }
.docs-view { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.docs-view-head { padding: 0.8rem 1rem 0.6rem; border-bottom: 1px solid var(--line-soft); }
.docs-view-head h3 { margin: 0 0 0.2rem; font-size: 1rem; overflow-wrap: anywhere; }
.docs-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.1rem 0.8rem; margin: 0.4rem 0; font-size: 0.82rem; }
.docs-facts dt { color: var(--ink-faint); }
.docs-facts dd { margin: 0; overflow-wrap: anywhere; }
.docs-actions { display: flex; gap: 0.4rem; }
.docs-preview { flex: 1; min-height: 0; background: var(--page); display: flex; }
.docs-frame { border: none; width: 100%; height: 100%; background: #fff; }
.docs-image { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 0.5rem; }
.docs-image img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
.docs-empty { margin: auto; padding: 1.5rem; text-align: center; color: var(--ink-soft); font-size: 0.9rem; max-width: 34rem; }
/* an object's documents in its panel */
.detail-docs h4 { font-size: 0.84rem; margin: 0.6rem 0 0.15rem; }
.doc-short { list-style: none; margin: 0; padding: 0; font-size: 0.86rem; }
.doc-short li { padding: 0.1rem 0; overflow-wrap: anywhere; }
.doc-link { text-align: left; font-weight: 400; padding: 0; font-size: 0.86rem; color: var(--primary-hover); display: inline; }
.detail-docs .docs-open { margin-top: 0.5rem; }
@media (max-width: 760px) {
  dialog.docs { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }
  dialog.docs[open] { grid-template-columns: 1fr; grid-template-rows: minmax(0, 45%) minmax(0, 1fr); }
  .docs-side { border-right: none; border-bottom: 1px solid var(--line); }
}
dialog::backdrop { background: rgb(0 0 0 / 0.35); }
dialog pre { white-space: pre-wrap; color: var(--ink-soft); font-size: 0.8rem; }
.error-list { padding-left: 1.1rem; }
.error-list li { margin-bottom: 0.3rem; overflow-wrap: anywhere; }

/* narrow screens: the panels over the map */
@media (max-width: 1100px) {
  :root { --sidebar: 330px; --detail: 330px; }
  .tabs button { font-size: 0.82rem; }
  .welcome-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .dropzone { flex-wrap: wrap; justify-content: center; text-align: center; }
  .drop-text { flex-basis: 100%; }
  .welcome-cards { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1rem; }
  #viewer { grid-template-columns: 1fr; }
  .sidebar {
    position: absolute; z-index: 25; inset: 0 auto 0 0; width: min(88vw, 360px); box-shadow: var(--shadow);
  }
  .sidebar-closed .sidebar { display: none; }
  .sidebar-toggle { display: inline-flex; }
  .has-detail .sidebar-toggle { bottom: calc(55% + 0.6rem); }
  .sidebar-closed #viewer { grid-template-columns: 1fr; }
  .detail { position: absolute; z-index: 26; inset: auto 0 0 0; width: auto; max-height: 55%; box-shadow: var(--shadow); border-left: none; border-top: 1px solid var(--line); }
  .has-detail .map-controls { right: 0.75rem; }
  .levering-title small, .top-actions > button > span, .top-actions > .menu-wrap > button > span { display: none; }
  .top-link { display: none; }
  .menu-right { width: min(340px, 92vw); }
  #coords { display: none; }
  /* Room below the last row, to scroll it clear of the panel button. */
  [role="tabpanel"] { padding-bottom: 6rem; }
}
@media (max-width: 380px) {
  .tabs button { font-size: 0.78rem; padding-inline: 0.3em; }
}
