/* =====================================================================
   Uitleggo — stijl
   Rustig, licht, veel witruimte. Eén accentkleur (groenblauw).
   Kleuren en maten staan als variabelen bovenaan; later per gebruiker
   aan te passen (eigen merkkleur).
   ===================================================================== */
:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --surface-2: #F1EFEA;
  --ink: #1B1D21;
  --ink-2: #3D4148;
  --muted: #6B6F76;
  --line: #E4E1DA;
  --line-strong: #D3CFC6;
  --accent: #0E7C66;
  --accent-hover: #0B6A57;
  --accent-soft: #E2F1EC;
  --accent-ink: #FFFFFF;
  --accent-text: #0E7C66;
  --warm: #FFB547;
  --danger: #C2412D;
  --danger-soft: #FBEAE6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(27, 29, 33, .05), 0 4px 16px rgba(27, 29, 33, .05);
  --shadow-lg: 0 12px 40px rgba(27, 29, 33, .14);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1080px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .4em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); font-weight: 750; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 .8em; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }
.icon { display: inline-flex; flex: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

/* ---------- Layout ---------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 64px; }
.page.narrow { max-width: 460px; }
.center-page { text-align: center; padding-top: 12vh; }
.center-page .logo { justify-content: center; margin-bottom: 24px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 20px; }
.page-head h1 { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.boot { min-height: 60vh; display: grid; place-items: center; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar.plain { position: static; background: transparent; border-bottom: 0; backdrop-filter: none; }
.topbar-inner { max-width: var(--maxw); margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.user-email { color: var(--muted); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.15rem; letter-spacing: -0.02em; }
.logo-mark { color: var(--accent); display: inline-flex; }
@media (max-width: 560px) {
  .user-email, .hide-sm { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(14, 124, 102, .25); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(27, 29, 33, .06); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #A8361F; }
.btn-solid { background: rgba(255, 255, 255, .94); border-color: transparent; box-shadow: var(--shadow); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .875rem; }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; font-weight: 600; text-align: left; }
.linklike.danger { color: var(--danger); }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 10px; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.input, textarea.input, select.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 400; font-size: 1rem;
}
.input:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); outline-offset: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: #0B4F42; font-size: .925rem; margin: 0 0 14px; }
.notice[data-type="error"] { background: var(--danger-soft); color: #7A2414; }
.notice[data-type="warn"] { background: #FFF4DC; color: #6B4A00; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }
.pill-live { background: var(--accent-soft); color: var(--accent); }

/* ---------- Toast & dialog ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: .925rem; font-weight: 500;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; max-width: min(92vw, 520px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast[data-type="error"] { background: var(--danger); }
.dialog { border: 0; border-radius: var(--radius); padding: 22px; max-width: min(92vw, 420px); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(27, 29, 33, .4); }
.dialog p { margin: 0 0 18px; font-size: 1rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Landing ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; padding: 32px 0 56px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--accent-text); margin-bottom: 10px; }
.hero h1 { font-size: clamp(2.2rem, 1.4rem + 3vw, 3.4rem); letter-spacing: -0.03em; }
.lead { font-size: 1.125rem; color: var(--ink-2); max-width: 38em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-visual { position: relative; }
.mock { position: relative; padding: 10px 30px 30px 0; }
.mock-card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 18px; border: 1px solid var(--line); transform: rotate(-1.2deg); }
.mock-step { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 12px; }
.mock-photo { border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 10; }
.mock-text { margin: 12px 0 0; color: var(--ink-2); font-size: .95rem; }
.mock-qr { position: absolute; right: 0; bottom: 0; width: 104px; height: 104px; background: #fff; padding: 12px; border-radius: 16px; box-shadow: var(--shadow-lg); transform: rotate(4deg); border: 1px solid var(--line); }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature p { color: var(--muted); font-size: .95rem; margin: 0; }
.feature-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.site-footer { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 40px; display: flex; justify-content: space-between; font-size: .875rem; color: var(--ink-2); }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 8px; }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } .mock { padding-right: 20px; } .mock-qr { width: 84px; height: 84px; } }

/* ---------- Auth ---------- */
.auth-card { padding: 28px; margin-top: 4vh; }
.auth-card h1 { margin-bottom: 4px; }
.auth-card > .muted { margin-bottom: 20px; }
.auth-switch { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: .95rem; }

/* ---------- Dashboard ---------- */
.manual-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.manual-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.manual-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.manual-thumb { aspect-ratio: 16 / 10; background: var(--surface-2); display: grid; place-items: center; color: var(--line-strong); overflow: hidden; }
.manual-thumb img { width: 100%; height: 100%; object-fit: cover; }
.manual-meta { padding: 14px 16px 16px; }
.manual-meta h3 { margin-bottom: 2px; }
.manual-meta p { margin-bottom: 10px; }
.empty { text-align: center; padding: 56px 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty-icon { width: 72px; height: 72px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 16px; }
.empty .btn { margin-top: 8px; }
.small-empty { padding: 28px 20px; margin-bottom: 16px; }
.small-empty p { margin: 0 0 4px; }

/* ---------- Editor ---------- */
.editor { max-width: 760px; }
.manual-head { padding: 18px 20px 18px; margin-bottom: 20px; }
.edit-field { display: block; margin-bottom: 10px; cursor: text; }
.edit-label { display: block; font-size: .78rem; font-weight: 650; color: var(--muted); margin: 0 0 4px 2px; }
.edit-wrap { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius-sm); padding: 4px 12px; transition: border-color .15s, background .15s; }
.edit-wrap:hover { border-color: var(--line-strong); }
.edit-wrap:focus-within { border-color: var(--accent); background: #fff; outline: 3px solid var(--accent-soft); }
.edit-wrap .icon { color: var(--muted); opacity: .7; }
.edit-wrap:focus-within .icon { opacity: 0; }
.link-hint { margin: -6px 2px 14px; }
.publish-hint { margin: 10px 2px 0; }
.more-menu { position: relative; margin-left: auto; }
.more-menu summary { list-style: none; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 230px; z-index: 30; }
.more-item { white-space: nowrap; display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 8px; font: inherit; font-size: .95rem; cursor: pointer; color: var(--ink); text-align: left; }
.more-item:hover { background: var(--surface-2); }
.more-item.danger { color: var(--danger); }
.more-item.danger:hover { background: var(--danger-soft); }
.empty-start { text-align: center; padding: 40px 20px 32px; background: var(--surface); border: 2px dashed var(--line-strong); border-radius: var(--radius); }
.empty-start h2 { margin-bottom: 4px; }
.empty-start-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px 0 12px; }
.empty-start .muted.small { margin-bottom: 6px; }
.title-input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font: inherit; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); font-weight: 750; letter-spacing: -0.02em; color: var(--ink); padding: 4px 0; outline: none; }
.title-input::placeholder, .intro-input::placeholder, .step-body::placeholder { color: #A3A39C; }
.intro-input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font: inherit; color: var(--ink-2); resize: none; padding: 4px 0; outline: none; overflow: hidden; }
.manual-status { display: flex; align-items: center; gap: 12px; margin: 10px 0 12px; }
.save-state[data-state="busy"] { color: var(--muted); }
.save-state[data-state="error"] { color: var(--danger); font-weight: 600; }
.linkbox { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; background: var(--surface-2); border-radius: 12px; color: var(--ink-2); font-size: .9rem; margin-bottom: 14px; }
.linkbox-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.linkbox.is-draft { opacity: .6; }
.manual-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.step-card { padding: 10px 14px 14px; }
.step-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.drag-handle { width: 32px; height: 36px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: grab; border-radius: 8px; touch-action: none; }
.drag-handle:hover { background: var(--surface-2); }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; font-weight: 750; font-size: .9rem; flex: none; }
.step-num.big { width: 34px; height: 34px; font-size: 1rem; }
.step-title { font-weight: 650; color: var(--ink-2); }
.step-tools { margin-left: auto; display: flex; gap: 2px; }
.step-content { display: flex; flex-direction: column; gap: 10px; }
.step-photo { position: relative; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.empty-photo { border: 2px dashed var(--line-strong); background: var(--bg); min-height: 150px; display: grid; place-items: center; }
.photo-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 20px; }
.photo-edit-hit { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.photo-actions { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.busy { position: absolute; inset: 0; background: rgba(247, 246, 243, .85); display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; font-weight: 600; color: var(--ink-2); }
.step-photo .anno-figure { width: min(100%, calc(460px * var(--r, 1.5))); margin: 0 auto; }
.step-body { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); font: inherit; font-size: 1rem; padding: 10px 12px; resize: none; color: var(--ink); overflow: hidden; min-height: 48px; }
.step-body:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); background: #fff; }
.drag-ghost { opacity: .35; }
.drag-chosen { box-shadow: var(--shadow-lg); }
.add-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 14px; border: 2px dashed var(--line-strong); border-radius: var(--radius); justify-content: center; }


/* ---------- Annotaties ---------- */
.anno-figure { position: relative; width: 100%; line-height: 0; }
.anno-figure img { width: 100%; height: 100%; object-fit: contain; }
.anno-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.anno-layer.interactive { pointer-events: auto; touch-action: none; cursor: crosshair; }
.anno-layer.interactive[data-tool="select"] { cursor: default; }
.anno-layer.interactive .shape { cursor: move; }
.anno-layer .handle { cursor: grab; }

.annotator { position: fixed; inset: 0; z-index: 100; background: #16181B; color: #fff; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.annotator-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
.annotator-head .btn-ghost { color: #fff; }
.annotator-head .btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.annotator-tools { display: flex; gap: 10px; padding: 4px 12px 10px; overflow-x: auto; justify-content: center; scrollbar-width: none; }
.toolgroup { display: flex; gap: 4px; background: rgba(255, 255, 255, .07); padding: 4px; border-radius: 14px; flex: none; }
.toolgroup.colors { align-items: center; padding: 4px 8px; gap: 8px; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; padding: 6px 6px 4px; border: 0; border-radius: 10px; background: transparent; color: #D9DCE0; font: inherit; font-size: .7rem; cursor: pointer; }
.tool:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.tool.active { background: #fff; color: var(--ink); }
.tool:disabled { opacity: .35; cursor: default; }
.tool.danger:not(:disabled):hover { background: rgba(229, 72, 77, .25); }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); background: var(--c); cursor: pointer; padding: 0; }
.swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--c); }
.anno-textbar { display: flex; align-items: center; gap: 10px; padding: 0 12px 10px; max-width: 520px; margin: 0 auto; width: 100%; }
.anno-textbar label { font-size: .85rem; color: #D9DCE0; }
.anno-textbar .input { min-height: 40px; }
.anno-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 12px; }
.anno-canvas { position: relative; user-select: none; -webkit-user-select: none; }
.anno-canvas img { width: 100%; height: 100%; border-radius: 6px; pointer-events: none; }
.annotator-hint { text-align: center; font-size: .8rem; color: #9CA1A8; margin: 8px 12px 10px; }
@media (max-width: 560px) {
  .tool { min-width: 42px; padding: 8px 4px; }
  .tool-label { display: none; }
  .annotator-tools { flex-wrap: wrap; gap: 6px; }
  .toolgroup.colors { gap: 6px; }
  .swatch { width: 26px; height: 26px; }
}

/* ---------- Openbare weergave ---------- */
.viewer { min-height: 100vh; }
.draft-banner { background: #FFF4DC; color: #6B4A00; text-align: center; padding: 10px 16px; font-size: .9rem; font-weight: 600; }
.viewer-page { max-width: 720px; margin: 0 auto; padding: 28px 18px 48px; }
.brand-bar-wrap { background: var(--surface); border-bottom: 1px solid var(--line); }
.brand-bar { max-width: 720px; margin: 0 auto; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand-bar.is-free .logo { font-size: 1.05rem; }
.brand-bar-cta { font-size: .85rem; font-weight: 600; text-decoration: none; color: var(--accent-text); background: var(--accent-soft); padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.brand-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { height: var(--logo-h, 52px); max-width: min(70vw, 420px); width: auto; object-fit: contain; }
.brand-bar.align-center { justify-content: center; }
.brand-bar.align-center .brand-id { flex-direction: column; gap: 6px; text-align: center; }
.brand-bar-wrap.bg-brand { background: var(--accent); border-bottom-color: transparent; }
.brand-bar-wrap.bg-brand .brand-name { color: var(--accent-ink); }
.preview-phone .brand-bar-wrap .brand-bar { background: transparent; border-bottom: 0; }
.preview-phone .brand-bar-wrap { border-bottom: 1px solid var(--line); background: var(--surface); }
.preview-phone .brand-bar-wrap.bg-brand { background: var(--accent); border-bottom-color: transparent; }
.brand-name { font-weight: 750; font-size: 1.1rem; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-banner img { width: 100%; height: clamp(110px, 24vw, 240px); object-fit: cover; }
.viewer-head { margin-bottom: 28px; }
.viewer-head h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.5rem); letter-spacing: -0.025em; }
.viewer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.v-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.v-step { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); break-inside: avoid; }
.v-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.v-step-label { font-weight: 700; color: var(--ink-2); }
.v-step .anno-figure { border-radius: 12px; overflow: hidden; width: min(100%, calc(72vh * var(--r, 1.5))); margin: 0 auto; }
.zoom-hit { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.v-step-text { font-size: 1.1rem; margin: 14px 2px 2px; white-space: pre-wrap; }
.viewer-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
.made-with { color: var(--muted); font-size: .875rem; text-decoration: none; }
.made-with strong { color: var(--accent-text); }
.made-with.subtle { font-size: .75rem; opacity: .7; }
.lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(12, 13, 15, .92); display: grid; place-items: center; padding: 16px; }
.lightbox-inner { width: min(100%, calc((100dvh - 32px) * var(--r, 1.5))); }
.lightbox-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: #fff; display: grid; place-items: center; cursor: pointer; }

/* ---------- QR-kaartje ---------- */
.qr-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.qr-preview { display: grid; place-items: center; padding: 28px; background: var(--surface-2); border-radius: var(--radius); min-height: 420px; }
.qr-controls { padding: 20px; }
.qr-card {
  background: #fff; color: var(--ink); border-radius: 18px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  width: 300px; aspect-ratio: 105 / 148; padding: 30px 26px 22px; border-top: 10px solid var(--accent);
}
.qr-card.size-a5 { width: 360px; aspect-ratio: 148 / 210; }
.qr-card-title { font-size: 1.25rem; font-weight: 750; letter-spacing: -0.015em; line-height: 1.25; margin-bottom: auto; overflow-wrap: anywhere; }
.qr-code { width: 74%; margin: 18px 0 14px; }
.qr-code svg { width: 100%; height: auto; display: block; }
.qr-cta { font-weight: 700; font-size: 1.05rem; margin: 0 0 4px; color: var(--accent-text); }
.qr-url { font-size: .72rem; color: var(--muted); margin: 0 0 auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .qr-layout { grid-template-columns: 1fr; }
  .qr-preview { min-height: 0; padding: 20px; }
}

/* ---------- Printen / PDF ---------- */
@media print {
  body { background: #fff; }
  .no-print, .topbar, .draft-banner, .toast, .brand-bar-cta, .save-bar { display: none !important; }
  .brand-bar-wrap { border-bottom: 1px solid #ddd; }
  .viewer-page { max-width: none; padding: 0; }
  .v-step { box-shadow: none; border-color: #ccc; page-break-inside: avoid; }
  .v-step .anno-figure { width: min(100%, calc(11cm * var(--r, 1.5))); margin: 0 auto; }
  .viewer-foot { page-break-inside: avoid; }

  body.print-qr * { visibility: hidden; }
  body.print-qr .qr-card, body.print-qr .qr-card * { visibility: visible; }
  body.print-qr .qr-card {
    position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; aspect-ratio: auto;
    border-radius: 0; box-shadow: none; padding: 12% 10% 6%;
  }
  body.print-qr .qr-card-title { font-size: 20pt; }
  body.print-qr .qr-cta { font-size: 15pt; }
  body.print-qr .qr-url { font-size: 8pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Huisstijl-pagina ---------- */
.brand-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.brand-form { padding: 22px; gap: 22px; }
.field-tip { margin: 2px 0 0; font-weight: 400; }
.brand-img { position: relative; height: 96px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); display: grid; place-items: center; overflow: hidden;
  background: repeating-conic-gradient(#F1EFEA 0 25%, #fff 0 50%) 0 0 / 16px 16px; font-weight: 400; }
.brand-img img { max-height: 78px; max-width: 90%; object-fit: contain; }
.brand-img.wide { height: 120px; }
.brand-img.wide img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.brand-img-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.brand-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch.light { width: 34px; height: 34px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.swatch.light.active { box-shadow: 0 0 0 2px var(--c); }
.brand-custom-color { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-weight: 400; }
.color-input { width: 46px; height: 46px; padding: 0; border: 1px solid var(--line-strong); border-radius: 10px; background: none; cursor: pointer; }
.hex-input { width: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: lowercase; }
.brand-preview { position: sticky; top: 84px; }
.preview-label { margin: 0 0 8px 2px; font-weight: 600; }
.preview-label:not(:first-child) { margin-top: 22px; }
.preview-phone { min-height: 0; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--bg); box-shadow: var(--shadow-lg); }
.preview-phone .brand-bar { padding: 10px 16px; min-height: 52px; }
.preview-phone .brand-banner img { height: 96px; }
.preview-phone .brand-logo { height: calc(var(--logo-h, 52px) * .8); max-width: 80%; }
.preview-body { padding: 16px; }
.preview-body h2 { font-size: 1.3rem; }
.preview-body .v-step { padding: 12px; }
.preview-photo { aspect-ratio: 16 / 9; border-radius: 10px; background: linear-gradient(135deg, #E9E6DF, #D5CEC2); }
.preview-body .v-step-text { font-size: .95rem; margin-top: 10px; }
.preview-qr { width: 220px; margin: 0 auto; padding: 20px 18px 16px; }
.fake-qr { width: 58%; aspect-ratio: 1; background: repeating-conic-gradient(#1B1D21 0 25%, #fff 0 50%) 0 0 / 22% 22%; border-radius: 4px; }
.qr-brand-logo { height: min(calc(var(--logo-h, 52px) * 1.05), 34%); max-width: 82%; object-fit: contain; margin-bottom: 12px; }
.qr-brand-name { font-weight: 750; color: var(--accent-text); margin-bottom: 10px; }
.qr-free-brand { margin-top: 10px; transform: scale(.82); opacity: .9; }
.preview-qr .qr-card-title { font-size: 1rem; }
.preview-qr .qr-cta { font-size: .9rem; }
@media (max-width: 860px) {
  .brand-layout { grid-template-columns: 1fr; }
  .brand-preview { position: static; }
}

.check { display: flex; align-items: center; gap: 10px; font-size: .95rem; cursor: pointer; margin-top: -8px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.header-field { gap: 12px; }
.sub-field { display: flex; flex-direction: column; gap: 6px; font-weight: 400; }
.sub-label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range { flex: 1; accent-color: var(--accent); height: 28px; }
.range-big { font-size: 1.3rem; font-weight: 600; color: var(--muted); line-height: 1; }
.range-value { min-width: 78px; text-align: right; }
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; align-self: flex-start; }
.segmented button { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; font: inherit; font-size: .9rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(27, 29, 33, .15); }

.save-bar { position: sticky; bottom: 0; z-index: 15; margin: 24px -20px -64px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.save-bar-inner { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.dirty-note { margin-right: auto; }
@media (max-width: 560px) { .dirty-note { display: none; } .save-bar-inner .btn { flex: 1; } }

/* ---------- Beheer ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat { padding: 16px 18px; }
.stat-value { font-size: 1.8rem; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.admin-tabs button { border: 0; background: none; font: inherit; font-weight: 650; color: var(--muted); padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.admin-tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.admin-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 12px; color: var(--muted); }
.search input { flex: 1; border: 0; background: none; font: inherit; min-height: 42px; outline: none; color: var(--ink); }
.search:focus-within { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
.admin-list { padding: 4px 0; }
.admin-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.admin-row:last-child { border-bottom: 0; }
.admin-main { flex: 1; min-width: 0; }
.admin-title { font-weight: 650; display: flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-count { white-space: nowrap; color: var(--ink-2); }
.admin-actions { display: flex; gap: 6px; }
.admin-empty { padding: 20px 18px; margin: 0; }
.admin-foot { margin-top: 14px; }
.danger-text { color: var(--danger); }
.small-seg button { padding: 6px 12px; font-size: .85rem; }
.segmented button.active.pro { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 720px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
  .admin-row { flex-wrap: wrap; gap: 8px 12px; }
  .admin-main { flex-basis: 100%; }
}

.editor .save-bar { margin-left: 0; margin-right: 0; border-radius: 16px 16px 0 0; border: 1px solid var(--line); border-bottom: 0; }
.editor-bar { max-width: none; }
