/* server/public/css/whiteboard.css */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;600;700&family=Playpen+Sans+Arabic:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

.wb-shell {
  --wb-bg: #f6f6fc;
  --wb-dot: #d6d6ec;
  --wb-topbar: #0d0e16;
  --wb-pill: #1b1c2a;
  --wb-pill-hover: #27293d;
  --wb-ink: #252157;
  --wb-ink-soft: #433f78;
  --wb-blue: #2563eb;
  --wb-emerald: #059669;
  --wb-purple: #7c3aed;
  --wb-amber: #d97706;
  --wb-red: #dc2626;
  --wb-hand-font: 'Caveat', 'Playpen Sans Arabic', cursive, sans-serif;
  --wb-body-font: 'Caveat', 'Playpen Sans Arabic', 'Segoe UI', cursive, sans-serif;
  --wb-mono-font: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
  --wb-speed: 1;

  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 78vh;
  height: calc(100vh - 150px);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  background-color: #fbfcfe;
  background-image: radial-gradient(#d8dde9 1.15px, transparent 1.15px);
  background-size: 24px 24px;
  color: var(--wb-ink);
  direction: rtl;
}

body.wb-fullscreen-active {
  overflow: hidden !important;
}
body.wb-fullscreen-active .navbar,
body.wb-fullscreen-active .account-dock,
body.wb-fullscreen-active .study-chat,
body.wb-fullscreen-active #studyChatWidget {
  display: none !important;
}

.wb-shell.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  background-color: #fbfcfe !important;
  background-image: radial-gradient(#d8dde9 1.15px, transparent 1.15px) !important;
}

.wb-shell.is-fullscreen .wb-workspace-body {
  padding: 0 12px 12px !important;
}

.wb-shell.is-fullscreen .wb-right-drawer {
  position: absolute;
  top: 70px;
  right: 16px;
  max-height: calc(100dvh - 86px);
  width: min(352px, calc(100vw - 32px));
  z-index: 32;
}

.wb-fs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #0b0d14;
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.wb-fs-btn:hover {
  background: #1c2030;
}

.wb-shell.is-fullscreen .wb-fs-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.wb-shell.is-fullscreen .wb-fs-btn:hover {
  background: #f1f5f9;
}

/* ── Floating Pill Top Header (Matches Reference Capsule Design) ── */
.wb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: min(1180px, calc(100% - 28px));
  margin: 10px auto 4px;
  padding: 6px 10px 6px 12px;
  border-radius: 999px;
  background: #090b11;
  color: #f8fafc;
  flex-shrink: 0;
  gap: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 32px rgba(9, 11, 17, 0.22);
  z-index: 25;
}

.wb-header-sep {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.wb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: -0.15px;
  min-width: 0;
}

.wb-brand-title {
  color: #f8fafc;
  white-space: nowrap;
}

.wb-active-course-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
  color: #f1f5f9;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  max-width: 310px;
  transition: all 0.16s ease;
}

.wb-active-course-badge span:last-of-type {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-active-course-badge svg {
  color: #94a3b8;
  flex-shrink: 0;
}

.wb-active-course-badge:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.7);
}

.wb-active-course-badge.has-selection {
  border-color: rgba(16, 185, 129, 0.65);
  background: rgba(16, 185, 129, 0.12);
  color: #ecfdf5;
}

.wb-course-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.75);
  flex-shrink: 0;
}

.wb-logo-end {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  font-size: 12.5px;
  color: #ffffff;
  letter-spacing: 0.4px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #141824;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.wb-header-progress {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.wb-header-progress[hidden] {
  display: none !important;
}

.wb-header-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.wb-voice-picker {
  background: #141724;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 5px 11px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.wb-voice-picker:hover {
  background: #1c2032;
  border-color: rgba(255, 255, 255, 0.28);
}

.wb-drawer-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #a7f3d0;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.wb-drawer-toggle-btn:hover,
.wb-drawer-toggle-btn.is-open {
  background: #059669;
  border-color: #34d399;
  color: #ffffff;
}

.wb-icon-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--wb-pill);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  font-size: 14px;
}

.wb-icon-circle:hover {
  background: var(--wb-pill-hover);
  transform: translateY(-1px);
}

.wb-icon-circle.is-active {
  background: #059669;
  border-color: #34d399;
}

.wb-icon-circle.is-muted {
  background: #3f1d28;
  border-color: #f87171;
  color: #fca5a5;
}

.wb-icon-circle svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

/* ── Workspace Container: Canvas + Collapsible Right Drawer ── */
.wb-workspace-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  background: transparent;
  padding: 0 10px 10px;
  gap: 10px;
  overflow: hidden;
}

/* ── Whiteboard Dotted Canvas Stage (~Full Viewport) ── */
.wb-stage-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: transparent;
}

/* ── Left Vertical Drawing Toolbar (Matches Reference Mockup!) ── */
.wb-left-toolbar {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 22;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 6px;
  border-radius: 16px;
  background: rgba(15, 18, 28, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.wb-draw-tool {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.wb-draw-tool:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.wb-draw-tool.is-active {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.55);
  color: #34d399;
}

.wb-toolbar-sep {
  width: 22px;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 2px 0;
}

.wb-draw-svg-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 12;
}

.wb-canvas-scroll.is-draw-mode {
  cursor: crosshair;
}

.wb-canvas-scroll.is-text-mode {
  cursor: text;
}

.wb-canvas-scroll.is-eraser-mode {
  cursor: cell;
}

.wb-canvas-scroll.is-eraser-mode .wb-draw-svg-layer > * {
  pointer-events: stroke;
  cursor: cell;
}

.wb-canvas-scroll.is-eraser-mode .wb-user-sticky-note {
  cursor: cell;
}

.wb-user-sticky-note {
  position: absolute;
  min-width: 120px;
  max-width: 280px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fef9c3;
  border: 1.5px solid #eab308;
  color: #1e1b4b;
  font-family: var(--wb-hand-font);
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(234, 179, 8, 0.18);
  z-index: 13;
  outline: none;
}

/* ── Collapsible Right Drawer (Reference Image 1: Compact Dark Panel "خيارات السبورة") ── */
.wb-right-drawer {
  width: min(352px, 94vw);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #13161e 0%, #0b0d13 100%);
  color: #f8fafc;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
  z-index: 24;
}

.wb-right-drawer[hidden] {
  display: none !important;
}

.wb-rd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
}

.wb-rd-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 800;
  color: #f8fafc;
}

.wb-rd-title svg {
  color: #cbd5e1;
}

.wb-right-drawer-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.wb-rd-tab {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 6px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #94a3b8;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.wb-rd-tab svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.wb-rd-tab:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
}

.wb-rd-tab.is-active {
  background: rgba(16, 185, 129, 0.14);
  border-color: #10b981;
  color: #ecfdf5;
}

.wb-rd-tab.is-active svg {
  color: #34d399;
  opacity: 1;
}

.wb-rd-tab[hidden] {
  display: none !important;
}

.wb-rd-badge-row {
  display: flex;
  justify-content: flex-start;
}

.wb-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wb-field-title {
  font-size: 12px;
  font-weight: 800;
  color: #e2e8f0;
}

.wb-rd-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  transition: background 0.14s ease;
}

.wb-rd-close:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fecaca;
}

/* Settings Tab Inside Collapsible Right Drawer */
.wb-settings-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 2px;
}

.wb-settings-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wb-settings-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #94a3b8;
}

.wb-settings-select {
  width: 100%;
  background: #1a1d2c;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.wb-settings-select:focus {
  border-color: #10b981;
}

.wb-rd-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.wb-rd-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.wb-right-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wb-rd-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.wb-rd-pane[hidden] {
  display: none !important;
}

.wb-slides-outline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.wb-slides-outline[hidden] {
  display: none !important;
}

.wb-slides-outline-head {
  font-size: 12px;
  font-weight: 800;
  color: #a5b4fc;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wb-slides-outline-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wb-slide-outline-btn {
  text-align: right;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.wb-slide-outline-btn:hover {
  background: rgba(99, 102, 241, 0.16);
  color: #ffffff;
}

.wb-slide-outline-btn.is-current {
  border-color: #34d399;
  background: rgba(16, 185, 129, 0.16);
  color: #a7f3d0;
}

.wb-ask-idle-hint {
  padding: 16px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  color: #94a3b8;
  font-size: 12.5px;
  line-height: 1.65;
  text-align: center;
}

.wb-ask-idle-hint[hidden] {
  display: none !important;
}

/* Floating Canvas Controls Bar (Reference Image 2: Top-Left Pill + Top-Right Controls) */
.wb-floating-top {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  gap: 8px;
  pointer-events: none;
}

.wb-fs-brand-pill {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 6px 13px;
  border-radius: 999px;
  background: #0b0d14;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(11, 13, 20, 0.22);
  transition: background 0.15s ease;
}

.wb-fs-brand-pill:hover {
  background: #171b28;
}

.wb-shell.is-fullscreen .wb-fs-brand-pill {
  display: inline-flex;
}

.wb-fs-logo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.wb-fs-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.16);
}

.wb-fs-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.wb-fs-title {
  color: #e2e8f0;
  font-weight: 700;
}

.wb-fs-chevron {
  color: #94a3b8;
  font-size: 15px;
  line-height: 1;
}

.wb-lesson-top-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Hide extra playback clutter in Fullscreen Empty State (Match Reference Image 2 cleanly) */
.wb-shell.is-fullscreen:not(.has-lesson) .wb-lesson-top-controls {
  display: none;
}

.wb-top-undo-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #0b0d14;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 16px rgba(11, 13, 20, 0.18);
  overflow: hidden;
}

.wb-top-undo-pill button {
  background: transparent;
  border: none;
  color: #f8fafc;
  font-size: 13px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s ease;
}

.wb-top-undo-pill button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.wb-top-undo-pill button + button {
  border-inline-start: 1px solid rgba(255, 255, 255, 0.1);
}

.wb-fs-exit-circle {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0b0d14;
  color: #ffffff;
  font-size: 13px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(11, 13, 20, 0.22);
  transition: background 0.15s ease;
}

.wb-fs-exit-circle:hover {
  background: #dc2626;
}

.wb-shell.is-fullscreen .wb-fs-exit-circle {
  display: inline-flex;
}

.wb-zoom-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--wb-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.wb-shell.is-fullscreen .wb-zoom-pill {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.wb-zoom-pill button {
  background: transparent;
  border: none;
  color: #f8fafc;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
  height: 32px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.14s ease;
}

.wb-shell.is-fullscreen .wb-zoom-pill button {
  color: #0f172a;
}

.wb-zoom-pill button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.wb-shell.is-fullscreen .wb-zoom-pill button:hover {
  background: #f1f5f9;
}

#wbZoomResetBtn {
  font-size: 11px;
  color: #a5b4fc;
  min-width: 44px;
  border-inline: 1px solid rgba(255, 255, 255, 0.1);
}

.wb-shell.is-fullscreen #wbZoomResetBtn {
  color: #1e293b;
  border-inline: 1px solid #e2e8f0;
}

.wb-floating-group {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  flex-wrap: wrap;
}

.wb-history-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  pointer-events: auto;
}

.wb-history-hint {
  font-family: var(--wb-hand-font);
  font-size: 11.5px;
  color: #4f46a8;
  opacity: 0.85;
  user-select: none;
  padding-inline-end: 2px;
}

.wb-follow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0b0d14;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(11, 13, 20, 0.18);
  transition: all 0.15s ease;
}

.wb-follow-pill:hover {
  background: #171a26;
  color: #ffffff;
}

.wb-follow-pill.is-on {
  border-color: rgba(16, 185, 129, 0.55);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.16);
}

.wb-follow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
}

.wb-follow-pill.is-on .wb-follow-dot {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.85);
}

/* ── Interactive Pannable & Zoomable Board Surface ── */
.wb-canvas-scroll {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  cursor: grab;
  touch-action: none;
  padding: 54px 26px 24px 66px;
}

.wb-canvas-scroll.is-panning {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

.wb-canvas-inner {
  max-width: 1280px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform-origin: 0 0;
  will-change: transform;
}

/* ── Empty State (Matches Reference Centered Hero + 4 Quick Cards) ── */
.wb-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 50px 56px 32px;
  gap: 14px;
}

.wb-empty-icon-badge {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #ecfdf5;
  border: 1px solid #d1fae5;
  color: #059669;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.08);
  margin-bottom: 4px;
}

.wb-empty-title {
  font-family: var(--sans, 'Cairo', 'Tajawal', sans-serif);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  color: #161829;
  line-height: 1.4;
  max-width: 680px;
  margin: 0;
}

.wb-empty-sub {
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  max-width: 520px;
  margin: 0 0 12px;
}

.wb-empty-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.wb-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #d7dce8;
  background: #ffffff;
  color: #161829;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.wb-empty-btn:hover {
  border-color: #10b981;
  color: #065f46;
  background: #f0fdf4;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.12);
}

.wb-empty-btn svg {
  color: #10b981;
  flex-shrink: 0;
}

.wb-sample-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  max-width: 680px;
}

.wb-sample-chip {
  padding: 8px 15px;
  border-radius: 999px;
  border: 1.5px solid #d5d4ee;
  background: rgba(255, 255, 255, 0.86);
  color: var(--wb-ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  box-shadow: 0 2px 8px rgba(37, 33, 87, 0.05);
}

.wb-sample-chip:hover {
  border-color: #4f46e5;
  color: #3730a3;
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.12);
}

/* ── Loading Indicator on Board ── */
.wb-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 20px;
  text-align: center;
}

.wb-loading-ink {
  font-family: var(--wb-hand-font);
  font-size: 22px;
  color: var(--wb-ink);
}

.wb-loading-dots {
  display: inline-flex;
  gap: 7px;
}

.wb-loading-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4f46e5;
  animation: wbDotBounce 1.1s infinite ease-in-out;
}

.wb-loading-dots span:nth-child(2) { animation-delay: 0.15s; background: #2563eb; }
.wb-loading-dots span:nth-child(3) { animation-delay: 0.3s; background: #059669; }

@keyframes wbDotBounce {
  0%, 80%, 100% { transform: scale(0.55); opacity: 0.45; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* ── Active Lesson Header & Stage Stepper ── */
.wb-lesson-banner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 2px dashed rgba(37, 33, 87, 0.14);
}

.wb-lesson-title {
  font-family: var(--wb-hand-font);
  font-size: clamp(22px, 3vw, 31px);
  font-weight: 700;
  color: var(--wb-ink);
  line-height: 1.4;
}

.wb-stage-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wb-stage-pill {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1.5px solid #d5d4ee;
  background: rgba(255, 255, 255, 0.7);
  color: #5b578d;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.wb-stage-pill.is-done {
  border-color: #6ee7b7;
  background: #ecfdf5;
  color: #047857;
}

.wb-stage-pill.is-current {
  border-color: #4f46e5;
  background: #4f46e5;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* ── Live Board Elements & Progressive Handwriting Animations ── */
.wb-board-items {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wb-item {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.wb-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.wb-item.is-active-element {
  position: relative;
}

/* Handwritten Heading */
.wb-el-heading {
  font-family: var(--wb-hand-font);
  font-size: clamp(19px, 2.4vw, 25px);
  font-weight: 700;
  color: var(--wb-ink);
  line-height: 1.5;
  padding-bottom: 4px;
  border-bottom: 2.5px solid rgba(79, 70, 229, 0.28);
  display: inline-block;
  align-self: flex-start;
  max-width: 100%;
}

.wb-color-blue { color: var(--wb-blue) !important; border-color: rgba(37, 99, 235, 0.35) !important; }
.wb-color-emerald { color: var(--wb-emerald) !important; border-color: rgba(5, 150, 105, 0.35) !important; }
.wb-color-purple { color: var(--wb-purple) !important; border-color: rgba(124, 58, 237, 0.35) !important; }
.wb-color-amber { color: var(--wb-amber) !important; border-color: rgba(217, 119, 6, 0.35) !important; }
.wb-color-red { color: var(--wb-red) !important; border-color: rgba(220, 38, 38, 0.35) !important; }

/* Handwritten Notes & Lists */
.wb-el-note {
  font-family: var(--wb-hand-font);
  font-size: clamp(16px, 1.9vw, 19.5px);
  line-height: 1.85;
  color: var(--wb-ink);
  padding: 6px 12px;
  border-radius: 10px;
}

.wb-el-note.is-highlighted {
  background: linear-gradient(90deg, rgba(254, 240, 138, 0.65), rgba(254, 249, 195, 0.4));
  border-inline-start: 4px solid #eab308;
}

.wb-el-note ul {
  margin: 8px 0 0;
  padding-inline-start: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wb-el-note li {
  line-height: 1.75;
}

/* Editable Sticky Note Hover */
.wb-editable {
  cursor: text;
  transition: background 0.2s;
}

.wb-editable:focus {
  outline: 2px dashed #6366f1;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
}

/* Equation Card on Whiteboard */
.wb-el-equation {
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid #c7d2fe;
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 6px 20px rgba(37, 33, 87, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wb-eq-label {
  font-family: var(--wb-hand-font);
  font-size: 14px;
  font-weight: 700;
  color: #4338ca;
}

.wb-eq-math {
  direction: ltr;
  text-align: center;
  font-size: 1.25em;
  color: #1e1b4b;
  overflow-x: auto;
  padding: 6px 0;
  animation: wbInkSweepLtr calc(0.85s / var(--wb-speed, 1)) ease forwards;
}

.wb-eq-note {
  font-family: var(--wb-hand-font);
  font-size: 14.5px;
  color: #433f78;
  border-top: 1px dashed #d5d4ee;
  padding-top: 8px;
}

@keyframes wbInkSweepLtr {
  from { clip-path: inset(0 100% 0 0); opacity: 0.4; }
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}

/* ── Dedicated Programming Code Area on Whiteboard ── */
.wb-el-code {
  background: #131522;
  color: #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #2e3250;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  direction: ltr;
  text-align: left;
}

.wb-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: #1c1f33;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--wb-mono-font);
  font-size: 12px;
  color: #cbd5e1;
}

.wb-code-dots {
  display: inline-flex;
  gap: 6px;
}

.wb-code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.wb-code-dots span:nth-child(1) { background: #ef4444; }
.wb-code-dots span:nth-child(2) { background: #f59e0b; }
.wb-code-dots span:nth-child(3) { background: #10b981; }

.wb-code-body {
  padding: 12px 10px;
  font-family: var(--wb-mono-font);
  font-size: 13.5px;
  line-height: 1.75;
  overflow-x: auto;
}

.wb-code-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 2px 10px;
  border-radius: 6px;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.wb-code-line.is-typed {
  opacity: 1;
  transform: translateX(0);
}

.wb-code-line.is-active-line {
  background: rgba(16, 185, 129, 0.22);
  border-left: 3px solid #34d399;
}

.wb-code-ln {
  min-width: 24px;
  text-align: right;
  color: #64748b;
  user-select: none;
  font-size: 11.5px;
}

.wb-code-text {
  white-space: pre;
  color: #f8fafc;
}

.wb-code-note-inline {
  margin-inline-start: auto;
  direction: rtl;
  font-family: var(--wb-body-font);
  font-size: 11.5px;
  color: #86efac;
  background: rgba(16, 185, 129, 0.12);
  padding: 1px 8px;
  border-radius: 999px;
}

.wb-code-output {
  background: #0b0d17;
  border-top: 1px solid rgba(52, 211, 153, 0.25);
  padding: 10px 16px;
  font-family: var(--wb-mono-font);
  font-size: 12.5px;
  color: #6ee7b7;
}

.wb-code-output-label {
  font-family: var(--wb-body-font);
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 4px;
  direction: rtl;
  text-align: right;
}

/* ── SVG Live Diagram / Memory / Linked List Containers ── */
.wb-el-diagram {
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid #dcdbf4;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(37, 33, 87, 0.06);
  overflow-x: auto;
}

.wb-diagram-title {
  font-family: var(--wb-hand-font);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--wb-ink);
  margin-bottom: 10px;
}

.wb-svg-canvas {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  direction: ltr;
}

.wb-svg-stroke {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: wbDrawStroke calc(0.95s / var(--wb-speed, 1)) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.wb-svg-arrow {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: wbDrawStroke calc(0.75s / var(--wb-speed, 1)) ease forwards;
}

.wb-svg-label {
  opacity: 0;
  animation: wbFadeIn calc(0.4s / var(--wb-speed, 1)) ease forwards;
}

.wb-draw-line {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: wbDrawStroke calc(0.95s / var(--wb-speed, 1)) ease forwards;
}

@keyframes wbDrawStroke {
  to { stroke-dashoffset: 0; }
}

@keyframes wbFadeIn {
  to { opacity: 1; }
}

/* ── Callout Box (Common Mistakes / Tips) ── */
.wb-el-callout {
  padding: 12px 16px;
  border-radius: 14px;
  font-family: var(--wb-hand-font);
  font-size: 15.5px;
  line-height: 1.7;
  border: 2px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.wb-el-callout.tone-warning,
.wb-el-callout.tone-mistake {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.wb-el-callout.tone-tip {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
}

.wb-el-callout strong {
  display: block;
  margin-bottom: 4px;
}

/* ── Spoken Subtitle Strip (Non-overlapping inside flex footer) ── */
.wb-caption-bar {
  flex-shrink: 0;
  width: min(760px, calc(100% - 28px));
  margin: 0 auto 6px;
  background: rgba(20, 21, 31, 0.9);
  backdrop-filter: blur(8px);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 5px 12px;
  font-size: 11.5px;
  line-height: 1.45;
  text-align: center;
  z-index: 16;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  max-height: 44px;
  overflow-y: auto;
}

.wb-caption-bar.is-recovery-open,
.wb-caption-bar:has(.wb-recovery-actions) {
  max-height: none;
  overflow: visible;
  padding: 9px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.wb-recovery-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.wb-shell.is-fullscreen .wb-bottom-dock {
  background: transparent;
  padding-bottom: 16px;
}

/* ── Bottom Dark Pill Composer & Playback Controls (Non-obstructive Floating Bar) ── */
.wb-bottom-dock {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  padding: 6px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 20;
  background: linear-gradient(180deg, rgba(248, 249, 253, 0) 0%, rgba(248, 249, 253, 0.9) 42%, rgba(248, 249, 253, 0.98) 100%);
}

.wb-bottom-dock > * {
  width: min(760px, 100%);
}

.wb-playback-pill {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  width: auto !important;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(20, 21, 31, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.wb-playback-pill::-webkit-scrollbar {
  display: none;
}

.wb-ctrl-btn {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #f8fafc;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.wb-ctrl-btn.is-active {
  background: rgba(99, 102, 241, 0.28);
  border-color: rgba(129, 140, 248, 0.55);
  color: #e0e7ff;
}

.wb-composer-row[hidden] {
  display: none !important;
}

.wb-ctrl-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

.wb-ctrl-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.wb-ctrl-btn.is-primary {
  background: #10b981;
  border-color: #34d399;
  color: #052e16;
}

.wb-step-counter {
  font-size: 11.5px;
  font-weight: 700;
  color: #a5b4fc;
  padding: 0 6px;
}

.wb-composer-row {
  width: min(540px, 100%) !important;
  max-width: 540px !important;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
}

.wb-composer-pill {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #11131d;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.25);
}

.wb-composer-input {
  flex: 1 1 0%;
  width: 0;
  border: none;
  background: transparent;
  color: #ffffff;
  font-family: var(--sans, 'Segoe UI', sans-serif);
  font-size: 13px;
  line-height: 1.45;
  padding: 6px 4px;
  outline: none;
  min-width: 0;
  resize: none;
  max-height: 100px;
  overflow-y: auto;
}

.wb-tool-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}

.wb-tool-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.wb-tool-btn svg {
  width: 17px;
  height: 17px;
}

.wb-mic-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0e1018;
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 10px 26px rgba(13, 14, 22, 0.28);
  transition: all 0.16s ease;
}

.wb-mic-btn:hover {
  background: #1e2030;
}

.wb-mic-btn.is-listening {
  background: #dc2626;
  border-color: #f87171;
  color: #ffffff;
  animation: wbMicPulse 1.1s infinite;
}

@keyframes wbMicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55); }
  50% { box-shadow: 0 0 0 9px rgba(220, 38, 38, 0); }
}

.wb-mic-btn svg {
  width: 18px;
  height: 18px;
}

.wb-files-strip {
  width: min(460px, 100%) !important;
  max-width: 460px !important;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 14px;
  background: rgba(14, 16, 24, 0.94);
  border: 1px solid rgba(129, 140, 248, 0.28);
}

/* ── Overflow-Proof SVG ForeignObject Nodes & Edge Pills ── */
.wb-fo-node {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 14px;
  gap: 4px;
  font-family: var(--wb-hand-font, 'Caveat', 'Playpen Sans Arabic', cursive, sans-serif);
  box-sizing: border-box;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.wb-fo-title {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.25;
}

.wb-fo-sub {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  color: #475569;
}

.wb-fo-edge-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wb-fo-edge-pill {
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-family: var(--wb-hand-font, 'Caveat', 'Playpen Sans Arabic', cursive, sans-serif);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
}

.wb-file-thumb {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.wb-files-strip[hidden] {
  display: none !important;
}

.wb-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(129, 140, 248, 0.4);
  color: #e0e7ff;
  font-size: 11.5px;
  font-weight: 700;
  max-width: 240px;
}

.wb-file-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-file-chip.is-uploading {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde68a;
}

.wb-file-chip button {
  border: none;
  background: transparent;
  color: #fca5a5;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.wb-shell.is-dragover {
  outline: 3px dashed #10b981;
  outline-offset: -4px;
}

.wb-composer-input::placeholder {
  color: #94a3b8;
}

.wb-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #10b981;
  color: #052e16;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.16s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.wb-send-btn:hover:not(:disabled) {
  background: #34d399;
  color: #022c22;
  transform: scale(1.06);
}

.wb-send-btn:disabled {
  opacity: 0.45;
  cursor: wait;
}

.wb-send-btn svg {
  width: 16px;
  height: 16px;
}

.wb-course-popover {
  width: 100%;
  max-width: 100%;
  background: transparent;
  color: #f8fafc;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wb-course-popover[hidden] {
  display: none !important;
}

.wb-popover-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wb-popover-row select {
  flex: 1;
  min-width: 0;
  background: #1e2030;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12px;
}

.wb-ch-count {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #c7d2fe;
  white-space: nowrap;
}

.wb-chapter-checklist {
  max-height: 155px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wb-ch-empty {
  font-size: 11.5px;
  color: #94a3b8;
  padding: 8px;
  text-align: center;
}

.wb-ch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 12px;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.14s ease;
}

.wb-ch-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.wb-ch-item input[type="checkbox"] {
  accent-color: #10b981;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.wb-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.wb-switch-control {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.wb-switch-control input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.wb-switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.18s ease;
}

.wb-switch-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.18s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.wb-switch-control input:checked + .wb-switch-slider {
  background: #10b981;
}

.wb-switch-control input:checked + .wb-switch-slider::before {
  transform: translateX(18px);
}

/* ── Saved Boards History Drawer (Inside Collapsible Right Drawer) ── */
.wb-history-drawer {
  position: static;
  width: 100%;
  max-height: none;
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wb-history-drawer[hidden] {
  display: none !important;
}

.wb-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 800;
  font-size: 13px;
}

.wb-history-list {
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wb-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 0.15s;
}

.wb-history-item:hover {
  background: rgba(255, 255, 255, 0.11);
}

.wb-history-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wb-history-meta strong {
  font-size: 12.5px;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-history-meta small {
  font-size: 11px;
  color: #94a3b8;
}

.wb-history-del {
  background: transparent;
  border: none;
  color: #fca5a5;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12px;
}

.wb-history-del:hover {
  background: rgba(239, 68, 68, 0.18);
}

@media (max-width: 900px) {
  .wb-shell {
    height: calc(100dvh - 210px);
    min-height: 460px;
    margin-bottom: calc(var(--account-dock-height, 76px) + 14px);
    border-radius: 14px;
  }
  .wb-header {
    width: calc(100% - 12px);
    margin: 6px auto 4px;
    border-radius: 16px;
    padding: 7px 10px;
    gap: 6px;
    flex-direction: column;
    align-items: stretch;
  }
  .wb-header-sep {
    display: none;
  }
  .wb-brand {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 5px 8px;
    font-size: 13.5px;
  }
  .wb-logo-end {
    font-size: 11.5px;
    padding: 3px 8px;
  }
  .wb-active-course-badge {
    max-width: 100%;
    font-size: 10.5px;
    padding: 3px 8px;
  }
  .wb-header-right {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
  }
  .wb-workspace-body {
    padding: 0 6px 6px;
  }
  .wb-right-drawer {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 6px;
    width: min(320px, calc(100% - 12px));
    z-index: 32;
  }
  .wb-left-toolbar {
    left: 6px;
    padding: 5px 4px;
    gap: 3px;
    border-radius: 12px;
  }
  .wb-draw-tool {
    width: 30px;
    height: 30px;
  }
  .wb-fs-btn {
    padding: 4px 10px;
    font-size: 11px;
  }
  .wb-pdf-btn,
  .wb-drawer-toggle-btn {
    padding: 4px 9px;
    font-size: 11px;
  }
  .wb-voice-picker {
    max-width: calc(50% - 4px);
    flex: 1 1 100px;
    min-width: 0;
    font-size: 10.5px;
    padding: 4px 7px;
  }
  .wb-floating-top {
    top: 6px;
    left: 6px;
    right: 6px;
    padding: 0;
    flex-wrap: wrap;
    gap: 6px;
  }
  .wb-floating-group {
    max-width: 100%;
    gap: 5px;
  }
  .wb-top-undo-pill {
    display: none;
  }
  .wb-zoom-pill button {
    padding: 4px 6px;
    height: 28px;
    font-size: 11px;
  }
  #wbZoomResetBtn {
    min-width: 36px;
    font-size: 10px;
  }
  .wb-canvas-scroll {
    padding: 44px 12px 16px 44px;
    overflow: hidden;
    touch-action: none;
  }
  .wb-empty-state {
    padding: 18px 10px 14px;
    gap: 10px;
  }
  .wb-empty-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .wb-empty-title {
    font-size: 20px;
  }
  .wb-empty-sub {
    font-size: 12px;
    margin-bottom: 4px;
  }
  .wb-empty-actions {
    gap: 8px;
  }
  .wb-empty-btn {
    padding: 8px 13px;
    font-size: 12px;
  }
  .wb-bottom-dock {
    padding: 4px 8px 8px;
  }
  .wb-composer-row {
    width: 100% !important;
    max-width: 100% !important;
    gap: 5px;
  }
  .wb-composer-pill {
    padding: 4px 8px 4px 4px;
    gap: 3px;
    border-radius: 22px;
  }
  .wb-composer-input {
    font-size: 12.5px;
    padding: 5px 3px;
  }
  .wb-tool-btn {
    width: 28px;
    height: 28px;
  }
  .wb-tool-btn svg {
    width: 15px;
    height: 15px;
  }
  .wb-send-btn {
    width: 32px;
    height: 32px;
  }
  .wb-mic-btn {
    width: 36px;
    height: 36px;
  }
  .wb-mic-btn svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-height: 540px) {
  .wb-shell:not(.is-fullscreen) {
    min-height: 320px;
    height: 82dvh;
  }
  .wb-header {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    padding: 4px 8px !important;
    gap: 5px !important;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .wb-header::-webkit-scrollbar { display: none; }
  .wb-brand { display: none !important; }
  .wb-header-right {
    flex-wrap: nowrap !important;
    width: auto !important;
    gap: 5px !important;
  }
  .wb-voice-picker {
    max-width: 135px !important;
    flex: 0 0 auto !important;
    padding: 3px 7px !important;
    font-size: 10.5px !important;
  }
  .wb-floating-top {
    top: 4px;
    left: 6px;
    right: 6px;
  }
  .wb-icon-circle {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .wb-follow-pill {
    padding: 4px 9px;
    font-size: 10.5px;
  }
  .wb-canvas-scroll {
    padding: 36px 10px 10px !important;
  }
  .wb-lesson-banner {
    padding: 4px 0 6px;
    margin-bottom: 6px;
  }
  .wb-lesson-title {
    font-size: 18px;
  }
  .wb-bottom-dock {
    padding: 2px 6px 5px !important;
    gap: 4px !important;
  }
  .wb-empty-state {
    padding: 8px 10px;
    gap: 8px;
  }
  .wb-empty-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .wb-empty-title {
    font-size: 20px;
  }
  .wb-empty-sub {
    display: none;
  }
}

/* ── Live Student Daily AI Quota Badge in Whiteboard Header ── */
.wb-quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.36);
  color: #a7f3d0;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.wb-quota-pill[hidden] {
  display: none !important;
}

.wb-quota-pill.is-low {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde68a;
}

.wb-quota-pill.is-empty {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.42);
  color: #fecaca;
}

@media (max-width: 640px) {
  .wb-quota-pill {
    font-size: 10.5px;
    padding: 4px 8px;
  }
}

/* ── PDF Export Button ── */
.wb-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.45);
  background: rgba(99, 102, 241, 0.18);
  color: #e0e7ff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.wb-pdf-btn[hidden] {
  display: none !important;
}

.wb-pdf-btn:hover {
  background: rgba(99, 102, 241, 0.34);
  color: #ffffff;
}

.wb-ctrl-btn.is-ask {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}

.wb-ctrl-btn.is-ask:hover {
  background: rgba(245, 158, 11, 0.3);
}

/* ── Pause & Ask Teacher Panel (Inside Collapsible Right Drawer) ── */
.wb-ask-panel {
  width: 100%;
  max-width: 100%;
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  color: #f8fafc;
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.wb-ask-panel[hidden] {
  display: none !important;
}

.wb-ask-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fde68a;
}

.wb-ask-messages {
  flex: 1;
  min-height: 80px;
  max-height: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wb-ask-msg {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.65;
}

.wb-ask-msg.is-user {
  background: rgba(99, 102, 241, 0.22);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #e0e7ff;
  align-self: flex-start;
}

.wb-ask-msg.is-teacher {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #ecfdf5;
}

.wb-ask-msg-title {
  font-weight: 800;
  font-size: 12px;
  color: #6ee7b7;
  margin-bottom: 3px;
}

.wb-ask-pin-btn {
  margin-top: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.45);
  background: rgba(99, 102, 241, 0.2);
  color: #e0e7ff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.wb-ask-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wb-ask-input {
  flex: 1;
  min-width: 0;
  background: #1e2030;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  outline: none;
  resize: none;
  max-height: 110px;
  overflow-y: auto;
}

.wb-ask-input:focus {
  border-color: #fbbf24;
}

/* ── Whiteboard Comparison Table ── */
.wb-el-table {
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 14px;
  overflow-x: auto;
  box-shadow: 0 4px 16px rgba(30, 27, 75, 0.06);
}

.wb-table-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #1e1b4b;
  margin-bottom: 10px;
}

.wb-table-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  color: #1e293b;
}

.wb-table-grid th,
.wb-table-grid td {
  border: 1px solid #cbd5e1;
  padding: 9px 11px;
  text-align: right;
  vertical-align: top;
}

.wb-table-grid th {
  background: #eef2ff;
  color: #312e81;
  font-weight: 800;
}

.wb-table-grid tr:nth-child(even) td {
  background: #f8fafc;
}

/* ── Medical / Biology Anatomy Diagram ── */
.wb-el-anatomy {
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid #fecdd3;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 6px 20px rgba(190, 18, 60, 0.06);
}

.wb-anatomy-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 14px;
  align-items: center;
}

.wb-anatomy-labels {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wb-anatomy-label-card {
  padding: 8px 11px;
  border-radius: 10px;
  border-inline-start: 4px solid #e11d48;
  background: #fff1f2;
  color: #1e1b4b;
  font-size: 13px;
}

.wb-anatomy-label-card.wb-color-blue { border-inline-start-color: #2563eb; background: #eff6ff; }
.wb-anatomy-label-card.wb-color-emerald { border-inline-start-color: #059669; background: #ecfdf5; }
.wb-anatomy-label-card.wb-color-purple { border-inline-start-color: #7c3aed; background: #f5f3ff; }
.wb-anatomy-label-card.wb-color-amber { border-inline-start-color: #d97706; background: #fffbeb; }
.wb-anatomy-label-card.wb-color-indigo { border-inline-start-color: #4338ca; background: #eef2ff; }

.wb-anatomy-label-card strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 2px;
}

.wb-anatomy-label-card span {
  font-size: 12.5px;
  color: #475569;
}

@media (max-width: 720px) {
  .wb-anatomy-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Interactive Inline Checkpoint Quiz ── */
.wb-el-quiz {
  background: #fffbeb;
  border: 2px solid #f59e0b;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.12);
  color: #1e1b4b;
}

.wb-quiz-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11.5px;
  font-weight: 800;
  margin-bottom: 8px;
}

.wb-quiz-q {
  font-size: 16px;
  font-weight: 800;
  color: #1e1b4b;
  margin-bottom: 12px;
}

.wb-quiz-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.wb-quiz-opt {
  text-align: right;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wb-quiz-opt:hover:not(:disabled) {
  border-color: #4f46e5;
  background: #eef2ff;
}

.wb-quiz-opt.is-correct {
  border-color: #059669;
  background: #d1fae5;
  color: #065f46;
}

.wb-quiz-opt.is-wrong {
  border-color: #dc2626;
  background: #fee2e2;
  color: #991b1b;
}

.wb-quiz-feedback {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wb-quiz-continue-btn {
  align-self: flex-start;
  padding: 7px 16px;
  border-radius: 999px;
  border: none;
  background: #10b981;
  color: #052e16;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

/* ── Live On-Board Q&A Drawing Section & Continue Chapter Card ── */
.wb-qa-section {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(238, 242, 255, 0.72);
  border: 2px dashed #6366f1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wb-qa-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 999px;
  background: #4338ca;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.wb-continue-card {
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 2px solid #10b981;
  box-shadow: 0 10px 26px rgba(16, 185, 129, 0.14);
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #1e1b4b;
}

.wb-continue-q {
  font-family: var(--wb-hand-font);
  font-size: 19px;
  font-weight: 700;
  color: #065f46;
}

.wb-continue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wb-continue-yes {
  padding: 8px 18px;
  border-radius: 999px;
  border: none;
  background: #10b981;
  color: #052e16;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease;
}

.wb-continue-yes:hover:not(:disabled) {
  background: #059669;
  color: #ffffff;
  transform: translateY(-1px);
}

.wb-continue-no {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid #6366f1;
  background: #eef2ff;
  color: #312e81;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s ease;
}

.wb-continue-no:hover:not(:disabled) {
  background: #4338ca;
  color: #ffffff;
}

.wb-continue-reply {
  font-size: 13.5px;
  color: #312e81;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  background: #eef2ff;
  border-inline-start: 4px solid #6366f1;
}

/* ── Live Adaptive Highlighter (Yellow Primary + Soft Red for Warnings/Contrast) ── */
.wb-w {
  display: inline;
  padding: 1px 4px;
  margin: 0 -2px;
  border-radius: 6px 8px 5px 7px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  background-repeat: no-repeat;
  background-position: 100% 62%;
  background-size: 0% 86%;
  transition: background-size 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}

.wb-w.wb-hl-yellow {
  background-image: linear-gradient(104deg, rgba(254, 240, 138, 0.28) 0%, rgba(253, 224, 71, 0.92) 10%, rgba(254, 240, 138, 0.88) 90%, rgba(253, 224, 71, 0.32) 100%);
}

.wb-w.wb-hl-red {
  background-image: linear-gradient(104deg, rgba(254, 202, 202, 0.28) 0%, rgba(248, 113, 113, 0.72) 10%, rgba(252, 165, 165, 0.7) 90%, rgba(248, 113, 113, 0.28) 100%);
}

.wb-w.is-hl-active {
  background-size: 100% 88%;
}

/* Non-destructive SVG <text>/<tspan> occurrence highlight (preserves SVG geometry & accessibility) */
.wb-svg-w.is-hl-active,
.wb-svg-label.is-hl-active {
  fill: #1e1b4b;
  font-weight: 800;
  filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.95)) drop-shadow(0 0 9px rgba(253, 224, 71, 0.85));
}

/* Non-destructive KaTeX leaf token highlight (zero layout/box-metric mutation) */
.wb-katex-tok.is-hl-active {
  background-color: rgba(253, 224, 71, 0.88);
  border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.72);
}

/* Soft highlighter focus accent on the active board block (equations, diagrams, analogies, tables, code) */
.wb-item.is-speaking-now > .wb-el-equation,
.wb-item.is-speaking-now > .wb-el-diagram,
.wb-item.is-speaking-now > .wb-el-analogy,
.wb-item.is-speaking-now > .wb-el-table,
.wb-item.is-speaking-now > .wb-el-anatomy,
.wb-item.is-speaking-now > .wb-el-callout {
  box-shadow: 0 0 0 3px rgba(253, 224, 71, 0.78), 0 10px 28px rgba(234, 179, 8, 0.16);
  transition: box-shadow 0.22s ease;
}

/* ── Persistent Chapter Step Divider on Continuous Whiteboard ── */
.wb-step-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1.5px dashed rgba(99, 102, 241, 0.22);
}

.wb-step-section:last-child {
  border-bottom: none;
}

.wb-step-divider {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(67, 56, 202, 0.1);
  border: 1px solid rgba(67, 56, 202, 0.28);
  color: #312e81;
  font-size: 12px;
  font-weight: 800;
}

/* ── Side-by-Side Classroom Layout (Main Explanation + Side-Margin Example Sketch) ── */
.wb-step-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.wb-step-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
}

.wb-step-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.wb-step-aside[hidden] {
  display: none !important;
}

.wb-step-layout.has-side-sketch {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.92fr);
  gap: 22px;
}

.wb-step-layout.has-side-sketch .wb-step-main {
  max-width: none;
  margin: 0;
}

.wb-step-layout.has-side-sketch.is-aside-right {
  grid-template-columns: minmax(300px, 0.92fr) minmax(0, 1.45fr);
}

.wb-step-layout.has-side-sketch.is-aside-right .wb-step-aside {
  order: -1;
}

@media (max-width: 860px) {
  .wb-step-layout.has-side-sketch,
  .wb-step-layout.has-side-sketch.is-aside-right {
    grid-template-columns: minmax(0, 1fr);
  }
  .wb-step-layout.has-side-sketch.is-aside-right .wb-step-aside {
    order: 0;
  }
}

.wb-el-analogy.is-side-sketch {
  background: rgba(255, 251, 235, 0.42);
  border: 2px dashed rgba(217, 119, 6, 0.45);
  border-radius: 22px 14px 20px 16px / 14px 20px 16px 22px;
  padding: 12px 14px 10px;
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.06);
}

.wb-sketch-label-box.is-side-lbl {
  align-items: flex-start;
  justify-content: center;
  text-align: right;
  padding-inline: 4px;
}

.wb-sketch-arrow-label.is-side-arr {
  justify-content: flex-end;
  text-align: right;
  padding-inline-end: 6px;
}

/* ── Hand-Drawn Classroom Chalk/Marker Example Sketch (No Polished Infographic — Pure Rough Ink!) ── */
.wb-el-analogy {
  background: transparent;
  border: 2px dashed rgba(51, 65, 85, 0.34);
  border-radius: 20px 14px 22px 16px / 14px 22px 16px 20px;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wb-analogy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.wb-analogy-title {
  font-family: var(--wb-hand-font);
  font-size: 22px;
  font-weight: 700;
  color: #1e1b4b;
  text-decoration: underline wavy rgba(245, 158, 11, 0.65);
  text-underline-offset: 5px;
}

.wb-analogy-flow-tag {
  padding: 2px 10px;
  border-radius: 12px 6px 10px 8px;
  background: rgba(254, 240, 138, 0.55);
  border: 1.5px dashed #ca8a04;
  color: #713f12;
  font-family: var(--wb-hand-font);
  font-size: 14px;
  font-weight: 700;
}

.wb-sketch-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.wb-sketch-part {
  opacity: 0;
  transition: opacity 0.28s ease;
}

.wb-sketch-part.is-drawn {
  opacity: 1;
}

.wb-sketch-part .wb-sketch-stroke {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
}

.wb-sketch-part.is-drawn .wb-sketch-stroke {
  animation: wbSketchDraw calc(1.05s / var(--wb-speed, 1)) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes wbSketchDraw {
  to { stroke-dashoffset: 0; }
}

.wb-sketch-part.is-sketch-active .wb-sketch-halo {
  opacity: 0.72 !important;
  transition: opacity 0.25s ease;
}

.wb-sketch-halo {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.wb-sketch-label-box {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: 2px;
  font-family: var(--wb-hand-font, 'Caveat', 'Playpen Sans Arabic', cursive, sans-serif);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.wb-sketch-role {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.2;
  color: #1e1b4b;
}

.wb-sketch-map {
  font-size: 12.5px;
  font-weight: 700;
  color: #4338ca;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.1);
}

.wb-sketch-detail {
  font-size: 13px;
  color: #475569;
  line-height: 1.25;
}

.wb-sketch-arrow-label {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--wb-hand-font, 'Caveat', 'Playpen Sans Arabic', cursive, sans-serif);
  font-size: 13px;
  font-weight: 700;
  color: #b45309;
  line-height: 1.2;
}

@media print {
  .wb-sketch-part { opacity: 1 !important; }
  .wb-sketch-part .wb-sketch-stroke { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; animation: none !important; }
}

/* ── Board Language Display Modes (Both / Arabic Only / English Only) ── */
.wb-shell[data-lang-mode="ar"] [data-bilingual="1"] .wb-seg-en,
.wb-shell[data-lang-mode="ar"] [data-bilingual="1"] .wb-lang-en,
.wb-pdf-root[data-lang-mode="ar"] [data-bilingual="1"] .wb-seg-en,
.wb-pdf-root[data-lang-mode="ar"] [data-bilingual="1"] .wb-lang-en {
  display: none !important;
}

.wb-shell[data-lang-mode="en"] [data-bilingual="1"] .wb-seg-ar,
.wb-shell[data-lang-mode="en"] [data-bilingual="1"] .wb-lang-ar,
.wb-pdf-root[data-lang-mode="en"] [data-bilingual="1"] .wb-seg-ar,
.wb-pdf-root[data-lang-mode="en"] [data-bilingual="1"] .wb-lang-ar {
  display: none !important;
}

.wb-shell[data-lang-mode="en"] .wb-step-main [data-bilingual="1"] {
  direction: auto;
}

/* Never hide programming code or KaTeX formulas */
.wb-el-code .wb-lang-en,
.wb-el-code .wb-lang-ar,
.wb-eq-math .wb-lang-en,
.wb-eq-math .wb-lang-ar {
  display: inline !important;
}

/* ── Phase 1A: Freeze All Board Animations at Exact Progress on Pause ── */
.wb-shell.is-paused .wb-board-items *,
.wb-shell.is-paused .wb-board-items *::before,
.wb-shell.is-paused .wb-board-items *::after {
  animation-play-state: paused !important;
}

/* ── Phase 1C: Inline Buffering Indicator (>350ms fetch) ── */
.wb-buffering-pill {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 26;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(129, 140, 248, 0.45);
  color: #e0e7ff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  pointer-events: none;
}

.wb-buffering-pill[hidden] {
  display: none !important;
}

.wb-buf-spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(165, 180, 252, 0.35);
  border-top-color: #34d399;
  animation: wbSpin 0.75s linear infinite;
}

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

/* ── Phase 2B: Controlled Voice Lock Recovery Actions ── */
.wb-recovery-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}
