:root {
  --bg: #f3f1ec;
  --panel: #ffffff;
  --ink: #1c2321;
  --muted: #6b7672;
  --accent: #1f6f5c;
  --accent-ink: #ffffff;
  --mine: #d9efe6;
  --theirs: #ffffff;
  --line: #e1ddd4;
  --danger: #b3261e;
  --name-l: 36%;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121615;
    --panel: #1b2120;
    --ink: #e8ecea;
    --muted: #93a09b;
    --accent: #3fa68c;
    --accent-ink: #06130f;
    --mine: #1f4a3e;
    --theirs: #232a28;
    --line: #2c3432;
    --danger: #f2857d;
    --name-l: 72%;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
h1 { font-size: 1.15rem; margin: 0; }
h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.6rem 0 .6rem; }
code { background: var(--line); padding: .1em .35em; border-radius: 4px; }

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-block; border: 0; border-radius: 10px; padding: .4rem 1rem;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none;
}
.btn:disabled { opacity: .5; }
.ghost {
  border: 1px solid var(--line); border-radius: 10px; padding: .32rem .75rem;
  background: transparent; cursor: pointer;
}
.ghost.wide { width: 100%; margin-top: 2rem; }
.link {
  display: inline-block; border: 1px solid var(--line); border-radius: 10px; padding: .32rem .75rem;
  background: var(--panel); color: var(--ink); text-align: center; text-decoration: none; cursor: pointer;
}
.hint { color: var(--muted); font-size: .9rem; margin: 0 0 .8rem; }
.error { color: var(--danger); font-size: .9rem; margin: .4rem 0; }

input, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); padding: .6rem .75rem;
}

/* Inloggen */
.auth { min-height: 100%; display: grid; place-items: center; padding: 1.2rem; }
.card {
  width: 100%; max-width: 380px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 1.6rem;
}
.card h1 { font-size: 1.5rem; margin-bottom: .8rem; }
.card form { display: grid; gap: .8rem; }
.card label { display: grid; gap: .25rem; font-size: .9rem; color: var(--muted); }

/* Gesprek */
.chat, .panel {
  height: 100dvh; display: flex; flex-direction: column;
  max-width: 760px; margin: 0 auto; background: var(--bg);
}
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: calc(.6rem + env(safe-area-inset-top)) 1rem .6rem;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.list {
  flex: 1; overflow-y: auto; padding: 1rem .8rem;
  display: flex; flex-direction: column; gap: .35rem;
  overscroll-behavior: contain;
}
#older { align-self: center; margin-bottom: .6rem; border-radius: 99px; font-size: .9rem; }
.empty { margin: auto; color: var(--muted); text-align: center; }
.day {
  align-self: center; margin: .7rem 0 .3rem; padding: .15rem .7rem; border-radius: 99px;
  background: var(--line); color: var(--muted); font-size: .78rem;
}
.msg {
  max-width: 82%; align-self: flex-start; background: var(--theirs);
  border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: .45rem .7rem;
}
.msg.mine { align-self: flex-end; background: var(--mine); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.msg .who { font-size: .8rem; font-weight: 700; color: hsl(var(--h, 160) 55% var(--name-l)); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .body a.msg-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.msg img, .msg video { display: block; max-width: 100%; max-height: 340px; border-radius: 9px; margin: .2rem 0; }
.msg .meta { display: flex; gap: .7rem; justify-content: flex-end; font-size: .72rem; color: var(--muted); }
.msg .del { font-size: .72rem; color: var(--muted); }

.pill {
  position: fixed; left: 50%; bottom: 5.5rem; transform: translateX(-50%);
  border: 0; border-radius: 99px; padding: .45rem 1rem;
  background: var(--accent); color: var(--accent-ink); font-size: .85rem;
  box-shadow: 0 2px 10px rgb(0 0 0 / .25);
}

.composer {
  background: var(--panel); border-top: 1px solid var(--line);
  padding: .45rem .7rem calc(.45rem + env(safe-area-inset-bottom));
}
.composer .row { display: flex; align-items: flex-end; gap: .5rem; }
.composer textarea { resize: none; max-height: 140px; padding: .36rem .7rem; overflow-y: hidden; scrollbar-width: thin; }
.composer .photo { flex: none; }
.composer .btn { flex: none; }
.preview { display: flex; align-items: center; gap: .8rem; margin-bottom: .5rem; }
.preview img, .preview video { height: 64px; border-radius: 8px; }
/* Meer foto's tegelijk gekozen: kleine plaatjes ernaast en het aantal. */
.preview-more { display: flex; align-items: center; gap: .3rem; overflow-x: auto; max-width: 55vw; }
.preview-more img { height: 44px; width: 44px; object-fit: cover; border-radius: 6px; flex: none; }
.preview-more .count { flex: none; font-size: .85rem; color: var(--muted); padding-left: .2rem; }

.note { color: var(--accent); font-size: .9rem; margin: .4rem 0; }

/* Eigen achtergrondkleur */
.list { background: var(--chat-bg, transparent); }
.list.on-dark .empty { color: #f2f4f3; }
.list.on-light .empty { color: #1c2321; }
.swatches { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .8rem; }
.swatches button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--muted); padding: 0; background: var(--bg); }
.swatches button.default { background: linear-gradient(135deg, var(--bg) 50%, var(--panel) 50%); }
.swatches button[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }
.custom-color { display: flex; align-items: center; gap: .8rem; font-size: .9rem; color: var(--muted); }

/* Reageren en beantwoorden */
.msg { cursor: pointer; }
.msg.flash { outline: 2px solid var(--accent); outline-offset: 2px; }
.quote {
  display: grid; width: 100%; min-width: 0; margin: .15rem 0 .3rem; padding: .25rem .5rem;
  border: 0; border-left: 3px solid var(--accent); border-radius: 6px;
  background: rgb(127 127 127 / .14); color: var(--ink); font-size: .82rem; text-align: left;
}
.quote strong { font-size: .78rem; color: var(--accent); }
.quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.reacts { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .3rem; }
.reacts button {
  border: 1px solid var(--line); border-radius: 99px; background: var(--panel); color: var(--ink);
  padding: .05rem .45rem; font-size: .85rem; line-height: 1.5;
}
.reacts button.mine { border-color: var(--accent); }
.reply-bar { display: flex; align-items: center; gap: .7rem; margin-bottom: .45rem; }
.reply-bar .quote { flex: 1; margin: 0; }
.edit-bar .quote { border-left-color: var(--accent); }
.msg .meta .edited { font-style: italic; }
.sheet { position: fixed; inset: 0; z-index: 6; display: flex; align-items: flex-end; justify-content: center; background: rgb(0 0 0 / .4); }
.sheet-box {
  display: grid; gap: .7rem; width: 100%; max-width: 760px; background: var(--panel);
  border-radius: 16px 16px 0 0; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
}
.sheet-box .quote { margin: 0; }
.sheet-box .ghost { width: 100%; padding: .55rem; }
.sheet-box .link { justify-self: center; padding: .2rem; }
.react-row { display: flex; justify-content: space-between; }
.react-row button { width: 46px; height: 46px; border: 0; border-radius: 50%; background: none; font-size: 1.7rem; line-height: 1; }
.react-row button[aria-pressed="true"] { background: var(--mine); outline: 2px solid var(--accent); }

/* Foto groot bekijken */
.lightbox {
  position: fixed; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center;
  background: rgb(0 0 0 / .92); padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.lightbox img, .lightbox video { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-bar { position: absolute; top: calc(.6rem + env(safe-area-inset-top)); right: .8rem; display: flex; gap: .5rem; }
.video-frame { width: min(100%, 960px); aspect-ratio: 16 / 9; max-height: calc(100% - 5rem); }
.video-frame iframe { width: 100%; height: 100%; border: 0; background: #000; }
.msg .body a.yt-link .yt-play { display: inline-block; margin-right: .3rem; padding: 0 .35rem; border-radius: 4px; background: #e62117; color: #fff; font-size: .75em; text-decoration: none; vertical-align: .1em; }
.msg .body a.yt-link .yt-play.vimeo { background: #17a6d8; }
.lightbox-bar .ghost { background: rgb(0 0 0 / .55); border-color: rgb(255 255 255 / .45); color: #fff; text-decoration: none; font-size: 1rem; }

.note-pill {
  align-self: center; margin: 0 0 .5rem; padding: .15rem .7rem; border-radius: 99px;
  background: var(--line); color: var(--muted); font-size: .78rem; text-align: center;
}

/* Profielfoto's en accountpagina */
.avatar {
  --s: 36px; flex: none; width: var(--s); height: var(--s); border-radius: 50%; object-fit: cover;
  display: inline-grid; place-items: center; overflow: hidden;
  background: hsl(var(--h, 160) 42% 44%); color: #fff; font-weight: 700; font-size: calc(var(--s) * .4); line-height: 1;
}
.avatar-btn { flex: none; display: grid; padding: 0; border: 0; border-radius: 50%; background: none; }
.bar .actions { gap: .35rem; }
.chat .bar { gap: .5rem; padding-left: .8rem; padding-right: .8rem; }
.chat .bar .ghost { padding-left: .55rem; padding-right: .55rem; }
.chat .bar h1 { gap: .45rem; }
.form label.ghost { display: inline-block; color: var(--ink); font-size: 1rem; }
.msg .who { display: flex; align-items: center; gap: .35rem; }
.people li > .avatar { margin-right: -.3rem; }
.people li > .info { flex: 1; }
.people li.tappable { cursor: pointer; }
.profile-box { justify-items: center; text-align: center; gap: .4rem; padding-top: 1.4rem; }
.profile-box strong { font-size: 1.2rem; }
.profile-box .hint { margin: 0; }
#accountAvatar { display: grid; }

/* Hoofdmenu (drie puntjes) */
.titles { display: grid; min-width: 0; line-height: 1.2; }
.titles > * { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.titles small { font-size: .75rem; font-weight: 400; color: var(--muted); }
.menu-btn { position: relative; display: grid; place-items: center; }
.menu-btn svg { fill: currentColor; }
.menu-btn .dot { position: absolute; top: -1px; right: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--danger); border: 2px solid var(--panel); }
.sheet-box h2 { margin: .2rem 0 0; }
.menu-list { display: grid; gap: .35rem; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem; width: 100%;
  border: 1px solid var(--line); border-radius: 10px; background: transparent; padding: .6rem .8rem; text-align: left;
}
.menu-item[aria-current="true"] { border-color: var(--accent); background: var(--mine); font-weight: 600; }
.menu-item .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }

/* Kleine icoonknoppen in de berichtbalk */
.composer .row { gap: .3rem; }
.composer .row > .icon-btn {
  flex: none; display: grid; place-items: center; width: 32px; height: 36px; padding: 0;
  border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; font-size: 1.2rem; line-height: 1;
}
.composer .row > .icon-btn:hover, .composer .row > .icon-btn[aria-expanded="true"] { background: var(--line); }
.icon-btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.composer .row > .btn { margin-left: .2rem; }

.retention-box { display: grid; gap: .45rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.retention-box .hint { margin: 0; }

/* Sluiten-knop onderaan de menu's */
.sheet-box .close-btn { margin-top: .3rem; background: var(--bg); font-weight: 600; }
.profile-box .close-btn { margin-top: .8rem; }

/* Knoppen in lijsten en balken blijven compact */
.people li .link { flex: none; font-size: .9rem; }
.reply-bar .link, .preview .link { flex: none; font-size: .9rem; }
.card form .link { background: transparent; }

.field-label { display: grid; gap: .3rem; margin-bottom: .8rem; font-size: .9rem; color: var(--muted); }

/* Over deze app */
.auth { align-content: center; gap: 1rem; }
.auth-foot { display: grid; justify-items: center; gap: .5rem; color: var(--muted); font-size: .85rem; }
.auth-foot .link { font-size: .85rem; background: transparent; }
.about { display: grid; gap: 1.2rem; align-content: start; max-width: 560px; }
.about-head { display: grid; justify-items: center; gap: .3rem; padding-top: .6rem; text-align: center; }
.about .about-logo { width: 96px; height: 96px; border-radius: 22px; }
.about-name { font-size: 1.4rem; }
.about-head .hint { margin: 0; }
.about-text { margin: 0; text-align: center; }
.about section { display: grid; gap: .5rem; }
.about h2 { margin: 0; }
.about p, .about li { margin: 0; font-size: .95rem; }
.about ul { margin: 0; padding-left: 1.3rem; display: grid; gap: .35rem; }
.about a { color: var(--accent); }
textarea { resize: vertical; }

/* Leesbevestiging bij eigen berichten: rood = nog niet door iedereen gelezen, groen = wel */
.read-dot { flex: none; align-self: center; width: 9px; height: 9px; border-radius: 50%; background: #d93025; }
/* Groen krijgt ook een andere vorm (groter, met een vinkje), zodat het zonder kleur te onderscheiden is. */
.read-dot.all { position: relative; width: 15px; height: 15px; background: #1e9e55; }
.read-dot.all::after {
  content: ''; position: absolute; left: 5px; top: 2.5px; width: 3.5px; height: 7px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.sheet-box #menuRead { margin: 0; }

/* Privégesprekken */
.menu-who { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.menu-who > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.menu-item.new-dm { justify-content: center; border-style: dashed; color: var(--accent); font-weight: 600; }
.dm-people { max-height: 40vh; overflow-y: auto; }
#dmPicker .sheet-box { max-height: 92vh; overflow-y: auto; }
.guest-invite { display: grid; gap: .55rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.guest-invite h3 { margin: 0; font-size: 1rem; }
.guest-invite .hint { margin: 0; }
#guestForm, #guestBox { display: grid; gap: .5rem; }
#guestForm[hidden], #guestBox[hidden], .guest-invite[hidden] { display: none; }
#guestLink { width: 100%; }
#guestOpen:empty { display: none; }
.dm-bar {
  display: flex; align-items: center; justify-content: space-between; gap: .7rem; flex-wrap: wrap;
  background: var(--panel); border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem;
  padding: .7rem .9rem calc(.7rem + env(safe-area-inset-bottom));
}
.profile-box .wide-btn { width: 100%; max-width: 320px; padding: .55rem; }
.profile-box .wide-btn.danger { color: var(--danger); border-color: var(--danger); }

/* Startscherm met alle gesprekken; op een telefoon één scherm tegelijk, op een computer naast elkaar */
.app { display: flex; height: 100dvh; max-width: 1240px; margin: 0 auto; }
.home { display: flex; flex-direction: column; width: 100%; min-width: 0; background: var(--panel); }
.app > .chat { flex: 1; min-width: 0; max-width: none; height: 100%; margin: 0; position: relative; }
@media (max-width: 899px) {
  .app.in-chat > .home { display: none; }
  .app:not(.in-chat) > .chat { display: none; }
}
@media (min-width: 900px) {
  .home { width: 370px; flex: none; border-right: 1px solid var(--line); }
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .back-btn { display: none !important; }
}
.home .bar h1 span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.home > .empty { margin: 2rem 1.2rem; }
.home-foot { padding: .7rem .9rem calc(.7rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.home-foot .btn { width: 100%; }

.chat-row {
  display: flex; align-items: center; gap: .75rem; width: 100%; padding: .65rem .9rem;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer;
}
.chat-row:hover { background: var(--bg); }
.chat-row[aria-current="true"] { background: var(--mine); }
.chat-row .group-av { border-radius: 14px; }
.chat-mid { flex: 1; min-width: 0; display: grid; gap: .15rem; }
.chat-top, .chat-bottom { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-width: 0; }
.chat-name { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.chat-top strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 1rem; }
.new-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #1d8cf0; box-shadow: 0 0 0 2px var(--panel, #fff); }
.chat-time { flex: none; font-size: .75rem; color: var(--muted); }
.chat-preview { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .88rem; color: var(--muted); }
.chat-row.unread .chat-time { color: var(--accent); font-weight: 600; }
.chat-row.unread .chat-preview { color: var(--ink); }
.badge {
  flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  font-size: .72rem; font-weight: 700; line-height: 1;
}

/* Kopbalk van een gesprek: terug, wie, menu */
.chat-bar { gap: .4rem; }
.back-btn {
  position: relative; flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin-left: -.3rem;
  border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer;
}
.back-btn:hover { background: var(--line); }
.back-btn svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.back-btn .badge { position: absolute; top: -2px; right: -6px; min-width: 18px; height: 18px; font-size: .66rem; }
.chat-head { flex: 1; display: flex; align-items: center; gap: .55rem; min-width: 0; cursor: pointer; border-radius: 10px; }
.chat-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chat-head #chatAvatar { display: grid; }
.chat-head .group-av { border-radius: 11px; }
.pick-chat { margin: auto; }
.app > .chat .pill { position: absolute; }

.group-photo .group-av { border-radius: 14px; }

/* GIF's */
.composer .row > .gif-btn span {
  display: grid; place-items: center; height: 20px; padding: 0 4px; border: 1.8px solid currentColor; border-radius: 5px;
  font-size: .62rem; font-weight: 800; letter-spacing: .02em;
}
.msg a.is-gif { position: relative; display: inline-block; }
/* Luidsprekertje bij een bewegende GIF met geluid (MP4/WebM). */
.sound-btn { position: absolute; right: 6px; bottom: 6px; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 50%; background: rgb(0 0 0 / .55); font-size: .95rem; line-height: 1; cursor: pointer; }
.gif-item .sound-btn { right: 4px; bottom: 4px; width: 26px; height: 26px; font-size: .8rem; }
.gif-label {
  position: absolute; left: 6px; bottom: 6px; padding: 0 5px; border-radius: 4px;
  background: rgb(0 0 0 / .55); color: #fff; font-size: .65rem; font-weight: 800; line-height: 1.5;
}

/* GIF-verzameling */
.gif-box { max-height: 85vh; grid-template-rows: auto auto minmax(0, 1fr) auto auto auto; }
.gif-tabs { border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.gif-tabs button { flex: none; padding: .45rem .8rem; font-size: .9rem; white-space: nowrap; }
/* Tabbladen met een icoontje per map. */
.gif-tabs .gif-tab { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .4rem .45rem .3rem; width: 4.4rem; }
.gif-tab-icon { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 8px; overflow: hidden; background: var(--bg, #f2f2f2); }
.gif-tab-icon img, .gif-tab-icon video { width: 100%; height: 100%; object-fit: cover; }
.gif-tab-emoji { font-size: 1.6rem; line-height: 1; }
.gif-tab-icon.own { background: transparent; border-radius: 0; }
.gif-tab-icon.own img { object-fit: contain; }
.gif-tab-name { max-width: 100%; font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gif-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .4rem;
  overflow-y: auto; min-height: 120px; max-height: 52vh; overscroll-behavior: contain;
}
/* Vierkante vakjes met de "padding"-methode: aspect-ratio liet de rijen op sommige telefoons in elkaar schuiven. */
.gif-grid { align-content: start; grid-auto-rows: max-content; }
.gif-item { position: relative; height: 0; padding: 0 0 100%; border: 0; border-radius: 8px; background: var(--line); overflow: hidden; cursor: pointer; }
.gif-item img, .gif-item video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.device-gif { text-align: center; }

/* Op een telefoon: tekstvak en Stuur bovenaan over de volle breedte, de vier knoppen eronder */
@media (max-width: 600px) {
  .composer .row { flex-wrap: wrap; row-gap: .35rem; }
  .composer .row > #text { order: 1; flex: 1 1 0; min-width: 0; }
  .composer .row > #sendBtn { order: 2; margin-left: 0; }
  .composer .row > .icon-btn { order: 3; width: 44px; height: 34px; }
  .composer .row > .icon-btn:first-child { margin-left: -.3rem; }
  /* Dwingt de knoppen naar een eigen regel */
  .composer .row::after { content: ''; order: 2; flex-basis: 100%; height: 0; }
}

/* Voorvertoning van het app-icoon zoals de telefoon het rond maakt */
.icon-mask { width: 72px; height: 72px; border-radius: 50%; box-shadow: 0 1px 4px rgb(0 0 0 / .25); }

/* Hulp */
.help-btn {
  flex: none; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; font-weight: 700; font-size: 1.05rem; line-height: 1;
}
.help-btn.floating { position: fixed; top: calc(.8rem + env(safe-area-inset-top)); right: 1rem; background: var(--panel); }
.bar h1 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.help { display: grid; gap: .6rem; align-content: start; }
.help p, .help li { font-size: .95rem; margin: 0; }
.help ol, .help ul { margin: 0; padding-left: 1.3rem; display: grid; gap: .35rem; }

/* Groepen */
.tabs { display: flex; gap: .4rem; padding: .45rem .7rem; overflow-x: auto; background: var(--panel); border-bottom: 1px solid var(--line); }
.tabs button {
  flex: none; display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--line); border-radius: 99px; background: transparent; padding: .3rem .85rem; font-size: .9rem;
}
.tabs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tabs .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
.inline { display: flex; gap: .5rem; align-items: center; }
.inline input { flex: 1; min-width: 0; }
.inline button { flex: none; }
.checks { display: grid; gap: .55rem; margin: .2rem 0 .8rem; }
.checks .check { display: flex; align-items: center; gap: .6rem; color: var(--ink); font-size: 1rem; }
.groups { display: grid; gap: .6rem; }
.group { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: .2rem .8rem; }
.group summary { cursor: pointer; padding: .55rem 0; font-weight: 600; color: var(--ink); }
.group[open] { padding-bottom: .8rem; }
.group[open] > * + * { margin-top: .7rem; }
.link.danger { color: var(--danger); border-color: var(--danger); }

/* Smileys */
.composer .emoji-btn { flex: none; padding: 0 .55rem; font-size: 1.1rem; line-height: 1; }
/* Foto, smiley en Stuur even hoog, op één lijn met het tekstvak. */
.composer .row > .ghost, .composer .row > .btn { height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.composer textarea { min-height: 36px; }
.emoji-panel { margin-bottom: .5rem; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); overflow: hidden; }
.emoji-tabs { display: flex; border-bottom: 1px solid var(--line); }
.emoji-tabs button {
  flex: 1; border: 0; background: none; padding: .45rem 0; font-size: 1.25rem;
  border-bottom: 2px solid transparent;
}
.emoji-tabs button[aria-selected="true"] { border-bottom-color: var(--accent); background: var(--panel); }
.emoji-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  max-height: 190px; overflow-y: auto; padding: .3rem; overscroll-behavior: contain;
}
.emoji-grid button { border: 0; background: none; border-radius: 8px; padding: .25rem 0; font-size: 1.6rem; line-height: 1.25; }
.emoji-grid button:hover, .emoji-grid button:active { background: var(--line); }

/* Logo */
.logo { width: 28px; height: 28px; object-fit: contain; border-radius: 7px; flex: none; }
.logo.big { width: 72px; height: 72px; border-radius: 16px; }
.card > .logo { display: block; margin-bottom: .8rem; }
.bar h1 { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.bar .actions { display: flex; gap: .5rem; flex: none; }

/* Beheer */
.form { display: grid; gap: 1rem; max-width: 460px; }
.form h2 { margin: .8rem 0 0; }
.form label, .form .field { display: grid; gap: .3rem; font-size: .9rem; color: var(--muted); }
.form .hint { margin: 0; }
.logo-row { display: flex; align-items: center; gap: 1rem; }
.logo-actions { display: grid; gap: .6rem; justify-items: start; }
input[type="checkbox"] { width: 1.15rem; height: 1.15rem; padding: 0; flex: none; accent-color: var(--accent); }
.form label.check { display: flex; align-items: center; gap: .6rem; color: var(--ink); font-size: 1rem; }
.form .btn, .form .ghost { justify-self: start; }
.form .link { justify-self: start; }
#totpSecret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; padding-inline: .5rem; }
input[type="color"] { width: 64px; height: 44px; padding: 4px; cursor: pointer; }

/* Leden */
.panel { position: fixed; inset: 0; z-index: 5; }
.panel-body { flex: 1; overflow-y: auto; padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom)); }
.people { list-style: none; margin: 0; padding: 0; }
.people li {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 0; border-bottom: 1px solid var(--line);
}
.people .info { display: grid; min-width: 0; }
.people .info span { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
#inviteBox { margin-top: .9rem; display: grid; gap: .5rem; }

/* Na de verhuizing: welkom op het inlogscherm */
.moved-note { display: grid; gap: .2rem; margin: 0 0 .9rem; padding: .7rem .8rem; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text, inherit); font-size: .92rem; text-align: left; }
.moved-note[hidden] { display: none; }

/* Linkvoorbeeld onder een bericht */
.link-card { display: block; margin: .35rem 0 .1rem; border-radius: 10px; overflow: hidden; background: rgb(0 0 0 / .05);
  border-left: 3px solid var(--accent); color: inherit; text-decoration: none; max-width: 320px; }
.link-pic { position: relative; display: block; background: rgb(0 0 0 / .06); }
.link-pic img { display: block; width: 100%; max-height: 180px; object-fit: cover; }
.link-play { position: absolute; inset: 0; margin: auto; width: 52px; height: 36px; border-radius: 10px; background: rgb(0 0 0 / .65);
  color: #fff; display: grid; place-items: center; font-size: 1.1rem; }
.link-text { display: grid; gap: .1rem; padding: .45rem .6rem .5rem; }
.link-title { font-size: .9rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-desc { font-size: .8rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-site { font-size: .75rem; color: var(--muted); }
.link-site:empty { display: none; }

/* Doorsturen */
.forward-list { max-height: 50vh; overflow-y: auto; }
.forward-row { display: flex; align-items: center; gap: .7rem; padding: .45rem .2rem; cursor: pointer; }
.forward-row input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); flex: none; }
.forward-row.done .forward-name::after { content: ' ✓ doorgestuurd'; color: var(--accent); font-size: .85em; }
.forward-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .fwd { font-size: .78rem; font-style: italic; color: var(--muted); margin-bottom: .15rem; }

/* Bellen */
.call-start svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chat-bar .actions { display: flex; gap: .35rem; }
.call-screen { position: fixed; inset: 0; z-index: 1000; background: #101716; color: #fff; display: grid;
  grid-template-rows: 1fr auto auto; justify-items: center; padding: max(1.2rem, env(safe-area-inset-top)) 1rem calc(1.4rem + env(safe-area-inset-bottom)); overflow: hidden; }
.call-screen[hidden] { display: none; }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; opacity: 0; pointer-events: none; }
.call-screen.video.connected .call-remote { opacity: 1; }
.call-screen:not(.video) .call-remote { width: 1px; height: 1px; } /* alleen geluid */
.call-local { position: absolute; right: 2rem; top: max(1rem, env(safe-area-inset-top)); width: 28vw; max-width: 160px; aspect-ratio: 3 / 4;
  object-fit: cover; border-radius: 12px; background: #222; box-shadow: 0 4px 16px rgb(0 0 0 / .5); transform: scaleX(-1); z-index: 2;
  touch-action: none; cursor: grab; transition: left .2s, top .2s, right .2s, bottom .2s; }
/* Het eigen beeld kan naar elke hoek worden gesleept; ruim van de rand, zodat de terug-veeg van de telefoon niet afgaat. */
.call-local.pos-tl { left: 2rem; right: auto; }
.call-local.pos-bl { left: 2rem; right: auto; top: auto; bottom: calc(8rem + env(safe-area-inset-bottom)); }
.call-local.pos-br { top: auto; bottom: calc(8rem + env(safe-area-inset-bottom)); }
.call-local.dragging { transition: none; cursor: grabbing; box-shadow: 0 8px 24px rgb(0 0 0 / .6); }
.call-local[hidden] { display: none; }
.call-info { position: relative; z-index: 1; align-self: center; display: grid; justify-items: center; gap: .5rem; text-align: center; }
.call-info strong { font-size: 1.5rem; }
.call-status { font-size: 1rem; opacity: .85; font-variant-numeric: tabular-nums; }
.call-tip { max-width: 300px; margin-top: .6rem; font-size: .85rem; line-height: 1.4; opacity: .8; }
.call-tip[hidden] { display: none; }
.call-avatar .avatar { box-shadow: 0 0 0 6px rgb(255 255 255 / .08); }
.call-screen.video.connected .call-info { align-self: start; margin-top: .5rem; text-shadow: 0 1px 4px rgb(0 0 0 / .8); }
.call-screen.video.connected .call-avatar { display: none; }
/* De ander heeft de app even verlaten of zijn camera staat stil: foto en naam in plaats van een zwart beeld. */
.call-screen.video.connected.remote-off .call-remote { opacity: 0; }
.call-screen.video.connected.remote-off .call-avatar { display: block; }
.call-screen.video.connected.remote-off .call-info { align-self: center; margin-top: 0; }
.call-note { position: relative; z-index: 1; margin: 0 0 1rem; padding: .4rem .8rem; border-radius: 8px; background: rgb(0 0 0 / .5); font-size: .9rem; text-align: center; }
.call-note[hidden] { display: none; }
.call-controls { position: relative; z-index: 1; display: flex; gap: 1.1rem; justify-content: center; flex-wrap: wrap; }
.call-controls[hidden] { display: none; }
.call-btn { width: 62px; height: 62px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgb(255 255 255 / .16); color: #fff; cursor: pointer; }
.call-btn[hidden] { display: none; }
.call-btn svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.call-btn .slash { display: none; }
.call-btn[aria-pressed="true"] { background: #fff; color: #101716; }
.call-btn[aria-pressed="true"] .slash { display: inline; }
.call-btn.hangup { background: #e53935; }
.call-btn.hangup svg { fill: currentColor; stroke: none; }
.call-btn.accept { background: #22a55b; }
#callIncoming .call-btn { width: 70px; height: 70px; }
#callIncoming .call-btn { position: relative; margin-bottom: 1.4rem; }
#callIncoming .call-btn::after { content: attr(title); position: absolute; top: calc(100% + .35rem); left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: .8rem; opacity: .85; }

/* Bellen voorbereiden */
.prep-list { list-style: none; margin: .2rem 0 .8rem; padding: 0; display: grid; gap: .35rem; }
.prep-list li { display: flex; align-items: center; gap: .55rem; font-size: .95rem; }
.prep-mark { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--line); }
.prep-list li.ok .prep-mark { background: #1f9d55; color: #fff; }
.prep-list li.bad .prep-mark { background: #d64541; color: #fff; }
#callPrep[hidden] { display: none; }

/* Bellen vanuit een profiel */
.profile-calls { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; width: 100%; max-width: 320px; }
.profile-calls button { padding: .55rem; }
.profile-calls[hidden] { display: none; }
.profile-calls button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.profile-calls svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

/* Mijn notities in de keuzelijst */
.notes-text { display: grid; text-align: left; line-height: 1.25; }
.notes-text small { font-size: .78rem; }

/* Updates in Beheer */
.upd-result { display: grid; gap: .5rem; padding: .8rem; border-radius: 10px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.upd-result[hidden] { display: none; }
.upd-result p { margin: 0; }
.upd-ok { color: var(--accent); font-weight: 600; }
.upd-new { font-weight: 700; }
#updates h3 { font-size: .95rem; margin: 1rem 0 .3rem; }

/* Eigen kleur voor je eigen berichten */
.mine-dark .msg.mine { color: #fff; }
.mine-dark .msg.mine .meta, .mine-dark .msg.mine .fwd { color: rgb(255 255 255 / .8); }
.mine-dark .msg.mine a, .mine-dark .msg.mine .link-site, .mine-dark .msg.mine .link-desc { color: #fff; }
.mine-dark .msg.mine .quote, .mine-dark .msg.mine .link-card { background: rgb(255 255 255 / .16); color: #fff; }
.mine-light .msg.mine { color: #1f2933; }
.mine-light .msg.mine .meta, .mine-light .msg.mine .fwd { color: #5b6670; }
.bubble-preview { display: flex; flex-direction: column; gap: .4rem; padding: .7rem; border-radius: 12px; background: var(--chat-bg, var(--bg)); margin: .3rem 0 .6rem; }
.bubble-preview .msg { max-width: 75%; padding: .45rem .7rem; }
#bubbleSwatches { margin-top: .2rem; }
#account .swatches + .custom-color + .hint { margin-top: 1rem; }

/* Eigen achtergrondafbeelding */
.list.has-wall, .bubble-preview.has-wall { background: var(--wall) center / cover no-repeat, var(--chat-bg, var(--bg)); }
.list.wall-dim, .bubble-preview.wall-dim { background: linear-gradient(rgb(255 255 255 / .45), rgb(255 255 255 / .45)), var(--wall) center / cover no-repeat; }
@media (prefers-color-scheme: dark) {
  .list.wall-dim, .bubble-preview.wall-dim { background: linear-gradient(rgb(0 0 0 / .45), rgb(0 0 0 / .45)), var(--wall) center / cover no-repeat; }
}
.list.has-wall .empty { background: rgb(255 255 255 / .85); color: #1c2321; padding: .4rem .8rem; border-radius: 10px; }
.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: .5rem; margin-bottom: .7rem; }
/* Staande vakjes (3:4) met de "padding"-methode, net als bij de GIF's: werkt op alle telefoons. */
.wall-grid { align-content: start; grid-auto-rows: max-content; }
.wall-tile { position: relative; height: 0; padding: 0 0 133%; border-radius: 10px; border: 1px solid var(--line); cursor: pointer;
  background: center / cover no-repeat var(--panel); overflow: hidden; }
.wall-tile .wall-label { position: absolute; left: 0; right: 0; bottom: 0; }
.wall-tile.plain .wall-label { top: 50%; bottom: auto; transform: translateY(-50%); }
.wall-tile[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }
.wall-label { width: 100%; padding: .2rem .25rem; font-size: .72rem; line-height: 1.2; text-align: center; background: rgb(0 0 0 / .45); color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wall-tile.plain .wall-label { background: none; color: inherit; white-space: normal; font-size: .82rem; }
#wallDimRow[hidden] { display: none; }
.list.has-wall .day, .list.has-wall .note-pill { background: rgb(255 255 255 / .88); color: #39434b; }
#wallDimRow { margin-bottom: 1rem; }

/* Een scherm open (menu, leden, account, beheer, hulp…): wat eronder ligt vervaagt en wordt iets donkerder. */
#app, #auth { transition: filter .2s ease; }
body.layer-open #app, body.layer-open #auth { filter: blur(6px) brightness(.82); pointer-events: none; }
@media (min-width: 761px) {
  /* Op een groot scherm staat een paneel in het midden: geef het een duidelijke rand. */
  .panel { box-shadow: 0 0 0 1px var(--line), 0 10px 40px rgb(0 0 0 / .25); }
}
@media (prefers-reduced-motion: reduce) { #app, #auth { transition: none; } }

.emoji-close { display: block; width: 100%; border: 0; border-top: 1px solid var(--line); background: var(--panel); padding: .5rem; font-weight: 600; cursor: pointer; }

/* Meldingsvoorkeuren */
.notify-prefs { display: grid; gap: .35rem; margin-top: .8rem; }
.notify-prefs .hint { margin: -.15rem 0 .2rem 1.9rem; font-size: .82rem; }
.notify-prefs .hint:empty { display: none; }
.notify-prefs input:disabled + * , .notify-prefs label:has(input:disabled) { opacity: .6; }

/* Melding "bijgewerkt naar versie …" na automatisch herladen. */
.update-toast { position: fixed; left: 50%; bottom: calc(5.5rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200;
  background: #1f2933; color: #fff; padding: .55rem 1rem; border-radius: 999px; font-size: .9rem; box-shadow: 0 4px 14px rgb(0 0 0 / .25);
  transition: opacity .5s; max-width: calc(100% - 2rem); text-align: center; }
.update-toast.gone { opacity: 0; }

/* Bijlagen (documenten): klaarzetten onder het tekstvak en als kaartje in het gesprek. */
.file-preview { display: flex; align-items: center; gap: .7rem; margin-bottom: .5rem; padding: .5rem .7rem; border: 1px solid var(--line, #e4e7eb); border-radius: 10px; background: var(--panel, #fff); }
.file-preview[hidden] { display: none; }
.file-preview .file-info { flex: 1; min-width: 0; display: grid; }
.file-preview strong { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview small { color: var(--muted); font-size: .8rem; }
.file-icon { font-size: 1.4rem; }
.msg a.file-card { display: flex; align-items: center; gap: .65rem; margin: .2rem 0; padding: .55rem .7rem; border-radius: 9px;
  background: rgb(0 0 0 / .05); color: inherit; text-decoration: none; min-width: 190px; max-width: 100%; }
.msg a.file-card .file-badge { flex: none; display: grid; place-items: center; width: 38px; height: 44px; border-radius: 6px; background: var(--accent); color: var(--accent-ink, #fff);
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.msg a.file-card .file-text { min-width: 0; display: grid; }
.msg a.file-card .file-text strong { font-size: .92rem; overflow-wrap: anywhere; }
.msg a.file-card .file-text small { font-size: .78rem; opacity: .75; }
.mine-dark .msg.mine a.file-card { background: rgb(255 255 255 / .15); }

/* Beheer: mappen van de GIF-verzameling. */
.gif-folders { display: grid; gap: .5rem; }
.gif-folder { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: center; padding: .55rem .6rem; border: 1px solid var(--line); border-radius: 10px; }
.gif-folder .gif-tab-icon { width: 2.6rem; height: 2.6rem; }
.gif-folder .gf-text { min-width: 0; display: grid; }
.gif-folder .gf-text strong { overflow-wrap: anywhere; }
.gif-folder .gf-text small { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.gif-folder .gf-move { display: flex; gap: .2rem; }
.gif-folder .gf-move button { width: 2rem; height: 2rem; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); }
.gif-folder .gf-move button:disabled { opacity: .35; }
.gif-folder .gf-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.gif-folder .gf-rename { grid-column: 1 / -1; display: flex; gap: .4rem; }
.gif-folder .gf-rename input { flex: 1; min-width: 0; }
.gif-new { display: grid; gap: .5rem; margin-top: .4rem; }
.gif-icon-pick { text-align: center; }

/* Een bewegend WebP-plaatje zonder tekst: geen ballon, zodat doorzichtig ook doorzichtig is (zoals een sticker). */
.msg.sticker { background: transparent; border-color: transparent; box-shadow: none; padding: 0; }
.msg.sticker img { margin: 0; border-radius: 0; max-height: 200px; }
.msg.sticker .gif-label { display: none; }
.msg.sticker .who, .msg.sticker .fwd { display: block; width: fit-content; margin-bottom: .2rem; padding: .05rem .45rem; border-radius: 6px; background: var(--theirs); }
.msg.sticker .meta { justify-content: flex-end; margin-top: .15rem; }
.msg.sticker .meta > span:not(.read-dot) { padding: 0 .4rem; border-radius: 6px; background: rgb(0 0 0 / .4); color: #fff; }
.gif-item.loaded { background: transparent; }

/* Mijn account: account verwijderen. */
.delete-account { margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.delete-account ul { margin: .3rem 0 .6rem 1.1rem; padding: 0; }
.btn.danger-btn { background: var(--danger); border-color: var(--danger); color: #fff; }

/* Groepen die een lid zelf heeft gemaakt. */
.owner-tools { margin-top: 1.2rem; padding-top: .8rem; border-top: 1px solid var(--line); display: grid; gap: .5rem; }
.owner-tools h3 { margin: .6rem 0 0; font-size: .95rem; }
.owner-photo { text-align: center; }
.people .remove-member { margin-left: auto; }
#noticeList .notice { margin-bottom: .9rem; }
#noticeList .notice h2 { margin: 0 0 .35rem; font-size: 1.05rem; text-transform: none; letter-spacing: 0; color: inherit; }
.notice-ok { width: 100%; margin-top: .4rem; }
#noticeList .notice p { margin: 0; white-space: pre-line; }
#noticeList .notice small { color: var(--muted); }

/* Balkje bovenin als de server even niet bereikbaar is. */
.offline-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 300; padding: calc(.25rem + env(safe-area-inset-top)) .8rem .25rem;
  background: #b45309; color: #fff; font-size: .8rem; line-height: 1.3; text-align: center; box-shadow: 0 2px 8px rgb(0 0 0 / .2); }
.offline-bar[hidden] { display: none; }

/* Beheer: woordfilter als tabel. */
.wf-table { width: 100%; border-collapse: collapse; margin: .6rem 0; }
.wf-table th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: .3rem .4rem; border-bottom: 1px solid var(--line); }
.wf-table td { padding: .45rem .4rem; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.wf-table td:last-child { text-align: right; white-space: nowrap; width: 1%; }
.wf-table .wf-from { font-weight: 600; }
.wf-table .wf-to.auto { color: var(--muted); font-style: italic; }
.wf-add { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.wf-add .btn { grid-column: 1 / -1; }
.wf-result { min-height: 1.4em; margin: .4rem 0 0; font-weight: 600; overflow-wrap: anywhere; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Beheer: elk onderdeel op één regel (titel en uitleg links, knop rechts), gescheiden door een lijn. */
.admin-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .8rem; padding: .85rem 0; border-top: 2px solid var(--line); }
.form > .admin-row + .admin-row { margin-top: -1rem; } /* de tussenruimte van het formulier niet dubbel tellen */
.form > .admin-row:last-of-type { margin-bottom: -.2rem; }
.admin-row .admin-text { min-width: 0; }
.admin-row .admin-text h2 { margin: 0 0 .15rem; }
.admin-row .admin-text .hint { margin: 0; }
.admin-row .admin-open { min-width: 6.5rem; white-space: nowrap; justify-self: end; }
#settings .panel-body > .form > h2:first-child, #settings .panel-body > section#updates > h2 { margin-top: 0; }
#settings section#updates, #settings form.form:has(> #twofaBox), #settings .twofa { border-top: 2px solid var(--line); padding-top: .85rem; }
#settings .panel-body > section#updates { margin-bottom: 1.2rem; }

/* Knoppen boven een grote foto: altijd binnen het scherm, ook op een smal scherm of met grote letters.
   Ze krimpen mee met de breedte; is het echt te krap, dan wordt een woord netjes afgekapt. */
.lightbox-bar { left: .5rem; right: .5rem; justify-content: flex-end; gap: .4rem; }
.lightbox-bar .ghost { flex: 0 1 auto; min-width: 0; padding: .45rem min(.9rem, 2.2vw);
  font-size: min(1rem, 3.7vw); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
/* Op een telefoon staan de knoppen boven een foto in het midden; op een groot scherm rechts. */
@media (max-width: 700px) { .lightbox-bar { justify-content: center; } }
