/* Vooruit Studio — vanilla CSS */
:root {
  --red: #E72501;
  --red-bright: #FF2900;
  --red-dark: #9F1D04;
  --beige: #E8E0D6;
  --black: #1a1a1a;
  --white: #ffffff;
  --ink-2: #2a2a2a;
  --ink-3: #555;
  --ink-4: #888;
  --rule: #e6e6e6;
  --bg: #f4f1ec;
  --sidebar-w: 360px;
  --header-h: 52px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: 'Poppins', Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--black);
  height: 100vh;
  overflow: hidden;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ---------- TOPBAR ---------- */
.topbar {
  height: var(--header-h);
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px 0 4px;
  position: relative;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding-right: 14px;
  border-right: 1px solid rgba(255,255,255,0.18);
  height: 100%;
}
.brand-logo {
  height: 30px;
  width: auto;
  display: block;
}
.brand-studio {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
}

/* Inline-editable project title */
.topbar-title {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  max-width: 480px;
}
.project-name {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: 1px solid transparent;
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  transition: background 120ms, border-color 120ms;
}
.project-name::placeholder { color: rgba(255,255,255,0.55); }
.project-name:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
}
.project-name:focus {
  outline: none;
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.45);
}
.project-name-icon {
  width: 14px;
  height: 14px;
  color: rgba(255,255,255,0.55);
  flex-shrink: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms;
}
.topbar-title:hover .project-name-icon,
.project-name:focus + .project-name-icon { opacity: 1; }

/* Right-side action cluster */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.tb-icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--white);
  cursor: pointer;
  padding: 0;
  transition: background 120ms, border-color 120ms;
}
.tb-icon-btn svg { width: 18px; height: 18px; display: block; }
.tb-icon-btn:hover { background: rgba(255,255,255,0.14); }
.tb-icon-btn:active { background: rgba(255,255,255,0.22); }
.tb-icon-btn.is-open { background: rgba(255,255,255,0.22); }

.tb-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 11px 0 9px;
  border-radius: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.20);
  color: #fff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms, border-color 120ms;
}
.tb-new svg { width: 15px; height: 15px; flex-shrink: 0; }
.tb-new:hover { background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.34); }
.tb-new:active { transform: translateY(1px); }
@media (max-width: 720px) { .tb-new span { display: none; } .tb-new { padding: 0 9px; } }

.tb-divider {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.22);
  margin: 0 6px;
}

/* Primary save button */
.tb-save {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px 0 12px;
  background: #fff;
  color: var(--red);
  border: 1px solid #fff;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 4px;
  transition: background 120ms, color 120ms, transform 60ms;
}
.tb-save svg { width: 15px; height: 15px; }
.tb-save:hover { background: var(--beige); }
.tb-save:active { transform: translateY(1px); }

/* Overflow menu */
.tb-overflow { position: relative; }
.tb-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: #fff;
  color: #1a1a1a;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.08);
  padding: 6px;
  z-index: 40;
}
.tb-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 9px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  text-align: left;
}
.tb-menu-item svg { width: 16px; height: 16px; color: #555; flex-shrink: 0; }
.tb-menu-item:hover { background: var(--bg); }
.tb-menu-item:hover svg { color: var(--red); }
.tb-menu-sep {
  height: 1px;
  background: var(--rule, #e7e3dc);
  margin: 4px 6px;
}

/* Save-status indicator in de topbar */
.save-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.78);
  transition: color 160ms, background 160ms;
}
.save-status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.save-status[data-state="saved"]   { color: rgba(255,255,255,0.62); }
.save-status[data-state="saving"]  { color: #ffd9b0; }
.save-status[data-state="saving"] .save-status-dot { animation: saveBlink 0.9s ease-in-out infinite; }
.save-status[data-state="unsaved"] { color: #ffc7bd; background: rgba(231,37,1,0.22); }
@keyframes saveBlink { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }
@media (max-width: 720px) { .save-status-text { display: none; } }

/* Download-menu extra's */
.tb-menu-right { right: 0; }
.tb-menu-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: #9a948b;
  padding: 6px 10px 3px;
}
.tb-menu-item-accent { color: var(--red); font-weight: 600; }
.tb-menu-item-accent svg { color: var(--red); }
.tb-menu-item-accent:hover { background: rgba(231,37,1,0.08); }
.dl-ratio {
  width: 16px; height: 16px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.dl-ratio::before {
  content: ""; display: block;
  border: 1.6px solid #9a948b; border-radius: 2px;
}
.tb-menu-item:hover .dl-ratio::before { border-color: var(--red); }
.dl-square::before    { width: 13px; height: 13px; }
.dl-portrait::before  { width: 11px; height: 14px; }
.dl-story::before     { width: 9px;  height: 15px; }
.dl-landscape::before { width: 15px; height: 8px; }

/* Download-menu onder de sidebar-footer (opent naar boven) */
.dl-footer { position: relative; flex: 1 1 0; display: flex; }
.dl-footer .btn-footer { flex: 1 1 0; }
.dl-footer-menu {
  top: auto;
  bottom: calc(100% + 8px);
  left: 0; right: auto;
  min-width: 240px;
}

/* Sneltoetsen-modal */
.sc-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(26,26,26,0.42);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: scFade 140ms ease;
}
@keyframes scFade { from { opacity: 0; } to { opacity: 1; } }
.sc-card {
  width: 100%; max-width: 420px;
  background: #fff; border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
  padding: 24px 24px 20px;
}
.sc-card h3 {
  margin: 0 0 4px; font-size: 18px; font-weight: 700; color: #1a1a1a;
  display: flex; align-items: center; gap: 8px;
}
.sc-lede { margin: 0 0 16px; font-size: 13px; color: #6b655c; line-height: 1.5; }
.sc-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 9px 0;
  border-top: 1px solid var(--rule, #efeae2);
}
.sc-row:first-of-type { border-top: 0; }
.sc-row span { font-size: 13.5px; color: #2a2620; }
.sc-keys { display: inline-flex; gap: 5px; flex-shrink: 0; }
.sc-key {
  font: 600 12px/1 ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--bg, #f6f4f0); color: #3a352e;
  border: 1px solid var(--rule, #e2dcd2);
  border-bottom-width: 2px;
  border-radius: 6px; padding: 5px 7px; min-width: 16px; text-align: center;
}
.sc-actions { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sc-replay {
  background: none; border: 0; padding: 4px 2px;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--red); cursor: pointer;
}
.sc-replay:hover { text-decoration: underline; }

/* Onboarding-rondleiding */
.ob-overlay { position: fixed; inset: 0; z-index: 300; }
.ob-spot {
  position: absolute;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(20,18,16,0.62);
  transition: left 220ms ease, top 220ms ease, width 220ms ease, height 220ms ease;
  pointer-events: none;
  outline: 2px solid rgba(255,255,255,0.85);
  outline-offset: 0;
}
.ob-tip {
  position: absolute;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.30);
  padding: 16px 18px 14px;
  transition: left 200ms ease, top 200ms ease;
}
.ob-tip h4 { margin: 0 0 5px; font-size: 16px; font-weight: 700; color: #1a1a1a; }
.ob-tip p { margin: 0; font-size: 13px; line-height: 1.5; color: #5a554d; }
.ob-step {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--red); margin-bottom: 6px;
}
.ob-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 16px;
}
.ob-skip {
  background: none; border: 0; padding: 4px 2px;
  font-family: inherit; font-size: 12.5px; color: #9a948b; cursor: pointer;
}
.ob-skip:hover { color: #5a554d; }
.ob-nav { display: flex; gap: 8px; }
.ob-btn {
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--rule, #e2dcd2);
}
.ob-ghost { background: #fff; color: #3a352e; }
.ob-ghost:hover { border-color: #b9b2a6; }
.ob-primary { background: var(--red); border-color: var(--red); color: #fff; }
.ob-primary:hover { background: var(--deep-red, #B91C00); border-color: var(--deep-red, #B91C00); }
.ob-arrow { position: absolute; width: 0; height: 0; }
.ob-arrow-top    { top: -8px;  border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 8px solid #fff; }
.ob-arrow-bottom { bottom: -8px; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid #fff; }
.ob-arrow-left   { left: -8px;  border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-right: 8px solid #fff; }
.ob-arrow-right  { right: -8px; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 8px solid #fff; }

/* Begeleide flow — doorklikbare verduistering + startscherm */
.ob-overlay-guide { pointer-events: none; }
.ob-overlay-guide .ob-tip { pointer-events: auto; }
.ob-spot.ob-spot-ok { outline-color: #2bd07a; box-shadow: 0 0 0 9999px rgba(20,18,16,0.62), 0 0 0 3px #2bd07a; }
.ob-intro {
  background: rgba(20,18,16,0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.ob-intro-card {
  width: 100%; max-width: 380px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.34);
  padding: 28px 26px 22px;
  text-align: center;
  animation: scFade 160ms ease;
}
.ob-intro-emoji { font-size: 40px; line-height: 1; }
.ob-intro-card h3 { margin: 12px 0 8px; font-size: 21px; font-weight: 800; color: #1a1a1a; }
.ob-intro-card p { margin: 0; font-size: 14px; line-height: 1.55; color: #5a554d; }
.ob-intro-actions {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 22px;
}
.ob-wait {
  margin-top: 12px; padding: 8px 10px;
  background: var(--bg, #f6f4f0); border-radius: 8px;
  font-size: 12px; font-weight: 600; color: #8a7f70;
}
.ob-wait-ok { background: rgba(31,138,91,0.10); color: #1F8A5B; }
.ob-wait-info { background: var(--bg, #f6f4f0); color: #8a7f70; font-weight: 500; }
.ob-skiplink {
  background: none; border: 0; padding: 8px 6px;
  font-family: inherit; font-size: 12px; color: #9a948b; cursor: pointer;
}
.ob-skiplink:hover { color: #5a554d; text-decoration: underline; }
.ob-btn.ob-primary:disabled { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 720px) {
  .ob-tip { width: calc(100vw - 24px) !important; left: 12px !important; }
}

/* Interactieve checklist — zwevend kaartje rechtsonder */
.cl-card {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 180;
  width: 290px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 44px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  font-family: inherit;
  animation: clIn 260ms cubic-bezier(.2,.7,.2,1);
}
@keyframes clIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.cl-card.cl-pulse { animation: clPulse 420ms ease; }
@keyframes clPulse { 0%,100% { box-shadow: 0 16px 44px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.08); } 40% { box-shadow: 0 0 0 3px rgba(231,37,1,0.35), 0 16px 44px rgba(0,0,0,0.22); } }
.cl-head {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  background: var(--red);
  color: #fff;
  border: 0;
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
}
.cl-head-title { font-size: 14px; font-weight: 700; flex: 1 1 auto; text-align: left; }
.cl-progress {
  font-size: 11.5px; font-weight: 700;
  background: rgba(255,255,255,0.22);
  padding: 2px 8px; border-radius: 999px;
}
.cl-chev { font-size: 12px; transition: transform 180ms; }
.cl-card.cl-collapsed .cl-chev { transform: rotate(-180deg); }
.cl-body { padding: 12px 14px 14px; }
.cl-card.cl-collapsed .cl-body { display: none; }
.cl-lede { margin: 0 0 10px; font-size: 12px; line-height: 1.45; color: #6b655c; }
.cl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cl-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 6px; border-radius: 8px;
}
.cl-check {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--rule, #d9d3c8);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
  transition: background 160ms, border-color 160ms;
}
.cl-item-done .cl-check { background: #1F8A5B; border-color: #1F8A5B; }
.cl-item-text { display: flex; flex-direction: column; gap: 2px; }
.cl-item-label { font-size: 13px; font-weight: 600; color: #2a2620; }
.cl-item-done .cl-item-label { color: #9a948b; text-decoration: line-through; }
.cl-item-hint { font-size: 11.5px; color: #9a948b; line-height: 1.35; }
.cl-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.cl-dismiss, .cl-tour {
  background: none; border: 0; font-family: inherit;
  font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 2px;
}
.cl-dismiss { color: #9a948b; }
.cl-dismiss:hover { color: #5a554d; }
.cl-tour { color: var(--red); }
.cl-tour:hover { text-decoration: underline; }
.cl-done { text-align: center; padding: 8px 4px 2px; }
.cl-done-emoji { font-size: 34px; }
.cl-done h4 { margin: 6px 0 4px; font-size: 16px; font-weight: 700; color: #1a1a1a; }
.cl-done p { margin: 0 0 14px; font-size: 12.5px; line-height: 1.5; color: #6b655c; }
.cl-btn-primary {
  background: var(--red); color: #fff; border: 0;
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 9px 18px; border-radius: 8px; cursor: pointer;
}
.cl-btn-primary:hover { background: var(--deep-red, #B91C00); }
@media (max-width: 720px) {
  .cl-card { right: 10px; bottom: 10px; width: calc(100vw - 20px); max-width: 320px; }
}

/* ---------- BUTTONS ---------- */
.btn {
  border: 1px solid transparent;
  background: var(--white);
  color: var(--black);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: background 120ms, color 120ms, border-color 120ms, transform 80ms;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.btn:hover { background: var(--beige); }
.btn:active { transform: translate(1px, 1px); }
.btn-primary {
  background: var(--white);
  color: var(--red);
  border-color: var(--white);
}
.btn-primary:hover { background: var(--beige); color: var(--red-dark); }
.btn-ghost {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border-color: rgba(255,255,255,0.3);
}
.btn-ghost:hover { background: rgba(255,255,255,0.2); }
.btn-mini { padding: 6px 10px; font-size: 12px; }
.btn-big {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 15px;
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-big:hover { background: var(--red-bright); border-color: var(--red-bright); }
.btn-danger {
  background: transparent;
  color: var(--red-dark);
  border-color: transparent;
}
.btn-danger:hover { background: #fce8e5; }

/* ---------- WORKSPACE ---------- */
.workspace {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--rule);
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 0 12px;
  min-height: 0;
}
.sidebar > section.panel:last-of-type { flex: 1 1 auto; }
.sidebar-footer {
  flex: 0 0 auto;
  background: var(--white);
  border-top: 1px solid var(--rule);
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  z-index: 5;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.04);
}
.sidebar-footer .btn-footer {
  flex: 1 1 0;
  height: 40px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ---------- design-name prompt modal ---------- */
.name-prompt-overlay {
  position: fixed; inset: 0;
  background: rgba(17, 24, 39, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 99999;
  padding: 24px;
  animation: npFade 120ms ease-out;
}
@keyframes npFade { from { opacity: 0; } to { opacity: 1; } }
.name-prompt-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 28px 22px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  animation: npPop 140ms ease-out;
}
@keyframes npPop { from { transform: translateY(8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.name-prompt-card h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
  color: #1F2937;
}
.name-prompt-lede {
  margin: 0 0 18px;
  font-size: 14px;
  color: #6B7280;
  line-height: 1.45;
}
.name-prompt-card input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: #1F2937;
  background: #FAFAFA;
  transition: border-color 120ms, background 120ms;
}
.name-prompt-card input:focus {
  outline: none;
  border-color: #1F2937;
  background: #fff;
}
.name-prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.name-prompt-actions .btn {
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}
.panel {
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--rule);
}
.panel-title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Format grid */
.format-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.fmt-btn {
  background: var(--white);
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  padding: 10px 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  font-size: 10px;
  color: var(--ink-2);
  font-weight: 600;
  text-align: center;
  transition: border-color 120ms, background 120ms;
  min-height: 92px;
}
.fmt-btn .fmt-preview-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.fmt-btn > span {
  display: block;
}
.fmt-btn:hover { border-color: var(--ink-4); }
.fmt-btn.active {
  border-color: var(--red);
  background: #fff5f3;
  color: var(--red);
}
.fmt-btn small {
  display: block;
  font-size: 10px;
  color: var(--ink-4);
  font-weight: 400;
}
.fmt-btn.active small { color: var(--red-dark); }
.fmt-preview {
  width: 28px;
  max-height: 40px;
  background: var(--beige);
  border-radius: 3px;
}
.fmt-btn.active .fmt-preview { background: var(--red); }

/* Template picker */
.template-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
  max-width: 220px;
}
.tq-thumb {
  aspect-ratio: 1 / 1;
  background: var(--beige);
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  padding: 0;
  transition: border-color 120ms, transform 120ms;
}
.tq-thumb:hover { border-color: var(--red); transform: translateY(-1px); }
.tq-thumb.is-active { border-color: var(--red); border-width: 2px; }
.btn-block { width: 100%; }
.tq-more {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms, transform 80ms;
}
.tq-more:hover { background: var(--white); border-color: var(--red); color: var(--red); }
.tq-more:active { transform: scale(0.99); }
.tp-meta small {
  display: block;
  font-size: 11px;
  color: var(--ink-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Theme grid */
.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.theme-btn {
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  background: white;
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: border-color 120ms;
}
.theme-btn:hover { border-color: var(--ink-4); }
.theme-btn.active { border-color: var(--red); }
.theme-swatch {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  overflow: hidden;
  flex-shrink: 0;
}
.theme-swatch span { flex: 1; }

/* Pill color grid — user picks balk-achtergrondkleur */
.pill-color-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.pill-swatch {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: 999px;
  border: 1.5px solid var(--rule);
  background: #fff;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: transform 120ms, border-color 120ms, box-shadow 120ms;
}
.pill-swatch:hover { transform: scale(1.08); border-color: var(--ink-4); }
.pill-swatch.active {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--red);
}
.pill-swatch .ps-fill {
  position: absolute; inset: 0;
  border-radius: 999px;
}
.pill-swatch .ps-check {
  position: absolute; inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}
.pill-swatch.active .ps-check { display: flex; }
.pill-swatch[data-id="white"],
.pill-swatch[data-id="cream"],
.pill-swatch[data-id="beige"] { border-color: var(--rule); }

/* Fields */
.field {
  display: block;
  margin-bottom: 12px;
}
.field-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 6px;
  font-weight: 600;
}
.field-label .val { color: var(--red); font-weight: 700; }
.field input[type="text"],
.field textarea,
.field input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  font-size: 13px;
  color: var(--black);
  background: white;
  font-family: inherit;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--red);
}
.field textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.4;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--red);
}
.field-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  background: #f9f7f3;
  border-radius: 6px;
}
.field-inline select,
.field-inline label {
  font-size: 11px;
}
.field-inline .field { margin: 0; }
.field-inline select {
  width: 100%;
  padding: 6px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: white;
}
.field-inline .caps-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
}

/* Photo drop */
.photo-drop {
  border: 2px dashed var(--rule);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  margin-bottom: 10px;
  background: var(--bg);
  transition: border-color 120ms, background 120ms;
}
.photo-drop.drag {
  border-color: var(--red);
  background: #fff5f3;
}
.photo-drop-icon {
  font-size: 22px;
  margin-bottom: 2px;
  opacity: 0.7;
}
.photo-drop-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}
.photo-drop-hint {
  font-size: 10px;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.photo-buttons {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.photo-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 120ms, background 120ms, transform 80ms;
  width: 100%;
}
.photo-action-btn:hover {
  border-color: var(--red);
  background: #fff;
}
.photo-action-btn:active { transform: scale(0.99); }
.photo-action-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.photo-action-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.photo-action-label strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

/* Photo adjustment groups (compact) */
.photo-adj-group {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.photo-adj-group:last-of-type { border-bottom: none; padding-bottom: 0; }
.photo-adj-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.photo-adj-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-mid, #555);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.btn-text-mini {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-mid, #777);
  padding: 2px 6px;
  border-radius: 4px;
}
.btn-text-mini:hover { background: var(--bg); color: var(--red); }
.field-compact { margin-bottom: 4px; }
.field-compact .field-label { font-size: 11px; }
.photo-hint {
  font-size: 10px;
  color: var(--ink-mid, #888);
  font-style: italic;
  margin: 4px 0 0;
  line-height: 1.3;
}

/* Photo card (shown when a photo is loaded) */
.photo-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--white);
  margin-bottom: 10px;
}
.photo-card-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--bg);
  background-size: cover;
  background-position: center;
}
.photo-card-actions {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.photo-card-actions .btn {
  width: 100%;
  justify-content: flex-start;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--rule);
}
.photo-card-actions .btn:hover {
  background: var(--white);
  border-color: var(--red);
  color: var(--red);
}

/* Inline danger link for "remove photo" — less prominent than a danger button */
.btn-link-danger {
  background: transparent !important;
  border: none !important;
  color: var(--red) !important;
  text-decoration: underline;
  font-size: 11px;
  padding: 6px 4px !important;
  margin-top: 4px;
  align-self: flex-start;
}
.btn-link-danger:hover { color: var(--red-dark) !important; }

/* Afdelingsmatch indicator (onder logoAfdeling input) */
.afd-hint {
  display: block;
  margin-top: 6px;
  font: 600 11px/1.3 'Poppins', system-ui, sans-serif;
  color: #1a8a4a;
  letter-spacing: .01em;
}

/* Logo positions */
.logo-pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-bottom: 10px;
  max-width: 108px;
  justify-items: start;
}
.pos-btn {
  aspect-ratio: 1;
  width: 100%;
  border: 1.5px solid var(--rule);
  background: white;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  color: var(--ink-3);
  transition: border-color 120ms, color 120ms;
}
.pos-btn:hover { border-color: var(--ink-4); }
.pos-btn.active {
  border-color: var(--red);
  color: var(--red);
  background: #fff5f3;
}

/* ---------- CANVAS STAGE ---------- */
.canvas-stage {
  overflow: auto;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.canvas-toolbar {
  position: absolute;
  top: 14px;
  left: 18px;
  display: flex;
  gap: 6px;
  z-index: 5;
}
.ct-btn {
  background: var(--white);
  border: 1px solid var(--rule);
  color: var(--ink-2);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: background 120ms, border-color 120ms, color 120ms;
}
.ct-btn:hover { border-color: var(--ink-4); color: var(--black); }
.ct-btn:active { transform: translateY(1px); }
.ct-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ct-btn.ct-icon {
  min-width: 34px;
  padding: 7px 10px;
  font-size: 16px;
  line-height: 1;
}
.ct-btn.ct-accent {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 600;
}
.ct-btn.ct-accent:hover { background: var(--deep-red, #B91C00); border-color: var(--deep-red, #B91C00); color: #fff; }
.ct-divider {
  width: 1px;
  align-self: stretch;
  margin: 4px 2px;
  background: var(--rule, #e7e3dc);
}
.canvas-wrap {
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  background: white;
  display: block;
}
#canvas {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - var(--header-h) - 64px);
  width: auto;
  height: auto;
}

/* ---------- MODAL ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,0.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal-card {
  background: white;
  border-radius: 10px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}
.modal-wide { width: min(1100px, 92vw); }
.modal-narrow { width: min(420px, 92vw); }
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
}
.modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.modal-head-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: center;
}
.modal-head-actions input[type="text"] {
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 13px;
  width: 240px;
}
.modal-close {
  background: transparent;
  border: 0;
  font-size: 24px;
  line-height: 1;
  color: var(--ink-4);
  padding: 4px 8px;
  border-radius: 4px;
  margin-left: auto;
}
.modal-head-actions + .modal-close { margin-left: 0; }
.modal-close:hover { background: var(--bg); color: var(--black); }
.modal-body {
  padding: 20px;
  overflow-y: auto;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
.modal-topics {
  display: flex;
  gap: 6px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  flex-wrap: wrap;
}
.topic-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--rule);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
}
.topic-chip:hover { border-color: var(--ink-4); }
.topic-chip.active {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

/* ---------- GRIDS (gallery / projects / photos) ---------- */
.gallery-grid,
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.card-tile {
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  background: white;
  cursor: pointer;
  transition: border-color 120ms, transform 120ms;
  display: flex;
  flex-direction: column;
}
.card-tile:hover {
  border-color: var(--red);
  transform: translateY(-2px);
}
.card-tile .tile-thumb {
  aspect-ratio: 1;
  background: var(--beige) center/cover;
  display: block;
}
.card-tile .tile-meta {
  padding: 10px 12px;
  border-top: 1px solid var(--rule);
}
.card-tile .tile-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--black);
  margin: 0 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-tile .tile-sub {
  font-size: 11px;
  color: var(--ink-4);
  margin: 0;
}
.card-tile .tile-actions {
  display: flex;
  gap: 4px;
  padding: 0 10px 10px;
}
.card-tile .tile-actions .btn {
  flex: 1;
  justify-content: center;
  padding: 5px 8px;
  font-size: 11px;
  background: var(--bg);
}
.card-tile .tile-actions .btn:hover { background: var(--beige); }
.card-tile .tile-actions .btn-danger {
  background: transparent;
  flex: 0 0 32px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 720px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}
.photo-tile {
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  background: white;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: border-color 120ms;
}
.photo-tile:hover { border-color: var(--red); }
.photo-tile .pt-img {
  aspect-ratio: 1;
  background: var(--beige) center/cover;
}
.photo-tile .pt-meta {
  padding: 6px 8px;
  font-size: 11px;
}
.photo-tile .pt-name {
  font-weight: 700;
  color: var(--black);
  margin: 0 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-tile .pt-tags {
  color: var(--ink-4);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 14px;
}
.photo-tile .pt-del {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(26,26,26,0.75);
  color: white;
  border: 0;
  border-radius: 50%;
  width: 24px; height: 24px;
  opacity: 0;
  transition: opacity 120ms, background 120ms;
  font-size: 14px;
  line-height: 1;
}
.photo-tile:hover .pt-del { opacity: 1; }
.photo-tile .pt-del:hover { background: var(--red); }
.photo-tile .editable {
  outline: none;
}
.photo-tile .editable:focus {
  background: #fff5f3;
  border-radius: 3px;
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--ink-4);
  grid-column: 1 / -1;
}
.empty-state h3 { margin: 0 0 8px; color: var(--ink-3); }

/* ---------- FLASH ---------- */
.flash {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--black);
  color: white;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 200;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  animation: flash-in 180ms;
}
@keyframes flash-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  :root { --sidebar-w: 100%; --preview-h: 38vh; }
  body { overflow: hidden; height: 100dvh; }
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: var(--preview-h) 1fr;
    height: calc(100dvh - var(--header-h));
  }
  /* preview pinned on top */
  .canvas-stage {
    order: 1;
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 6px 14px rgba(0,0,0,0.06);
    height: var(--preview-h);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .canvas-wrap {
    max-height: 100%;
  }
  #canvas {
    max-height: calc(var(--preview-h) - 32px) !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
  }
  /* sidebar scrolls underneath */
  .sidebar {
    order: 2;
    max-height: none;
    height: 100%;
    border-right: 0;
    border-top: 1px solid var(--rule);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 10px;
    gap: 8px;
  }
  .topbar-title { order: 3; max-width: 100%; flex: 1 1 100%; }
  .project-name { width: 100%; }
}

/* ---------- STICKERS panel ---------- */
.sticker-palette {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  max-width: 280px;
}
/* Map ("folder") — inklapbare categorie binnen het palet. */
.sp-folder { border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.sp-folder-head {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: var(--bg);
  border: 0; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: #3a352e;
  text-align: left;
}
.sp-folder-head:hover { background: #f0ece4; }
.sp-folder-label { flex: 1; }
.sp-folder-count {
  font-size: 11px; font-weight: 600; color: #9a948b;
  background: #fff; border: 1px solid var(--rule);
  border-radius: 999px; padding: 1px 7px; min-width: 18px; text-align: center;
}
.sp-folder-chev { font-size: 10px; color: #9a948b; transition: transform 150ms ease; }
.sp-folder.sp-collapsed .sp-folder-chev { transform: rotate(-90deg); }
.sp-folder-body { padding: 8px; background: #fff; }
.sp-folder.sp-collapsed .sp-folder-body { display: none; }
.sp-folder-empty { margin: 0; padding: 6px 2px; font-size: 12px; color: #9a948b; font-style: italic; }
.sp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  justify-items: start;
}
.sticker-palette .sp-btn {
  aspect-ratio: 1;
  width: 100%;
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  background: var(--bg);
  cursor: pointer;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 120ms, background 120ms, transform 120ms;
}
.sticker-palette .sp-btn:hover {
  border-color: var(--red);
  background: white;
  transform: translateY(-1px);
}
.sticker-palette .sp-btn .sp-thumb {
  flex: 1;
  width: 100%;
  height: 100%;
  background-color: #E72501;
  background-size: 70%;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 3px;
}
/* Raw-variant (full-colour logo/media): witte tegel, volledig logo zichtbaar. */
.sticker-palette .sp-btn .sp-thumb-raw {
  background-color: #fff;
  background-size: contain;
}
/* Emoji-variant: geen rode achtergrond, grote glyph als "thumbnail". */
.sticker-palette .sp-btn .sp-thumb-emoji {
  background-color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}
/* Hide labels — too cramped at this size. Tooltip (title attr) still works. */
.sticker-palette .sp-btn > span:not(.sp-thumb) { display: none; }

.sticker-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sticker-card {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sticker-card .sc-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sticker-card .sc-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background-color: var(--bg);
  background-size: 78%;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}
.sticker-card .sc-icon-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}
.sticker-card .sc-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--black);
  flex: 1;
}
.sticker-card .sc-toggle,
.sticker-card .sc-del {
  background: transparent;
  border: 0;
  color: var(--ink-4);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
}
.sticker-card .sc-toggle:hover {
  background: var(--bg);
  color: var(--black);
}
.sticker-card .sc-del:hover {
  background: #fee2e2;
  color: var(--red);
}
.sticker-card.sc-hidden {
  opacity: 0.55;
}
.sticker-card.sc-hidden .sc-icon {
  filter: grayscale(0.8);
}
.sticker-card .field {
  gap: 4px;
  margin: 0;
}
.sticker-card .field-label {
  font-size: 10px;
}

.sticker-colors {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.sticker-colors button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--rule);
  cursor: pointer;
  padding: 0;
  transition: transform 120ms, border-color 120ms;
  position: relative;
}
.sticker-colors button:hover { transform: scale(1.1); }
.sticker-colors button.active {
  border-color: var(--black);
  box-shadow: 0 0 0 2px white, 0 0 0 3.5px var(--black);
}


/* ---------- AUTH OVERLAY ---------- */
.auth-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #E5322D 0%, #B82420 100%);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-overlay[hidden] { display: none !important; }
.auth-card {
  width: 100%; max-width: 440px;
  background: #fff;
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.auth-brand {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid #ececec;
  margin-bottom: 20px;
}
.auth-brand img { height: 34px; filter: brightness(0) invert(0); display: none; }
.auth-brand { background: #E5322D; margin: -36px -36px 24px; padding: 24px 36px; border-radius: 16px 16px 0 0; color: #fff; }
.auth-brand img { display: block; filter: none; }
.auth-brand div { display: flex; flex-direction: column; line-height: 1.1; }
.auth-brand strong { font-size: 20px; font-weight: 800; }
.auth-brand span { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.9; }

.auth-tabs { display: flex; gap: 4px; margin-bottom: 20px; background: #f4f4f4; padding: 4px; border-radius: 8px; }
.auth-tab {
  flex: 1; border: 0; background: transparent; padding: 8px 12px;
  font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 6px; color: #555;
}
.auth-tab.active { background: #fff; color: #111; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form[hidden] { display: none !important; }
.auth-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #333; }
.auth-field small { color: #888; font-weight: 400; }
.auth-field input, .auth-field select {
  border: 1px solid #d9d9d9; border-radius: 8px; padding: 10px 12px;
  font-size: 14px; font-family: inherit; background: #fff; color: #111;
}
.auth-field input:focus, .auth-field select:focus { outline: none; border-color: #E5322D; box-shadow: 0 0 0 3px rgba(229,50,45,0.15); }
.auth-error {
  background: #fdecec; color: #b82420; border-radius: 8px;
  padding: 10px 12px; font-size: 13px; font-weight: 500;
}
.auth-success {
  background: #e9f7ee; color: #1a6b34; border-radius: 8px;
  padding: 12px 14px; font-size: 13px; line-height: 1.5;
  border: 1px solid #c8e6cf;
}
.auth-success strong { display: block; font-size: 14px; margin-bottom: 4px; }
.auth-submit { margin-top: 4px; padding: 12px; font-size: 14px; background: #E5322D; color: #fff; border-color: #E5322D; }
.auth-submit:hover { background: #B82420; border-color: #B82420; }
.auth-submit:disabled { opacity: 0.6; cursor: default; }

.auth-link {
  align-self: center; background: none; border: 0; padding: 4px 6px;
  font-family: inherit; font-size: 13px; font-weight: 600; color: #E5322D;
  cursor: pointer; border-radius: 6px;
}
.auth-link:hover { text-decoration: underline; }
.auth-intro { font-size: 13px; line-height: 1.55; color: #555; margin: 0; }

.auth-footnote {
  margin-top: 20px; padding-top: 18px; border-top: 1px solid #ececec;
  font-size: 11px; color: #777; line-height: 1.55;
}
.auth-footnote strong { color: #333; }

/* ---------- USER MENU ---------- */
.user-menu { position: relative; margin-left: 6px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px; padding: 3px 6px 3px 4px;
  cursor: pointer; color: #fff;
  height: 36px;
  transition: background 120ms;
}
.user-chip:hover { background: rgba(255,255,255,0.24); }
.user-chip.is-open { background: rgba(255,255,255,0.28); }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; color: var(--red);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; letter-spacing: 0.02em;
  flex-shrink: 0;
}
.user-chip-caret { width: 10px; height: 10px; opacity: 0.85; }

.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; color: #111;
  border-radius: 10px; min-width: 220px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.08);
  padding: 6px;
  z-index: 50;
}
.user-drop-meta {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px 6px;
}
.user-drop-meta strong { font-size: 13px; font-weight: 600; color: #1a1a1a; }
.user-drop-meta small { font-size: 10px; color: #888; text-transform: uppercase; letter-spacing: 0.05em; }
.user-drop-sep { height: 1px; background: var(--rule, #e7e3dc); margin: 4px 6px; }
.user-drop-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: transparent; border: 0;
  padding: 9px 10px; border-radius: 6px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: #1a1a1a; cursor: pointer;
}
.user-drop-item svg { width: 16px; height: 16px; color: #555; flex-shrink: 0; }
.user-drop-item:hover { background: var(--bg); }
.user-drop-item:hover svg { color: var(--red); }

/* ---------- ADMIN PANEL ---------- */
.admin-tabs {
  display: flex; gap: 2px; padding: 0 24px;
  border-bottom: 1px solid #eee; background: #fafafa;
}
.admin-tab {
  border: 0; background: transparent; padding: 12px 16px;
  font-size: 13px; font-weight: 600; color: #666; cursor: pointer;
  border-bottom: 2px solid transparent; font-family: inherit;
}
.admin-tab:hover { color: #111; }
.admin-tab.active { color: #E5322D; border-bottom-color: #E5322D; }
.admin-body { padding: 20px 24px; min-height: 400px; }
.admin-pane-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 18px;
}
.admin-pane-head strong { font-size: 15px; }
.admin-hint { font-size: 13px; color: #666; margin: 4px 0 0; line-height: 1.5; max-width: 560px; }

.admin-templates-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.admin-template-card {
  border: 1px solid #e8e8e8; border-radius: 10px; overflow: hidden;
  background: #fff; cursor: default;
}
.admin-template-card .atc-thumb {
  aspect-ratio: 1/1; background: #f4f4f4; background-size: cover; background-position: center;
}
.admin-template-card .atc-meta { padding: 10px 12px; }
.admin-template-card .atc-meta strong { font-size: 13px; display: block; }
.admin-template-card .atc-meta small { font-size: 11px; color: #888; }
.admin-template-card .atc-actions { display: flex; gap: 6px; padding: 0 10px 10px; }
.admin-template-card .atc-actions .btn { padding: 5px 10px; font-size: 11px; flex: 1; }

.admin-empty {
  grid-column: 1 / -1;
  padding: 40px; text-align: center; color: #888;
  border: 2px dashed #e0e0e0; border-radius: 10px;
}

.admin-users-list { display: flex; flex-direction: column; gap: 6px; }
.admin-user-role {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 4px;
}
.admin-user-role.role-user { background: #f0f0f0; color: #555; }
.admin-user-role.role-beweging { background: #fff4d1; color: #7d5a00; }
.admin-user-role.role-lab { background: #fdecec; color: #b82420; }

/* ---------- TEMPLATE IMPORT ---------- */
.modal-xwide { max-width: 1100px !important; width: 95vw; }
.ti-body { display: grid; grid-template-columns: 340px 1fr; gap: 0; padding: 0 !important; min-height: 520px; }
.ti-left { padding: 20px 22px; border-right: 1px solid #eee; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 72vh; }
.ti-right { padding: 20px; background: #f6f6f6; display: flex; align-items: center; justify-content: center; overflow: auto; }
.ti-preview {
  position: relative; max-width: 100%; max-height: 68vh;
  background: #fff; box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  background-size: cover; background-position: center;
}
.ti-preview-empty {
  width: 400px; height: 400px;
  display: flex; align-items: center; justify-content: center;
  color: #999; font-size: 14px; background: #eee;
}
.ti-ph {
  position: absolute; border: 2px dashed #E5322D; background: rgba(229,50,45,0.08);
  color: #E5322D; font-size: 11px; font-weight: 700;
  padding: 4px 8px; cursor: move; user-select: none;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.ti-ph.selected { border-style: solid; background: rgba(229,50,45,0.18); box-shadow: 0 0 0 2px #E5322D; }
.ti-ph .ti-ph-handle {
  position: absolute; right: -6px; bottom: -6px;
  width: 12px; height: 12px; background: #E5322D; border-radius: 50%;
  cursor: nwse-resize;
}
.ti-ph-remove {
  position: absolute; top: -10px; right: -10px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #E5322D; color: #fff; border: 2px solid #fff;
  font-size: 13px; font-weight: 700; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ti-plist { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.ti-plist-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; background: #f4f4f4; border-radius: 6px; font-size: 12px;
}
.ti-plist-item.selected { background: rgba(229,50,45,0.12); color: #E5322D; font-weight: 600; }
.ti-add-row { display: flex; gap: 6px; flex-wrap: wrap; }

.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: auto; padding-top: 10px; }

/* Hide the app chrome when the auth overlay is active. */
body.auth-gated > .topbar,
body.auth-gated > .workspace,
body.auth-gated > .modal { display: none !important; }
body.auth-gated { overflow: hidden; }

/* users tab: grid table */
.admin-users-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; margin-bottom: 12px; flex-wrap: wrap;
}
.admin-users-table {
  border: 1px solid #eee; border-radius: 8px; overflow: hidden;
}
.aut-head, .admin-user-row {
  display: grid;
  grid-template-columns: 1.3fr 1.6fr 1.1fr 90px 90px;
  gap: 12px; align-items: center;
  padding: 10px 14px;
}
.aut-head {
  background: #fafafa;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: #666;
}
.aut-head .aut-num { text-align: right; }
.admin-user-row { border-top: 1px solid #f0f0f0; font-size: 13px; }
.admin-user-row strong { font-weight: 600; font-size: 13px; }
.admin-user-row .aur-email { color: #666; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-row .aut-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.admin-user-role {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 4px;
  justify-self: start;
}
.admin-user-role.role-user { background: #f0f0f0; color: #555; }
.admin-user-role.role-beweging { background: #fff4d1; color: #7d5a00; }
.admin-user-role.role-lab { background: #fdecec; color: #b82420; }


/* ---------- ADMIN: pending approvals + role editor ---------- */
.admin-section { margin-bottom: 28px; }
.admin-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #eee;
  font-size: 14px;
}
.admin-pending-list { display: flex; flex-direction: column; gap: 8px; }
.admin-pending-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 10px;
  background: #fff8e6; border: 1px solid #f4dc99;
}
.admin-pending-row .apr-who strong { display: block; font-size: 14px; }
.admin-pending-row .apr-who small { color: #806b1f; font-size: 12px; }
.admin-pending-row .apr-actions { display: flex; gap: 8px; }

.admin-rejected-list { display: flex; flex-direction: column; gap: 6px; }
.admin-rejected-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: 6px; background: #fafafa;
  font-size: 13px;
}
.admin-rejected-row strong { font-weight: 600; }

/* role select inline */
.admin-role-select {
  font-size: 12px; padding: 4px 8px; border: 1px solid #ddd; border-radius: 6px;
  background: #fff; cursor: pointer; max-width: 100%;
}
.admin-role-select:hover { border-color: #bbb; }

/* updated grid: add 6th column for actions */
.aut-head, .admin-user-row {
  grid-template-columns: 1.2fr 1.6fr 1.2fr 80px 80px 32px !important;
}
.aur-actions { display: flex; align-items: center; justify-content: center; }
.aur-self { font-size: 11px; color: #aaa; font-style: italic; }
.btn-icon {
  width: 26px; height: 26px; padding: 0; display: inline-flex;
  align-items: center; justify-content: center; font-size: 14px; line-height: 1;
}
.btn-tb-icon {
  min-width: 34px;
  padding: 6px 10px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}
.btn-tb-icon:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------- ADMIN: activity log ---------- */
.admin-activity { display: flex; flex-direction: column; gap: 14px; }
.al-filter-row {
  display: flex; gap: 10px; align-items: center;
}
.al-search {
  flex: 1 1 auto;
  padding: 9px 12px; border: 1px solid var(--rule); border-radius: 8px;
  font-size: 13px; background: #fff; font-family: inherit;
}
.al-search:focus { outline: none; border-color: var(--vooruit-red); box-shadow: 0 0 0 3px rgba(231,37,1,0.12); }
.al-select {
  padding: 9px 10px; border: 1px solid var(--rule); border-radius: 8px;
  font-size: 13px; background: #fff; font-family: inherit; cursor: pointer;
}
.al-table {
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.al-head, .al-row {
  display: grid;
  grid-template-columns: 130px 1.4fr 170px 2fr;
  gap: 12px;
  padding: 10px 14px;
  align-items: center;
  font-size: 13px;
}
.al-head {
  background: #f7f7f7;
  border-bottom: 1px solid var(--rule);
  font-weight: 600;
  color: #555;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.al-row + .al-row { border-top: 1px solid #f0f0f0; }
.al-row:hover { background: #fafafa; }
.al-ts { color: #666; font-variant-numeric: tabular-nums; font-size: 12px; }
.al-who strong { display: block; font-size: 13px; font-weight: 600; }
.al-who small { display: block; color: #888; font-size: 11px; }
.al-kind {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  width: fit-content;
  white-space: nowrap;
}
.al-kind.al-ok { background: #dcf5e5; color: #1b7a3e; }
.al-kind.al-info { background: #e4edff; color: #2149a6; }
.al-kind.al-warn { background: #ffe4e1; color: #a63021; }
.al-kind.al-neutral { background: #eee; color: #555; }
.al-detail { color: #444; font-size: 12px; word-wrap: break-word; }

@media (max-width: 900px) {
  .al-head { display: none; }
  .al-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 14px;
  }
  .al-ts { font-size: 11px; color: #999; }
  .al-kind { margin: 4px 0 0; }
}


/* ---------- PHOTO LIB: filter tabs ---------- */
.photolib-tabs {
  display: inline-flex;
  gap: 2px;
  background: #f0f0f0;
  border-radius: 8px;
  padding: 3px;
}
.photolib-tabs .ph-tab {
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 120ms;
}
.photolib-tabs .ph-tab:hover { color: var(--black); }
.photolib-tabs .ph-tab.is-active {
  background: var(--white);
  color: var(--red);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ---------- PHOTO LIB: badges + actions ---------- */
.photo-tile.is-archived { opacity: 0.6; }
.photo-tile.is-archived .pt-img { filter: grayscale(0.4); }

.photo-tile .pt-badges {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  gap: 4px;
  pointer-events: none;
}
.photo-tile .pt-badge {
  background: rgba(0,0,0,0.65);
  color: white;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 10px;
  line-height: 1;
}

/* (oude pt-act styling verwijderd — zie nieuwe pt-actions hieronder) */

/* archived design tile */
/* =========================================================
   PROJECT TILES v2 — "Mijn designs"
   ========================================================= */
.pt2-tile {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1.5px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 160ms, border-color 160ms, transform 160ms;
  cursor: default;
}
.pt2-tile:hover {
  border-color: var(--red);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}
.pt2-tile.is-archived { opacity: 0.6; }
.pt2-tile.is-archived .pt2-thumb img { filter: grayscale(0.5); }

/* Thumbnail */
.pt2-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  flex-shrink: 0;         /* vierkant behouden, niet platdrukken door tegelhoogte */
  background: var(--beige, #f4f1ec);
  border: 0;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pt2-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pt2-thumb-empty { font-size: 32px; opacity: 0.3; pointer-events: none; }
.pt2-thumb::after {
  content: 'Open';
  position: absolute; inset: 0;
  background: rgba(26,18,12,0.46);
  color: #fff; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 140ms;
}
.pt2-tile:hover .pt2-thumb::after { opacity: 1; }

/* Badges */
.pt2-badges {
  position: absolute; top: 8px; left: 8px;
  display: flex; gap: 4px;
  pointer-events: none; z-index: 2;
}
.pt2-badge {
  background: rgba(0,0,0,0.58);
  color: #fff; font-size: 11px;
  padding: 2px 6px; border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* Meta */
.pt2-meta { padding: 10px 12px 6px; border-top: 1px solid var(--rule); }
.pt2-name {
  font-size: 13px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  outline: none;
}
.pt2-name[contenteditable]:focus {
  outline: 2px solid var(--red); border-radius: 4px;
  white-space: normal; overflow: visible;
}
.pt2-date { font-size: 11px; color: var(--ink-4); margin-top: 1px; }

/* Action bar */
.pt2-actions {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--rule);
  background: var(--bg, #f4f1ec);
}
.pt2-btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  flex: 1 1 auto;
  padding: 7px 10px;
  background: var(--red); color: #fff;
  border: 0; border-radius: 8px;
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: background 120ms;
}
.pt2-btn-primary:hover { background: var(--deep-red, #B91C00); }

.pt2-icon-btns { display: flex; gap: 3px; margin-left: auto; flex-shrink: 0; }
.pt2-icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1.5px solid var(--rule);
  border-radius: 8px; cursor: pointer; padding: 0;
  color: var(--ink-3, #5a554d);
  transition: background 120ms, border-color 120ms, color 120ms;
}
.pt2-icon:hover { background: var(--beige); border-color: var(--ink-3); color: var(--ink); }
.pt2-icon.is-active { background: rgba(231,37,1,0.08); border-color: var(--red); color: var(--red); }
.pt2-icon-danger:hover { background: rgba(231,37,1,0.08); border-color: var(--red); color: var(--red); }
.pt2-icon:disabled { opacity: 0.4; cursor: default; pointer-events: none; }

.pt2-error {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(231,37,1,0.92); color: #fff;
  font-size: 11.5px; font-weight: 600; text-align: center;
  padding: 6px; animation: clIn 200ms ease;
}

/* ---------- PHOTO LIB v2: actions ON image, side-by-side ---------- */
.photo-tile { position: relative; }
.photo-tile .pt-img {
  position: relative;
  aspect-ratio: 1;
  background: var(--beige) center/cover;
}
.photo-tile .pt-actions {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  bottom: auto;
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  opacity: 0;
  transition: opacity 150ms;
  z-index: 2;
}
.photo-tile:hover .pt-actions,
.photo-tile:focus-within .pt-actions { opacity: 1; }
.photo-tile .pt-act {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: #FFFFFF;
  color: #1F2937;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: all 120ms;
}
.photo-tile .pt-act:hover { background: #E5E7EB; color: #1F2937; }
.photo-tile .pt-act .pt-act-ico { font-size: 13px; line-height: 1; }
.photo-tile .pt-act .pt-act-label { font-size: 13px; font-weight: 500; }
.photo-tile .pt-act.pt-share.is-on {
  background: #FEF3C7;
  color: #92400E;
}
.photo-tile .pt-act.pt-del:hover {
  background: #FEE2E2;
  color: #DC2626;
}
.photo-tile .pt-act.pt-act-iconly {
  padding: 0;
  width: 28px;
  height: 28px;
  justify-content: center;
  border-radius: 999px;
}
.photo-tile .pt-act.pt-act-iconly .pt-act-ico { font-size: 13px; }
.photo-tile .pt-badges {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  gap: 4px;
  pointer-events: none;
  z-index: 2;
}

/* ---------- Upload-zone (first tile in grid) ---------- */
.photolib-body {
  display: block;
}
.photo-uploadzone {
  aspect-ratio: 1 / 1;
  border: 2px dashed #D1D5DB;
  border-radius: 12px;
  background: #FAFAFA;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  text-align: center;
  transition: all 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: none;
}
.photo-uploadzone:hover { background: #F3F4F6; border-color: #9CA3AF; }
.photo-uploadzone.is-dragover {
  background: #FEE2E2;
  border-style: solid;
  border-color: var(--red);
}
.photo-uploadzone .puz-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  margin-bottom: 16px;
  transition: color 140ms;
}
.photo-uploadzone.is-dragover .puz-icon { color: var(--red); }
.photo-uploadzone .puz-icon svg {
  width: 32px;
  height: 32px;
}
.photo-uploadzone .puz-text {
  font-size: 15px;
  font-weight: 400;
  color: #6B7280;
  line-height: 1.3;
}
.photo-uploadzone .puz-or {
  font-size: 15px;
  color: #6B7280;
  font-weight: 400;
  margin-bottom: 12px;
}
.photo-uploadzone .puz-browse {
  background: #E5E7EB;
  border: none;
  color: #4B5563;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: 999px;
  transition: background 140ms;
}
.photo-uploadzone .puz-browse:hover { background: #D1D5DB; }
.photo-uploadzone .puz-foot {
  position: absolute;
  left: 12px;
  bottom: 12px;
  font-size: 12px;
  color: #9CA3AF;
  text-align: left;
  font-weight: 400;
}
.photo-uploadzone .puz-sub,
.photo-uploadzone .puz-secure,
.photo-uploadzone .puz-types { display: none; }
.photo-tile.upload-tile {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--rule);
  background: linear-gradient(135deg, #fdfdfb 0%, #f7f5f0 100%);
  text-align: center;
  padding: 20px 16px;
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  transition: all 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.photo-tile.upload-tile::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1.5px dashed rgba(0,0,0,0.15);
  border-radius: 4px;
  pointer-events: none;
  transition: border-color 160ms;
}
.photo-tile.upload-tile:hover {
  border-color: var(--red);
  background: linear-gradient(135deg, #fff8f5 0%, #ffefe8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 50, 30, 0.12);
}
.photo-tile.upload-tile:hover::before {
  border-color: var(--red);
}
.photo-tile.upload-tile.is-dragover {
  border-color: var(--red);
  background: linear-gradient(135deg, #ffe8e0 0%, #ffd6c8 100%);
  transform: scale(1.02);
}
.photo-tile.upload-tile.is-dragover::before {
  border-color: var(--red);
  border-style: solid;
}
.photo-tile.upload-tile .ut-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.photo-tile.upload-tile .ut-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.06);
  transition: all 160ms;
}
.photo-tile.upload-tile:hover .ut-icon {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 4px 14px rgba(220, 50, 30, 0.25);
}
.photo-tile.upload-tile .ut-icon svg {
  width: 22px;
  height: 22px;
  color: var(--black);
  transition: color 160ms;
}
.photo-tile.upload-tile:hover .ut-icon svg { color: white; }
.photo-tile.upload-tile .ut-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--black);
  letter-spacing: 0.01em;
}
.photo-tile.upload-tile .ut-sub {
  font-size: 10.5px;
  color: var(--ink-4);
  line-height: 1.4;
  max-width: 140px;
}


/* ---------- CANVAS TEMPLATE PICKER ---------- */
.canvas-stage { position: relative; }
.canvas-wrap { position: relative; }
.canvas-picker[hidden] { display: none !important; }
.canvas-picker {
  position: absolute;
  inset: 0;
  background: #fff;
  border-radius: inherit;
  z-index: 5;
  overflow: auto;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
}
.canvas-stage.has-picker .canvas-wrap canvas { visibility: hidden; }
.cp-close {
  position: absolute; top: 14px; right: 16px; z-index: 6;
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--rule, #e2dcd2); background: #fff;
  font-size: 22px; line-height: 1; color: #5a554d; cursor: pointer;
}
.cp-close:hover { border-color: var(--red); color: var(--red); }

.cp-head { text-align: center; margin-bottom: 18px; }
.cp-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--red, #DA291C);
  margin-bottom: 8px;
}
.cp-title {
  font-family: 'Poppins', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--black, #111);
  margin: 0 0 6px;
  line-height: 1.1;
}
.cp-sub {
  margin: 0 auto;
  max-width: 420px;
  font-size: 13px;
  color: var(--ink-4, #6B7280);
  line-height: 1.45;
}
.cp-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 18px auto 0;
}
.cp-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 8px;
  background: #fff;
  border: 1px solid var(--rule, #E5E0D5);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2, #3a352e);
}
.cp-step-num {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.cp-topics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
}
.cp-topics .topic-chip {
  border: 1.5px solid var(--rule, #E5E0D5);
  background: #fff;
  color: var(--ink, #111);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms;
}
.cp-topics .topic-chip:hover { border-color: var(--red, #DA291C); }
.cp-topics .topic-chip.active {
  background: var(--red, #DA291C);
  color: #fff;
  border-color: var(--red, #DA291C);
}
.cp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  align-content: start;
}
.cp-grid .card-tile {
  background: #fff;
  cursor: pointer;
}
@media (max-width: 768px) {
  .canvas-picker { padding: 20px 16px; }
  .cp-title { font-size: 22px; }
  .cp-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
}


/* ---------- SIDEBAR TABS ---------- */
.sidebar-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: #fafafa;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}
.sb-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #666;
  font: inherit;
  transition: color .12s, border-color .12s, background .12s;
}
.sb-tab:hover { color: #222; background: rgba(0,0,0,.02); }
.sb-tab.active {
  color: var(--brand-red, #E5322D);
  border-bottom-color: var(--brand-red, #E5322D);
  background: var(--white);
}
.sb-tab-icon {
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}
.sb-tab-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.sb-pane[hidden] { display: none !important; }

@media (max-width: 900px) {
  .sidebar-tabs { position: sticky; top: 0; }
  .sb-tab-label { font-size: 10px; }
}


/* checkbox row used in logo panel */
.checkbox-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-2, #555);
  margin-top: 8px; cursor: pointer; user-select: none;
}
.checkbox-row input[type=checkbox] { margin: 0; cursor: pointer; }

/* fields.js — segment buttons & block separators */
.field-block {
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--rule, #eee);
}
.field-block:last-child { border-bottom: none; }

/* field-card: collapsible variant for the Tekst tab */
.field-card {
  border: 1px solid var(--rule);
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 0 !important;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-card.is-open { border-color: #d0d0d0; }
.field-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  user-select: none;
}
.field-card-header:hover { background: #FAFAFA; }
.field-card-title {
  font-size: 12px;
  font-weight: 600;
  color: #222;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.field-card-preview {
  flex: 1;
  font-size: 12px;
  color: #888;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.field-card-chev {
  font-size: 12px;
  color: #888;
  transition: transform 0.18s;
  flex-shrink: 0;
}
.field-card.is-open .field-card-chev { transform: rotate(180deg); }
.field-card-body {
  display: none;
  padding: 4px 12px 12px;
  border-top: 1px solid var(--rule);
}
.field-card.is-open .field-card-body { display: block; }
.field-card-body .field-block { padding: 8px 0 10px; border-bottom: none; }

.field-inline {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 4px;
}

.field-center-x {
  align-self: flex-start;
  margin-top: 2px;
  padding: 5px 10px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  color: #5a554d; background: var(--bg, #f4f1ec);
  border: 1px solid var(--rule, #e2dcd2); border-radius: 6px;
  cursor: pointer;
}
.field-center-x:hover { border-color: var(--red); color: var(--red); background: #fff; }

.field-eye {
  cursor: pointer; font-size: 15px; line-height: 1;
  padding: 2px 5px; margin-left: 2px; border-radius: 5px;
  opacity: 0.85; user-select: none;
}
.field-eye:hover { background: rgba(0,0,0,0.07); opacity: 1; }
.field-eye.is-hidden { opacity: 0.45; }

.field-style-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 2px;
}
.seg-buttons {
  display: inline-flex;
  border: 1px solid var(--rule, #ddd);
  border-radius: 6px;
  overflow: hidden;
  background: white;
}
.seg-btn {
  appearance: none;
  border: none;
  background: white;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  color: var(--ink-3, #555);
  cursor: pointer;
  border-right: 1px solid var(--rule, #ddd);
  transition: background .12s, color .12s;
  min-width: 32px;
}
.seg-buttons .seg-btn:last-child { border-right: none; }
.seg-btn:hover { background: #f7f7f7; }
.seg-btn.active {
  background: var(--brand-red, #E5322D);
  color: white;
}
.seg-caps {
  border: 1px solid var(--rule, #ddd);
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: .04em;
}

/* Click-to-focus flash op tekst-velden in de zijbalk */
@keyframes fieldFlash {
  0%   { background: rgba(229,50,45,0.18); }
  100% { background: transparent; }
}
.field-flash {
  animation: fieldFlash 1.1s ease-out;
  border-radius: 6px;
}

/* ----------------------------------------------------------------------
   Photo Layers (transparent PNG overlays)
   ---------------------------------------------------------------------- */
.photo-layers-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--rule);
}
.layers-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.layers-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}
.layers-hint {
  font-size: 10px;
  color: var(--muted);
}
.layers-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.layers-list:empty { margin-bottom: 0; }
.layers-empty-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 0 0;
  font-style: italic;
}
.layer-card {
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.layer-card.is-active {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(228,30,38,0.15);
}
.layer-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
}
.layer-card-header:hover { background: #FAFAFA; }
.layer-thumb {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background-color: #F4F4F4;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-image:
    linear-gradient(45deg, #E8E8E8 25%, transparent 25%),
    linear-gradient(-45deg, #E8E8E8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #E8E8E8 75%),
    linear-gradient(-45deg, transparent 75%, #E8E8E8 75%);
  background-size: 8px 8px, 8px 8px, 8px 8px, 8px 8px, contain;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px, center;
  flex-shrink: 0;
}
.layer-thumb-overlay {
  width: 100%;
  height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.layer-name {
  flex: 1;
  font-size: 12px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.layer-toggle-icon {
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.18s;
}
.layer-card.is-open .layer-toggle-icon { transform: rotate(180deg); }
.layer-card-body {
  display: none;
  padding: 4px 10px 12px 10px;
  border-top: 1px solid var(--rule);
}
.layer-card.is-open .layer-card-body { display: block; }
.layer-card-body .field-compact { margin-bottom: 8px; }
.layer-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}
.layer-card-actions .btn-mini {
  font-size: 11px;
  padding: 5px 6px;
}
.layer-card-actions .layer-delete {
  grid-column: 1 / -1;
}
.layer-drag-tip {
  font-size: 10px;
  color: var(--muted);
  margin: 4px 0 8px 0;
  font-style: italic;
}
.layers-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.layers-actions .btn-mini { flex: 1; }
