/* Sprinttrack Studio - Bos Rubber
   Huisstijl-tokens overgenomen uit de originele configurator */

:root {
  --editor: #0c0d0f;
  --editor-panel: #161719;
  --editor-panel-2: #1c1d20;
  --editor-fg: #f8f8f8;
  --editor-muted: #96989b;
  --editor-border: rgba(255, 255, 255, 0.12);
  --accent: #3196b8;
  --accent-fg: #fcfcfc;
  --action: #0a5c7d;
  --action-fg: #fcfcfc;
  --stage: #0d0e10;
  --font-sans: "Barlow", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Barlow Condensed", "Barlow", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--editor);
  color: var(--editor-fg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
body { -webkit-tap-highlight-color: transparent; }

.app { display: flex; height: 100dvh; width: 100%; }



/* ---------- sidebar ---------- */
.sidebar {
  display: flex; flex-direction: column;
  width: 46%; max-width: 660px; min-width: 480px;
  background: var(--editor);
  border-right: 1px solid var(--editor-border);
  position: relative; z-index: 5;
}

.sidebar-head { padding: 30px 34px 0; }
.brand-logo-wrap { position: relative; display: inline-block; margin-bottom: 18px; }
.brand-logo {
  display: block; height: 40px; width: auto;
  filter: brightness(0.72) saturate(0.88) drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
}
.brand-logo-shine {
  position: absolute; inset: 0; pointer-events: none;
  -webkit-mask-image: url('../img/logo.png');
  -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: left center;
  mask-image: url('../img/logo.png');
  mask-size: contain; mask-repeat: no-repeat; mask-position: left center;
  background: linear-gradient(115deg,
    transparent 34%,
    rgba(255, 244, 235, 0.16) 45%,
    rgba(255, 248, 242, 0.32) 50%,
    rgba(255, 244, 235, 0.16) 55%,
    transparent 66%);
  background-size: 260% 100%;
  background-repeat: no-repeat;
  animation: logoShine 6.5s ease-in-out infinite;
  mix-blend-mode: screen;
}
@keyframes logoShine {
  0% { background-position: 130% 0; }
  48% { background-position: -30% 0; }
  100% { background-position: -30% 0; }
}
.sidebar-head h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 2.9vw, 46px);
  font-weight: 700; text-transform: uppercase; line-height: 0.95; letter-spacing: 0.005em;
}
.sidebar-head h1 em { font-style: italic; }
.head-rule { border-top: 1px solid var(--editor-border); margin-top: 20px; }

.step-heading { display: flex; gap: 16px; padding: 20px 34px; border-bottom: 1px solid var(--editor-border); }
.step-heading .num { font-size: 13px; font-weight: 700; line-height: 1.3; white-space: pre; color: var(--editor-fg); }
.step-heading h2 { font-family: var(--font-display); font-size: 19px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.step-heading p { margin-top: 3px; font-size: 13px; color: var(--editor-muted); }

.panel { flex: 1; overflow-y: auto; padding: 24px 34px; scrollbar-width: thin; scrollbar-color: #333 transparent; }
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb { background: #2c2d30; border-radius: 4px; }

.panel-inner { animation: panelIn 0.32s cubic-bezier(0.22, 0.8, 0.3, 1) both; }
@keyframes panelIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- template-kaarten ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tpl-card {
  position: relative; text-align: left;
  border: 1px solid var(--editor-border); border-radius: 6px; overflow: hidden;
  background: var(--editor-panel);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.tpl-card:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.3); }
.tpl-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 10px 30px -12px rgba(49, 150, 184, 0.45);
}
.tpl-card .thumb { position: relative; aspect-ratio: 3 / 4; background: #0a0b0c; overflow: hidden; }
.tpl-card .thumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.tpl-card .thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.82) 100%);
}
.tpl-card .meta { position: absolute; left: 10px; right: 10px; bottom: 9px; z-index: 2; }
.tpl-card .meta h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; line-height: 1.2; letter-spacing: 0.02em; }
.tpl-card .meta p { margin-top: 3px; font-size: 10.5px; line-height: 1.35; color: #c4c6c9; }
.tpl-card.scratch {
  display: flex; align-items: center; justify-content: center;
  border-style: dashed; background: transparent; aspect-ratio: auto;
}
.tpl-card.scratch .scratch-inner { text-align: center; padding: 12px; }
.tpl-card.scratch .plus {
  display: block; margin: 0 auto 8px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--editor-border); line-height: 32px; font-size: 18px; color: var(--editor-muted);
  transition: all 0.18s ease;
}
.tpl-card.scratch:hover .plus { border-color: var(--accent); color: var(--accent); transform: rotate(90deg); }
.tpl-card.scratch h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; line-height: 1.3; }

/* ---------- formulier-elementen ---------- */
.field-block { margin-bottom: 26px; }
.field-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--editor-muted); margin-bottom: 12px;
}
.field-label .value { color: var(--editor-fg); font-size: 14px; letter-spacing: 0; }
.field-label .value b { color: var(--accent); font-size: 18px; font-weight: 800; }
/* intypbare waarde naast de schuifregelaar */
.field-label .value-input {
  -moz-appearance: textfield; appearance: textfield;
  width: 4.2ch; padding: 0 2px; margin: 0; background: transparent; border: 0;
  border-bottom: 1px dashed var(--accent); border-radius: 0;
  color: var(--accent); font: inherit; font-size: 18px; font-weight: 800; letter-spacing: 0;
  text-align: right; cursor: text; outline: none;
}
.field-label .value-input::-webkit-outer-spin-button,
.field-label .value-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field-label .value-input:focus { border-bottom-style: solid; background: rgba(255, 255, 255, 0.05); }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) var(--fill, 50%), #2a2b2e var(--fill, 50%));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%;
  background: var(--editor-fg); border: 4px solid var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); transition: transform 0.12s ease;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: #2a2b2e; }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--editor-fg); border: 4px solid var(--accent);
}
.range-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: #5c5e62; margin-top: 2px; }

.hint-note {
  display: flex; gap: 10px; padding: 13px 14px; border-radius: 4px;
  background: var(--editor-panel); border: 1px solid var(--editor-border);
  font-size: 12.5px; line-height: 1.5; color: var(--editor-muted);
}
.hint-note::before { content: "i"; flex: none; width: 17px; height: 17px; border-radius: 50%;
  border: 1px solid var(--editor-muted); font-size: 11px; text-align: center; line-height: 16px; margin-top: 1px; }

.seg-group { display: flex; gap: 8px; }
.seg-btn {
  flex: 1; padding: 13px 10px; border: 1px solid var(--editor-border); border-radius: 4px;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--editor-fg); background: var(--editor-panel);
  transition: all 0.15s ease;
}
.seg-btn:hover { border-color: rgba(255, 255, 255, 0.32); }
.seg-btn.active { border-color: var(--accent); background: rgba(49, 150, 184, 0.14); color: var(--accent); }

.lane-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lane-btn {
  padding: 16px 0 12px; border: 1px solid var(--editor-border); border-radius: 4px;
  background: var(--editor-panel); text-align: center; transition: all 0.15s ease;
}
.lane-btn .lanes-ico { display: flex; justify-content: center; gap: 3px; height: 20px; margin-bottom: 8px; }
.lane-btn .lanes-ico i { width: 7px; background: #3a3c40; border-radius: 1px; transition: background 0.15s ease; }
.lane-btn b { font-size: 14px; font-weight: 800; }
.lane-btn:hover { border-color: rgba(255, 255, 255, 0.32); }
.lane-btn.active { border-color: var(--accent); background: rgba(49, 150, 184, 0.14); }
.lane-btn.active .lanes-ico i { background: var(--accent); }

.toggle-panel {
  display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--editor-border); border-radius: 6px; background: var(--editor-panel); padding: 6px 16px;
}
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.toggle-row + .toggle-row { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.toggle-row span { font-size: 13.5px; }
.switch {
  position: relative; width: 44px; height: 24px; border-radius: 12px; flex: none;
  background: #303236; transition: background 0.18s ease;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform 0.18s cubic-bezier(0.3, 1.4, 0.6, 1);
}
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }

/* ---------- kleuren ---------- */
.color-section { border: 1px solid var(--editor-border); border-radius: 6px; background: var(--editor-panel); margin-bottom: 12px; overflow: hidden; }
.color-section > .sect-head {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  padding: 14px 16px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.color-section .chev { transition: transform 0.2s ease; color: var(--editor-muted); font-size: 11px; }
.color-section.open .chev { transform: rotate(180deg); }
.color-section .sect-body { display: none; padding: 4px 16px 16px; }
.color-section.open .sect-body { display: block; }

.swatch-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--editor-muted); margin: 12px 0 10px; }
.swatch-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 6px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.swatch .dot {
  width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  position: relative; transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  background-size: cover;
}
.swatch:hover .dot { transform: scale(1.12); border-color: rgba(255, 255, 255, 0.4); }
.swatch.selected .dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--editor-panel), 0 0 0 4px var(--accent);
}
.swatch.selected .dot::after {
  content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 14px; font-weight: 800; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.swatch span { font-size: 9.5px; color: var(--editor-muted); text-align: center; line-height: 1.15; }
.swatch.selected span { color: var(--editor-fg); }
.swatch .swatch-badge { font-size: 8px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }

.width-warning {
  display: none; margin-top: 14px; padding: 11px 13px; border-radius: 4px;
  border: 1px solid rgba(217, 161, 59, 0.45); background: rgba(217, 161, 59, 0.1);
  font-size: 12px; line-height: 1.5; color: #e6c789;
}

.config-disclaimer {
  padding: 11px 34px; border-top: 1px solid var(--editor-border);
  font-size: 10.5px; line-height: 1.5; color: var(--editor-fg);
}
.credits-link {
  font: inherit; color: var(--editor-muted); text-decoration: underline; text-underline-offset: 2px;
  background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap;
}
.credits-link:hover { color: var(--editor-fg); }
.dialog--small { max-width: 400px; }
.dialog--small .credit-text { margin-top: 14px; font-size: 12.5px; line-height: 1.6; color: var(--editor-fg); }
.dialog--small .credit-text a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- footer ---------- */
.sidebar-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border-top: 1px solid var(--editor-border); padding: 18px 34px;
}
.footer-note { font-size: 12px; color: var(--editor-muted); }
.link-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--editor-muted); transition: color 0.15s ease;
}
.link-btn:hover { color: var(--editor-fg); }
.cta-btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 30px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--action); color: var(--action-fg);
  border-radius: 6px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.cta-btn .arr { transition: transform 0.18s ease; }
.cta-btn:hover:not(:disabled) { opacity: 0.92; }
.cta-btn:hover:not(:disabled) .arr { transform: translateX(4px); }
.cta-btn:disabled { background: var(--editor-panel); color: var(--editor-muted); cursor: not-allowed; }
.cta-btn.brand { background: var(--accent); color: var(--accent-fg); box-shadow: 0 12px 34px -14px rgba(49, 150, 184, 0.6); }

/* ---------- stage ---------- */
.stage-wrap { position: relative; flex: 1; display: flex; flex-direction: column; background: var(--stage); min-width: 0; }

.progress-bar {
  position: relative; z-index: 6;
  display: flex; align-items: flex-start; justify-content: center; gap: 0;
  padding: 22px 20px 8px;
}
.p-step { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 120px; position: relative; }
.p-step .dot-wrap { display: flex; align-items: center; width: 100%; }
.p-step .line { flex: 1; height: 2px; background: #2a2c30; transition: background 0.3s ease; }
.p-step .line.filled { background: var(--accent); }
.p-step .line.hidden-line { visibility: hidden; }
.p-step .circle {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 2px solid #2a2c30; background: var(--stage);
  display: grid; place-items: center; font-size: 11px; color: #fff;
  transition: all 0.25s ease; cursor: pointer;
}
.p-step .circle .inner { width: 8px; height: 8px; border-radius: 50%; background: transparent; transition: background 0.2s ease; }
.p-step.current .circle { border-color: var(--accent); }
.p-step.current .circle .inner { background: var(--accent); animation: pulse 2s ease-in-out infinite; }
.p-step.done .circle { border-color: var(--accent); background: var(--accent); }
.p-step span { font-size: 12px; color: var(--editor-muted); transition: color 0.2s ease; }
.p-step.current span { color: var(--editor-fg); font-weight: 600; }
.p-step:not(.disabled) { cursor: pointer; }
.p-step.disabled .circle { cursor: default; }
@keyframes pulse { 50% { transform: scale(1.5); opacity: 0.6; } }

.stage { position: relative; flex: 1; min-height: 0; }
.stage canvas.gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.stage canvas.gl:active { cursor: grabbing; }

/* bewegende achtergrond-glow over de 3D-weergave */
.glow-overlay { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: 0.75; }
.glow-overlay::before, .glow-overlay::after {
  content: ""; position: absolute; width: 58%; height: 58%; border-radius: 50%;
  filter: blur(90px);
}
.glow-overlay::before {
  background: radial-gradient(circle, rgba(49, 150, 184, 0.15), transparent 65%);
  top: -18%; left: -12%;
  animation: drift1 16s ease-in-out infinite alternate;
}
.glow-overlay::after {
  background: radial-gradient(circle, rgba(10, 92, 125, 0.18), transparent 65%);
  bottom: -20%; right: -14%;
  animation: drift2 19s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(11%, 16%) scale(1.18); } }
@keyframes drift2 { to { transform: translate(-13%, -12%) scale(1.12); } }

.dim-label {
  position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; opacity: 0;
  padding: 5px 10px; border-radius: 3px;
  background: rgba(16, 17, 19, 0.88); border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--editor-fg);
  white-space: nowrap;
}

.spec-chip {
  position: absolute; left: 22px; bottom: 20px; z-index: 5;
  display: flex; align-items: center; gap: 14px;
  padding: 11px 16px; border-radius: 5px;
  background: rgba(15, 16, 18, 0.78); border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  font-size: 12px; color: var(--editor-muted);
  opacity: 0; transform: translateY(8px); transition: all 0.3s ease;
}
.spec-chip.visible { opacity: 1; transform: none; }
.spec-chip b { color: var(--editor-fg); font-weight: 700; }
.spec-chip .sep { width: 1px; height: 16px; background: rgba(255, 255, 255, 0.14); }
.spec-chip .m2 { color: var(--accent); font-weight: 800; }

.view-controls {
  position: absolute; right: 22px; bottom: 20px; z-index: 5;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.view-toggle {
  display: flex; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 5px; overflow: hidden;
  background: rgba(15, 16, 18, 0.78); backdrop-filter: blur(10px);
}
.view-toggle button {
  padding: 9px 14px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--editor-muted); transition: all 0.15s ease;
}
.view-toggle button.active { background: var(--accent); color: var(--accent-fg); }
.view-toggle button:not(.active):hover { color: var(--editor-fg); }
.icon-stack { display: flex; flex-direction: column; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 5px; display: grid; place-items: center;
  background: rgba(15, 16, 18, 0.78); border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px); color: var(--editor-fg); font-size: 16px;
  transition: all 0.15s ease;
}
.icon-btn:hover { background: var(--accent); border-color: var(--accent); }

.drag-hint {
  position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(15, 16, 18, 0.72); border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px; color: var(--editor-muted); pointer-events: none;
  opacity: 0; transition: opacity 0.5s ease;
}
.drag-hint.visible { opacity: 1; }
.drag-hint .orb { width: 14px; height: 14px; border: 1.5px solid var(--accent); border-radius: 50%; position: relative; animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }

.stage-empty {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; pointer-events: none;
  transition: opacity 0.4s ease;
}
.stage-empty .card {
  padding: 34px 44px; border-radius: 8px; text-align: center;
  background: rgba(18, 19, 21, 0.86); border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}
.stage-empty .card .ico { font-size: 30px; margin-bottom: 12px; opacity: 0.85; }
.stage-empty .card h3 { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.stage-empty .card p { margin-top: 6px; font-size: 12.5px; color: var(--editor-muted); }
.stage-empty.hidden { opacity: 0; }

/* ---------- dialog ---------- */
.dialog-backdrop {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, 0.66); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity 0.22s ease;
}
.dialog-backdrop.open { opacity: 1; pointer-events: auto; }
.dialog {
  width: 100%; max-width: 470px; max-height: 92dvh; overflow-y: auto;
  background: var(--editor); border: 1px solid var(--editor-border); border-radius: 10px;
  padding: 26px 28px; position: relative;
  transform: translateY(14px) scale(0.98); transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8);
}
.dialog-backdrop.open .dialog { transform: none; }
.dialog h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; text-transform: uppercase; padding-right: 30px; }
.dialog .sub { margin-top: 6px; font-size: 13px; line-height: 1.55; color: var(--editor-muted); }
.dialog-close { position: absolute; right: 16px; top: 16px; color: var(--editor-muted); font-size: 20px; line-height: 1; }
.dialog-close:hover { color: var(--editor-fg); }

.dlg-field { margin-top: 14px; }
.dlg-field label { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--editor-muted); margin-bottom: 7px; }
.dlg-field .err { color: #ff6b5e; text-transform: none; letter-spacing: 0; font-weight: 600; margin-left: 8px; }
.editor-input {
  width: 100%; padding: 12px 13px; font-family: inherit; font-size: 14px; color: var(--editor-fg);
  background: var(--editor-panel); border: 1px solid var(--editor-border); border-radius: 4px;
  outline: none; transition: border-color 0.15s ease;
}
.editor-input:focus { border-color: var(--accent); }
.editor-input::placeholder { color: #5b5d61; }
textarea.editor-input { resize: none; }

.logo-block { margin-top: 16px; padding: 14px; border: 1px solid var(--editor-border); border-radius: 5px; background: var(--editor-panel); }
.logo-block .q { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--editor-muted); margin-bottom: 10px; }
.yn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.yn-btn {
  padding: 10px; border: 1px solid var(--editor-border); border-radius: 4px;
  font-size: 13px; font-weight: 700; text-transform: uppercase; transition: all 0.15s ease;
}
.yn-btn.active { border-color: var(--accent); background: rgba(49, 150, 184, 0.14); color: var(--accent); }
.upload-zone {
  margin-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 20px 12px; border: 2px dashed rgba(255, 255, 255, 0.2); border-radius: 5px;
  color: var(--editor-muted); font-size: 13px; cursor: pointer; text-align: center;
  transition: border-color 0.15s ease;
}
.upload-zone:hover { border-color: rgba(255, 255, 255, 0.42); }
.upload-zone input { display: none; }
.upload-file {
  margin-top: 12px; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid rgba(49, 150, 184, 0.6); border-radius: 4px;
  background: rgba(49, 150, 184, 0.1); font-size: 13px;
}
.upload-file .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-err { margin-top: 8px; font-size: 12px; color: #ff6b5e; }

.dlg-actions { margin-top: 20px; display: flex; flex-direction: column; gap: 9px; }
.dlg-primary {
  width: 100%; padding: 15px; background: var(--accent); color: var(--accent-fg);
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 6px;
  transition: opacity 0.15s ease;
}
.dlg-primary:hover:not(:disabled) { opacity: 0.92; }
.dlg-primary:disabled { opacity: 0.55; cursor: wait; }
.dlg-secundair { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.dlg-ghost {
  padding: 13px; border: 1px solid var(--editor-border); border-radius: 4px;
  font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--editor-fg); transition: all 0.15s ease;
}
.dlg-ghost:hover:not(:disabled) { border-color: var(--editor-fg); }
.dlg-ghost:disabled { opacity: 0.55; cursor: wait; }

.dlg-done { display: flex; flex-direction: column; align-items: center; gap: 13px; padding: 22px 0 10px; text-align: center; }
.dlg-done .check {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 26px;
  animation: popIn 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes popIn { from { transform: scale(0.3); opacity: 0; } }
.dlg-done h2 { font-size: 20px; }
.dlg-done p { font-size: 13.5px; line-height: 1.55; color: var(--editor-muted); max-width: 330px; }

.spinner {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(70px); z-index: 80;
  padding: 12px 20px; border-radius: 6px; font-size: 13px; font-weight: 600;
  background: var(--editor-panel-2); border: 1px solid var(--editor-border); color: var(--editor-fg);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  box-shadow: 0 18px 44px -16px rgba(0, 0, 0, 0.7);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- mobiel: 3D bovenin, configuratie als bottom-sheet ---------- */
.sheet-handle { display: none; }
.stage-brand { display: none; }

@media (max-width: 1023px) {
  .app { flex-direction: column; }

  .stage-wrap { order: 1; flex: 1 1 auto; min-height: 0; }
  .sidebar {
    order: 2; width: 100%; max-width: none; min-width: 0;
    border-right: none; border-top: 1px solid var(--editor-border);
    border-radius: 16px 16px 0 0;
    max-height: 56dvh;
    box-shadow: 0 -18px 44px -18px rgba(0, 0, 0, 0.85);
  }
  .sidebar.collapsed .panel { display: none; }
  .sidebar.collapsed .step-heading { border-bottom: none; }

  .sheet-handle { display: flex; justify-content: center; padding: 10px 0 6px; width: 100%; }
  .sheet-handle span { width: 42px; height: 4px; border-radius: 2px; background: #3f4145; }

  .sidebar-head { display: none; }
  .step-heading { padding: 4px 20px 12px; gap: 12px; }
  .step-heading h2 { font-size: 15px; }
  .step-heading p { font-size: 12px; }
  .panel { padding: 14px 20px; }
  .sidebar-footer { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
  .config-disclaimer { padding: 9px 20px; font-size: 10px; }
  .sidebar.collapsed .config-disclaimer { display: none; }
  .footer-note { font-size: 11px; }
  .cta-btn { padding: 14px 22px; font-size: 12px; white-space: nowrap; flex: none; }
  .link-btn { white-space: nowrap; font-size: 11px; }

  /* compacte voortgang */
  .progress-bar { padding: 10px 6px 2px; }
  .p-step { width: auto; flex: 1; max-width: 106px; }
  .p-step .circle { width: 18px; height: 18px; font-size: 9px; }
  .p-step .circle .inner { width: 6px; height: 6px; }
  .p-step span { font-size: 10px; }

  /* merk zwevend op de stage */
  .stage-brand {
    display: block; position: absolute; top: 10px; left: 12px; z-index: 6;
    height: 24px; width: auto;
    filter: brightness(0.72) saturate(0.88) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
  }

  /* spec-chip rechtsboven, ingekort tot maat + m2 */
  .spec-chip {
    left: auto; right: 10px; top: 10px; bottom: auto;
    padding: 7px 10px; gap: 8px; font-size: 10.5px;
    transform: translateY(-8px);
  }
  .spec-chip.visible { transform: none; }
  .spec-chip > *:nth-child(n+4) { display: none; }

  /* compacte view-controls; zoomen gaat via knijpen */
  .view-controls { right: 10px; bottom: 12px; gap: 6px; }
  .view-toggle button { padding: 7px 10px; font-size: 10px; letter-spacing: 0.03em; }
  .icon-stack { flex-direction: row; justify-content: flex-end; }
  #btnZoomIn, #btnZoomOut { display: none; }
  .icon-btn { width: 34px; height: 34px; font-size: 14px; }

  .drag-hint { display: none !important; }
  .stage-empty .card { padding: 22px 26px; margin: 0 16px; }

  /* templates als swipe-carrousel */
  .tpl-grid {
    display: flex; overflow-x: auto; gap: 10px; padding: 2px 2px 8px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tpl-grid::-webkit-scrollbar { display: none; }
  .tpl-card { flex: 0 0 126px; scroll-snap-align: start; }
  .tpl-card.scratch { aspect-ratio: 3 / 4; }

  /* invoer */
  .swatch-grid { grid-template-columns: repeat(5, 1fr); }
  .swatch .dot { width: 34px; height: 34px; }
  .field-block { margin-bottom: 20px; }
  .lane-btn { padding: 12px 0 9px; }

  /* dialoog als sheet vanaf de onderkant */
  .dialog-backdrop { padding: 0; align-items: end; justify-items: stretch; }
  .dialog {
    max-width: none; border-radius: 16px 16px 0 0; max-height: 90dvh;
    padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  }
  .editor-input { font-size: 16px; }

  .dim-label { font-size: 10px; padding: 4px 8px; }
}
