:root {
  --bg: #050507;
  --bg-accent: radial-gradient(circle at 20% -10%, rgba(99, 102, 241, 0.35), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(236, 72, 153, 0.28), transparent 45%),
    radial-gradient(circle at -10% 80%, rgba(14, 165, 233, 0.22), transparent 55%),
    #050507;
  --panel: rgba(20, 22, 33, 0.94);
  --panel-soft: rgba(33, 35, 46, 0.78);
  --primary: #6366f1;
  --primary-soft: rgba(99, 102, 241, 0.18);
  --text: #f5f5f7;
  --muted: #9ca3af;
  --accent: #14b8a6;
  --danger: #f87171;
  --success: #34d399;
  --stage-zoom: 1;
  --control-offset: 8.5rem;
  font-family: 'Urbanist', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100%;
  background: var(--bg-accent);
  color: var(--text);
  font-family: 'Urbanist', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

#class-app {
  min-height: 100%;
  min-height: 100dvh;
  height: 100%;
  width: 100%;
  position: relative;
}

.no-scroll {
  overflow: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.card {
  background: var(--panel);
  border-radius: 28px;
  padding: 2.25rem;
  box-shadow: 0 28px 60px rgba(9, 9, 15, 0.45);
  backdrop-filter: blur(16px);
}

.dashboard-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.class-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}

.class-card {
  background: var(--panel-soft);
  border-radius: 22px;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
}

.class-card .actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

h1,
h2,
h3 {
  font-weight: 600;
  margin: 0 0 1rem;
}

p {
  margin: 0;
}

.tag {
  font-size: 0.9rem;
  color: var(--muted);
}

label {
  font-size: 0.85rem;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 16, 24, 0.6);
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.45);
}

button {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.85rem 1.75rem;
  font: inherit;
  font-weight: 600;
  color: inherit;
  background: rgba(255, 255, 255, 0.06);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

button.primary {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: white;
  box-shadow: 0 18px 32px rgba(99, 102, 241, 0.38);
}

button.primary:disabled,
button.primary.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

button.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

button.secondary {
  background: rgba(99, 102, 241, 0.18);
  color: var(--primary);
  border-radius: 14px;
  padding: 0.65rem 1.4rem;
}

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.5rem;
  border-radius: 16px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  font-weight: 600;
  transition: background 0.2s ease;
}

.secondary:hover {
  background: rgba(99, 102, 241, 0.28);
  text-decoration: none;
}

button.danger {
  background: linear-gradient(135deg, #f87171, #ef4444);
  color: #fff;
  box-shadow: 0 16px 28px rgba(248, 113, 113, 0.35);
}

button.danger.ghost {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.45);
  box-shadow: none;
}

.pill-btn {
  border-radius: 999px;
  padding-inline: 1.35rem;
  font-weight: 500;
}

.pill-btn[aria-pressed='true'],
.ghost.pill-btn.is-active {
  background: rgba(37, 99, 235, 0.18);
  color: #dbeafe;
}

.control-btn {
  position: relative;
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 22px;
  background: rgba(17, 18, 28, 0.72);
  color: rgba(248, 250, 252, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 44px rgba(5, 6, 15, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.control-btn .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.control-btn .icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.control-badges {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  pointer-events: none;
}

.control-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.92);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.32);
}

.control-badge.subtle {
  background: rgba(14, 165, 233, 0.88);
}

.control-btn .label {
  display: none;
}

.control-btn:hover:not(:disabled) {
  transform: translateY(-4px);
  box-shadow: 0 30px 52px rgba(5, 6, 15, 0.55);
  background: rgba(24, 26, 40, 0.82);
  border-color: rgba(148, 163, 184, 0.24);
}

.control-btn:not(.danger)[aria-pressed='true'],
.control-btn.is-active:not(.danger) {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-color: rgba(59, 130, 246, 0.6);
  color: #fff;
  box-shadow: 0 32px 64px rgba(37, 99, 235, 0.38);
}

.control-btn:not(.danger)[aria-pressed='true'] .icon svg,
.control-btn.is-active:not(.danger) .icon svg {
  color: inherit;
  fill: currentColor;
}

.control-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.control-btn.is-disabled {
  opacity: 0.45;
}

.control-btn.is-disabled:hover {
  transform: none;
  box-shadow: 0 24px 44px rgba(5, 6, 15, 0.45);
}

.control-btn.is-off {
  background: rgba(10, 11, 20, 0.68);
  color: rgba(226, 232, 240, 0.68);
  border-color: rgba(148, 163, 184, 0.16);
}

.control-btn.danger {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fff;
  box-shadow: 0 32px 48px rgba(248, 113, 113, 0.45);
}

.control-btn.danger:hover:not(:disabled) {
  box-shadow: 0 38px 62px rgba(248, 113, 113, 0.5);
}

.control-btn[data-tooltip]::after,
.menu-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translate(-50%, 6px);
  background: rgba(8, 9, 16, 0.92);
  color: #f9fafb;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
  box-shadow: 0 18px 36px rgba(4, 5, 12, 0.5);
  z-index: 80;
}

.control-btn[data-tooltip]:hover::after,
.control-btn[data-tooltip]:focus-visible::after,
.menu-btn[data-tooltip]:hover::after,
.menu-btn[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.control-btn[aria-pressed='false'] {
  opacity: 0.78;
}

.control-btn[aria-pressed='true'] {
  opacity: 1;
}

.control-btn:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.45);
  outline-offset: 3px;
}

.stage-zoom {
  display: none;
}
button.small {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 14px;
  min-width: auto;
}

button.primary.small {
  box-shadow: 0 18px 32px rgba(99, 102, 241, 0.32);
}

.participant-actions .ghost.small,
.hand-controls .ghost.small,
.panel-card button.small {
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
}

.participant-actions .ghost.small.danger {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.45);
}

.participant-actions .ghost.small.danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

.error-box {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  margin-bottom: 1rem;
}

#join-view,
#lobby-view,
#host-lobby,
#live-view,
#ended-view {
  padding: 3.5rem 1.5rem 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.join-layout {
  width: min(960px, 100%);
  display: grid;
  justify-content: center;
  position: relative;
}

.join-layout::before {
  content: '';
  position: absolute;
  inset: 8% 5% auto;
  height: 280px;
  border-radius: 160px;
  background: radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.35), transparent 65%);
  filter: blur(32px);
  z-index: -1;
}

.join-card {
  background: var(--panel);
  border-radius: 36px;
  padding: 2.5rem 2.75rem;
  box-shadow: 0 30px 70px rgba(9, 10, 18, 0.5);
  display: grid;
  gap: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
  backdrop-filter: blur(20px);
}

.join-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.meeting-actions {
  display: flex;
  gap: 0.75rem;
}

.meeting-code-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meeting-code-card .label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meeting-code-card strong {
  font-size: 1.35rem;
  letter-spacing: 0.12em;
}

.preview-video-wrapper {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 26px;
  overflow: hidden;
  background: rgba(15, 15, 23, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.preview-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: rgba(12, 12, 20, 0.8);
}

.field-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.text-input {
  margin-bottom: 0.25rem;
}

.preview-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

@media (max-width: 900px) {
  #join-view,
  #lobby-view,
  #host-lobby,
  #live-view,
  #ended-view {
    padding: 3rem 1.25rem 4rem;
  }
  .join-card {
    padding: 2.25rem 2.25rem;
    border-radius: 32px;
  }
}

@media (max-width: 720px) {
  #join-view,
  #lobby-view,
  #host-lobby,
  #live-view,
  #ended-view {
    padding: 2.5rem 1.1rem 3.5rem;
  }
  .join-card {
    padding: 2rem 1.6rem;
    border-radius: 30px;
    gap: 1.4rem;
  }
  .join-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  .meeting-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.65rem;
  }
  .meeting-actions button {
    flex: 1 1 auto;
  }
  .meeting-code-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }
  .preview-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .preview-controls button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  #join-view,
  #lobby-view,
  #host-lobby,
  #live-view,
  #ended-view {
    padding: 2.25rem 0.9rem 3rem;
  }
  .join-card {
    padding: 1.75rem 1.35rem;
    border-radius: 26px;
    gap: 1.25rem;
  }
  .preview-video-wrapper {
    border-radius: 22px;
  }
  .meeting-code-card {
    border-radius: 20px;
  }
  .meeting-actions button {
    flex: 1 1 calc(50% - 0.4rem);
    min-width: 140px;
  }
}

@media (max-width: 420px) {
  #join-view,
  #lobby-view,
  #host-lobby,
  #live-view,
  #ended-view {
    padding: 2rem 0.75rem 2.75rem;
  }
  .join-card {
    padding: 1.55rem 1.1rem;
  }
  .meeting-actions button {
    flex-basis: 100%;
  }
}

body.is-student .preview-video-wrapper.viewer-mode::before {
  content: 'You will watch the host. No camera or microphone needed.';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

body.is-student .preview-video-wrapper.viewer-mode video {
  display: none;
}

body.is-student .preview-controls.viewer-only {
  justify-content: flex-end;
}

body.is-student .preview-controls.viewer-only .hidden {
  display: none !important;
}

body.is-student #join-btn {
  flex: 1;
}

.status-card {
  background: var(--panel);
  padding: 2.5rem;
  border-radius: 32px;
  text-align: center;
  box-shadow: 0 28px 64px rgba(9, 10, 18, 0.45);
  display: grid;
  gap: 1rem;
  max-width: 420px;
}

.status-indicator {
  width: 56px;
  height: 8px;
  border-radius: 999px;
  margin: 0 auto;
}

.status-indicator.waiting {
  background: rgba(99, 102, 241, 0.6);
}

.status-indicator.ended {
  background: rgba(148, 163, 184, 0.35);
}

.status-indicator.reconnect {
  background: rgba(14, 165, 233, 0.45);
}

.host-lobby-card {
  width: min(780px, 100%);
  padding: 2.25rem;
  border-radius: 32px;
  background: var(--panel);
  box-shadow: 0 28px 70px rgba(10, 12, 20, 0.5);
  display: grid;
  gap: 1.5rem;
}

.host-lobby-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.lobby-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.lobby-list .empty {
  text-align: center;
  color: var(--muted);
  padding: 1rem 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.lobby-entry {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.lobby-entry .actions {
  display: flex;
  gap: 0.5rem;
}

.meeting-shell {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 0;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--control-offset));
  border-radius: 0;
  box-shadow: none;
  border: none;
  background: none;
}

.meeting-shell.layout-portrait .stage {
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

.meeting-shell.layout-portrait .stage-main {
  min-height: 320px;
}

.meeting-shell.layout-portrait .meeting-controls .control-bar {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

.meeting-shell.layout-portrait .control-dock {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.meeting-shell.layout-portrait .meeting-controls {
  width: min(420px, calc(100% - 2.5rem));
}

#live-view {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

.meeting-header {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translate(-50%, 0);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.75rem;
  background: rgba(12, 14, 25, 0.55);
  border-radius: 16px;
  box-shadow: 0 24px 52px rgba(5, 6, 12, 0.45);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  z-index: 40;
  width: auto;
}

.meeting-shell.viewer-autohide .meeting-header {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.meeting-shell.viewer-autohide.controls-hidden .meeting-header {
  opacity: 0;
  transform: translate(-50%, -18px);
  pointer-events: none;
}

.meeting-stats {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.88);
}

.stat-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}

.stat-chip.active {
  color: #bfdbfe;
}

.stat-icon {
  font-size: 1rem;
}

.meeting-stats .stat-value {
  min-width: 1.75rem;
  text-align: center;
}

.meeting-heading {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-align: left;
}

.meeting-context {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.72);
}

.meeting-heading h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.meeting-code {
  font-size: 0.88rem;
  color: rgba(226, 232, 240, 0.8);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-btn {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 16px;
  background: rgba(17, 20, 35, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: rgba(248, 250, 252, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-btn .icon {
  display: inline-flex;
}


.header-btn .icon svg {
  width: 16px;
  height: 16px;
}

.header-btn.copied {
  box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.18), 0 18px 36px rgba(99, 102, 241, 0.35);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #f87171;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.32);
  font-weight: 600;
}

.status-chip .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.18);
}

.mono {
  font-family: 'Space Mono', 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
}

.meeting-body {
  display: contents;
}

.stage {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  background: radial-gradient(circle at 50% 35%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(14, 165, 233, 0.16), transparent 60%),
    rgba(6, 7, 14, 0.9);
}

.stage-main {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(9, 10, 18, 0.92);
  border-radius: 32px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.stage-live-watermark {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0px;
  background: rgba(9, 10, 18, 0.55);
  backdrop-filter: blur(22px);
  border: 0px solid rgba(148, 163, 184, 0.2);
  color: rgba(236, 240, 255, 0.92);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  z-index: 25;
}

.stage-live-watermark img {
  opacity: 0.72;
}

.stage-main video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(5, 6, 12, 0.9);
  transform: scale(var(--stage-zoom));
  transform-origin: center;
  transition: transform 0.24s ease;
}

.stage-main canvas {
  transform: scale(var(--stage-zoom));
  transform-origin: center;
  transition: transform 0.24s ease;
}

.stage-overlay {
  position: absolute;
  inset: 0;
  
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 1.75rem;
  pointer-events: none;
}

.stage-overlay span {
  font-weight: 600;
  font-size: 1.05rem;
}

@media (max-width: 900px) {
  .stage {
    padding: 0 0 6rem;
    align-items: stretch;
  }
  .stage-main {
    border-radius: 28px;
    min-height: clamp(320px, 52vh, 540px);
  }
}

@media (max-width: 720px) {
  .stage {
    padding: 0 0 6.5rem;
  }
  .stage-main {
    border-radius: 24px;
  }
  .stage-overlay {
    padding: 1.25rem;
  }
  .stage-overlay span {
    font-size: 0.95rem;
  }
}

@media (max-width: 560px) {
  .stage {
    padding: 0 0 7rem;
  }
  .stage-main {
    min-height: clamp(260px, 58vh, 520px);
    border-radius: 20px;
  }
  .stage-overlay {
    padding: 1.1rem;
  }
}

.stage-pip {
  position: absolute;
  bottom: 3.5rem;
  right: 3.5rem;
  width: 240px;
  border-radius: 24px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 24px 46px rgba(8, 9, 18, 0.5);
  background: rgba(12, 12, 20, 0.88);
  z-index: 30;
}

.stage-pip video {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.stage-pip span {
  position: absolute;
  bottom: 0.5rem;
  left: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
}
.speaker-banner {
  position: absolute;
  left: 2rem;
  bottom: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(12, 13, 22, 0.88);
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  box-shadow: 0 20px 40px rgba(3, 4, 10, 0.4);
  pointer-events: none;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.speaker-banner::before {
  content: '🎤';
  font-size: 1.1rem;
}

/* VVD Text Overlay */
.vvd-text-overlay {
  position: absolute;
  z-index: 25;
  max-width: 400px;
  padding: 1rem 1.5rem;
  background: rgba(9, 10, 18, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  color: rgba(236, 240, 255, 0.95);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  word-wrap: break-word;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  transition: all 0.3s ease;
}

/* Recording Indicator */
.recording-indicator {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(220, 38, 38, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 12px;
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
  pointer-events: none;
  animation: recording-glow 2s infinite;
}

.recording-indicator .recording-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  animation: recording-blink 1s infinite;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
}

.recording-indicator .recording-text {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  font-weight: 700;
}

@keyframes recording-blink {
  0%, 50% {
    opacity: 1;
    transform: scale(1);
  }
  51%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
}

@keyframes recording-glow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
  }
  50% {
    box-shadow: 0 3px 12px rgba(220, 38, 38, 0.5);
  }
}

.vvd-text-overlay.top-left {
  top: 1.5rem;
  left: 1.5rem;
}

.vvd-text-overlay.top-right {
  top: 1.5rem;
  right: 1.5rem;
}

.vvd-text-overlay.bottom-left {
  bottom: 1.5rem;
  left: 1.5rem;
}

.vvd-text-overlay.bottom-right {
  bottom: 1.5rem;
  right: 1.5rem;
}

.vvd-text-overlay.center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.vvd-text-overlay.hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.vvd-text-overlay.center.hidden {
  transform: translate(-50%, -50%) translateY(10px);
}

/* VVD Overlay Controls */
.vvd-overlay-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.vvd-overlay-controls textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 80px;
}

.vvd-overlay-controls textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}

.vvd-overlay-controls textarea::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.vvd-overlay-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.vvd-overlay-preview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vvd-overlay-preview label {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(148, 163, 184, 0.8);
}

.vvd-overlay-preview select {
  padding: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.9rem;
}

.vvd-overlay-preview select:focus {
  outline: none;
  border-color: var(--accent);
}

.speaker-banner[data-kind='screen']::before {
  content: '🖥';
}

.speaker-banner.hidden {
  opacity: 0;
  transform: translateY(12px);
}

.participant-strip {
  display: none;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

body.is-student .participant-strip {
  display: none !important;
}

.participant-strip::-webkit-scrollbar {
  height: 6px;
}

.participant-strip::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}

.participant-tile {
  min-width: 160px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.participant-tile video {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 14px;
}

.participant-tile span {
  font-size: 0.85rem;
  color: var(--muted);
}

.participant-tile.audio-only {
  align-items: center;
  justify-items: center;
  padding: 1rem;
}

.participant-tile.audio-only video {
  display: none;
}

.participant-tile.audio-only span {
  color: #fff;
  background: rgba(99, 102, 241, 0.2);
  border-radius: 14px;
  padding: 0.6rem 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.meeting-sidebar {
  display: grid;
  gap: 1.25rem;
}

.meeting-sidebar section {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  padding: 1.35rem;
  display: grid;
  gap: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.lobby-card header,
.chat-panel header,
.participants-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
}

#live-lobby-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

#live-lobby-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 0.85rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

#live-lobby-list .actions {
  display: flex;
  gap: 0.45rem;
}

#live-lobby-list .identity,
.lobby-entry .identity {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.avatar-bubble {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.18);
  display: grid;
  place-items: center;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.identity strong {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.92);
}

.identity div {
  display: grid;
  gap: 0.15rem;
}

.identity .hint {
  font-size: 0.75rem;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 0.45rem;
}


.chat-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.chat-messages {
  max-height: 320px;
  overflow-y: auto;
  display: grid;
  gap: 0.6rem;
  padding-right: 0.25rem;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}

.chat-item {
  background:transparent;
  border-radius: 18px;
  padding: 0.6rem 0.75rem;
  display: flex;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.chat-item.system {
  background: transparent;
  border: none;
  padding: 0.2rem 0;
  justify-content: center;
  gap: 0.35rem;
  color: rgba(226, 232, 240, 0.75);
  font-size: 0.85rem;
}

.chat-item.system::before {
  content: '•';
  color: rgba(226, 232, 240, 0.45);
  font-size: 0.9rem;
}

.chat-system-text {
  font-weight: 500;
}

.chat-system-time {
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.7);
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.18);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}
/* 
.chat-content {
  flex: 1;
  display: grid;
  gap: 0.35rem;
} */

.chat-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.chat-author {
  font-weight: 600;
  font-size: 0.9rem;
}

.chat-time {
  font-size: 0.72rem;
  color: var(--muted);
}

.chat-text {
  margin: 0;
  color: rgba(241, 245, 249, 0.88);
  font-size: 0.92rem;
}

.chat-form input {
  border-radius: 16px;
  background: rgba(12, 12, 20, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.22);
  padding: 0.85rem 1rem;
}

.participants {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
  font-size: 0.95rem;
}

.participant {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem 0.85rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: rgba(255, 255, 255, 0.8);
}

.participant.auto-joined {
  border-color: rgba(96, 165, 250, 0.32);
  background: rgba(37, 99, 235, 0.12);
}

.participant.host {
  padding: 0.5rem 0;
  border: none;
  background: transparent;
}

.participant .identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.participant-tag.auto {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.16);
  color: rgba(219, 234, 254, 0.92);
}

.participant .role {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.participant-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.media-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  font-size: 0.82rem;
  font-weight: 600;
}

.media-chip.on {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.media-chip.off {
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
}

.hand-raised {
  font-size: 1.15rem;
}

.hand-allowed {
  font-size: 1rem;
  color: #fde68a;
}

.participant-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.meeting-controls {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1.25rem);
  left: 0%;
  transform: translateX(-50%);
  width:100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: 80;
}

.meeting-controls .control-bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  width: auto;
  padding: 0.75rem 1.85rem;
  border-radius: 28px;
  background: rgba(12, 14, 25, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 36px 72px rgba(5, 6, 15, 0.55);
  backdrop-filter: blur(14px);
}

.meeting-shell .meeting-controls {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.meeting-shell.controls-hidden .meeting-controls {
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
}

.meeting-shell.controls-visible .meeting-controls {
  opacity: 1;
  transform: translateY(0);
}

.floating-controls {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 6.5rem);
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  pointer-events: none;
  z-index: 85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.meeting-shell.controls-hidden .floating-controls {
  opacity: 0;
  transform: translateY(18px);
}

.meeting-shell.controls-visible .floating-controls {
  opacity: 1;
  transform: translateY(0);
}

.floating-btn {
  pointer-events: auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.05rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(13, 16, 29, 0.84);
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 18px 42px rgba(13, 16, 29, 0.42);
}

.floating-btn .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.82);
  color: #cbd5f5;
}

.floating-btn .icon svg {
  width: 16px;
  height: 16px;
}

.floating-btn .label {
  pointer-events: none;
}

.floating-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.38);
}

.floating-btn.is-active,
.floating-btn:focus-visible {
  outline: none;
  border-color: rgba(96, 165, 250, 0.8);
  background: rgba(59, 130, 246, 0.22);
  color: #dbeafe;
  box-shadow: 0 22px 44px rgba(59, 130, 246, 0.26);
}

.floating-btn.is-active .icon {
  background: rgba(96, 165, 250, 0.3);
  color: #dbeafe;
}

.floating-badge {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #f43f5e;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(244, 63, 94, 0.42);
}

.meeting-shell.layout-portrait .floating-controls {
  top: calc(env(safe-area-inset-top, 0px) + 1.25rem);
  bottom: auto;
  right: 1rem;
  flex-direction: row;
  gap: 0.75rem;
}

@media (max-width: 860px) {
  .floating-controls {
    right: 1rem;
  }
  .floating-btn {
    font-size: 0.78rem;
    padding: 0.55rem 0.95rem;
  }
  .floating-btn .icon {
    width: 26px;
    height: 26px;
  }
}

@media (max-width: 540px) {
  .meeting-shell.layout-portrait .floating-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
  }
}

body.is-host .student-only {
  display: none !important;
}

body.is-student .host-only {
  display: none !important;
}

.control-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}


.control-more-menu {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--control-offset));
  left: 50%;
  transform: translate(-50%, 12px) scale(0.96);
  background: rgba(12, 14, 25, 0.92);
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  backdrop-filter: blur(28px);
  box-shadow: 0 36px 76px rgba(4, 5, 12, 0.6);
  padding: 1.2rem 1.6rem;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  max-width: min(520px, 90vw);
}

.control-more-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.camera-menu {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -6px) scale(0.98);
  min-width: 180px;
  padding: 0.5rem;
  display: grid;
  gap: 0.35rem;
  border-radius: 18px;
  background: rgba(15, 16, 24, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.26);
  box-shadow: 0 28px 52px rgba(5, 6, 15, 0.55);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  z-index: 120;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.camera-menu[data-position='bottom'] {
  transform: translate(-50%, 6px) scale(0.98);
}

.camera-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.camera-menu.open[data-position='top'] {
  transform: translate(-50%, -6px) scale(1);
}

.camera-menu.open[data-position='bottom'] {
  transform: translate(-50%, 0) scale(1);
}

.camera-menu button {
  width: 100%;
  border-radius: 14px;
  padding: 0.65rem 0.9rem;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  font-weight: 500;
}

.camera-menu button:hover,
.camera-menu button:focus {
  background: rgba(99, 102, 241, 0.16);
  outline: none;
}

.camera-menu button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: transparent;
}

.control-btn.menu-open,
.ghost.menu-open,
button.menu-open {
  background: rgba(99, 102, 241, 0.18);
  color: var(--text);
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.28);
}

.menu-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.menu-inline {
  display: flex;
  gap: 0.75rem;
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.menu-section {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(17, 19, 30, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 18px 32px rgba(6, 7, 15, 0.3);
}

.menu-section-title {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.78);
}

.tone-toggle {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.tone-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tone-toggle-track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  transition: background 0.2s ease;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
}

.tone-toggle-thumb {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.24);
  transform: translateX(0);
  transition: transform 0.2s ease;
}

.tone-toggle-input:checked + .tone-toggle-track {
  background: rgba(99, 102, 241, 0.92);
}

.tone-toggle-input:checked + .tone-toggle-track .tone-toggle-thumb {
  transform: translateX(20px);
}

.tone-toggle-label {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(248, 250, 252, 0.92);
}

.menu-btn {
  position: relative;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 18px;
  background: rgba(17, 19, 30, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: rgba(248, 250, 252, 0.92);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-start;
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 36px rgba(6, 7, 15, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.menu-btn .icon {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-btn .icon svg {
  width: 18px;
  height: 18px;
}

.menu-btn .text {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.menu-btn:hover {
  transform: translateY(-2px);
  background: rgba(24, 26, 38, 0.88);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 28px 44px rgba(6, 7, 15, 0.48);
}

.menu-btn:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.4);
  outline-offset: 3px;
}

.menu-btn.danger {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.16), rgba(248, 113, 113, 0.32));
  border-color: rgba(248, 113, 113, 0.38);
  color: #fecaca;
}

.menu-btn.danger:hover {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.35), rgba(248, 113, 113, 0.45));
  color: #fff;
}

.live-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%) scale(0.94);
  padding: 1.4rem 2.4rem;
  background: rgba(10, 12, 22, 0.86);
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 36px 64px rgba(4, 5, 12, 0.55);
  backdrop-filter: blur(26px);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.live-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.live-toast .toast-text {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.live-toast .toast-action {
  padding: 0.4rem 0.9rem;
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.22);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: rgba(228, 232, 255, 0.96);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.live-toast .toast-action:hover {
  background: rgba(99, 102, 241, 0.32);
  border-color: rgba(99, 102, 241, 0.52);
  transform: translateY(-1px);
}

.modal-layer {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 10, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 120;
}

.modal-layer.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: rgba(12, 14, 25, 0.92);
  border-radius: 28px;
  padding: 2.2rem 2.6rem 2.1rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 48px 90px rgba(5, 6, 15, 0.55);
  backdrop-filter: blur(30px);
  width: min(420px, 90vw);
  display: grid;
  gap: 1.8rem;
}

.modal-body h3 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.modal-body p {
  color: rgba(226, 232, 240, 0.78);
  font-size: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.85rem;
}

.modal-actions .ghost {
  padding-inline: 1.3rem;
}

.modal-actions .primary {
  min-width: 120px;
}
utility-panel {
  position: absolute;
  top: 2.4rem;
  right: 2.6rem;
  width: 360px;
  max-height: calc(100% - 4.8rem);
  display: none;
  flex-direction: column;
  gap: 1rem;
  background: rgba(23, 25, 37, 0.96);
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 32px 70px rgba(5, 6, 11, 0.55);
  backdrop-filter: blur(26px);
  overflow: hidden;
  z-index: 40;
}

.utility-panel.visible {
  display: flex;
}

.utility-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem 0;
}

.utility-header h3 {
  margin: 0;
}

.utility-header p {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.utility-tabs {
  display: flex;
  gap: 0.75rem;
  padding: 0 1.5rem;
}

.utility-tab {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.utility-tab.active {
  color: var(--text);
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.35);
}

.utility-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.5rem 1.5rem;
  display: grid;
  gap: 1rem;
}

.panel-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  padding: 1rem 1.25rem;
  display: grid;
  gap: 0.75rem;
}

.panel-card label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-card input,
.panel-card textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(12, 13, 20, 0.78);
  padding: 0.65rem 0.85rem;
  color: var(--text);
  font-family: inherit;
}

.panel-card textarea {
  resize: vertical;
  min-height: 110px;
}

#polls-wrapper,
#poll-options-list,
#poll-history-list,
#qna-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.poll-option {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  padding: 0.75rem 1rem;
  display: grid;
  gap: 0.55rem;
}

.poll-option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.poll-option-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.poll-option-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.poll-option-bar div {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.65), rgba(59, 130, 246, 0.85));
}

.poll-history-item {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  padding: 0.65rem 0.9rem;
  display: grid;
  gap: 0.4rem;
}

.poll-history-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.qna-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  padding: 0.75rem 0.95rem;
  display: grid;
  gap: 0.4rem;
}

.qna-question {
  margin: 0;
  font-weight: 600;
}

.qna-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.qna-answer {
  background: rgba(99, 102, 241, 0.14);
  border-radius: 14px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.whiteboard-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
}

.whiteboard-toolbar input[type='color'] {
  width: 40px;
  height: 40px;
  border: none;
  padding: 0;
  background: transparent;
  border-radius: 12px;
}

.whiteboard-toolbar input[type='range'] {
  width: 120px;
}

.whiteboard-info {
  font-size: 0.78rem;
  color: var(--muted);
}

.recording-status {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.recording-status.active {
  color: #fca5a5;
}

.recording-status.active::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f87171;
  box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.7);
  animation: recording-pulse 1.5s infinite;
}

.recording-status.paused {
  color: #bfdbfe;
}

.recording-status.paused::before {
  content: '⏸';
  font-size: 0.7rem;
  color: #93c5fd;
}

.recording-status.uploading {
  color: #a5b4fc;
}

.recording-status.uploading::before {
  content: '⬆';
  font-size: 0.8rem;
  color: #818cf8;
  animation: upload-pulse 1.2s infinite;
}

.recording-status.uploaded {
  color: #86efac;
}

.recording-status.uploaded::before {
  content: '✓';
  font-size: 0.9rem;
  color: #34d399;
}

.recording-meta {
  margin-top: 0.35rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.82rem;
}

.recording-timer {
  font-variant-numeric: tabular-nums;
}

@keyframes recording-pulse {
  0% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(248, 113, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0); }
}

@keyframes upload-pulse {
  0%, 100% { opacity: 0.5; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

.recording-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.recording-actions .ghost.small.is-active,
.recording-actions .ghost.small[aria-pressed='true'] {
  background: rgba(37, 99, 235, 0.18);
  color: #dbeafe;
  border-color: rgba(59, 130, 246, 0.4);
}

.recording-link {
  margin-top: 0.35rem;
  font-size: 0.82rem;
}

/* Header meters */
.meeting-meters {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.25rem;
}

.meter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

#meter-recording .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f87171;
  box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.7);
  animation: recording-pulse 1.5s infinite;
}

.raised-hands {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.16);
  display: grid;
  gap: 0.55rem;
}

.raised-hands h4 {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

#raised-hands-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

#raised-hands-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.78);
}

.hand-controls {
  display: flex;
  gap: 0.4rem;
}

@media (max-width: 960px) {
  .utility-panel.visible {
    position: fixed;
    inset: auto 1.5rem 1.5rem 1.5rem;
    width: auto;
    max-height: 70vh;
  }
}

.side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 86vw);
  height: 100vh;
  background: rgba(15, 16, 24, 0.95);
  backdrop-filter: blur(16px);
  box-shadow: -12px 0 48px rgba(5, 6, 15, 0.6);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 60;
  overflow: hidden;
  overflow-y: auto;
}

.side-drawer.open {
  animation: drawer-slide 0.25s ease forwards;
}

@keyframes drawer-slide {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.chat-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 1.25rem;
  z-index: 120;
  pointer-events: none;
}

.chat-overlay.open {
  pointer-events: auto;
}

.chat-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 18, 0.65);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chat-overlay.open .chat-overlay-backdrop {
  opacity: 1;
}

.chat-overlay-panel {
  position: relative;
  width: min(420px, 100%);
  max-height: min(82vh, 520px);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: rgba(15, 18, 33, 0.95);
  border-radius: 24px;
  padding: 1.5rem 1.5rem calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
  box-shadow: 0 32px 80px rgba(7, 9, 18, 0.68);
  border: 1px solid rgba(99, 102, 241, 0.22);
  backdrop-filter: blur(18px);
  transform: translateY(24px);
  opacity: 0;
  transition: transform 0.24s ease, opacity 0.24s ease;
  z-index: 1;
}

.chat-overlay.open .chat-overlay-panel {
  transform: translateY(0);
  opacity: 1;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 11, 0.65);
  backdrop-filter: blur(2px);
  z-index: 50;
}

.chat-messages {
  max-height: none;
}

.chat-form {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.chat-form input {
  flex: 1 1 auto;
  min-width: 0;
}

.chat-send {
  flex: 0 0 auto;
  padding: 0.65rem 1.35rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 600;
  border: none;
  box-shadow: 0 14px 28px rgba(99, 102, 241, 0.28);
}

.chat-send span {
  pointer-events: none;
}

.chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

#chat-drawer .chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

.side-drawer .participants {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.side-drawer .raised-hands {
  margin-top: auto;
}

@media (max-width: 960px) {
  :root {
    --control-offset: 7.5rem;
  }
  .meeting-header {
    top: 1.25rem;
    width: min(720px, calc(100% - 2.5rem));
  }
  .control-btn {
    width: 54px;
    height: 54px;
  }
  .stage-pip {
    bottom: 2.2rem;
    right: 2.2rem;
    width: 210px;
  }
}

@media (max-width: 720px) {
  :root {
    --control-offset: 8.75rem;
  }
  #live-view {
    min-height: 100dvh;
  }
  .meeting-header {
    top: 1rem;
    width: calc(100% - 2rem);
    padding: 0.7rem 1.3rem;
  }
  .meeting-heading h2 {
    font-size: 1.22rem;
  }
  .control-btn {
    width: 50px;
    height: 50px;
  }
  .meeting-controls {
    width: calc(100% - 1.75rem);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
  }
  .control-more-menu {
    width: calc(100% - 2.2rem);
  }
  .stage-pip {
    bottom: 1.6rem;
    right: 1.6rem;
    width: 180px;
  }
  .side-drawer {
    height: 100dvh;
  }
  .chat-overlay {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }
  .chat-overlay-panel {
    width: 100%;
    max-height: calc(100vh - 4.5rem);
    border-radius: 24px 24px 0 0;
    margin: 0;
  }
}

@media (max-width: 560px) {
  :root {
    --control-offset: 9.5rem;
  }
  .meeting-header {
    width: calc(100% - 1.6rem);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .meeting-heading h2 {
    font-size: 1.12rem;
  }
  .control-btn {
    width: 46px;
    height: 46px;
  }
  .control-dock {
    gap: 0.65rem;
  }
  .meeting-controls .control-bar {
    padding: 0.65rem 1.2rem;
  }
  .control-more-menu {
    width: calc(100% - 1.8rem);
  }
  .stage-pip {
    position: static;
    width: 160px;
    margin: 1rem auto 0;
  }
  .live-toast {
    width: calc(100% - 2.4rem);
  }
  .chat-overlay-panel {
    max-height: calc(100vh - 3.25rem);
    border-radius: 22px 22px 0 0;
  }
}

@media (max-width: 420px) {
  :root {
    --control-offset: 10rem;
  }
  .status-card {
    padding: 1.8rem 1.4rem;
    border-radius: 24px;
    gap: 0.75rem;
  }
  .meeting-header {
    width: calc(100% - 1.2rem);
    padding: 0.6rem 0.95rem;
  }
  .meeting-heading h2 {
    font-size: 1.04rem;
  }
  .control-btn {
    width: 44px;
    height: 44px;
  }
  .control-dock {
    gap: 0.5rem;
  }
  .meeting-controls .control-bar {
    padding: 0.6rem 0.85rem;
    gap: 0.6rem;
  }
  .control-more-menu {
    width: calc(100% - 1.2rem);
  }
  .live-toast {
    width: calc(100% - 1.5rem);
    padding: 1rem 1.4rem;
    font-size: 0.95rem;
  }
}

/* Dashboard -------------------------------------------------------------- */

body.dashboard-body {
  --bg: #f3f4ff;
  --panel: #ffffff;
  --panel-soft: #f5f7ff;
  --text: #0f172a;
  --muted: #6b7280;
  --primary: #4f46e5;
  --primary-soft: rgba(79, 70, 229, 0.12);
  --accent: #2563eb;
  background: linear-gradient(180deg, rgba(248, 249, 255, 1), rgba(242, 244, 255, 0.92));
  color: var(--text);
  min-height: 100dvh;
}

.dashboard-app {
  display: grid;
  grid-template-columns: clamp(240px, 22vw, 280px) 1fr;
  min-height: 100dvh;
  position: relative;
}

.dashboard-sidebar {
  background: #ffffff;
  border-right: 1px solid rgba(15, 23, 42, 0.06);
  padding: 2.5rem 1.8rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

.dashboard-sidebar::-webkit-scrollbar {
  width: 6px;
}

.dashboard-sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
}

.sidebar-header {
  display: grid;
  gap: 0.4rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.2rem;
  color: #312e81;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.15);
}

.brand-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.sidebar-nav {
  display: grid;
  gap: 0.4rem;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  font-weight: 600;
  width: 100%;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.nav-item .nav-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: rgba(79, 70, 229, 0.08);
  align-items: center;
  justify-content: center;
  color: #4338ca;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.18);
  color: #1e1b4b;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  background: rgba(79, 70, 229, 0.16);
  color: #312e81;
}

.sidebar-section {
  display: grid;
  gap: 0.6rem;
}

.sidebar-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: #1f2937;
}

.sidebar-count {
  font-size: 0.8rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.12);
  color: #4338ca;
  font-weight: 600;
}

.sidebar-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  max-height: 220px;
  overflow-y: auto;
}

.sidebar-list li {
  background: rgba(15, 23, 42, 0.04);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  display: grid;
  gap: 0.1rem;
}

.sidebar-list li .participant-name {
  font-weight: 600;
  color: #1f2937;
}

.sidebar-list li .participant-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.sidebar-logout {
  margin-top: auto;
}

.logout-btn {
  width: 100%;
  justify-content: center;
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.dashboard-main {
  padding: 2.5rem clamp(2rem, 6vw, 4rem);
  display: grid;
  gap: 2.5rem;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.welcome-kicker {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(79, 70, 229, 0.64);
}

#welcome-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
}

.quick-action {
  border-radius: 14px;
  padding: 0.75rem 1.35rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 16px 30px rgba(99, 102, 241, 0.28);
}

.quick-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.21);
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 600;
}

.view {
  display: none;
  flex-direction: column;
  gap: 2.5rem;
}

.view.active {
  display: flex;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.4rem;
}

.stat-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 1.6rem;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 0.55rem;
}

.stat-label {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.stat-value {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #1f2937;
  letter-spacing: -0.03em;
}

.stat-foot {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(79, 70, 229, 0.7);
}

.panel {
  background: #ffffff;
  border-radius: 24px;
  padding: 1.8rem 2rem;
  box-shadow: 0 24px 52px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 1.6rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.panel-sub {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.ghost-link {
  background: none;
  color: #4f46e5;
  padding: 0;
  border: none;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.panel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.panel-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.panel-item h3 {
  margin: 0;
  font-size: 1rem;
}

.panel-item .panel-meta {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.panel-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Quick Fullscreen Button */
.quick-fullscreen-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 40px;
  height: 40px;
  background: rgba(20, 22, 33, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.quick-fullscreen-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  transform: scale(1.05);
}

.quick-fullscreen-btn:active {
  transform: scale(0.95);
}

.quick-fullscreen-btn svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.quick-fullscreen-btn.in-fullscreen svg {
  color: var(--accent);
}

.quick-fullscreen-btn.in-fullscreen {
  border-color: rgba(20, 184, 166, 0.4);
}

/* Uploading Videos Section */
.uploading-video-item {
  padding: 1rem;
  border-left: 3px solid var(--primary);
  background: rgba(99, 102, 241, 0.05);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.uploading-video-item:hover {
  background: rgba(99, 102, 241, 0.1);
  transform: translateX(4px);
}

.uploading-video-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.uploading-video-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.uploading-video-header strong {
  font-size: 1rem;
  color: var(--text);
}

.upload-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.upload-status-badge.queued {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.upload-status-badge.uploading {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  animation: pulse-badge 1.5s infinite;
}

.upload-status-badge.completed {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.upload-status-badge.failed {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
}

.uploading-video-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.uploading-video-host {
  font-size: 0.82rem;
  color: var(--muted);
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

#uploading-videos-container {
  min-height: 80px;
}

#uploading-videos-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.create-panel .form-grid {
  display: grid;
  gap: 1rem;
}

.form-field {
  display: grid;
  gap: 0.35rem;
}

.form-field span {
  font-weight: 600;
  color: #1f2937;
}

.form-field input {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  padding: 0.75rem 1rem;
  font: inherit;
  color: var(--text);
}

.form-field input:disabled {
  background: rgba(148, 163, 184, 0.12);
  color: rgba(17, 24, 39, 0.5);
}

.form-field input::placeholder {
  color: rgba(107, 114, 128, 0.6);
}

.form-field input:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-stack {
  display: grid;
  gap: 1.2rem;
  max-width: 420px;
}

.field-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.form-actions .ghost {
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.1);
  color: var(--muted);
}

.developer-card {
  display: grid;
  gap: 1.2rem;
  padding: 1.4rem 1.6rem;
  border-radius: 18px;
  background: rgba(79, 70, 229, 0.06);
  border: 1px solid rgba(79, 70, 229, 0.18);
  max-width: 500px;
}

.developer-label {
  margin: 0;
  font-weight: 600;
  color: #312e81;
}

.developer-key {
  display: inline-block;
  font-family: 'Space Mono', 'SFMono-Regular', Menlo, monospace;
  font-size: 0.95rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(79, 70, 229, 0.22);
  overflow-wrap: anywhere;
}

.developer-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.developer-actions .ghost {
  border-color: rgba(79, 70, 229, 0.25);
  color: #4338ca;
  background: rgba(79, 70, 229, 0.08);
}

.developer-actions .primary {
  box-shadow: 0 16px 30px rgba(79, 70, 229, 0.28);
}

.developer-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.developer-docs {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 14px;
  border: 1px solid rgba(79, 70, 229, 0.14);
}

.developer-docs h3 {
  margin: 0;
  font-size: 1rem;
  color: #312e81;
}

.developer-docs ol {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.developer-docs pre {
  margin: 0;
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  overflow-x: auto;
}

.developer-docs code {
  font-family: 'Space Mono', 'SFMono-Regular', Menlo, monospace;
}

.class-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.class-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.class-item {
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.03);
  padding: 1rem 1.2rem;
  display: grid;
  gap: 0.4rem;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.class-item:hover,
.class-item.active {
  border-color: rgba(79, 70, 229, 0.34);
  box-shadow: 0 18px 32px rgba(79, 70, 229, 0.12);
  background: rgba(79, 70, 229, 0.08);
}

.class-item h3 {
  margin: 0;
  font-size: 1.05rem;
}

.class-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.class-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  width: fit-content;
}

.class-status.live {
  background: rgba(236, 72, 153, 0.16);
  color: #be185d;
}

.class-status.ended {
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
}

.class-status.scheduled {
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
}

.class-detail {
  background: rgba(248, 249, 255, 0.7);
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 1.5rem;
  min-height: 320px;
  display: grid;
}

.detail-placeholder {
  text-align: center;
  color: var(--muted);
  align-self: center;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.detail-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.detail-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.detail-section {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.detail-section h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
}

.detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
}

.detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.detail-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.dashboard-modal-layer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 120;
}

.dashboard-modal-layer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.dashboard-modal {
  width: min(520px, calc(100% - 2.8rem));
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 36px 72px rgba(15, 23, 42, 0.18);
  padding: 2rem;
  display: grid;
  gap: 1.5rem;
}

.dashboard-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.modal-kicker {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(79, 70, 229, 0.68);
}

.dashboard-modal-head h2 {
  margin: 0.35rem 0 0;
  font-size: 1.45rem;
}

.modal-close {
  background: rgba(15, 23, 42, 0.06);
  border-radius: 12px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #1e1b4b;
}

.modal-form {
  display: grid;
  gap: 1.25rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.modal-actions .ghost {
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.1);
  color: var(--muted);
}

.create-result {
  display: grid;
  gap: 0.3rem;
  border-radius: 16px;
  padding: 1rem 1.2rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  margin: 1rem 0;
}

.create-label {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #047857;
}

.create-link {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.create-link button {
  text-decoration: underline;
  padding: 0;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 0.8rem;
}

.page-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(79, 70, 229, 0.1);
  color: #312e81;
  border: none;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-status {
  font-size: 0.85rem;
  color: var(--muted);
}

.dashboard-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #f8fafc;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 999;
}

.dashboard-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1100px) {
  .dashboard-app {
    grid-template-columns: 1fr;
  }
  .dashboard-sidebar {
    position: static;
    height: auto;
    overflow: visible;
    z-index: 20;
    border-right: none;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 1.6rem 1.4rem 1.4rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.4rem;
    align-items: flex-start;
  }
  .sidebar-header {
    flex: 1 1 100%;
  }
  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .sidebar-section {
    flex: 1 1 100%;
  }
  .sidebar-logout {
    flex: 1 1 180px;
  }
  .dashboard-main {
    padding: 1.8rem clamp(1.4rem, 5vw, 2.4rem) 3rem;
  }
  .class-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  .panel {
    padding: 1.5rem;
  }
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .detail-actions {
    width: 100%;
  }
  .detail-actions button {
    flex: 1 1 auto;
  }
  .side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  background: rgba(15, 16, 24, 0.95);
  backdrop-filter: blur(16px);
  box-shadow: -12px 0 48px rgba(5, 6, 15, 0.6);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 60;
  overflow: hidden;
  overflow-y: auto;
}
}


.direct-call-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 26, 0.72);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.direct-call-overlay.visible {
  opacity: 1;
}

.direct-call-overlay.hidden {
  pointer-events: none;
}

.direct-call-card {
  width: min(640px, 90vw);
  background: rgba(15, 17, 26, 0.92);
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: #f8fafc;
}

.direct-call-card.error {
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 8px 40px rgba(239, 68, 68, 0.16);
}

.direct-call-card.error .direct-call-status {
  color: #fca5a5;
}

.direct-call-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.direct-call-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.direct-call-status {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.78);
}

.direct-call-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.direct-call-body video {
  width: 100%;
  border-radius: 16px;
  background: #0f172a;
}

.direct-call-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.direct-call-actions button {
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.direct-call-actions .danger {
  background: #ef4444;
  color: #fff;
}

.direct-call-actions .primary {
  background: #2563eb;
  color: #fff;
}

.direct-call-actions .ghost {
  background: rgba(148, 163, 184, 0.12);
  color: #f8fafc;
}

@media (max-width: 720px) {
  .direct-call-card {
    width: 95vw;
  }
  .direct-call-body {
    grid-template-columns: 1fr;
  }
}


.developer-key-card,
.developer-create-card,
.developer-class-card {
  display: grid;
  gap: 0.9rem;
  padding: 1.2rem 1.4rem;
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.16);
  background: rgba(59, 130, 246, 0.08);
  margin-bottom: 1.2rem;
}

.developer-key-card header,
.developer-class-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.developer-key-value {
  font-family: 'Space Mono', 'SFMono-Regular', Menlo, monospace;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  overflow-wrap: anywhere;
}

.developer-muted {
  color: rgba(30, 64, 175, 0.7);
  font-size: 0.85rem;
}

.developer-create-card form {
  display: grid;
  gap: 0.8rem;
}

.developer-create-card input {
  width: 100%;
}

.developer-class-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.developer-class-card li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.55rem;
  border-radius: 12px;
  background: rgba(30, 64, 175, 0.08);
}

.developer-class-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.developer-class-body {
  display: grid;
  gap: 1rem;
}

.developer-class-auto h4 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  color: #1e3a8a;
}

.developer-form-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.developer-purchase-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: #1e3a8a;
}

.developer-message {
  margin-bottom: 1.2rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.developer-empty {
  padding: 1rem;
  border-radius: 14px;
  background: rgba(30, 64, 175, 0.06);
  color: rgba(30, 41, 59, 0.72);
  margin-bottom: 1.2rem;
}

.developer-empty.error {
  background: rgba(248, 113, 113, 0.12);
  color: #b91c1c;
}

.developer-class-meta {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: rgba(30, 64, 175, 0.7);
}

.auto-join-panel {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  display: grid;
  gap: 0.6rem;
}

.auto-join-panel h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #1e3a8a;
}

.auto-join-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.auto-join-panel li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.12);
  color: rgba(30, 41, 59, 0.85);
}

.auto-join-empty {
  font-size: 0.85rem;
  color: rgba(30, 41, 59, 0.6);
}

.auto-join-status {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auto-join-status.joined {
  color: #047857;
}

.auto-join-status.pending {
  color: #b91c1c;
}

footer.meeting-header-new.bottom {
  position: absolute;
  bottom: 1.5rem;     
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.75rem;
  background: rgba(12, 14, 25, 0.55);
  border-radius: 16px;
  box-shadow: 0 24px 52px rgba(5, 6, 12, 0.45);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  z-index: 40;
  width: auto;




  border-radius: 28px;
  background: rgba(12, 14, 25, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 36px 72px rgba(5, 6, 15, 0.55);
  backdrop-filter: blur(14px);
}
.meeting-controls {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 1.25rem);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    display: flex
;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 80;
}
@media (max-width: 900px) {
    .meeting-controls .control-bar {
        gap: 0.6rem;
        width: 100%;
        left: 0%;
        display: flex
;
        position: absolute;
        margin-bottom: 85px;
    }
}
footer.meeting-controls
 {
    left: 0;
}

header.meeting-header {
    display: none;
}

/* Mobile Landscape Mode Optimizations */
@media (max-width: 900px) and (orientation: landscape) {
  #live-view {
    min-height: 100vh;
  }

  .meeting-shell {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 5rem);
  }

  .stage {
    padding: 0;
    min-height: 100vh;
  }

  .stage-main {
    min-height: 100vh;
    border-radius: 0;
    border: none;
  }

  .stage-main video {
    object-fit: contain;
    height: 100vh;
  }

  .meeting-controls {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
  }

  .meeting-controls .control-bar {
    padding: 0.5rem 1rem;
    gap: 0.5rem;
  }

  .control-btn {
    width: 42px;
    height: 42px;
  }

  .meeting-header {
    display: none !important;
  }

  .quick-fullscreen-btn {
    top: 0.5rem;
    left: 0.5rem;
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 720px) and (orientation: landscape) {
  :root {
    --control-offset: 5.5rem;
  }

  .stage-main {
    min-height: 100vh;
  }

  .control-btn {
    width: 38px;
    height: 38px;
  }

  .control-dock {
    gap: 0.4rem;
  }

  .meeting-controls .control-bar {
    padding: 0.4rem 0.8rem;
    gap: 0.4rem;
  }
}

@media (max-width: 560px) and (orientation: landscape) {
  .control-btn {
    width: 36px;
    height: 36px;
  }

  .control-btn .icon svg {
    width: 18px;
    height: 18px;
  }

  .meeting-controls .control-bar {
    padding: 0.35rem 0.65rem;
  }
}

/* Mobile Menu Button (VVD Logo) - Always visible as watermark */
.mobile-menu-btn {
  display: flex;
  position: fixed;
  top: env(safe-area-inset-top, 1rem);
  right: 1rem;
  z-index: 9999;
  width: 120px;
  height: 120px;
  border-radius: 12px;
  background: transparent;
  border: none;
  cursor: default;
  transition: all 0.2s ease;
  padding: 0;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-menu-btn img {
  width: 120px;
  height: 120px;
  display: block;
  object-fit: contain;
  opacity: 0.85;
}

/* First-time hint tooltip */
.mobile-menu-hint {
  display: none;
  position: absolute;
  bottom: -2.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(99, 102, 241, 0.95);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.3s ease-out;
}

.mobile-menu-hint::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 6px solid rgba(99, 102, 241, 0.95);
}

/* Show hint on first visit */
.mobile-menu-btn.show-hint {
  animation: pulse 2s ease-in-out infinite;
}

.mobile-menu-btn.show-hint .mobile-menu-hint {
  display: block;
}

/* Pulse animation */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 20px rgba(99, 102, 241, 0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* On mobile, make it interactive */
@media (max-width: 768px) {
  .mobile-menu-btn {
    cursor: pointer;
    pointer-events: auto;
  }
  
  .mobile-menu-btn:hover {
    transform: scale(1.05);
  }
  
  .mobile-menu-btn:hover img {
    opacity: 1;
  }
  
  .mobile-menu-btn:active {
    transform: scale(0.95);
  }
}

/* Also make it interactive in landscape mode */
@media (max-height: 500px) and (orientation: landscape) {
  .mobile-menu-btn {
    cursor: pointer;
    pointer-events: auto !important;
  }
}

/* Mobile Controls Menu */
.mobile-controls-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: 100vw;
  background: rgba(8, 10, 18, 0.98);
  backdrop-filter: blur(24px);
  z-index: 10000;
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(env(safe-area-inset-top, 0px) + 1rem) 1rem calc(env(safe-area-inset-bottom, 0px) + 1rem);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-overflow-scrolling: touch;
  visibility: visible;
}

.mobile-controls-menu.hidden {
  transform: translateX(100%);
  pointer-events: none;
}

.mobile-controls-menu:not(.hidden) {
  transform: translateX(0);
  pointer-events: auto;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  flex-shrink: 0;
}

.mobile-menu-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.mobile-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding-bottom: 1rem;
  width: 100%;
  max-width: 100%;
}

.mobile-menu-grid .control-btn {
  width: 100%;
  height: auto;
  min-height: 90px;
  max-width: 100%;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.875rem 0.5rem;
  border-radius: 16px;
  background: rgba(20, 22, 33, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-grid .control-btn .icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-menu-grid .control-btn .icon svg {
  width: 22px;
  height: 22px;
}

.mobile-menu-grid .control-btn .control-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  flex-shrink: 0;
}

.mobile-menu-grid .control-btn:hover {
  background: rgba(30, 32, 43, 0.85);
  border-color: rgba(148, 163, 184, 0.3);
}

.mobile-menu-grid .control-btn[aria-pressed='true'] {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.mobile-menu-grid .control-btn.danger {
  background: rgba(127, 29, 29, 0.3);
  border-color: rgba(248, 113, 113, 0.3);
}

.mobile-menu-grid .control-btn.danger:hover {
  background: rgba(127, 29, 29, 0.5);
  border-color: var(--danger);
}

.mobile-menu-grid .control-btn .control-badges {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.mobile-menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  visibility: visible;
}

.mobile-menu-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

.mobile-menu-backdrop:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

/* Hide bottom controls on mobile - both portrait and landscape */
@media (max-width: 768px) {
  .meeting-controls {
    display: none !important;
  }
  
  /* Hide header on mobile for full video */
  .meeting-header {
    display: none !important;
  }
  
  /* Hide participant strip on mobile */
  .participant-strip {
    display: none !important;
  }
}

/* Ensure controls hidden in landscape mode too */
@media (max-height: 500px) and (orientation: landscape) {
  .meeting-controls {
    display: none !important;
  }
  
  .meeting-header {
    display: none !important;
  }
  
  .participant-strip {
    display: none !important;
  }
}

/* Hide mobile menu on desktop - but NOT on landscape mobile */
@media (min-width: 769px) and (min-height: 501px) {
  .mobile-controls-menu,
  .mobile-menu-backdrop {
    display: none !important;
  }
}

/* Ensure mobile menu can show in landscape */
@media (max-width: 768px) and (orientation: landscape),
       (max-height: 500px) and (orientation: landscape) {
  .mobile-controls-menu {
    display: block;
  }
  
  .mobile-menu-backdrop {
    display: block;
  }
}

/* Mobile portrait - ensure proper fit */
@media (max-width: 768px) and (orientation: portrait) {
  /* Full screen video in portrait */
  .stage-main video,
  #primary-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .mobile-menu-btn {
    top: calc(env(safe-area-inset-top, 0px) + 1rem);
    z-index: 9999;
    position: fixed;
  }

  .mobile-menu-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
  }
  
  .mobile-menu-grid .control-btn {
    min-height: 85px;
    padding: 0.75rem 0.4rem;
  }
  
  .mobile-menu-grid .control-btn .control-label {
    font-size: 0.7rem;
  }
  
  /* Hint position for portrait */
  .mobile-menu-hint {
    bottom: -2.5rem;
  }
}

/* Mobile landscape - same 3 column layout */
@media (max-width: 768px) and (orientation: landscape) {
  /* Full screen video layout */
  #live-view {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  
  .meeting-shell {
    width: 100%;
    height: 100%;
    padding: 0;
  }
  
  .stage {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    margin: 0;
  }
  
  .stage-main {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }
  
  .stage-main video,
  #primary-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
  }
  
  /* Ensure logo button is visible and clickable ON TOP of video */
  .mobile-menu-btn {
    display: flex !important;
    position: fixed;
    top: 0.5rem;
    right: 0.5rem;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 9999;
    /* Temporary debug: add visible background */
    background: rgba(255, 0, 0, 0.1) !important;
    outline: 2px solid rgba(99, 102, 241, 0.5);
  }
  
  .mobile-menu-btn:active {
    background: rgba(99, 102, 241, 0.3) !important;
  }
  
    .mobile-menu-grid {
      grid-template-columns: repeat(4, 1fr);
      gap: 0.6rem;
    }
  
  .mobile-menu-grid .control-btn {
    min-height: 75px;
    padding: 0.65rem 0.4rem;
  }
  
  .mobile-menu-grid .control-btn .icon {
    width: 36px;
    height: 36px;
  }
  
  .mobile-menu-grid .control-btn .icon svg {
    width: 20px;
    height: 20px;
  }
  
  .mobile-menu-grid .control-btn .control-label {
    font-size: 0.7rem;
  }
  
  /* Hint position for landscape - position to the left */
  .mobile-menu-hint {
    bottom: auto;
    right: 100%;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 0.75rem;
  }
  
  .mobile-menu-hint::before {
    top: 50%;
    left: auto;
    right: -6px;
    transform: translateY(-50%);
    border-left: 6px solid rgba(99, 102, 241, 0.95);
    border-right: none;
    border-bottom: 8px solid transparent;
    border-top: 8px solid transparent;
  }
  
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(-50%) translateX(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(-50%) translateX(0);
    }
  }
}

/* Landscape mode on tablets/phones - ensure controls hidden */
@media (max-height: 500px) and (orientation: landscape) {
  /* Full screen video */
  #live-view {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  
  .meeting-shell {
    width: 100%;
    height: 100%;
    padding: 0;
  }
  
  .stage {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    margin: 0;
  }
  
  .stage-main {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }
  
  .stage-main video,
  #primary-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
  }
  
  .mobile-menu-btn {
    display: flex !important;
    position: fixed;
    top: 0.5rem;
    right: 0.5rem;
    width: 80px;
    height: 80px;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 9999;
  }
  
  .mobile-menu-btn img {
    width: 80px;
    height: 80px;
  }
}

/* Very small mobile screens */
@media (max-width: 400px) {
  .mobile-menu-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  
  .mobile-menu-grid .control-btn {
    min-height: 80px;
    padding: 0.65rem 0.35rem;
  }
  
  .mobile-menu-grid .control-btn .control-label {
    font-size: 0.65rem;
  }
  
  .mobile-menu-header h3 {
    font-size: 1.1rem;
  }
}

div#camera-menu {
  margin-left: 121px!important;
}