/* Offertes Werkhoven Timmerwerken
   Huisstijl: blauw #00a3db (logo) met wit (logo), antraciet, Roboto-familie.
   Werkplaats-detail: een rolmaat-strook onder de kop. */

:root {
  --blue: #00a3db;
  --blue-d: #0087b8;
  --blue-l: #e3f6fd;
  --ink: #1d2126;
  --char: #33373d;
  --muted: #6c727a;
  --paper: #f2f1ed;
  --card: #fff;
  --line: #dcdad3;
  --line-l: #ebe9e3;
  --red: #cc3366;
  --green: #2f9e5b;
  --amber: #d98a00;
  --r: 6px;
  --sans: Roboto, -apple-system, system-ui, sans-serif;
  --slab: "Roboto Slab", Georgia, serif;
  --cond: "Roboto Condensed", Roboto, sans-serif;
  --mono: "Roboto Mono", ui-monospace, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.45 var(--sans);
}
a { color: var(--blue-d); }
h1, h2 { font-family: var(--slab); font-weight: 700; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 26px; }
h2 { font-size: 17px; }
small { color: var(--muted); font-weight: 400; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

/* ---------- kop + rolmaat ---------- */
.topbar { background: var(--blue); position: sticky; top: 0; z-index: 20; }
.topbar-in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 10px 20px 8px; }
.brand img { display: block; height: 44px; width: auto; }
.mainnav { display: flex; gap: 4px; margin-left: auto; }
.mainnav a {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--r);
  color: #fff; text-decoration: none; font: 700 14px var(--cond); text-transform: uppercase; letter-spacing: .06em;
}
.mainnav a:hover { background: rgba(255,255,255,.14); }
.mainnav a.on { background: #fff; color: var(--blue-d); }
.tape {
  height: 12px; background-color: #f5c400;
  background-image:
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 50px),
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 10px);
  background-size: 100% 12px, 100% 5px;
  background-repeat: repeat-x;
  background-position: 0 0, 0 0;
  border-bottom: 1px solid rgba(0,0,0,.25);
}

.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 20px 80px; }

/* ---------- knoppen + formulieren ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 15px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: 500 14px var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--char); }
.btn.primary { background: var(--char); border-color: var(--char); color: #fff; }
.btn.primary:hover { background: #000; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--red); }
.btn.small { height: 32px; padding: 0 11px; font-size: 13px; }
.btn.big { height: 50px; font-size: 16px; width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn { border: 0; background: none; padding: 8px; border-radius: var(--r); color: var(--muted); cursor: pointer; display: inline-flex; }
.iconbtn:hover { background: var(--line-l); color: var(--ink); }
.iconbtn.danger:hover { color: var(--red); }

input, select, textarea {
  font: 400 15px/1.3 var(--sans); text-transform: none; letter-spacing: 0; color: var(--ink); width: 100%; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--r); background: #fff; padding: 9px 11px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
textarea { resize: vertical; }
label { display: flex; flex-direction: column; gap: 5px; font: 700 12px var(--cond); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
label small { text-transform: none; letter-spacing: 0; font-family: var(--sans); }
label.check { flex-direction: row; align-items: center; gap: 9px; text-transform: none; letter-spacing: 0; font: 400 14px var(--sans); color: var(--ink); }
label.check input { width: 18px; height: 18px; accent-color: var(--blue-d); flex: none; }
.fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.fields .span2 { grid-column: span 2; }
.fields .span4 { grid-column: 1 / -1; }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 14px; }

.alert { background: #fdecf1; color: #8a1f43; border-left: 4px solid var(--red); padding: 10px 14px; border-radius: 0 var(--r) var(--r) 0; }
.note.ok { background: #e7f6ed; color: #1b6a3c; border-left: 4px solid var(--green); padding: 10px 14px; border-radius: 0 var(--r) var(--r) 0; }

/* ---------- paginakop ---------- */
.pagehead { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.pagehead h1 { margin-right: auto; }
.ph-actions { display: flex; gap: 8px; }

/* ---------- filters ---------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.search { position: relative; flex: 1 1 280px; display: block; }
.search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 36px; height: 42px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font: 500 13px var(--sans); cursor: pointer; white-space: nowrap;
}
.chip b { font: 500 11px var(--mono); color: var(--muted); }
.chip.on { background: var(--char); border-color: var(--char); color: #fff; }
.chip.on b { color: #c9ccd0; }

/* ---------- stempels (status) ---------- */
.stamp {
  display: inline-block; font: 700 11px var(--cond); text-transform: uppercase; letter-spacing: .1em;
  padding: 3px 8px; border: 2px solid currentColor; border-radius: 3px; transform: rotate(-2deg); justify-self: start;
}
.st-concept { color: var(--muted); }
.st-verstuurd { color: var(--blue-d); }
.st-akkoord { color: var(--green); }
.st-afgewezen { color: var(--red); }

/* ---------- offertelijst ---------- */
.quotelist { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.quotelist li + li { border-top: 1px solid var(--line-l); }
.quotelist a {
  display: grid; grid-template-columns: 92px 1fr 150px 110px 150px; align-items: center; gap: 16px;
  padding: 14px 18px; color: inherit; text-decoration: none;
}
.quotelist a:hover { background: #fafaf8; }
.quotelist a:hover strong { color: var(--blue-d); }
.ql-num { font: 500 13px var(--mono); color: var(--muted); }
.ql-main { display: flex; flex-direction: column; min-width: 0; }
.ql-main strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-date { color: var(--muted); font-size: 13px; }
.ql-total { text-align: right; font-size: 16px; display: flex; flex-direction: column; }
.ql-total small { font: 400 11px var(--sans); }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ---------- panelen ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; }
.panel > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 14px; padding: 14px 18px; }
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::after { content: "+"; margin-left: auto; font: 500 20px/1 var(--mono); color: var(--muted); }
.panel[open] > summary::after { content: "–"; }
.panel > .fields { padding: 0 18px 18px; }
.panel-label { font: 700 12px var(--cond); text-transform: uppercase; letter-spacing: .08em; color: var(--blue-d); }
.cust-sum { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel.static { padding: 20px; }
.panel.static h2 { margin: 22px 0 6px; }
.panel.static h2:first-of-type { margin-top: 0; }

/* ---------- offerte bewerken ---------- */
.quotehead { align-items: center; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 14px; width: 100%; }
.back:hover { color: var(--ink); }
.qh-title { display: flex; align-items: baseline; gap: 12px; flex: 1 1 380px; min-width: 0; }
.qnum { font: 500 14px var(--mono); color: var(--muted); white-space: nowrap; }
.title-input {
  border: 0; border-bottom: 2px dashed transparent; border-radius: 0; padding: 2px 0; background: transparent;
  font: 700 26px var(--slab); letter-spacing: -.01em;
}
.title-input:hover { border-bottom-color: var(--line); }
.title-input:focus { outline: 0; border-bottom-color: var(--blue); }
.qh-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qh-actions form { margin: 0; }
.status-select { width: auto; font: 700 13px var(--cond); text-transform: uppercase; letter-spacing: .08em; border-width: 2px; height: 40px; border-color: currentColor; }

.quote-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.quote-side { position: sticky; top: 92px; }

.section { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; overflow: hidden; }
.section-head {
  display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 0; background: var(--char); color: #fff;
}
.section-head::before { content: ""; align-self: stretch; width: 6px; background: var(--blue); margin-right: 8px; }
.section-name {
  flex: 1; background: transparent; border: 0; color: #fff; padding: 6px 4px;
  font: 700 15px var(--cond); text-transform: uppercase; letter-spacing: .08em;
}
.section-name:focus { outline: 1px dashed rgba(255,255,255,.5); }
.section-head .iconbtn { color: #aeb3b9; }
.section-head .iconbtn:hover { background: rgba(255,255,255,.1); color: #fff; }
.section-sub { font: 500 15px var(--mono); padding: 0 8px; white-space: nowrap; }

.lines-head, .line {
  display: grid; grid-template-columns: minmax(0, 1fr) 62px 122px 62px 86px 100px 84px; gap: 8px; align-items: center; padding: 0 12px;
}
.lines-head { font: 700 11px var(--cond); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-l); }
.lines-head .r, .line .r { text-align: right; }
.line { padding-top: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line-l); }
.line:hover { background: #fbfbf9; }
.line input, .line select { border-color: transparent; background: transparent; padding: 7px 6px; height: 36px; }
.line input:hover, .line select:hover { border-color: var(--line); background: #fff; }
.line input:focus, .line select:focus { background: #fff; }
.line .l-desc { font-weight: 500; }
.line .l-price { text-align: right; font-family: var(--mono); }
.line .l-len { text-align: right; font-family: var(--mono); }
.line .l-total { text-align: right; font-size: 15px; }
.l-at { display: none; }
.line .l-acts { display: flex; justify-content: flex-end; opacity: .35; }
.line:hover .l-acts, .line:focus-within .l-acts { opacity: 1; }
.line .l-acts .iconbtn { padding: 5px; }

.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r); background: #fff; height: 36px; }
.stepper button { border: 0; background: none; width: 34px; height: 100%; font: 500 18px var(--mono); color: var(--muted); cursor: pointer; flex: none; }
.stepper button:hover { color: var(--ink); background: var(--line-l); }
.stepper input { text-align: center; border: 0 !important; padding: 0 2px !important; height: 100% !important; font: 700 15px var(--mono); background: transparent !important; }
.stepper:focus-within { outline: 2px solid var(--blue); outline-offset: -1px; }

.section-foot { display: flex; gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
.section-empty { padding: 14px 12px 4px; color: var(--muted); font-size: 14px; }
.add-section { width: 100%; height: 48px; border-style: dashed; margin-bottom: 16px; }

.summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.summary h2 { margin-bottom: 10px; }
.summary ol { list-style: none; margin: 0 0 12px; padding: 0; }
.summary li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dotted var(--line); font-size: 14px; }
.summary li a { color: inherit; text-decoration: none; }
.summary li a:hover { color: var(--blue-d); }
.summary li.zero { color: #a9adb2; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin: 0 0 14px; align-items: center; }
.totals dt { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.totals dd { margin: 0; text-align: right; }
.totals dt input { width: 46px; padding: 3px 5px; text-align: right; font: 500 13px var(--mono); }
.totals .grand { font-size: 19px; color: var(--ink); font-weight: 700; border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 4px; }
.totals dt.grand { font: 700 13px var(--cond); text-transform: uppercase; letter-spacing: .06em; }
.summary .check { font-size: 13px; align-items: flex-start; }
.mobile-total { display: none; }

/* ---------- sheets (dialogen) ---------- */
dialog.sheet {
  width: min(760px, 100vw - 32px); max-height: min(86vh, 900px); padding: 0; border: 0; border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35); display: none; flex-direction: column; color: var(--ink);
}
dialog.sheet[open] { display: flex; }
dialog.sheet.narrow { width: min(560px, 100vw - 32px); }
dialog::backdrop { background: rgba(29,33,38,.55); }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 4px solid var(--blue); margin: 0; }
.sheet-head p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.sheet-tools { padding: 12px 20px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line-l); }
.sheet-tools .search { flex: none; }
.search-row .search { flex: 1; }
.sheet-tools .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.sheet-body { overflow-y: auto; padding: 8px 20px 16px; flex: 1; }
.sheet-body.fields { padding-top: 16px; }
.sheet-foot { padding: 12px 20px calc(12px + var(--safe-b)); border-top: 1px solid var(--line-l); display: flex; gap: 10px; align-items: flex-end; }
.sheet-foot.split label { flex: 0 1 200px; }
.grow { flex: 1; }
.search-row { display: flex; gap: 8px; }

.pick-group { font: 700 11px var(--cond); text-transform: uppercase; letter-spacing: .08em; color: var(--blue-d); padding: 14px 0 4px; border-bottom: 1px solid var(--line-l); }
.pick {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; width: 100%;
  padding: 10px 6px; border: 0; border-bottom: 1px solid var(--line-l); background: none; text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.pick:hover { background: var(--blue-l); }
.pick .p-name { font-weight: 500; }
.pick .p-meta { color: var(--muted); font-size: 13px; }
.pick .p-add { width: 30px; height: 30px; border-radius: 50%; background: var(--char); color: #fff; display: grid; place-items: center; }
.pick .p-add .i { width: 16px; height: 16px; }
.pick.added { background: #e7f6ed; }
.pick.added .p-add { background: var(--green); }
.pick-count { font: 700 12px var(--mono); color: var(--green); }

/* ---------- materialen ---------- */
.refreshbar { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin: -6px 0 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.matlist .cat { margin-bottom: 22px; }
.matlist h2 { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--char); color: #fff; border-radius: var(--r) var(--r) 0 0; font: 700 15px var(--cond); text-transform: uppercase; letter-spacing: .08em; }
.matlist h2::before { content: ""; width: 6px; align-self: stretch; background: var(--blue); margin: -8px 4px -8px -12px; border-radius: var(--r) 0 0 0; }
.matlist h2 small { color: #aeb3b9; font: 500 12px var(--mono); }
.mat-table { background: var(--card); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r) var(--r); }
.mat-grp { font: 700 11px var(--cond); text-transform: uppercase; letter-spacing: .08em; color: var(--blue-d); padding: 12px 14px 4px; }
.mat {
  display: grid; grid-template-columns: minmax(0,1fr) 80px 60px 120px 110px; gap: 12px; align-items: center;
  padding: 9px 14px; border-top: 1px solid var(--line-l); cursor: pointer;
}
.mat:hover { background: var(--blue-l); }
.mat .m-name { font-weight: 500; }
.mat .r { text-align: right; }
.mat .m-unit, .mat .m-len { color: var(--muted); font-size: 13px; }
.mat .m-price { font-size: 15px; }
.mat .m-pm { color: var(--muted); font-size: 13px; }
.mat.archived { opacity: .45; }
.badge { display: inline-flex; align-items: center; gap: 4px; font: 500 11px var(--sans); color: var(--blue-d); background: var(--blue-l); border-radius: 99px; padding: 2px 8px; margin-left: 6px; white-space: nowrap; }
.badge .i { width: 12px; height: 12px; }
.badge.old { color: var(--amber); background: #fdf3e1; }

.th-result { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 11px 6px; border: 0; border-bottom: 1px solid var(--line-l); background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.th-result:hover { background: var(--blue-l); }
.th-product { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; padding: 12px 0; }
.th-product img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--r); background: var(--line-l); }
.th-product h3 { margin: 0 0 4px; font: 700 17px var(--slab); }
.th-product p { margin: 0; color: var(--muted); font-size: 13px; }
.th-name { margin: 10px 0; }
.variant { display: grid; grid-template-columns: 26px 1fr auto auto; gap: 12px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line-l); cursor: pointer; font: 400 14px var(--sans); text-transform: none; letter-spacing: 0; color: var(--ink); }
.variant input { width: 18px; height: 18px; accent-color: var(--blue-d); }
.variant .v-shop { color: var(--muted); font-size: 13px; }
.variant .v-calc { font-size: 15px; }
.variant.have { color: var(--muted); }
.loading { padding: 30px 0; text-align: center; color: var(--muted); }
.loading::before { content: ""; display: block; width: 26px; height: 26px; margin: 0 auto 10px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- instellingen ---------- */
.settings { display: grid; gap: 16px; max-width: 860px; }
.cat-table { width: 100%; border-collapse: collapse; }
.cat-table th { text-align: left; font: 700 11px var(--cond); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px; }
.cat-table td { padding: 4px 6px; border-top: 1px solid var(--line-l); }
.cat-table .w-sort { width: 70px; }
.cat-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--red); }
.userlist { list-style: none; padding: 0; margin: 0 0 18px; }
.userlist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-l); }
.userlist li span { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.userlist li form, .userlist li em { margin-left: auto; color: var(--muted); }

/* ---------- login ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--paper); }
.login { width: 100%; max-width: 420px; background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.12); }
.login-head { background: var(--blue); }
.login-head img { display: block; width: 100%; height: auto; padding: 22px 22px 18px; }
.login-form { padding: 26px; display: grid; gap: 16px; }
.login-form h1 { font-size: 22px; }
.login-form input { height: 46px; font-size: 16px; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r); font-size: 14px; transition: .2s; z-index: 100; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--red); }

/* ---------- tablet ---------- */
@media (max-width: 1020px) {
  .quote-grid { grid-template-columns: 1fr; }
  .quote-side { position: static; }
  .quotelist a { grid-template-columns: 80px 1fr 110px 130px; }
  .ql-date { display: none; }
}

/* ---------- telefoon ---------- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .topbar-in { padding: 8px 14px 6px; }
  .brand img { height: 34px; }
  .mainnav {
    position: fixed; left: 0; right: 0; bottom: 0; margin: 0; gap: 0; z-index: 30;
    background: var(--ink); padding: 4px 6px calc(4px + var(--safe-b));
  }
  .mainnav a { flex: 1; flex-direction: column; gap: 3px; padding: 8px 4px; font-size: 11px; border-radius: 4px; color: #b9bec4; }
  .mainnav a.on { background: transparent; color: var(--blue); }
  .mainnav .i { width: 22px; height: 22px; }
  .wrap { padding: 16px 14px calc(96px + var(--safe-b)); }
  h1 { font-size: 23px; }
  .fields { grid-template-columns: 1fr 1fr; gap: 12px; }
  .fields .span2 { grid-column: 1 / -1; }
  input, select, textarea { font-size: 16px; }

  .pagehead .btn span { display: none; }
  .pagehead .btn.primary span { display: inline; }
  .ph-actions .btn span { display: none; }

  .quotelist a { grid-template-columns: 1fr auto; grid-template-areas: "main total" "num stamp"; gap: 6px 12px; padding: 14px; }
  .ql-main { grid-area: main; }
  .ql-total { grid-area: total; }
  .ql-num { grid-area: num; }
  .quotelist .stamp { grid-area: stamp; justify-self: end; }

  .qh-title { flex-basis: 100%; }
  .title-input { font-size: 21px; }
  .qh-actions { width: 100%; }
  .qh-actions .status-select { flex: 1; }
  .qh-actions .btn span { display: none; }

  .section-head .iconbtn.mv { display: none; }

  .mobile-total {
    display: flex; justify-content: space-between; align-items: center; position: fixed; left: 0; right: 0;
    bottom: calc(58px + var(--safe-b)); background: var(--blue); color: #fff; padding: 10px 16px; z-index: 25;
    font: 700 12px var(--cond); text-transform: uppercase; letter-spacing: .06em;
  }
  .mobile-total strong { font-size: 18px; }
  .page-quote .wrap { padding-bottom: calc(150px + var(--safe-b)); }

  dialog.sheet, dialog.sheet.narrow {
    width: 100vw; max-width: 100vw; height: calc(100dvh - 40px); max-height: none; margin: auto 0 0; border-radius: 14px 14px 0 0;
  }
  .sheet-foot.split { flex-wrap: wrap; }
  .sheet-foot.split label { flex: 1 1 40%; }

  .mat { grid-template-columns: 1fr auto; grid-template-areas: "name price" "meta pm"; gap: 2px 10px; }
  .mat .m-name { grid-area: name; }
  .mat .m-price { grid-area: price; }
  .mat .m-pm { grid-area: pm; }
  .mat .m-meta { grid-area: meta; }
  .mat .m-len, .mat .m-unit { display: none; }
  #toast { bottom: calc(120px + var(--safe-b)); }
}
@media (min-width: 721px) { .mat .m-meta { display: none; } }

/* regels: kaartweergave als het onderdeel smal is (telefoon of smal venster) */
.section { container-type: inline-size; }
@container (min-width: 700px) {
  .line .l-meta { display: contents; }
  .line > *, .line .l-meta > * { grid-row: 1; }
  .line .l-desc { grid-column: 1; }
  .line .l-len { grid-column: 2; }
  .line .l-qty { grid-column: 3; }
  .line .l-unit { grid-column: 4; }
  .line .l-price { grid-column: 5; }
  .line .l-total { grid-column: 6; }
  .line .l-acts { grid-column: 7; }
}
@container (max-width: 699px) {
  .lines-head { display: none; }
  .line {
    grid-template-columns: 1fr auto; grid-template-areas:
      "desc desc"
      "qty total"
      "meta acts";
    gap: 6px 10px; padding: 12px;
  }
  .line .l-desc { grid-area: desc; font-size: 16px; padding-left: 0; }
  .line .l-qty { grid-area: qty; max-width: 150px; }
  .line .l-total { grid-area: total; font-size: 17px; align-self: center; }
  .line .l-meta { grid-area: meta; display: flex; gap: 6px; align-items: center; }
  .line { grid-template-columns: minmax(0, 1fr) auto; }
  .line .l-meta { min-width: 0; }
  .line .l-meta input, .line .l-meta select { border-color: var(--line-l); width: 64px; height: 36px; font-size: 14px; padding: 6px; }
  .line .l-meta .l-unit { width: 72px; }
  .line .l-meta .l-price { width: 84px; }
  .line .l-acts { grid-area: acts; opacity: 1; }
  .line .l-acts .mv { display: none; }
  .stepper { height: 42px; }
  .stepper button { width: 42px; }
  .line .l-at { display: inline; color: var(--muted); font-size: 13px; white-space: nowrap; }
}
.panel.static > .fields, .panel.static form.fields { padding: 0; }

/* ---------- Moneybird ---------- */
.mb-box { border-top: 1px solid var(--line-l); margin: 4px 0 14px; padding-top: 14px; display: grid; gap: 8px; }
.mb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mb-logo { font: 700 12px var(--cond); text-transform: uppercase; letter-spacing: .08em; color: #1f5ca8; }
.mb-state { font: 500 12px var(--sans); color: var(--muted); text-align: right; }
.mb-state b { color: var(--ink); }
.mb-open { font-size: 13px; text-align: center; }
.mb-search { padding: 0 18px 14px; position: relative; }
.mb-results { display: grid; }
.mb-results:not(:empty) { border: 1px solid var(--line); border-radius: var(--r); margin-top: 6px; max-height: 260px; overflow-y: auto; }
.mb-hit { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line-l); background: #fff; padding: 9px 12px; cursor: pointer; font: inherit; color: inherit; }
.mb-hit:hover { background: var(--blue-l); }
.mb-hit small { display: block; }
.mb-connected { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.mb-connected .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.steps { margin: 0 0 14px; padding-left: 20px; line-height: 1.7; }
