/* RIBX app layout: toolbar on top, map left, side panel right. No inline styles (CSP style-src 'self'). */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font: 14px/1.4 system-ui, "Segoe UI", Roboto, Arial, sans-serif; color: #222; }
body { display: flex; flex-direction: column; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 10px; background: #f3f5f7; border-bottom: 1px solid #ccd; }
.toolbar h1 { font-size: 16px; margin: 0 8px 0 0; }
.toolbar label { display: inline-flex; align-items: center; gap: 4px; }
.toolbar select, .toolbar button, .button { font: inherit; padding: 3px 8px; border: 1px solid #99a; border-radius: 4px; background: #fff; cursor: pointer; }
.button.primary { background: #0b5394; color: #fff; border-color: #0b5394; }
.button:focus-within, button:focus-visible, select:focus-visible { outline: 2px solid #f2c400; outline-offset: 1px; }
.spacer { flex: 1; }
main { flex: 1; display: flex; min-height: 0; }
.map { flex: 1; position: relative; min-width: 0; }
.map.dragover { outline: 4px dashed #0b5394; outline-offset: -8px; }
.drop { position: absolute; inset: 40% 20% auto 20%; z-index: 2; padding: 16px; text-align: center; background: #ffffffe6; border: 2px dashed #99a; border-radius: 8px; pointer-events: none; }
.drop.hidden { display: none; }
aside { width: 540px; max-width: 48vw; overflow: auto; border-left: 1px solid #ccd; padding: 8px 10px; background: #fff; }
footer { padding: 2px 10px; font-size: 12px; color: #555; background: #f3f5f7; border-top: 1px solid #ccd; display: flex; justify-content: space-between; }
progress { width: 100%; }
.status { margin-bottom: 6px; }
.status.error { color: #b2182b; font-weight: bold; }
.hint { color: #666; font-size: 12px; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.warn { color: #b2182b; font-weight: bold; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.swatch { display: inline-block; width: 12px; height: 12px; border: 1px solid #0006; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.legend ul { list-style: none; padding: 0; margin: 4px 0; }
.legend li { display: flex; align-items: center; gap: 4px; }
.legend li .n, .legend li .lg-n { margin-left: auto; font-variant-numeric: tabular-nums; }
.legend h3, .panel h3 { margin: 6px 0 4px; font-size: 15px; }
.panel { position: relative; border-top: 1px solid #ccd; padding-top: 4px; }
.panel .close { position: absolute; right: 0; top: 4px; border: 0; background: none; font-size: 16px; cursor: pointer; }
.panel h4 { margin: 10px 0 4px; font-size: 14px; }
.panel table { border-collapse: collapse; width: 100%; font-size: 12px; }
.panel th, .panel td { text-align: left; vertical-align: top; padding: 2px 4px; border-bottom: 1px solid #eee; }
.panel td.n { text-align: right; font-variant-numeric: tabular-nums; }
.panel table.kv th { width: 38%; font-weight: normal; color: #555; }
.panel .decision { font-size: 16px; display: flex; align-items: center; gap: 6px; }
.panel .decision .swatch { width: 18px; height: 18px; }
.panel .why { margin: 4px 0; }
.panel ul.aspects, .panel ul.flags { margin: 2px 0 4px; padding-left: 18px; }
.panel tr[data-trail], .panel tr[data-obs] { cursor: pointer; }
.panel tr[data-trail]:hover, .panel tr[data-obs]:hover, .panel tr.active { background: #fff4c2; }
.panel td.media { word-break: break-all; }
.panel table.trail td:last-child { white-space: nowrap; }
.tag { font-size: 11px; background: #ddd; border-radius: 3px; padding: 0 3px; }
.problems summary { cursor: pointer; font-weight: bold; margin-top: 8px; }
.problems ul { padding-left: 18px; font-size: 12px; max-height: 240px; overflow: auto; }
@media (max-width: 800px) { main { flex-direction: column; } aside { width: auto; max-width: none; height: 45vh; border-left: 0; border-top: 1px solid #ccd; } }
footer a { color: inherit; }
table.obs tr.end td { color: #666; }
/* 0.2.0: map + print header/footer wrapper (print header/footer: css/print.css) */
.sheet { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sheet .map { flex: 1; }
/* 0.2.0: tabs in the side panel (js/ui/tabs.js) */
.tablist { display: flex; gap: 2px; border-bottom: 1px solid #99a; margin: 4px 0 6px; }
.tablist [role="tab"] { font: inherit; padding: 4px 12px; border: 1px solid #99a; border-bottom: 0; border-radius: 4px 4px 0 0; background: #eef1f4; cursor: pointer; margin-bottom: -1px; }
.tablist [role="tab"][aria-selected="true"] { background: #fff; font-weight: bold; border-bottom: 1px solid #fff; }
.tablist [role="tab"]:focus-visible, [role="tabpanel"]:focus-visible { outline: 2px solid #f2c400; outline-offset: 1px; }
/* 0.2.0: short panel with fold-out sections */
.panel .levels { margin: 4px 0; }
.panel details.sec { border-top: 1px solid #eee; padding: 2px 0; }
.panel details.sec > summary { cursor: pointer; font-weight: bold; padding: 3px 0; }
/* 0.2.0: colour and name editor */
.style-editor { margin: 6px 0; }
.style-editor > summary { cursor: pointer; font-weight: bold; }
.style-editor fieldset { border: 1px solid #ddd; margin: 4px 0; padding: 4px 6px; }
.style-row { display: flex; gap: 6px; align-items: center; margin: 2px 0; }
.style-row input[type="color"] { width: 36px; height: 24px; padding: 0; border: 1px solid #99a; }
.style-row input[type="text"] { flex: 1; font: inherit; padding: 2px 4px; }
/* 0.2.0: print form and explanation tab */
.print-form label { display: block; margin: 4px 0; }
.print-form fieldset { border: 1px solid #ddd; margin: 4px 0; }
.print-form fieldset label { display: inline-block; margin-right: 12px; }
/* 0.3.0-m6: the manual GWSW join (index.html #gwswJoin) */
.gwsw-join { border: 1px solid #ddd; margin: 6px 0; padding: 4px 6px; }
.gwsw-join label { display: inline-block; margin-right: 10px; }
.print-form input[type="text"] { width: 100%; font: inherit; padding: 2px 4px; }
.help .steps { padding-left: 20px; }
.help .steps li, .help .more li { margin: 4px 0; }
.help .more { padding-left: 18px; }
/* 0.2.0: GWSW and price list sections in the Informatie tab */
.gwsw, .prices { margin: 6px 0; }
.gwsw > summary, .prices > summary { cursor: pointer; font-weight: bold; }
.prices-table { border-collapse: collapse; font-size: 12px; margin: 4px 0; width: 100%; }
.prices-table th, .prices-table td { border-bottom: 1px solid #eee; padding: 1px 4px; text-align: left; }
.prices-table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* the legend note "voorbeeldwaarden RIONED, aanpasbaar" */
.hint.example { font-style: italic; }
.toolbar .group { display: inline-flex; align-items: center; gap: 4px; }

/* 0.2.2: GWSW zone, warning, legend keys and map popup (js/ui/gwsw-panel.js, js/gwsw/view.js).
   The colours repeat GWSW_COLORS in js/gwsw/view.js: matched #3d3d3d (solid), context #5e81ac (dashed). */
.gwsw label { margin-right: 8px; }
.gwsw .error-text { color: #b00020; font-size: 12px; margin: 2px 0; }
.gwsw .error-text:empty { display: none; }
.gwsw-warn { background: #fff4ce; border: 1px solid #c9a227; padding: 4px 6px; font-size: 12px; }
.gw-key { display: inline-block; width: 18px; height: 0; margin-right: 4px; vertical-align: middle; }
.gw-key.gw-matched { border-top: 3px solid #3d3d3d; }
.gw-key.gw-context { border-top: 2px dashed #5e81ac; }
.gw-key.gw-put-matched, .gw-key.gw-put-context { width: 6px; height: 6px; border-radius: 50%; margin: 0 10px 0 6px; }
.gw-key.gw-put-matched { background: #3d3d3d; }
.gw-key.gw-put-context { background: #fff; border: 1.5px solid #5e81ac; }
h3.gw-legend { font-size: 13px; margin-top: 8px; }
p.gw-zone { margin: 0 0 2px; }                        /* 0.2.3: "zone: 100 m rond de strengen" */
/* 0.2.3: the GWSW popup styles moved to the section "map popup" below (.map-popup) */

/* ---- 0.2.3: shared look of the sidebar and the map popup (one place to change fonts/colours) ---- */
:root {
  --ribx-font: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --ribx-text: #222;
  --ribx-muted: #666;
  --ribx-line: #ccd;
  --ribx-soft: #f3f5f7;
  --ribx-accent: #0b5394;
}

/* ---- map popup (0.2.3; js/map/popup.js builds it with textContent, no inline styles) ---- */
.map-popup { position: relative; min-width: 200px; max-width: 320px; max-height: 300px; overflow: auto;
  padding: 8px 10px 6px; background: #fff; color: var(--ribx-text); font: 12px/1.4 var(--ribx-font);
  border: 1px solid var(--ribx-line); border-top: 3px solid var(--ribx-accent); border-radius: 6px; box-shadow: 0 2px 8px #0003; }
.map-popup[hidden] { display: none; }
.map-popup .pop-close { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px;
  background: none; color: var(--ribx-muted); font-size: 16px; line-height: 1; cursor: pointer; }
.map-popup .pop-close:hover { background: var(--ribx-soft); color: var(--ribx-text); }
.map-popup .pop-head { margin: 0 22px 6px 0; }
.map-popup .pop-title { margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.map-popup .pop-sub { margin: 1px 0 0; color: var(--ribx-muted); }
.map-popup .pop-group { padding-top: 4px; margin-top: 4px; border-top: 1px solid var(--ribx-soft); }
.map-popup .pop-group-title { margin: 0 0 2px; font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--ribx-accent); }
.map-popup .pop-rows { display: grid; grid-template-columns: max-content 1fr; gap: 1px 10px; margin: 0; }
.map-popup .pop-rows dt { color: var(--ribx-muted); }
.map-popup .pop-rows dd { margin: 0; overflow-wrap: anywhere; }
.map-popup .hint { margin: 0; }

/* ---- 0.2.3: column explanations of the CSV imports (js/ui/templates-panel.js) ---- */
details.columns { margin: 4px 0 6px; }
details.columns > summary { cursor: pointer; color: var(--ribx-muted); font-size: 12px; }
.columns-list { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 4px 0; font-size: 12px; }
.columns-list dd { margin: 0; }
/* 0.3.0-m1: tool views (js/ui/router.js). One view is visible at a time; [hidden] must win over
   display:flex (an author "display" rule would otherwise beat the browser's own [hidden] rule). */
.view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.view[hidden] { display: none; }
.app-header { border-bottom: 0; }
.tool-toolbar { border-top: 1px solid #dde; }
.tool-links { display: inline-flex; gap: 4px; }
.tool-links a { color: #0b5394; text-decoration: none; padding: 3px 8px; border-radius: 4px; border: 1px solid transparent; }
.tool-links a:hover { border-color: #99a; background: #fff; }
.tool-links a[aria-current="page"] { font-weight: bold; color: #222; background: #fff; border-color: #99a; }
.tool-links a:focus-visible, .check-entry a:focus-visible, .tool-page a:focus-visible { outline: 2px solid #f2c400; outline-offset: 1px; }
a.button { display: inline-block; color: inherit; text-decoration: none; }
.check-entry { margin: 2px 0 8px; }
.status-link { margin: 0 0 6px; }
.tool-page { flex: 1; overflow: auto; padding: 12px 16px; max-width: 64em; }
.tool-page h2 { font-size: 18px; margin: 8px 0; }
.tool-page h2:focus { outline: none; }
.check-disclaimer { background: #f3f5f7; border: 1px solid #ccd; border-radius: 4px; padding: 6px 10px; }
/* 0.3.0-m2: the L0 check (js/ui/check-view.js). Severity = colour + icon + word, never colour alone. */
.check-view .tool-page { max-width: 96em; }
.check-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 8px 0; }
.check-summary ul { margin: 4px 0; padding-left: 18px; }
.check-ok { color: #1d6b2f; font-weight: bold; }
.check-bad { color: #a01818; font-weight: bold; }
.check-table { border-collapse: collapse; font-size: 12px; margin: 6px 0; }
.check-table th, .check-table td { border: 1px solid #ccd; padding: 2px 6px; text-align: left; vertical-align: top; }
.check-table th { background: #eef1f4; }
.check-table td.code { font-family: monospace; white-space: nowrap; }
.check-table td.num { text-align: right; white-space: nowrap; }
.check-table td.sev { white-space: nowrap; font-weight: bold; }
.check-table tr.sev-fout td.sev { color: #a01818; }
.check-table tr.sev-waarschuwing td.sev { color: #8a5a00; }
.check-table tr.sev-info td.sev { color: #24548a; }
.check-table .raw { font-family: monospace; font-style: italic; color: #555; }
.check-pager button { margin: 0 6px; }
/* 0.3.0-m3: check rules, the "Per regel" table, filters and group rows */
.check-rules { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 8px 0; }
.check-rules > p, .check-rules > details { flex-basis: 100%; margin: 2px 0; }
/* 0.3.0-m7: the optional L4 comparison (order file / GWSW) */
.check-compare { margin: 8px 0; padding: 4px 10px; border: 1px solid #ccc; }
.check-compare > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 4px 0; }
.check-compare > p { margin: 2px 0; }
.check-per-rule tbody tr { cursor: pointer; }
.check-per-rule tbody tr:hover, .check-per-rule tbody tr:focus-visible { background: #fff6cc; outline: 2px solid #f2c400; outline-offset: -2px; }
.check-per-rule tbody tr.selected { background: #fff0a8; font-weight: bold; }
.check-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 10px 0 4px; font-size: 13px; }
.check-filters fieldset.check-sev { display: inline-flex; gap: 8px; border: 0; margin: 0; padding: 0; }
.check-filters fieldset.check-sev legend { float: left; padding: 0 4px 0 0; }
/* 0.3.0-m4: the export line of the Leveringscontrole */
.check-export { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 6px 0; font-size: 13px; }
.check-table tr.check-group th { background: #e3e8ee; font-weight: bold; text-align: left; }
/* 0.3.0-m5: the views Kaart / Tabel / Beide (class view-* on #sheet, js/main.js) and the table of pipes */
.toolbar .seg label { gap: 2px; }
.sheet.view-tabel .map { display: none; }
.pipe-table-box { display: flex; flex-direction: column; min-height: 0; padding: 4px 8px; background: #fff; }
.pipe-table-box[hidden] { display: none; }
.sheet.view-tabel .pipe-table-box { flex: 1; }
.sheet.view-beide .map { min-height: 200px; }
.sheet.view-beide .pipe-table-box { flex: 0 0 42%; border-top: 2px solid #ccd; }
.pt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.pt-bar h2 { font-size: 15px; margin: 2px 8px 2px 0; }
.pt-bar label { display: inline-flex; align-items: center; gap: 4px; }
.table-hint { margin: 4px 0; padding: 4px 8px; background: #fff4c2; border: 1px solid #e0c96a; border-radius: 4px; }
.table-hint[hidden] { display: none; }
.pt-scroll { flex: 1; overflow: auto; min-height: 0; }
.pipe-table { border-collapse: collapse; font-size: 12px; width: 100%; }
.pipe-table th, .pipe-table td { border-bottom: 1px solid #e3e6ea; padding: 2px 6px; text-align: left; vertical-align: top; white-space: nowrap; }
.pipe-table thead th { position: sticky; top: 0; background: #eef1f4; z-index: 1; }
.pipe-table th button.sort { font: inherit; font-weight: bold; border: 0; background: none; padding: 0; cursor: pointer; }
.pipe-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pipe-table .raw { font-family: ui-monospace, Consolas, monospace; }
.pipe-table tbody tr { cursor: pointer; }
.pipe-table tbody tr:hover, .pipe-table tbody tr.selected { background: #fff4c2; }
.pipe-table tbody tr:focus-visible { outline: 2px solid #f2c400; outline-offset: -2px; }
.pipe-table td.lg-geen { color: #8a5a00; }
.pipe-table td button { font: inherit; font-size: 11px; padding: 0 6px; }
.pipe-table-box.dragover { outline: 4px dashed #0b5394; outline-offset: -8px; }
/* legend "Ligging": a short line sample per source (solid = RIBX, dotted = GWSW, none = geen) */
.legend .lg-key, .print-legend-box .lg-key { display: inline-block; width: 22px; height: 0; margin-right: 4px; vertical-align: middle; border-top: 4px solid #555; }
.legend .lg-key.lg-gwsw, .print-legend-box .lg-key.lg-gwsw { border-top-style: dotted; }
.legend .lg-key.lg-geen, .print-legend-box .lg-key.lg-geen { border-top-color: transparent; }
