/* ═════════════════════════════════════════════════════════════════
   MANODEMY EXCEL FLAGSHIP STUDIO — MICROSOFT 365 PARITY STYLESHEET
   100% Parity to SQL & Python Studios + Full Real-World Excel Ribbon & Grid
═════════════════════════════════════════════════════════════════ */

@import url('/Version-3/styles.css?v=236.0.0');

/* ── Excel Theme Tokens (Emerald Palette) ────────────────────────── */
/* Default to Dark Mode (100% Parity with Version-3 and SQL/Python Studios) */
:root, [data-theme="dark"], html.dark, body.dark {
  --excel-brand-green: #107C41;
  --excel-brand-dark: #0b5c30;
  --excel-accent: #21A366;
  --excel-glow: rgba(16, 124, 65, 0.35);
  --excel-ribbon-bg: #1e2330;
  --excel-ribbon-border: #2e364a;
  --excel-grid-header-bg: #1c212e;
  --excel-grid-header-color: #e2e8f0;
  --excel-grid-border: #2d3748;
  --excel-header-border: #3b455e;
  --excel-grid-cell-bg: #0f131c;
  --excel-grid-text: #f8fafc;
  --excel-status-bg: #0b5c30;
  --excel-status-text: #e2e8f0;
  /* Active cell: Excel-green outline */
  --excel-selection-border: #107C41;
  --excel-selection-bg: #0f131c;
  /* Multi-cell range: Excel blue highlight (dark mode) */
  --excel-range-bg: rgba(100, 160, 240, 0.22);
  --excel-range-border: #1a73e8;
  /* Selected header (dark mode) */
  --excel-header-selected-bg: rgba(100, 160, 240, 0.28);
  --excel-header-selected-color: #93c5fd;
}

/* Light Mode Overrides for Excel */
[data-theme="light"], html.light, body.light {
  --excel-ribbon-bg: #f3f2f1;
  --excel-ribbon-border: #d4d4d4;
  --excel-grid-header-bg: #f3f2f1;
  --excel-grid-header-color: #201f1e;
  --excel-grid-border: #d4d4d4;
  --excel-header-border: #c6c6c6;
  --excel-grid-cell-bg: #ffffff;
  --excel-grid-text: #000000;
  --excel-status-bg: #107C41;
  --excel-status-text: #ffffff;
  /* Active cell: Excel-green outline */
  --excel-selection-border: #107C41;
  --excel-selection-bg: #ffffff;
  /* Multi-cell range: Excel blue highlight (light mode — matches real Excel) */
  --excel-range-bg: rgba(173, 214, 255, 0.55);
  --excel-range-border: #1a73e8;
  /* Selected header (light mode) */
  --excel-header-selected-bg: rgba(26, 115, 232, 0.14);
  --excel-header-selected-color: #1557b0;
}

/* ── Day Badge Customization for Excel Track ─────────────────────── */
.day-picker-pill .track-logo-badge.track-logo-excel svg {
  width: 14px;
  height: 14px;
}

.day-picker-dot--excel {
  background: #21A366 !important;
  box-shadow: 0 0 8px rgba(33, 163, 102, 0.6) !important;
}

/* ── Toolbar Excel Action Buttons ───────────────────────────────── */
.tb-btn--excel-run {
  background: linear-gradient(135deg, #107C41 0%, #21A366 100%) !important;
  border: 1px solid #21A366 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 10px rgba(16, 124, 65, 0.4) !important;
}

.tb-btn--excel-run:hover {
  background: linear-gradient(135deg, #0b5c30 0%, #107C41 100%) !important;
  box-shadow: 0 4px 14px rgba(16, 124, 65, 0.6) !important;
  transform: translateY(-1px);
}

.tb-btn--xlsx {
  background: linear-gradient(135deg, #107c41 0%, #1e8e3e 100%) !important;
  color: #ffffff !important;
  border: 1px solid #107c41 !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.tb-btn--xlsx:hover {
  background: linear-gradient(135deg, #0b5c30 0%, #107c41 100%) !important;
  box-shadow: 0 2px 8px rgba(16, 124, 65, 0.4) !important;
  transform: translateY(-1px);
}

.tb-btn--gsheets {
  background: linear-gradient(135deg, #0f9d58 0%, #34a853 100%) !important;
  color: #ffffff !important;
  border: 1px solid #0f9d58 !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.tb-btn--gsheets:hover {
  background: linear-gradient(135deg, #0b8043 0%, #0f9d58 100%) !important;
  box-shadow: 0 2px 8px rgba(15, 157, 88, 0.4) !important;
  transform: translateY(-1px);
}

/* ── Practice Question Target Coordinate Badge ──────────────────── */
.target-coord-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 124, 65, 0.15);
  border: 1px solid var(--excel-accent);
  color: #34d399;
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  letter-spacing: 0.02em;
}

/* ═════════════════════════════════════════════════════════════════
   EXCEL SPREADSHEET STUDIO WORKBENCH (REPLACES CODEMIRROR)
═════════════════════════════════════════════════════════════════ */

.excel-workbench-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--excel-grid-cell-bg);
  border-top: 1px solid var(--excel-ribbon-border);
  overflow-y: auto;
  overflow-x: hidden;
}

.excel-ribbon-tab-bar,
.excel-ribbon-toolbar,
.excel-formula-bar,
.point-mode-banner,
.excel-bottom-bar,
.excel-status-bar,
#mainOutput.output-section {
  flex-shrink: 0 !important;
}

/* ── 1. Ribbon Tab Bar ─────────────────────────────────────────── */
.excel-ribbon-tab-bar {
  display: flex;
  align-items: center;
  height: 32px;
  background: var(--excel-ribbon-bg);
  border-bottom: 1px solid var(--excel-ribbon-border);
  padding: 0 8px;
  gap: 4px;
  user-select: none;
}

.ribbon-tab-btn {
  background: none;
  border: none;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim, #666);
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  transition: all 0.15s;
}

.ribbon-tab-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main, #111);
}

.ribbon-tab-btn.active {
  background: var(--excel-grid-cell-bg);
  color: var(--excel-brand-green);
  font-weight: 700;
  border-bottom: 2px solid var(--excel-brand-green);
}

/* ── 2. Ribbon Command Bar (Tools Toolbar) ──────────────────────── */
.excel-ribbon-toolbar {
  display: flex;
  align-items: center;
  min-height: 44px;
  background: var(--excel-ribbon-bg);
  border-bottom: 1px solid var(--excel-ribbon-border);
  padding: 4px 10px;
  gap: 8px;
  overflow-x: auto;
  user-select: none;
}

.ribbon-panel {
  display: none;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.ribbon-panel.active {
  display: flex;
}

.ribbon-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 8px;
  border-right: 1px solid var(--excel-ribbon-border);
}

.ribbon-group:last-child {
  border-right: none;
}

.ribbon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 26px;
  height: 28px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--excel-grid-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.ribbon-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.12);
}

.ribbon-btn.active {
  background: rgba(16, 124, 65, 0.18);
  border-color: var(--excel-brand-green);
  color: var(--excel-brand-green);
}

.ribbon-btn.pivot-btn {
  background: rgba(16, 124, 65, 0.12);
  border: 1px solid var(--excel-brand-green);
  color: var(--excel-brand-green);
  font-weight: 700;
}

.ribbon-btn.pivot-btn:hover {
  background: var(--excel-brand-green);
  color: #ffffff;
}

.ribbon-select {
  height: 28px;
  padding: 0 6px;
  background: var(--excel-grid-cell-bg);
  border: 1px solid var(--excel-ribbon-border);
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--excel-grid-text);
  outline: none;
  cursor: pointer;
}

.ribbon-chip-btn {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  background: rgba(16, 124, 65, 0.1);
  border: 1px solid rgba(16, 124, 65, 0.25);
  color: var(--excel-brand-green);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.ribbon-chip-btn:hover {
  background: var(--excel-brand-green);
  color: #ffffff;
}

/* ── 3. Excel Formula Bar ───────────────────────────────────────── */
.excel-formula-bar {
  display: flex;
  align-items: center;
  height: 36px;
  background: var(--excel-grid-cell-bg);
  border-bottom: 1px solid var(--excel-ribbon-border);
  padding: 0 10px;
  gap: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
  z-index: 10;
}

.name-box {
  min-width: 65px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--excel-brand-green);
  background: rgba(16, 124, 65, 0.12);
  border: 1px solid var(--excel-brand-green);
  border-radius: 4px;
  padding: 0 8px;
  font-size: 12px;
}

.formula-btn-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.formula-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-dim, #777);
  font-weight: 700;
  font-size: 13px;
  border-radius: 3px;
  cursor: pointer;
}

.formula-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--excel-grid-text);
}

.formula-btn.fx-icon {
  font-style: italic;
  font-weight: 800;
  color: #0284c7;
  font-size: 14px;
}

.formula-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  height: 28px;
  background: var(--excel-grid-cell-bg);
  border: 1px solid var(--excel-ribbon-border);
  border-radius: 4px;
  padding: 0 8px;
}

.formula-input-wrapper:focus-within {
  border-color: var(--excel-brand-green);
  box-shadow: 0 0 0 2px var(--excel-glow);
}

.formula-main-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
  color: var(--excel-grid-text);
}

/* ── 4. Spreadsheet Interactive Grid Table ──────────────────────── */
.excel-grid-viewport {
  flex: 1 1 140px;
  min-height: 120px;
  overflow: auto;
  position: relative;
  background: var(--excel-grid-cell-bg);
}

.excel-sheet-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
  font-family: 'Calibri', 'Segoe UI', var(--font-sans, sans-serif);
  font-size: 12px;
  color: var(--excel-grid-text);
  user-select: none;
  background: var(--excel-grid-cell-bg);
}

.excel-corner-th {
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  height: 24px;
  background: var(--excel-grid-header-bg);
  position: sticky;
  top: 0;
  left: 0;
  z-index: 30;
  border-right: 1px solid var(--excel-header-border);
  border-bottom: 1px solid var(--excel-header-border);
  cursor: pointer;
  box-sizing: border-box;
}

.corner-triangle {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 7px 7px;
  border-color: transparent transparent var(--excel-header-border) transparent;
  position: absolute;
  right: 3px;
  bottom: 3px;
}

.excel-col-th {
  height: 24px;
  min-height: 24px;
  max-height: 24px;
  background: var(--excel-grid-header-bg);
  color: var(--excel-grid-header-color);
  font-weight: 600;
  font-size: 11px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 20;
  border-right: 1px solid var(--excel-header-border);
  border-bottom: 1px solid var(--excel-header-border);
  line-height: 23px;
  box-sizing: border-box;
  user-select: none;
  cursor: pointer;
}

.excel-col-th.selected {
  background: var(--excel-header-selected-bg, rgba(26, 115, 232, 0.14)) !important;
  color: var(--excel-header-selected-color, #1557b0) !important;
  font-weight: 700;
  border-bottom: 2px solid var(--excel-range-border, #1a73e8) !important;
}

.excel-row-th {
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  height: 24px;
  min-height: 24px;
  max-height: 24px;
  background: var(--excel-grid-header-bg);
  color: var(--excel-grid-header-color);
  font-weight: 600;
  font-size: 11px;
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 15;
  border-right: 1px solid var(--excel-header-border);
  border-bottom: 1px solid var(--excel-grid-border);
  line-height: 23px;
  box-sizing: border-box;
}

.excel-row-th.selected {
  background: var(--excel-header-selected-bg, rgba(26, 115, 232, 0.14)) !important;
  color: var(--excel-header-selected-color, #1557b0) !important;
  font-weight: 700;
  border-right: 2px solid var(--excel-range-border, #1a73e8) !important;
}

.excel-data-cell {
  background: var(--excel-grid-cell-bg);
  color: var(--excel-grid-text);
  cursor: cell;
  position: relative;
  height: 24px;
  min-height: 24px;
  max-height: 24px;
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid var(--excel-grid-border);
  border-bottom: 1px solid var(--excel-grid-border);
  line-height: 23px;
  box-sizing: border-box;
}

.excel-data-cell.has-formula {
  font-weight: 600;
}

.excel-data-cell.active-cell {
  outline: 2px solid var(--excel-selection-border) !important;
  outline-offset: -2px;
  background: var(--excel-selection-bg) !important;
  z-index: 10;
}

.excel-data-cell.in-range-selection {
  background: rgba(16, 124, 65, 0.14) !important;
}

.excel-inline-cell-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid var(--excel-brand-green) !important;
  padding: 3px 6px;
  font-family: 'Segoe UI', var(--font-sans, sans-serif);
  font-size: 12.5px;
  background: var(--excel-grid-cell-bg);
  color: var(--excel-grid-text);
  outline: none;
  z-index: 50;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.excel-cell-fill-handle {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 7px;
  height: 7px;
  background: var(--excel-brand-green);
  border: 1px solid #ffffff;
  cursor: crosshair;
  z-index: 25;
}

/* ── 5. Bottom Sheet Tabs Navigation ────────────────────────────── */
.excel-bottom-bar {
  display: flex;
  align-items: center;
  height: 34px;
  background: var(--excel-ribbon-bg);
  border-top: 1px solid var(--excel-ribbon-border);
  padding: 0 8px;
  gap: 4px;
  user-select: none;
}

.sheet-nav-arrow {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-dim, #666);
  cursor: pointer;
  border-radius: 3px;
  font-size: 11px;
}

.sheet-nav-arrow:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--excel-grid-text);
}

.sheet-tabs-list {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
}

.excel-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim, #555);
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.excel-tab:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--excel-grid-text);
}

.excel-tab.active {
  background: var(--excel-grid-cell-bg);
  border-color: var(--excel-ribbon-border);
  border-bottom: 2px solid var(--excel-brand-green);
  color: var(--excel-brand-green);
  font-weight: 700;
}

.add-sheet-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  font-size: 15px;
  color: var(--text-dim, #666);
  cursor: pointer;
  border-radius: 3px;
}

.add-sheet-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* ── 6. Excel Status Bar (Calculated Aggregations) ───────────────── */
.excel-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 25px;
  background: var(--excel-status-bg);
  color: var(--excel-status-text);
  padding: 0 12px;
  font-size: 11.5px;
  font-weight: 600;
  user-select: none;
}

.status-left, .status-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-metric {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ── 7. Pivot Table Modal (Interactive Feature) ─────────────────── */
.pivot-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.pivot-modal-card {
  width: 100%;
  max-width: 860px;
  background: var(--bg-card, #0c1424);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pivot-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #0b5c30 0%, #107C41 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pivot-body {
  padding: 20px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
}

.pivot-fields-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px;
}

.pivot-fields-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
  color: #34d399;
}

.pivot-field-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 12px;
  cursor: pointer;
}

.pivot-result-panel {
  background: var(--excel-grid-cell-bg);
  border: 1px solid var(--excel-grid-border);
  border-radius: 8px;
  overflow: auto;
  max-height: 400px;
  padding: 12px;
}

.pivot-table-render {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pivot-table-render th, .pivot-table-render td {
  border: 1px solid var(--excel-grid-border);
  padding: 6px 10px;
  text-align: right;
}

.pivot-table-render th:first-child, .pivot-table-render td:first-child {
  text-align: left;
}

.pivot-table-render th {
  background: var(--excel-grid-header-bg);
  color: var(--excel-brand-green);
  font-weight: 700;
}

.pivot-footer {
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Question Spotlight & Focus View (Section 8.5) ──────────────── */
.question-spotlight-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
}

/* ═════════════════════════════════════════════════════════════════
   CHAPTER / SUBTOPIC DROPDOWN (100% SQL & PYTHON FLAGSHIP PARITY)
   ═════════════════════════════════════════════════════════════════ */
.chapter-list {
  position: absolute !important;
  top: 46px !important;
  right: 12px !important;
  left: auto !important;
  width: 380px !important;
  max-width: calc(100vw - 24px) !important;
  max-height: 380px !important;
  z-index: 1000 !important;
  background: rgba(10, 15, 29, 0.98) !important;
  border: 1px solid rgba(16, 124, 65, 0.3) !important;
  border-radius: 12px !important;
  box-shadow: 0 20px 45px -8px rgba(0, 0, 0, 0.8),
              0 0 20px rgba(16, 124, 65, 0.15),
              inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  overflow: hidden !important;
  overflow-y: auto !important;
  padding: 6px !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  margin: 0 !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(16, 124, 65, 0.4) transparent !important;
  animation: popoverFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

[data-theme="light"] .chapter-list {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04) !important;
}

.chapter-item {
  display: grid !important;
  grid-template-columns: 24px 38px 1fr !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 7px 10px !important;
  border-radius: 8px !important;
  color: #cbd5e1 !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-size: 0.81rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  border: 1px solid transparent !important;
  margin-bottom: 2px !important;
  min-width: 0 !important;
  letter-spacing: -0.01em !important;
  box-sizing: border-box !important;
}

.chapter-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

[data-theme="light"] .chapter-item {
  color: #1e293b !important;
}

[data-theme="light"] .chapter-item:hover {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

.chapter-item.active {
  background: rgba(16, 124, 65, 0.12) !important;
  border-color: rgba(16, 124, 65, 0.35) !important;
  color: #34d399 !important;
}

[data-theme="light"] .chapter-item.active {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  color: #065f46 !important;
}

.chapter-item__icon {
  font-size: 0.68rem !important;
  color: #34d399 !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 6px !important;
  background: rgba(16, 124, 65, 0.18) !important;
  transition: all 0.15s ease !important;
}

[data-theme="light"] .chapter-item__icon {
  background: #e0f2fe !important;
  color: #0284c7 !important;
}

.chapter-item.active .chapter-item__icon {
  background: linear-gradient(135deg, #107C41, #21A366) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(16, 124, 65, 0.35) !important;
}

.chapter-item__time {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.70rem !important;
  font-weight: 700 !important;
  color: #94a3b8 !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 5px !important;
  padding: 2px 5px !important;
  min-width: 32px !important;
  flex-shrink: 0 !important;
  text-align: center !important;
  letter-spacing: 0 !important;
  line-height: 1.2 !important;
  transition: all 0.15s ease !important;
}

[data-theme="light"] .chapter-item__time {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #64748b !important;
}

.chapter-item__title {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important;
}

/* ═════════════════════════════════════════════════════════════════
   QUESTION PICKER POPOVER (100% SQL & PYTHON FLAGSHIP PARITY)
   ═════════════════════════════════════════════════════════════════ */
.q-picker-popover {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  z-index: 10000 !important;
  background: #0d1117 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
  width: 360px !important;
  max-width: calc(100vw - 20px) !important;
  max-height: min(440px, 60vh) !important;
  display: flex;
  flex-direction: column !important;
  overflow: hidden !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  animation: qPickerSlideIn 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@keyframes qPickerSlideIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

[data-theme="light"] .q-picker-popover {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04) !important;
}

.q-picker-header {
  padding: 10px 14px 9px !important;
  font-size: 0.68rem !important;
  font-weight: 750 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: #94a3b8 !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-shrink: 0 !important;
}

[data-theme="light"] .q-picker-header {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-bottom-color: #e2e8f0 !important;
}

.q-picker-count-badge {
  font-size: 0.64rem !important;
  font-weight: 700 !important;
  color: #34d399 !important;
  background: rgba(16, 124, 65, 0.16) !important;
  padding: 2px 7px !important;
  border-radius: 10px !important;
  letter-spacing: normal !important;
}

[data-theme="light"] .q-picker-count-badge {
  color: #0b5c30 !important;
  background: #dcfce7 !important;
}

.q-picker-list {
  overflow-y: auto !important;
  flex: 1 !important;
  padding: 5px !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(16, 124, 65, 0.4) transparent !important;
}

.q-picker-item {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 10px !important;
  cursor: pointer !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  width: 100% !important;
  text-align: left !important;
  border-radius: 8px !important;
  transition: all 0.12s ease !important;
  margin-bottom: 2px !important;
  box-sizing: border-box !important;
  font-family: inherit !important;
}

.q-picker-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="light"] .q-picker-item:hover {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

.q-picker-item.active {
  background: rgba(16, 124, 65, 0.12) !important;
  border-color: rgba(16, 124, 65, 0.35) !important;
}

[data-theme="light"] .q-picker-item.active {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
}

.q-picker-item-num {
  flex-shrink: 0 !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  font-family: 'JetBrains Mono', monospace !important;
  color: #94a3b8 !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 6px !important;
  padding: 3px 6px !important;
  min-width: 32px !important;
  text-align: center !important;
  line-height: 1.2 !important;
}

[data-theme="light"] .q-picker-item-num {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #64748b !important;
}

.q-picker-item.active .q-picker-item-num {
  color: #ffffff !important;
  background: linear-gradient(135deg, #107C41, #21A366) !important;
  border-color: transparent !important;
  box-shadow: 0 2px 6px rgba(16, 124, 65, 0.35) !important;
}

.q-picker-item-main {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.q-picker-item-title {
  font-size: 0.79rem !important;
  color: #f1f5f9 !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.35 !important;
}

[data-theme="light"] .q-picker-item-title {
  color: #0f172a !important;
}

.q-picker-item-status {
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 18px !important;
  height: 18px !important;
}

.q-picker-item-dot {
  width: 5px !important;
  height: 5px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.2) !important;
}

[data-theme="light"] .q-picker-item-dot {
  background: #cbd5e1 !important;
}

/* ═════════════════════════════════════════════════════════════════
   SPLIT SCREEN DIVIDER CONTROLS (100% SQL & PYTHON FLAGSHIP PARITY)
   ═════════════════════════════════════════════════════════════════ */
.divider {
  position: relative !important;
}

.divider-toggles {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 20px !important;
  padding: 6px 4px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
  z-index: 25 !important;
}

[data-theme="light"] .divider-toggles {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
}

.div-toggle-btn {
  width: 26px !important;
  height: 26px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #94a3b8 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.65rem !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
  padding: 0 !important;
  user-select: none !important;
}

.div-toggle-btn:hover {
  background: #107C41 !important;
  color: #ffffff !important;
  border-color: #21A366 !important;
  transform: scale(1.1) !important;
}

[data-theme="light"] .div-toggle-btn {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #475569 !important;
}

[data-theme="light"] .div-toggle-btn:hover {
  background: #107C41 !important;
  color: #ffffff !important;
  border-color: #107C41 !important;
}

/* ── Virtual Grid Spotlight & Selection Styling ────────────────── */
.excel-cell {
  background: var(--excel-grid-cell-bg);
  color: var(--excel-grid-text);
  cursor: cell;
  position: relative;
  height: 24px;
  min-height: 24px;
  max-height: 24px;
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid var(--excel-grid-border);
  border-bottom: 1px solid var(--excel-grid-border);
  line-height: 23px;
  box-sizing: border-box;
  font-family: 'Segoe UI', var(--font-sans, sans-serif);
  font-size: 12px;
}

.excel-cell.spotlight-target-cell {
  outline: 2px dashed #f59e0b !important;
  outline-offset: -2px;
  background: rgba(245, 158, 11, 0.15) !important;
  font-weight: 700;
}

th.spotlight-col {
  border-top: 3px solid #107C41 !important;
  background: rgba(16, 124, 65, 0.12) !important;
  color: var(--excel-brand-green) !important;
  font-weight: 700;
}

.excel-spacer-row {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  font-size: 0 !important;
  line-height: 0 !important;
}
.excel-spacer-row td {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  font-size: 0 !important;
  line-height: 0 !important;
  pointer-events: none;
}

.excel-cell.copied-marching {
  outline: 2px dashed #107c41 !important;
  outline-offset: -2px;
  animation: excelMarching 1s linear infinite;
}

@keyframes excelMarching {
  0% { outline-offset: -2px; }
  50% { outline-offset: -1px; }
  100% { outline-offset: -2px; }
}

/* ── Inline Cell Editor (Real Excel-style in-cell input) ─────────── */
.excel-inline-input {
  position: absolute;
  z-index: 200;
  border: 2px solid #217346 !important;
  outline: none !important;
  padding: 0 4px;
  font-size: 12px;
  font-family: Calibri, 'Segoe UI', Arial, sans-serif;
  background: #ffffff;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(33, 115, 70, 0.25);
  caret-color: #000;
}
.excel-inline-input:focus {
  outline: none !important;
  border-color: #107c41 !important;
}
/* ── Active Cell: Excel-style green border, white/dark background ── */
.excel-cell.active-cell {
  background: var(--excel-selection-bg) !important;
  outline: 2px solid var(--excel-selection-border) !important;
  outline-offset: -2px;
  z-index: 12;
  position: relative;
}

/* ── In-Range Selection: Excel blue fill (NOT green) ─────────────── */
.excel-cell.in-range {
  background: var(--excel-range-bg) !important;
}

/* Active cell INSIDE a range keeps white/clear background so it stands out */
.excel-cell.active-cell.in-range {
  background: var(--excel-selection-bg) !important;
  outline: 2px solid var(--excel-selection-border) !important;
  outline-offset: -2px;
  z-index: 12;
}

/* ── Column / Row headers turn BLUE when their cells are in selection ── */
th.excel-col-th.selected {
  background: var(--excel-header-selected-bg) !important;
  color: var(--excel-header-selected-color) !important;
  border-bottom: 2px solid var(--excel-range-border) !important;
}
th.excel-row-th.selected {
  background: var(--excel-header-selected-bg) !important;
  color: var(--excel-header-selected-color) !important;
  border-right: 2px solid var(--excel-range-border) !important;
}

/* ── Selection Rectangle Overlay (the blue border around entire range) ── */
.excel-selection-overlay {
  position: absolute;
  pointer-events: none;
  z-index: 15;
  border: 2px solid var(--excel-range-border, #1a73e8);
  box-sizing: border-box;
  border-radius: 0;
}

/* ── Copied Marching Ants (Ctrl+C) ───────────────────────────────── */
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 7px 7px;
  border-color: transparent transparent #64748b transparent;
  margin: 3px 0 0 3px;
}

/* ── Point Mode & Animated Marching Ants ────────────────────────── */
.point-mode-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(37, 99, 235, 0.12);
  border-bottom: 1px solid rgba(37, 99, 235, 0.35);
  color: #60a5fa;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  z-index: 20;
}

html[data-theme="light"] .point-mode-banner,
body:not(.dark) .point-mode-banner {
  background: rgba(37, 99, 235, 0.08);
  border-bottom-color: rgba(37, 99, 235, 0.25);
  color: #1d4ed8;
}

.point-mode-pulse {
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border-radius: 50%;
  animation: pointPulse 1s infinite alternate;
}

@keyframes pointPulse {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1.3); opacity: 1; }
}

.point-mode-text {
  flex: 1;
}

.point-mode-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.point-mode-btn {
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.point-mode-btn--done {
  background: #107C41;
  color: #ffffff;
}

.point-mode-btn--cancel {
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
}

/* Marching Ants Cell Highlights */
@keyframes pointAntsPulse {
  0% { opacity: 0.85; }
  50% { opacity: 1; }
  100% { opacity: 0.85; }
}

.excel-cell.in-point-ref {
  background: rgba(37, 99, 235, 0.12) !important;
  z-index: 5;
  position: relative;
  animation: pointAntsPulse 1.2s infinite ease-in-out;
}

.excel-cell.in-point-ref.color-1 {
  background: rgba(225, 29, 72, 0.12) !important;
}

.excel-cell.in-point-ref.color-2 {
  background: rgba(16, 124, 65, 0.12) !important;
}

.excel-cell.in-point-ref.color-3 {
  background: rgba(217, 119, 6, 0.12) !important;
}

/* Animated Marching Ants Dashed Edges (Color 0: Azure) */
.excel-cell.marching-edge-top {
  border-top: 2px dashed #2563eb !important;
}
.excel-cell.marching-edge-bottom {
  border-bottom: 2px dashed #2563eb !important;
}
.excel-cell.marching-edge-left {
  border-left: 2px dashed #2563eb !important;
}
.excel-cell.marching-edge-right {
  border-right: 2px dashed #2563eb !important;
}

/* Color 1: Crimson */
.excel-cell.color-1.marching-edge-top { border-top: 2px dashed #e11d48 !important; }
.excel-cell.color-1.marching-edge-bottom { border-bottom: 2px dashed #e11d48 !important; }
.excel-cell.color-1.marching-edge-left { border-left: 2px dashed #e11d48 !important; }
.excel-cell.color-1.marching-edge-right { border-right: 2px dashed #e11d48 !important; }

/* Color 2: Emerald */
.excel-cell.color-2.marching-edge-top { border-top: 2px dashed #107C41 !important; }
.excel-cell.color-2.marching-edge-bottom { border-bottom: 2px dashed #107C41 !important; }
.excel-cell.color-2.marching-edge-left { border-left: 2px dashed #107C41 !important; }
.excel-cell.color-2.marching-edge-right { border-right: 2px dashed #107C41 !important; }

/* Color 3: Amber */
.excel-cell.color-3.marching-edge-top { border-top: 2px dashed #d97706 !important; }
.excel-cell.color-3.marching-edge-bottom { border-bottom: 2px dashed #d97706 !important; }
.excel-cell.color-3.marching-edge-left { border-left: 2px dashed #d97706 !important; }
.excel-cell.color-3.marching-edge-right { border-right: 2px dashed #d97706 !important; }

/* ═════════════════════════════════════════════════════════════════
   10/10 FLAGSHIP ELEVATION: HEADER BRANDING & CUSTOM DAY PILLS
═════════════════════════════════════════════════════════════════ */
.day-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-nav-arrow-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.day-nav-arrow-btn:hover:not(:disabled) {
  background: rgba(16, 124, 65, 0.2);
  border-color: #107C41;
  color: #ffffff;
}

.day-nav-arrow-btn:disabled,
.day-nav-arrow-btn.disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: auto !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  color: #475569 !important;
}

.day-picker-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.day-picker-pill:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(16, 124, 65, 0.5);
}

.day-picker-pill select {
  display: none !important;
}

.day-picker-pill .custom-select-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  cursor: pointer;
}

.day-picker-pill .day-picker-chevron {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.day-picker-pill.open .day-picker-chevron {
  transform: rotate(180deg);
}

.day-picker-pill .custom-select-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 340px;
  max-width: min(420px, calc(100vw - 24px));
  max-height: 420px;
  overflow-y: auto;
  background: rgba(10, 15, 29, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: none;
  flex-direction: column;
  padding: 6px;
  z-index: 100000;
  box-sizing: border-box;
}

.day-picker-pill .custom-select-options.open {
  display: flex !important;
  animation: dropdownMenuFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.day-picker-pill .custom-select-options::-webkit-scrollbar {
  width: 5px;
}
.day-picker-pill .custom-select-options::-webkit-scrollbar-track {
  background: transparent;
}
.day-picker-pill .custom-select-options::-webkit-scrollbar-thumb {
  background: rgba(16, 124, 65, 0.4);
  border-radius: 4px;
}
.day-picker-pill .custom-select-options::-webkit-scrollbar-thumb:hover {
  background: #107C41;
}

.day-picker-pill .dropdown-section-header {
  padding: 8px 12px 4px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 6px;
  margin-bottom: 4px;
}
.day-picker-pill .dropdown-section-header:first-child {
  margin-top: 0;
}

.day-picker-pill .custom-select-option {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
  border-radius: 8px;
  margin: 2px 0;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.day-picker-pill .custom-select-option:hover {
  background: rgba(16, 124, 65, 0.15);
  color: #ffffff;
}
.day-picker-pill .custom-select-option.selected {
  background: linear-gradient(90deg, rgba(16, 124, 65, 0.28), rgba(16, 124, 65, 0.08));
  color: #34d399;
  font-weight: 700;
  border-left: 3px solid #107C41;
}
.day-picker-pill .custom-select-option.is-locked {
  opacity: 0.7;
}

.day-picker-pill .option-day-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.day-picker-pill .option-day-tag strong {
  color: #f8fafc;
  font-weight: 700;
  font-size: 12px;
}
.day-picker-pill .option-day-tag .option-day-title {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
}
.day-picker-pill .custom-select-option:hover .option-day-title,
.day-picker-pill .custom-select-option.selected .option-day-title {
  color: #e2e8f0;
}

/* Badges */
.day-picker-pill .day-free-badge {
  background: rgba(16, 124, 65, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 124, 65, 0.4);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
}
.day-picker-pill .day-coming-soon-badge {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}
.day-picker-pill .day-lock-badge {
  font-size: 11px;
}

.day-picker-pill.topic-picker-pill {
  max-width: 320px;
}

.day-picker-pill.topic-picker-pill .day-picker-dot,
.topic-picker-pill .day-picker-dot {
  display: none !important;
}

.day-picker-pill .selected-text svg {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0 !important;
}

.slide-header-content {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  padding: 8px 14px !important;
  border-bottom: 1px solid rgba(16, 124, 65, 0.25) !important;
  box-sizing: border-box !important;
}

.slide-header-content h2 {
  margin: 0 !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  color: #e2e8f0 !important;
  display: flex !important;
  align-items: center !important;
  letter-spacing: -0.01em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important;
}

html[data-theme="light"] .slide-header-content,
[data-theme="light"] .slide-header-content {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .slide-header-content h2,
[data-theme="light"] .slide-header-content h2 {
  color: #0f172a !important;
}

.day-picker-pill.topic-picker-pill .trigger-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: #cbd5e1;
}

html[data-theme="light"] .day-picker-pill,
[data-theme="light"] .day-picker-pill {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Keep dropdown signature dark glassmorphism on all themes (Parity with SQL and Python) */
.day-picker-pill .custom-select-options {
  background: rgba(8, 14, 28, 0.98) !important;
  backdrop-filter: blur(24px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(200%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  padding: 8px 6px !important;
}

.day-picker-pill .dropdown-section-header {
  padding: 8px 12px 5px 12px !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  color: #94a3b8 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  background: transparent !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-bottom: none !important;
  margin-top: 6px !important;
  margin-bottom: 2px !important;
  pointer-events: none !important;
  user-select: none !important;
}
.day-picker-pill .dropdown-section-header:first-child {
  border-top: none !important;
  margin-top: 0 !important;
}

.day-picker-pill .custom-select-option {
  padding: 8px 12px !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  color: #cbd5e1 !important;
  border-radius: 10px !important;
  margin: 2px 0 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
  white-space: nowrap !important;
  border: 1px solid transparent !important;
}
.day-picker-pill .custom-select-option:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}
.day-picker-pill .custom-select-option.selected {
  background: linear-gradient(90deg, rgba(16, 124, 65, 0.32), rgba(16, 124, 65, 0.1)) !important;
  border: 1px solid rgba(16, 124, 65, 0.45) !important;
  color: #34d399 !important;
  font-weight: 700 !important;
}
.day-picker-pill .custom-select-option.selected .option-day-tag strong {
  color: #34d399 !important;
}
.day-picker-pill .custom-select-option .option-day-tag strong {
  color: #f8fafc !important;
  font-size: 0.8rem !important;
}
.day-picker-pill .custom-select-option .option-day-title {
  color: #94a3b8 !important;
  font-size: 0.72rem !important;
}
.day-picker-pill .custom-select-option:hover .option-day-title,
.day-picker-pill .custom-select-option.selected .option-day-title {
  color: #e2e8f0 !important;
}

.day-picker-pill .day-free-badge {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  font-size: 0.65rem !important;
  font-weight: 800 !important;
  border-radius: 4px !important;
  padding: 2px 6px !important;
  letter-spacing: 0.04em !important;
}
.day-picker-pill .day-coming-soon-badge {
  background: rgba(56, 189, 248, 0.12) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  border-radius: 4px !important;
  padding: 2px 6px !important;
}

html[data-theme="light"] .day-nav-arrow-btn,
[data-theme="light"] .day-nav-arrow-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

html[data-theme="light"] .day-nav-arrow-btn:disabled,
html[data-theme="light"] .day-nav-arrow-btn.disabled,
[data-theme="light"] .day-nav-arrow-btn:disabled,
[data-theme="light"] .day-nav-arrow-btn.disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: auto !important;
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #94a3b8 !important;
}

/* Coming Soon Toast */
.excel-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100000;
  background: rgba(10, 15, 29, 0.96);
  border: 1px solid rgba(16, 124, 65, 0.5);
  backdrop-filter: blur(16px);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 16px rgba(16, 124, 65, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Inter', -apple-system, sans-serif;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.excel-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.excel-toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
}
.excel-toast-icon {
  font-size: 20px;
}
.excel-toast-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.excel-toast-text strong {
  font-size: 13px;
  color: #34d399;
}
.excel-toast-text span {
  font-size: 12px;
  color: #94a3b8;
}
html[data-theme="light"] .excel-toast,
[data-theme="light"] .excel-toast {
  background: #ffffff !important;
  border-color: #107C41 !important;
  color: #0f172a !important;
  box-shadow: 0 12px 32px rgba(16, 124, 65, 0.15) !important;
}
html[data-theme="light"] .excel-toast-text strong,
[data-theme="light"] .excel-toast-text strong {
  color: #107C41 !important;
}
html[data-theme="light"] .excel-toast-text span,
[data-theme="light"] .excel-toast-text span {
  color: #64748b !important;
}

/* ═════════════════════════════════════════════════════════════════
   10/10 FLAGSHIP ELEVATION: THEORY PRESENTATION & VISUAL CARDS
═════════════════════════════════════════════════════════════════ */
.slide-section {
  margin-bottom: 28px;
  scroll-margin-top: 70px;
}

.slide-section-title.heading-box-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.heading-num-box {
  background: linear-gradient(135deg, #107C41 0%, #21A366 100%);
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(16, 124, 65, 0.4);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.heading-title-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #141824;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  flex: 1;
}

.heading-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
}

.heading-title-text {
  font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  flex: 1;
}

.audio-play-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(16, 124, 65, 0.2);
  border: 1px solid rgba(16, 124, 65, 0.5);
  color: #21A366;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  line-height: 1;
}

.audio-play-btn:hover {
  background: #107C41;
  color: #ffffff;
  transform: scale(1.1);
}

/* Theory Slide Cards */
.theory-card {
  background: #121622;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  color: #e2e8f0;
  line-height: 1.65;
}

.theory-card .lead-text {
  font-size: 14px;
  color: #cbd5e1;
  margin-top: 0;
  margin-bottom: 16px;
  line-height: 1.65;
}

/* 3-Column Architecture Matrix Cards */
.architecture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.arch-box {
  background: #181d2a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 3px solid #107C41;
  border-radius: 8px;
  padding: 16px 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.arch-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(33, 163, 102, 0.4);
}

.arch-box h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #34d399;
  margin-top: 0;
  margin-bottom: 8px;
}

.arch-box p {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.55;
  margin: 0;
}

/* Glassmorphic Key Notes Callout */
.keynote-box {
  border-radius: 8px;
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 13.5px;
  line-height: 1.6;
}

.keynote-box.keynote-emerald {
  background: rgba(16, 124, 65, 0.12);
  border: 1px solid rgba(16, 124, 65, 0.35);
  border-left: 4px solid #107C41;
  color: #d1fae5;
}

.keynote-box strong {
  color: #34d399;
  font-weight: 700;
}

/* 2D Flagship Technical Reference Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 16px 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.reference-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.reference-table th {
  background: #181f30;
  color: #38bdf8;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 11px 14px;
  border-bottom: 2px solid #2d3748;
}

.reference-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  line-height: 1.5;
}

.reference-table tr:last-child td {
  border-bottom: none;
}

.reference-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.reference-table code {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

/* Light Mode Overrides for Theory Cards */
html[data-theme="light"] .heading-title-box,
[data-theme="light"] .heading-title-box {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .heading-title-text,
[data-theme="light"] .heading-title-text {
  color: #0f172a !important;
}

html[data-theme="light"] .theory-card,
[data-theme="light"] .theory-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
  color: #334155 !important;
}

html[data-theme="light"] .theory-card .lead-text,
[data-theme="light"] .theory-card .lead-text {
  color: #475569 !important;
}

html[data-theme="light"] .arch-box,
[data-theme="light"] .arch-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-top: 3px solid #107C41 !important;
}

html[data-theme="light"] .arch-box h4,
[data-theme="light"] .arch-box h4 {
  color: #059669 !important;
}

html[data-theme="light"] .arch-box p,
[data-theme="light"] .arch-box p {
  color: #475569 !important;
}

html[data-theme="light"] .keynote-box.keynote-emerald,
[data-theme="light"] .keynote-box.keynote-emerald {
  background: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
  border-left: 4px solid #059669 !important;
  color: #065f46 !important;
}

html[data-theme="light"] .keynote-box.keynote-emerald strong,
[data-theme="light"] .keynote-box.keynote-emerald strong {
  color: #047857 !important;
}

html[data-theme="light"] .table-responsive,
[data-theme="light"] .table-responsive {
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .reference-table th,
[data-theme="light"] .reference-table th {
  background: #f1f5f9 !important;
  color: #0369a1 !important;
  border-bottom: 2px solid #cbd5e1 !important;
}

html[data-theme="light"] .reference-table td,
[data-theme="light"] .reference-table td {
  color: #334155 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .reference-table code,
[data-theme="light"] .reference-table code {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border: 1px solid #bae6fd !important;
}

/* ═════════════════════════════════════════════════════════════════
   10/10 FLAGSHIP ELEVATION: RESPONSIVE MOBILE SUITE (320PX - 768PX)
═════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .header {
    display: grid !important;
    grid-template-areas: "left right" "center center" !important;
    grid-template-columns: 1fr auto !important;
    align-items: center !important;
    gap: 4px 6px !important;
    padding: 4px 8px !important;
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
    box-sizing: border-box !important;
    transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease !important;
  }

  .header.is-collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-bottom-width: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }

  /* ── ROW 1: HEADER LEFT ────────────────────────────────────── */
  .header-left {
    grid-area: left !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .header-left .back-to-home-btn {
    margin-right: 0 !important;
    width: 26px !important;
    height: 26px !important;
    flex-shrink: 0 !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .header-left .back-to-home-btn svg {
    width: 15px !important;
    height: 15px !important;
  }

  .header-left .user-profile {
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
  }

  /* Compact Graded Stats Badges (Zero Collision with Action Buttons) */
  .stats-card {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    height: 22px !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
  }

  .stats-row {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    height: 22px !important;
    flex-wrap: nowrap !important;
  }

  .stats-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 0 !important;
    height: 22px !important;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25)) !important;
  }

  .stats-label {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 4px !important;
    font-size: 7px !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    line-height: 1 !important;
    border-radius: 4px 0 0 4px !important;
  }

  .stats-value--fraction {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1px 4px !important;
    min-width: 18px !important;
    line-height: 1 !important;
    border-radius: 0 4px 4px 0 !important;
  }

  .stats-value--fraction .stats-num {
    font-size: 8px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
  }

  .stats-value--fraction .stats-den {
    font-size: 7px !important;
    line-height: 1 !important;
    opacity: 0.8 !important;
  }

  /* ── ROW 1: HEADER RIGHT ───────────────────────────────────── */
  .header-right {
    grid-area: right !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
  }

  .hdr-btn--test,
  .hdr-btn--score {
    height: 24px !important;
    padding: 0 7px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    gap: 3px !important;
  }

  .hdr-btn--score svg {
    width: 11px !important;
    height: 11px !important;
    margin-right: 2px !important;
  }

  .header-overall-score {
    display: none !important;
  }

  /* ── ROW 2: DAY NAVIGATION & FLUID TOPIC PILL ──────────────── */
  .header-center {
    grid-area: center !important;
    width: 100% !important;
    display: flex !important;
    justify-content: stretch !important;
    overflow: visible !important;
  }

  .day-navigation {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    position: relative !important;
  }

  .day-nav-arrow-btn {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
  }

  .day-picker-pill:not(.topic-picker-pill) {
    height: 26px !important;
    padding: 0 6px !important;
    font-size: 11.5px !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    border-radius: 6px !important;
  }

  .day-picker-pill:not(.topic-picker-pill) .selected-text svg,
  .day-picker-pill:not(.topic-picker-pill) .track-icon-wrap svg {
    width: 15px !important;
    height: 15px !important;
  }

  .day-picker-pill.topic-picker-pill {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
    height: 26px !important;
    padding: 0 8px !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    overflow: hidden !important;
  }

  .day-picker-pill.topic-picker-pill .custom-select-trigger,
  .topic-picker-pill .custom-select-trigger {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    gap: 0 !important;
  }

  .day-picker-pill.topic-picker-pill .trigger-title,
  .topic-picker-pill .trigger-title {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: clamp(10.5px, 2.7vw, 12px) !important;
    font-weight: 600 !important;
    text-align: left !important;
    letter-spacing: -0.01em !important;
  }

  /* Duration badge hidden on mobile to give topic title 100% full width */
  .trigger-duration-badge,
  .topic-picker-pill .trigger-duration-badge,
  .topic-duration-badge {
    display: none !important;
  }

  /* Compact Theme Toggle Pill in Row 2 */
  .day-navigation .theme-toggle-btn {
    flex-shrink: 0 !important;
    margin-left: 2px !important;
    width: 38px !important;
    height: 22px !important;
    padding: 0 !important;
    border-radius: 9999px !important;
  }

  .day-navigation .theme-switch-thumb {
    width: 16px !important;
    height: 16px !important;
    top: 2px !important;
    left: 2px !important;
  }

  [data-theme="light"] .day-navigation .theme-switch-thumb {
    transform: translateX(16px) !important;
  }

  .day-navigation .track-icon svg,
  .day-navigation .thumb-icon svg {
    width: 9px !important;
    height: 9px !important;
  }
}

/* Extra narrow screens (<= 360px): Responsive score button label */
@media (max-width: 360px) {
  .header {
    padding: 4px 6px !important;
    gap: 4px 4px !important;
  }
  .hdr-btn--test {
    padding: 0 5px !important;
  }
  .hdr-btn--score {
    padding: 0 5px !important;
  }
  .stats-label {
    padding: 0 3px !important;
    font-size: 6.5px !important;
  }
  .stats-value--fraction {
    padding: 1px 3px !important;
    min-width: 16px !important;
  }
}

  /* ═════════════════════════════════════════════════════════════════
   FLAGSHIP SPLIT SCREEN WORKSPACE LAYOUT (DESKTOP & LAPTOP >= 901px)
   ═════════════════════════════════════════════════════════════════ */
@media (min-width: 901px) {
  .workspace,
  #workspaceContainer {
    display: flex !important;
    flex-direction: row !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    position: relative !important;
    height: calc(100vh - 56px) !important;
    min-height: 0 !important;
    width: 100% !important;
  }

  .mobile-tabs-nav {
    display: none !important;
  }

  /* Uncollapsed Base Styles (No !important so collapsed classes override) */
  .panel-left {
    flex: 0 0 50%;
    width: 50%;
    display: flex;
    flex-direction: column;
    min-width: 400px;
    max-width: calc(100% - 80px);
    overflow: hidden;
    position: relative;
    border-right: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    background: var(--bg, #060913);
    transition: flex-basis 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease;
  }

  .panel-right {
    flex: 1 1 50%;
    width: 50%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 320px;
    position: relative;
    background: var(--bg, #060913);
    transition: flex-basis 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease;
  }

  .divider {
    display: flex !important;
    width: 8px !important;
    flex: 0 0 8px !important;
    cursor: col-resize !important;
    background: var(--surface, #0f131c) !important;
    border-left: 1px solid var(--border, rgba(255, 255, 255, 0.08)) !important;
    border-right: 1px solid var(--border, rgba(255, 255, 255, 0.08)) !important;
    position: relative !important;
    z-index: 30 !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    transition: background 0.2s ease !important;
  }

  .divider:hover {
    background: var(--excel-brand-green, #107C41) !important;
  }

  /* COLLAPSED STATES: Specificity immunity with ID and Class */
  #panelLeft.collapsed,
  .panel-left.collapsed {
    flex: 0 0 0px !important;
    flex-basis: 0% !important;
    min-width: 0 !important;
    width: 0 !important;
    max-width: 0 !important;
    border-right: none !important;
    display: none !important;
    overflow: hidden !important;
  }

  #panelRight.collapsed,
  .panel-right.collapsed {
    flex: 0 0 0px !important;
    flex-basis: 0% !important;
    min-width: 0 !important;
    width: 0 !important;
    max-width: 0 !important;
    border-left: none !important;
    display: none !important;
    overflow: hidden !important;
  }

  /* EXPAND REMAINING PANEL TO FULL WIDTH (100% - 8px for divider) */
  .workspace.right-collapsed #panelLeft,
  .workspace.right-collapsed .panel-left,
  .workspace:has(#panelRight.collapsed) #panelLeft,
  .workspace:has(.panel-right.collapsed) #panelLeft,
  .workspace:has(#panelRight.collapsed) .panel-left,
  .workspace:has(.panel-right.collapsed) .panel-left {
    flex: 1 1 calc(100% - 8px) !important;
    flex-basis: calc(100% - 8px) !important;
    width: calc(100% - 8px) !important;
    max-width: calc(100% - 8px) !important;
    display: flex !important;
    overflow: hidden !important;
  }

  .workspace.left-collapsed #panelRight,
  .workspace.left-collapsed .panel-right,
  .workspace:has(#panelLeft.collapsed) #panelRight,
  .workspace:has(.panel-left.collapsed) #panelRight,
  .workspace:has(#panelLeft.collapsed) .panel-right,
  .workspace:has(.panel-left.collapsed) .panel-right {
    flex: 1 1 calc(100% - 8px) !important;
    flex-basis: calc(100% - 8px) !important;
    width: calc(100% - 8px) !important;
    max-width: calc(100% - 8px) !important;
    display: flex !important;
  }
}

/* ═════════════════════════════════════════════════════════════════
   MOBILE VIEWPORT PARITY (<= 900px)
   ═════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Day Dropdown Modal & Mobile Stacking */
  .header:not(.is-collapsed),
  .app-header:not(.is-collapsed),
  header:not(.is-collapsed) {
    overflow: visible !important;
  }

  .header-center {
    overflow: visible !important;
  }

  .day-navigation {
    overflow: visible !important;
    position: relative !important;
  }

  .day-picker-pill {
    position: relative !important;
  }

  .day-picker-pill.open {
    z-index: 100000 !important;
  }

  .day-picker-pill .custom-select-options {
    position: fixed !important;
    top: 74px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(100vw - 20px) !important;
    max-height: 65vh !important;
    z-index: 999999 !important;
    border-radius: 14px !important;
    background: rgba(10, 15, 29, 0.98) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(16, 124, 65, 0.3) !important;
    padding: 8px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  /* Mobile Tabs Navigation Bar */
  .mobile-tabs-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 12px !important;
    background: #0f131c !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 5000 !important;
  }

  .mobile-tabs-group {
    display: inline-flex !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 9999px !important;
    padding: 2px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  .mobile-tab-btn {
    height: 28px !important;
    padding: 0 12px !important;
    border-radius: 9999px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
  }

  .mobile-tab-btn.active {
    background: #107C41 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(16, 124, 65, 0.4) !important;
  }

  .mobile-hdr-toggle-btn {
    height: 28px !important;
    padding: 0 10px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 9999px !important;
    color: #cbd5e1 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    user-select: none !important;
  }

  .mobile-hdr-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
  }

  .mobile-hdr-toggle-btn.is-collapsed {
    background: rgba(16, 124, 65, 0.2) !important;
    border-color: #107C41 !important;
    color: #34d399 !important;
  }

  .mobile-hdr-toggle-btn .hdr-toggle-icon {
    display: inline-flex !important;
    transition: transform 0.25s ease !important;
  }

  /* Question Bar Mobile Layout */
  .editor-toolbar {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    padding: 6px 10px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .question-bar {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 10px 14px !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    height: auto !important;
    min-height: fit-content !important;
    overflow: visible !important;
  }

  .question-bar .q-marker {
    width: 4px !important;
    min-width: 4px !important;
    border-radius: 2px !important;
    flex-shrink: 0 !important;
    align-self: stretch !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .question-prompt {
    font-size: 13px !important;
    line-height: 1.55 !important;
    width: auto !important;
    flex: 1 1 auto !important;
    margin-right: 0 !important;
    text-align: left !important;
    word-break: break-word !important;
  }

  /* Mobile Workspace Layout */
  .workspace,
  #workspaceContainer {
    flex-direction: column !important;
    height: auto !important;
    min-height: calc(100vh - 50px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .divider {
    display: none !important;
  }

  /* Show Practice Tab */
  .workspace.mobile-show-practice #panelLeft {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    flex: 1 1 auto !important;
    height: auto !important;
    overflow-y: visible !important;
    border-right: none !important;
  }

  .workspace.mobile-show-practice #panelRight {
    display: none !important;
  }

  /* Show Theory Tab */
  .workspace.mobile-show-theory #panelLeft {
    display: none !important;
  }

  .workspace.mobile-show-theory #panelRight {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    flex: 1 1 auto !important;
    height: auto !important;
    overflow-y: auto !important;
  }

  /* Mobile Workbench & Grid */
  .excel-workbench-container {
    overflow: visible !important;
    height: auto !important;
    flex: none !important;
  }

  .excel-ribbon-tab-bar,
  .excel-ribbon-toolbar {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
  }

  .excel-grid-viewport {
    height: clamp(160px, 32vh, 320px) !important;
    max-height: 40vh !important;
    flex: none !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
    transition: height 0.2s ease;
  }

  body.mobile-keyboard-open .excel-grid-viewport,
  body.is-cell-editing .excel-grid-viewport {
    height: 150px !important;
    max-height: 25vh !important;
  }

  /* Sheet Tabs: Sticky & 100% visible on mobile, pinned above virtual keyboard */
  .excel-bottom-bar,
  #excelSheetTabs {
    display: flex !important;
    position: sticky !important;
    bottom: var(--kb-offset, 0px) !important;
    z-index: 100 !important;
    height: 38px !important;
    background: var(--excel-ribbon-bg, #1e2330) !important;
    border-top: 1px solid var(--excel-ribbon-border, #2e364a) !important;
    border-bottom: 1px solid var(--excel-ribbon-border, #2e364a) !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.4) !important;
    transition: bottom 0.15s ease-out;
  }

  .excel-status-bar {
    display: flex !important;
    height: 24px !important;
  }

  /* Result / Output Panel: 100% visible & scrollable on mobile */
  .output-section,
  #mainOutput {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 90px !important;
    max-height: 280px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-top: 8px !important;
    margin-bottom: calc(var(--kb-offset, 0px) + 80px) !important;
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.12)) !important;
    background: var(--terminal-bg, #04060b) !important;
    transition: margin-bottom 0.15s ease-out;
  }
}


/* Stacking Context Immunity: Ensure Header and Custom Dropdowns are always above editor toolbar and action buttons */
header.header,
.header {
  position: relative !important;
  z-index: 50000 !important;
}

.day-navigation {
  position: relative !important;
  z-index: 50001 !important;
}

.day-picker-pill {
  position: relative !important;
  z-index: 50002 !important;
}

.day-picker-pill .custom-select-options {
  z-index: 100000 !important;
}

.editor-toolbar {
  position: relative !important;
  z-index: 20 !important;
}

/* ==========================================================================
   FORMULA EXECUTION & TEST RESULTS - MODERN UI/UX REDESIGN
   Strict Zero-XP Marks Architecture + Sleek Card Design
   ========================================================================== */

#mainOutput.output-section {
  padding: 12px 16px 16px 16px !important;
  background: rgba(15, 23, 42, 0.5) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

[data-theme="light"] #mainOutput.output-section {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
}

#mainOutput .output-label {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: #94a3b8 !important;
  margin-bottom: 10px !important;
}

[data-theme="light"] #mainOutput .output-label {
  color: #64748b !important;
}

#mainOutput .output-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #107C41;
  box-shadow: 0 0 8px rgba(16, 124, 65, 0.6);
}

.result-prompt-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.5;
}

[data-theme="light"] .result-prompt-card {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.result-card {
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
  animation: resultSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes resultSlideIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-card--success {
  background: linear-gradient(135deg, rgba(16, 124, 65, 0.14), rgba(16, 185, 129, 0.04));
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.08);
}

[data-theme="light"] .result-card--success {
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border: 1px solid #a7f3d0;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
}

.result-card--error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(220, 38, 38, 0.04));
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.08);
}

[data-theme="light"] .result-card--error {
  background: linear-gradient(135deg, #fef2f2, #fff1f2);
  border: 1px solid #fecaca;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.06);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-icon-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.result-icon-circle--success {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.result-icon-circle--error {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.result-title {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.result-card--success .result-title {
  color: #34d399;
}
[data-theme="light"] .result-card--success .result-title {
  color: #047857;
}

.result-card--error .result-title {
  color: #f87171;
}
[data-theme="light"] .result-card--error .result-title {
  color: #b91c1c;
}

.result-score-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

[data-theme="light"] .result-score-badge {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #065f46;
}

.result-error-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

[data-theme="light"] .result-error-pill {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.result-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

[data-theme="light"] .result-body {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.result-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
}

.result-field-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

[data-theme="light"] .result-field-label {
  color: #64748b;
}

.result-field-code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.76rem;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #38bdf8;
  font-weight: 600;
}

[data-theme="light"] .result-field-code {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0284c7;
}

.result-field-value {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-weight: 700;
}

[data-theme="light"] .result-field-value {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.result-message {
  font-size: 0.8rem;
  color: #fca5a5;
  line-height: 1.5;
}

[data-theme="light"] .result-message {
  color: #b91c1c;
}


/* ==========================================================================
   WORLD-CLASS 10/10 HEADER & NAVIGATION DESIGN SYSTEM
   Linear & Apple Human Interface Standard - Parity across all 60 pages
   ========================================================================== */

/* ── 1. Desktop & Global Header Architecture ───────────────────────────── */
.header {
  height: 50px !important;
  min-height: 50px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 16px !important;
  background: rgba(10, 15, 29, 0.88) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
  position: relative !important;
  z-index: 50000 !important;
  box-sizing: border-box !important;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
}

[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

/* ── 2. Header Left Suite: Back, Profile, Graded Stats ──────────────────── */
.header-left {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

.header-left .back-to-home-btn {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #94a3b8 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

.header-left .back-to-home-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
  transform: translateY(-1px) !important;
}

[data-theme="light"] .header-left .back-to-home-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

[data-theme="light"] .header-left .back-to-home-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.header-left .user-profile {
  position: relative !important;
  width: 30px !important;
  height: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.header-left .user-profile .avatar-img {
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
}

[data-theme="light"] .header-left .user-profile .avatar-img {
  border-color: #cbd5e1 !important;
  background-color: #f1f5f9 !important;
}

.header-left .user-profile .active-dot {
  position: absolute !important;
  bottom: 0 !important;
  right: 0 !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: #10b981 !important;
  border: 1.5px solid #0a0f1d !important;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6) !important;
}

[data-theme="light"] .header-left .user-profile .active-dot {
  border-color: #ffffff !important;
}

/* Graded Stats Badges (Zero Light Mode Contrast Collision) */
.stats-card {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  height: 28px !important;
  box-shadow: none !important;
  flex-shrink: 0 !important;
}

.stats-row {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.stats-item {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  gap: 0 !important;
  height: 26px !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.15)) !important;
}

.stats-label {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 7px !important;
  font-size: 8.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  line-height: 1 !important;
  margin: 0 !important;
  border-radius: 6px 0 0 6px !important;
  background: #1e293b !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-right: none !important;
  color: #94a3b8 !important;
}

[data-theme="light"] .stats-label {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  border-right: none !important;
  color: #475569 !important;
}

.stats-value--fraction {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 7px !important;
  gap: 1px !important;
  line-height: 1 !important;
  border-radius: 0 6px 6px 0 !important;
  font-family: var(--font-mono, monospace) !important;
}

/* Solved fraction color */
.stats-item:first-child .stats-value--fraction {
  background: rgba(14, 165, 233, 0.15) !important;
  border: 1px solid rgba(14, 165, 233, 0.3) !important;
  border-left: none !important;
}

.stats-item:first-child .stats-value--fraction .stats-num {
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #38bdf8 !important;
}

.stats-item:first-child .stats-value--fraction .stats-den {
  font-size: 9px !important;
  font-weight: 600 !important;
  color: #94a3b8 !important;
}

[data-theme="light"] .stats-item:first-child .stats-value--fraction {
  background: #e0f2fe !important;
  border: 1px solid #bae6fd !important;
  border-left: none !important;
}

[data-theme="light"] .stats-item:first-child .stats-value--fraction .stats-num {
  color: #0284c7 !important;
}

[data-theme="light"] .stats-item:first-child .stats-value--fraction .stats-den {
  color: #64748b !important;
}

/* Marks fraction color */
.stats-item:last-child .stats-value--fraction,
.stats-item:nth-child(3) .stats-value--fraction {
  background: rgba(168, 85, 247, 0.15) !important;
  border: 1px solid rgba(168, 85, 247, 0.3) !important;
  border-left: none !important;
}

.stats-item:last-child .stats-value--fraction .stats-num,
.stats-item:nth-child(3) .stats-value--fraction .stats-num {
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #c084fc !important;
}

.stats-item:last-child .stats-value--fraction .stats-den,
.stats-item:nth-child(3) .stats-value--fraction .stats-den {
  font-size: 9px !important;
  font-weight: 600 !important;
  color: #94a3b8 !important;
}

[data-theme="light"] .stats-item:last-child .stats-value--fraction,
[data-theme="light"] .stats-item:nth-child(3) .stats-value--fraction {
  background: #ede9fe !important;
  border: 1px solid #ddd6fe !important;
  border-left: none !important;
}

[data-theme="light"] .stats-item:last-child .stats-value--fraction .stats-num,
[data-theme="light"] .stats-item:nth-child(3) .stats-value--fraction .stats-num {
  color: #7c3aed !important;
}

[data-theme="light"] .stats-item:last-child .stats-value--fraction .stats-den,
[data-theme="light"] .stats-item:nth-child(3) .stats-value--fraction .stats-den {
  color: #64748b !important;
}

.stats-divider {
  display: none !important;
}

.stats-progress-bar {
  display: none !important;
}

/* ── 3. Header Center: Unified Day Stepper Capsule & Topic Breadcrumb ──── */
.header-center {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
}

.day-navigation {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0 !important;
  overflow: visible !important;
  position: relative !important;
}

/* Fused Stepper Arrow: Prev */
.day-nav-arrow-btn--prev {
  order: 1 !important;
  height: 32px !important;
  width: 28px !important;
  min-width: 28px !important;
  border-radius: 8px 0 0 8px !important;
  border-right: none !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #94a3b8 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  margin: 0 !important;
}

/* Fused Stepper Day Selector Pill */
.day-picker-pill:not(.topic-picker-pill) {
  order: 2 !important;
  height: 32px !important;
  border-radius: 0 !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  padding: 0 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  margin: 0 !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  color: #f1f5f9 !important;
}

/* Fused Stepper Arrow: Next */
.day-nav-arrow-btn--next {
  order: 3 !important;
  height: 32px !important;
  width: 28px !important;
  min-width: 28px !important;
  border-radius: 0 8px 8px 0 !important;
  border-left: none !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #94a3b8 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  margin: 0 8px 0 0 !important; /* Space between stepper capsule and topic breadcrumb */
}

/* Stepper Hover States (Dark Mode Default) */
.day-nav-arrow-btn--prev:hover,
.day-nav-arrow-btn--next:hover,
.day-picker-pill:not(.topic-picker-pill):hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

/* Light Mode Overrides for Stepper */
[data-theme="light"] .day-nav-arrow-btn--prev {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-right: none !important;
  color: #475569 !important;
}

[data-theme="light"] .day-picker-pill:not(.topic-picker-pill) {
  background: #ffffff !important;
  border-top: 1px solid #cbd5e1 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  border-left: 1px solid #e2e8f0 !important;
  border-right: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] .day-nav-arrow-btn--next {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-left: none !important;
  color: #475569 !important;
}

[data-theme="light"] .day-nav-arrow-btn--prev:hover,
[data-theme="light"] .day-nav-arrow-btn--next:hover,
[data-theme="light"] .day-picker-pill:not(.topic-picker-pill):hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

/* Topic Breadcrumb Pill */
.day-picker-pill.topic-picker-pill {
  order: 4 !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 0 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  max-width: 380px !important;
  overflow: hidden !important;
  margin: 0 !important;
}

[data-theme="light"] .day-picker-pill.topic-picker-pill {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
}

.topic-picker-pill .trigger-title {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #e2e8f0 !important;
}

[data-theme="light"] .topic-picker-pill .trigger-title {
  color: #0f172a !important;
}

.topic-duration-badge {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  border-radius: 4px !important;
  padding: 1px 6px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  font-family: var(--font-mono, monospace) !important;
  flex-shrink: 0 !important;
}

[data-theme="light"] .topic-duration-badge {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border: 1px solid #bae6fd !important;
}

/* ── 4. Header Right Suite: Actions & Achievement ──────────────────────── */
.header-right {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  height: 28px !important;
  width: 50px !important;
  padding: 0 !important;
  border-radius: 9999px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  display: inline-flex !important;
  align-items: center !important;
  position: relative !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

[data-theme="light"] .theme-toggle-btn {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

.theme-switch-thumb {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  position: absolute !important;
  top: 2px !important;
  left: 2px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

[data-theme="light"] .theme-switch-thumb {
  transform: translateX(22px) !important;
}

/* Take Test CTA Button */
.hdr-btn--test {
  height: 32px !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  cursor: pointer !important;
  text-decoration: none !important;
}

.hdr-btn--test:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.hdr-btn--test:active {
  transform: translateY(0) scale(0.98) !important;
}

/* Score Card Button */
.hdr-btn--score {
  height: 32px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.18s ease !important;
  cursor: pointer !important;
  text-decoration: none !important;
}

[data-theme="light"] .hdr-btn--score {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

.hdr-btn--score:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

[data-theme="light"] .hdr-btn--score:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Header Trophy Overall Score */
.header-overall-score {
  height: 32px !important;
  padding: 0 10px !important;
  border-radius: 9999px !important;
  background: rgba(245, 158, 11, 0.1) !important;
  border: 1px solid rgba(245, 158, 11, 0.28) !important;
  color: #fbbf24 !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
}

[data-theme="light"] .header-overall-score {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #b45309 !important;
}

/* ── 5. Responsive Mobile Suite (≤ 768px) ────────────────────────────────── */
@media (max-width: 768px) {
  .header {
    display: grid !important;
    grid-template-areas: 
      "left right"
      "center center" !important;
    grid-template-columns: 1fr auto !important;
    gap: 6px 8px !important;
    padding: 6px 10px !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  [data-theme="light"] .header {
    border-bottom: 1px solid #e2e8f0 !important;
  }

  /* Row 1 Left: Home, Avatar, Compact Solved Badge */
  .header-left {
    grid-area: left !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  .header-left .back-to-home-btn {
    width: 26px !important;
    height: 26px !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
  }
  .header-left .back-to-home-btn svg {
    width: 14px !important;
    height: 14px !important;
  }
  .header-left .user-profile {
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
  }
  .header-left .user-profile .avatar-img {
    width: 24px !important;
    height: 24px !important;
  }
  .header-left .user-profile .active-dot {
    width: 6px !important;
    height: 6px !important;
  }

  .stats-card {
    height: 24px !important;
    padding: 0 !important;
    gap: 0 !important;
    flex-shrink: 0 !important;
  }
  .stats-row {
    gap: 4px !important;
  }
  .stats-item {
    height: 22px !important;
  }
  .stats-label {
    padding: 0 5px !important;
    font-size: 7.5px !important;
  }
  .stats-value--fraction {
    padding: 0 5px !important;
  }
  .stats-num {
    font-size: 9.5px !important;
  }
  .stats-den {
    font-size: 8px !important;
  }

  /* Row 1 Right: Theme Toggle, Take Test, Score Card */
  .header-right {
    grid-area: right !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 5px !important;
    flex-shrink: 0 !important;
  }
  .theme-toggle-btn {
    width: 36px !important;
    height: 22px !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
  }
  .theme-switch-thumb {
    width: 16px !important;
    height: 16px !important;
    top: 2px !important;
    left: 2px !important;
  }
  [data-theme="light"] .theme-switch-thumb {
    transform: translateX(14px) !important;
  }

  .hdr-btn--test {
    height: 24px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
  }
  .hdr-btn--score {
    height: 24px !important;
    padding: 0 7px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
  }
  .hdr-btn--score svg {
    width: 11px !important;
    height: 11px !important;
    margin-right: 2px !important;
  }
  .header-overall-score {
    display: none !important;
  }

  /* Row 2: Unified Day Capsule (< | Day XX | >) + Fluid Topic Breadcrumb */
  .header-center {
    grid-area: center !important;
    width: 100% !important;
    display: flex !important;
    overflow: visible !important;
  }
  .day-navigation {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    overflow: visible !important;
  }

  .day-nav-arrow-btn--prev {
    height: 28px !important;
    width: 24px !important;
    min-width: 24px !important;
    border-radius: 6px 0 0 6px !important;
    margin: 0 !important;
  }
  .day-picker-pill:not(.topic-picker-pill) {
    height: 28px !important;
    padding: 0 6px !important;
    font-size: 11px !important;
    margin: 0 !important;
  }
  .day-picker-pill:not(.topic-picker-pill) .selected-text svg,
  .day-picker-pill:not(.topic-picker-pill) .track-icon-wrap svg {
    width: 14px !important;
    height: 14px !important;
  }
  .day-nav-arrow-btn--next {
    height: 28px !important;
    width: 24px !important;
    min-width: 24px !important;
    border-radius: 0 6px 6px 0 !important;
    margin: 0 6px 0 0 !important;
  }

  .day-picker-pill.topic-picker-pill {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 28px !important;
    padding: 0 8px !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
  }
  .topic-picker-pill .trigger-title {
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .topic-duration-badge {
    display: none !important;
  }
}

/* Narrow mobile screens (≤ 480px): Hide MARKS fraction so SOLVED fits smoothly */
@media (max-width: 480px) {
  .stats-card .stats-item:last-child,
  .stats-card .stats-item:nth-child(3),
  .stats-card .stats-divider {
    display: none !important;
  }
}
