/* =====================================================================
   Samen — rust, adem, aandacht.
   Licht thema: rijstpapier en mist. Donker thema: basalt bij avond.
   Eén accent (jade) en één warme tint (oker) voor de opgestoken hand.
   ===================================================================== */

:root {
  --bg: #f6f1e6;
  --bg-glow: rgba(91, 143, 166, .12);
  --surface: #fbf7ec;
  --surface-2: #ece5d6;
  --raised: #fffdf7;
  --line: #ddd4c2;
  --line-soft: #e8e0d0;
  --text: #2d3940;
  --muted: #5a646a;
  --faint: #858c8f;

  --accent: #3f6f86;
  --accent-hover: #335d71;
  --accent-text: #2f5b70;
  --on-accent: #ffffff;
  --accent-soft: rgba(91, 143, 166, .14);
  --accent-ring: rgba(63, 111, 134, .32);

  --danger: #a8442a;
  --danger-hover: #8e3e22;
  --danger-text: #8e3e22;
  --danger-soft: rgba(184, 92, 58, .12);
  --ochre: #d4a574;
  --on-ochre: #2d2214;
  --speak: #6f8a73;
  --speak-soft: rgba(111, 138, 115, .32);
  --mic-live: #4f8a57;
  --cta: var(--accent); /* één hoofdkleur voor "doen": Doe mee, Les starten, Volgende, Opslaan */
  --ochre-text: #8a5a1e; /* oker als tekstkleur (op beige); het okervlak zelf blijft --ochre met donkere tekst --on-ochre */

  --stage: #ece5d6;
  --tile: #ddd3c0;
  --tile-line: rgba(28, 35, 32, .06);
  --video-bg: #1f2a30;
  --bar: #fbf7ec;
  --overlay: rgba(20, 24, 22, .58);
  --scrim: rgba(28, 35, 32, .32);

  --breath-core: rgba(91, 143, 166, .18);
  --orb-a: #dbe8ea; --orb-b: #aecbd3; --orb-c: #86aebc; --orb-warm: rgba(222, 184, 140, .34); --orb-shadow: rgba(63, 111, 134, .55);
  --breath-hi: rgba(255, 253, 247, .9);
  --breath-line: rgba(63, 111, 134, .30);
  --breath-line-2: rgba(111, 138, 115, .22);
  /* ademcirkel in de les */
  --breath-fill: rgba(63, 111, 134, .78);
  --breath-fill-2: rgba(122, 170, 190, .86);
  --breath-warm: rgba(212, 165, 116, .50);
  --breath-edge: rgba(255, 253, 247, .65);
  --breath-glow: rgba(91, 143, 166, .30);

  --shadow-sm: 0 1px 2px rgba(28, 35, 32, .06);
  --shadow: 0 1px 2px rgba(28, 35, 32, .05), 0 14px 36px -14px rgba(28, 35, 32, .22);
  --shadow-lg: 0 2px 6px rgba(28, 35, 32, .06), 0 30px 70px -24px rgba(28, 35, 32, .34);

  --font: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans: var(--font);
  --serif: "Spectral", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, "Bitstream Charter", Georgia, serif;
  --ease: cubic-bezier(.22, .7, .25, 1);
  --toolbar-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a2228;
    --bg-glow: rgba(91, 143, 166, .10);
    --surface: #212b31;
    --surface-2: #2d3940;
    --raised: #27333a;
    --line: #3a4850;
    --line-soft: #2f3c43;
    --text: #f3eee3;
    --muted: #b3b1a8;
    --faint: #8a8f8c;

    --accent: #7fb0c6;
    --accent-hover: #97c1d4;
    --accent-text: #9cc6d9;
    --on-accent: #10232c;
    --accent-soft: rgba(127, 176, 198, .15);
    --accent-ring: rgba(127, 176, 198, .38);

    --danger: #b85c3a;
    --danger-hover: #c96d4a;
    --danger-text: #f0a585;
    --danger-soft: rgba(216, 120, 85, .16);
    --speak: #8fb293;
    --speak-soft: rgba(143, 178, 147, .32);
    --mic-live: #9fd6a6;
    --ochre-text: #e0b98a;

    --stage: #141b20;
    --tile: #26323a;
    --tile-line: rgba(255, 255, 255, .04);
    --video-bg: #10171b;
    --bar: #1d262c;
    --overlay: rgba(10, 12, 11, .62);
    --scrim: rgba(0, 0, 0, .55);

    --breath-core: rgba(127, 176, 198, .15);
    --orb-a: #6f9bae; --orb-b: #436f84; --orb-c: #2c4f61; --orb-warm: rgba(212, 165, 116, .22); --orb-shadow: rgba(0, 0, 0, .7);
    --breath-hi: rgba(212, 165, 116, .30);
    --breath-line: rgba(127, 176, 198, .30);
    --breath-line-2: rgba(143, 178, 147, .16);
    --breath-fill: rgba(72, 122, 146, .82);
    --breath-fill-2: rgba(127, 176, 198, .82);
    --breath-warm: rgba(212, 165, 116, .42);
    --breath-edge: rgba(243, 238, 227, .40);
    --breath-glow: rgba(127, 176, 198, .26);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -14px rgba(0, 0, 0, .65);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 30px 80px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

/* ---------- basis ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.center { justify-content: center; flex-wrap: wrap; }
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; }
kbd {
  background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; padding: 0 6px; font: 600 12px/1.7 var(--font);
}
::selection { background: var(--accent-ring); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile :focus-visible, .seg :focus-visible { outline-offset: -2px; }

.screen { position: fixed; inset: 0; }

/* ---------- knoppen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 9px 18px; font-weight: 600; font-size: 14px; line-height: 1.3; min-height: 40px;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s, transform .08s, box-shadow .18s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px -8px var(--accent-ring); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--accent-soft); }
.btn.quiet { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn.quiet[aria-expanded="true"], .btn.quiet.on { border-color: var(--accent); color: var(--accent-text); }
.btn.big { padding: 13px 22px; font-size: 15.5px; min-height: 50px; }
.btn.small { padding: 6px 13px; font-size: 13px; min-height: 32px; }
.btn.wide { width: 100%; justify-content: flex-start; border-radius: 12px; }
.btn .bi { width: 19px; height: 19px; flex: none; }
.icon-btn {
  width: 36px; height: 36px; padding: 8px; border: 0; border-radius: 10px; flex: none;
  background: transparent; color: var(--muted); transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--text); }

input, select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; outline: none; min-height: 44px; font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; padding-right: 38px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
label { display: block; font-size: 13px; color: var(--muted); margin: 16px 0 6px; font-weight: 600; }
label.check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-weight: 500; font-size: 14px; cursor: pointer; line-height: 1.45; }
label.check input { width: 18px; height: 18px; min-height: 0; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

/* ---------- ademende ring ---------- */
.breath { position: relative; width: 340px; aspect-ratio: 1; flex: none; }
.breath i { position: absolute; border-radius: 50%; animation: breathe 10s ease-in-out infinite; }
.breath::before { content: ""; position: absolute; inset: -4%; border-radius: 50%; background: radial-gradient(circle, var(--bg-glow) 0%, transparent 66%); }
/* De bol: dezelfde vorm als de ademcirkel in de les (lichtvlek, zachte schaduw), in de mistige kleur van het beginscherm. */
.breath i:nth-child(1) {
  inset: 24%;
  background:
    radial-gradient(circle at 34% 27%, var(--breath-hi) 0%, transparent 40%),
    radial-gradient(circle at 68% 84%, var(--orb-warm) 0%, transparent 54%),
    radial-gradient(circle at 42% 36%, var(--orb-a) 0%, var(--orb-b) 60%, var(--orb-c) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .32), 0 22px 44px -22px var(--orb-shadow);
}
.breath i:nth-child(2) { inset: 11%; border: 1px solid var(--breath-line); animation-delay: .35s; }
.breath i:nth-child(3) { inset: 0; border: 1px solid var(--breath-line-2); animation-delay: .7s; }
.breath.mid { width: 128px; margin: 0 auto; }
.breath.tiny { width: 26px; }
.breath.tiny::before { content: none; }
.breath.tiny i:nth-child(1) { inset: 0; background: var(--accent); box-shadow: none; opacity: .7; }
@keyframes breathe {
  0%, 100% { transform: scale(.82); opacity: .7; }
  40% { transform: scale(1); opacity: 1; }
}

/* ---------- home ---------- */
#home {
  background: radial-gradient(900px 640px at 78% 46%, var(--bg-glow), transparent 70%), var(--bg);
  display: flex; flex-direction: column; overflow: auto;
}
.home-top { display: flex; justify-content: space-between; align-items: center; padding: 22px clamp(20px, 5vw, 56px); gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font: 500 22px/1 var(--serif); letter-spacing: -.01em; }
.brand img { border-radius: 9px; }
.home-clock { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.home-clock::first-letter { text-transform: uppercase; }
.home-main {
  flex: 1; display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 420px); align-items: center;
  justify-content: center; gap: clamp(32px, 6vw, 96px); padding: 24px clamp(20px, 5vw, 56px);
}
.home-hero h1 { font-size: clamp(38px, 5.4vw, 66px); line-height: 1.04; margin: 0 0 20px; }
.home-hero p { color: var(--muted); font-size: 17px; line-height: 1.6; margin: 0; max-width: 36em; }
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.breath-art { display: flex; align-items: center; justify-content: center; }
.my-lessons { margin-top: 26px; max-width: 460px; animation: rise .28s var(--ease); }
.ml-title { margin: 0 0 10px; font: 600 13px/1.3 var(--sans, inherit); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ml-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ml-list li { display: flex; align-items: stretch; gap: 6px; }
.ml-open { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 16px; text-align: left;
  border: 1px solid var(--line); border-radius: 14px; background: var(--raised, transparent); color: var(--text); cursor: pointer;
  transition: border-color .15s, transform .15s; }
.ml-open:hover { border-color: var(--accent); }
.ml-open:active { transform: translateY(1px); }
.ml-open [data-icon] { width: 20px; height: 20px; color: var(--accent); flex: none; }
.ml-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ml-list li.ml-item { flex-direction: column; gap: 4px; padding: 6px; border: 1px solid transparent; border-radius: 16px; }
.my-lessons, .ml-list, .ml-list li { min-width: 0; }
.my-lessons { width: 100%; }
.ml-item.dragging { opacity: .5; }
.ml-item .ml-open { flex: none; width: 100%; min-width: 0; box-sizing: border-box; }
.ml-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--dot, var(--line)); }
.ml-go { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 13px; font-weight: 600; color: var(--accent-text, var(--accent)); }
.ml-go [data-icon], .ml-go svg { width: 16px; height: 16px; }
.ml-code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ml-tools { display: flex; gap: 2px; justify-content: flex-end; flex-wrap: wrap; }
.ml-ib { width: 44px; height: 40px; padding: 10px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; }
.ml-ib:hover:not(:disabled) { color: var(--text); border-color: var(--line); }
.ml-ib:disabled { opacity: .3; cursor: default; }
.ml-ib:focus-visible, .ml-sw:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ml-ib [data-icon], .ml-ib svg { width: 100%; height: 100%; display: block; }
.ml-add { margin-top: 10px; }
.ml-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.ml-colors-l { font-size: 13px; color: var(--muted); font-weight: 600; margin-right: 4px; }
.ml-sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; background: var(--dot, var(--surface)); color: var(--muted); padding: 6px; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.ml-sw.on { border-color: var(--text); }
.ml-sw svg { width: 100%; height: 100%; display: block; }
.ml-actions { margin-top: 18px; display: flex; gap: 10px; }
.ml-code { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.ml-del { width: 44px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--muted); padding: 12px; cursor: pointer; }
.ml-del:hover { color: var(--text); border-color: var(--line); }
.join-box { margin-top: 18px; max-width: 460px; animation: rise .28s var(--ease); }
.join-box label { margin-top: 0; }
.join-box .row { align-items: stretch; }
.join-box .btn { white-space: nowrap; border-radius: 12px; }
.home-foot {
  display: flex; gap: 10px; align-items: center; padding: 18px clamp(20px, 5vw, 56px) calc(22px + var(--safe-b));
  color: var(--muted); font-size: 13.5px;
}
.hf-icon { width: 18px; height: 18px; color: var(--accent); flex: none; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- lobby ---------- */
#lobby { display: flex; align-items: center; justify-content: center; padding: 28px; overflow: auto; background: var(--bg); }
.lobby-wrap { display: grid; grid-template-columns: minmax(0, 660px) 360px; gap: clamp(28px, 4vw, 56px); align-items: center; width: min(1100px, 100%); margin: auto; }
.lobby-preview {
  position: relative; aspect-ratio: 16/9; background: var(--video-bg); border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.lobby-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-off { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #c9d1cb; font-size: 14px; background: radial-gradient(circle at 50% 40%, #27302b, #151917 70%); }
.preview-bar {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 12px; align-items: center; justify-content: center;
  padding: 36px 16px 16px; background: linear-gradient(transparent, rgba(8, 10, 9, .62));
}
.preview-error {
  position: absolute; top: 14px; left: 14px; right: 14px; background: rgba(28, 16, 15, .78); color: #ffd9d6;
  border: 1px solid rgba(229, 96, 90, .5); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; backdrop-filter: blur(8px);
}
.round-btn {
  width: 52px; height: 52px; border-radius: 50%; padding: 14px; border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .14); color: #fff; backdrop-filter: blur(10px); transition: background-color .18s, border-color .18s;
}
.round-btn:hover { background: rgba(255, 255, 255, .24); }
.round-btn.off { background: var(--danger); border-color: var(--danger); }
.level { width: 92px; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.level.wide { width: 100%; margin-top: 10px; background: var(--surface-2); }
.level-fill { height: 100%; width: 0; background: var(--speak); border-radius: inherit; transition: width .08s linear; }
.lobby-brand { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; font: 500 17px/1 var(--serif); color: var(--muted); }
.lobby-brand img { border-radius: 6px; }
.lobby-form h2 { margin: 0 0 6px; font-size: clamp(28px, 3vw, 36px); line-height: 1.1; }
.lobby-form #lobbySub { margin: 0; font-variant-numeric: tabular-nums; }
.code-edit { margin-top: 10px; }
.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-row input { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.code-row .btn { flex: none; }
.code-help { margin: 6px 0 0; font-size: 13px; }
.code-err { margin: 8px 0 0; color: var(--danger-text); font-size: 14px; background: var(--danger-soft); padding: 8px 12px; border-radius: 12px; }
.code-edit .check { margin-top: 10px; }
.code-edit input[aria-invalid="true"] { border-color: var(--danger-text); }
.lobby-form .btn.big { margin-top: 24px; width: 100%; }
.lobby-form .btn.ghost { width: 100%; margin-top: 6px; }
.devices { margin-top: 18px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.devices summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; padding: 4px 0; border-radius: 6px; }
.devices summary:hover { color: var(--text); }
.not-started { display: flex; gap: 14px; align-items: center; margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); font-size: 14px; line-height: 1.45; }
.teacher-link { margin-top: 2px; }
.form-error { margin-top: 14px; color: var(--danger-text); font-size: 14px; background: var(--danger-soft); padding: 10px 14px; border-radius: 12px; }

/* ---------- wachtkamer / einde ---------- */
#waiting, #ended {
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(700px 500px at 50% 40%, var(--bg-glow), transparent 70%), var(--bg);
}
.center-card { text-align: center; max-width: 440px; animation: rise .4s var(--ease); }
.center-card h2 { margin: 24px 0 8px; font-size: 32px; line-height: 1.15; }
.center-card p { margin: 0; font-size: 16px; line-height: 1.6; }
.center-card .btn { margin-top: 26px; }
.center-card .row .btn { margin-top: 26px; }
.ended-logo { border-radius: 14px; box-shadow: var(--shadow); }

/* ---------- vergadering ---------- */
#meeting { display: flex; flex-direction: column; background: var(--stage); }
.topbar {
  height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; flex: none;
  position: relative; z-index: 5; gap: 10px; padding-top: env(safe-area-inset-top, 0px); box-sizing: content-box;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 8px; min-width: 200px; }
.tb-left { flex: 0 1 auto; }
.tb-left > *:not(.conn-badge), .tb-right > * { flex-shrink: 0; }
.tb-right { justify-content: flex-end; }
.tb-center { color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.info-btn {
  width: 36px; height: 36px; padding: 7px; border: 0; background: var(--accent-soft); color: var(--accent-text); border-radius: 10px;
  transition: background-color .15s;
}
.info-btn:hover { background: var(--accent-ring); }
.rec-badge { display: inline-flex; align-items: center; gap: 7px; background: var(--danger-soft); color: var(--danger-text); padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.rec-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.lock-badge { width: 22px; height: 22px; color: #b07a3e; }
.timer { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; margin-right: 2px; }
.seg { display: flex; background: var(--surface-2); border-radius: 11px; padding: 3px; }
.seg button { width: 36px; height: 30px; padding: 6px 8px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; transition: background-color .15s, color .15s; }
.seg button.on { background: var(--raised); color: var(--text); box-shadow: var(--shadow-sm); }

.info-pop {
  position: absolute; top: 58px; left: 14px; z-index: 30; width: 400px; max-width: calc(100vw - 28px);
  background: var(--raised); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; box-shadow: var(--shadow-lg);
  animation: pop .18s var(--ease); transform-origin: top left;
}
.info-pop h3 { margin: 0 0 14px; font: 500 22px/1.2 var(--serif); }
.info-pop dl { display: grid; grid-template-columns: 104px 1fr; gap: 10px 14px; margin: 0 0 18px; font-size: 14px; }
.info-pop dt { color: var(--muted); }
.info-pop dd { margin: 0; overflow-wrap: anywhere; }
.info-pop dd.link { color: var(--accent-text); font-weight: 600; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

.banner {
  position: absolute; top: 60px; left: 50%; transform: translateX(-50%); z-index: 20;
  background: var(--raised); border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 18px; font-size: 14px;
  display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); white-space: nowrap;
}
.banner.share { border-color: var(--accent-ring); }
.banner.share::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--speak); margin-right: -6px; }

.body { flex: 1; display: flex; min-height: 0; position: relative; }
.stage { flex: 1; position: relative; min-width: 0; padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.gallery { flex: 1; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 8px; min-height: 0; }
.stage.speaker .spot { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.stage.speaker .gallery { flex: none; height: 118px; flex-wrap: nowrap; overflow-x: auto; justify-content: center; align-content: stretch; padding: 4px; scrollbar-width: thin; }
.stage.speaker .gallery .tile { width: 196px !important; height: 110px !important; flex: none; }
.stage.speaker .spot .tile { width: 100%; height: 100%; max-width: calc((100vh - 230px) * 16 / 9); }

/* kleine tegels in de strook onder de spreker */
.stage.speaker .gallery .tile-name { left: 6px; bottom: 6px; font-size: 11.5px; padding: 2px 7px 2px 6px; max-width: calc(100% - 12px); border-radius: 7px; }
.stage.speaker .gallery .tile-name .mic-off { width: 13px; height: 13px; }
.stage.speaker .gallery .tile-hand { width: 26px; height: 26px; padding: 5px; top: 6px; left: 6px; box-shadow: 0 0 0 3px rgba(212, 165, 116, .28); }
.stage.speaker .gallery .tile-more { width: 28px; height: 28px; padding: 5px; top: 6px; right: 6px; }
.stage.speaker .gallery .net, .stage.speaker .gallery .conn { display: none; }
.stage.speaker .gallery .avatar { font-size: 15px; box-shadow: none; }

/* lege toestand: alleen in de les */
.invite {
  position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 6;
  width: min(440px, calc(100% - 28px)); background: var(--raised); border: 1px solid var(--line);
  border-radius: 20px; padding: 18px 20px; box-shadow: var(--shadow-lg); animation: rise .5s .3s var(--ease) both;
}
.invite-title { margin: 0 0 4px; font: 500 20px/1.25 var(--serif); }
.invite-sub { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.stage.speaker .invite { display: none; }

/* ---------- tegels ---------- */
.tile {
  position: relative; background: var(--tile); border-radius: 16px; overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--tile-line);
  transition: box-shadow .25s var(--ease);
}
.tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .25s var(--ease); z-index: 3;
}
.tile.speaking::after { box-shadow: inset 0 0 0 3px var(--speak), inset 0 0 22px var(--speak-soft); }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--video-bg); }
.tile.contain video { object-fit: contain; }
.tile.mirror video { transform: scaleX(-1); }
.tile.cam-off video { visibility: hidden; }
.tile .avatar { display: none; }
.tile.cam-off .avatar { display: flex; }
.avatar {
  position: absolute; inset: 0; margin: auto; width: 30%; max-width: 128px; min-width: 40px; aspect-ratio: 1; border-radius: 50%;
  align-items: center; justify-content: center; font-weight: 600; color: #fff; font-size: clamp(15px, 3vw, 40px);
  letter-spacing: .02em; box-shadow: 0 0 0 6px rgba(255, 255, 255, .10), 0 12px 30px -10px rgba(0, 0, 0, .35);
  transition: box-shadow .3s var(--ease);
}
.tile.speaking .avatar { box-shadow: 0 0 0 6px var(--speak-soft), 0 0 0 12px rgba(111, 138, 115, .14); }
.avatar.big { position: static; display: flex; width: 104px; font-size: 38px; }
.tile-name {
  position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 64px);
  background: rgba(14, 18, 16, .58); color: #fff; padding: 4px 10px 4px 8px; border-radius: 9px; font-size: 13px; font-weight: 600;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); z-index: 4;
}
.tile-name .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-name .mic-off { width: 15px; height: 15px; color: #ff9c95; flex: none; display: none; }
.tile.muted .tile-name .mic-off { display: block; }
.tile-hand {
  position: absolute; top: 10px; left: 10px; width: 38px; height: 38px; padding: 8px; z-index: 4;
  background: var(--ochre); color: var(--on-ochre); border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(212, 165, 116, .28), 0 8px 18px -6px rgba(0, 0, 0, .4);
  animation: handRise .5s var(--ease), sway 2.4s 0.5s ease-in-out infinite;
}
@keyframes handRise { from { transform: translateY(8px) scale(.6); opacity: 0; } }
@keyframes sway { 50% { transform: rotate(-10deg); } }
.net { position: absolute; right: 12px; bottom: 14px; display: flex; gap: 2px; align-items: flex-end; height: 13px; z-index: 4; }
.net i { width: 3px; background: rgba(255, 255, 255, .4); border-radius: 1px; }
.net i:nth-child(1) { height: 5px; } .net i:nth-child(2) { height: 9px; } .net i:nth-child(3) { height: 13px; }
.net.q3 i { background: #9ccaa2; }
.net.q2 i:nth-child(-n+2) { background: #e4b27a; }
.net.q1 i:nth-child(1) { background: #ff7d76; }
.tile.local .net { display: none; }
.tile-more {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; padding: 6px; border-radius: 10px; border: 0; z-index: 5;
  background: rgba(14, 18, 16, .55); color: #fff; opacity: 0; transition: opacity .18s; backdrop-filter: blur(8px);
}
.tile:hover .tile-more, .tile-more[aria-expanded="true"], .tile-more:focus-visible { opacity: 1; }
@media (hover: none) { .tile-more { opacity: .85; } }
.tile-menu { top: 50px; right: 10px; }
.conn {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); font-size: 12.5px; z-index: 4;
  background: rgba(14, 18, 16, .62); padding: 4px 11px; border-radius: 999px; color: #dfe5e1; white-space: nowrap;
}
.reactions { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.reactions span { position: absolute; bottom: 36px; font-size: 40px; animation: floatUp 2.6s var(--ease) forwards; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35)); }
@keyframes floatUp {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  12% { transform: translateY(-10px) scale(1.08); opacity: 1; }
  100% { transform: translateY(-180px) scale(1); opacity: 0; }
}

/* ---------- menu's ---------- */
.more-wrap { position: relative; }
.menu {
  position: absolute; z-index: 40; min-width: 220px; background: var(--raised); border: 1px solid var(--line);
  border-radius: 16px; padding: 6px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 2px;
  animation: pop .16s var(--ease);
}
.menu.up { bottom: calc(100% + 12px); right: 0; padding: 10px; gap: 8px; min-width: 270px; }
.menu > button:not(.btn) {
  border: 0; background: transparent; text-align: left; padding: 10px 12px; border-radius: 10px; font-size: 14px; min-height: 40px;
}
.menu > button:not(.btn):hover { background: var(--accent-soft); }
.menu > button.danger-text { color: var(--danger-text); }
.menu > button.danger-text:hover { background: var(--danger-soft); }
.menu .check { margin: 0; padding: 9px 10px; border-radius: 10px; }
.menu .check:hover { background: var(--accent-soft); }
.menu hr { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 6px; }
.menu .menu-title { font-size: 12.5px; color: var(--muted); padding: 8px 12px 2px; font-weight: 600; }
.menu > button.sel { color: var(--accent-text); font-weight: 600; }
.menu > button.sel::before { content: "✓"; display: inline-block; width: 18px; }

/* ---------- panelen ---------- */
.panel {
  width: 348px; flex: none; background: var(--surface); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; animation: panelIn .28s var(--ease);
}
@keyframes panelIn { from { opacity: 0; transform: translateX(14px); } }
.panel header { display: flex; justify-content: space-between; align-items: center; padding: 14px 12px 12px 20px; border-bottom: 1px solid var(--line-soft); }
.panel h3 { margin: 0; font: 500 20px/1.2 var(--serif); }
.panel h3 #peopleCount { font: 500 14px var(--font); color: var(--muted); }
.panel footer { padding: 12px 14px calc(12px + var(--safe-b)); border-top: 1px solid var(--line-soft); display: flex; gap: 8px; justify-content: flex-end; }
.panel footer .menu { bottom: calc(100% + 8px); right: 0; }
.people { list-style: none; margin: 0; padding: 8px; overflow: auto; flex: 1; }
.people li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; min-height: 52px; }
.people li:hover { background: var(--accent-soft); }
.people .pa { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: #fff; flex: none; }
.people .pn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.people .pn small { color: var(--muted); margin-left: 6px; font-weight: 400; font-size: 13px; }
.people .pi { display: flex; gap: 8px; align-items: center; }
.people .pi b { font-size: 16px; }
.people .pi span { width: 18px; height: 18px; color: var(--faint); }
.people .pi span.off { color: var(--danger-text); }
.people .pbtn { opacity: 0; transition: opacity .15s; }
.people li:hover .pbtn, .people .pbtn:focus-visible { opacity: 1; }
@media (hover: none) { .people .pbtn { opacity: 1; } }
.waiting-box { border-bottom: 1px solid var(--line-soft); padding: 12px 14px; background: rgba(212, 165, 116, .10); }
.wb-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.waiting-box ul { list-style: none; margin: 0; padding: 0; }
.waiting-box li { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.waiting-box li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-log { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.chat-empty {
  margin: auto; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.55; max-width: 240px; padding-bottom: 40px;
}
.chat-empty::before {
  content: ""; display: block; width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%;
  background: var(--accent-soft) no-repeat center / 26px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b8fa6' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v8a2.5 2.5 0 0 1-2.5 2.5H10l-4.5 4v-4A1.5 1.5 0 0 1 4 14.5z'/%3E%3C/svg%3E");
}
.msg { animation: rise .22s var(--ease); max-width: 88%; }
.msg .mh { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
.msg .mh b { color: var(--text); font-weight: 600; }
.msg .mb {
  white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); padding: 8px 12px;
  border-radius: 4px 16px 16px 16px; display: inline-block; max-width: 100%; font-size: 14.5px;
}
.msg.me { align-self: flex-end; text-align: right; }
.msg.me .mb { background: var(--accent-soft); border-radius: 16px 4px 16px 16px; text-align: left; }
.msg a { color: var(--accent-text); }
.chat-form { border-top: 1px solid var(--line-soft); padding: 12px 14px calc(12px + var(--safe-b)); position: relative; }
.chat-to { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.chat-form textarea { resize: none; padding-right: 60px; border-radius: 16px; display: block; }
.chat-form .send {
  position: absolute; right: 20px; bottom: calc(18px + var(--safe-b)); width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 11px; border: 0;
  border-radius: 50%; background: var(--accent); color: var(--on-accent); transition: background-color .15s;
}
.chat-form .send:hover { background: var(--accent-hover); }

/* ---------- werkbalk ---------- */
.toolbar {
  min-height: var(--toolbar-h); flex: none; background: var(--bar); display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px var(--safe-b); border-top: 1px solid var(--line-soft); position: relative; z-index: 10; gap: 8px;
}
.tl-left, .tl-right { display: flex; align-items: center; gap: 4px; min-width: 0; flex: none; }
.tl-right { justify-content: flex-end; }
.tl-center { display: flex; align-items: center; gap: 2px; }
.extra-tools { display: contents; }
.more-tool { display: none !important; }
.tool-group { display: flex; align-items: center; border-radius: 14px; }
.tool {
  position: relative; border: 0; background: transparent; color: var(--text); min-width: 68px; height: 58px; padding: 7px 8px 5px;
  border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 12px; font-weight: 500;
  transition: background-color .18s var(--ease), color .18s;
}
.tool:hover { background: var(--accent-soft); }
.tool .ti { width: 23px; height: 23px; transition: color .18s; }
.tool .tl { white-space: nowrap; }
.tool.off { color: var(--danger-text); }
.tool.off .ti { color: var(--danger); }
.tool.active { background: var(--accent-soft); }
.tool.active .ti { color: var(--accent); }
.tool.share .ti { color: var(--accent); }
.tool.share.active { background: var(--accent-soft); }
.tool.recording .ti { color: var(--danger); animation: blink 1.6s ease-in-out infinite; }
.tool .count {
  position: absolute; top: 5px; right: 13px; font-size: 11px; color: var(--muted); font-weight: 600;
  background: var(--surface-2); border-radius: 999px; padding: 0 6px; line-height: 17px;
}
.tool .dot {
  position: absolute; top: 5px; right: 20px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger);
  font-size: 11px; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 0 0 2px var(--bar);
}
.tool .dot:empty { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 9px; right: 24px; }
.tool .dot.wait { background: var(--ochre); color: var(--on-ochre); right: auto; left: 12px; }
.preview-off .spacer { height: 46px; }
.caret { width: 20px; height: 58px; border: 0; background: transparent; color: var(--muted); padding: 0 2px; border-radius: 8px; margin-left: -8px; }
.caret svg { height: 14px; }
.caret:hover { background: var(--accent-soft); color: var(--text); }
.caret-menu { bottom: calc(var(--toolbar-h) + 6px); left: 14px; max-height: 60vh; overflow: auto; }
.react-pop {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); background: var(--raised);
  border: 1px solid var(--line); border-radius: 18px; padding: 10px; box-shadow: var(--shadow-lg); z-index: 40; width: 320px;
  animation: rise .18s var(--ease);
}
.emojis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; margin-bottom: 8px; }
.emojis button { border: 0; background: transparent; font-size: 24px; height: 44px; border-radius: 12px; padding: 0; transition: transform .12s var(--ease), background-color .12s; }
.emojis button:hover { background: var(--accent-soft); transform: scale(1.12); }
#btnHand { justify-content: center; }
#tLeave { padding: 10px 22px; }

body:not(.is-host) .host-only { display: none !important; }

/* ---------- meldingen ---------- */
.toasts { position: absolute; left: 0; right: 0; top: calc(52px + env(safe-area-inset-top, 0px) + 8px); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 8; pointer-events: none; padding: 0 12px; }
.toast {
  background: var(--raised); border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px 11px 16px; font-size: 14px;
  box-shadow: var(--shadow); animation: toastIn .3s var(--ease); max-width: 360px; pointer-events: auto;
  display: flex; gap: 12px; align-items: center;
}
.toast .btn { flex: none; }
#meeting.panel-open .toasts { right: 380px; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }

/* ---------- instellingen ---------- */
dialog {
  padding: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text);
  width: min(740px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-shadow: var(--shadow-lg); overflow: auto;
}
dialog[open] { animation: pop .22s var(--ease); }
dialog::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
.settings header { display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 14px 24px; border-bottom: 1px solid var(--line-soft); }
.settings h3 { margin: 0; font: 500 24px/1.2 var(--serif); }
.set-body { display: grid; grid-template-columns: 180px 1fr; min-height: 400px; }
.set-body nav { border-right: 1px solid var(--line-soft); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.set-body nav button { border: 0; background: transparent; text-align: left; padding: 10px 14px; border-radius: 12px; color: var(--muted); font-weight: 600; min-height: 42px; }
.set-body nav button:hover { color: var(--text); background: var(--surface-2); }
.set-body nav button.on { background: var(--accent-soft); color: var(--accent-text); }
.tabs { padding: 6px 26px 26px; min-width: 0; }
.tabs video { width: 100%; aspect-ratio: 16/9; background: var(--video-bg); border-radius: 16px; margin-top: 16px; object-fit: cover; transform: scaleX(-1); display: block; }
.tabs video.nomirror { transform: none; }
.tabs .check { margin-top: 16px; }
.tabs p.small { margin-top: 18px; line-height: 1.9; }

/* kleurregel: blauwgrijs (--cta) = doen; terracotta (--danger) alleen voor weggaan, stoppen en wissen; oker = aandacht; groen = goed/aan */
.btn.primary { background: var(--cta); border-color: var(--cta); }
#invCopy.done { background: var(--speak); border-color: var(--speak); }

/* ---------- lobby: toestemming & hulp ---------- */
.help-chip {
  position: absolute; left: 50%; transform: translateX(-50%); top: 84px; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 8px 12px; min-height: 40px;
  border: 0; border-radius: 999px; background: #fff; color: #2d3940; font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .5); animation: rise .3s var(--ease);
}
.lobby-preview:has(.help-chip:not(.hidden)) .preview-off > span:not(.spacer) { display: none; }
.lobby-preview:has(.help-chip:not(.hidden)) .preview-off .avatar { display: none; } /* hulpknop niet over de avatar */
.help-chip .bi { width: 19px; height: 19px; color: #3f6f86; }
.help-chip:hover { background: #f6f1e6; }
.perm-hint {
  position: absolute; left: 14px; right: 14px; top: 14px; z-index: 3; display: flex; gap: 12px; align-items: flex-start;
  background: rgba(251, 252, 249, .96); color: #1c2320; border-radius: 16px; padding: 12px 16px; font-size: 14px; line-height: 1.45;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); animation: rise .35s var(--ease);
}
.perm-hint p { margin: 0; }
.ph-arrow { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: #3f6f86; box-shadow: 0 0 0 5px rgba(63, 111, 134, .2); animation: blink 1.6s ease-in-out infinite; }

/* ---------- uitnodigen & hulp (dialogen) ---------- */
dialog.sheet-dlg { width: min(540px, calc(100vw - 32px)); }
.sheet-dlg header { display: flex; justify-content: space-between; align-items: center; padding: 18px 16px 6px 24px; }
.sheet-dlg h3 { margin: 0; font: 500 24px/1.2 var(--serif); }
.dlg-body { padding: 4px 24px 24px; }
.dlg-body > p.muted { margin: 0 0 16px; line-height: 1.55; }
.inv-msg {
  white-space: pre-wrap; overflow-wrap: anywhere; background: var(--accent-soft); border-radius: 4px 18px 18px 18px;
  padding: 14px 16px; font-size: 14.5px; line-height: 1.55; margin-bottom: 18px;
}
.inv-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inv-actions .btn.primary { grid-column: 1 / -1; min-height: 50px; font-size: 15.5px; }
.inv-actions a.btn { text-decoration: none; color: var(--text); }
.btn.done { background: var(--speak); border-color: var(--speak); color: #fff; }
.inv-link { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.inv-link code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 13.5px/1.4 var(--font); color: var(--accent-text); }
.help-steps { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 10px; }
.help-steps li { counter-increment: st; display: flex; gap: 12px; align-items: flex-start; line-height: 1.5; font-size: 15px; }
.help-steps li::before {
  content: counter(st); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13.5px; margin-top: -2px;
}
.help-extra p { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.help-extra:empty { display: none; }
.dlg-body .row { margin-top: 18px; flex-wrap: wrap; }

/* ---------- eerste keer: tips ---------- */
.tips {
  position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 7;
  width: min(440px, calc(100% - 28px)); background: var(--raised); border: 1px solid var(--line);
  border-radius: 22px; padding: 20px 22px; box-shadow: var(--shadow-lg); animation: rise .5s .4s var(--ease) both;
}
.tips-title { margin: 0 0 12px; font: 500 22px/1.25 var(--serif); }
.tips-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.tips-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.5; }
.tips-list li > span[data-icon] { flex: none; width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); margin-top: -4px; }
.stage:has(.tips:not(.hidden)) .invite { display: none; }
#meeting.panel-open .tips { display: none; } /* tips niet half achter een open paneel */

/* ---------- deelnemers: uitnodigen ---------- */
.people-invite {
  display: flex; gap: 12px; align-items: center; text-align: left; margin: 10px 10px 0; padding: 12px 14px;
  border: 1px dashed var(--accent-ring); border-radius: 16px; background: transparent; transition: background-color .15s;
}
.people-invite:hover { background: var(--accent-soft); }
.people-invite .pi-icon { flex: none; width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.people-invite b { display: block; font-weight: 600; }
.people-invite small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.info-pop .row { flex-wrap: wrap; }

/* ---------- microfoon-niveau in de werkbalk ---------- */
#tMic .ti { position: relative; isolation: isolate; }
#tMic .ti::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; z-index: -1; background: var(--speak-soft);
  transform: scale(calc(.6 + var(--lvl, 0) * .45)); opacity: min(1, calc(var(--lvl, 0) * 2.2));
  transition: transform .12s linear, opacity .12s linear;
}
#tMic.off .ti::before { opacity: 0; }

/* =====================================================================
   Tablet en kleiner
   ===================================================================== */
@media (max-width: 1080px) {
  /* labels blijven zichtbaar onder de iconen: ouderen herkennen een knop aan de tekst */
  .toolbar .tool .tl { font-size: 11px; line-height: 1.15; text-align: center; }
  .tool { min-width: 56px; height: 60px; padding: 6px 3px 4px; gap: 3px; }
  .toolbar .tool .tl { white-space: normal; max-width: 68px; }
  .tl-center { gap: 0; }
  .toolbar { padding-left: 8px; padding-right: 8px; gap: 4px; }
  .caret { height: 60px; }
  .tl-left, .tl-right { min-width: 0; }
  .tb-left, .tb-right { min-width: 0; }
  .tool .count { right: 4px; }
  .tool .dot { right: 8px; }
  .tool .dot:empty { right: 12px; }
  .tool .dot.wait { left: 4px; }
  .panel {
    position: absolute; right: 0; top: 0; bottom: 0; z-index: 15; width: min(380px, 100%);
    box-shadow: var(--shadow-lg);
  }
  #meeting.panel-open .toasts { right: 0; }
  /* het paneel ligt over de werkbalk: de rode knop mag er niet onder (of onder "versturen") zitten */
  #meeting.panel-open #tLeave, #meeting.panel-open #leaveMenu { visibility: hidden; pointer-events: none; }
}

@media (max-width: 960px) {
  .home-main { grid-template-columns: 1fr; justify-items: start; gap: 8px; align-content: center; }
  .breath-art { order: -1; justify-self: start; }
  .breath-art .breath { width: 150px; }
  .lobby-wrap { grid-template-columns: minmax(0, 620px); justify-content: center; gap: 24px; }
  #lobby { align-items: flex-start; }
}

/* =====================================================================
   Telefoon
   ===================================================================== */
@media (max-width: 720px) {
  :root { --toolbar-h: 76px; }
  body { font-size: 15px; }
  .home-top { padding: 16px 20px; }
  .home-clock { display: none; }
  .home-main { padding: 8px 20px 20px; }
  .home-hero h1 { font-size: clamp(36px, 10vw, 46px); margin-bottom: 14px; }
  .home-hero p { font-size: 16px; }
  .home-actions { flex-direction: column; align-items: stretch; margin-top: 26px; }
  .home-actions .btn { width: 100%; }
  .breath-art .breath { width: 136px; }
  .join-box .row { flex-direction: column; }
  .join-box .btn { min-height: 48px; }
  .home-foot { padding: 12px 20px calc(18px + var(--safe-b)); align-items: flex-start; }

  #lobby { padding: 0 0 calc(20px + var(--safe-b)); }
  .lobby-wrap { gap: 0; margin: 0 auto; }
  .preview-off { gap: 8px; padding: 40px 0 78px; font-size: 13px; }
  .preview-off .spacer { display: none; }
  .avatar.big { width: 76px; font-size: 28px; }
  .preview-error { top: 10px; left: 10px; right: 10px; padding: 8px 12px; font-size: 13px; }
  .preview-bar { padding: 28px 14px 14px; }
  .lobby-preview { border-radius: 0 0 26px 26px; aspect-ratio: 4/3; box-shadow: var(--shadow); }
  .lobby-form { padding: 22px 20px 0; }
  .lobby-brand { display: none; }

  .topbar { height: 48px; padding: 0 10px; }
  .tb-center, #btnFull { display: none; }
  .stage { padding: 2px 8px 8px; }
  .gallery { gap: 6px; }
  .stage.speaker .gallery { height: 84px; }
  .stage.speaker .gallery .tile { width: 132px !important; height: 76px !important; border-radius: 12px; }
  .stage.speaker .spot .tile { max-width: none; }
  .tile { border-radius: 14px; }
  .tile-name { left: 8px; bottom: 8px; font-size: 12.5px; padding: 3px 8px 3px 7px; }
  .tile-hand { width: 32px; height: 32px; padding: 6px; top: 8px; left: 8px; }
  .tile-more { top: 8px; right: 8px; }
  .invite { bottom: 16px; }

  .toolbar { padding: 0 8px var(--safe-b); gap: 2px; }
  .caret { display: none; }
  .tl-left, .tl-center, .tl-right { gap: 2px; }
  .tool { min-width: 0; flex: 1 1 0; max-width: 64px; width: auto; height: 62px; padding: 5px 1px 3px; gap: 3px; border-radius: 14px; }
  .tool .ti { width: 24px; height: 24px; }
  .toolbar .tool .tl { font-size: 10.5px; line-height: 1.1; white-space: normal; max-width: 100%; }
  .tool-group, .tl-left, .tl-center { flex: 1 1 auto; min-width: 0; }
  .tool-group .tool { max-width: none; }
  .more-tool { display: flex !important; }
  .toolbar.more-open .more-tool { background: var(--accent-soft); }
  #tLeave { padding: 10px 16px; min-height: 44px; font-size: 14px; }

  /* "Meer"-blad boven de werkbalk */
  .extra-tools {
    display: none; position: fixed; left: 10px; right: 10px; bottom: calc(var(--toolbar-h) + var(--safe-b) + 10px);
    grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px; z-index: 45;
    background: var(--raised); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg);
  }
  .toolbar.more-open .extra-tools { display: grid; animation: rise .22s var(--ease); }
  .extra-tools .tool, .extra-tools .react-wrap .tool { width: 100%; height: 76px; gap: 7px; background: var(--surface-2); border-radius: 18px; }
  .extra-tools .tool.active { background: var(--accent-soft); }
  .extra-tools .react-wrap { display: flex; }
  .toolbar .extra-tools .tool .tl { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; font-size: 12.5px; }
  .extra-tools:has(.react-pop:not(.hidden)) { background: transparent; border-color: transparent; box-shadow: none; }
  .extra-tools:has(.react-pop:not(.hidden)) > .tool,
  .extra-tools:has(.react-pop:not(.hidden)) > .react-wrap > .tool { visibility: hidden; }
  .react-pop {
    position: fixed; left: 10px; right: 10px; width: auto; transform: none;
    bottom: calc(var(--toolbar-h) + var(--safe-b) + 10px); border-radius: 24px; padding: 12px;
  }
  .emojis { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .emojis button { height: 52px; font-size: 28px; }
  #btnHand { min-height: 48px; }
  .menu.up { position: fixed; left: 10px; right: 10px; bottom: calc(var(--toolbar-h) + var(--safe-b) + 10px); min-width: 0; border-radius: 24px; }
  .menu.up .btn { min-height: 48px; }

  /* panelen als volledig scherm */
  .panel {
    position: fixed; inset: 0; width: 100%; z-index: 60; border-left: 0; box-shadow: none;
    padding-top: env(safe-area-inset-top, 0px); animation: sheetUp .3s var(--ease);
  }
  .panel header { padding: 12px 10px 12px 20px; }
  .panel .icon-btn { width: 44px; height: 44px; padding: 11px; background: var(--surface-2); border-radius: 50%; }
  .people li { min-height: 56px; }
  .chat-form textarea { font-size: 16px; }
  @keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } }

  .toasts { padding: 0 10px; align-items: stretch; }
  .toast { max-width: none; }
  .info-pop { position: fixed; left: 10px; right: 10px; width: auto; top: calc(56px + env(safe-area-inset-top, 0px)); }
  .info-pop dl { grid-template-columns: 1fr; gap: 2px; }
  .info-pop dd { margin-bottom: 10px; }
  .banner { top: 56px; font-size: 13.5px; }
  .caret-menu { left: 10px !important; right: 10px; }

  dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  dialog.sheet-dlg { inset: auto 0 0 0; width: 100vw; max-width: 100vw; height: auto; max-height: 92dvh; margin: auto 0 0; border-radius: 26px 26px 0 0; padding-bottom: var(--safe-b); }
  .sheet-dlg header { padding: 18px 12px 6px 20px; }
  .dlg-body { padding: 4px 20px 24px; }
  .help-chip { top: auto; bottom: 86px; }
  .perm-hint { left: 10px; right: 10px; top: 10px; font-size: 13.5px; }
  .tips { bottom: 14px; }
  .settings { min-height: 100%; display: flex; flex-direction: column; }
  .settings header { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .set-body { grid-template-columns: 1fr; min-height: 0; }
  .set-body nav { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 10px 14px; gap: 6px; overflow-x: auto; }
  .set-body nav button { flex: 1; text-align: center; padding: 8px 10px; white-space: nowrap; }
  .tabs { padding: 4px 20px calc(28px + var(--safe-b)); }
  select, input { font-size: 16px; }
}

@media (max-width: 380px) {
  .toolbar .tool .tl { font-size: 10px; letter-spacing: -.1px; }
  #tLeave { padding: 10px 11px; font-size: 13px; }
}

/* liggende telefoon: lage hoogte */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --toolbar-h: 56px; }
  .topbar { height: 40px; }
  .tb-center { display: none; }
  .toolbar .tool .tl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .tool { height: 48px; min-width: 50px; }
  .caret { height: 48px; }
  .stage { padding: 0 10px 6px; }
  .stage.speaker .gallery { height: 70px; }
  .stage.speaker .gallery .tile { width: 112px !important; height: 63px !important; }
  .stage.speaker .spot .tile { max-width: calc((100vh - 170px) * 16 / 9); }
  .home-main { grid-template-columns: minmax(0, 1fr) auto; gap: 24px; }
  .home-actions { flex-direction: row; }
  .breath-art { order: 0; }
  .lobby-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 20px; }
  #lobby { padding: 16px; align-items: flex-start; }
  .lobby-preview { border-radius: 18px; aspect-ratio: 16/9; }
  .lobby-form { padding: 0; }
  .panel { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
  .toolbar { padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); }
}

/* staand scherm (telefoon/tablet): spotlight-tegel houdt het hele beeld (16:9) */
@media (orientation: portrait) {
  .stage.speaker .spot .tile { height: auto; aspect-ratio: 16/9; }
}

/* =====================================================================
   Minder beweging
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .breath i, .tile-hand, .tool.recording .ti, .rec-badge i, .ph-arrow, .music-pill-btn .note { animation: none; }
  /* Microfoonknop: geen bewegende balkjes, wel een duidelijke kleurwissel zodra je praat. */
  .mic-bars i, #tMic .ti::before { transition: none; transform: none; }
  .mic-bars i { transform: scaleY(.6); }
  #tMic .ti::before { opacity: 0; }
  #tMic.talking .ti::before { opacity: 1; }
  .breath-dots i { transition: none; }
  .panel, .menu, .info-pop, .tips, .help-chip, .perm-hint, .react-pop, .toast, .msg, .join-box, .center-card, .invite,
  dialog[open], .toolbar.more-open .extra-tools { animation: none; }
  .reactions span { animation: fadeAway 2.6s linear forwards; bottom: 40%; }
  @keyframes fadeAway { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
  * { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Taalkiezer */
.home-right { display: flex; align-items: center; gap: 16px; }
.lobby-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lobby-top .lobby-brand { margin: 0; }
select.lang-select { width: auto; min-width: 0; padding: 6px 34px 6px 12px; font-size: 14px; }
.tabs select.lang-select { width: 100%; margin-bottom: 8px; }
.lobby-top { margin-bottom: 10px; }

/* ---------- verlaten bevestigen, geluid-knop, einde-scherm ---------- */
dialog.leave-dlg { width: min(440px, calc(100vw - 32px)); }
.leave-dlg .dlg-body { padding: 26px 24px 24px; text-align: center; }
.leave-dlg h3 { margin: 0 0 8px; font: 500 26px/1.2 var(--serif); }
.leave-dlg p { margin: 0 0 22px; font-size: 16px; }
.leave-actions { display: grid; gap: 12px; }
.leave-actions .btn { width: 100%; justify-content: center; min-height: 58px; font-size: 18px; border-radius: 16px; }
.btn.sound-prompt {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 70;
  min-height: 72px; padding: 18px 30px; font-size: 20px; border-radius: 22px; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px);
}
#btnRejoin { min-height: 64px; padding: 16px 34px; font-size: 20px; border-radius: 18px; }
@media (max-width: 720px) {
  dialog.leave-dlg { inset: auto 0 0 0; width: 100vw; max-width: 100vw; height: auto; max-height: 92dvh; margin: auto 0 0; border-radius: 26px 26px 0 0; padding-bottom: var(--safe-b); }
  #btnRejoin { width: 100%; }
  #ended .row.center { flex-direction: column; align-items: stretch; width: 100%; }
}

.tool .tl-short { display: none; }
@media (max-width: 720px) {
  .tool .tl-long { display: none; }
  .tool .tl-short { display: block; }
}

/* =====================================================================
   Lestimer
   ===================================================================== */
.timer-pill {
  position: absolute; top: calc(56px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 9px; padding: 8px 18px; border-radius: 999px;
  background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow);
  font: 500 21px/1 var(--serif); font-variant-numeric: tabular-nums lining-nums; color: var(--text); pointer-events: none;
}
.timer-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: blink 2.4s ease-in-out infinite; }
.timer-pill.low { border-color: var(--ochre); }
.timer-pill.low i { background: var(--ochre); }
.timer-pop .pop-title { margin: 2px 4px 10px; font: 600 14px/1.3 var(--font); }
.timer-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.timer-presets .btn { justify-content: center; min-height: 44px; }
.timer-custom { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.timer-custom label { margin: 0; flex: 1; }
.timer-custom input { width: 90px; text-align: center; }
.timer-actions { display: flex; gap: 8px; }
.timer-actions .btn { flex: 1; justify-content: center; min-height: 44px; }

/* waarschuwing bij originele audio */
.warn-note {
  margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; font-weight: 600;
  background: var(--ochre); color: var(--on-ochre);
}

/* =====================================================================
   Eenvoudige leerlingenwerkbalk: Microfoon, Camera, Hand opsteken, Meer, Verlaten.
   Chat, Deelnemers, Reacties, Scherm delen en Instellingen zitten in het Meer-blad.
   ===================================================================== */
.student-only { display: none !important; }
body.is-student .student-only { display: flex !important; }
body.is-student .caret, body.is-student #tRecord { display: none !important; }
body.sheet-mode .more-tool { display: flex !important; }
body.sheet-mode .toolbar.more-open .more-tool { background: var(--accent-soft); }
body.sheet-mode .extra-tools {
  display: none; position: fixed; left: 0; right: 0; margin: 0 auto; width: min(460px, calc(100% - 20px));
  bottom: calc(var(--toolbar-h) + var(--safe-b) + 10px); grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px; z-index: 45;
  background: var(--raised); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg);
}
body.sheet-mode .toolbar.more-open .extra-tools { display: grid; animation: rise .22s var(--ease); }
body.sheet-mode .extra-tools .tool, body.sheet-mode .extra-tools .react-wrap .tool {
  width: 100%; max-width: none; height: 76px; gap: 7px; background: var(--surface-2); border-radius: 18px;
}
body.sheet-mode .extra-tools .tool.active { background: var(--accent-soft); }
body.sheet-mode .extra-tools .react-wrap { display: flex; }
body.sheet-mode .toolbar .extra-tools .tool .tl { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; font-size: 12.5px; white-space: normal; text-align: center; }
body.sheet-mode .extra-tools .tool .count { right: 14px; }
body.sheet-mode .extra-tools .tool .dot { right: 14px; }
body.sheet-mode .extra-tools:has(.react-pop:not(.hidden)) { background: transparent; border-color: transparent; box-shadow: none; }
body.sheet-mode .extra-tools:has(.react-pop:not(.hidden)) > .tool,
body.sheet-mode .extra-tools:has(.react-pop:not(.hidden)) > .react-wrap > .tool { visibility: hidden; }
body.sheet-mode .react-pop {
  position: fixed; left: 0; right: 0; margin: 0 auto; width: min(460px, calc(100% - 20px)); transform: none;
  bottom: calc(var(--toolbar-h) + var(--safe-b) + 10px); border-radius: 24px; padding: 12px;
}
body.sheet-mode .emojis { grid-template-columns: repeat(4, 1fr); gap: 4px; }
body.sheet-mode .emojis button { height: 52px; font-size: 28px; }
body.sheet-mode #btnHand { min-height: 48px; }
body.is-student .tl-center { gap: 6px; }
body.is-student #tMore .dot { right: 8px; top: 3px; }

/* =====================================================================
   Lesinstellingen (host) en rechten van leerlingen
   ===================================================================== */
dialog.lesson-dlg { width: min(620px, calc(100vw - 32px)); }
.ls-body { padding: 4px 24px 26px; }
.ls-group { margin-top: 18px; }
.ls-group h4 { margin: 0 0 4px; font: 500 19px/1.3 var(--serif); color: var(--text); }
.ls-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; margin: 0;
  border-bottom: 1px solid var(--line-soft); cursor: pointer; color: var(--text); font-size: 15px; font-weight: 500;
}
.ls-row:last-child { border-bottom: 0; }
div.ls-row { cursor: default; }
.ls-text { display: grid; gap: 2px; min-width: 0; }
.ls-text b { font-weight: 600; font-size: 15.5px; }
.ls-text small { color: var(--muted); font-size: 13.5px; line-height: 1.4; font-weight: 400; }
.ls-value { font-weight: 600; color: var(--muted); white-space: nowrap; }
input.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 54px; height: 32px; margin: 0; padding: 0; min-height: 0;
  border-radius: 999px; background: var(--line); border: 0; cursor: pointer; transition: background-color .18s var(--ease);
}
input.switch::before {
  content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s var(--ease);
}
input.switch:checked { background: var(--accent); }
input.switch:checked::before { transform: translateX(22px); }
input.switch:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 3px; }
.ls-row .btn { flex: none; }

/* wat de docent voor leerlingen heeft uitgezet: knoppen verdwijnen, de reden staat in het Meer-blad */
body.perm-no-chat #tChat, body.perm-no-chat #panelChat { display: none !important; }
body.perm-no-react #tReact { display: none !important; }
body.perm-no-hand #tHand, body.perm-no-hand #btnHand { display: none !important; }
body.perm-no-screen #tShare { display: none !important; }
body.perm-no-rename .rename-field { display: none !important; }
.perm-note { display: none; margin: 0; grid-column: 1 / -1; padding: 2px 8px 4px; font-size: 13px; line-height: 1.45; color: var(--muted); }
body.is-student .perm-note:not(:empty) { display: block; }
body.is-student .perm-note:empty { display: none; }

/* ---------- gespiegelde docent (leerlingen) ---------- */
.tile.mirror-teacher video { transform: scaleX(-1); }

/* ---------- ademcirkel ----------
   Een rustig kaartje in de hoek, zodat de docent zelf goed zichtbaar blijft.
   Opbouw, van buiten naar binnen: zachte gloed (aura) · dunne voortgangsring · richtring (zo ver gaat de adem) ·
   de bol (schaalt met de adem; daarin een lichtvlek, een langzaam draaiend schijnsel en lichtpuntjes) · het aftelgetal.
   Alles wat beweegt is transform of opacity (op de compositor): geen animatielus in JavaScript, dus ook vloeiend naast video. */
.breath-overlay {
  --ring: clamp(124px, 26vmin, 184px);
  /* water (standaard) */
  --b-a: #76a9bf; --b-b: #44758c; --b-c: #2c556b; --b-rgb: 68, 117, 140; --b-rgb2: 150, 196, 214;
  --b-hi: rgba(255, 255, 255, .82); --b-warm: rgba(158, 214, 206, .34); --b-glow: rgba(91, 143, 166, .34); --b-shadow: rgba(44, 85, 107, .42);
  --b-line: rgba(63, 111, 134, .30); --b-line2: rgba(63, 111, 134, .15); --b-prog: var(--accent);
  --b-num: #fff; --b-numsh: rgba(18, 46, 60, .5); --b-mote: #8fc0d4;
  --b-ink: var(--text); --b-ink2: var(--muted);
  position: absolute; top: 10px; left: 10px; z-index: 12; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 20px 16px; border-radius: 30px; background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow);
  pointer-events: none; animation: breathEnter .9s ease-out both;
}
@keyframes breathEnter { from { opacity: 0; } }
.breath-overlay[data-theme="sun"] {
  --b-a: #f6c982; --b-b: #e09a55; --b-c: #b96639; --b-rgb: 214, 140, 78; --b-rgb2: 246, 204, 140;
  --b-hi: rgba(255, 251, 238, .88); --b-warm: rgba(255, 226, 160, .5); --b-glow: rgba(232, 160, 96, .38); --b-shadow: rgba(170, 92, 48, .42);
  --b-line: rgba(176, 108, 70, .34); --b-line2: rgba(176, 108, 70, .16); --b-prog: #b3683f;
  --b-num: #4a2410; --b-numsh: rgba(255, 240, 214, .6); --b-mote: #eeb06a;
}
.breath-overlay[data-theme="moon"] {
  --b-a: #eef2fa; --b-b: #b3bfd8; --b-c: #7483a8; --b-rgb: 150, 164, 198; --b-rgb2: 222, 229, 244;
  --b-hi: rgba(255, 255, 255, .95); --b-warm: rgba(96, 110, 148, .38); --b-glow: rgba(176, 192, 224, .34); --b-shadow: rgba(8, 12, 24, .6);
  --b-line: rgba(190, 202, 222, .40); --b-line2: rgba(190, 202, 222, .18); --b-prog: #d3dcf0;
  --b-num: #232a40; --b-numsh: rgba(255, 255, 255, .55); --b-mote: #fff;
}
/* Maan: een nachtblauw kaartje (ook in het lichte thema), met sterretjes. */
.breath-overlay[data-theme="moon"]:not([data-size="l"]) {
  --b-ink: #eef1f8; --b-ink2: #b9c3da;
  background: radial-gradient(120% 90% at 50% 0%, #283048 0%, #1a2030 62%); border-color: rgba(180, 194, 222, .22);
}
@media (prefers-color-scheme: dark) {
  .breath-overlay { --b-mote: #d6ecf4; --b-line: rgba(127, 176, 198, .34); --b-line2: rgba(127, 176, 198, .17); --b-glow: rgba(127, 176, 198, .26); --b-shadow: rgba(0, 0, 0, .5); }
  .breath-overlay[data-theme="sun"] { --b-mote: #ffe2b0; --b-line: rgba(232, 160, 96, .38); --b-line2: rgba(232, 160, 96, .18); --b-prog: #e0a060; --b-glow: rgba(232, 160, 96, .26); }
  .breath-overlay[data-theme="moon"] { --b-mote: #fff; --b-line: rgba(190, 202, 222, .40); --b-line2: rgba(190, 202, 222, .18); --b-glow: rgba(176, 192, 224, .30); }
}
.breath-overlay[data-size="s"] { --ring: clamp(80px, 15vmin, 108px); padding: 12px 13px 11px; border-radius: 24px; gap: 7px; }

.breath-ring { position: relative; width: var(--ring); aspect-ratio: 1; display: grid; place-items: center; flex: none; }
/* Zachte gloed rond het geheel; ademt heel langzaam mee, los van het ritme. */
.breath-aura {
  position: absolute; inset: -4%; border-radius: 50%; pointer-events: none; opacity: .5;
  background: var(--g-aura, radial-gradient(circle, transparent 56%, var(--b-glow) 70%, transparent 71%));
  animation: breathAura 9s ease-in-out infinite;
}
@keyframes breathAura { 0%, 100% { opacity: .32; transform: scale(.975); } 50% { opacity: .62; transform: scale(1.025); } }
/* De richtring laat zien hoe ver de adem gaat; de bol groeit ernaartoe. Het stippelringetje is het rustpunt. */
.breath-guide { position: absolute; inset: 8%; border-radius: 50%; border: 1px solid var(--g-line, var(--b-line)); }
.breath-guide::after { content: ""; position: absolute; inset: 27%; border-radius: 50%; border: 1px dashed var(--g-line2, var(--b-line2)); }
/* Voortgang door de fase: een dunne boog die zich vult (stroke-dashoffset; de duur zet app.js per fase). */
.breath-ringsvg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; overflow: visible; }
.breath-ringsvg circle { fill: none; stroke-width: 1.5; }
.breath-prog-bg { stroke: var(--g-line2, var(--b-line2)); }
.breath-prog-bar { stroke: var(--g-prog, var(--b-prog)); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
/* Eén element schaalt (transform); gloed, bol, schijnsel en lichtpuntjes liften mee. De duur zet app.js per fase. */
.breath-orb {
  position: absolute; inset: 8%; border-radius: 50%; transform: scale(.46); will-change: transform;
  transition: transform 4s cubic-bezier(.37, 0, .28, 1);
}
.breath-overlay[data-phase="out"] .breath-orb { transition-timing-function: cubic-bezier(.33, 0, .22, 1); }
.breath-orb i { position: absolute; border-radius: 50%; }
.breath-halo {
  inset: -17%; opacity: .5; transition: opacity 1.8s ease-in-out;
  background: var(--g-halo, radial-gradient(circle, var(--b-glow) 0%, var(--b-glow) 50%, transparent 70%));
}
.breath-circle {
  inset: 0;
  background: var(--g-circle,
    radial-gradient(circle at 33% 25%, var(--b-hi) 0%, transparent 33%),
    radial-gradient(circle at 66% 84%, var(--b-warm) 0%, transparent 52%),
    radial-gradient(circle at 42% 36%, var(--b-a) 0%, var(--b-b) 58%, var(--b-c) 100%));
  box-shadow: var(--g-circle-sh,
    inset 0 0 0 1px rgba(255, 255, 255, .28),
    inset 0 calc(var(--ring) * -.05) calc(var(--ring) * .12) rgba(0, 0, 0, .13),
    0 calc(var(--ring) * .05) calc(var(--ring) * .13) calc(var(--ring) * -.04) var(--b-shadow));
}
/* Schijnsel: twee zachte lichtbanen die heel langzaam door de bol draaien, als licht in water. */
.breath-sheen {
  inset: 3%; opacity: .55; transition: opacity 1.8s ease-in-out;
  background: conic-gradient(from 20deg, transparent 0 16%, rgba(255, 255, 255, .26) 30%, transparent 44% 60%, rgba(255, 255, 255, .16) 74%, transparent 88%);
  -webkit-mask: radial-gradient(circle, #000 24%, transparent 68%); mask: radial-gradient(circle, #000 24%, transparent 68%);
  animation: breathTurn 38s linear infinite;
}
.breath-core { inset: 24%; opacity: 0; transition: opacity 1.8s ease-in-out; background: radial-gradient(circle, var(--b-hi) 0%, transparent 68%); }
/* Lichtpuntjes: een krans net buiten de rand, die traag ronddraait en met de bol mee in- en uitademt. */
.breath-motes { position: absolute; inset: -11%; border-radius: 50%; opacity: .0; transition: opacity 2.2s ease-in-out; animation: breathTurn 96s linear infinite; }
.breath-motes.b { inset: -17%; animation-duration: 140s; animation-direction: reverse; }
.breath-motes i { width: 3.2%; height: 3.2%; margin: -1.6%; background: var(--g-mote, var(--b-mote)); box-shadow: 0 0 calc(var(--ring) * .035) calc(var(--ring) * .008) var(--g-mote, var(--b-mote)); animation: breathTwinkle 5.2s ease-in-out infinite; }
.breath-motes i:nth-child(1) { left: 50%; top: 0; }
.breath-motes i:nth-child(2) { left: 85.4%; top: 14.6%; animation-delay: -1.3s; width: 2.2%; height: 2.2%; }
.breath-motes i:nth-child(3) { left: 100%; top: 50%; animation-delay: -3.1s; }
.breath-motes i:nth-child(4) { left: 85.4%; top: 85.4%; animation-delay: -.6s; width: 2.4%; height: 2.4%; }
.breath-motes i:nth-child(5) { left: 50%; top: 100%; animation-delay: -4.2s; }
.breath-motes i:nth-child(6) { left: 14.6%; top: 85.4%; animation-delay: -2.2s; width: 2%; height: 2%; }
.breath-motes i:nth-child(7) { left: 0; top: 50%; animation-delay: -3.7s; }
.breath-motes i:nth-child(8) { left: 14.6%; top: 14.6%; animation-delay: -1.9s; width: 2.6%; height: 2.6%; }
.breath-motes.b i { width: 1.8%; height: 1.8%; margin: -.9%; opacity: .7; animation-duration: 7.4s; }
.breath-motes.b i:nth-child(1) { left: 69.1%; top: 3.8%; }
.breath-motes.b i:nth-child(2) { left: 97.6%; top: 34.5%; }
.breath-motes.b i:nth-child(3) { left: 90.5%; top: 79.4%; }
.breath-motes.b i:nth-child(4) { left: 39.6%; top: 98.9%; }
.breath-motes.b i:nth-child(5) { left: 4.3%; top: 70.3%; }
.breath-motes.b i:nth-child(6) { left: 13.6%; top: 15.7%; }
/* Telefoon: minder losse lagen naast de video (geen twinkeling en geen tweede krans); de krans draait en ademt nog wel mee. */
@media (max-width: 720px), (max-height: 520px) {
  .breath-motes i { animation: none; opacity: .85; }
  .breath-motes.b { display: none; }
}
@keyframes breathTurn { to { transform: rotate(360deg); } }
@keyframes breathTwinkle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
/* Per fase: inademen = licht komt op, vasthouden = stil en helder, uitademen = licht zakt, rust = gedempt. */
.breath-overlay[data-phase="in"] .breath-halo { opacity: .85; }
.breath-overlay[data-phase="in"] .breath-motes { opacity: .9; }
.breath-overlay[data-phase="hold"] .breath-halo { opacity: 1; animation: breathShimmer 3.2s ease-in-out infinite; }
.breath-overlay[data-phase="hold"] .breath-core { opacity: .8; }
.breath-overlay[data-phase="hold"] .breath-sheen { opacity: .9; }
.breath-overlay[data-phase="hold"] .breath-motes { opacity: 1; }
.breath-overlay[data-phase="hold"] .breath-guide { border-style: dashed; animation: breathTurn 24s linear infinite; }
.breath-overlay[data-phase="out"] .breath-halo { opacity: .45; }
.breath-overlay[data-phase="out"] .breath-motes { opacity: .35; }
.breath-overlay[data-phase="rest"] .breath-halo { opacity: .28; }
.breath-overlay[data-phase="rest"] .breath-sheen { opacity: .3; }
@keyframes breathShimmer { 0%, 100% { opacity: .78; } 50% { opacity: 1; } }
/* Het aftelgetal staat altijd óp de bol (ook als die klein is), dus de kleur hoort bij de bol, niet bij het kaartje. */
.breath-count {
  position: relative; font: 400 calc(var(--ring) * .25)/1 var(--serif); color: var(--g-num, var(--b-num)); font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -.01em; text-shadow: var(--g-numtsh, 0 1px calc(var(--ring) * .03) var(--b-numsh));
}
.breath-count.tick { animation: breathTick .5s ease-out; }
@keyframes breathTick { from { opacity: .62; } }
.breath-info { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.breath-text { margin: 0; min-width: 6.5em; text-align: center; font: 500 clamp(19px, 3.7vmin, 24px)/1.2 var(--serif); letter-spacing: .012em; color: var(--g-ink, var(--b-ink)); text-shadow: var(--g-tsh, none); }
.breath-text.swap { animation: breathWords .9s var(--ease); }
@keyframes breathWords { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.breath-overlay[data-size="s"] .breath-text { font-size: 16.5px; min-width: 5.6em; }
.breath-meta { margin: 0; text-align: center; font: 500 13px/1.25 var(--font); letter-spacing: .01em; color: var(--g-ink2, var(--b-ink2)); text-shadow: var(--g-tsh, none); font-variant-numeric: tabular-nums; }
.breath-meta:empty { display: none; }
.breath-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 6px; margin-top: 2px; max-width: calc(var(--ring) + 20px); }
.breath-dots:empty { display: none; }
.breath-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--g-line, var(--b-line)); box-shadow: var(--g-dotsh, none); transition: background-color .8s, transform .8s var(--ease), opacity .8s; }
.breath-dots i.done { background: var(--g-prog, var(--b-prog)); opacity: .5; }
.breath-dots i.now { background: var(--g-prog, var(--b-prog)); transform: scale(1.4); }
.breath-roundtext { font: 500 12.5px/1 var(--font); color: var(--g-ink2, var(--b-ink2)); text-shadow: var(--g-tsh, none); font-variant-numeric: tabular-nums; }
.breath-close, .breath-snd {
  position: absolute; top: -10px; right: -10px; pointer-events: auto; background: var(--raised); border: 1px solid var(--line); border-radius: 50%;
  width: 40px; height: 40px; padding: 10px; box-shadow: var(--shadow-sm);
}
.breath-snd { right: auto; left: -10px; }
.breath-snd.off { color: var(--danger); }
.breath-vol { pointer-events: auto; width: 100%; min-width: 150px; padding-top: 8px; border-top: 1px solid var(--line-soft); color: var(--b-ink); }
.breath-vol label { margin: 0 0 2px; font-size: 12.5px; color: var(--b-ink2); }
.breath-vol .check { margin-top: 6px; font-size: 13.5px; color: var(--b-ink); }
/* Groot: midden in beeld, zonder kaart. De bol is dan van glas: een lichtende rand met een doorzichtig hart,
   zodat de docent erachter zichtbaar blijft. Getal en woord staan wit met een schaduw over het beeld.
   De glaskleuren zijn eigen variabelen (--g-…): staan ze uit (zie de staande telefoon van de leerling), dan geldt het gewone kaartje. */
.breath-overlay[data-size="l"] {
  --ring: min(50vmin, 400px);
  --g-num: #fff; --g-numtsh: 0 1px 3px rgba(0, 0, 0, .8), 0 0 20px rgba(0, 0, 0, .6); --g-ink: #fff; --g-ink2: rgba(255, 255, 255, .92);
  --g-tsh: 0 1px 2px rgba(0, 0, 0, .9), 0 0 14px rgba(0, 0, 0, .65); --g-dotsh: 0 0 3px rgba(0, 0, 0, .5);
  --g-line: rgba(255, 255, 255, .5); --g-line2: rgba(255, 255, 255, .28); --g-prog: #fff; --g-mote: #fff;
  --g-circle:
    radial-gradient(circle at 33% 25%, rgba(255, 255, 255, .34) 0%, transparent 32%),
    radial-gradient(circle at 50% 56%, rgba(10, 20, 26, .30) 0%, rgba(10, 20, 26, .13) 34%, transparent 56%),
    radial-gradient(circle, rgba(var(--b-rgb), .20) 0%, rgba(var(--b-rgb), .30) 50%, rgba(var(--b-rgb2), .58) 86%, rgba(255, 255, 255, .62) 98%, rgba(255, 255, 255, .5) 100%);
  --g-circle-sh: inset 0 0 0 1.5px rgba(255, 255, 255, .7), 0 0 calc(var(--ring) * .09) rgba(var(--b-rgb2), .5), 0 calc(var(--ring) * .03) calc(var(--ring) * .09) rgba(0, 0, 0, .28);
  --g-halo: radial-gradient(circle, transparent 46%, rgba(var(--b-rgb2), .38) 58%, transparent 72%);
  --g-aura: radial-gradient(circle, transparent 54%, rgba(var(--b-rgb2), .30) 70%, transparent 88%);
  top: 50%; left: 50%; transform: translate(-50%, -50%); background: transparent; border-color: transparent; box-shadow: none; padding: 0; gap: 2px;
}
.breath-overlay[data-size="l"] .breath-count { font-size: calc(var(--ring) * .21); transform: translateY(-46%); }
.breath-overlay[data-size="l"] .breath-ringsvg circle { stroke-width: .8; }
.breath-overlay[data-size="l"] .breath-aura { inset: -9%; }
.breath-overlay[data-size="l"] .breath-text { font-size: clamp(22px, 4.6vmin, 32px); }
/* Het woord en de stipjes staan bij "groot" ín de cirkel, onder het getal: zo valt er niets buiten het beeld. */
.breath-overlay[data-size="l"] .breath-info { position: relative; margin-top: calc(var(--ring) * -.43); margin-bottom: calc(var(--ring) * .43 - 60px); min-height: 60px; }
.breath-overlay[data-size="l"] .breath-info:has(.breath-meta:not(:empty)) { margin-bottom: calc(var(--ring) * .43 - 64px); }
.breath-overlay[data-size="l"] .breath-close { top: 4%; right: 4%; }
.breath-overlay[data-size="l"] .breath-snd { top: 4%; left: 4%; }
.breath-overlay[data-size="l"] .breath-vol { --g-ink: var(--text); --g-ink2: var(--muted); --g-tsh: none; width: auto; margin-top: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--raised); }
/* Minder beweging: de bol staat stil en er draait of twinkelt niets; licht, rand en de voortgangsboog (per seconde) tonen de fase. */
.breath-overlay.reduced .breath-orb { transform: scale(.84) !important; transition: none; }
.breath-overlay.reduced, .breath-overlay.reduced .breath-aura, .breath-overlay.reduced .breath-guide, .breath-overlay.reduced .breath-halo, .breath-overlay.reduced .breath-sheen,
.breath-overlay.reduced .breath-motes, .breath-overlay.reduced .breath-motes i, .breath-overlay.reduced .breath-text, .breath-overlay.reduced .breath-count { animation: none !important; }
.breath-overlay.reduced .breath-halo, .breath-overlay.reduced .breath-core, .breath-overlay.reduced .breath-sheen, .breath-overlay.reduced .breath-motes { transition-duration: .01s; }
.breath-overlay.reduced .breath-motes i { opacity: .7; }
.breath-overlay.reduced .breath-circle { transition: none; }
.breath-overlay.reduced[data-phase="in"] .breath-circle { box-shadow: inset 0 0 0 3px var(--accent), inset 0 0 0 4px rgba(255, 255, 255, .5); }
.breath-overlay.reduced[data-phase="hold"] .breath-circle { box-shadow: inset 0 0 0 3px var(--ochre), inset 0 0 0 4px rgba(255, 255, 255, .5); }
.breath-overlay.reduced[data-phase="out"] .breath-circle, .breath-overlay.reduced[data-phase="rest"] .breath-circle { opacity: .62; }
@media (prefers-reduced-motion: reduce) {
  .breath-overlay, .breath-aura, .breath-guide, .breath-halo, .breath-sheen, .breath-motes, .breath-motes i, .breath-text, .breath-count { animation: none !important; }
  .breath-prog-bar { transition: none !important; }
}

.breath-pop { width: 432px; }
.music-pop { width: 348px; }
.breath-pop, .music-pop { max-height: calc(100vh - var(--toolbar-h) - 90px); max-height: calc(100dvh - var(--toolbar-h) - 90px); overflow-y: auto; overscroll-behavior: contain; }
.breath-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.breath-fields label { margin: 0; display: grid; gap: 4px; text-align: center; font-size: 12.5px; }
.breath-fields input { width: 100%; text-align: center; padding: 8px 4px; }
.breath-pop .check, .music-pop .check { margin: 0 0 12px; }
.breath-presets { display: flex; flex-wrap: wrap; }
.breath-presets .btn { flex: 1 1 auto; white-space: nowrap; }
.breath-presets .btn { font-size: 13.5px; padding-left: 8px; padding-right: 8px; }
.pop-sub { margin: 4px 4px 6px; font: 600 13px/1.3 var(--font); color: var(--muted); }
.pop-note { margin: 0 4px 10px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.pop-note.warn { padding: 8px 10px; margin: 0 0 10px; border-radius: 10px; background: var(--danger-soft); color: var(--text); }
.pop-note.warn.struck { opacity: .6; }
.pop-range { display: flex; align-items: center; gap: 12px; margin: 0 4px 10px; }
.pop-range label { margin: 0; flex: none; }
input[type="range"] { width: 100%; min-height: 32px; padding: 0; border: 0; background: transparent; box-shadow: none; accent-color: var(--accent); cursor: pointer; }
input[type="range"]:focus { box-shadow: none; }
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; min-height: 40px; padding: 6px 13px;
  font: 500 13.5px/1.2 var(--font); cursor: pointer; transition: background-color .15s, border-color .15s;
}
.chip:hover { background: var(--surface-2); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.chips.sizes .chip { flex: 1; }

/* ---------- muziek ---------- */
.music-list { list-style: none; margin: 0 0 8px; padding: 0; max-height: 168px; overflow-y: auto; }
.music-list:empty { display: none; }
.music-list li { display: flex; align-items: center; gap: 2px; border-radius: 12px; }
.music-list li.now { background: var(--accent-soft); }
.music-list li.bad .music-item { text-decoration: line-through; color: var(--muted); }
.music-item {
  flex: 1; min-width: 0; min-height: 44px; padding: 8px 10px; border: 0; background: transparent; color: var(--text); text-align: left;
  font: 500 14px/1.3 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-radius: 12px;
}
.music-list li.now .music-item { color: var(--accent-text); font-weight: 600; }
.music-list li.now .music-item::before { content: "♪ "; }
.music-del { flex: none; width: 40px; height: 40px; padding: 11px; }
.music-pick { width: 100%; justify-content: center; min-height: 44px; margin-bottom: 10px; }
.music-ctl { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.music-ctl .btn { justify-content: center; min-height: 44px; padding-left: 8px; padding-right: 8px; gap: 6px; font-size: 13.5px; }
.music-ctl .btn .bi { width: 16px; height: 16px; flex: none; }
#btnMusicLoop.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.music-pill {
  position: absolute; top: calc(56px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 30; max-width: min(250px, calc(100% - 24px));
  border-radius: 20px; background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.music-pill-btn {
  display: flex; align-items: center; gap: 7px; width: 100%; min-height: 40px; padding: 6px 16px; border: 0; background: transparent; color: var(--text);
  font: 500 14.5px/1 var(--font); border-radius: 20px; cursor: pointer;
}
.music-pill-btn .note { font: 500 19px/1 var(--serif); color: var(--accent); animation: blink 2.4s ease-in-out infinite; }
.music-pill-vol { padding: 2px 16px 10px; min-width: 210px; }
.music-pill-vol label { margin: 0 0 2px; font-size: 12.5px; }
.music-pill-vol .pop-note { margin: 4px 0 0; }
body.large-text .music-pill-btn { font-size: 17px; min-height: 48px; }

/* ---------- je ziet dat je te horen bent: balkjes en ring op de microfoonknop ---------- */
.mic-bars { position: absolute; top: 9px; left: calc(50% + 15px); display: flex; align-items: flex-end; gap: 2px; height: 16px; pointer-events: none; }
.mic-bars i {
  width: 3.5px; height: 100%; border-radius: 2px; background: var(--mic-live); transform-origin: 50% 100%; opacity: .55;
  transform: scaleY(calc(.22 + var(--lvl, 0) * var(--k, .78))); transition: transform .12s linear, opacity .2s;
}
.mic-bars i:nth-child(1) { --k: .55; }
.mic-bars i:nth-child(2) { --k: .84; }
.mic-bars i:nth-child(3) { --k: .68; }
#tMic.talking .mic-bars i { opacity: 1; }
#tMic.talking .ti { color: var(--mic-live); }
#tMic.talking .ti::before { box-shadow: 0 0 0 1.5px var(--mic-live); }
.breath-pop .pop-title, .music-pop .pop-title { margin: 2px 4px 10px; font: 600 14px/1.3 var(--font); }
#tMic.off .mic-bars { display: none; }
#tMic.nudge .ti::before { opacity: 1; transform: scale(1); background: var(--danger-soft); box-shadow: 0 0 0 1.5px var(--danger); }

/* ---------- aanwezigheid ---------- */
.att-list { list-style: none; margin: 0 0 16px; padding: 0; max-height: 46vh; max-height: 46dvh; overflow: auto; }
.att-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
.att-list small { display: block; color: var(--muted); font-size: 13px; }
.att-list .att-min { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }

/* =====================================================================
   Rustig leerlingenscherm
   - vijf even brede knoppen; microfoon en camera tonen hun toestand (aan = groen, uit = rood)
   - geen tegelmenu, één weergaveknop met tekst
   - op een staande telefoon vult de docent het scherm (vierkant in plaats van een smalle strook)
   ===================================================================== */
body.is-student .toolbar {
  display: grid; grid-template-columns: repeat(5, minmax(0, 124px)); justify-content: center; align-items: center; gap: 6px;
  padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px));
}
body.is-student .tl-left, body.is-student .tl-center, body.is-student .tl-right, body.is-student .tool-group { display: contents; }
body.is-student .toolbar > * > .tool, body.is-student .tool-group > .tool { width: 100%; min-width: 0; max-width: none; }
body.is-student .tl-right > .more-wrap { width: 100%; }
body.is-student #tLeave { width: 100%; justify-content: center; padding-left: 4px; padding-right: 4px; min-height: 48px; }
body.is-student #tMic, body.is-student #tCam { background: var(--ok-soft); color: var(--ok); }
body.is-student #tMic .ti, body.is-student #tCam .ti { color: var(--ok); }
body.is-student #tMic.off, body.is-student #tCam.off { background: var(--danger-soft); color: var(--danger-text); }
body.is-student #tMic.off .ti, body.is-student #tCam.off .ti { color: var(--danger); }
body.is-student #tMic.locked { opacity: .75; }
body.is-student #tHand.active { background: var(--ochre); color: var(--on-ochre); }
body.is-student #tHand.active .ti { color: var(--on-ochre); }
body.is-student .tile-more, body.is-student .tile-menu { display: none !important; }
.view-toggle { display: none; }
body.is-student .view-toggle:not(.hidden) { display: inline-flex; }
body.is-student .tb-right .seg { display: none; }
.rotate-hint { display: none; margin: 0; text-align: center; flex: none; }


/* =====================================================================
   Makkelijk voor leerlingen (ouderen): testruimte, grote knoppen met woorden,
   hulp in de les, vraag van de docent en grote letters.
   ===================================================================== */
:root { --ok: #27693f; --ok-soft: rgba(39, 105, 63, .12); }
@media (prefers-color-scheme: dark) { :root { --ok: #74c794; --ok-soft: rgba(116, 199, 148, .16); } }
a.btn { text-decoration: none; }

/* ---------- lobby: testruimte ---------- */
.lobby-left { min-width: 0; }
.testroom { margin-top: 16px; padding: 4px 16px 8px; background: var(--raised); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm); }
.tr-title { margin: 14px 0 4px; font: 600 16px/1.3 var(--font); color: var(--muted); }
.tr-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; min-height: 72px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.tr-title + .tr-row { border-top: 0; }
.tr-tick { flex: none; width: 32px; height: 32px; padding: 7px; border-radius: 50%; background: var(--surface-2); color: transparent; transition: background-color .2s, color .2s; }
.tr-row[data-state="ok"] .tr-tick { background: var(--ok); color: #fff; }
.tr-row[data-state="bad"] .tr-tick { background: var(--danger-soft); box-shadow: inset 0 0 0 2px var(--danger); }
.tr-text { flex: 1 1 120px; min-width: 0; display: grid; gap: 7px; font-size: 16px; font-weight: 600; line-height: 1.3; }
.tr-row[data-state="ok"] .tr-text { color: var(--ok); }
.tr-row[data-state="off"] .tr-text { color: var(--muted); }
.tr-text .level { display: block; width: 100%; max-width: 240px; height: 8px; background: var(--surface-2); }
.tr-text .level-fill { display: block; background: var(--ok); }
.tr-btn { flex: none; min-height: 56px; padding: 10px 18px; font-size: 16px; border-radius: 16px; }
.tr-btn .bi { width: 22px; height: 22px; }
.tr-btn.off { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-text); }
.tr-yn { display: flex; gap: 8px; }
.tr-yn .tr-btn { min-width: 76px; }
.tr-note { margin: 2px 0 10px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); font-size: 15.5px; line-height: 1.5; }
.perm-box { margin: 6px 0 8px; padding: 14px 14px 16px; border-radius: 16px; background: var(--danger-soft); }
.perm-intro { margin: 0 0 12px; font-size: 16px; font-weight: 600; line-height: 1.4; }
.perm-box .help-steps li, .perm-box .help-extra p { font-size: 16px; line-height: 1.5; }
.perm-box .help-extra p { color: var(--text); }
.lobby-steps { margin: 12px 0 0; font-size: 16px; line-height: 1.5; }

/* ---------- lobby: grote knoppen met woorden ---------- */
#btnEnter { min-height: 64px; font-size: 20px; border-radius: 18px; }
.lobby-form .btn.ghost { min-height: 56px; font-size: 16px; }
.lobby-form .btn.ghost.small { min-height: 44px; font-size: 14px; }
.lobby-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.aa-btn { min-height: 56px; padding: 8px 14px; border-radius: 16px; gap: 8px; font-size: 14px; }
.aa-btn b { font: 600 21px/1 var(--serif); }
.aa-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.lobby-tools select.lang-select { min-height: 56px; border-radius: 16px; }
#linkHelp, #lobbyHelp { color: var(--text); }
@media (max-width: 720px) {
  .testroom { margin: 14px 14px 0; }
  .lobby-top { margin-bottom: 14px; }
  /* De grote knop blijft in beeld, ook als de testruimte erboven staat. Een rand in de achtergrondkleur
     maakt er een rustige balk van: tekst die eronderdoor schuift, komt niet half achter de knop te staan. */
  #btnEnter { position: sticky; bottom: calc(12px + var(--safe-b)); z-index: 4; box-shadow: 0 0 0 14px var(--bg), 0 10px 26px -8px var(--accent-ring); }
  /* nog geen naam ingevuld: dan staat de knop gewoon onder het naamveld, zodat hij dat veld niet afdekt
     (klasse uit app.js, geen :has(): dat kennen oudere telefoons niet) */
  #lobbyForm.name-empty #btnEnter { position: static; box-shadow: 0 10px 26px -8px var(--accent-ring); }
}

/* ---------- leerlingenwerkbalk: minstens 56 px hoog, altijd met woorden ---------- */
body.is-student .toolbar .tool { min-height: 56px; }
body.is-student #tLeave { min-height: 56px; }
/* alle vier de knoppen hebben in rust dezelfde vorm: een zacht vlak; kleur zegt alleen iets over aan/uit */
body.is-student .toolbar #tHand:not(.active), body.is-student .toolbar #tMore { background: var(--surface-2); }
@media (hover: none) { body.is-student .toolbar #tHand:not(.active):hover, body.is-student .toolbar #tMore:hover { background: var(--surface-2); } }
@media (max-width: 720px) { body.is-student .toolbar > * > .tool .tl, body.is-student .toolbar .tool-group > .tool .tl, body.is-student #tMore .tl { min-height: 2.25em; display: flex; align-items: center; justify-content: center; } }
.tool .ti.aa { width: auto; font: 600 20px/23px var(--serif); }
.help-btn { min-height: 40px; padding: 6px 14px 6px 10px; font-size: 14px; }
.help-btn .bi { width: 20px; height: 20px; }
@media (max-height: 520px) and (orientation: landscape) {
  body.is-student { --toolbar-h: 64px; }
  body.is-student .toolbar .tool { height: 58px; }
  body.is-student .toolbar .tool .tl { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; white-space: normal; max-width: 100%; text-align: center; line-height: 1.1; font-size: 11px; }
}

/* ---------- hulp in de les en de vraag van de docent ---------- */
.lh-item { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.lh-item h4 { margin: 0 0 4px; font: 500 21px/1.3 var(--serif); }
.lh-item p { margin: 0; font-size: 16px; line-height: 1.5; }
.lh-item .btn { margin-top: 12px; }
.lh-all { width: 100%; margin-top: 18px; min-height: 56px; }
.lh-buttons > summary { list-style: none; cursor: pointer; }
.lh-buttons > summary::-webkit-details-marker { display: none; }
.lh-buttons[open] > summary { background: var(--accent-soft); }
.lh-list { list-style: none; margin: 8px 0 0; padding: 0; }
.lh-list li { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.lh-list li:first-child { border-top: 0; }
.lh-list img { width: 78px; height: auto; border-radius: 14px; border: 1px solid var(--line); }
.lh-list p { margin: 0; font-size: 16px; line-height: 1.5; }
.ask-icon { width: 68px; height: 68px; padding: 17px; margin: 0 auto 14px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); }
#askDlg h3 { text-wrap: balance; }

/* ---------- docent groot voor leerlingen: altijd het hele beeld ---------- */
body.is-student .stage.speaker .spot .tile video { object-fit: contain; }
.rotate-hint { align-items: center; justify-content: center; gap: 4px; font-size: 15px; color: var(--muted); }
.rotate-hint .icon-btn { width: 44px; height: 44px; padding: 13px; color: var(--muted); }
@media (orientation: portrait) and (max-width: 700px) {
  /* Staande telefoon: de docent volledig (16:9, niets afgesneden) en gecentreerd; jijzelf en de ademcirkel eronder. */
  /* Midden in beeld, maar past het niet (kleine telefoon, grote letters), dan begint het bovenaan en kun je scrollen:
     daarom opvulling boven en onder in plaats van justify-content: center (dat snijdt de bovenkant af). */
  body.is-student .stage.speaker { justify-content: flex-start; gap: 12px; overflow-y: auto; }
  body.is-student .stage.speaker::before, body.is-student .stage.speaker::after { content: ""; flex: 1 0 0px; margin: -6px 0; }
  body.is-student .stage.speaker::after { order: 5; }
  body.is-student .stage.speaker .spot { flex: none; }
  body.is-student .stage.speaker .spot .tile { width: 100%; height: auto; aspect-ratio: 16/9; max-height: none; }
  body.is-student .stage.speaker .gallery { flex: none; height: auto; flex-wrap: wrap; overflow: visible; justify-content: center; gap: 8px; padding: 0; }
  body.is-student .stage.speaker .gallery .tile { width: calc(50% - 4px) !important; height: auto !important; aspect-ratio: 16/9; border-radius: 14px; }
  body.is-student .stage.speaker .gallery .tile:only-child { width: 62% !important; }
  /* Telefoon rechtop: de ademcirkel is een kaartje ónder de docent, nooit eroverheen (ook bij "groot"). */
  body.is-student .stage.speaker .breath-overlay, body.is-student .stage.speaker .breath-overlay[data-size="l"] {
    --ring: 96px; position: relative; top: auto; left: auto; transform: none; order: 3; flex: none; align-self: center; flex-flow: row wrap; justify-content: center; gap: 6px 18px;
    padding: 12px 22px 12px 14px; background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 28px;
  }
  body.is-student .stage.speaker .breath-overlay[data-size="s"] { --ring: 72px; }
  body.is-student .stage.speaker .breath-overlay[data-size="l"] {
    --ring: 136px;
    /* geen glas: de gewone kleuren van het kaartje */
    --g-num: initial; --g-numtsh: initial; --g-ink: initial; --g-ink2: initial; --g-tsh: initial; --g-dotsh: initial; --g-line: initial; --g-line2: initial;
    --g-prog: initial; --g-mote: initial; --g-circle: initial; --g-circle-sh: initial; --g-halo: initial; --g-aura: initial;
  }
  body.is-student .stage.speaker .breath-overlay[data-theme="moon"] { --b-ink: #eef1f8; --b-ink2: #b9c3da; background: radial-gradient(120% 90% at 50% 0%, #283048 0%, #1a2030 62%); border-color: rgba(180, 194, 222, .22); }
  body.is-student .stage.speaker .breath-overlay[data-size="l"] .breath-aura { inset: -4%; }
  body.is-student .stage.speaker .breath-overlay[data-size="l"] .breath-ringsvg circle { stroke-width: 1.5; }
  body.is-student .stage.speaker .breath-overlay[data-size="l"] .breath-info { margin: 0; min-height: 0; }
  body.is-student .stage.speaker .breath-overlay[data-size="l"] .breath-count { transform: none; font-size: calc(var(--ring) * .25); }
  body.is-student .stage.speaker .breath-overlay[data-size="l"] .breath-text { font-size: clamp(19px, 3.7vmin, 24px); }
  body.is-student .stage.speaker .breath-overlay[data-size="l"] .breath-close { top: -10px; right: -10px; }
  body.is-student .stage.speaker .breath-overlay[data-size="l"] .breath-snd { top: -10px; left: -10px; }
  body.is-student .stage.speaker .breath-overlay[data-size="l"] .breath-vol { --g-ink: initial; --g-ink2: initial; border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; padding: 8px 0 0; margin: 0; width: 100%; background: none; }
  body.is-student .stage.speaker .breath-info { align-items: flex-start; }
  body.is-student .stage.speaker .breath-text { min-width: 5.5em; text-align: left; }
  body.is-student .stage.speaker .breath-vol { flex-basis: 100%; }
}

/* =====================================================================
   Grote letters (leerlingen): tekst en knoppen ongeveer een kwart groter.
   ===================================================================== */
body.large-text { font-size: 18.75px; }
body.large-text .btn { font-size: 17.5px; min-height: 50px; padding: 11px 22px; }
body.large-text .btn.small { font-size: 16px; min-height: 42px; padding: 8px 16px; }
body.large-text .btn.big { font-size: 19.5px; min-height: 64px; }
body.large-text #btnEnter, body.large-text #btnRejoin { min-height: 78px; font-size: 25px; }
body.large-text .tr-btn, body.large-text .lobby-form .btn.ghost, body.large-text .aa-btn { min-height: 68px; font-size: 20px; }
body.large-text .lobby-form .btn.ghost.small { min-height: 52px; font-size: 17px; }
body.large-text .aa-btn b { font-size: 26px; }
body.large-text input, body.large-text select, body.large-text textarea { font-size: 19px; min-height: 55px; }
body.large-text label, body.large-text .small { font-size: 16px; }
body.large-text .tr-title { font-size: 20px; }
body.large-text .tr-text, body.large-text .perm-intro, body.large-text .perm-box .help-steps li, body.large-text .tr-note { font-size: 20px; }
body.large-text .tr-tick { width: 40px; height: 40px; padding: 9px; }
body.large-text .tr-row { min-height: 88px; }
body.large-text .lobby-form h2 { font-size: clamp(34px, 3.6vw, 44px); }
body.large-text .not-started, body.large-text .form-error, body.large-text .devices summary, body.large-text .wake-status, body.large-text .diag p, body.large-text .diag-list, body.large-text .diag-tip { font-size: 17.5px; }
body.large-text .center-card h2 { font-size: 40px; }
body.large-text .center-card p { font-size: 20px; }
body.large-text .toast { font-size: 17.5px; max-width: 450px; padding: 14px 16px 14px 18px; }
body.large-text .sheet-dlg h3 { font-size: 30px; }
body.large-text .leave-dlg h3 { font-size: 31px; }
body.large-text .leave-dlg p, body.large-text .lh-item p, body.large-text .lh-list p, body.large-text .help-steps li, body.large-text .tips-list li, body.large-text .lobby-steps { font-size: 20px; }
body.large-text .perm-box .help-extra p { font-size: 20px; }
body.large-text .lh-item h4 { font-size: 26px; }
body.large-text .leave-actions .btn { min-height: 72px; font-size: 22.5px; }
body.large-text .help-extra p, body.large-text .dlg-body > p.muted { font-size: 17.5px; }
body.large-text .tips-title { font-size: 27px; }
body.large-text .tile-name { font-size: 16.5px; }
body.large-text .stage.speaker .gallery .tile-name { font-size: 14px; }
body.large-text .conn, body.large-text .banner, body.large-text .perm-note { font-size: 16.5px; }
body.large-text .rotate-hint { font-size: 18px; }
body.large-text .msg, body.large-text .chat-empty, body.large-text .people li { font-size: 18px; }
body.large-text .timer, body.large-text .tb-center { font-size: 17.5px; }
body.large-text .breath-overlay:not([data-size="s"]) .breath-text { font-size: clamp(22px, 4.5vmin, 27px); }
body.large-text .btn.sound-prompt { font-size: 25px; min-height: 90px; }
body.large-text .help-btn { min-height: 46px; font-size: 17.5px; }
body.large-text .view-toggle { min-height: 46px; }
/* werkbalk: hoger, grotere iconen en woorden */
body.large-text.is-student { --toolbar-h: 96px; }
body.large-text.is-student .toolbar .tool { height: 82px; min-height: 82px; gap: 5px; }
body.large-text.is-student .toolbar .tool .ti { width: 30px; height: 30px; }
body.large-text.is-student .toolbar .tool .tl { font-size: 15px; line-height: 1.12; }
body.large-text.is-student .tool .ti.aa { font-size: 25px; line-height: 30px; }
body.large-text.is-student #tLeave { min-height: 70px; font-size: 17.5px; }
body.large-text.sheet-mode .extra-tools .tool, body.large-text.sheet-mode .extra-tools .react-wrap .tool { height: 96px; }
body.large-text.sheet-mode .toolbar .extra-tools .tool .tl { font-size: 15.5px; }
@media (max-width: 720px) {
  body.large-text.is-student .toolbar .tool .tl { font-size: 13px; }
  body.large-text.is-student #tLeave { font-size: 15px; padding-left: 2px; padding-right: 2px; }
  body.large-text.sheet-mode .extra-tools { grid-template-columns: repeat(2, 1fr); }
  body.large-text .lobby-top { flex-wrap: wrap; }
  body.large-text .lobby-tools { flex-wrap: wrap; justify-content: flex-end; }
  body.large-text .aa-btn { white-space: nowrap; }
  /* past de knop niet meer naast de tekst, dan krijgt hij de hele breedte */
  body.large-text .tr-btn, body.large-text .tr-yn { flex: 1 1 100%; }
  body.large-text .tr-yn .tr-btn { flex: 1 1 0; }
  body.large-text .perm-box .tr-btn { width: 100%; }
}
@media (max-height: 520px) and (orientation: landscape) {
  body.large-text.is-student { --toolbar-h: 76px; }
  body.large-text.is-student .toolbar .tool { height: 68px; min-height: 68px; }
  body.large-text.is-student .toolbar .tool .tl { font-size: 13px; }
}

/* Start en Stop blijven in beeld, ook als het ademcirkel-paneel op een klein scherm moet schuiven. */
.breath-pop .timer-actions { position: sticky; bottom: -12px; margin: 0 -2px -2px; padding: 8px 2px 12px; background: var(--raised); }

/* Merk: subtiele "by"-regel in de footer van het beginscherm */
.home-by { margin-left: auto; color: var(--muted); font-size: 12.5px; text-decoration: none; opacity: .8; white-space: nowrap; }
.home-by:hover, .home-by:focus-visible { text-decoration: underline; opacity: 1; }
@media (max-width: 640px) { .home-foot { flex-wrap: wrap; } .home-by { margin-left: 28px; } }
@media (max-width: 480px) {
  .home-top { gap: 10px; }
  .brand { font-size: 15.5px; gap: 8px; min-width: 0; flex: 1 1 auto; }
  .home-right .lang-select { min-width: 9.5em; padding-left: 10px; }
  .brand span { white-space: nowrap; }
  .brand img { width: 28px; height: 28px; }
  .home-right { gap: 8px; }
  .home-clock { display: none; }
}


/* =====================================================================
   Fable-eindcontrole (16 nov 2026): rustiger, één kleurregel, grotere tikdoelen
   ===================================================================== */
/* startpagina: één hoofdknop per scherm */
.home-actions .lbl-t { display: none; }
.home-teacher .home-actions .lbl-t { display: inline; }
.home-teacher .home-actions .lbl-s { display: none; }
.home-actions { align-items: stretch; }
#btnJoinShow { order: 1; } #joinForm { order: 2; flex: 1 1 100%; margin: 0; } #linkHelp { order: 3; } #btnNew { order: 9; } #homeTools { order: 2; }
#home:not(.home-teacher) #btnNew { align-self: center; width: auto; min-height: 44px; font-size: 14px; padding: 8px 18px; color: var(--muted); }
#home:not(.home-teacher) #btnNew .bi { display: none; }
.home-teacher #btnNew { order: 1; } .home-teacher #homeTools { order: 2; } .home-teacher #btnJoinShow { order: 3; } .home-teacher #joinForm { order: 4; } .home-teacher #linkHelp { order: 5; }
.home-tools { flex: 1 1 100%; display: grid; gap: 8px; }
.home-tools-t { font-size: 13px; font-weight: 600; color: var(--muted); }
.home-tools-row { display: flex; gap: 10px; flex-wrap: wrap; }
.home-tools-row .btn { flex: 1 1 160px; }
.home-by { min-height: 44px; display: inline-flex; align-items: center; }
.home-right .lang-select, .lobby-tools select.lang-select { min-width: 9.5em; max-width: none; }
.lobby-top { flex-wrap: wrap; }
.lobby-top .lobby-brand { flex: 1 1 100%; white-space: nowrap; }
.lobby-tools { margin-left: 0; flex-wrap: wrap; }
.aa-btn { white-space: nowrap; }

/* "Verlaten" is niet het felste vlak: omlijnd; rood pas in de bevestigingsvraag */
#tLeave { background: transparent; border: 1.5px solid var(--line); color: var(--text); box-shadow: none; }
#tLeave:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-text); }

/* leerlingenwerkbalk: aan = groen met vinkje, uit = rood; ring blijft binnen het icoonvak */
body.is-student .toolbar .tool { gap: 7px; }
body.is-student #tMic:not(.off)::after, body.is-student #tCam:not(.off)::after {
  content: "✓"; position: absolute; top: 3px; left: 8px; font-size: 12px; font-weight: 700; line-height: 1; color: var(--ok);
}
body.is-student .toolbar .tool .tl { font-size: 12px; }
body.is-student .toolbar .tool { padding-left: 6px; padding-right: 6px; }
@media (min-width: 721px) { body.is-student .toolbar .tool .tl { font-size: 13px; } }
body.large-text.is-student .toolbar .tool .tl { font-size: 14px; }
body.is-student #tHand.active { background: var(--ochre); color: var(--on-ochre); }

/* tikdoelen van minstens 44 px */
.btn.small, .icon-btn, .help-btn, #btnTipsOk, #btnLeaveWaiting, #btnHome, .tile-more { min-height: 44px; }
.icon-btn { min-width: 44px; }
.tile-more { min-width: 44px; }
.stage.speaker .gallery .tile-more { min-width: 28px; min-height: 28px; }
label.check { min-height: 44px; align-items: center; }
.devices summary { min-height: 44px; display: flex; align-items: center; }
@media (max-width: 720px) {
  #peopleList .btn.small, .waiting-list .btn.small, .people .btn.small { min-height: 48px; }
  .tool { min-width: 44px; }
}

/* ademcirkel instellen: standaard vier ritmes, drie klanken en Start; de rest onder "Meer instellen" */
#breathPop:not(.more-open) .extra, #breathPop:not(.more-open) .breath-more { display: none; }
#breathPop.running .breath-setup { display: none; }
#breathPop.running .breath-toggle { display: none; }
/* loopt de oefening: grootte en alle klanken blijven bereikbaar */
#breathPop.running .chip.extra { display: inline-block; }
#breathPop.running p.breath-size { display: block; }
#breathPop.running .chips.breath-size { display: flex; }
.breath-toggle { width: 100%; justify-content: flex-start; color: var(--muted); }
.breath-toggle::before { content: "▸"; display: inline-block; transition: transform .15s var(--ease); }
.breath-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
#btnBreathStop:disabled, #btnTimerStop:disabled { display: none; }

/* inklapbare koppen: altijd een pijltje dat draait, zodat een dichte kop niet op een lege kop lijkt */
.sc-how > summary, .sc-causes > summary, .ad-edit > summary, .ad-cgroup > summary, .st-more > summary, .devices > summary, .gd-deep > summary, .gd-notice > summary, details.ad-card > summary, .ad-more > summary {
  list-style: none; display: flex; align-items: center; gap: 10px;
}
.sc-how > summary::-webkit-details-marker, .sc-causes > summary::-webkit-details-marker, .ad-edit > summary::-webkit-details-marker, .ad-cgroup > summary::-webkit-details-marker, .st-more > summary::-webkit-details-marker,
.devices > summary::-webkit-details-marker, .gd-deep > summary::-webkit-details-marker, .gd-notice > summary::-webkit-details-marker, details.ad-card > summary::-webkit-details-marker, .ad-more > summary::-webkit-details-marker { display: none; }
.sc-how > summary::after, .sc-causes > summary::after, .ad-edit > summary::after, .ad-cgroup > summary::after, .st-more > summary::after, .devices > summary::after, .gd-deep > summary::after, .gd-notice > summary::after, details.ad-card > summary::after, .ad-more > summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin: -4px 4px 0 auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: .7; transition: transform .15s var(--ease);
}
details[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }

#ended.host-ended #btnHome { order: -1; min-height: 64px; padding: 16px 34px; font-size: 20px; border-radius: 18px; }
#ended.host-ended #btnRejoin { min-height: 44px; padding: 8px 18px; font-size: 14px; border-radius: 999px; }
#ended .row.center { flex-wrap: wrap; }

/* ---------- ademcirkel: timer, voortgang en programma's ---------- */
.breath-progs { margin: 0 0 12px; }
.breath-progs-toggle { width: 100%; justify-content: flex-start; min-height: 44px; }
.breath-progs-toggle::before { content: "▸"; display: inline-block; margin-right: 6px; transition: transform .15s var(--ease); }
.breath-progs-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.breath-proglist { display: grid; gap: 10px; margin-top: 8px; }
.breath-prog { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.prog-start { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 52px; padding: 8px 14px; text-align: left; }
.prog-start b { font: 600 15px/1.25 var(--font); overflow-wrap: anywhere; }
.prog-start small { font: 500 12.5px/1.3 var(--font); opacity: .9; }
.prog-actions { display: flex; gap: 6px; }
.prog-actions .btn, .prog-new { flex: 1; justify-content: center; min-height: 44px; }
.prog-new { width: 100%; }
.breath-prog .pop-note.warn { margin: 0; }
#breathPop.editing > :not(#breathEditor) { display: none; }
.breath-editor { display: grid; gap: 10px; }
.breath-editor > * { margin: 0; }
.breath-editor input[type="text"] { width: 100%; min-height: 44px; }
.breath-steps { display: grid; gap: 10px; }
.breath-step { padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.step-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.step-btns { display: flex; gap: 6px; }
.ed-mv { min-width: 44px; min-height: 44px; justify-content: center; padding: 0; }
.ed-mv:disabled { opacity: .35; }
.step-fields { grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 0; }
.step-fields input { min-height: 44px; padding: 8px 2px; }
.breath-editor .btn.wide { justify-content: center; min-height: 44px; }
.breath-editor .check { margin: 0; min-height: 44px; }
.breath-ed-actions .btn { min-height: 48px; }
#breathDur .chip { min-height: 44px; }

/* opname-keuze en muziek-ducking */
.rec-dlg { border: 1px solid var(--line); border-radius: 18px; background: var(--raised); color: var(--text); padding: 18px; width: min(420px, calc(100vw - 32px)); }
.rec-dlg::backdrop { background: rgba(0, 0, 0, .4); }
/* Telefoon: een compact venster in het midden, niet het hele scherm (de algemene dialoogregel maakt dialogen daar schermvullend). */
@media (max-width: 720px) { dialog.rec-dlg { width: calc(100vw - 24px); max-width: 420px; height: fit-content; max-height: 92dvh; margin: auto; border: 1px solid var(--line); border-radius: 22px; } }
.rec-opts { display: grid; gap: 10px; margin-bottom: 14px; }
.rec-opt { display: grid; gap: 3px; text-align: left; min-height: 64px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.rec-opt b { font: 600 15px/1.3 var(--font); }
.rec-opt small { font: 400 13px/1.4 var(--font); color: var(--muted); }
.rec-opt.on { border-color: var(--cta); background: var(--accent-soft); }
.duck-box { margin: 0 0 10px; padding: 10px 0 0; border-top: 1px solid var(--line-soft); }
.duck-box .chip { min-height: 44px; }
.duck-box .pop-range label { flex: 1; }

/* ademklanken: groepen met een luister-knop per klank */
#breathSounds { display: flex; flex-wrap: wrap; gap: 6px; }
#breathSounds .grp { flex: 1 0 100%; margin: 6px 4px 0; font: 600 12.5px/1.3 var(--font); color: var(--muted); }
#breathSounds .snd { display: inline-flex; align-items: stretch; }
#breathSounds .snd .chip { min-height: 44px; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
#breathSounds .snd .snd-play { min-height: 44px; min-width: 44px; border: 1px solid var(--line); border-left: 1px solid var(--line-soft); background: var(--surface); color: var(--accent-text); border-radius: 0 999px 999px 0; cursor: pointer; font-size: 14px; }
#breathSounds .snd .chip.on + .snd-play { border-color: var(--accent); background: var(--accent-soft); }
#breathSounds .snd .snd-play:hover { background: var(--surface-2); }
#breathPop:not(.more-open) #breathSounds .extra, #breathPop:not(.more-open) #breathSounds .grp { display: none; }
#breathPop.running #breathSounds .extra { display: inline-flex; }
#breathPop.running #breathSounds .grp { display: block; }
#breathRooms .chip, #breathBeds .chip { min-height: 44px; }
@media (max-width: 480px) { .ml-item .ml-code { display: none; } }

/* Eigen klank van de ademcirkel (dit apparaat): keuzelijst met luisterknop */
.set-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.set-row select { flex: 1; min-width: 0; margin: 0; }
.set-row .btn { flex: none; min-height: 44px; }
.breath-vol select { width: 100%; margin-top: 2px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
