/* ═══════════════════════════════════════════════════
   Taglings — Global Styles
   Two themes from one set of tokens. Dark is the default; light applies
   when the device prefers it (no choice made) or when the person picks
   Light in the menu (html[data-theme]). Components only use tokens, and
   the video stage stays dark in both themes, like YouTube.
   ═══════════════════════════════════════════════════ */

:root {
  --bg: #06080f;
  --bg-2: #0a0e1a;
  --surface: rgba(14, 20, 40, 0.85);
  --surface-2: rgba(20, 28, 52, 0.9);
  --surface-3: rgba(26, 36, 64, 0.92);
  --border: rgba(80, 110, 200, 0.12);
  --border-hover: rgba(108, 140, 255, 0.25);
  --text: #edf0fa;
  --text-2: #c8d4f0;
  --muted: #7b8dba;
  --accent: #6c8cff;
  --accent-2: #8b6cff;
  --accent-glow: rgba(108, 140, 255, 0.3);
  --green: #3cda8a;
  --green-glow: rgba(60, 218, 138, 0.25);
  --green-dim: rgba(60, 218, 138, 0.12);
  --red: #ff5c6a;
  --red-dim: rgba(255, 92, 106, 0.12);
  --yellow: #ffc04d;
  --yellow-dim: rgba(255, 192, 77, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 20px 60px rgba(0,0,0,0.3);
  --transition: all .25s ease;
  --nav-bg: rgba(6, 8, 15, 0.88);
  --field-bg: rgba(10, 16, 32, 0.8);
  --scrim: rgba(0, 0, 0, 0.6);
  --tint-weak: rgba(108, 140, 255, 0.07);
  --tint: rgba(108, 140, 255, 0.12);
  --tint-2: rgba(108, 140, 255, 0.2);
  --on-accent: #07102b;
  --on-green: #071a0f;
  --red-text: #ff8a82;
  --sunk: rgba(6, 8, 15, 0.35);
  --warn-bg: #241d0a;
  --warn-border: rgba(255, 192, 77, 0.45);
  --neutral-pill: rgba(170, 180, 212, 0.12);
  --neutral-text: #aab4d4;
  --on-air: #3ddc84;
  --on-air-bg: rgba(18, 161, 80, 0.16);
  --thumb-bg: linear-gradient(135deg, #1d2547, #2b2059);
  --private-bg: repeating-linear-gradient(135deg, rgba(108, 140, 255, .07) 0 12px, transparent 12px 24px), linear-gradient(135deg, #111833, #1d2547);
  --private-fg: rgba(237, 240, 250, .35);
  --btn-neutral: rgba(255, 255, 255, 0.1);
  --btn-neutral-hover: rgba(255, 255, 255, 0.18);
  --strong-bg: #ffffff;
  --strong-fg: #111111;
  --switch-off: rgba(255, 255, 255, 0.18);
  --ctrl-bg: rgba(255, 255, 255, 0.12);
  --ctrl-bg-hover: rgba(255, 255, 255, 0.22);
  --ctrl-fg: #ffffff;
  --chat-avatar-bg: rgba(108, 140, 255, 0.22);
  --chat-avatar-fg: #dfe6ff;
  --glow-1: rgba(108, 140, 255, 0.06);
  --glow-2: rgba(60, 218, 138, 0.04);
  --glow-3: rgba(139, 108, 255, 0.05);
  color-scheme: dark;
}

/* Light: the device prefers it and no theme was picked, or Light was picked */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f6fa;
    --bg-2: #eceff6;
    --surface: #ffffff;
    --surface-2: #f0f2f8;
    --surface-3: #ffffff;
    --border: rgba(15, 23, 42, 0.1);
    --border-hover: rgba(59, 91, 219, 0.35);
    --text: #0f172a;
    --text-2: #334155;
    --muted: #556275;
    --accent: #3149c4;
    --accent-2: #6741d9;
    --accent-glow: rgba(59, 91, 219, 0.2);
    --green: #136c33;
    --green-glow: rgba(21, 128, 61, 0.2);
    --green-dim: rgba(21, 128, 61, 0.1);
    --red: #c81e1e;
    --red-dim: rgba(220, 38, 38, 0.08);
    --yellow: #94460a;
    --yellow-dim: rgba(217, 119, 6, 0.1);
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --nav-bg: rgba(255, 255, 255, 0.9);
    --field-bg: #ffffff;
    --scrim: rgba(15, 23, 42, 0.4);
    --tint-weak: rgba(59, 91, 219, 0.05);
    --tint: rgba(59, 91, 219, 0.09);
    --tint-2: rgba(59, 91, 219, 0.16);
    --on-accent: #ffffff;
  --on-green: #ffffff;
    --red-text: #b01818;
    --sunk: rgba(15, 23, 42, 0.04);
    --warn-bg: #fff7e6;
    --warn-border: rgba(217, 119, 6, 0.4);
    --neutral-pill: rgba(15, 23, 42, 0.06);
    --neutral-text: #526079;
    --on-air: #136c33;
    --on-air-bg: rgba(21, 128, 61, 0.1);
    --thumb-bg: linear-gradient(135deg, #e3e8fb, #ece4fb);
    --private-bg: repeating-linear-gradient(135deg, rgba(59, 91, 219, .06) 0 12px, transparent 12px 24px), linear-gradient(135deg, #e6eaf7, #dfe4f5);
    --private-fg: rgba(59, 91, 219, .4);
    --btn-neutral: rgba(15, 23, 42, 0.06);
    --btn-neutral-hover: rgba(15, 23, 42, 0.1);
    --strong-bg: #0f172a;
    --strong-fg: #ffffff;
    --switch-off: rgba(15, 23, 42, 0.2);
    --ctrl-bg: rgba(15, 23, 42, 0.07);
    --ctrl-bg-hover: rgba(15, 23, 42, 0.12);
    --ctrl-fg: #0f172a;
    --chat-avatar-bg: rgba(59, 91, 219, 0.12);
    --chat-avatar-fg: #3149c4;
    --glow-1: rgba(59, 91, 219, 0.07);
    --glow-2: rgba(21, 128, 61, 0.04);
    --glow-3: rgba(112, 72, 232, 0.05);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f6fa;
  --bg-2: #eceff6;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --surface-3: #ffffff;
  --border: rgba(15, 23, 42, 0.1);
  --border-hover: rgba(59, 91, 219, 0.35);
  --text: #0f172a;
  --text-2: #334155;
  --muted: #556275;
  --accent: #3149c4;
  --accent-2: #6741d9;
  --accent-glow: rgba(59, 91, 219, 0.2);
  --green: #136c33;
  --green-glow: rgba(21, 128, 61, 0.2);
  --green-dim: rgba(21, 128, 61, 0.1);
  --red: #c81e1e;
  --red-dim: rgba(220, 38, 38, 0.08);
  --yellow: #94460a;
  --yellow-dim: rgba(217, 119, 6, 0.1);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --nav-bg: rgba(255, 255, 255, 0.9);
  --field-bg: #ffffff;
  --scrim: rgba(15, 23, 42, 0.4);
  --tint-weak: rgba(59, 91, 219, 0.05);
  --tint: rgba(59, 91, 219, 0.09);
  --tint-2: rgba(59, 91, 219, 0.16);
  --on-accent: #ffffff;
  --on-green: #ffffff;
  --red-text: #b01818;
  --sunk: rgba(15, 23, 42, 0.04);
  --warn-bg: #fff7e6;
  --warn-border: rgba(217, 119, 6, 0.4);
  --neutral-pill: rgba(15, 23, 42, 0.06);
  --neutral-text: #526079;
  --on-air: #136c33;
  --on-air-bg: rgba(21, 128, 61, 0.1);
  --thumb-bg: linear-gradient(135deg, #e3e8fb, #ece4fb);
  --private-bg: repeating-linear-gradient(135deg, rgba(59, 91, 219, .06) 0 12px, transparent 12px 24px), linear-gradient(135deg, #e6eaf7, #dfe4f5);
  --private-fg: rgba(59, 91, 219, .4);
  --btn-neutral: rgba(15, 23, 42, 0.06);
  --btn-neutral-hover: rgba(15, 23, 42, 0.1);
  --strong-bg: #0f172a;
  --strong-fg: #ffffff;
  --switch-off: rgba(15, 23, 42, 0.2);
  --ctrl-bg: rgba(15, 23, 42, 0.07);
  --ctrl-bg-hover: rgba(15, 23, 42, 0.12);
  --ctrl-fg: #0f172a;
  --chat-avatar-bg: rgba(59, 91, 219, 0.12);
  --chat-avatar-fg: #3149c4;
  --glow-1: rgba(59, 91, 219, 0.07);
  --glow-2: rgba(21, 128, 61, 0.04);
  --glow-3: rgba(112, 72, 232, 0.05);
  color-scheme: light;
}

/* The video stage is dark in both themes: buttons over video keep their dark look */
#video-grid, .room-layout-immersive {
  --ctrl-bg: rgba(255, 255, 255, 0.12);
  --ctrl-bg-hover: rgba(255, 255, 255, 0.22);
  --ctrl-fg: #ffffff;
  --strong-bg: #ffffff;
  --strong-fg: #111111;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Background glow ───────────────── */
.bg-glow { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-glow .orb { position: absolute; border-radius: 50%; filter: blur(120px); animation: float 10s ease-in-out infinite; }
.bg-glow .orb-1 { width: 600px; height: 600px; background: var(--glow-1); top: -15%; left: -10%; }
.bg-glow .orb-2 { width: 500px; height: 500px; background: var(--glow-2); bottom: -15%; right: -10%; animation-delay: -5s; }
.bg-glow .orb-3 { width: 400px; height: 400px; background: var(--glow-3); top: 40%; left: 50%; animation-delay: -3s; }
@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(30px,-20px) scale(1.05); }
  66% { transform: translate(-20px,15px) scale(0.95); }
}

/* ── Navigation ────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.nav-inner {
  max-width: 1200px; margin: auto;
  display: flex; align-items: center; gap: 16px;
  height: 60px;
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text);
  flex-shrink: 0;
}
.nav-logo-mark { width: 35px; height: 20px; flex: none; display: block; }
.logo-text { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; font-weight: 800; font-size: 21px; letter-spacing: -0.03em; color: var(--text); }

/* YouTube-style search in the middle of the bar */
.nav-search { flex: 1; max-width: 560px; margin: 0 auto; position: relative; display: flex; align-items: center; gap: 8px; }
.nav-search-box { flex: 1; min-width: 0; display: flex; align-items: stretch; height: 40px; border: 1px solid var(--border-hover); border-radius: 20px; background: var(--field-bg); overflow: hidden; transition: var(--transition); }
.nav-search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.nav-search-input {
  flex: 1; min-width: 0; padding: 0 16px;
  background: transparent; border: 0; outline: none;
  color: var(--text); font-size: 15px; font-family: inherit;
}
.nav-search-input::-webkit-search-cancel-button { filter: invert(0.6); }
.nav-search-icon { display: grid; place-items: center; width: 56px; flex: none; background: var(--surface-2); border-left: 1px solid var(--border); color: var(--muted); }
.nav-search-icon svg { width: 18px; height: 18px; }
.nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.nav-icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--text); cursor: pointer; flex: none; }
.nav-icon-btn:hover { background: var(--surface-2); }
.nav-icon-btn svg { width: 22px; height: 22px; }
.nav-search-back, .nav-search-open { display: none; }
.nav-menu-wrap { position: relative; }
.nav-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 6px; z-index: 300; }
.nav-menu a, .nav-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px; border: 0; background: none; color: var(--text); font-size: 14px; font-weight: 500; line-height: 1.2; font-family: inherit; text-decoration: none; text-align: left; cursor: pointer; }
.nav-menu a:hover, .nav-menu button:hover { background: var(--tint); }
.nav-menu small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.nav-menu a, .nav-menu button { flex-direction: column; align-items: flex-start; gap: 2px; }
@media (max-width: 680px) {
  .nav { padding: 0 10px; }
  .nav-inner { gap: 6px; }
  .nav-search { display: none; }
  .nav-search-open { display: grid; }
  .nav.nav-searching .nav-logo, .nav.nav-searching .nav-right { display: none; }
  .nav.nav-searching .nav-search { display: flex; max-width: none; }
  .nav.nav-searching .nav-search-back { display: grid; }
  .nav-btn-label { display: none; }
  .nav-btn-short { display: inline; }
}
.nav-btn-short { display: none; }
.nav-btn { text-decoration: none; white-space: nowrap; }
.search-results {
  display: none; position: absolute; top: calc(100% + 6px);
  left: 0; right: 0; background: var(--surface-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  max-height: 300px; overflow-y: auto; z-index: 200;
  box-shadow: var(--shadow);
}
.search-results.active { display: block; }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--text);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--tint-weak); }
.search-result-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: white; flex-shrink: 0;
}
.search-result-info { flex: 1; min-width: 0; }
.search-result-name { font-weight: 600; font-size: 14px; }
.search-result-username { color: var(--muted); font-size: 12px; }
.search-result-live {
  background: var(--green-dim); color: var(--green);
  font-size: 10px; font-weight: 700; padding: 3px 8px;
  border-radius: 99px; text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-btn {
  border: none; border-radius: var(--radius-sm);
  padding: 9px 16px; font-weight: 600; font-size: 13px;
  cursor: pointer; transition: var(--transition);
  font-family: inherit; white-space: nowrap;
}
.nav-btn-primary { background: var(--accent); color: var(--on-accent); }
.nav-btn-primary:hover { filter: brightness(1.1); }
.nav-btn-secondary { background: var(--tint); color: var(--accent); }
.nav-btn-secondary:hover { background: var(--tint-2); }
.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: white;
  cursor: pointer; border: 2px solid transparent;
  transition: var(--transition);
}
.nav-avatar:hover { border-color: var(--accent); }

/* ── Main content ──────────────────── */
.main {
  position: relative; z-index: 1;
  min-height: 100vh; padding-top: 76px;
  max-width: 1200px; margin: 0 auto;
  padding-left: 20px; padding-right: 20px;
  padding-bottom: 40px;
}

/* ── Loading ───────────────────────── */
.loading-screen {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 60vh; gap: 16px; color: var(--muted);
}
.loading-dots { display: flex; gap: 6px; }
.loading-dots .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: loadBounce .6s ease-in-out infinite alternate;
}
.loading-dots .dot:nth-child(2) { animation-delay: .15s; }
.loading-dots .dot:nth-child(3) { animation-delay: .3s; }
@keyframes loadBounce { from { transform: translateY(0); opacity: 0.4; } to { transform: translateY(-8px); opacity: 1; } }

/* ── Cards ─────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(16px);
  transition: var(--transition);
  box-shadow: var(--shadow);
}
.card:hover { border-color: var(--border-hover); }
.card-compact { padding: 16px; }
.card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-title { font-size: 18px; font-weight: 700; }

/* ── Buttons ───────────────────────── */
.btn {
  border: none; border-radius: var(--radius-sm);
  padding: 12px 20px; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: var(--transition);
  font-family: inherit; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white; box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 6px 28px var(--accent-glow); transform: translateY(-1px); }
.btn-secondary { background: var(--tint); color: var(--accent); }
.btn-secondary:hover { background: var(--tint-2); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #ff7682; }
.btn-success { background: var(--green); color: var(--on-green); }
.btn-success:hover { filter: brightness(1.08); }
.btn-sm { padding: 8px 14px; font-size: 12px; }
.btn-lg { padding: 16px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Form elements ─────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 12px 14px;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px;
  font-family: inherit; outline: none;
  transition: var(--transition);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { cursor: pointer; }
.form-error { color: var(--red); font-size: 12px; margin-top: 4px; font-weight: 600; }
.form-hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Badges ────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; padding: 4px 10px;
  border-radius: 99px; letter-spacing: 0.4px;
  text-transform: uppercase;
}
.badge-live { background: var(--green-dim); color: var(--green); border: 1px solid rgba(60,218,138,0.2); }
.badge-offline { background: rgba(139,156,192,0.1); color: var(--muted); border: 1px solid var(--border); }
.badge-private { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,92,106,0.2); }
.badge-public { background: var(--green-dim); color: var(--green); border: 1px solid rgba(60,218,138,0.2); }
.badge-unlisted { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(255,192,77,0.2); }
.badge-director { background: var(--red-dim); color: var(--red); }
.badge-broadcaster { background: var(--yellow-dim); color: var(--yellow); }
.badge-guest { background: var(--tint); color: var(--accent); }
.badge-audience { background: var(--green-dim); color: var(--green); }

.badge-pulse { position: relative; }
.badge-pulse::before {
  content: ''; position: absolute; left: 10px; top: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; transform: translateY(-50%);
}
.badge-pulse { padding-left: 22px; }
.badge-pulse::after {
  content: ''; position: absolute; left: 7px; top: 50%;
  width: 12px; height: 12px; border-radius: 50%;
  background: currentColor; opacity: 0.3;
  transform: translateY(-50%);
  animation: pulse-badge 1.5s ease-out infinite;
}
@keyframes pulse-badge { 0% { transform: translateY(-50%) scale(1); opacity: 0.3; } 100% { transform: translateY(-50%) scale(2); opacity: 0; } }

/* ── Tabs ──────────────────────────── */
.tabs {
  display: flex; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px; margin-bottom: 20px;
}
.tab-btn {
  flex: 1; border: none; border-radius: var(--radius-sm);
  padding: 11px 14px; font-weight: 700; font-size: 13px;
  cursor: pointer; background: transparent; color: var(--muted);
  transition: var(--transition); font-family: inherit;
}
.tab-btn.active { background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 16px var(--accent-glow); }
.tab-btn:not(.active):hover { background: var(--tint-weak); color: var(--text); }

/* ── Grid layouts ──────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* ── Avatar ────────────────────────── */
.avatar {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; flex-shrink: 0;
}
.avatar-xs { width: 28px; height: 28px; font-size: 11px; }
.avatar-sm { width: 36px; height: 36px; font-size: 14px; }
.avatar-md { width: 56px; height: 56px; font-size: 20px; }
.avatar-lg { width: 80px; height: 80px; font-size: 28px; }
.avatar-xl { width: 120px; height: 120px; font-size: 42px; }

/* ── Toast ─────────────────────────── */
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 1000; display: flex;
  flex-direction: column; gap: 8px;
}
.toast {
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 20px;
  font-size: 13px; font-weight: 600;
  animation: slideIn .3s ease;
  box-shadow: var(--shadow); max-width: 350px;
  backdrop-filter: blur(16px);
}
.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }
.toast-info { border-left: 3px solid var(--accent); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { opacity: 1; } to { opacity: 0; transform: translateX(100%); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

/* ── Modal ─────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: var(--scrim); backdrop-filter: blur(6px);
  z-index: 500; justify-content: center; align-items: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  max-width: 520px; width: 92%;
  max-height: 85vh; overflow-y: auto;
  animation: fadeUp .25s ease;
  box-shadow: var(--shadow);
}
.modal-title { font-size: 20px; font-weight: 800; margin-bottom: 16px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── Page fade ─────────────────────── */
.page-enter { animation: fadeUp .35s ease; }

/* ── Utility ───────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }

/* ── Connection quality indicator ──── */
.connection-quality {
  display: inline-flex; gap: 2px; align-items: flex-end;
  height: 16px;
}
.conn-bar { width: 3px; border-radius: 1px; transition: background .3s; }
.conn-bar:nth-child(1) { height: 4px; }
.conn-bar:nth-child(2) { height: 8px; }
.conn-bar:nth-child(3) { height: 12px; }
.conn-bar:nth-child(4) { height: 16px; }
.conn-good .conn-bar { background: var(--green); }
.conn-medium .conn-bar { background: var(--yellow); }
.conn-medium .conn-bar:nth-child(4) { background: rgba(255,192,77,0.3); }
.conn-poor .conn-bar { background: var(--red); }
.conn-poor .conn-bar:nth-child(3),
.conn-poor .conn-bar:nth-child(4) { background: rgba(255,92,106,0.3); }

/* ── Video grid ────────────────────── */
.ic { width: 22px; height: 22px; flex: none; display: block; }
.video-grid {
  display: grid; gap: 8px;
  width: 100%; height: 100%;
  position: relative; /* anchors the top bar and chat overlay to the video */
}
.video-grid-1 { grid-template-columns: 1fr; }
.video-grid-2 { grid-template-columns: 1fr 1fr; }
.video-grid-3 { grid-template-columns: 1fr 1fr; }
.video-grid-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.video-container {
  position: relative; background: #05070d;
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16/9; border: 1px solid var(--border);
}
.video-container video { width: 100%; height: 100%; object-fit: cover; }
/* A single video fills the stage instead of sitting in a 16:9 box. */
.video-grid-1 .video-container { aspect-ratio: unset; height: 100%; min-height: 320px; }
.video-placeholder { display: flex; align-items: center; justify-content: center; }
.placeholder-inner { display: grid; justify-items: center; gap: 8px; padding: 24px; text-align: center; max-width: 340px; color: rgba(255,255,255,0.72); font-size: 14px; }
.placeholder-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.08); color: #fff; margin-bottom: 6px; }
.placeholder-icon .ic { width: 28px; height: 28px; }
.placeholder-pulse { animation: ph-pulse 2s ease-out infinite; }
@keyframes ph-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.25); } 100% { box-shadow: 0 0 0 22px rgba(255,255,255,0); } }
.placeholder-title { color: #fff; font-weight: 700; font-size: 17px; }
.video-label {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 4px 10px; border-radius: 999px; color: #fff;
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.tap-unmute {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 7; padding: 12px 20px; border: none; border-radius: 999px;
  background: rgba(0,0,0,0.7); color: white; font-size: 15px; font-weight: 700;
  cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; gap: 8px; font-family: inherit;
}
.tap-unmute[hidden] { display: none; }
.conn-status {
  position: absolute; top: 64px; left: 50%; transform: translateX(-50%);
  z-index: 6; padding: 4px 12px; border-radius: 999px;
  background: rgba(0,0,0,0.6); color: white; font-size: 12px; font-weight: 600;
  white-space: nowrap; pointer-events: none;
}
.conn-status[hidden] { display: none; }
.conn-status-bad { background: rgba(220,40,60,0.85); }
.video-controls {
  position: absolute; top: 60px; right: 10px; z-index: 6;
  display: flex; gap: 6px;
}
.video-ctrl-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: none; color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.video-ctrl-btn .ic { width: 16px; height: 16px; }
.video-ctrl-btn:hover { background: rgba(0,0,0,0.8); }
.video-ctrl-btn.muted { background: var(--red); }

/* ── Top bar over the video: host, LIVE, viewers, close ── */
.live-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 8;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 28px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(to bottom, rgba(0,0,0,0.45), transparent);
  pointer-events: none; color: #fff;
}
.live-topbar > * { pointer-events: auto; }
.live-host { display: flex; align-items: center; gap: 8px; min-width: 0; }
.live-host[hidden] { display: none; }
.live-host-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.85);
}
.live-host-name {
  font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 40vw; text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.live-pill {
  display: none; padding: 3px 8px; border-radius: 6px;
  background: #ff2d55; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em;
}
.has-video .live-pill { display: inline-block; }
.viewer-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 6px;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 12px; font-weight: 700;
}
.viewer-pill .ic { width: 14px; height: 14px; }
/* Broadcaster's comments toggle, top-right (white = comments showing). */
.live-topbar .ctrl-btn-top { margin-left: auto; width: 40px; height: 40px; }
.live-topbar .ctrl-btn-top .ic { width: 20px; height: 20px; }

/* ── Chat panel (director's Messages list) ── */
.chat-panel {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 0; overflow: hidden;
}
.chat-header {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.chat-header .ic { width: 18px; height: 18px; color: var(--accent); }
.chat-scope { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--muted); }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
  overscroll-behavior: contain;
}
.chat-msg { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; line-height: 1.35; }
.chat-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  background: var(--chat-avatar-bg); color: var(--chat-avatar-fg);
}
.chat-msg-host .chat-avatar { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.chat-msg-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-msg-name { font-weight: 700; font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.chat-msg-text { color: var(--text); word-break: break-word; }
.chat-host-tag {
  font-size: 9.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 4px; background: var(--accent); color: var(--on-accent);
}
.chat-msg-time { color: var(--muted); font-size: 10.5px; white-space: nowrap; margin-left: auto; padding-top: 2px; }
.chat-msg-system-row { justify-content: center; }
.chat-msg-private { font-size: 11px; font-weight: 600; opacity: .75; margin-top: 1px; }
.chat-msg-system { color: var(--muted); font-size: 12px; }
.chat-input-area {
  padding: 10px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: center;
}
.chat-input {
  flex: 1; min-width: 0; height: 42px; padding: 0 16px;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text); font-size: 15px; /* 15px+ stops iOS zooming on focus */
  font-family: inherit; outline: none;
}
.chat-input:focus { border-color: var(--accent); }
.chat-input:disabled { opacity: .6; }
.chat-send {
  width: 42px; height: 42px; flex: none; border: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); cursor: pointer;
}
.chat-send .ic { width: 18px; height: 18px; }
.chat-send:disabled { opacity: .5; cursor: not-allowed; }

/* ── Private chat threads (director/broadcaster view) ── */
.chat-thread-list {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  max-height: 88px; overflow-y: auto;
}
.chat-thread-chip {
  background: var(--tint); border: 1px solid transparent;
  color: var(--text); font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 999px; cursor: pointer;
  font-family: inherit; transition: var(--transition);
}
.chat-thread-chip:hover { background: var(--tint-2); }
.chat-thread-chip.active { background: var(--accent); color: var(--on-accent); }
.chat-thread-unread {
  background: var(--red); color: white; border-radius: 999px;
  font-size: 10px; padding: 1px 6px; margin-left: 4px;
}

/* ── Comments over the video (Instagram / YouTube / Facebook Live) ──
   White text with a strong shadow on a soft dark pill and a bottom scrim,
   so every comment stays readable on bright or dark video. */
.chat-panel-overlay {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 76px; z-index: 7;
  width: min(440px, 86%); max-height: 46%;
  background: transparent; border: none; border-radius: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: visible;
  pointer-events: none; /* taps fall through to the video except on our own controls */
}
.chat-panel-overlay .chat-messages {
  padding: 8px 12px; gap: 6px; flex: 0 1 auto; min-height: 0;
  -webkit-mask-image: linear-gradient(to top, #000 78%, transparent);
  mask-image: linear-gradient(to top, #000 78%, transparent);
  pointer-events: auto; transition: opacity .3s ease, transform .3s ease;
}
.chat-panel-overlay .chat-msg {
  align-self: flex-start; max-width: 100%;
  padding: 6px 12px 6px 6px; border-radius: 18px;
  background: rgba(0,0,0,0.46);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: chat-in .25s ease-out;
}
@keyframes chat-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.chat-panel-overlay .chat-avatar { width: 28px; height: 28px; box-shadow: 0 0 0 1.5px rgba(255,255,255,0.6); }
.chat-panel-overlay .chat-msg-name,
.chat-panel-overlay .chat-msg-text {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.85), 0 0 10px rgba(0,0,0,0.45);
}
.chat-panel-overlay .chat-msg-name { font-size: 13px; }
.chat-panel-overlay .chat-msg-text { font-size: 14.5px; font-weight: 500; }
.chat-panel-overlay .chat-msg-time { display: none; }
.chat-panel-overlay .chat-msg-host { background: rgba(108,140,255,0.42); }
.chat-panel-overlay .chat-host-tag { background: #fff; color: #1b2340; text-shadow: none; }
.chat-panel-overlay .chat-msg-system-row { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 2px 8px; }
.chat-panel-overlay .chat-msg-system { color: rgba(255,255,255,0.85); font-size: 12.5px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.9); }
.chat-panel-overlay .chat-thread-list {
  border: none; pointer-events: auto; background: transparent;
}
.chat-panel-overlay .chat-thread-chip { background: rgba(0,0,0,0.45); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.chat-panel-overlay .chat-thread-chip.active { background: #fff; color: #111; }
.chat-panel-overlay .chat-input-area { border: none; padding: 6px 10px; pointer-events: auto; }
.chat-panel-overlay .chat-input {
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.55); color: #fff;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.chat-panel-overlay .chat-input::placeholder { color: rgba(255,255,255,0.8); }
.chat-panel-overlay .chat-input:focus { border-color: #fff; }
.chat-panel-overlay .chat-send { background: #fff; color: #111; }

/* Audience: comments hidden until a tap; broadcaster can hide them too. */
.chat-mode-tap:not(.chat-open) .chat-messages,
.chat-mode-tap:not(.chat-open) .chat-thread-list,
.chat-panel-overlay.chat-hidden .chat-messages,
.chat-panel-overlay.chat-hidden .chat-thread-list {
  opacity: 0; transform: translateY(10px); pointer-events: none; visibility: hidden;
  transition: opacity .3s ease, transform .3s ease, visibility 0s .3s;
}

/* ── Room layout ───────────────────── */
.room-stage { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.room-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.room-sidebar { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Broadcaster/audience: one dark stage, video fills it, controls float on it. */
.room-layout-immersive .room-stage {
  height: calc(100vh - 120px); height: calc(100dvh - 120px); min-height: 480px;
  background: #000; border-radius: var(--radius); overflow: hidden; gap: 0;
}
.room-layout-immersive #video-grid { flex: 1; min-height: 0; }
/* Soft bottom scrim so comments and controls read on bright video. */
.room-layout-immersive #video-grid::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 45%; z-index: 6;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0.2) 55%, transparent);
  pointer-events: none;
}
.room-layout-immersive .video-grid-1 .video-container { border: none; border-radius: 0; min-height: 0; background: #000; }
.room-layout-immersive .video-grid-1 .video-label { display: none; } /* the top bar names the host */
.room-layout-immersive .video-grid-1 .video-container video { object-fit: contain; }
.room-layout-immersive .control-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 9;
  background: transparent; border: none; border-radius: 0;
  padding: 12px 14px max(14px, env(safe-area-inset-bottom));
}

/* Director: the video as viewers see it, Messages + participants beside it. */
.room-layout-director { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.room-layout-director .room-stage { position: sticky; top: 76px; }
.room-layout-director #video-grid { height: min(68vh, 720px); background: #000; border-radius: var(--radius); overflow: hidden; }
.room-layout-director .video-grid-1 .video-container { border: none; border-radius: 0; min-height: 0; }
.room-layout-director .video-container video { object-fit: contain; background: #000; }
.room-layout-director .room-sidebar { height: calc(100dvh - 120px); }
.room-layout-director .chat-panel { flex: 1; min-height: 260px; }
.room-participants-card { max-height: 34%; overflow-y: auto; flex: none; }
.room-sidebar .card-header .ic { width: 18px; height: 18px; color: var(--accent); }
/* Director's view switch, and what changes in Audience view. */
.room-layout-director #ctrl-overlay-chat { display: none; }
.room-layout-immersive .room-sidebar { display: none; }
.room-layout-immersive .chat-header { display: none; }
.room-layout-immersive.role-director .video-controls,
.room-layout-immersive.role-director #ctrl-go-live { display: none; }

/* Viewer window not in focus: blur the video */
.privacy-veil { display: none; }
.privacy-blur #video-grid video { filter: blur(28px) brightness(0.6); transform: scale(1.08); }
.privacy-blur .privacy-veil {
  position: absolute; inset: 0; z-index: 8; display: grid; place-items: center;
  text-align: center; color: #fff; cursor: pointer;
}
.privacy-veil > div { display: grid; justify-items: center; gap: 6px; padding: 16px; }
.privacy-veil .ic { width: 30px; height: 30px; opacity: .85; }
.privacy-veil p { font-weight: 700; font-size: 15px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.privacy-veil span { font-size: 13px; opacity: .8; }

/* In-page confirmation (never the browser's blocking confirm()) */
.room-dialog-backdrop {
  position: fixed; inset: 0; z-index: 500;
  display: grid; place-items: center; padding: 16px;
  background: var(--scrim); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: dlg-fade .15s ease-out;
}
.room-dialog {
  width: min(380px, 100%); padding: 22px 22px 18px;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); display: grid; gap: 10px;
}
.room-dialog h3 { font-size: 17px; font-weight: 800; }
.room-dialog p { color: var(--text-2); font-size: 14px; line-height: 1.5; }
.room-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.room-dialog-btn {
  height: 40px; padding: 0 18px; border-radius: 999px; border: none; cursor: pointer;
  font: 600 14px/1 inherit; font-family: inherit;
  background: var(--btn-neutral); color: var(--text);
}
.room-dialog-btn:hover { background: var(--btn-neutral-hover); }
.room-dialog-btn.primary { background: var(--strong-bg); color: var(--strong-fg); }
.room-dialog-btn.danger { background: #ff3b30; color: #fff; }
@keyframes dlg-fade { from { opacity: 0; } to { opacity: 1; } }
.site-banner {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 90;
  width: max-content; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 999px;
  background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--yellow);
  font-size: 14px; box-shadow: var(--shadow); text-align: center;
}
body.site-paused .main { padding-top: 128px; }
.acct-logo { width: 30px; height: 18px; flex: none; }
.site-footer { max-width: 1200px; margin: 0 auto; padding: 28px 20px 36px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.legal-page { max-width: 720px; margin: 0 auto; display: grid; gap: 18px; padding-bottom: 20px; }
.legal-page h1 { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; font-size: clamp(28px, 4vw, 38px); font-weight: 800; letter-spacing: -0.02em; }
.legal-page h2 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.legal-page section { display: grid; gap: 8px; color: var(--text-2); font-size: 15px; line-height: 1.6; }
.legal-page ul { padding-left: 20px; display: grid; gap: 4px; }
.legal-page a { color: var(--accent); }
.legal-intro { font-size: 17px; color: var(--text-2); line-height: 1.6; }
.legal-draft { justify-self: start; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--yellow-dim); color: var(--yellow); }
.legal-links { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; }
.tab-badge { display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 4px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; text-align: center; }
.tab-badge[hidden] { display: none; }
.tab-badge.urgent { background: var(--red); color: #fff; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.admin-table th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; padding: 8px 10px; }
.admin-table td { padding: 10px; border-top: 1px solid var(--border); vertical-align: top; }
.admin-table .num { text-align: right; }
.safety-pause { padding: 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.safety-pause.on { border-color: rgba(255,92,106,0.5); background: var(--red-dim); }
.safety-report { padding: 16px; display: grid; gap: 10px; border-left: 4px solid var(--border); }
.safety-report.p0 { border-left-color: var(--red); }
.safety-report.p1 { border-left-color: #ff8a3d; }
.safety-report.p2 { border-left-color: var(--yellow); }
.safety-report.done { opacity: .7; }
.safety-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.safety-reason { font-weight: 800; font-size: 15px; }
.safety-target { display: grid; gap: 4px; font-size: 14px; }
.safety-target .badge, .safety-target .safety-chip { margin-left: 6px; }
.safety-details { margin: 0; font-size: 14px; color: var(--text-2); }
.safety-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.safety-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--tint); color: var(--text-2); }
.safety-chip.warn { background: var(--red-dim); color: var(--red-text); }
.link-btn { background: none; border: none; padding: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--text); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ui-dialog-field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.ui-dialog-field textarea {
  width: 100%; resize: vertical; min-height: 70px; padding: 10px 12px;
  background: var(--field-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font: 400 14px/1.4 inherit; font-family: inherit; outline: none;
}
.ui-dialog-field textarea:focus { border-color: var(--accent); }
.ui-dialog-error { color: var(--red-text); font-size: 13px; font-weight: 600; }
.report-dialog { width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; }
.report-reasons { border: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.report-reason {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px;
}
.report-reason:has(input:checked) { border-color: #ff6b62; background: rgba(255,59,48,0.08); }
.report-reason input { margin-top: 3px; accent-color: #ff3b30; }
.report-reason span { display: grid; gap: 1px; }
.report-reason small { color: var(--muted); font-size: 12px; }
.report-note { font-size: 12px !important; color: var(--muted) !important; }

/* ── Control bar ───────────────────── */
.control-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ctrl-btn {
  position: relative;
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  border: none; cursor: pointer; transition: background .2s, transform .1s;
  display: flex; align-items: center; justify-content: center;
  background: var(--ctrl-bg); color: var(--ctrl-fg);
}
.room-layout-immersive .ctrl-btn { background: rgba(0,0,0,0.42); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14); }
.ctrl-btn:hover { background: var(--ctrl-bg-hover); }
.room-layout-immersive .ctrl-btn:hover { background: rgba(0,0,0,0.6); }
.ctrl-btn:active { transform: scale(0.94); }
.ctrl-btn.active, .room-layout-immersive .ctrl-btn.active { background: var(--strong-bg); color: var(--strong-fg); }
.ctrl-btn.muted, .room-layout-immersive .ctrl-btn.muted { background: #ff3b30; color: #fff; box-shadow: none; }
.ctrl-btn.danger { background: rgba(255,59,48,0.16); color: var(--red-text); }
.ctrl-btn.danger:hover { background: #ff3b30; color: #fff; }
.ctrl-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ctrl-btn-pill { width: auto; padding: 0 18px; gap: 8px; border-radius: 999px; font: 700 14px/1 inherit; font-family: inherit; }
.ctrl-btn-pill, .room-layout-immersive .ctrl-btn-pill { background: var(--strong-bg); color: var(--strong-fg); }
.ctrl-btn-pill:hover, .room-layout-immersive .ctrl-btn-pill:hover { opacity: .9; }
.room-layout-immersive .ctrl-btn.danger { background: rgba(255,59,48,0.22); color: #ff8a82; }
.room-layout-immersive .ctrl-btn.danger:hover { background: #ff3b30; color: #fff; }
.ctrl-btn.has-unread::after {
  content: ''; position: absolute; top: 6px; right: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #ff2d55; box-shadow: 0 0 0 2px rgba(0,0,0,0.6);
}
/* Red "hang up" button, like ending a call. */
.ctrl-btn-leave, .room-layout-immersive .ctrl-btn-leave { background: #ff3b30; color: #fff; box-shadow: 0 4px 14px rgba(255,59,48,0.45); }
.ctrl-btn-leave:hover, .room-layout-immersive .ctrl-btn-leave:hover { background: #ff5a50; }
.ctrl-btn-leave .ic { transform: rotate(135deg); fill: currentColor; stroke-width: 1; }

/* ── Participant list ──────────────── */
.participant-list {
  display: flex; flex-direction: column; gap: 4px;
}
.participant-group-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted);
  padding: 8px 12px 2px;
}
.participant-group-label:first-child { padding-top: 2px; }
.participant-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  transition: background .15s;
}
.participant-item:hover { background: var(--tint-weak); }
.participant-name { flex: 1; font-size: 13px; font-weight: 600; }
.participant-actions { display: flex; gap: 4px; }
.participant-actions button {
  width: 28px; height: 28px; border-radius: 50%;
  border: none; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--tint); color: var(--accent);
  transition: var(--transition);
}
.participant-actions button:hover { background: var(--tint-2); }

/* ── Waiting room ──────────────────── */
.waiting-screen {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 60vh; text-align: center; gap: 16px;
}
.waiting-icon { font-size: 64px; }
.waiting-title { font-size: 24px; font-weight: 800; }
.waiting-subtitle { color: var(--muted); font-size: 15px; max-width: 400px; }

/* ── Session cards ─────────────────── */
.session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  cursor: pointer;
}
.session-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.session-card-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.session-card-desc { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.session-card-meta {
  display: flex; gap: 12px; align-items: center; font-size: 12px;
  color: var(--muted);
}

/* ── Profile page ──────────────────── */
.profile-header {
  display: flex; gap: 24px; align-items: center;
  margin-bottom: 32px;
}
.profile-info { flex: 1; }
.profile-name { font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.profile-username { color: var(--muted); font-size: 15px; margin-bottom: 12px; }
.profile-bio { color: var(--text-2); font-size: 14px; line-height: 1.6; }

/* ── QR code ───────────────────────── */
.qr-container {
  background: white; border-radius: 16px; padding: 16px;
  display: inline-block; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.qr-container canvas, .qr-container img {
  display: block; border-radius: 4px;
}

/* ── Privacy notice ────────────────── */
.privacy-notice {
  background: var(--yellow-dim);
  border: 1px solid rgba(255,192,77,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 12px;
  color: var(--yellow); line-height: 1.6;
}

/* ── Responsive ────────────────────── */
@media (max-width: 768px) {
  .nav-inner { gap: 10px; }
  .room-layout { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .profile-header { flex-direction: column; text-align: center; }
  .control-bar { flex-wrap: wrap; }
  .video-grid-2 { grid-template-columns: 1fr; }
  .toast-container { left: 20px; right: 20px; }
  .toast { max-width: none; }
  .main { padding-left: 12px; padding-right: 12px; }
  /* Phones: broadcaster/audience go true full-screen (over the nav bar),
     like Instagram/Facebook Live. */
  .room-layout-immersive {
    position: fixed; inset: 0; z-index: 150;
    display: block; background: #000;
    height: 100vh; height: 100dvh; /* dvh follows the mobile browser's toolbars */
  }
  .room-layout-immersive .room-stage { height: 100%; min-height: 0; border-radius: 0; }
  .room-layout-immersive .video-grid-1 .video-container video { object-fit: cover; }
  .room-layout-immersive .control-bar { flex-wrap: nowrap; gap: 10px; }
  .room-layout-immersive .chat-panel-overlay { bottom: calc(70px + env(safe-area-inset-bottom)); max-height: 50%; width: 100%; left: 0; transform: none; }
  .room-layout-immersive .chat-panel-overlay .chat-msg { max-width: 86%; }
  body:has(.room-layout-immersive) .nav { display: none; } /* the room is the whole screen */

  /* Phones, director: video on top, then controls, Messages, participants. */
  .room-layout-director { grid-template-columns: minmax(0, 1fr); }
  .room-layout-director .room-stage { position: static; }
  .room-layout-director #video-grid { height: 42vh; min-height: 240px; }
  .room-layout-director .room-sidebar { height: auto; }
  .room-layout-director .chat-panel { height: 58vh; flex: none; }
  .room-participants-card { max-height: none; }
}

@media (max-width: 480px) {
  .btn { padding: 10px 14px; font-size: 13px; }
}

/* ── Home feed (blueprint layout) ───────────────────── */
.hf { --display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif; display: grid; gap: 34px; padding-top: 8px; }
.hf [hidden] { display: none !important; }
.hf-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px 40px; align-items: end; padding: 20px 0 4px; }
.hf-hero-text { display: grid; gap: 14px; justify-items: start; }
.hf-steps { list-style: none; margin: 0; padding: 18px; display: grid; gap: 14px; counter-reset: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.hf-steps li { counter-increment: step; display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: start; }
.hf-steps li::before { content: counter(step); grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--accent); font: 700 13px/1 'Inter', sans-serif; }
.hf-steps b { font-size: 15px; font-weight: 600; }
.hf-steps span { color: var(--muted); font-size: 13px; }
@media (max-width: 860px) { .hf-hero { grid-template-columns: minmax(0, 1fr); align-items: start; } }
.hf-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hf-hero h1 { font-family: var(--display); font-size: clamp(30px, 4.6vw, 50px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; text-wrap: balance; }
.hf-lede { color: var(--text-2); font-size: 17px; max-width: 56ch; }
.hf-search { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 560px; height: 48px; padding: 0 16px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); margin-top: 6px; }
.hf-search:focus-within { border-color: var(--accent); }
.hf-search svg { width: 18px; height: 18px; flex: none; }
.hf-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); font: inherit; font-size: 16px; }
.hf-results { display: grid; gap: 6px; width: 100%; max-width: 560px; }
.hf-result { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.hf-result:hover { border-color: var(--border-hover); }
.hf-result span:not(.hf-avatar):not(.hf-badge) { flex: 1; min-width: 0; display: grid; }
.hf-result small { color: var(--muted); font-size: 12px; }
.hf-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.hf-cta-note { color: var(--muted); font-size: 13px; }

.hf-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: -10px; }
.hf-chip { flex: none; height: 34px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--surface-2); color: var(--text); font: 500 13px/1 'Inter', sans-serif; cursor: pointer; }
.hf-chip.on { background: var(--text); color: var(--bg); }

.hf-row { display: grid; gap: 14px; }
.hf-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hf-row-head h2 { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 9px; }
.hf-row-head span { color: var(--muted); font-size: 13px; }
.hf-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: hfPulse 1.6s infinite; }
@keyframes hfPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.hf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px 16px; }
.hf-card { display: grid; gap: 10px; align-content: start; padding: 0; border: 0; background: none; color: inherit; text-align: left; text-decoration: none; cursor: pointer; font: inherit; }
.hf-thumb { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 12px; overflow: hidden; background-size: cover; transition: transform .2s ease; }
.hf-card:hover .hf-thumb, .hf-card:focus-visible .hf-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.hf-tl, .hf-badge, .hf-bl { position: absolute; display: inline-flex; align-items: center; gap: 5px; font: 700 11px/1 'Inter', sans-serif; padding: 5px 7px; border-radius: 6px; }
.hf-tl { top: 8px; left: 8px; background: var(--red); color: #fff; letter-spacing: .04em; }
.hf-tl.hf-soon { background: rgba(6, 8, 15, .82); color: #edf0fa; letter-spacing: 0; }
.hf-badge { top: 8px; right: 8px; background: rgba(6, 8, 15, .82); color: #edf0fa; }
.hf-badge svg, .hf-bl svg { width: 12px; height: 12px; }
.hf-bl { bottom: 8px; left: 8px; background: rgba(6, 8, 15, .72); color: #edf0fa; font-weight: 600; }
.hf-private { background: var(--private-bg); }
.hf-private-lock { position: absolute; inset: 0; display: grid; place-items: center; color: var(--private-fg); }
.hf-private-lock svg { width: 38px; height: 38px; }
.hf-avatar-private { background: var(--surface-2); color: var(--muted); }
.hf-avatar-private svg { width: 15px; height: 15px; }
/* on dark glass over the thumbnail, so fixed light colours in both themes */
.hf-acc-pin { color: #9db1ff; }
.hf-acc-ticket { color: #ffc04d; }
.hf-acc-members { color: #3cda8a; }
.hf-live-pill { position: static; background: var(--red); color: #fff; }
.hf-meta { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
.hf-meta b { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--text); }
.hf-meta small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.hf-avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 700 12px/1 'Inter', sans-serif; color: #fff; background-size: cover; background-position: center; }

.hf-directors { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.hf-dir { position: relative; display: grid; justify-items: center; gap: 6px; padding: 16px 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; text-align: center; cursor: pointer; font: inherit; }
.hf-dir:hover { border-color: var(--border-hover); }
.hf-dir .hf-avatar { width: 56px; height: 56px; font-size: 17px; }
.hf-dir b { font-size: 14px; font-weight: 600; line-height: 1.25; }
.hf-dir small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.hf-dir-live { position: absolute; top: 14px; left: calc(50% + 18px); width: 12px; height: 12px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg); }
.hf-empty { color: var(--muted); font-size: 14px; }
.hf-footnote { color: var(--muted); font-size: 13px; max-width: 70ch; border-top: 1px solid var(--border); padding-top: 18px; }

@media (max-width: 560px) {
  .hf { gap: 28px; }
  .hf-grid { grid-template-columns: minmax(0, 1fr); }
  .hf-directors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .hf-dot { animation: none; } }

/* ── Creator account request ───────────────────────── */
.hf-creator-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px; border-radius: var(--radius); background: linear-gradient(135deg, var(--tint), rgba(139, 108, 255, 0.08)); border: 1px solid var(--border-hover); }
.hf-creator-cta div { display: grid; gap: 4px; min-width: 0; flex: 1 1 280px; }
.hf-creator-cta b { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; font-size: 19px; }
.hf-creator-cta span { color: var(--text-2); font-size: 14px; }
.creator-req { max-width: 560px; margin: 32px auto; }
.creator-req-card { display: grid; gap: 16px; padding: 28px; }
.creator-req-title { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; font-size: clamp(26px, 5vw, 34px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
.creator-req-lede { color: var(--text-2); font-size: 16px; line-height: 1.55; }
.creator-req-email { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.creator-req-email span { font-size: 12px; }
.creator-req-email b { font-size: 20px; font-weight: 700; user-select: all; overflow-wrap: anywhere; }
.creator-req-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.creator-req-actions .btn { text-decoration: none; }
.creator-req-include b { font-size: 14px; }
.creator-req-include ul { margin: 6px 0 0; padding-left: 20px; color: var(--text-2); font-size: 14px; line-height: 1.7; }
.creator-req-note { font-size: 13px; border-top: 1px solid var(--border); padding-top: 14px; }
.creator-req-note a { color: var(--accent); }

/* ── Live status: on air (green, pulsing) vs room open (grey) ── */
.hf-tl.hf-onair { background: #12a150; color: #fff; }
.hf-tl.hf-waiting { background: rgba(6, 8, 15, .85); color: #aab4d4; letter-spacing: 0; }
.hf-tl i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.hf-tl.hf-onair i { background: #fff; animation: hfPulse 1.4s infinite; }
.hf-seats { color: var(--muted); }
.hf-seats.hf-few { color: var(--yellow); }
.hf-seats.hf-full { color: var(--red); font-weight: 600; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 12px; padding: 5px 10px; border-radius: 999px; }
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill.on-air { background: var(--on-air-bg); color: var(--on-air); }
.status-pill.on-air i { animation: hfPulse 1.4s infinite; }
.status-pill.waiting { background: var(--neutral-pill); color: var(--neutral-text); }
.status-note { font-size: 13px; line-height: 1.5; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); text-align: left; }
@media (prefers-reduced-motion: reduce) { .hf-tl.hf-onair i, .status-pill.on-air i { animation: none; } }

/* ── Accounts: sign in, settings, become a creator ── */
.nav-account { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border-hover); background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font: 700 14px/1 inherit; font-family: inherit; display: grid; place-items: center; overflow: hidden; cursor: pointer; padding: 0; }
.nav-account img { width: 100%; height: 100%; object-fit: cover; }
.nav-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: grid; gap: 2px; }
.nav-menu-head b { font-size: 14px; }
.nav-menu-head small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.acct-wrap { max-width: 460px; margin: 32px auto; }
.acct-card { display: grid; gap: 16px; padding: 28px; }
.acct-mark { display: flex; align-items: center; gap: 8px; font-family: 'Bricolage Grotesque', 'Inter', sans-serif; font-weight: 800; font-size: 22px; letter-spacing: -0.03em; }
.acct-mark i { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(255, 92, 106, 0.18); }
.acct-title { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; font-size: clamp(24px, 5vw, 30px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.acct-lede { color: var(--text-2); font-size: 15px; line-height: 1.55; margin: 0; }
.acct-error { background: rgba(255, 92, 106, 0.1); border: 1px solid rgba(255, 92, 106, 0.35); color: var(--red-text); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; }
.acct-buttons { display: grid; gap: 10px; }
.acct-provider { display: flex; align-items: center; justify-content: center; gap: 12px; height: 48px; border-radius: 12px; background: #fff; color: #1f1f1f; font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid #dadce0; transition: var(--transition); }
.acct-provider:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); }
.acct-provider svg { width: 20px; height: 20px; flex: none; }
.acct-fine { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0; }
.acct-fine a { color: var(--accent); }
.acct-settings { max-width: 640px; margin: 24px auto; display: grid; gap: 16px; }
.acct-page-title { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.acct-section { display: grid; gap: 10px; padding: 20px; }
.acct-section h2 { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.acct-section p { margin: 0; color: var(--text-2); font-size: 14px; }
.acct-section a:not(.btn) { color: var(--accent); }
.acct-section .btn { text-decoration: none; }
.acct-profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.acct-profile-head b { display: block; font-size: 16px; }
.acct-profile-head small { color: var(--muted); font-size: 13px; }
.acct-photo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.acct-photo-initial { display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; font-size: 22px; }
.acct-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); margin-top: 6px; }
.acct-row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.acct-methods { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.acct-methods li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.acct-methods svg { width: 20px; height: 20px; flex: none; }
.acct-methods span { display: grid; }
.acct-methods small { color: var(--muted); font-size: 12px; }

/* ── Creator Studio (YouTube Studio-style, phone first) ── */
.si { width: 18px; height: 18px; flex: none; display: block; }
.studio { display: grid; gap: 16px; }
.studio-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.studio-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.studio-id h1 { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.studio-id a { font-size: 13px; text-decoration: none; }
.studio-create { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; }
.studio-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.studio-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; }
.studio-nav .tab-btn {
  flex: none; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-2); box-shadow: none;
}
.studio-nav .tab-btn.active { background: var(--tint); color: var(--text); box-shadow: none; }
.studio-nav .tab-btn.active .si { color: var(--accent); }
.studio-nav .tab-btn .tab-badge { margin-left: auto; }
.studio-nav-label { padding: 14px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.studio-main { min-width: 0; }
.studio-stack { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.studio-main > .studio-stack { gap: 16px; }
.studio-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; min-width: 0; align-content: start; }
.studio-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.studio-card-head h3, .studio-card h3 { font-size: 16px; font-weight: 700; }
.studio-sub { font-size: 13px; color: var(--muted); margin: 0; }
.studio-note { font-size: 12px; color: var(--muted); margin: 0; }
.studio-hero {
  border-radius: var(--radius); padding: 22px; display: grid; gap: 8px;
  background: linear-gradient(135deg, var(--tint), rgba(139,108,255,0.06)); border: 1px solid var(--border-hover);
}
.studio-hero.is-live { background: linear-gradient(135deg, rgba(255,59,48,0.18), rgba(255,59,48,0.04)); border-color: rgba(255,92,106,0.45); }
.studio-hero .eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.studio-hero.is-live .eyebrow { color: var(--red-text); }
.studio-hero h2 { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; font-size: clamp(22px, 3vw, 28px); font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
.studio-hero p { max-width: 60ch; font-size: 14px; }
.studio-hero-actions, .session-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.studio-hero-actions .btn, .sc-actions .btn, .session-actions .btn { display: inline-flex; align-items: center; gap: 8px; }
.btn-golive { background: #ff3b30; color: #fff; box-shadow: 0 4px 18px rgba(255,59,48,0.35); }
.btn-golive:hover { background: #ff5a50; }
.btn-ghost-danger { background: transparent; color: var(--red-text); border: 1px solid rgba(255,92,106,0.45); }
.btn-ghost-danger:hover { background: var(--red-dim); }
.btn-icon { background: var(--tint); color: var(--accent); padding: 8px 10px; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat { display: grid; gap: 2px; padding: 12px; border-radius: var(--radius-sm); background: var(--tint-weak); }
.stat span { font-size: 12px; color: var(--muted); }
.stat b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat small { font-size: 11px; color: var(--muted); }
.studio-share { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.studio-share p { font-size: 13px; overflow-wrap: anywhere; margin: 2px 0 0; }
.studio-share .btn { display: inline-flex; align-items: center; gap: 8px; }
/* session card */
.sc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; }
.sc.live { border-color: rgba(255,92,106,0.45); }
.sc-main { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; min-width: 0; }
.sc-thumb {
  width: 76px; aspect-ratio: 16 / 10; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--thumb-bg); color: var(--accent);
}
.sc.live .sc-thumb { background: linear-gradient(135deg, #5a1720, #2b0c12); color: #fff; }
.sc.live .sc-thumb b { font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 2px 6px; border-radius: 4px; background: #ff2d55; }
.sc.ended .sc-thumb { color: var(--muted); background: var(--tint-weak); }
.sc-info { display: grid; gap: 3px; min-width: 0; }
.sc-title { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-meta { font-size: 13px; color: var(--muted); }
.sc-live { color: var(--red-text); font-weight: 700; }
.sc-chips { display: flex; gap: 6px; }
.chip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--tint); color: var(--text-2); }
.sc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* share dialog */
.share-box { display: flex; gap: 8px; }
.share-box .form-input { flex: 1; min-width: 0; font-size: 13px; }
.share-box .btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.share-qr { display: grid; justify-items: center; gap: 6px; font-size: 12px; }
.share-qr > div { background: #fff; padding: 10px; border-radius: 10px; }
/* analytics */
.kpi-card { padding: 0; gap: 0; overflow: hidden; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.kpi {
  display: grid; gap: 2px; text-align: left; padding: 14px 16px; border: none; background: transparent; color: var(--text);
  cursor: pointer; font-family: inherit; border-bottom: 3px solid transparent;
}
.kpi + .kpi { border-left: 1px solid var(--border); }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 11px; color: var(--muted); }
.kpi[aria-selected="true"] { background: var(--tint-weak); border-bottom-color: var(--accent); }
.kpi:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.kpi-chart { padding: 16px; }
.studio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
.bar-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; border-radius: 999px; background: var(--tint); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.num { font-variant-numeric: tabular-nums; }
.split { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; }
.split i { display: block; }
.split-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.split-legend span { display: inline-flex; align-items: center; gap: 6px; }
.split-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dev-phone { background: var(--accent); }
.dev-computer { background: var(--accent-2); }
.dev-tablet { background: var(--green); }
.dev-\? { background: var(--muted); }
.top-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.studio-card-head + .top-row { border-top: none; }
.top-rank { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--tint); color: var(--accent); flex: none; }
.top-info { display: grid; min-width: 0; flex: 1; }
.top-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.live-strip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-color: rgba(255,92,106,0.4); }

@media (max-width: 900px) {
  .studio-body { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .studio-nav {
    flex-direction: row; overflow-x: auto; gap: 6px; scrollbar-width: none;
    margin: 0 -12px; padding: 6px 12px; z-index: 20;
    background: var(--nav-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    top: 60px;
  }
  .studio-nav::-webkit-scrollbar { display: none; }
  .studio-nav .tab-btn { white-space: nowrap; padding: 8px 12px; border-radius: 999px; background: var(--tint-weak); font-size: 13px; gap: 8px; }
  .studio-nav .tab-btn.active { background: var(--text); color: var(--bg); }
  .studio-nav .tab-btn.active .si { color: var(--bg); }
  .studio-nav .tab-btn .si { width: 16px; height: 16px; }
  .studio-nav-label { display: none; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: none; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--border); }
  .studio-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .studio-create span { display: none; }
  .studio-create { padding: 10px 12px; }
  .studio-id h1 { font-size: 22px; }
  .sc-actions .btn { flex: 1 1 auto; justify-content: center; }
  .studio-hero-actions .btn, .session-actions .btn { flex: 1 1 100%; justify-content: center; }
  .studio-hero { padding: 18px; }
}

/* ── Follow & reminders ── */
.viewer-pill[hidden] { display: none; }
.follow-prompt {
  display: grid; justify-items: center; gap: 10px; margin-top: 8px; padding: 16px 18px; max-width: 380px;
  border-radius: var(--radius); background: var(--tint); border: 1px solid var(--border-hover); text-align: center; font-size: 14px;
}
.profile-actions { display: flex; gap: 8px; margin-top: 10px; }
.profile-header .profile-actions { justify-content: inherit; }
.btn-follow { padding: 9px 22px; border-radius: 999px; }
.hf-card-wrap { position: relative; display: grid; }
.hf-remind {
  position: absolute; bottom: 10px; right: 10px; z-index: 2; border: none; cursor: pointer;
  padding: 6px 10px; border-radius: 999px; font: 700 12px/1 inherit; font-family: inherit;
  background: rgba(0,0,0,0.6); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hf-remind.on { background: #fff; color: #111; }
.hf-row-head a { color: var(--accent); font-size: 14px; text-decoration: none; font-weight: 600; }
/* My channels */
.channels { max-width: 760px; margin: 0 auto; display: grid; gap: 20px; }
.channels-head h1 { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
#channels-body { display: grid; gap: 22px; }
.ch-section { display: grid; gap: 10px; }
.ch-section h2 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ch-show {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none;
}
.ch-show.live { border-color: rgba(255,92,106,0.45); }
.ch-show-info { display: grid; gap: 2px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.ch-show-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-show-info small { color: var(--muted); font-size: 13px; }
.ch-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)) center / cover; color: #fff;
}
.ch-channel { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ch-channel-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; text-decoration: none; position: relative; }
.ch-channel-link span { display: grid; min-width: 0; }
.ch-channel-link small { color: var(--muted); font-size: 13px; }
.ch-live-dot { position: absolute; left: 32px; top: 0; width: 12px; height: 12px; border-radius: 50%; background: #ff2d55; box-shadow: 0 0 0 2px var(--bg); }
.ch-empty { display: grid; gap: 8px; justify-items: start; padding: 18px; }
.ch-note { padding: 12px 16px; font-size: 14px; }
.ch-note a, .ch-empty a.btn { text-decoration: none; }
.ch-fine { font-size: 12px; }
/* settings switch */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--switch-off); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Creator profile: the landing page for joining a live session ── */
#profile-container { display: grid; gap: 22px; max-width: 980px; margin: 0 auto; }
#profile-container svg { width: 18px; height: 18px; flex: none; }
.pf-hero { display: grid; gap: 18px; padding: 24px; border-radius: var(--radius); background: linear-gradient(135deg, var(--tint), rgba(139,108,255,0.04)); border: 1px solid var(--border-hover); }
.pf-id { display: flex; gap: 20px; align-items: flex-start; }
.pf-id .avatar-xl { flex: none; }
.pf-id-text { display: grid; gap: 6px; min-width: 0; }
.pf-id-text h1 { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
.pf-handle { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.pf-verified { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--green-dim); color: var(--green); font-size: 12px; font-weight: 700; }
.pf-verified svg { width: 14px !important; height: 14px !important; }
.pf-bio { color: var(--text-2); font-size: 15px; max-width: 62ch; }
.pf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pf-stats > div { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--sunk); }
.pf-stats b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pf-stats span { font-size: 12px; color: var(--muted); }
.pf-live { color: var(--red-text); }
.pf-private-now { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; border-radius: var(--radius); border: 1px solid rgba(255,92,106,0.4); background: rgba(255,59,48,0.08); }
.pf-private-now > div { display: grid; gap: 2px; flex: 1; min-width: 220px; font-size: 14px; }
.pf-private-now span { color: var(--text-2); }
.pf-lock { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,59,48,0.16); color: var(--red-text); flex: none; }
.pf-section { display: grid; gap: 12px; }
.pf-section h2 { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.pf-trust { display: grid; gap: 16px; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.pf-trust-head { display: flex; gap: 14px; align-items: flex-start; }
.pf-trust-head h2 { font-size: 19px; font-weight: 800; }
.pf-trust-head p { color: var(--text-2); font-size: 14px; }
.pf-shield { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--green-dim); color: var(--green); flex: none; }
.pf-shield svg { width: 24px !important; height: 24px !important; }
.pf-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: pfstep; }
.pf-steps li { counter-increment: pfstep; display: grid; gap: 4px; align-content: start; padding: 14px; border-radius: var(--radius-sm); background: var(--tint-weak); font-size: 14px; }
.pf-steps li::before { content: counter(pfstep); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 13px; }
.pf-steps span { color: var(--text-2); font-size: 13px; line-height: 1.5; }
.pf-trust-points { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-trust-points span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--tint); font-size: 13px; font-weight: 600; color: var(--text-2); }
.pf-trust-points svg { width: 15px !important; height: 15px !important; color: var(--accent); }
.pf-join { justify-self: start; }
.pf-past { display: grid; gap: 8px; }
.pf-past-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: inherit; text-align: left; cursor: pointer; font: inherit; width: 100%; }
.pf-past-row:hover { border-color: var(--border-hover); }
.pf-past-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--tint); color: var(--accent); flex: none; }
.pf-past-info { display: grid; gap: 2px; flex: 1; min-width: 0; }
.pf-past-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-past-info small { color: var(--muted); font-size: 13px; }
.pf-ended, .hf-ended { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--neutral-pill); color: var(--muted); flex: none; }
.pf-fine { font-size: 13px; color: var(--muted); }
@media (max-width: 720px) {
  .pf-hero, .pf-trust { padding: 18px; }
  .pf-id { flex-direction: column; gap: 12px; }
  .pf-stats { grid-template-columns: minmax(0, 1fr); }
  .pf-steps { grid-template-columns: minmax(0, 1fr); }
  .pf-join { justify-self: stretch; text-align: center; }
}

/* ── Landing page trust ── */
.hf-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.hf-hero-actions .btn { text-decoration: none; }
.hf-trust { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hf-trust > div { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.hf-trust b { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.hf-trust b svg { width: 16px; height: 16px; color: var(--green); }
.hf-trust span { color: var(--muted); font-size: 13px; }
.hf-recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.hf-recent-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: inherit; text-decoration: none; text-align: left; font: inherit; cursor: pointer; min-width: 0; }
.hf-recent-row > span:nth-child(2) { display: grid; gap: 2px; flex: 1; min-width: 0; }
.hf-recent-row b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hf-recent-row small { color: var(--muted); font-size: 12px; }
.hf-footnote a { color: var(--accent); }
@media (max-width: 860px) { .hf-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .hf-trust { grid-template-columns: minmax(0, 1fr); } }

/* Wrong-PIN alert: host and director only */
.pin-alert {
  position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 1200;
  width: min(560px, calc(100% - 24px)); display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: start;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--text); box-shadow: var(--shadow);
}
.pin-alert-icon { color: var(--yellow); display: flex; }
.pin-alert-icon .ic { width: 22px; height: 22px; }
.pin-alert-text { display: grid; gap: 4px; min-width: 0; }
.pin-alert-text b { color: var(--yellow); font-size: 14px; }
.pin-alert-text span { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.pin-alert-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.pin-alert-note { font-size: 12px; color: var(--muted); margin-right: auto; }
.room-dialog .pin-new-pin { font-size: 34px; font-weight: 800; letter-spacing: 0.18em; text-align: center; font-variant-numeric: tabular-nums; margin: 4px 0; }
.room-dialog .pin-new-link { font-size: 12px; color: var(--muted); word-break: break-all; text-align: center; }
.sc-alert { display: block; margin-top: 6px; font-size: 12px; color: var(--yellow); line-height: 1.4; }

/* Too many wrong PINs on this device: calm wait notice with a timer */
.pin-wait {
  display: grid; gap: 8px; text-align: left; margin: 4px 0 14px; padding: 14px 16px;
  border-radius: var(--radius-sm); background: var(--yellow-dim); border: 1px solid rgba(255,192,77,0.35);
}
.pin-wait b { color: var(--yellow); font-size: 15px; }
.pin-wait b span { font-variant-numeric: tabular-nums; }
.pin-wait p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.pin-wait .link-btn { justify-self: start; font-size: 13px; }
.start-note b { color: var(--text); }

/* Appearance switch (⋮ menu) */
.theme-switch { display: grid; gap: 6px; padding: 8px 12px 10px; border-top: 1px solid var(--border); margin-top: 6px; }
.theme-switch > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.theme-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.nav-menu .theme-seg button {
  flex-direction: row; align-items: center; justify-content: center; gap: 6px; padding: 7px 6px;
  font-size: 12px; font-weight: 600; border-radius: 8px; color: var(--muted);
}
.nav-menu .theme-seg button:hover { background: var(--tint); color: var(--text); }
.nav-menu .theme-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.theme-seg svg { width: 14px; height: 14px; }

/* Replaces inline dark-only backgrounds in the session and profile pages */
.inset-box { background: var(--sunk); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.live-card { border: 1px solid rgba(255, 92, 106, 0.4); background: linear-gradient(135deg, var(--red-dim), var(--surface)); margin-bottom: 16px; }
.pin-gate { background: var(--surface-2); border: 1px solid var(--border-hover); padding: 16px; margin-top: 8px; box-shadow: none; }
.session-hero-card { border: 1px solid var(--border-hover); background: linear-gradient(135deg, var(--tint-weak), var(--surface)); }

/* ── Channel name and handle ── */
.handle-input { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--field-bg); overflow: hidden; transition: var(--transition); }
.handle-input:focus-within { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.handle-input span { display: grid; place-items: center; padding: 0 4px 0 14px; color: var(--muted); font-weight: 600; }
.handle-input input { flex: 1; min-width: 0; padding: 12px 14px 12px 2px; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 14px; }
.form-hint.hint-ok { color: var(--green); font-weight: 600; }
.form-hint.hint-bad { color: var(--red-text); font-weight: 600; }
.channel-setup { gap: 14px; border-color: var(--border-hover); background: linear-gradient(135deg, var(--tint), var(--surface)); }
.channel-setup .eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.channel-setup h3 { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin: 2px 0 4px; }
.channel-setup .form-group { margin-bottom: 0; }

/* ── Featured channels ── */
.pf-featured { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--yellow-dim); color: var(--yellow); font-size: 12px; font-weight: 700; }
.pf-featured svg { width: 14px !important; height: 14px !important; }
.safety-chip.featured { background: var(--yellow-dim); color: var(--yellow); }
.hf-featured { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.hf-feat {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; min-width: 0;
  border-radius: var(--radius); border: 1px solid var(--border-hover); color: var(--text); text-decoration: none;
  background: linear-gradient(135deg, var(--tint), var(--surface));
}
.hf-feat:hover { border-color: var(--accent); }
.hf-feat .hf-avatar { width: 52px; height: 52px; font-size: 16px; }
.hf-feat .hf-dir-live { left: 52px; top: 14px; }
.hf-feat-info { display: grid; gap: 2px; min-width: 0; flex: 1; }
.hf-feat b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hf-feat small { color: var(--muted); font-size: 12px; }
.hf-feat em { font-style: normal; color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hf-feat-tag { flex: none; align-self: flex-start; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--yellow-dim); color: var(--yellow); }
.hf-dir .hf-feat-tag { position: absolute; top: 8px; right: 8px; }
.handle-warn { margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--yellow-dim); color: var(--text-2); font-size: 13px; line-height: 1.45; border: 1px solid var(--warn-border); }

/* ── Home spotlight: one event, big ── */
.hf-spotlight {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0; overflow: hidden;
  border-radius: calc(var(--radius) + 4px); border: 1px solid var(--border-hover); background: var(--surface);
  box-shadow: var(--shadow);
}
.hf-spot-art { position: relative; min-height: 260px; background-size: cover; display: block; }
.hf-spot-art .hf-tl { top: 14px; left: 14px; font-size: 12px; padding: 6px 9px; }
.hf-spot-art .hf-badge { top: 14px; right: 14px; }
.hf-spot-body { display: grid; gap: 10px; align-content: center; padding: 26px 28px; min-width: 0; }
.hf-spot-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.hf-spot-body h2 { font-family: var(--display); font-size: clamp(24px, 3.2vw, 34px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; overflow-wrap: anywhere; }
.hf-spot-creator { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; justify-self: start; }
.hf-spot-creator .hf-avatar { width: 32px; height: 32px; }
.hf-spot-desc { color: var(--text-2); font-size: 15px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hf-spot-when { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.hf-spot-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.hf-spot-actions .btn { text-decoration: none; }
@media (max-width: 760px) {
  .hf-spotlight { grid-template-columns: minmax(0, 1fr); }
  .hf-spot-art { min-height: 0; aspect-ratio: 16 / 9; }
  .hf-spot-body { padding: 18px; }
  .hf-spot-actions .btn { flex: 1 1 auto; justify-content: center; }
}
.hf-feat-tag.live { background: var(--red); color: #fff; }
.spot-admin-row { display: flex; gap: 8px; align-items: center; }
.spot-admin-row .form-select { flex: 1; min-width: 0; }
.search-note { display: grid; gap: 4px; padding: 14px 16px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.search-note b { color: var(--text); font-size: 14px; }
.hf-listed-note { font-size: 13px; color: var(--muted); }
.hf-listed-note b { color: var(--text-2); font-weight: 600; }
.visibility-group { display: grid; gap: 6px; }
.hf-find { display: flex; align-items: stretch; gap: 0; max-width: 560px; border: 1px solid var(--border-hover); border-radius: 999px; background: var(--field-bg); overflow: hidden; transition: var(--transition); }
.hf-find:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.hf-find-at { display: grid; place-items: center; padding: 0 2px 0 16px; color: var(--muted); font-weight: 700; }
.hf-find input { flex: 1; min-width: 0; height: 46px; padding: 0 10px 0 4px; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 16px; }
.hf-find .btn { border-radius: 0 999px 999px 0; padding: 0 22px; }
.hf-find-result { display: grid; gap: 10px; }
.hf-find-msg { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.hf-find-msg b { color: var(--text); }
.search-group { padding: 10px 16px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--border); }
.hf-find-similar { font-size: 15px; font-weight: 700; margin-top: 4px; }
.pin-field { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: 0.4em; font-variant-numeric: tabular-nums; }
.pin-field::placeholder { font-size: 15px; font-weight: 500; letter-spacing: normal; }

/* Connection status: one dot in the top bar (tap it for details) */
.status-dot { position: relative; width: 26px; height: 26px; flex: none; border: 0; padding: 0; background: transparent; cursor: pointer; pointer-events: auto; }
.status-dot::before {
  content: ''; position: absolute; inset: 7px; border-radius: 50%;
  background: #f5b301; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}
.status-dot.ok::before { background: #22c55e; }
.status-dot.bad::before { background: #ef4444; }
.status-dot.wait::before { animation: dotPulse 1.2s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .status-dot.wait::before { animation: none; } }

/* Wrong PIN tries: a quiet orange count for host and director (tap for details) */
.wp-chip {
  display: inline-flex; align-items: center; gap: 4px; flex: none; pointer-events: auto; cursor: pointer;
  padding: 3px 8px; border: 0; border-radius: 999px; font: 800 12px/1 'Inter', sans-serif;
  background: #f59e0b; color: #1f1300; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.wp-chip[hidden] { display: none; }
.wp-chip .ic { width: 14px; height: 14px; }
