/* The configurator (/offerte.html). Tokens, buttons and form controls come from base.css.
   Wide screen: three columns that fill the window under the header, each scrolling by itself.
   Below 1000 px the columns stack and the page scrolls as a whole. */

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.cfg { --panel-pad: 16px; }

/* ---- before the first upload ---- */
.cfg-start { max-width: 860px; margin: 0 auto; padding: 40px 24px 64px; }
.start-card { padding: 32px 36px 36px; }
.start-card h1 { font-size: 28px; margin-bottom: 20px; }
.start-steps { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 10px; }
.start-steps li { display: flex; gap: 12px; align-items: baseline; }
.step-no { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: 13.5px;
  display: inline-flex; align-items: center; justify-content: center; position: relative; top: 2px; }
.dropzone { border: 2px dashed #b9c1ca; border-radius: var(--radius); background: #fafbfc; padding: 40px 24px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.dropzone-icon { width: 48px; height: 48px; color: var(--steel); }
.dropzone-title { font-size: 19px; font-weight: 600; margin: 0; }
.dropzone-limits { margin: 0; font-size: 13.5px; }
/* The way to the drawing module (/tekenen.html) for who has no drawing yet. */
.start-draw { margin: 16px 0 0; text-align: center; font-size: 14.5px; }
/* The work area fills the window under the header; the footer follows it directly. */
.configurator .site-footer { margin-top: 0; }

/* ---- the three columns ---- */
.cfg-work { display: grid; grid-template-columns: 350px minmax(0, 1fr) 360px; gap: 0; height: calc(100vh - var(--header-h)); min-height: 520px; }
.panel { background: var(--card); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.parts-panel { border-right: 1px solid var(--line); }
.settings-panel { border-left: 1px solid var(--line); }
.panel-head { padding: 14px var(--panel-pad) 10px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 16.5px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-tools { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; }
.link-btn { background: none; border: 0; padding: 2px 0; font: inherit; font-size: 13.5px; color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--ink); }
.link-btn:focus-visible, .part:focus-visible, .part-remove:focus-visible, .drop-more:focus-visible, .tabs button:focus-visible,
.stage-tools button:focus-visible, .view-toggle button:focus-visible, .viewer2d-canvas:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 1px; }

/* ---- parts list ---- */
.parts { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; min-height: 80px; }
.part { display: grid; grid-template-columns: 20px 52px minmax(0, 1fr) auto 24px; gap: 10px; align-items: center;
  padding: 10px var(--panel-pad) 10px 12px; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; cursor: pointer; }
.part:hover { background: #fafbfc; }
.part.selected { background: #fff9e6; border-left-color: var(--accent); }
.part-upload { cursor: default; }
.part-status { width: 20px; height: 20px; display: inline-flex; }
.part-status svg { width: 20px; height: 20px; }
.tone-ok { color: var(--ok); }
.tone-ask { color: var(--blue); }
.tone-err { color: var(--err); }
.tone-todo { color: #b9c1ca; }
.spin { width: 18px; height: 18px; border: 2.5px solid #d5dae0; border-top-color: var(--ink); border-radius: 50%; animation: cfg-spin .8s linear infinite; }
@keyframes cfg-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 4s; } }
.part-thumb { width: 52px; height: 40px; display: flex; align-items: center; justify-content: center; background: #f1f3f5; border-radius: 6px; overflow: hidden; }
.part-thumb svg { max-width: 46px; max-height: 34px; width: 100%; height: 100%; }
.part-main { display: grid; gap: 1px; min-width: 0; }
.part-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part-size, .part-material { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* The size is what the visitor checks his drawing by: it wraps before it is cut off. */
.part-size { white-space: normal; }
.part-material.muted, .part-size.muted { color: var(--steel); }
.part-problem { font-size: 12.5px; color: var(--err); }
.part-ask-why { font-size: 12.5px; color: var(--blue); }
.price-retry { margin: -4px 0 10px; }
/* A remark of the server about a part that can be ordered all the same: amber and under the row, never the red of a problem. */
.part-warnings { grid-column: 2 / -1; display: grid; gap: 4px; }
.part-warning { display: flex; gap: 6px; align-items: flex-start; padding: 5px 8px; border-radius: 6px; background: #fff7e0; border: 1px solid #ffe3a1;
  font-size: 12.5px; line-height: 1.35; color: #6b4a00; }
.part-warning svg { flex: none; width: 15px; height: 15px; margin-top: 1px; color: var(--warn); }
.part-side { display: grid; justify-items: end; gap: 1px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.part-qty { font-size: 12.5px; color: var(--steel); }
.part-price { font-weight: 700; font-size: 14.5px; }
.part-price-ask { font-weight: 600; font-size: 12.5px; color: var(--blue); white-space: normal; text-align: right; max-width: 76px; line-height: 1.2; }
.part-unit { font-size: 11.5px; }
.part-remove { width: 24px; height: 24px; padding: 3px; border: 0; background: none; color: var(--steel); border-radius: 6px; cursor: pointer; }
.part-remove:hover { background: #eef1f4; color: var(--err); }
.part-remove svg { width: 18px; height: 18px; display: block; }
.price-pending .part-price, .price-pending .part-unit, .price-pending #total-amount, .price-pending #total-rows, .price-pending .facts { opacity: .45; }

.drop-more { margin: 12px var(--panel-pad); padding: 12px; border: 2px dashed #b9c1ca; border-radius: 8px; background: #fafbfc; color: var(--ink-2);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; display: flex; gap: 8px; align-items: center; justify-content: center; flex: none; }
.drop-more:hover { border-color: var(--steel); background: #f4f5f7; }
.drop-more svg { width: 18px; height: 18px; }

.totals { border-top: 1px solid var(--line); padding: 12px var(--panel-pad) 16px; flex: none; display: grid; gap: 6px; }
.total-row { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* Transport has no amount here, only a sentence: it may wrap, and it reads as text and not as a number. */
.total-row.total-transport { gap: 12px; }
.total-row.total-transport span:last-child { text-align: right; }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.total-label { font-size: 16px; font-weight: 700; }
.total-label small { font-weight: 400; color: var(--steel); font-size: 12.5px; }
#total-amount { font-size: 22px; font-variant-numeric: tabular-nums; text-align: right; }
#total-amount[data-kind="aanvraag"] { font-size: 17px; color: var(--blue); }
.delivery { margin: 0; font-size: 13px; line-height: 1.4; }
.delivery strong { color: var(--ink); font-weight: 600; }
.next-btn { width: 100%; margin-top: 4px; }
.next-hint { margin: 0; font-size: 12.5px; }
.admin-link { font-size: 13px; }
.totals .notice { margin: 0; }

/* ---- the drawing ---- */
.stage { position: relative; background: #e9ecef; min-width: 0; min-height: 0; overflow: hidden; }
.stage-view { position: absolute; inset: 0; }
.viewer2d-canvas { display: block; touch-action: none; cursor: grab; }
.viewer2d-canvas.dragging { cursor: grabbing; }
.stage-note { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); margin: 0; max-width: min(520px, 86%); padding: 8px 12px; border-radius: 8px;
  background: #fff7e0; border: 1px solid #ffe3a1; font-size: 13.5px; text-align: center; z-index: 3; }
.stage-tools { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; background: #fff; border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; z-index: 3; }
.stage-tools button { width: 40px; height: 38px; border: 0; background: #fff; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.stage-tools button + button { border-left: 1px solid var(--line); }
.stage-tools button:hover { background: #f4f5f7; }
.stage-tools svg { width: 18px; height: 18px; }
.stage[data-mode="leeg"] .stage-tools, .stage[data-mode="geen"] .stage-tools { display: none; }
.readout { position: absolute; left: 16px; bottom: 18px; background: rgba(255, 255, 255, .92); border-radius: 8px; padding: 6px 10px; font-size: 13px; box-shadow: var(--shadow); z-index: 3; }
/* The 3D viewer shows the size itself, bottom right; one readout is enough there. */
.stage[data-mode="3d"] .readout { display: none; }
.view-toggle { position: absolute; top: 14px; right: 16px; display: flex; background: #fff; border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; z-index: 3; }
.view-toggle button { border: 0; background: #fff; padding: 7px 14px; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---- settings ---- */
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 var(--panel-pad); gap: 18px; flex: none; }
.tabs button { border: 0; background: none; padding: 10px 0 9px; font: inherit; font-weight: 600; font-size: 14px; color: var(--steel); cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.settings-scroll { overflow-y: auto; padding: 14px var(--panel-pad) 20px; flex: 1 1 auto; min-height: 0; }
.settings-panel .label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 4px; }
.optional { font-weight: 400; }
.field-note { margin: 5px 0 0; font-size: 12.5px; line-height: 1.4; }
.stock-note { color: var(--warn); }
.field-err { color: var(--err); }
#thickness-note { color: var(--warn); }
select:disabled { background: #f1f3f5; color: var(--steel); }

.layers-scroll { max-height: 290px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.layers { width: 100%; border-collapse: collapse; font-size: 13px; }
.layers th, .layers td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
.layers tbody tr:last-child th, .layers tbody tr:last-child td { border-bottom: 0; }
.layers thead th { position: sticky; top: 0; background: #f4f5f7; font-size: 11.5px; font-weight: 600; color: var(--steel); z-index: 1; }
.layers .pick { text-align: center; width: 62px; padding-left: 2px; padding-right: 2px; }
.layers input[type=radio] { width: 17px; height: 17px; accent-color: var(--ink); margin: 0; vertical-align: middle; cursor: pointer; }
.layers-all th { font-weight: 600; background: #fafbfc; }
.layers-all td { background: #fafbfc; }
/* The colour of the drawing's layer is set by the page (element.style); a layer without one is ink. */
.layer-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; border: 1px solid rgba(0, 0, 0, .25); vertical-align: middle; background: #15191e; }
.layer-name { font-weight: 600; word-break: break-word; }
.layer-facts { display: block; font-size: 11.5px; margin-left: 16px; }

.stepper { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 6px; }
.stepper .btn { padding: 0; font-size: 20px; line-height: 1; }
.stepper input { text-align: center; font-variant-numeric: tabular-nums; }
input[aria-invalid="true"] { border-color: var(--err); }

.holes { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.holes th, .holes td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; vertical-align: middle; }
.holes thead th { font-size: 11.5px; font-weight: 600; color: var(--steel); text-transform: uppercase; letter-spacing: .3px; }
.holes .num { text-align: right; font-variant-numeric: tabular-nums; }
.holes tbody th { font-weight: 600; white-space: nowrap; }
.holes select { padding: 6px 8px; }

.part-info { display: grid; gap: 12px; margin-top: 6px; }
.part-info:empty { display: none; }
.part-info .notice { margin: 0; }
.problem-list { margin: 0; padding: 10px 12px 10px 28px; border-radius: 8px; background: #fdecea; border: 1px solid #f5c2bd; color: #7a1f18; font-size: 13.5px; }
.problem-list.on-request { background: #eaf1fd; border-color: #c3d6f7; color: #173e8a; }
.problem-list.to-do { background: #f4f5f7; border-color: var(--line); color: var(--ink-2); }
.facts { margin: 0; display: grid; gap: 4px; font-size: 13.5px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; }
.facts dt { color: var(--steel); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.warn-box { padding: 10px 12px; border-radius: 8px; background: #fff7e0; border: 1px solid #ffe3a1; font-size: 13px; }
.warn-list { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.line-warn-box strong { display: flex; gap: 6px; align-items: center; }
.line-warn-box strong svg { flex: none; width: 16px; height: 16px; color: var(--warn); }
.line-warn-foot { margin: 8px 0 0; color: var(--ink-2); }
.cutter-note { margin: 0; }

/* ---- "opnieuw bestellen": the notice above the list (or on the start card), and its question ---- */
.repeat-note { flex: none; }
.repeat-box { position: relative; margin: 10px var(--panel-pad) 0; padding: 10px 12px; border-radius: 8px; background: #eaf1fd; border: 1px solid #c3d6f7;
  font-size: 13px; line-height: 1.4; max-height: 38vh; overflow-y: auto; }
.repeat-box p { margin: 0 0 4px; }
.repeat-box.repeat-warn { background: #fff7e0; border-color: #ffe3a1; }
.repeat-box.repeat-err { background: #fdecea; border-color: #f5c2bd; color: #7a1f18; }
.repeat-list { margin: 2px 0 6px; padding-left: 18px; display: grid; gap: 4px; }
.repeat-list strong { word-break: break-all; }
.repeat-progress { width: 100%; height: 8px; margin-top: 4px; accent-color: var(--ink); }
.repeat-close { display: inline-block; margin-top: 2px; }

/* ---- a material chosen on a material page (js/offerte/pick.js), on the start card ---- */
.pick-note { margin: 0 0 16px; padding: 10px 12px; border-radius: 8px; background: #fff7e0; border: 1px solid #ffe3a1; font-size: 14px; line-height: 1.45; }
.pick-note .link-btn { margin-left: 4px; }
#repeat-host-start .repeat-box { margin: 0 0 20px; }
.repeat-choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ---- dropping, bulk ---- */
.drop-veil { position: fixed; inset: 0; z-index: 200; background: rgba(21, 25, 30, .72); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.drop-veil p { margin: 0; padding: 28px 40px; border: 3px dashed var(--accent); border-radius: 14px; color: #fff; font-size: 22px; font-weight: 600; }

.bulk-dialog { border: 0; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(16, 24, 40, .35); padding: 0; width: min(560px, calc(100vw - 32px)); color: var(--ink); }
.bulk-dialog::backdrop { background: rgba(21, 25, 30, .55); }
.bulk { padding: 22px 24px 20px; }
.bulk h2 { font-size: 20px; }
.bulk-scope { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 12px; margin: 14px 0; display: grid; gap: 6px; }
.bulk-scope legend { font-size: 13.5px; font-weight: 600; color: var(--ink-2); padding: 0 4px; }
.bulk-scope .check { align-items: center; margin: 0; }
.bulk-parts { list-style: none; margin: 4px 0 0 24px; padding: 0; max-height: 180px; overflow-y: auto; display: grid; gap: 4px; }
.bulk-parts span { word-break: break-all; }
.bulk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.bulk-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ---- narrower than three columns ---- */
@media (max-width: 1099px) {
  .cfg-work { grid-template-columns: 300px minmax(0, 1fr) 320px; }
}
@media (max-width: 999px) {
  .cfg-work { display: block; height: auto; }
  .parts-panel, .settings-panel { border: 0; }
  .parts { max-height: 46vh; }
  .stage { height: 62vh; min-height: 320px; }
  /* Too narrow for the size and the buttons side by side. */
  .readout { bottom: auto; top: 14px; }
  .stage-note { top: 54px; }
  .settings-scroll { overflow: visible; }
  .cfg-start { padding: 20px 12px 40px; }
  .start-card { padding: 22px 18px 24px; }
  .bulk-grid { grid-template-columns: 1fr; }
}
