/* ==========================================================================
   Caller — application styles
   A single stylesheet for both the sign-in page and the calling app.
   ========================================================================== */

:root {
  --bg: #080b12;
  --bg-soft: #0d121c;
  --panel: #121a28;
  --panel-2: #172132;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9eefb;
  --muted: #94a3bd;
  --faint: #63708a;
  --accent: #5b8def;
  --accent-soft: rgba(91, 141, 239, 0.16);
  --violet: #8e6bd9;
  --ok: #21c08b;
  --warn: #f5a623;
  --danger: #ef4f5f;
  --danger-soft: rgba(239, 79, 95, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --sidebar-w: 320px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background:
    radial-gradient(1100px 700px at 12% -10%, rgba(91, 141, 239, 0.16), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(142, 107, 217, 0.14), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Inter", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   Controls
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 550;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.09); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--violet));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 24px rgba(91, 141, 239, 0.28);
}
.btn-primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--accent), var(--violet)); }
.btn-danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn-danger:hover { background: #dc3f4f; }
.btn-ok { background: var(--ok); border-color: transparent; color: #04150f; }
.btn-ok:hover { background: #1dae7d; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; border-radius: 10px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 550; }
.field .hint { font-size: 12px; color: var(--faint); }

input[type="text"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
  width: 100%;
  padding: 11px 13px;
  background: rgba(4, 8, 16, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder { color: var(--faint); }
input.code { text-transform: uppercase; letter-spacing: 0.14em; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--muted); }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* --------------------------------------------------------------------------
   Sign-in page
   -------------------------------------------------------------------------- */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}
.auth-hero {
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(91, 141, 239, 0.1), transparent 60%);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  display: grid; place-items: center;
  box-shadow: 0 8px 22px rgba(91, 141, 239, 0.35);
}
.brand-mark svg { width: 21px; height: 21px; color: #fff; }
.auth-hero h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.1; margin: 34px 0 16px; }
.auth-hero .lede { color: var(--muted); font-size: 17px; max-width: 46ch; }
.feature-list { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 14px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); font-size: 14.5px; }
.feature-list b { color: var(--text); font-weight: 600; }
.feature-list svg { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 2px; }
.auth-foot { color: var(--faint); font-size: 12.5px; }

.auth-card-wrap { display: grid; place-items: center; padding: 40px 24px; }
.auth-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.tabs { display: flex; gap: 4px; padding: 4px; background: rgba(4, 8, 16, 0.5); border-radius: 12px; margin-bottom: 22px; }
.tabs button {
  flex: 1; padding: 9px; border: 0; background: transparent; color: var(--muted);
  border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px;
}
.tabs button[aria-selected="true"] { background: rgba(255, 255, 255, 0.09); color: var(--text); }
.form-title { margin-bottom: 4px; }
.form-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
.alert {
  padding: 11px 13px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-error { background: var(--danger-soft); border-color: rgba(239, 79, 95, 0.4); color: #ffc9cf; }
.alert-info { background: var(--accent-soft); border-color: rgba(91, 141, 239, 0.4); color: #cfe0ff; }
.alert-ok { background: rgba(33, 192, 139, 0.14); border-color: rgba(33, 192, 139, 0.4); color: #b6f2dc; }

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; overflow: hidden; }

.sidebar {
  display: flex; flex-direction: column;
  background: rgba(9, 13, 21, 0.72);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(10px);
  min-height: 0;
}
.sidebar-head { padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 14px; }
.me {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: rgba(255, 255, 255, 0.03);
}
.avatar {
  width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #08111f; letter-spacing: 0;
}
.avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 21px; }
.avatar.xl { width: 84px; height: 84px; border-radius: 24px; font-size: 32px; }
.me-info { min-width: 0; flex: 1; }
.me-name { font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-sub { font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.online { background: var(--ok); box-shadow: 0 0 0 3px rgba(33, 192, 139, 0.18); }
.dot.offline { background: #4a5568; }
.dot.busy { background: var(--warn); box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.16); }

.side-tabs { display: flex; gap: 3px; padding: 3px; background: rgba(4, 8, 16, 0.5); border-radius: 10px; }
.side-tabs button {
  flex: 1; padding: 7px 6px; border: 0; background: transparent; color: var(--muted);
  border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.side-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, 0.09); color: var(--text); }

.sidebar-body { flex: 1; overflow-y: auto; padding: 4px 12px 20px; min-height: 0; }
.section-label {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--faint); font-weight: 700; margin: 16px 6px 8px;
}

.person {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.person:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--border); }
.person.selected { background: var(--accent-soft); border-color: rgba(91, 141, 239, 0.45); }
.person-info { flex: 1; min-width: 0; }
.person-name { font-weight: 570; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-sub { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.12s ease; }
.person:hover .person-actions, .person.selected .person-actions { opacity: 1; }
.person-actions .btn-icon { padding: 6px; }
.person-actions svg { width: 16px; height: 16px; }
.check {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; flex: none;
}
.person.selected .check { background: var(--accent); border-color: var(--accent); }
.check svg { width: 13px; height: 13px; color: #fff; opacity: 0; }
.person.selected .check svg { opacity: 1; }

.empty-note { padding: 26px 14px; text-align: center; color: var(--faint); font-size: 13.5px; }
.empty-note svg { width: 30px; height: 30px; opacity: 0.5; margin-bottom: 8px; }

.callto { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--border); background: rgba(4, 8, 16, 0.35); }
.callto .btn { flex: 1; }

/* --------------------------------------------------------------------------
   Stage
   -------------------------------------------------------------------------- */

.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.stage-empty {
  flex: 1; display: grid; place-items: center; text-align: center; padding: 40px;
}
.stage-empty .inner { max-width: 460px; display: grid; gap: 14px; justify-items: center; }
.stage-empty h2 { font-size: 24px; }
.stage-empty p { color: var(--muted); }
.stage-empty .glyph {
  width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center;
  background: linear-gradient(140deg, rgba(91, 141, 239, 0.2), rgba(142, 107, 217, 0.16));
  border: 1px solid var(--border);
}
.stage-empty .glyph svg { width: 34px; height: 34px; color: var(--accent); }

.stage-live { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.call-bar {
  display: flex; align-items: center; gap: 14px; padding: 12px 18px;
  border-bottom: 1px solid var(--border); background: rgba(9, 13, 21, 0.6); backdrop-filter: blur(8px);
}
.call-title { font-weight: 620; }
.call-meta { font-size: 12.5px; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650;
  padding: 3px 8px; border-radius: 99px; border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05); color: var(--muted);
  text-wrap: nowrap;
}
.badge.live { color: #b6f2dc; border-color: rgba(33, 192, 139, 0.4); background: rgba(33, 192, 139, 0.12); }
.badge.ring { color: #ffe6b8; border-color: rgba(245, 166, 35, 0.4); background: rgba(245, 166, 35, 0.12); }
.call-bar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.stage-main { flex: 1; display: flex; min-height: 0; }
.video-area { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }

.video-grid {
  flex: 1; display: grid; gap: 12px; padding: 14px; overflow-y: auto; align-content: center;
}
.video-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.video-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.video-grid[data-count="3"], .video-grid[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.video-grid[data-count="5"], .video-grid[data-count="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.video-grid[data-count="7"], .video-grid[data-count="8"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.tile {
  position: relative; background: #0c1119; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10; min-height: 140px;
  display: grid; place-items: center;
}
.video-grid[data-count="1"] .tile { aspect-ratio: auto; height: 100%; min-height: 320px; }
.video-grid[data-count="2"] .tile { aspect-ratio: 4 / 3; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #0c1119; }
.tile video.mirrored { transform: scaleX(-1); }
.tile.local video { transform: scaleX(-1); }
.tile.screen video { object-fit: contain; transform: none; }

.tile-avatar {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.06), transparent 70%);
}
.tile.no-video .tile-avatar { display: grid; }
.tile-avatar .avatar { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
.tile.has-video .tile-avatar { display: none; }

.tile-foot {
  position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px;
  pointer-events: none;
}
.tile-name {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 99px;
  background: rgba(4, 8, 16, 0.66); backdrop-filter: blur(6px);
  font-size: 12.5px; font-weight: 600; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile-icons { margin-left: auto; display: flex; gap: 5px; }
.tile-icons .chip {
  width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(4, 8, 16, 0.66); backdrop-filter: blur(6px);
}
.tile-icons .chip svg { width: 14px; height: 14px; }
.chip.muted { color: var(--danger); }
.chip.sharing { color: var(--ok); }
.tile-status {
  position: absolute; top: 10px; left: 10px; font-size: 11.5px; font-weight: 650;
  padding: 3px 8px; border-radius: 99px; background: rgba(4, 8, 16, 0.66);
  color: var(--muted); backdrop-filter: blur(6px);
}
.tile-status.warn { color: #ffe6b8; }
.tile-status.bad { color: #ffc9cf; }
.tile.watching { border-color: rgba(33, 192, 139, 0.55); box-shadow: 0 0 0 3px rgba(33, 192, 139, 0.12); }
.tile.speaking { border-color: rgba(91, 141, 239, 0.6); }

/* Controls */
.controls {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 18px 18px; flex-wrap: wrap;
}
.ctrl {
  width: 52px; height: 52px; border-radius: 16px; border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05); display: grid; place-items: center; cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease, border-color 0.15s ease; position: relative;
}
.ctrl:hover { background: rgba(255, 255, 255, 0.11); }
.ctrl:active { transform: translateY(1px); }
.ctrl svg { width: 22px; height: 22px; }
.ctrl.off { background: var(--danger-soft); border-color: rgba(239, 79, 95, 0.4); color: var(--danger); }
.ctrl.active { background: var(--accent-soft); border-color: rgba(91, 141, 239, 0.5); color: #cfe0ff; }
.ctrl.hangup { background: var(--danger); border-color: transparent; color: #fff; width: 66px; }
.ctrl.hangup:hover { background: #dc3f4f; }
.ctrl .ctrl-label {
  position: absolute; bottom: -17px; left: 50%; transform: translateX(-50%);
  font-size: 10.5px; color: var(--faint); white-space: nowrap;
}
.controls { padding-bottom: 30px; }

/* Side panel (chat / participants) */
.panel {
  width: 340px; flex: none; border-left: 1px solid var(--border); background: rgba(9, 13, 21, 0.5);
  display: flex; flex-direction: column; min-height: 0;
}
.panel-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.panel-head h3 { font-size: 14.5px; }
.panel-head .btn-icon { margin-left: auto; }
.panel-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.chat-msg { display: flex; flex-direction: column; gap: 2px; max-width: 92%; }
.chat-msg .who { font-size: 11.5px; color: var(--faint); font-weight: 600; }
.chat-msg .bubble {
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border);
  padding: 8px 11px; border-radius: 12px; font-size: 13.5px; word-break: break-word;
}
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.mine .bubble { background: var(--accent-soft); border-color: rgba(91, 141, 239, 0.4); }
.chat-msg.system .bubble { background: transparent; border: 0; color: var(--faint); font-size: 12.5px; padding: 2px; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-form input { flex: 1; }

.roster-item { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; }
.roster-item:hover { background: rgba(255, 255, 255, 0.04); }
.roster-state { font-size: 12px; color: var(--faint); margin-left: auto; }

/* --------------------------------------------------------------------------
   Modals & overlays
   -------------------------------------------------------------------------- */

.overlay {
  position: fixed; inset: 0; background: rgba(4, 7, 13, 0.78); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 24px; z-index: 60; overflow-y: auto;
}
.modal {
  width: min(520px, 100%); background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 20px; box-shadow: var(--shadow); overflow: hidden;
  animation: pop 0.16s ease-out;
}
@keyframes pop { from { transform: scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 20px 22px 14px; display: flex; align-items: flex-start; gap: 12px; }
.modal-head h2 { font-size: 19px; }
.modal-head p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.modal-body { padding: 0 22px 4px; max-height: 62vh; overflow-y: auto; }
.modal-foot { padding: 16px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Incoming call */
.incoming { text-align: center; width: min(400px, 100%); }
.incoming .modal-body { padding: 6px 22px 12px; }
.incoming .who { display: grid; gap: 12px; justify-items: center; margin-bottom: 8px; }
.incoming .who h2 { font-size: 24px; }
.incoming .who p { color: var(--muted); }
.pulse { position: relative; display: grid; place-items: center; }
.pulse::before, .pulse::after {
  content: ""; position: absolute; inset: -10px; border-radius: 32px;
  border: 2px solid rgba(91, 141, 239, 0.5); animation: ripple 2s ease-out infinite;
}
.pulse::after { animation-delay: 0.9s; }
@keyframes ripple { 0% { transform: scale(0.85); opacity: 0.85; } 100% { transform: scale(1.5); opacity: 0; } }

/* Call summary toast on end */
.call-summary { display: grid; gap: 8px; }
.dur { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */

.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 80; max-width: 360px; }
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--panel-2); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); animation: slide 0.18s ease-out;
}
.toast.error { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast .t-body { flex: 1; font-size: 13.5px; }
.toast .t-title { font-weight: 620; margin-bottom: 1px; }
@keyframes slide { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* The audio-resume nudge is persistent, so unlike a transient toast it sits in
   the flow under the call bar; bottom-right would cover the call controls on a
   narrow screen. */
.audio-nudge { margin: 10px 14px 0; animation: slide 0.18s ease-out; }

/* Add-participant list inside a modal */
.picker { display: grid; gap: 4px; max-height: 340px; overflow-y: auto; padding-right: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px;
  border-radius: 99px; background: var(--accent-soft); border: 1px solid rgba(91, 141, 239, 0.35);
  font-size: 12.5px; font-weight: 600;
}
.chip-tag button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 2px; }

/* Invite / admin tables */
.invite-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.025);
  margin-bottom: 8px;
}
.invite-code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 700;
  letter-spacing: 0.08em; font-size: 14px;
}
.invite-meta { font-size: 12px; color: var(--faint); }
.invite-actions { margin-left: auto; display: flex; gap: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.025); }
.stat .n { font-size: 22px; font-weight: 700; }
.stat .l { font-size: 12px; color: var(--faint); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .panel { width: 300px; }
}

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(340px, 82vw); z-index: 40;
    transform: translateX(-102%); transition: transform 0.22s ease; box-shadow: var(--shadow);
  }
  body.drawer-open .sidebar { transform: none; }
  .panel { position: fixed; inset: 0 0 0 20%; z-index: 45; transform: translateX(102%);
    transition: transform 0.22s ease; width: auto; }
  body.panel-open .panel { transform: none; }
  /* The menu button floats above the stage in every state; the sidebar and
     scrim (higher z-index) cover it while the drawer is open. */
  .drawer-toggle {
    display: inline-flex !important;
    position: fixed; top: 10px; left: 12px; z-index: 30;
    background: rgba(9, 13, 21, 0.82); backdrop-filter: blur(8px);
  }
  .drawer-close { display: inline-flex !important; }
  /* Leave room for the floating menu button. */
  .call-bar { padding-left: 60px; }
  .video-grid[data-count="3"], .video-grid[data-count="4"],
  .video-grid[data-count="5"], .video-grid[data-count="6"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.drawer-toggle { display: none; }
.drawer-close { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 38; }

@media (max-width: 560px) {
  .video-grid[data-count] { grid-template-columns: minmax(0, 1fr); }
  .video-grid .tile { aspect-ratio: 4 / 3; }
  .ctrl { width: 46px; height: 46px; }
  .ctrl.hangup { width: 58px; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
}
