/* CE-tool — bouwt verder op style.css */
.tool-hero { background: var(--ink); color: var(--paper); border-bottom: 1px solid var(--line-dark); }
.tool-hero .hazard { height: 6px; background: repeating-linear-gradient(-45deg, var(--signal) 0 10px, var(--ink) 10px 20px); }
.tool-hero .wrap { padding-block: clamp(36px, 5vw, 60px) clamp(28px, 4vw, 44px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: end; }
.tool-hero h1 { font-family: var(--f-display); font-size: var(--step-3); margin-top: 12px; }
.tool-hero p { color: #c3c7cc; margin-top: 14px; max-width: 64ch; }
.deadline-chip { border: 1px solid var(--line-dark); padding: 14px 18px; display: grid; gap: 2px; min-width: 200px; }
.deadline-chip b { font-family: var(--f-display); font-size: 2.2rem; color: var(--signal); font-weight: 400; line-height: 1.1; font-variant-numeric: tabular-nums; }
.deadline-chip span { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute-dark); }
@media (max-width: 760px) { .tool-hero .wrap { grid-template-columns: 1fr; } .deadline-chip { justify-self: start; } }

/* project-kop */
.project { background: var(--steel); border-bottom: 1px solid var(--line); }
.project .wrap { padding-block: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 14px 18px; align-items: end; }
.pfield { display: grid; gap: 4px; min-width: 0; }
.pfield label { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.pfield input { font: inherit; font-size: .95rem; border: 0; border-bottom: 1px solid var(--ink); background: transparent; padding: 6px 0; width: 100%; border-radius: 0; color: var(--ink); }
.pfield input:focus { outline: none; border-color: var(--signal); box-shadow: 0 1px 0 var(--signal); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.abtn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink);
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; white-space: nowrap;
}
.abtn:hover { background: var(--ink); color: var(--paper); }
.abtn--primary { background: var(--ink); color: var(--paper); }
.abtn--primary:hover { background: var(--paper); color: var(--ink); }
.abtn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.6; }
@media (max-width: 1100px) { .project .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); } .actions { grid-column: 1 / -1; justify-content: flex-start; } }
@media (max-width: 520px) { .project .wrap { grid-template-columns: 1fr; } }

.confirm { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .9rem; background: var(--ink); color: var(--paper); padding: 8px 12px; }
.confirm .abtn { border-color: var(--paper); }

/* layout */
.tool { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 32px; padding-block: 32px 80px; align-items: start; }
@media (max-width: 980px) { .tool { grid-template-columns: 1fr; } }

/* quick scan */
.scan { position: sticky; top: calc(var(--header-h) + 16px + env(safe-area-inset-top, 0px)); border: 1px solid var(--ink); background: var(--paper); }
@media (max-width: 980px) { .scan { position: static; } }
.scan__head { background: var(--ink); color: var(--paper); padding: 14px 18px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.scan__head h2 { font-family: var(--f-display); font-size: .95rem; }
.scan__body { padding: 16px 18px 20px; display: grid; gap: 18px; }
.q { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.q legend, .q > label { font-size: .88rem; font-weight: 500; padding: 0; margin-bottom: 8px; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); }
.seg--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 8px 10px; font-size: .84rem; text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background .15s; }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: -2px; }
.seg label:hover span { background: var(--steel); }
.seg input:checked:hover + span { background: var(--ink); }
.toggle { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: .88rem; cursor: pointer; }
.toggle input { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border: 1px solid var(--ink); position: relative; flex: none; cursor: pointer; margin: 0; background: var(--paper); }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: var(--ink); transition: transform .15s; }
.toggle input:checked { background: var(--ink); }
.toggle input:checked::after { background: var(--signal); transform: translateX(16px); }
.hint { font-size: .78rem; color: var(--mute); margin-top: -2px; }
.route { border-top: 1px solid var(--ink); padding-top: 14px; display: grid; gap: 6px; }
.route b { font-family: var(--f-display); font-weight: 400; font-size: 1rem; }
.route p { font-size: .86rem; color: var(--mute); }
.route .nb { display: inline-block; align-self: start; justify-self: start; background: var(--signal); color: var(--ink); font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; padding: 2px 6px; }

/* voortgang */
.progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--ink); margin-bottom: 24px; }
.pcell { padding: 14px 16px; border-right: 1px solid var(--line); display: grid; gap: 6px; background: var(--paper); cursor: pointer; text-align: left; font: inherit; color: inherit; border-top: 0; border-bottom: 0; border-left: 0; }
.pcell:last-child { border-right: 0; }
.pcell:hover { background: var(--steel); }
.pcell[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.pcell[aria-selected="true"] .label { color: var(--mute-dark); }
.pcell[aria-selected="true"] .bar { background: var(--line-dark); }
.pcell .num { font-family: var(--f-display); font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pcell .sub { font-size: .78rem; color: var(--mute); font-family: var(--f-mono); }
.pcell[aria-selected="true"] .sub { color: var(--mute-dark); }
.bar { height: 4px; background: var(--line); position: relative; }
.bar i { position: absolute; inset: 0 auto 0 0; background: currentColor; transition: width .3s; }
@media (max-width: 700px) { .progress { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pcell:nth-child(2) { border-right: 0; } .pcell:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }

/* filterbalk */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 14px; }
.filters input[type="search"], .filters select { font: inherit; font-size: .9rem; border: 1px solid var(--line); padding: 8px 10px; background: var(--paper); color: var(--ink); border-radius: 0; }
.filters input[type="search"] { flex: 1 1 220px; min-width: 0; }
.filters .count { font-family: var(--f-mono); font-size: 11.5px; color: var(--mute); margin-left: auto; }
.chk { display: inline-flex; gap: 8px; align-items: center; font-size: .88rem; cursor: pointer; }
.chk input { accent-color: var(--ink); width: 16px; height: 16px; }

/* verplichtingen */
.ob { border: 1px solid var(--line); border-left: 4px solid var(--line); background: var(--paper); display: grid; grid-template-columns: 150px minmax(0, 1fr) 180px; gap: 0; margin-bottom: 10px; }
.ob[data-risk="HOOG"] { border-left-color: var(--ink); }
.ob[data-risk="MIDDEL"] { border-left-color: var(--mute); }
.ob.is-done { background: var(--steel); }
.ob.is-done .ob__main h3 { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--mute); }
.ob.is-na { opacity: .55; }
.ob__ref { padding: 14px; border-right: 1px solid var(--line); font-family: var(--f-mono); font-size: 12px; display: grid; gap: 8px; align-content: start; }
.ob__main { padding: 14px 16px; display: grid; gap: 8px; min-width: 0; }
.ob__main h3 { font-family: var(--f-body); font-weight: 600; font-size: 1rem; }
.ob__main p { font-size: .93rem; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .82rem; color: var(--mute); }
.meta b { font-weight: 500; color: var(--ink); }
.ob__note { font-size: .84rem; color: var(--mute); border-left: 2px solid var(--line); padding-left: 10px; }
.ob__ctl { padding: 14px; border-left: 1px solid var(--line); display: grid; gap: 8px; align-content: start; }
.ob__ctl select, .ob__ctl textarea, .cell-input { font: inherit; font-size: .86rem; width: 100%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 7px 8px; border-radius: 0; }
.ob__ctl textarea { min-height: 54px; resize: vertical; }
.chip { display: inline-block; justify-self: start; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; padding: 2px 7px; border: 1px solid var(--ink); }
.chip--HOOG { background: var(--ink); color: var(--paper); }
.chip--KRITIEK { background: var(--signal); border-color: var(--signal); color: var(--ink); }
.chip--LAAG { border-color: var(--line); color: var(--mute); }
.chip--warn { background: var(--signal); border-color: var(--signal); color: var(--ink); }
.chip--cond { border-style: dashed; color: var(--mute); border-color: var(--mute); }
@media (max-width: 760px) {
  .ob { grid-template-columns: minmax(0, 1fr); }
  .ob__ref { border-right: 0; border-bottom: 1px solid var(--line); grid-auto-flow: column; justify-content: start; align-items: center; }
  .ob__ctl { border-left: 0; border-top: 1px solid var(--line); }
}
.empty { border: 1px dashed var(--mute); padding: 28px; text-align: center; color: var(--mute); }

/* tabellen */
.tablewrap { overflow-x: auto; border: 1px solid var(--ink); background: var(--paper); }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 720px; }
.t th { text-align: left; font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--paper); background: var(--ink); padding: 10px 12px; white-space: nowrap; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tr.is-done td { background: var(--steel); }
.t tr.is-na td { opacity: .5; }
.t .n { font-family: var(--f-mono); font-variant-numeric: tabular-nums; width: 44px; }
.t .ref { font-family: var(--f-mono); font-size: 12px; color: var(--mute); white-space: nowrap; }
.t .desc { color: var(--mute); font-size: .85rem; margin-top: 2px; }
.t .strong { font-weight: 600; }
.t input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ink); }
.t .cell-input { min-width: 0; }
.t select.cell-input { width: auto; min-width: 0; max-width: 150px; }
#plan-table td:first-child { min-width: 170px; }
#plan-table td, #plan-table th { padding-inline: 9px; }
.yn { display: inline-grid; grid-template-columns: repeat(3, auto); border: 1px solid var(--line); }
.yn button { font: inherit; font-family: var(--f-mono); font-size: 11px; padding: 5px 9px; border: 0; border-right: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
.yn button:last-child { border-right: 0; }
.yn button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.yn button[data-v="N"][aria-pressed="true"] { background: var(--signal); color: var(--ink); }
.phase-row td { background: var(--steel); font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 7px 12px; }

.panel h2 { font-family: var(--f-display); font-size: 1.3rem; }
.panel__intro { color: var(--mute); margin: 8px 0 18px; max-width: 70ch; font-size: .95rem; }
.disclaimer { margin-top: 28px; font-size: .84rem; color: var(--mute); border-top: 1px solid var(--line); padding-top: 14px; max-width: 80ch; }
.disclaimer a { color: var(--ink); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--paper); padding: 10px 16px; font-family: var(--f-mono); font-size: 12px; letter-spacing: .05em; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 80; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* afdrukken: alles tonen, interface weg */
@media print {
  .site-header, .site-footer, .actions, .filters, .tool-hero .hazard, .scan .hint, .toast, .progress { display: none !important; }
  body::before { display: none; }
  .tool { grid-template-columns: 1fr; padding: 0; }
  .scan { position: static; }
  [role="tabpanel"][hidden] { display: block !important; }
  .panel { break-before: page; }
  .tool-hero, .tool-hero * { color: #000 !important; background: #fff !important; }
  .ob, tr { break-inside: avoid; }
  .tablewrap { overflow: visible; }
  table.t { min-width: 0; }
}
#plan-table td:nth-child(5) { overflow-wrap: anywhere; hyphens: auto; }
