:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #667085; --border: #e3e6ec;
  --accent: #1f5fbf; --accent-soft: #e8f0fc; --ok: #1a7f4b; --ok-soft: #e7f6ee;
  --warn: #9a6200; --warn-soft: #fff6e0; --bad: #b42318; --bad-soft: #fdecea;
  --ig1: #2e7d32; --ig2: #1f5fbf; --ig3: #7b3fb5;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
header.top { background: #14213d; color: #fff; padding: 0 20px; display: flex; align-items: center; gap: 24px; height: 52px; }
header.top a { color: #dfe7f5; text-decoration: none; }
header.top a:hover, header.top a.active { color: #fff; }
header.top .brand { font-weight: 650; color: #fff; margin-right: 12px; }
header.top nav { display: flex; gap: 18px; flex: 1; }
header.top .who { font-size: 13px; color: #b9c4d8; display: flex; gap: 12px; align-items: center; }
/* Fluid: use the whole window; the side margin grows with the window (16 px on a phone, up to
   64 px on a large screen). Only running text is limited, so lines stay readable. */
main { padding: 22px clamp(16px, 3vw, 64px) 60px; }
p, .explain, .sub { max-width: 120ch; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 10px; }
.sub { color: var(--muted); margin-bottom: 18px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=number], input[type=date], input[type=file], select, textarea {
  width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: #fff; }
table input[type=number], table select { padding: 3px 5px; font-size: 13px; }
table input[type=number] { width: 72px; }
button, .btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 8px 14px;
  font: inherit; font-weight: 550; cursor: pointer; text-decoration: none; }
button.secondary, .btn.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
button.danger { background: var(--bad); }
button.small, .btn.small { padding: 4px 9px; font-size: 12.5px; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .02em; background: #fafbfc; position: sticky; top: 0; }
tr.muted td { color: #98a2b3; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11.5px; font-weight: 600; color: #fff; }
.ig1 { background: var(--ig1); } .ig2 { background: var(--ig2); } .ig3 { background: var(--ig3); } .ig0 { background: #999; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11.5px; background: var(--accent-soft); color: var(--accent); }
.box { padding: 10px 12px; border-radius: 6px; margin: 8px 0; }
.ok { background: var(--ok-soft); color: var(--ok); }
.warn { background: var(--warn-soft); color: var(--warn); }
.bad { background: var(--bad-soft); color: var(--bad); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
ul.warnings { margin: 6px 0 0; padding-left: 18px; max-height: 220px; overflow-y: auto; font-size: 12.5px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 550; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.explain { font-size: 12px; color: var(--muted); }
details summary { cursor: pointer; }
.saved { color: var(--ok); font-size: 12px; }
.htmx-request.saving::after { content: " …"; }
a { color: var(--accent); }
.stat { font-size: 26px; font-weight: 650; }
.override { background: var(--warn-soft); }
.comments { margin-top: 6px; display: grid; gap: 6px; }
.comment { border-left: 3px solid var(--accent); background: #fafbfc; padding: 5px 9px; border-radius: 0 6px 6px 0; font-size: 12.5px; }
.comment .meta { color: var(--muted); font-size: 11.5px; }
.comment .body { white-space: pre-wrap; }
.comment.old { border-left-color: var(--border); color: var(--muted); }
.comment.internal { border-left-color: var(--warn); background: var(--warn-soft); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
table.hide-ready tr.ready { display: none; }
pre { background: #f3f4f6; padding: 8px 10px; border-radius: 6px; font-size: 12.5px; }
.tag.muted-tag { background: #eef0f3; color: var(--muted); }
select.tag-select { width: auto; padding: 2px 4px; font-size: 12px; }
.lang-switch { display: flex; gap: 2px; margin: 0; }
.lang-switch button { background: transparent; color: #b9c4d8; border: 1px solid #56627a; padding: 2px 8px; font-size: 12px; text-transform: uppercase; border-radius: 4px; }
.lang-switch button.on { background: #dfe7f5; color: #14213d; border-color: #dfe7f5; }
textarea { resize: vertical; }
.entry { padding: 14px 18px; }
.entry.out { opacity: .65; }
.entry textarea { font-size: 13px; }
.advice-item { padding: 4px 0; border-bottom: 1px dashed var(--border); }
.advice-item:last-of-type { border-bottom: 0; }
textarea.just-added { background: var(--accent-soft); transition: background .3s; }
select.advice-pick { color: var(--muted); }
.logentry { border-left: 3px solid var(--accent); background: #fafbfc; padding: 5px 9px; margin-top: 6px; border-radius: 0 6px 6px 0; font-size: 13px; }
.logentry.carried { border-left-color: var(--border); }
.logentry .meta { color: var(--muted); font-size: 11.5px; }
.logentry .body { white-space: pre-wrap; }
button.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 400; font-size: 11.5px; cursor: pointer; text-decoration: underline; }
.aanpak { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--border); }
.aanpak input[type=text], .aanpak input[type=date] { padding: 4px 6px; font-size: 12.5px; }

/* Cbw tab */
.bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.bar > span { display: block; height: 100%; background: var(--accent); }
ul.plain { list-style: none; padding-left: 0; margin: 4px 0; }
table.cbw td { vertical-align: top; }
table.cbw textarea { width: 100%; margin-top: 4px; font-size: 13px; }
.cbw-item textarea, .cbw-item input[type=text] { width: 100%; }

/* Verloop */
table.trend th.current, table.trend td.current { background: var(--accent-soft); }
table.trend tr.total td { border-top: 2px solid var(--border); }
.up { color: var(--ok); }
.down { color: var(--bad); }
.trend-hidden { display: none; }

/* Assessment page: zones */
.a-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.a-head h1 { margin: 2px 0 10px; }
nav.zones { display: flex; gap: 4px; flex-wrap: wrap; }
nav.zones a { padding: 10px 16px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; font-weight: 550; }
nav.zones a.active { color: var(--text); border-bottom-color: var(--accent); }
.zone-count { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.subbar { margin-bottom: 14px; }
nav.admin-tabs { border-bottom: 1px solid var(--border); margin: -6px 0 18px; }
nav.seg { display: flex; gap: 3px; background: #e8ebf1; padding: 3px; border-radius: 9px; flex-wrap: wrap; }
nav.seg a { padding: 6px 13px; border-radius: 7px; color: var(--muted); text-decoration: none; font-weight: 550; }
nav.seg a.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.side-layout { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.side-main { flex: 999 1 560px; min-width: 0; }
.side-nav { flex: 1 1 220px; max-width: 280px; padding: 10px; }
.side-nav > a { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 7px; color: var(--text); text-decoration: none; }
.side-nav > a.active, .ctl-list a.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.card-warn { border-color: #e9c37a; }
.facts { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 10px; }
.facts b { font-size: 18px; }
header.top .present { color: #b9c4d8; font-size: 13px; }

/* Two kinds of progress: filled in (x / y, thin slate bar) vs implementation (%, thick green/orange bar) */
.prog { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.prog > span { display: block; height: 100%; background: #5a6f95; }
.impl { flex: 1; height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.impl > span { display: block; height: 100%; border-radius: 5px; }
.hi { background: #2f8a5b; } .lo { background: #d9822b; }

/* Overview */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.tile { margin: 0; }
.tile-num { font-size: 30px; font-weight: 700; margin: 2px 0; font-variant-numeric: tabular-nums; }
.impl-list { display: grid; gap: 8px; margin-top: 12px; }
.impl-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.impl-row > span:first-child { width: 22px; text-align: right; }
.impl-name { width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.impl-row b { width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; }
ol.top5 { list-style: none; padding: 0; margin: 10px 0 0; }
ol.top5 li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
ol.top5 li .t { flex: 1; min-width: 0; }
.years { display: flex; gap: 18px; align-items: flex-end; margin-top: 12px; border-bottom: 1px solid var(--border); }
.year { flex: 1; text-align: center; }
.year .bars { display: flex; gap: 4px; align-items: flex-end; height: 140px; }
.year .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.year .col i { display: block; width: 100%; border-radius: 3px 3px 0 0; }
.year .v { font-size: 11px; color: var(--muted); }
.year.current .v { color: var(--text); font-weight: 600; }
.b1 { background: #3d64c9; } .b2 { background: #8a5cc4; }

/* Fill-in screen */
.ctl-nav .stat { margin: 2px 0; }
.ctl-list { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 6px; }
.ctl-list a { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 13px; }
.ctl-list a:hover { background: #f2f4f7; }
.ctl-list .ck { width: 14px; color: var(--ok); font-weight: 700; visibility: hidden; }
.ctl-list a.done .ck { visibility: visible; }
.ctl-list .nr { width: 20px; color: var(--muted); }
.ctl-list .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctl-list .ct { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ctl-head .hstat { min-width: 150px; }
.ctl-foot { margin-top: 4px; }
.entry { padding: 12px 18px; }
.entry-sum { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; list-style: none; }
.entry-sum::-webkit-details-marker { display: none; }
.entry-sum::before { content: "▸"; color: var(--muted); width: 10px; }
details[open] > .entry-sum::before { content: "▾"; }
.entry-sum .nr { min-width: 34px; }
.entry-sum .t { flex: 1 1 280px; min-width: 0; }
a.impl-row { color: var(--text); text-decoration: none; border-radius: 6px; padding: 2px 4px; margin: 0 -4px; }
a.impl-row:hover { background: #f2f4f7; }
a.impl-row .go { color: var(--muted); width: 10px; }
.ctl-item { padding: 12px 18px; }
.ctl-item.out { opacity: .65; }
.ctl-item .score { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.ctl-item .hist { margin-top: 8px; }
span.impl { display: inline-block; }
a.tile { color: var(--text); text-decoration: none; transition: border-color .15s; }
a.tile:hover { border-color: var(--accent); }
select.a-switch { width: auto; max-width: 100%; font-size: 22px; font-weight: 650; border: 1px solid transparent; background-color: transparent; padding: 0 6px 0 0; margin: 2px 0 10px; cursor: pointer; }
select.a-switch:hover, select.a-switch:focus { border-color: var(--border); background-color: #fff; }
/* The hidden attribute always wins (author display rules like .row must not undo it). */
[hidden] { display: none !important; }
/* Fill-in screen: the control list stays in view while scrolling (not when stacked on a phone). */
@media (min-width: 900px) {
  .ctl-nav { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
}
/* Control list: fixed grid columns (check, number, name, count), so the
   indent never shifts, also not when the active row turns bold. The nav is
   wide enough for the longest control name in bold plus the count. */
.ctl-nav { flex: 0 0 42ch; max-width: none; }
@media (max-width: 899px) { .ctl-nav { flex: 1 1 100%; } }
.ctl-list a { display: grid; grid-template-columns: 14px 3ch minmax(0, 1fr) auto; column-gap: 8px; }
.ctl-list .nr { width: auto; text-align: right; }
.ctl-list .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ctl-list .ct { text-align: right; }
