/* ---------------------------------------------------------------- materiaal_bij_vullen
   Functie materiaal_bij_vullen (public/js/functies/materiaal_bij_vullen.js): de kiezer "Vullen met" in de werkbalk bij
   Ruimte tekenen en Rechthoek, met zijn paneel, en de regel Eronder (lagen onder de vloer) bij een ruimte.
   Zonder de functie staat geen van deze klassen in de pagina. */

/* de kiezer zweeft onder de gereedschappen, boven de tekening: als hij verschijnt, verschuift er niets (Thomas,
   13 november: "dan verschuift ook mijn positie op mijn canvas") */
.kijkrij:has(> .vul-kiezer) { position: relative; }
.vul-kiezer { position: absolute; right: 0; top: calc(100% + 8px); z-index: 7; max-width: min(420px, 100%); box-shadow: 0 2px 10px rgba(21, 26, 45, .12); border-radius: var(--r-bediening, 8px); }
.vul-kiezer[hidden] { display: none; }
.vul-knop { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 30px; padding: 0 10px 0 12px; border: 0; border-radius: var(--r-bediening, 8px);
  background: var(--accent-zacht, #E8EDF7); color: var(--accent-donker, #142560); font: inherit; font-size: 10.5px; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(27, 50, 122, .22); transition: box-shadow .3s var(--veer), background-color .3s var(--veer); }
.vul-knop:hover { box-shadow: inset 0 0 0 1px rgba(27, 50, 122, .45); }
.vul-knop[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--accent-vlak, #1B327A), 0 0 0 3px rgba(27, 50, 122, .14); }
.vul-woord { color: var(--grijs); font-weight: 500; white-space: nowrap; }
.vul-knop .staal { width: 16px; height: 16px; }
.vul-naam { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; color: var(--inkt); }
.vul-maat { color: var(--inkt-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.vul-maat + .vul-maat { color: var(--grijs); }
.vul-lagen { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 99px; background: var(--vlak); color: var(--inkt-2); font-weight: 550; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--lijn-sterk); }
.vul-lagen .icoon { width: 12px; height: 12px; }
.vul-pijl { width: 13px; height: 13px; color: var(--grijs); flex: none; transition: transform .25s var(--veer); }
.vul-knop[aria-expanded="true"] .vul-pijl { transform: rotate(180deg); }

/* het paneel onder de kiezer */
.vul-paneel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; width: 340px; max-width: calc(100vw - 32px); max-height: min(560px, 70svh); overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: 8px; background: var(--vlak); box-shadow: 0 0 0 1px var(--lijn), var(--schaduw-3); overscroll-behavior: contain; }
.vul-paneel[hidden] { display: none; }
.vul-paneel-kop { display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; }
.vul-paneel-kop b { font-size: 12px; font-weight: 650; }
.vul-paneel-kop span { color: var(--grijs); line-height: 1.4; }
.vul-sectie { display: flex; flex-direction: column; gap: 6px; }
.vul-sectie-kop { font-size: 10px; font-weight: 600; color: var(--grijs); text-transform: uppercase; letter-spacing: .04em; }
.vul-lijst { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.vul-optie { display: grid; grid-template-columns: 16px minmax(0, 1fr) 16px; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 5px 8px;
  border: 0; border-radius: 5px; background: none; color: var(--inkt); font: inherit; font-size: 10.5px; text-align: left; cursor: pointer; transition: background-color .25s var(--veer); }
.vul-optie:hover, .vul-optie:focus-visible { background: rgba(21, 26, 45, .05); outline: none; }
.vul-optie[aria-selected="true"] { background: var(--accent-zacht, #E8EDF7); }
.vul-optie .staal { width: 16px; height: 16px; }
.vul-optie-tekst { display: flex; flex-direction: column; min-width: 0; }
.vul-optie-tekst b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vul-optie-tekst span { color: var(--grijs); font-size: 10px; font-variant-numeric: tabular-nums; }
.vul-vink { width: 15px; height: 15px; color: var(--accent-vlak, #1B327A); }
.vul-hulp { margin: 0; font-size: 9.5px; line-height: 1.45; }

/* de lagen bewerken: in het paneel en bij een ruimte */
.lagen-editor { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.laag-rij { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 24px; align-items: center; gap: 0 6px; width: 100%; min-height: 28px; font-size: 10px; font-variant-numeric: tabular-nums; }
.laag-rij .staal { width: 14px; height: 12px; }
.laag-naam { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; color: var(--inkt); }
.laag-rij.onbekend .laag-naam { color: var(--let, #A15C07); font-weight: 500; }
.laag-dikte-vak { display: inline-flex; align-items: center; gap: 4px; }
.laag-dikte.invoer { width: 52px; height: 26px; padding: 0 6px; text-align: right; font-size: 10.5px; background: var(--vlak); }
.laag-eenheid { color: var(--grijs); }
.laag-maat { grid-column: 2 / -1; margin: -3px 0 2px; color: var(--grijs); font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.knop-icoon.laag-weg { width: 24px; height: 24px; color: var(--grijs); }
.knop-icoon.laag-weg .icoon { width: 14px; height: 14px; }
.knop-icoon.laag-weg:hover { color: var(--fout); background: var(--fout-zacht); }
.laag-erbij { height: 26px; max-width: 100%; padding: 0 8px; border: 0; border-radius: var(--r-s, 4px); background: none; color: var(--accent, #004890); font: inherit; font-size: 10px; font-weight: 550; cursor: pointer; }
.laag-erbij:hover { background: rgba(21, 26, 45, .05); }

/* de regel Eronder onder een ruimte met vloer */
.laag-regel { grid-column: 1 / -1; display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: start; gap: 6px; cursor: default; }
.laag-label { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; color: var(--grijs); font-size: 10px; font-weight: 550; }
.laag-label .icoon { width: 13px; height: 13px; }
.laag-regel:not(.met) .lagen-editor { align-items: flex-start; }
.laag-regel:not(.met) .laag-erbij { margin-left: -8px; }

/* bij het totaal: de lagen als eigen regel in de lijst met materialen */
.per-materiaal .regel.laag-totaal .laag-onder { display: block; font-size: 9.5px; font-weight: 450; color: var(--grijs); }
