/* BEGU brand: indigo #312783, orange #ea5b0c, teal #0e8c8c */
:root {
  --bg: #15122e;
  --surface: #2a2650;
  --surface-hover: #363163;
  --text: #eeedf7;
  --muted: #a29fbd;
  --accent: #a9a0ff;
  --primary: #312783;
  --primary-hover: #3f33a3;
  --orange: #ea5b0c;
  --orange-hover: #bf470a;
  --teal: #0e8c8c;
  --danger: #e5484d;
  --danger-hover: #c93a3f;
  --light-text: #15122e;
  --light-muted: #615e7c;
  --light-border: #e5e3ef;
  --light-fill: #f7f6fb;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Google Sans", Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
body.light { background: #fff; color: var(--light-text); }
[hidden] { display: none !important; }
svg { width: 24px; height: 24px; fill: currentColor; display: block; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
.muted { color: var(--light-muted); }
.small { font-size: 13px; }

/* ---------- buttons */
.btn {
  border: 0; border-radius: 24px; height: 48px; padding: 0 22px;
  font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; white-space: nowrap; transition: background .15s, box-shadow .15s;
}
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); box-shadow: 0 1px 3px rgba(21,18,46,.3); }
.btn.text { background: transparent; color: var(--primary); padding: 0 14px; }
.btn.text:hover:not(:disabled) { background: #efedfa; }
.btn.text:disabled { color: #a29fbd; opacity: 1; }
.btn.outline-light { background: #fff; color: var(--primary); border: 1px solid var(--light-border); }
.btn.outline-light:hover { background: #efedfa; }
.btn.wide { min-width: 200px; }

.field {
  width: 100%; height: 56px; border: 1px solid var(--light-border); border-radius: 6px; padding: 0 16px;
  font-size: 16px; outline: none; color: var(--light-text); background: #fff;
}
.field:focus { border: 2px solid var(--primary); padding: 0 15px; }
.field.invalid { border: 2px solid var(--danger-hover); padding: 0 15px; }
.form-error { color: var(--danger-hover); font-size: 14px; margin: 10px 0 0; }

/* ---------- top bar & logo */
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 22px; letter-spacing: .3px; }
.logo-img { width: 42px; height: 42px; display: block; }
.logo b { font-weight: 800; color: var(--primary); }
.logo em { font-style: normal; font-weight: 700; color: var(--orange); }
.topbar-time { color: var(--light-muted); font-size: 16px; }

/* ---------- home / welcome page */
.site-header {
  position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--light-border); gap: 16px;
}
.site-nav { display: flex; gap: 28px; }
.site-nav a { color: var(--light-muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.site-nav a:hover { color: var(--primary); }
.header-right { display: flex; align-items: center; gap: 20px; }
.small-btn { height: 40px; padding: 0 18px; font-size: 14px; }

.eyebrow { color: var(--orange); font-weight: 500; font-size: 14px; letter-spacing: .6px; text-transform: uppercase; margin: 0 0 12px; }
.eyebrow.center { text-align: center; }

.hero {
  max-width: 1200px; margin: 0 auto; padding: 56px 24px 72px;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center;
  min-height: calc(100vh - 64px);
}
.hero h1 { font-size: clamp(34px, 4.6vw, 54px); font-weight: 400; line-height: 1.12; margin: 0 0 20px; letter-spacing: -1px; }
.hl { color: var(--orange); }
.lead { font-size: 18px; color: var(--light-muted); line-height: 1.6; margin: 0 0 36px; max-width: 560px; }
.home-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.join-form { display: flex; align-items: center; gap: 4px; }
.code-field {
  display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 14px;
  border: 1px solid #b9b5d0; border-radius: 6px; color: var(--light-muted); background: #fff;
}
.code-field:focus-within { border: 2px solid var(--primary); padding: 0 13px; }
.code-field input { border: 0; outline: 0; font-size: 16px; width: 200px; color: var(--light-text); background: transparent; }

.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 15; min-width: 290px; padding: 8px 0;
  background: #fff; border-radius: 6px; box-shadow: 0 4px 16px rgba(21,18,46,.25), 0 1px 3px rgba(21,18,46,.2);
}
.menu button {
  width: 100%; display: flex; align-items: center; gap: 16px; padding: 12px 18px; border: 0; background: none;
  font-size: 15px; color: var(--light-text); text-align: left;
}
.menu button:hover, .menu button:focus-visible { background: var(--light-fill); outline: none; }
.menu svg { color: var(--light-muted); }

.trust { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-wrap: wrap; gap: 10px 24px; color: var(--light-muted); font-size: 14px; }
.trust li { display: flex; align-items: center; gap: 6px; }
.trust svg { width: 18px; height: 18px; color: var(--teal); }

/* Hero mock-up of a call */
.hero-art { display: flex; justify-content: center; }
.mock {
  width: 100%; max-width: 520px; background: var(--bg); border-radius: 18px; padding: 14px 14px 12px;
  box-shadow: 0 24px 60px rgba(49,39,131,.25), 0 8px 20px rgba(0,0,0,.12); transform: rotate(-1.5deg);
}
.mock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mock-tile { position: relative; aspect-ratio: 16 / 10; border-radius: 10px; display: grid; place-items: center; }
.mock-tile span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 24px; }
.mock-tile i { position: absolute; left: 10px; bottom: 8px; color: var(--text); font-style: normal; font-size: 12px; }
.t1 { background: #2b2560; } .t1 span { background: #5b4fd0; }
.t2 { background: #4a2616; } .t2 span { background: var(--orange); }
.t3 { background: #143a3d; } .t3 span { background: var(--teal); }
.t4 { background: #33204f; } .t4 span { background: #6d3bbf; }
.mock-tile.speaking { box-shadow: inset 0 0 0 3px var(--accent); }
.mock-tile.speaking span { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(169,160,255,.3); } }
.mock-bar { display: flex; justify-content: center; gap: 10px; padding-top: 12px; }
.mock-bar b { width: 30px; height: 30px; border-radius: 50%; background: var(--surface); }
.mock-bar b.red { width: 40px; border-radius: 15px; background: var(--danger); }

/* Sections */
.section { padding: 88px 24px; }
.section.alt { background: var(--light-fill); }
.section-title { font-size: clamp(28px, 3.4vw, 38px); font-weight: 400; text-align: center; margin: 0 0 14px; letter-spacing: -.5px; }
.section-lead { text-align: center; color: var(--light-muted); font-size: 17px; max-width: 620px; margin: 0 auto; line-height: 1.6; }

.feature-grid {
  max-width: 1100px; margin: 48px auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
}
.feature { border: 1px solid var(--light-border); border-radius: 16px; padding: 28px; background: #fff; transition: box-shadow .2s, transform .2s; }
.feature:hover { box-shadow: 0 8px 24px rgba(21,18,46,.12); transform: translateY(-2px); }
.feature h3, .use h3, .steps h3 { font-size: 18px; font-weight: 500; margin: 18px 0 8px; }
.feature p, .use p, .steps p { color: var(--light-muted); line-height: 1.6; margin: 0; font-size: 15px; }
.f-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; }
.f-icon.blue { background: #efedfa; color: var(--primary); }
.f-icon.red { background: #fff1e8; color: var(--orange); }
.f-icon.green { background: #e4f4f3; color: var(--teal); }
.f-icon.yellow { background: #f3ecfb; color: #6d3bbf; }

.steps { list-style: none; padding: 0; max-width: 1000px; margin: 48px auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; counter-reset: none; }
.steps li { text-align: center; padding: 0 8px; }
.step-num {
  width: 52px; height: 52px; border-radius: 50%; background: var(--orange); color: #fff; font-size: 22px; font-weight: 500;
  display: inline-grid; place-items: center; box-shadow: 0 6px 16px rgba(234,91,12,.3);
}

.use-grid { max-width: 1100px; margin: 48px auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.use { border-radius: 16px; padding: 32px 28px; background: linear-gradient(160deg, #efedfa, #fff 70%); border: 1px solid #d9d5f0; }
.use > svg { width: 36px; height: 36px; color: var(--primary); }

.faq { max-width: 760px; margin: 40px auto 0; display: grid; gap: 12px; }
.faq details { background: #fff; border: 1px solid var(--light-border); border-radius: 12px; padding: 0 22px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 0; font-size: 16px; font-weight: 500;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 24px; font-weight: 300; color: var(--orange); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 18px; color: var(--light-muted); line-height: 1.6; }

.cta {
  margin: 0 24px 64px; padding: 64px 24px; border-radius: 24px; text-align: center; color: #fff;
  background: radial-gradient(circle at 85% 15%, rgba(234,91,12,.45), transparent 45%), linear-gradient(135deg, #312783, #171247);
}
.cta h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 400; margin: 0 0 10px; }
.cta p { margin: 0 0 28px; opacity: .9; font-size: 17px; }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.btn.light-btn { background: var(--orange); color: #fff; }
.btn.light-btn:hover { background: var(--orange-hover); }
.btn.outline-white { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.7); }
.btn.outline-white:hover { background: rgba(255,255,255,.12); }

.site-footer {
  border-top: 1px solid var(--light-border); padding: 24px; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 12px; max-width: 1200px; margin: 0 auto;
}
.site-footer .logo { font-size: 18px; }
.site-footer .logo-img { width: 34px; height: 34px; }
.site-footer p { margin: 0; color: var(--light-muted); font-size: 14px; }
.site-footer p a { color: var(--light-muted); }

/* "Meeting for later" dialog */
.modal { border: 0; border-radius: 12px; padding: 24px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 12px 40px rgba(0,0,0,.25); color: var(--light-text); }
.modal::backdrop { background: rgba(21,18,46,.5); }
.modal h2 { font-size: 20px; font-weight: 400; margin: 0 0 8px; }
.modal p { line-height: 1.5; font-size: 14px; margin: 0 0 16px; }
.link-box { display: flex; align-items: center; background: var(--light-fill); border-radius: 6px; padding-left: 14px; }
.link-box input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 15px; color: var(--light-text); outline: none; height: 48px; }
.copied { color: var(--teal); font-size: 13px !important; margin: 8px 0 0 !important; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; gap: 48px; min-height: 0; }
  .hero-art { order: -1; }
  .mock { max-width: 420px; }
  .feature-grid, .use-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-nav, .topbar-time { display: none; }
}
@media (max-width: 640px) {
  .feature-grid, .use-grid, .steps { grid-template-columns: 1fr; }
  .section { padding: 64px 16px; }
  .hero { padding: 24px 16px 56px; }
  .cta { margin: 0 16px 48px; }
  .site-header .small-btn { display: none; }
}
@media (max-width: 480px) {
  .join-form { width: 100%; }
  .code-field { flex: 1; min-width: 0; }
  .code-field input { width: 100%; }
  .menu-wrap, .menu-wrap > .btn { width: 100%; }
  .menu { right: 0; min-width: 0; }
}

/* ---------- lobby */
.lobby-page { min-height: 100%; }
.lobby {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 48px;
  padding: 24px 16px 48px; min-height: calc(100vh - 64px);
}
.lobby-preview { flex: 1 1 520px; max-width: 760px; }
.preview-box { position: relative; aspect-ratio: 16 / 9; background: var(--bg); border-radius: 8px; overflow: hidden; }
.preview-box video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.preview-off { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; }
.preview-controls { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; gap: 20px; }
.device-msg { color: var(--light-muted); font-size: 14px; min-height: 20px; margin: 12px 4px 0; }
.lobby-join { flex: 0 1 340px; text-align: center; }
.lobby-join h1 { font-size: 30px; font-weight: 400; margin: 0 0 10px; }
.lobby-join .field { margin: 20px 0 16px; }

/* ---------- round controls */
.ctl {
  width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--surface); color: var(--text);
  display: grid; place-items: center; transition: background .15s, border-radius .2s;
}
.ctl:hover { background: var(--surface-hover); }
.ctl.off { background: var(--danger); color: #fff; }
.ctl.off:hover { background: var(--danger-hover); }
.ctl.active { background: var(--accent); color: var(--bg); }
/* Waiting room (lobby side) */
.waiting-box { padding: 8px 0 4px; }
.waiting-box h2 { font-size: 20px; font-weight: 500; margin: 16px 0 6px; }
.waiting-box p { margin: 0 0 20px; line-height: 1.5; font-size: 14px; }
.spinner {
  width: 40px; height: 40px; margin: 8px auto 0; border-radius: 50%;
  border: 4px solid var(--light-border); border-top-color: var(--orange); animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Admit request (host side) */
.admit-card {
  position: fixed; right: 16px; bottom: 96px; z-index: 12; width: min(380px, calc(100vw - 32px));
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 14px; padding: 16px 16px 10px;
  background: #fff; color: var(--light-text); border-radius: 12px; border-left: 4px solid var(--orange);
  box-shadow: 0 8px 28px rgba(0,0,0,.35); animation: slide-in .25s ease-out;
}
@keyframes slide-in { from { transform: translateY(12px); opacity: 0; } }
.admit-card .p-avatar { width: 40px; height: 40px; font-size: 16px; }
.admit-text { display: flex; flex-direction: column; min-width: 0; font-size: 14px; color: var(--light-muted); }
.admit-text b { color: var(--light-text); font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admit-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.admit-actions .btn { height: 38px; }

.panel-row { display: flex; align-items: center; justify-content: space-between; padding-right: 16px; }
.btn.tiny { height: 32px; padding: 0 12px; font-size: 13px; }
.icon-btn.small-icon { width: 34px; height: 34px; flex: none; }
.icon-btn.small-icon svg { width: 20px; height: 20px; }
.p-name { display: flex; flex-direction: column; }
.p-name > span { overflow: hidden; text-overflow: ellipsis; }
.p-name small { font-size: 12px; color: var(--light-muted); }
.host-note { margin: 16px 0 8px !important; font-size: 13px !important; color: var(--light-muted); }

.ctl.recording { background: var(--danger); color: #fff; }
.ctl.recording:hover { background: var(--danger-hover); }
.rec-badge {
  position: absolute; top: 16px; left: 16px; z-index: 4; display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 10px; border-radius: 16px; background: rgba(21,18,46,.85); color: #fff;
  font-size: 13px; font-weight: 500; pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: rec-blink 1.4s ease-in-out infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
.ctl.leave { width: 64px; border-radius: 24px; background: var(--danger); color: #fff; }
.ctl.leave:hover { background: var(--danger-hover); }
.ctl.outline { width: 56px; height: 56px; background: transparent; border: 1px solid rgba(255,255,255,.9); color: #fff; }
.ctl.outline:hover { background: rgba(255,255,255,.15); }
.ctl.outline.off { background: var(--danger); border-color: var(--danger); }

.icon-btn {
  position: relative; width: 48px; height: 48px; border-radius: 50%; border: 0; background: transparent;
  color: var(--text); display: grid; place-items: center;
}
.icon-btn:hover { background: rgba(232,234,237,.08); }
.icon-btn.active { color: var(--accent); }
.icon-btn.dark { color: var(--light-muted); }
.icon-btn.dark:hover { background: rgba(21,18,46,.06); }
.badge {
  position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--orange); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center;
}
.badge.dot { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 10px; right: 10px; background: var(--accent); }

/* ---------- meeting */
.meeting { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.main { flex: 1; min-height: 0; display: flex; position: relative; }
.stage {
  flex: 1; min-width: 0; position: relative; padding: 8px;
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 8px; overflow: hidden;
}

.tile { position: relative; flex: none; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--surface); }
.tile.mirror video.cam { transform: scaleX(-1); }
.tile.video-off video.cam { visibility: hidden; }
.tile .screen-video { display: none; }
.avatar { position: absolute; inset: 0; display: none; place-items: center; }
.tile.video-off .avatar { display: grid; }
.avatar span {
  width: clamp(44px, 26%, 140px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: clamp(18px, 4vw, 56px); transition: box-shadow .15s;
}

/* Presenting: the shared screen fills the tile and the presenter's camera floats in the corner */
.tile.screen { background: #000; }
.tile.screen .screen-video { display: block; position: absolute; inset: 0; object-fit: contain; background: #000; }
.tile.screen video.cam, .tile.screen .avatar {
  position: absolute; inset: auto 12px 12px auto; width: clamp(72px, 22%, 300px); height: auto; aspect-ratio: 16 / 9;
  border-radius: 12px; z-index: 2; box-shadow: 0 8px 24px rgba(0,0,0,.5); outline: 2px solid rgba(255,255,255,.2);
}
.tile.screen .avatar { background: var(--surface); }
.tile.screen .avatar span { width: 42%; font-size: clamp(14px, 1.6vw, 26px); }
.tile.screen.speaking::after { inset: auto 12px 12px auto; width: clamp(72px, 22%, 300px); height: auto; aspect-ratio: 16 / 9; border-radius: 12px; z-index: 3; }
.tile.speaking::after {
  content: ""; position: absolute; inset: 0; border: 3px solid var(--accent); border-radius: inherit; pointer-events: none;
}
.tile.speaking .avatar span { box-shadow: 0 0 0 8px rgba(169,160,255,.3); }
.tile-name {
  position: absolute; left: 12px; bottom: 10px; max-width: calc(100% - 24px); font-size: 14px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.7);
}
.tile-mic, .tile-hand {
  position: absolute; top: 10px; width: 30px; height: 30px; border-radius: 50%; display: none; place-items: center;
}
.tile-mic { right: 10px; background: rgba(21,18,46,.65); }
.tile-hand { left: 10px; background: #fff; color: var(--bg); }
.tile-mic svg, .tile-hand svg { width: 18px; height: 18px; }
.tile.muted .tile-mic, .tile.hand .tile-hand { display: grid; }
.tile-pin {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 48px; height: 48px; border-radius: 50%;
  border: 0; background: rgba(21,18,46,.6); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .15s;
}
.tile:hover .tile-pin, .tile-pin:focus-visible { opacity: 1; }
.tile.is-pinned .tile-pin { color: var(--accent); }
.tile.connecting::before {
  content: "Connecting…"; position: absolute; right: 12px; bottom: 10px; font-size: 12px; color: var(--muted); z-index: 1;
}

/* Pinned / presenting layout: one big tile, everyone else in a strip beside it */
.stage.pinned { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: flex-end; justify-content: flex-start; overflow-y: auto; }
.stage.pinned .tile.is-pinned { position: absolute; top: 8px; left: 8px; bottom: 8px; right: 276px; }
.stage.pinned .tile:not(.is-pinned) { width: 260px; height: auto; aspect-ratio: 16 / 9; }

/* "You're presenting" banner */
.presenting-bar {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 6px 16px; border-radius: 24px; background: rgba(36,31,74,.94); color: #fff; font-size: 14px; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.08);
}
.presenting-bar svg { width: 20px; height: 20px; color: var(--accent); }
.btn.stop-present { background: var(--accent); color: var(--bg); border-radius: 18px; font-weight: 600; }
.btn.stop-present:hover { background: #c3bcff; }

/* ---------- bottom bar */
.bar {
  height: 88px; flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 0 20px;
}
.bar-left { display: flex; align-items: center; gap: 12px; min-width: 0; white-space: nowrap; }
.bar-time { font-size: 16px; font-weight: 600; }
.bar-code {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.15);
  color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis;
}
.host-chip {
  background: rgba(234,91,12,.2); color: #ffb48a; font-size: 11px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; padding: 3px 8px; border-radius: 10px;
}
.bar-center { display: flex; align-items: center; gap: 12px; }
.bar-right { display: flex; justify-content: flex-end; gap: 4px; }
.ctl-group {
  display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 32px;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07);
}
.split { display: flex; align-items: center; border-radius: 26px; background: var(--surface); }
.caret {
  order: -1; width: 30px; height: 48px; padding-left: 4px; border: 0; border-radius: 24px 0 0 24px;
  background: transparent; color: var(--text); display: grid; place-items: center;
}
.caret svg { width: 20px; height: 20px; transition: transform .15s; }
.caret:hover, .caret.open { background: var(--surface-hover); }
.caret.open svg { transform: rotate(180deg); }

/* Styled tooltips */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translate(-50%, 4px);
  background: #ece9ff; color: var(--bg); font-size: 12px; font-weight: 600; white-space: nowrap; padding: 6px 10px; border-radius: 6px;
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 30;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.bar-right [data-tip]::after { left: auto; right: 0; transform: translateY(4px); }
.bar-right [data-tip]:hover::after, .bar-right [data-tip]:focus-visible::after { transform: translateY(0); }
[data-tip].open::after { opacity: 0 !important; }

/* ---------- side panel */
.panel {
  width: 360px; flex: none; margin: 8px 16px 0 0; background: #fff; color: var(--light-text);
  border-radius: 8px; display: flex; flex-direction: column; min-height: 0;
}
.panel header { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 8px 24px; }
.panel h2 { font-size: 18px; font-weight: 400; margin: 0; }
.panel-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#peoplePanel { padding: 8px 0 16px; overflow-y: auto; }
#peoplePanel > .btn { margin: 0 24px; align-self: flex-start; }
.panel-label { font-size: 12px; font-weight: 500; letter-spacing: .5px; text-transform: uppercase; color: var(--light-muted); margin: 24px 24px 8px; }
.people-list { list-style: none; margin: 0; padding: 0; }
.people-list li { display: flex; align-items: center; gap: 14px; padding: 8px 24px; }
.people-list li:hover { background: var(--light-fill); }
.p-avatar { width: 32px; height: 32px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-size: 14px; flex: none; }
.p-name { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-icons { display: flex; gap: 6px; color: var(--light-muted); }
.p-icons svg { width: 20px; height: 20px; }

.chat-note { margin: 4px 16px 12px; padding: 12px; border-radius: 8px; background: var(--light-fill); font-size: 12px; color: var(--light-muted); line-height: 1.5; text-align: center; }
.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 0 24px; }
.msg-meta { font-size: 13px; }
.msg-meta b { font-weight: 500; }
.msg-meta time { color: var(--light-muted); margin-left: 8px; font-size: 12px; }
.msg-text { font-size: 14px; margin: 4px 0 18px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-form { display: flex; align-items: center; margin: 12px 16px 16px; background: var(--light-fill); border-radius: 24px; padding-left: 16px; }
.chat-form input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; height: 48px; color: var(--light-text); }
.chat-form .icon-btn { color: var(--primary); }

/* ---------- left screen & toasts */
.left-screen { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 24px 16px; text-align: center; }
.left-screen h1 { font-weight: 400; font-size: 32px; margin: 0; }
.left-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.toasts { position: fixed; left: 16px; bottom: 96px; display: flex; flex-direction: column; gap: 8px; z-index: 20; pointer-events: none; max-width: calc(100vw - 32px); }
.toast {
  background: #241f4a; color: var(--text); padding: 12px 18px; border-radius: 6px; font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.35); transition: opacity .4s, transform .4s; max-width: 380px; overflow-wrap: anywhere;
}
.toast.hide { opacity: 0; transform: translateY(6px); }

/* ---------- small screens */
@media (max-width: 700px) {
  .admit-card { bottom: 128px; }
  .bar { height: auto; display: flex; flex-wrap: wrap; justify-content: center; padding: 8px; gap: 8px; }
  .bar-left { display: none; }
  .bar-center { gap: 8px; }
  .bar-right { gap: 0; }
  .ctl { width: 44px; height: 44px; }
  .ctl.leave { width: 56px; height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .panel { position: absolute; inset: 0; width: auto; margin: 0; border-radius: 0; z-index: 5; }
  .stage.pinned { flex-direction: row; align-items: flex-end; overflow-x: auto; overflow-y: hidden; }
  .stage.pinned .tile.is-pinned { right: 8px; bottom: 108px; }
  .stage.pinned .tile:not(.is-pinned) { width: 160px; }
  .wide-only { display: none !important; }
  .ctl-group { padding: 4px; gap: 6px; }
  .caret { width: 24px; height: 44px; }
  .presenting-bar > span:nth-child(2) { display: none; }
  .toasts { bottom: 120px; }
  .lobby { gap: 24px; }
}

/* ---------- bar popovers (devices, more options) */
.popover {
  position: fixed; z-index: 40; min-width: 260px; max-width: min(360px, calc(100vw - 16px)); max-height: 60vh; overflow-y: auto;
  padding: 8px 0; background: #241f4a; color: var(--text); border-radius: 14px; border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: pop .15s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.popover button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border: 0; background: none;
  color: inherit; font-size: 14px; text-align: left;
}
.popover button:hover, .popover button:focus-visible { background: rgba(255,255,255,.07); outline: none; }
.popover button svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.popover-title {
  display: flex; align-items: center; gap: 8px; margin: 10px 16px 4px; font-size: 12px; font-weight: 600;
  letter-spacing: .5px; text-transform: uppercase; color: var(--muted);
}
.popover-title svg { width: 16px; height: 16px; }
.popover button[role=menuitemradio] svg { visibility: hidden; color: var(--accent); }
.popover button.selected { color: #fff; font-weight: 600; }
.popover button.selected svg { visibility: visible; }
.popover-empty { margin: 4px 16px 8px; font-size: 13px; color: var(--muted); }
.popover .popover-action { border-top: 1px solid rgba(255,255,255,.08); margin-top: 6px; padding-top: 12px; }

/* ---------- backgrounds & effects */
.fx-chip {
  position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 6px; padding: 8px 14px 8px 10px;
  border: 0; border-radius: 20px; background: rgba(21,18,46,.6); color: #fff; font-size: 13px; font-weight: 600;
  backdrop-filter: blur(6px); transition: background .15s;
}
.fx-chip:hover { background: rgba(21,18,46,.8); }
.fx-chip.active { background: var(--orange); }
.fx-chip svg { width: 18px; height: 18px; }

.fx-dialog {
  width: min(1040px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: 20px;
  background: #1b1740; color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.55); overflow: hidden;
}
.fx-dialog::backdrop { background: rgba(10,8,30,.65); backdrop-filter: blur(4px); }
.fx-dialog[open] { display: flex; flex-direction: column; animation: pop .2s ease-out; }
.fx-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 20px 16px 28px; }
.fx-head h2 { margin: 0; font-size: 22px; font-weight: 500; }
.fx-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.fx-body {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; padding: 0 28px 28px;
  min-height: 0; overflow-y: auto;
}
.fx-preview {
  position: relative; align-self: start; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: var(--surface);
  box-shadow: 0 12px 32px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.06);
}
.fx-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.fx-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: var(--surface); color: var(--muted); font-size: 14px; text-align: center; padding: 16px;
}
.fx-overlay svg { width: 40px; height: 40px; }
.fx-overlay.loading { background: rgba(21,18,46,.72); color: #fff; }
.fx-overlay .spinner { margin: 0; border-color: rgba(255,255,255,.2); border-top-color: var(--orange); }
.fx-current {
  position: absolute; left: 12px; bottom: 12px; padding: 5px 12px; border-radius: 14px;
  background: rgba(21,18,46,.75); font-size: 13px; font-weight: 600;
}
.fx-options h3 { margin: 2px 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.fx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
.fx-option {
  position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; padding: 0;
  border: 0; border-radius: 12px; background: var(--surface) center / cover no-repeat; color: var(--text);
  outline: 2px solid transparent; outline-offset: 2px; transition: transform .15s, outline-color .15s;
}
.fx-option:hover { transform: translateY(-2px); }
.fx-option:focus-visible { outline-color: var(--accent); }
.fx-option[aria-pressed=true] { outline-color: var(--orange); }
.fx-option[aria-pressed=true]::before {
  content: ""; position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; z-index: 1;
  background: var(--orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.fx-icon { display: grid; place-items: center; margin-bottom: 14px; }
.fx-icon svg { width: 28px; height: 28px; }
.fx-icon.strong svg { width: 34px; height: 34px; }
.fx-label {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 8px 6px; font-size: 12px; font-weight: 600; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.6)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fx-option.upload { background: transparent; border: 1.5px dashed rgba(255,255,255,.28); color: var(--muted); }
.fx-option.upload:hover { border-color: var(--orange); color: #fff; }
.fx-option.upload .fx-label { background: none; color: inherit; text-align: center; }
@media (max-width: 760px) {
  .fx-head { padding: 18px 12px 12px 18px; }
  .fx-body { grid-template-columns: 1fr; gap: 18px; padding: 0 16px 20px; }
}
