/* SHS Messenger — ontwerpsysteem: moderne Messenger, verfrist Y2K.
   Alle kleuren via variabelen zodat Werkplaats-thema's alles kunnen restylen. */

:root {
  --font: "Segoe UI", "Segoe UI Variable Text", Tahoma, system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", Tahoma, system-ui, Roboto, Arial, sans-serif;
  --font-mono: Consolas, "Cascadia Mono", "Courier New", monospace;

  /* hemel */
  --sky-0: #f6fbff;
  --sky-1: #e6f2fe;
  --sky-2: #cfe4fb;
  --sky-3: #a9cdf3;
  --sky-4: #79afe8;

  /* merk */
  --blue: #2f7fd6;
  --blue-d: #1d5fae;
  --blue-dd: #154a8a;
  --blue-l: #5aa7f2;
  --navy: #0f2e4f;
  --petal-y: #ffc23a;
  --petal-o: #ff7a45;
  --petal-g: #3ebf68;
  --petal-b: #2f95f2;

  /* tekst */
  --ink: #15304f;
  --ink-2: #3a5574;
  --muted: #66809e;
  --faint: #93a8c0;
  --on-blue: #ffffff;
  --link: #1f6fc9;

  /* vlakken */
  --glass: rgba(255, 255, 255, 0.74);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --glass-soft: rgba(255, 255, 255, 0.55);
  --panel: #ffffff;
  --panel-2: #f3f8fe;
  --panel-3: #e8f1fc;
  --line: rgba(31, 95, 174, 0.16);
  --line-2: rgba(31, 95, 174, 0.28);
  --hover: rgba(47, 127, 214, 0.09);
  --active: rgba(47, 127, 214, 0.16);
  --sel: linear-gradient(180deg, #e9f4ff 0%, #d3e8ff 100%);
  --sel-line: #8fbdf0;

  /* status */
  --st-online: #39c050;
  --st-idle: #f5a623;
  --st-dnd: #e5414a;
  --st-offline: #9aa6b4;

  --ok: #2f9e54;
  --warn: #d98a12;
  --bad: #d23b44;
  --mention: rgba(255, 194, 58, 0.18);
  --mention-line: #f0b429;

  /* glans */
  --gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.25) 48%, rgba(255, 255, 255, 0) 52%);
  --title: linear-gradient(180deg, #6bb5f8 0%, #3a8ce6 48%, #2a78d2 52%, #2f84de 100%);
  --title-ink: #ffffff;

  --r-xs: 6px;
  --r-s: 9px;
  --r: 14px;
  --r-l: 20px;
  --shadow-s: 0 1px 2px rgba(17, 62, 120, 0.12), 0 2px 8px rgba(17, 62, 120, 0.08);
  --shadow: 0 8px 28px rgba(17, 62, 120, 0.16), 0 1px 3px rgba(17, 62, 120, 0.1);
  --shadow-l: 0 24px 60px rgba(12, 46, 96, 0.28), 0 2px 8px rgba(12, 46, 96, 0.12);
  --blur: saturate(160%) blur(18px);

  --backdrop: radial-gradient(1200px 700px at 12% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 60%),
              radial-gradient(900px 600px at 105% 110%, rgba(126, 198, 255, 0.55) 0%, rgba(126, 198, 255, 0) 60%),
              linear-gradient(180deg, #eaf4ff 0%, #d4e8fd 55%, #bcdaf8 100%);
  --scene-waves: url("/assets/img/backdrop.svg");

  --anim: 1;
  color-scheme: light;
}

/* donker thema (instelling) */
:root[data-theme="nacht"] {
  --sky-0: #0f1b2b; --sky-1: #13233a; --sky-2: #1a2e4b; --sky-3: #22406a; --sky-4: #2b5590;
  --ink: #e6f0ff; --ink-2: #c3d4ee; --muted: #8fa6c6; --faint: #6c84a6; --link: #7cc0ff;
  --glass: rgba(18, 32, 54, 0.78); --glass-strong: rgba(20, 36, 60, 0.92); --glass-soft: rgba(24, 42, 70, 0.6);
  --panel: #142640; --panel-2: #172b48; --panel-3: #1c3456;
  --line: rgba(124, 180, 255, 0.14); --line-2: rgba(124, 180, 255, 0.26);
  --hover: rgba(124, 180, 255, 0.08); --active: rgba(124, 180, 255, 0.16);
  --sel: linear-gradient(180deg, #1f3d66 0%, #1a3459 100%); --sel-line: #3c6fb0;
  --gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.06) 48%, rgba(255, 255, 255, 0) 52%);
  --backdrop: radial-gradient(1000px 600px at 10% -10%, #24456f 0%, rgba(36, 69, 111, 0) 60%),
              radial-gradient(900px 600px at 105% 110%, rgba(47, 127, 214, 0.35) 0%, rgba(47, 127, 214, 0) 60%),
              linear-gradient(180deg, #0f1c2e 0%, #0c1726 100%);
  --mention: rgba(255, 194, 58, 0.12);
  color-scheme: dark;
}

:root[data-motion="laag"] { --anim: 0; }
:root[data-motion="laag"] *, :root[data-motion="laag"] *::before, :root[data-motion="laag"] *::after {
  animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--backdrop);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  overscroll-behavior: none;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: var(--scene-waves) center bottom / cover no-repeat; opacity: .9;
}
:root[data-theme="nacht"] body::before { opacity: .25; }
:root[data-font="groot"] body { font-size: 15.5px; }
:root[data-font="klein"] body { font-size: 13px; }

button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
::selection { background: rgba(47, 127, 214, 0.25); }
[hidden] { display: none !important; }

/* schuifbalken in Windows-stijl, maar slank */
* { scrollbar-width: thin; scrollbar-color: rgba(47, 127, 214, 0.35) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #a9cdf3, #79afe8); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.mono { font-family: var(--font-mono); }

/* ------------------------------------------------------------------ glas en vensters */

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-radius: var(--r);
}
:root[data-theme="nacht"] .glass { border-color: rgba(124, 180, 255, 0.12); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05); }

.titlebar {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  min-height: 42px; padding: 6px 12px;
  background: var(--title);
  color: var(--title-ink);
  text-shadow: 0 1px 1px rgba(10, 50, 110, 0.45);
  border-bottom: 1px solid rgba(10, 60, 130, 0.35);
}
.titlebar::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.08)); pointer-events: none;
}
.titlebar > * { position: relative; z-index: 1; }

/* ------------------------------------------------------------------ knoppen */

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 5px 14px;
  border: 1px solid #9cbfe6;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #eef5fd 48%, #e1ecf9 52%, #eaf2fc 100%);
  color: var(--blue-dd);
  font-weight: 600; font-size: 13px; line-height: 1.1;
  cursor: pointer; user-select: none; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(17, 62, 120, 0.15), inset 0 1px 0 #fff;
  transition: filter .12s, transform .06s, box-shadow .12s;
}
.btn:hover { filter: brightness(1.04); box-shadow: 0 2px 8px rgba(47, 127, 214, 0.25), inset 0 1px 0 #fff; }
.btn:active { transform: translateY(1px); filter: brightness(.97); }
.btn:focus-visible { outline: 2px solid var(--petal-b); outline-offset: 2px; }
.btn[disabled] { opacity: .5; cursor: default; pointer-events: none; }
.btn .ic { width: 16px; height: 16px; }

.btn.primary {
  color: #fff; border-color: #1b5fae;
  background: linear-gradient(180deg, #7cc0ff 0%, #3f93ea 46%, #2477d6 52%, #2f86e2 100%);
  text-shadow: 0 1px 1px rgba(10, 50, 110, 0.5);
  box-shadow: 0 2px 6px rgba(31, 111, 201, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.btn.green { color: #fff; border-color: #23843f; background: linear-gradient(180deg, #8ee59a 0%, #45c25f 46%, #2ea64a 52%, #3cb556 100%); text-shadow: 0 1px 1px rgba(10, 70, 30, 0.5); box-shadow: 0 2px 6px rgba(46, 166, 74, .35), inset 0 1px 0 rgba(255,255,255,.55); }
.btn.red { color: #fff; border-color: #a8252d; background: linear-gradient(180deg, #ff9a9f 0%, #ef4d56 46%, #d8333c 52%, #e5444d 100%); text-shadow: 0 1px 1px rgba(90, 10, 15, 0.5); box-shadow: 0 2px 6px rgba(216, 51, 60, .35), inset 0 1px 0 rgba(255,255,255,.5); }
.btn.orange { color: #fff; border-color: #c4621e; background: linear-gradient(180deg, #ffc48f 0%, #ff8d40 46%, #f2742a 52%, #ff8338 100%); text-shadow: 0 1px 1px rgba(110, 45, 5, 0.5); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); }
.btn.small { min-height: 26px; padding: 3px 10px; font-size: 12px; }
.btn.big { min-height: 40px; padding: 8px 22px; font-size: 15px; }
.btn.block { width: 100%; }
:root[data-theme="nacht"] .btn:not(.primary):not(.green):not(.red):not(.orange):not(.ghost) {
  background: linear-gradient(180deg, #2a4a74 0%, #213d62 50%, #1c3456 52%, #22406a 100%); border-color: #3c6fb0; color: #dbeaff; box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

/* ronde glazen pictogramknop */
.ibtn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 50%; border: 1px solid transparent; background: transparent;
  color: var(--ink-2); cursor: pointer;
  transition: background .12s, border-color .12s, transform .06s;
}
.ibtn:hover { background: linear-gradient(180deg, #ffffff, #e4effc); border-color: #a9cbef; box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(17, 62, 120, .15); color: var(--blue-d); }
.ibtn:active { transform: scale(.95); }
.ibtn.on { background: linear-gradient(180deg, #e3f0ff, #c9e1fd); border-color: #8fbdf0; color: var(--blue-dd); }
.ibtn.danger.on { background: linear-gradient(180deg, #ffe1e3, #ffc4c8); border-color: #ef8d93; color: var(--bad); }
.ibtn .ic { width: 19px; height: 19px; }
.ibtn.small { width: 28px; height: 28px; }
.ibtn.small .ic { width: 16px; height: 16px; }
:root[data-theme="nacht"] .ibtn:hover { background: linear-gradient(180deg, #2a4a74, #1f3a60); border-color: #3c6fb0; color: #cfe4ff; }

.ic { width: 18px; height: 18px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }

/* ------------------------------------------------------------------ invoer */

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.input, .textarea, .select {
  width: 100%;
  min-height: 36px; padding: 7px 11px;
  border: 1px solid #b6cfe9; border-radius: 10px;
  background: linear-gradient(180deg, #f4f8fd 0%, #ffffff 30%);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(17, 62, 120, 0.08);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.textarea { resize: vertical; min-height: 80px; line-height: 1.45; }
.input:focus, .textarea:focus, .select:focus { border-color: #5aa7f2; box-shadow: 0 0 0 3px rgba(90, 167, 242, 0.22), inset 0 1px 2px rgba(17, 62, 120, 0.06); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input.with-icon { padding-left: 36px; }
.input-wrap { position: relative; }
.input-wrap > .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-wrap > .suffix { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
:root[data-theme="nacht"] .input, :root[data-theme="nacht"] .textarea, :root[data-theme="nacht"] .select { background: #0f1f35; border-color: #2e4f7d; }

.check { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); margin: 0; }

/* schakelaar */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: linear-gradient(180deg, #c9d6e4, #dfe7f1); border: 1px solid #a9b9cc; transition: background .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(180deg, #fff, #e6eef7); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: linear-gradient(180deg, #5fd16f, #2fae47); border-color: #23843f; }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--petal-b); outline-offset: 2px; }

.range { width: 100%; accent-color: var(--blue); }

/* ------------------------------------------------------------------ weergaveafbeelding met statuskader */

.dp {
  --size: 40px;
  --frame: var(--st-offline);
  position: relative; flex: 0 0 auto;
  width: var(--size); height: var(--size);
  border-radius: calc(var(--size) * 0.22);
  padding: max(2px, calc(var(--size) * 0.06));
  background:
    linear-gradient(180deg, rgba(255,255,255,.75) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--frame) 55%, white) 0%, var(--frame) 60%, color-mix(in srgb, var(--frame) 80%, black) 100%);
  box-shadow: 0 1px 3px rgba(17, 62, 120, 0.3), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.dp > .pic {
  width: 100%; height: 100%;
  border-radius: calc(var(--size) * 0.16);
  overflow: hidden; background: #fff; position: relative;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.dp > .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dp > .pic .ini { font-weight: 700; color: #fff; font-size: calc(var(--size) * 0.36); letter-spacing: .5px; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.dp > .pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,0) 45%); pointer-events: none; }
.dp.online { --frame: var(--st-online); }
.dp.idle { --frame: var(--st-idle); }
.dp.dnd { --frame: var(--st-dnd); }
.dp.offline { --frame: var(--st-offline); }
.dp.blue { --frame: var(--blue); }
.dp.xs { --size: 24px; }
.dp.s { --size: 32px; }
.dp.m { --size: 40px; }
.dp.l { --size: 56px; }
.dp.xl { --size: 84px; }
.dp.xxl { --size: 120px; }
.dp.speaking { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--st-online), 0 0 14px rgba(57, 192, 80, .8); }

/* statusbolletje */
.orb { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; display: inline-block; background: radial-gradient(circle at 35% 30%, #fff 0 18%, var(--c, var(--st-offline)) 45%); box-shadow: 0 0 0 1.5px rgba(255,255,255,.9), 0 1px 2px rgba(0,0,0,.25); }
.orb.online { --c: var(--st-online); }
.orb.idle { --c: var(--st-idle); }
.orb.dnd { --c: var(--st-dnd); }
.orb.offline { --c: var(--st-offline); }

/* serverpictogram (glazen bol) */
.sicon {
  --size: 46px; --bg: var(--blue);
  position: relative; flex: 0 0 auto;
  width: var(--size); height: var(--size); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--bg) 70%, white) 0%, var(--bg) 55%, color-mix(in srgb, var(--bg) 70%, black) 100%);
  color: #fff; font-weight: 700; font-size: calc(var(--size) * .34); text-shadow: 0 1px 2px rgba(0,0,0,.3);
  box-shadow: 0 2px 6px rgba(17, 62, 120, 0.3), inset 0 -2px 6px rgba(0,0,0,.15);
}
.sicon img { width: 100%; height: 100%; object-fit: cover; }
.sicon::after { content: ""; position: absolute; left: 12%; right: 12%; top: 4%; height: 46%; border-radius: 50%; background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,.05)); pointer-events: none; }
.sicon.s { --size: 32px; }
.sicon.l { --size: 72px; }

/* ------------------------------------------------------------------ badges en labels */

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #ff6b73, #e0313b);
  box-shadow: 0 1px 2px rgba(150, 20, 30, .4), inset 0 1px 0 rgba(255,255,255,.4);
}
.badge.blue { background: linear-gradient(180deg, #6db6ff, #2477d6); }
.badge.green { background: linear-gradient(180deg, #6fe07f, #2ea64a); }
.badge.grey { background: linear-gradient(180deg, #b9c6d6, #8a9bb0); }
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
  background: var(--panel-3); color: var(--blue-d); border: 1px solid var(--line);
}
.tag.bot { background: linear-gradient(180deg, #6db6ff, #2477d6); color: #fff; border: 0; }
.tag.staff { background: linear-gradient(180deg, #ffd36b, #f2a91a); color: #5a3a00; border: 0; }
.tag.ts { background: linear-gradient(180deg, #5d6c86, #364459); color: #fff; border: 0; }
.tag.free { background: #eef6ee; color: #2f7a41; border-color: #bfe0c6; }
.tag.full { background: linear-gradient(180deg, #8ee59a, #2ea64a); color: #fff; border: 0; }

.divider { height: 1px; background: var(--line); margin: 8px 0; border: 0; }
.kbd { font-family: var(--font-mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: var(--panel); }

/* ------------------------------------------------------------------ menu's en tooltips */

.menu {
  position: fixed; z-index: 1000; min-width: 200px; max-width: 300px; padding: 5px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid rgba(47, 127, 214, 0.25); border-radius: 12px;
  box-shadow: var(--shadow-l);
  animation: menu-in .12s ease-out;
  user-select: none;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.menu .mi {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 10px; border: 0; border-radius: 8px; background: none; text-align: left;
  color: var(--ink); font-size: 13px; cursor: pointer;
}
.menu .mi .ic { width: 16px; height: 16px; color: var(--muted); }
.menu .mi:hover, .menu .mi.focus { background: var(--title); color: #fff; }
.menu .mi:hover .ic, .menu .mi.focus .ic { color: #fff; }
.menu .mi.danger { color: var(--bad); }
.menu .mi.danger:hover { background: linear-gradient(180deg, #ff8a91, #e0313b); color: #fff; }
.menu .mi .sub { margin-left: auto; color: var(--faint); font-size: 11px; }
.menu .mi:hover .sub { color: rgba(255,255,255,.8); }
.menu .mi[disabled] { opacity: .45; pointer-events: none; }
.menu .sep { height: 1px; background: var(--line); margin: 4px 6px; }
.menu .mh { padding: 6px 10px 4px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.menu .mi .check-mark { margin-left: auto; color: var(--blue); }
.menu .mi:hover .check-mark { color: #fff; }

.tooltip {
  position: fixed; z-index: 1100; pointer-events: none;
  max-width: 260px; padding: 5px 9px; border-radius: 7px;
  background: linear-gradient(180deg, #24476f, #15304f); color: #fff;
  font-size: 12px; line-height: 1.35; box-shadow: 0 4px 14px rgba(0,0,0,.25);
  animation: tip-in .1s ease-out;
}
@keyframes tip-in { from { opacity: 0; } to { opacity: 1; } }
.tooltip b { font-weight: 700; }

/* ------------------------------------------------------------------ dialogen */

.overlay {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(14, 40, 78, 0.32);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: fade-in .15s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.dialog {
  position: relative; width: min(520px, 100%); max-height: min(88vh, 860px);
  display: flex; flex-direction: column;
  background: var(--panel); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow-l); border: 1px solid rgba(47, 127, 214, .35);
  animation: pop-in .18s cubic-bezier(.2, .9, .3, 1.2);
}
.dialog.wide { width: min(780px, 100%); }
.dialog.xwide { width: min(1040px, 100%); }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.dialog > .titlebar { border-radius: 0; font-weight: 600; font-size: 14.5px; }
.dialog > .titlebar .close { margin-left: auto; color: #fff; }
.dialog > .titlebar .close:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5); color: #fff; }
.dialog > .body { padding: 18px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.dialog > .foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; background: var(--panel-2); border-top: 1px solid var(--line); }
.dialog > .foot .left { margin-right: auto; }

/* meldingen */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 1200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  min-width: 240px; max-width: 360px; padding: 10px 12px; border-radius: 12px;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid rgba(47, 127, 214, .3); box-shadow: var(--shadow);
  animation: toast-in .25s cubic-bezier(.2, .9, .3, 1.2); cursor: default;
}
.toast.click { cursor: pointer; }
.toast.bad { border-color: rgba(210, 59, 68, .45); }
.toast.ok { border-color: rgba(47, 158, 84, .45); }
.toast .t-title { font-weight: 700; font-size: 13px; }
.toast .t-body { font-size: 12.5px; color: var(--ink-2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

/* Messenger-melding rechtsonder ("... is zojuist aangemeld") */
.popup-note {
  position: fixed; right: 18px; bottom: 18px; z-index: 1150; width: 250px;
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-l); background: var(--panel);
  border: 1px solid rgba(47, 127, 214, .4); animation: slide-up .35s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes slide-up { from { transform: translateY(120%); } to { transform: none; } }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 30px 20px; text-align: center; color: var(--muted); }
.empty .ill { width: 140px; opacity: .95; }
.empty h3 { margin: 0; color: var(--ink); font-size: 16px; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(47,127,214,.2); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow-s); }
.section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0; }
.notice { padding: 10px 12px; border-radius: 10px; background: var(--panel-3); border: 1px solid var(--line); font-size: 13px; }
.notice.warn { background: #fff6e5; border-color: #f3cf86; color: #6b4a00; }
.notice.bad { background: #ffeef0; border-color: #f2a5ab; color: #7a1a22; }
.notice.ok { background: #ecf9ef; border-color: #a9dfb6; color: #1d5a2f; }
:root[data-theme="nacht"] .notice.warn { background: #3a2c10; color: #ffd98a; border-color: #6b5320; }
:root[data-theme="nacht"] .notice.bad { background: #3a1418; color: #ffb3b9; border-color: #6b262d; }
:root[data-theme="nacht"] .notice.ok { background: #14321e; color: #a9f0bd; border-color: #2a6b3e; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line); gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--title); color: #fff; text-shadow: 0 1px 1px rgba(10,50,110,.4); box-shadow: 0 1px 3px rgba(31,111,201,.35); }

.boot { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; }
.boot img { width: 220px; animation: boot-pulse 1.6s ease-in-out infinite; }
@keyframes boot-pulse { 50% { transform: scale(1.04); filter: brightness(1.05); } }

/* ------------------------------------------------------------------ emoticons & emoji */

.emo {
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: -3px;
  object-fit: contain;
  flex-shrink: 0;
  image-rendering: -webkit-optimize-contrast;
}
.emo.big {
  width: 32px;
  height: 32px;
  vertical-align: -6px;
}

/* ------------------------------------------------------------------ nudge / por shake animatie */

@keyframes app-shake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-10px, -6px) rotate(-0.5deg); }
  20% { transform: translate(12px, 5px) rotate(0.5deg); }
  30% { transform: translate(-12px, 4px) rotate(-0.3deg); }
  40% { transform: translate(10px, -4px) rotate(0.3deg); }
  50% { transform: translate(-8px, 3px) rotate(-0.2deg); }
  60% { transform: translate(8px, -2px) rotate(0.2deg); }
  70% { transform: translate(-5px, 2px) rotate(0deg); }
  80% { transform: translate(4px, -1px) rotate(0deg); }
  90% { transform: translate(-2px, 1px) rotate(0deg); }
}

#app.shake, .shell.shake, body.shake {
  animation: app-shake 0.55s cubic-bezier(.36,.07,.19,.97) both;
}

