/* Pro Office Meet meeting page. System fonts, inline SVG icons, no external files. */

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --bg: #f5f6fa;
  --bg-tint: #eceffa;
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --surface-3: #e7eaf2;
  --fg: #161a23;
  --muted: #586070;
  --line: #dde1ea;
  --brand: #3550d9;
  --brand-hover: #2a42bd;
  --brand-fg: #ffffff;
  --brand-soft: #e8ecff;
  --brand-soft-fg: #22379f;
  --teal: #1f8a7e;
  --danger: #c4312b;
  --danger-hover: #a92823;
  --danger-fg: #ffffff;
  --ok-bg: #e2f4ea;
  --ok-fg: #0f5a35;
  --warn-bg: #fff2d4;
  --warn-fg: #5c4100;
  --focus: #c25e00;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-2: 0 8px 28px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .08);
  /* The meeting stage is dark in both themes. */
  --stage: #0d1015;
  --stage-2: #151921;
  --tile: #1d222c;
  --tile-2: #262c38;
  --stage-fg: #eef0f5;
  --stage-muted: #a9b0bf;
  --bar-btn: #2a303c;
  --bar-btn-hover: #363d4b;
  --bar-on: #d9e0ff;
  --bar-on-fg: #162067;
  --off: #d4373c;
  --off-hover: #b92e33;
  --speak: #5fd7b4;
  --hand: #ffcf5c;
  --radius: 14px;
  --radius-s: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1218;
    --bg-tint: #141a28;
    --surface: #171b23;
    --surface-2: #1e232d;
    --surface-3: #282e3a;
    --fg: #e8ebf2;
    --muted: #a0a8b8;
    --line: #2b313d;
    --brand: #7f95ff;
    --brand-hover: #98a9ff;
    --brand-fg: #0a1030;
    --brand-soft: #222c52;
    --brand-soft-fg: #c9d3ff;
    --teal: #5fd7b4;
    --danger: #ff6b66;
    --danger-hover: #ff857f;
    --danger-fg: #2a0705;
    --focus: #f5a524;
    --ok-bg: #12301f;
    --ok-fg: #a6ecc3;
    --warn-bg: #3a2d0c;
    --warn-fg: #ffe1a0;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 10px 30px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1218; --bg-tint: #141a28; --surface: #171b23; --surface-2: #1e232d; --surface-3: #282e3a;
  --fg: #e8ebf2; --muted: #a0a8b8; --line: #2b313d; --brand: #7f95ff; --brand-hover: #98a9ff; --brand-fg: #0a1030;
  --brand-soft: #222c52; --brand-soft-fg: #c9d3ff; --teal: #5fd7b4; --danger: #ff6b66; --danger-hover: #ff857f;
  --danger-fg: #2a0705; --focus: #f5a524; --ok-bg: #12301f; --ok-fg: #a6ecc3; --warn-bg: #3a2d0c; --warn-fg: #ffe1a0;
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
body[data-screen="call"] { overflow: hidden; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.sr, .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); color: var(--fg); padding: 8px 12px; border-radius: 8px; z-index: 100; box-shadow: var(--shadow-2); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code { font-family: var(--mono); font-size: .92em; word-break: break-all; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 650; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
p { margin: 0; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-defs .fill { fill: currentColor; stroke: none; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.center { justify-content: center; }
.row.end { justify-content: flex-end; }

/* ------------------------------------------------------------------ controls */
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; opacity: .55; }
input:not([type=checkbox]), select {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  transition: border-color .15s, box-shadow .15s;
}
input:not([type=checkbox]):hover, select:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
input:not([type=checkbox]):focus-visible, select:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
input::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
label { font-size: 13px; font-weight: 600; }

.primary, .secondary, .danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  transition: background-color .15s, box-shadow .15s, transform .1s;
}
.primary { background: var(--brand); color: var(--brand-fg); box-shadow: var(--shadow-1); }
.primary:hover:not(:disabled) { background: var(--brand-hover); }
.primary:active:not(:disabled) { transform: translateY(1px); }
.primary.big { min-height: 50px; font-size: 16px; width: 100%; }
.secondary { background: var(--surface); color: var(--fg); border: 1px solid var(--line); }
.secondary:hover:not(:disabled) { background: var(--surface-2); }
.secondary.on-dark { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); }
.secondary.on-dark:hover { background: rgba(255, 255, 255, .2); }
.secondary.block { width: 100%; }
.danger { background: var(--danger); color: var(--danger-fg); }
.danger:hover { background: var(--danger-hover); }
.link-btn { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; font-size: inherit; padding: 2px 0; }
.link-btn:hover { text-decoration-thickness: 2px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; color: inherit; transition: background-color .15s; }
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.icon-btn.small { width: 30px; height: 30px; }
.icon-btn.small .ic { width: 18px; height: 18px; }
.quiet-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; transition: background-color .15s; }
.quiet-btn .lbl { position: static; width: auto; height: auto; clip: auto; margin: 0; white-space: nowrap; overflow: visible; }

.spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.busy .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip .ic { width: 16px; height: 16px; }
.chip.soft { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.chip.soft.ok { background: var(--ok-bg); color: var(--ok-fg); border-color: transparent; }

/* Tooltips (mouse hover and keyboard focus). */
[data-tip] { position: relative; }
@media (hover: hover) {
  [data-tip]:hover::after, [data-tip]:focus-visible::after {
    content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%);
    background: #20242d; color: #f2f4f8; font-size: 12px; font-weight: 500; line-height: 1.3; padding: 6px 9px;
    border-radius: 7px; white-space: nowrap; pointer-events: none; z-index: 40; box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
    animation: tip .15s .35s both;
  }
  .topbar [data-tip]:hover::after, .topbar [data-tip]:focus-visible::after { bottom: auto; top: calc(100% + 8px); }
  .tb-side [data-tip]:last-child:hover::after, .tb-side [data-tip]:last-child:focus-visible::after { left: auto; right: 0; transform: none; }
}
@keyframes tip { from { opacity: 0; } to { opacity: 1; } }
[data-tip][aria-expanded=true]::after { display: none !important; }

/* ------------------------------------------------------------------ top bar */
.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 20px; min-height: 60px; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-name { font-size: 17px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; }
.brand-name b { font-weight: 700; }
.call-info { display: none; min-width: 0; flex: 1; align-items: center; gap: 12px; }
.title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 15px; }
.timer { font-variant-numeric: tabular-nums; color: var(--stage-muted); font-size: 14px; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .18); }
.top-actions { display: none; align-items: center; gap: 8px; flex: none; }

body[data-screen="call"] { background: var(--stage); color: var(--stage-fg); }
body[data-screen="call"] .topbar, body[data-screen="call"] .stage, body[data-screen="call"] .toolbar, body[data-screen="call"] .banner-row { --focus: #f5a524; }
body[data-screen="call"] .topbar { background: var(--stage); color: var(--stage-fg); padding: 10px 16px; min-height: 56px; }
body[data-screen="call"] .brand-name { display: none; }
body[data-screen="call"] .brand-mark { width: 26px; height: 26px; }
body[data-screen="call"] .call-info, body[data-screen="call"] .top-actions { display: flex; }
.top-actions .chip { background: rgba(255, 255, 255, .08); color: var(--stage-fg); }
.chip-btn { cursor: pointer; transition: background-color .15s; }
.chip-btn:hover { background: rgba(255, 255, 255, .16); }
.chip-btn.e2ee { background: rgba(95, 215, 180, .16); color: #9ff0d5; }
.chip-btn.partial, .chip-btn.off { background: rgba(255, 196, 77, .16); color: #ffd98a; }
.chip-btn.checking .ic, .chip-btn.unverified .ic { opacity: .75; }
.top-actions .quiet-btn { color: var(--stage-fg); background: rgba(255, 255, 255, .08); }
.top-actions .quiet-btn:hover { background: rgba(255, 255, 255, .16); }

/* ------------------------------------------------------------------ popovers, menus, dialogs */
.popover {
  position: absolute; z-index: 50; background: var(--surface); color: var(--fg); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 14px 16px 16px; animation: pop .16s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.pop-head h2 { font-size: 15px; }
.details-pop { position: fixed; top: 60px; right: 16px; width: min(380px, calc(100vw - 32px)); }
.facts { margin: 0 0 14px; display: grid; gap: 4px 0; font-size: 13.5px; }
.facts dt { font-weight: 650; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-top: 8px; }
.facts dd { margin: 0; line-height: 1.45; }

.menu-wrap { position: relative; }
.menu {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 50; min-width: 230px;
  background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-2); padding: 6px; display: flex; flex-direction: column; animation: pop .16s var(--ease);
}
.menu [role=menuitem] { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; text-align: left; font-size: 14px; }
.menu [role=menuitem]:hover, .menu [role=menuitem]:focus-visible { background: var(--surface-2); outline-offset: -2px; }
.menu .ic { color: var(--muted); }

.dialog {
  border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--fg); box-shadow: var(--shadow-2);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
}
.dialog[open] { animation: pop .18s var(--ease); }
.dialog::backdrop { background: rgba(8, 10, 16, .55); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px 24px; }
.dialog-head h2 { font-size: 19px; }
.dialog-body { padding: 6px 24px 22px; }
.dialog-body h3 { margin: 16px 0 4px; }
.dialog-body p { line-height: 1.55; }
.dialog-body p + p { margin-top: 8px; }
.small-dialog { width: min(420px, calc(100vw - 32px)); }
.small-dialog .dialog-body { padding-top: 22px; }
.small-dialog h2 { margin-bottom: 8px; }
.small-dialog .row { margin-top: 20px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 14px 0 0; align-items: center; }
.keys dd { margin: 0; }
kbd { display: inline-grid; place-items: center; min-width: 30px; height: 28px; padding: 0 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; font: 600 13px var(--font); }

/* ------------------------------------------------------------------ messages */
.alert {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 60; width: max-content; max-width: min(640px, calc(100vw - 24px));
  display: flex; gap: 10px; align-items: center; padding: 10px 10px 10px 14px; border-radius: var(--radius);
  background: #fdecea; color: #5f1410; border: 1px solid #f3c2bd; box-shadow: var(--shadow-2); animation: pop .18s var(--ease);
}
.alert > .ic { color: #b3261e; }
.alert span { flex: 1; font-size: 14px; }
.alert-action { font-weight: 650; font-size: 14px; padding: 6px 12px; border-radius: 999px; background: #b3261e; color: #fff; white-space: nowrap; }
.alert-action:hover { background: #95201a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .alert { background: #3a1513; color: #ffdad6; border-color: #6f2a25; }
  :root:not([data-theme="light"]) .alert > .ic { color: #ff8a80; }
  :root:not([data-theme="light"]) .alert-action { background: #ff8a80; color: #2a0705; }
}
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 55; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
body[data-screen="call"] .toasts { bottom: 96px; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px; font-size: 14px;
  background: #232833; color: #f1f3f7; box-shadow: 0 8px 24px rgba(0, 0, 0, .28); max-width: 520px;
  animation: toast-in .22s var(--ease);
}
.toast .ic { width: 18px; height: 18px; color: #aab4ff; }
.toast.leaving { animation: toast-out .2s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ------------------------------------------------------------------ main and simple screens */
main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
main:focus { outline: none; }
.center-screen { flex: 1; display: grid; place-items: center; padding: 24px 16px 48px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-1); }
.status-card { width: min(460px, 100%); padding: 36px 32px 32px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.status-card h1 { font-size: 24px; margin-top: 8px; }
.status-card #lobby-text, .status-card #left-text { color: var(--fg); max-width: 36ch; }
.status-card .row { margin-top: 14px; }
.status-card .secondary { margin-top: 12px; min-width: 120px; }
.secondary-link { color: var(--brand); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 999px; text-decoration: none; }
.secondary-link:hover { background: var(--surface-2); }
.left-visual { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-soft-fg); }
.left-visual .ic { width: 32px; height: 32px; }
.lobby-visual { position: relative; width: 200px; height: 200px; display: grid; place-items: center; margin-bottom: 4px; }
.lobby-visual video { position: absolute; inset: 10px; width: 180px; height: 180px; border-radius: 50%; object-fit: cover; transform: scaleX(-1); background: var(--tile); z-index: 1; }
.lobby-visual .avatar-circle { width: 120px; height: 120px; font-size: 42px; }
.pulse { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--brand); opacity: .5; animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.82); opacity: .6; } 100% { transform: scale(1.05); opacity: 0; } }

/* ------------------------------------------------------------------ pre-join */
.prejoin {
  flex: 1; width: min(1280px, 100%); margin: 0 auto; padding: 16px 40px 56px;
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 56px; align-items: center;
}
body[data-screen="prejoin"], body[data-screen="lobby"], body[data-screen="left"] {
  background: radial-gradient(1200px 600px at 15% -10%, var(--bg-tint), transparent 70%), var(--bg);
}
.prejoin-media { min-width: 0; }
.preview {
  position: relative; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: #1a1e27;
  box-shadow: 0 18px 50px rgba(16, 24, 40, .18), 0 2px 8px rgba(16, 24, 40, .08); color: #fff;
}
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.preview-off { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(120% 90% at 50% 30%, #262c3a, #14171e); }
.preview-off-text { color: #c7cdd9; font-size: 14px; }
.perm {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-align: center; padding: 24px 32px 84px; background: radial-gradient(120% 90% at 50% 30%, #262c3a, #14171e); color: #eef0f5;
}
.perm h2 { font-size: 19px; }
.perm p { color: #c3c9d6; max-width: 44ch; font-size: 14px; line-height: 1.5; }
.perm .row { margin-top: 10px; }
.perm-ic { width: 40px; height: 40px; color: #aab8ff; margin-bottom: 4px; stroke-width: 1.5; }
.perm.denied .perm-ic { color: #ff9b95; }
.preview-controls { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; gap: 14px; z-index: 3; }
.round-btn {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: rgba(20, 23, 30, .55); border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(8px);
  transition: background-color .15s, border-color .15s;
}
.round-btn .ic { width: 24px; height: 24px; }
.round-btn:hover { background: rgba(40, 45, 56, .75); }
.round-btn.is-off { background: var(--off); border-color: var(--off); }
.round-btn.is-off:hover { background: var(--off-hover); }
.round-btn.ghost { position: absolute; right: 18px; bottom: 0; width: 44px; height: 44px; }
.round-btn.ghost .ic { width: 20px; height: 20px; }
.settings-pop { right: 14px; bottom: 56px; width: min(340px, calc(100% - 28px)); display: flex; flex-direction: column; gap: 6px; text-align: left; }
.settings-pop label { margin-top: 6px; }
.settings-pop select:disabled { opacity: .6; }
.meter { position: absolute; left: 18px; top: 18px; z-index: 3; height: 32px; padding: 0 10px; border-radius: 999px; display: flex; align-items: center; gap: 3px; background: rgba(20, 23, 30, .55); backdrop-filter: blur(8px); }
.meter i { width: 4px; height: 6px; border-radius: 2px; background: rgba(255, 255, 255, .35); transition: height .08s linear, background-color .08s linear; }
.meter i.on { background: var(--speak); }
.avatar-circle {
  --hue: 228; display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%;
  background: hsl(var(--hue) 42% 46%); color: #fff; font-weight: 650; font-size: 34px; letter-spacing: .02em; user-select: none;
}
.avatar-circle.big { width: 112px; height: 112px; font-size: 40px; }
.avatar-circle .ic { width: 52%; height: 52%; stroke-width: 1.6; }
.viewer-card {
  aspect-ratio: 16 / 9; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 32px;
  background: linear-gradient(145deg, var(--brand-soft), var(--surface)); border: 1px solid var(--line);
}
.viewer-card h2 { font-size: 21px; }
.viewer-card p { max-width: 46ch; color: var(--muted); }
.viewer-ic { width: 56px; height: 56px; color: var(--brand); stroke-width: 1.4; margin-bottom: 6px; }

.prejoin-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips:empty, .chips:not(:has(> :not([hidden]))) { display: none; }
.meeting-h { font-size: 32px; overflow-wrap: anywhere; }
.host-note { display: inline-flex; align-self: flex-start; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; color: var(--brand-soft-fg); background: var(--brand-soft); padding: 6px 12px; border-radius: 999px; }
.join-form { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.join-form .field { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.join-form .primary.big { margin-top: 12px; }
#join-hint { text-align: center; }
.privacy-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.privacy-line .ic { width: 18px; height: 18px; color: var(--teal); }

/* ------------------------------------------------------------------ call */
.call { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--stage); color: var(--stage-fg); }
.banner-row { padding: 0 16px 8px; }
.warning { display: flex; gap: 10px; align-items: center; padding: 4px 4px 4px 12px; border-radius: 10px; background: rgba(255, 196, 77, .12); color: #ffdf9c; font-size: 13px; }
.warning > .ic { width: 18px; height: 18px; }
.warning p { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .warning p { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 12.5px; } }
.call-body { flex: 1; display: flex; min-height: 0; gap: 12px; padding: 0 16px 0; }
.stage { position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.grid { position: relative; flex: 1; min-height: 0; }
.tile {
  position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: hidden; border-radius: var(--radius);
  background: var(--tile); transition: left .25s var(--ease), top .25s var(--ease), width .25s var(--ease), height .25s var(--ease), box-shadow .2s;
}
.tile.offstage { visibility: hidden; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--tile); }
.tile.self video { transform: scaleX(-1); }
.tile.screen { background: #07090c; }
.tile.screen video { object-fit: contain; background: #07090c; }
.tile.cam-off video { visibility: hidden; }
.tile .avatar { position: absolute; inset: 0; display: none; place-items: center; background: radial-gradient(110% 90% at 50% 35%, var(--tile-2), var(--tile)); }
.tile.cam-off .avatar { display: grid; }
.tile .avatar-circle { width: clamp(44px, 26%, 128px); height: auto; aspect-ratio: 1; font-size: clamp(16px, 4.5vmin, 40px); }
.tile.speaking { box-shadow: inset 0 0 0 3px var(--speak), 0 0 0 1px rgba(95, 215, 180, .35); }
.tile .label {
  position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); display: flex; gap: 6px; align-items: center;
  padding: 4px 10px 4px 8px; border-radius: 8px; background: rgba(10, 12, 16, .62); color: #fff; font-size: 13px; font-weight: 550;
  backdrop-filter: blur(6px);
}
.tile .label .ic { width: 16px; height: 16px; }
.tile .label .muted-ic { color: #ff9b95; }
.tile .label .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .label .tag { font-size: 11px; font-weight: 650; padding: 1px 6px; border-radius: 5px; background: rgba(255, 255, 255, .16); text-transform: uppercase; letter-spacing: .04em; }
.tile .hand-badge { position: absolute; top: 10px; left: 10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--hand); color: #3b2a00; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); animation: wave .6s var(--ease); }
.tile .hand-badge .ic { width: 20px; height: 20px; }
@keyframes wave { 0% { transform: scale(.4) rotate(-20deg); } 70% { transform: scale(1.1) rotate(8deg); } 100% { transform: none; } }
.tile .status { position: absolute; top: 10px; right: 10px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(10, 12, 16, .62); border-radius: 8px; padding: 3px 8px; }
.tile.pip { z-index: 2; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .12); }
.tile.pip .label { left: 6px; bottom: 6px; font-size: 12px; padding: 2px 8px 2px 6px; }
.tile.small .label { left: 6px; bottom: 6px; font-size: 12px; padding: 2px 7px 2px 6px; }
.tile.small .label .tag { display: none; }
.tile.small .hand-badge { top: 6px; left: 6px; width: 26px; height: 26px; }
.tile.small .hand-badge .ic { width: 15px; height: 15px; }

.alone {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 3; width: min(420px, calc(100% - 24px));
  background: rgba(22, 26, 34, .9); border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px; padding: 16px 18px;
  backdrop-filter: blur(10px); box-shadow: 0 12px 32px rgba(0, 0, 0, .4);
}
.alone-h { font-weight: 650; font-size: 15px; }
.alone-t { color: var(--stage-muted); font-size: 13.5px; margin: 2px 0 12px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; padding-top: 8px; font-size: 13px; color: var(--stage-muted); }
.pager .icon-btn { color: var(--stage-fg); background: rgba(255, 255, 255, .08); }

/* Side panels */
.panel {
  width: 360px; flex: none; display: flex; flex-direction: column; min-height: 0; margin-bottom: 4px;
  background: var(--surface); color: var(--fg); border-radius: 18px; overflow: hidden; animation: slide-in .22s var(--ease);
}
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 6px 20px; }
.panel-head h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.panel-head .count { font-size: 12px; font-weight: 650; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.panel-note { margin: 0 20px 8px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.panel-scroll { flex: 1; overflow: auto; padding: 0 20px 16px; }
.empty { color: var(--muted); font-size: 13.5px; text-align: center; padding: 28px 20px 0; }
.chat-log, .qa-list { flex: 1; list-style: none; margin: 0; padding: 8px 20px; overflow: auto; min-height: 80px; }
.chat-log li { margin: 0 0 14px; overflow-wrap: anywhere; }
.chat-log .meta { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; margin-bottom: 3px; }
.chat-log .who { font-weight: 650; }
.chat-log .when { color: var(--muted); font-size: 12px; }
.chat-log .text { white-space: pre-wrap; background: var(--surface-2); padding: 8px 12px; border-radius: 4px 14px 14px 14px; display: inline-block; max-width: 100%; font-size: 14px; }
.chat-log li.mine { text-align: right; }
.chat-log li.mine .meta { justify-content: flex-end; }
.chat-log li.mine .text { background: var(--brand-soft); color: var(--brand-soft-fg); border-radius: 14px 4px 14px 14px; text-align: left; }
.chat-log li.cont { margin-top: -10px; }
.chat-log li.cont .meta { display: none; }
.compose { display: flex; gap: 8px; align-items: center; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.compose input { border-radius: 999px; background: var(--surface-2); border-color: transparent; padding-left: 16px; }
.send-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-fg); flex: none; }
.send-btn:hover { background: var(--brand-hover); }
.send-btn .ic { width: 20px; height: 20px; }

.qa-list li { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.qa-list li.answered .q-text { color: var(--muted); }
.qa-list .q-text { font-size: 14px; grid-column: 2; }
.qa-list .q-meta { grid-column: 2; font-size: 12.5px; color: var(--muted); }
.qa-list .vote { grid-row: 1 / span 3; display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 44px; padding: 6px 4px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; font-weight: 650; }
.qa-list .vote .ic { width: 18px; height: 18px; }
.qa-list .vote[aria-pressed=true] { background: var(--brand-soft); color: var(--brand-soft-fg); border-color: transparent; }
.qa-list .row { grid-column: 2; margin-top: 4px; }
.mini { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
.mini:hover { background: var(--surface-2); }
.mini.go { background: var(--brand); color: var(--brand-fg); border-color: transparent; }
.mini.go:hover { background: var(--brand-hover); }
.mini.warn { color: var(--danger); }
.answered-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--ok-fg); background: var(--ok-bg); padding: 0 8px; border-radius: 999px; font-weight: 600; }
.answered-tag .ic { width: 14px; height: 14px; }

.host-tools .group { padding: 12px 0 14px; border-bottom: 1px solid var(--line); }
.host-tools h3, .list-h { margin: 6px 0 10px; }
.list-h { margin-top: 16px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-weight: 500; font-size: 14px; margin-bottom: 10px; cursor: pointer; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; width: 42px; height: 24px; border-radius: 999px; margin: 0; position: relative; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--line); transition: background-color .15s;
}
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s var(--ease); }
.switch:checked { background: var(--brand); border-color: var(--brand); }
.switch:checked::after { transform: translateX(18px); }
.pw-form { display: flex; flex-direction: column; gap: 6px; }
.pw-form .row { flex-wrap: nowrap; }
.pw-form .link-btn { align-self: flex-start; font-size: 13px; }
.pw-form .link-btn:disabled { display: none; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 0; }
.list li .avatar-circle { width: 34px; height: 34px; font-size: 13px; flex: none; }
.list li .who { flex: 1; min-width: 110px; display: flex; flex-direction: column; overflow-wrap: anywhere; line-height: 1.3; }
.list li .who .name { font-weight: 600; font-size: 14px; }
.list li .who .sub { font-size: 12px; color: var(--muted); }
.list li .state { display: flex; gap: 6px; color: var(--muted); }
.list li .state .ic { width: 18px; height: 18px; }
.list li .state .hand-ic { color: #b07800; }
.list li .acts { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; padding-left: 44px; }
.waiting li { background: var(--surface-2); border-radius: 12px; padding: 8px 10px; margin-bottom: 6px; }
.waiting li .acts { width: auto; padding-left: 0; }

/* Control bar */
.toolbar { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 16px 16px; flex: none; }
.tb-center { display: flex; gap: 10px; align-items: center; }
.tb-side { position: absolute; right: 16px; top: 12px; display: flex; gap: 8px; }
.tb-btn {
  position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bar-btn); color: var(--stage-fg); transition: background-color .15s, color .15s, transform .1s;
}
.tb-btn .ic { width: 23px; height: 23px; }
.tb-btn:hover:not(:disabled) { background: var(--bar-btn-hover); }
.tb-btn:active:not(:disabled) { transform: scale(.96); }
.tb-btn.off { background: var(--off); color: #fff; }
.tb-btn.off:hover { background: var(--off-hover); }
.tb-btn[aria-pressed=true] { background: var(--bar-on); color: var(--bar-on-fg); }
.tb-btn.quiet { background: transparent; }
.tb-btn.quiet:hover { background: var(--bar-btn); }
.tb-btn.quiet[aria-expanded=true] { background: var(--bar-on); color: var(--bar-on-fg); }
.tb-btn.leave { width: 68px; border-radius: 999px; background: var(--off); color: #fff; }
.tb-btn.leave:hover { background: var(--off-hover); }
.tb-btn .dot { position: absolute; top: 9px; right: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--speak); box-shadow: 0 0 0 2px var(--stage); }
.tb-btn .badge-n { position: absolute; top: 4px; right: 2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--hand); color: #3b2a00; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--stage); }
.narrow-only { display: none !important; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .prejoin { gap: 32px; padding: 16px 24px 40px; }
  .meeting-h { font-size: 28px; }
}
@media (max-width: 860px) {
  .prejoin { grid-template-columns: 1fr; align-items: start; gap: 22px; width: min(640px, 100%); padding: 8px 16px 32px; }
  .meeting-h { font-size: 26px; }
  .panel { position: fixed; z-index: 30; top: 64px; right: 12px; bottom: 92px; width: min(380px, calc(100vw - 24px)); box-shadow: var(--shadow-2); }
}
@media (max-width: 760px) {
  .tb-side { position: static; }
  .toolbar { gap: 8px; }
}
@media (max-width: 600px) {
  .topbar { padding: 10px 16px; min-height: 56px; }
  .brand-name { font-size: 16px; }
  .prejoin { padding: 4px 16px 28px; gap: 18px; }
  .preview { aspect-ratio: auto; height: min(50vh, 440px); border-radius: 20px; width: 100%; }
  .viewer-card { aspect-ratio: auto; padding: 28px 20px; }
  .meeting-h { font-size: 24px; }
  .round-btn { width: 50px; height: 50px; }
  .round-btn.ghost { right: 12px; width: 42px; height: 42px; }
  .meter { left: 12px; top: 12px; }
  .status-card { padding: 28px 20px 24px; border-radius: 18px; }
  body[data-screen="call"] .topbar { padding: 8px 12px; gap: 10px; min-height: 52px; }
  body[data-screen="call"] .brand { display: none; }
  .top-actions { gap: 6px; }
  .top-actions .quiet-btn { width: 36px; padding: 0; justify-content: center; }
  .top-actions .quiet-btn .lbl { position: absolute; width: 1px; height: 1px; clip: rect(0 0 0 0); overflow: hidden; }
  .chip-btn #security { position: absolute; width: 1px; height: 1px; clip: rect(0 0 0 0); overflow: hidden; }
  .chip-btn { padding: 3px 8px; }
  .timer { padding-left: 10px; font-size: 13px; }
  .title { font-size: 14px; }
  #people-chip { display: none; }
  .call-body { padding: 0 8px; }
  .banner-row { padding: 0 8px 6px; }
  .toolbar { padding: 10px 8px calc(12px + env(safe-area-inset-bottom)); gap: 6px; }
  .tb-center, .tb-side { gap: 6px; }
  .tb-btn { width: 44px; height: 44px; }
  .tb-btn .ic { width: 21px; height: 21px; }
  .tb-btn.leave { width: 54px; }
  .tb-btn .dot { top: 6px; right: 6px; }
  .wide-only { display: none !important; }
  .narrow-only { display: flex !important; }
  .menu { left: auto; right: -40px; transform: none; }
  .panel { inset: 0; top: 0; right: 0; bottom: 0; width: 100%; border-radius: 0; z-index: 45; margin: 0; }
  .tile .label { font-size: 12px; }
  .alone { bottom: 12px; }
  body[data-screen="call"] .toasts { bottom: 84px; }
  .alert { top: 8px; }
}

/* ------------------------------------------------------------------ motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .pulse { display: none; }
}
@media (forced-colors: active) {
  .tb-btn, .round-btn, .chip, .primary, .secondary { border: 1px solid ButtonText; }
}

/* Start page (home.html) */
.home-card { width: min(560px, 100%); text-align: left; align-items: flex-start; gap: 12px; }
.home-card h1 { margin-top: 0; }
