/* =========================================================
   CodeB Conference — stylesheet
   Reuses the design tokens, typography and component patterns
   from www.codeb.io so the phone integrates seamlessly there.
   ========================================================= */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,500&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ---------- Tokens (mirrors codeb.io) ---------- */
:root {
  /* Surfaces */
  --bg-0: #0a0d12;
  --bg-1: #0f141c;
  --bg-2: #141a24;
  --bg-3: #1a2230;
  --surface-glass: rgba(15, 20, 28, 0.78);

  /* Lines */
  --line-1: #1d2531;
  --line-2: #2a3342;
  --line-3: #394355;

  /* Text */
  --fg-0: #f3f5f8;
  --fg-1: #d7dce4;
  --fg-2: #99a3b4;
  --fg-3: #6b7689;
  --fg-4: #4b5466;

  /* Signal-amber accent */
  --accent: #f5a524;
  --accent-hot: #ffb842;
  --accent-deep: #b97a10;
  --accent-tint: rgba(245, 165, 36, 0.10);
  --accent-tint-strong: rgba(245, 165, 36, 0.18);

  /* Status */
  --ok: #5bd28a;
  --bad: #ef4d4d;

  /* Type */
  --font-display: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* Sizing */
  --max-w: 1280px;
  --radius: 4px;
  --radius-lg: 10px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--fg-1);
  background: var(--bg-0);
  font-weight: 400;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
a { color: var(--fg-0); text-decoration: none; }
a:hover { color: var(--accent); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--fg-0);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0 0 1rem;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1rem; color: var(--fg-1); }
.kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.25rem;
}
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 1.75rem;
  height: 1px;
  background: var(--accent);
}
.muted { color: var(--fg-2); }
.mono  { font-family: var(--font-mono); }

/* ---------- Site header (matches codeb.io chrome) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface-glass);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line-1);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media (min-width: 720px)  { .site-header .container { padding: 0 2rem; } }
@media (min-width: 1080px) { .site-header .container { padding: 0 2.5rem; } }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--fg-0);
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--fg-0); }
.brand .brand-mark {
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand .brand-mark .amber { color: var(--accent); }
.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-left: 0.6rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--line-2);
}
@media (max-width: 640px) { .brand-sub { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--fg-0);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.btn:hover { border-color: var(--fg-2); color: var(--fg-0); }
.btn-primary {
  background: var(--accent);
  color: #0a0d12;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hot); border-color: var(--accent-hot); color: #0a0d12; }
.btn-ghost { background: transparent; color: var(--fg-0); border-color: var(--line-2); }
.btn-quiet {
  padding: 0.55rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-0);
  font-size: 0.88rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-quiet:hover { background: var(--accent); border-color: var(--accent); color: #0a0d12; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Site top navigation (marketing pages) ---------- */
.site-header .container { position: relative; gap: 0.5rem; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-nav-link {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  color: var(--fg-1);
  text-decoration: none;
  font-size: 0.88rem;
  font-family: var(--font-body);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border: 1px solid transparent;
}
.site-nav-link:hover {
  color: #0a0d12;
  background: var(--accent);
  border-color: var(--accent);
}
.site-nav-link[aria-current="page"] {
  color: var(--accent);
  border-color: var(--line-2);
}
.site-nav-link.external {
  color: var(--fg-3);
  border-color: var(--line-2);
}
.site-nav-link.external:hover {
  color: #0a0d12;
}

/* ---------- Nav submenu (CSS-only hover dropdown on desktop) ---------- */
.site-nav .has-submenu { position: relative; }
.site-nav .has-submenu > .site-nav-link::after {
  content: "▾";
  display: inline-block;
  margin-left: 0.35em;
  font-size: 0.7em;
  opacity: 0.6;
}
.site-nav .site-submenu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius);
  box-shadow: 0 14px 32px rgba(0,0,0,0.45);
  padding: 0.35rem;
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  z-index: 90;
}
.site-nav .has-submenu:hover > .site-submenu,
.site-nav .has-submenu:focus-within > .site-submenu {
  display: flex;
}
.site-nav .site-submenu .site-nav-link {
  display: block;
  border-radius: 6px;
  white-space: normal;
  line-height: 1.35;
  padding: 0.55rem 0.7rem;
}
.site-nav .site-submenu .site-nav-link small {
  display: block;
  color: var(--fg-3);
  font-size: 0.75rem;
  margin-top: 0.15rem;
}
.site-nav .site-submenu .site-nav-link:hover small { color: rgba(10,13,18,0.7); }

@media (max-width: 820px) {
  /* On mobile the nav stacks vertically — flatten the submenu inline. */
  .site-nav .has-submenu { display: contents; }
  .site-nav .site-submenu {
    position: static;
    display: flex;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    min-width: 0;
  }
  .site-nav .has-submenu > .site-nav-link::after { content: ""; }
  .site-nav .site-submenu .site-nav-link {
    padding: 0.85rem 0.5rem 0.85rem 1.5rem;
    border-radius: 0;
    border-bottom: 1px solid var(--line-1);
    font-size: 0.92rem;
    color: var(--fg-2);
  }
  .site-nav .site-submenu .site-nav-link small { display: none; }
}


/* nested submenu (e.g. SSO -> integration guides) */
.site-nav .site-submenu .has-submenu { position: relative; }
.site-nav .site-submenu .has-submenu > .site-nav-link { position: relative; }
.site-nav .site-submenu .has-submenu > .site-nav-link::after {
  content: "\203A"; /* > */
  position: absolute; right: 0.55rem; top: 50%; transform: translateY(-50%);
  color: var(--fg-3); font-weight: 400; font-size: 0.95rem; line-height: 1;
}
.site-nav .site-submenu .has-submenu > .site-submenu {
  position: absolute;
  top: -0.35rem;
  left: calc(100% + 6px);
  min-width: 240px;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius);
  box-shadow: 0 14px 32px rgba(0,0,0,0.45);
  padding: 0.35rem;
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  z-index: 95;
}
.site-nav .site-submenu .has-submenu:hover > .site-submenu,
.site-nav .site-submenu .has-submenu:focus-within > .site-submenu { display: flex; }
@media (max-width: 820px) {
  /* Flatten the nested level too; give it a deeper indent so the
     parent-child relationship reads clearly on mobile. */
  .site-nav .site-submenu .has-submenu > .site-nav-link::after { content: ""; }
  .site-nav .site-submenu .has-submenu > .site-submenu {
    position: static;
    display: flex;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    min-width: 0;
  }
  .site-nav .site-submenu .has-submenu > .site-submenu .site-nav-link {
    padding-left: 2.75rem;
    font-size: 0.88rem;
    color: var(--fg-3);
  }
}

.site-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.site-nav-toggle:hover { border-color: var(--fg-2); }
.site-nav-toggle span {
  position: absolute;
  left: 10px;
  width: 22px;
  height: 2px;
  background: var(--fg-1);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}
.site-nav-toggle span:nth-child(1) { top: 13px; }
.site-nav-toggle span:nth-child(2) { top: 20px; }
.site-nav-toggle span:nth-child(3) { top: 27px; }
.site-nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.site-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.site-nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 20px; transform: rotate(-45deg); }

@media (max-width: 820px) {
  .site-nav-toggle { display: inline-block; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-0);
    border-bottom: 1px solid var(--line-1);
    padding: 0.5rem 1.5rem 1rem;
    display: none;
    box-shadow: 0 18px 36px rgba(0,0,0,0.45);
  }
  .site-nav.open { display: flex; }
  .site-nav-link {
    padding: 0.85rem 0.5rem;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--line-1);
    font-size: 0.95rem;
  }
  .site-nav-link:last-child { border-bottom: none; }
  .site-nav-link[aria-current="page"] { border-color: var(--line-1); }
}


/* ---------- Form fields (matches codeb.io contact form) ---------- */
.field { display: grid; gap: 0.5rem; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.field input,
.field select {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font: inherit;
  color: var(--fg-0);
  transition: border-color 0.15s, background 0.15s;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-2);
}

/* ---------- Landing page ---------- */
body.landing {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body.landing::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(245,165,36,0.05), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(60,90,160,0.04), transparent 60%);
}
body.landing > * { position: relative; z-index: 1; }
body.landing > .site-header { z-index: 100; }
/* Mobile nav dropdown must clear the join card on landing */
.site-nav.open { z-index: 110; }

.landing-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 5rem) 1.5rem;
}
.landing-card {
  width: 100%;
  max-width: 460px;
  border: 1px solid var(--line-1);
  background: linear-gradient(180deg, var(--bg-1) 0%, rgba(15,20,28,0.55) 100%);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
}
.landing-card .eyebrow { margin-bottom: 1rem; }
.landing-card h1 {
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  margin: 0 0 0.6rem;
}
.landing-card .lead {
  color: var(--fg-2);
  font-size: 0.98rem;
  margin: 0 0 1.75rem;
  line-height: 1.55;
  max-width: 36ch;
}
.landing-card .fields { display: grid; gap: 1rem; }
.landing-card .actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.landing-card .actions .btn { width: 100%; }
.landing-card .hint {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-1);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--fg-3);
  line-height: 1.6;
}

/* ---------- Site footer (slim) ---------- */
.site-footer {
  border-top: 1px solid var(--line-1);
  padding: 1.5rem 0;
  background: var(--bg-0);
}
.site-footer .container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--fg-3);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
}

/* =========================================================
   Room page
   ========================================================= */
body.room {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-0);
}

/* Room header — same chrome as site-header but tighter */
.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  background: var(--surface-glass);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line-1);
  flex-shrink: 0;
  padding-top: calc(0.65rem + env(safe-area-inset-top));
}
.room-header .brand {
  font-size: 1.05rem;
}
.room-title {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.9rem;
  overflow: hidden;
  flex: 1;
  justify-content: center;
  min-width: 0;
}
.room-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
}
#room-name-display {
  color: var(--fg-0);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.header-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.header-actions .ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--fg-1);
  font-size: 0.85rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.header-actions .ghost:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 640px) {
  .room-header .brand .brand-sub { display: none; }
  .room-header .brand { font-size: 1rem; }
  .room-title { font-size: 0.8rem; }
  .header-actions .ghost { padding: 0.5rem 0.6rem; }

  /* On phones the header has too many chrome buttons to fit, so the
     critical pair — Settings and Copy-link — gets pushed off-screen.
     Hide the low-priority / desktop-leaning controls on phones; they
     remain available on desktop, and recording / whiteboard / breakout
     are workflows that are awkward on a phone anyway. */
  #btn-rec, #rec-dot,
  #btn-sticky, #btn-doc-pip,
  #btn-whiteboard, #btn-breakout,
  #btn-pip { display: none; }

  /* Make the Copy-link button the visually dominant action in the
     header on mobile — it is the primary mobile-share gesture. */
  #copy-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #0a0d12;
    font-weight: 600;
    padding: 0.5rem 0.85rem;
  }
  #copy-link:hover,
  #copy-link:focus-visible {
    background: var(--accent-hot);
    border-color: var(--accent-hot);
    color: #0a0d12;
  }
  /* Show the label even on mobile so it's clearly identifiable */
  #copy-link span.copy-text { display: inline; font-size: 0.82rem; }
}

/* Phones: shrink header further so the remaining buttons + brand + room
   title fit a 360 px viewport without horizontal scroll. */
@media (max-width: 480px) {
  .room-header { padding-left: 0.55rem; padding-right: 0.55rem; gap: 0.5rem; }
  .room-header .brand-mark { font-size: 0.92rem; }
  .room-title { font-size: 0.72rem; gap: 0.35rem; }
  .room-label { font-size: 0.6rem; letter-spacing: 0.1em; }
  #room-name-display { font-size: 0.75rem; }
  .header-actions { gap: 0.3rem; }
  .header-actions .ghost { padding: 0.45rem 0.5rem; }
  .header-actions .ghost svg { width: 16px; height: 16px; }
  /* Keep the prominent copy button readable even at this size */
  #copy-link { padding: 0.45rem 0.7rem; }
  #copy-link span.copy-text { font-size: 0.78rem; }
}

/* Very narrow: hide the brand entirely (favicon in the tab is enough),
   hide the lock button (still reachable from Settings) and let the copy
   button shrink to an icon-with-tight-label to guarantee it stays on
   screen alongside Settings. */
@media (max-width: 380px) {
  .room-header .brand { display: none; }
  #btn-lock { display: none; }
  .header-actions .ghost { padding: 0.4rem 0.4rem; }
  .header-actions .ghost svg { width: 15px; height: 15px; }
  #copy-link { padding: 0.4rem 0.55rem; }
  #copy-link span.copy-text { font-size: 0.72rem; }
}

/* Video grid */
.video-grid {
  flex: 1;
  display: grid;
  gap: 6px;
  padding: 6px;
  overflow: hidden;
  background: var(--bg-0);
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
}
.video-grid.tiles-3,
.video-grid.tiles-4,
.video-grid.tiles-5,
.video-grid.tiles-6 { grid-template-columns: 1fr 1fr; }

@media (min-width: 600px) {
  .video-grid.tiles-2 { grid-template-columns: 1fr 1fr; }
  .video-grid.tiles-3,
  .video-grid.tiles-4 { grid-template-columns: 1fr 1fr; }
  .video-grid.tiles-5,
  .video-grid.tiles-6 { grid-template-columns: 1fr 1fr 1fr; }
}
@media (min-width: 900px) {
  .video-grid.tiles-3 { grid-template-columns: 1fr 1fr 1fr; }
}

.tile {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 0;
  transition: border-color 0.15s;
}
.tile.speaking { border-color: var(--accent); }
.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
}
.tile.screen video { object-fit: contain; background: #000; }
.tile.local video { transform: scaleX(-1); }
.tile.local.screen video { transform: none; }
.tile .tile-label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(10, 13, 18, 0.78);
  border: 1px solid var(--line-2);
  color: var(--fg-0);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  max-width: calc(100% - 20px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile .tile-flags {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
}
.tile .tile-flag {
  background: rgba(10, 13, 18, 0.78);
  border: 1px solid var(--line-2);
  color: var(--fg-0);
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.tile .tile-flag.muted {
  background: rgba(239, 77, 77, 0.18);
  border-color: var(--bad);
  color: var(--bad);
}
/* Camera-off placeholder — Zoom/Teams-style circular initials badge centered over a clean tile backdrop. */
.tile.no-video::after{content:'';position:absolute;inset:0;background:radial-gradient(circle at 50% 40%,#18222f 0%,var(--bg-1) 70%,#0a0d12 100%);z-index:1}
.tile.no-video::before{content:attr(data-initials);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:clamp(72px,22%,132px);height:clamp(72px,22%,132px);display:flex;align-items:center;justify-content:center;border-radius:50%;background:linear-gradient(135deg,var(--accent) 0%,var(--accent-deep) 100%);color:#0a0d12;font-family:var(--font-display);font-size:clamp(1.8rem,5vw,2.6rem);font-weight:700;letter-spacing:0;line-height:1;text-transform:uppercase;box-shadow:0 6px 24px rgba(0,0,0,0.45),inset 0 1px 0 rgba(255,255,255,0.18);z-index:2;user-select:none}
.tile.no-video>video{visibility:hidden}

/* Phone (SIP bridge) tile — never shows video, displays a phone glyph and
   a quiet animation that pulses while the call is connected. The bridge
   sends audio only, so the <video> element stays empty; we hide it. */
.tile.phone video { display: none; }
.tile.phone {
  background:
    radial-gradient(circle at 30% 20%, rgba(245, 165, 36, 0.10) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-1) 0%, #1a2330 100%);
}
.tile.phone .phone-glyph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0.75;
  pointer-events: none;
  z-index: 1;
}
.tile.phone.speaking .phone-glyph {
  animation: tile-phone-pulse 1.2s ease-in-out infinite;
}
@keyframes tile-phone-pulse {
  0%   { opacity: 0.45; transform: scale(1); }
  50%  { opacity: 1;    transform: scale(1.08); }
  100% { opacity: 0.45; transform: scale(1); }
}
.tile.phone .tile-label {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* Connecting/failed cue on remote tiles — bridge tile sees this most. */
.tile.pc-connecting{position:relative}
.tile.pc-connecting::after{content:'Connecting…';position:absolute;left:50%;bottom:12%;transform:translateX(-50%);padding:4px 12px;background:rgba(10,13,18,.78);color:var(--accent);font-family:var(--font-mono);font-size:.78rem;letter-spacing:.06em;border:1px solid rgba(245,165,36,.55);border-radius:999px;z-index:4;pointer-events:none;white-space:nowrap;animation:tile-connecting-pulse 1.4s ease-in-out infinite}
.tile.pc-connecting::before{content:'';position:absolute;inset:0;border:2px solid rgba(245,165,36,.55);border-radius:inherit;pointer-events:none;z-index:3;animation:tile-connecting-border 1.8s ease-in-out infinite}
.tile.pc-connecting.phone .phone-glyph{animation:tile-phone-pulse 1.6s ease-in-out infinite}
.tile.pc-failed::after{content:'Connection failed';position:absolute;left:50%;bottom:12%;transform:translateX(-50%);padding:4px 12px;background:rgba(10,13,18,.82);color:var(--bad);font-family:var(--font-mono);font-size:.78rem;letter-spacing:.06em;border:1px solid var(--bad);border-radius:999px;z-index:4;pointer-events:none}
@keyframes tile-connecting-pulse{0%,100%{opacity:.6}50%{opacity:1}}
@keyframes tile-connecting-border{0%{box-shadow:0 0 0 0 rgba(245,165,36,.35)}50%{box-shadow:0 0 0 6px rgba(245,165,36,0)}100%{box-shadow:0 0 0 0 rgba(245,165,36,0)}}

/* Inline "Call us" pill, green so it pops next to dimmer amber/grey text in footers and info@codeb.io lines. !important to win over the legacy inline-style attributes still on most pages. */
.callus-inline{display:inline-flex!important;align-items:center!important;gap:.4rem!important;padding:.3rem .85rem!important;background:rgba(91,210,138,.12)!important;color:var(--ok)!important;border:1.5px solid var(--ok)!important;border-radius:999px!important;font-family:var(--font-mono)!important;font-size:.82rem!important;font-weight:600!important;letter-spacing:.05em!important;text-decoration:none!important;cursor:pointer!important;margin-left:.5rem!important;vertical-align:middle!important;transition:background .15s,transform .05s,box-shadow .15s}
.callus-inline svg{width:14px!important;height:14px!important}
.callus-inline:hover{background:var(--ok)!important;color:#0a0d12!important;box-shadow:0 0 0 3px rgba(91,210,138,.22)!important}
.callus-inline:active{transform:translateY(1px)}

/* Dial-phone modal validation error line */
.dial-error {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius);
  background: rgba(239, 77, 77, 0.12);
  border: 1px solid var(--bad);
  color: var(--bad);
  font-size: 0.85rem;
}

/* Controls bar */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem;
  background: var(--bg-0);
  border-top: 1px solid var(--line-1);
  flex-shrink: 0;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
}
.ctrl {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--bg-1);
  color: var(--fg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 0.55rem 0.95rem;
  min-width: 64px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ctrl:hover { border-color: var(--fg-2); color: var(--fg-0); }
.ctrl.active { background: var(--accent); border-color: var(--accent); color: #0a0d12; }
.ctrl.off    { background: var(--bg-2); border-color: var(--bad); color: var(--bad); }
.ctrl.danger { background: var(--bad); border-color: var(--bad); color: #0a0d12; }
.ctrl.danger:hover { background: #c33d3d; border-color: #c33d3d; color: #fff; }
.ctrl-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}
@media (max-width: 480px) {
  .ctrl { min-width: 56px; padding: 0.5rem 0.6rem; }
  .ctrl-label { font-size: 0.62rem; letter-spacing: 0.08em; }
  .controls { gap: 0.4rem; padding: 0.6rem 0.5rem; padding-bottom: calc(0.6rem + env(safe-area-inset-bottom)); }
}

/* Status banner (toast-style alert) */
.status-banner {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-1);
  border: 1px solid var(--bad);
  border-left: 3px solid var(--bad);
  color: var(--fg-0);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  z-index: 100;
  box-shadow: 0 14px 30px rgba(0,0,0,0.45);
  max-width: 90vw;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.status-banner.info { border-color: var(--accent); border-left-color: var(--accent); color: var(--accent); }
.hidden { display: none !important; }

/* Modal (Settings + Name prompt) */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 18, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal-card {
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.45);
}
.modal-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}
.modal-sub {
  color: var(--fg-2);
  font-size: 0.92rem;
  margin: 0 0 1.25rem;
}
.modal-card label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 1rem 0 0.45rem;
}
.modal-card input,
.modal-card select,
.device-select {
  width: 100%;
  padding: 0.75rem 0.95rem;
  background: var(--bg-0);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font: inherit;
  color: var(--fg-0);
  transition: border-color 0.15s, background 0.15s;
}
.modal-card input:focus,
.modal-card select:focus,
.device-select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-2);
}
.modal-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}
.modal-actions .btn,
.modal-actions .primary,
.modal-actions .secondary { font-family: var(--font-body); }
.modal-card .primary,
.modal-card button.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.4rem;
  background: var(--accent);
  color: #0a0d12;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  width: 100%;
  margin-top: 1.25rem;
  transition: background 0.15s, border-color 0.15s;
}
.modal-card .primary:hover { background: var(--accent-hot); border-color: var(--accent-hot); }
.modal-card .secondary,
.modal-card button.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  background: transparent;
  color: var(--fg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-size: 0.92rem;
}
.modal-card .secondary:hover { border-color: var(--fg-2); color: var(--fg-0); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Focus visibility ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- Remote pointer overlay ---------- */
.pointer-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}
.remote-pointer {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-2px, -1px);
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  opacity: 1;
  transition: opacity 0.25s ease, left 0.07s linear, top 0.07s linear;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}
.remote-pointer.fading { opacity: 0; }
.remote-pointer svg {
  flex-shrink: 0;
  width: 18px;
  height: 22px;
}
.remote-pointer-name {
  margin-top: 14px;
  background: var(--ptr-color, var(--accent));
  color: #0a0d12;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  white-space: nowrap;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.pointer-click {
  position: absolute;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  animation: pointerClickPulse 0.6s ease-out forwards;
}
@keyframes pointerClickPulse {
  0%   { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(1.8); opacity: 0;   }
}

/* ---------- Settings: pointer toggle ---------- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  background: var(--bg-0);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
}
.toggle-row .toggle-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.toggle-row .toggle-label strong {
  color: var(--fg-0);
  font-weight: 600;
  font-size: 0.95rem;
}
.toggle-row .toggle-label small {
  color: var(--fg-3);
  font-size: 0.78rem;
  line-height: 1.4;
}
/* iOS-style switch */
.switch {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  display: inline-block;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.switch .slider {
  position: absolute;
  inset: 0;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.switch .slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--fg-1);
  border-radius: 50%;
  transition: transform 0.18s ease;
}
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider::before { background: #0a0d12; transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Chat button badge ---------- */
.ctrl { position: relative; }
.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent);
  color: #0a0d12;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  letter-spacing: 0;
  border: 1.5px solid var(--bg-0);
}

/* ---------- Chat side panel ---------- */
.chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 100vw;
  background: var(--bg-1);
  border-left: 1px solid var(--line-1);
  display: flex;
  flex-direction: column;
  z-index: 150;
  box-shadow: -10px 0 30px rgba(0,0,0,0.45);
  transition: transform 0.22s ease;
  transform: translateX(0);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.chat-panel.hidden { transform: translateX(100%); display: flex !important; pointer-events: none; }

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line-1);
  background: var(--surface-glass);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
}
.chat-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.chat-head .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  color: var(--fg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
}
.chat-head .ghost:hover { color: var(--accent); border-color: var(--accent); }

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  scroll-behavior: smooth;
}
.chat-list::-webkit-scrollbar { width: 8px; }
.chat-list::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
.chat-list::-webkit-scrollbar-thumb:hover { background: var(--line-3); }

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 92%;
}
.chat-msg.self { align-self: flex-end; align-items: flex-end; }
.chat-msg-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.78rem;
}
.chat-msg-who {
  font-weight: 600;
  letter-spacing: 0.01em;
}
.chat-msg-time {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--fg-3);
  letter-spacing: 0.04em;
}
.chat-msg-body {
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: 12px 12px 12px 4px;
  padding: 0.55rem 0.8rem;
  color: var(--fg-0);
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.chat-msg.self .chat-msg-body {
  background: var(--accent-tint);
  border-color: var(--accent-tint-strong);
  border-radius: 12px 12px 4px 12px;
  color: var(--fg-0);
}
.chat-msg.system {
  align-self: center;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--fg-3);
  text-align: center;
  padding: 0.2rem 0.6rem;
  border-top: 1px dashed var(--line-1);
  border-bottom: 1px dashed var(--line-1);
}

.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--line-1);
  background: var(--bg-0);
}
.chat-input {
  flex: 1;
  resize: none;
  min-height: 40px;
  max-height: 140px;
  padding: 0.6rem 0.8rem;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.95rem;
  color: var(--fg-0);
  line-height: 1.4;
  transition: border-color 0.15s;
}
.chat-input:focus { outline: none; border-color: var(--accent); }
.chat-send {
  padding: 0.55rem 0.85rem;
  min-width: 44px;
}

/* Mobile: chat takes full screen, and bump input to ≥16px so iOS Safari
   doesn't zoom the viewport when the field gets focus */
@media (max-width: 640px) {
  .chat-panel {
    width: 100vw;
    border-left: 0;
    box-shadow: none;
  }
  .chat-input { font-size: 16px; }
}

/* Desktop: shrink video grid to make room for chat when open */
@media (min-width: 900px) {
  body.chat-open .video-grid { padding-right: 366px; }
  body.chat-open .room-header,
  body.chat-open .controls { padding-right: 360px; }
}

/* ---------- Tile expand button ---------- */
.tile-expand {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 13, 18, 0.6);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--fg-1);
  cursor: pointer;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s, background 0.15s;
}
.tile:hover .tile-expand,
.tile.spotlight .tile-expand { opacity: 1; }
.tile-expand:hover { color: var(--accent); border-color: var(--accent); background: rgba(10, 13, 18, 0.85); }
.tile.spotlight .tile-expand { color: var(--accent); border-color: var(--accent); }

/* ---------- Spotlight mode ---------- */
.video-grid.spotlight-mode {
  display: grid;
  gap: 6px;
  padding: 6px;
  /* Desktop: main tile + thumbnail rail on the right */
  grid-template-columns: 1fr 220px;
  grid-template-rows: 1fr;
  grid-template-areas: "main thumbs";
}
.video-grid.spotlight-mode .tile.spotlight {
  grid-area: main;
  height: 100%;
  min-height: 0;
}
.video-grid.spotlight-mode .thumb-rail {
  grid-area: thumbs;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  min-width: 0;
  scrollbar-width: thin;
}
.video-grid.spotlight-mode .thumb-rail::-webkit-scrollbar { width: 6px; }
.video-grid.spotlight-mode .thumb-rail::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.video-grid.spotlight-mode .thumb-rail .tile {
  flex: 0 0 auto;
  height: 130px;
  width: 100%;
}

/* Tablet / small desktop — thumbs slightly narrower */
@media (max-width: 980px) and (min-width: 721px) {
  .video-grid.spotlight-mode { grid-template-columns: 1fr 180px; }
  .video-grid.spotlight-mode .thumb-rail .tile { height: 110px; }
}

/* Mobile — thumbnails row at the bottom, spotlight on top */
@media (max-width: 720px) {
  .video-grid.spotlight-mode {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 110px;
    grid-template-areas: "main" "thumbs";
  }
  .video-grid.spotlight-mode .thumb-rail {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .video-grid.spotlight-mode .thumb-rail .tile {
    flex: 0 0 auto;
    width: 150px;
    height: 100%;
  }
}

/* Hide the per-tile pointer layer's visual confusion in tiny thumbnails (keep functional) */
.video-grid.spotlight-mode .thumb-rail .tile .tile-expand {
  width: 22px;
  height: 22px;
  top: 4px;
  left: 4px;
}
.video-grid.spotlight-mode .thumb-rail .tile .tile-label {
  font-size: 0.62rem;
  padding: 0.15rem 0.4rem;
  left: 4px;
  bottom: 4px;
}

/* ---------- Speaking ring on tiles ---------- */
.tile.speaking { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint-strong); }

/* ---------- Raised-hand emoji on tile ---------- */
.tile-hand {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.6rem;
  background: rgba(10, 13, 18, 0.78);
  border: 1px solid var(--accent);
  width: 38px; height: 38px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  animation: wave 1.2s ease-in-out infinite alternate;
}
@keyframes wave {
  0%   { transform: translateX(-50%) rotate(-10deg); }
  100% { transform: translateX(-50%) rotate(10deg); }
}

/* ---------- Reactions (floating emoji over a tile) ---------- */
.tile-reaction {
  position: absolute;
  bottom: 50px;
  font-size: 2.6rem;
  pointer-events: none;
  z-index: 5;
  animation: float-up 2.1s ease-out forwards;
}
@keyframes float-up {
  0%   { transform: translateY(0)    scale(0.6); opacity: 0; }
  15%  { transform: translateY(-10px) scale(1.0); opacity: 1; }
  100% { transform: translateY(-160px) scale(1.1); opacity: 0; }
}

/* ---------- Reaction tray (popup over controls) ---------- */
.react-tray {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.4rem 0.5rem;
  display: flex;
  gap: 0.2rem;
  z-index: 110;
  box-shadow: 0 14px 30px rgba(0,0,0,0.45);
}
.react-tray.hidden { display: none; }
.react-tray button {
  width: 40px; height: 40px;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  border-radius: 50%;
  transition: background 0.12s, transform 0.12s;
}
.react-tray button:hover { background: var(--bg-2); transform: scale(1.18); }

/* ---------- Ctrl button emoji (raise hand, react) ---------- */
.ctrl-emoji {
  font-size: 1.3rem;
  line-height: 1;
  display: inline-block;
  filter: saturate(1.1);
}
.ctrl.active { background: var(--accent); border-color: var(--accent); color: #0a0d12; }

/* ---------- Connection quality bars ---------- */
.tile-bars {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  background: rgba(10, 13, 18, 0.6);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 3px 5px;
  z-index: 4;
}
.tile-bars span {
  display: inline-block;
  width: 3px;
  background: var(--fg-4);
  border-radius: 1px;
  opacity: 0.6;
}
.tile-bars span:nth-child(1) { height: 4px; }
.tile-bars span:nth-child(2) { height: 7px; }
.tile-bars span:nth-child(3) { height: 10px; }
.tile-bars span:nth-child(4) { height: 13px; }
.tile-bars span.on { opacity: 1; }
.tile-bars.q1 span.on { background: var(--bad); }
.tile-bars.q2 span.on { background: #e8a13a; }
.tile-bars.q3 span.on { background: var(--accent); }
.tile-bars.q4 span.on { background: var(--ok); }
.tile-bars.unknown span { opacity: 0.3; background: var(--fg-4); }

/* Hide bars on the local tile (self-quality is meaningless to display) */
.tile.local .tile-bars { display: none; }

/* ---------- Media route indicator (P2P vs TURN) ---------- */
.tile-route {
  position: absolute;
  bottom: 10px;
  right: 64px; /* sit to the left of .tile-bars */
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(10, 13, 18, 0.6);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 3px 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--fg-2);
  z-index: 4;
  user-select: none;
}
.tile-route .route-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-4);
  flex: 0 0 auto;
}
.tile-route.p2p     { color: var(--ok); border-color: rgba(54,179,126,0.45); }
.tile-route.p2p .route-dot     { background: var(--ok); box-shadow: 0 0 6px rgba(54,179,126,0.6); }
.tile-route.turn    { color: var(--accent); border-color: rgba(245,165,36,0.55); }
.tile-route.turn .route-dot    { background: var(--accent); box-shadow: 0 0 6px rgba(245,165,36,0.6); }
.tile-route.unknown { color: var(--fg-4); }
.tile-route.unknown .route-dot { background: var(--fg-4); }

/* Hide on local tile — route applies to a peer connection, not to self */
.tile.local .tile-route { display: none; }

/* On small thumbnails in spotlight rail, condense to just the dot */
.video-grid.spotlight-mode .thumb-rail .tile-route .route-label { display: none; }
.video-grid.spotlight-mode .thumb-rail .tile-route { padding: 4px; right: 36px; }

/* Phones: tighten — still readable, doesn't crowd the bars */
@media (max-width: 600px) {
  .tile-route { right: 56px; font-size: 9px; padding: 2px 5px; gap: 4px; }
  .tile-route .route-dot { width: 5px; height: 5px; }
}

/* ---------- Chat file link ---------- */
.chat-file {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 0.55rem 0.8rem;
  background: var(--bg-2);
  margin-top: 0.2rem;
}
.chat-file-icon { font-size: 1.5rem; line-height: 1; }
.chat-file-meta { min-width: 0; }
.chat-file-name {
  font-weight: 500; color: var(--fg-0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 0.92rem;
}
.chat-file-size {
  font-size: 0.7rem;
  color: var(--fg-3);
  letter-spacing: 0.04em;
}
.chat-file-dl {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  text-decoration: none;
}

.chat-attach {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--fg-2);
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.chat-attach:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Settings: keyboard shortcuts list ---------- */
.shortcuts {
  margin-top: 1.25rem;
  border-top: 1px solid var(--line-1);
  padding-top: 1rem;
}
.shortcuts summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  list-style: none;
}
.shortcuts summary::-webkit-details-marker { display: none; }
.shortcuts summary::after { content: ' ▾'; color: var(--fg-4); }
.shortcuts[open] summary::after { content: ' ▴'; }
.kbd-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1rem;
  font-size: 0.85rem;
  color: var(--fg-2);
}
kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  background: var(--bg-0);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 0.05rem 0.4rem;
  margin-right: 0.4rem;
  color: var(--fg-0);
}

/* ---------- Landing: 2-column grid (form + QR) ---------- */
.landing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  width: 100%;
  max-width: 920px;
  align-items: start;
}
@media (min-width: 820px) {
  .landing-grid { grid-template-columns: 1.1fr 0.9fr; gap: 2rem; }
}

.qr-card {
  border: 1px solid var(--line-1);
  background: linear-gradient(180deg, var(--bg-1) 0%, rgba(15,20,28,0.55) 100%);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.qr-display {
  width: 240px;
  height: 240px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  margin: 0.5rem 0 1rem;
  padding: 6px;
  box-sizing: content-box;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-display svg { width: 100%; height: 100%; display: block; }
.qr-empty {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  text-align: center;
  padding: 0 1rem;
}
.qr-url {
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--fg-3);
  word-break: break-all;
  text-align: center;
  margin: 0 0 0.5rem;
  max-width: 100%;
}
.qr-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1;
}
.qr-copy:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: transparent;
  color: var(--fg-3);
  border-color: var(--line-2);
}
.qr-copy.copied {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0d12;
}
.qr-copy svg { flex-shrink: 0; }
.qr-hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--fg-3);
  margin: 0;
}

@media (max-width: 819px) {
  .qr-display { width: 200px; height: 200px; }
}

/* ---------- Chat panel on phones / narrow screens (FIX) ----------
   Up to 900 px the chat takes the full viewport so the video grid isn't
   squeezed under a side panel, and the close affordance is enlarged
   and labelled so users can clearly leave the chat on a phone. */
@media (max-width: 899px) {
  .chat-panel {
    width: 100vw !important;
    border-left: 0;
    box-shadow: none;
  }
  .chat-head .ghost {
    width: auto;
    height: 36px;
    padding: 0 0.85rem;
    gap: 0.4rem;
    color: var(--fg-0);
    border-color: var(--accent);
  }
  .chat-head .ghost::after {
    content: 'Done';
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
  .chat-title { font-size: 0.85rem; }
}

/* ---------- Mirror toggle (FIX) ----------
   When mirror is off, remove the scaleX(-1) on the local self-view. */
.tile.local.no-mirror video { transform: none; }

/* ---------- Mobile controls bar (FIX) ----------
   8 buttons don't fit a typical phone width at 56 px each. Shrink and let it scroll.
   Add horizontal-scroll fallback so nothing is ever hidden. */
.controls {
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: nowrap;
  justify-content: flex-start;
  scroll-snap-type: x proximity;
}
.controls::-webkit-scrollbar { display: none; }

/* Centre buttons when they fit; left-anchor when they overflow */
@media (min-width: 720px) {
  .controls { justify-content: center; }
}

@media (max-width: 480px) {
  .ctrl {
    min-width: 48px;
    padding: 0.35rem 0.45rem;
    gap: 2px;
    flex-shrink: 0;
    scroll-snap-align: start;
  }
  .ctrl svg { width: 20px; height: 20px; }
  .ctrl-emoji { font-size: 1.15rem; }
  .ctrl-label { font-size: 0.58rem; letter-spacing: 0.06em; }
  .controls { gap: 0.3rem; padding: 0.55rem 0.5rem; padding-bottom: calc(0.55rem + env(safe-area-inset-bottom)); }
}

/* Very narrow viewports (≤ 360 px): even tighter, scroll if needed */
@media (max-width: 360px) {
  .ctrl { min-width: 42px; padding: 0.3rem 0.35rem; }
  .ctrl svg { width: 18px; height: 18px; }
  .ctrl-label { font-size: 0.54rem; letter-spacing: 0.04em; }
  .controls { gap: 0.2rem; padding-left: 0.3rem; padding-right: 0.3rem; }
}

/* ---------- "How it works" link styling ---------- */
.hint-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  margin-top: 0.35rem;
}
.hint-link:hover { color: var(--accent-hot); }

.settings-link {
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line-1);
  text-align: center;
}
.settings-link a {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}
.settings-link a:hover { color: var(--accent-hot); }

/* Inline <code> in dataflow page */
.df-section code, .df-card code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-0);
  border: 1px solid var(--line-1);
  border-radius: 3px;
  padding: 0.05em 0.4em;
  color: var(--accent);
}

/* ---------- File-transfer progress bar ---------- */
.fx-bar {
  margin-top: 0.4rem;
  height: 4px;
  background: var(--bg-0);
  border-radius: 2px;
  overflow: hidden;
}
.fx-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.18s ease;
}
.fx-bar.done .fx-bar-fill { background: var(--ok); }
.chat-file-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-3);
}
.chat-file-action.done { color: var(--ok); font-size: 1.1rem; }

/* ---------- Recording indicator + button ---------- */
.rec-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bad);
  margin-right: 0.25rem;
  animation: recPulse 1.2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(239, 77, 77, 0.6);
}
@keyframes recPulse {
  0%   { box-shadow: 0 0 0 0  rgba(239, 77, 77, 0.65); }
  70%  { box-shadow: 0 0 0 8px rgba(239, 77, 77, 0);    }
  100% { box-shadow: 0 0 0 0  rgba(239, 77, 77, 0);    }
}
#btn-rec.active {
  border-color: var(--bad) !important;
  color: var(--bad) !important;
}
.rec-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  margin-left: 0.25rem;
}

/* ---------- Per-tile volume slider ---------- */
.tile-vol {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 4;
  background: rgba(10, 13, 18, 0.78);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 0.4rem 0.25rem;
}
.tile:hover .tile-vol { opacity: 1; }
.tile.local .tile-vol { display: none; }
.tile-vol input[type=range] {
  /* Modern replacement for deprecated appearance: slider-vertical */
  writing-mode: vertical-lr;
  direction: rtl;
  width: 6px;
  height: 80px;
  accent-color: var(--accent);
  background: transparent;
}

/* ---------- Shout flag (elevator brake) ---------- */
.tile-flag.shout {
  background: rgba(245, 165, 36, 0.9);
  color: #0a0d12;
  border-color: var(--accent);
  font-weight: 700;
}

/* ---------- Verified by CodeB badge ---------- */
.tile-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.4rem;
  color: var(--accent);
  vertical-align: middle;
}

/* ---------- Sticky notes overlay ---------- */
.sticky-mode .tile { cursor: copy; }
.sticky-mode .tile.local { cursor: default; }
#btn-sticky.active, #btn-lock.active {
  background: var(--accent);
  color: #0a0d12;
  border-color: var(--accent);
}
.sticky-note {
  position: absolute;
  width: 140px;
  min-height: 70px;
  padding: 0.4rem;
  border: 2px solid;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--fg-0);
  z-index: 6;
  pointer-events: auto;
  box-shadow: 2px 4px 12px rgba(0,0,0,0.4);
  transform: translate(-50%, -50%) rotate(-1deg);
}
.sticky-head {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.0acing: 0.06em;
  color: var(--fg-2);
  margin-bottom: 0.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0.2rem;
}
.sticky-body {
  min-height: 30px;
  outline: none;
  word-wrap: break-word;
}
.sticky-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  color: var(--fg-1);
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Knock chat row ---------- */
.knock-row .chat-msg-head { padding: 0.4rem 0; }
.knock-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0;
}
.knock-actions .btn { padding: 0.4rem 0.85rem; font-size: 0.82rem; }

/* ---------- Doc-PiP placeholder card ---------- */
#pip-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg-1);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-lg);
  margin: 6px;
}
.pip-note {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  color: var(--fg-2);
  text-align: center;
}

/* ---------- Long Settings modal: cap height + make content scrollable ----------
   The modal grew enough that on smaller screens / shorter viewports it overflows.
   Cap the card at ~88dvh and let the body scroll while the title and the
   action bar stay pinned. */
.modal-card {
  max-height: 88vh;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-card h2,
.modal-card .modal-sub {
  flex-shrink: 0;
}
.modal-card .modal-actions {
  flex-shrink: 0;
  padding-top: 1rem;
  margin-top: auto;
  border-top: 1px solid var(--line-1);
  background: var(--bg-1);
  position: sticky;
  bottom: 0;
}
.modal-card { overflow-y: auto; -webkit-overflow-scrolling: touch; }

.modal-card::-webkit-scrollbar { width: 8px; }
.modal-card::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
.modal-card::-webkit-scrollbar-thumb:hover { background: var(--line-3); }

@media (max-width: 640px) {
  .modal-card { max-height: 92dvh; padding-bottom: 0.5rem; }
}

/* =====================================================================
   Recording-consent modal — appears on every peer when someone clicks
   Record. Allow / Deny answer is signed into the forensic sidecar.
   ===================================================================== */
.rc-modal-bg {
  position: fixed; inset: 0;
  background: rgba(10, 13, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  animation: rcFadeIn 0.18s ease-out;
}
@keyframes rcFadeIn { from { opacity: 0; } to { opacity: 1; } }

.rc-modal {
  background: var(--bg-1);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem 1.5rem;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(245,165,36,0.2);
  text-align: center;
}
.rc-modal .rc-icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(239, 77, 77, 0.12);
  color: #ef4d4d;
  margin-bottom: 1.25rem;
  animation: rcPulse 1.4s infinite ease-in-out;
}
@keyframes rcPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,77,77, 0.45); }
  50%      { box-shadow: 0 0 0 14px rgba(239,77,77, 0); }
}
.rc-modal h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  margin: 0 0 0.75rem;
  color: var(--fg-0);
}
.rc-modal p { color: var(--fg-1); line-height: 1.55; margin: 0 0 0.6rem; font-size: 0.95rem; }
.rc-modal p strong { color: var(--accent); }
.rc-modal .rc-note { color: var(--fg-3); font-size: 0.82rem; line-height: 1.5; margin: 0.5rem 0 1.5rem; }
.rc-modal .rc-actions {
  display: flex; gap: 0.7rem; justify-content: center;
  margin-top: 0.5rem;
}
.rc-modal .rc-actions .btn { min-width: 110px; }

@media (max-width: 480px) {
  .rc-modal { padding: 1.5rem 1.25rem; }
  .rc-modal h2 { font-size: 1.15rem; }
}

/* =====================================================================
   Shared whiteboard overlay — full-screen canvas with a floating tool tray.
   Synced across peers via the chat data channel.
   ===================================================================== */
.wb-overlay {
  position: fixed; inset: 0;
  z-index: 9000;
  background: rgba(10, 13, 18, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: auto;
}
.wb-overlay.hidden { display: none; }

#wb-canvas {
  position: absolute; inset: 0;
  width: 100vw; height: 100vh;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

.wb-tray {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: rgba(10, 13, 18, 0.92);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  align-items: center;
}
.wb-tray .wb-tools,
.wb-tray .wb-colors,
.wb-tray .wb-actions { display: flex; gap: 0.35rem; align-items: center; }
.wb-tray .wb-tools  { padding-right: 0.5rem; border-right: 1px solid var(--line-2); }
.wb-tray .wb-colors { padding: 0 0.5rem; border-right: 1px solid var(--line-2); }
.wb-tray .wb-actions { padding-left: 0.5rem; }

.wb-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--bg-1);
  color: var(--fg-1);
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.wb-btn:hover { border-color: var(--accent); color: var(--accent); }
.wb-btn.active { background: var(--accent); color: #0a0d12; border-color: var(--accent); }
.wb-btn.close { color: var(--bad); border-color: rgba(239,77,77,0.4); }
.wb-btn.close:hover { background: var(--bad); color: #0a0d12; border-color: var(--bad); }

.wb-color {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.wb-color.active { border-color: var(--fg-0); box-shadow: 0 0 0 2px rgba(255,255,255,0.2); }

@media (max-width: 600px) {
  .wb-tray {
    bottom: 0.75rem;
    padding: 0.4rem 0.55rem;
    gap: 0.35rem;
    flex-wrap: nowrap;
    max-width: calc(100vw - 1.5rem);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .wb-tray::-webkit-scrollbar { display: none; }
  .wb-btn { width: 30px; height: 30px; font-size: 0.85rem; }
  .wb-color { width: 18px; height: 18px; }
}

/* =====================================================================
   Breakout countdown banner — appears top-center while in a sub-room.
   ===================================================================== */
.breakout-countdown {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #0a0d12;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  z-index: 12000;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(245,165,36,0.35);
  pointer-events: none;
}

/* =====================================================================
   Breakout picker modal — lists active breakouts under the current room
   and lets a user join, switch, or create new ones.
   ===================================================================== */
.bo-modal-bg {
  position: fixed; inset: 0;
  background: rgba(10, 13, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: rcFadeIn 0.18s ease-out;
}
.bo-modal {
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
.bo-modal .bo-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 0.4rem;
}
.bo-modal h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0;
}
.bo-modal .bo-close {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--fg-1);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.bo-modal .bo-close:hover { border-color: var(--accent); color: var(--accent); }
.bo-subtitle {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--fg-3);
  margin: 0 0 1.25rem;
}
.bo-section-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 1.4rem 0 0.75rem;
}
.bo-rows {
  display: flex; flex-direction: column; gap: 0.5rem;
}
.bo-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line-1);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.bo-row.here {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.bo-row-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.bo-row-title { color: var(--fg-0); font-weight: 600; font-size: 0.95rem; }
.bo-row-title .mono { color: var(--accent); font-weight: 500; font-size: 0.85rem; margin-left: 0.3rem; }
.bo-row-meta {
  color: var(--fg-3);
  font-size: 0.82rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bo-row-action { flex-shrink: 0; }
.bo-join-btn { padding: 0.45rem 0.95rem; font-size: 0.85rem; }
.bo-here-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
}
.bo-empty {
  color: var(--fg-3);
  font-style: italic;
  padding: 1rem 0;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
}
.bo-create {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-items: end;
}
.bo-create #bo-split-btn { grid-column: span 2; margin-top: 0.4rem; }
#bo-return-btn { width: 100%; }

@media (max-width: 480px) {
  .bo-modal { padding: 1rem 1.1rem; }
  .bo-create { grid-template-columns: 1fr; }
}

/* =====================================================================
   Breakout strip — replaces the old tiny countdown pill. Sits at the top
   centre while inside a breakout room and offers obvious controls:
   Switch group · Return to main · Returns in M:SS.
   ===================================================================== */
.breakout-strip {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-1);
  border: 1px solid var(--accent);
  box-shadow: 0 8px 28px rgba(245,165,36,0.25), 0 0 0 1px rgba(245,165,36,0.08);
  padding: 0.4rem 0.55rem;
  border-radius: 999px;
  z-index: 12000;
  font-family: var(--font-body);
  font-size: 0.86rem;
}
.breakout-strip .bs-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--fg-0);
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.breakout-strip .bs-btn:hover { border-color: var(--accent); color: var(--accent); }
.breakout-strip .bs-btn.bs-switch {
  background: var(--accent);
  color: #0a0d12;
  border-color: var(--accent);
  font-weight: 600;
}
.breakout-strip .bs-btn.bs-switch:hover { background: var(--accent-hot); border-color: var(--accent-hot); color: #0a0d12; }
.breakout-strip .bs-time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--fg-2);
  padding: 0 0.55rem 0 0.3rem;
  white-space: nowrap;
}
.breakout-strip .bs-time .mono { color: var(--accent); }

@media (max-width: 640px) {
  .breakout-strip {
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.35rem 0.5rem;
    gap: 0.4rem;
    border-radius: var(--radius-lg);
    left: 0.5rem; right: 0.5rem;
    transform: none;
    width: calc(100% - 1rem);
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
  .breakout-strip .bs-btn { padding: 0.35rem 0.65rem; font-size: 0.78rem; }
  .breakout-strip .bs-time { width: 100%; text-align: center; padding: 0; }
}

/* ---------- Hide tile stats overlays unless enabled ---------- */
body:not(.show-stats) .tile-bars,
body:not(.show-stats) .tile-route { display: none !important; }
/* Status nav link: small green "live" dot to flag it as the live operational page. */
.site-nav-link[href="status.html"]::before,.btn-quiet[href="status.html"]::before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--ok,#4caf50);margin-right:0.45em;vertical-align:middle;box-shadow:0 0 6px rgba(76,175,80,0.7);animation:status-pulse 2.2s ease-in-out infinite}
@keyframes status-pulse{0%{opacity:0.55}50%{opacity:1}100%{opacity:0.55}}
