:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f0f3f6;
  --border: #d8dee4;
  --text: #1c2228;
  --muted: #5f6b76;
  --accent: #0f6e8c;
  --accent-text: #ffffff;
  --accent-soft: #e2f1f6;
  --ok: #1d7a46;
  --ok-soft: #e1f3e8;
  --warn: #9a6200;
  --warn-soft: #fbf0d9;
  --err: #b42318;
  --err-soft: #fde7e5;
  --code-bg: #f6f8fa;
  --k: #0b5394;
  --s: #1d7a46;
  --n: #9a3412;
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1418; --surface: #161c22; --surface-2: #1d252c; --border: #2c3640;
    --text: #e3e8ec; --muted: #94a1ad; --accent: #3fa9c9; --accent-text: #061016; --accent-soft: #15323d;
    --ok: #5cc98a; --ok-soft: #143222; --warn: #e3b25a; --warn-soft: #3a2c10; --err: #f07a6e; --err-soft: #3d1714;
    --code-bg: #11171c; --k: #7cb7ff; --s: #7fd6a0; --n: #f2a46c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1418; --surface: #161c22; --surface-2: #1d252c; --border: #2c3640;
  --text: #e3e8ec; --muted: #94a1ad; --accent: #3fa9c9; --accent-text: #061016; --accent-soft: #15323d;
  --ok: #5cc98a; --ok-soft: #143222; --warn: #e3b25a; --warn-soft: #3a2c10; --err: #f07a6e; --err-soft: #3d1714;
  --code-bg: #11171c; --k: #7cb7ff; --s: #7fd6a0; --n: #f2a46c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button, input, select { font: inherit; color: inherit; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent); }
.brand span { color: var(--text); }
.conn { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
label.inline { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
label.inline input { width: 170px; }
label.inline.narrow input { width: 80px; }

input[type=text], input[type=number], input[type=password], input[type=search], select {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; min-width: 0;
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input:disabled { opacity: .6; }

.btn {
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 6px; padding: 6px 12px; cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.btn.primary:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; }
.btn.small { padding: 3px 8px; font-size: 12px; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; vertical-align: middle; }
.pill:empty { display: none; }
.pill-muted { background: var(--surface-2); color: var(--muted); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-err { background: var(--err-soft); color: var(--err); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: calc(100vh - 54px); }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border); padding: 12px; overflow-y: auto;
  position: sticky; top: 54px; height: calc(100vh - 54px);
}
.side-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.filter { width: 100%; margin-bottom: 8px; }
.versionfilter { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.versionfilter label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
nav h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 4px 6px; }
.navbtn {
  display: flex; justify-content: space-between; align-items: center; gap: 6px; width: 100%; text-align: left;
  border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 6px 8px; cursor: pointer;
}
.navbtn:hover { background: var(--surface-2); }
.navbtn.active { background: var(--accent-soft); border-color: var(--accent); }
.navbtn .m { font: 600 10px var(--mono); color: var(--muted); }
.navbtn .tags { display: flex; gap: 3px; flex-shrink: 0; }

.tag { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.tag.v2 { background: var(--accent-soft); color: var(--accent); }
.tag.ext { background: var(--warn-soft); color: var(--warn); }
.tag.post { background: var(--err-soft); color: var(--err); }

.main { padding: 16px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.card h2 { font-size: 14px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.fn-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.fn-head h1 { font-size: 18px; margin: 0 0 4px; }
.fn-actions { display: flex; gap: 8px; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; font-weight: normal; }
#fnDesc { margin: 8px 0 10px; }
.pathrow { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.pathrow input { flex: 1; font-family: var(--mono); }
.method { font: 700 12px var(--mono); padding: 4px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); }
.method.POST { background: var(--err-soft); color: var(--err); }

.params { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; }
.params label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.params label .req { color: var(--err); }
.params label.check { flex-direction: row; align-items: center; gap: 6px; padding-top: 18px; color: var(--text); }
.params .where { font: 10px var(--mono); opacity: .7; }
.params .empty { color: var(--muted); font-style: italic; }

.panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 8px 0 4px; }
.urlbox { display: flex; gap: 6px; align-items: flex-start; }
.urlbox code { flex: 1; font: 12px var(--mono); background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; word-break: break-all; }
.copy { border: 1px solid var(--border); background: var(--surface-2); border-radius: 6px; cursor: pointer; padding: 4px 8px; }
.code {
  margin: 0; font: 12px/1.5 var(--mono); background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 10px; min-height: 120px; max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
.code.raw { min-height: 140px; }
.code .k { color: var(--k); } .code .s { color: var(--s); } .code .n { color: var(--n); } .code .b { color: var(--n); font-weight: 600; }
.viewer { min-width: 0; }
.viewer img.single { max-width: 100%; border-radius: 6px; border: 1px solid var(--border); background: #000; display: block; }
.viewer video { max-width: 100%; border-radius: 6px; background: #000; display: block; }
.viewer .bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.viewer .bar a { color: var(--accent); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 480px; overflow: auto; padding: 2px; }
.gallery figure { margin: 0; font-size: 10px; color: var(--muted); word-break: break-all; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: #000; cursor: zoom-in; display: block; }
.notice { padding: 8px 10px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); font-size: 13px; margin-bottom: 8px; }
.notice.err { background: var(--err-soft); color: var(--err); }

.history-head { display: flex; justify-content: space-between; align-items: center; }
.history-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow: auto; font: 12px var(--mono); }
.history-list li { display: grid; grid-template-columns: 70px 54px 1fr auto; gap: 8px; padding: 4px 6px; border-radius: 4px; cursor: pointer; align-items: center; }
.history-list li:hover { background: var(--surface-2); }
.history-list .path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-list:empty::after { content: "Nog geen calls."; color: var(--muted); font-family: system-ui, sans-serif; }

/* ---------- Dialog / lightbox ---------- */
dialog { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); padding: 0; width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.45); }
.settings-form { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.settings-form h2 { margin: 0 0 4px; font-size: 16px; }
.settings-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.settings-form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 20; cursor: zoom-out; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; }
.lightbox .cap { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: #fff; font: 12px var(--mono); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .panes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; max-height: 50vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .main { padding: 16px; }
  label.inline input { width: 130px; }
  .grid2 { grid-template-columns: 1fr; }
  .history-list li { grid-template-columns: 60px 44px 1fr; }
  .history-list li .t { display: none; }
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; }
.tab { padding: 6px 14px; border-radius: 6px; color: var(--muted); text-decoration: none; font-weight: 600; }
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab.active { background: var(--accent-soft); color: var(--accent); }
[hidden] { display: none !important; }

/* ---------- Testdata ---------- */
.dstatus { margin-bottom: 10px; word-break: break-all; }
.dstatus code, .card code { font: 12px var(--mono); }
.err { color: var(--err); }
.btn.block { display: block; text-align: center; text-decoration: none; margin-bottom: 8px; }
.btn.danger { color: var(--err); }
.btn.danger:hover { border-color: var(--err); }
.btn.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
a.btn { color: inherit; text-decoration: none; display: inline-block; }
.plist { list-style: none; margin: 0; padding: 0; }
.plist a { display: block; padding: 6px 8px; border-radius: 6px; color: inherit; text-decoration: none; border: 1px solid transparent; }
.plist a:hover { background: var(--surface-2); }
.plist a.active { background: var(--accent-soft); border-color: var(--accent); }
.pname { display: block; font-weight: 600; }
.pmeta { display: block; font-size: 11px; color: var(--muted); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs .sep { opacity: .5; }
#dMain { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: flex; gap: 6px; }
.dform { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 14px; }
.dform.one { grid-template-columns: minmax(0, 1fr); align-content: start; }
.dform.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dform label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.dform label.wide, .dform .wide { grid-column: 1 / -1; }
.dform input, .dform select, .dform textarea { width: 100%; }
.dform input[type=checkbox] { width: auto; }
.dform label.check { flex-direction: row; align-items: center; gap: 8px; padding-top: 18px; color: var(--text); font-size: 13px; }
.tlink { display: flex; gap: 8px; align-items: center; }
.tlink select { flex: 1; min-width: 0; }
.slidepick { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; color: var(--text) !important; font-size: 13px !important; padding: 2px 0; }
textarea { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
fieldset { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin: 0; }
legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
label.check.inline { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--border); padding: 6px; white-space: nowrap; }
.tbl td { border-bottom: 1px solid var(--border); padding: 5px 6px; vertical-align: middle; }
.tbl.click tbody tr { cursor: pointer; }
.tbl.click tbody tr:hover, .tbl.raw tbody tr:hover { background: var(--surface-2); }
.tbl a { color: var(--accent); }
.tbl input { width: 100%; min-width: 60px; padding: 3px 6px; }
.tbl input.num { max-width: 90px; }
.tbl tfoot td { border-bottom: 0; padding-top: 10px; }
.tbl .nowrap { white-space: nowrap; }
.tbl .nowrap .btn { margin-left: 2px; }
.tblock { border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px; }
.tblock summary { padding: 8px 10px; cursor: pointer; }
.tblock form { padding: 0 10px 10px; }
.notice + .dform { margin-top: 8px; }

.wells { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.wcard { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; color: inherit; text-decoration: none; background: var(--surface); }
.wcard:hover { border-color: var(--accent); }
.wcard img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #000; display: block; }
.wbody { padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.whead { width: 100%; }
.wdesc { width: 100%; font-size: 12px; font-style: italic; color: var(--muted); }
.noimg { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted); font-size: 12px; text-align: center; padding: 8px; }
.noimg.big { aspect-ratio: auto; min-height: 220px; border-radius: 6px; }
.chip { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.fate { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.fate-transfer { background: var(--ok-soft); color: var(--ok); }
.fate-freeze { background: var(--accent-soft); color: var(--accent); }
.fate-avoid { background: var(--err-soft); color: var(--err); }
.fate-other { background: var(--surface-2); color: var(--muted); }

.wgrid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; }
.imgwrap { position: relative; background: #000; border-radius: 6px; overflow: hidden; }
.imgwrap img { width: 100%; display: block; cursor: zoom-in; min-height: 200px; object-fit: contain; }
.vcap { position: absolute; left: 8px; bottom: 8px; font: 12px var(--mono); color: #fff; background: rgba(0,0,0,.55); padding: 2px 6px; border-radius: 4px; }
.vctl { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.vctl input[type=range] { flex: 1; min-width: 0; }
.vfocal { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--muted); }
.vfocal a { margin-left: auto; color: var(--accent); }

.pager { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.gridwrap { overflow: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: 6px; }
.tbl.raw { font: 12px var(--mono); }
.tbl.raw th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.tbl.raw th a { color: inherit; text-decoration: none; text-transform: none; font-size: 12px; }
.tbl.raw .ctype { font-size: 10px; opacity: .6; }
.tbl.raw td.cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: text; }
.null { color: var(--muted); font-style: italic; opacity: .6; }

.toast { position: fixed; right: 16px; bottom: 16px; background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); padding: 10px 14px; border-radius: 8px; z-index: 30; max-width: calc(100vw - 32px); box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.toast.err { background: var(--err-soft); color: var(--err); border-color: var(--err); }

@media (max-width: 1000px) {
  .wgrid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .tabs { order: 3; width: 100%; }
  .dform.three { grid-template-columns: minmax(0, 1fr); }
  .tbl { display: block; overflow-x: auto; }
}

/* ---------- API-log ---------- */
.logview { padding: 16px; display: flex; flex-direction: column; gap: 12px; min-height: calc(100vh - 54px); }
.logbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.logbar input[type=search] { flex: 1; min-width: 200px; }
.logbar label.check { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.logpanes { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.loglist-card { padding: 0; overflow: auto; max-height: calc(100vh - 140px); }
.loglist { font-size: 12px; }
.loglist th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.loglist td, .loglist th { padding: 5px 8px; }
.loglist tbody tr { cursor: pointer; }
.loglist tbody tr:hover { background: var(--surface-2); }
.loglist tbody tr.sel { background: var(--accent-soft); }
.loglist .lpath { font-family: var(--mono); max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loglist .method { padding: 1px 6px; font-size: 10px; }
#lgEmpty { padding: 12px 14px; margin: 0; }
.logdetail { position: sticky; top: 70px; max-height: calc(100vh - 140px); overflow: auto; }
.logdetail h3 { font-size: 13px; margin: 14px 0 0; }
.logdetail .code { max-height: 320px; }
@media (max-width: 1000px) {
  .logpanes { grid-template-columns: minmax(0, 1fr); }
  .logdetail { position: static; max-height: none; }
}

/* ---------- Snel annoteren ---------- */
.quick { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; background: var(--surface-2); }
.quick-head { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.quick-stages { display: flex; flex-wrap: wrap; gap: 4px; }
.qstage.done { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.qstage .muted { font-size: 10px; }
#aTable select { max-width: 220px; }
#aHelp { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Import ---------- */
.zfocals { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 4px; }
.bar-outer { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; width: 140px; margin-bottom: 2px; }
.bar-inner { height: 100%; background: var(--accent); }
#zLog { max-height: 260px; }

/* ---------- Mapping ---------- */
.mapview { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 14px; padding: 14px 16px; align-items: start; }
.meditor { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.meditor label, .mout label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.meditor label.check { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.meditor label.btn { display: inline-block; margin: 0; font-size: 12px; color: inherit; cursor: pointer; }
.meditor input, .meditor select, .meditor textarea, .mout input, .mout select, .mout textarea {
  padding: 5px 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 13px; min-width: 0;
}
.meditor .mono, .mout .mono { font: 12px var(--mono); }
.meditor textarea.bad { border-color: var(--err); }
.meditor h3 { font-size: 13px; margin: 12px 0 6px; }
.meditor summary { cursor: pointer; }
.meditor details[open] summary { margin-bottom: 10px; }
.mindent { margin-left: 22px; }
.mbtns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mtbl-wrap { overflow-x: auto; margin-bottom: 6px; }
.mtbl td { padding: 2px 3px; }
.mtbl input, .mtbl select { width: 100%; padding: 3px 5px; font-size: 12px; }
.mtbl td:first-child input { min-width: 110px; }
.mtbl select { min-width: 92px; }
.mtbl input.mono { min-width: 90px; }
.mtbl input:disabled { opacity: .35; }
.mrow-act { white-space: nowrap; width: 1%; }
.mout { position: sticky; top: 64px; min-width: 0; }
.mout-card { max-height: calc(100vh - 92px); display: flex; flex-direction: column; }
.mout-card > div:not(.card-head) { overflow: auto; min-height: 0; }
.mcode { margin: 0; white-space: pre; word-break: normal; tab-size: 4; font-size: 12px; min-height: 300px; max-height: none; overflow: visible; }
.mres-wrap { overflow-x: auto; margin-bottom: 10px; }
.mres th:first-child { position: sticky; left: 0; background: var(--surface); }
.mres td, .mres th { font-size: 12px; white-space: nowrap; }
.mres tbody th { font: 12px var(--mono); color: var(--text); text-transform: none; letter-spacing: 0; }
.mres td .small { white-space: normal; display: inline-block; min-width: 120px; }
.mwarn { color: var(--err); font-weight: 600; }
.msim { margin: 4px 0 10px; }
@media (max-width: 1100px) {
  .mapview { grid-template-columns: 1fr; }
  .mout { position: static; }
  .mout-card { max-height: none; }
}
.minfo { white-space: nowrap; font-size: 12px; color: var(--muted); }
.minfo u { text-decoration: none; border-bottom: 1px dotted var(--muted); cursor: help; }
.mlookup { width: auto; margin-bottom: 6px; }
.mlookup select, .mlookup input { min-width: 200px; }

/* Automatische slide (Testdata) */
.asopt { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; }
.asopt input { margin-top: 3px; }
.asrange { margin: 8px 0 0 26px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.asrange input { width: 64px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }

/* Slide samenstellen (Testdata) */
.kslide { margin: 6px 0; }
.kwells { display: grid; gap: 6px; max-width: 640px; }
.kwells.k16 { max-width: 820px; }
.kwells.k12 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kwells.k16 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.kwell { position: relative; aspect-ratio: 1; border: 2px dashed var(--border); border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer; overflow: hidden; background: var(--surface-2); }
.kwell.filled { border-style: solid; background: #000; }
.kwell.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.kwell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kwn { position: absolute; top: 8%; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; z-index: 1;
  background: var(--surface); color: var(--text); border-radius: 999px; padding: 0 6px; }
.kwl { position: absolute; bottom: 10%; left: 50%; transform: translateX(-50%); z-index: 1; font-size: 10px; white-space: nowrap;
  background: rgba(0, 0, 0, .65); color: #fff; border-radius: 4px; padding: 0 4px; }
.kplus { font-size: 22px; color: var(--muted); }
.kdel { position: absolute; top: 18%; right: 14%; z-index: 2; border: 0; border-radius: 50%; width: 20px; height: 20px; font-size: 11px;
  background: var(--err); color: #fff; cursor: pointer; display: none; }
.kwell.filled:hover .kdel { display: block; }
.kfilters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.kfilters input[type=search] { flex: 1 1 220px; }
.kfilters input, .kfilters select { padding: 5px 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.kcard { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--surface); }
.kcard:hover { border-color: var(--accent); }
.kthumb { aspect-ratio: 1; background: #000; display: flex; align-items: center; justify-content: center; }
.kthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kmeta { padding: 6px 8px; font-size: 12px; line-height: 1.4; }
.kmeta code { word-break: break-all; }
@media (max-width: 700px) {
  .kwells.k12, .kwells.k16 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.mimg { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; background: #000; display: block; }
.madv { border: 1px dashed var(--border); border-radius: var(--radius); padding: 8px 10px; }
.madv > summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.madv[open] > summary { margin-bottom: 10px; }
.madv > .card { margin-bottom: 12px; }
.mfields input { min-width: 64px; }
.mfields td:first-child input, .mfields td:nth-child(2) input { min-width: 120px; }
.mfields select { min-width: 0; }
.mfields .minfo { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.mnowrap { white-space: nowrap; }
.mnowrap select { width: auto; }
.msub > td { background: var(--surface-2); padding: 8px 10px !important; }
.mcolsel { max-width: 260px; font: 12px var(--mono); }
