/* Layout: one column on phones; on wide screens the room becomes stage (left) + control rail (right).
   Palette: lapis (Gast A), garnet (Gast B), brass (Moderator & Zeit) on a cool paper ground. */
:root {
  --paper: #f2f4f1;
  --surface: #ffffff;
  --sunken: #e7ebe6;
  --line: #d3dad3;
  --ink: #15211d;
  --muted: #5b6a64;
  --lapis: #24509c;
  --lapis-soft: #e2e9f6;
  --garnet: #8e2c45;
  --garnet-soft: #f5e3e8;
  --brass: #9a7426;
  --brass-soft: #f4ecd9;
  --ok: #2f7a4f;
  --warn: #b7791f;
  --bad: #b3261e;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgb(20 33 29 / 8%), 0 8px 24px rgb(20 33 29 / 6%);
  --f-display: 'Amiri', 'Noto Naskh Arabic', Georgia, 'Times New Roman', serif;
  --f-body: 'IBM Plex Sans Arabic', 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1412; --surface: #141d1a; --sunken: #1b2622; --line: #2a3833; --ink: #e5ece8; --muted: #93a39c;
    --lapis: #86a8ea; --lapis-soft: #1a2640; --garnet: #e58aa0; --garnet-soft: #351a22; --brass: #d9b56a; --brass-soft: #2e2715;
    --ok: #6cc596; --warn: #e5b45a; --bad: #f08a80; --on-accent: #0d1412;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1412; --surface: #141d1a; --sunken: #1b2622; --line: #2a3833; --ink: #e5ece8; --muted: #93a39c;
  --lapis: #86a8ea; --lapis-soft: #1a2640; --garnet: #e58aa0; --garnet-soft: #351a22; --brass: #d9b56a; --brass-soft: #2e2715;
  --ok: #6cc596; --warn: #e5b45a; --bad: #f08a80; --on-accent: #0d1412;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 30%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
a { color: var(--lapis); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.eyebrow { font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
[dir="rtl"] .eyebrow { letter-spacing: 0; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 600;
  font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.brass { background: var(--brass); border-color: var(--brass); color: var(--on-accent); }
.btn.lapis { background: var(--lapis); border-color: var(--lapis); color: var(--on-accent); }
.btn.garnet { background: var(--garnet); border-color: var(--garnet); color: var(--on-accent); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.big { min-height: 52px; font-size: 16px; padding: 0 20px; border-radius: 10px; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.6; }
.input:focus { border-color: var(--brass); outline: none; box-shadow: 0 0 0 3px var(--brass-soft); }
.switch { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.switch input { appearance: none; flex: none; width: 40px; height: 24px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); transition: inset-inline-start .15s; box-shadow: 0 1px 2px rgb(0 0 0 / 25%); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { inset-inline-start: 19px; }
.switch b { display: block; font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--sunken); color: var(--muted); white-space: nowrap; }
.chip.live { background: var(--bad); color: var(--on-accent); }
.chip.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
.chip.A { background: var(--lapis-soft); color: var(--lapis); }
.chip.B { background: var(--garnet-soft); color: var(--garnet); }
.chip.host { background: var(--brass-soft); color: var(--brass); }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- top bar ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 58px; padding-block: 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-size: 22px; font-weight: 700; cursor: pointer; }
.brand svg { width: 28px; height: 28px; color: var(--brass); flex: none; }
.brand small { font-family: var(--f-body); font-size: 12px; color: var(--muted); font-weight: 500; }

/* ---------- auth ---------- */
.auth { min-height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--ink); color: var(--paper); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art h1 { font-family: var(--f-display); font-size: clamp(40px, 6vw, 72px); line-height: 1.05; font-weight: 700; }
.auth-art h1 span { color: var(--brass); display: block; font-size: .62em; }
.auth-art p { max-width: 38ch; opacity: .8; font-size: 17px; }
.auth-art .pattern { position: absolute; inset-inline-end: -120px; bottom: -120px; width: 420px; height: 420px; color: var(--brass); opacity: .18; }
.auth-art ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; max-width: 42ch; }
.auth-art li { display: flex; gap: 10px; opacity: .85; }
.auth-art li b { color: var(--brass); font-family: var(--f-mono); font-weight: 500; }
.auth-form { padding: 48px max(24px, env(safe-area-inset-right, 0px)) 48px max(24px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; justify-content: center; gap: 18px; max-width: 460px; width: 100%; margin: 0 auto; }
.tabs { display: flex; gap: 4px; background: var(--sunken); padding: 4px; border-radius: 10px; }
.tabs button { flex: 1; min-height: 38px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.error { color: var(--bad); font-size: 14px; min-height: 1.2em; }
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 32px 20px 28px; }
  .auth-art ul { display: none; }
}

/* ---------- home ---------- */
.page { padding-block: 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-family: var(--f-display); font-size: 34px; }
.joinbar { display: flex; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.joinbar .input { flex: 1; min-width: 180px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: var(--muted); box-shadow: var(--shadow); }
.card h3 { font-family: var(--f-display); font-size: 21px; line-height: 1.25; }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; }
.vs .a { color: var(--lapis); } .vs .b { color: var(--garnet); text-align: end; }
.vs i { font-style: normal; color: var(--muted); font-family: var(--f-display); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }

/* ---------- create ---------- */
.form-sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.form-sec h2 { font-family: var(--f-display); font-size: 23px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.side-box { border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.side-box.A { background: var(--lapis-soft); } .side-box.B { background: var(--garnet-soft); } .side-box.host { background: var(--brass-soft); }
.side-box h3 { font-size: 15px; }
.side-box.A h3 { color: var(--lapis); } .side-box.B h3 { color: var(--garnet); } .side-box.host h3 { color: var(--brass); }
.seg-list { display: flex; flex-direction: column; gap: 8px; }
.seg-row { display: grid; grid-template-columns: 28px 1.3fr 1fr 78px auto auto; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.seg-row .num { font-family: var(--f-mono); color: var(--muted); text-align: center; font-size: 13px; }
.seg-row .input { min-height: 38px; padding: 6px 8px; }
.seg-row .tools { display: flex; gap: 2px; }
.seg-row .ij { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 720px) {
  .seg-row { grid-template-columns: 28px 1fr 1fr; }
  .seg-row .min, .seg-row .ij, .seg-row .tools { grid-column: span 1; }
  .seg-row .tools { grid-column: 2 / span 2; justify-content: flex-end; }
}
.tpl { display: flex; gap: 8px; flex-wrap: wrap; }
.timebar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--sunken); }
.timebar span { display: block; height: 100%; }
.timebar .A { background: var(--lapis); } .timebar .B { background: var(--garnet); } .timebar .host { background: var(--brass); }
.timebar .both { background: linear-gradient(90deg, var(--lapis), var(--garnet)); } .timebar .none { background: var(--line); }
.sticky-actions { position: sticky; bottom: 0; padding-block: 12px calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, var(--paper) 30%); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- room ---------- */
.room { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; padding-block: 16px 40px; align-items: start; }
@media (max-width: 980px) { .room { grid-template-columns: 1fr; } }
.room-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.room-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.room-head h1 { font-family: var(--f-display); font-size: clamp(24px, 3.2vw, 34px); line-height: 1.15; }
.room-head .topic { color: var(--muted); max-width: 70ch; }

.stage { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { position: relative; aspect-ratio: 4 / 3; max-width: 100%; border-radius: 12px; overflow: hidden; background: var(--sunken); border: 2px solid transparent; transition: border-color .2s, box-shadow .2s; }
.tile.A { --side: var(--lapis); --side-soft: var(--lapis-soft); } .tile.B { --side: var(--garnet); --side-soft: var(--garnet-soft); } .tile.host { --side: var(--brass); --side-soft: var(--brass-soft); }
.tile.floor { border-color: var(--side); box-shadow: 0 0 0 4px color-mix(in srgb, var(--side) 22%, transparent); }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.tile .avatar { position: absolute; inset: 0; display: grid; place-items: center; background: var(--side-soft); }
.tile .avatar b { width: 34%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-size: clamp(28px, 5vw, 54px); color: var(--on-accent); background: var(--side); }
.tile.speaking .avatar b { animation: talk 1.1s ease-in-out infinite; }
@keyframes talk { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--side) 18%, transparent); } }
.tile .meta { position: absolute; inset-inline: 0; bottom: 0; padding: 22px 10px 8px; background: linear-gradient(transparent, rgb(0 0 0 / 62%)); color: #fff; display: flex; align-items: flex-end; gap: 8px; }
.tile .meta .who { flex: 1; min-width: 0; }
.tile .meta b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .meta small { display: block; font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .tag { position: absolute; top: 8px; inset-inline-start: 8px; background: var(--side); color: var(--on-accent); padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.tile .micstate { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / 45%); }
.tile .micstate.locked { background: #b3261e; }
.tile .micstate svg { width: 15px; height: 15px; }
.tile .used { position: absolute; top: 8px; inset-inline-end: 8px; background: rgb(0 0 0 / 50%); color: #fff; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-family: var(--f-mono); }
.tile.offline .avatar b { opacity: .45; }
.host-strip { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.host-strip .tile { width: 112px; aspect-ratio: 4 / 3; flex: none; border-radius: 8px; }
.host-strip .tile .meta { padding: 4px 6px; } .host-strip .tile .meta b { font-size: 12px; } .host-strip .tile .meta small, .host-strip .tile .tag, .host-strip .tile .used { display: none; }
.host-strip .tile .avatar b { font-size: 22px; }

/* the clock */
.clock { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.clock .seg-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.clock .seg-line h2 { font-family: var(--f-display); font-size: 24px; }
.clock .digits { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: clamp(56px, 11vw, 104px); line-height: 1; font-weight: 500; letter-spacing: -.02em; color: var(--ink); direction: ltr; }
.clock .digits.warn { color: var(--warn); } .clock .digits.danger { color: var(--bad); } .clock .digits.over { color: var(--bad); animation: pulse 1s infinite; }
.clock .main { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.clock .who-floor { font-size: 17px; font-weight: 600; }
.clock .who-floor .A { color: var(--lapis); } .clock .who-floor .B { color: var(--garnet); } .clock .who-floor .host { color: var(--brass); }
.progress { height: 8px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brass); border-radius: inherit; transition: width .25s linear; }
.progress.warn span { background: var(--warn); } .progress.danger span, .progress.over span { background: var(--bad); }
.overlay-banner { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--brass-soft); border: 1px solid color-mix(in srgb, var(--brass) 40%, transparent); flex-wrap: wrap; }
.overlay-banner.A { background: var(--lapis-soft); border-color: color-mix(in srgb, var(--lapis) 40%, transparent); }
.overlay-banner.B { background: var(--garnet-soft); border-color: color-mix(in srgb, var(--garnet) 40%, transparent); }
.overlay-banner .od { font-family: var(--f-mono); font-size: 30px; font-variant-numeric: tabular-nums; direction: ltr; }
.overlay-banner .ot { flex: 1; min-width: 160px; }
.overlay-banner .ot b { display: block; }
.next-up { font-size: 13px; color: var(--muted); }
.question-screen { background: var(--ink); color: var(--paper); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.question-screen p { margin: 0; font-family: var(--f-display); font-size: 21px; line-height: 1.4; }

.agenda { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.agenda button { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: start; min-width: 118px; border-top: 3px solid var(--line); }
.agenda button.A { border-top-color: var(--lapis); } .agenda button.B { border-top-color: var(--garnet); } .agenda button.host { border-top-color: var(--brass); }
.agenda button.both { border-top-color: var(--muted); }
.agenda button.cur { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.agenda button.done { opacity: .55; }
.agenda button:disabled { cursor: default; }
.agenda b { font-size: 13px; } .agenda small { font-size: 12px; font-family: var(--f-mono); opacity: .8; }

.rail { display: flex; flex-direction: column; gap: 12px; position: sticky; top: calc(70px + env(safe-area-inset-top, 0px)); min-width: 0; }
@media (max-width: 980px) { .rail { position: static; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-width: 0; }
.panel-tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.panel-tabs button { flex: 1; min-height: 44px; padding: 0 10px; border: 0; background: transparent; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; position: relative; }
.panel-tabs button.on { color: var(--ink); border-bottom-color: var(--brass); }
.panel-tabs .badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: var(--on-accent); font-size: 11px; margin-inline-start: 4px; }
.panel-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; max-height: 64vh; overflow-y: auto; }
@media (max-width: 980px) { .panel-body { max-height: none; } }
.ctl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ctl-grid .btn { width: 100%; padding: 0 6px; }
.ctl-grid .wide { grid-column: span 3; }
.sub { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }
[dir="rtl"] .sub { letter-spacing: 0; }
.seg3 { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg3 button { border: 0; background: var(--surface); padding: 6px 10px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg3 button + button { border-inline-start: 1px solid var(--line); }
.seg3 button.on { background: var(--ink); color: var(--paper); }
.item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); }
.item p { margin: 0; overflow-wrap: anywhere; }
.item.pending { border-color: color-mix(in srgb, var(--brass) 60%, transparent); background: var(--brass-soft); }
.log { display: flex; flex-direction: column; gap: 0; font-size: 13px; }
.log div { display: grid; grid-template-columns: 62px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.log time { font-family: var(--f-mono); color: var(--muted); direction: ltr; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stat-table th, .stat-table td { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: start; }
.stat-table td { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.stat-table th.A { color: var(--lapis); } .stat-table th.B { color: var(--garnet); }
.balance { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--sunken); }
.balance .A { background: var(--lapis); } .balance .B { background: var(--garnet); }
.guest-actions { display: flex; flex-direction: column; gap: 8px; }
.hint { font-size: 13px; color: var(--muted); }
.notice { padding: 10px 12px; border-radius: 8px; background: var(--sunken); font-size: 14px; }
.notice.warn { background: var(--brass-soft); }
.adab { white-space: pre-line; line-height: 1.8; font-size: 14.5px; }
.invite { display: flex; flex-direction: column; gap: 6px; }
.invite code { display: block; padding: 8px 10px; background: var(--sunken); border-radius: 6px; font-family: var(--f-mono); font-size: 12px; overflow-wrap: anywhere; user-select: all; direction: ltr; text-align: start; }
.media-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.reactions { display: flex; gap: 6px; }
.reactions button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 18px; }
.floaters { position: fixed; inset-inline-end: max(24px, env(safe-area-inset-right, 0px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); pointer-events: none; z-index: 20; }
.floaters span { position: absolute; bottom: 0; inset-inline-end: 0; font-size: 28px; animation: float 2.4s ease-out forwards; }
@keyframes float { to { transform: translateY(-220px); opacity: 0; } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; z-index: 50; box-shadow: var(--shadow); max-width: calc(100% - 32px); font-size: 14px; }
.demo-bar { background: var(--brass-soft); border-bottom: 1px solid color-mix(in srgb, var(--brass) 35%, transparent); }
.demo-bar .wrap { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-block: 8px; font-size: 13.5px; }
.demo-bar .seg3 button { padding: 6px 12px; }
.ended-card { text-align: center; padding: 24px 16px; }
.ended-card h2 { font-family: var(--f-display); font-size: 28px; }

@media (max-width: 560px) {
  .stage { gap: 6px; }
  .tile .meta { padding: 16px 6px 6px; } .tile .meta b { font-size: 13px; } .tile .meta small { display: none; }
  .clock { padding: 14px; }
  .page-head h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* video above the avatar placeholder */
.tile video { position: absolute; inset: 0; z-index: 1; }
.tile .meta, .tile .tag, .tile .used { z-index: 2; }
.topbar .wrap > * { flex-shrink: 0; }
.topbar .brand { min-width: 0; flex-shrink: 1; }
@media (max-width: 560px) {
  .topbar .wrap { gap: 6px; }
  .brand { font-size: 19px; gap: 6px; }
  .brand small, #presence { display: none; }
  .topbar .btn.sm { padding: 0 8px; }
  .host-strip { flex-wrap: wrap; }
  .host-strip .grow { flex-basis: calc(100% - 130px); }
  .host-strip .reactions { width: 100%; justify-content: space-around; }
}

/* ================= v2: camera layouts, voice glow, time line ================= */
.stage-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.stage-tools .seg3 button { padding: 6px 12px; }
.size-ctl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.size-ctl input { width: 120px; accent-color: var(--brass); }
.wide-btn svg { width: 15px; height: 15px; }
.room.wide { grid-template-columns: 1fr; }
.room.wide .rail { position: static; display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); align-items: start; }
@media (max-width: 980px) { .wide-btn { display: none; } .room.wide .rail { display: flex; } }

.stage { margin-inline: auto; width: 100%; transition: max-width .2s; }
.stage .tile { aspect-ratio: 4 / 3; cursor: grab; }
.stage .tile.dragging { opacity: .45; }
.stage .tile.drop-target { outline: 3px dashed var(--brass); outline-offset: 2px; }
/* Bühne: Gast A | Moderator | Gast B */
.stage.l-stage { grid-template-columns: minmax(0, 1fr) minmax(0, .46fr) minmax(0, 1fr); align-items: center; }
.stage.l-stage .tile.host { aspect-ratio: 3 / 4; }
/* Sprecher groß */
.stage.l-speaker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stage.l-speaker .tile { aspect-ratio: 16 / 9; }
.stage.l-speaker .tile.big { grid-column: 1 / -1; order: -1 !important; aspect-ratio: 16 / 9; }
/* Raster */
.stage.l-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) {
  .stage.l-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage.l-stage .tile.host { grid-column: 1 / -1; order: 9 !important; aspect-ratio: 16 / 9; width: 62%; justify-self: center; }
  .stage.l-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage.l-grid .tile:nth-child(3) { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
  .size-ctl input { width: 90px; }
}
.tile .tile-top { position: absolute; inset: 8px 8px auto; z-index: 3; display: flex; gap: 6px; align-items: center; }
.tile .tile-top .tag, .tile .tile-top .used { position: static; }
.tile .tile-tools { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.tile:hover .tile-tools, .tile:focus-within .tile-tools, .tile.pinned .tile-tools { opacity: 1; }
@media (hover: none) { .tile .tile-tools { opacity: .9; } }
.tile .tile-tools button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgb(0 0 0 / 55%); color: #fff; display: grid; place-items: center; cursor: pointer; }
.tile .tile-tools button:hover { background: rgb(0 0 0 / 78%); }
.tile .tile-tools svg { width: 15px; height: 15px; }
.tile.pinned .tile-tools [data-tile-act="pin"] { background: var(--brass); color: var(--on-accent); }
.tile:fullscreen { border-radius: 0; border: 0; aspect-ratio: auto; }
.tile:fullscreen video { object-fit: contain; }
.tile .tile-time { position: absolute; inset: auto 0 0; height: 4px; z-index: 3; background: rgb(255 255 255 / 18%); }
.tile .tile-time span { display: block; height: 100%; width: 0; background: var(--side); }
.tile:not(.floor) .tile-time { display: none; }

/* voice activity */
.tile .micstate { transition: background .12s; position: relative; }
.tile.talking { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 85%, transparent), 0 0 calc(10px + var(--lvl, 0) * 30px) color-mix(in srgb, var(--ok) 45%, transparent); }
.tile.talking .micstate { background: var(--ok); color: #fff; box-shadow: 0 0 0 calc(var(--lvl, 0) * 10px) color-mix(in srgb, var(--ok) 35%, transparent); }
.tile.talking .avatar b { box-shadow: 0 0 0 calc(var(--lvl, 0) * 22px) color-mix(in srgb, var(--side) 22%, transparent); }
.tile.speaking .avatar b { animation: none; }
.btn.talking { border-color: var(--ok); color: var(--ok); box-shadow: 0 0 0 calc(var(--lvl, 0) * 8px) color-mix(in srgb, var(--ok) 25%, transparent); }

.host-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.host-bar .grow { min-width: 160px; }

/* time line: depletes smoothly; colour = who has the floor */
.timeline { --tl: var(--brass); position: relative; height: 14px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.timeline.side-A { --tl: var(--lapis); } .timeline.side-B { --tl: var(--garnet); }
.timeline.side-both { --tl: color-mix(in srgb, var(--lapis) 50%, var(--garnet)); }
.timeline.warn { --tl: var(--warn); } .timeline.danger { --tl: var(--bad); }
.timeline .tl-track { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.timeline .tl-track i { position: absolute; top: 3px; bottom: 3px; width: 2px; margin-inline-start: -1px; background: var(--surface); opacity: .55; border-radius: 1px; }
.timeline .tl-fill { position: absolute; inset-block: 0; inset-inline-start: 0; width: 100%; border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tl) 78%, var(--surface)), var(--tl)); }
[dir="rtl"] .timeline .tl-fill { background: linear-gradient(270deg, color-mix(in srgb, var(--tl) 78%, var(--surface)), var(--tl)); }
.timeline .tl-fill::after { content: ""; position: absolute; inset-block: 1px; inset-inline-end: 1px; width: 12px; border-radius: 50%; background: var(--surface); opacity: .9; box-shadow: 0 0 8px var(--tl); }
.timeline.paused .tl-fill { background: repeating-linear-gradient(45deg, var(--tl) 0 8px, color-mix(in srgb, var(--tl) 70%, var(--surface)) 8px 16px); }
.timeline.over { background: repeating-linear-gradient(45deg, var(--bad) 0 10px, color-mix(in srgb, var(--bad) 70%, var(--surface)) 10px 20px); animation: pulse 1s infinite; }
.tl-scale { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 12px; color: var(--muted); direction: ltr; }
[dir="rtl"] .tl-scale { flex-direction: row-reverse; }
.overlay-banner { position: relative; overflow: hidden; }
.overlay-banner .ov-line { position: absolute; inset: auto 0 0; height: 4px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.overlay-banner .ov-line span { display: block; height: 100%; width: 100%; background: var(--brass); }
.overlay-banner.A .ov-line span { background: var(--lapis); } .overlay-banner.B .ov-line span { background: var(--garnet); }
.clock { gap: 12px; }
/* tiles adapt to their own width */
.tile { container-type: inline-size; }
.tile .avatar b { font-size: clamp(16px, 13cqi, 56px); }
.tile .tag { white-space: nowrap; }
@container (max-width: 280px) {
  .tile .used, .tile .meta small { display: none; }
  .tile .meta b { font-size: 13px; }
  .tile .tile-tools button { width: 26px; height: 26px; }
  .tile .tile-top { inset: 6px 6px auto; }
}
@container (max-width: 160px) { .tile .tag, .tile .tile-tools button:not([data-tile-act=max]) { display: none; } }
.brand .ver { font-family: var(--f-mono); font-size: 11px; opacity: .75; }
@media (max-width: 560px) { .brand .ver { display: none; } }

/* ================= v1.4: documents on stage, comments, audience view ================= */
.doc-view { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.doc-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.doc-title { display: flex; gap: 8px; align-items: center; min-width: 0; flex: 1 1 200px; }
.doc-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.doc-nav, .doc-tools { display: flex; gap: 6px; align-items: center; }
.doc-pg { width: 70px; min-height: 32px; padding: 4px 6px; text-align: center; }
.doc-search { display: flex; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.doc-search .input { min-height: 36px; }
.doc-results { max-height: 180px; overflow-y: auto; padding: 6px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.doc-hit { display: grid; grid-template-columns: 74px 1fr; gap: 8px; text-align: start; border: 0; background: transparent; padding: 6px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.doc-hit:hover { background: var(--sunken); }
.doc-hit .mono { color: var(--muted); }
.doc-query { padding: 6px 12px; border-bottom: 1px solid var(--line); }
mark { background: #ffd54a; color: #1b1b1b; border-radius: 2px; padding: 0 1px; }
.doc-page { position: relative; overflow: auto; max-height: 72vh; min-height: 260px; background: var(--sunken); padding: 8px; }
.doc-sheet { display: flex; justify-content: center; }
.doc-sheet img { display: block; max-width: none; border-radius: 4px; box-shadow: var(--shadow); }
.doc-canvas { position: relative; background: #fff; box-shadow: var(--shadow); flex: none; }
.doc-canvas canvas { display: block; }
.doc-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
/* pdf.js text layer (invisible text for selection + highlighting) */
.textLayer { position: absolute; inset: 0; overflow: hidden; line-height: 1; text-align: initial; opacity: 1; transform-origin: 0 0; z-index: 2; }
.textLayer span, .textLayer br { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0 0; }
.textLayer mark { color: transparent; background: rgb(255 200 0 / 55%); padding: 0; border-radius: 2px; }
.textLayer span.hit { background: rgb(255 200 0 / 35%); }
.textLayer ::selection { background: rgb(36 80 156 / 30%); }

/* stage while a document is shown: document big, all cameras in a small strip */
.stage.sharing { grid-template-columns: minmax(0, 1fr) minmax(140px, 200px) !important; align-items: start; }
.stage.sharing .doc-view { grid-column: 1; grid-row: 1 / span 4; order: -5 !important; }
.stage.sharing .tile, .stage.sharing .tile.big, .stage.sharing .tile.host { grid-column: 2 !important; aspect-ratio: 4 / 3 !important; width: auto !important; justify-self: stretch !important; }
@media (max-width: 760px) {
  .stage.sharing { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .stage.sharing .doc-view { grid-column: 1 / -1; grid-row: auto; }
  .stage.sharing .tile, .stage.sharing .tile.big, .stage.sharing .tile.host { grid-column: auto !important; order: 1 !important; }
  .doc-page { max-height: 60vh; }
}

/* documents panel */
.drop { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; padding: 18px 12px; border: 2px dashed var(--line); border-radius: 10px; cursor: pointer; background: var(--paper); }
.drop:hover, .drop.over { border-color: var(--brass); background: var(--brass-soft); }
.doc-ico { flex: none; width: 40px; height: 48px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--on-accent); background: var(--bad); }
.doc-ico.img { background: var(--lapis); }
.progress { height: 6px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brass); }

/* comments */
.comments { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.cmt { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.cmt p { margin: 2px 0 0; overflow-wrap: anywhere; white-space: pre-line; }
.cmt.host { border-color: color-mix(in srgb, var(--brass) 45%, transparent); background: var(--brass-soft); }
.cmt-form textarea { min-height: 60px; }

/* audience: calm view – picture, time, agenda, mic states, comments */
.room.aud .stage-tools, .room.aud #reactBar, .room.aud #mediaBar:empty { display: none !important; }
.room.aud .tile-tools [data-tile-act=menu] { display: none; }
.room.aud .tile { cursor: default; }

/* v1.4.1: all tabs always visible – wrap to a second row instead of hiding off-screen */
.panel-tabs { flex-wrap: wrap; overflow: visible; }
.panel-tabs button { flex: 1 1 auto; min-height: 40px; border-bottom: 2px solid transparent; }

/* ================= v1.5: time ring, tile menu, AV settings ================= */
.tile .tile-ring { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible; opacity: 0; transition: opacity .25s; }
.tile .tile-ring path { fill: none; stroke-width: 5; stroke-linecap: round; }
.tile .tile-ring .rt { stroke: color-mix(in srgb, var(--side) 22%, transparent); }
.tile .tile-ring .rf { stroke: var(--side); stroke-dasharray: 100 100; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--side) 70%, transparent)); }
.stage.munazara .tile.ring-on .tile-ring { opacity: 1; }
.stage.munazara .tile.ring-on { border-color: transparent; box-shadow: none; }
.stage.munazara .tile.ring-on.talking { box-shadow: 0 0 calc(10px + var(--lvl, 0) * 30px) color-mix(in srgb, var(--ok) 45%, transparent); }
.stage.munazara .tile .tile-time { display: none; }
.tile.ring-warn .tile-ring .rf { stroke: var(--warn); filter: drop-shadow(0 0 5px var(--warn)); }
.tile.ring-danger .tile-ring .rf { stroke: var(--bad); filter: drop-shadow(0 0 6px var(--bad)); }
.tile.ring-ovl .tile-ring .rf { stroke: var(--brass); filter: drop-shadow(0 0 5px var(--brass)); }
.tile.ring-over .tile-ring .rf { stroke: var(--bad); animation: pulse 1s infinite; }
.tile.ring-paused .tile-ring .rf { stroke-opacity: .55; filter: none; }
.tile .micstate { border: 0; padding: 0; color: #fff; cursor: default; }
.tile .micstate.ctl { cursor: pointer; }
.tile .micstate.ctl:hover { outline: 2px solid #fff; outline-offset: 1px; }

.ctx-menu { position: fixed; z-index: 60; min-width: 230px; max-width: calc(100vw - 16px); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgb(0 0 0 / 25%); padding: 6px; display: flex; flex-direction: column; }
.ctx-menu button { text-align: start; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; color: inherit; }
.ctx-menu button:hover:not([disabled]), .ctx-menu button:focus-visible { background: var(--sunken); }
.ctx-menu button[disabled] { opacity: .4; cursor: default; }
.ctx-head { display: flex; gap: 8px; align-items: center; padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.ctx-sec { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px 2px; }
[dir="rtl"] .ctx-sec { letter-spacing: 0; }
.ctx-sec small { text-transform: none; font-weight: 500; letter-spacing: 0; }
.ctx-row { display: flex; gap: 4px; padding: 0 4px; }
.ctx-row button { flex: 1; text-align: center; background: var(--sunken); font-family: var(--f-mono); font-size: 13px; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 6px; }

.modal { position: fixed; inset: 0; z-index: 70; background: rgb(10 16 14 / 55%); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); overflow-y: auto; }
.modal-card { background: var(--surface); color: var(--ink); border-radius: 16px; padding: 20px; width: min(720px, 100%); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgb(0 0 0 / 35%); }
.modal-card h2 { font-family: var(--f-display); font-size: 26px; }
.av-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 640px) { .av-grid { grid-template-columns: 1fr; } }
.av-preview { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; max-width: 100%; }
.av-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-level { position: absolute; inset: auto 10px 10px; height: 6px; border-radius: 99px; background: rgb(255 255 255 / 25%); overflow: hidden; }
.av-level span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s; }
.av-bg { display: flex; flex-wrap: wrap; }
.av-bg button { flex: 1 1 auto; padding: 8px 12px; }
.av-presets { gap: 8px; }
.av-presets .preset { min-width: 92px; min-height: 52px; border-radius: 10px; border: 2px solid transparent; color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; display: grid; place-items: center; text-shadow: 0 1px 2px rgb(0 0 0 / 50%); }
.av-presets label.preset { background: var(--sunken); color: var(--ink); text-shadow: none; border: 2px dashed var(--line); }
.av-presets .preset.on { border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-soft); }

/* audience: TV-style – speaker large, time compact */
.room.aud .host-bar { display: none; }
.room.aud .clock { padding: 12px 16px; gap: 8px; }
.room.aud .clock .digits { font-size: clamp(34px, 6vw, 56px); }
.room.aud .clock .seg-line h2 { font-size: 20px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.tile .used { white-space: nowrap; }
@container (max-width: 340px) { .tile:hover .used, .tile:focus-within .used { display: none; } }

/* ================= v1.6: navigation, avatars, discover, profile, legal ================= */
.mainnav { display: flex; gap: 4px; margin-inline-start: 8px; }
.mainnav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.mainnav a:hover { background: var(--sunken); color: var(--ink); }
.mainnav a.on { color: var(--ink); background: var(--sunken); }
.userchip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; max-width: 200px; }
[dir="rtl"] .userchip { padding: 3px 3px 3px 10px; }
.userchip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userchip.on, .userchip:hover { border-color: var(--brass); }
@media (max-width: 720px) {
  .topbar .wrap { flex-wrap: wrap; }
  .mainnav { order: 9; width: 100%; margin: 0; justify-content: center; }
  .userchip span:last-child { display: none; }
  .userchip { padding: 3px; }
}

.av { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--sunken); color: var(--ink); font-family: var(--f-display); font-weight: 700; font-size: 15px; overflow: hidden; }
.av img, .tile .avatar b img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.av.xs { width: 24px; height: 24px; font-size: 10px; } .av.sm { width: 32px; height: 32px; font-size: 12px; } .av.xl { width: 120px; height: 120px; font-size: 40px; }
.vs2 .a .av { background: var(--lapis-soft); color: var(--lapis); } .vs2 .b .av { background: var(--garnet-soft); color: var(--garnet); }
.tile .avatar b { overflow: hidden; }

.vs2 { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.vs2 .side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vs2 .side.b { justify-content: flex-end; text-align: end; }
.vs2 .side > div { min-width: 0; }
.vs2 b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs2 .a b { color: var(--lapis); } .vs2 .b b { color: var(--garnet); }
.vs2 small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs2 i { font-style: normal; color: var(--muted); font-family: var(--f-display); }

.live-strip { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--line)); border-radius: var(--r); padding: 10px 12px; margin-bottom: 16px; flex-wrap: wrap; }
.sec-title { font-family: var(--f-display); font-size: 24px; margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
.sec-title .muted { font-family: var(--f-body); font-size: 14px; }
a.card { color: inherit; text-decoration: none; }
.dcard.live { border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.dcards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
@media (max-width: 400px) { .dcards, .cards { grid-template-columns: 1fr; } }
.past-list { display: flex; flex-direction: column; gap: 6px; }
.past { display: flex; gap: 12px; align-items: baseline; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; flex-wrap: wrap; }
.past:hover { border-color: var(--muted); }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--ok); }
.pwm { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 4px; align-items: center; margin-top: 4px; }
.pwm span { height: 5px; border-radius: 99px; background: var(--sunken); }
.pwm small { font-size: 12px; color: var(--muted); min-width: 48px; text-align: end; }
.pwm[data-s="1"] span:nth-child(-n+1) { background: var(--bad); }
.pwm[data-s="2"] span:nth-child(-n+2) { background: var(--warn); }
.pwm[data-s="3"] span:nth-child(-n+3) { background: var(--ok); }
.pwm[data-s="4"] span:nth-child(-n+4) { background: var(--ok); }

.prof-head { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.prof-head h1 { font-family: var(--f-display); font-size: 34px; }
.prof-av { position: relative; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }
.prof-av .av { box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line); }
.prof-av-edit { position: absolute; inset: auto 0 0; border-radius: 0 0 60px 60px; background: rgb(0 0 0 / 55%); color: #fff; font-size: 12px; font-weight: 600; padding: 6px 0 10px; opacity: 0; transition: opacity .15s; }
.prof-av:hover .prof-av-edit, .prof-av:focus-visible .prof-av-edit { opacity: 1; }
.prof-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 860px) { .prof-grid { grid-template-columns: 1fr; } }
.form-sec .sep { height: 1px; background: var(--line); margin: 4px 0; }
.ok { color: var(--ok); }
.danger-zone { border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--line)); background: color-mix(in srgb, var(--bad) 6%, var(--surface)); border-radius: 10px; padding: 14px; }
.btn.danger { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
canvas.crop { display: block; margin: 0 auto; border-radius: 12px; background: var(--sunken); touch-action: none; cursor: grab; max-width: 100%; height: auto !important; aspect-ratio: 1; }
.ctx-head .av { margin-inline-end: 2px; }
.ctx-bio { margin-top: 4px; max-width: 260px; white-space: normal; color: var(--ink); }
.cmt .av { margin-inline-end: 2px; }

.site-foot { border-top: 1px solid var(--line); margin-top: 20px; }
.site-foot .wrap { display: flex; gap: 16px; align-items: center; padding-block: 16px calc(16px + env(safe-area-inset-bottom, 0px)); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.site-foot a { color: var(--muted); }
.legal { max-width: 820px; }
.legal h1 { font-family: var(--f-display); font-size: 34px; margin-bottom: 4px; }
.legal h2 { font-family: var(--f-display); font-size: 22px; margin: 24px 0 8px; }
.legal p, .legal li { line-height: 1.7; }
.legal .missing { background: var(--brass-soft); color: var(--brass); padding: 0 6px; border-radius: 4px; font-size: 13px; }
table.pv { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
table.pv th, table.pv td { text-align: start; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; min-width: 140px; }
table.pv th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
a.btn { text-decoration: none; }
.vs2 b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }

/* ================= v1.7: feed, kinds, meeting, recording ================= */
.create-btn span { display: inline; }
@media (max-width: 720px) { .create-btn span { display: none; } }
.chip.mode { background: var(--sunken); color: var(--ink); }
.chip.mode.conference { background: var(--lapis-soft); color: var(--lapis); }
.chip.mode.meeting { background: var(--brass-soft); color: var(--brass); }
.chip.rec { background: var(--bad); color: var(--on-accent); }

.create-bar { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.create-bar h1, .hero-mini h1 { font-family: var(--f-display); font-size: clamp(28px, 4vw, 38px); }
.create-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; flex: 1 1 520px; }
@media (max-width: 640px) { .create-quick { grid-template-columns: 1fr; } }
.cq { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.cq:hover { border-color: var(--brass); box-shadow: var(--shadow); }
.cq b { display: block; font-size: 14px; } .cq small { display: block; color: var(--muted); font-size: 12px; }
.cq-ico, .kind-ico { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--sunken); color: var(--ink); }
.cq-ico svg, .kind-ico svg { width: 22px; height: 22px; }
.cq.munazara .cq-ico, .kind-card.munazara .kind-ico { background: var(--garnet-soft); color: var(--garnet); }
.cq.conference .cq-ico, .kind-card.conference .kind-ico { background: var(--lapis-soft); color: var(--lapis); }
.cq.meeting .cq-ico, .kind-card.meeting .kind-ico { background: var(--brass-soft); color: var(--brass); }
.hero-mini { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 18px; }
.hero-mini p { margin: 4px 0 0; }
.feed-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.feed-tools .kinds button { padding: 8px 14px; }
.feed-tools .search { display: flex; gap: 8px; flex: 1 1 280px; max-width: 460px; }
.soon { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1px dashed var(--line); border-radius: var(--r); background: var(--surface); }
.soon-ico { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); color: var(--muted); font-size: 18px; }
.dcard.video .vthumb { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; background: linear-gradient(135deg, #15211d, #24403a); display: grid; place-items: center; overflow: hidden; }
.vthumb .chip { position: absolute; top: 8px; inset-inline-start: 8px; }
.vplay { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / 90%); color: #15211d; font-size: 20px; padding-inline-start: 4px; }
.vdur { position: absolute; bottom: 8px; inset-inline-end: 8px; background: rgb(0 0 0 / 65%); color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.vs2.meet { grid-template-columns: auto 1fr; }
.player { border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; max-width: 100%; }
.player video { width: 100%; height: 100%; display: block; }
.video-page { max-width: 1000px; }

.kind-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .kind-grid { grid-template-columns: 1fr; } }
.kind-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.kind-card h2 { font-family: var(--f-display); font-size: 26px; }
.kind-card p { margin: 0; }
.kind-card ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; font-size: 14px; flex: 1; }
.kind-card .row .btn { flex: 1; }

.rec-banner { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--bad) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--line)); font-size: 14px; }
.rec-banner b { color: var(--bad); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: pulse 1.2s infinite; }

/* meeting */
.room .mstage, .room .meet-bar { display: none; }
.room.meeting .mstage { display: grid; }
.room.meeting .meet-bar { display: flex; }
.room.meeting .stage, .room.meeting .stage-tools, .room.meeting .host-bar, .room.meeting #timebar, .room.meeting #agendaWrap, .room.meeting #qScreen, .room.meeting #pulse { display: none !important; }
.mstage { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.mstage[data-n="1"] { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.mstage[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .mstage, .mstage[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mstage[data-n="1"] { grid-template-columns: 1fr; } }
.mtile { --side: var(--lapis); --side-soft: var(--lapis-soft); aspect-ratio: 16 / 10; }
.mtile.hostt { --side: var(--brass); --side-soft: var(--brass-soft); }
.mtile .hand { font-size: 20px; background: var(--surface); border-radius: 8px; padding: 0 4px; }
.meet-bar { align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.meet-bar .btn svg { width: 14px; height: 14px; }
.plist { display: flex; flex-direction: column; gap: 6px; }
.prow { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 14px; }
.pstate { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; flex: none; }
.pstate.off { background: var(--bad); }
.pstate svg { width: 13px; height: 13px; }

/* conference with one speaker */
.stage.one-speaker .tile.B { display: none !important; }
.stage.one-speaker.l-stage { grid-template-columns: minmax(0, 1fr) minmax(0, .46fr); }
.stage.one-speaker.l-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ================= v1.8: colour worlds, audience pulse, screen sharing ================= */
.brand svg.logo { width: 34px; height: 34px; color: inherit; border-radius: 10px; box-shadow: 0 2px 10px rgb(0 0 0 / 18%); }
.icon-btn svg { width: 18px; height: 18px; }
.topbar { background: color-mix(in srgb, var(--surface) 84%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
html { background: var(--paper); }
body { background: var(--bg, var(--paper)); background-attachment: fixed; background-repeat: no-repeat; min-height: 100%; }
.lg-short { display: none; }
@media (max-width: 560px) { .lg-short { display: inline; } .lg-long { display: none; } }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: var(--pat-img, none); background-size: 72px 72px; opacity: var(--pat-op, .05); }
:root[data-pattern="off"] body::after { display: none; }
#app { zoom: 1; }
:root[data-fs="sm"] #app { zoom: .92; }
:root[data-fs="lg"] #app { zoom: 1.1; }
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }

/* Smaragd (default) */
:root[data-skin="emerald"] {
  --paper: #0b1f1b; --surface: #11302a; --sunken: #0d2722; --line: #23483f; --ink: #eaf4f0; --muted: #9dbab0;
  --lapis: #8fb2ff; --lapis-soft: #1b2e55; --garnet: #f492ab; --garnet-soft: #4a2230; --brass: #e9c46a; --brass-soft: #3b3119;
  --ok: #6fd3a0; --warn: #f0be5c; --bad: #ff8a7f; --on-accent: #0b1f1b;
  --shadow: 0 1px 2px rgb(0 0 0 / 35%), 0 10px 30px rgb(0 0 0 / 28%);
  --bg: radial-gradient(1100px 620px at 88% -12%, rgb(233 196 106 / 16%), transparent 62%), radial-gradient(900px 560px at -12% 108%, rgb(143 178 255 / 13%), transparent 60%), linear-gradient(160deg, #0d2622, #08171a 70%);
  --pat-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23e9c46a' stroke-width='1'%3E%3Crect x='23' y='23' width='26' height='26'/%3E%3Crect x='23' y='23' width='26' height='26' transform='rotate(45 36 36)'/%3E%3Cpath d='M0 36h9M63 36h9M36 0v9M36 63v9'/%3E%3C/g%3E%3C/svg%3E"); --pat-op: .045;
  color-scheme: dark;
}
/* Mitternacht */
:root[data-skin="night"] {
  --paper: #0a1226; --surface: #121c36; --sunken: #0e1730; --line: #283658; --ink: #e9eefb; --muted: #9eabc9;
  --lapis: #7fb0ff; --lapis-soft: #172a52; --garnet: #ff8fa8; --garnet-soft: #44192a; --brass: #ffb547; --brass-soft: #3d2c12;
  --ok: #67d59c; --warn: #ffc15a; --bad: #ff8277; --on-accent: #0a1226;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 30px rgb(0 0 0 / 32%);
  --bg: radial-gradient(1000px 600px at 80% -10%, rgb(255 181 71 / 14%), transparent 60%), radial-gradient(900px 600px at 0% 100%, rgb(127 176 255 / 18%), transparent 60%), linear-gradient(170deg, #0d1733, #070c1c 75%);
  --pat-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%237fb0ff' stroke-width='1'%3E%3Crect x='23' y='23' width='26' height='26'/%3E%3Crect x='23' y='23' width='26' height='26' transform='rotate(45 36 36)'/%3E%3Cpath d='M0 36h9M63 36h9M36 0v9M36 63v9'/%3E%3C/g%3E%3C/svg%3E"); --pat-op: .045;
  color-scheme: dark;
}
/* Purpur */
:root[data-skin="royal"] {
  --paper: #190f2e; --surface: #24173f; --sunken: #1d1236; --line: #3d2c61; --ink: #f3ecfd; --muted: #b8a9d4;
  --lapis: #8fb6ff; --lapis-soft: #22285a; --garnet: #ff8fb8; --garnet-soft: #4b1d3c; --brass: #f6c76a; --brass-soft: #3f3019;
  --ok: #72d6a2; --warn: #f7c25c; --bad: #ff8b85; --on-accent: #190f2e;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 30px rgb(0 0 0 / 30%);
  --bg: radial-gradient(1000px 640px at 85% -15%, rgb(246 199 106 / 16%), transparent 60%), radial-gradient(900px 600px at -5% 105%, rgb(255 143 184 / 15%), transparent 60%), linear-gradient(160deg, #241446, #120a22 75%);
  --pat-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23f6c76a' stroke-width='1'%3E%3Crect x='23' y='23' width='26' height='26'/%3E%3Crect x='23' y='23' width='26' height='26' transform='rotate(45 36 36)'/%3E%3Cpath d='M0 36h9M63 36h9M36 0v9M36 63v9'/%3E%3C/g%3E%3C/svg%3E"); --pat-op: .045;
  color-scheme: dark;
}
/* Morgenrot (hell, warm) */
:root[data-skin="sunrise"] {
  --paper: #fdf1e4; --surface: #fffaf4; --sunken: #f6e5d3; --line: #ead2bb; --ink: #2b1712; --muted: #7a5d50;
  --lapis: #1f55b3; --lapis-soft: #e1e9fb; --garnet: #ad1f45; --garnet-soft: #fbe1e7; --brass: #c2600f; --brass-soft: #fde6cc;
  --ok: #24804f; --warn: #b9700f; --bad: #c0281d; --on-accent: #ffffff;
  --shadow: 0 1px 2px rgb(90 40 10 / 8%), 0 10px 30px rgb(150 70 20 / 10%);
  --bg: radial-gradient(1100px 600px at 90% -10%, rgb(255 176 104 / 45%), transparent 60%), radial-gradient(900px 600px at -10% 110%, rgb(255 140 160 / 28%), transparent 60%), linear-gradient(170deg, #fff3e6, #fbe7da 80%);
  --pat-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23c2600f' stroke-width='1'%3E%3Crect x='23' y='23' width='26' height='26'/%3E%3Crect x='23' y='23' width='26' height='26' transform='rotate(45 36 36)'/%3E%3Cpath d='M0 36h9M63 36h9M36 0v9M36 63v9'/%3E%3C/g%3E%3C/svg%3E"); --pat-op: .055;
  color-scheme: light;
}
/* Klassisch = previous look (light/dark follows the system) */
:root[data-skin="classic"] {
  --pat-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%239a7426' stroke-width='1'%3E%3Crect x='23' y='23' width='26' height='26'/%3E%3Crect x='23' y='23' width='26' height='26' transform='rotate(45 36 36)'/%3E%3C/g%3E%3C/svg%3E"); --pat-op: .06;
}
/* dark worlds: surfaces get a soft inner light so cards don't look flat */
:root:is([data-skin="emerald"], [data-skin="night"], [data-skin="royal"]) .card,
:root:is([data-skin="emerald"], [data-skin="night"], [data-skin="royal"]) .panel { background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 100%, #fff 3%), var(--surface)); }
:root:is([data-skin="emerald"], [data-skin="night"], [data-skin="royal"]) .auth-art { background: linear-gradient(150deg, color-mix(in srgb, var(--paper) 70%, #000), var(--surface)); color: var(--ink); }

/* appearance dialog */
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.skin-card { display: grid; gap: 4px; text-align: start; padding: 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; }
.skin-card.on { border-color: var(--brass); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 25%, transparent); }
.skin-card small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.sw { display: flex; height: 34px; border-radius: 8px; overflow: hidden; margin-bottom: 4px; }
.sw i { flex: 1; }
.sw-emerald { background: #0b1f1b; } .sw-emerald i:nth-child(1) { background: linear-gradient(135deg, #1d6b5a, #0b1f1b); } .sw-emerald i:nth-child(2) { background: #e9c46a; flex: .5; } .sw-emerald i:nth-child(3) { background: linear-gradient(90deg, #8fb2ff 50%, #f492ab 50%); flex: .7; }
.sw-night i:nth-child(1) { background: #0a1226; } .sw-night i:nth-child(2) { background: #ffb547; flex: .5; } .sw-night i:nth-child(3) { background: linear-gradient(90deg, #7fb0ff 50%, #ff8fa8 50%); flex: .7; }
.sw-royal i:nth-child(1) { background: #24173f; } .sw-royal i:nth-child(2) { background: #f6c76a; flex: .5; } .sw-royal i:nth-child(3) { background: linear-gradient(90deg, #8fb6ff 50%, #ff8fb8 50%); flex: .7; }
.sw-sunrise i:nth-child(1) { background: linear-gradient(135deg, #fff3e6, #ffc79a); } .sw-sunrise i:nth-child(2) { background: #c2600f; flex: .5; } .sw-sunrise i:nth-child(3) { background: linear-gradient(90deg, #1f55b3 50%, #ad1f45 50%); flex: .7; }
.sw-classic i:nth-child(1) { background: #f2f4f1; } .sw-classic i:nth-child(2) { background: #9a7426; flex: .5; } .sw-classic i:nth-child(3) { background: linear-gradient(90deg, #24509c 50%, #8e2c45 50%); flex: .7; }

/* live badge on the stage */
.stage-wrap { position: relative; }
.live-badge { position: absolute; z-index: 5; inset-block-start: -13px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; font-size: 12.5px; font-weight: 700; }
.live-badge span { background: rgb(0 0 0 / 62%); color: #fff; padding: 3px 10px; border-radius: 99px; backdrop-filter: blur(6px); }
.live-badge .lb-live { background: var(--bad); color: #fff; animation: lbPulse 1.8s infinite; }
@keyframes lbPulse { 50% { opacity: .72; } }

/* audience pulse: tug of war between the two guests */
.pulse { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 10px; box-shadow: var(--shadow); }
.pulse-head { display: flex; align-items: center; gap: 8px; }
.pulse-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; }
.pulse-side { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px; border-radius: 12px; border: 2px solid transparent; background: var(--sunken); cursor: pointer; text-align: start; transition: transform .12s, border-color .15s, background .15s; }
.pulse-side:disabled { cursor: default; }
.pulse-side:not(:disabled):hover { transform: translateY(-1px); }
.pulse-side.A { --side: var(--lapis); --sidesoft: var(--lapis-soft); }
.pulse-side.B { --side: var(--garnet); --sidesoft: var(--garnet-soft); flex-direction: row-reverse; text-align: end; }
.pulse-side.on { border-color: var(--side); background: var(--sidesoft); }
.pulse-side .ps-name { display: grid; min-width: 0; flex: 1; }
.pulse-side .ps-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pulse-side .ps-name small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse-side.on .ps-name small { color: var(--side); font-weight: 600; }
.pulse-side .ps-pct { font-size: 22px; font-weight: 600; color: var(--side); }
.tug { position: relative; height: 16px; border-radius: 99px; overflow: visible; display: flex; background: var(--sunken); }
.tug .ta, .tug .tb { height: 100%; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.tug .ta { background: linear-gradient(90deg, color-mix(in srgb, var(--lapis) 70%, #000), var(--lapis)); border-radius: 99px 0 0 99px; }
.tug .tb { background: linear-gradient(90deg, var(--garnet), color-mix(in srgb, var(--garnet) 70%, #000)); border-radius: 0 99px 99px 0; }
[dir="rtl"] .tug .ta { border-radius: 0 99px 99px 0; } [dir="rtl"] .tug .tb { border-radius: 99px 0 0 99px; }
.tug .knot { position: absolute; top: 50%; width: 26px; height: 26px; margin-inline-start: -13px; transform: translateY(-50%); border-radius: 50%; background: var(--brass); border: 3px solid var(--surface); box-shadow: 0 2px 8px rgb(0 0 0 / 30%); transition: inset-inline-start .8s cubic-bezier(.2, .8, .2, 1); }
.pulse-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pulse-foot .center { text-align: center; }
.pulse-foot .cheers { font-weight: 700; font-family: var(--f-mono); }
.pulse-foot .cheers.A { color: var(--lapis); } .pulse-foot .cheers.B { color: var(--garnet); }
.swing { border-top: 1px dashed var(--line); padding-top: 8px; font-size: 14px; }
.swing .up { color: var(--ok); font-weight: 700; } .swing .down { color: var(--bad); font-weight: 700; }
@media (max-width: 640px) {
  .pulse-row { grid-template-columns: 1fr 1fr; }
  .pulse-row .tug { grid-column: 1 / -1; order: 3; }
  .pulse-side .av { display: none; }
  .pulse-side { padding: 8px; gap: 6px; }
  .pulse-side .ps-name b { white-space: normal; font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .pulse-side .ps-pct { font-size: 18px; }
  .pulse-foot .center { order: 5; flex-basis: 100%; }
}
/* applause on a guest's picture */
.cheer-fx { position: absolute; z-index: 6; bottom: 18%; font-size: 30px; pointer-events: none; animation: cheerUp 1.8s ease-out forwards; }
@keyframes cheerUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-10px) scale(1.15); } 100% { transform: translateY(-120px) scale(.9); opacity: 0; } }
.tile.cheered { animation: cheerGlow .7s ease-out; }
@keyframes cheerGlow { 0% { box-shadow: 0 0 0 0 rgb(240 201 104 / 55%); } 100% { box-shadow: 0 0 0 10px rgb(240 201 104 / 0%); } }

/* screen sharing: the shared screen is the big picture, shown whole */
.tile.screen video { object-fit: contain !important; background: #000; transform: none !important; }
.stage .tile.screen { aspect-ratio: 16 / 9 !important; }
.tile.screen .tag::after { content: " · 🖥"; }
.mstage.has-screen { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; max-width: none; }
.mstage.has-screen .mtile.screen { grid-column: 1 / -1; order: -10 !important; aspect-ratio: 16 / 9; }
@media (max-width: 560px) { .mstage.has-screen { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }

/* files & personal document view */
.doc-filter .input { width: 100%; }
.doc-own { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 12px; background: var(--brass-soft); color: var(--ink); border-bottom: 1px solid var(--line); }
.doc-own span { flex: 1; }
.room.meeting #docView { margin-bottom: 4px; }
.room.meeting #docView .doc-page { max-height: 62vh; }

/* ================= v1.9: fixed dock, side menu, compact time, chats, files, calendar ================= */
/* room: stage | side panel | icon rail */
.room { padding-bottom: 24px; }

.room .side { display: none; }

.room.side-open .side { display: flex; }
.side { flex-direction: column; position: sticky; top: calc(70px + env(safe-area-inset-top, 0px)); max-height: calc(100vh - 70px - 108px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-width: 0; box-shadow: var(--shadow); }
.side-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.side .panel-body { flex: 1; max-height: none; overflow-y: auto; }
.side-rail { position: sticky; top: calc(70px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 4px; padding: 6px 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.side-rail button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; color: var(--muted); }
.side-rail button:hover { background: var(--sunken); color: var(--ink); }
.side-rail button.on { background: var(--brass-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--brass); }
[dir="rtl"] .side-rail button.on { box-shadow: inset -3px 0 0 var(--brass); }
.side-rail .ri { font-size: 18px; line-height: 1; }
.side-rail .rl { font-size: 10.5px; font-weight: 600; line-height: 1.15; text-align: center; max-width: 58px; overflow: hidden; text-overflow: ellipsis; }
.side-rail .badge, .dm-contact .badge { position: absolute; top: 3px; inset-inline-end: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; animation: badgePop .3s ease-out; }
@keyframes badgePop { from { transform: scale(.4); } to { transform: scale(1); } }
.side-rail .rail-toggle { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; font-size: 16px; }
@media (max-width: 980px) {
  .room, .room.side-open { grid-template-columns: 1fr; }
  .room > .room-main, .room > .side, .room > .side-rail { grid-column: 1; }
  .side-rail { position: sticky; top: calc(58px + env(safe-area-inset-top, 0px)); z-index: 6; flex-direction: row; overflow-x: auto; scrollbar-width: none; order: 2; padding: 4px; }
  .side-rail button { flex: 1 0 64px; }
  .side-rail .rail-toggle { display: none; }
  .room.side-open .side { order: 3; position: static; max-height: none; }
  .side .panel-body { max-height: 70vh; }
}

/* fixed control dock */
body.has-dock { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
body.has-dock .floaters { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
.dock { position: fixed; z-index: 15; inset: auto 0 0; padding: 8px max(10px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); box-shadow: 0 -8px 30px rgb(0 0 0 / 18%); }
.dock-in { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.dock-media .media-bar, .dock-main, .dock-end { display: flex; align-items: center; gap: 6px; }
.dock-main { flex: 1; justify-content: center; flex-wrap: wrap; min-width: 0; }
.dock .hint { display: none; }
.btn.dk { flex-direction: column; gap: 1px; min-height: 52px; min-width: 56px; padding: 4px 8px; border-radius: 12px; font-size: 18px; line-height: 1; }
.btn.dk svg { width: 20px; height: 20px; }
.btn.dk span { font-size: 10.5px; font-weight: 600; line-height: 1.1; max-width: 86px; overflow: hidden; text-overflow: ellipsis; }
.btn.dk.num { font-family: var(--f-mono); font-size: 15px; font-weight: 600; }
.btn.dk.off { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.dk.wide { min-width: 150px; flex-direction: row; gap: 8px; font-size: 18px; }
.btn.dk.wide span { font-size: 14px; max-width: none; }
.btn.dk.danger { color: var(--bad); }
.dk-sep { width: 1px; height: 34px; background: var(--line); margin: 0 2px; }
.dk-state { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; background: var(--sunken); font-size: 12.5px; font-weight: 600; color: var(--bad); }
.dk-state.on { color: var(--ok); }
.dk-state svg { width: 15px; height: 15px; }
.dk-react { display: flex; gap: 4px; }
.dk-react button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 19px; transition: transform .12s; }
.dk-react button:hover { transform: translateY(-2px) scale(1.06); }
.dk-react button:active { transform: scale(.92); }
.dk-cmt { display: flex; gap: 6px; flex: 1; min-width: 180px; max-width: 520px; }
.dk-cmt .input { min-height: 42px; border-radius: 99px; padding-inline: 16px; }
.dk-cmt .btn { border-radius: 50%; width: 42px; min-height: 42px; padding: 0; }
@media (max-width: 760px) {
  .dock-in { gap: 6px; flex-wrap: wrap; justify-content: center; }
  .btn.dk { min-width: 46px; min-height: 46px; padding: 3px 6px; }
  .btn.dk span { display: none; }
  .btn.dk.wide span { display: inline; }
  .dk-sep { display: none; }
  .dk-react button { width: 38px; height: 38px; font-size: 17px; }
  .dk-cmt { order: 5; flex-basis: 100%; max-width: none; }
  body.has-dock { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
}
/* popovers above the dock */
.pop { position: fixed; z-index: 30; min-width: 220px; max-width: min(360px, calc(100vw - 16px)); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgb(0 0 0 / 35%); padding: 8px; display: flex; flex-direction: column; gap: 4px; animation: popIn .14s ease-out; }
@keyframes popIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pop > button, .pop .row > button { text-align: start; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font-weight: 600; }
.pop > button:hover, .pop .row > button:hover { background: var(--sunken); }
.pop > button.on { background: var(--brass-soft); }
.pop button.danger { color: var(--bad); }
.pop-h { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 6px 8px 2px; }
.pop-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; }
.pop .seg3 button { padding: 5px 9px; font-size: 12.5px; }
.pop input[type=range] { accent-color: var(--brass); flex: 1; }

/* compact time strip under the pictures */
.tbar { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 10px; display: grid; gap: 7px; }
.tb-row { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.tb-n { font-size: 12px; color: var(--muted); }
.tb-seg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-seg .A { color: var(--lapis); font-weight: 600; } .tb-seg .B { color: var(--garnet); font-weight: 600; } .tb-seg .host { color: var(--brass); font-weight: 600; }
.tb-digits { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 26px; line-height: 1; font-weight: 600; direction: ltr; }
.tb-digits.warn { color: var(--warn); } .tb-digits.danger, .tb-digits.over { color: var(--bad); } .tb-digits.over { animation: pulse 1s infinite; }
.tbar .timeline { height: 7px; }
.tbar .timeline .tl-fill::after { display: none; }
.tbar .overlay-banner { padding: 8px 10px; }
.tbar .overlay-banner .od { font-size: 22px; }
.tbar.ended-card { padding: 12px 14px; }
@media (max-width: 560px) { .tb-next { display: none; } .tb-digits { font-size: 22px; } }
.agenda-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; }
.agenda-wrap summary { cursor: pointer; display: flex; gap: 10px; align-items: center; min-height: 36px; list-style: none; }
.agenda-wrap summary::-webkit-details-marker { display: none; }
.agenda-wrap summary::after { content: "▾"; margin-inline-start: auto; color: var(--muted); }
.agenda-wrap[open] summary::after { content: "▴"; }
.agenda-wrap .agenda { padding-bottom: 8px; }

/* private messages */
.dm-list { display: grid; gap: 4px; }
.dm-contact { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid transparent; border-radius: 12px; background: var(--sunken); cursor: pointer; text-align: start; width: 100%; }
.dm-contact:hover { border-color: var(--line); }
.dm-contact .badge { position: static; }
.dm-contact .grow { display: grid; gap: 1px; }
.dm-contact small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-av { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--line); color: var(--ink); }
.dm-av.A { background: var(--lapis-soft); color: var(--lapis); } .dm-av.B { background: var(--garnet-soft); color: var(--garnet); } .dm-av.host, .dm-av.stage { background: var(--brass-soft); color: var(--brass); }
.dm-av .online { position: absolute; bottom: 0; inset-inline-end: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); }
.dm-head { display: flex; align-items: center; gap: 8px; }
.dm-thread { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; padding: 4px 2px; }
.dm-msg { max-width: 82%; align-self: flex-start; background: var(--sunken); border-radius: 14px 14px 14px 4px; padding: 7px 10px; }
.dm-msg.me { align-self: flex-end; background: var(--brass-soft); border-radius: 14px 14px 4px 14px; }
.dm-msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.dm-msg time { display: block; font-size: 10.5px; color: var(--muted); text-align: end; }
.dm-from { font-weight: 700; font-size: 11.5px; color: var(--muted); }
.dm-form { display: flex; gap: 6px; }
.dm-form .input { flex: 1; border-radius: 99px; }

/* file drive */
.vis-pick { display: grid; gap: 4px; }
.vis-pick .seg3 button { flex: 1; }
.doc-ico.doc { background: #2b5cad; } .doc-ico.xls { background: #1f7a47; } .doc-ico.ppt { background: #c4561d; } .doc-ico.zip { background: #6b5a8c; }
.doc-ico.aud { background: #8a3f9c; } .doc-ico.vid { background: #b2332e; } .doc-ico.txt { background: #5b6a64; }
.chip.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.chip.warn { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }

/* calendar */
.nav-cal { }
.save-btn { border: 0; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; color: var(--brass); padding: 2px 4px; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .cal-layout { grid-template-columns: 1fr; } }
.cal-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-nav h2 { font-family: var(--f-display); font-size: 24px; flex: 1; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: center; text-transform: uppercase; padding: 4px 0; }
.cal-day { min-height: 92px; border-radius: 10px; background: var(--sunken); padding: 5px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.out { opacity: .45; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--brass); }
.cal-n { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-day.today .cal-n { color: var(--brass); }
.cal-ev { display: block; font-size: 11.5px; line-height: 1.25; padding: 3px 5px; border-radius: 6px; background: var(--brass-soft); color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-inline-start: 3px solid var(--brass); }
.cal-ev.munazara { border-color: var(--garnet); background: var(--garnet-soft); } .cal-ev.conference { border-color: var(--lapis); background: var(--lapis-soft); }
.cal-ev.ended { opacity: .6; } .cal-ev.live { box-shadow: 0 0 0 1px var(--bad); }
.cal-ev .mono { font-size: 10.5px; opacity: .8; }
@media (max-width: 560px) { .cal-day { min-height: 56px; } .cal-ev { font-size: 0; padding: 3px; } .cal-ev .mono { font-size: 9.5px; } }
.cal-side .sec-title { font-size: 20px; margin: 0 0 10px; }
.cal-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; border-inline-start: 4px solid var(--brass); }
.cal-item.munazara { border-inline-start-color: var(--garnet); } .cal-item.conference { border-inline-start-color: var(--lapis); }
.cal-item a { color: inherit; text-decoration: none; }
.cal-sub { margin-top: 14px; }
.feed-url { display: block; overflow-wrap: anywhere; font-size: 12px; background: var(--sunken); padding: 8px; border-radius: 8px; }
.cal-steps { margin: 6px 0 0; padding-inline-start: 18px; display: grid; gap: 4px; }
/* history */
.hist { display: grid; gap: 2px; max-height: 360px; overflow-y: auto; }
.hist-row { display: flex; gap: 10px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.hist-row a { color: inherit; }
.hist-ico { width: 28px; height: 28px; border-radius: 50%; background: var(--sunken); display: grid; place-items: center; flex: none; }
/* language menu */
.lang-menu { position: relative; }

.btn.dk.num span { display: none; }
.btn.dk.num { min-width: 48px; }
.dock .btn.dk.primary { background: var(--brass); border-color: var(--brass); color: var(--on-accent); }
@media (max-width: 560px) { #liveChip { display: none; } }
@media (max-width: 760px) { .dock .notice { display: none; } }

/* ================= v1.10: chat side, app rail, chats page, people, enlarge ================= */
/* room grid: chats | stage | panel | rail */
.room { grid-template-columns: 0 minmax(0, 1fr) 0 64px; column-gap: 0; }
.room > .chatside { grid-column: 1; } .room > .room-main { grid-column: 2; } .room > .side { grid-column: 3; } .room > .side-rail { grid-column: 4; }
.room.side-open { grid-template-columns: 0 minmax(0, 1fr) minmax(300px, 350px) 64px; }
.room.chat-open { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) 0 64px; }
.room.chat-open.side-open { grid-template-columns: minmax(250px, 290px) minmax(0, 1fr) minmax(290px, 340px) 64px; }
.room > * + * { margin-inline-start: 0; }
.room.chat-open > .chatside { margin-inline-end: 14px; }
.room.side-open > .side { margin-inline-start: 14px; }
.room > .side-rail { margin-inline-start: 14px; }
.chatside { display: none; }
.room.chat-open .chatside { display: flex; flex-direction: column; position: sticky; top: calc(70px + env(safe-area-inset-top, 0px)); max-height: calc(100vh - 70px - 108px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); min-width: 0; }
.cs-tabs { display: flex; border-bottom: 1px solid var(--line); }
.cs-tabs button { flex: 1; position: relative; padding: 10px 6px; border: 0; background: transparent; cursor: pointer; font-weight: 700; color: var(--muted); }
.cs-tabs button.on { color: var(--ink); box-shadow: inset 0 -3px 0 var(--brass); }
.cs-tabs .cs-close { flex: 0 0 38px; }
.cs-tabs .badge { position: static; display: inline-grid; margin-inline-start: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; place-items: center; }
.cs-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; overflow: hidden; }
.cs-list, .cs-body .chat-rows, .cs-body .chat-msgs { flex: 1; overflow-y: auto; min-height: 120px; display: flex; flex-direction: column; gap: 6px; }
.cs-msg { background: var(--sunken); border-radius: 10px; padding: 6px 9px; }
.cs-msg.host { border-inline-start: 3px solid var(--brass); } .cs-msg.A { border-inline-start: 3px solid var(--lapis); } .cs-msg.B { border-inline-start: 3px solid var(--garnet); }
.cs-msg p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chatside-toggle { position: relative; display: inline-flex; align-items: center; gap: 4px; margin-inline-end: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 15px; align-self: flex-start; }
.chatside-toggle .cs-arrow { font-size: 11px; color: var(--muted); }
.chatside-toggle .badge, .side-rail [data-app] .badge { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
[hidden].badge { display: none !important; }
.room-head { display: flex; align-items: flex-start; }
.rail-sep { height: 1px; background: var(--line); margin: 4px 6px; flex: none; }
@media (max-width: 980px) {
  .room, .room.side-open, .room.chat-open, .room.chat-open.side-open { grid-template-columns: 1fr; }
  .room > .chatside, .room > .room-main, .room > .side, .room > .side-rail { grid-column: 1; margin-inline: 0 !important; }
  .room.chat-open .chatside { position: fixed; z-index: 25; inset: 60px auto 0 0; width: min(88vw, 360px); max-height: none; border-radius: 0 14px 14px 0; box-shadow: 10px 0 40px rgb(0 0 0 / 45%); }
  .side-rail .rail-sep, .side-rail [data-app] { display: none; }
}

/* app-wide list at the right edge */
body.has-apprail { padding-inline-end: 76px; }
.app-rail { position: fixed; z-index: 12; top: 74px; inset-inline-end: 8px; display: flex; flex-direction: column; gap: 4px; padding: 6px 4px; width: 64px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.app-rail button, .side-rail [data-app] { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; color: var(--muted); }
.app-rail button:hover { background: var(--sunken); color: var(--ink); }
.app-rail .ri { font-size: 18px; line-height: 1; } .app-rail .rl { font-size: 10.5px; font-weight: 600; line-height: 1.15; text-align: center; max-width: 58px; overflow: hidden; text-overflow: ellipsis; }
.app-rail .badge { position: absolute; top: 3px; inset-inline-end: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
@media (max-width: 760px) {
  body.has-apprail { padding-inline-end: 0; padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .app-rail { top: auto; bottom: 0; inset-inline: 0; width: auto; flex-direction: row; justify-content: space-around; border-radius: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); }
  .app-rail button { flex: 1; }
}
.nbadge:empty { display: none; }
.nbadge { display: inline-grid; place-items: center; margin-inline-start: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; }

/* chats page (like a messenger) */
.chats-page { max-width: 1300px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 14px; height: calc(100vh - 64px); }
.chat-list, .chat-main { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; box-shadow: var(--shadow); }
.chat-list h1 { font-family: var(--f-display); font-size: 26px; margin: 0; }
.chat-rows { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.chat-row { display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: start; width: 100%; color: var(--ink); }
.chat-row:hover { background: var(--sunken); } .chat-row.on { background: var(--brass-soft); }
.chat-row .grow { display: grid; min-width: 0; } .chat-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-meta { display: grid; justify-items: end; gap: 3px; } .chat-meta small { font-size: 11px; color: var(--muted); }
.chat-meta .badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.chat-head .grow { display: grid; min-width: 0; } .chat-head small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head .chat-back { display: none; }
.chat-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; }
.chat-day { align-self: center; font-size: 11.5px; color: var(--muted); background: var(--sunken); padding: 2px 10px; border-radius: 99px; margin: 6px 0; }
.chat-empty { margin: auto; text-align: center; display: grid; gap: 8px; justify-items: center; max-width: 360px; }
.chat-empty-ico { font-size: 54px; }
.center { text-align: center; }
@media (max-width: 760px) {
  .chats-page { grid-template-columns: 1fr; height: calc(100vh - 64px - 66px); padding: 8px; }
  .chats-page.has-thread .chat-list { display: none; } .chats-page:not(.has-thread) .chat-main { display: none; }
  .chat-head .chat-back { display: inline-flex; }
}
.picker .pk-sel { display: flex; flex-wrap: wrap; gap: 6px; } .picker .pk-sel .chip button { border: 0; background: transparent; cursor: pointer; color: inherit; }
.picker .pk-res { display: grid; gap: 3px; max-height: 300px; overflow-y: auto; }

/* participants & attendance */
.person { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.person .grow { display: grid; min-width: 0; } .person small { color: var(--muted); font-size: 12px; }
.att { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; }
.att-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; }
.att-row > span:first-child { color: var(--muted); font-size: 10px; } .att-row > span.on { color: var(--ok); }

/* ⤢ enlarge a picture inside the window */
.tile.maxed, .mtile.maxed { position: fixed !important; z-index: 22; inset: 64px 12px 96px !important; width: auto !important; height: auto !important; max-width: none !important; aspect-ratio: auto !important; grid-column: auto !important; order: 0 !important; border-radius: 16px; box-shadow: 0 0 0 100vmax rgb(0 0 0 / 70%); }
.tile.maxed video { object-fit: contain !important; background: #000; }
body.has-max .dock { z-index: 23; }
.mt-max { width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgb(0 0 0 / 50%); color: #fff; cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.mt-max svg { width: 16px; height: 16px; }
.mtile:hover .mt-max, .mtile.maxed .mt-max, .mt-max:focus-visible { opacity: 1; }
@media (hover: none) { .mt-max { opacity: .85; } }
.mtile { cursor: pointer; }
.meter-bar { height: 8px; border-radius: 99px; background: var(--sunken); overflow: hidden; } .meter-bar span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s; }
.side-rail { max-height: calc(100vh - 70px - 100px); overflow-y: auto; scrollbar-width: thin; } @media (max-width: 980px) { .side-rail { max-height: none; } }

/* meeting: while a document or a screen is shown, the people become a film strip next to it */
.room.meeting.doc-on .room-main { display: grid; grid-template-columns: minmax(0, 1fr) 210px; grid-template-areas: "head head" "rec rec" "unm unm" "bar bar" "doc strip"; align-items: start; column-gap: 12px; }
.room.meeting.doc-on .room-main > .room-head { grid-area: head; } .room.meeting.doc-on .room-main > #recBanner { grid-area: rec; } .room.meeting.doc-on .room-main > #unmuteBar { grid-area: unm; } .room.meeting.doc-on .room-main > .meet-bar { grid-area: bar; }
.room.meeting.doc-on .room-main > #docView { grid-area: doc; margin: 0; }
.room.meeting.doc-on .room-main > #mstage { grid-area: strip; display: flex !important; flex-direction: column; gap: 8px; max-height: calc(100vh - 220px); overflow-y: auto; padding: 0; max-width: none; grid-template-columns: none !important; }
.room.meeting.doc-on #mstage .mtile { width: 100%; aspect-ratio: 16 / 10; flex: none; order: 0 !important; grid-column: auto !important; }
.room.meeting.doc-on #mstage .mtile .avatar { transform: scale(.6); }
.room.meeting.doc-on .room-main > .stage-wrap, .room.meeting.doc-on .room-main > #timebar, .room.meeting.doc-on .room-main > #pulse, .room.meeting.doc-on .room-main > #qScreen, .room.meeting.doc-on .room-main > #agendaWrap { display: none; }
/* screen share in a meeting: big screen, others in a strip below */
.room.meeting.strip:not(.doc-on) #mstage.has-screen { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important; }
.room.meeting.strip:not(.doc-on) #mstage.has-screen .mtile:not(.screen) { aspect-ratio: 16 / 10; }
@media (max-width: 760px) {
  .room.meeting.doc-on .room-main { grid-template-columns: 1fr; grid-template-areas: "head" "rec" "unm" "bar" "doc" "strip"; }
  .room.meeting.doc-on .room-main > #mstage { flex-direction: row; overflow-x: auto; max-height: none; }
  .room.meeting.doc-on #mstage .mtile { width: 150px; }
}

/* ================= v1.11: soft transitions, small meeting window ================= */
::view-transition-old(root) { animation: vtOut .22s ease both; }
::view-transition-new(root) { animation: vtIn .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes vtOut { to { opacity: 0; transform: scale(.995); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(10px); } }
:root[data-motion="off"]::view-transition-old(root), :root[data-motion="off"]::view-transition-new(root) { animation: none; }
#app > main, #app > .room, #app > .wrap { animation: pageIn .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }
.btn, .card, .chip, .side-rail button, .app-rail button, .chat-row, .dm-contact, .skin-card, .cal-day, .pulse-side, .tile { transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .2s ease; }
.btn:active { transform: scale(.97); }
.card.dcard:hover, a.card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgb(0 0 0 / 22%); }
.room.side-open .side { animation: slideInR .26s cubic-bezier(.2, .8, .2, 1); }
.room.chat-open .chatside { animation: slideInL .26s cubic-bezier(.2, .8, .2, 1); }
@keyframes slideInR { from { opacity: 0; transform: translateX(16px); } }
@keyframes slideInL { from { opacity: 0; transform: translateX(-16px); } }
[dir="rtl"] .room.side-open .side { animation-name: slideInL; } [dir="rtl"] .room.chat-open .chatside { animation-name: slideInR; }
.modal { animation: fadeIn .18s ease; } .modal .modal-card { animation: popIn .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes fadeIn { from { opacity: 0; } }
.toast { animation: popIn .25s cubic-bezier(.2, .8, .2, 1); }

/* small window: the event keeps running while you look at the calendar, chats, profile … */
.mini-room { position: fixed; z-index: 40; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgb(0 0 0 / 45%); overflow: hidden; transform: translateY(20px) scale(.96); opacity: 0; transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .3s; }
.mini-room.in { transform: none; opacity: 1; }
[dir="rtl"] .mini-room { right: auto; left: 16px; }
body.has-apprail .mini-room { right: 88px; } [dir="rtl"] body.has-apprail .mini-room { left: 88px; right: auto; }
.mini-vids { display: grid; gap: 2px; background: #000; aspect-ratio: 16 / 9; cursor: pointer; }
.mini-vids[data-n="2"] { grid-template-columns: 1fr 1fr; } .mini-vids[data-n="3"], .mini-vids[data-n="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mini-vids[data-n="0"]::after { content: "🎧"; display: grid; place-items: center; font-size: 34px; color: #fff; }
.mini-vids video { width: 100%; height: 100%; object-fit: cover; min-height: 0; }
.mini-vids video.off { display: none; }
.mini-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px 4px; cursor: grab; user-select: none; touch-action: none; }
.mini-bar b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mini-live { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); flex: none; animation: lbPulse 1.8s infinite; }
.mini-acts { display: flex; gap: 6px; padding: 6px 10px 10px; }
.mini-acts button { border: 1px solid var(--line); background: var(--sunken); color: var(--ink); border-radius: 10px; padding: 7px 10px; cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.mini-acts button svg { width: 16px; height: 16px; }
.mini-acts button.danger { color: var(--bad); }
.mini-acts .grow { flex: 1; }
@media (max-width: 760px) { .mini-room, body.has-apprail .mini-room { width: 210px; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }

/* calendar: click a day to plan */
.cal-day { cursor: pointer; } .cal-day:hover { box-shadow: inset 0 0 0 1px var(--brass); }
.cal-pop button { display: flex; align-items: center; gap: 8px; }
.cq-ico.sm { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; } .cq-ico.sm svg { width: 15px; height: 15px; }
.cal-n { display: flex; justify-content: space-between; align-items: center; }
.cal-add { opacity: 0; color: var(--brass); font-weight: 800; transition: opacity .15s; }
.cal-day:hover .cal-add, .cal-day:focus .cal-add { opacity: 1; }
@media (hover: none) { .cal-add { opacity: .7; } }
.mini-vids video.novid { background: radial-gradient(circle at 50% 45%, var(--sunken) 0 22%, #0b1513 23%) ; }
.past .chip { margin-inline: 6px; }
