/* RHJ Kleurstudio — dark-neutral workspace (so paint colours read true), navy as brand accent. */

:root {
  color-scheme: dark;
  --navy: #1d1d43;
  --navy-2: #26275a;
  --navy-line: #34367a;
  --accent: #b3b8ff;          /* light tint of the logo navy: focus rings, active states */
  --stage: #131313;
  --bg: #1a1a1b;
  --panel: #202021;
  --panel-2: #29292b;
  --panel-3: #333336;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #eeeef0;
  --muted: #a3a3a8;
  --faint: #77777c;
  --danger: #ff7a6b;
  --ok: #7fdca4;
  --radius: 14px;
  --radius-s: 10px;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
#app { position: fixed; inset: 0; overflow: hidden; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
button:disabled { cursor: default; opacity: 0.38; }
a { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
select, option { background: var(--panel-2); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { width: 22px; height: 22px; display: block; }
.ic { display: inline-flex; flex: none; }

.boot { height: 100%; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); letter-spacing: 0.04em; }
.boot img { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ---- buttons --------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px;
  background: var(--panel-3); color: var(--text); font-weight: 600; letter-spacing: 0.005em;
  border: 1px solid var(--line);
  transition: background 0.16s, transform 0.12s var(--ease), border-color 0.16s;
}
.btn:hover:not(:disabled) { background: #3d3d41; }
.btn:active:not(:disabled) { transform: scale(0.975); }
.btn.primary { background: #fff; color: var(--navy); border-color: #fff; }
.btn.primary:hover:not(:disabled) { background: #e9eaff; }
.btn.big { min-height: 54px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.danger { background: transparent; border-color: rgba(255, 122, 107, 0.4); color: var(--danger); }
.btn.danger:hover:not(:disabled) { background: rgba(255, 122, 107, 0.12); }
.btn[aria-pressed="true"] { background: var(--navy-2); border-color: var(--navy-line); }
.btn.busy { opacity: 0.6; }

.ibtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; height: 44px; padding: 0 10px; border-radius: 12px; color: var(--text);
  transition: background 0.16s, color 0.16s, transform 0.12s var(--ease);
}
.ibtn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.09); }
.ibtn:active:not(:disabled) { transform: scale(0.94); }
.ibtn[aria-pressed="true"] { background: rgba(255, 255, 255, 0.16); color: #fff; }
.ibtn-label { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; flex: none; }

.segmented { display: flex; background: var(--panel-2); border-radius: 12px; padding: 3px; gap: 2px; }
.segmented button {
  flex: 1; min-height: 44px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  transition: background 0.16s, color 0.16s;
}
.segmented button[aria-selected="true"], .segmented button[aria-pressed="true"] { background: var(--panel-3); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.segmented .icon { width: 16px; height: 16px; }

/* ---- top bar / brand ---------------------------------------------------------------- */

.topbar {
  display: flex; align-items: center; gap: 6px;
  min-height: calc(56px + var(--sat)); padding: var(--sat) calc(10px + var(--sar)) 0 calc(6px + var(--sal));
  background: linear-gradient(180deg, #212150, var(--navy));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative; z-index: 5;
}
.topbar .title { display: flex; flex-direction: column; min-width: 0; flex: 1; padding: 0 6px; line-height: 1.2; }
.topbar .title strong { font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title span { font-size: 12px; color: rgba(255, 255, 255, 0.66); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.topbar .ibtn.accent { background: #fff; color: var(--navy); padding: 0 14px; margin-left: 6px; }
.topbar .ibtn.accent:hover { background: #e9eaff; }
.topbar-mark { width: 26px; height: 26px; margin: 0 6px 0 12px; opacity: 0.95; flex: none; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 14.5px; font-weight: 650; letter-spacing: 0.01em; white-space: nowrap; }
.brand-text span { font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255, 255, 255, 0.62); }

/* ---- home ---------------------------------------------------------------------------- */

.home { height: 100%; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
.home-bar { padding-left: calc(18px + var(--sal)); justify-content: space-between; position: sticky; top: 0; }
.home-main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 calc(22px + var(--sar)) 28px calc(22px + var(--sal)); }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 46px 0 34px; border-bottom: 1px solid var(--line); }
.eyebrow { font-size: 11.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.hero h1 { font-size: clamp(27px, 4.2vw, 42px); line-height: 1.08; font-weight: 700; letter-spacing: -0.02em; }
.lead { margin-top: 14px; max-width: 54ch; color: var(--muted); font-size: 16px; }
.hero .btn { flex: none; }
.home-section { padding-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 18px; font-weight: 650; letter-spacing: -0.005em; }
.count { color: var(--faint); font-size: 13px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); }
.card-main { display: block; width: 100%; text-align: left; }
.card-thumb { position: relative; aspect-ratio: 3 / 2; background: #0f0f10; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-text { display: flex; flex-direction: column; gap: 2px; padding: 13px 52px 15px 15px; }
.card-text strong { font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-text span { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-text small { color: var(--faint); font-size: 12px; margin-top: 3px; }
.card-delete { position: absolute; right: 6px; bottom: 10px; color: var(--faint); }
.card-delete:hover { color: var(--danger); }
.badge { position: absolute; left: 10px; top: 10px; padding: 4px 9px; border-radius: 999px; background: rgba(20, 20, 22, 0.78); backdrop-filter: blur(8px); font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; }
.empty-card { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 20px; border: 1.5px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); text-align: center; transition: border-color 0.2s, background 0.2s; }
.empty-card:hover { border-color: var(--accent); background: rgba(179, 184, 255, 0.05); }
.empty-card strong { color: var(--text); font-size: 15px; }
.empty-card .icon { width: 30px; height: 30px; margin-bottom: 4px; }
.home.dropping .empty-card, .home.dropping .hero { border-color: var(--accent); }
.home-foot { display: flex; align-items: center; gap: 14px; padding: 18px calc(22px + var(--sar)) calc(18px + var(--sab)) calc(22px + var(--sal)); border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; max-width: 1180px; width: 100%; margin: 0 auto; }
.keurmerk { border-radius: 4px; flex: none; }
.foot-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.foot-text strong { color: var(--text); font-weight: 600; }
.stroom { color: var(--faint); text-decoration: none; font-size: 12px; letter-spacing: 0.04em; white-space: nowrap; padding: 14px 0; }
.stroom:hover { color: var(--accent); }

/* ---- modal ---------------------------------------------------------------------------- */

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(8, 8, 10, 0.6); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.2s; }
.modal.open { opacity: 1; }
.modal-card { width: min(600px, 100%); max-height: min(92dvh, 860px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow); transform: translateY(14px) scale(0.985); transition: transform 0.26s var(--ease); }
.modal.open .modal-card { transform: none; }
.modal.small .modal-card { width: min(440px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 6px 22px; }
.modal-head h2 { font-size: 18px; font-weight: 650; }
.modal-body { padding: 8px 22px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-text { color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field label em { font-style: normal; color: var(--faint); font-weight: 400; }
.field input, .search-input { height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); padding: 0 14px; font-size: 16px; width: 100%; min-width: 0; }
.field input:focus, .search:focus-within { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 16px 16px; border: 1.5px dashed var(--line-2); border-radius: 16px; text-align: center; overflow: hidden; transition: border-color 0.2s, background 0.2s; }
.dropzone.over { border-color: var(--accent); background: rgba(179, 184, 255, 0.07); }
.dropzone-text { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 13.5px; }
.dropzone-text strong { color: var(--text); font-size: 15px; }
.dropzone-text .icon { width: 30px; height: 30px; margin-bottom: 4px; }
.dropzone-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.dropzone-hint { color: var(--faint); }
.photo-preview:empty { display: none; }
.photo-preview img { max-height: 210px; border-radius: 10px; margin: 0 auto; }
.dropzone.has-photo .dropzone-text, .dropzone.has-photo .dropzone-hint { display: none; }
.about .modal-body { gap: 12px; font-size: 14px; color: #d5d5d9; }
.about h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-top: 8px; }
.about-brand { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; border-radius: 14px; background: var(--navy); }
.about-brand img:first-child { height: 58px; }
.about-brand .keurmerk { height: 54px; width: auto; }
.about-note { color: var(--muted); font-style: italic; }
.sources { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.about-foot { display: flex; justify-content: space-between; align-items: center; color: var(--faint); font-size: 12px; margin-top: 6px; }

.toast { position: fixed; left: 50%; bottom: calc(26px + var(--sab)); z-index: 80; transform: translate(-50%, 16px); max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 14px; background: rgba(34, 34, 37, 0.96); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px; font-weight: 550; text-align: center; opacity: 0; pointer-events: none; transition: opacity 0.22s, transform 0.26s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- editor layout ------------------------------------------------------------------ */

.editor { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 384px; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "top top" "stage panel"; background: var(--stage); position: relative; }
.editor > .topbar { grid-area: top; }
.stage { grid-area: stage; position: relative; overflow: hidden; background: var(--stage); min-height: 0; }
.panel { grid-area: panel; display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--panel); border-left: 1px solid var(--line); padding-right: var(--sar); }
.clientbar, .client-close { display: none; }

.viewport { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: default; }
.editor[data-tool="select"] .viewport { cursor: pointer; }
.editor[data-tool="pan"] .viewport, .viewport.grab { cursor: grab; }
.viewport.grabbing { cursor: grabbing !important; }
.editor[data-tool="brush"] .viewport, .editor[data-tool="erase"] .viewport { cursor: crosshair; }
.layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; opacity: 0; transition: opacity 0.35s; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 18px 60px rgba(0, 0, 0, 0.55); }
.editor.ready .layer { opacity: 1; }
.layer.smooth { transition: transform 0.26s var(--ease), opacity 0.35s; }
.layer.pixel canvas { image-rendering: pixelated; }
.layer canvas { position: absolute; left: 0; top: 0; display: block; }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage.thinking .viewport { cursor: progress; }

.float { background: rgba(30, 30, 32, 0.9); backdrop-filter: blur(14px) saturate(1.2); border: 1px solid var(--line-2); box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4); }
.toolrail, .histbar, .stagetools, .brushbar, .status, .scan-caption {
  position: absolute; z-index: 3; display: flex; align-items: center;
  background: rgba(30, 30, 32, 0.9); backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--line-2); box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4); border-radius: 16px;
  transition: opacity 0.25s, transform 0.3s var(--ease);
}
.toolrail { left: calc(14px + var(--sal)); top: 50%; transform: translateY(-50%); flex-direction: column; padding: 5px; gap: 2px; }
.tool { width: 62px; min-height: 56px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 600; transition: background 0.16s, color 0.16s; }
.tool:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.tool[aria-pressed="true"] { background: #fff; color: var(--navy); }
.rail-sep { width: 34px; height: 1px; background: var(--line-2); margin: 3px 0; }
.histbar { right: 14px; top: 14px; padding: 3px; }
.stagetools { right: 14px; bottom: 14px; padding: 3px; }
.zoom-label { min-width: 52px; height: 44px; font-size: 12.5px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.brushbar { left: 50%; top: 14px; transform: translateX(-50%); gap: 12px; padding: 0 16px; height: 50px; }
.brushbar-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.brushbar input[type="range"] { width: min(220px, 34vw); accent-color: #fff; height: 30px; }
.brush-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; flex: none; }
.brush-ring { position: absolute; left: 0; top: 0; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); pointer-events: none; z-index: 2; }
.status { left: calc(14px + var(--sal)); bottom: 14px; gap: 8px; padding: 0 13px; height: 34px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.status.busy i { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.status.ok i { background: var(--ok); }

/* scanning */
.scan { position: absolute; z-index: 2; pointer-events: none; overflow: hidden; }
.scan::before { content: ""; position: absolute; inset: 0; background: rgba(10, 10, 14, 0.28); }
.scan-sweep { position: absolute; left: 0; right: 0; top: 0; height: 38%; background: linear-gradient(180deg, rgba(179, 184, 255, 0) 0%, rgba(179, 184, 255, 0.16) 78%, rgba(255, 255, 255, 0.5) 99%, #fff 100%); border-bottom: 1.5px solid #fff; box-shadow: 0 6px 24px rgba(179, 184, 255, 0.5); animation: sweep 2.3s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate; }
@keyframes sweep { from { transform: translateY(-100%); } to { transform: translateY(265%); } }
.scan-corners i { position: absolute; width: 26px; height: 26px; border: 2px solid #fff; opacity: 0.9; }
.scan-corners i:nth-child(1) { left: 10px; top: 10px; border-right: 0; border-bottom: 0; }
.scan-corners i:nth-child(2) { right: 10px; top: 10px; border-left: 0; border-bottom: 0; }
.scan-corners i:nth-child(3) { left: 10px; bottom: 10px; border-right: 0; border-top: 0; }
.scan-corners i:nth-child(4) { right: 10px; bottom: 10px; border-left: 0; border-top: 0; }
.scan-caption { left: 50%; bottom: 72px; transform: translateX(-50%); gap: 10px; padding: 10px 16px; max-width: calc(100% - 28px); flex-wrap: wrap; justify-content: center; font-size: 13.5px; font-weight: 600; }
.scan-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 0.9s ease-in-out infinite; }
.scan-caption.done .scan-dot { background: var(--ok); animation: none; }
.scan-found { display: contents; }
.found-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-size: 12.5px; animation: pop 0.4s var(--ease) both; }
.found-chip i { width: 8px; height: 8px; border-radius: 50%; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.9); } }
.editor.scanning .toolrail, .editor.scanning .histbar, .editor.scanning .stagetools { opacity: 0.35; pointer-events: none; }

/* before / after */
.ba-handle { position: absolute; left: 0; top: 0; width: 0; z-index: 2; touch-action: none; cursor: ew-resize; }
.ba-handle::before { content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 14px rgba(0, 0, 0, 0.5); }
.ba-handle::after { content: ""; position: absolute; left: -24px; right: -24px; top: 0; bottom: 0; }
.ba-grip { position: absolute; left: -24px; top: 50%; margin-top: -24px; width: 48px; height: 48px; border-radius: 50%; background: #fff; color: var(--navy); display: grid; place-items: center; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5); transition: transform 0.16s var(--ease); z-index: 1; }
.ba-handle.dragging .ba-grip { transform: scale(1.1); }
.ba-tag { position: absolute; top: 12px; padding: 5px 11px; border-radius: 999px; background: rgba(18, 18, 20, 0.78); backdrop-filter: blur(8px); font-size: 11.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; pointer-events: none; }
.ba-tag.before { right: 14px; }
.ba-tag.after { left: 14px; }

/* "Wat is dit?" sheet */
.sheet { position: absolute; z-index: 6; left: 50%; bottom: 76px; width: min(470px, calc(100% - 28px)); transform: translateX(-50%); padding: 14px; border-radius: 20px; background: rgba(32, 32, 34, 0.97); backdrop-filter: blur(16px); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: rise 0.28s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 18px); } }
.sheet.top { bottom: auto; top: 74px; }
.sheet-head { display: grid; grid-template-columns: 1fr auto; align-items: start; column-gap: 8px; padding: 0 0 10px 4px; }
.sheet-head strong { font-size: 17px; font-weight: 650; align-self: center; }
.sheet-head .sheet-sub { grid-column: 1; color: var(--muted); font-size: 12.5px; }
.sheet-head .ibtn { grid-column: 2; grid-row: 1 / span 2; margin: -6px -6px 0 0; }
.part-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.part-btn { min-height: 52px; border-radius: 12px; background: var(--panel-3); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 8px; font-size: 13.5px; font-weight: 600; transition: background 0.16s, transform 0.12s var(--ease), border-color 0.16s; }
.part-btn:hover { background: #404045; }
.part-btn:active { transform: scale(0.96); }
.part-btn i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.part-btn.current { background: #fff; color: var(--navy); border-color: #fff; }
.sheet-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.sheet-actions .segmented { flex: 0 1 220px; }
.sheet-actions .btn .icon { width: 18px; height: 18px; }

/* ---- panel: schemes, groups ------------------------------------------------------ */

.schemes { display: flex; align-items: center; gap: 6px; padding: 12px 12px 10px 14px; }
.scheme-tabs { flex: 1; display: flex; gap: 6px; min-width: 0; }
.scheme { flex: 1 1 0; min-width: 0; min-height: 48px; border-radius: 12px; background: var(--panel-2); border: 1px solid transparent; display: flex; align-items: center; gap: 8px; padding: 0 10px; color: var(--muted); transition: background 0.16s, color 0.16s, border-color 0.16s; }
.scheme:hover { color: var(--text); }
.scheme.active { background: #fff; color: var(--navy); }
.scheme-letter { width: 26px; height: 26px; border-radius: 8px; background: rgba(255, 255, 255, 0.1); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.scheme.active .scheme-letter { background: var(--navy); color: #fff; }
.scheme-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scheme-dots { display: flex; margin-left: auto; }
.scheme-dots i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--panel-2); margin-left: -4px; }
.scheme.active .scheme-dots i { border-color: #fff; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.3); }
.scheme.add { flex: 0 1 auto; border: 1px dashed var(--line-2); background: transparent; justify-content: center; }
.scheme.add .icon { width: 18px; height: 18px; }
.scheme-remove { color: var(--faint); flex: none; }

.groups { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 12px 12px 14px; border-bottom: 1px solid var(--line); }
.group { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 5px 9px; border-radius: 12px; border: 1px solid transparent; text-align: left; min-width: 0; transition: background 0.16s, border-color 0.16s; }
.group:hover { background: var(--panel-2); }
.group.active { background: var(--panel-2); border-color: var(--line-2); box-shadow: 0 0 0 1.5px var(--accent) inset; }
.group.empty .group-name, .group.empty .group-colour { opacity: 0.55; }
.group-swatch { width: 30px; height: 30px; border-radius: 9px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22) inset, 0 1px 3px rgba(0, 0, 0, 0.4); }
.group-swatch.none { background: transparent; border: 1.5px dashed; box-shadow: none; opacity: 0.8; }
.group-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.group-name { font-size: 13.5px; font-weight: 650; display: flex; align-items: baseline; gap: 6px; }
.group-name small { color: var(--faint); font-weight: 600; font-size: 11.5px; }
.group-colour { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- picker ---------------------------------------------------------------------------- */

.picker { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.picker-head { padding: 10px 12px 2px 14px; }
.picker-hint { color: var(--muted); font-size: 13px; padding: 6px 0; }
.picker-target { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.picker-swatch { width: 44px; height: 44px; border-radius: 12px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22) inset, 0 2px 8px rgba(0, 0, 0, 0.4); transition: background 0.25s; }
.picker-swatch.empty { background: repeating-linear-gradient(45deg, #2c2c2f 0 6px, #252527 6px 12px); }
.picker-target-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.picker-for { font-size: 12px; color: var(--muted); }
.picker-for strong { color: var(--text); }
.picker-current { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-current b { font-weight: 700; letter-spacing: 0.01em; }
.picker-current i { font-style: normal; color: var(--faint); font-size: 12px; }
.picker-current.none { color: var(--faint); }
.star { color: var(--muted); }
.star.on { color: #ffd45c; }
.picker-filters { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px 8px 14px; }
.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.search .icon { width: 18px; height: 18px; }
.search-input { border: 0; background: transparent; height: 100%; padding: 0; font-size: 16px; color: var(--text); outline: none; }
.search-input::placeholder { color: var(--faint); }
.search-input::-webkit-search-cancel-button { filter: invert(1) opacity(0.6); }
.families { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 0 -14px; padding: 0 12px 0 12px; }
.families::-webkit-scrollbar { display: none; }
.family { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 37px; min-height: 48px; padding: 4px 3px 2px; border-radius: 10px; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.family-dot { width: 24px; height: 24px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset; transition: transform 0.16s var(--ease), box-shadow 0.16s; }
.family[aria-pressed="true"] { color: #fff; }
.family[aria-pressed="true"] .family-dot { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px #fff; transform: scale(0.92); }
.picker-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 12px calc(16px + var(--sab)) 14px; scrollbar-width: thin; scrollbar-color: #444 transparent; }
.picker-section { margin-top: 12px; }
.picker-section h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 650; margin-bottom: 8px; }
.picker-section h3 small { font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--faint); font-weight: 500; text-align: right; }
.sw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.sw { position: relative; height: 62px; border-radius: 10px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding: 5px 7px; color: #fff; text-align: left; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset; transition: transform 0.14s var(--ease), box-shadow 0.14s; }
.sw.light { color: #1b1b1e; }
.sw:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3) inset, 0 6px 14px rgba(0, 0, 0, 0.4); }
.sw:active { transform: scale(0.95); }
.sw.current { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px #fff; }
.sw-code { font-size: 10.5px; font-weight: 700; letter-spacing: 0.01em; line-height: 1.15; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.sw-name { font-size: 9.5px; line-height: 1.15; opacity: 0.85; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.sw-fav { position: absolute; right: 5px; top: 5px; }
.sw-fav .icon { width: 12px; height: 12px; }
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.preset { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); text-align: left; min-width: 0; transition: background 0.16s; }
.preset:hover { background: var(--panel-3); }
.preset-chips { display: flex; flex: none; }
.preset-chips span { width: 26px; height: 26px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset; }
.preset-chips span + span { margin-left: -9px; box-shadow: 0 0 0 2px var(--panel-2); }
.preset-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.preset-text b { font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preset-text small { font-size: 10.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-empty { color: var(--muted); font-size: 13.5px; padding: 18px 0; text-align: center; }
.picker-sentinel { height: 1px; }

/* ---- compare ---------------------------------------------------------------------------- */

.compare { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; background: #111; opacity: 0; transition: opacity 0.2s; }
.compare.open { opacity: 1; }
.compare-head { display: flex; align-items: center; gap: 12px; padding: calc(8px + var(--sat)) calc(10px + var(--sar)) 8px calc(20px + var(--sal)); border-bottom: 1px solid var(--line); background: var(--panel); }
.compare-head h2 { font-size: 17px; font-weight: 650; }
.compare-head .brand-mark { width: 22px; height: 22px; }
.compare-hint { flex: 1; color: var(--muted); font-size: 13px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compare-grid { flex: 1; min-height: 0; display: grid; gap: var(--gap, 14px); place-content: center; padding: 14px calc(14px + var(--sar)) calc(14px + var(--sab)) calc(14px + var(--sal)); overflow: hidden; }
.compare-tile { width: var(--tile-w); display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); text-align: left; transition: transform 0.2s var(--ease), border-color 0.2s; animation: pop 0.35s var(--ease) both; }
button.compare-tile:hover { transform: translateY(-2px); border-color: var(--line-2); }
.compare-tile.active { border-color: #fff; box-shadow: 0 0 0 1px #fff; }
.compare-image canvas { display: block; width: 100%; height: auto; }
.compare-foot { height: 62px; padding: 8px 12px; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.compare-foot strong { font-size: 13.5px; font-weight: 650; }
.compare-chips { display: flex; gap: 10px; overflow: hidden; white-space: nowrap; }
.compare-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); flex: none; }
.compare-chip i { width: 12px; height: 12px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset; }
.compare-chip b { color: var(--text); font-weight: 600; }
.compare-none { font-size: 11.5px; color: var(--faint); }

/* ---- share ---------------------------------------------------------------------------- */

.share-top { display: flex; gap: 14px; align-items: center; }
.share-preview { width: 148px; flex: none; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-2); }
.share-preview canvas { display: block; width: 100%; height: auto; max-height: 170px; object-fit: cover; }
.share-meta { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 13.5px; min-width: 0; }
.share-meta strong { color: var(--text); font-size: 16px; }
.share-option { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.share-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--navy-2); display: grid; place-items: center; }
.share-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.share-text strong { font-size: 14.5px; }
.share-text span { font-size: 12.5px; color: var(--muted); }
.share-buttons { display: flex; gap: 8px; }
.share-buttons .icon { width: 18px; height: 18px; }
.share-status { min-height: 20px; font-size: 13px; color: var(--ok); }
.share-note { font-size: 12px; color: var(--faint); font-style: italic; }

/* ---- klantmodus ---------------------------------------------------------------------- */

.editor.client { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "stage" "client"; background: #0c0c0c; }
.editor.client > .topbar, .editor.client .panel, .editor.client .toolrail, .editor.client .histbar, .editor.client .stagetools, .editor.client .status, .editor.client .brushbar, .editor.client .sheet { display: none; }
.editor.client .stage { background: #0c0c0c; }
.editor.client .layer { box-shadow: none; }
.editor.client .clientbar { grid-area: client; display: flex; align-items: center; gap: 22px; padding: 14px calc(22px + var(--sar)) calc(14px + var(--sab)) calc(22px + var(--sal)); background: linear-gradient(180deg, #212150, var(--navy)); border-top: 1px solid rgba(255, 255, 255, 0.1); min-width: 0; }
.client-schemes { display: flex; gap: 8px; flex: none; }
.client-schemes button { min-width: 74px; height: 58px; border-radius: 14px; background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.75); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; transition: background 0.2s, color 0.2s, transform 0.14s var(--ease); }
.client-schemes button b { font-size: 21px; font-weight: 700; }
.client-schemes button span { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }
.client-schemes button.active { background: #fff; color: var(--navy); }
.client-schemes button:active { transform: scale(0.95); }
.client-chips { flex: 1; display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; min-width: 0; justify-content: flex-end; }
.client-chips::-webkit-scrollbar { display: none; }
.client-chip { display: flex; align-items: center; gap: 11px; flex: none; animation: pop 0.35s var(--ease) both; }
.client-chip i { width: 46px; height: 46px; border-radius: 12px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.55) inset, 0 3px 10px rgba(0, 0, 0, 0.4); flex: none; }
.client-chip div { display: flex; flex-direction: column; line-height: 1.2; }
.client-chip span { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.66); }
.client-chip strong { font-size: 15.5px; font-weight: 650; white-space: nowrap; }
.client-chip small { font-size: 11.5px; color: rgba(255, 255, 255, 0.66); white-space: nowrap; }
.client-empty { color: rgba(255, 255, 255, 0.7); font-size: 14px; }
.editor.client .client-close { display: inline-flex; align-items: center; gap: 6px; position: absolute; z-index: 8; right: calc(14px + var(--sar)); top: calc(14px + var(--sat)); height: 44px; padding: 0 14px 0 10px; border-radius: 999px; background: rgba(20, 20, 22, 0.6); backdrop-filter: blur(10px); border: 1px solid var(--line-2); color: rgba(255, 255, 255, 0.85); font-size: 13px; font-weight: 600; opacity: 0.75; transition: opacity 0.2s; }
.client-close:hover { opacity: 1; }
.client-close .icon { width: 18px; height: 18px; }

/* ---- responsive ------------------------------------------------------------------------ */

/* Tablet portrait and phones: photo on top, panel underneath. */
@media (max-width: 999px) {
  .editor { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) clamp(330px, 42dvh, 470px); grid-template-areas: "top" "stage" "panel"; }
  .panel { border-left: 0; border-top: 1px solid var(--line); padding-right: 0; }
  .topbar .wide-label .ibtn-label { display: none; }
  .topbar .ibtn.accent { padding: 0 10px; }
  .topbar-mark { width: 22px; height: 22px; margin: 0 4px 0 8px; }
  .toolrail { top: 12px; left: calc(12px + var(--sal)); transform: none; flex-direction: row; padding: 3px; }
  .tool { width: 46px; min-height: 44px; }
  .tool span:not(.ic) { display: none; }
  .rail-sep { width: 1px; height: 26px; margin: 0 2px; }
  .histbar { top: 12px; right: calc(12px + var(--sar)); }
  .brushbar { top: 68px; left: calc(12px + var(--sal)); transform: none; }
  .stagetools { right: calc(12px + var(--sar)); bottom: 12px; }
  .status { bottom: 12px; left: calc(12px + var(--sal)); }
  .scan-caption { bottom: 68px; }
  .schemes { padding: 10px 12px 8px calc(12px + var(--sal)); }
  .groups { display: flex; overflow-x: auto; scrollbar-width: none; padding: 0 12px 10px calc(12px + var(--sal)); gap: 6px; }
  .groups::-webkit-scrollbar { display: none; }
  .group { flex: none; min-width: 152px; max-width: 200px; background: var(--panel-2); }
  .picker-head { padding-top: 8px; }
  .toast { bottom: auto; top: calc(68px + var(--sat)); transform: translate(-50%, -16px); }
  .sheet, .sheet.top { background: #222224; backdrop-filter: none; position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: auto; transform: none; border-radius: 22px 22px 0 0; padding: 16px 16px calc(18px + var(--sab)); border-bottom: 0; animation: rise-flat 0.3s var(--ease); z-index: 20; }
  @keyframes rise-flat { from { transform: translateY(40px); opacity: 0; } }
  .editor.client .clientbar { flex-wrap: wrap; gap: 12px 16px; }
  .editor.client .clientbar .brand { order: 1; flex: 1; }
  .client-schemes { order: 2; }
  .client-chips { order: 3; flex: 1 0 100%; justify-content: flex-start; }
}

@media (max-width: 999px) and (min-width: 600px) {
  .sw-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .picker-filters { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(280px, 1.2fr); align-items: center; }
  .picker-filters .families { grid-column: 1 / -1; }
  .part-grid { grid-template-columns: repeat(7, 1fr); }
  .presets { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 599px) {
  body { font-size: 14.5px; }
  .topbar { min-height: calc(52px + var(--sat)); padding-right: calc(8px + var(--sar)); gap: 2px; }
  .topbar .title { padding: 0 2px; }
  .topbar .ibtn.accent { margin-left: 2px; }
  .topbar-mark { margin: 0 0 0 6px; }
  .home-bar .wide-label .ibtn-label { display: none; }
  .hero { flex-direction: column; align-items: stretch; padding: 30px 0 26px; gap: 22px; }
  .home-main { padding-left: calc(16px + var(--sal)); padding-right: calc(16px + var(--sar)); }
  .project-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .modal { padding: 0; place-items: end stretch; }
  .modal-card { width: 100%; border-radius: 22px 22px 0 0; max-height: 94dvh; padding-bottom: var(--sab); transform: translateY(40px); }
  .modal-actions .btn { flex: 1; }
  .stagetools .ibtn[title="Uitzoomen"], .stagetools .ibtn[title="Inzoomen"], .stagetools .sep { display: none; }
  .zoom-label { min-width: 46px; }
  .scheme.add .scheme-name { display: none; }
  .scheme.add { min-width: 48px; }
  .editor { grid-template-rows: auto minmax(0, 1fr) clamp(330px, 46dvh, 470px); }
  /* Little height: search and filters scroll away with the colours. */
  .picker { overflow-y: auto; overscroll-behavior: contain; }
  .picker-body { flex: none; overflow: visible; }
  .brushbar input[type="range"] { width: 150px; }
  .share-option { grid-template-columns: auto 1fr; }
  .share-buttons { grid-column: 1 / -1; }
  .share-buttons .btn { flex: 1; }
  .share-preview { width: 104px; }
  .compare-hint { display: none; }
  .compare-head h2 { flex: 1; }
  .client-chip i { width: 38px; height: 38px; }
  .client-schemes button { min-width: 58px; height: 50px; }
  .editor.client .clientbar { padding-top: 12px; }
  .editor.client .brand-text span { display: none; }
  .home-foot { flex-wrap: wrap; }
}

/* Phone held sideways: keep the photo large, panel beside it. */
@media (max-height: 520px) and (orientation: landscape) {
  .editor { grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "top top" "stage panel"; }
  .panel { border-top: 0; border-left: 1px solid var(--line); }
  .groups { display: flex; overflow-x: auto; }
  .group { flex: none; min-width: 150px; }
  .families { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
