/* Volluxz-Chat — dark "ink + lux amber" by default, warm light theme on request or by system setting. */
:root {
  --bg: #0b0d13;
  --panel: #12151e;
  --panel-2: #1a1e2b;
  --raise: #222737;
  --line: #272c3d;
  --text: #e9ecf4;
  --muted: #8d96ab;
  --accent: #ffc531;
  --accent-ink: #1a1300;
  --accent-soft: rgba(255, 197, 49, 0.14);
  --ok: #3ddc97;
  --bad: #ff6b7a;
  --them: #1b2030;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f3ed; --panel: #ffffff; --panel-2: #f0ede4; --raise: #e7e3d7; --line: #e0dccf;
    --text: #16181f; --muted: #636a7c; --accent: #f2a900; --accent-ink: #1a1300; --accent-soft: rgba(242, 169, 0, 0.16);
    --ok: #12a06b; --bad: #d62f45; --them: #ffffff; --shadow: 0 10px 40px rgba(40, 30, 0, 0.15);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f3ed; --panel: #ffffff; --panel-2: #f0ede4; --raise: #e7e3d7; --line: #e0dccf;
  --text: #16181f; --muted: #636a7c; --accent: #f2a900; --accent-ink: #1a1300; --accent-soft: rgba(242, 169, 0, 0.16);
  --ok: #12a06b; --bad: #d62f45; --them: #ffffff; --shadow: 0 10px 40px rgba(40, 30, 0, 0.15);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.offscreen { position: fixed; left: -9999px; top: 0; }
.icon { flex: none; display: block; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--raise); padding: 1px 5px; border-radius: 5px; }

/* ---------- shared controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); font-weight: 600; white-space: nowrap; transition: background 0.15s, transform 0.05s, border-color 0.15s;
}
.btn:hover { background: var(--raise); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.07); background: var(--accent); }
.btn.big { height: 48px; font-size: 16px; border-radius: 12px; }
.btn.icon-btn { width: 38px; padding: 0; position: relative; }
.btn[disabled], .tool[disabled], .send[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn.pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 197, 49, 0.55); } 70% { box-shadow: 0 0 0 10px rgba(255, 197, 49, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 197, 49, 0); } }
.badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; display: grid; place-items: center;
}
input, textarea, select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.err { color: var(--bad); font-size: 13px; margin-top: 8px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -0.01em; font-size: 17px; }
.brand img { border-radius: 8px; }

.topbar {
  display: flex; align-items: center; gap: 14px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--line); background: var(--panel); flex: none;
}
.topbar .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--raise); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 10px 14px; border-radius: 12px; font-size: 14px; animation: rise 0.2s ease; transition: opacity 0.3s; }
.toast.error { border-color: var(--bad); }
.toast.out { opacity: 0; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------- landing ---------- */
.landing { overflow-y: auto; }
.hero { max-width: 1020px; margin: 0 auto; padding: 56px 20px 24px; text-align: center; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 5px 12px; border-radius: 999px; }
.hero h1 { font-size: clamp(36px, 7vw, 64px); line-height: 1.04; letter-spacing: -0.035em; margin: 20px 0 16px; font-weight: 800; }
.hl { color: var(--accent); }
.lead { max-width: 620px; margin: 0 auto; color: var(--muted); font-size: 18px; }
.start { max-width: 460px; margin: 32px auto 0; padding: 22px; text-align: left; }
.start label:first-child { margin-top: 0; }
.opt { font-weight: 400; }
.start .btn.big { width: 100%; margin-top: 14px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0 12px; }
.or::before, .or::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.joinrow { display: flex; gap: 8px; }
.joinrow input { flex: 1; min-width: 0; }
.joinrow .btn { height: 42px; }
.features { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; padding: 0; margin: 48px 0 0; text-align: left; }
.features li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.features h2 { font-size: 16px; margin: 12px 0 6px; }
.features p { color: var(--muted); font-size: 14px; }
.fi { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 28px 20px 40px; }

/* ---------- lobby ---------- */
.lobby { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.lobby-card { width: min(100%, 420px); padding: 26px; }
.lobby-card .brand { margin-bottom: 18px; }
.lobby-card h1 { font-size: 24px; letter-spacing: -0.02em; margin-bottom: 6px; }
.lobby-card .btn.big { width: 100%; margin-top: 18px; }
.fp-line { margin-top: 16px; font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fp-line b { color: var(--text); font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.06em; }

/* ---------- room shell ---------- */
.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.room-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.conn { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.conn[data-state="open"] .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.conn[data-state="reconnecting"] .dot, .conn[data-state="connecting"] .dot { background: var(--accent); animation: blink 1s infinite; }
.conn[data-state="closed"] .dot { background: var(--bad); }
@keyframes blink { 50% { opacity: 0.25; } }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); font-size: 12px; font-weight: 700; color: var(--ok); }
.banner { background: var(--accent-soft); border-bottom: 1px solid var(--line); padding: 8px 16px; display: flex; gap: 12px; align-items: center; flex: none; font-size: 14px; }
.banner.warn { background: rgba(255, 107, 122, 0.12); }
.banner .btn { height: 30px; margin-left: auto; }
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 270px; }
.main-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; }

/* ---------- people ---------- */
.people { border-left: 1px solid var(--line); background: var(--panel); padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.people h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.plist { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.plist li { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; }
.plist .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.plist .pname small { color: var(--muted); font-weight: 400; }
.plist .pflag { color: var(--ok); display: inline-flex; gap: 4px; }
.plist .pflag .off { color: var(--bad); }
.e2ee-note { margin-top: auto; color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; align-items: flex-start; }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; background: hsl(var(--h, 40) 55% 40%); user-select: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }

/* ---------- chat ---------- */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.log { flex: 1; overflow-y: auto; padding: 14px 16px 6px; scroll-behavior: auto; overscroll-behavior: contain; }
.log:focus-visible { outline-offset: -2px; }
.empty { margin: 14vh auto 0; max-width: 360px; text-align: center; color: var(--muted); }
.empty .fi { margin: 0 auto 12px; }
.empty b { color: var(--text); }
.day { text-align: center; margin: 16px 0 8px; font-size: 12px; color: var(--muted); }
.day span { background: var(--panel-2); padding: 3px 12px; border-radius: 999px; }
.sys { text-align: center; color: var(--muted); font-size: 12.5px; margin: 10px 0; }
.msg { display: flex; gap: 10px; margin-top: 2px; animation: fade 0.15s ease; }
.msg.first { margin-top: 14px; }
.msg .avatar, .msg .spacer { width: 34px; flex: none; }
.msg.me { flex-direction: row-reverse; }
.msg.me .avatar, .msg.me .spacer { display: none; }
.stack { min-width: 0; max-width: min(640px, 84%); display: flex; flex-direction: column; align-items: flex-start; }
.msg.me .stack { align-items: flex-end; }
.who { font-size: 12px; margin: 0 4px 3px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.who b { color: hsl(var(--h, 40) 70% 68%); }
:root[data-theme="light"] .who b { color: hsl(var(--h, 40) 60% 34%); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .who b { color: hsl(var(--h, 40) 60% 34%); } }
.bubble { background: var(--them); border: 1px solid var(--line); padding: 7px 12px; border-radius: 16px; border-top-left-radius: 5px; overflow-wrap: anywhere; word-break: break-word; position: relative; }
.msg:not(.first) .bubble { border-top-left-radius: 16px; border-bottom-left-radius: 5px; }
.msg.me .bubble { background: var(--accent); color: var(--accent-ink); border-color: transparent; border-radius: 16px; border-top-right-radius: 5px; }
.msg.me:not(.first) .bubble { border-top-right-radius: 16px; border-bottom-right-radius: 5px; }
.bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.bubble pre { margin: 6px 0; padding: 10px 12px; background: rgba(0, 0, 0, 0.28); color: #e8ebf3; border-radius: 10px; overflow-x: auto; font: 13px/1.45 ui-monospace, Consolas, monospace; white-space: pre; }
.bubble pre code { background: none; padding: 0; color: inherit; }
.bubble code { background: rgba(127, 127, 127, 0.22); }
.msg.me .bubble pre { background: rgba(0, 0, 0, 0.82); }
.time { font-size: 11px; color: var(--muted); margin: 2px 6px 0; }
.msg.failed .bubble { border: 1px solid var(--bad); }
.fail { color: var(--bad); font-size: 12px; margin: 3px 6px 0; display: flex; gap: 8px; align-items: center; }
.fail button { background: none; border: 0; color: var(--accent); text-decoration: underline; padding: 0; }
.bubble.media { padding: 4px; background: transparent; border-color: transparent; }
.bubble.media + .bubble, .bubble + .bubble.media { margin-top: 4px; }
.msg.me .bubble.media { background: transparent; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.att { max-width: 100%; }
.att + .att { margin-top: 6px; }
.att-img { position: relative; width: fit-content; max-width: 100%; line-height: 0; border-radius: 12px; overflow: hidden; background: var(--panel-2); min-width: 120px; min-height: 80px; }
.att-img img { max-width: min(340px, 100%); max-height: 300px; display: block; cursor: zoom-in; border-radius: 12px; }
.att-img .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; line-height: 1.2; }
.att-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); min-width: 230px; max-width: 340px; text-align: left; }
.msg.me .att-file { background: rgba(255, 255, 255, 0.92); color: #16181f; }
.att-file .ficon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.msg.me .att-file .ficon { color: #8a6000; background: rgba(242, 169, 0, 0.22); }
.att-file .fmeta { min-width: 0; flex: 1; line-height: 1.3; }
.att-file .fname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-file .fsub { font-size: 12px; color: var(--muted); }
.att-file .fact { flex: none; }
.att-file .btn { height: 32px; padding: 0 10px; font-size: 13px; background: var(--raise); color: var(--text); }
.bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--accent); transition: width 0.15s; }
.att audio { width: 280px; max-width: 100%; display: block; }
.att video { max-width: min(380px, 100%); max-height: 300px; border-radius: 12px; display: block; background: #000; }

.jump { position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 5; border-radius: 999px; padding: 6px 14px; background: var(--accent); color: var(--accent-ink); border: 0; font-weight: 700; font-size: 13px; box-shadow: var(--shadow); display: inline-flex; gap: 4px; align-items: center; }
.typing { height: 20px; padding: 0 18px; font-size: 12.5px; color: var(--muted); flex: none; }

/* ---------- composer ---------- */
.composer { border-top: 1px solid var(--line); background: var(--panel); padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); flex: none; position: relative; }
.composer .row { display: flex; align-items: flex-end; gap: 6px; }
.composer textarea { resize: none; max-height: 168px; min-height: 42px; line-height: 1.45; border-radius: 14px; padding: 9px 14px; }
.tool { width: 40px; height: 42px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; flex: none; }
.tool:hover { background: var(--panel-2); color: var(--text); }
.tool.on { color: var(--bad); background: rgba(255, 107, 122, 0.14); }
.send { width: 46px; height: 42px; border-radius: 14px; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.tray { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 10px; }
.chipf { position: relative; flex: none; display: flex; align-items: center; gap: 8px; max-width: 220px; padding: 6px 30px 6px 6px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.chipf img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.chipf .ficon { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.chipf .fn { min-width: 0; font-size: 13px; line-height: 1.25; }
.chipf .fn b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.chipf .fn span { color: var(--muted); font-size: 12px; }
.chipf .rm { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--raise); color: var(--text); display: grid; place-items: center; padding: 0; }
.rec { display: flex; align-items: center; gap: 10px; padding: 0 0 10px; font-size: 14px; }
.rec .btn { height: 32px; }
.rec .btn:first-of-type { margin-left: auto; }
.recdot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: blink 1s infinite; }
.emoji-pop { position: absolute; bottom: calc(100% + 6px); left: 12px; z-index: 20; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; background: var(--raise); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); width: min(344px, calc(100vw - 24px)); max-height: 240px; overflow-y: auto; }
.emoji-pop button { border: 0; background: none; font-size: 22px; line-height: 1; padding: 6px 0; border-radius: 8px; }
.emoji-pop button:hover { background: var(--panel-2); }

/* ---------- call stage ---------- */
.stage { flex: none; height: min(54vh, 560px); display: flex; flex-direction: column; background: #07080c; border-bottom: 1px solid var(--line); }
:root[data-theme="light"] .stage { background: #14161d; }
.tiles { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 8px; padding: 8px; overflow-y: auto; align-content: center; justify-items: center; }
.tile { position: relative; width: 100%; max-height: 100%; aspect-ratio: 16 / 9; background: #0e1118; border-radius: 12px; overflow: hidden; display: grid; place-items: center; cursor: pointer; border: 2px solid transparent; transition: border-color 0.12s, box-shadow 0.12s; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile.screen video { object-fit: contain; }
.tile.local.cam video { transform: scaleX(-1); }
.tile .ph { position: relative; z-index: 1; display: grid; place-items: center; gap: 6px; color: #aab; text-align: center; font-size: 13px; }
.tile .ph .avatar { width: 64px; height: 64px; font-size: 22px; }
.tile.hasvideo .ph { display: none; }
.tile .label { position: absolute; left: 8px; bottom: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 16px); padding: 3px 9px; border-radius: 8px; background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 12.5px; font-weight: 600; }
.tile .label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .label .icon { color: var(--bad); }
.tile .connecting { position: absolute; top: 8px; right: 8px; z-index: 2; font-size: 11.5px; padding: 2px 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.6); color: #ddd; }
.tile.speaking { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(61, 220, 151, 0.25); }
.tiles.has-pin { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; }
.tiles.has-pin .tile { flex: 0 0 168px; width: 168px; }
.tiles.has-pin .tile.pinned { flex: 1 1 100%; width: 100%; max-height: calc(100% - 100px); order: -1; }
.callbar { flex: none; display: flex; justify-content: center; align-items: center; gap: 10px; padding: 8px 12px 12px; position: relative; }
.cbtn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: #2a2f40; color: #fff; display: grid; place-items: center; transition: background 0.15s, transform 0.05s; }
.cbtn:hover { background: #3a4057; }
.cbtn:active { transform: scale(0.95); }
.cbtn.off { background: #fff; color: #111; }
.cbtn.live { background: var(--accent); color: var(--accent-ink); }
.cbtn.danger { background: #e5394b; width: 58px; border-radius: 23px; }
.cbtn.danger:hover { background: #f04b5d; }
.cbtn.danger .icon { transform: rotate(135deg); }
.cbtn.sm { width: 36px; height: 36px; }
.call-timer { position: absolute; right: 14px; color: #9aa; font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- dialogs, menu, misc ---------- */
.dlg { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text); padding: 22px; width: min(94vw, 460px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(3, 5, 10, 0.66); backdrop-filter: blur(3px); }
.dlg h2 { font-size: 20px; letter-spacing: -0.01em; margin-bottom: 12px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.info-list { padding-left: 18px; margin: 0 0 12px; display: grid; gap: 8px; font-size: 14px; }
.preview { position: relative; aspect-ratio: 16 / 9; background: #0b0d12; border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.pv-off { position: relative; display: grid; place-items: center; gap: 6px; color: #9aa; font-size: 13px; text-align: center; padding: 0 12px; }
.preview.hasvideo .pv-off { display: none; }
.pv-bar { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 10px; z-index: 2; }
.meter { width: 90px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.meter i { display: block; height: 100%; width: var(--lvl, 0%); background: var(--ok); transition: width 0.08s; }
.hint { min-height: 20px; margin-top: 10px; font-size: 13px; color: var(--accent); }
.fields label { margin: 10px 0 4px; }
.menu { position: fixed; z-index: 60; min-width: 210px; padding: 6px; background: var(--raise); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: none; border-radius: 9px; text-align: left; }
.menu button:hover, .menu button:focus-visible { background: var(--panel-2); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.lightbox { border: 0; background: transparent; padding: 0; max-width: 96vw; max-height: 96vh; color: var(--text); }
.lightbox img { max-width: 96vw; max-height: 86vh; display: block; margin: 0 auto; border-radius: 12px; background: var(--panel); }
.lb-bar { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.dropzone { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(5, 7, 12, 0.78); backdrop-filter: blur(3px); pointer-events: none; }
.dropzone > div { display: grid; place-items: center; gap: 10px; padding: 48px 64px; border: 3px dashed var(--accent); border-radius: 24px; color: var(--accent); font-size: 18px; font-weight: 700; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .people { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(86vw, 320px); transform: translateX(105%); transition: transform 0.2s ease; box-shadow: var(--shadow); padding-top: calc(16px + env(safe-area-inset-top)); }
  .people.open { transform: none; }
  .stage { height: 44vh; }
  .room-meta .chip span:last-child { display: none; }
  .chip { padding: 0 7px; }
}
@media (max-width: 620px) {
  .topbar { gap: 8px; padding: 8px 10px; }
  .brand span { display: none; }
  .landing .brand span { display: inline; }
  .btn .lbl { display: none; }
  #btn-call .lbl { display: inline; }
  #btn-invite { width: 38px; padding: 0; }
  .stack { max-width: 88%; }
  .msg .avatar, .msg .spacer { width: 28px; }
  .msg .avatar { height: 28px; font-size: 11px; }
  .conn #conn-text { display: none; }
  .callbar { gap: 8px; }
  .composer .row { gap: 3px; }
  .tool { width: 36px; }
  #b-emoji { display: none; } /* phone keyboards have their own emoji */
  .call-timer { display: none; }
  .hero { padding-top: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
