@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #151922;
  --muted: #6b7280;
  --line: #e6e8ee;
  --accent: #F54325;
  --accent-2: #d9371b;
  --danger: #F54325;
  --soft-red: #fff1f2;
  --soft-red-2: #ffe4e6;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Arial, sans-serif; color: var(--text); background: radial-gradient(circle at top left, #fff5f5 0, #f6f7f9 360px); }
.app-shell { display: grid; grid-template-columns: 370px 1fr; min-height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 22px; overflow-y: auto; box-shadow: 8px 0 24px rgba(15,23,42,.035); }
.brand { display:flex; align-items:center; gap:12px; margin-bottom:24px; padding-bottom:18px; border-bottom:1px solid var(--line); }
.brand-logo-link { display:block; line-height:0; border-radius:10px; }
.brand-logo-link:focus-visible { outline:3px solid var(--accent-2); outline-offset:3px; }
.brand-logo { width:124px; max-height:48px; object-fit:contain; display:block; }
.brand-mark { width:42px; height:42px; border-radius:12px; background:var(--accent); color:#fff; display:grid; place-items:center; font-weight:800; }
.brand strong { letter-spacing:.01em; }
.brand span { display:block; color:var(--muted); font-size:13px; margin-top:2px; }
.upload-box { border:2px dashed #f3a0a6; border-radius:20px; padding:24px; display:flex; flex-direction:column; gap:8px; align-items:center; text-align:center; cursor:pointer; background:linear-gradient(180deg,#fff,#fff7f8); margin-bottom:18px; transition:.16s ease; }
.upload-box:hover { border-color:var(--accent); box-shadow:0 10px 24px rgba(245,67,37,.08); transform:translateY(-1px); }
.upload-box.dragover { border-color: var(--accent); background:var(--soft-red); }
.upload-box input { display:none; }
.upload-box span { color: var(--muted); font-size:14px; }
.panel { border:1px solid var(--line); border-radius:20px; padding:16px; margin-bottom:18px; background:#fff; box-shadow:0 10px 28px rgba(15,23,42,.035); }
h2 { margin:0 0 12px; font-size:16px; display:flex; align-items:center; gap:8px; }
h2::before { content:""; width:7px; height:18px; border-radius:99px; background:var(--accent); display:inline-block; }
.grid-2 { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; }
label { display:flex; flex-direction:column; gap:6px; color:var(--muted); font-size:13px; }
input[type=number], input[type=text] { width:100%; min-width:0; padding:10px; border:1px solid var(--line); border-radius:12px; font-size:15px; background:#fff; }
input[type=number]:focus, input[type=text]:focus, select:focus { outline:3px solid rgba(245,67,37,.12); border-color:var(--accent); }
.color-tool { flex-direction:row; align-items:center; gap:8px; color:var(--muted); font-weight:700; }
.color-tool select { min-width:190px; height:38px; padding:7px 10px; border:1px solid var(--line); border-radius:12px; background:#fff; font-weight:700; color:#111827; }
.btn { border:1px solid var(--line); background:#fff; border-radius:13px; padding:10px 14px; font-weight:800; cursor:pointer; transition:.14s ease; }
.btn:hover { transform: translateY(-1px); border-color:#ffb6aa; box-shadow:0 8px 18px rgba(15,23,42,.06); }
.btn.primary { background:var(--accent); color:#fff; border-color:var(--accent); box-shadow:0 10px 20px rgba(245,67,37,.18); }
.btn.primary:hover { background:var(--accent-2); border-color:var(--accent-2); }
.btn.secondary { width:100%; margin-top:12px; }
.workspace { display:flex; flex-direction:column; min-width:0; }
.topbar { display:flex; justify-content:space-between; gap:20px; align-items:center; padding:20px 24px; background:rgba(255,255,255,.96); border-bottom:1px solid var(--line); box-shadow:0 8px 24px rgba(15,23,42,.035); }
h1 { margin:0; font-size:24px; letter-spacing:-.02em; }
p { margin:5px 0 0; color:var(--muted); }
.toolbar { display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; }
.canvas-wrap { position:relative; flex:1; padding:24px; overflow:auto; }
.canvas-stage { display:flex; align-items:flex-start; gap:14px; min-width:max-content; }
.canvas-panel { position:relative; }
canvas { background:#fff; border:1px solid var(--line); border-radius:22px; cursor:grab; box-shadow:0 18px 50px rgba(15,23,42,.08); }
.hint { position:absolute; left:42px; bottom:38px; background:rgba(255,255,255,.92); border:1px solid var(--line); border-radius:999px; padding:8px 14px; color:var(--muted); font-size:13px; }
.parts-list.empty { color:var(--muted); font-size:14px; }
.part-item { border:1px solid var(--line); border-radius:14px; padding:11px; margin-bottom:9px; cursor:pointer; display:flex; justify-content:space-between; gap:8px; align-items:center; }
.part-item.active { border-color:var(--accent); background:var(--soft-red); box-shadow:inset 4px 0 0 var(--accent); }
.part-title { font-weight:700; font-size:14px; word-break:break-word; }
.part-meta { color:var(--muted); font-size:12px; margin-top:3px; }
.remove { color:var(--danger); border:0; background:transparent; cursor:pointer; font-weight:800; }
@media (max-width: 900px) { .app-shell { grid-template-columns:1fr; } .sidebar { border-right:0; border-bottom:1px solid var(--line); } .topbar { flex-direction:column; align-items:flex-start; } }
.btn.active { background:var(--soft-red); border-color:var(--accent); color:var(--accent); }
canvas.entity-mode { cursor: crosshair; }
canvas.dragover { border-color: var(--accent); box-shadow:0 0 0 4px rgba(245,67,37,.14), 0 10px 30px rgba(15,23,42,.08); }
canvas.dragover + .hint::before { content:'Laat los om bestand te importeren · '; color:#111827; font-weight:800; }
.scale-tool { display:flex; align-items:center; gap:7px; font-size:13px; color:#475569; }
.scale-tool input { width:76px; padding:8px; border:1px solid #dbe4ee; border-radius:10px; }

.part-main { flex:1; min-width:0; }
.part-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.qty-field { display:flex; flex-direction:column; gap:3px; color:var(--muted); font-size:11px; font-weight:700; }
.qty-field input { width:58px; padding:7px 8px; border:1px solid var(--line); border-radius:10px; font-size:14px; font-weight:700; color:var(--text); }


.vertical-toolbar {
  position:sticky;
  left:0;
  top:12px;
  z-index:5;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:8px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,255,255,.98);
  box-shadow:0 10px 25px rgba(15,23,42,.08);
}
.tool-btn {
  width:54px;
  min-height:52px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  color:#111827;
  cursor:pointer;
  font-size:18px;
  font-weight:800;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:2px;
}
.tool-btn span { font-size:9px; font-weight:800; line-height:1; }
.tool-btn:hover { transform:translateY(-1px); }
.tool-btn.active { background:var(--accent); border-color:var(--accent); color:#fff; box-shadow:0 8px 16px rgba(245,67,37,.18); }
.tool-btn.danger { color:var(--danger); }
@media (max-width: 900px) { .canvas-stage { gap:10px; } .vertical-toolbar { top:10px; } }

.sheets-list { margin-top:12px; display:flex; flex-direction:column; gap:8px; }
.sheet-item { display:flex; align-items:center; justify-content:space-between; gap:8px; border:1px solid var(--line); border-radius:12px; padding:9px 10px; cursor:pointer; background:#fff; }
.sheet-item.active { border-color:var(--accent); background:var(--soft-red); box-shadow:inset 4px 0 0 var(--accent); }
.sheet-title { font-weight:800; font-size:13px; }
.sheet-meta { color:var(--muted); font-size:12px; margin-top:2px; }
.sheet-remove { border:0; background:transparent; color:var(--danger); font-weight:900; cursor:pointer; font-size:16px; }

/* v1.13 UX pass: rustiger, workflow-gebaseerd en dichter bij een productie-editor */
:root { --sidebar-w: 340px; --radius-xl: 24px; --shadow-soft: 0 14px 38px rgba(15,23,42,.07); }
.app-shell { grid-template-columns: var(--sidebar-w) 1fr; background:#f4f6f8; }
.sidebar { padding:18px; background:#fbfcfd; }
.brand { background:#fff; border:1px solid var(--line); border-radius:22px; padding:14px; margin-bottom:16px; box-shadow:0 10px 26px rgba(15,23,42,.04); }
.brand-logo { width:112px; }
.section-title { margin:18px 0 8px; font-size:11px; font-weight:900; letter-spacing:.14em; text-transform:uppercase; color:var(--accent); }
.upload-box { border-radius:22px; min-height:118px; margin-bottom:12px; border-color:#ffb6aa; }
.panel { border-radius:22px; padding:15px; box-shadow:0 8px 24px rgba(15,23,42,.045); }
.panel h2 { font-size:15px; }
.topbar { display:grid; grid-template-columns:minmax(240px, 380px) 1fr; align-items:start; padding:18px 22px; gap:22px; }
.topbar-title { padding:4px 0; }
.eyebrow { color:var(--accent); font-weight:900; font-size:11px; letter-spacing:.12em; text-transform:uppercase; }
h1 { font-size:26px; margin-top:4px; }
.workflow-toolbar { justify-content:flex-end; align-items:stretch; gap:12px; }
.tool-group { background:#fff; border:1px solid var(--line); border-radius:18px; padding:10px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; box-shadow:0 8px 24px rgba(15,23,42,.04); }
.tool-label { width:100%; font-size:10px; font-weight:900; letter-spacing:.12em; text-transform:uppercase; color:#94a3b8; margin:0 0 1px 2px; }
.tool-group .btn { padding:8px 11px; border-radius:11px; }
.laser-group { border-color:#fed7d7; background:linear-gradient(180deg,#fff,#fffafa); }
.export-btn { align-self:stretch; min-width:130px; border-radius:18px; font-size:15px; }
.color-tool { min-width:260px; }
.color-tool select { min-width:220px; border-radius:11px; }
.canvas-wrap { padding:18px 22px 28px; }
.canvas-stage { gap:12px; }
.vertical-toolbar { top:0; border-radius:20px; padding:10px; background:#fff; box-shadow:var(--shadow-soft); }
.tool-btn { width:62px; min-height:58px; border-radius:16px; }
.tool-btn span { font-size:10px; }
.canvas-panel { background:#fff; border:1px solid var(--line); border-radius:26px; padding:14px; box-shadow:var(--shadow-soft); }
canvas { border-radius:18px; box-shadow:none; border:1px solid #dde3eb; }
.hint { left:30px; bottom:28px; border-radius:14px; max-width:760px; line-height:1.35; }
.part-item, .sheet-item { background:#fff; transition:.15s ease; }
.part-item:hover, .sheet-item:hover { border-color:#ffb6aa; transform:translateY(-1px); }
.part-item.active, .sheet-item.active { background:#fff5f6; }
.btn.active { background:#F54325; color:#fff; border-color:#F54325; }
.scale-tool { background:#f8fafc; border:1px solid var(--line); border-radius:11px; padding:5px 8px; }
.scale-tool input { height:32px; }
@media (max-width: 1200px) { .topbar { grid-template-columns:1fr; } .workflow-toolbar { justify-content:flex-start; } }

/* v1.18 UX polish: alleen logo linksboven, titeltekst en Luxigo rood */
.topbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}
.topbar-title {
  max-width: 820px;
}
.main-title-label {
  display: block;
  color: var(--accent);
  font-size: 20px;
  letter-spacing: .045em;
  text-transform: none;
  font-weight: 900;
}
.topbar-title h1 {
  font-size: 15px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: 0;
}
.workflow-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(440px, 1.25fr) minmax(430px, 1.25fr) 160px;
  gap: 14px;
  align-items: stretch;
  justify-content: stretch;
}
.workflow-toolbar .tool-group {
  margin: 0;
  align-content: start;
}
.workflow-toolbar .export-btn {
  width: 100%;
  min-height: 96px;
}
.workflow-toolbar .btn,
.workflow-toolbar select,
.workflow-toolbar input {
  font-size: 14px;
}
@media (max-width: 1450px) {
  .workflow-toolbar { grid-template-columns: 1fr 1fr; }
  .workflow-toolbar .export-btn { min-height: 72px; }
}
@media (max-width: 980px) {
  .workflow-toolbar { grid-template-columns: 1fr; }
}


/* v1.15: materiaal-popup en Luxigo-app importknop */
.small-link {
  display:inline-flex;
  align-items:center;
  width:max-content;
  margin:-4px 0 12px;
  color:var(--accent);
  font-size:12px;
  font-weight:800;
  text-decoration:none;
}
.small-link:hover { text-decoration:underline; }
.export-stack { display:flex; flex-direction:column; gap:10px; min-width:160px; }
.workflow-toolbar .export-stack .export-btn { min-height:64px; width:100%; }
.import-btn { width:100%; border-color:#ffb6aa; background:#fff5f6; color:var(--accent); }
.import-btn:hover { border-color:var(--accent); box-shadow:0 10px 20px rgba(245,67,37,.10); }
.quote-btn { width:100%; text-align:center; text-decoration:none; border-color:#ffb6aa; background:#fff; color:var(--accent); }
.project-name-field { gap:6px; font-weight:800; color:var(--text); font-size:12px; }
.project-name-field input { height:40px; font-size:14px; font-weight:700; color:var(--text); }
.quote-btn:hover { border-color:var(--accent); background:#fff5f6; box-shadow:0 10px 20px rgba(245,67,37,.08); }
.modal-overlay {
  position:fixed;
  inset:0;
  z-index:1000;
  display:none;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(15,23,42,.54);
}
.modal-overlay.open { display:flex; }
.modal-card {
  width:min(1120px, 96vw);
  height:min(820px, 92vh);
  background:#fff;
  border-radius:24px;
  box-shadow:0 24px 70px rgba(15,23,42,.28);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  border:1px solid rgba(255,255,255,.7);
}
.modal-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px 18px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,#fff,#fff7f8);
}
.modal-header strong { display:block; font-size:18px; }
.modal-header span { display:block; color:var(--muted); font-size:13px; margin-top:2px; }
.modal-close {
  width:42px;
  height:42px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  color:var(--text);
  font-size:28px;
  line-height:1;
  cursor:pointer;
}
.modal-close:hover { color:var(--accent); border-color:#ffb6aa; }
#materialsFrame { flex:1; width:100%; border:0; background:#fff; }
.modal-footer { padding:10px 18px 14px; border-top:1px solid var(--line); background:#fff; }
@media (max-width:1450px){ .workflow-toolbar { grid-template-columns: 1fr 1fr; } .export-stack { min-width:0; } }
@media (max-width:980px){ .export-stack { width:100%; } }

.btn:disabled, .tool-btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.3); }


/* v1.18: logo-only sidebar header */
.brand { justify-content:flex-start; padding:16px; }
.brand-logo-link { border-radius:14px; }
.brand-logo { width:176px; max-height:72px; }
@media (max-width: 900px) { .brand-logo { width:156px; } }

/* v1.24 stable: gelijke marge links/rechts en laatste layout-polish */
.app-shell {
  width: calc(100% - 48px);
  max-width: 1880px;
  margin: 0 auto;
  min-height: 100vh;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  box-shadow: 0 18px 60px rgba(15,23,42,.055);
}
.workspace {
  min-width: 0;
}
.topbar {
  padding-right: 28px;
}
.canvas-wrap {
  padding-right: 28px;
}
.workflow-toolbar {
  width: 100%;
}
.export-stack {
  min-width: 170px;
}
@media (max-width: 900px) {
  .app-shell {
    width: 100%;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }
  .topbar,
  .canvas-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* v1.25 stable: definitieve bovenbalk-layout */
.topbar {
  padding: 28px 32px 22px;
  gap: 20px;
}
.topbar-title {
  max-width: 980px;
}
.workflow-toolbar {
  display: grid;
  grid-template-columns: 310px minmax(420px, 1fr) 390px 240px;
  gap: 18px;
  align-items: stretch;
  width: 100%;
}
.workflow-toolbar .tool-group,
.workflow-toolbar .export-stack {
  min-width: 0;
  border-radius: 20px;
  min-height: 170px;
}
.workflow-toolbar .tool-group {
  padding: 16px;
  align-content: start;
}
.workflow-toolbar .tool-group:first-child {
  align-items: flex-start;
}
.workflow-toolbar .tool-group:first-child .btn {
  white-space: nowrap;
}
.workflow-toolbar .laser-group {
  max-width: 390px;
}
.color-tool {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
}
.color-tool select {
  width: 100%;
  min-width: 0;
}
.export-stack {
  background: #fff;
  border: 1px solid #fed7d7;
  box-shadow: 0 8px 24px rgba(15,23,42,.04);
  padding: 16px;
  gap: 12px;
}
.export-stack::before {
  content: 'Export';
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0;
}
.project-name-field input {
  height: 44px;
}
.workflow-toolbar .export-stack .export-btn,
.workflow-toolbar .export-stack .import-btn,
.workflow-toolbar .export-stack .quote-btn {
  min-height: 52px;
  width: 100%;
  border-radius: 16px;
}
.workflow-toolbar .export-stack .export-btn {
  min-height: 64px;
}
.canvas-wrap {
  padding: 22px 32px 34px;
}
.canvas-stage {
  gap: 18px;
}
.canvas-panel {
  padding: 18px;
}
.vertical-toolbar {
  margin-top: 0;
}
@media (max-width: 1680px) {
  .workflow-toolbar {
    grid-template-columns: 300px minmax(390px, 1fr) 350px 230px;
    gap: 14px;
  }
  .workflow-toolbar .laser-group { max-width: 350px; }
}
@media (max-width: 1450px) {
  .workflow-toolbar {
    grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.25fr) minmax(320px, 1fr);
  }
  .export-stack {
    grid-column: 1 / -1;
    min-height: 0 !important;
    display: grid;
    grid-template-columns: 160px 1fr 1fr 1fr;
    align-items: end;
  }
  .export-stack::before { display:none; }
  .project-name-field { align-self: stretch; justify-content: end; }
}
@media (max-width: 980px) {
  .workflow-toolbar { grid-template-columns: 1fr; }
  .export-stack { display:flex; }
}

/* v1.26 stable: rustige editor-layout met focus op het werkgebied */
.app-shell {
  grid-template-columns: 360px minmax(0, 1fr);
}
.sidebar {
  padding: 22px 20px;
}
.workspace {
  min-width: 0;
}
.topbar {
  padding: 28px 34px 18px;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.topbar-title {
  max-width: 980px;
}
.main-title-label {
  font-size: 22px;
  line-height: 1.15;
}
.topbar-title h1 {
  margin: 4px 0 4px;
}
.topbar-title p {
  margin: 0;
}
.workflow-toolbar {
  display: grid;
  grid-template-columns: minmax(420px, 620px) 260px;
  justify-content: space-between;
  align-items: stretch;
  gap: 18px;
  max-width: 100%;
}
/* Deze functies staan al in de verticale toolbar of zijn minder belangrijk voor de stabiele V1. */
.workflow-toolbar > .tool-group:nth-of-type(1),
.workflow-toolbar > .tool-group:nth-of-type(2) {
  display: none !important;
}
.workflow-toolbar .laser-group {
  max-width: none;
  min-height: 0;
  padding: 16px;
  display: grid;
  grid-template-columns: auto auto minmax(240px, 1fr);
  align-items: center;
  gap: 12px;
  border-radius: 20px;
}
.workflow-toolbar .laser-group .tool-label {
  grid-column: 1 / -1;
  margin-bottom: 0;
}
.workflow-toolbar .laser-group .btn {
  white-space: nowrap;
}
.color-tool {
  width: 100%;
  grid-template-columns: 74px minmax(0, 1fr);
}
.export-stack {
  min-height: 0 !important;
  padding: 16px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.export-stack::before {
  display: block;
  content: 'Export';
}
.workflow-toolbar .export-stack .export-btn,
.workflow-toolbar .export-stack .import-btn,
.workflow-toolbar .export-stack .quote-btn {
  min-height: 46px;
  border-radius: 14px;
  font-size: 14px;
}
.workflow-toolbar .export-stack .export-btn {
  min-height: 56px;
}
.project-name-field input {
  height: 42px;
}
.canvas-wrap {
  padding: 22px 34px 36px;
  overflow: auto;
}
.canvas-stage {
  gap: 16px;
}
.canvas-panel {
  padding: 16px;
  border-radius: 24px;
}
.vertical-toolbar {
  top: 0;
}
@media (max-width: 1350px) {
  .workflow-toolbar {
    grid-template-columns: 1fr;
  }
  .workflow-toolbar .laser-group {
    grid-template-columns: auto auto minmax(220px, 1fr);
  }
  .export-stack {
    max-width: 520px;
  }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .workflow-toolbar .laser-group { grid-template-columns: 1fr; }
  .topbar, .canvas-wrap { padding-left: 18px; padding-right: 18px; }
}

/* v1.27 stable: rustiger canvas, stappen links, RDWorks-kleurblokjes */
.app-shell {
  grid-template-columns: 360px minmax(0, 1fr);
}
.topbar.minimal-topbar {
  padding: 28px 36px 16px;
  background:#fff;
  border-bottom:1px solid var(--line);
}
.hidden-controls {
  display:none !important;
}
.workflow-toolbar,
.workflow-toolbar .laser-group,
.workflow-toolbar .export-stack {
  display:none !important;
}
.canvas-wrap {
  padding: 20px 36px 36px;
}
.canvas-stage {
  gap: 16px;
}
.canvas-panel {
  padding: 18px;
  border-radius: 24px;
}
.sidebar {
  padding-bottom: 32px;
}
.compact-panel {
  padding: 14px;
}
.button-row {
  display:grid;
  gap:8px;
  margin-bottom:8px;
}
.button-row.two {
  grid-template-columns:1fr 1fr;
}
.scale-row {
  display:grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap:8px;
  align-items:end;
  margin-top:10px;
}
.scale-row .btn { padding:10px 9px; }
.shape-buttons {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:10px;
}
.shape-buttons .btn:first-child {
  grid-column: 1 / -1;
}
.export-panel .export-btn,
.export-panel .import-btn,
.export-panel .quote-btn {
  width:100%;
  min-height:46px;
  margin-top:10px;
  border-radius:14px;
}
.export-panel .export-btn {
  min-height:56px;
}
.rdworks-palette {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-bottom:12px;
}
.color-swatch {
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:12px;
  padding:9px 10px;
  font-weight:800;
  cursor:pointer;
  text-align:left;
}
.color-swatch span {
  width:22px;
  height:22px;
  border-radius:6px;
  border:1px solid rgba(15,23,42,.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
  flex:0 0 auto;
}
.color-swatch:hover {
  border-color:#ffb6aa;
  transform:translateY(-1px);
}
.color-swatch.active {
  border-color:var(--accent);
  background:#fff5f6;
  box-shadow:0 0 0 3px rgba(245,67,37,.10);
}
.layer-info {
  list-style:none;
  padding:0;
  margin:8px 0 0;
  display:flex;
  flex-direction:column;
  gap:7px;
  color:var(--muted);
  font-size:12px;
}
.layer-info li {
  display:flex;
  align-items:center;
  gap:7px;
}
.layer-info strong { color:var(--text); }
.dot {
  width:10px;
  height:10px;
  border-radius:999px;
  display:inline-block;
  flex:0 0 auto;
}
.dot.black { background:#111827; }
.dot.red { background:#F54325; }
.dot.green { background:#22c55e; }
.dot.blue { background:#3b82f6; }
.visually-hidden {
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}
.mini-result {
  margin:10px 0 0;
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}
.vertical-toolbar {
  top: 0;
}
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { max-height: none; }
  .canvas-wrap { padding-left:18px; padding-right:18px; }
}

/* v1.28 stable: editor-focus, toolbar drawers, kleuren onder werkgebied */
.topbar.minimal-topbar { padding-bottom: 10px; }
.canvas-stage { align-items: flex-start; }
.toolbar-drawer {
  position: sticky;
  top: 0;
  z-index: 4;
  width: 280px;
  flex: 0 0 280px;
  display: none;
}
.toolbar-drawer.open { display: block; }
.drawer-panel {
  display: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 14px 34px rgba(15,23,42,.075);
}
.drawer-panel.active { display: block; }
.drawer-panel h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text);
}
.drawer-panel h3::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 16px;
  border-radius: 999px;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: -3px;
}
.drawer-scale { grid-template-columns: minmax(0,1fr) auto auto; }
.matrix-apply { width: 100%; margin-top: 12px; }
.canvas-panel { display: flex; flex-direction: column; gap: 12px; }
.canvas-layerbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 12px;
}
.layerbar-title {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #94a3b8;
}
.rdworks-palette.horizontal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.rdworks-palette.horizontal .color-swatch {
  min-width: 160px;
  padding: 8px 10px;
}
.color-swatch small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  margin-left: auto;
}
/* kleurenpanel staat nu onder het werkgebied, niet meer in de sidebar */
.sidebar .rdworks-palette, .sidebar .layer-info { display: none; }
/* v1.28: sidebar is weer alleen stappen 1-4 */
.sidebar .compact-panel:has(#checkDuplicateLines) { margin-top: 0; }
@media (max-width: 1300px) {
  .toolbar-drawer { width: 240px; flex-basis: 240px; }
  .rdworks-palette.horizontal .color-swatch { min-width: 135px; }
}
@media (max-width: 900px) {
  .toolbar-drawer { position: static; width: 100%; flex-basis: auto; }
  .canvas-stage { flex-direction: column; }
  .vertical-toolbar { flex-direction: row; flex-wrap: wrap; position: static; }
  .canvas-layerbar { grid-template-columns: 1fr; }
}

/* v1.30 final polish */
.top-instruction-link {
  display:inline-flex;
  width:max-content;
  margin-top:8px;
  color:var(--accent);
  font-size:13px;
  font-weight:800;
  text-decoration:none;
}
.top-instruction-link:hover { text-decoration:underline; }
#instructionsFrame { flex:1; width:100%; border:0; background:#fff; }
.convert-status {
  display: none;
  margin: 10px 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(245, 67, 37, .25);
  border-radius: 12px;
  background: rgba(245, 67, 37, .06);
  color: #7f1d1d;
  font-size: 13px;
  line-height: 1.35;
}


/* v1.36 - maatvelden in onderdelenlijst */
.dimension-fields { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:8px; }
.dimension-fields label { display:flex; flex-direction:column; gap:3px; color:var(--muted); font-size:11px; font-weight:700; }
.dimension-fields input { min-width:0; width:100%; padding:7px 8px; border:1px solid var(--line); border-radius:10px; font-size:13px; font-weight:700; color:var(--text); box-sizing:border-box; }
.part-main { min-width:0; flex:1; }

/* v1.37 Stable: workflow polish, upload first, safe plate margin */
.upload-panel .upload-box {
  min-height: 156px;
  margin: 8px 0 12px;
  justify-content: center;
}
.upload-panel .upload-box strong {
  font-size: 16px;
}
.file-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.file-badges span {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #ffd0c8;
  border-radius: 999px;
  background: #fff7f5;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
}
.sidebar .section-title {
  margin-top: 16px;
}
.panel .grid-2 label {
  min-width: 0;
}
.canvas-layerbar::after {
  content: 'Rode stippellijn = veilige plaatmarge';
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
@media (max-width: 1200px) {
  .canvas-layerbar::after { display: none; }
}


/* v1.43 Stable - Luxigo App style pass
   Meer in lijn met app.luxigo.nl: Montserrat, rustiger wit/grijs, Luxigo-rood en strakkere panelen. */

:root {
  --bg: #f7f7f7;
  --panel: #ffffff;
  --text: #292524;
  --muted: #78716c;
  --line: #e7e5e4;
  --line-strong: #d6d3d1;
  --accent: #F54325;
  --accent-2: #d9361e;
  --danger: #F54325;
  --soft-red: #fff4f1;
  --soft-red-2: #ffe0da;
  --focus-ring: rgba(245, 67, 37, .16);
  --shadow-card: 0 8px 22px rgba(41, 37, 36, .055);
  --shadow-panel: 0 12px 34px rgba(41, 37, 36, .075);
}

html, body {
  font-family: 'Montserrat', Arial, sans-serif !important;
  background: var(--bg) !important;
  color: var(--text);
  font-size: 14px;
}

body {
  background-image: none !important;
}

.app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  border: 0;
  box-shadow: none;
  background: var(--bg);
  grid-template-columns: 360px minmax(0, 1fr);
}

.sidebar {
  background: #f7f7f7;
  border-right: 1px solid var(--line);
  padding: 22px 20px 28px;
  box-shadow: none;
}

.brand {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 4px 2px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.brand-logo { width: 184px; max-height: 76px; }
.brand-logo-link:hover { opacity: .92; }

.section-title {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  margin: 18px 0 8px;
}

.panel {
  border: 1.4px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  padding: 16px;
  margin-bottom: 16px;
}
.panel h2 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}
h2::before, .drawer-panel h3::before {
  background: var(--accent);
  width: 5px;
  height: 17px;
}

.upload-box {
  border: 2px dashed #d6d3d1;
  border-radius: 12px;
  background: #fff;
  min-height: 160px;
  box-shadow: none;
}
.upload-box:hover,
.upload-box.dragover {
  border-color: var(--accent);
  background: #fff7f5;
  box-shadow: 0 0 0 4px var(--focus-ring);
  transform: none;
}
.upload-box strong { color: var(--text); font-weight: 800; }
.upload-box span { color: var(--muted); }
.file-badges span {
  border-color: #ffd0c8;
  background: #fff7f5;
  color: var(--accent);
  font-weight: 800;
}

input[type=number],
input[type=text],
select {
  border: 1.4px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-weight: 600;
}
input[type=number]:focus,
input[type=text]:focus,
select:focus {
  outline: 3px solid var(--focus-ring);
  border-color: var(--accent);
}
label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.btn,
.tool-btn,
.color-swatch {
  font-family: inherit;
  border-radius: 8px;
  border: 1.4px solid var(--line-strong);
  box-shadow: none;
  font-weight: 800;
}
.btn:hover,
.tool-btn:hover,
.color-swatch:hover {
  transform: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.btn.primary,
.tool-btn.active,
.btn.active {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  box-shadow: none;
}
.btn.primary:hover,
.tool-btn.active:hover,
.btn.active:hover {
  background: var(--accent-2) !important;
  border-color: var(--accent-2) !important;
}
.import-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.import-btn:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}
.quote-btn {
  background: #fff;
  color: var(--accent);
  border-color: var(--accent);
}
.quote-btn:hover {
  background: #fff7f5;
}

.workspace { background: #fff; }
.topbar.minimal-topbar,
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 26px 34px 14px;
  box-shadow: none;
}
.main-title-label {
  color: var(--accent);
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0;
}
.topbar-title h1 {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.top-instruction-link,
.small-link {
  color: var(--accent);
  font-weight: 800;
}

.canvas-wrap {
  background: #fff;
  padding: 18px 34px 34px;
}
.canvas-stage { gap: 14px; }
.canvas-panel {
  border: 1.4px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
  background: #fff;
  padding: 14px;
}
canvas {
  border-radius: 8px;
  border: 1.4px solid var(--line-strong);
  box-shadow: none;
}
canvas.dragover {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus-ring);
}
.hint {
  border-radius: 8px;
  border: 1.4px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,.96);
  font-weight: 600;
}

.vertical-toolbar {
  border: 1.4px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  padding: 8px;
  gap: 7px;
}
.tool-btn {
  width: 58px;
  min-height: 54px;
  border-radius: 9px;
  color: var(--text);
}
.tool-btn span {
  font-size: 9px;
  font-weight: 800;
}
.tool-btn.danger { color: var(--accent); }

.canvas-layerbar {
  border: 1.4px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}
.layerbar-title,
.tool-label,
.export-stack::before {
  color: #a8a29e;
  font-weight: 900;
}
.rdworks-palette.horizontal .color-swatch {
  min-width: 154px;
  border-radius: 8px;
  background: #fff;
}
.color-swatch.active {
  border-color: var(--accent);
  background: #fff7f5;
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.color-swatch span { border-radius: 4px; }
.color-swatch small { color: var(--muted); }

.part-item,
.sheet-item {
  border: 1.4px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.part-item:hover,
.sheet-item:hover {
  transform: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.part-item.active,
.sheet-item.active {
  border-color: var(--accent);
  background: #fff7f5;
  box-shadow: inset 3px 0 0 var(--accent);
}
.part-title,
.sheet-title { color: var(--text); font-weight: 800; }
.part-meta,
.sheet-meta { color: var(--muted); }
.dimension-fields input,
.qty-field input {
  border-radius: 8px;
  border: 1.4px solid var(--line);
}

.export-panel .export-btn,
.export-panel .import-btn,
.export-panel .quote-btn {
  border-radius: 8px;
}
.export-panel .export-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.export-panel .export-btn:hover {
  background: var(--accent-2);
}

.modal-card {
  border-radius: 12px;
  box-shadow: 0 22px 60px rgba(41,37,36,.24);
}
.modal-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.modal-close { border-radius: 8px; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
}

.sheet-warning {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 16px 18px;
  border: 1.5px solid rgba(245,67,37,.35);
  background: #fff7f5;
  color: var(--text);
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(245,67,37,.08);
  overflow: hidden;
}
.sheet-warning-copy {
  flex: 1 1 auto;
  min-width: 0;
}
.sheet-warning strong {
  display: block;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 4px;
}
.sheet-warning span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}
.sheet-warning-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  max-width: 260px;
}
.sheet-warning .btn,
.sheet-warning-button {
  width: auto;
  max-width: 100%;
  white-space: nowrap;
  padding: 10px 18px;
}
@media (max-width: 1200px) {
  .sheet-warning {
    flex-direction: column;
    align-items: stretch;
  }
  .sheet-warning-actions {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
  }
  .sheet-warning .btn,
  .sheet-warning-button {
    width: 100%;
  }
}

/* v1.51 stable: 100% layout polish + smart fill progress */
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
.app-shell {
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}
.workspace {
  min-width: 0;
  overflow: hidden;
}
.topbar,
.canvas-wrap {
  max-width: 100%;
  min-width: 0;
}
.canvas-wrap {
  overflow: auto;
  padding-right: 28px !important;
}
.canvas-stage {
  min-width: 0;
  width: max-content;
  max-width: 100%;
}
.canvas-panel {
  max-width: 100%;
}

.sheet-warning {
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  overflow: visible !important;
}
.sheet-warning-copy { width: 100%; }
.sheet-warning-actions {
  width: 100% !important;
  max-width: none !important;
  justify-content: flex-start !important;
}
.sheet-warning .btn,
.sheet-warning-button {
  width: auto !important;
  max-width: 100% !important;
  align-self: flex-start;
}

.smart-fill-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 24, 39, .38);
  backdrop-filter: blur(3px);
}
.smart-fill-overlay.visible { display: flex; }
.smart-fill-card {
  width: min(460px, 100%);
  border-radius: 16px;
  background: #fff;
  border: 1.4px solid var(--line, #e5e7eb);
  box-shadow: 0 24px 80px rgba(17, 24, 39, .22);
  padding: 22px;
  font-family: 'Montserrat', Arial, sans-serif;
}
.smart-fill-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.smart-fill-header strong {
  display: block;
  color: var(--text, #111827);
  font-size: 17px;
  font-weight: 900;
  margin-bottom: 5px;
}
.smart-fill-header span,
.smart-fill-status {
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 700;
}
.smart-fill-progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1f5f9;
  margin: 14px 0 10px;
}
.smart-fill-progress > div {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: var(--accent, #F54325);
  transition: width .16s ease;
}
.smart-fill-card .btn {
  margin-top: 16px;
}


/* v2.0 beta layout polish */
html, body { overflow-x: hidden; }
.app-shell { max-width: 100vw; }
.main, .content, .canvas-wrap { min-width: 0; box-sizing: border-box; }
.canvas-wrap { max-width: 100%; overflow: auto; }
.canvas-stage { max-width: 100%; }
.canvas-panel { max-width: calc(100vw - var(--sidebar-w, 370px) - 130px); overflow: auto; }
.sheet-warning, .nest-warning { align-items: flex-start !important; }
.sheet-warning .btn, .nest-warning .btn, #sheetWarningAddSheet { align-self: flex-start; max-width: 100%; white-space: normal; }
@media (max-width: 1100px){ .canvas-panel { max-width: calc(100vw - 130px); } }

/* v2.2 beta - canvas tip onder werkgebied en clipboard/matrix polish */
.canvas-panel {
  display: flex;
  flex-direction: column;
}
.canvas-panel .hint,
.hint {
  position: static !important;
  left: auto !important;
  bottom: auto !important;
  display: block;
  margin: 12px 0 0 !important;
  max-width: none !important;
  width: fit-content;
  box-sizing: border-box;
  border-radius: 10px !important;
  background: #fff !important;
}
@media (max-width: 900px) {
  .canvas-panel .hint,
  .hint { width: 100%; }
}

/* V2.4 Materiaaloverzicht in Nesting Tool */
.material-open-btn{
  background:transparent;
  border:0;
  padding:0;
  display:inline-flex;
  width:max-content;
  cursor:pointer;
  font:inherit;
}
.material-modal-card{
  width:min(1280px, calc(100vw - 48px));
  max-width:1280px;
  height:min(86vh, 900px);
  display:flex;
  flex-direction:column;
}
.material-modal-card .modal-header span{
  display:block;
  color:#667085;
  font-size:13px;
  margin-top:3px;
  max-width:920px;
  line-height:1.35;
}
.material-modal-body{
  flex:1;
  min-height:0;
  padding:18px 22px;
  display:flex;
  flex-direction:column;
  gap:14px;
  background:#fff;
}
.material-modal-toolbar{
  display:grid;
  grid-template-columns:minmax(360px, 1fr) minmax(150px, 210px) auto;
  gap:12px;
  align-items:end;
}
.material-search-label,
.material-filter-label{
  display:flex;
  flex-direction:column;
  gap:7px;
  font-weight:700;
  color:#1f2937;
  font-size:13px;
  min-width:0;
}
.material-search-wide{
  min-width:320px;
}
.material-search-label input,
.material-filter-label select{
  width:100%;
  height:46px;
  border:1px solid #e4e7ec;
  border-radius:12px;
  padding:0 14px;
  font:inherit;
  outline:none;
  background:#fbfcfd;
}
.material-search-label input:focus,
.material-filter-label select:focus{
  border-color:#F54325;
  box-shadow:0 0 0 4px rgba(245,67,37,.12);
  background:#fff;
}
.small-material-btn{
  height:46px;
  white-space:nowrap;
  width:auto;
  min-width:132px;
  padding-left:18px;
  padding-right:18px;
  justify-content:center;
}
.material-status{
  color:#667085;
  font-size:13px;
  line-height:1.4;
}
.material-status code{
  background:#f2f4f7;
  padding:2px 5px;
  border-radius:5px;
}
.materials-matrix-wrap{
  flex:1;
  min-height:0;
  overflow:auto;
  border:1px solid #eef0f3;
  border-radius:14px;
  background:#fff;
}
.material-matrix{
  width:max-content;
  min-width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:13px;
}
.material-matrix th,
.material-matrix td{
  border-bottom:1px solid #eef0f3;
  border-right:1px solid #f3f4f6;
  padding:10px;
  text-align:left;
  vertical-align:middle;
  background:#fff;
}
.material-matrix thead th{
  position:sticky;
  top:0;
  z-index:4;
  background:#f9fafb;
  color:#667085;
  font-weight:800;
  white-space:nowrap;
}
.material-matrix .sticky-col{
  position:sticky;
  left:0;
  z-index:3;
  min-width:230px;
  background:#fff;
  box-shadow:8px 0 16px rgba(15,23,42,.04);
}
.material-matrix thead .sticky-col{
  z-index:5;
  background:#f9fafb;
}
.material-matrix td:nth-child(2),
.material-matrix th:nth-child(2){
  min-width:80px;
  white-space:nowrap;
}
.material-matrix strong{
  display:block;
  color:#1f2937;
  font-weight:800;
}
.material-matrix small{
  display:block;
  color:#667085;
  font-size:11px;
  margin-top:2px;
}
.empty-price{
  color:#c6cbd3;
  text-align:center!important;
}
.material-price-btn{
  width:100%;
  min-width:118px;
  border:1px solid #ffd0c7;
  background:#fff8f6;
  color:#F54325;
  border-radius:10px;
  padding:9px 10px;
  font-weight:800;
  cursor:pointer;
  transition:.15s ease;
}
.material-price-btn span{
  display:block;
  color:#F54325;
  font-size:14px;
}
.material-price-btn small{
  color:#7a4a42;
  margin-top:3px;
}
.material-price-btn:hover,
.material-price-btn:focus{
  background:#F54325;
  color:#fff;
  border-color:#F54325;
  transform:translateY(-1px);
  box-shadow:0 8px 24px rgba(245,67,37,.18);
}
.material-price-btn:hover span,
.material-price-btn:hover small,
.material-price-btn:focus span,
.material-price-btn:focus small{
  color:#fff;
}
.material-modal-footer{
  justify-content:space-between;
  gap:12px;
  color:#667085;
  font-size:13px;
}
@media (max-width: 760px){
  .material-modal-card{width:calc(100vw - 18px);height:92vh;}
  .material-modal-toolbar{grid-template-columns:1fr;align-items:stretch;}
  .material-search-wide{min-width:0;}
  .small-material-btn{width:100%;}
  .material-modal-footer{align-items:flex-start;flex-direction:column;}
}

/* v2.7 - materiaallijst zoals Luxigo App */
.material-modal-card{
  width:min(1420px, calc(100vw - 40px));
  max-width:1420px;
}
.material-matrix-appstyle{
  font-size:14px;
}
.material-matrix-appstyle th,
.material-matrix-appstyle td{
  padding:12px 14px;
}
.material-matrix-appstyle tbody tr:hover td{
  background:#fcfcfd;
}
.material-matrix-appstyle .material-image-col{
  width:112px;
  min-width:112px;
  text-align:center;
}
.material-matrix-appstyle .material-sku-col{
  width:110px;
  min-width:110px;
  white-space:nowrap;
  color:#111827;
  font-weight:600;
}
.material-matrix-appstyle .material-name-col{
  min-width:360px;
  max-width:520px;
  left:0;
}
.material-matrix-appstyle .material-thickness-col{
  min-width:78px;
  white-space:nowrap;
  font-weight:700;
  color:#111827;
}
.material-thumb{
  width:78px;
  height:78px;
  object-fit:cover;
  border-radius:8px;
  border:1px solid #eef0f3;
  background:#f7f7f7;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.material-thumb-empty{
  color:#98a2b3;
  font-weight:800;
}
.material-matrix-appstyle .material-price-btn{
  min-width:112px;
  padding:10px 12px;
  background:#fff;
  border-color:#d0d5dd;
  color:#344054;
}
.material-matrix-appstyle .material-price-btn span{
  color:#111827;
  font-size:14px;
}
.material-matrix-appstyle .material-price-btn small{
  color:#667085;
  font-size:10px;
}
.material-matrix-appstyle .material-price-btn:hover,
.material-matrix-appstyle .material-price-btn:focus{
  background:#F54325;
  border-color:#F54325;
}
.material-matrix-appstyle .material-price-btn:hover span,
.material-matrix-appstyle .material-price-btn:hover small,
.material-matrix-appstyle .material-price-btn:focus span,
.material-matrix-appstyle .material-price-btn:focus small{
  color:#fff;
}
@media (max-width: 900px){
  .material-matrix-appstyle .material-image-col{width:86px;min-width:86px;}
  .material-thumb{width:58px;height:58px;}
  .material-matrix-appstyle .material-name-col{min-width:260px;}
}
.quality-label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:800;color:var(--muted);margin:8px 0 10px}.quality-label select{width:100%;border:1px solid var(--line);border-radius:12px;padding:10px 12px;font:inherit;font-weight:800;color:var(--text);background:#fff}.tool-btn span{font-size:11px}

/* v3.1 calm layout - meer rust, dichter bij app.luxigo.nl */
:root{
  --bg:#f7f7f7;
  --panel:#ffffff;
  --text:#111827;
  --muted:#667085;
  --line:#eaecf0;
  --line-strong:#d0d5dd;
  --accent:#F54325;
  --accent-2:#d9361e;
  --focus-ring:rgba(245,67,37,.12);
  --sidebar-w:330px;
}

html,body{
  background:#f7f7f7 !important;
  font-family:'Montserrat',Arial,sans-serif !important;
  color:var(--text);
}

.app-shell{
  grid-template-columns:var(--sidebar-w) minmax(0,1fr) !important;
  background:#f7f7f7 !important;
}

.sidebar{
  background:#f7f7f7 !important;
  padding:18px 18px 24px !important;
  border-right:1px solid var(--line) !important;
}

.brand{
  margin:0 0 14px !important;
  padding:0 0 14px !important;
  border-bottom:1px solid var(--line) !important;
}
.brand-logo{width:150px !important; max-height:62px !important;}

.section-title{
  color:#98a2b3 !important;
  font-size:10px !important;
  letter-spacing:.12em !important;
  margin:16px 0 7px !important;
}

.panel{
  border:1px solid var(--line) !important;
  border-radius:12px !important;
  padding:14px !important;
  margin-bottom:14px !important;
  box-shadow:none !important;
  background:#fff !important;
}
.panel h2{
  font-size:14px !important;
  margin-bottom:10px !important;
}
h2::before,.drawer-panel h3::before{width:4px !important;height:16px !important;}

.upload-panel .upload-box{
  min-height:118px !important;
  border-radius:10px !important;
  padding:18px 14px !important;
  margin:6px 0 10px !important;
}
.upload-box strong{font-size:14px !important;}
.file-badges{gap:5px !important;}
.file-badges span{height:22px !important;font-size:10px !important;padding:0 7px !important;}

input[type=number],input[type=text],input[type=search],select{
  border-radius:8px !important;
  height:40px;
  font-size:13px !important;
  font-weight:600 !important;
}
.grid-2{gap:9px !important;}
.btn{border-radius:8px !important;padding:9px 12px !important;font-size:13px !important;}
.btn.secondary{margin-top:9px !important;}

.workspace{background:#fff !important;}
.topbar.minimal-topbar,.topbar{
  padding:22px 28px 12px !important;
  background:#fff !important;
  border-bottom:1px solid var(--line) !important;
}
.main-title-label{
  font-size:22px !important;
  line-height:1.1 !important;
  letter-spacing:-.015em !important;
}
.topbar-title h1{font-size:13px !important;margin:3px 0 !important;}
.topbar-title p{font-size:13px !important;margin:0 !important;max-width:760px;}
.top-instruction-link{font-size:13px !important;margin-top:7px !important;}

.canvas-wrap{
  padding:16px 28px 28px !important;
  background:#fff !important;
}
.canvas-stage{gap:12px !important;align-items:flex-start !important;}
.vertical-toolbar{
  border-radius:12px !important;
  padding:6px !important;
  gap:6px !important;
  border:1px solid var(--line) !important;
  background:#fff !important;
}
.tool-btn{
  width:54px !important;
  min-height:50px !important;
  border-radius:8px !important;
  font-size:16px !important;
}
.tool-btn span{font-size:9px !important;}

.toolbar-drawer{width:250px !important;flex-basis:250px !important;}
.drawer-panel{
  border-radius:12px !important;
  border:1px solid var(--line) !important;
  box-shadow:none !important;
  padding:13px !important;
}
.drawer-panel h3{font-size:13px !important;margin-bottom:10px !important;}
.mini-result{font-size:12px !important;}

.canvas-panel{
  border-radius:12px !important;
  border:1px solid var(--line) !important;
  padding:12px !important;
  box-shadow:none !important;
  gap:10px !important;
}
.canvas-layerbar{
  display:flex !important;
  align-items:center !important;
  gap:14px !important;
  border:0 !important;
  border-bottom:1px solid var(--line) !important;
  border-radius:0 !important;
  padding:0 0 10px !important;
  background:#fff !important;
}
.canvas-layerbar::after{display:none !important;}
.layerbar-title{
  min-width:86px;
  color:#98a2b3 !important;
  font-size:10px !important;
}
.rdworks-palette.horizontal{
  gap:7px !important;
}
.rdworks-palette.horizontal .color-swatch{
  min-width:132px !important;
  padding:7px 9px !important;
  font-size:13px !important;
  border-radius:8px !important;
}
.color-swatch span{width:20px !important;height:20px !important;}
.color-swatch small{font-size:9px !important;}
canvas{border-radius:8px !important;border:1px solid var(--line-strong) !important;}
.hint{
  font-size:12px !important;
  color:#667085 !important;
  border:0 !important;
  background:#f9fafb !important;
  padding:8px 10px !important;
  width:100% !important;
}

.sheet-warning{
  border-radius:10px !important;
  padding:14px !important;
  box-shadow:none !important;
  background:#fff7f5 !important;
}
.sheet-warning strong{font-size:13px !important;}
.sheet-warning span{font-size:12px !important;}

.part-item,.sheet-item{
  border-radius:8px !important;
  padding:9px 10px !important;
}
.part-title,.sheet-title{font-size:13px !important;}
.part-meta,.sheet-meta{font-size:11px !important;}
.dimension-fields{gap:5px !important;}

.export-panel .export-btn,.export-panel .import-btn,.export-panel .quote-btn{
  min-height:42px !important;
  margin-top:8px !important;
}
.export-panel .export-btn{min-height:48px !important;}

.material-modal-card,.modal-card{border-radius:12px !important;}
.material-modal-body{padding:16px 18px !important;gap:12px !important;}
.material-modal-toolbar{grid-template-columns:minmax(320px,1fr) 180px auto !important;}
.materials-matrix-wrap{border-radius:10px !important;}
.material-matrix-appstyle th,.material-matrix-appstyle td{padding:10px 12px !important;}

@media (max-width: 1280px){
  .app-shell{grid-template-columns:310px minmax(0,1fr) !important;}
  .toolbar-drawer{width:230px !important;flex-basis:230px !important;}
  .rdworks-palette.horizontal .color-swatch{min-width:118px !important;}
}
@media (max-width: 1100px){
  .app-shell{grid-template-columns:1fr !important;}
  .canvas-panel{max-width:calc(100vw - 118px) !important;}
}


/* v3.3 - nette onderdeelkaart met thumbnail en gelijk uitgelijnde velden */
.parts-list .part-item{
  display:block !important;
  padding:10px !important;
  border-radius:12px !important;
  gap:0 !important;
}
.part-card-top{
  display:grid;
  grid-template-columns:56px minmax(0,1fr) 24px;
  gap:10px;
  align-items:start;
}
.part-thumb{
  width:56px;
  height:56px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.part-thumb-svg{
  width:48px;
  height:48px;
  display:block;
}
.part-main{min-width:0 !important;}
.part-title{
  line-height:1.2;
  margin-top:1px;
}
.part-meta{
  display:flex;
  flex-wrap:wrap;
  gap:4px 8px;
  line-height:1.25;
  margin-top:5px !important;
}
.part-meta span{
  display:inline-flex;
  align-items:center;
  color:var(--muted);
}
.part-fields{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) 74px;
  gap:8px;
  align-items:end;
  margin-top:10px;
}
.part-field,
.qty-field.part-field{
  display:flex !important;
  flex-direction:column !important;
  gap:5px !important;
  color:var(--muted) !important;
  font-size:11px !important;
  font-weight:800 !important;
  line-height:1.1;
}
.part-field input,
.qty-field.part-field input{
  width:100% !important;
  min-width:0 !important;
  height:42px !important;
  padding:8px 9px !important;
  border:1px solid var(--line) !important;
  border-radius:10px !important;
  font-size:13px !important;
  font-weight:800 !important;
  color:var(--text) !important;
  background:#fff !important;
}
.part-card-top .remove{
  width:24px;
  height:24px;
  display:grid;
  place-items:center;
  border-radius:8px;
  line-height:1;
  margin-top:2px;
}
.part-card-top .remove:hover{
  background:#fff1f2;
}
.dimension-fields,
.part-actions{display:none !important;}

/* V4.6 Color Engine */
.file-color-panel{
  margin: 12px 16px 0 16px;
  padding: 14px;
  border: 1px solid rgba(245,67,37,.20);
  background: #fff8f6;
  border-radius: 14px;
  box-sizing: border-box;
}
.file-color-warning-head{
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
  color: #374151;
}
.file-color-warning-head strong{
  font-size: 14px;
  color: #111827;
}
.file-color-warning-head span{
  font-size: 12px;
  color: #6b7280;
}
.file-color-warning-list{
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.file-color-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid #f3d5cd;
  border-radius: 12px;
  background: #fff;
}
.file-color-select{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #374151;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.file-color-select small{
  color: #9ca3af;
  font-weight: 600;
}
.file-color-dot{
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}
.file-color-actions{
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.file-color-actions button{
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.file-color-actions button:hover{
  border-color: #F54325;
  color: #F54325;
  background: #fff;
}
@media (max-width: 900px){
  .file-color-row{ align-items: flex-start; flex-direction: column; }
  .file-color-actions{ justify-content: flex-start; }
}

/* V4.7 - Stap 3 kleurcontrole + horizontale bewerk-toolbar */
.control-color-panel{
  margin-top:14px;
  border:1px solid #fed7d7;
  background:#fff7f5;
  border-radius:16px;
  padding:14px;
  box-shadow:none;
}
.control-color-panel .color-warning-head{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-bottom:12px;
}
.control-color-panel .color-warning-head strong{
  color:#F54325;
  font-size:14px;
  letter-spacing:0;
}
.control-color-panel .color-warning-head span{
  color:#64748b;
  font-size:12px;
  line-height:1.35;
}
.control-color-panel .color-warning-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.control-color-panel .color-warning-row{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:10px;
  border:1px solid #ffe0d9;
  border-radius:14px;
  background:#fff;
}
.control-color-panel .color-warning-source{
  display:flex;
  align-items:center;
  gap:8px;
  width:100%;
  border:0;
  background:transparent;
  color:#111827;
  font-weight:800;
  cursor:pointer;
  padding:0;
  text-align:left;
}
.control-color-panel .color-warning-source span,
.control-color-panel .color-warning-map span{
  width:18px;
  height:18px;
  border-radius:5px;
  border:1px solid rgba(15,23,42,.18);
  flex:0 0 auto;
}
.control-color-panel .color-warning-source small{
  margin-left:auto;
  color:#64748b;
  font-size:11px;
  font-weight:700;
}
.control-color-panel .color-warning-targets{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
}
.control-color-panel .color-warning-map{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  border:1px solid #e5e7eb;
  background:#fff;
  color:#111827;
  border-radius:10px;
  padding:8px 7px;
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}
.control-color-panel .color-warning-map:hover{
  border-color:#F54325;
  color:#F54325;
}

.quick-edit-toolbar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  padding:12px 16px;
  border:1px solid #e5e7eb;
  border-top:0;
  background:#fff;
  border-radius:0 0 18px 18px;
  margin-bottom:14px;
}
.quick-toolbar-group{
  display:flex;
  align-items:center;
  gap:7px;
  padding-right:10px;
  border-right:1px solid #edf2f7;
}
.quick-toolbar-group:last-child{border-right:0;padding-right:0;}
.quick-tool-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:38px;
  min-width:46px;
  padding:8px 11px;
  border:1px solid #d7dde7;
  border-radius:11px;
  background:#fff;
  color:#111827;
  font-size:16px;
  font-weight:900;
  cursor:pointer;
  transition:.15s ease;
}
.quick-tool-btn span{font-size:11px;font-weight:900;}
.quick-tool-btn.wide{min-width:92px;}
.quick-tool-btn.compact{min-width:38px;padding:8px 9px;color:#F54325;}
.quick-tool-btn:hover{
  border-color:#F54325;
  color:#F54325;
  transform:translateY(-1px);
}
.quick-angle-field{
  display:flex;
  align-items:center;
  gap:6px;
  min-height:38px;
  padding:6px 9px;
  border:1px solid #d7dde7;
  border-radius:11px;
  background:#fff;
  color:#111827;
  font-weight:900;
}
.quick-angle-field input{
  width:58px;
  height:26px;
  border:0;
  outline:0;
  text-align:center;
  font-weight:900;
  font:inherit;
  background:transparent;
}
.quick-angle-field b{font-size:14px;}
.quick-align-group select{
  min-height:38px;
  border:1px solid #d7dde7;
  border-radius:11px;
  padding:8px 10px;
  background:#fff;
  color:#111827;
  font-weight:800;
}
@media(max-width:900px){
  .quick-edit-toolbar{padding:10px;gap:8px;}
  .quick-toolbar-group{border-right:0;padding-right:0;flex-wrap:wrap;}
  .quick-tool-btn.wide{min-width:78px;}
}

/* V4.8 toolbar polish */
#quickApplyRotateAngle{display:none!important;}
.quick-angle-field{
  min-width:104px;
  padding:7px 10px;
}
.quick-angle-field input{
  width:54px;
  font-size:15px;
}
.quick-angle-field:focus-within{
  border-color:#F54325;
  box-shadow:0 0 0 3px rgba(245,67,37,.10);
}
.quick-tool-btn.wide span{font-size:12px;}
#toolCloseLines{display:none!important;}


/* V4.9 selectie + toolbar polish */
.quick-angle-field.quick-angle-inline{
  display:inline-flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  min-width:96px!important;
  min-height:38px!important;
  height:38px!important;
  padding:6px 10px!important;
  white-space:nowrap!important;
}
.quick-angle-field.quick-angle-inline .angle-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  line-height:1;
}
.quick-angle-field.quick-angle-inline input{
  width:44px!important;
  min-width:44px!important;
  max-width:44px!important;
  height:24px!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  border-bottom:1px solid #d7dde7!important;
  border-radius:0!important;
  text-align:center!important;
  font-size:15px!important;
  font-weight:900!important;
  line-height:24px!important;
}
.quick-angle-field.quick-angle-inline .angle-degree{
  font-size:15px;
  font-weight:900;
  line-height:1;
}

/* V4.10 toolbar + accordion polish */
#toolEditPanel{display:none!important;}
.quick-scale-field{
  display:inline-flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  min-width:104px!important;
  min-height:38px!important;
  height:38px!important;
  padding:6px 10px!important;
  border:1px solid #d7dde7;
  border-radius:11px;
  background:#fff;
  color:#111827;
  font-weight:900;
  white-space:nowrap!important;
}
.quick-scale-field:focus-within{
  border-color:#F54325;
  box-shadow:0 0 0 3px rgba(245,67,37,.10);
}
.quick-scale-field .scale-icon{
  font-size:15px;
  line-height:1;
}
.quick-scale-field input{
  width:48px!important;
  min-width:48px!important;
  max-width:48px!important;
  height:24px!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  border-bottom:1px solid #d7dde7!important;
  border-radius:0!important;
  background:transparent!important;
  text-align:center!important;
  font-size:15px!important;
  font-weight:900!important;
  line-height:24px!important;
  outline:none!important;
}
.quick-scale-field .scale-percent{
  font-size:13px;
  font-weight:900;
  line-height:1;
}
.parts-accordion-header{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:8px 0 10px;
  padding:12px 14px;
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#fff;
  color:#111827;
  cursor:pointer;
  font-family:inherit;
  box-shadow:0 8px 24px rgba(15,23,42,.05);
}
.parts-accordion-header span:first-child{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
}
.parts-accordion-header strong{
  font-size:14px;
  font-weight:900;
}
.parts-accordion-header small{
  font-size:12px;
  color:#64748b;
  font-weight:700;
}
.parts-accordion-chevron{
  width:28px;
  height:28px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f8fafc;
  color:#F54325;
  font-size:14px;
  transition:.15s ease;
}
.parts-accordion-header.is-open .parts-accordion-chevron{
  transform:rotate(180deg);
}
.parts-list.is-collapsed{
  display:none!important;
}
.parts-list:not(.is-collapsed){
  max-height:520px;
  overflow:auto;
  padding-right:4px;
}


/* v5.5.3 - visuele aansluiting op app.luxigo.nl */
.step-heading {
  display:flex;
  align-items:center;
  gap:11px;
  margin:22px 2px 10px;
  color:var(--text);
  letter-spacing:0;
  text-transform:none;
}
.step-number {
  width:34px;
  height:34px;
  flex:0 0 34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:var(--accent);
  color:#fff;
  font-size:15px;
  font-weight:900;
  box-shadow:0 7px 16px rgba(245,67,37,.22);
}
.step-copy {
  display:flex;
  flex-direction:column;
  gap:1px;
  min-width:0;
}
.step-copy small {
  color:var(--accent);
  font-size:10px;
  line-height:1.1;
  font-weight:900;
  letter-spacing:.11em;
  text-transform:uppercase;
}
.step-copy strong {
  color:#292524;
  font-size:15px;
  line-height:1.25;
  font-weight:800;
  letter-spacing:0;
}
.sidebar > .panel {
  border:1px solid #e7e5e4;
  border-radius:12px;
  box-shadow:0 5px 18px rgba(28,25,23,.045);
}
.sidebar > .panel h2 {
  color:#44403c;
  font-size:14px;
  font-weight:800;
}
.upload-panel {
  padding:14px;
}
.upload-panel .upload-box {
  border-width:2px;
  border-style:dashed;
  border-color:#d6d3d1;
  background:#fff;
  border-radius:10px;
  min-height:132px;
  transition:border-color .18s ease, background .18s ease, transform .18s ease;
}
.upload-panel .upload-box:hover,
.upload-panel .upload-box.dragover {
  border-color:var(--accent);
  background:#fff7f5;
  transform:translateY(-1px);
}
.upload-panel .upload-box strong {
  color:#44403c;
  font-size:14px;
}
.upload-panel .upload-box span {
  color:#78716c;
}
.file-badges span {
  border-color:#e7e5e4;
  background:#fafaf9;
  color:#78716c;
}
.sidebar .btn.primary,
.sidebar .export-btn {
  border-radius:4px;
}
@media (max-width:900px) {
  .step-heading { margin-top:18px; }
  .step-number { width:32px; height:32px; flex-basis:32px; }
}


/* v5.6 – centrale loaders en meldingen */
.luxigo-spinner {
  width:32px;
  height:32px;
  display:inline-block;
  border:3px solid rgba(245,67,37,.18);
  border-top-color:var(--accent);
  border-radius:50%;
  animation:luxigo-spin .75s linear infinite;
}
@keyframes luxigo-spin { to { transform:rotate(360deg); } }
.global-loader {
  position:fixed;
  inset:0;
  z-index:10000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(28,25,23,.26);
  backdrop-filter:blur(2px);
  opacity:0;
  visibility:hidden;
  transition:opacity .18s ease, visibility .18s ease;
}
.global-loader.open { opacity:1; visibility:visible; }
.global-loader-card {
  min-width:230px;
  max-width:360px;
  padding:24px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  background:#fff;
  border:1px solid #e7e5e4;
  border-radius:14px;
  box-shadow:0 22px 60px rgba(28,25,23,.18);
  text-align:center;
}
.global-loader-card strong { color:#292524; font-size:16px; }
.global-loader-card span:last-child { color:#78716c; font-size:13px; }
.instructions-frame-wrap { position:relative; min-height:420px; background:#fafaf9; }
.instructions-frame-wrap iframe { width:100%; min-height:560px; border:0; opacity:0; transition:opacity .2s ease; }
.instructions-frame-wrap.loaded iframe { opacity:1; }
.inline-loader {
  position:absolute;
  inset:0;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
  color:#292524;
  background:#fff;
  transition:opacity .2s ease, visibility .2s ease;
}
.instructions-frame-wrap.loaded .inline-loader { opacity:0; visibility:hidden; pointer-events:none; }
.inline-loader small { color:#78716c; }
.toast-region {
  position:fixed;
  right:20px;
  bottom:20px;
  z-index:10020;
  display:flex;
  flex-direction:column;
  gap:10px;
  pointer-events:none;
}
.luxigo-toast {
  min-width:240px;
  max-width:360px;
  padding:12px 14px;
  border-radius:10px;
  background:#292524;
  color:#fff;
  box-shadow:0 14px 35px rgba(28,25,23,.2);
  font-size:13px;
  font-weight:700;
  opacity:0;
  transform:translateY(8px);
  animation:toast-in .2s ease forwards;
}
.luxigo-toast.success { background:#166534; }
.luxigo-toast.error { background:#991b1b; }
@keyframes toast-in { to { opacity:1; transform:translateY(0); } }
@media (prefers-reduced-motion:reduce) {
  .luxigo-spinner { animation-duration:1.5s; }
  .global-loader,.inline-loader,.instructions-frame-wrap iframe,.luxigo-toast { transition:none; }
}


/* v5.7 RDWorks-achtige compacte editor */
.vertical-toolbar{overflow:visible;gap:5px;padding:7px;border-radius:12px}
.tool-btn{position:relative;width:42px;min-height:40px;border-radius:8px;font-size:19px;display:grid;place-items:center;padding:0}
.tool-btn::after{content:attr(data-tooltip);position:absolute;left:calc(100% + 10px);top:50%;transform:translateY(-50%) translateX(-4px);white-space:nowrap;max-width:340px;padding:9px 11px;border-radius:9px;background:#111827;color:#fff;font-size:12px;font-weight:700;line-height:1.25;box-shadow:0 10px 28px rgba(15,23,42,.22);opacity:0;pointer-events:none;transition:.14s ease;z-index:50}
.tool-btn:hover::after{opacity:1;transform:translateY(-50%) translateX(0)}
.tool-separator{height:1px;background:#dbe3ec;margin:3px 4px}
canvas.draw-mode{cursor:crosshair} canvas.pan-ready{cursor:grab!important} canvas.panning{cursor:grabbing!important}
.quick-dimension-group{gap:5px!important}.quick-dimension-group>label:not(.aspect-lock){display:flex;align-items:center;gap:4px;background:#fff;border:1px solid var(--line);border-radius:8px;padding:3px 6px;font-size:11px;font-weight:900}.quick-dimension-group input[type=number]{width:68px;border:0;padding:5px 2px;font-weight:800;outline:0}.quick-dimension-group small{color:var(--muted);font-size:10px}.aspect-lock{display:grid;place-items:center;width:31px;height:31px;border:1px solid var(--line);border-radius:8px;background:#fff;cursor:pointer}.aspect-lock input{position:absolute;opacity:0}.aspect-lock:has(input:not(:checked)){opacity:.45}.shape-buttons{display:grid!important;grid-template-columns:repeat(3,1fr);gap:7px}.shape-fields{margin-bottom:10px}
@media(max-width:900px){.tool-btn::after{display:none}.tool-btn{width:40px;min-height:38px}}


/* v5.8 professionele contextuele CAD-toolbar */
#quickEditToolbar.quick-edit-toolbar{
  display:flex;align-items:center;flex-wrap:nowrap;gap:0;min-height:52px;padding:6px 10px;
  overflow-x:auto;overflow-y:hidden;border-radius:0 0 14px 14px;background:#fff;
  box-shadow:0 8px 20px rgba(15,23,42,.04);
}
.quick-toolbar-state{display:flex;align-items:center;gap:7px;min-width:170px;max-width:230px;padding:0 12px 0 4px;color:#64748b;font-size:11px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.quick-toolbar-state .state-dot{width:8px;height:8px;border-radius:999px;background:#cbd5e1;flex:0 0 auto}
#quickEditToolbar[data-selection="single"] .state-dot,#quickEditToolbar[data-selection="multi"] .state-dot{background:#F54325;box-shadow:0 0 0 4px rgba(245,67,37,.10)}
#quickEditToolbar .quick-toolbar-group{flex-wrap:nowrap;gap:5px;padding:0 9px;border-right:1px solid #e8edf3;min-height:38px}
#quickEditToolbar .quick-toolbar-group:last-child{border-right:0}
.quick-inline-field{display:flex!important;flex-direction:row!important;align-items:center!important;gap:4px!important;height:34px;padding:0 7px!important;border:1px solid #d9e0e8!important;border-radius:8px!important;background:#fff!important;white-space:nowrap}
.quick-inline-field b{font-size:11px;color:#475569;line-height:1}
.quick-inline-field input[type=number]{width:62px!important;height:28px;border:0!important;background:transparent!important;padding:0 2px!important;text-align:right;font-size:13px!important;font-weight:850!important;color:#0f172a!important;outline:0}
.quick-inline-field small{font-size:10px!important;color:#94a3b8!important;font-weight:750!important}
.quick-inline-field:focus-within{border-color:#F54325!important;box-shadow:0 0 0 3px rgba(245,67,37,.10)}
#quickEditToolbar .aspect-lock{width:34px;height:34px;border-radius:8px;flex:0 0 auto}
#quickEditToolbar .quick-tool-btn{min-width:36px;min-height:34px;height:34px;padding:0 8px;border-radius:8px;font-size:15px;gap:4px}
#quickEditToolbar .quick-tool-btn span{font-size:10px}
#quickEditToolbar .quick-angle-field{min-width:82px;height:34px;min-height:34px;padding:0 7px;border-radius:8px}
#quickEditToolbar .quick-angle-field input{width:42px;height:26px;font-size:13px}
#quickEditToolbar .quick-align-group select{height:34px;min-height:34px;padding:0 7px;border-radius:8px;font-size:11px}
#quickEditToolbar[data-selection="none"] .quick-position-group,
#quickEditToolbar[data-selection="none"] .quick-dimension-group,
#quickEditToolbar[data-selection="none"] .quick-multi-actions,
#quickEditToolbar[data-selection="none"] .quick-line-actions,
#quickEditToolbar[data-selection="none"] .quick-align-group,
#quickEditToolbar[data-selection="none"] .quick-toolbar-group[aria-label="Draaien"]{opacity:.38;pointer-events:none}
#quickEditToolbar[data-selection="single"] .quick-align-group{display:none}
#quickEditToolbar[data-selection="single"] #quickGroupParts{display:none}
#quickEditToolbar[data-selection="multi"] #quickUngroupParts{display:none}
#quickEditToolbar input:disabled{cursor:not-allowed;color:#94a3b8!important}
#drawerDraw,#toolDrawText{display:none!important}
@media(max-width:1100px){.quick-toolbar-state{display:none}#quickEditToolbar.quick-edit-toolbar{padding:6px}.quick-inline-field input[type=number]{width:52px!important}}
@media(max-width:760px){#quickEditToolbar .quick-line-actions,#quickEditToolbar .quick-multi-actions{display:none}.quick-inline-field input[type=number]{width:46px!important}}


/* v5.8.1 - compacte afmetingenbalk en sneltoetsen-popover */
.topbar-title { width:100%; }
.top-help-links {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  width:100%;
  max-width:980px;
  margin-top:7px;
}
.top-help-links .top-instruction-link { margin-top:0 !important; }
.shortcut-help { position:relative; margin-left:auto; }
.shortcut-help-link {
  appearance:none;
  border:0;
  padding:0;
  background:transparent;
  color:var(--accent);
  font:inherit;
  font-size:13px;
  font-weight:800;
  cursor:help;
  white-space:nowrap;
}
.shortcut-help-link:hover,
.shortcut-help-link:focus-visible { text-decoration:underline; outline:none; }
.shortcut-popover {
  position:absolute;
  z-index:80;
  top:calc(100% + 10px);
  right:0;
  width:330px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  box-shadow:0 16px 40px rgba(16,24,40,.16);
  opacity:0;
  visibility:hidden;
  transform:translateY(-4px);
  pointer-events:none;
  transition:opacity .16s ease, transform .16s ease, visibility .16s ease;
}
.shortcut-help:hover .shortcut-popover,
.shortcut-help:focus-within .shortcut-popover {
  opacity:1;
  visibility:visible;
  transform:translateY(0);
  pointer-events:auto;
}
.shortcut-popover::before {
  content:'';
  position:absolute;
  top:-6px;
  right:28px;
  width:11px;
  height:11px;
  border-left:1px solid var(--line);
  border-top:1px solid var(--line);
  background:#fff;
  transform:rotate(45deg);
}
.shortcut-popover > strong { display:block; margin-bottom:9px; font-size:13px; }
.shortcut-popover > div {
  display:grid;
  grid-template-columns:max-content max-content 1fr;
  align-items:center;
  gap:5px;
  min-height:28px;
  color:#475467;
  font-size:12px;
}
.shortcut-popover > div span { grid-column:3; margin-left:5px; }
.shortcut-popover kbd {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:25px;
  height:23px;
  padding:0 6px;
  border:1px solid #d0d5dd;
  border-bottom-width:2px;
  border-radius:6px;
  background:#f9fafb;
  color:#344054;
  font-family:inherit;
  font-size:10px;
  font-weight:800;
  line-height:1;
}
@media (max-width:760px) {
  .top-help-links { align-items:flex-start; flex-direction:column; gap:7px; }
  .shortcut-help { margin-left:0; }
  .shortcut-popover { left:0; right:auto; width:min(330px, calc(100vw - 56px)); }
  .shortcut-popover::before { left:28px; right:auto; }
}


/* v6.0 - compacte sneltoetsen en professionele nesting-status */
.shortcut-popover { width:390px; padding:16px 17px; }
.shortcut-popover > strong { margin-bottom:11px; font-size:15px; }
.shortcut-popover .shortcut-row {
  display:grid;
  grid-template-columns:178px minmax(0,1fr);
  align-items:center;
  gap:14px;
  min-height:34px;
  padding:3px 0;
  color:#475467;
  font-size:13px;
}
.shortcut-keys {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:5px;
  min-width:0;
  white-space:nowrap;
}
.shortcut-keys b { color:#98a2b3; font-size:12px; font-weight:700; }
.shortcut-popover .shortcut-keys kbd {
  flex:0 0 auto;
  min-width:30px;
  height:26px;
  padding:0 8px;
  font-size:11px;
}
.shortcut-label { min-width:0; line-height:1.25; }
.nesting-metrics {
  display:flex;
  align-items:stretch;
  gap:8px;
  padding:9px 12px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,#fff,#fbfcfe);
  overflow-x:auto;
}
.nesting-metric {
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-width:112px;
  padding:7px 10px;
  border:1px solid #e4e7ec;
  border-radius:9px;
  background:#fff;
}
.nesting-metric span { color:#667085; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.nesting-metric strong { margin-top:2px; color:#101828; font-size:14px; line-height:1.2; }
.nesting-metric.metric-status { min-width:168px; }
.nesting-metric.metric-status strong[data-state="warning"] { color:#b54708; }
.nesting-metric.metric-status strong[data-state="success"] { color:#067647; }
.sheet-utilization-list { display:flex; align-items:center; gap:6px; margin-left:auto; }
.sheet-utilization-chip {
  display:flex;
  align-items:center;
  gap:7px;
  min-width:104px;
  padding:7px 9px;
  border:1px solid #e4e7ec;
  border-radius:9px;
  background:#fff;
  color:#344054;
  font-size:11px;
  font-weight:700;
  white-space:nowrap;
}
.sheet-utilization-chip i { display:block; width:36px; height:5px; overflow:hidden; border-radius:99px; background:#eaecf0; }
.sheet-utilization-chip i::after { content:''; display:block; width:var(--use,0%); height:100%; border-radius:inherit; background:var(--accent); }
@media(max-width:760px){
  .shortcut-popover { width:min(360px,calc(100vw - 32px)); }
  .shortcut-popover .shortcut-row { grid-template-columns:150px minmax(0,1fr); gap:9px; }
  .nesting-metric.metric-status { min-width:150px; }
}


/* v6.1 - definitieve sneltoetsenlayout: iedere actie is één vaste flex-rij */
.shortcut-popover { width:420px !important; padding:18px !important; }
.shortcut-popover > .shortcut-row {
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:16px !important;
  min-height:38px !important;
  padding:3px 0 !important;
  text-align:left !important;
}
.shortcut-popover > .shortcut-row > .shortcut-keys {
  display:inline-flex !important;
  flex:0 0 172px !important;
  width:172px !important;
  min-width:172px !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:5px !important;
  white-space:nowrap !important;
  margin:0 !important;
  grid-column:auto !important;
}
.shortcut-popover > .shortcut-row > .shortcut-label {
  display:block !important;
  flex:1 1 auto !important;
  width:auto !important;
  margin:0 !important;
  grid-column:auto !important;
  text-align:left !important;
  line-height:1.25 !important;
}
.shortcut-popover .shortcut-keys kbd {
  display:inline-flex !important;
  flex:0 0 auto !important;
  width:auto !important;
  min-width:32px !important;
  max-width:none !important;
  height:27px !important;
  padding:0 8px !important;
}
.shortcut-popover .shortcut-keys b { flex:0 0 auto !important; }
@media(max-width:600px){
  .shortcut-popover { width:min(390px,calc(100vw - 24px)) !important; }
  .shortcut-popover > .shortcut-row { gap:10px !important; }
  .shortcut-popover > .shortcut-row > .shortcut-keys { flex-basis:150px !important; width:150px !important; min-width:150px !important; }
}

/* Luxigo Nesting v6.2 - productie- en CAD-tools */
.tool-section-label{margin:14px 0 7px;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#64748b}
.inline-tool-row{display:flex;gap:7px;align-items:center;margin:7px 0}.inline-tool-row input{min-width:0;width:78px;height:38px;padding:7px 9px;border:1px solid #d9e0ea;border-radius:9px}.inline-tool-row .btn{white-space:nowrap;padding:9px 10px}
.cad-button-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.cad-button-grid .btn{padding:9px 5px;font-size:12px}.boolean-grid{margin-top:7px}
.drawer-panel#drawerProduction,.drawer-panel#drawerCad{max-height:min(74vh,720px);overflow:auto}
.production-alert{padding:9px 11px;border-radius:9px;background:#fff7ed;color:#9a3412;font-size:12px}.production-ok{background:#ecfdf5;color:#047857}


/* Luxigo Nesting v6.3 - contextbalken en controle-overzicht */
.canvas-stage > .toolbar-drawer { display:none; }
.canvas-panel > .toolbar-drawer {
  position:relative;
  inset:auto;
  width:100%;
  max-width:none;
  height:auto;
  border:0;
  border-bottom:1px solid var(--line);
  background:#fff;
  box-shadow:none;
  transform:none;
  overflow:hidden;
}
.canvas-panel > .toolbar-drawer.open { display:block; }
.canvas-panel > .toolbar-drawer .drawer-panel {
  display:none;
  width:100%;
  max-height:none !important;
  padding:10px 14px;
  overflow:visible !important;
}
.canvas-panel > .toolbar-drawer .drawer-panel.active {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px 14px;
}
.canvas-panel > .toolbar-drawer .drawer-panel h3 {
  margin:0 8px 0 0;
  font-size:13px;
  white-space:nowrap;
}
.canvas-panel > .toolbar-drawer .tool-section-label { margin:0 6px 0 0; }
.canvas-panel > .toolbar-drawer .context-tool-section,
.canvas-panel > .toolbar-drawer .inline-tool-row,
.canvas-panel > .toolbar-drawer .button-row,
.canvas-panel > .toolbar-drawer .cad-button-grid {
  display:flex;
  align-items:center;
  gap:7px;
  margin:0;
}
.canvas-panel > .toolbar-drawer .mini-result { margin:0 0 0 auto; max-width:300px; }
.canvas-panel > .toolbar-drawer .btn { width:auto; min-width:0; padding:8px 10px; }
.canvas-panel > .toolbar-drawer input { height:34px; }
.control-metrics {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid #e7eaf0;
}
.control-metric {
  display:flex;
  flex-direction:column;
  gap:2px;
  padding:9px 10px;
  border:1px solid #e4e7ec;
  border-radius:9px;
  background:#fbfcfe;
}
.control-metric span { font-size:10px; font-weight:800; color:#667085; text-transform:uppercase; letter-spacing:.04em; }
.control-metric strong { font-size:14px; color:#101828; }
.control-status { grid-column:1/-1; }
.control-status strong[data-state="warning"] { color:#b54708; }
.control-status strong[data-state="success"] { color:#067647; }
@media(max-width:900px){
  .canvas-panel > .toolbar-drawer .drawer-panel.active { align-items:flex-start; }
  .canvas-panel > .toolbar-drawer .mini-result { flex-basis:100%; margin-left:0; }
}

/* Luxigo Nesting v6.3.1 - geïntegreerde horizontale ribbon */
.canvas-panel > .toolbar-drawer {
  background:linear-gradient(180deg,#fff 0%,#fbfcfe 100%);
  border-top:1px solid #edf0f4;
  border-bottom:1px solid var(--line);
}
.canvas-panel > .toolbar-drawer .drawer-panel.ribbon-panel.active {
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  min-height:62px;
  gap:10px;
  padding:9px 14px;
  overflow-x:auto !important;
  overflow-y:hidden !important;
}
.ribbon-title {
  flex:0 0 auto;
  padding-right:12px;
  color:#101828;
  font-size:13px;
  font-weight:800;
  white-space:nowrap;
}
.ribbon-group {
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  gap:7px;
  min-width:0;
  white-space:nowrap;
}
.ribbon-label {
  color:#667085;
  font-size:11px;
  font-weight:800;
  letter-spacing:.03em;
  text-transform:uppercase;
}
.ribbon-divider {
  display:inline-block;
  flex:0 0 1px;
  width:1px;
  height:34px;
  margin:0 3px;
  background:#e4e7ec;
}
.canvas-panel > .toolbar-drawer .ribbon-panel .btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:auto;
  min-width:0;
  height:36px;
  margin:0 !important;
  padding:0 11px;
  border-radius:9px;
  white-space:nowrap;
}
.unit-field,
.compact-field {
  position:relative;
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  height:36px;
  margin:0;
  border:1px solid #d9e0ea;
  border-radius:9px;
  background:#fff;
  overflow:hidden;
}
.unit-field input,
.compact-field input {
  width:76px !important;
  height:34px !important;
  margin:0 !important;
  padding:0 36px 0 10px !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  font-weight:700;
}
.unit-field > span {
  position:absolute;
  right:10px;
  color:#98a2b3;
  font-size:11px;
  font-weight:800;
  pointer-events:none;
}
.compact-field > span {
  padding-left:10px;
  color:#667085;
  font-size:11px;
  font-weight:700;
}
.compact-field input {
  width:58px !important;
  padding:0 8px !important;
  text-align:center;
}
.segmented-control {
  display:inline-flex;
  align-items:center;
  padding:2px;
  border:1px solid #d9e0ea;
  border-radius:10px;
  background:#f8fafc;
}
.segmented-control .btn {
  height:30px !important;
  padding:0 10px !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
}
.segmented-control .btn:hover,
.segmented-control .btn:focus-visible {
  background:#fff !important;
}
.ribbon-action { font-weight:800; }
.ribbon-result {
  flex:0 0 auto;
  max-width:none !important;
  margin:0 0 0 auto !important;
  color:#667085;
  white-space:nowrap;
}
.align-group { gap:6px; }
@media(max-width:1100px){
  .canvas-panel > .toolbar-drawer .drawer-panel.ribbon-panel.active { padding-right:10px; }
  .ribbon-result { display:none; }
}
@media(max-width:760px){
  .canvas-panel > .toolbar-drawer .drawer-panel.ribbon-panel.active {
    min-height:56px;
    gap:8px;
    padding:8px 10px;
  }
  .ribbon-title { display:none; }
  .ribbon-label { font-size:10px; }
}

/* Luxigo Nesting v6.3.3 - full-width ribbon en compacte canvasafstand */
.canvas-stage {
  align-items:flex-start !important;
}
.canvas-panel {
  gap:10px !important;
}
.canvas-panel > .toolbar-drawer {
  width:100% !important;
  min-width:0 !important;
  flex:0 0 auto !important;
  position:relative !important;
  top:auto !important;
  border:1px solid var(--line) !important;
  border-radius:16px !important;
  background:linear-gradient(180deg,#fff 0%,#fbfcfe 100%) !important;
  box-shadow:0 8px 22px rgba(15,23,42,.045) !important;
  overflow:hidden !important;
  margin:0 !important;
}
.canvas-panel > .toolbar-drawer:not(.open) {
  display:none !important;
}
.canvas-panel > .toolbar-drawer.open {
  display:block !important;
}
.canvas-panel > .toolbar-drawer .drawer-panel.ribbon-panel.active {
  width:100% !important;
  min-width:0 !important;
  min-height:58px !important;
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:center !important;
  align-content:center !important;
  gap:8px 12px !important;
  padding:9px 14px !important;
  overflow:visible !important;
  box-sizing:border-box !important;
}
.canvas-panel > .toolbar-drawer .drawer-panel:not(.ribbon-panel).active {
  width:100% !important;
  box-sizing:border-box !important;
}
.ribbon-title {
  min-width:max-content !important;
  padding-right:8px !important;
}
.ribbon-group {
  display:flex !important;
  flex:0 1 auto !important;
  flex-wrap:wrap !important;
  min-width:0 !important;
}
.ribbon-result {
  margin-left:auto !important;
}
.canvas-panel > .toolbar-drawer,
.canvas-panel > .toolbar-drawer .drawer-panel,
.canvas-panel > .toolbar-drawer .ribbon-panel {
  scrollbar-width:none !important;
}
.canvas-panel > .toolbar-drawer::-webkit-scrollbar,
.canvas-panel > .toolbar-drawer .drawer-panel::-webkit-scrollbar,
.canvas-panel > .toolbar-drawer .ribbon-panel::-webkit-scrollbar {
  display:none !important;
}
.canvas-panel > canvas,
.canvas-panel > #canvas {
  margin-top:0 !important;
}
@media (max-width:1150px){
  .ribbon-result{display:none !important;}
  .canvas-panel > .toolbar-drawer .drawer-panel.ribbon-panel.active{gap:7px 9px !important;}
}
@media (max-width:760px){
  .canvas-panel{gap:8px !important;}
  .canvas-panel > .toolbar-drawer .drawer-panel.ribbon-panel.active{
    min-height:0 !important;
    padding:8px 10px !important;
  }
  .ribbon-title{display:block !important;width:100%;padding:0 !important;}
}

/* Luxigo Nesting v6.3.3 - ribbon polish */
.canvas-panel > .toolbar-drawer .drawer-panel.ribbon-panel.active {
  min-height:60px !important;
  flex-wrap:nowrap !important;
  gap:0 !important;
  padding:10px 15px !important;
}
.ribbon-title {
  display:flex !important;
  align-items:center !important;
  align-self:stretch !important;
  min-width:122px !important;
  padding:0 18px 0 0 !important;
  margin-right:16px !important;
  border-right:1px solid #e4e7ec !important;
  line-height:1 !important;
}
.ribbon-group {
  display:flex !important;
  flex:0 0 auto !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  min-height:40px !important;
  gap:8px !important;
}
.ribbon-group + .ribbon-divider,
.ribbon-divider {
  height:36px !important;
  margin:0 16px !important;
}
.ribbon-label {
  display:flex !important;
  align-items:center !important;
  height:38px !important;
  line-height:1.1 !important;
}
.canvas-panel > .toolbar-drawer .ribbon-panel .btn,
.unit-field,
.compact-field,
.segmented-control {
  height:40px !important;
  box-sizing:border-box !important;
}
.canvas-panel > .toolbar-drawer .ribbon-panel .btn {
  padding:0 14px !important;
}
.unit-field input,
.compact-field input {
  height:38px !important;
  box-sizing:border-box !important;
}
#kerfAmount {
  width:94px !important;
  min-width:94px !important;
  padding-left:12px !important;
  padding-right:34px !important;
  font-size:14px !important;
}
#tabWidth {
  width:78px !important;
  min-width:78px !important;
}
.compact-field {
  padding-left:0 !important;
}
.compact-field > span {
  display:flex !important;
  align-items:center !important;
  align-self:stretch !important;
  padding:0 8px 0 10px !important;
  border-right:1px solid #eef1f5 !important;
  line-height:1 !important;
}
.compact-field input {
  width:54px !important;
  min-width:54px !important;
}
.segmented-control {
  padding:3px !important;
}
.segmented-control .btn {
  height:32px !important;
}
.ribbon-result {
  display:flex !important;
  align-items:center !important;
  min-height:40px !important;
  padding-left:18px !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
@media (max-width:1200px) {
  .ribbon-result { display:none !important; }
  .canvas-panel > .toolbar-drawer .drawer-panel.ribbon-panel.active {
    overflow-x:auto !important;
  }
}
@media (max-width:760px) {
  .canvas-panel > .toolbar-drawer .drawer-panel.ribbon-panel.active {
    flex-wrap:wrap !important;
    gap:8px !important;
  }
  .ribbon-title {
    width:100% !important;
    min-width:100% !important;
    height:28px !important;
    margin:0 !important;
    padding:0 !important;
    border-right:0 !important;
  }
}


/* V6.4 — compact kleur- en laagbeheer */
#layerPalette{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
#layerPalette .color-swatch{position:relative;padding-right:38px!important}
.layer-count-badge{position:absolute;right:9px;top:50%;transform:translateY(-50%);min-width:22px;height:22px;padding:0 5px;border-radius:999px;background:#eef2f7;color:#475569;font-size:11px;line-height:22px;text-align:center;cursor:pointer}
.color-swatch.active .layer-count-badge{background:#fff0ed;color:#e33c25}
.info-layer-swatch span{box-shadow:0 0 0 1px rgba(139,92,246,.2)}
.layer-manager-btn,.layer-overig-chip{height:44px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;color:#334155;font-weight:800;padding:0 14px;cursor:pointer;white-space:nowrap}
.layer-manager-btn:hover,.layer-overig-chip:hover{border-color:#F54325;color:#F54325;background:#fff8f6}
.layer-overig-chip{display:inline-flex;align-items:center;gap:7px}.layer-overig-chip[hidden]{display:none}.layer-overig-dot{width:18px;height:18px;border-radius:5px;background:conic-gradient(#f59e0b,#ec4899,#06b6d4,#f59e0b)}
.layer-manager-modal{position:fixed;inset:0;z-index:10050;display:none}.layer-manager-modal.open{display:block}.layer-manager-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.44);backdrop-filter:blur(2px)}
.layer-manager-dialog{position:relative;width:min(850px,calc(100vw - 32px));max-height:calc(100vh - 48px);overflow:auto;margin:24px auto;background:#fff;border-radius:18px;box-shadow:0 28px 80px rgba(15,23,42,.28);padding:24px}
.layer-manager-dialog header{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;border-bottom:1px solid #e5e7eb;padding-bottom:16px}.layer-manager-dialog h2{margin:0 0 5px;font-size:24px}.layer-manager-dialog header p{margin:0;color:#64748b}.layer-manager-close{border:0;background:#f1f5f9;border-radius:10px;width:38px;height:38px;font-size:25px;cursor:pointer}
.layer-manager-note{display:flex;align-items:center;gap:9px;margin:16px 0;padding:11px 13px;background:#f8f7ff;border:1px solid #ddd6fe;border-radius:10px;color:#4c1d95}.layer-manager-note span{width:18px;height:18px;border-radius:5px;flex:0 0 auto}
.layer-manager-table-head,.layer-manager-row{display:grid;grid-template-columns:minmax(230px,1fr) 70px minmax(210px,.8fr) 92px;gap:12px;align-items:center}.layer-manager-table-head{padding:0 10px 8px;color:#94a3b8;font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.04em}.layer-manager-row{padding:10px;border-top:1px solid #eef2f7}.layer-source{display:flex;align-items:center;gap:10px;min-width:0}.layer-source span{width:25px;height:25px;border-radius:7px;border:1px solid rgba(15,23,42,.15);flex:0 0 auto}.layer-source strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layer-line-count{text-align:center;color:#475569}.layer-manager-row select{height:42px;border:1px solid #cbd5e1;border-radius:9px;padding:0 10px;background:#fff}.layer-select-all{height:40px;border:1px solid #cbd5e1;background:#fff;border-radius:9px;font-weight:800;cursor:pointer}.layer-select-all:hover{border-color:#F54325;color:#F54325}.layer-manager-dialog footer{display:flex;justify-content:flex-end;gap:10px;border-top:1px solid #e5e7eb;margin-top:12px;padding-top:16px}.layer-manager-empty{padding:28px;text-align:center;color:#64748b}
@media(max-width:760px){.layer-manager-table-head{display:none}.layer-manager-row{grid-template-columns:1fr 60px}.layer-manager-row select{grid-column:1/-1}.layer-select-all{grid-column:1/-1}.layer-manager-dialog{padding:16px}.rdworks-palette.horizontal .color-swatch{min-width:122px!important}}

/* v7.0 language selector */
.topbar-title { position: relative; }
.language-switcher {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 20;
}
.language-switcher label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}
.language-switcher select {
  min-width: 148px;
  height: 36px;
  padding: 0 34px 0 12px;
  border: 1px solid #dbe3ec;
  border-radius: 9px;
  background: #fff;
  color: #172033;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15,23,42,.05);
}
@media (max-width: 980px) {
  .language-switcher { position: static; margin-top: 12px; width: max-content; }
}


/* v7.0.1 — laserlagen op één regel, zonder aantallen */
.canvas-layerbar{
  flex-wrap:nowrap !important;
  min-width:0;
}
.layerbar-title{
  flex:0 0 auto;
  min-width:74px !important;
}
#layerPalette{
  display:flex !important;
  align-items:center !important;
  flex-wrap:nowrap !important;
  gap:7px !important;
  min-width:0;
  width:100%;
}
#layerPalette .color-swatch{
  flex:1 1 0;
  min-width:0 !important;
  padding:7px 8px !important;
  padding-right:8px !important;
  overflow:hidden;
}
#layerPalette .color-swatch > small{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.layer-count-badge{display:none !important;}
.layer-manager-btn{
  flex:0 0 auto;
  height:40px;
  padding:0 12px;
  border-radius:8px;
}
.layer-overig-chip{
  flex:0 0 auto;
  height:40px;
  padding:0 10px;
  border-radius:8px;
}
@media(max-width:1180px){
  .layerbar-title{display:none;}
  #layerPalette{gap:5px !important;}
  #layerPalette .color-swatch{font-size:12px !important;padding:6px !important;}
  #layerPalette .color-swatch span{width:17px !important;height:17px !important;}
  #layerPalette .color-swatch small{font-size:8px !important;}
  .layer-manager-btn{padding:0 9px;font-size:12px;}
}
@media(max-width:900px){
  .canvas-layerbar{overflow-x:auto;}
  #layerPalette{min-width:820px;}
}

/* Betrouwbare modalsluiting en Luxigo-tooltipstijl */
.layer-manager-backdrop{cursor:pointer;}
.layer-manager-close:hover{background:#fee9e5;color:#d9341e;}
.tool-btn::after{
  border-left:3px solid #F54325;
  transition:opacity .14s ease,transform .14s ease;
}
.tool-btn:hover::after{transform:translateY(-50%) translateX(0);}


/* v7.0.2 — sluitbaar kleurbeheer en exacte rechteruitlijning header */
.topbar.minimal-topbar .topbar-title{
  max-width:none !important;
  width:100% !important;
  box-sizing:border-box;
}
.top-help-links{
  max-width:none !important;
  width:100% !important;
}
.shortcut-help{
  margin-left:auto !important;
}
.language-switcher{
  right:0 !important;
}
.layer-manager-close,
[data-layer-close]{
  pointer-events:auto !important;
}

/* v7.0.5 — exportkeuze bij meerdere werkgebieden */
.export-choice-modal{
  position:fixed; inset:0; z-index:10050; display:none; align-items:center; justify-content:center;
  padding:24px;
}
.export-choice-modal.is-open{display:flex;}
.export-choice-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.58);backdrop-filter:blur(3px);}
.export-choice-dialog{
  position:relative; width:min(720px,100%); background:#fff; border-radius:22px; padding:28px;
  box-shadow:0 28px 80px rgba(15,23,42,.28); color:#172033;
}
.export-choice-dialog header{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;padding-bottom:20px;border-bottom:1px solid #e5eaf0;}
.export-choice-dialog h2{margin:0 0 5px;font-size:26px;line-height:1.15;}
.export-choice-dialog h2:before{content:'';display:inline-block;width:5px;height:22px;border-radius:4px;background:#F54325;margin-right:12px;vertical-align:-2px;}
.export-choice-dialog header p{margin:0;color:#718096;font-size:15px;}
.export-choice-close{width:46px;height:46px;border:0;border-radius:13px;background:#f1f5f9;font-size:28px;line-height:1;cursor:pointer;flex:0 0 auto;}
.export-choice-close:hover{background:#fee9e5;color:#d9341e;}
.export-choice-options{display:grid;grid-template-columns:1fr 1fr;gap:14px;padding:22px 0;}
.export-choice-card{display:flex;align-items:flex-start;gap:15px;text-align:left;border:1px solid #d7e0ea;border-radius:15px;background:#fff;padding:19px;cursor:pointer;color:inherit;transition:.16s ease;}
.export-choice-card:hover,.export-choice-card:focus-visible{border-color:#F54325;box-shadow:0 0 0 3px rgba(245,67,37,.10);transform:translateY(-1px);outline:none;}
.export-choice-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:11px;background:#fff0ed;color:#F54325;font-size:23px;flex:0 0 auto;}
.export-choice-card strong{display:block;font-size:16px;margin:1px 0 6px;}
.export-choice-card small{display:block;color:#718096;font-size:13px;line-height:1.45;}
.export-choice-dialog footer{display:flex;justify-content:flex-end;padding-top:18px;border-top:1px solid #e5eaf0;}
.export-choice-dialog footer .btn{min-width:150px;}
@media(max-width:650px){.export-choice-options{grid-template-columns:1fr}.export-choice-dialog{padding:22px}.export-choice-dialog h2{font-size:22px}}

/* v7.1.1 — sticky desktopeditor en export onder werkgebied op mobiel */
#exportDesktopAnchor{
  display:none;
}
.mobile-export-mount{
  display:none;
}

@media (min-width: 901px){
  .workspace{
    align-self:start;
    min-height:100vh;
  }
  .workspace > .canvas-wrap{
    position:sticky;
    top:12px;
    z-index:20;
    max-height:calc(100vh - 24px);
    overflow:auto;
    overscroll-behavior:contain;
    scrollbar-gutter:stable;
    background:#fff;
  }
  .workspace > .canvas-wrap .canvas-stage{
    min-height:max-content;
  }
}

@media (max-width: 900px){
  .workspace > .canvas-wrap{
    position:static;
    max-height:none;
    overflow:visible;
  }
  .mobile-export-mount{
    display:block;
    padding:0 14px 24px;
    background:#f7f7f7;
  }
  .mobile-export-mount .step-heading{
    margin-top:20px !important;
  }
  .mobile-export-mount .export-panel{
    width:100%;
    margin-bottom:0 !important;
  }
}

/* v7.2.0 — desktop CAD-layout met onafhankelijke scrollgebieden */
@media (min-width: 901px){
  html, body{
    height:100%;
    overflow:hidden;
  }
  .app-shell{
    height:100vh;
    min-height:0;
    grid-template-columns:var(--sidebar-w) minmax(0,1fr);
    overflow:hidden;
  }
  .sidebar{
    height:100vh;
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
    scrollbar-gutter:stable;
    padding-bottom:0;
  }
  .workspace{
    height:100vh;
    min-height:0;
    overflow:hidden;
    display:flex;
    flex-direction:column;
  }
  .workspace > .topbar{
    flex:0 0 auto;
    position:relative;
    z-index:30;
  }
  .workspace > .canvas-wrap{
    position:relative !important;
    top:auto !important;
    flex:1 1 auto;
    min-height:0;
    max-height:none !important;
    overflow:auto !important;
    overscroll-behavior:contain;
    scrollbar-gutter:stable both-edges;
    background:#f4f6f8;
  }
  .workspace > .canvas-wrap .canvas-stage{
    min-height:max-content;
  }
  .desktop-export-dock{
    position:sticky;
    bottom:0;
    z-index:40;
    margin:0 -18px;
    padding:10px 18px 16px;
    background:linear-gradient(180deg,rgba(251,252,253,0),#fbfcfd 18px,#fbfcfd 100%);
  }
  .desktop-export-dock .step-heading{
    margin-top:12px;
  }
  .desktop-export-dock .export-panel{
    margin-bottom:0;
    box-shadow:0 -8px 28px rgba(15,23,42,.07);
  }
  #exportDesktopAnchor{
    display:block;
    height:1px;
  }
}

/* Mobiel: normale documentflow, export direct onder het werkgebied */
@media (max-width: 900px){
  html, body{
    height:auto;
    overflow:auto;
  }
  .app-shell{
    min-height:100vh;
    height:auto;
    overflow:visible;
  }
  .sidebar,
  .workspace{
    height:auto;
    min-height:0;
    overflow:visible;
  }
  .workspace > .canvas-wrap{
    flex:none;
    overflow:auto;
  }
  .mobile-export-mount{
    display:block;
    padding:0 14px 24px;
    background:#f7f7f7;
  }
  .mobile-export-mount .step-heading{
    margin-top:20px !important;
  }
  .mobile-export-mount .export-panel{
    margin-bottom:0 !important;
  }
  .desktop-export-dock{
    display:none !important;
  }
}

/* v7.2.1 — export onderaan in normale desktopflow, zonder overlap */
@media (min-width: 901px){
  .desktop-export-dock{
    position:relative;
    bottom:auto;
    z-index:auto;
    margin:0;
    padding:0 0 28px;
    background:transparent;
  }
  .desktop-export-dock .step-heading{
    margin-top:26px;
  }
  .desktop-export-dock .export-panel{
    margin-bottom:0;
    box-shadow:none;
  }
  #exportDesktopAnchor{
    display:block;
    height:0;
  }
}


/* v7.2.2 — vaste desktop actiebalk onder het werkgebied */
.workspace-actionbar{display:none;}
@media (min-width:901px){
  .workspace-actionbar{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
    flex:0 0 auto;
    padding:12px 18px 14px;
    border-top:1px solid #e2e8f0;
    background:rgba(255,255,255,.96);
    backdrop-filter:blur(12px);
    box-shadow:0 -10px 28px rgba(15,23,42,.06);
    z-index:35;
  }
  .workspace-actionbar .btn{
    width:100%;
    min-height:48px;
    margin:0;
    white-space:nowrap;
  }
}
@media (max-width:900px){
  .workspace-actionbar{display:none !important;}
}


/* v7.2.7 — Instructions modal: full-height content + header action */
#instructionsModal .modal-card {
  height:min(900px, calc(100vh - 48px));
}
#instructionsModal .instructions-frame-wrap {
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
}
#instructionsModal .instructions-frame-wrap iframe {
  display:block;
  width:100%;
  height:100%;
  min-height:0;
}
.instructions-header-actions {
  display:flex;
  align-items:center;
  gap:12px;
  flex:0 0 auto;
}
.instructions-new-tab {
  white-space:nowrap;
  font-weight:700;
}
@media (max-width: 640px) {
  #instructionsModal.modal-overlay { padding:10px; }
  #instructionsModal .modal-card { height:calc(100vh - 20px); width:100%; }
  #instructionsModal .modal-header { padding:12px; gap:8px; }
  #instructionsModal .modal-header > div:first-child span { display:none; }
  .instructions-header-actions { gap:8px; }
  .instructions-new-tab { font-size:0; }
  .instructions-new-tab::after { content:'Nieuw tabblad ↗'; font-size:12px; }
}
