/* Meettool, huisstijl TotaalBouw: donkerblauw en bordeauxrood op koel papierwit. */
:root {
	--navy: #0b2d63;
	--navy-2: #24467d;
	--bordeaux: #97102f;
	--paper: #f2f4f6;
	--sheet: #ffffff;
	--ink: #17202b;
	--muted: #5b6573;
	--line: #d6dbe2;
	--canvas: #dfe3e8;
	--ok: #22744a;
	--warn: #a35a00;
	--radius: 8px;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--navy); }
h1, h2 { line-height: 1.2; text-wrap: balance; margin: 0; }
.wrap { max-width: 1480px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

/* Kop en voet */
.site-head { background: var(--sheet); border-bottom: 3px solid var(--navy); }
.site-head__inner { display: flex; align-items: center; gap: 16px; padding-block: 10px; flex-wrap: wrap; }
.site-head__brand img { height: 52px; width: auto; display: block; }
.site-head__name { font-weight: 600; color: var(--navy); border-left: 1px solid var(--line); padding-left: 16px; }
.badge-test { margin-left: auto; font: 600 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--bordeaux); border: 1px solid currentColor; border-radius: 4px; padding: 5px 8px; }
.site-foot { margin-top: 40px; background: var(--navy); color: #dfe6f2; }
.site-foot__inner { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-block: 18px; font-size: 13px; }
.site-foot a { color: #fff; margin-left: 16px; }

.intro { padding-block: 26px 14px; }
.intro h1 { font-size: clamp(22px, 3vw, 30px); color: var(--navy); }
.intro__text { max-width: 70ch; color: var(--muted); margin: 8px 0 0; }

/* Knoppen en velden */
.btn { font: 500 13px/1.2 var(--font); color: var(--ink); background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: var(--navy-2); }
.btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn--primary { background: var(--bordeaux); border-color: var(--bordeaux); color: #fff; }
.btn--primary:hover { background: #7d0d27; border-color: #7d0d27; }
.btn--quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn--icon { padding: 6px 10px; font-family: var(--mono); }
.btn:disabled { opacity: .5; cursor: default; }
.btn input[type=file] { display: none; }
kbd { font: 10px var(--mono); border: 1px solid currentColor; border-radius: 3px; padding: 0 3px; opacity: .6; }
input[type=text], input[type=email], input[type=tel], input[type=number], select, textarea { font: inherit; font-size: 14px; color: var(--ink); background: var(--sheet); border: 1px solid var(--line); border-radius: 5px; padding: 7px 9px; min-width: 0; }
input.num { width: 100px; font-family: var(--mono); }
.row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Meettool */
.mt { display: flex; flex-direction: column; gap: 10px; }
.mt-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.mt-tabs { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
.mt-tab { display: flex; align-items: stretch; background: #e6e9ee; border: 1px solid var(--line); border-radius: 6px 6px 0 0; max-width: 260px; }
.mt-tab.is-active { background: var(--sheet); border-bottom-color: var(--sheet); box-shadow: inset 0 3px 0 var(--bordeaux); }
.mt-tab__name { border: 0; background: none; font: 500 13px var(--font); padding: 8px 4px 8px 12px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.mt-tab__close { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 9px; font-size: 16px; }
.mt-tab__close:hover { color: var(--bordeaux); }
.mt-toolbar { display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: space-between; }
.mt-group { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.mt-group__label { font-size: 12px; color: var(--muted); margin-right: 4px; }
.dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.dot--vloer { background: #2c56c9; } .dot--wand { background: #b8641c; } .dot--dak { background: #7a3fb8; } .dot--opening { background: #fff; border: 2px dashed #d13b2a; }

.mt-work { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 12px; height: calc(100vh - 210px); min-height: 560px; }
.mt-stage { position: relative; background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; touch-action: none; }
.mt-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mt-stage.is-drop { outline: 3px dashed var(--bordeaux); outline-offset: -8px; }
.mt-empty { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 6px; padding: 24px; }
.mt-busy { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; padding: 10px 16px; }
.mt-zoom { position: absolute; right: 10px; top: 10px; display: flex; gap: 4px; }
.mt-hint { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.mt-hint span { background: var(--sheet); border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; font-size: 12px; }

.mt-side { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; }
.card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.card h2 { font-size: 15px; color: var(--navy); display: flex; align-items: baseline; gap: 8px; }
.card p { margin: 0; }
.mt-state { margin-left: auto; font: 400 11px var(--mono); color: var(--muted); }
.mt-state.is-ok { color: var(--ok); } .mt-state.is-todo { color: var(--warn); }
.table-scroll { overflow-x: auto; }
.mt-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.mt-table th { text-align: left; font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 4px 5px; border-bottom: 1px solid var(--line); }
.mt-table td { padding: 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.mt-table .num { text-align: right; white-space: nowrap; font-family: var(--mono); font-size: 12.5px; }
.mt-table td.mt-lbl { color: var(--muted); }
.mt-table tr { cursor: pointer; }
.mt-table tr.is-sel td { background: #eef2fb; }
.mt-table input[type=text] { width: 100%; border-color: transparent; background: transparent; padding: 2px 4px; font-size: 13px; }
.mt-table input[type=text]:focus, .mt-table input[type=text]:hover { border-color: var(--line); background: var(--sheet); }
.mt-table small { display: block; color: var(--muted); font-size: 11px; padding-left: 4px; }
.mt-pitch { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); padding-left: 4px; }
.mt-pitch input { width: 58px; padding: 2px 4px; font-size: 12px; }
.mt-chip { font: 600 10.5px var(--font); border-radius: 3px; padding: 2px 6px; color: #fff; white-space: nowrap; display: inline-block; }
.mt-chip--vloer { background: #2c56c9; } .mt-chip--wand { background: #b8641c; } .mt-chip--dak { background: #7a3fb8; } .mt-chip--opening { background: #d13b2a; } .mt-chip--lengte { background: #0f8b9a; }
.mt-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0 6px; }
.mt-del:hover { color: var(--bordeaux); }
.mt-empty-row { color: var(--muted); font-size: 13px; padding: 8px 4px !important; cursor: default; }
.mt-totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; font-variant-numeric: tabular-nums; }
.mt-totals dt { font-size: 13px; color: var(--muted); }
.mt-totals dd { margin: 0; font: 600 14px var(--mono); text-align: right; }
.mt-estimate { font: 700 20px var(--font); color: var(--bordeaux); }
.mt-estimate-lines { margin: 0; padding-left: 18px; }
.mt-ai-out { white-space: pre-wrap; color: var(--muted); }
.mt-ai-out.is-error { color: var(--warn); }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 15px; border-radius: 6px; font-size: 13px; z-index: 20; max-width: calc(100vw - 32px); }

/* Aanvraag */
.aanvraag { margin-top: 24px; }
.card--wide { padding: 20px; max-width: 860px; }
.card--wide h2 { font-size: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .check { flex-direction: row; align-items: flex-start; gap: 8px; color: var(--ink); }
.form-grid .hp { position: absolute; left: -9999px; }
.flash { background: #e5f1ea; color: var(--ok); border-radius: 6px; padding: 10px 12px; }
.flash--error { background: #fbe9e7; color: #a12a1c; }
.flash ul { margin: 0; padding-left: 18px; }

.prose { max-width: 760px; padding-block: 30px; }
.prose h1 { color: var(--navy); margin-bottom: 14px; }
.prose h2 { margin: 22px 0 8px; font-size: 19px; }

@media (max-width: 980px) {
	.mt-work { grid-template-columns: 1fr; height: auto; }
	.mt-stage { height: 64vh; min-height: 380px; }
	.mt-side { overflow: visible; }
	.form-grid { grid-template-columns: 1fr; }
	.site-head__name { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Aandacht voor het schaalpaneel als er nog geen schaal is */
@keyframes mt-flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(151, 16, 47, 0); } 30% { box-shadow: 0 0 0 4px rgba(151, 16, 47, .35); } }
.card.is-flash { border-color: var(--bordeaux); animation: mt-flash 1.4s ease 2; }
@media (prefers-reduced-motion: reduce) { .card.is-flash { animation: none; } }

/* Eenvoudige stappen, voortgang en uitkomst bovenaan */
.steps { margin: 14px 0 16px; padding-left: 20px; display: grid; gap: 4px; max-width: 70ch; }
.btn--big { font-size: 16px; padding: 13px 22px; }
.result-wrap { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.progress progress { width: 100%; height: 8px; accent-color: var(--bordeaux); }
.progress .row { justify-content: space-between; }
.result h2 { font-size: 20px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kpi { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.kpi__label { font-size: 12.5px; color: var(--muted); }
.kpi__value { font: 700 24px/1.15 var(--font); color: var(--navy); font-variant-numeric: tabular-nums; }
.kpi--accent { background: #fbf2f4; border-color: #e8c3cc; }
.kpi--accent .kpi__value { color: var(--bordeaux); font-size: 19px; }
.result details summary { cursor: pointer; color: var(--navy); font-weight: 500; }
.result-table td { cursor: default; }
.section-title { font-size: 18px; color: var(--navy); margin-top: 6px; }
@media (max-width: 860px) { .kpis { grid-template-columns: 1fr 1fr; } }
.kpi__sub { font-size: 12px; color: var(--muted); }

/* Betaalstap */
.pay { border: 2px solid var(--bordeaux); gap: 12px; padding: 18px 20px; }
.pay h2 { font-size: 19px; }
.pay__credit { background: #fbf2f4; color: var(--bordeaux); font-weight: 600; padding: 8px 12px; border-radius: 6px; }
.pay__field { display: flex; flex-direction: column; gap: 4px; max-width: 360px; }
.pay .check { display: flex; gap: 8px; align-items: flex-start; max-width: 70ch; }
#mt-pay-msg.is-error { color: #a12a1c; }
#mt-pay-msg.is-ok { color: var(--ok); }
