/* =========================================================================
   Interactive SVG Matching, Worksheet Experience, and Concept Pages Styles
   ========================================================================= */

/* --- 1. Interactive SVG Matching (Dual Mode) --- */
.interactive-svg-matching {
  margin: 1.25rem 0;
  position: relative;
  user-select: none;
}

.matching-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.matching-instruction {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
}

.matching-instruction-icon {
  font-size: 1.15rem;
  color: #f59e0b;
}

.matching-clear-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #64748b;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.matching-clear-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: #334155;
}

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

.matching-interactive-stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 140px 1fr;
  align-items: stretch;
  gap: 0;
  min-height: 260px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.25rem 1rem;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.02);
}

.matching-wire-svg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  overflow: visible;
}

.wire-badge-btn {
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s ease;
}

.wire-badge-btn:hover {
  transform: scale(1.2);
}

.wire-dash-animation {
  animation: wireDashMove 1.2s linear infinite;
}

@keyframes wireDashMove {
  from { stroke-dashoffset: 20; }
  to { stroke-dashoffset: 0; }
}

.matching-wire-live {
  fill: none;
  stroke: #6366f1;
  stroke-width: 3.5;
  stroke-dasharray: 6, 6;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.5));
}

.matching-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  z-index: 2;
}

.matching-col-heading {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.matching-col-right .matching-col-heading {
  text-align: right;
}

.matching-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 56px;
}

.matching-tile:hover {
  border-color: #94a3b8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.matching-tile.is-selected {
  border-color: #6366f1;
  background: #f5f3ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  transform: scale(1.02);
}

.matching-tile.is-matched {
  border-color: var(--wire-color, #10b981);
  background: #ffffff;
  box-shadow: 0 0 0 2px var(--wire-glow, rgba(16, 185, 129, 0.2));
}

.matching-badge {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eeecff;
  color: #4f46e5;
  font-size: 0.85rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.matching-badge.badge-num {
  background: #e0f2fe;
  color: #0284c7;
  order: 3;
}

.matching-tile-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.matching-card-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.35;
}

.matching-card-svg-thumb {
  max-width: 140px;
  max-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.matching-card-svg-thumb svg {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
}

.matching-pin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  touch-action: none;
  flex-shrink: 0;
  pointer-events: auto;
  z-index: 10;
}

.pin-inner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  transition: all 0.2s ease;
}

.matching-pin:hover {
  transform: scale(1.3);
  border-color: #6366f1;
}

.matching-pin:hover .pin-inner {
  background: #6366f1;
}

.matching-pin.connected {
  border-color: var(--wire-color, #10b981);
  background: #ffffff;
}

.matching-pin.connected .pin-inner {
  background: var(--wire-color, #10b981);
}

.matching-col-left .matching-pin {
  margin-left: auto;
  margin-right: -21px;
}

.matching-col-right .matching-pin {
  margin-right: auto;
  margin-left: -21px;
  order: 1;
}

.matching-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #cbd5e1;
}

.matching-count {
  font-size: 0.85rem;
  font-weight: 800;
  color: #475569;
}

.matching-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.matching-wire-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1.5px solid currentColor;
}

.chip-remove-btn {
  background: none;
  border: none;
  color: currentColor;
  font-size: 0.85rem;
  font-weight: 900;
  cursor: pointer;
  padding: 0 2px;
  border-radius: 50%;
}

.chip-remove-btn:hover {
  transform: scale(1.2);
}

/* --- 2. Modern De-Cluttered Worksheet Shell & Layout --- */

/* =========================================================================
   Zero-Scroll Viewport Optimization: Fill Screen & Eliminate Dead Space
   ========================================================================= */
body.worksheet-active-mode,
.dashboard-shell.worksheet-active-mode {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
}

body.worksheet-active-mode .dashboard-main,
.dashboard-shell.worksheet-active-mode .dashboard-main,
.dashboard-main.worksheet-active-mode,
.dashboard-main:has(.inline-sheet-shell),
.dashboard-shell:has(.inline-sheet-shell) .dashboard-main,
.dashboard-shell[data-portal-role="student"]:has(.inline-sheet-shell) .dashboard-main,
.live-class-page .dashboard-main,
.live-class-mode .dashboard-main {
  padding: 8px 24px 10px !important;
  height: 100vh !important;
  max-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

body.worksheet-active-mode .topbar,
.dashboard-shell.worksheet-active-mode .topbar,
.dashboard-main:has(.inline-sheet-shell) .topbar,
.dashboard-shell:has(.inline-sheet-shell) .topbar,
.live-class-mode .topbar {
  margin-bottom: 6px !important;
  flex: 0 0 auto !important;
}

body.worksheet-active-mode #content,
.dashboard-shell.worksheet-active-mode #content,
.dashboard-main:has(.inline-sheet-shell) #content,
.dashboard-shell:has(.inline-sheet-shell) #content,
.live-class-mode #content {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

/* Ensure the workspace layout and question pane stretch to 100% of #content */
.practice-workspace-layout.workspace-closed,
.live-split-workspace.workspace-closed {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  margin: 0 !important;
  width: 100% !important;
}

.practice-workspace-layout.workspace-closed > .live-question-pane,
.live-split-workspace.workspace-closed > .live-question-pane {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  align-self: stretch !important;
  width: 100% !important;
}

.practice-workspace-layout.workspace-closed > .live-workspace-pane,
.live-split-workspace.workspace-closed > .live-workspace-pane {
  display: none !important;
}

/* Position the optional Workspace button cleanly in the header without overlapping counters */
.focus-top .optional-workspace-controls,
.practice-workspace-layout.workspace-closed .optional-workspace-controls,
.live-split-workspace.workspace-closed .optional-workspace-controls {
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  z-index: auto !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
}

.optional-workspace-controls .workspace-open-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
  border: 1px solid #c7ded5 !important;
  background: #edf8f3 !important;
  color: #08755a !important;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.15s ease !important;
}

.optional-workspace-controls .workspace-open-button:hover {
  background: #dff4eb !important;
  border-color: #a8d9c7 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(8, 117, 90, 0.15) !important;
}

.inline-sheet-shell,
.live-question-pane > .inline-sheet-shell {
  max-width: 1060px !important;
  width: 100% !important;
  margin: 0 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  background: #ffffff !important;
  border: 1.5px solid var(--line, #e6eaf2) !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06) !important;
  box-sizing: border-box !important;
}

.inline-sheet-shell .focus-sheet {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* De-crowded, elegant, single-row header bar */
.inline-sheet-shell .focus-top,
.live-split-workspace .focus-top,
.practice-workspace-layout .focus-top {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  grid-template-columns: none !important;
  gap: 1rem !important;
  padding: 0.75rem 1.75rem !important;
  border-bottom: 1px solid #edf2f7 !important;
  background: #ffffff !important;
  width: 100% !important;
  box-sizing: border-box !important;
  position: relative !important;
}

/* In live class, hide the redundant/confusing "Back to live class" button since student is already in live class */
.live-class-page .inline-sheet-shell .focus-close,
.live-class-mode .inline-sheet-shell .focus-close,
[data-portal-view="live"] .inline-sheet-shell .focus-close,
.student-live-practice-head ~ .inline-sheet-shell .focus-close {
  display: none !important;
}

/* Unified, sleek pill button for Back to Chapter */
.inline-sheet-shell .focus-close,
.live-split-workspace .focus-close,
.practice-workspace-layout .focus-close {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  color: #334155 !important;
  font-size: 0.82rem !important;
  font-weight: 750 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.15s ease !important;
}

.inline-sheet-shell .focus-close:hover,
.live-split-workspace .focus-close:hover,
.practice-workspace-layout .focus-close:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

.inline-sheet-shell .focus-close span,
.live-split-workspace .focus-close span,
.practice-workspace-layout .focus-close span {
  display: inline-block !important;
  font-size: 0.95rem !important;
  line-height: 1 !important;
  margin: 0 !important;
}

/* Center group: Title + Progress bar with Speaker button */
.inline-sheet-shell .focus-top > div:has(> .focus-progress-wrap),
.live-split-workspace .focus-top > div:has(> .focus-progress-wrap),
.practice-workspace-layout .focus-top > div:has(> .focus-progress-wrap) {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  margin: 0 0.75rem !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.inline-sheet-shell .focus-top .eyebrow {
  margin: 0 0 2px !important;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: var(--primary, #6558e8) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Status / progress bar container with speaker beside it */
.inline-sheet-shell .focus-progress-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  margin: 3px 0 !important;
}

.inline-sheet-shell .focus-progress-wrap > .focus-top-actions {
  align-self: center !important;
}

.inline-sheet-shell .focus-progress {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 8px !important;
  background: #f1f5f9 !important;
  border-radius: 99px !important;
  overflow: hidden !important;
  margin: 0 !important;
  min-width: 0 !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

.inline-sheet-shell .focus-progress span {
  display: block !important;
  height: 100% !important;
  background: linear-gradient(90deg, var(--primary, #6558e8), var(--accent, #21b79b)) !important;
  border-radius: 99px !important;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Speaker toggle button beside status bar */
.inline-sheet-shell .sound-toggle-btn {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  border-radius: 50% !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #ffffff !important;
  font-size: 1.1rem !important;
  line-height: 1 !important;
  cursor: pointer !important;
  color: #334155 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
  transition: all 0.15s ease !important;
  padding: 0 !important;
  margin: 0 !important;
}

.inline-sheet-shell .sound-toggle-btn:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  transform: scale(1.08) !important;
}

.inline-sheet-shell .focus-top small {
  margin: 2px 0 0 !important;
  font-size: 0.76rem !important;
  color: #64748b !important;
  font-weight: 600 !important;
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Right side actions: Concept Page pill & practice counters */
.inline-sheet-shell .focus-top-actions,
.live-split-workspace .focus-top-actions,
.practice-workspace-layout .focus-top-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

.inline-sheet-shell .focus-top-actions > .concept-page-pill,
.inline-sheet-shell .focus-top-actions .workspace-open-button {
  width: 148px !important;
  min-width: 148px !important;
}

.inline-sheet-shell .concept-page-pill,
.live-split-workspace .concept-page-pill,
.practice-workspace-layout .concept-page-pill {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  font-size: 0.82rem !important;
  font-weight: 750 !important;
  white-space: nowrap !important;
  background: #faf5ff !important;
  border: 1.5px solid #e9d5ff !important;
  color: #7e22ce !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  box-shadow: 0 1px 3px rgba(126, 34, 206, 0.08) !important;
  transition: all 0.15s ease !important;
}

.inline-sheet-shell .concept-page-pill:hover,
.live-split-workspace .concept-page-pill:hover,
.practice-workspace-layout .concept-page-pill:hover {
  background: #f3e8ff !important;
  border-color: #d8b4fe !important;
  color: #6b21a8 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(126, 34, 206, 0.16) !important;
}

.topbar-sound-btn {
  display: none !important;
}

.inline-sheet-shell .practice-counters,
.live-split-workspace .practice-counters,
.practice-workspace-layout .practice-counters {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 6px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 999px !important;
  padding: 3px 8px !important;
  height: 36px !important;
  box-sizing: border-box !important;
  position: static !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
}

.inline-sheet-shell .practice-counters span,
.live-split-workspace .practice-counters span,
.practice-workspace-layout .practice-counters span {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  border-radius: 50% !important;
  display: inline-grid !important;
  place-items: center !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  margin: 0 !important;
}

.inline-sheet-shell .practice-counters span b,
.live-split-workspace .practice-counters span b,
.practice-workspace-layout .practice-counters span b {
  font-size: 0.78rem !important;
  line-height: 1 !important;
}

/* Stable worksheet header: align controls with the tracker without reparenting
   workflow-owned DOM nodes. */
.inline-sheet-shell .focus-top {
  display: grid !important;
  grid-template-columns: auto minmax(220px, 1fr) auto auto !important;
  grid-template-rows: auto 36px auto !important;
  column-gap: 10px !important;
  row-gap: 2px !important;
  align-items: center !important;
}

.inline-sheet-shell .focus-top > .focus-close {
  grid-column: 1 !important;
  grid-row: 1 / 4 !important;
}

.inline-sheet-shell .focus-top > div:has(> .focus-progress-wrap) {
  display: contents !important;
}

.inline-sheet-shell .focus-top > div:has(> .focus-progress-wrap) > .eyebrow {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

.inline-sheet-shell .focus-top > div:has(> .focus-progress-wrap) > .focus-progress-wrap {
  grid-column: 2 !important;
  grid-row: 2 !important;
}

.inline-sheet-shell .focus-top > div:has(> .focus-progress-wrap) > small {
  grid-column: 2 !important;
  grid-row: 3 !important;
}

.inline-sheet-shell .focus-top > .focus-top-actions {
  grid-column: 3 !important;
  grid-row: 2 !important;
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  height: 36px !important;
}

.dashboard-shell.live-class-mode .inline-sheet-shell .focus-top-actions > .optional-workspace-controls.workspace-controls-closed {
  position: static !important;
  inset: auto !important;
  display: inline-flex !important;
  width: 148px !important;
  min-width: 148px !important;
  height: 36px !important;
  min-height: 36px !important;
  align-items: center !important;
  align-self: center !important;
}

.dashboard-shell.live-class-mode .inline-sheet-shell .focus-top-actions > .optional-workspace-controls.workspace-controls-closed > .workspace-open-button {
  width: 148px !important;
  min-width: 148px !important;
}

.inline-sheet-shell .focus-top > .practice-counters {
  grid-column: 4 !important;
  grid-row: 2 !important;
  align-self: center !important;
}

@media (max-width: 900px) {
  .inline-sheet-shell .focus-top {
    grid-template-columns: minmax(180px, 1fr) auto auto !important;
  }
  .inline-sheet-shell .focus-top > .focus-close {
    display: none !important;
  }
  .inline-sheet-shell .focus-top > div:has(> .focus-progress-wrap) > .eyebrow,
  .inline-sheet-shell .focus-top > div:has(> .focus-progress-wrap) > .focus-progress-wrap,
  .inline-sheet-shell .focus-top > div:has(> .focus-progress-wrap) > small {
    grid-column: 1 !important;
  }
  .inline-sheet-shell .focus-top > .focus-top-actions { grid-column: 2 !important; }
  .inline-sheet-shell .focus-top > .practice-counters { grid-column: 3 !important; }
}

/* --- Question Navigator Strip (Centered with Balanced Pill Spacing) --- */
.worksheet-nav-pills {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0.55rem 1.5rem 0.65rem 1.5rem !important;
  background: #f8faff !important;
  border-bottom: 1.5px solid var(--line, #e6eaf2) !important;
  overflow: visible !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

@media (max-width: 680px) {
  .worksheet-nav-pills {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
}

.worksheet-nav-pills::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.nav-pills-label-wrap {
  display: none !important;
}

.nav-pills-carousel {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 1rem !important;
  flex: 0 1 auto !important;
  margin: 0 auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.nav-arrow-btn {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  border: 1.5px solid var(--line, #e6eaf2) !important;
  background: #ffffff !important;
  color: var(--ink, #16243b) !important;
  font-size: 1.2rem !important;
  line-height: 1 !important;
  font-weight: 700 !important;
  display: grid !important;
  place-items: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  flex-shrink: 0 !important;
  padding: 0 0 2px 0 !important;
  user-select: none !important;
  box-shadow: 0 1px 3px rgba(22, 36, 59, 0.04) !important;
}

.nav-arrow-btn:hover:not(:disabled) {
  border-color: var(--primary, #6558e8) !important;
  color: var(--primary, #6558e8) !important;
  background: #fbfbfe !important;
  transform: scale(1.08) !important;
  box-shadow: 0 2px 8px rgba(101, 88, 232, 0.18) !important;
}

.nav-arrow-btn:disabled {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
  border-color: var(--line, #e6eaf2) !important;
  color: var(--muted, #68758a) !important;
  box-shadow: none !important;
  transform: none !important;
}

.nav-pills-track {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: clamp(8px, 1.5vw, 16px) !important;
  padding: 5px 4px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  max-width: 100% !important;
  min-width: 0 !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  scroll-behavior: smooth !important;
}

.nav-pills-track::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.q-pill {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  border: 2px solid var(--line, #e6eaf2) !important;
  background: #ffffff !important;
  color: var(--ink, #16243b) !important;
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  display: grid !important;
  place-items: center !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  padding: 0 !important;
  position: relative !important;
  user-select: none !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 5px rgba(22, 36, 59, 0.04) !important;
}

.q-pill:hover:not(:disabled):not(.locked) {
  border-color: var(--primary, #6558e8) !important;
  color: var(--primary, #6558e8) !important;
  background: #fbfbfe !important;
  transform: translateY(-2px) scale(1.06) !important;
  box-shadow: 0 4px 12px rgba(101, 88, 232, 0.2) !important;
}

.q-pill.active {
  border-color: var(--primary, #6558e8) !important;
  background: var(--primary, #6558e8) !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(101, 88, 232, 0.25), 0 4px 14px rgba(101, 88, 232, 0.35) !important;
  transform: scale(1.12) !important;
}

.q-pill.correct {
  border-color: var(--accent, #21b79b) !important;
  background: #edf9f5 !important;
  color: #0d7f6b !important;
}

.q-pill.correct .q-pill-check {
  position: absolute !important;
  top: -4px !important;
  right: -4px !important;
  width: 15px !important;
  height: 15px !important;
  border-radius: 50% !important;
  background: var(--accent, #21b79b) !important;
  color: #ffffff !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  display: grid !important;
  place-items: center !important;
  box-shadow: 0 1px 3px rgba(33, 183, 155, 0.35) !important;
}

.q-pill.exhausted {
  border-color: #f59e0b !important;
  background: #fffbeb !important;
  color: #b45309 !important;
}

.q-pill.attempted {
  border-color: #9d94f6 !important;
  background: #f3f2ff !important;
  color: var(--primary-dark, #4b3fc8) !important;
}

.q-pill.locked {
  border: 1.5px dashed #cbd5e1 !important;
  background: #f8fafc !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
  box-shadow: none !important;
  transform: none !important;
}

.q-pill.locked:hover {
  border-color: #cbd5e1 !important;
  color: #94a3b8 !important;
  transform: none !important;
  box-shadow: none !important;
}

.q-pill-lock {
  position: absolute !important;
  top: -4px !important;
  right: -4px !important;
  font-size: 8px !important;
  line-height: 1 !important;
  background: #f1f5f9 !important;
  border-radius: 50% !important;
  padding: 1px !important;
}

/* --- Question Body: Hide Redundant Floating Number Box (Already visible in navigator) --- */
.inline-sheet-shell .question-tools,
.inline-sheet-shell .question-number,
.inline-sheet-shell .question-number-only {
  display: none !important;
}

.inline-sheet-shell .focus-question {
  padding: 1.25rem 2.5rem 1.35rem !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  scrollbar-width: thin !important;
  scrollbar-color: #cbd5e1 transparent !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  max-width: 100% !important;
  margin: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.inline-sheet-shell .focus-question::-webkit-scrollbar {
  width: 6px !important;
}

.inline-sheet-shell .focus-question::-webkit-scrollbar-track {
  background: transparent !important;
}

.inline-sheet-shell .focus-question::-webkit-scrollbar-thumb {
  background-color: #cbd5e1 !important;
  border-radius: 4px !important;
}

.inline-sheet-shell .focus-question::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8 !important;
}

.inline-sheet-shell .focus-question > * {
  max-width: 960px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.inline-sheet-shell .focus-question h2 {
  font-size: 1.42rem !important;
  line-height: 1.5 !important;
  font-weight: 750 !important;
  color: #0f172a !important;
  margin: 0.2rem 0 1.25rem 0 !important;
}

.inline-sheet-shell .focus-options {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1rem !important;
  margin: 0.85rem 0 1.25rem !important;
}

@media (max-width: 640px) {
  .inline-sheet-shell .focus-options {
    grid-template-columns: 1fr !important;
  }
}

.inline-sheet-shell .focus-options label > span {
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 14px !important;
  padding: 0.9rem 1.25rem !important;
  min-height: 56px !important;
  background: #ffffff !important;
  cursor: pointer !important;
  font-weight: 650 !important;
  font-size: 1.04rem !important;
  color: #1e293b !important;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02) !important;
}

.inline-sheet-shell .focus-options label > span:hover {
  border-color: var(--primary, #6558e8) !important;
  background: #fbfbfe !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(101, 88, 232, 0.1) !important;
}

.inline-sheet-shell .focus-options input:checked + span {
  border-color: var(--primary, #6558e8) !important;
  background: #f5f3ff !important;
  box-shadow: 0 0 0 2px rgba(101, 88, 232, 0.2) !important;
}

.inline-sheet-shell .focus-options label > span b {
  width: 34px !important;
  height: 34px !important;
  flex-shrink: 0 !important;
  border-radius: 10px !important;
  background: #f1f2f7 !important;
  color: var(--muted, #68758a) !important;
  font-weight: 800 !important;
  font-size: 0.9rem !important;
  display: grid !important;
  place-items: center !important;
}

.inline-sheet-shell .focus-options input:checked + span b {
  background: var(--primary, #6558e8) !important;
  color: #ffffff !important;
}

.inline-sheet-shell .written-answer input {
  width: 100% !important;
  border-radius: 14px !important;
  border: 1.5px solid var(--line, #e6eaf2) !important;
  padding: 0.95rem 1.25rem !important;
  font-size: 1.15rem !important;
  background: #ffffff !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
}

.inline-sheet-shell .written-answer input:focus {
  border-color: var(--primary, #6558e8) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(101, 88, 232, 0.2) !important;
}

/* --- Focus Footer --- */
.inline-sheet-shell .focus-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1.25rem !important;
  padding: 0.95rem 2.25rem !important;
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
}

.inline-sheet-shell .focus-footer .button,
.inline-sheet-shell .focus-footer .outline-button {
  padding: 0.75rem 1.6rem !important;
  font-size: 0.96rem !important;
  font-weight: 750 !important;
  border-radius: 12px !important;
}

.inline-sheet-shell .focus-support {
  display: flex !important;
  align-items: center !important;
  gap: 0.85rem !important;
  flex-wrap: wrap !important;
}

.inline-sheet-shell .attempts-label {
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
}

/* --- 3. Workspace Controls (Scratchpad merged into seamless Workspace) --- */
.scratchpad-toggle-btn,
.scratchpad-overlay {
  display: none !important;
}

/* --- 4. Controls in Focus Sheet Header (Cleaned & De-conflicted) --- */
.sound-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  font-size: 0.95rem;
  padding: 0.25rem 0.55rem;
  border-radius: 20px;
  cursor: pointer;
}

/* --- 5. Interesting Concept Page Modal --- */
.student-concept-page-modal {
  padding: 1.5rem;
}

.concept-modal-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #7c3aed;
  background: #ede9fe;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  margin-bottom: 0.4rem;
}

.concept-modal-sub {
  color: #64748b;
  font-size: 0.9rem;
  margin: 0.2rem 0 0;
}

.student-concept-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1.25rem 0;
}

.concept-hook-card {
  display: flex;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1.5px solid #fde68a;
}

.hook-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.hook-text h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: #92400e;
}

.hook-text p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #78350f;
}

.concept-visual-wrapper {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.concept-hero-svg-card {
  width: 100%;
}

.concept-rule-card {
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: #f8fafc;
  border-left: 5px solid #6366f1;
}

.rule-badge {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #4f46e5;
  margin-bottom: 0.35rem;
}

.rule-statement {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.5;
}

.concept-example-card {
  padding: 1.15rem 1.35rem;
  border-radius: 16px;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
}

.example-header {
  margin-bottom: 0.5rem;
}

.example-tag {
  display: block;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #15803d;
  margin-bottom: 0.2rem;
}

.example-header b {
  font-size: 0.96rem;
  color: #166534;
}

.example-thinking {
  padding-top: 0.5rem;
  border-top: 1px dashed #86efac;
}

.thinking-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  color: #15803d;
  margin-bottom: 0.25rem;
}

.example-thinking p {
  margin: 0;
  font-size: 0.92rem;
  color: #14532d;
  line-height: 1.5;
}

/* --- Real Mathematical Concept Card Enhancements --- */
.concept-lead-card {
  display: flex;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #f0fdf4, #e0f2fe);
  border: 1.5px solid #bae6fd;
}

.lead-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.lead-text h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: #0369a1;
}

.concept-lead-text {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.55;
  font-weight: 700;
  color: #0c4a6e;
}

.example-steps-block {
  padding-top: 0.65rem;
  margin-top: 0.65rem;
  border-top: 1px dashed #86efac;
}

.concept-steps-list {
  margin: 0.35rem 0 0 1.25rem;
  padding: 0;
  color: #14532d;
  font-size: 0.92rem;
  line-height: 1.6;
}

.concept-steps-list li {
  margin-bottom: 0.25rem;
}

.concept-mistake-card {
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: #fef2f2;
  border-left: 5px solid #ef4444;
}

.mistake-badge {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #b91c1c;
  margin-bottom: 0.35rem;
}

.mistake-statement {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #7f1d1d;
  line-height: 1.5;
}

.concept-remember-card {
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: #eef2ff;
  border-left: 5px solid #6366f1;
}

.remember-badge {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #4338ca;
  margin-bottom: 0.35rem;
}

.remember-statement {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #312e81;
  line-height: 1.5;
}

.concept-visual-wrapper svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.concept-visual-wrapper .g7-concept-visual {
  margin: 0;
}

.concept-page-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

@media (max-width: 720px) {
  .matching-interactive-stage {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .matching-wire-spacer {
    display: none;
  }
  .matching-wire-svg-canvas {
    display: none;
  }
  .scratchpad-window {
    height: 90vh;
  }
}

/* --- Grade 10 Rich Concept Page Additions --- */
.grade10-concept-modal {
  max-width: 760px;
}

.grade10-concept-modal .concept-header-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex-shrink: 0;
  max-width: 260px;
}

.grade10-concept-modal .concept-header-actions .icon-button {
  min-width: 36px;
}

@media (max-width: 600px) {
  .grade10-concept-modal .modal-head { flex-wrap: wrap; }
  .grade10-concept-modal .concept-header-actions { max-width: 100%; }
}

.concept-principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.principle-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.principle-box strong {
  display: block;
  font-size: 0.88rem;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.principle-box p {
  margin: 0;
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.45;
}

.concept-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.concept-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
  background: #ffffff;
}

.concept-table th {
  background: #f1f5f9;
  padding: 0.65rem 0.8rem;
  font-weight: 700;
  color: #334155;
  border-bottom: 1px solid #cbd5e1;
}

.concept-table td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.badge-success {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: #ecfdf5;
  color: #065f46;
  font-weight: 700;
  font-size: 0.8rem;
}

.badge-danger {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 700;
  font-size: 0.8rem;
}

.badge-warning {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
  font-size: 0.8rem;
}

.concept-pitfalls-card {
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
}

.pitfalls-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  color: #9a3412;
  margin-bottom: 0.4rem;
}

.concept-pitfalls-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: #7c2d12;
  font-size: 0.88rem;
  line-height: 1.5;
}

.concept-pitfalls-card li {
  margin-bottom: 0.25rem;
}

/* =========================================================================
   Global "Back to Live Class" Controls (on all other screens)
   ========================================================================= */
.back-to-live-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 0.4rem 0.95rem !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  border: none !important;
  font-size: 0.82rem !important;
  font-weight: 750 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
  transition: all 0.15s ease !important;
}

.back-to-live-chip:hover {
  transform: translateY(-1px) scale(1.02) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45) !important;
}

.active-live-class-banner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1.25rem !important;
  padding: 0.85rem 1.4rem !important;
  margin-bottom: 1.25rem !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4) !important;
  border: 1.5px solid #a7f3d0 !important;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.08) !important;
}

.active-live-banner-info {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.active-live-banner-info strong {
  display: block !important;
  font-size: 0.92rem !important;
  color: #065f46 !important;
  font-weight: 800 !important;
}

.active-live-banner-info span {
  display: block !important;
  font-size: 0.8rem !important;
  color: #047857 !important;
}

.live-dot-pulse {
  color: #10b981 !important;
  font-size: 1.1rem !important;
  line-height: 1 !important;
  display: inline-block !important;
  animation: pulseLiveDot 1.5s infinite ease-in-out !important;
}

@keyframes pulseLiveDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

.back-to-live-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0.5rem 1.15rem !important;
  border-radius: 10px !important;
  background: #10b981 !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 750 !important;
  font-size: 0.86rem !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25) !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}

.back-to-live-btn:hover {
  background: #059669 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35) !important;
}

.sidebar .nav-link.has-active-session {
  position: relative !important;
}

.sidebar .nav-link.has-active-session::after {
  content: "" !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: #10b981 !important;
  position: absolute !important;
  right: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  animation: pulseLiveDot 1.5s infinite ease-in-out !important;
}

/* =========================================================================
   Workspace Open & Closed Split-Screen Layout: Exact Height Matching & Zero Dead Space
   ========================================================================= */
/* When workspace is closed: single column layout */
.live-split-workspace.workspace-closed,
.practice-workspace-layout.workspace-closed {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  flex: 1 1 auto !important;
  align-items: stretch !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
}

.live-split-workspace.workspace-closed > .live-question-pane,
.practice-workspace-layout.workspace-closed > .live-question-pane {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  align-self: stretch !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  overflow: hidden !important;
}

.live-split-workspace.workspace-closed > .live-workspace-pane,
.practice-workspace-layout.workspace-closed > .live-workspace-pane {
  display: none !important;
}

/* When workspace is OPEN: Strict 50/50 Side-by-Side Split Columns */
.live-split-workspace.workspace-open,
.practice-workspace-layout.workspace-open,
.dashboard-main .live-split-workspace.workspace-open,
.dashboard-main .practice-workspace-layout.workspace-open,
#content .live-split-workspace.workspace-open,
#content .practice-workspace-layout.workspace-open {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  grid-template-rows: 100% !important;
  column-gap: 16px !important;
  row-gap: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  flex: 1 1 auto !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.live-split-workspace.workspace-open > .live-split-controls,
.practice-workspace-layout.workspace-open > .live-split-controls {
  display: none !important;
}

.live-split-workspace.workspace-open > .live-question-pane,
.practice-workspace-layout.workspace-open > .live-question-pane {
  grid-column: 1 !important;
  grid-row: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  align-self: stretch !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.live-split-workspace.workspace-open > .live-workspace-pane,
.practice-workspace-layout.workspace-open > .live-workspace-pane {
  grid-column: 2 !important;
  grid-row: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  align-self: stretch !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.live-split-workspace .live-question-pane > .inline-sheet-shell,
.practice-workspace-layout .live-question-pane > .inline-sheet-shell {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 auto !important;
  align-self: stretch !important;
  flex: 1 1 auto !important;
  position: relative !important;
  top: 0 !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
}

.live-split-workspace.workspace-open .live-question-pane > .inline-sheet-shell,
.practice-workspace-layout.workspace-open .live-question-pane > .inline-sheet-shell {
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

.live-split-workspace .inline-sheet-shell > .focus-sheet,
.practice-workspace-layout .inline-sheet-shell > .focus-sheet {
  height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.live-split-workspace.workspace-open .focus-sheet .focus-question,
.practice-workspace-layout.workspace-open .focus-sheet .focus-question {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  scrollbar-width: thin !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  padding: 1.15rem 1.4rem !important;
}

.live-split-workspace.workspace-open .focus-sheet .focus-question h2,
.practice-workspace-layout.workspace-open .focus-sheet .focus-question h2 {
  font-size: 1.25rem !important;
  line-height: 1.4 !important;
  margin: 0.15rem 0 1rem 0 !important;
}

.live-split-workspace.workspace-open .live-workspace-pane > .live-whiteboard,
.practice-workspace-layout.workspace-open .live-workspace-pane > .live-whiteboard {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  flex: 1 1 auto !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  border: 1.5px solid var(--line, #e6eaf2) !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06) !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.live-split-workspace.workspace-open .live-whiteboard .workspace-compact-head,
.practice-workspace-layout.workspace-open .live-whiteboard .workspace-compact-head {
  padding: 0.85rem 1.4rem 0.65rem 1.4rem !important;
  background: #ffffff !important;
  border-bottom: 1px solid #edf2f7 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.live-split-workspace.workspace-open .live-whiteboard .workspace-compact-head h2,
.practice-workspace-layout.workspace-open .live-whiteboard .workspace-compact-head h2 {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 0 !important;
}

.live-split-workspace.workspace-open .live-whiteboard .workspace-compact-head small,
.practice-workspace-layout.workspace-open .live-whiteboard .workspace-compact-head small {
  color: #64748b !important;
  font-size: 0.8rem !important;
}

.live-split-workspace.workspace-open .live-whiteboard .whiteboard-toolbar,
.practice-workspace-layout.workspace-open .live-whiteboard .whiteboard-toolbar {
  margin: 0 !important;
  padding: 0.55rem 1rem !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #edf2f7 !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.45rem !important;
  flex-wrap: wrap !important;
}

.live-split-workspace.workspace-open .live-whiteboard .workspace-primary-tools,
.practice-workspace-layout.workspace-open .live-whiteboard .workspace-primary-tools {
  display: flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
}

.live-split-workspace.workspace-open .live-whiteboard .whiteboard-icon-button,
.practice-workspace-layout.workspace-open .live-whiteboard .whiteboard-icon-button {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  display: grid !important;
  place-items: center !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #1e293b !important;
  font-size: 0.92rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.live-split-workspace.workspace-open .live-whiteboard .whiteboard-icon-button.active,
.practice-workspace-layout.workspace-open .live-whiteboard .whiteboard-icon-button.active {
  background: #6366f1 !important;
  border-color: #6366f1 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3) !important;
}

.live-split-workspace.workspace-open .live-whiteboard .whiteboard-colours,
.practice-workspace-layout.workspace-open .live-whiteboard .whiteboard-colours {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 0 4px !important;
  border-left: 1px solid #e2e8f0 !important;
  border-right: 1px solid #e2e8f0 !important;
  margin: 0 2px !important;
}

.live-split-workspace.workspace-open .live-whiteboard .whiteboard-colours button,
.practice-workspace-layout.workspace-open .live-whiteboard .whiteboard-colours button {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  border-radius: 50% !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 0 0 1px #cbd5e1 !important;
  padding: 0 !important;
  cursor: pointer !important;
  transition: transform 0.15s ease !important;
}

.live-split-workspace.workspace-open .live-whiteboard .whiteboard-colours button.active,
.practice-workspace-layout.workspace-open .live-whiteboard .whiteboard-colours button.active {
  box-shadow: 0 0 0 2.5px #6366f1 !important;
  transform: scale(1.2) !important;
}

/* --- Math Tools Tray: Sleek, compact, perfectly sized with no text overflow --- */
.workspace-math-tray {
  padding: 6px 8px !important;
  gap: 5px !important;
}

.workspace-math-categories {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 4px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin-bottom: 4px !important;
}

.workspace-category-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  padding: 0 5px !important;
  border: 1px solid #dfe7e3 !important;
  border-radius: 6px !important;
  background: #f8fbfa !important;
  color: #153455 !important;
  cursor: pointer !important;
  font-size: 0.7rem !important;
  font-weight: 750 !important;
  text-align: center !important;
  gap: 4px !important;
  box-sizing: border-box !important;
  transition: all 0.15s ease !important;
}

.workspace-category-button:hover,
.workspace-category-button:focus-visible {
  border-color: #b7d9ce !important;
  background: #f0faf6 !important;
}

.workspace-category-button.active {
  border-color: #168a68 !important;
  background: #e9f8f2 !important;
  color: #087154 !important;
}

.workspace-category-button > span {
  flex: 0 0 auto !important;
  font-size: 0.78rem !important;
  line-height: 1 !important;
}

.workspace-category-button > b {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1 !important;
}

.workspace-math-category-panels {
  min-width: 0 !important;
  max-width: 100% !important;
}

.workspace-math-category-panel {
  display: flex !important;
  min-width: 0 !important;
  max-width: 100% !important;
  align-items: center !important;
  gap: 4px !important;
  flex-wrap: wrap !important;
  padding: 4px 6px !important;
  border: 1px solid #e4ebe7 !important;
  border-radius: 8px !important;
  background: #fbfdfc !important;
}

/* Sub-tool buttons: compact, auto-width, no text clipping or colliding */
.workspace-math-category-panel .whiteboard-icon-button,
.workspace-math-category-panel[data-workspace-category="numbers"] .whiteboard-icon-button,
.workspace-math-category-panel[data-workspace-category="shapes"] .whiteboard-icon-button,
.workspace-math-category-panel[data-workspace-category="measure"] .whiteboard-icon-button,
.workspace-math-category-panel[data-workspace-category="nets"] .whiteboard-icon-button {
  width: auto !important;
  min-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  padding: 0 6px !important;
  font-size: 0.76rem !important;
  font-weight: 750 !important;
  line-height: 28px !important;
  white-space: nowrap !important;
  border-radius: 6px !important;
  border: 1px solid #dbe5e1 !important;
  background: #ffffff !important;
  color: #1e293b !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  transition: all 0.12s ease !important;
}

.workspace-math-category-panel .whiteboard-icon-button:hover,
.workspace-math-category-panel[data-workspace-category] .whiteboard-icon-button:hover {
  background: #f1f8f5 !important;
  border-color: #168a68 !important;
  color: #087154 !important;
}

.workspace-math-category-panel .whiteboard-icon-button.active,
.workspace-math-category-panel[data-workspace-category] .whiteboard-icon-button.active {
  background: #168a68 !important;
  border-color: #168a68 !important;
  color: #ffffff !important;
}

.workspace-math-category-panel .whiteboard-icon-button > span {
  display: inline-block !important;
  font-size: 0.78rem !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.live-split-workspace.workspace-open .live-whiteboard .workspace-math-button,
.practice-workspace-layout.workspace-open .live-whiteboard .workspace-math-button {
  min-height: 32px !important;
  padding: 4px 10px !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #1e293b !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  cursor: pointer !important;
}

.live-split-workspace.workspace-open .live-whiteboard .workspace-math-button.active,
.practice-workspace-layout.workspace-open .live-whiteboard .workspace-math-button.active {
  background: #ede9fe !important;
  border-color: #8b5cf6 !important;
  color: #6d28d9 !important;
}

.live-split-workspace.workspace-open .live-whiteboard .whiteboard-stage,
.practice-workspace-layout.workspace-open .live-whiteboard .whiteboard-stage {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  overflow: hidden !important;
  border: none !important;
  border-radius: 0 !important;
  background-color: #ffffff !important;
  background-image: radial-gradient(#e2e8f0 1.2px, transparent 1.2px) !important;
  background-size: 20px 20px !important;
  box-shadow: none !important;
}

.live-split-workspace.workspace-open .live-whiteboard .whiteboard-stage canvas,
.practice-workspace-layout.workspace-open .live-whiteboard .whiteboard-stage canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

.live-split-workspace.workspace-open .live-whiteboard footer,
.practice-workspace-layout.workspace-open .live-whiteboard footer {
  padding: 0.35rem 1rem !important;
  margin: 0 !important;
  background: #f8fafc !important;
  border-top: 1px solid #edf2f7 !important;
  font-size: 0.74rem !important;
  color: #64748b !important;
}

/* Question numbering strip when workspace is open: compact pills & zero clipping */
.live-split-workspace.workspace-open .worksheet-nav-pills,
.practice-workspace-layout.workspace-open .worksheet-nav-pills {
  justify-content: center !important;
  padding: 0.35rem 0.85rem 0.45rem 0.85rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.live-split-workspace.workspace-open .nav-pills-carousel,
.practice-workspace-layout.workspace-open .nav-pills-carousel {
  width: 100% !important;
  max-width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
  gap: 6px !important;
  min-width: 0 !important;
}

.live-split-workspace.workspace-open .nav-pills-track,
.practice-workspace-layout.workspace-open .nav-pills-track {
  flex: 1 1 auto !important;
  justify-content: center !important;
  min-width: 0 !important;
  max-width: 100% !important;
  gap: 5px !important;
  padding: 3px 2px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  scroll-behavior: smooth !important;
}

.live-split-workspace.workspace-open .nav-pills-track::-webkit-scrollbar,
.practice-workspace-layout.workspace-open .nav-pills-track::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.live-split-workspace.workspace-open .q-pill,
.practice-workspace-layout.workspace-open .q-pill {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  font-size: 0.82rem !important;
  border-width: 1.5px !important;
  flex-shrink: 0 !important;
}

.live-split-workspace.workspace-open .q-pill.active,
.practice-workspace-layout.workspace-open .q-pill.active {
  box-shadow: 0 0 0 3px rgba(101, 88, 232, 0.25), 0 3px 10px rgba(101, 88, 232, 0.35) !important;
  transform: scale(1.08) !important;
}

.live-split-workspace.workspace-open .nav-arrow-btn,
.practice-workspace-layout.workspace-open .nav-arrow-btn {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  font-size: 1rem !important;
  flex-shrink: 0 !important;
}

/* Compact footer in split workspace mode */
.live-split-workspace.workspace-open .focus-footer,
.practice-workspace-layout.workspace-open .focus-footer {
  padding: 0.65rem 1.25rem !important;
  gap: 0.5rem !important;
  flex-wrap: wrap !important;
}

.live-split-workspace.workspace-open .focus-support,
.practice-workspace-layout.workspace-open .focus-support {
  gap: 0.5rem !important;
  flex-wrap: wrap !important;
}

.live-split-workspace.workspace-open .focus-footer .button,
.live-split-workspace.workspace-open .focus-footer .outline-button,
.practice-workspace-layout.workspace-open .focus-footer .button,
.practice-workspace-layout.workspace-open .focus-footer .outline-button {
  padding: 0.55rem 1.15rem !important;
  font-size: 0.88rem !important;
  border-radius: 10px !important;
}

.live-split-workspace.workspace-open .scratchpad-toggle-btn,
.practice-workspace-layout.workspace-open .scratchpad-toggle-btn {
  display: none !important;
}

/* =========================================================================
   Concept Intro Page: Unified Elegant Card, Proper Fit, Zero Floating Overlap
   ========================================================================= */
.concept-intro-page,
.live-question-pane .concept-intro-page,
#content .concept-intro-page {
  max-width: 1060px !important;
  width: 100% !important;
  margin: 0 auto !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
  background: #ffffff !important;
  border: 1.5px solid var(--line, #e6eaf2) !important;
  border-radius: 20px !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06) !important;
  overflow: hidden !important;
  padding: 0 !important;
}

/* Hide disconnected floating workspace button while student is on concept intro */
body:has(.concept-intro-page) .optional-workspace-controls,
.live-split-workspace:has(.concept-intro-page) .optional-workspace-controls,
.practice-workspace-layout:has(.concept-intro-page) .optional-workspace-controls {
  display: none !important;
}

.concept-intro-page > header {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 1.15rem 2.25rem 0.95rem 2.25rem !important;
  border-bottom: 1px solid #edf2f7 !important;
  background: #ffffff !important;
}

.concept-intro-page > header > div {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.concept-intro-page .eyebrow {
  margin: 0 0 3px 0 !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  color: var(--primary, #6558e8) !important;
}

.concept-intro-page h1 {
  font-size: 1.45rem !important;
  line-height: 1.3 !important;
  font-weight: 850 !important;
  color: #16243b !important;
  margin: 0 0 3px 0 !important;
}

.concept-intro-page header p {
  margin: 0 !important;
  font-size: 0.84rem !important;
  color: #64748b !important;
}

.concept-intro-page .role-chip {
  padding: 6px 12px !important;
  border-radius: 99px !important;
  background: #eef2ff !important;
  color: var(--primary, #6558e8) !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  white-space: nowrap !important;
}

/* Scrollable middle body: story, worked example, visual cards */
.concept-scroll-body,
.concept-intro-page > .concept-story {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  scrollbar-width: thin !important;
  padding: 1.4rem 2.25rem !important;
  box-sizing: border-box !important;
}

.concept-intro-page .concept-lead {
  font-size: 1.12rem !important;
  font-weight: 800 !important;
  color: #1b3156 !important;
  line-height: 1.5 !important;
  margin: 0 0 0.65rem 0 !important;
}

.concept-intro-page .concept-story p:not(.concept-lead) {
  font-size: 0.94rem !important;
  line-height: 1.65 !important;
  color: #475569 !important;
  margin: 0 0 1rem 0 !important;
}

.concept-intro-page .concept-example {
  margin: 1.15rem 0 !important;
  padding: 1rem 1.35rem !important;
  border-radius: 14px !important;
  background: #f8faff !important;
  border: 1px solid #e0e9f8 !important;
  border-left: 5px solid var(--primary, #6558e8) !important;
}

.concept-intro-page .concept-example span {
  font-size: 0.72rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
  color: var(--primary, #6558e8) !important;
  display: block !important;
  margin-bottom: 4px !important;
}

.concept-intro-page .concept-example p {
  margin: 0 !important;
  font-size: 0.95rem !important;
  line-height: 1.55 !important;
  color: #1e293b !important;
  font-weight: 600 !important;
}

/* Number System & visual cards inside concept pages */
.concept-intro-page .g7-concept-visual {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  padding: 1.25rem !important;
  margin: 1rem 0 !important;
  background: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 16px !important;
}

.concept-intro-page .g7-concept-visual span {
  padding: 8px 16px !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  text-align: center !important;
}

.concept-intro-page .g7-concept-visual span b {
  font-size: 1.35rem !important;
  color: var(--primary, #6558e8) !important;
  display: block !important;
}

.concept-intro-page .g7-concept-visual span small {
  font-size: 0.72rem !important;
  font-weight: 750 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.concept-intro-page .g7-concept-visual > b {
  color: #94a3b8 !important;
  font-size: 1.2rem !important;
}

/* Footer: Anchored at the bottom of the card with single clear action */
.concept-intro-page > footer {
  flex: 0 0 auto !important;
  position: static !important;
  margin: 0 !important;
  padding: 1rem 2.25rem !important;
  border-top: 1px solid #edf2f7 !important;
  background: #f8fafc !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  box-sizing: border-box !important;
}

.concept-intro-page > footer small {
  flex: 1 1 auto !important;
  max-width: 580px !important;
  color: #64748b !important;
  font-size: 0.82rem !important;
  line-height: 1.45 !important;
  font-weight: 600 !important;
}

.concept-intro-page > footer .button {
  flex: 0 0 auto !important;
  padding: 0.7rem 1.65rem !important;
  font-size: 0.94rem !important;
  font-weight: 850 !important;
  border-radius: 12px !important;
  background: #168a68 !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(22, 138, 104, 0.28) !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
}

.concept-intro-page > footer .button:hover {
  background: #107255 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(22, 138, 104, 0.36) !important;
}

/* =========================================================================
   Concept Clue: Positioned in spacious bottom area above footer
   ========================================================================= */
.inline-sheet-shell .hint-panel,
.hint-panel {
  display: none !important;
  align-items: flex-start !important;
  gap: 12px !important;
  background: #fffbeb !important;
  border: 1.5px solid #fde68a !important;
  border-left: 5px solid #f59e0b !important;
  color: #92400e !important;
  border-radius: 14px !important;
  padding: 14px 18px !important;
  margin: 1.25rem 0 0.5rem 0 !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.08) !important;
  width: 100% !important;
  box-sizing: border-box !important;
  font-size: 0.94rem !important;
  line-height: 1.55 !important;
}

.inline-sheet-shell .hint-panel.show,
.hint-panel.show {
  display: flex !important;
  animation: hintSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

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

.inline-sheet-shell .hint-panel b,
.hint-panel b {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 0.86rem !important;
  font-weight: 850 !important;
  color: #78350f !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.inline-sheet-shell .hint-panel b::before,
.hint-panel b::before {
  content: '💡';
  font-size: 1.05rem !important;
}

.inline-sheet-shell .hint-panel span,
.hint-panel span {
  flex: 1 1 auto !important;
  color: #78350f !important;
  font-size: 0.94rem !important;
  line-height: 1.5 !important;
  font-weight: 600 !important;
}

/* Clue button in footer */
.inline-sheet-shell .hint-button,
.focus-footer .hint-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 36px !important;
  padding: 0 16px !important;
  border-radius: 999px !important;
  border: 1.5px solid #fde68a !important;
  background: #fefce8 !important;
  color: #854d0e !important;
  font-size: 0.84rem !important;
  font-weight: 750 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 3px rgba(133, 77, 14, 0.08) !important;
}

.inline-sheet-shell .hint-button:hover,
.focus-footer .hint-button:hover {
  background: #fef9c3 !important;
  border-color: #facc15 !important;
  color: #713f12 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 6px rgba(133, 77, 14, 0.12) !important;
}

/* ==========================================================================
   TEACHER LIVE CLASS: QUESTION NAVIGATION & SYNC CONTROLS
   ========================================================================== */

.teacher-live-player .worksheet-nav-pills {
  margin: -10px -10px 18px -10px !important;
  padding: 8px 12px !important;
  border-radius: 12px !important;
  border: 1px solid var(--border-subtle, #e2e8f0) !important;
  background: var(--bg-card, #ffffff) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03) !important;
}

.teacher-live-player .nav-pills-carousel {
  gap: 8px !important;
}

.teacher-live-player .q-pill {
  width: 32px !important;
  height: 32px !important;
  font-size: 13px !important;
}

.teacher-live-sync-banner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  border-radius: 8px !important;
  padding: 7px 12px !important;
  margin-bottom: 14px !important;
  font-size: 13px !important;
  color: #166534 !important;
}

.teacher-return-live-btn {
  background: #16a34a !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: background 0.15s ease !important;
}

.teacher-return-live-btn:hover {
  background: #15803d !important;
}

.q-pill .q-pill-live-dot {
  color: #22c55e !important;
  font-size: 10px !important;
  line-height: 1 !important;
  margin-left: 2px !important;
  animation: q-pill-pulse 1.5s infinite !important;
}

@keyframes q-pill-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.q-pill.student-live-q {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 1.5px rgba(34, 197, 94, 0.35) !important;
}

/* ==========================================================================
   LIVE CLASS: COMPACT ICON-ONLY SIDEBAR WHEN WORKSPACE IS OPEN
   ========================================================================== */

.dashboard-shell.live-class-mode {
  transition: grid-template-columns 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.dashboard-shell.live-class-mode:not(.live-sidebar-expanded) {
  grid-template-columns: 72px minmax(0, 1fr) !important;
}

.dashboard-shell.live-class-mode:not(.live-sidebar-expanded) > .sidebar {
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  padding: 20px 8px !important;
  align-items: center !important;
  box-sizing: border-box !important;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), padding 0.22s ease !important;
}

.dashboard-shell.live-class-mode:not(.live-sidebar-expanded) > .sidebar .logo {
  justify-content: center !important;
  padding: 0 !important;
  margin-bottom: 24px !important;
}

.dashboard-shell.live-class-mode:not(.live-sidebar-expanded) > .sidebar .logo .brand-wordmark,
.dashboard-shell.live-class-mode:not(.live-sidebar-expanded) > .sidebar .logo span:last-child {
  display: none !important;
}

.dashboard-shell.live-class-mode:not(.live-sidebar-expanded) > .sidebar .logo .logo-mark {
  width: 38px !important;
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.dashboard-shell.live-class-mode:not(.live-sidebar-expanded) > .sidebar .logo .brand-lockup {
  display: none !important;
}

.dashboard-shell.live-class-mode:not(.live-sidebar-expanded) > .sidebar .logo .brand-mark-compact {
  display: block !important;
  width: 42px !important;
  height: 42px !important;
}

.dashboard-shell.live-class-mode:not(.live-sidebar-expanded) > .sidebar nav {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  margin-top: 0 !important;
}

.dashboard-shell.live-class-mode:not(.live-sidebar-expanded) > .sidebar .nav-link {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 12px !important;
}

.dashboard-shell.live-class-mode:not(.live-sidebar-expanded) > .sidebar .nav-link > .nav-icon {
  margin: 0 !important;
  font-size: 1.25rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.dashboard-shell.live-class-mode:not(.live-sidebar-expanded) > .sidebar .nav-link > .nav-label {
  display: none !important;
}

.dashboard-shell.live-class-mode:not(.live-sidebar-expanded) > .sidebar .logout {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  padding: 0 !important;
  margin: auto auto 0 auto !important;
  border-radius: 12px !important;
  font-size: 0 !important;
}

.dashboard-shell.live-class-mode:not(.live-sidebar-expanded) > .sidebar .logout::before {
  content: '↪' !important;
  font-size: 1.25rem !important;
}

/* ==========================================================================
   TEACHER LIVE CLASS: EXACT PARITY WITH STUDENT WORKSHEET EXPERIENCE
   Keeps the teacher view completely identical in proportions to student side:
   - Full viewport height card (no cutoff and zero dead space at the bottom)
   - Fixed header at top (student name, timer, end class)
   - Smooth internal scroll on question area (.teacher-live-player) when content is tall
   - Anchored answer status & correct answer banner at bottom
   ========================================================================== */

.dashboard-main:has(.live-selected-student),
.dashboard-shell[data-portal-role="teacher"] .dashboard-main:has(.live-selected-student),
.dashboard-shell[data-portal-role="teacher"].live-class-mode .dashboard-main {
  padding: 8px 24px 10px !important;
  height: 100vh !important;
  max-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.dashboard-shell[data-portal-role="teacher"].live-class-mode .topbar {
  margin-bottom: 6px !important;
  flex: 0 0 auto !important;
}

.dashboard-shell[data-portal-role="teacher"].live-class-mode #content {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-split-workspace {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  margin: 0 !important;
  width: 100% !important;
  overflow: hidden !important;
}

.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-split-workspace.workspace-open {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  gap: 12px !important;
}

.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-split-workspace > .live-question-pane {
  flex: 1 1 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  align-self: stretch !important;
  width: 100% !important;
}

.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-split-workspace > .live-workspace-pane {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-split-workspace > .live-workspace-pane > .live-whiteboard {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Match .live-selected-student to student's .inline-sheet-shell exactly */
.live-selected-student,
.live-question-pane > .live-selected-student {
  max-width: 1060px !important;
  width: 100% !important;
  margin: 0 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  flex: 1 1 0 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #ffffff !important;
  border: 1.5px solid var(--line, #e6eaf2) !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06) !important;
  box-sizing: border-box !important;
}

/* Match .live-student-card to student's .focus-sheet */
.live-selected-student > .live-student-card {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  flex: 1 1 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Header bar: Seamless, uniform layout grouping tools and actions together on the right */
html body #app .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .live-student-card > header,
.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .live-student-card > header,
.live-selected-student .live-student-card > header {
  flex: 0 0 auto !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 12px 24px !important;
  border-bottom: 1px solid var(--line, #e6eaf2) !important;
  background: #ffffff !important;
  margin: 0 !important;
  grid-template-columns: none !important;
  box-sizing: border-box !important;
}

/* Left side student info */
html body #app .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .live-student-card > header > div:first-child,
.live-selected-student .live-student-card > header > div:first-child {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-right: auto !important;
  min-width: 0 !important;
}

.live-selected-student .live-student-card > header > div:first-child b {
  font-size: 1rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  white-space: nowrap !important;
}

.live-selected-student .live-student-card > header > div:first-child small {
  font-size: 0.8rem !important;
  color: #64748b !important;
  white-space: nowrap !important;
}

.live-selected-student .live-student-card > header > div:first-child .live-dot {
  font-size: 14px !important;
  color: #14a47f !important;
}

/* Right-side tools cluster: counters, timer, workspace button, action buttons */
html body #app .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .live-student-card > header .live-header-tools,
.live-selected-student .live-student-card > header .live-header-tools {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin: 0 !important;
  margin-left: auto !important;
  flex-wrap: nowrap !important;
  flex: 0 0 auto !important;
}

/* 1. Uniform Counters Capsule (34px height) */
html body #app .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .teacher-simple-counters,
.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .teacher-simple-counters,
.live-selected-student .teacher-simple-counters {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  padding: 0 6px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 99px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

html body #app .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .teacher-simple-counters span,
.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .teacher-simple-counters span,
.live-selected-student .teacher-simple-counters span {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  font-size: 0.76rem !important;
}

html body #app .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .teacher-simple-counters span b,
.live-selected-student .teacher-simple-counters span b {
  font-size: 0.76rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

/* 2. Uniform Live Countdown Chip (34px height) */
html body #app .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .live-timer,
.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .live-timer,
.live-selected-student .live-timer {
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  min-width: 68px !important;
  padding: 0 10px !important;
  border-radius: 10px !important;
  font-family: Manrope, "Segoe UI", Arial, sans-serif !important;
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  line-height: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  letter-spacing: 0.03em !important;
  font-variant-numeric: tabular-nums !important;
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border: 1px solid #e2e8f0 !important;
  margin: 0 !important;
}

html body #app .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .live-timer.last-ten,
.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .live-timer.last-ten,
.live-selected-student .live-timer.last-ten {
  background: #fff5ed !important;
  color: #c2410c !important;
  border-color: #fed7aa !important;
}

/* 3. Uniform Workspace / Scratchpad Button (34px height) */
html body #app .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .optional-workspace-controls,
.dashboard-shell.live-class-mode .live-student-card header .optional-workspace-controls {
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

html body #app .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .optional-workspace-controls.workspace-controls-closed,
.dashboard-shell.live-class-mode .live-student-card header .optional-workspace-controls.workspace-controls-closed {
  position: static !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  grid-column: auto !important;
  grid-row: auto !important;
  flex: 0 0 auto !important;
  width: max-content !important;
  min-width: max-content !important;
}

html body #app .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .optional-workspace-controls.workspace-controls-closed > .workspace-open-button,
.dashboard-shell.live-class-mode .live-student-card header .optional-workspace-controls.workspace-controls-closed > .workspace-open-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  padding: 0 12px !important;
  font-size: 0.8rem !important;
  font-weight: 750 !important;
  border-radius: 10px !important;
  border: 1px solid #bfe4d5 !important;
  background: #edf8f3 !important;
  color: #08755a !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  min-width: 148px !important;
  flex: 0 0 auto !important;
}

html body #app .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .optional-workspace-controls.workspace-controls-closed > .workspace-open-button:hover,
.dashboard-shell.live-class-mode .live-student-card header .optional-workspace-controls.workspace-controls-closed > .workspace-open-button:hover {
  background: #ddf3ea !important;
  border-color: #08755a !important;
}

/* 4. Uniform Class Actions (34px height) */
html body #app .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .live-class-actions,
.live-selected-student .live-student-card > header .live-class-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  margin-left: 0 !important;
  flex-wrap: nowrap !important;
  flex: 0 0 auto !important;
}

html body #app .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .live-class-actions button,
.live-selected-student .live-student-card > header .live-class-actions button {
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  line-height: 32px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  font-size: 0.8rem !important;
  font-weight: 750 !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

/* "+ Add optional 10 min" button */
html body #app .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .live-class-actions button.outline-button,
.live-selected-student .live-student-card > header .live-class-actions button.outline-button {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

html body #app .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .live-class-actions button.outline-button:hover,
.live-selected-student .live-student-card > header .live-class-actions button.outline-button:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

/* "End class" button inside student cards strictly hidden */
.live-class-actions,
.live-selected-student .live-class-actions,
.live-selected-student .live-student-card > header .live-class-actions,
.live-student-card .live-class-actions,
.live-actions-only {
  display: none !important;
}

/* Keep the four live controls distinct. None may shrink into its neighbour. */
.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-header-tools > .teacher-simple-counters,
.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-header-tools > .live-timer,
.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-header-tools > .optional-workspace-controls,
.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-header-tools > .live-class-actions {
  flex: 0 0 auto !important;
}

/* On a narrower teacher canvas, place the intact control group below student info. */
@media (max-width: 1100px) {
  .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .live-student-card > header {
    flex-wrap: wrap !important;
  }

  .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .live-student-card > header > div:first-child {
    flex: 1 1 100% !important;
  }

  .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .live-student-card > header .live-header-tools {
    width: 100% !important;
    justify-content: flex-end !important;
  }
}

@media (max-width: 720px) {
  .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-selected-student .live-student-card > header .live-header-tools {
    flex-wrap: wrap !important;
    row-gap: 8px !important;
  }
}

/* Suppress stray floating button outside card */
.dashboard-shell.live-class-mode .live-split-workspace.workspace-closed > .optional-workspace-controls.workspace-controls-closed {
  display: none !important;
}

/* Compact headers in teacher live view so card fits without viewport overflow */
.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-class-head {
  flex: 0 0 auto !important;
  margin-bottom: 4px !important;
  padding: 6px 14px !important;
  min-height: 0 !important;
}

.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-class-head h2 {
  font-size: 1.05rem !important;
  margin: 0 !important;
}

.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-student-tabs {
  flex: 0 0 auto !important;
  margin: 0 0 8px 0 !important;
  padding: 2px 2px 4px 2px !important;
}

.dashboard-shell[data-portal-role="teacher"].live-class-mode .live-split-workspace.workspace-closed {
  flex: 1 1 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* Question body matches student's .focus-question with smooth scroll */
.live-selected-student .teacher-live-player {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  scrollbar-width: thin !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  padding: 1.25rem 2.5rem 1.35rem 2.5rem !important;
  margin: 0 !important;
  background: transparent !important;
  box-sizing: border-box !important;
}

.live-selected-student .teacher-live-player::-webkit-scrollbar {
  width: 6px !important;
}

.live-selected-student .teacher-live-player::-webkit-scrollbar-track {
  background: transparent !important;
}

.live-selected-student .teacher-live-player::-webkit-scrollbar-thumb {
  background: #cbd5e1 !important;
  border-radius: 99px !important;
}

.live-selected-student .teacher-live-player::-webkit-scrollbar-thumb:hover {
  background: #94a3b8 !important;
}

.live-selected-student .teacher-live-player .worksheet-nav-pills {
  margin: 0 0 14px 0 !important;
  padding: 6px 12px !important;
}

.live-selected-student .teacher-live-player .eyebrow {
  margin-bottom: 2px !important;
}

.live-selected-student .teacher-live-player > h2 {
  font-size: 1.42rem !important;
  line-height: 1.5 !important;
  font-weight: 750 !important;
  color: #0f172a !important;
  margin: 0.2rem 0 1.25rem 0 !important;
}

.live-selected-student .teacher-live-options {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1rem !important;
  margin: 0.85rem 0 1.25rem !important;
}

.live-selected-student .teacher-live-options > div {
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 14px !important;
  padding: 0.9rem 1.25rem !important;
  min-height: 56px !important;
  background: #ffffff !important;
  font-weight: 650 !important;
  font-size: 1.04rem !important;
  color: #1e293b !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02) !important;
}

.live-selected-student .teacher-live-options > div > span {
  width: 34px !important;
  height: 34px !important;
  flex: 0 0 auto !important;
  border-radius: 10px !important;
  background: #f1f2f7 !important;
  color: #68758a !important;
  font-weight: 800 !important;
  font-size: 0.9rem !important;
  display: grid !important;
  place-items: center !important;
}

.live-selected-student .teacher-live-options > div > b {
  font-size: 1.04rem !important;
  color: #1e293b !important;
  font-weight: 650 !important;
}

.live-selected-student .teacher-live-options > div.student-selected {
  border-color: #20a474 !important;
  background: #edfbf5 !important;
  box-shadow: 0 0 0 2px rgba(32, 164, 116, 0.2) !important;
}

.live-selected-student .teacher-live-options > div.student-selected > span {
  background: #20a474 !important;
  color: #ffffff !important;
}

.live-selected-student .teacher-live-options > div.student-selected > em {
  margin-left: auto !important;
  color: #08745d !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
}

.live-selected-student .teacher-written-answer {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin: 12px 0 !important;
  padding: 12px 18px !important;
  border: 1.5px solid #20a474 !important;
  border-radius: 14px !important;
  background: #edfbf5 !important;
  color: #08745d !important;
  font-size: 1.05rem !important;
}

.live-selected-student .teacher-correct-answer {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin: 10px 0 !important;
  padding: 10px 16px !important;
  border: 1.5px solid #6558e8 !important;
  border-radius: 12px !important;
  background: #f5f3ff !important;
  color: #4338ca !important;
  font-size: 0.92rem !important;
}

.live-selected-student .teacher-answer-waiting {
  margin: 8px 0 !important;
  padding: 10px 14px !important;
  font-size: 0.85rem !important;
  border-radius: 10px !important;
}

/* Docked teacher footer matching student .focus-footer */
.live-selected-student .live-student-card > footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1.25rem !important;
  padding: 0.85rem 2.25rem !important;
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  min-height: 48px !important;
  box-sizing: border-box !important;
}

.live-selected-student .live-student-card > footer .teacher-footer-status {
  font-size: 0.82rem !important;
  font-weight: 750 !important;
  color: #64748b !important;
}

.live-selected-student .live-student-card > footer .table-progress {
  margin: 0 !important;
  width: 220px !important;
  max-width: 50% !important;
}

/* Tablet Scratchpad: stack below the complete worksheet and keep every tool tappable. */
@media (min-width: 651px) and (max-width: 1099px) {
  .dashboard-main:has(.live-selected-student),
  .dashboard-shell[data-portal-role="teacher"] .dashboard-main:has(.live-selected-student),
  .dashboard-shell[data-portal-role="teacher"].live-class-mode .dashboard-main {
    height: auto !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .dashboard-shell[data-portal-role="teacher"].live-class-mode #content {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  #content .live-split-workspace.workspace-open,
  #content .practice-workspace-layout.workspace-open,
  .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-split-workspace.workspace-open {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  #content .live-split-workspace.workspace-open > .live-question-pane,
  #content .practice-workspace-layout.workspace-open > .live-question-pane,
  #content .live-split-workspace.workspace-open > .live-workspace-pane,
  #content .practice-workspace-layout.workspace-open > .live-workspace-pane,
  .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-split-workspace.workspace-open > .live-question-pane,
  .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-split-workspace.workspace-open > .live-workspace-pane {
    display: flex !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 620px !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  #content .live-split-workspace.workspace-open .live-question-pane > .inline-sheet-shell,
  #content .practice-workspace-layout.workspace-open .live-question-pane > .inline-sheet-shell,
  .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-split-workspace.workspace-open .live-question-pane > .live-selected-student,
  #content .live-split-workspace.workspace-open .live-workspace-pane > .live-whiteboard,
  #content .practice-workspace-layout.workspace-open .live-workspace-pane > .live-whiteboard {
    width: 100% !important;
    height: auto !important;
    min-height: 620px !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  #content .live-split-workspace.workspace-open .live-whiteboard .whiteboard-stage,
  #content .practice-workspace-layout.workspace-open .live-whiteboard .whiteboard-stage {
    min-height: 320px !important;
  }
}

@media (min-width: 651px) and (max-width: 1366px) {
  .live-split-workspace.workspace-open .live-whiteboard .whiteboard-icon-button,
  .practice-workspace-layout.workspace-open .live-whiteboard .whiteboard-icon-button,
  .workspace-math-category-panel .whiteboard-icon-button,
  .workspace-math-category-panel[data-workspace-category] .whiteboard-icon-button {
    width: auto !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 8px !important;
    line-height: 40px !important;
  }

  .live-split-workspace.workspace-open .live-whiteboard .whiteboard-colours,
  .practice-workspace-layout.workspace-open .live-whiteboard .whiteboard-colours {
    gap: 7px !important;
  }

  .live-split-workspace.workspace-open .live-whiteboard .whiteboard-colours button,
  .practice-workspace-layout.workspace-open .live-whiteboard .whiteboard-colours button {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
  }

  .workspace-header-toggle,
  .dashboard-shell.live-class-mode .workspace-header-toggle,
  .workspace-compact-head .whiteboard-status > button {
    min-height: 40px !important;
  }

  .workspace-compact-toolbar {
    grid-template-columns: 120px 120px minmax(0, 1fr) auto !important;
  }

  .workspace-mode-button,
  .live-split-workspace.workspace-open .live-whiteboard .workspace-math-button,
  .practice-workspace-layout.workspace-open .live-whiteboard .workspace-math-button {
    width: 120px !important;
    min-width: 120px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding-inline: 10px !important;
  }

  .workspace-category-button {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
  }
}

/* iPad Safari hides native scrollbars. Keep the live Scratchpad genuinely
   scrollable and provide permanent touch controls instead of relying on a
   scrollbar that the browser may never draw. Canvas gestures remain reserved
   for drawing; the pane, header and toolbar pan vertically. */
.whiteboard-scroll-controls {
  display: none;
}

@media (min-width: 651px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .live-split-workspace.workspace-open .live-whiteboard .workspace-compact-head,
  .practice-workspace-layout.workspace-open .live-whiteboard .workspace-compact-head {
    flex-wrap: wrap !important;
    gap: 8px 12px !important;
  }

  .live-split-workspace.workspace-open .live-whiteboard .workspace-compact-head > div:first-child,
  .practice-workspace-layout.workspace-open .live-whiteboard .workspace-compact-head > div:first-child {
    flex: 1 1 160px !important;
    min-width: 160px !important;
  }

  .live-split-workspace.workspace-open .live-whiteboard .workspace-compact-head .whiteboard-status,
  .practice-workspace-layout.workspace-open .live-whiteboard .workspace-compact-head .whiteboard-status {
    flex: 1 1 280px !important;
    min-width: 0 !important;
  }

  .whiteboard-scroll-controls {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
  }

  .whiteboard-scroll-controls > button {
    display: grid;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    place-items: center;
    border: 1px solid #b7d9ce;
    border-radius: 9px;
    background: #f0faf6;
    color: #087154;
    font-size: 1.05rem;
    font-weight: 900;
    cursor: pointer;
    line-height: 1;
    overflow: hidden;
    touch-action: manipulation;
  }

  body.worksheet-active-mode .dashboard-main.worksheet-active-mode,
  .dashboard-shell.worksheet-active-mode .dashboard-main.worksheet-active-mode,
  .dashboard-main.worksheet-active-mode,
  .dashboard-main:has(.live-split-workspace.workspace-open),
  .dashboard-main:has(.practice-workspace-layout.workspace-open) {
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  .dashboard-main.worksheet-active-mode > #content,
  .dashboard-main:has(.live-split-workspace.workspace-open) > #content,
  .dashboard-main:has(.practice-workspace-layout.workspace-open) > #content {
    overflow: visible !important;
  }

  .live-split-workspace.workspace-open > .live-workspace-pane,
  .practice-workspace-layout.workspace-open > .live-workspace-pane,
  .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-split-workspace.workspace-open > .live-workspace-pane {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    touch-action: pan-y;
  }

  .live-split-workspace.workspace-open > .live-workspace-pane::-webkit-scrollbar,
  .practice-workspace-layout.workspace-open > .live-workspace-pane::-webkit-scrollbar {
    width: 10px;
  }

  .live-split-workspace.workspace-open > .live-workspace-pane::-webkit-scrollbar-thumb,
  .practice-workspace-layout.workspace-open > .live-workspace-pane::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #7eb9a8;
    background-clip: padding-box;
  }
}

@media (min-width: 1100px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .live-split-workspace.workspace-open > .live-workspace-pane > .live-whiteboard,
  .practice-workspace-layout.workspace-open > .live-workspace-pane > .live-whiteboard,
  .dashboard-shell[data-portal-role="teacher"].live-class-mode .live-split-workspace.workspace-open > .live-workspace-pane > .live-whiteboard {
    height: auto !important;
    min-height: 680px !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    overflow: hidden !important;
  }

  .live-split-workspace.workspace-open .live-whiteboard .whiteboard-stage,
  .practice-workspace-layout.workspace-open .live-whiteboard .whiteboard-stage {
    min-height: 340px !important;
    flex: 1 0 340px !important;
  }
}

/* =========================================================================
   Two-Box Structured Answer Inputs (1 Input Per Box Check)
   ========================================================================= */
.written-answer.two-box-answer {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.15rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px solid #cbd5e1;
}

.two-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.two-box-prompt {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
}

.two-box-badge {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.two-box-inputs {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.two-box-paren {
  font-size: 1.75rem;
  font-weight: 800;
  color: #334155;
  line-height: 46px;
  user-select: none;
}

.two-box-delimiter {
  font-size: 1.25rem;
  font-weight: 800;
  color: #475569;
  line-height: 46px;
  padding: 0 0.15rem;
  user-select: none;
}

.two-box-field {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0 !important;
}

.two-box-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
}

.written-answer-box {
  width: 100%;
  min-height: 46px;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  border: 2px solid #94a3b8;
  background: #ffffff;
  font-size: 1.02rem;
  font-weight: 700;
  color: #0f172a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.written-answer-box:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.written-answer-box.multi-value-warning,
.written-answer-box.incorrect-input {
  border-color: #dc2626 !important;
  background: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18) !important;
}

.two-box-hint {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  margin: 0;
}

.two-box-hint.warning {
  color: #dc2626;
  font-weight: 700;
}

/* Live class topbar shared controls */
.live-topbar-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  vertical-align: middle;
}

.live-topbar-timer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  color: #0f172a;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid #cbd5e1;
}

.live-topbar-timer.last-ten {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
  animation: pulse 1.5s infinite;
}

.live-topbar-btn {
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.live-topbar-extend.teacher-live-extend-pill,
.teacher-live-extend-pill,
.live-topbar-end.teacher-live-end-pill,
.teacher-live-end-pill {
  background: linear-gradient(135deg, #153455, #168a68) !important;
  color: #ffffff !important;
  border: none !important;
}
.live-topbar-extend.teacher-live-extend-pill:hover,
.teacher-live-extend-pill:hover,
.live-topbar-end.teacher-live-end-pill:hover,
.teacher-live-end-pill:hover {
  background: linear-gradient(135deg, #183d63, #199e77) !important;
}

/* Calendar multi-student & multi-slot */
.schedule-student-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.schedule-student-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.schedule-student-pill input[type="checkbox"] {
  accent-color: #4f46e5;
  width: 15px;
  height: 15px;
}

.schedule-student-pill:has(input:checked) {
  background: #eef2ff;
  border-color: #6366f1;
  color: #3730a3;
}

.schedule-slots-container,
.batch-slots-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-time-slot-row,
.batch-slot-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-time-slot-row input[type="datetime-local"],
.batch-slot-row input[type="datetime-local"] {
  flex: 1;
}

.batch-slot-row .remove-slot-btn {
  color: #dc2626;
  border: 1px solid #fca5a5;
  background: #fef2f2;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.batch-slot-row .remove-slot-btn:hover {
  background: #fee2e2;
  border-color: #f87171;
}

.schedule-days-choice {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-days-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.schedule-days-picker .days-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}

.schedule-days-picker .days-chips {
  display: inline-flex;
  gap: 6px;
}

.schedule-days-picker .day-chip {
  cursor: pointer;
  margin: 0;
  position: relative;
}

.schedule-days-picker .day-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.schedule-days-picker .day-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  transition: all 0.15s ease;
  user-select: none;
}

.schedule-days-picker .day-chip input:checked + span {
  background: #08745a;
  color: #ffffff;
  border-color: #08745a;
  box-shadow: 0 1px 3px rgba(8, 116, 90, 0.25);
}

.schedule-days-picker .day-chip:hover span {
  border-color: #08745a;
}

/* Past Students & Roster Tabs */
.roster-tabs {
  display: inline-flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
}

.roster-tabs .tab-button {
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.roster-tabs .tab-button.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.past-student-card {
  opacity: 0.88;
  border-color: #e2e8f0;
  background: #fafbfc;
}

.past-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  background: #e2e8f0;
  padding: 2px 7px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-left: 6px;
  vertical-align: middle;
}

.profile-avatar.past {
  background: #94a3b8 !important;
}

/* Monthly Attendance Badges */
.overview-attendance-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 4px;
  width: fit-content;
}

.student-attendance-line {
  display: inline-block;
  color: #0284c7;
  font-weight: 600;
  margin-top: 3px;
}

/* Game Activity Log Table */
.game-activity-panel {
  margin-top: 24px;
}

.game-activity-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-activity-controls select {
  font-size: 0.85rem;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.game-activity-table {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.game-activity-row {
  display: grid;
  grid-template-columns: 1.5fr 1.6fr 1fr 1fr 1.2fr 1.4fr;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
  gap: 12px;
}

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

.game-activity-row.head {
  background: #f8fafc;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.game-activity-student {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #4f46e5;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  font-style: normal;
}

.mode-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 9999px;
  font-style: normal;
}

.mode-pill.challenge {
  background: #fef3c7;
  color: #92400e;
}

.mode-pill.practice {
  background: #f1f5f9;
  color: #475569;
}

.game-activity-score b {
  color: #0f172a;
}

.game-activity-accuracy b {
  color: #16a34a;
}

.game-activity-time {
  display: flex;
  flex-direction: column;
}

.game-activity-time small {
  color: #64748b;
  font-size: 0.75rem;
}

.activity-log-caption {
  display: block;
  text-align: right;
  margin-top: 8px;
  color: #64748b;
  font-size: 0.78rem;
}

/* Live class attendance tracking */
.live-attendance-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}
.attendance-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}
.attendance-tag.present {
  background: #edfdf5;
  color: #087154;
  border: 1px solid #b6e9d6;
}
.attendance-tag.absent {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.attendance-toggle-btn {
  font-size: 0.68rem !important;
  padding: 2px 6px !important;
  color: #64748b !important;
  text-decoration: underline !important;
  cursor: pointer !important;
  background: transparent !important;
  border: none !important;
}
.attendance-toggle-btn:hover {
  color: #1e293b !important;
}







