/* Note.Web: strak en rustig. Wit papier, een koele grijze zijbalk, petrol als enige kleur.
   Het enige dat opvalt zijn de links tussen pagina's: daar draait het om. */
@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
:root {
  color-scheme: light;
  --paper: #ffffff; --side: #f3f5f4; --ink: #172226; --muted: #5f6d71; --faint: #8b989b; --line: #e2e7e5;
  --hover: #e8edeb; --sel: #dbe7e4; --accent: #12343b; --accent-2: #1f4750; --on-accent: #ffffff; --link: #17606f; --link-line: #9cc6c9;
  --new: #9a5b00; --new-line: #e2bd7f; --danger: #a3341a; --on-danger: #ffffff; --code: #eef2f1;
  --glass: rgba(255, 255, 255, 0.97); --placeholder: #c3cbc9; --tint: rgba(0, 0, 0, 0.05); --focus-ring: rgba(23, 96, 111, 0.15);
  --warn-bg: #fdf3e2; --warn-ink: #5d3a00; --toast-bg: #172226; --toast-ink: #ffffff; --toast-link: #9fe0d4;
  --backdrop: rgba(23, 34, 38, 0.35); --scrim: rgba(23, 34, 38, 0.3);
  --side-w: 272px; --cond: "Barlow Semi Condensed", "Barlow", "Arial Narrow", sans-serif;
  --shadow: 0 1px 2px rgba(23, 34, 38, 0.1), 0 10px 30px rgba(23, 34, 38, 0.14);
  --t: env(safe-area-inset-top, 0px); --b: env(safe-area-inset-bottom, 0px);
}
/* Donker: volgt het apparaat, tenzij je zelf Licht of Donker kiest (data-theme op <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
  --paper: #161c1e; --side: #1d2427; --ink: #e3eae8; --muted: #9eadb0; --faint: #6f7e81; --line: #2d3639;
  --hover: #262f32; --sel: #233a3d; --accent: #5ea9b2; --accent-2: #74bac2; --on-accent: #0e1a1c; --link: #82c6ce; --link-line: #3b676c;
  --new: #e3aa5c; --new-line: #7c5c2c; --danger: #ef8a6f; --on-danger: #1d0f0a; --code: #252e31;
  --glass: rgba(22, 28, 30, 0.96); --placeholder: #4f5c5f; --tint: rgba(255, 255, 255, 0.07); --focus-ring: rgba(130, 198, 206, 0.22);
  --warn-bg: #3a2f1c; --warn-ink: #f1d6a6; --toast-bg: #e3eae8; --toast-ink: #142022; --toast-link: #17606f;
  --backdrop: rgba(0, 0, 0, 0.55); --scrim: rgba(0, 0, 0, 0.5);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #161c1e; --side: #1d2427; --ink: #e3eae8; --muted: #9eadb0; --faint: #6f7e81; --line: #2d3639;
  --hover: #262f32; --sel: #233a3d; --accent: #5ea9b2; --accent-2: #74bac2; --on-accent: #0e1a1c; --link: #82c6ce; --link-line: #3b676c;
  --new: #e3aa5c; --new-line: #7c5c2c; --danger: #ef8a6f; --on-danger: #1d0f0a; --code: #252e31;
  --glass: rgba(22, 28, 30, 0.96); --placeholder: #4f5c5f; --tint: rgba(255, 255, 255, 0.07); --focus-ring: rgba(130, 198, 206, 0.22);
  --warn-bg: #3a2f1c; --warn-ink: #f1d6a6; --toast-bg: #e3eae8; --toast-ink: #142022; --toast-link: #17606f;
  --backdrop: rgba(0, 0, 0, 0.55); --scrim: rgba(0, 0, 0, 0.5);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.45);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 16px/1.5 "Barlow", "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.ico { display: block; flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 7px; border: 1px solid var(--line); background: var(--paper); font-weight: 600; font-size: 15px; white-space: nowrap; }
.btn:hover { background: var(--side); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.btn.small { height: 30px; padding: 0 10px; font-size: 14px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }
.field { display: block; width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.field:focus { outline: 0; border-color: var(--link); box-shadow: 0 0 0 3px var(--focus-ring); }
label.lbl { display: block; font-size: 14px; font-weight: 600; margin: 0 0 5px; }
.err { color: var(--danger); font-size: 14px; min-height: 0; margin: 10px 0 0; }
.err:empty { display: none; }

/* Inloggen: één veld, de code als label aan een sleutelbos */
.gate { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: var(--side); }
.gate-card { width: 100%; max-width: 380px; }
.mark { margin: 0 0 6px; font-size: 30px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.mark img { width: 34px; height: 34px; }
.gate p { margin: 0 0 22px; color: var(--muted); }
.code-in { display: block; width: 100%; height: 64px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); font: 600 26px/1 var(--cond); letter-spacing: 0.14em; text-transform: uppercase; text-align: center; }
.code-in::placeholder { color: var(--placeholder); letter-spacing: 0.14em; }
.code-in:focus { outline: 0; border-color: var(--link); box-shadow: 0 0 0 4px var(--focus-ring); }
.gate .btn.primary { width: 100%; height: 46px; margin-top: 12px; font-size: 16px; }
.gate .back { display: block; margin-top: 24px; font-size: 14px; color: var(--muted); }

/* Beheer */
.admin { max-width: 860px; margin: 0 auto; padding: calc(28px + var(--t)) 20px 60px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.admin-head .mark { margin: 0; font-size: 24px; }
.admin-head .mark small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.admin h2 { font-size: 18px; margin: 0 0 12px; }
.projects { list-style: none; margin: 0 0 36px; padding: 0; border-top: 1px solid var(--line); }
.proj-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.proj-row .name { font-weight: 600; font-size: 17px; }
.proj-row .meta { color: var(--muted); font-size: 14px; }
.proj-row .code { font: 600 20px/1 var(--cond); letter-spacing: 0.12em; padding: 7px 10px; border: 1px dashed var(--faint); border-radius: 6px; user-select: all; }
.proj-row .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.proj-edit { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; padding: 14px 0; border-bottom: 1px solid var(--line); }
.newproj { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; padding: 18px; background: var(--side); border-radius: 10px; margin-bottom: 30px; }
.empty { color: var(--muted); padding: 16px 0; }
details.admin-code summary { cursor: pointer; color: var(--muted); font-weight: 500; }
details.admin-code form { display: flex; gap: 8px; margin-top: 12px; max-width: 420px; }

/* Werkruimte */
#app { height: 100%; }
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; height: 100%; }
.scrim { display: none; }
.side { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding-top: var(--t); }
.side-head { display: flex; align-items: center; gap: 9px; padding: 14px 14px 8px; }
.side-head img { width: 26px; height: 26px; }
.proj-name { flex: 1; min-width: 0; font-weight: 700; font-size: 16px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 6px; border-radius: 6px; }
.proj-name:hover { background: var(--hover); }
.search { padding: 4px 12px 8px; }
.search input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); font-size: 15px; }
.search input:focus { outline: 0; border-color: var(--link); }
.tree, .results { flex: 1; overflow: auto; padding: 4px 8px 12px; min-height: 0; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { padding-left: 14px; }
.row { display: flex; align-items: center; gap: 2px; border-radius: 6px; min-height: 32px; }
.row:hover { background: var(--hover); }
.row.cur { background: var(--sel); }
.row .tog { width: 22px; height: 26px; display: grid; place-items: center; background: none; border: 0; border-radius: 4px; color: var(--faint); flex: none; }
.row .tog:hover { color: var(--ink); background: var(--tint); }
.row .tog svg { transition: transform 0.12s ease; }
.row.open > .tog svg { transform: rotate(90deg); }
.row .tog.leaf { visibility: hidden; }
.row a { flex: 1; min-width: 0; padding: 5px 4px; text-decoration: none; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.cur a { font-weight: 600; }
.row .plus { width: 26px; height: 26px; display: grid; place-items: center; background: none; border: 0; border-radius: 4px; color: var(--faint); flex: none; opacity: 0; }
.row:hover .plus, .row .plus:focus-visible { opacity: 1; }
.row .plus:hover { color: var(--ink); background: var(--tint); }
.side .add-root { margin: 0 12px 10px; justify-content: flex-start; background: none; border-color: transparent; color: var(--muted); font-weight: 500; padding: 0 8px; }
.side .add-root:hover { background: var(--hover); color: var(--ink); }
.side-foot { display: flex; gap: 14px; flex-wrap: wrap; padding: 10px 16px calc(14px + var(--b)); border-top: 1px solid var(--line); font-size: 14px; }
.side-foot a, .side-foot button { color: var(--muted); background: none; border: 0; padding: 0; text-decoration: none; font-weight: 500; }
.side-foot a:hover, .side-foot button:hover { color: var(--ink); }
.theme-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--muted); font-weight: 500; font-size: inherit; }
.theme-btn:hover { color: var(--ink); }
.side-foot .theme-btn { margin-left: auto; }
.gate .theme-btn { margin-top: 14px; font-size: 14px; }
.admin-head .acts { display: flex; align-items: center; gap: 14px; }
.results ul { list-style: none; margin: 0; padding: 0; }
.results a { display: block; padding: 7px 8px; border-radius: 6px; text-decoration: none; }
.results a:hover, .results a.on { background: var(--hover); }
.results a b { display: block; font-weight: 600; font-size: 15px; }
.results a small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results .none { color: var(--muted); padding: 8px; font-size: 14px; }

.main { overflow: auto; min-width: 0; position: relative; }
.topbar { display: none; }
/* Tijdens bewerken: een smalle werkbalk bovenin (op de telefoon in de bovenbalk) */
.shell.editing .topbar { display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 10; padding: 6px 12px; background: var(--glass); border-bottom: 1px solid var(--line); }
.tools { display: none; align-items: center; gap: 2px; flex: 1; min-width: 0; max-width: 664px; margin: 0 auto; }
.shell.editing .tools { display: flex; }
.shell.editing .topbar .menu-btn, .shell.editing .topbar .tb-title { display: none; }
.tool { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--ink); font-size: 18px; }
.tool b { font-weight: 700; font-size: 19px; line-height: 1; }
.tool:hover { background: var(--side); }
.tools-gap { flex: 1; }
.tool.done { background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 15px; padding: 0 16px; }
.tool.done:hover { background: var(--accent-2); }

/* Afbeeldingen */
.doc figure { margin: 6px 0 16px; }
.doc img { display: block; max-width: 100%; height: auto; max-height: 70vh; border-radius: 8px; background: var(--side); cursor: zoom-in; }
.doc figcaption { margin-top: 6px; font-size: 14px; color: var(--muted); }
.doc .img-wait { display: inline-block; padding: 18px 20px; border: 1px dashed var(--faint); border-radius: 8px; color: var(--muted); font-size: 14px; }
.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(12, 18, 20, 0.92); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lb-close { position: absolute; top: calc(10px + var(--t)); right: 10px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; }
.page { max-width: 760px; margin: 0 auto; padding: 44px 48px 140px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); min-height: 21px; margin-bottom: 14px; }
.crumbs a { text-decoration: none; padding: 1px 4px; border-radius: 4px; }
.crumbs a:hover { background: var(--side); color: var(--ink); }
.crumbs .sep { color: var(--faint); }
.title-row { display: flex; align-items: flex-start; gap: 10px; }
.title { flex: 1; display: block; width: 100%; margin: 0; padding: 0; border: 0; resize: none; overflow: hidden; background: none; font-size: 36px; line-height: 1.15; font-weight: 700; letter-spacing: -0.015em; }
.title:focus { outline: 0; }
.title::placeholder { color: var(--placeholder); }
.page h1.title { margin: 0; }
.more { flex: none; width: 36px; height: 36px; margin-top: 2px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--muted); }
.more:hover { background: var(--side); color: var(--ink); }
.saved { display: block; min-height: 20px; margin: 6px 0 18px; font-size: 13px; color: var(--faint); }
.saved.bad { color: var(--danger); }

.menu { position: fixed; z-index: 40; min-width: 210px; padding: 5px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 6px; background: none; font-size: 15px; }
.menu button:hover, .menu button.on { background: var(--side); }
.menu button.danger { color: var(--danger); }
.menu button small { display: block; color: var(--muted); font-size: 12px; }

/* De tekst */
.doc { min-height: 120px; font-size: 17px; line-height: 1.65; cursor: text; border-radius: 6px; overflow-wrap: anywhere; }
.doc:focus { outline: 0; }
.doc > :first-child { margin-top: 0; }
.doc p { margin: 0 0 12px; }
.doc h2 { font-size: 24px; line-height: 1.25; margin: 26px 0 8px; font-weight: 700; }
.doc h3 { font-size: 20px; line-height: 1.3; margin: 22px 0 6px; font-weight: 600; }
.doc h4 { font-size: 17px; margin: 18px 0 4px; font-weight: 600; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.doc blockquote { margin: 0 0 12px; padding: 2px 0 2px 14px; border-left: 3px solid var(--line); color: var(--muted); }
.doc code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; background: var(--code); padding: 1px 5px; border-radius: 4px; }
.doc ul.list { list-style: none; margin: 0 0 12px; padding: 0; }
.doc ul.list li { position: relative; padding-left: 24px; margin: 2px 0; }
.doc ul.list li.d1 { margin-left: 22px; } .doc ul.list li.d2 { margin-left: 44px; } .doc ul.list li.d3 { margin-left: 66px; } .doc ul.list li.d4 { margin-left: 88px; }
.doc ul.list li .mk { position: absolute; left: 0; top: 0; width: 20px; text-align: center; color: var(--muted); }
.doc ul.list li.num .mk { text-align: right; width: 20px; left: -2px; font-variant-numeric: tabular-nums; }
.doc ul.list li.task { padding-left: 28px; }
.doc ul.list li.task input { position: absolute; left: 1px; top: 5px; width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.doc ul.list li.done > span:last-child { color: var(--faint); text-decoration: line-through; }
.doc .placeholder { color: var(--faint); }
.doc a { color: var(--link); text-decoration-color: var(--link-line); text-underline-offset: 3px; }
/* Links naar andere pagina's: dikke, rustige onderstreping, en gestippeld als de pagina nog niet bestaat */
.doc a.wl { color: var(--link); font-weight: 500; text-decoration: none; border-bottom: 2px solid var(--link-line); padding-bottom: 0; }
.doc a.wl:hover { border-bottom-color: var(--link); background: var(--tint); }
.doc a.wl.new { color: var(--new); border-bottom: 2px dashed var(--new-line); }
.doc a.wl.new:hover { border-bottom-color: var(--new); background: var(--tint); }
.edit { display: block; position: relative; width: 100%; min-height: 160px; padding: 0; margin: 0; border: 0; background: none; font-size: 17px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; word-break: normal; cursor: text; caret-color: var(--accent); }
.edit:focus { outline: 0; }
.edit.empty::before { content: attr(data-placeholder); position: absolute; left: 0; top: 0; color: var(--placeholder); pointer-events: none; }
.edit .chip { color: var(--link); font-weight: 500; border-bottom: 2px solid var(--link-line); white-space: pre-wrap; cursor: default; }
.edit .chip.new { color: var(--new); border-bottom-style: dashed; border-bottom-color: var(--new-line); }
.edit .chip-img { display: inline-block; vertical-align: top; margin: 4px 0; max-width: 100%; }
.edit .chip-img img { display: block; max-width: 100%; max-height: 260px; height: auto; border-radius: 8px; background: var(--side); }
.edit .chip-img .img-wait { display: inline-block; padding: 18px 20px; border: 1px dashed var(--faint); border-radius: 8px; color: var(--muted); font-size: 14px; }
.edit .atom { cursor: default; }
.edit .pfx { color: var(--muted); }
.edit .pfx.li { display: inline-block; width: 1.25em; text-align: center; }
.edit .pfx.ol { display: inline-block; min-width: 1.25em; margin-right: 0.3em; font-variant-numeric: tabular-nums; }
.edit .pfx.task { display: inline-block; width: 1.65em; height: 1em; vertical-align: -2px; cursor: pointer; }
.edit .pfx.task .box { display: block; width: 17px; height: 17px; box-sizing: border-box; border: 1.5px solid var(--muted); border-radius: 4px; }
.edit .pfx.task .box.on { background: var(--accent); border-color: var(--accent); }
.edit .pfx.task .box.on::after { content: ""; display: block; width: 5px; height: 9px; margin: 1px 0 0 4.5px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.edit .pfx.q { display: inline-block; width: 3px; height: 1.25em; margin-right: 11px; vertical-align: -4px; background: var(--line); border-radius: 2px; }
.edit .ed-q { color: var(--muted); }
.edit .ed-done { color: var(--faint); text-decoration: line-through; }
.edit .pfx.h2, .edit .pfx.h3, .edit .pfx.h4 { color: var(--faint); font-size: 12px; font-weight: 600; margin-right: 6px; vertical-align: 0.25em; letter-spacing: 0.04em; }
.edit .mk { color: var(--faint); font-weight: 400; font-style: normal; font-size: 0.8em; }
.edit .ed-b { font-weight: 700; }
.edit .ed-i { font-style: italic; }
.edit .ed-s { text-decoration: line-through; }
.edit .ed-c { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; background: var(--code); border-radius: 4px; padding: 1px 3px; }
.edit .ed-h2 { font-size: 24px; font-weight: 700; line-height: 1.5; }
.edit .ed-h3 { font-size: 20px; font-weight: 600; line-height: 1.5; }
.edit .ed-h4 { font-weight: 600; }
.edit-hint { margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--faint); }
.edit-hint code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; background: var(--code); padding: 0 4px; border-radius: 3px; color: var(--muted); }

.conflict { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 18px; padding: 12px 14px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-size: 15px; }
.conflict span { flex: 1 1 260px; }

.block { margin-top: 44px; }
.block h2 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.block ul { list-style: none; margin: 0; padding: 0; }
.block li a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 8px; margin: 0 -8px; border-radius: 6px; text-decoration: none; }
.block li a:hover { background: var(--side); }
.block li a span { font-weight: 500; }
.block li a small { color: var(--faint); font-size: 13px; white-space: nowrap; }
.block .add { margin-top: 6px; padding: 6px 8px; margin-left: -8px; background: none; border: 0; border-radius: 6px; color: var(--muted); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.block .add:hover { background: var(--side); color: var(--ink); }
.block .none { color: var(--faint); font-size: 15px; margin: 6px 0 0; }
.home-empty { margin-top: 24px; }
.home-empty p { color: var(--muted); margin: 0 0 14px; }

/* Link-suggesties tijdens typen */
.suggest { position: fixed; z-index: 45; width: 290px; max-height: 300px; overflow: auto; padding: 5px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.suggest button { display: block; width: 100%; text-align: left; padding: 7px 9px; border: 0; border-radius: 6px; background: none; font-size: 15px; }
.suggest button small { display: block; color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest button.on { background: var(--sel); }
.suggest .new { color: var(--new); }
.suggest .sug-none { margin: 4px 9px 6px; font-size: 12px; color: var(--faint); }

/* Vragen */
dialog#ask { width: min(440px, calc(100% - 32px)); padding: 22px; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); color: var(--ink); background: var(--paper); }
dialog#ask::backdrop { background: var(--backdrop); }
dialog#ask h3 { margin: 0 0 8px; font-size: 19px; }
dialog#ask p { margin: 0 0 16px; color: var(--muted); }
dialog#ask .field { margin-bottom: 16px; }
dialog#ask select.field { padding-right: 6px; }
dialog#ask .acts { display: flex; justify-content: flex-end; gap: 8px; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(22px + var(--b)); transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 14px; background: var(--toast-bg); color: var(--toast-ink); border-radius: 8px; box-shadow: var(--shadow); font-size: 14px; }
.toast button { margin-left: 10px; background: none; border: 0; color: var(--toast-link); font-weight: 600; padding: 0; }

/* Telefoon: zijbalk als la van links */
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; width: min(86vw, 320px); transform: translateX(-102%); transition: transform 0.18s ease; box-shadow: var(--shadow); }
  .shell.nav .side { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 25; background: var(--scrim); }
  .shell.nav .scrim { display: block; }
  .topbar, .shell.editing .topbar { display: flex; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 10; padding: calc(6px + var(--t)) 8px 6px; background: var(--glass); border-bottom: 1px solid var(--line); }
  .tools { gap: 0; }
  .tool { min-width: 42px; height: 42px; padding: 0 6px; }
  .edit-hint { display: none; }
  /* Tikvlakken van minstens 44 pixels, invoer op 16px zodat de iPhone niet inzoomt */
  .row { min-height: 44px; }
  .row a { padding: 10px 4px; font-size: 16px; }
  .row .tog { width: 34px; height: 42px; }
  .row .plus { width: 42px; height: 42px; }
  .tree ul ul { padding-left: 12px; }
  .search input { height: 42px; font-size: 16px; }
  .side-foot { gap: 6px 20px; font-size: 15px; }
  .side-foot a, .side-foot button { padding: 8px 0; }
  .side .add-root { height: 44px; font-size: 16px; }
  .block li a { padding: 12px 8px; }
  .block .add { padding: 12px 8px; }
  .suggest button { padding: 11px 10px; font-size: 16px; }
  .menu button { padding: 12px; font-size: 16px; }
  .crumbs { font-size: 15px; }
  .crumbs a { padding: 4px; }
  .doc img { max-height: 60vh; }
  .topbar .menu-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; }
  .topbar .menu-btn:hover { background: var(--side); }
  .topbar .tb-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page { padding: 22px 18px 120px; }
  .title { font-size: 29px; }
  .row .plus { opacity: 1; }
  .proj-row { grid-template-columns: 1fr auto; }
  .proj-row .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .newproj, .proj-edit { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .side, .row .tog svg { transition: none; }
}

/* Logo: dun randje, zodat het donkere vierkant ook op een donkere achtergrond zichtbaar blijft */
.side-head img, .mark img { border-radius: 7px; box-shadow: 0 0 0 1px var(--line); }
