/* Stonsys Meet v2 */
:root {
  --brand: #289DD2;
  --brand-dark: #1f7fab;
  --brand-soft: rgba(40, 157, 210, .14);
  --ink: #16222E;
  --room-bg: #0B1117;
  --surface: #151D25;
  --surface-2: #1D2731;
  --line: rgba(255, 255, 255, .08);
  --muted: #8FA0B0;
  --radius: 18px;
}

body { font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif; }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; }
.btn-brand { --bs-btn-color:#fff; --bs-btn-bg:var(--brand); --bs-btn-border-color:var(--brand); --bs-btn-hover-color:#fff; --bs-btn-hover-bg:var(--brand-dark); --bs-btn-hover-border-color:var(--brand-dark); --bs-btn-active-bg:var(--brand-dark); --bs-btn-active-color:#fff; font-weight: 500; }
.btn-soft { background: var(--surface-2); color: #DDE5EC; border: 1px solid var(--line); }
.btn-soft:hover { background: #26323d; color: #fff; }
.btn-xs { padding: .2rem .55rem; font-size: .78rem; border-radius: .5rem; }
.min-w-0 { min-width: 0; }

/* ================= public pages ================= */
body.meet-public { background: radial-gradient(1200px 500px at 50% -10%, #e4f3fb 0%, #f4f7fa 60%); min-height: 100vh; color: var(--ink); }
.public-nav { padding: 14px 0; background: rgba(255,255,255,.7); backdrop-filter: blur(8px); border-bottom: 1px solid #e6edf3; }
.meet-public .card { border-radius: 1.25rem; }
.meet-public .form-control { border-radius: .8rem; }
.meet-public .form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(40,157,210,.2); }

.join-wrap { max-width: 980px; margin: 0 auto; }
.join-card { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 20px 60px rgba(22, 34, 46, .10); }
.join-preview { position: relative; background: #0B1117; min-height: 420px; display: flex; align-items: center; justify-content: center; }
.join-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.pv-avatar { width: 112px; height: 112px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.pv-meter { position: absolute; left: 24px; right: 24px; bottom: 92px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.pv-meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #34c38f, var(--brand)); transition: width .08s; }
.pv-tools { position: absolute; bottom: 24px; display: flex; gap: 12px; }
.pv-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1.2rem; }
.pv-btn.on { background: var(--brand); }
.pv-hint { position: absolute; top: 18px; left: 20px; right: 20px; margin: 0; color: #C9D3DD; font-size: .85rem; text-align: center; }
.join-form { padding: 36px 36px 28px; }
.role-pill { display: inline-block; background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; font-size: .75rem; padding: .2rem .7rem; border-radius: 99px; margin-bottom: .6rem; }
.join-title { font-size: 1.55rem; font-weight: 600; margin: 0 0 .4rem; letter-spacing: -.01em; }
.join-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; color: #5B6B7A; font-size: .9rem; margin-bottom: 1rem; }
.join-meta i { margin-right: .35rem; color: var(--brand); }
.join-desc { color: #5B6B7A; font-size: .9rem; background: #f4f8fb; border-radius: .8rem; padding: .7rem .9rem; }
.join-points { list-style: none; padding: 0; margin: 0 0 1.2rem; font-size: .88rem; color: #46576A; display: grid; gap: .45rem; }
.join-points i { color: var(--brand); margin-right: .5rem; }
.join-privacy { font-size: .75rem; color: #7A8896; margin: .9rem 0 0; line-height: 1.5; }
@media (max-width: 820px) {
  .join-card { grid-template-columns: 1fr; }
  .join-preview { min-height: 300px; }
  .pv-avatar { width: 84px; height: 84px; font-size: 2.2rem; margin-bottom: 56px; }
  .pv-meter { bottom: 88px; }
  .join-form { padding: 24px; }
}

/* ================= room ================= */
body.meet-room { background: var(--room-bg); color: #E8EDF2; height: 100vh; height: 100dvh; overflow: hidden; }
.screen-center { height: 100vh; height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.state-card { text-align: center; max-width: 420px; }
.pulse-ring { width: 104px; height: 104px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(40,157,210,.12); animation: ring 2s infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(40,157,210,.45); } 100% { box-shadow: 0 0 0 28px rgba(40,157,210,0); } }

#screen-call { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
#screen-call.d-none { display: none !important; }

.call-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 12px 18px; }
.top-left, .top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-logo { height: 22px; flex: none; }
.top-sep { width: 1px; height: 20px; background: var(--line); flex: none; }
.top-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: var(--surface); color: #C9D3DD; font-size: .82rem; border: 1px solid var(--line); }
.btn-chip { cursor: pointer; }
.btn-chip:hover { background: var(--surface-2); color: #fff; }
.rec-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: rgba(217,48,37,.15); color: #ff8a80; font-size: .75rem; font-weight: 600; letter-spacing: .05em; }
.rec-pill.d-none { display: none !important; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff4b3e; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }

.call-body { flex: 1; display: flex; min-height: 0; }
.call-main { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 0 18px 8px; min-height: 0; position: relative; overflow-y: auto; }

/* stage = cameras + screen share */
.stage { display: grid; gap: 12px; flex: 1 1 62%; min-height: 260px; grid-template-columns: 1fr; grid-auto-rows: minmax(0, 1fr); overflow: hidden; }
.stage[data-count="2"], .stage[data-count="3"], .stage[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stage .tile { aspect-ratio: auto; min-height: 0; }
.stage .tile.screen { grid-column: 1 / -1; }
.stage .tile.screen video { object-fit: contain; }
.stage .tile:not(.screen) video { object-fit: cover; }
.stage[data-count="1"] .tile:not(.screen) video { object-fit: contain; }

/* presenter view: shared screen large on the left, cameras in a column on the right */
.stage.present { flex: 1 1 auto; grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: repeat(var(--rows, 1), minmax(0, 1fr)); grid-auto-rows: 0; }
.stage.present.no-cams { grid-template-columns: minmax(0, 1fr); }
.stage.present .tile.screen { grid-column: 1; grid-row: 1 / -1; }
.stage.present .tile:not(.screen) { grid-column: 2; }
.stage.present .tile:not(.screen):nth-child(n+6) { display: none; }   /* 4 cameras max beside the screen */

/* phone + shared screen: one row of 4 equal tiles (3 people + "+N"), like Google Meet */
.mstrip { display: none; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.call-main.m-present .mstrip { display: grid; }
/* phone + sharing: screen takes at most ~40% of the height; tiles never shrink below a usable size (page scrolls if needed) */
.call-main.m-present #stage { flex: none; }
.call-main.m-present .tile.screen .zoom-view { max-height: 38vh; max-height: 38dvh; }
.call-main.m-present .mstrip.grid-mode { flex: 1 0 auto; min-height: 210px; grid-template-rows: repeat(var(--mrows, 1), minmax(100px, 1fr)); }
.mstrip.grid-mode .mtile:last-child:nth-child(odd):not(:first-child) { grid-column: 1 / -1; }   /* odd count: last tile full width */
.call-main.m-present #stage .tile:not(.screen) { display: none !important; }
.call-main.m-present #grid { display: none !important; }
.mtile { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--surface); outline: 2px solid transparent; outline-offset: -2px; border: 0; padding: 0; color: #fff; transition: outline-color .15s; }
.mtile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; background: #000; }
.mtile.has-video video { display: block; }
.mtile.local video { transform: scaleX(-1); }
.mtile .avatar { position: absolute; inset: 0 0 20px 0; display: flex; align-items: center; justify-content: center; }
.mtile .avatar span { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: .9rem; color: #fff; }
.mtile.has-video .avatar { display: none; }
.mtile .mlabel { position: absolute; left: 4px; right: 4px; bottom: 4px; display: flex; align-items: center; justify-content: center; gap: 3px; font-size: .66rem; background: rgba(8,12,16,.6); border-radius: 99px; padding: 2px 6px; white-space: nowrap; }
.mtile .mlabel .nm { overflow: hidden; text-overflow: ellipsis; }
.mtile .mlabel .mic.off { color: #ff7a70; }
.mtile.speaking { outline-color: var(--brand); }
.mtile.hand-up { outline-color: #f5b400; }
.m-hand { display: none; position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; background: #f5b400; color: #1a1300; font-size: .7rem; align-items: center; justify-content: center; z-index: 2; }
.mtile.hand-up .m-hand { display: inline-flex; }
.mtile.more { cursor: pointer; }
.mtile.more .avatar span { background: var(--surface-2); border: 1px dashed rgba(255,255,255,.3); font-size: .95rem; }

/* phone, nobody sharing: Google Meet grid - 2 columns of equal tiles filling the screen, up to 8 */
.call-main.m-grid .mstrip { display: grid; }
.call-main.m-grid #stage, .call-main.m-grid #grid { display: none !important; }
.mstrip.grid-mode { flex: 1; min-height: 0; grid-template-columns: repeat(var(--mcols, 2), minmax(0, 1fr)); grid-template-rows: repeat(var(--mrows, 1), minmax(0, 1fr)); gap: 10px; }
.mstrip.grid-mode .mtile { aspect-ratio: auto; min-height: 0; border-radius: 18px; }
.mstrip.grid-mode .mtile .avatar { inset: 0; }
.mstrip.grid-mode .mtile .avatar span { width: clamp(52px, 34%, 92px); height: auto; aspect-ratio: 1; font-size: 1.45rem; }
.mstrip.grid-mode .mtile .mlabel { left: 10px; right: auto; bottom: 10px; max-width: calc(100% - 20px); justify-content: flex-start; gap: 6px; font-size: .82rem; padding: 4px 12px 4px 8px; }
.mstrip.grid-mode .m-hand { top: 10px; left: 10px; right: auto; width: 26px; height: 26px; font-size: .8rem; }
.m-badge { display: none; position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(8,12,16,.8); color: #fff; font-size: .8rem; padding: 4px 12px; border-radius: 99px; }
.mtile.has-badge { cursor: pointer; }
.mtile.has-badge .m-badge { display: inline-block; }

/* camera shape: portrait (phone upright) is never cropped; landscape fills the tile */
.tile.has-video[data-orient="portrait"] video,
.tile.has-video[data-orient="square"] video { object-fit: contain !important; }
.tile.has-video[data-orient="portrait"] { background: #05080b; }
/* desktop: only portrait cameras (e.g. everyone on phones) -> narrow tall tiles side by side, centred */
.stage.all-portrait { display: flex; justify-content: center; align-items: stretch; }
.stage.all-portrait .tile { flex: 0 1 auto; height: 100%; aspect-ratio: var(--ar, 9 / 16); max-width: calc((100% - 36px) / var(--rows, 1)); }
.stage.all-portrait .tile video { object-fit: cover !important; }

/* shared screen zoom (each viewer zooms their own view) */
.zoom-view { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; cursor: zoom-in; }
.tile.zoomed .zoom-view { touch-action: none; cursor: grab; }
.tile.zoomed .zoom-view:active { cursor: grabbing; }
.zoom-view video { transform-origin: center center; will-change: transform; transition: transform .06s linear; }
.screen-foot { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; z-index: 3; pointer-events: none; }
.screen-foot > * { pointer-events: auto; }
.tile.screen .screen-foot .label { position: static; }
.zoom-bar { display: flex; align-items: center; gap: 2px; background: rgba(8,12,16,.72); backdrop-filter: blur(6px); border-radius: 99px; padding: 3px; opacity: .55; transition: opacity .15s; }
.tile.screen:hover .zoom-bar, .tile.screen.zoomed .zoom-bar { opacity: 1; }
.zoom-bar button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: .95rem; }
.zoom-bar button:hover { background: rgba(255,255,255,.14); }
.zoom-pct { font-size: .75rem; min-width: 44px; text-align: center; color: #C9D3DD; font-variant-numeric: tabular-nums; }


/* grid = audio people */
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); align-content: start; }
.grid:not(.with-stage) { flex: 1; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
/* bubbles: when cameras or a shared screen are on, audio-only people sit in one row; extra people become "+N" */
.grid.with-stage { --bubble: 76px; display: flex; flex-wrap: nowrap; gap: 10px; flex: none; overflow: hidden; padding: 4px 2px 2px; }
.grid.with-stage .tile { flex: 0 0 var(--bubble); height: calc(var(--bubble) + 22px); aspect-ratio: auto; background: transparent; outline: 0; box-shadow: none; border-radius: 0; overflow: visible; }
.grid.with-stage .tile.bubble-hidden { display: none; }
.grid.with-stage .avatar { inset: 0 0 auto 0; height: var(--bubble); padding: 0; background: none; }
.grid.with-stage .avatar span { width: calc(var(--bubble) - 14px); height: calc(var(--bubble) - 14px); font-size: 1.05rem; transition: box-shadow .15s; }
.grid.with-stage .tile.speaking .avatar span { box-shadow: 0 0 0 3px var(--brand), 0 0 0 7px rgba(40,157,210,.25); animation: none; }
.grid.with-stage .tile.hand-up .avatar span { box-shadow: 0 0 0 3px #f5b400; }
.grid.with-stage .tile .label { left: 0; right: 0; bottom: 0; justify-content: center; background: none; backdrop-filter: none; padding: 0; font-size: .7rem; max-width: none; gap: 3px; color: #C9D3DD; }
.grid.with-stage .tile .label .q { display: none; }
.grid.with-stage .tile-badges { top: 0; right: 4px; }
.grid.with-stage .hand-badge { width: 22px; height: 22px; font-size: .7rem; }
.grid.with-stage .react-badge { font-size: 1.2rem; line-height: 22px; }
.more-bubble { border: 0; padding: 0; color: #fff; cursor: pointer; position: relative; }
.more-bubble .avatar span { background: var(--surface-2) !important; border: 1px dashed rgba(255,255,255,.25); font-size: .95rem !important; }
.more-bubble:hover .avatar span { background: #2a3642 !important; }
.grid:not(.with-stage) .avatar { padding-bottom: 20px; }

.tile { position: relative; background: var(--surface); border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10; outline: 2px solid transparent; outline-offset: -2px; transition: outline-color .15s, box-shadow .15s; }
.tile.speaking { outline-color: var(--brand); box-shadow: 0 0 0 4px rgba(40,157,210,.18); }
.tile.hand-up { outline-color: #f5b400; }
.tile video { width: 100%; height: 100%; display: none; background: #000; }
.tile.has-video video { display: block; }
.tile.local:not(.screen) video { transform: scaleX(-1); }
.tile .avatar { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.04), transparent 70%); }
.tile.has-video .avatar { display: none; }
.tile .avatar span { width: 72px; height: 72px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 1.5rem; }
.tile.speaking .avatar span { animation: speak 1.1s infinite; }
@keyframes speak { 50% { box-shadow: 0 0 0 10px rgba(40,157,210,.22); } }
.tile .label { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; font-size: .8rem; background: rgba(8,12,16,.62); backdrop-filter: blur(6px); padding: 4px 10px; border-radius: 99px; max-width: calc(100% - 20px); }
.tile .label .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .label .mic.off { color: #ff7a70; }
.tile .q-poor { color: #ffb020; }
.tile-badges { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.hand-badge { display: none; width: 30px; height: 30px; border-radius: 50%; background: #f5b400; color: #1a1300; align-items: center; justify-content: center; font-size: .9rem; animation: wave 1.2s ease-in-out infinite; }
.tile.hand-up .hand-badge { display: inline-flex; }
@keyframes wave { 50% { transform: rotate(14deg); } }
.react-badge { font-size: 1.6rem; line-height: 30px; opacity: 0; transform: scale(.4); transition: all .2s; }
.react-badge.show { opacity: 1; transform: scale(1); }

/* floating reactions */
.reactions-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.reaction { position: absolute; bottom: 10px; display: flex; flex-direction: column; align-items: center; animation: floatup 3.5s ease-out forwards; }
.r-emoji { font-size: 2.4rem; filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); }
.r-name { font-size: .72rem; background: rgba(8,12,16,.7); padding: 2px 8px; border-radius: 99px; margin-top: 2px; white-space: nowrap; }
@keyframes floatup { 0% { transform: translateY(0) scale(.6); opacity: 0; } 12% { opacity: 1; transform: translateY(-40px) scale(1); } 100% { transform: translateY(-62vh) translateX(20px); opacity: 0; } }

.enable-audio { position: absolute; left: 50%; top: 1rem; transform: translateX(-50%); z-index: 6; border-radius: 99px; }

/* side panel */
.panel { width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 18px 8px 0; display: flex; flex-direction: column; min-height: 0; }
.panel.d-none { display: none !important; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; background: var(--room-bg); border-radius: 99px; padding: 3px; }
.seg-btn { border: 0; background: transparent; color: var(--muted); font-size: .85rem; padding: 5px 16px; border-radius: 99px; }
.seg-btn.active { background: var(--brand); color: #fff; }
.icon-btn { border: 0; background: transparent; color: var(--muted); width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--surface-2); color: #fff; }
.panel-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; min-height: 0; }
.panel-body.d-none { display: none !important; }
.lobby-box { background: var(--brand-soft); border: 1px solid rgba(40,157,210,.35); border-radius: 14px; padding: 10px; margin-bottom: 12px; }
.lobby-box.d-none { display: none !important; }
.person { border-bottom: 1px solid var(--line); }
.person-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; }
.avatar-sm { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 600; color: #fff; }
.person-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px 10px 44px; }
.pa-btn { border: 1px solid var(--line); background: var(--surface-2); color: #DDE5EC; font-size: .76rem; padding: 4px 10px; border-radius: 99px; display: inline-flex; align-items: center; gap: 5px; }
.pa-btn:hover { background: #26323d; color: #fff; }
.pa-btn.danger { color: #ff8a80; border-color: rgba(255,138,128,.3); }

.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.chat-empty { color: var(--muted); font-size: .8rem; text-align: center; margin: auto 0; }
.chat-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 88%; }
.chat-msg.cont { margin-top: -4px; }
.chat-msg.cont .chat-av { visibility: hidden; }
.chat-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-av { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; color: #fff; font-size: .68rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.chat-av.sm { width: 30px; height: 30px; flex-basis: 30px; }
.chat-bubble { background: var(--surface-2); border-radius: 16px 16px 16px 4px; padding: 7px 11px 5px; min-width: 70px; }
.chat-msg.mine .chat-bubble { background: var(--brand); color: #fff; border-radius: 16px 16px 4px 16px; }
.chat-msg.cont .chat-bubble { border-radius: 16px; }
.chat-meta { display: flex; align-items: center; gap: 6px; font-size: .74rem; margin-bottom: 1px; }
.chat-msg.mine .chat-meta { display: none; }
.chat-role { font-size: .62rem; background: var(--brand-soft); color: var(--brand); padding: 0 6px; border-radius: 99px; }
.chat-text { white-space: pre-wrap; word-break: break-word; font-size: .9rem; line-height: 1.35; }
.chat-time { font-size: .62rem; opacity: .6; text-align: right; margin-top: 2px; }
/* incoming message previews over the call (when chat is closed) */
.chat-pop { position: absolute; left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 7; width: min(340px, calc(100% - 24px)); pointer-events: none; }
.chat-pop-item { pointer-events: auto; display: flex; align-items: flex-start; gap: 8px; text-align: left; border: 1px solid var(--line); background: rgba(29,39,49,.96); backdrop-filter: blur(8px); color: #E8EDF2; border-radius: 16px; padding: 8px 12px 8px 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: popin .25s ease-out; transition: opacity .35s, transform .35s; }
.chat-pop-item.hide { opacity: 0; transform: translateY(6px); }
.cp-body { display: flex; flex-direction: column; min-width: 0; font-size: .85rem; line-height: 1.3; }
.cp-body strong { font-size: .75rem; color: var(--brand); }
.cp-body span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@keyframes popin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.chat-form { display: flex; gap: 6px; padding-top: 8px; }
.chat-form .form-control { background: var(--room-bg); border-color: var(--line); border-radius: 99px; }

/* control bar */
.call-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 10px 18px calc(14px + env(safe-area-inset-bottom)); }
.bar-side { display: flex; align-items: center; gap: 8px; }
.bar-center { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ctl { position: relative; height: 50px; min-width: 50px; padding: 0 14px; border-radius: 25px; border: 0; background: var(--surface-2); color: #E8EDF2; font-size: 1.15rem; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, transform .1s; }
.ctl:hover { background: #2a3642; }
.ctl:active { transform: scale(.96); }
.ctl.d-none { display: none !important; }
.ctl.on { background: var(--brand); color: #fff; }
.ctl.off { background: #3a2626; color: #ff8a80; }
.ctl.rec-on { background: #d93025; color: #fff; }
.ctl.rec-locked { opacity: .55; }
.top-chip.plan-left { background: #5a3d00; color: #ffd27a; }
.ctl-flat { background: transparent; }
.ctl-leave { background: #d93025; color: #fff; min-width: 64px; }
.ctl-leave:hover { background: #b3261e; }
.ctl-end { background: transparent; border: 1px solid rgba(217,48,37,.6); color: #ff8a80; font-size: .85rem; height: 40px; }
.ctl .dot { position: absolute; top: 9px; right: 11px; width: 9px; height: 9px; border-radius: 50%; background: #f5b400; }
.react-wrap { position: relative; }
.react-pop { position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 6px 8px; display: flex; gap: 2px; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 20; }
.react-pop.d-none { display: none !important; }
.react-pop button { border: 0; background: transparent; font-size: 1.5rem; width: 44px; height: 44px; border-radius: 50%; transition: transform .1s, background .1s; }
.react-pop button:hover { background: var(--surface-2); transform: scale(1.2); }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 50; width: min(92vw, 440px); }
.toast-msg { background: rgba(29,39,49,.96); backdrop-filter: blur(8px); color: #fff; padding: 9px 14px; border-radius: 12px; font-size: .88rem; box-shadow: 0 8px 24px rgba(0,0,0,.35); transition: opacity .35s; border: 1px solid var(--line); }
.toast-msg.hide { opacity: 0; }
.toast-ok { border-left: 4px solid #34c38f; }
.toast-warn { border-left: 4px solid #f5b400; }
.toast-error { border-left: 4px solid #d93025; }
.toast-info { border-left: 4px solid var(--brand); }

/* mobile */
@media (max-width: 768px) {
  .call-top { padding: 10px 12px; }
  .top-sep, .top-title { display: none; }
  .top-right { gap: 6px; }
  .top-chip { padding: 5px 8px; }
  .call-main { padding: 0 10px 8px; }
  .panel { position: fixed; inset: 0 0 82px 0; width: auto; margin: 0; border-radius: 0; z-index: 30; }
  .grid:not(.with-stage) { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  /* phone: tiles keep their own 16:9 height, so nothing overlaps; shared screen full width on top */
  .stage, .stage[data-count], .stage.present { flex: none; min-height: 0; overflow: visible; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: auto; }
  .stage .tile, .stage.present .tile:not(.screen) { aspect-ratio: 16 / 9; grid-column: auto; grid-row: auto; display: block; }
  .stage .tile.screen, .stage.present .tile.screen { grid-column: 1 / -1; grid-row: auto; }
  .stage .tile:not(.screen):only-child, .stage .tile.screen + .tile:not(.screen):last-child { grid-column: 1 / -1; }
  .zoom-bar button { width: 40px; height: 40px; }
  /* phone: shared screen on top, its label + zoom bar BELOW it so nothing covers the content */
  .stage .tile.screen, .stage.present .tile.screen { aspect-ratio: auto !important; background: transparent; overflow: visible; display: flex; flex-direction: column; gap: 8px; border-radius: 0; outline: 0; }
  .tile.screen .zoom-view { position: relative; inset: auto; width: 100%; aspect-ratio: var(--ar, 16 / 9); max-height: 62vh; background: #000; border-radius: var(--radius); }
  .tile.screen .screen-foot { position: static; padding: 0 2px; }
  .zoom-bar { opacity: 1; }
  .grid.with-stage { --bubble: 62px; gap: 8px; }
  .stage .tile.screen + .tile.has-video[data-orient="portrait"]:last-child { grid-column: 1 / -1 !important; justify-self: center; height: 56vh; width: auto; }
  .chat-pop { bottom: 8px; }
  /* phone: each camera tile takes the real shape of its video */
  .stage .tile.has-video[data-orient] { aspect-ratio: var(--ar, 16 / 9); max-height: 68vh; }
  .stage .tile.has-video[data-orient="portrait"] { grid-column: auto !important; }
  .stage .tile.has-video[data-orient="portrait"]:only-child { grid-column: 1 / -1 !important; justify-self: center; height: 62vh; width: auto; }
  .stage.all-portrait { display: grid; }
  .stage.all-portrait .tile { height: auto; max-width: none; }
  .call-bar { grid-template-columns: 1fr; padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); }
  .bar-side { justify-content: center !important; }
  .bar-side.d-lg-flex { display: none !important; }
  .call-bar .bar-side:last-child { order: -1; }
  .ctl { height: 46px; min-width: 46px; padding: 0 12px; font-size: 1.05rem; }
}

/* host controls */
.hc-intro { font-size: .8rem; color: var(--muted); margin: 0 0 8px; }
.hc-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 4px; font-weight: 600; }
.hc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.hc-row.static { cursor: default; }
.hc-row > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.hc-row strong { font-weight: 500; font-size: .9rem; }
.hc-row small { color: var(--muted); font-size: .75rem; line-height: 1.35; }
.hc-row .form-check-input { width: 2.6em; height: 1.4em; cursor: pointer; }
.hc-row .form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.chat-off { font-size: .8rem; color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.ctl.mic-locked { opacity: .55; }
.ctl.mic-locked::after { content: "\f47a"; font-family: bootstrap-icons; position: absolute; right: 6px; bottom: 4px; font-size: .7rem; }

/* many reactions at once: one grouped bubble per emoji */
.reaction-combo { animation: none !important; bottom: 120px; transform: none; opacity: 1; }
.reaction-combo .r-name { font-weight: 600; font-size: 15px; }
