[hidden] { display: none !important; }
:root {
  --bg: #f4f2ee; --kaart: #ffffff; --tekst: #24211d; --zacht: #6f6a62; --lijn: #ddd8cf;
  --accent: #8a5a2b; --accent-tekst: #ffffff; --fout: #b3261e; --ok: #2e7d32; --viewer: #e9e6e0;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1b1a18; --kaart: #262421; --tekst: #ece8e1; --zacht: #a59f95; --lijn: #3b3833;
          --accent: #c8935a; --accent-tekst: #1b1a18; --fout: #ef8a80; --ok: #81c784; --viewer: #2d2b28; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--tekst); font: 15px/1.45 system-ui, "Segoe UI", sans-serif; display: flex; flex-direction: column; }
header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--lijn); background: var(--kaart); }
.merk { font-weight: 650; letter-spacing: .02em; }
header .rechts { display: flex; gap: 12px; align-items: center; }
main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
section { padding: 16px; }
h1, h2, h3 { margin: 0 0 10px; font-weight: 620; } h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--zacht); }
.kaart { background: var(--kaart); border: 1px solid var(--lijn); border-radius: 10px; padding: 18px; margin: 0 auto 16px; max-width: 980px; width: 100%; }
.smal { max-width: 380px; margin-top: 8vh; }
label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 13px; color: var(--zacht); }
input, select, button { font: inherit; color: inherit; }
input:not([type]), input[type=password], input[name] { padding: 8px 10px; border: 1px solid var(--lijn); border-radius: 7px; background: var(--bg); color: var(--tekst); }
button { cursor: pointer; padding: 8px 14px; border-radius: 7px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-tekst); font-weight: 560; }
button.wis { color: #c0392b; }
button.licht { background: transparent; color: var(--tekst); border-color: var(--lijn); font-weight: 450; }
button:disabled { opacity: .5; cursor: progress; }
button.groot { width: 100%; padding: 11px; margin-top: 6px; }
select { padding: 5px 8px; border: 1px solid var(--lijn); border-radius: 7px; background: var(--bg); }
.rij { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; } .rij label { margin: 0; } .rij .breed { flex: 1; min-width: 200px; }
.fout { color: var(--fout); min-height: 1.2em; margin: 8px 0 0; }
.zacht { color: var(--zacht); } .klein { font-size: 12px; }
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--lijn); } th { font-size: 12px; color: var(--zacht); font-weight: 550; }
tbody tr { cursor: pointer; } tbody tr:hover { background: var(--bg); }
#v-dossier { flex: 1; min-height: 0; display: flex; gap: 0; padding: 0; }
.paneel { width: 340px; flex: none; overflow-y: auto; padding: 16px; background: var(--kaart); border-right: 1px solid var(--lijn); }
.paneel > button.licht { margin-bottom: 14px; }
.scanvak { margin: 16px 0; }
.drop { display: block; border: 2px dashed var(--lijn); border-radius: 9px; padding: 14px; text-align: center; cursor: pointer; color: var(--zacht); font-size: 13px; margin: 0; }
.drop.over, .drop:hover { border-color: var(--accent); }
.drop input { display: none; }
.info { font-size: 13px; margin: 6px 0 0; }
.status { min-height: 1.3em; font-size: 13px; } .status.ok { color: var(--ok); } .status.fout { color: var(--fout); }
.tonen { margin: 18px 0; } .tonen label { flex-direction: row; align-items: center; gap: 8px; margin: 6px 0; color: var(--tekst); font-size: 14px; }
.tonen .schuif { flex-direction: column; align-items: stretch; margin-top: 12px; color: var(--zacht); font-size: 13px; }
.viewer { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--viewer); }
.topbalk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 10px; background: var(--kaart); border-bottom: 1px solid var(--lijn); min-height: 44px; }
.wb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 1 auto; }
.wb button { padding: 5px 10px; font-size: 13px; }
.wb button.aan { border-color: var(--accent); background: var(--accent); color: var(--accent-tekst); }
.wb-tekst { flex-basis: 100%; font-size: 13px; }
.wb .fout { margin: 0; min-height: 0; font-size: 13px; }
.zichten { display: flex; gap: 4px; margin-left: auto; }
.zichten button { padding: 4px 9px; font-size: 12px; }
.beeld { flex: 1; min-height: 0; position: relative; }
#c3d { width: 100%; height: 100%; display: block; }
.hulp { position: absolute; left: 12px; bottom: 10px; font-size: 12px; color: var(--zacht); pointer-events: none; }
.stap { margin: 16px 0; padding-top: 14px; border-top: 1px solid var(--lijn); }
.stap h3 { display: flex; gap: 8px; align-items: center; }
.nr { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-tekst); font-size: 12px; letter-spacing: 0; }
.stap.uit { opacity: .45; pointer-events: none; }
h4 { margin: 10px 0 6px; font-size: 13px; font-weight: 600; }
.scanvak { margin: 8px 0 14px; }
.knoppen { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.knoppen button, .scanvak > button { padding: 6px 10px; font-size: 13px; margin-top: 6px; }
.gedaan::after { content: " ✓"; color: var(--ok); font-weight: 700; }
.rij2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.keuze { flex-direction: row !important; align-items: center; gap: 8px !important; margin: 4px 0 !important; color: var(--tekst) !important; font-size: 14px !important; }
input[type=number] { padding: 8px 10px; border: 1px solid var(--lijn); border-radius: 7px; background: var(--bg); color: var(--tekst); width: 100%; }
#c2d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: var(--viewer); cursor: crosshair; }
.scheid { width: 1px; height: 22px; background: var(--lijn); margin: 0 4px; }
#k-mm-in { width: 90px; display: inline-block; }
@media (max-width: 760px) {
  #v-dossier { flex-direction: column; overflow-y: auto; }
  .paneel { width: 100%; border-right: 0; border-bottom: 1px solid var(--lijn); }
  .viewer { min-height: 60vh; }
}
.v-rijen { display: flex; flex-wrap: wrap; gap: 6px 14px; flex-basis: 100%; }
.v-rij { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.v-rij.uit { opacity: .45; }
.v-lab { margin-right: 2px; }
.v-rij input { width: 64px; padding: 4px 6px; text-align: right; }
.v-rij button { padding: 3px 9px; font-size: 14px; line-height: 1.1; }
.v-eenh { color: var(--zacht); }
.delen { margin: 2px 0 6px 24px; }
.delen label { margin: 3px 0 !important; font-size: 13px !important; }
.delen label.nvt { opacity: .45; }
.kantblok { margin: 4px 0 8px; }
.kantkop { font-weight: 600; }
.sub { margin-left: 22px; }
.sub label { margin: 3px 0 !important; font-size: 13px !important; }
.uit { opacity: .45; }
.delen label.vol { font-style: italic; }
#chat-log { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
#chat-log:empty { display: none; }
.cb { padding: 6px 9px; border-radius: 8px; font-size: 13px; line-height: 1.35; white-space: pre-wrap; max-width: 92%; }
.cb.gebruiker { align-self: flex-end; background: var(--accent, #8a5a2b); color: #fff; }
.cb.claude { align-self: flex-start; background: rgba(127,127,127,.14); }
.cb.bezig { opacity: .6; font-style: italic; }
#f-chat { display: flex; gap: 6px; align-items: stretch; }
#f-chat textarea { flex: 1; resize: vertical; font: inherit; font-size: 13px; padding: 6px; }
#overzicht table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
#overzicht td, #overzicht th { padding: 3px 4px; border-bottom: 1px solid rgba(127,127,127,.25); text-align: left; }
#overzicht td.mm, #overzicht th.mm { text-align: right; white-space: nowrap; }

#fijn-log { max-height: 11em; overflow: auto; font-size: 11px; line-height: 1.35; white-space: pre-wrap; margin: .5em 0 0; padding: .5em; border-radius: 6px; background: var(--vlak, rgba(127,127,127,.08)); }

/* pop-up: chat wacht op een bijkomend antwoord */
.vraag-achter { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.vraag-achter[hidden] { display: none; }
.vraag-kaart { background: var(--kaart); color: var(--tekst); border: 1px solid var(--lijn); border-radius: 12px; padding: 20px; width: min(440px, 100%); box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.vraag-kop { margin: 0 0 6px; font-size: 13px; color: var(--accent); font-weight: 600; }
#vraag-tekst { margin: 0 0 14px; white-space: pre-line; line-height: 1.45; }
#vraag-knoppen { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
#vraag-knoppen:empty { display: none; }
#vraag-knoppen button { text-transform: capitalize; }
#f-vraag { display: flex; gap: 8px; margin-bottom: 10px; }
#f-vraag input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--lijn); border-radius: 7px; background: var(--bg); }
#b-vraag-sluit { width: 100%; }

/* scan indrukken: gesloten lijn over het 3D-beeld */
#indruk-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
#indruk-svg polyline, #indruk-svg polygon { fill: none; stroke: #d9480f; stroke-width: 2; stroke-dasharray: 6 4; }
#indruk-svg circle { fill: #d9480f; }
#wb-indruk > span:not(.wb-tekst):not(.scheid) { display: inline-flex; gap: 6px; flex-wrap: wrap; }
#wb-indruk > span[hidden] { display: none; }

/* help */
.hulpknop { margin-left: auto; width: 22px; height: 22px; padding: 0; border-radius: 50%; font-size: 12px; line-height: 1; background: transparent; color: var(--accent); border: 1px solid var(--accent); text-transform: none; }
.help-kaart { background: var(--kaart); color: var(--tekst); border: 1px solid var(--lijn); border-radius: 12px; padding: 18px 20px; width: min(720px, 100%); max-height: 88vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.help-boven { display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; top: -18px; background: var(--kaart); padding: 4px 0 8px; }
.help-boven h2 { margin: 0; }
#help-inhoud { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
#help-inhoud:empty { display: none; }
#help-inhoud a { font-size: 13px; color: var(--accent); text-decoration: none; border: 1px solid var(--lijn); border-radius: 6px; padding: 2px 8px; }
#help-tekst h3 { margin: 16px 0 6px; color: var(--accent); }
#help-tekst p { margin: 0 0 6px; line-height: 1.5; }
#help-tekst ul { margin: 0 0 8px; padding-left: 20px; }
#help-tekst li { margin-bottom: 4px; line-height: 1.45; }
#b-help-alles { margin-top: 10px; }

/* zones-schets */
.schets-rij { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: center; margin: 6px 0 8px; }
.schets-rij figure { margin: 0; flex: 1 1 240px; max-width: 340px; text-align: center; }
.schets-rij figcaption { font-size: 12px; color: var(--zacht); margin-top: 4px; }
.schets-svg { width: 100%; height: auto; max-height: 360px; }
.schets-omtrek { fill: color-mix(in srgb, var(--accent) 12%, transparent); stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
.schets-snede { stroke: var(--zacht); stroke-width: 1.2; stroke-dasharray: 5 4; }
.schets-punt { fill: var(--accent); stroke: var(--kaart); stroke-width: 1.5; }
.schets-letter { fill: var(--accent-tekst); font: 700 11px system-ui, sans-serif; text-anchor: middle; }
.schets-kant { fill: var(--zacht); font: 11px system-ui, sans-serif; }
.schets-lijst { margin: 8px 0 4px; display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; }
.schets-lijst dt { font-weight: 600; white-space: nowrap; }
.schets-lijst dd { margin: 0; line-height: 1.45; }
.schets-badge { display: inline-block; width: 20px; height: 20px; line-height: 20px; border-radius: 50%; text-align: center; background: var(--accent); color: var(--accent-tekst); font-size: 12px; font-weight: 700; }
@media (max-width: 560px) { .schets-lijst { grid-template-columns: 1fr; } .schets-lijst dd { margin-bottom: 6px; } }

/* zone oplichten op de 3D-leest */
.zlink { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; border-radius: 3px; }
.zlink:hover, .zlink:focus-visible { color: var(--accent); text-decoration: underline; }
.schets-knop { cursor: pointer; }
.schets-knop:hover .schets-punt { fill: #e8590c; }
.zone-licht { position: absolute; left: 12px; top: 10px; display: flex; align-items: center; gap: 8px; background: var(--kaart); border: 1px solid var(--rand, #ccc);
  border-radius: 6px; padding: 4px 6px 4px 10px; font-size: 13px; box-shadow: 0 1px 4px rgba(0,0,0,.12); max-width: calc(100% - 24px); }
.zone-licht[hidden] { display: none; }
.zone-licht-stip { width: 12px; height: 12px; border-radius: 50%; background: #e8590c; opacity: .8; flex: none; }
.zone-licht button { border: 0; background: none; font-size: 18px; line-height: 1; padding: 2px 6px; cursor: pointer; color: var(--zacht); }
.om-schuif button { padding: 2px 6px; margin-left: 3px; }
