
/* Zelfde opbouw als het kippenhok: titelhoek, 3D-model, genummerde tekenbladen, lijsten als werkdocument. Kleuren en letters van de site. */
:root {
  --paper: #F4F1EA; --surface: #FFFFFF; --sunk: #EDE9DF; --ink: #15191C; --ink-2: #545C61; --rule: #D9D4C7;
  --accent: #B23A0A; --accent-soft: #F7E3D8; --steel: #1F4E79; --ok: #2F6B45;
  --viewer-bg: #E9E5DB;
  --d-sheet: #FDFCF9; --d-line: #273032; --d-vuren: #EAD3A8; --d-mpx: #F3E6CB; --d-front: #E9D2AC; --d-hb: #B98A62; --d-gat: #4A3424;
  --d-staal: #9AA2A8; --d-zwart: #2A2C2E; --d-bs: #5C7383; --d-dim: #1F4E79; --d-hl: #E07F45;
  --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;
}
* { box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.55; }
.wrap { max-width: 1260px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; text-wrap: balance; margin: 0; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); line-height: 1.12; }
h3 { font-size: 1.12rem; }
p { margin: 0; }
a { color: var(--steel); }
.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: 30px 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); 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-top: 12px; max-width: 60ch; color: var(--ink-2); font-size: 1.02rem; }
.gratis { margin-top: 14px; max-width: 60ch; font-size: .95rem; padding-left: 12px; border-left: 3px solid var(--steel); }
.knoppen-werk { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.knop-print { display: inline-flex; align-items: center; min-height: 52px; padding: 0 22px; border: 1.5px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer; }
.knop-print:hover { border-color: var(--ink); color: var(--ink); }
.tblock { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1.5px solid var(--ink); font-size: .84rem; border-radius: 14px; overflow: hidden; }
.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; }

/* ---- 3D ---- */
.viewer { position: relative; background: var(--viewer-bg); border: 1px solid var(--rule); height: min(68vh, 640px); min-height: 380px; overflow: hidden; border-radius: 16px 16px 0 0; }
.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; }
.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: 3px; 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; }
.printbeeld { display: none; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; 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); }

/* ---- 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); display: flex; flex-direction: column; min-width: 0; border-radius: 16px; overflow: hidden; }
.sheet .canvas { padding: 10px 12px 4px; overflow: hidden; }
.sheet svg.dwg { display: block; width: 100%; height: auto; max-height: 560px; }
.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 ol.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 ol.legend li { break-inside: avoid; padding-left: 2px; }
.sheet ol.legend li::marker { font-family: var(--f-mono); color: var(--d-dim); font-weight: 500; }

svg.dwg polygon, svg.dwg line, svg.dwg rect, svg.dwg circle, svg.dwg polyline { vector-effect: non-scaling-stroke; stroke-linejoin: round; }
svg.dwg polygon { stroke: var(--d-line); stroke-width: .7px; }
.m-vuren { fill: var(--d-vuren); } .m-mpx { fill: var(--d-mpx); } .m-front { fill: var(--d-front); } .m-hb { fill: var(--d-hb); }
svg.dwg polygon.gaten { fill: url(#gatP); }
.m-staal { fill: var(--d-staal); } .m-zwart { fill: var(--d-zwart); } .m-bs { fill: var(--d-bs); }
svg.dwg polygon.sn { stroke: none; pointer-events: none; }
svg.dwg .snl { stroke: var(--d-line); stroke-width: .7px; opacity: .55; }
svg.dwg .hid { fill: none; stroke: var(--d-line); stroke-width: .9px; stroke-dasharray: 5 4; opacity: .85; pointer-events: none; }
svg.dwg polygon.hl { fill: var(--d-hl); stroke: var(--d-line); }
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 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 .da { fill: var(--d-dim); font-style: italic; }
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) * .78px); 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) * .8px); }

dialog#zoom { width: min(96vw, 1500px); max-width: none; height: min(92vh, 1000px); padding: 0; border: 1px solid var(--rule); background: var(--d-sheet); color: var(--ink); border-radius: 16px; }
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 14px; 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 ---- */
.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); background: var(--surface); border-radius: 16px; }
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: 240px; }
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; text-decoration-color: var(--ink-2); }
td.ck, th.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: .76rem; padding: 1px 7px; border: 1px solid var(--rule); border-radius: 999px; white-space: nowrap; }

/* ---- zaagplan ---- */
.plan-ctrl { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin-bottom: 10px; 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; width: 5.2em; font-family: var(--f-mono); }
.plan-ctrl select { width: auto; }
.plan-noot { font-size: .82rem; color: var(--ink-2); margin-bottom: 14px; }
.pgroups { display: grid; gap: 18px; }
.pgroup { background: var(--surface); border: 1px solid var(--rule); padding: 14px; min-width: 0; border-radius: 16px; }
.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.05rem; }
.bars { display: grid; gap: 4px; }
.bar { display: grid; grid-template-columns: 2.4em minmax(0, 1fr); align-items: center; gap: 6px; font-family: var(--f-mono); font-size: .7rem; }
.bar .i { color: var(--ink-2); text-align: right; }
.bar .track { display: flex; height: 22px; background: repeating-linear-gradient(135deg, var(--sunk) 0 4px, transparent 4px 8px); border: 1px solid var(--rule); overflow: hidden; border-radius: 4px; }
.bar .pc { background: var(--d-vuren); border-right: 2px solid var(--surface); display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; color: var(--ink); min-width: 0; }
.platen { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.plaat { margin: 0; }
.plaat svg { display: block; width: 100%; height: auto; }
.plaat .pl { fill: var(--sunk); stroke: var(--rule); stroke-width: 6; }
.plaat .rand { fill: none; stroke: var(--ink-2); stroke-width: 3; stroke-dasharray: 18 12; }
.plaat g rect { fill: var(--d-mpx); stroke: var(--d-line); stroke-width: 4; }
.plaat text { font-family: var(--f-mono); fill: var(--ink); font-weight: 500; }
.plaat text.pm { fill: var(--ink-2); font-weight: 400; }
.plaat figcaption { font-family: var(--f-mono); font-size: .76rem; color: var(--ink-2); margin-top: 4px; }

/* ---- materialen & bouwen ---- */
.cols2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.buy { background: var(--surface); border: 1px solid var(--rule); padding: 16px; border-radius: 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 { margin-top: 10px; font-size: .84rem; color: var(--ink-2); }
ol.steps { list-style: none; margin: 0; padding: 0; counter-reset: st; display: grid; }
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; }
.note-box { border-left: 3px solid var(--steel); background: var(--surface); padding: 12px 16px; font-size: .92rem; border-radius: 0 16px 16px 0; }
.note-box ul { margin: 6px 0 0; padding-left: 18px; }
.note-box li { margin: 4px 0; }
.voorbehoud { padding-block: 28px 0; color: var(--ink-2); font-size: .9rem; }
.werk-vraag { margin: 28px auto 44px; padding: 30px; background: var(--ink); 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; max-width: 56ch; }

@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-werk .knop, .knop-print, .werk-vraag .knop { width: 100%; justify-content: center; text-align: center; }
  .knop-print { min-height: 0; padding-block: 14px; line-height: 1.25; }
  .werk-vraag .knop { min-height: 0; padding-block: 14px; line-height: 1.25; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---- printen: A4, alles onder elkaar ---- */
@media print {
  @page { size: A4 portrait; margin: 12mm 11mm 13mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html { scroll-behavior: auto; }
  body { background: #fff; font-size: 9.5pt; line-height: 1.4; }
  .wrap { max-width: none; padding: 0; }
  .kop, .snav, .vbar, .vhint, #tip, dialog, .knop-print, .knoppen-werk, .tools button, .sheet .cap button, td.ck, th.ck, .plan-ctrl, .werk-vraag .knop { display: none !important; }
  .top { background: #fff; border-bottom: 1.5px solid #000; }
  .top .wrap { grid-template-columns: minmax(0, 1fr) 82mm; padding-block: 0 6mm; gap: 8mm; }
  .top h1 { font-size: 26pt; }
  .lede, .gratis { font-size: 9.5pt; }
  section { padding-block: 7mm 0; }
  .shead { margin-bottom: 4mm; }
  h2 { font-size: 15pt; }
  #model .viewer { display: none; }
  .printbeeld { display: block; width: 100%; max-height: 120mm; object-fit: contain; border: 1px solid var(--rule); border-radius: 0; background: var(--viewer-bg); }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #tekeningen { break-before: page; }
  .sheets { display: block; }
  .sheet { break-inside: avoid; margin-bottom: 6mm; border-radius: 0; border-color: #999; }
  .sheet .canvas { padding: 2mm 3mm 0; }
  .sheet svg.dwg { max-height: 232mm; }
  .sheet .cap { font-size: 8pt; }
  .sheet .cap > * { padding: 1.5mm 3mm; }
  .sheet ol.legend { font-size: 7.5pt; padding: 1.5mm 3mm 2mm 8mm; }
  #zaaglijst, #bouwen { break-before: page; }
  .shead, h2, h3 { break-after: avoid; }
  .facts > div { break-inside: avoid; }
  .tablewrap { overflow: visible; border-radius: 0; }
  table { font-size: 8pt; }
  th, td { padding: 3px 6px; }
  td.note { min-width: 0; font-size: 7.5pt; }
  tr { break-inside: avoid; }
  thead { display: table-header-group; }
  tr.row.done td:not(.ck) { opacity: 1; text-decoration: none; }
  tbody tr.row:hover td, tbody tr.row.pin td { background: none; }
  .pgroup { break-inside: avoid; border-radius: 0; }
  .platen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  ol.steps > li { break-inside: avoid; padding: 2.5mm 0; }
  .note-box { border-radius: 0; }
  .werk-vraag { background: #fff; color: #000; border: 1.5px solid #000; border-radius: 0; padding: 5mm; margin: 6mm 0 0; break-inside: avoid; }
  .werk-vraag h2 { color: #000; }
  .werk-vraag p { color: #333; }
  .werk-vraag .print-adres { display: block !important; font-family: var(--f-mono); }
  .voet { background: #fff !important; color: #333 !important; padding: 4mm 0 0 !important; border-top: 1px solid #999; }
  .voet a, .voet .merk { color: #000 !important; }
  .voet-binnen { display: block; break-inside: avoid; }
  .voet nav { display: none; }
  .voet-binnen p { margin: 1mm 0 0; }
  .juridisch { padding-top: 1mm; border: 0; }
}

/* ---- 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; } }

/* Roboserve: kop en voet van de site */
.print-adres { display: none; }
.werkbank-pagina main { display: block; }
