/* Heit & Mem 50 — mobile first, light and dark theme following the device. */

:root {
  --bg: #fbf6ef;
  --surface: #ffffff;
  --surface-2: #f4ece1;
  --text: #2a1d1f;
  --muted: #6f5f61;
  --border: #e6d9c8;
  --wine: #7a2e3b;
  --wine-strong: #5e1f2b;
  --gold: #b07d1e;
  --gold-soft: #e2b45c;
  --on-wine: #fff8ee;
  --danger: #b3261e;
  --ok: #1f7a4a;
  --shadow: 0 1px 2px rgb(60 30 20 / 6%), 0 6px 20px rgb(60 30 20 / 8%);
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161012;
    --surface: #221a1c;
    --surface-2: #2c2225;
    --text: #f3e9e4;
    --muted: #b8a7a4;
    --border: #3b2f31;
    --wine: #c0576a;
    --wine-strong: #d97083;
    --gold: #e2b45c;
    --gold-soft: #e2b45c;
    --on-wine: #1a0f11;
    --danger: #ff7a70;
    --ok: #5fd69a;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
img, video, canvas { max-width: 100%; }
a { color: var(--wine); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 6px; font-size: .92em; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.gold { color: var(--gold); }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-family: var(--serif); font-size: 1.1rem; }
.brand img { border-radius: 8px; }
.brand b { color: var(--gold); }
.brand span { white-space: nowrap; }
.userbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.userbar .who { font-size: .85rem; color: var(--muted); max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Layout */
.page { max-width: 720px; margin: 0 auto; padding: 16px; }
.page.wide { max-width: 1040px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 16px;
  box-shadow: var(--shadow);
}
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .95rem; }
label.check, .checks label { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
legend { font-weight: 600; margin-bottom: 4px; }
input, textarea, select {
  font: inherit; color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--wine); }
textarea { resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible, .btn:focus-visible, button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--gold) 70%, transparent);
  outline-offset: 2px;
}

/* Buttons */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--wine); border-color: var(--wine); color: var(--on-wine); }
.btn.primary:hover { background: var(--wine-strong); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: .875rem; }
.btn[disabled] { opacity: .55; cursor: default; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 8px; font-size: 1rem; border-radius: 8px; }
.icon-btn:hover { color: var(--danger); }

/* Hero + countdown */
.hero { text-align: center; padding: 24px 0 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: var(--muted); margin-bottom: .4em; }
.hero h1 { font-size: clamp(2.3rem, 11vw, 3.8rem); margin-bottom: .1em; }
.rings { position: relative; height: 34px; width: 64px; margin: 4px auto 18px; }
.rings span { position: absolute; top: 0; width: 34px; height: 34px; border: 4px solid var(--gold-soft); border-radius: 50%; }
.rings span:first-child { left: 4px; }
.rings span:last-child { right: 4px; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 480px; margin: 0 auto 16px; }
.cd-part {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 4px 8px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center;
}
.cd-num { font-family: var(--serif); font-size: clamp(1.6rem, 8vw, 2.6rem); font-weight: 700; color: var(--wine); font-variant-numeric: tabular-nums; line-height: 1.1; }
.cd-part:first-child .cd-num { color: var(--gold); }
.cd-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cd-done { font-family: var(--serif); font-size: 2rem; color: var(--gold); }
.intro { font-size: 1.2rem; max-width: 560px; margin: 0 auto 8px; }
.days-inline { color: var(--wine); }
.hint { border-left: 5px solid var(--gold-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* Gallery */
.gallery-section { margin-bottom: 16px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.gallery .ph {
  position: relative; display: block; padding: 0; border: 0; border-radius: 12px; overflow: hidden;
  background: var(--surface-2); aspect-ratio: 1; cursor: pointer;
}
.gallery .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .ph .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px;
  font-size: .78rem; color: #fff; text-align: left;
  background: linear-gradient(transparent, rgb(0 0 0 / 65%));
}
.manage .tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.manage .tile img { aspect-ratio: 1; object-fit: cover; width: 100%; display: block; }
.manage .tile .meta { padding: 8px; display: flex; flex-direction: column; gap: 6px; font-size: .85rem; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge.secret { background: color-mix(in srgb, var(--wine) 18%, transparent); color: var(--wine); }
.preview { max-height: 320px; object-fit: contain; border-radius: 12px; background: var(--surface-2); }

/* Dialogs */
.dlg {
  border: 0; padding: 0; border-radius: 20px; width: min(520px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / 35%);
}
.dlg::backdrop { background: rgb(20 10 12 / 55%); }
.dlg-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.dlg-actions.wrap { flex-wrap: wrap; }
.dlg-photo { width: min(960px, calc(100vw - 16px)); }
.dlg-photo img { width: 100%; max-height: 75vh; object-fit: contain; border-radius: 12px; background: #000; }
.dlg-camera video { width: 100%; border-radius: 12px; background: #000; aspect-ratio: 3 / 4; object-fit: cover; }
.name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-error { color: var(--danger); min-height: 1.2em; margin: 0; }
.notice { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }

/* Tabs */
.tabs, .subtabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; scrollbar-width: thin; }
.tabs button, .subtabs button {
  flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; min-height: 40px;
}
.tabs .tab-link {
  flex: 0 0 auto; display: inline-flex; align-items: center; border: 1px dashed var(--wine); color: var(--wine);
  border-radius: 999px; padding: 8px 14px; font-weight: 600; text-decoration: none; min-height: 40px;
}
.tabs button[aria-selected=true], .subtabs button[aria-selected=true] { background: var(--wine); color: var(--on-wine); border-color: var(--wine); }

/* Texts editor */
.text-edit textarea { min-height: 110px; }
.text-edit .row { justify-content: space-between; flex-wrap: wrap; }

/* Chat */
.chat {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 55vh; min-height: 200px; overflow-y: auto;
  padding: 12px; background: var(--surface-2); border-radius: var(--radius); margin-bottom: 8px;
}
.msg { max-width: 85%; align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; padding: 8px 12px; }
.msg.mine { align-self: flex-end; background: color-mix(in srgb, var(--wine) 14%, var(--surface)); border-radius: 14px 14px 4px 14px; }
.msg .head { display: flex; gap: 8px; align-items: baseline; font-size: .78rem; color: var(--muted); }
.msg .head b { color: var(--wine); }
.msg .body { white-space: pre-wrap; word-wrap: break-word; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; }

/* Ideas */
.ideas { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ideas li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.ideas li.st-klaar { opacity: .75; }
.ideas li.st-afgewezen { opacity: .5; }
.ideas .title { font-weight: 700; }
.ideas .body { white-space: pre-wrap; margin: 4px 0; }
.ideas .foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.ideas select { width: auto; padding: 4px 8px; }

/* Video call */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.vtile { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; }
.vtile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vtile.self video { transform: scaleX(-1); }
.vtile .label { position: absolute; left: 8px; bottom: 8px; background: rgb(0 0 0 / 55%); color: #fff; padding: 2px 10px; border-radius: 999px; font-size: .8rem; }
.vtile .novideo { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 2.4rem; font-family: var(--serif); }
.vtile.audio-only { aspect-ratio: auto; min-height: 64px; }
.call-controls { margin-bottom: 8px; }
#qr-canvas { background: #fff; border-radius: 12px; padding: 0; display: block; margin: 8px auto; width: 264px; height: 264px; image-rendering: pixelated; }
.pair-video { width: 100%; border-radius: 14px; background: #000; aspect-ratio: 3 / 4; object-fit: cover; }
.pair-video.mirror { transform: scaleX(-1); }

/* Admin */
.icon-editor { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
#icon-canvas { width: 200px; height: 200px; border-radius: 22%; background: var(--surface-2); box-shadow: var(--shadow); touch-action: none; cursor: grab; justify-self: center; }
@media (min-width: 640px) { .icon-editor { grid-template-columns: 220px 1fr; } }
.status { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.status dt { color: var(--muted); }
.status dd { margin: 0; font-weight: 600; }
.list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.list li { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; flex-wrap: wrap; }
.code { background: var(--surface-2); padding: 12px; border-radius: 10px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; font-size: .82rem; }
.ok { color: var(--ok); }
.bad { color: var(--danger); }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 12px; box-shadow: var(--shadow); font-size: .95rem; }
.toast.error { background: var(--danger); color: #fff; }

/* Disclaimer */
.disclaimer {
  max-width: 720px; margin: 24px auto 0; padding: 16px 16px 32px;
  font-size: .88rem; color: var(--muted); border-top: 1px solid var(--border);
}
.disclaimer strong { color: var(--text); }

@media (min-width: 700px) {
  .page { padding: 24px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Themes (chosen by the admin). Base :root above is "klassiek". ---------- */
:root[data-theme="goud"] {
  --bg: #fdf9ee; --surface: #ffffff; --surface-2: #f6eedb; --text: #2b2414; --muted: #6d6249; --border: #eadfc2;
  --wine: #8a6614; --wine-strong: #6e510f; --gold: #b8860b; --gold-soft: #d9b45a; --on-wine: #fffaf0;
}
:root[data-theme="fries"] {
  --bg: #f5f8fc; --surface: #ffffff; --surface-2: #e8eff8; --text: #13233a; --muted: #56657a; --border: #d4dfee;
  --wine: #1f5aa6; --wine-strong: #17457f; --gold: #c8202f; --gold-soft: #e04555; --on-wine: #ffffff;
}
:root[data-theme="waddenzee"] {
  --bg: #f0f6f6; --surface: #ffffff; --surface-2: #e1eeef; --text: #10292e; --muted: #4f6a6f; --border: #cfe0e2;
  --wine: #0f5c6e; --wine-strong: #0a4655; --gold: #b08a3e; --gold-soft: #d8b878; --on-wine: #f2fbfc;
}
:root[data-theme="skutsje"] {
  --bg: #f7f4ec; --surface: #fffdf8; --surface-2: #efe9da; --text: #16213a; --muted: #5a6275; --border: #e1d9c4;
  --wine: #1d2f5c; --wine-strong: #142245; --gold: #a63a2a; --gold-soft: #c4553f; --on-wine: #fffdf8;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="goud"] {
    --bg: #15120b; --surface: #201b11; --surface-2: #2a2416; --text: #f4ecd8; --muted: #bcae8c; --border: #3a321f;
    --wine: #d9b45a; --wine-strong: #e8c877; --gold: #e8c877; --gold-soft: #d9b45a; --on-wine: #1a150a;
  }
  :root[data-theme="fries"] {
    --bg: #0d1420; --surface: #152034; --surface-2: #1c2a42; --text: #e7eef8; --muted: #9fb0c7; --border: #26364f;
    --wine: #6fa3e6; --wine-strong: #8db8ef; --gold: #ff6b78; --gold-soft: #ff6b78; --on-wine: #0b1220;
  }
  :root[data-theme="waddenzee"] {
    --bg: #08171b; --surface: #0f2329; --surface-2: #152e35; --text: #e3f1f3; --muted: #93b2b8; --border: #1f3b43;
    --wine: #4fb3c7; --wine-strong: #74c6d6; --gold: #e0c07e; --gold-soft: #e0c07e; --on-wine: #04161a;
  }
  :root[data-theme="skutsje"] {
    --bg: #0c111d; --surface: #141b2b; --surface-2: #1b2438; --text: #eef0f5; --muted: #a3aabb; --border: #263049;
    --wine: #8aa4e0; --wine-strong: #a9bdea; --gold: #e07a5f; --gold-soft: #e07a5f; --on-wine: #0c111d;
  }
}

/* Hero decorations per theme */
.deco { display: block; margin: 4px auto 18px; height: 40px; width: 120px; color: var(--gold-soft); }
.deco-sail { height: 64px; color: var(--gold); }
.deco-hearts { color: var(--gold); }
.deco-waves { color: var(--wine); }

/* Water themes: a soft wave line under the top bar */
:root[data-theme="waddenzee"] .topbar, :root[data-theme="skutsje"] .topbar {
  border-bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='6' viewBox='0 0 40 6'%3E%3Cpath d='M0 3 q10 -4 20 0 t20 0' fill='none' stroke='%2388aab4' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: bottom;
}

/* ---------- Info button + footer ---------- */
.topbar-right { display: flex; align-items: center; gap: 8px; }
.info-btn {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--wine);
  font: 700 1rem/1 var(--serif); font-style: italic; cursor: pointer;
}
.linklike { background: none; border: 0; padding: 4px 0; color: var(--wine); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.disclaimer { display: flex; flex-direction: column; gap: 2px; align-items: center; text-align: center; }
@media (max-width: 430px) { .userbar .who { display: none; } }

/* ---------- Beheer: tabs stay visible while scrolling ---------- */
.page-beheer .tabs {
  position: sticky; top: var(--topbar-h, 58px); z-index: 9;
  background: var(--bg); margin: 0 -16px 12px; padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 700px) { .page-beheer .tabs { margin: 0 -24px 12px; padding: 8px 24px; } }

/* ---------- Theme picker ---------- */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.theme-opt {
  display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer;
  border: 2px solid var(--border); border-radius: 12px; padding: 10px; background: var(--surface); color: var(--text); font: inherit;
}
.theme-opt[aria-pressed="true"] { border-color: var(--wine); box-shadow: 0 0 0 2px color-mix(in srgb, var(--wine) 25%, transparent); }
.theme-opt .sw { display: flex; height: 26px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.theme-opt .sw span { flex: 1; }
.theme-opt small { color: var(--muted); }

/* ---------- To-do's ---------- */
.todo-filter { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.todo-filter button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .9rem; cursor: pointer; }
.todo-filter button[aria-pressed="true"] { background: var(--wine); border-color: var(--wine); color: var(--on-wine); }
.todos { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.todos li { display: flex; align-items: flex-start; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.todos li input[type=checkbox] { margin-top: 2px; flex: 0 0 auto; width: 22px; height: 22px; }
.todos li .t { flex: 1; min-width: 0; }
.todos li .t .title { font-weight: 600; word-wrap: break-word; }
.todos li.done .title { text-decoration: line-through; color: var(--muted); }
.todos li .t .meta { font-size: .8rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.todos .due.late { color: var(--danger); font-weight: 700; }
.todo-form { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .todo-form { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; } }

/* ---------- Preview: what heit & mem see ---------- */
.preview-banner {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
  background: color-mix(in srgb, var(--gold-soft) 28%, var(--surface)); border: 1px solid var(--gold-soft);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px;
}
.preview-banner strong { font-family: var(--serif); font-size: 1.1rem; }
.preview-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.preview-tools button[aria-pressed="true"] { background: var(--wine); border-color: var(--wine); color: var(--on-wine); }
.preview-stage { display: flex; justify-content: center; }
.preview-frame { background: var(--bg); overflow: hidden; }
.preview-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.preview-frame.phone {
  width: 390px; height: min(844px, calc(100vh - 210px)); min-height: 520px;
  border: 12px solid #15110f; border-radius: 44px; box-shadow: 0 20px 50px rgb(0 0 0 / 25%);
}
.preview-frame.full { width: 100%; height: calc(100vh - 200px); min-height: 520px; border: 1px solid var(--border); border-radius: 12px; }
@media (max-width: 520px) {
  .preview-frame.phone, .preview-frame.full { width: 100%; height: calc(100vh - 190px); border: 1px solid var(--border); border-radius: 12px; box-shadow: none; }
  .preview-tools [data-mode] { display: none; }
}


/* ---------- 1.4: tabs with badges ---------- */
.tab-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px;
  border-radius: 999px; background: var(--gold); color: #fff; font-size: .75rem; font-weight: 700;
}
.tabs button[aria-selected=true] .tab-badge { background: var(--on-wine); color: var(--wine); }
.row.between { justify-content: space-between; }

/* ---------- start page parts (switchable) ---------- */
.sec { position: relative; }
.sec.is-hidden { opacity: .45; outline: 2px dashed var(--gold-soft); outline-offset: 4px; border-radius: 12px; }
.sec-flag {
  position: absolute; top: -12px; right: 8px; z-index: 2; background: var(--gold); color: #fff; opacity: 1;
  font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
}
.actions .sec { display: contents; }
.actions .sec.is-hidden { display: inline-flex; padding: 6px; }
.edit-btn {
  display: inline-flex; align-items: center; gap: 4px; margin: 6px 0 0; padding: 4px 10px;
  border: 1px dashed var(--wine); border-radius: 999px; background: var(--surface); color: var(--wine);
  font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.edit-btn:hover { background: color-mix(in srgb, var(--wine) 10%, var(--surface)); }
.hintteller { text-align: center; }
.hintteller-text { font-size: 1.05rem; margin-bottom: 8px; }
.countdown.mini { max-width: 320px; gap: 6px; margin-bottom: 4px; }
.countdown.mini .cd-part { padding: 6px 2px 4px; box-shadow: none; }
.countdown.mini .cd-num { font-size: 1.35rem; }
.countdown.mini .cd-label { font-size: .65rem; }
.hint-text { font-size: 1.05rem; }
.older-hints { margin-top: 10px; }
.older-hints summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.older-hints ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.older-hints li { border-top: 1px solid var(--border); padding-top: 8px; }
.planned { margin-top: 12px; padding: 10px; border: 1px dashed var(--border); border-radius: 12px; background: var(--surface-2); }
.planned-title { font-weight: 700; margin-bottom: 6px; }
.planned ul { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-direction: column; gap: 6px; }
.info-text p:last-child { margin-bottom: 0; }

/* ---------- preview tab ---------- */
.preview-at { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; width: 100%; }
.inline-label { flex-direction: row; align-items: center; gap: 8px; font-size: .9rem; }
.inline-label input { width: auto; padding: 6px 8px; }

/* ---------- editor ---------- */
.dlg-edit { width: min(720px, calc(100vw - 16px)); }
.dlg-edit .dlg-body { max-height: calc(100vh - 32px); overflow-y: auto; }
.rich { line-height: 1.55; }
.preview-box, .muted-box { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; min-height: 2.5em; }
.edit-current summary, #edit-history-box summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.edit-current .rich { margin-top: 6px; }
.toolbar { gap: 6px; }
.notice.warn { background: color-mix(in srgb, var(--gold-soft) 25%, var(--surface)); border: 1px solid var(--gold-soft); }
.checks.inline { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; }
.checks.inline legend { width: 100%; }

/* ---------- proposals + messages ---------- */
.proposals { display: flex; flex-direction: column; gap: 12px; }
.proposal { display: flex; flex-direction: column; gap: 8px; }
.proposal.outdated { border-color: var(--gold-soft); }
.p-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; justify-content: space-between; }
.p-note { font-style: italic; color: var(--muted); margin: 0; }
.p-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.ok-badge { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.diff { white-space: pre-wrap; word-wrap: break-word; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; line-height: 1.6; }
.diff ins { background: color-mix(in srgb, var(--ok) 22%, transparent); text-decoration: none; border-radius: 3px; }
.diff del { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--muted); border-radius: 3px; }
.comment-box { border-top: 1px solid var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.comments { list-style: none; padding: 0; margin: 0; font-size: .9rem; display: flex; flex-direction: column; gap: 4px; }
.comment-form { display: flex; gap: 6px; }
.comment-form input { padding: 6px 10px; }
.recent > summary { cursor: pointer; font-weight: 700; }
.recent .proposals { margin-top: 10px; }
.text-blocks, .hint-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.text-blocks li, .hint-list li { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--border); padding-top: 10px; }
.tb-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.notif-preview {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--border); max-width: 420px;
}
.notif-preview img { border-radius: 8px; flex: 0 0 auto; }
.notif-preview div { display: flex; flex-direction: column; min-width: 0; }
.notif-preview span { color: var(--muted); font-size: .9rem; word-wrap: break-word; }
.draft.st-verstuurd, .draft.st-ingetrokken { opacity: .7; }

/* ---------- admin cards ---------- */
.admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.acard {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; min-height: 130px;
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow); transition: transform .1s ease, border-color .1s ease;
}
.acard:hover { transform: translateY(-2px); border-color: var(--wine); }
.acard.danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.acard.danger .acard-title { color: var(--danger); }
.acard-icon { font-size: 1.6rem; line-height: 1; }
.acard-title { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; }
.acard-sum { display: flex; flex-direction: column; gap: 2px; font-size: .88rem; color: var(--muted); width: 100%; }
.sum-line { display: block; overflow: hidden; text-overflow: ellipsis; }
.sum-line.ok { color: var(--ok); font-weight: 600; }
.sum-line.bad { color: var(--gold); font-weight: 600; }
.sum-icon { border-radius: 12px; }
.sw.mini { display: flex; width: 80px; height: 18px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.sw.mini span { flex: 1; }
.admin-detail .detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.admin-detail .detail-head h2 { margin: 0; }
.switches { width: 100%; border-collapse: collapse; }
.switches th, .switches td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.switches th { font-size: .85rem; color: var(--muted); }
.order-list { padding-left: 1.4em; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.order-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; background: var(--surface-2); border-radius: 10px; }
.wipe-groups { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .wipe-groups { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .page-beheer .tabs { flex-wrap: wrap; overflow: visible; } }

/* ---------- 1.5: text cards ---------- */
.cards-title { margin: 8px 0 10px; }
#text-cards { margin-bottom: 20px; }
.sum-line.preview-line {
  color: var(--text); white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 4px;
}
.acard.add { border-style: dashed; background: transparent; box-shadow: none; justify-content: center; }
.text-detail .detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.text-detail .detail-head h2 { margin: 0; }
.text-detail h3 { margin: 8px 0 4px; }
.hist-text { flex: 1; min-width: 0; }
