:root {
  --bg: #0f1013;
  --panel: #17181d;
  --card: #1f2127;
  --line: #2c2f38;
  --text: #f1efe9;
  --muted: #9a9ca6;
  --accent: #ff6b2c;
  --accent-ink: #1a0d05;
  --ok: #4fd08a;
  --warn: #ffb648;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
}
.brand { color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 14px; }
.brand img { height: 26px; width: auto; display: block; }
.brand-sub { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; padding-left: 14px; border-left: 1px solid var(--line); }
.foot { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 16px; }
.foot img { height: 22px; width: auto; flex: none; opacity: .85; }
.foot p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.top-note { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 430px; min-height: calc(100vh - 53px); }

/* ---------- 3D ---------- */
.stage {
  position: sticky; top: 0; height: calc(100vh - 53px); min-height: 380px; overflow: hidden;
  background:
    radial-gradient(70% 60% at 50% 46%, #5d626f 0%, #3a3d47 38%, #1c1d22 78%, #121317 100%);
}
#viewer { position: absolute; inset: 0; cursor: grab; touch-action: none; }
#viewer:active { cursor: grabbing; }
#viewer canvas { display: block; }
.stage-chips { position: absolute; left: 18px; top: 16px; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.chip { font-size: 12px; color: var(--text); background: rgba(15, 16, 19, .6); border: 1px solid var(--line); padding: 5px 11px; border-radius: 99px; backdrop-filter: blur(6px); }
.chip.warn { color: var(--warn); border-color: rgba(255, 182, 72, .4); }
.stage-hint { position: absolute; left: 0; right: 0; bottom: 14px; margin: 0; text-align: center; font-size: 12px; color: var(--muted); pointer-events: none; }
.overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: rgba(15, 16, 19, .82); color: var(--muted); text-align: center; padding: 24px; transition: opacity .25s; }
.overlay.hidden { display: none; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.overlay.error .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- paneel ---------- */
.panel { background: var(--panel); border-left: 1px solid var(--line); padding: 26px 26px 40px; }
h1 { font-size: 26px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -.01em; }
.lead { margin: 0 0 22px; color: var(--muted); }
.step { padding: 18px 0; border-top: 1px solid var(--line); }
.step h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; color: var(--text); }
.step h2 b { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-content: center; font-size: 12px; }
.help { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

.text-field { position: relative; }
.text-field input {
  width: 100%; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  color: var(--text); font: 800 28px/1 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase;
  padding: 16px 64px 16px 16px; outline: none;
}
.text-field input:focus { border-color: var(--accent); }
#count { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); }
.examples { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.examples button { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 4px 11px; font: inherit; font-size: 12px; cursor: pointer; }
.examples button:hover { color: var(--text); border-color: var(--muted); }

.designs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.design {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); color: var(--text);
  padding: 12px 10px 10px; cursor: pointer; text-align: left; font: inherit; display: grid; gap: 8px;
}
.design svg { width: 100%; display: block; color: #d9d6ce; }
.design strong { display: block; font-size: 14px; }
.design small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.design:hover { border-color: var(--muted); }
.design[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 107, 44, .18); }
.design[aria-checked="true"] svg { color: var(--accent); }

.swatches { display: flex; gap: 9px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--panel); outline: 1.5px solid var(--line); cursor: pointer; padding: 0; }
.swatch[aria-checked="true"] { outline: 2.5px solid var(--accent); }
.toggle { display: flex; align-items: center; gap: 9px; margin-top: 14px; font-size: 13.5px; color: var(--muted); cursor: pointer; flex-wrap: wrap; }
.toggle.first { margin-top: 0; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.mini-swatches { display: inline-flex; gap: 6px; margin-left: auto; }
.mini-swatches button { width: 18px; height: 18px; border-radius: 50%; border: 0; outline: 1.5px solid var(--line); cursor: pointer; padding: 0; }
.mini-swatches button[aria-checked="true"] { outline: 2px solid var(--text); }

form { display: grid; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
form input, form textarea, .bericht-tekst { background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; color: var(--text); font: inherit; padding: 10px 12px; outline: none; min-width: 0; }
form input:focus, form textarea:focus, .bericht-tekst:focus { border-color: var(--accent); }
.bericht-tekst { width: 100%; box-sizing: border-box; resize: vertical; line-height: 1.5; margin: 6px 0 12px; }
form input.invalid { border-color: #e2584e; }

.price { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.price-main { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.price-label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.price-main strong { font-size: 26px; letter-spacing: -.01em; }
.price-per { margin: 2px 0 0; font-size: 13px; color: var(--text); }
.price-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.btn { background: var(--card); color: var(--text); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); padding: 13px 16px; font-size: 15px; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: none; }
.form-msg { margin: 0; font-size: 13px; min-height: 1.2em; color: var(--muted); }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: #f08377; }

.maker { margin-top: 10px; border: 1px dashed var(--line); border-radius: var(--radius); padding: 0 14px; }
.maker summary { cursor: pointer; padding: 12px 0; font-weight: 700; font-size: 13.5px; }
.maker summary span, .maker h3 span { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.maker[open] { padding-bottom: 14px; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 0 0 12px; font-size: 13px; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; font-variant-numeric: tabular-nums; }
.stats .ok { color: var(--ok); }
.stats .bad { color: var(--warn); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.maker h3 { font-size: 13px; margin: 16px 0 6px; }
.orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12.5px; }
.orders li { background: var(--card); border-radius: 8px; padding: 8px 10px; display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.orders li span { color: var(--muted); }
.orders a { color: var(--accent); }
.orders .empty { background: none; color: var(--muted); padding: 0; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .stage { position: relative; height: 46vh; min-height: 280px; }
  .panel { border-left: 0; border-top: 1px solid var(--line); padding: 20px 16px 36px; }
  h1 { font-size: 22px; }
  .brand img { height: 22px; }
  .brand-sub { display: none; }
  .text-field input { font-size: 24px; }
}

/* ---------- bevestiging ---------- */
.render { position: absolute; inset: 0; margin: 0; background: #14161a; display: grid; place-items: center; }
.render img { width: 100%; height: 100%; object-fit: cover; display: block; }
.render figcaption { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; font-size: 12px; color: rgba(255, 255, 255, .55); letter-spacing: .08em; text-transform: uppercase; }
.eyebrow { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--ok); }
.done-stats { margin: 6px 0 16px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.done-price { margin-bottom: 16px; }
.done-actions .btn { text-decoration: none; text-align: center; flex: 1; }
[hidden] { display: none !important; }
.dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; outline: 1.5px solid var(--line); vertical-align: middle; }
