:root {
  color-scheme: dark;
  --bg: #101214;
  --panel: #1a1d21;
  --border: #2a2e33;
  --text: #e8e9ea;
  --muted: #9aa0a6;
  --accent: #4f8cff;
  --accent-hover: #6ba0ff;
  --danger: #e5484d;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-username {
  color: var(--muted);
  font-size: 0.9rem;
  margin-right: 4px;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 20px;
}

h1 { font-size: 1.6rem; margin-bottom: 4px; }
p.subtitle { color: var(--muted); margin-top: 0; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
}

.card h2 { margin-top: 0; font-size: 1.1rem; }

table { width: 100%; min-width: 820px; border-collapse: collapse; margin-top: 12px; font-size: 0.9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.row-actions { display: flex; flex-wrap: nowrap; gap: 10px; align-items: center; white-space: nowrap; }
.row-actions input[type="number"] { width: 56px; flex-shrink: 0; }
.row-action-group { display: flex; gap: 6px; align-items: center; padding-right: 10px; border-right: 1px solid var(--border); }
.row-action-group select { min-width: 130px; padding: 6px 8px; }
#users-table select { min-width: 110px; }

.plan-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.plan-badge-free { background: rgba(154, 160, 166, 0.15); color: var(--muted); }
.plan-badge-granted { background: rgba(79, 140, 255, 0.15); color: var(--accent); }
.plan-badge-paid { background: rgba(52, 199, 123, 0.15); color: #34c77b; }

.admin-page { max-width: 1080px; }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 20px 0 0; }
.admin-tab {
  background: transparent; border: none; color: var(--muted); cursor: pointer;
  padding: 10px 16px; font-size: 0.9rem; font-weight: 600; border-radius: 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; }

.plan-banner { padding: 12px 16px; border-radius: var(--radius); font-size: 0.9rem; margin-bottom: 20px; }
.plan-banner a { color: inherit; font-weight: 600; }
.plan-banner-free { background: rgba(229, 72, 77, 0.12); border: 1px solid rgba(229, 72, 77, 0.3); color: #f0a3a5; }
.plan-banner-active { background: rgba(52, 199, 123, 0.12); border: 1px solid rgba(52, 199, 123, 0.3); color: #6fe0a3; }

.my-meetings-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.my-meetings-header h1, .my-meetings-header .subtitle { margin: 0; }
.my-meetings-header .primary { flex-shrink: 0; white-space: nowrap; }

.pricing-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pricing-header h1, .pricing-header .subtitle { margin: 0; }
.pricing-header .secondary { flex-shrink: 0; white-space: nowrap; }

.recording-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.recording-row:last-child { border-bottom: none; }

.recording-row .actions {
  flex-wrap: wrap;
  margin-top: 0;
}

.meeting-edit-form {
  flex: 1;
  padding: 8px 0;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 14px 0 6px;
}

label.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

label.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

input[type="text"], input[type="datetime-local"], select {
  width: 100%;
  padding: 10px 12px;
  background: #0d0f11;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
}

input[type="file"] {
  width: 100%;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
}

.primary { background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-hover); }
.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.danger { background: var(--danger); color: #fff; }

button:disabled { opacity: 0.5; cursor: not-allowed; }

.actions { margin-top: 18px; display: flex; gap: 10px; }

.result { margin-top: 20px; }
.result .field { margin-bottom: 12px; }
.result .field label { margin-bottom: 4px; }

.copy-row {
  display: flex;
  gap: 8px;
}
.copy-row input {
  flex: 1;
  background: #0d0f11;
}

.hint { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

.divider {
  margin: 28px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  position: relative;
}
.divider span {
  position: relative;
  top: -11px;
  background: var(--bg);
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

a { color: var(--accent); }

.error-text { color: var(--danger); font-size: 0.85rem; margin-top: 8px; display: none; }

.preview-video {
  width: 100%;
  max-height: 320px;
  background: #000;
  border-radius: 8px;
  object-fit: cover;
}

.meeting-view {
  display: none;
  flex-direction: column;
  height: 100vh;
  background: var(--bg);
}

.layout-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.meeting-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  margin-right: 8px;
  padding: 0 12px 0 0;
  border-right: 1px solid var(--border);
}

.layout-bar button {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.layout-bar select {
  width: auto;
  padding: 6px 10px;
  font-size: 0.85rem;
  background: #0d0f11;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
}

#page-indicator {
  color: var(--muted);
  font-size: 0.8rem;
}

.meeting-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.video-grid {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  padding: 8px;
  overflow-y: auto;
}

.reopen-presentation-btn {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.participant-panel {
  display: none;
  flex-direction: column;
  flex: 0 0 280px;
  width: 280px;
  background: var(--panel);
  border-left: 1px solid var(--border);
}

.participant-panel.open {
  display: flex;
}

.participant-panel-header {
  padding: 12px 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.participant-panel ul {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  overflow-y: auto;
}

.participant-panel li {
  padding: 8px 16px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-action-btn {
  padding: 2px 8px;
  font-size: 0.75rem;
  margin-left: 6px;
}

.chat-panel {
  display: none;
  flex-direction: column;
  flex: 0 0 280px;
  width: 280px;
  background: var(--panel);
  border-left: 1px solid var(--border);
}

.chat-panel.open {
  display: flex;
}

.chat-panel ul {
  list-style: none;
  margin: 0;
  padding: 8px 12px;
  overflow-y: auto;
  flex: 1;
}

.chat-panel li {
  padding: 6px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.chat-panel li .chat-from {
  font-weight: 600;
  margin-right: 4px;
}

.chat-panel li.private {
  color: var(--accent);
}

.chat-panel form {
  padding: 10px;
  border-top: 1px solid var(--border);
}

.bg-panel-body {
  padding: 16px;
}

.bg-panel-body label {
  margin-top: 0;
}

.chat-panel select {
  width: 100%;
  margin-bottom: 8px;
  background: #0d0f11;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px;
}

.chat-input-row {
  display: flex;
  gap: 6px;
}

.chat-input-row input {
  flex: 1;
  background: #0d0f11;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 10px;
}

.chat-file-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.chat-file-row #chat-attach-btn,
.chat-file-row #chat-file-clear-btn {
  padding: 4px 8px;
  font-size: 0.85rem;
}

.chat-file-row #chat-file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
}

.chat-file-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
}

.video-grid.layout-speaker {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  /* the filmstrip below scrolls on its own now, so the outer container
     shouldn't also try to scroll (that would let the spotlight scroll away) */
  overflow-y: hidden;
}

.video-grid.layout-speaker .tile-spotlight,
.video-grid.layout-speaker .spotlight-grid {
  width: 100%;
  max-width: 1100px;
  height: 65vh;
  flex-shrink: 0;
}

.video-grid.layout-speaker .tile-spotlight video {
  object-fit: contain;
}

.video-grid.layout-presentation {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  overflow-y: hidden;
}

.presentation-row {
  display: flex;
  gap: 10px;
  height: 65vh;
  flex-shrink: 0;
}

.presentation-row .tile-spotlight,
.presentation-row .spotlight-grid {
  width: 38%;
  max-width: 420px;
  height: 100%;
  flex-shrink: 0;
}

/* --- Multi-speaker spotlight grid (host/co-host configurable) --------- */

.spotlight-grid {
  display: flex;
  gap: 8px;
}

.spotlight-grid.orientation-column {
  flex-direction: column;
}

.spotlight-grid .spotlight-tile {
  flex: 1;
  min-width: 0;
  min-height: 0;
  width: auto;
  height: auto;
  aspect-ratio: auto;
}

.spotlight-grid .spotlight-tile video {
  object-fit: contain;
}

/* --- Drag-to-resize handles -------------------------------------------- */

.resize-handle-row {
  flex-shrink: 0;
  width: 100%;
  height: 10px;
  margin: -5px 0;
  cursor: row-resize;
  position: relative;
  z-index: 3;
}

.resize-handle-col {
  flex-shrink: 0;
  align-self: stretch;
  width: 10px;
  margin: 0 -5px;
  cursor: col-resize;
  position: relative;
  z-index: 3;
}

.resize-handle-row::after,
.resize-handle-col::after {
  content: '';
  position: absolute;
  background: var(--border);
  border-radius: 2px;
  transition: background-color 0.15s ease;
}

.resize-handle-row::after {
  left: 50%;
  top: 50%;
  width: 40px;
  height: 4px;
  transform: translate(-50%, -50%);
}

.resize-handle-col::after {
  left: 50%;
  top: 50%;
  width: 4px;
  height: 40px;
  transform: translate(-50%, -50%);
}

.resize-handle-row:hover::after,
.resize-handle-col:hover::after,
body.resizing-row .resize-handle-row::after,
body.resizing-col .resize-handle-col::after {
  background: var(--accent);
}

body.resizing-row,
body.resizing-col {
  user-select: none;
}

.file-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #1c1f23;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.file-pane-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.file-pane-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-pane-from {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.file-pane-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: #fff;
}

.file-pane-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.file-pane-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- Waiting room ---------------------------------------------------- */

.waiting-room-notice {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #0d0f11;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.spinner {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Modal (speaker assignment, meeting edit, etc.) ------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  margin: 0;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.meeting-info-rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.meeting-info-row .copy-row {
  margin-top: 4px;
}

.meeting-info-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.meeting-info-row > span:not(.meeting-info-label) {
  font-size: 0.95rem;
}

/* --- Participant panel: roles, sections, badges ----------------------- */

.participant-section-header {
  padding: 10px 16px 4px !important;
  font-size: 0.7rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.role-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-left: 6px;
}

.role-badge.host { background: var(--accent); color: #fff; }
.role-badge.cohost { background: #3d4552; color: var(--text); }
.role-badge.speaker { background: #b8862b; color: #fff; }
.role-badge.hand-raised { background: #f0b429; color: #201404; display: inline-flex; align-items: center; padding: 2px 5px; }

.recording-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(220, 53, 69, 0.15);
  color: #ff6b6b;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.recording-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b30;
  animation: recording-pulse 1.5s ease-in-out infinite;
}

@keyframes recording-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.current-room-label {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #3d4552;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
}

.breakout-room-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.breakout-room-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.breakout-room-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}

.breakout-room-invite-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.breakout-room-invite-row select {
  flex: 1;
  margin-bottom: 0;
}

.participant-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  min-width: 0;
}

.rename-input-row {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 1;
}

.rename-input-row input {
  padding: 3px 6px;
  font-size: 0.85rem;
}

/* --- Speaker (narasumber) lower-third: static two-level banner --------- */

/* color combinations (chosen per-speaker via the speaker modal) — each
   just sets the same set of variables so .speaker-ticker-name/-role and
   the modal's swatch previews stay in sync automatically */
.theme-blue {
  --ticker-top-bg: linear-gradient(135deg, #6ba0ff, #3568d4);
  --ticker-top-fg: #ffffff;
  --ticker-bottom-bg: #0d1420;
  --ticker-bottom-fg: #bcd2f7;
  --ticker-accent: #8fb8ff;
}

.theme-gold {
  --ticker-top-bg: linear-gradient(135deg, #f0c05e, #b8862b);
  --ticker-top-fg: #201404;
  --ticker-bottom-bg: #1a1204;
  --ticker-bottom-fg: #f0d28a;
  --ticker-accent: #f0d28a;
}

.theme-emerald {
  --ticker-top-bg: linear-gradient(135deg, #4ee2ab, #059669);
  --ticker-top-fg: #04140d;
  --ticker-bottom-bg: #04140d;
  --ticker-bottom-fg: #9df3d1;
  --ticker-accent: #6ee7b7;
}

.theme-crimson {
  --ticker-top-bg: linear-gradient(135deg, #fb8484, #b91c1c);
  --ticker-top-fg: #ffffff;
  --ticker-bottom-bg: #1c0a0a;
  --ticker-bottom-fg: #fca5a5;
  --ticker-accent: #fca5a5;
}

.theme-violet {
  --ticker-top-bg: linear-gradient(135deg, #b7a1fc, #6d28d9);
  --ticker-top-fg: #ffffff;
  --ticker-bottom-bg: #150a29;
  --ticker-bottom-fg: #ddd6fe;
  --ticker-accent: #ddd6fe;
}

.theme-slate {
  --ticker-top-bg: linear-gradient(135deg, #7c8ba3, #334155);
  --ticker-top-fg: #ffffff;
  --ticker-bottom-bg: #0f172a;
  --ticker-bottom-fg: #cbd5e1;
  --ticker-accent: #cbd5e1;
}

.speaker-ticker {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  box-shadow: 0 -3px 14px rgba(0, 0, 0, 0.4);
}

.speaker-ticker-name {
  padding: 8px 18px 5px 16px;
  background: var(--ticker-top-bg);
  color: var(--ticker-top-fg);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 4px solid var(--ticker-accent);
}

.speaker-ticker-role {
  padding: 5px 18px 8px 20px;
  background: var(--ticker-bottom-bg);
  color: var(--ticker-bottom-fg);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 4px solid var(--ticker-accent);
}

/* --- Speaker color-theme picker (in the speaker-assignment modal) ------ */

.theme-swatch-row {
  display: flex;
  gap: 10px;
  margin: 4px 0 4px;
}

.theme-swatch {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0.75;
  transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.theme-swatch:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.theme-swatch::before,
.theme-swatch::after {
  content: '';
  flex: 1;
  display: block;
}

.theme-swatch::before { background: var(--ticker-top-bg); }
.theme-swatch::after { background: var(--ticker-bottom-bg); }

.theme-swatch.selected {
  opacity: 1;
  border-color: #fff;
}

/* --- Toast notifications (e.g. "X raised their hand") ------------------ */

.toast-container {
  position: absolute;
  top: 64px;
  right: 16px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #1c2333;
  border: 1px solid #2c3650;
  color: #e8ecf7;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

/* --- Raise hand ---------------------------------------------------------*/

.control-btn.is-active {
  background: var(--accent);
  color: #fff;
}

.tile-hand-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f0b429;
  color: #201404;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  animation: hand-bounce 1.2s ease-in-out infinite;
}

@keyframes hand-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* --- Reactions ------------------------------------------------------------ */

.reaction-picker-wrap {
  position: relative;
}

.reaction-picker {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  background: #1c2333;
  border: 1px solid #2c3650;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  z-index: 15;
}

.reaction-option {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}

.reaction-option:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.15);
}

.floating-reaction {
  position: absolute;
  left: 50%;
  bottom: 40px;
  font-size: 1.8rem;
  transform: translateX(-50%);
  animation: reaction-float 1.8s ease-out forwards;
  pointer-events: none;
}

@keyframes reaction-float {
  0% { opacity: 0; transform: translateX(-50%) translateY(0) scale(0.6); }
  15% { opacity: 1; transform: translateX(-50%) translateY(-8px) scale(1.1); }
  /* the tile clips overflow, so fully fade out (opacity 0) before the
     translation gets anywhere near the tile's top edge */
  100% { opacity: 0; transform: translateX(-50%) translateY(-36px) scale(1); }
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* --- Host/co-host announcement running-text bar ------------------------ */

.announcement-bar {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: #12203a;
  border-bottom: 2px solid var(--accent);
  color: #eaf2ff;
  font-size: 1.1rem;
  font-weight: 600;
}

.announcement-bar-icon {
  flex-shrink: 0;
  display: flex;
  color: var(--accent-hover);
}

.announcement-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.announcement-track {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: ticker-scroll 26s linear infinite;
}

.announcement-item {
  white-space: nowrap;
}

.announcement-sep {
  display: inline-flex;
  align-items: center;
  vertical-align: -3px;
  margin: 0 16px;
  color: var(--accent-hover);
}

.announcement-manage-btn {
  flex-shrink: 0;
  color: #d8e6ff;
  border-color: rgba(216, 230, 255, 0.3);
}

textarea {
  width: 100%;
  padding: 10px 12px;
  background: #0d0f11;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}

@media (max-width: 700px) {
  .presentation-row {
    flex-direction: column;
    height: auto;
  }

  .presentation-row .tile-spotlight,
  .presentation-row .spotlight-grid {
    width: 100%;
    max-width: none;
    height: 30vh;
  }

  .file-pane {
    height: 35vh;
  }

  .resize-handle-col {
    display: none;
  }
}

.filmstrip {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
  /* fill the remaining space below the spotlight and scroll independently;
     min-height: 0 is required for a flex child to actually shrink and scroll
     instead of growing to fit all its wrapped content */
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.tile {
  position: relative;
  width: 220px;
  aspect-ratio: 1 / 1;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  flex: 0 0 auto;
}

.tile.tile-screen {
  width: 100%;
  max-width: 960px;
  height: 540px;
}

.tile.tile-screen video {
  object-fit: contain;
}

.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile audio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.tile-name {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
}

.tile-mic-off {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: var(--danger);
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.tile-camoff {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: #1c1f23;
  color: var(--muted);
  font-size: 0.9rem;
}

.tile-pin-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  opacity: 0.6;
}

.tile-pin-btn:hover {
  opacity: 1;
}

.controls-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  background: var(--panel);
  border-top: 1px solid var(--border);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

/* --- Icon system --------------------------------------------------- */

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-btn .btn-icon {
  display: inline-flex;
  flex-shrink: 0;
}

.icon-btn .btn-icon svg {
  display: block;
}

/* toggleable icon buttons hold both an "on" and "off" glyph and flip
   which is visible via a state class, so JS only needs to toggle a class
   and a text label instead of re-rendering markup */
.icon-btn .btn-icon .icon-off {
  display: none;
}

.icon-btn.is-off .btn-icon .icon-on {
  display: none;
}

.icon-btn.is-off .btn-icon .icon-off {
  display: inline-flex;
}

/* Circular primary meeting controls (mic, camera, share, background,
   record, leave) — icon centered above a small caption, matching the
   layout convention of modern meeting apps. */
.control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 10px 6px;
  min-width: 64px;
  background: transparent;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text);
}

.control-btn .btn-icon {
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #2a2e33;
  transition: background-color 0.15s ease;
}

.control-btn:hover .btn-icon {
  background: #34383e;
}

.control-btn.is-off .btn-icon,
.control-btn.is-active .btn-icon {
  background: var(--accent);
  color: #fff;
}

.control-btn.control-danger .btn-icon {
  background: var(--danger);
  color: #fff;
}

.control-btn.control-danger:hover .btn-icon {
  background: #ff5a5f;
}

/* the leave button reuses a phone glyph rotated into the classic
   "hang up" orientation used by most meeting apps */
#leave-btn .btn-icon svg {
  transform: rotate(135deg);
}

/* Pill-style icon+label buttons (layout bar, navbar, lobby, forms) sit
   on top of the existing .primary/.secondary/.danger color rules — icons
   just add a glyph before the label inside the same button. */
.layout-bar .icon-btn,
.navbar-actions .icon-btn,
.chat-input-row .icon-btn {
  padding: 6px 14px 6px 10px;
}

.icon-only-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.icon-only-btn svg {
  display: block;
}

.icon-only-btn-lg {
  width: 40px;
  height: 40px;
  padding: 8px;
}

.tile-pin-btn.icon-only-btn {
  width: 26px;
  height: 26px;
  padding: 4px;
}

@media (max-width: 700px) {
  .navbar {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .navbar-actions {
    gap: 6px;
  }

  .navbar-username {
    display: none;
  }

  .tile {
    width: calc(50% - 4px);
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .tile.tile-screen {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .layout-bar,
  .controls-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 8px;
  }

  .layout-bar button,
  .controls-bar button {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .participant-panel,
  .chat-panel {
    position: fixed;
    width: 100%;
    top: auto;
    bottom: 0;
    height: 60vh;
    z-index: 5;
  }

  .video-grid.layout-speaker .tile-spotlight {
    height: 40vh;
  }
}

/* Landing page */
.landing { max-width: 1080px; margin: 0 auto; padding: 48px 24px 80px; }

.landing-hero { text-align: center; padding: 24px 0 48px; }
.landing-hero h1 { font-size: 2.4rem; margin: 0 0 16px; line-height: 1.2; }
.landing-tagline { color: var(--muted); font-size: 1.1rem; max-width: 640px; margin: 0 auto 28px; line-height: 1.6; }
.landing-cta { justify-content: center; }

.landing-section { margin-top: 64px; }
.landing-section-title { font-size: 1.5rem; text-align: center; margin-bottom: 8px; }
.landing-section-subtitle { color: var(--muted); text-align: center; margin-top: 0; margin-bottom: 24px; }

.carousel { position: relative; max-width: 640px; margin: 32px auto 0; }
.carousel-track { position: relative; min-height: 220px; }
.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}
.carousel-slide.active { opacity: 1; visibility: visible; }
.carousel-icon { color: var(--accent); margin-bottom: 12px; display: flex; justify-content: center; }
.carousel-slide h3 { margin: 0 0 10px; font-size: 1.2rem; }
.carousel-slide p { color: var(--muted); margin: 0; line-height: 1.6; }
.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.carousel-dot {
  width: 8px; height: 8px; border-radius: 50%; padding: 0;
  background: var(--border); border: none; cursor: pointer;
}
.carousel-dot.active { background: var(--accent); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 28px; }
.feature-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.feature-icon { color: var(--accent); margin-bottom: 10px; }
.feature-card h3 { margin: 0 0 8px; font-size: 1rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }

.download-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-top: 12px; }
.download-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.download-card h3 { margin: 0 0 6px; }
.download-card .hint { margin: 0 0 16px; }

.landing-footer { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 80px; }

@media (max-width: 700px) {
  .landing-hero h1 { font-size: 1.8rem; }
  .carousel-track { min-height: 260px; }
}
