/* Werktekening keuken: zelfde opbouw als het kippenhok. Titelhoek, 3D, tekenbladen, lijsten. Print als A4, alles onder elkaar. */
:root {
  --paper: #F4F1EA; --surface: #FFFFFF; --sunk: #EDE9DF; --ink: #15191C; --ink-2: #545C61; --rule: #D9D4C7;
  --accent: #B23A0A; --accent-soft: #F7E3D8; --steel: #1F4E79; --ok: #36704a; --viewer-bg: #e6e2d8;
  --d-sheet: #fcfbf8; --d-line: #273032; --d-mp: #ead9bd; --d-front: #ffffff; --d-eik: #d9b88c; --d-app: #d5d8da; --d-appd: #4a4f54;
  --d-rvs: #e3e6e8; --d-hw: #2d2d2d; --d-wall: #e7e3da; --d-floor: #d8d1c4; --d-dim: #1F4E79; --d-hl: #D9480F;
  --f-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --f-body: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}
body { font-size: 15.5px; line-height: 1.55; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); line-height: 1.15; margin: 0; }
h3 { font-size: 1.12rem; }
.mono, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
button, select, input { font: inherit; color: inherit; }

/* titelhoek */
.top { background: var(--surface); border-bottom: 1px solid var(--rule); }
.top .wrap { padding-block: 28px 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 28px; align-items: end; }
.top h1 { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.6rem); line-height: 1; }
.top h1 span { color: var(--accent); }
.lede { margin: 12px 0 0; max-width: 60ch; color: var(--ink-2); font-size: 1.02rem; }
.gratis { margin: 14px 0 0; max-width: 60ch; padding-left: 12px; border-left: 3px solid var(--steel); font-size: .95rem; }
.knoppen { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 18px; }
.knop-print { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; box-shadow: 0 0 0 1.5px var(--ink) inset; }
.knop-print:hover { color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent) inset; }
.tblock { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1.5px solid var(--ink); border-radius: 14px; overflow: hidden; font-size: .84rem; }
.tblock div { padding: 6px 10px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-width: 0; }
.tblock div:nth-child(2n) { border-right: 0; }
.tblock div:nth-last-child(-n+2) { border-bottom: 0; }
.tblock b { display: block; font-family: var(--f-mono); font-weight: 400; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.tblock span { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* navigatie */
.snav { position: sticky; top: 66px; z-index: 9; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule); }
.snav .wrap { display: flex; gap: 4px; overflow-x: auto; padding-block: 8px; scrollbar-width: none; }
.snav a { flex: none; text-decoration: none; color: var(--ink-2); font-size: .88rem; font-weight: 500; padding: 6px 12px; border-radius: 999px; }
.snav a:hover { color: var(--ink); background: var(--sunk); }
section { padding-block: 44px 8px; scroll-margin-top: 120px; }
.shead { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.shead p { color: var(--ink-2); max-width: 62ch; margin: 0; }

/* 3D */
.viewer { position: relative; background: var(--viewer-bg); border: 1px solid var(--rule); border-radius: 16px 16px 0 0; height: min(68vh, 640px); min-height: 380px; overflow: hidden; }
.viewer canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.viewer canvas:active { cursor: grabbing; }
.vbar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--rule); border-top: 0; border-radius: 0 0 16px 16px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 6px 12px; font-size: .86rem; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; cursor: pointer; }
.chk input { accent-color: var(--accent); width: 16px; height: 16px; }
.vbar select { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 5px 8px; font-size: .86rem; }
.vhint { position: absolute; left: 12px; top: 10px; font-size: .78rem; color: var(--ink-2); background: color-mix(in srgb, var(--viewer-bg) 80%, transparent); padding: 3px 8px; border-radius: 4px; pointer-events: none; }
.nogl canvas { display: none; }
.nogl .vfallback { display: grid; }
.vfallback { display: none; place-items: center; height: 100%; color: var(--ink-2); padding: 20px; text-align: center; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 18px; border-top: 1px solid var(--rule); }
.facts div { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.facts b { display: block; font-family: var(--f-display); font-size: 1.05rem; }
.facts span { font-size: .88rem; color: var(--ink-2); }
.facts b span, .facts span span { font-size: inherit; color: inherit; }

/* tekenbladen */
.sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 540px), 1fr)); gap: 18px; }
.sheet { margin: 0; background: var(--d-sheet); border: 1px solid var(--rule); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.sheet[data-id="voor"], .sheet[data-id="romp"], .sheet[data-id="blad"] { grid-column: 1 / -1; }
.sheet .canvas { padding: 10px 12px 4px; overflow: hidden; }
.sheet svg.dwg { display: block; width: 100%; height: auto; max-height: 640px; }
.sheet .cap { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; border-top: 1.5px solid var(--d-line); font-size: .82rem; margin-top: auto; }
.sheet .cap > * { padding: 7px 10px; min-width: 0; }
.sheet .cap .no { font-family: var(--f-mono); border-right: 1px solid var(--rule); color: var(--ink-2); white-space: nowrap; }
.sheet .cap .tt b { font-family: var(--f-display); font-size: 1rem; margin-right: 8px; }
.sheet .cap .tt span { color: var(--ink-2); }
.sheet .cap button { border: 0; border-left: 1px solid var(--rule); background: transparent; cursor: pointer; color: var(--accent); font-weight: 600; font-size: .8rem; }
.sheet .legend { margin: 0; padding: 8px 12px 12px 34px; font-size: .82rem; color: var(--ink-2); columns: 2 240px; column-gap: 24px; border-top: 1px solid var(--rule); }
.sheet .legend li { break-inside: avoid; }
.sheet .legend li::marker { font-family: var(--f-mono); color: var(--d-dim); }
svg.dwg polygon, svg.dwg path, svg.dwg line, svg.dwg rect, svg.dwg polyline { vector-effect: non-scaling-stroke; stroke-linejoin: round; }
svg.dwg polygon, svg.dwg path { stroke: var(--d-line); stroke-width: .7px; }
.m-mp { fill: var(--d-mp); } .m-front { fill: var(--d-front); } .m-eik { fill: var(--d-eik); } .m-app { fill: var(--d-app); } .m-appd { fill: var(--d-appd); }
.m-rvs { fill: var(--d-rvs); } .m-hw { fill: var(--d-hw); } .m-wall { fill: var(--d-wall); } .m-floor { fill: var(--d-floor); }
svg.dwg .cut { stroke-width: 1.6px; }
svg.dwg .hid { fill: none; stroke: var(--d-line); stroke-width: .8px; stroke-dasharray: 5 4; opacity: .8; }
svg.dwg .hl { fill: var(--d-hl); }
svg.dwg .dl, svg.dwg .de, svg.dwg .dk { stroke: var(--d-dim); fill: none; }
svg.dwg .dl { stroke-width: .9px; } svg.dwg .de { stroke-width: .6px; } svg.dwg .dk { stroke-width: 1.4px; }
svg.dwg .sec { stroke: var(--d-line); stroke-width: 1.4px; stroke-dasharray: 18 5 3 5; fill: none; }
svg.dwg .gr { stroke: var(--d-line); stroke-width: 2.2px; fill: none; }
svg.dwg text { font-family: var(--f-mono); font-size: calc(var(--fs) * 1px); paint-order: stroke; stroke: var(--d-sheet); stroke-width: calc(var(--fs) * .2px); stroke-linejoin: round; }
svg.dwg .dt { fill: var(--d-dim); }
svg.dwg .cl { fill: var(--d-line); font-size: calc(var(--fs) * .8px); font-weight: 500; }
svg.dwg .bl circle { fill: var(--d-sheet); stroke: var(--d-dim); stroke-width: 1.1px; }
svg.dwg .bl line { stroke: var(--d-dim); stroke-width: .7px; }
svg.dwg .bl text { fill: var(--d-dim); font-weight: 500; font-size: calc(var(--fs) * .85px); stroke: none; }
svg.dwg .bl .dot { fill: var(--d-dim); stroke: none; }
svg.dwg .note { fill: var(--d-line); font-family: var(--f-body); font-size: calc(var(--fs) * .85px); }
dialog#zoom { width: min(96vw, 1500px); max-width: none; height: min(92vh, 1000px); padding: 0; border: 1px solid var(--rule); border-radius: 16px; background: var(--d-sheet); color: var(--ink); }
dialog#zoom::backdrop { background: rgb(10 14 15 / .55); }
.zbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--d-sheet); z-index: 2; }
.zbar button { border: 1px solid var(--rule); background: var(--surface); padding: 4px 12px; border-radius: 999px; cursor: pointer; }
.zbody { overflow: auto; height: calc(100% - 46px); }
.zbody svg.dwg { display: block; width: 100%; min-width: 1100px; height: auto; padding: 12px; }
#tip { position: fixed; z-index: 30; pointer-events: none; background: var(--ink); color: var(--surface); font-size: .78rem; padding: 4px 8px; border-radius: 4px; opacity: 0; transition: opacity .1s; max-width: 260px; }
#tip b { font-family: var(--f-mono); margin-right: 6px; color: var(--accent-soft); }

/* zaaglijst en tabellen */
.tools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: .86rem; color: var(--ink-2); margin-bottom: 10px; }
.tools button { border: 1px solid var(--rule); background: var(--surface); border-radius: 999px; padding: 3px 12px; cursor: pointer; }
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-family: var(--f-mono); font-weight: 500; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); background: var(--sunk); }
td.n, th.n { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
td.code { font-family: var(--f-mono); font-weight: 500; white-space: nowrap; }
td.note { color: var(--ink-2); font-size: .82rem; min-width: 220px; }
tr.cat td { background: var(--paper); font-family: var(--f-display); font-weight: 700; font-size: .98rem; padding-top: 14px; border-bottom: 1.5px solid var(--ink); }
tr.cat td .num { font-family: var(--f-mono); font-weight: 400; font-size: .78rem; color: var(--ink-2); float: right; padding-top: 3px; }
tbody tr.row { cursor: pointer; }
tbody tr.row:hover td, tbody tr.row.pin td { background: var(--accent-soft); }
tr.row.done td:not(.ck) { opacity: .45; text-decoration: line-through; }
td.ck { width: 34px; }
td.ck input { width: 17px; height: 17px; accent-color: var(--ok); cursor: pointer; }
.sec-chip { display: inline-block; font-family: var(--f-mono); font-size: .74rem; padding: 1px 6px; border: 1px solid var(--rule); border-radius: 4px; white-space: nowrap; }

/* zaagplan */
.plan-ctrl { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin-bottom: 14px; font-size: .88rem; }
.plan-ctrl label { display: inline-flex; gap: 8px; align-items: center; }
.plan-ctrl input, .plan-ctrl select { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 4px 6px; font-family: var(--f-mono); }
.plan-ctrl input { width: 5em; }
.pgroups { display: grid; gap: 18px; }
.pgroup { background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 14px; min-width: 0; }
.pgroup header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 18px; margin-bottom: 10px; }
.pgroup header .res { font-family: var(--f-mono); font-size: .86rem; }
.pgroup header .res strong { color: var(--accent); font-weight: 500; font-size: 1.02rem; }
.platen { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.plaatfig { margin: 0; min-width: 0; }
.plaatfig figcaption { font-family: var(--f-mono); font-size: .74rem; color: var(--ink-2); margin-bottom: 4px; }
svg.plaat { display: block; width: 100%; height: auto; }
svg.plaat .pl { fill: var(--sunk); stroke: var(--ink-2); stroke-width: 3; }
svg.plaat .rand { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 10 8; }
svg.plaat .st { fill: var(--d-mp); stroke: var(--ink); stroke-width: 2.5; }
svg.plaat g:hover .st, svg.plaat g.hl .st { fill: var(--d-hl); }
svg.plaat text { font-family: var(--f-mono); font-size: var(--fs); fill: var(--ink); }
svg.plaat text.mt { font-size: calc(var(--fs) * .8); fill: var(--ink-2); }
.ptitle { font-size: .84rem; margin: 6px 0; }

/* materialen en bouwen */
.cols2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.buy { background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 16px; }
.buy ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.buy li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--rule); padding-bottom: 6px; }
.buy li span:last-child { font-family: var(--f-mono); text-align: right; white-space: nowrap; }
.klein-noot { margin: 10px 0 0; font-size: .84rem; color: var(--ink-2); }
.note-box { border-left: 3px solid var(--steel); background: var(--surface); border-radius: 16px; padding: 12px 16px; font-size: .92rem; }
.note-box p { margin: 6px 0 0; }
.note-box ul { margin: 6px 0 0; padding-left: 18px; }
.note-box li { margin: 4px 0; }
ol.steps { list-style: none; margin: 0; padding: 0; counter-reset: st; }
ol.steps > li { counter-increment: st; display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 4px 14px; padding: 14px 0; border-top: 1px solid var(--rule); }
ol.steps > li::before { content: counter(st, decimal-leading-zero); font-family: var(--f-mono); font-size: 1.3rem; color: var(--accent); line-height: 1.2; }
ol.steps h3 { margin-bottom: 4px; }
ol.steps p { color: var(--ink-2); max-width: 75ch; margin: 0; }
.alleen-print { display: none; }
.keuken-voet { padding-block: 28px 0; color: var(--ink-2); font-size: .9rem; }
.werk-vraag { margin: 44px auto 0; padding: 30px; background: #15191C; color: #fff; border-radius: 20px; display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; }
.werk-vraag h2 { color: #fff; margin: 0 0 4px; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
.werk-vraag p { margin: 0; color: #C9CDCF; }

@media (max-width: 860px) {
  .top .wrap { grid-template-columns: minmax(0, 1fr); }
  .cols2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .viewer { min-height: 330px; height: 56vh; }
  .sheet .cap { grid-template-columns: minmax(0, 1fr) auto; }
  .sheet .cap .no { display: none; }
  .knoppen .knop, .knoppen .knop-print { width: 100%; justify-content: center; text-align: center; }
  .werk-vraag .knop { width: 100%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Print: A4 staand, alles onder elkaar, zonder knoppen */
@media print {
  @page { size: A4 portrait; margin: 12mm 11mm 14mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; box-shadow: none !important; }
  html, body { background: #fff !important; }
  body { font-size: 9.6pt; line-height: 1.4; }
  .kop, .snav, .vbar, .vhint, .cap button, .tools, .plan-ctrl, .werk-vraag, .knoppen, dialog, #tip, td.ck, th.ck, .voet nav, .sla-over { display: none !important; }
  .wrap { max-width: none !important; padding: 0 !important; }
  .top { border: 0; background: #fff; }
  .top .wrap { grid-template-columns: minmax(0, 1fr) 82mm; padding: 0 0 4mm !important; gap: 6mm; }
  .top h1 { font-size: 24pt; }
  #model .shead p { display: none; }
  .alleen-print { display: block; margin-top: 3mm; font-family: var(--f-mono); font-size: 8.5pt; color: var(--ink-2); }
  section { padding: 5mm 0 0; }
  .shead { margin-bottom: 3mm; } h2 { font-size: 15pt; break-after: avoid; }
  .viewer { height: 82mm; min-height: 0; border-radius: 0; break-inside: avoid; }
  .facts { break-inside: avoid; }
  .shead { break-after: avoid; }
  .facts div { padding: 2mm 3mm 2mm 0; }
  .sheets { display: block; }
  .sheet { break-inside: avoid; border-radius: 0; margin-bottom: 5mm; }
  .sheet svg.dwg { max-height: 205mm; }
  .sheet .cap { grid-template-columns: auto minmax(0, 1fr); }
  .sheet .legend { columns: 2; }
  .tablewrap { overflow: visible; border-radius: 0; }
  table { font-size: 8.4pt; } th, td { padding: 1.2mm 2mm; } td.note { min-width: 0; }
  tr { break-inside: avoid; } thead { display: table-header-group; }
  tr.row.done td:not(.ck) { opacity: 1; text-decoration: none; }
  .pgroup { break-inside: auto; border-radius: 0; }
  .platen { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4mm; }
  .plaatfig { break-inside: avoid; }
  .cols2 { grid-template-columns: minmax(0, 1fr); gap: 4mm; }
  .buy, .note-box { border-radius: 0; break-inside: avoid; }
  ol.steps > li { break-inside: avoid; padding: 2.5mm 0; }
  .voet { background: #fff !important; color: var(--ink-2) !important; padding: 4mm 0 0 !important; }
  .voet a, .voet .merk { color: var(--ink) !important; }
  a { color: inherit; text-decoration: none; }
}

/* ---- film: zelfde onderdelen, uit het model, om te delen ---- */
.werk-film { margin-top: 22px; max-width: 760px; }
.werk-film video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 16px; border: 1.5px solid var(--rule, #D9D4C7); background: #F4F1EA; }
.werk-film p { margin: 10px 0 0; font-size: .95rem; line-height: 1.45; color: var(--ink-2, #545C61); }
.werk-film a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.werk-film a:hover { color: var(--ink, #15191C); }
@media print { .werk-film { display: none !important; } }
