/* Lobbies room — Zoom-Enterprise feel: white/graphite, one blue accent, Inter, no marketing chrome. */
:root {
  --accent: #0b5cff; --accent-ink: #fff; --ink: #1f2329; --ink-2: #5b6370; --ink-3: #8a919c; --line: #e6e8eb;
  --paper: #fff; --soft: #f5f6f7; --graphite: #232428; --graphite-2: #2d2e33; --graphite-3: #3a3b41; --stage: #121315;
  --ok: #23a55a; --warn: #f5a524; --bad: #e5484d; --r: 10px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
button { font: inherit; cursor: pointer; }
.muted { color: var(--ink-2); } .small { font-size: 12px; }
[hidden] { display: none !important; }

/* Layout */
body.room { display: grid; grid-template-rows: 44px 1fr 64px; height: 100vh; background: var(--stage); overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 14px; background: var(--graphite); color: #e9eaec; font-size: 13px; }
.tb-left, .tb-right { display: flex; gap: 12px; align-items: center; min-width: 220px; }
.tb-right { justify-content: flex-end; }
.tb-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enc { display: inline-flex; gap: 6px; align-items: center; color: #cfd2d6; }
.host-chip { padding: 2px 8px; border-radius: 4px; background: var(--graphite-3); color: #dfe1e4; font-size: 12px; }
.live-badge { padding: 2px 8px; border-radius: 4px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
@keyframes blink { 50% { opacity: .35; } }
.clock { font-variant-numeric: tabular-nums; color: #cfd2d6; }

.main { display: grid; grid-template-columns: 1fr 340px; min-height: 0; }
.stage { display: grid; grid-template-rows: 1fr 104px; gap: 8px; padding: 10px; min-height: 0; }
.speaker { position: relative; background: #000; border-radius: var(--r); overflow: hidden; min-height: 0; }
.speaker video { width: 100%; height: 100%; object-fit: contain; background: #000; pointer-events: none; display: block; }
.name-tag { position: absolute; left: 12px; bottom: 12px; padding: 4px 8px; border-radius: 4px; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; }
.share-chip { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: var(--ok); color: #fff; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.net { position: absolute; right: 12px; top: 12px; display: flex; gap: 6px; align-items: center; padding: 4px 8px; border-radius: 4px; background: rgba(0,0,0,.55); color: #e9eaec; font-size: 12px; }
.net i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.net.low i { background: var(--warn); }
.reconnect { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 8px 14px; border-radius: 6px; background: rgba(20,20,22,.8); color: #fff; font-size: 13px; }
.join-audio { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: inline-flex; gap: 8px; align-items: center; border: 0; border-radius: 8px; padding: 10px 16px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }

.gallery { display: flex; gap: 8px; overflow: hidden; }
.tile { position: relative; flex: 0 0 168px; border-radius: 8px; background: var(--graphite-2); display: grid; place-items: center; color: #fff; }
.tile .av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 15px; background: var(--graphite-3); }
.tile .tn { position: absolute; left: 8px; bottom: 6px; font-size: 12px; display: flex; gap: 4px; align-items: center; color: #e9eaec; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .tn svg { flex: 0 0 12px; }
.tile.me { outline: 2px solid var(--accent); outline-offset: -2px; }
.tile .float { position: absolute; top: 8px; right: 10px; font-size: 22px; animation: rise 2.4s ease-out forwards; }
@keyframes rise { to { transform: translateY(-30px); opacity: 0; } }

/* Right panel */
.panel { display: grid; grid-template-rows: 44px 1fr; background: var(--paper); border-left: 1px solid var(--line); min-height: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; background: none; color: var(--ink-2); font-size: 13px; font-weight: 500; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.count { color: var(--ink-3); font-weight: 500; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.pane { display: grid; min-height: 0; overflow: hidden; }
.pane[data-pane="chat"] { grid-template-rows: auto 1fr auto auto auto; }
.threads { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.threads button { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 4px 10px; font-size: 12px; color: var(--ink-2); }
.threads button.on { border-color: var(--accent); color: var(--accent); background: #eef3ff; }
.msgs { list-style: none; margin: 0; padding: 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.msg { display: grid; grid-template-columns: 28px 1fr; gap: 8px; font-size: 13px; line-height: 1.4; }
.msg .av { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; background: #6b7280; }
.msg .meta { color: var(--ink-3); font-size: 11px; display: flex; gap: 6px; }
.msg .meta b { color: var(--ink); font-weight: 600; font-size: 12px; }
.msg .body { word-wrap: break-word; color: var(--ink); }
.msg.me .meta b { color: var(--accent); }
.msg.host .av { background: var(--accent); }
.msg .body.emoji { font-size: 22px; line-height: 1.1; }
.typing { padding: 2px 12px 6px; font-size: 12px; color: var(--ink-3); font-style: italic; }
.say { position: relative; border-top: 1px solid var(--line); padding: 8px 10px 10px; }
.say .to { font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
.say .to b { color: var(--accent); font-weight: 600; }
.say textarea { width: 100%; resize: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 40px 8px 10px; font: inherit; font-size: 13px; outline: none; }
.say textarea:focus { border-color: var(--accent); }
.say .send { position: absolute; right: 16px; bottom: 18px; border: 0; background: none; color: var(--accent); }

.people, .res { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; }
.people li { display: flex; align-items: center; gap: 10px; padding: 6px 14px; font-size: 13px; }
.people .av { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; background: #6b7280; flex: 0 0 28px; }
.people .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.people .nm small { color: var(--ink-3); margin-left: 4px; }
.people .ic { color: var(--bad); display: flex; }
.res li { margin: 8px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; display: flex; gap: 10px; align-items: center; font-size: 13px; }
.res li .k { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.res li a { margin-left: auto; color: var(--accent); font-weight: 600; text-decoration: none; }
.res .saved { color: var(--ok); font-size: 11px; }

/* Offer + poll cards on the stage */
.cta, .poll { position: absolute; right: 14px; bottom: 14px; width: 300px; background: var(--paper); border-radius: 10px; padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); font-size: 13px; }
.cta h4, .poll h4 { margin: 0 0 6px; font-size: 14px; }
.cta p { margin: 0 0 10px; color: var(--ink-2); }
.poll { bottom: auto; top: 50px; }
.poll .opt { position: relative; display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); padding: 7px 10px; margin-top: 6px; overflow: hidden; }
.poll .opt i { position: absolute; inset: 0 auto 0 0; background: #e8efff; transition: width .6s; z-index: 0; }
.poll .opt span { position: relative; z-index: 1; display: flex; justify-content: space-between; }
.poll .opt.mine { border-color: var(--accent); }

/* Bottom bar */
.bottombar { display: flex; justify-content: space-between; align-items: center; padding: 0 16px; background: var(--graphite); }
.bb-group { display: flex; gap: 4px; align-items: center; }
.bb { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; color: #e9eaec; font-size: 11px; padding: 6px 10px; border-radius: 6px; min-width: 76px; }
.bb svg { width: 22px; height: 22px; fill: currentColor; }
.bb:hover:not(:disabled) { background: var(--graphite-3); }
.bb:disabled { opacity: .75; cursor: default; }
.bb.on { color: var(--warn); }
.leave { border: 0; background: var(--bad); color: #fff; font-weight: 600; padding: 8px 16px; border-radius: 6px; }
.react-wrap { position: relative; }
.react-pop { position: absolute; bottom: 58px; left: 50%; transform: translateX(-50%); background: var(--paper); border-radius: 999px; padding: 6px; display: flex; gap: 2px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.react-pop button { border: 0; background: none; font-size: 22px; padding: 4px 6px; border-radius: 50%; }
.react-pop button:hover { background: var(--soft); }

/* Overlays: waiting room, late/next, ended, left */
.overlay { position: fixed; inset: 0; background: var(--soft); display: grid; place-items: center; z-index: 10; padding: 20px; overflow: auto; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 28px; width: 100%; max-width: 440px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card.wide { max-width: 520px; }
.card h1 { font-size: 20px; margin: 0 0 6px; } .card h2 { font-size: 15px; margin: 18px 0 6px; }
.card p { color: var(--ink-2); font-size: 14px; line-height: 1.5; margin: 6px 0; }
.wr-top { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13px; margin-bottom: 18px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.big { font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 6px 0 2px; }
.you { display: flex; gap: 12px; align-items: center; background: var(--soft); border-radius: 10px; padding: 12px; margin: 16px 0; }
.you .av { width: 40px; height: 40px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btn { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 9px 14px; font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .6; }
.bubble { background: #eef3ff; border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--ink); margin-top: 12px; }
.bubble b { color: var(--accent); }

/* Register + host pages */
body.plain { background: var(--soft); min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.field { display: grid; gap: 4px; margin: 10px 0; font-size: 13px; color: var(--ink-2); }
.field input, .host input { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--ink); outline: none; }
.field input:focus { border-color: var(--accent); }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }
.host { background: var(--soft); } .host-main { max-width: 960px; margin: 30px auto; padding: 0 20px; }
.host form { display: flex; gap: 8px; max-width: none; } .host h2 { font-size: 15px; margin-top: 24px; }
.tbl { width: 100%; border-collapse: collapse; background: var(--paper); font-size: 12px; } .tbl td, .tbl th { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: rgba(20,20,22,.92); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; z-index: 20; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.tile.cam .av { display: none; } .tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 8px; transform: scaleX(-1); }
.human { display: flex; gap: 8px; align-items: center; padding: 4px 12px; }
.linkish { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 12px; padding: 0; text-decoration: underline; }
.linkish:disabled { color: var(--ink-3); text-decoration: none; }
.tag { font-size: 10px; font-weight: 700; background: var(--soft); color: var(--ink-2); border-radius: 4px; padding: 1px 5px; vertical-align: middle; }

/* Waiting room + Lobby chat (also prep/replay) */
.card.xl { max-width: 900px; }
.wr-hey { font-size: 24px; } .wr-line { font-size: 15px !important; color: var(--ink) !important; }
.wr-hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--soft); border-radius: 10px; padding: 14px 16px; margin: 14px 0; flex-wrap: wrap; }
.host-card { display: flex; gap: 10px; align-items: center; } .host-card .av { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; }
.wr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.agenda { list-style: none; padding: 0; margin: 0; font-size: 13px; } .agenda li { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.agenda li span { color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 40px; } .agenda em { color: var(--accent); font-style: normal; font-weight: 600; font-size: 11px; margin-left: auto; }
.qbox { display: grid; gap: 6px; } .qbox textarea, .lc-say input { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; outline: none; width: 100%; }
.tc-vid { width: 160px; border-radius: 8px; margin-top: 6px; transform: scaleX(-1); }
.lc { display: grid; gap: 8px; } .lc-msgs { list-style: none; margin: 0; padding: 10px; height: 260px; overflow-y: auto; background: var(--soft); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; }
.lc-m { font-size: 13px; line-height: 1.4; display: grid; gap: 2px; } .lc-m b { font-size: 11px; color: var(--accent); } .lc-m.me b { color: var(--ink-2); } .lc-m.typing span { color: var(--ink-3); font-style: italic; }
.lc-say { display: flex; gap: 6px; } .lc-foot { display: flex; gap: 8px; align-items: center; }

@media (max-width: 860px) {
  .wr-grid { grid-template-columns: 1fr; }
  .main { grid-template-columns: 1fr; grid-template-rows: 1fr 46%; }
  .stage { grid-template-rows: 1fr; } .gallery { display: none; }
  .tb-left .host-chip, .bb span { display: none; } .bb { min-width: 44px; } .tb-left, .tb-right { min-width: 0; }
  .cta, .poll { width: auto; left: 10px; right: 10px; }
}
.replay-v { background: #000; border-radius: 10px; overflow: hidden; margin: 12px 0; } .replay-v video { width: 100%; display: block; max-height: 60vh; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .field select { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 14px; background: var(--paper); }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }

/* Phone: stage on top, panel is a bottom sheet (grab handle toggles; tabs + bottom-bar buttons open it). */
.grab { display: none; border: 0; background: none; width: 100%; height: 18px; padding: 0; }
.grab::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: #c9cdd3; margin: 7px auto; }
@media (max-width: 640px) {
  .topbar { padding: 0 10px; gap: 8px; font-size: 12px; } .enc-t { display: none; }
  .tb-left, .tb-right { gap: 8px; min-width: 0; } .tb-left { flex: 0 0 auto; } .tb-title { flex: 1; text-align: center; }
  .main { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .stage { padding: 6px 6px 70px; transition: padding .25s ease; }
  body.sheet-open .stage { padding-bottom: calc(var(--sheet) + 6px); }
  .panel { --h: 62px; position: fixed; left: 0; right: 0; bottom: 64px; height: var(--h); z-index: 6; border-left: 0; border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 24px rgba(0,0,0,.35); grid-template-rows: 18px 44px 1fr; transition: height .25s ease; overflow: hidden; }
  .panel.open { height: var(--sheet); }
  .grab { display: block; }
  .cta, .poll { left: 8px; right: 8px; width: auto; bottom: 8px; max-height: calc(100% - 16px); overflow: auto; }
}
body.room { --sheet: min(60vh, calc(100dvh - 44px - 64px - 230px)); }
