:root {
  color-scheme: dark;
  font-family: "Avenir Next", "Avenir", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg-0: #0a0d14;
  --bg-1: #0f1726;
  --bg-2: #131c31;
  --surface-0: rgba(15, 23, 38, 0.78);
  --surface-1: rgba(20, 30, 48, 0.88);
  --surface-2: rgba(28, 41, 66, 0.92);
  --surface-3: rgba(12, 18, 31, 0.96);
  --border-soft: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.28);
  --glass-highlight: rgba(255, 255, 255, 0.08);
  --text-strong: #f5f7fb;
  --text-main: #d7deea;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-primary: #7c3aed;
  --accent-primary-2: #4f46e5;
  --accent-secondary: #38bdf8;
  --accent-success: #22c55e;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --gradient-brand: linear-gradient(135deg, #7c3aed 0%, #4f46e5 52%, #38bdf8 100%);
  --gradient-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.28);
  --shadow-panel: 0 24px 80px rgba(2, 6, 23, 0.45);
  --shadow-accent: 0 0 0 1px rgba(124, 58, 237, 0.35), 0 12px 30px rgba(79, 70, 229, 0.22);
  background: var(--bg-0);
  color: var(--text-main);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 18%, rgba(124, 58, 237, 0.22), transparent 24%),
    radial-gradient(circle at 88% 12%, rgba(56, 189, 248, 0.16), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(79, 70, 229, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 48%, #0b1120 100%);
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
}

body::after {
  opacity: 0.22;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.18) 0.7px, transparent 0.7px);
  background-size: 18px 18px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

::selection {
  background: rgba(124, 58, 237, 0.35);
  color: var(--text-strong);
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22), 0 0 0 1px rgba(56, 189, 248, 0.55);
}

.hidden {
  display: none !important;
}

.page-shell {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.hero-panel,
.dashboard-grid,
.board-layout,
.trivia-mode-grid,
.modal-session-grid,
.modal-gallery,
.teacher-student-actions,
.quick-response-options {
  display: grid;
}

.hero-panel {
  grid-template-columns: minmax(0, 1.18fr) minmax(380px, 460px);
  gap: 28px;
  align-items: stretch;
}

.hero-copy,
.auth-card,
.dashboard-main-card,
.dashboard-header,
.insight-card,
.board-brand-panel,
.canvas-card,
.toolbar,
.teacher-side-panel,
.teacher-control-panel,
.student-action-panel,
.student-trivia-panel,
.trivia-stage-panel,
.trivia-scoreboard-panel,
.modal-card,
.note-editor-card,
.web-view-toolbar,
.web-view-frame-shell,
.teacher-toast,
.teacher-student-card,
.teacher-score-card,
.student-turn-card,
.dashboard-history-item,
.dashboard-homework-item,
.modal-session-card,
.modal-gallery-item,
.empty-state-card,
.session-code-panel,
.teacher-panel-note,
.student-panel-note,
.quick-response-option,
.student-action-button,
.board-readonly-indicator,
.board-edit-toast {
  background: var(--gradient-surface), var(--surface-0);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.hero-copy,
.auth-card,
.dashboard-main-card,
.dashboard-header,
.insight-card,
.modal-card,
.note-editor-card {
  position: relative;
  overflow: hidden;
}

.hero-copy::before,
.auth-card::before,
.dashboard-main-card::before,
.insight-card::before,
.modal-card::before,
.note-editor-card::before {
  content: "";
  position: absolute;
  inset: auto -12% -28% auto;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.22) 0%, rgba(124, 58, 237, 0) 72%);
  pointer-events: none;
}

.hero-copy {
  padding: 28px 30px;
  border-radius: 32px;
  min-height: 100%;
}

.hero-logo,
.auth-logo,
.board-brand-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.hero-logo {
  width: min(100%, 420px);
  margin-bottom: 8px;
  filter: drop-shadow(0 18px 34px rgba(15, 23, 42, 0.34));
}

.auth-card,
.dashboard-main-card,
.dashboard-header,
.insight-card {
  border-radius: 28px;
}

.auth-card,
.dashboard-main-card {
  padding: 26px;
  display: grid;
  gap: 22px;
}

.lobby-auth-card {
  padding: 30px;
  gap: 20px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.82)),
    var(--gradient-surface),
    var(--surface-0);
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow:
    0 28px 60px rgba(2, 6, 23, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.auth-logo {
  width: min(100%, 280px);
  margin: 0 auto 4px;
  filter: drop-shadow(0 14px 28px rgba(2, 6, 23, 0.28));
}

.dashboard-header,
.insight-card {
  padding: 18px 20px;
}

.eyebrow,
.meta-label,
.meta-label-inverse,
.session-code-label,
.dashboard-homework-pill,
.board-inline-pill,
.role-badge,
.teacher-chip,
.teacher-student-turn-badge,
.dashboard-history-resume-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow,
.meta-label,
.session-code-label {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.76rem;
  color: #c4b5fd;
  background: rgba(124, 58, 237, 0.14);
  border: 1px solid rgba(124, 58, 237, 0.22);
}

.eyebrow.subtle {
  color: #bfdbfe;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.18);
}

.meta-label-inverse {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.76rem;
  color: #e9d5ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-copy h1 {
  margin: 12px 0 12px;
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--text-strong);
  max-width: 14ch;
}

.hero-copy p,
.card-title-block p,
.dashboard-subtitle,
.insight-card p,
.session-code-copy p,
.dashboard-history-content p,
.modal-body p,
.dashboard-homework-item p,
.teacher-panel-note,
.student-panel-note,
.web-view-placeholder,
.helper-text {
  color: var(--text-muted);
  line-height: 1.65;
}

.hero-copy p {
  margin: 0;
  max-width: 62ch;
  font-size: 0.98rem;
}

.feature-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.feature-list li::before {
  content: "✦";
  color: #c4b5fd;
  font-size: 1rem;
}

.card-title-block {
  display: grid;
  gap: 10px;
}

.lobby-auth-card .card-title-block {
  gap: 8px;
}

.lobby-auth-card .card-title-block h2 {
  font-size: clamp(1.8rem, 2.4vw, 2.2rem);
  letter-spacing: 0.04em;
}

.card-title-block h2,
.card-title-block h3,
.dashboard-header h2,
.insight-card h3,
.teacher-side-header h2,
.teacher-panel-header h2,
.student-panel-header h2,
.trivia-stage-panel h2,
.trivia-podium-header h2,
.note-editor-copy h2,
.dashboard-history-content h4,
.modal-body h4,
.dashboard-homework-item h4,
.board-room-title {
  margin: 0;
  color: var(--text-strong);
  letter-spacing: 0.04em;
}

.field,
.compact-field,
.profile-list div,
.session-code-copy,
.dashboard-history-content,
.dashboard-history-meta,
.teacher-panel-section,
.quick-response-panel,
.teacher-side-section,
.teacher-side-header,
.teacher-side-section-top,
.note-editor-copy,
.modal-header,
.modal-body,
.modal-gallery,
.modal-session-grid {
  display: grid;
  gap: 10px;
}

.field span,
.compact-field span,
.profile-list dt {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.field input,
.field select,
.field textarea,
.note-editor-input {
  width: 100%;
  min-height: 58px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(8, 13, 24, 0.62);
  color: var(--text-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.field input::placeholder,
.field textarea::placeholder,
.note-editor-input::placeholder {
  color: var(--text-dim);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.note-editor-input:focus {
  border-color: rgba(124, 58, 237, 0.55);
  box-shadow: var(--shadow-accent);
  background: rgba(10, 16, 28, 0.82);
}

.field textarea,
.note-editor-input {
  min-height: 140px;
  resize: vertical;
}

.primary-button,
.secondary-button,
.link-button,
.role-toggle-button,
.toolbar-icon-button,
.toolbar-mode-button,
.shape-menu-item,
.quick-response-option,
.teacher-student-card-main,
.teacher-student-action-button,
.teacher-toast,
.student-action-button {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease, opacity 180ms ease, color 180ms ease;
}

.primary-button,
.secondary-button,
.link-button,
.toolbar-icon-button,
.toolbar-mode-button,
.shape-menu-item,
.teacher-student-action-button,
.student-action-button,
.quick-response-option {
  min-height: 58px;
  padding: 14px 18px;
  border-radius: 18px;
  font-weight: 700;
}

.primary-button:hover,
.secondary-button:hover,
.link-button:hover,
.toolbar-icon-button:hover,
.toolbar-mode-button:hover,
.shape-menu-item:hover,
.teacher-student-action-button:hover,
.student-action-button:hover,
.quick-response-option:hover,
.role-toggle-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 18px 34px rgba(79, 70, 229, 0.28);
}

.secondary-button,
.link-button,
.shape-menu-item,
.quick-response-option,
.teacher-student-action-button {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.secondary-button:hover,
.link-button:hover,
.shape-menu-item:hover,
.quick-response-option:hover,
.teacher-student-action-button:hover {
  border-color: rgba(56, 189, 248, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.secondary-button.danger,
.trivia-stage-wrong-btn {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.secondary-button.is-active,
.toolbar-icon-button.is-active,
.role-toggle-button.active,
.quick-response-option.is-active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.92), rgba(79, 70, 229, 0.92));
  color: #fff;
  box-shadow: var(--shadow-accent);
  border-color: rgba(196, 181, 253, 0.28);
}

.helper-text {
  min-height: 22px;
  margin: 0;
}

.auth-panel-stack {
  position: relative;
  display: grid;
}

.auth-form {
  display: grid;
  gap: 16px;
  animation: authFadeIn 220ms ease;
}

.auth-field {
  gap: 8px;
}

.auth-field span {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.auth-field input {
  min-height: 56px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.52);
  border-color: rgba(148, 163, 184, 0.14);
}

.auth-field input:hover {
  border-color: rgba(96, 165, 250, 0.24);
  background: rgba(7, 12, 24, 0.72);
}

.auth-submit-button {
  margin-top: 4px;
}

.auth-mode-toggle {
  padding: 6px;
  gap: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(148, 163, 184, 0.12);
}

.auth-mode-toggle .role-toggle-button {
  min-height: 50px;
  border-radius: 14px;
  font-size: 0.95rem;
}

@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.demo-credentials {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.demo-credentials h3 {
  margin: 0 0 12px;
  color: var(--text-strong);
  font-size: 0.96rem;
}

.demo-credentials ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--text-muted);
}

.dashboard-section {
  margin-top: 24px;
  display: grid;
  gap: 22px;
}

.dashboard-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.dashboard-brand-block {
  display: grid;
  gap: 10px;
}

.dashboard-brand-image {
  display: block;
  height: clamp(30px, 3vw, 38px);
  width: auto;
  max-width: min(180px, 32vw);
  object-fit: contain;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.22fr) minmax(340px, 430px);
  gap: 24px;
  align-items: start;
}

.dashboard-side,
.dashboard-homework-list,
.teacher-students-list {
  display: grid;
  gap: 16px;
}

.dashboard-join-card {
  padding: 10px 0 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  gap: 18px;
}

.dashboard-join-card .field {
  gap: 12px;
}

.dashboard-join-card .field + .field,
.dashboard-join-card .field + .session-code-panel,
.dashboard-join-card .session-code-panel + .field,
.dashboard-join-card .session-code-panel + .primary-button,
.dashboard-join-card .field + .primary-button {
  margin-top: 10px;
}

.dashboard-join-card .role-toggle {
  margin-top: 2px;
}

.role-badge,
.board-user-chip {
  min-height: 34px;
  padding: 0 12px;
  background: rgba(56, 189, 248, 0.12);
  color: #bfdbfe;
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.role-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 8px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.role-toggle-button {
  min-height: 58px;
  border-radius: 16px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
}

.session-code-panel {
  gap: 18px;
  padding: 26px;
  margin-top: 14px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(56, 189, 248, 0.08)),
    rgba(255, 255, 255, 0.04);
}

.dashboard-join-card .primary-button {
  margin-top: 16px;
}

.session-code-value {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0.22em;
  color: var(--text-strong);
}

.dashboard-history-item,
.dashboard-homework-item,
.modal-session-card,
.modal-gallery-item,
.empty-state-card,
.teacher-student-card,
.teacher-score-card,
.student-turn-card {
  border-radius: 22px;
}

.dashboard-history-item {
  position: relative;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  cursor: pointer;
}

.dashboard-history-item:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.22);
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.34);
}

.dashboard-history-visual,
.dashboard-history-thumb,
.dashboard-history-thumb-placeholder {
  width: 100%;
  min-height: 136px;
  border-radius: 18px;
}

.dashboard-history-visual {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(56, 189, 248, 0.18));
}

.dashboard-history-thumb {
  object-fit: cover;
  height: 100%;
  background: rgba(255, 255, 255, 0.08);
}

.dashboard-history-thumb-placeholder {
  display: grid;
  place-items: center;
  color: #e9d5ff;
  font-weight: 800;
  font-size: 1.4rem;
}

.dashboard-history-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: end;
  justify-content: start;
  padding: 14px;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.02), rgba(2, 6, 23, 0.62));
}

.dashboard-history-resume-pill,
.dashboard-homework-pill,
.teacher-chip,
.teacher-student-turn-badge {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.76rem;
  color: #dbeafe;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.dashboard-history-actions,
.dashboard-homework-meta,
.teacher-inline-tools,
.teacher-chip-list,
.teacher-student-list,
.web-view-actions,
.note-editor-actions,
.dashboard-actions,
.board-brand-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-history-action {
  min-height: 46px;
}

.dashboard-history-delete-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.24);
  background: rgba(12, 18, 31, 0.78);
  color: #fca5a5;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.28);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.dashboard-history-delete-button:hover {
  transform: scale(1.04);
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(36, 12, 18, 0.92);
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(12px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: min(88vh, 980px);
  overflow: auto;
  padding: 28px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.96), rgba(12, 18, 31, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-panel);
}

.modal-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.modal-session-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.modal-gallery {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.modal-gallery-item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 16px;
}

.empty-state-card {
  padding: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
}

.profile-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.profile-list dd {
  margin: 0;
  color: var(--text-strong);
  font-weight: 600;
}

body.board-page {
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body.board-page::before {
  mask-image: none;
  opacity: 0.45;
}

body.board-page button,
body.board-page input,
body.board-page label {
  touch-action: manipulation;
}

.board-fullscreen-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
}

.board-header,
.board-header-fullscreen {
  position: relative;
  padding: 4px 0 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}

.board-header {
  min-height: 0;
}

.board-brand-panel {
  min-height: 58px;
  max-height: none;
  padding: 10px 16px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, rgba(20, 30, 48, 0.92), rgba(12, 18, 31, 0.96));
  overflow: visible;
  transform-origin: top center;
  transition: max-height 240ms ease, opacity 220ms ease, transform 240ms ease, padding 240ms ease, margin 240ms ease;
  flex-wrap: wrap;
}

.board-brand-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.board-brand-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.board-room-title {
  margin: 0;
  font-size: clamp(1rem, 1.35vw, 1.24rem);
  line-height: 1;
  color: var(--text-strong);
  white-space: nowrap;
}

.board-school-name {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-brand-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.board-inline-pill,
.board-user-chip,
.board-width-pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  line-height: 1;
}

.board-inline-pill,
.board-user-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.board-link-button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.board-header-kicker {
  min-height: 24px;
  padding: 0 8px;
  font-size: 0.68rem;
}

.board-logo {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  flex: 0 0 auto;
}

.board-brand-image {
  height: clamp(30px, 3vw, 38px);
  width: auto;
  max-width: min(160px, 28vw);
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 18px rgba(2, 6, 23, 0.28));
}

.board-header-actions {
  row-gap: 10px;
}

.board-layout,
.board-layout-fullscreen {
  grid-template-columns: 1fr;
  min-height: 0;
}

.canvas-card,
.canvas-card-fullscreen {
  position: relative;
  min-height: 0;
  border-radius: 32px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.92), rgba(12, 18, 31, 0.96));
}

.board-stage,
.whiteboard-shell,
#shared-whiteboard,
#whiteboard {
  position: absolute;
  inset: 0;
}

.whiteboard-shell {
  overflow: hidden;
}

.presentation-loading {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(12, 18, 31, 0.75);
  color: var(--text-strong);
  font-size: 1.25rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.presentation-loading::before {
  content: "";
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-primary, #7c3aed);
  border-radius: 50%;
  animation: presentation-spin 0.8s linear infinite;
}

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

.presentation-loading.hidden {
  display: none !important;
}

#shared-whiteboard,
#whiteboard {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#shared-whiteboard {
  z-index: 18;
  pointer-events: none;
  background:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.98));
  background-size: 32px 32px;
}

#whiteboard {
  z-index: 21;
  background: transparent;
}

#whiteboard.is-readonly {
  cursor: not-allowed;
}

.board-readonly-indicator,
.board-edit-toast {
  position: absolute;
  left: 24px;
  z-index: 24;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  pointer-events: none;
  font-weight: 700;
}

.board-readonly-indicator {
  top: 24px;
  background: rgba(12, 18, 31, 0.82);
  color: #fff;
}

.board-edit-toast {
  bottom: 24px;
  background: rgba(34, 197, 94, 0.92);
  color: #fff;
}

.selection-toolbar {
  position: fixed;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.94), rgba(12, 18, 31, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 48px rgba(2, 6, 23, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.selection-toolbar.hidden {
  display: none;
}

.presentation-controls {
  position: fixed;
  left: 50%;
  bottom: 112px;
  transform: translateX(-50%);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 12px 14px;
  pointer-events: auto;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.94), rgba(12, 18, 31, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 48px rgba(2, 6, 23, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.presentation-controls.hidden {
  display: none;
}

.presentation-controls .secondary-button {
  min-width: 64px;
  min-height: 56px;
  padding: 14px 18px;
  font-size: 1rem;
}

.selection-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.selection-toolbar-range {
  min-width: 180px;
}

.selection-toolbar-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.82);
}

.selection-toolbar-palette {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.selection-toolbar-swatch {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  background: var(--swatch);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.selection-toolbar-swatch:hover {
  transform: scale(1.08);
}

.selection-toolbar-swatch.is-active {
  border-color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.22);
}

.selection-toolbar-swatch-light {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18);
}

.selection-toolbar input[type="range"] {
  width: 120px;
  accent-color: #22d3ee;
}

.selection-toolbar-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-weight: 700;
}

.selection-toolbar-pill.is-disabled {
  opacity: 0.5;
}

.selection-toolbar-delete {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(248, 113, 113, 0.28);
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.92), rgba(69, 10, 10, 0.96));
  color: #fecaca;
  font-weight: 800;
}

.selection-toolbar-delete:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.classroom-overlay {
  position: absolute;
  inset: 18px;
  z-index: 26;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  pointer-events: none;
}

.teacher-side-panel,
.teacher-control-panel,
.student-action-panel,
.student-trivia-panel,
.trivia-stage-panel,
.trivia-scoreboard-panel {
  pointer-events: auto;
  border-radius: 28px;
}

.teacher-side-panel,
.teacher-control-panel,
.student-trivia-panel,
.trivia-scoreboard-panel {
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.94), rgba(12, 18, 31, 0.96));
}

.teacher-side-panel {
  width: min(360px, 100%);
  padding: 18px;
  margin-left: auto;
}

.teacher-side-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
}

.teacher-side-panel-body {
  display: grid;
  gap: 22px;
}

.teacher-side-toggle-button {
  min-width: 52px;
  min-height: 52px;
  border-radius: 16px;
}

.teacher-side-panel.is-collapsed {
  width: 92px;
}

.teacher-side-panel.is-collapsed .teacher-side-header {
  display: flex;
  justify-content: center;
}

.teacher-side-panel.is-collapsed .teacher-side-header-copy,
.teacher-side-panel.is-collapsed .teacher-side-panel-body {
  display: none;
}

.teacher-side-section {
  padding-top: 6px;
  gap: 14px;
}

.teacher-students-list {
  gap: 12px;
}

.teacher-student-card {
  gap: 14px;
  padding: 14px 16px;
  border-radius: 20px;
}

.teacher-student-card.is-active-turn {
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.22), 0 18px 34px rgba(2, 6, 23, 0.28);
}

.teacher-student-card-main {
  width: 100%;
  padding: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
}

.teacher-student-card-copy {
  display: grid;
  gap: 4px;
}

.teacher-student-card-copy strong {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-strong);
  font-size: 1rem;
}

.teacher-student-card-copy span {
  color: var(--text-dim);
  font-size: 0.92rem;
}

.teacher-student-hand-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.18);
}

.teacher-student-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 800;
}

.teacher-student-status.is-online {
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
}

.teacher-student-status.is-offline {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
}

.teacher-student-actions {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.teacher-student-action-button {
  min-height: 62px;
  font-size: 1rem;
}

.teacher-chip.is-new-hand,
.teacher-student-card.is-new-hand {
  animation: handRaisePulse 1.15s ease;
}

@keyframes handRaisePulse {
  0% {
    transform: translateY(10px) scale(0.94);
    opacity: 0;
    box-shadow: 0 0 0 rgba(59, 130, 246, 0);
  }
  35% {
    transform: translateY(-4px) scale(1.03);
    opacity: 1;
    box-shadow: 0 14px 32px rgba(59, 130, 246, 0.22);
  }
  68% {
    transform: translateY(0) scale(1);
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.16);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
    box-shadow: 0 0 0 rgba(59, 130, 246, 0);
  }
}

.teacher-toast-region {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  gap: 10px;
  width: min(320px, calc(100vw - 48px));
  pointer-events: none;
  z-index: 12;
}

.teacher-toast {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  color: #bfdbfe;
  text-align: left;
  pointer-events: auto;
}

.student-action-panel {
  margin-left: auto;
  width: min(340px, 100%);
  padding: 22px;
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.9), rgba(12, 18, 31, 0.94));
}

.student-action-button {
  width: 100%;
  min-height: 72px;
  font-size: 1.08rem;
}

.quick-response-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.student-turn-card,
.teacher-score-card,
.teacher-panel-note,
.student-panel-note,
.quick-response-option {
  padding: 12px 14px;
  border-radius: 18px;
}

.teacher-panel-note,
.student-panel-note {
  gap: 8px;
}

.student-turn-card strong,
.teacher-score-card strong {
  color: var(--text-strong);
}

.student-turn-card span,
.teacher-score-card span {
  color: #bfdbfe;
  font-weight: 700;
}

.trivia-mode-overlay {
  position: absolute;
  inset: 0;
  z-index: 34;
  background:
    radial-gradient(circle at top, rgba(124, 58, 237, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.88));
  backdrop-filter: blur(8px);
}

.trivia-mode-overlay.hidden,
.trivia-podium-overlay.hidden,
.teacher-control-panel.hidden,
.teacher-side-panel.hidden,
.student-action-panel.hidden,
.student-trivia-panel.hidden,
.quick-response-panel.hidden,
.teacher-inline-tools.hidden {
  display: none !important;
}

.trivia-mode-shell {
  width: 100%;
  height: 100%;
  padding: 28px;
  display: grid;
  gap: 22px;
  align-content: start;
}

.trivia-stage-panel {
  padding: 32px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.16), transparent 28%),
    linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(20, 30, 48, 0.96) 42%, rgba(12, 18, 31, 0.98) 100%);
  display: grid;
  gap: 18px;
}

.trivia-stage-copy {
  margin: 0;
  max-width: 72ch;
}

.trivia-stage-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 64px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-strong);
  font-size: 1.6rem;
  font-weight: 800;
}

.trivia-stage-status,
.trivia-stage-judge {
  display: grid;
  gap: 14px;
}

.trivia-stage-responder-name {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.08rem;
  font-weight: 700;
}

.trivia-stage-judge-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.trivia-stage-correct-btn,
.trivia-stage-wrong-btn {
  min-height: 62px;
  padding: 14px 18px;
  border-radius: 18px;
  font-weight: 800;
}

.trivia-stage-correct-btn {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: #fff;
}

.trivia-stage-wrong-btn {
  background: var(--gradient-danger);
  color: #fff;
}

.trivia-mode-grid {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr) minmax(320px, 420px);
  gap: 24px;
  align-items: start;
}

.teacher-control-panel,
.student-trivia-panel,
.trivia-scoreboard-panel {
  padding: 24px;
  gap: 16px;
}

.trivia-scoreboard-panel {
  display: grid;
  gap: 18px;
}

.trivia-podium-overlay {
  position: absolute;
  inset: 0;
  z-index: 36;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
}

.trivia-podium-shell {
  width: min(980px, 100%);
  padding: 28px;
  border-radius: 32px;
  background:
    radial-gradient(circle at top, rgba(124, 58, 237, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(20, 30, 48, 0.96), rgba(12, 18, 31, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-panel);
}

.trivia-podium-header {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.trivia-podium-list {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.trivia-podium-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.trivia-podium-card.rank-1 {
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.22), 0 18px 34px rgba(250, 204, 21, 0.12);
}

.trivia-podium-card.rank-2 {
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.22), 0 18px 34px rgba(148, 163, 184, 0.12);
}

.trivia-podium-card.rank-3 {
  box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.22), 0 18px 34px rgba(251, 146, 60, 0.12);
}

.trivia-podium-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.8rem;
}

.trivia-podium-copy h3,
.trivia-podium-copy p {
  margin: 0;
}

.toolbar,
.toolbar-fullscreen {
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  overflow-x: auto;
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.94), rgba(12, 18, 31, 0.96));
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.toolbar-group-tools {
  flex: 1 1 auto;
  gap: 10px;
}

.toolbar-group-drawing {
  align-items: center;
  gap: 12px;
}

.toolbar-icon-button,
.toolbar-mode-button {
  min-width: 40px;
  min-height: 40px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.toolbar-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-size: 1rem;
  line-height: 1;
}

.toolbar-button-icon-text {
  font-size: 0.9rem;
}

.toolbar-mode-button {
  min-width: 80px;
  font-size: 0.78rem;
  font-weight: 800;
}

.toolbar-ai-button {
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 52%, #f59e0b 100%) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 18px 34px rgba(124, 58, 237, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.toolbar-ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.toolbar-field {
  min-height: 52px;
  padding: 8px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.toolbar-palette-field {
  gap: 10px;
}

.teacher-only-control[hidden] {
  display: none !important;
}

.toolbar-background-field {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  padding-left: 16px;
  margin-left: 8px;
}

.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: var(--swatch);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.color-swatch:hover {
  transform: scale(1.06);
}

.color-swatch.is-active {
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.22);
}

.color-swatch-light {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18);
}

.background-palette {
  gap: 8px;
}

.background-swatch {
  width: 36px;
  height: 36px;
  position: relative;
}

.background-swatch.is-active::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.background-swatch.color-swatch-light.is-active::after {
  color: #0f172a;
  text-shadow: none;
}

.compact-range-field input[type="range"] {
  width: 120px;
  accent-color: #8b5cf6;
}

.shape-menu-shell {
  position: relative;
}

.shape-menu {
  position: fixed;
  left: 0;
  bottom: auto;
  width: 220px;
  padding: 12px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.96), rgba(12, 18, 31, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-panel);
  display: grid;
  gap: 10px;
  z-index: 60;
}

.shape-menu[hidden],
.shape-menu-closed {
  display: none !important;
}

.shape-menu-item {
  justify-content: flex-start;
  text-align: left;
}

.web-view-panel {
  position: absolute;
  inset: 0;
  z-index: 28;
  pointer-events: none;
}

.web-view-panel .web-view-frame-shell,
.web-view-panel .web-view-toolbar,
.web-view-panel .web-view-splitter {
  pointer-events: auto;
}

.web-view-frame-shell {
  position: absolute;
  top: 12px;
  left: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 96px);
  min-height: 320px;
  min-width: 0;
  z-index: 10;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.94) 0%, rgba(12, 18, 31, 0.98) 100%);
  box-shadow: var(--shadow-panel);
}

.web-view-panel.is-full .web-view-frame-shell {
  top: 12px;
  left: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 96px);
}

.web-view-panel.is-split .web-view-frame-shell {
  top: 12px;
  left: 12px;
  width: calc(var(--split-ratio, 0.5) * 100% - 18px);
  height: calc(100% - 96px);
}

.web-view-panel.is-float .web-view-frame-shell {
  top: 28px;
  left: 32px;
  width: min(720px, calc(100% - 64px));
  height: min(420px, calc(100% - 140px));
}

.web-view-toolbar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.94), rgba(12, 18, 31, 0.96));
  box-shadow: var(--shadow-soft);
}

.web-view-splitter {
  position: absolute;
  top: 12px;
  left: calc(var(--split-ratio, 0.5) * 100% - 10px);
  width: 20px;
  height: calc(100% - 96px);
  z-index: 25;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.92) 0%, rgba(56, 189, 248, 0.92) 100%);
  color: #fff;
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.22);
  cursor: col-resize;
  pointer-events: auto;
}

.web-view-splitter[hidden] {
  display: none;
}

.web-view-drag-handle,
.web-view-resize-handle {
  position: absolute;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: rgba(12, 18, 31, 0.72);
  color: #cbd5e1;
}

.web-view-drag-handle {
  top: 12px;
  left: 12px;
  cursor: grab;
}

.web-view-drag-handle:active {
  cursor: grabbing;
}

.web-view-resize-handle {
  right: 12px;
  bottom: 12px;
  cursor: nwse-resize;
}

#web-view-frame {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  display: block;
  background: var(--bg-1);
}

.web-view-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  background:
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(19, 28, 49, 0.94) 0%, rgba(10, 13, 20, 0.98) 100%);
  background-size: 28px 28px;
}

.web-view-placeholder strong {
  font-size: 1.15rem;
  color: var(--text-strong);
}

.note-editor {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.42);
  backdrop-filter: blur(6px);
}

.note-editor-card {
  width: min(520px, calc(100vw - 48px));
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.96), rgba(12, 18, 31, 0.98));
  box-shadow: var(--shadow-panel);
}

.note-editor-card.is-text-editor .note-editor-input {
  background: rgba(8, 13, 24, 0.82);
}

body.board-page #shared-whiteboard.web-overlay-active {
  background: transparent;
}

body.board-page #shared-whiteboard,
body.board-page #whiteboard {
  min-height: 0;
}

@media (pointer: coarse) {
  body.board-page {
    touch-action: none;
  }

  .board-inline-pill,
  .board-user-chip {
    font-size: 0.96rem;
  }

  .shape-menu {
    left: 50%;
    transform: translateX(-50%);
    width: min(240px, calc(100vw - 48px));
  }

  .web-view-toolbar,
  .web-view-actions {
    width: 100%;
  }

  .web-view-actions > * {
    flex: 1 1 0;
  }

  .web-view-splitter {
    left: 12px;
    top: calc(50% - 10px);
    width: calc(100% - 24px);
    height: 20px;
    cursor: row-resize;
  }

  .web-view-panel.is-split .web-view-frame-shell,
  .web-view-panel.is-full .web-view-frame-shell,
  .web-view-panel.is-float .web-view-frame-shell {
    left: 10px;
    width: calc(100% - 20px);
    min-width: 0;
  }

  .web-view-panel.is-split .web-view-frame-shell,
  .web-view-panel.is-full .web-view-frame-shell {
    height: calc(50% - 60px);
  }

  .web-view-panel.is-float .web-view-frame-shell {
    top: 20px;
    height: min(360px, calc(100% - 120px));
  }
}

@media (max-width: 1180px) {
  .hero-panel,
  .dashboard-grid,
  .trivia-mode-grid,
  .modal-session-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    grid-template-columns: 1fr;
  }

  .board-brand-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .board-brand-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .page-shell {
    width: min(100%, calc(100% - 28px));
    padding-top: 20px;
  }

  .hero-copy,
  .auth-card,
  .dashboard-main-card,
  .dashboard-header,
  .insight-card,
  .modal-card {
    padding: 18px;
  }

  .dashboard-history-item {
    grid-template-columns: 1fr;
  }

  .classroom-overlay {
    inset: 12px;
    justify-content: stretch;
  }

  .teacher-side-panel,
  .teacher-control-panel,
  .student-action-panel,
  .student-trivia-panel {
    width: 100%;
    margin-left: 0;
  }

  .teacher-toast-region {
    top: 14px;
    right: 14px;
    width: min(100%, calc(100vw - 40px));
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100%, calc(100% - 20px));
    padding: 14px 0 28px;
  }

  .hero-copy {
    padding: 28px;
  }

  .hero-logo {
    width: min(100%, 320px);
  }

  .auth-logo {
    width: min(100%, 220px);
  }

  .board-brand-image {
    width: 112px;
    max-width: 34vw;
  }

  .toolbar,
  .toolbar-fullscreen {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .toolbar-icon-button,
  .toolbar-mode-button {
    min-width: 48px;
    min-height: 48px;
    border-radius: 14px;
  }

  .toolbar-mode-button {
    min-width: 88px;
    font-size: 0.82rem;
  }

  .board-fullscreen-shell {
    padding: 12px;
    gap: 12px;
  }

  .canvas-card,
  .canvas-card-fullscreen,
  .board-brand-panel {
    border-radius: 24px;
  }
}