:root {
  --accent: #2f7d5b; --ink: #1d221f; --muted: #5d6660; --line: #dfe3de; --bg: #f3f5f2; --card: #fff; --soft: #fafbf9; --danger: #b3261e;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); line-height: 1.5; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #e7ece8; --muted: #9ba59e; --line: #2f3632; --bg: #151917; --card: #1c211e; --soft: #202622; --danger: #f0aaa2; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); }
h1 { font-size: 1.35rem; margin: 0; } h2 { font-size: 1.05rem; margin: 0 0 10px; } h3 { font-size: .95rem; margin: 0 0 6px; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: .86rem; }
.layout { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
aside { background: var(--card); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
aside .brand { font-weight: 700; padding: 4px 10px 14px; }
aside .brand small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
aside a { text-decoration: none; color: var(--ink); padding: 8px 10px; border-radius: 8px; font-weight: 500; }
aside a:hover { background: var(--bg); }
aside a.active { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
aside .bottom { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
main { min-width: 0; padding: 20px 24px 60px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
button, .btn { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 7px 12px; min-height: 36px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; }
button:hover, .btn:hover { border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
button:disabled { opacity: .5; cursor: default; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.danger { color: var(--danger); }
.sm { min-height: 30px; padding: 3px 9px; font-size: .86rem; }
label { display: block; font-weight: 600; font-size: .86rem; margin: 0 0 4px; }
input, select, textarea { font: inherit; width: 100%; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); min-height: 36px; }
textarea { min-height: 90px; resize: vertical; }
textarea.md { font-family: ui-monospace, Consolas, monospace; font-size: .88rem; }
.field { margin-bottom: 10px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: auto; min-height: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.hint { color: var(--muted); font-size: .8rem; margin-top: 3px; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; color: var(--muted); }
.pill { font-size: .75rem; padding: 2px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: #e3f1ea; color: #1f6847; } .pill.warn { background: #fbf0d9; color: #7a5410; } .pill.off { background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
/* Pagina-editor: blokken links, voorbeeld rechts */
.editor { display: grid; grid-template-columns: minmax(340px, 460px) 1fr; gap: 16px; align-items: start; }
.preview { position: sticky; top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.preview .bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.preview iframe { width: 100%; height: calc(100vh - 110px); border: 0; display: block; background: #fff; }
.preview.mobile iframe { width: 390px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.block { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.block > summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.block > summary::-webkit-details-marker { display: none; }
.block > summary .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block > summary .t small { font-weight: 400; color: var(--muted); }
.block .body { padding: 4px 12px 12px; border-top: 1px solid var(--line); }
.block[open] { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.imgpick { display: flex; gap: 8px; align-items: center; }
.imgpick img { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.items .item { border: 1px dashed var(--line); border-radius: 8px; padding: 8px; margin-bottom: 8px; }
.mediagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 50vh; overflow: auto; }
.mediagrid button { padding: 0; height: 90px; overflow: hidden; display: block; }
.mediagrid img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs span { position: relative; } .thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.thumbs button { position: absolute; top: 2px; right: 2px; min-height: 0; padding: 0 5px; font-size: .75rem; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 0; width: min(640px, calc(100vw - 24px)); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
#modal-body { padding: 18px; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; } #toast.error { background: #b3261e; color: #fff; }
/* Voorbeeld van het icoon in een browsertabblad */
.tab-preview { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--card); font-size: .82rem; max-width: 220px; }
.tab-preview img { width: 16px; height: 16px; object-fit: contain; border: 0; border-radius: 2px; }
.tab-preview span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1000px) { .editor { grid-template-columns: minmax(0, 1fr); } .editor > * { min-width: 0; } .preview { position: static; } .preview iframe { height: 70vh; } }
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  /* Menu wordt een smalle balk bovenaan; de links scrollen zijwaarts */
  aside { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: nowrap; align-items: center; overflow-x: auto; gap: 4px; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  aside::-webkit-scrollbar { display: none; }
  aside .brand { padding: 4px 8px 4px 4px; white-space: nowrap; flex: none; }
  aside .brand small { display: none; }
  aside a { white-space: nowrap; flex: none; padding: 8px 10px; }
  aside .bottom { margin: 0; border: 0; padding: 0 0 0 4px; flex-direction: row; flex: none; border-left: 1px solid var(--line); }
  main { padding: 14px 14px 48px; }
  .grid2 { grid-template-columns: 1fr; }
  .grid2 > * { min-width: 0; }
  .hide-sm { display: none; }
  .head h1 { flex: 1 1 auto; }
  td, th { padding: 8px 6px; }
  .pill { white-space: normal; }
  button, .btn { min-height: 42px; }
  .sm { min-height: 36px; }
  input, select, textarea { font-size: 16px; min-height: 42px; }
  .check input { min-height: 0; }
  .preview.mobile iframe { width: 100%; }
  .imgpick { flex-wrap: wrap; }
}
/* ---------- Folder ---------- */
.pill.bad { background: #f6e3e1; color: #8a2c24; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button.on { background: color-mix(in srgb, var(--accent) 14%, var(--card)); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.editor { grid-template-columns: minmax(300px, 440px) 1fr; }
.preview-box { position: sticky; top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.preview-box .bar { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.canvas-wrap { padding: 16px; display: flex; justify-content: center; background: repeating-conic-gradient(var(--soft) 0 25%, var(--bg) 0 50%) 0 0 / 16px 16px; }
.canvas-wrap canvas { box-shadow: 0 2px 12px rgba(0, 0, 0, .18); background: #fff; max-width: 100%; height: auto; }
#ad-warn { padding: 0 12px; }
.warnline { background: #fbf0d9; color: #7a5410; border-radius: 8px; padding: 6px 10px; font-size: .86rem; margin: 10px 0; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sw { width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 50%; border: 2px solid var(--line); }
.sw.on { outline: 3px solid var(--accent); outline-offset: 1px; }
.swatches input[type=color] { width: 40px; height: 30px; min-height: 0; padding: 2px; }
.feedback { background: #f6e3e1; color: #8a2c24; border-radius: 8px; padding: 10px 12px; margin: 10px 0; white-space: pre-wrap; }
.adcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.adcard { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.adcard .thumb { display: flex; justify-content: center; background: var(--soft); border-radius: 8px; padding: 10px; }
.adcard canvas { box-shadow: 0 1px 6px rgba(0, 0, 0, .15); background: #fff; }
/* Pagina's van een editie */
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.pagecard { text-align: center; }
.pagecard .pg { position: relative; display: inline-block; box-shadow: 0 2px 10px rgba(0, 0, 0, .16); background: #fff; }
.pagecard canvas { display: block; }
.slot { position: absolute; border: 0; background: transparent; padding: 0; min-height: 0; border-radius: 2px; cursor: pointer; }
.slot:hover, .slot:focus-visible { outline: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.slot.empty { border: 1px dashed #c4c9c5; color: #8a918c; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.slot.empty:hover { color: var(--accent); }
.slot.sel { outline: 3px solid #e07b00; }
.pagecard .num { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.landing { max-width: 920px; margin: 0 auto; padding: 24px 16px 60px; }
.landing .hero { background: var(--accent); color: #fff; border-radius: 14px; padding: 28px 24px; margin-bottom: 16px; }
.landing .hero h1 { font-size: 1.7rem; margin-bottom: 8px; }
.landing .cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; align-items: start; }
.sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end; }
.sizes div { text-align: center; font-size: .82rem; }
.sizes i { display: block; margin: 0 auto 6px; background: color-mix(in srgb, var(--accent) 22%, var(--card)); border: 1px solid var(--accent); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar b { font-size: 1.05rem; }
.wrapmain { max-width: 1180px; margin: 0 auto; padding: 18px 16px 60px; }
@media (max-width: 1000px) { .editor { grid-template-columns: minmax(0, 1fr); } .preview-box { position: static; } }
@media (max-width: 720px) { .topbar { flex-wrap: wrap; padding: 8px 12px; } .topbar .row { gap: 4px; } }
@media (max-width: 720px) { .landing .cols { grid-template-columns: 1fr; } .landing .loginside { order: -1; } .pages { grid-template-columns: 1fr 1fr; } .sizes { grid-template-columns: repeat(2, 1fr); } }
