/* Same palette and type as the chocomarsh.com landing (projects/sites, landing/css/index.css). */
:root {
  --bg: #07080d;
  --bg-2: #0d1019;
  --card: #12141f;
  --card-2: #181b29;
  --card-border: #22263a;
  --ink: #eef1f8;
  --ink-dim: #8a90a6;
  --accent: #6ee7d8;
  --accent-2: #a78bfa;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --on-accent: #06080c;
  --danger: #fb7185;
  --danger-soft: color-mix(in srgb, var(--danger) 14%, transparent);
  --danger-hover: #fda4af;
  --warn: #fcd34d;
  --glass: rgba(18, 20, 31, .72);
  --scrim: rgba(0, 0, 0, .6);
  --shadow-color: rgba(0, 0, 0, .45);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .45);
  --shadow: 0 16px 40px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
/* the light theme: set on <html> by the inline script in layouts/base.html (Calls.theme in common.js) */
:root[data-theme="light"] {
  --bg: #f5f6fa;
  --bg-2: #eceef5;
  --card: #ffffff;
  --card-2: #f1f3f8;
  --card-border: #dde1ec;
  --ink: #10131c;
  --ink-dim: #5b6276;
  --accent: #0d9488;
  --accent-2: #7c3aed;
  --on-accent: #ffffff;
  --danger: #e11d48;
  --danger-hover: #be123c;
  --warn: #b45309;
  --glass: rgba(255, 255, 255, .8);
  --scrim: rgba(16, 19, 28, .35);
  --shadow-color: rgba(16, 19, 28, .12);
  --shadow-sm: 0 8px 24px rgba(16, 19, 28, .1);
  --shadow: 0 16px 40px rgba(16, 19, 28, .14);
  --shadow-lg: 0 24px 64px rgba(16, 19, 28, .18);
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 40%),
    radial-gradient(circle at 85% 30%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 45%);
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }

code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .92em; }

.icon { width: 20px; height: 20px; flex: none; }

/* shows the theme it switches to: a sun in the dark theme, a moon in the light one */
.theme-toggle .theme-to-dark { display: contents; }
.theme-toggle .theme-to-light { display: none; }
:root:not([data-theme="light"]) .theme-toggle .theme-to-dark { display: none; }
:root:not([data-theme="light"]) .theme-toggle .theme-to-light { display: contents; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.accent {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo {
  --logo-knock: var(--bg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -.035em;
  white-space: nowrap;
}
.logo-mark { width: 1.1em; height: 1.1em; flex: none; }

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  color: var(--ink-dim);
  font-size: 13px;
}

/* ───────── buttons & inputs ───────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .2s, transform .2s, box-shadow .2s, opacity .2s;
}
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--gradient); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 28px color-mix(in srgb, var(--accent) 22%, transparent); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--card-border); font-weight: 600; }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); border-color: var(--danger-hover); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
  transition: color .2s, background-color .2s;
}
.icon-btn:hover { color: var(--ink); background: var(--card-2); }
.icon-btn.is-active { color: var(--accent); }

input[type="text"], select {
  width: 100%;
  height: 50px;
  padding: 0 18px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--bg-2);
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input[type="text"]::placeholder { color: var(--ink-dim); }
input[type="text"]:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
select { padding: 0 14px; cursor: pointer; }
select:disabled { opacity: .6; cursor: default; }

.form-error { color: var(--danger); font-size: 14px; }

/* ───────── toast ───────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 112px;
  transform: translate(-50%, 16px);
  max-width: calc(100% - 32px);
  padding: 11px 20px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
/* in the call nothing sits at the bottom on wide screens; on phones, above the buttons and tabs */
.page-call .toast { bottom: 24px; }

.link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 16px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--bg-2);
}
.link-box code { flex: 1; min-width: 0; color: var(--accent); word-break: break-all; line-height: 1.45; }

/* ───────── home: a launcher screen, not a landing ───────── */

.page-home { min-height: 100vh; display: flex; flex-direction: column; }

.launcher {
  flex: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}
.launcher-head { margin-bottom: 28px; }
.launcher-head h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.launcher-head p { margin-top: 6px; color: var(--ink-dim); }

.launcher-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  background: var(--card);
  transition: border-color .2s, box-shadow .2s;
}
.panel:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.panel-create.is-ready { border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 6%, transparent); }
.panel-top { display: flex; gap: 16px; align-items: flex-start; }
.panel-top h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.panel-hint { margin-top: 2px; color: var(--ink-dim); font-size: 14px; }
.panel-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--gradient);
  color: var(--on-accent);
}
.panel-icon-muted { background: var(--card-2); border: 1px solid var(--card-border); color: var(--accent); }
.panel-body { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.panel-actions { display: flex; gap: 10px; }
.panel-actions .btn { flex: 1; padding: 13px 18px; }
.btn-block { width: 100%; }
.btn.is-active { border-color: var(--accent); color: var(--accent); }
.push-install { display: flex; gap: 8px; font-size: 13px; }
.push-install .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--accent); }

.recent { margin-top: 40px; }
.recent-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.recent-head h2 { font-size: 17px; font-weight: 700; }
.recent-note { color: var(--ink-dim); font-size: 13px; }
.recent-list {
  list-style: none;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  background: var(--card);
  overflow: hidden;
}
.recent-list:empty { display: none; }
.recent-item { display: flex; align-items: center; gap: 4px; padding: 8px 10px 8px 8px; }
.recent-item + .recent-item { border-top: 1px solid var(--card-border); }
.recent-item:hover { background: var(--card-2); }
.recent-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 6px 8px; border-radius: 12px; }
.recent-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  color: var(--accent);
}
.recent-icon .icon { width: 18px; height: 18px; }
.recent-text { min-width: 0; display: flex; flex-direction: column; }
.recent-title { font-weight: 600; font-size: 14px; }
.recent-code { color: var(--ink-dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-status { color: var(--ink-dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* somebody is in the call right now: a live dot on the icon, the names in the accent colour */
.recent-icon { position: relative; }
.recent-item.is-live .recent-icon { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.recent-item.is-live .recent-icon::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: var(--accent);
  animation: live-pulse 2s ease-out infinite;
}
.recent-item.is-live .recent-status { color: var(--accent); font-weight: 600; }
.recent-item.is-gone .recent-link { opacity: .55; }
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  70%, 100% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent); }
}
.recent-empty {
  padding: 28px 24px;
  border: 1px dashed var(--card-border);
  border-radius: 20px;
  color: var(--ink-dim);
  font-size: 14px;
  text-align: center;
}

@media (max-width: 760px) {
  .launcher { padding: 28px 16px 48px; }
  .launcher-grid { grid-template-columns: 1fr; }
  .recent-note { display: none; }
}

/* ───────── message pages (404, left the call) ───────── */

.message { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.page-call .message { min-height: calc(100vh - 64px); }
.message-card {
  width: min(480px, 100%);
  padding: 40px 32px;
  border: 1px solid var(--card-border);
  border-radius: 28px;
  background: var(--card);
  text-align: center;
}
.message-card .logo { --logo-knock: var(--card); margin-bottom: 28px; }
.message-card h1 { margin-bottom: 12px; font-size: clamp(26px, 4vw, 34px); font-weight: 800; letter-spacing: -.02em; }
.message-card p { color: var(--ink-dim); }
.message-card p:empty { display: none; }
.message-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }

/* ───────── call page ───────── */

.page-call { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--card-border);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(10px);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}
.chip .icon { width: 16px; height: 16px; }
.chip-button { cursor: pointer; transition: border-color .2s, color .2s; }
.chip-button:hover { border-color: var(--accent); color: var(--ink); }
.chip-button.is-active { border-color: var(--accent); color: var(--accent); }
#people-chip { position: relative; }
.chip-lock { display: inline-flex; color: var(--warn); }
.chip-lock .icon { width: 14px; height: 14px; }

/* lobby */
.lobby {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  align-items: center;
  gap: 40px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px;
  overflow-y: auto;
}
/* at the camera's proportions (call.js sets --ratio), never taller than --preview-height */
.lobby-stage { --preview-height: 64vh; min-width: 0; }
.lobby-preview {
  --ratio: 1.7778;
  margin: 0 auto;
  width: min(100%, calc(var(--preview-height) * var(--ratio)));
  aspect-ratio: var(--ratio);
}
.lobby-controls {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  z-index: 2;
}
.lobby-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px 28px;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  background: var(--card);
}
.lobby-card .eyebrow { align-self: flex-start; }
.lobby-card h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.lobby-card p { color: var(--ink-dim); font-size: 15px; }
.lobby-card .eyebrow { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.presence {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--bg-2);
  font-size: 14px;
  font-weight: 500;
}
.presence-avatars { display: flex; padding-left: 8px; }
.presence-avatars:empty { display: none; }
.presence-avatars span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: -8px;
  border: 2px solid var(--bg-2);
  border-radius: 50%;
  background: var(--gradient);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 800;
}
.presence-text { min-width: 0; }
.lobby-host { display: flex; align-items: center; gap: 8px; color: var(--warn) !important; font-size: 14px !important; font-weight: 600; }
.lobby-host .icon { width: 16px; height: 16px; }

/* meeting: the rail on the left, the stage, the side panel (chat or people) on the right; on
   phones a column instead: stage, a row of big buttons, the tab bar (see the 760px block) */
.meeting { flex: 1; min-height: 0; display: flex; }
.center { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

.stage-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 64px;
  padding: 0 20px;
}
.stage-title { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.call-title {
  min-width: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.call-timer { flex: none; color: var(--ink-dim); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stage-actions { flex: none; display: flex; align-items: center; gap: 8px; }

.stage { position: relative; flex: 1; min-height: 0; display: flex; padding: 0 20px 20px; }

/* tiles are absolute boxes at their video's proportions, placed by call.js (layout()) */
.grid {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
}
.grid > .tile {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease, border-color .15s, box-shadow .15s;
}
/* alone with the invite card: the self view floats over the corner */
.grid.is-alone .tile-self { z-index: 3; box-shadow: var(--shadow); }

.tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background: var(--card);
  transition: border-color .15s, box-shadow .15s;
}
/* alone in the call: link, QR code and "notify me" in the middle of the stage (call.js: renderInvite()) */
.invite {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(620px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 28px;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  z-index: 2;
}
.invite-close { position: absolute; top: 10px; right: 10px; }
.invite-qr { flex: none; width: 168px; height: 168px; border-radius: 16px; overflow: hidden; background: #fff; }
.invite-qr svg { display: block; width: 100%; height: 100%; }
.invite-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.invite-body h2 { padding-right: 32px; font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.invite-body p { color: var(--ink-dim); font-size: 14px; }
.invite-body .link-box code { font-size: 13px; }
.invite-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.invite-actions:not(:has(> :not([hidden]))) { display: none; }
.invite-actions .btn { padding: 11px 20px; font-size: 14px; }
.invite-note { display: flex; align-items: center; gap: 8px; }
.invite-note .icon { width: 16px; height: 16px; color: var(--accent); }

.tile video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* the tile already has the video's shape, so this crops at most a rounding error */
  object-fit: cover;
  background: var(--bg-2);
}
.tile-self video { transform: scaleX(-1); }
.tile-self[data-mirror="off"] video { transform: none; }
/* a shared screen is shown whole, never cropped */
.tile[data-screen="on"] video { object-fit: contain; background: #000; }

.tile.speaking {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent), 0 0 36px color-mix(in srgb, var(--accent-2) 22%, transparent);
}

.tile-avatar {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 55%),
    radial-gradient(circle at 75% 80%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 55%),
    var(--card);
}
.tile-avatar span {
  display: grid;
  place-items: center;
  width: clamp(52px, 20%, 112px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gradient);
  color: var(--on-accent);
  font-size: clamp(20px, 3vw, 44px);
  font-weight: 800;
}
.tile:not(.tile-self):nth-child(3n+1) .tile-avatar span { background: linear-gradient(135deg, #a78bfa, #f0abfc); }
.tile:not(.tile-self):nth-child(3n+2) .tile-avatar span { background: linear-gradient(135deg, #6ee7d8, #38bdf8); }
.tile:not(.tile-self):nth-child(3n) .tile-avatar span { background: linear-gradient(135deg, #fcd34d, #6ee7d8); }
/* those three are pastel in both themes, so their initials stay dark */
.tile:not(.tile-self) .tile-avatar span { color: #06080c; }
.tile[data-video="off"] .tile-avatar { display: grid; }
.tile[data-video="off"] video { visibility: hidden; }
.tile.speaking .tile-avatar span { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent); }

.tile-notice {
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  display: none;
  color: var(--ink-dim);
  font-size: 14px;
  text-align: center;
  z-index: 1;
}
#preview-tile[data-video="off"] .tile-notice { display: block; }

.tile-name {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 24px);
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 600;
  z-index: 1;
}
.tile-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-muted { display: none; color: var(--danger); }
.tile-muted .icon { width: 15px; height: 15px; }
.tile[data-audio="off"] .tile-muted { display: inline-flex; }
.tile[data-audio="off"] .tile-name { padding-left: 9px; }
.tile-hand { display: none; color: var(--warn); }
.tile-hand .icon { width: 15px; height: 15px; }
.tile[data-hand="on"] .tile-hand { display: inline-flex; }
.tile[data-hand="on"] .tile-name { padding-left: 9px; }
.tile[data-hand="on"]:not(.speaking) { border-color: color-mix(in srgb, var(--warn) 60%, transparent); }
.tile-host { display: none; color: var(--warn); }
.tile-host .icon { width: 14px; height: 14px; }
.tile[data-host="on"] .tile-host { display: inline-flex; }

/* connection quality: three bars, hover for the numbers (call.js: pollQuality) */
.tile-quality { display: none; align-items: flex-end; gap: 2px; height: 12px; margin-left: -3px; }
.tile[data-quality] .tile-quality { display: inline-flex; }
.tile-quality i { width: 3px; border-radius: 1px; background: currentColor; opacity: .25; }
.tile-quality i:nth-child(1) { height: 5px; }
.tile-quality i:nth-child(2) { height: 8px; }
.tile-quality i:nth-child(3) { height: 12px; }
.tile[data-quality="good"] .tile-quality { color: var(--accent); }
.tile[data-quality="fair"] .tile-quality { color: var(--warn); }
.tile[data-quality="poor"] .tile-quality { color: var(--danger); }
.tile[data-quality="good"] .tile-quality i,
.tile[data-quality="fair"] .tile-quality i:nth-child(-n+2),
.tile[data-quality="poor"] .tile-quality i:nth-child(1) { opacity: 1; }

.tile-pin {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: var(--glass);
  backdrop-filter: blur(8px);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, color .15s;
  z-index: 2;
}
.tile-pin .icon { width: 16px; height: 16px; }
.tile:hover .tile-pin, .tile-pin:focus-visible, .tile.is-pinned .tile-pin { opacity: 1; }
.tile.is-pinned .tile-pin { color: var(--accent); }
@media (hover: none) { .tile-pin { opacity: .8; } }

.tile-reaction {
  position: absolute;
  left: var(--x, 50%);
  bottom: 44px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  pointer-events: none;
  animation: reaction-float 2.4s ease-out forwards;
  z-index: 4;
}
@keyframes reaction-float {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.5); }
  12% { opacity: 1; transform: translate(-50%, -12px) scale(1.15); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -140px) scale(1); }
}

.tile[data-connection="new"]::after,
.tile[data-connection="connecting"]::after,
.tile[data-connection="disconnected"]::after,
.tile[data-connection="failed"]::after {
  /* the text is the tile's own attribute (call.html's tile-template), in the page's language */
  content: attr(data-connecting);
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink-dim);
  font-size: 12px;
  font-weight: 600;
  z-index: 1;
}

/* chat and people: a column next to the stage; on phones the tab under a shrunk stage */
.side {
  flex: none;
  display: flex;
  flex-direction: column;
  width: 360px;
  min-height: 0;
  border-left: 1px solid var(--card-border);
  background: var(--bg-2);
}
.side-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 64px;
  padding: 0 10px 0 12px;
  border-bottom: 1px solid var(--card-border);
}
.side-tabs { display: flex; gap: 4px; min-width: 0; }
.side-tabs button {
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-dim);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.side-tabs button:hover { color: var(--ink); }
.side-tabs button.is-active { background: var(--card-2); color: var(--ink); }
.chat, .people { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; overflow-y: auto; }
.chat-empty { margin: auto 0; color: var(--ink-dim); font-size: 13px; text-align: center; }
.chat-msg-name { margin-top: 10px; color: var(--ink-dim); font-size: 12px; font-weight: 700; }
.chat-msg:first-of-type .chat-msg-name { margin-top: 0; }
.chat-msg.is-self .chat-msg-name { color: var(--accent); }
.chat-msg-text { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg-text a { color: var(--accent); text-decoration: underline; }
.chat-form { display: flex; align-items: center; gap: 6px; padding: 10px; border-top: 1px solid var(--card-border); }
.chat-form input[type="text"] { height: 44px; border-radius: 12px; }
.chat-send { flex: none; width: 44px; height: 44px; color: var(--accent); }

/* the rail: every in-call control, in a column down the left edge */
.dock {
  --logo-knock: var(--bg-2);
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 76px;
  padding: 14px 0 16px;
  border-right: 1px solid var(--card-border);
  background: var(--bg-2);
  overflow-y: auto;
  scrollbar-width: none;
}
.rail-logo { flex: none; display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; color: var(--ink); }
.rail-logo .logo-mark { width: 30px; height: 30px; }
.rail-spacer { flex: 1; min-height: 8px; }
.dock .ctl { flex: none; width: 48px; min-width: 48px; height: 48px; padding: 0; border-radius: 14px; }
.dock .ctl-leave span { display: none; }

.ctl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 52px;
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: var(--card-2);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s;
}
.ctl:hover { border-color: var(--accent); }
.ctl { position: relative; }
.ctl.is-active { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ctl-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gradient);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 800;
  line-height: 19px;
  text-align: center;
}
.ctl .off { display: none; }
.ctl .on, .ctl.is-off .off { display: contents; }
.ctl.is-off .on { display: none; }
.ctl.is-off { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.ctl.is-off:hover { border-color: var(--danger); }
.ctl .mic-fill {
  fill: var(--accent);
  stroke: none;
  transform: translateY(calc((1 - var(--mic-level, 0)) * 12px));
  transition: transform .1s linear;
}
.ctl[data-toggle="audio"] { transition: border-color .2s, background-color .2s, color .2s, box-shadow .12s ease-out; }
.ctl.is-speaking { border-color: var(--accent); box-shadow: 0 0 0 calc(var(--mic-level, 0) * 5px) color-mix(in srgb, var(--accent) 22%, transparent); }
.ctl-leave { padding: 0 20px; background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.ctl-leave:hover { border-color: var(--danger-hover); background: var(--danger-hover); }

/* reactions and raise hand, next to the rail; on phones the "Ещё" sheet */
.popover {
  position: absolute;
  bottom: 20px;
  left: 88px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  z-index: 9;
}
.reaction-row { display: flex; gap: 2px; }
.reaction-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s, transform .15s;
}
.reaction-btn:hover { background: var(--card-2); transform: translateY(-2px); }
.hand-btn { padding: 10px 16px; }
/* phones only: what the rail has and their row of buttons doesn't */
.popover-more { display: none; }
.hand-btn.is-active { border-color: var(--warn); color: var(--warn); }

/* device settings */
.sheet {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--scrim);
  z-index: 50;
}
.sheet-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(440px, 100%);
  padding: 22px 24px 26px;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-right: -8px; }
.sheet-head h2 { font-size: 19px; font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--ink-dim); font-size: 13px; font-weight: 600; }
.sheet-note { color: var(--ink-dim); font-size: 13px; }
.sheet-group { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; border-top: 1px solid var(--card-border); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 14px; cursor: pointer; }
.switch input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  margin: 0;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card-2);
  cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink-dim);
  transition: transform .2s, background-color .2s;
}
.switch input:checked { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(18px); background: var(--accent); }
.switch input:focus-visible { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }

/* people panel */
.people-total { color: var(--ink-dim); font-weight: 600; }
.people-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 10px; }
.people-section + .people-section { margin-top: 8px; }
.people-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 4px;
  color: var(--ink-dim);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.link-btn { border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; font-weight: 700; text-transform: none; letter-spacing: 0; cursor: pointer; }
.person { border-radius: 14px; }
.person:hover, .person:has(.person-actions:not([hidden])) { background: var(--card-2); }
.person-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 4px 4px 8px; }
.person-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 800;
}
.person-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.person-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-tag { flex: none; display: none; align-items: center; gap: 4px; color: var(--ink-dim); font-size: 12px; font-weight: 600; }
.person-tag .icon { width: 13px; height: 13px; }
.person-tag-host { color: var(--warn); }
.person[data-self="on"] .person-tag-self, .person[data-host="on"] .person-tag-host { display: inline-flex; }
.person-icons { flex: none; display: flex; gap: 6px; }
.person-icons > span { display: none; }
.person-icons .icon { width: 16px; height: 16px; }
.person[data-hand="on"] .person-hand { display: inline-flex; color: var(--warn); }
.person[data-screen="on"] .person-screen { display: inline-flex; color: var(--accent); }
.person[data-audio="off"] .person-muted { display: inline-flex; color: var(--danger); }
.person-more.is-active { color: var(--accent); }
.person-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px 10px 50px; }
.pill-btn {
  padding: 7px 12px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.pill-btn:hover { border-color: var(--accent); }
.pill-btn.is-danger { color: var(--danger); }
.pill-btn.is-danger:hover { border-color: var(--danger); }

.knock { display: flex; align-items: center; gap: 10px; padding: 6px 4px 6px 8px; }
.knock-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.knock-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.knock-hint { display: none; color: var(--ink-dim); font-size: 12px; }
.knock .btn { flex: none; padding: 7px 14px; font-size: 13px; }

/* hosts: newcomers at the door, over the stage while the panel is closed */
.knocks {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: min(420px, calc(100% - 32px));
  z-index: 6;
}
.knocks .knock {
  padding: 10px 10px 10px 12px;
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.knocks .knock-hint { display: block; }
.knocks-more { align-self: center; box-shadow: var(--shadow-sm); }

.host-tools { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-top: 1px solid var(--card-border); }
.segmented { display: flex; padding: 3px; border: 1px solid var(--card-border); border-radius: 999px; background: var(--bg-2); }
.segmented button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  padding: 8px 6px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.segmented button .icon { width: 14px; height: 14px; }
.segmented button.is-active { background: var(--card-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }
.host-note { color: var(--ink-dim); font-size: 12px; }
.host-switch { font-size: 13px; }
.host-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.host-actions .btn { justify-content: center; padding: 9px 10px; font-size: 13px; }
.host-actions .btn .icon { width: 16px; height: 16px; }
.host-actions .btn:first-child, .host-actions .btn:last-child { grid-column: 1 / -1; }

/* waiting for a host to let us in */
.waiting {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(6px);
  z-index: 7;
}
.waiting .message-card { text-align: center; }
.waiting-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background: var(--card-2);
  color: var(--accent);
}
.waiting-icon .icon { width: 26px; height: 26px; }

/* push to talk: above the toasts, not under them */
.ptt-pill {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--card);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  z-index: 8;
}
.ptt-pill .icon { width: 16px; height: 16px; }

/* dialog */
.sheet-text { color: var(--ink-dim); font-size: 14px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; }
.sheet-actions .btn { padding: 11px 20px; font-size: 14px; }

/* video Picture-in-Picture needs a rendered, not display:none, element */
.pip-video { position: fixed; left: 0; bottom: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }

/* the Document Picture-in-Picture window (call.js: openDocumentPip) */
.page-pip { height: 100vh; overflow: hidden; }
.page-pip::before { display: none; }
.pip { height: 100vh; display: flex; flex-direction: column; gap: 8px; padding: 8px; }
.pip .tile { flex: 1; }
.pip .tile-avatar span { width: 64px; height: 64px; font-size: 26px; }
.pip-controls { flex: none; display: flex; justify-content: center; gap: 8px; }
.pip-controls .ctl { min-width: 44px; height: 44px; padding: 0 10px; border-radius: 14px; }
.pip-controls .ctl-leave span { display: none; }

.banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  z-index: 5;
}

.saver-offer {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 6px 6px 6px 18px;
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 14px;
  z-index: 6;
}
.saver-offer .btn { flex: none; padding: 9px 16px; font-size: 13px; }
.saver-offer .icon-btn { flex: none; width: 34px; height: 34px; }

.unlock {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  box-shadow: var(--shadow);
}
.unlock:hover:not(:disabled) { transform: translate(-50%, calc(-50% - 1px)); }

.debug {
  position: absolute;
  top: 8px;
  left: 8px;
  max-width: calc(100% - 16px);
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .75);
  color: #9fe;
  font: 11px/1.4 'JetBrains Mono', ui-monospace, monospace;
  white-space: pre-wrap;
  pointer-events: none;
  z-index: 7;
}

/* wide screens: the wrapper adds nothing, the rail is a column of .meeting like before */
.controls { display: contents; }
.tabbar, .controls-hide, .controls-btn { display: none; }

/* a phone in landscape: the rail has to fit ~360px of height */
@media (max-height: 520px) and (min-width: 761px) {
  .dock { gap: 4px; padding: 8px 0; }
  .rail-logo, .dock .ctl-link { display: none; }
  .rail-spacer { min-height: 0; }
  .dock .ctl { width: 38px; min-width: 38px; height: 38px; border-radius: 12px; }
  .dock .ctl .icon { width: 18px; height: 18px; }
  .stage-head { height: 48px; }
  .side-head { height: 48px; }
}

@media (max-width: 860px) {
  .lobby { grid-template-columns: 1fr; align-items: start; gap: 20px; padding: 16px; }
  .lobby-card { padding: 24px 20px; }
  /* svh: the height with Safari's toolbars shown, so the form still peeks out under the preview */
  .lobby-stage { --preview-height: 52vh; --preview-height: 52svh; }
}

/* phones: the video takes the whole screen, with one button over it (.controls-btn) that pulls up
   a sheet: the row of the four buttons used most, then tabs for the call, chat, people and "Ещё".
   With chat or people open the stage shrinks to a strip, and the tabs sit in the flow under it. */
@media (max-width: 760px) {
  .topbar { height: 56px; padding: 0 16px; }
  .meeting { flex-direction: column; }
  .center { order: 1; }
  .side { order: 2; flex: 1; width: auto; border-left: 0; border-top: 1px solid var(--card-border); }
  .side-head { display: none; }
  .controls { order: 3; flex: none; display: flex; flex-direction: column; }

  .stage-head { height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; }
  .call-title { font-size: 17px; }
  .stage-actions .chip-link { display: none; }
  .stage { padding: 0 8px calc(8px + env(safe-area-inset-bottom)); }

  .meeting.panel-open .center { flex: 0 0 34%; }
  .meeting.panel-open .stage { padding-bottom: 4px; }
  .meeting.panel-open .dock { display: none; }

  /* the call itself: the sheet floats over the video and hides below the screen's edge */
  .meeting:not(.panel-open) .controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    padding-top: 4px;
    border-top: 1px solid var(--card-border);
    border-radius: 24px 24px 0 0;
    background: color-mix(in srgb, var(--bg-2) 90%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 -16px 40px var(--shadow-color);
    transition: transform .25s ease, visibility .25s;
  }
  .meeting:not(.panel-open):not(.controls-open) .controls { transform: translateY(100%); visibility: hidden; }
  .meeting:not(.panel-open) .controls-hide {
    display: grid;
    place-items: center;
    align-self: center;
    width: 64px;
    height: 24px;
    border: 0;
    background: none;
    color: var(--ink-dim);
    cursor: pointer;
  }
  .meeting:not(.panel-open) .tabbar { border-top: 0; background: none; }

  .controls-btn {
    position: absolute;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 9;
    display: grid;
    place-items: center;
    width: 64px;
    height: 44px;
    transform: translateX(-50%);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .controls-btn .icon { width: 24px; height: 24px; }
  .controls-btn [data-knock-badge] { right: auto; left: -5px; background: var(--warn); }
  .meeting.panel-open .controls-btn, .meeting.controls-open .controls-btn { display: none; }

  .dock {
    flex-direction: row;
    justify-content: center;
    gap: 14px;
    width: auto;
    padding: 10px 16px 12px;
    border: 0;
    background: none;
    overflow: visible;
  }
  /* mic, camera, flip and leave; everything else is in the tabs and "Ещё" */
  .dock > :not([data-toggle], [data-flip], .ctl-leave) { display: none; }
  .dock .ctl { width: 58px; min-width: 58px; height: 58px; border-radius: 50%; }
  .dock .ctl .icon { width: 24px; height: 24px; }
  .dock .ctl-leave { width: 88px; border-radius: 999px; }

  .tabbar {
    flex: none;
    display: flex;
    padding: 4px 4px env(safe-area-inset-bottom);
    border-top: 1px solid var(--card-border);
    background: var(--bg-2);
  }
  .tab {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 0 6px;
    border: 0;
    background: none;
    color: var(--ink-dim);
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .tab .icon { width: 22px; height: 22px; }
  .tab.is-active { color: var(--accent); }
  .tab .ctl-badge { top: 2px; right: calc(50% - 26px); }

  .popover {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(66px + env(safe-area-inset-bottom));
    padding: 12px;
  }
  /* over the call the sheet holds the big buttons too: sit above them, not on them */
  .meeting:not(.panel-open) .popover { bottom: calc(174px + env(safe-area-inset-bottom)); }
  .reaction-row { justify-content: space-between; }
  .popover-more { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .popover .btn { padding: 12px 14px; font-size: 14px; }

  .page-call .toast { bottom: calc(160px + env(safe-area-inset-bottom)); }
}

@media (max-width: 560px) {
  /* a phone is what scans the code, not what shows it */
  .invite { top: 8px; transform: translateX(-50%); padding: 22px 20px 20px; }
  .invite-qr, .invite-qr-hint { display: none; }
  .reaction-btn { width: 42px; height: 42px; font-size: 24px; }
  .lobby-controls { gap: 8px; padding: 6px; bottom: 12px; }
  .lobby-controls .ctl { min-width: 44px; height: 44px; padding: 0 10px; border-radius: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .ctl .mic-fill, .ctl[data-toggle="audio"] { transition: none; }
  .tile-reaction { animation-duration: .01s; }
  .grid > .tile { transition: border-color .15s, box-shadow .15s; }
  .recent-item.is-live .recent-icon::after { animation: none; }
}
