@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;1,14..32,400&display=swap');

/* ============================================================
   QLCL System — Premium Design System
   ============================================================ */

:root {
  /* ── FTECA Brand Palette ── */
  --primary: #00b96b;
  --primary-hover: #00a05c;
  --primary-light: #edfaf3;
  --primary-glow: rgba(0, 185, 107, 0.20);

  --accent: #f59e0b;
  --accent-light: #fef3c7;

  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;

  /* Difficulty Colors */
  --diff-easy: #10b981;
  --diff-easy-light: #d1fae5;
  --diff-medium: #f59e0b;
  --diff-medium-light: #fef3c7;
  --diff-hard: #ef4444;
  --diff-hard-light: #fee2e2;

  /* Surface Layers — trung tính, không pha xanh */
  --bg-base: #f5f5f5;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  --bg-subtle: #f0f0f0;
  --bg-glass: rgba(255,255,255,0.80);

  /* Typography — xám đen trung tính */
  --text-primary: #111111;
  --text-secondary: #555555;
  --text-muted: #999999;
  --text-on-primary: #ffffff;

  /* Borders — xám nhẹ */
  --border: #e0e0e0;
  --border-focus: var(--primary);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-primary: 0 4px 16px var(--primary-glow);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --max-width: 1200px;
  --header-height: 64px;
}

/* ─── Dark Mode ─── */
[data-theme="dark"] {
  --bg-base: #0a0a0a;
  --bg-card: #111111;
  --bg-card-hover: #1a1a1a;
  --bg-subtle: #161616;
  --bg-glass: rgba(17,17,17,0.88);
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #5a5a5a;
  --border: #242424;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.6);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.75);
  --primary-light: rgba(0, 185, 107, 0.12);
  --success-light: rgba(16,185,129,0.15);
  --danger-light: rgba(239,68,68,0.15);
  --accent-light: rgba(245,158,11,0.15);
  --border-focus: #00b96b;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: linear-gradient(135deg, #008f4f 0%, #00b96b 50%, #00d479 100%);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: var(--shadow-md);
}
.header-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.header-brand-icon {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: #fcd34d;
  backdrop-filter: blur(4px);
}
.header-brand-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.header-brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  font-weight: 400;
}
.header-brand-sub span { color: #fcd34d; font-weight: 700; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.2);
  padding: 4px;
  border-radius: var(--radius-lg);
}
.nav-btn {
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  transition: var(--transition);
  white-space: nowrap;
}
.nav-btn:hover { color: #fff; background: rgba(255,255,255,0.12); }
.nav-btn.active { color: #fff; background: rgba(255,255,255,0.2); box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.nav-btn i { margin-right: 6px; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.header-subject-select {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  max-width: 240px;
  text-overflow: ellipsis;
  outline: none;
  backdrop-filter: blur(4px);
  transition: var(--transition);
}
.header-subject-select:hover, .header-subject-select:focus {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
}
.header-subject-select option {
  background: #1e1b4b;
  color: #fff;
  font-size: 13px;
  padding: 6px;
}

/* ─── Subject Banner Bar ─── */
.subject-banner-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 12px;
}
.subject-banner-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.subject-banner-badge {
  background: linear-gradient(135deg, #00b96b, #00d479);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}
.subject-banner-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.subject-banner-credits {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}
.subject-banner-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}
.block-filter-select {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  outline: none;
  transition: var(--transition);
}
.block-filter-select:hover, .block-filter-select:focus {
  border-color: var(--primary);
}
.btn-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.1);
  transition: var(--transition);
}
.btn-icon:hover { color: #fff; background: rgba(255,255,255,0.2); }

/* Theme switch: must remain visible on the light header as well as dark mode. */
#btn-theme-top {
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}
#btn-theme-top:hover,
#btn-theme-top:focus-visible {
  color: #0f172a;
  background: #e2e8f0;
  border-color: #94a3b8;
  outline: none;
}
[data-theme="dark"] #btn-theme-top {
  color: #f8fafc;
  background: #334155;
  border-color: #475569;
}
[data-theme="dark"] #btn-theme-top:hover,
[data-theme="dark"] #btn-theme-top:focus-visible {
  color: #fff;
  background: #475569;
  border-color: #64748b;
}

/* ─── Main Layout ─── */
.app-main {
  margin-top: var(--header-height);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 24px 20px;
  min-height: calc(100vh - var(--header-height));
}

/* ─── Tab Content ─── */
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeInUp 0.3s ease; }

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

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-sm { padding: 16px; border-radius: var(--radius-lg); }
.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); box-shadow: 0 6px 20px var(--primary-glow); }

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--border); color: var(--text-primary); }

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}
.btn-success:hover:not(:disabled) { background: #059669; }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text-primary); }

.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-full { width: 100%; }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-input, .form-select, .form-textarea {
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

/* File Upload Area */
.file-upload-area { position: relative; overflow: hidden; }
.file-upload-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; }
.file-upload-area:hover .file-upload-content { background: var(--primary-light); border-color: var(--primary); }

.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--accent-light); color: #b45309; }
.badge-easy { background: var(--diff-easy-light); color: var(--diff-easy); }
.badge-medium { background: var(--diff-medium-light); color: #b45309; }
.badge-hard { background: var(--diff-hard-light); color: var(--diff-hard); }

/* ============================================================
   EXAM MODE
   ============================================================ */
.exam-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1024px) {
  .exam-layout { grid-template-columns: 1fr; }
  .exam-sidebar { order: -1; }
}

.question-card { position: relative; overflow: hidden; }
.question-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #00d479);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.question-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ─── Answer Options ─── */
.option-btn {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background: var(--bg-card);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  font-size: 14px;
  color: var(--text-primary);
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 10px;
  line-height: 1.5;
}
.option-btn:hover { border-color: var(--primary); background: var(--primary-light); transform: translateX(2px); }
.option-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-hover);
  font-weight: 500;
}
.option-btn.correct {
  border-color: var(--success);
  background: var(--success-light);
  color: #065f46;
  font-weight: 600;
}
.option-btn.wrong {
  border-color: var(--danger);
  background: var(--danger-light);
  color: #991b1b;
  font-weight: 600;
}
.option-btn.disabled { pointer-events: none; opacity: 0.55; }

.option-label {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  transition: var(--transition);
  color: var(--text-secondary);
}
.option-btn.selected .option-label { background: var(--primary); color: #fff; }
.option-btn.correct .option-label { background: var(--success); color: #fff; }
.option-btn.wrong .option-label { background: var(--danger); color: #fff; }

/* ─── Question Palette ─── */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
}
.palette-btn {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.palette-btn:hover { border-color: var(--primary); color: var(--primary); }
.palette-btn.answered { background: var(--primary); border-color: var(--primary); color: #fff; }
.palette-btn.flagged { background: var(--warning); border-color: var(--warning); color: #fff; }
.palette-btn.current { ring: 2px; outline: 2.5px solid var(--primary); outline-offset: 2px; transform: scale(1.1); z-index: 1; }

/* ─── Timer ─── */
.timer-display {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 22px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: #b45309;
  border: 1.5px solid #fde68a;
  letter-spacing: 0.05em;
  transition: var(--transition);
}
.timer-display.urgent {
  background: var(--danger-light);
  color: var(--danger);
  border-color: #fca5a5;
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* ─── Difficulty Ratio Bar ─── */
.difficulty-bar {
  height: 6px;
  border-radius: var(--radius-full);
  display: flex;
  overflow: hidden;
  gap: 2px;
}
.diff-bar-easy { background: var(--diff-easy); transition: width 0.4s ease; }
.diff-bar-medium { background: var(--diff-medium); transition: width 0.4s ease; }
.diff-bar-hard { background: var(--diff-hard); transition: width 0.4s ease; }

/* ============================================================
   RESULT SCREEN
   ============================================================ */
.result-score-ring {
  width: 120px; height: 120px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
  background: conic-gradient(var(--primary) var(--score-pct, 0%), var(--bg-subtle) 0%);
}
.result-score-inner {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.stat-card {
  padding: 16px;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  text-align: center;
  border: 1px solid var(--border);
}
.stat-value { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* ============================================================
   SOURCE & GENERATOR
   ============================================================ */
.source-card {
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}
.source-card:hover { border-color: var(--primary); background: var(--primary-light); }

.generation-progress {
  padding: 20px;
  background: var(--primary-light);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-lg);
}
.progress-bar-wrap {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 12px 0;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #00d479);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  position: relative;
}
.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 60px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  from { transform: translateX(-40px); }
  to { transform: translateX(40px); }
}

/* ─── Source list ─── */
.source-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.source-item:hover { border-color: var(--primary); }

/* ============================================================
   QUESTION BANK
   ============================================================ */
.bank-question-card {
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}
.bank-question-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }

.bank-question-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.bank-answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.bank-answer-item {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
}
.bank-answer-item.correct {
  background: var(--success-light);
  border-color: #a7f3d0;
  color: #065f46;
  font-weight: 600;
}
.bank-explanation {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  border-left: 3px solid var(--primary);
}

/* ─── Search ─── */
.search-wrap {
  position: relative;
}
.search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}
.search-input {
  padding-left: 36px;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.toast.removing { animation: slideOutRight 0.25s ease forwards; }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--primary); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-icon { font-size: 18px; flex-shrink: 0; }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: var(--transition);
}
.modal-overlay.open .modal-box { transform: scale(1) translateY(0); }

/* ─── REVIEW & EDIT AI QUESTIONS MODAL ─── */
.review-modal-box {
  max-width: 960px !important;
  width: 96% !important;
  max-height: 92vh !important;
  display: flex;
  flex-direction: column;
  padding: 20px 24px !important;
  border: 1px solid var(--border);
}
.review-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.review-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  margin: 12px 0 10px;
}
.review-modal-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.review-q-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: var(--transition);
  position: relative;
}
.review-q-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.review-q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.review-option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}
@media (max-width: 640px) {
  .review-option-grid { grid-template-columns: 1fr; }
}
.review-option-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.review-option-item.correct {
  border-color: var(--success);
  background: var(--success-light);
}
.review-option-item input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
}
.review-modal-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}
.review-save-config-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}
@media (max-width: 768px) {
  .review-save-config-grid { grid-template-columns: 1fr; }
}
.save-config-card {
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.config-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.custom-subject-box {
  background: var(--bg-card);
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.privacy-option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.privacy-option-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.privacy-option-label.active {
  border-color: var(--primary);
  background: var(--primary-light);
}
.privacy-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}
.privacy-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   SETTINGS PANEL
   ============================================================ */
.settings-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 340px;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  padding: 24px;
  transform: translateX(100%);
  transition: var(--transition-slow);
  overflow-y: auto;
  border-left: 1px solid var(--border);
}
.settings-panel.open { transform: translateX(0); }
.settings-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 299;
  opacity: 0; visibility: hidden; transition: var(--transition);
}
.settings-overlay.open { opacity: 1; visibility: visible; }

/* ============================================================
   STATS & CHARTS
   ============================================================ */
.chapter-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chapter-bar-row {}
.chapter-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}
.chapter-bar-track {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.chapter-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   EXAM START SCREEN
   ============================================================ */
.exam-start-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}
@media (max-width: 640px) {
  .exam-start-grid { grid-template-columns: 1fr 1fr; }
}
.exam-info-tile {
  padding: 14px;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.exam-info-tile label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.exam-info-tile select, .exam-info-tile span {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
}

/* ─── Practice count buttons ─── */
.count-btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.count-btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--bg-subtle);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}
.count-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.count-btn.selected { border-color: var(--primary); background: var(--primary); color: #fff; }

/* ─── Grid utilities ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}

/* ─── Misc ─── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.w-full { width: 100%; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-6 > * + * { margin-top: 24px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 15px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 30px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-primary-color { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: #b45309; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .app-main { padding: 16px 12px; }
  .header-nav { display: none; }
  .card { padding: 16px; }
  .question-text { font-size: 14px; }
  .timer-display { font-size: 18px; }
}
@media (max-width: 480px) {
  .exam-start-grid { grid-template-columns: 1fr; }
  .header-brand-sub { display: none; }
}

/* ─── Loading Spinner ─── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.empty-state-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── Highlight in search ─── */
.highlight {
  background: var(--accent-light);
  color: #92400e;
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
}

/* ─── Chapter color indicator ─── */
.ch-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ch-1 { background: #00b96b; }
.ch-2 { background: #00d479; }
.ch-3 { background: #06b6d4; }
.ch-4 { background: #10b981; }
.ch-5 { background: #f59e0b; }

/* ???????????????????????????????????????????????????????????
   CERA AI CHATBOT STYLES
   ??????????????????????????????????????????????????????????? */

/* Floating Action Button */
.cera-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00b96b, #00d479);
  color: white;
  border: none;
  cursor: grab;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0,185,107,0.4);
  z-index: 9999;
  transition: box-shadow 0.2s;
  animation: cera-fab-bounce 3s ease-in-out infinite;
  user-select: none;
  touch-action: none;
}
.cera-fab:hover {
  box-shadow: 0 12px 40px rgba(0,185,107,0.55);
}
.cera-fab.is-open {
  background: linear-gradient(135deg, #ef4444, #f97316);
  animation: none;
}
.cera-fab[data-dragged="true"] {
  animation: none;
}
@keyframes cera-fab-bounce {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.cera-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* Chat Panel */
.cera-panel {
  position: fixed;
  bottom: 104px;
  right: 28px;
  width: 380px;
  max-height: 600px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.22);
  z-index: 9998;
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34,1.56,0.64,1),
              width 0.3s ease, height 0.3s ease, max-height 0.3s ease;
  user-select: none;
  touch-action: none;
}
.cera-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
/* Chế độ Phóng Toàn Màn Hình (Full Screen) & Tăng kích thước 1.5 lần */
.cera-panel.expanded {
  top: 16px !important;
  left: 16px !important;
  right: 16px !important;
  bottom: 16px !important;
  width: calc(100vw - 32px) !important;
  height: calc(100vh - 32px) !important;
  max-height: none !important;
  border-radius: 24px;
  box-shadow: 0 32px 100px rgba(0,0,0,0.4);
  z-index: 10000;
}

/* Scale up 1.5x các đối tượng bên trong khi phóng to */
.cera-panel.expanded .cera-header {
  padding: 16px 20px;
}
.cera-panel.expanded .cera-avatar {
  width: 52px;
  height: 52px;
  font-size: 24px;
}
.cera-panel.expanded .cera-name {
  font-size: 20px;
}
.cera-panel.expanded .cera-status {
  font-size: 13.5px;
}
.cera-panel.expanded .cera-header-btn {
  width: 42px;
  height: 42px;
  font-size: 18px;
}

.cera-panel.expanded .cera-messages {
  max-height: none !important;
  flex: 1;
  padding: 24px 20px;
  gap: 20px;
}
.cera-panel.expanded .cera-msg-avatar {
  width: 42px;
  height: 42px;
  font-size: 18px;
}
.cera-panel.expanded .cera-msg-bubble {
  font-size: 18px;
  line-height: 1.55;
  padding: 14px 20px;
  border-radius: 20px 20px 20px 6px;
}
.cera-panel.expanded .cera-msg-user .cera-msg-bubble {
  border-radius: 20px 20px 6px 20px;
}
.cera-panel.expanded .cera-msg-bubble p {
  margin-bottom: 8px;
}

.cera-panel.expanded .cera-input-wrap {
  padding: 16px 20px 20px;
  gap: 12px;
}
.cera-panel.expanded .cera-img-btn,
.cera-panel.expanded .cera-send-btn {
  width: 52px;
  height: 52px;
  font-size: 22px;
  border-radius: 16px;
}
.cera-panel.expanded .cera-input {
  font-size: 18px;
  padding: 13px 18px;
  border-radius: 16px;
  min-height: 52px;
}

@media (max-width: 480px) {
  .cera-panel { width: calc(100vw - 24px); right: 12px; bottom: 90px; }
  .cera-panel.expanded {
    top: 8px !important;
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    width: calc(100vw - 16px) !important;
    height: calc(100vh - 16px) !important;
    border-radius: 16px;
  }
  .cera-panel.expanded .cera-msg-bubble {
    font-size: 15px;
    padding: 12px 14px;
  }
  .cera-panel.expanded .cera-input {
    font-size: 15px;
  }
  .cera-fab { bottom: 16px; right: 16px; }
}

/* Header */
.cera-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(135deg, #008f4f, #00b96b);
  color: white;
  border-radius: 20px 20px 0 0;
  flex-shrink: 0;
  gap: 8px;
  position: relative;
}
.cera-header-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.cera-header-actions { display: flex; gap: 6px; flex-shrink: 0; position: relative; }
.cera-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.cera-name { font-size: 15px; font-weight: 700; letter-spacing: 0.3px; white-space: nowrap; }
.cera-status { font-size: 11px; opacity: 0.85; display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.cera-dot {
  width: 6px;
  height: 6px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}
.cera-dot.thinking { background: #fbbf24; }
@keyframes pulse-dot {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.cera-header-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255,255,255,0.18);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cera-header-btn:hover { background: rgba(255,255,255,0.32); }

/* ─── CERA 3-Gạch Menu Dropdown ─── */
.cera-menu-dropdown-wrap {
  position: relative;
}
.cera-menu-dropdown {
  position: absolute;
  top: 36px;
  right: 0;
  width: 210px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 10px;
  z-index: 10000;
  display: none;
  flex-direction: column;
  gap: 8px;
  animation: cera-dropdown-in 0.15s ease;
}
@keyframes cera-dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.cera-menu-dropdown.show {
  display: flex;
}
.cera-menu-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cera-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}
.cera-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}
.cera-menu-item:hover {
  background: var(--bg-subtle);
}
.cera-menu-item.danger {
  color: var(--danger);
}
.cera-menu-item.danger:hover {
  background: var(--danger-light);
}
.cera-menu-item i {
  font-size: 13px;
  width: 16px;
  text-align: center;
}

/* Messages area */
.cera-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
  min-height: 200px;
  max-height: 360px;
  background: var(--bg-card);
}
.cera-messages::-webkit-scrollbar { width: 4px; }
.cera-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.cera-msg { display: flex; gap: 8px; align-items: flex-start; animation: cera-msg-in 0.3s ease; }
@keyframes cera-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.cera-msg-user { flex-direction: row-reverse; }
.cera-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #008f4f, #00b96b);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
}
.cera-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.cera-msg-user .cera-msg-avatar {
  background: linear-gradient(135deg, #10b981, #06b6d4);
}
.cera-msg-bubble {
  max-width: 85%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 16px 16px 16px 4px;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-primary);
  word-break: break-word;
}
.cera-msg-user .cera-msg-bubble {
  background: linear-gradient(135deg, #008f4f, #00b96b);
  color: white;
  border-radius: 16px 16px 4px 16px;
  border: none;
}
.cera-msg-bubble p { margin: 0 0 6px 0; line-height: 1.45; }
.cera-msg-bubble p:last-child { margin-bottom: 0; }
.cera-msg-bubble ul { padding-left: 18px; margin: 4px 0 6px 0; }
.cera-msg-bubble li { margin-bottom: 3px; }
.cera-msg-bubble strong { font-weight: 700; }

/* Typing indicator */
.cera-typing .cera-msg-bubble {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 10px 16px;
}
.cera-typing-dots { display: flex; gap: 4px; align-items: center; height: 16px; }
.cera-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00b96b;
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.cera-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.cera-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
  0%,60%,100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Context bar */
.cera-context {
  margin: 0 12px 4px;
  padding: 6px 10px;
  background: rgba(0,185,107,0.08);
  border: 1px solid rgba(0,185,107,0.2);
  border-radius: 8px;
  font-size: 11.5px;
  color: #00965a;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Input area */
.cera-input-wrap {
  padding: 10px 12px 14px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-card);
}
.cera-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  background: var(--bg-subtle);
  color: var(--text-primary);
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  min-height: 38px;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.5;
}
.cera-input:focus { border-color: #00b96b; }
.cera-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #008f4f, #00b96b);
  color: white;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.15s;
}
.cera-send-btn:hover { opacity: 0.88; transform: scale(1.06); }
.cera-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Footer note */
.cera-footer-note {
  padding: 4px 14px 10px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
}

/* ─── CERA Model Select Dropdown ─── */
.cera-model-select {
  width: 100%;
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.cera-model-select:focus { border-color: var(--primary); }
.cera-model-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ─── CERA Image Upload & Preview ─── */
.cera-img-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  color: var(--primary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.cera-img-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: scale(1.05);
}

.cera-image-preview-container {
  position: relative;
  margin: 0 12px 6px;
  padding: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cera-image-preview {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.cera-image-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: white;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   OPENROUTER-STYLE LAYOUT SHELL (SIDEBAR + TOP HEADER)
   ============================================================ */

:root {
  --sidebar-width: 240px;
  --top-header-height: 56px;
  --sidebar-bg: #ffffff;
}

[data-theme="dark"] {
  --sidebar-bg: #0f1117;
}

.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--bg-base);
}

/* ─── 1. LEFT SIDEBAR ─── */
.app-sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  z-index: 120;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 2px 4px 6px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.brand-logo-full {
  height: 51px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  background: transparent;
  border: none;
  box-shadow: none;
  transition: transform 0.2s ease;
}

.brand-logo-full:hover {
  transform: scale(1.02);
}

.sidebar-close-btn {
  display: none;
  position: absolute;
  right: 4px; top: 8px;
  color: var(--text-muted);
  font-size: 16px;
  padding: 4px;
}

.sidebar-workspace {
  margin: 8px 0 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-workspace:hover {
  border-color: var(--border-focus);
}

.workspace-info {
  display: flex;
  flex-direction: column;
}

.workspace-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.workspace-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Sidebar Nav Links */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-nav-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  width: 100%;
  text-align: left;
}

.sidebar-nav-item i {
  font-size: 15px;
  width: 20px;
  text-align: center;
  color: var(--text-muted);
  transition: var(--transition);
}

.sidebar-nav-item:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.sidebar-nav-item:hover i {
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background: rgba(0, 220, 130, 0.12);
  color: #00dc82;
  font-weight: 600;
}

.sidebar-nav-item.active i {
  color: #00dc82;
}

[data-theme="light"] .sidebar-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

[data-theme="light"] .sidebar-nav-item.active i {
  color: var(--primary);
}

.sidebar-divider {
  padding: 12px 8px 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--danger);
  border-radius: 50%;
  margin-left: auto;
}

.badge-pro {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
}

.badge-soon {
  font-size: 9px;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 4px;
  white-space: nowrap;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 110;
  backdrop-filter: blur(2px);
}

/* ─── 2. MAIN CONTENT WRAPPER ─── */
.app-main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* ─── 3. TOP HEADER BAR ─── */
.top-header {
  height: var(--top-header-height);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  max-width: 600px;
}

.menu-toggle-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 16px;
}

/* Live Subject Search Bar */
.search-bar-container {
  position: relative;
  width: 100%;
}

.search-bar-container .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.subject-search-input {
  width: 100%;
  height: 38px;
  padding: 0 44px 0 36px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--text-primary);
  transition: var(--transition);
}

.subject-search-input:focus {
  outline: none;
  border-color: #00dc82;
  box-shadow: 0 0 0 3px rgba(0, 220, 130, 0.15);
  background: var(--bg-card);
}

.search-shortcut {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

/* Live Search Dropdown Popover */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  max-height: 420px;
  display: flex;
  flex-direction: column;
}

.search-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.search-count-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 10px;
}

.search-results-list {
  overflow-y: auto;
  padding: 6px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.search-result-item:hover {
  background: var(--bg-subtle);
}

.search-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-item-code {
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 220, 130, 0.15);
  color: #00dc82;
  padding: 3px 7px;
  border-radius: 6px;
}

[data-theme="light"] .search-item-code {
  background: var(--primary-light);
  color: var(--primary);
}

.search-item-info {
  display: flex;
  flex-direction: column;
}

.search-item-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.search-item-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.search-empty-state {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Top Header Right & Auth Zone */
.top-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-google-signin {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-google-signin:hover {
  border-color: #00dc82;
  box-shadow: 0 0 0 3px rgba(0, 220, 130, 0.12);
}

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: var(--transition);
}

.user-avatar-btn:hover {
  border-color: var(--border-focus);
}

.user-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.user-avatar-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* User Profile Popover (Hình 3 OpenRouter) */
.user-auth-zone {
  position: relative;
}

.user-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: #0f1117;
  color: #fff;
  border: 1px solid #27272a;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 300;
  padding: 14px;
}

[data-theme="light"] .user-popover {
  background: #ffffff;
  color: #0f172a;
  border-color: var(--border);
  box-shadow: var(--shadow-lg);
}

.popover-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.popover-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.popover-user-name {
  font-size: 14px;
  font-weight: 700;
}

.popover-user-email {
  font-size: 11px;
  color: #9ca3af;
}

.popover-divider {
  height: 1px;
  background: #27272a;
  margin: 12px 0;
}

[data-theme="light"] .popover-divider {
  background: var(--border);
}

.popover-wallet-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid #27272a;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

[data-theme="light"] .popover-wallet-box {
  background: var(--bg-subtle);
  border-color: var(--border);
}

.wallet-row {
  display: flex;
  justify-content: space-between;
}

.popover-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.popover-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: #d1d5db;
  transition: 0.15s;
  width: 100%;
  text-align: left;
}

[data-theme="light"] .popover-menu-item {
  color: var(--text-primary);
}

.popover-menu-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

[data-theme="light"] .popover-menu-item:hover {
  background: var(--bg-subtle);
  color: var(--primary);
}

.popover-signout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  transition: 0.15s;
}

.popover-signout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ─── 4. APP BODY & PAGES ─── */
.app-body {
  flex: 1;
  padding: 24px;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
}

.page-container {
  animation: fadeIn 0.25s ease-out;
}

/* Ontap Sub-tabs Top Bar (Thi thử, Luyện tập, Ngân hàng, AI sinh câu, Lịch sử) */
.ontap-nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ontap-nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.tab-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}

.tab-pill-btn:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.tab-pill-btn.active {
  background: #00dc82;
  color: #000;
  font-weight: 700;
}

[data-theme="light"] .tab-pill-btn.active {
  background: var(--primary);
  color: #fff;
}

.subject-pill-wrapper {
  flex-shrink: 0;
}

.subject-pill-select {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ─── 5. SUBJECT DETAIL PAGE ─── */
.subject-detail-page-shell { max-width: 1370px; margin: 0 auto; }
.subject-back-button { display:inline-flex; align-items:center; gap:10px; min-height:50px; padding:0 24px; margin:0 0 20px; border:1px solid var(--border); border-radius:var(--radius-full); background:var(--bg-card); color:var(--text-primary); font:inherit; font-size:14px; font-weight:700; cursor:pointer; box-shadow:0 4px 14px rgba(15,23,42,.05); transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.subject-back-button:hover, .subject-back-button:focus-visible { transform:translateY(-2px); border-color:rgba(16,185,129,.4); box-shadow:0 10px 24px rgba(15,23,42,.09); outline:none; }
.subject-detail-hero { --theme-main:#12a56c; --theme-soft:#dff8eb; --theme-rgb:18,165,108; position:relative; isolation:isolate; overflow:hidden; display:flex; min-height:305px; margin-bottom:26px; padding:42px 42px 36px; border:1px solid var(--border); border-radius:24px; background:linear-gradient(112deg,var(--bg-card) 45%,color-mix(in srgb,var(--theme-soft) 62%,var(--bg-card)) 100%); box-shadow:0 10px 28px rgba(15,23,42,.045); }
.subject-theme-defense { --theme-main:#0e9f6e; --theme-soft:#d6faeb; --theme-rgb:14,159,110; }.subject-theme-physics { --theme-main:#536dfe; --theme-soft:#e5e9ff; --theme-rgb:83,109,254; }.subject-theme-chemistry { --theme-main:#e4703b; --theme-soft:#fff0e5; --theme-rgb:228,112,59; }.subject-theme-biology { --theme-main:#a44fd0; --theme-soft:#f6e8ff; --theme-rgb:164,79,208; }.subject-theme-engineering { --theme-main:#2878bd; --theme-soft:#e5f2ff; --theme-rgb:40,120,189; }.subject-theme-food { --theme-main:#d68624; --theme-soft:#fff3df; --theme-rgb:214,134,36; }.subject-theme-quality { --theme-main:#079a79; --theme-soft:#dff9f1; --theme-rgb:7,154,121; }.subject-theme-business { --theme-main:#4e71d4; --theme-soft:#e8edff; --theme-rgb:78,113,212; }.subject-theme-society { --theme-main:#7b5fc7; --theme-soft:#eeeaff; --theme-rgb:123,95,199; }
.subject-detail-hero .subject-detail-badge,.subject-detail-hero .subject-meta-block { background:var(--theme-soft); color:var(--theme-main); }
.subject-hero-copy { position:relative; z-index:2; width:min(68%,780px); }
.subject-meta-row { display:flex; flex-wrap:wrap; align-items:center; gap:13px 25px; }
.subject-detail-badge, .subject-meta-pill { display:inline-flex; align-items:center; gap:8px; padding:9px 15px; border-radius:12px; font-size:13px; font-weight:800; line-height:1; letter-spacing:.01em; }
.subject-detail-badge { background:#d9fae9; color:#059669; }
.subject-meta-block { background:#e9faf2; color:#059669; }
.subject-meta-text { color:var(--text-primary); font-size:12px; font-weight:800; letter-spacing:.04em; white-space:nowrap; }
.subject-detail-title { max-width:735px; margin:24px 0 14px; color:var(--text-primary); font-size:clamp(30px,3.1vw,43px); font-weight:800; line-height:1.2; letter-spacing:-.035em; }
.subject-detail-description { max-width:700px; margin:0; color:var(--text-secondary); font-size:16px; line-height:1.65; }
.subject-hero-art { position:absolute; inset:0 0 0 auto; z-index:1; width:51%; overflow:hidden; pointer-events:none; opacity:.95; }.subject-art-glow { position:absolute; border-radius:50%; background:rgba(var(--theme-rgb),.13); }.subject-art-glow-one { width:285px; height:285px; right:70px; bottom:-108px; }.subject-art-glow-two { width:190px; height:190px; right:260px; bottom:-78px; background:rgba(var(--theme-rgb),.09); }.subject-art-platform { position:absolute; right:-8%; bottom:-79px; width:570px; height:205px; border-radius:50% 50% 0 0; background:linear-gradient(180deg,rgba(var(--theme-rgb),.35),rgba(var(--theme-rgb),.14)); }.subject-art-emblem { position:absolute; right:20%; bottom:75px; display:grid; width:124px; height:124px; place-items:center; border-radius:34px; background:linear-gradient(135deg,rgba(255,255,255,.85),rgba(var(--theme-rgb),.6)); box-shadow:0 15px 28px rgba(var(--theme-rgb),.19); color:#fff; font-size:52px; transform:rotate(-7deg); }.theme-defense .subject-art-emblem { clip-path:polygon(50% 0,94% 18%,94% 62%,50% 100%,6% 62%,6% 18%); border-radius:0; }.subject-art-orbit { position:absolute; border:2px solid rgba(var(--theme-rgb),.18); border-radius:50%; }.subject-art-orbit-one { right:4%; top:30px; width:180px; height:86px; transform:rotate(-24deg); }.subject-art-orbit-two { right:9%; top:86px; width:240px; height:110px; transform:rotate(37deg); }.subject-art-float { position:absolute; color:rgba(var(--theme-rgb),.38); }.subject-art-float-one { top:56px; right:11%; font-size:26px; }.subject-art-float-two { top:123px; right:38%; font-size:18px; }.theme-physics .subject-art-orbit { border-style:dashed; }.theme-chemistry .subject-art-emblem { border-radius:50% 50% 32px 32px; }.theme-biology .subject-art-glow-one { border-radius:57% 43% 60% 40%; }.theme-engineering .subject-art-emblem { border-radius:24px; transform:rotate(0); }.theme-food .subject-art-platform { border-radius:55% 45% 0 0; }.theme-business .subject-art-orbit { border-radius:22px; transform:rotate(28deg); }
.subject-detail-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:24px; }
.subject-card { position:relative; display:flex; flex-direction:column; align-items:flex-start; min-height:324px; padding:30px; overflow:hidden; border:1px solid var(--border); border-radius:20px; background:var(--bg-card); color:var(--text-primary); text-align:left; font:inherit; cursor:pointer; box-shadow:0 8px 22px rgba(15,23,42,.04); transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease; }
.subject-card:hover, .subject-card:focus-visible { transform:translateY(-6px); border-color:var(--card-accent); box-shadow:0 18px 36px rgba(15,23,42,.11); outline:none; }.subject-card:focus-visible { box-shadow:0 0 0 4px color-mix(in srgb,var(--card-accent) 22%,transparent),0 18px 36px rgba(15,23,42,.11); }
.subject-card-info { --card-accent:#10a76c; --card-soft:#e6f8ee; }.subject-card-lecture { --card-accent:#078d57; --card-soft:#e3f8ee; }.subject-card-exam { --card-accent:#f37a23; --card-soft:#fff3e4; }.subject-card-quiz { --card-accent:#0f9f62; --card-soft:#e8f9f0; }
.subject-card-icon { display:grid; width:76px; height:76px; margin-bottom:27px; place-items:center; border-radius:50%; background:var(--card-soft); color:var(--card-accent); font-size:31px; }.subject-card-exam .subject-card-icon { color:#d7a15b; }
.subject-card-content { display:flex; flex:1; flex-direction:column; align-items:flex-start; }.subject-card-title { font-size:19px; font-weight:800; line-height:1.3; letter-spacing:-.02em; }.subject-card-accent { width:27px; height:2px; margin:12px 0 14px; background:var(--card-accent); border-radius:var(--radius-full); }.subject-card-description { color:var(--text-secondary); font-size:15px; line-height:1.55; }.subject-card-status { margin-top:auto; padding-top:14px; color:var(--text-muted); font-size:12px; font-weight:700; }.subject-card-ready { color:var(--card-accent); }.subject-card-ready i { margin-right:5px; }
.subject-card-arrow { display:grid; width:46px; height:46px; margin-top:18px; margin-left:auto; place-items:center; border-radius:50%; background:var(--card-soft); color:var(--card-accent); font-size:16px; transition:transform .2s ease; }.subject-card:hover .subject-card-arrow { transform:translateX(4px); }
[data-theme="dark"] .subject-detail-hero { background:linear-gradient(112deg,var(--bg-card) 45%,rgba(var(--theme-rgb),.16) 100%); } [data-theme="dark"] .subject-detail-description,[data-theme="dark"] .subject-card-description { color:var(--text-secondary); }
@media (max-width:1160px) { .subject-detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.subject-card { min-height:292px; }.subject-hero-copy { width:72%; }.subject-hero-art { width:55%; opacity:.64; } }
@media (max-width:700px) { .subject-detail-hero { min-height:0; padding:28px 24px; border-radius:18px; }.subject-hero-copy { width:100%; }.subject-hero-art { display:none; }.subject-detail-grid { grid-template-columns:1fr; gap:16px; }.subject-card { min-height:265px; padding:24px; }.subject-card-icon { width:62px; height:62px; margin-bottom:19px; font-size:25px; }.subject-detail-title { margin-top:20px; font-size:30px; }.subject-detail-description { font-size:14px; }.subject-meta-row { gap:10px; }.subject-meta-text { font-size:11px; }.subject-back-button { min-height:46px; padding:0 18px; margin-bottom:16px; } }

/* ─── 6. RESPONSIVE BREAKPOINTS ─── */
@media (max-width: 900px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    display: block;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .app-main-wrapper {
    margin-left: 0;
  }

  .menu-toggle-btn {
    display: flex;
  }
}

/* ─── ROLE BADGES & ADMIN DASHBOARD ─── */
.badge-admin {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff !important;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  letter-spacing: 0.5px;
}
.badge-premium {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff !important;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  letter-spacing: 0.5px;
}
.badge-newbie {
  background: var(--bg-subtle);
  color: var(--text-muted) !important;
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 9999px;
}
.admin-page-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: 16px;
}
.admin-stat-card {
  transition: var(--transition);
  border: 1px solid var(--border);
}
.admin-stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ──────────────────────────────────────────────────────
   ADMIN CATEGORIZED NAVIGATION ZONES
────────────────────────────────────────────────────── */
.admin-nav-zones {
  display: grid;
  grid-template-columns: 1fr 2.2fr 2.2fr;
  gap: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: var(--radius-xl);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}
@media (max-width: 992px) {
  .admin-nav-zones { grid-template-columns: 1fr; }
}
.admin-nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-nav-group-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
}
.admin-nav-group-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.admin-zone-btn {
  flex: 1;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.admin-zone-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.admin-zone-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 8px var(--primary-glow);
}


/* ──────────────────────────────────────────────────────
   ADMIN CMS — ARTICLES LAYOUT
────────────────────────────────────────────────────── */
.admin-cms-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-article-list {
  width: 100%;
}

.admin-article-list .article-card-admin {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: 12px;
  background: var(--bg-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.admin-article-list .article-card-admin:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.article-card-admin .article-thumb {
  width: 96px;
  height: 66px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.article-card-admin .article-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.article-card-admin .article-info h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-excerpt-preview {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.article-card-admin .article-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-top: 2px;
}

.article-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Quill.js editor override & MS Word Paper View */
.word-editor-wrapper {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}
[data-theme="dark"] .word-editor-wrapper {
  background: #0f172a;
}
.word-editor-wrapper .ql-toolbar.ql-snow {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  background: var(--bg-card) !important;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.word-editor-wrapper .ql-container.ql-snow {
  border: none !important;
  background: transparent !important;
}
.word-editor-wrapper .ql-editor {
  max-width: 780px;
  margin: 0 auto;
  background: #ffffff !important;
  color: #1e293b !important;
  min-height: 380px;
  padding: 36px 44px !important;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .word-editor-wrapper .ql-editor {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Word Document Paper View for Readers (User Viewers) */
.document-paper-view {
  max-width: 780px;
  margin: 0 auto;
  background: #ffffff;
  color: #1e293b;
  padding: 32px 40px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
}
[data-theme="dark"] .document-paper-view {
  background: #1e293b;
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.1);
}
.document-paper-view img {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .ql-picker, [data-theme="dark"] .ql-stroke { stroke: var(--text-primary) !important; }
[data-theme="dark"] .ql-fill { fill: var(--text-primary) !important; }

/* ──────────────────────────────────────────────────────
   ADMIN FEEDBACK INBOX
────────────────────────────────────────────────────── */
.feedback-item {
  display: flex; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  margin-bottom: 8px; transition: var(--transition);
}
.feedback-item.unread { border-left: 3px solid var(--danger); background: var(--danger-light); }
.feedback-item.resolved { opacity: 0.6; }
.feedback-item .fb-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.feedback-item .fb-body { flex: 1; min-width: 0; }
.feedback-item .fb-body h5 { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.feedback-item .fb-body p { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.feedback-item .fb-actions { display: flex; gap: 6px; align-items: center; }
.badge-unread {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--danger); color: white; font-size: 10px; font-weight: 700;
  padding: 0 4px; margin-left: 4px;
}

/* ──────────────────────────────────────────────────────
   ADMIN RESOURCES LAYOUT
────────────────────────────────────────────────────── */
.admin-resources-layout {
  display: flex; gap: 16px; align-items: flex-start;
}
@media (max-width: 800px) { .admin-resources-layout { flex-direction: column; } }
.resource-item {
  display: flex; gap: 10px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  margin-bottom: 8px; transition: var(--transition);
}
.resource-item:hover { border-color: var(--primary); }
.resource-item .res-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.resource-item .res-body { flex: 1; min-width: 0; }
.resource-item .res-body a { font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none; }
.resource-item .res-body a:hover { text-decoration: underline; }
.resource-item .res-body .res-meta { font-size: 11px; color: var(--text-muted); }

/* ──────────────────────────────────────────────────────
   ADMIN BANK WORKFLOW (4-STEP)
────────────────────────────────────────────────────── */
.admin-bank-workflow { display: flex; flex-direction: column; gap: 16px; }
.bank-workflow-steps {
  display: flex; gap: 0; align-items: center;
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 6px 12px;
  overflow-x: auto;
}
.bank-step {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--radius-lg);
  cursor: default; opacity: 0.45; transition: var(--transition);
  white-space: nowrap;
}
.bank-step::after {
  content: '›'; font-size: 18px; color: var(--text-muted);
  margin-left: 12px; opacity: 0.5;
}
.bank-step:last-child::after { display: none; }
.bank-step.active { opacity: 1; background: var(--primary-light); }
.bank-step.done { opacity: 0.7; }
.step-num {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--border); font-size: 12px; font-weight: 700;
}
.bank-step.active .step-num { background: var(--primary); color: white; }
.bank-step.done .step-num { background: var(--success); color: white; }
.step-label { font-size: 12px; font-weight: 600; }

/* Source Mode Tabs */
.source-mode-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.source-mode-btn {
  padding: 6px 14px; border-radius: var(--radius-lg); font-size: 12px; font-weight: 600;
  border: 1.5px solid var(--border); background: transparent; cursor: pointer;
  transition: var(--transition); color: var(--text-secondary);
}
.source-mode-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.source-mode-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

/* Extracted preview box */
.bank-extracted-preview {
  margin-top: 10px; padding: 12px; background: var(--bg-subtle);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  max-height: 200px; overflow-y: auto; font-size: 12px; white-space: pre-wrap;
  font-family: monospace; color: var(--text-secondary);
}

/* Bank Review Question Cards */
.admin-bank-review-list { display: flex; flex-direction: column; gap: 10px; }
.bank-review-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px;
  background: var(--bg-card); position: relative;
}
.bank-review-card.marked-delete { opacity: 0.4; border-color: var(--danger); background: var(--danger-light); }
.bank-review-card .brc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bank-review-card .brc-num { font-weight: 800; font-size: 12px; color: var(--text-muted); }
.bank-review-card .brc-q { font-size: 13px; font-weight: 600; margin-bottom: 8px; width: 100%; border: none; background: transparent; resize: vertical; }
.bank-review-card .brc-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.bank-review-card .brc-option { display: flex; align-items: center; gap: 6px; }
.bank-review-card .brc-option input[type="text"] { flex: 1; font-size: 12px; border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; background: var(--bg-subtle); }
.bank-review-card .brc-option input[type="radio"] { accent-color: var(--primary); }
.bank-review-card .brc-exp { font-size: 12px; color: var(--text-muted); border-top: 1px dashed var(--border); padding-top: 6px; margin-top: 4px; width: 100%; border-left: none; border-right: none; border-bottom: none; background: transparent; resize: vertical; }

/* ══════════════════════════════════════════════════════════════════
   HOME PAGE — HERO SECTION (Modern Education Platform Style)
══════════════════════════════════════════════════════════════════ */

#page-home {
  padding: 0;
  overflow: visible;
}

/* ─── Hero Layout — Full Viewport Height ─── */
.home-hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  padding: 48px 64px 32px 64px;
  max-width: 1400px;
  margin: 0 auto;
  /* Chiếm toàn bộ màn hình trừ top-header */
  height: calc(100vh - var(--top-header-height));
  min-height: 540px;
  position: relative;
  overflow: hidden;
}

.home-hero-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.home-hero-right {
  flex: 0 0 560px;
  width: 560px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px;
}

/* ─── Badge pill ─── */
.home-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(0, 185, 107, 0.3);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  width: fit-content;
  animation: slideInLeft 0.5s ease-out;
}
.hero-badge-dot {
  width: 9px; height: 9px;
  background: var(--primary);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.8s ease-in-out infinite;
}

/* ─── Hero Title ─── */
.home-hero-title {
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 800;
  line-height: 1.18;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.8px;
  animation: slideInLeft 0.55s ease-out;
}
.home-hero-accent {
  background: linear-gradient(135deg, #00b96b, #00d4ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ─── Hero Description ─── */
.home-hero-desc {
  font-size: 16.5px;
  line-height: 1.68;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0;
  text-align: justify;
  text-justify: inter-word;
  animation: slideInLeft 0.6s ease-out;
}

/* ─── Hero Action Buttons ─── */
.home-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  animation: slideInLeft 0.65s ease-out;
  margin-top: 6px;
}
.home-cta-primary {
  padding: 16px 34px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 24px rgba(0, 185, 107, 0.38) !important;
  transition: all 0.25s ease !important;
}
.home-cta-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 185, 107, 0.5) !important;
}
.home-cta-secondary {
  padding: 16px 28px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  border-radius: 14px !important;
  border: 1.5px solid var(--border) !important;
  color: var(--text-primary) !important;
  background: transparent !important;
  transition: all 0.25s ease !important;
}
.home-cta-secondary:hover {
  background: var(--bg-subtle) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

/* ─── Hero Right: Circle + Image ─── */
.home-hero-circle-bg {
  position: absolute;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5, #a7f3d0);
  border: 3px dashed rgba(0, 185, 107, 0.4);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: spinSlow 22s linear infinite;
  z-index: 0;
}
[data-theme="dark"] .home-hero-circle-bg {
  background: linear-gradient(135deg, #052e16, #064e3b, #065f46);
}
.home-hero-img {
  position: relative;
  z-index: 1;
  width: 440px;
  height: 520px;
  max-height: 85vh;
  object-fit: cover;
  object-position: top center;
  border-radius: 28px;
  filter: drop-shadow(0 14px 40px rgba(0, 185, 107, 0.28));
  animation: floatY 4s ease-in-out infinite;
}

/* ─── Floating Cards ─── */
.home-float-card {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  white-space: nowrap;
  backdrop-filter: blur(10px);
  animation: floatCard 0.6s ease-out backwards;
}
.home-float-card-top {
  top: 36px; right: -10px;
  animation-delay: 0.3s;
}
.home-float-card-bottom {
  bottom: 24px; left: -20px;
  animation-delay: 0.5s;
}
.float-card-icon { font-size: 26px; }
.float-card-num { font-size: 20px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.float-card-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.float-card-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.float-card-session { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.float-card-time { font-size: 11px; color: var(--text-muted); }
.float-card-btn {
  padding: 7px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-left: 6px;
}
.float-card-btn:hover { background: var(--primary-hover); }

/* ─── Stats Row ─── */
.home-stats-row {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  max-width: 1400px;
  margin: 0 auto 36px auto;
  padding: 24px 40px;
  box-shadow: var(--shadow-sm);
}
.home-stat-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}
.home-stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.home-stat-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.home-stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 3px;
}
.home-stat-divider {
  width: 1px;
  height: 44px;
  background: var(--border);
  margin: 0 28px;
  flex-shrink: 0;
}

/* ─── Feature Cards Grid ─── */
.home-features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 64px 48px 64px;
}
.home-feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 26px 24px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home-feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  opacity: 0;
  transition: opacity 0.25s;
}
.home-feature-card:nth-child(1)::before { background: linear-gradient(90deg,#10b981,#059669); }
.home-feature-card:nth-child(2)::before { background: linear-gradient(90deg,#3b82f6,#1d4ed8); }
.home-feature-card:nth-child(3)::before { background: linear-gradient(90deg,#8b5cf6,#6d28d9); }
.home-feature-card:nth-child(4)::before { background: linear-gradient(90deg,#f59e0b,#d97706); }
.home-feature-card:hover::before { opacity: 1; }
.home-feature-card:hover {
  border-color: transparent;
  transform: translateY(-5px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.12);
}
.home-feature-icon {
  width: 54px; height: 54px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.home-feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.home-feature-card p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
}
.home-feature-arrow {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.2s;
  align-self: flex-end;
}
.home-feature-card:hover .home-feature-arrow {
  background: var(--primary);
  color: #fff;
  transform: translateX(3px);
}

/* ─── Animations ─── */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}
@keyframes spinSlow {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes floatCard {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Scroll Down Hint ─── */
.home-scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 0 24px 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  opacity: 0.8;
  cursor: pointer;
  transition: opacity 0.2s;
}
.home-scroll-hint:hover {
  opacity: 1;
  color: var(--primary);
}
.home-scroll-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  animation: bounceY 2s infinite;
}

@keyframes bounceY {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(6px); }
  60% { transform: translateY(3px); }
}

/* ─── Responsive: Tablet/Mobile ─── */
@media (max-width: 1100px) {
  .home-features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .home-hero-section {
    height: auto;
    min-height: auto;
    flex-direction: column;
    padding: 32px 20px 20px;
    gap: 24px;
  }
  .home-hero-right { flex: none; width: 100%; min-height: 280px; }
  .home-hero-circle-bg { width: 240px; height: 240px; }
  .home-hero-img { width: 200px; height: 260px; }
  .home-float-card-top { top: 10px; right: 10px; }
  .home-float-card-bottom { bottom: 10px; left: 10px; }
  .home-stats-row { margin: 0 20px 20px; padding: 16px 20px; flex-wrap: wrap; gap: 12px; }
  .home-stat-divider { display: none; }
  .home-features-grid { padding: 0 20px 28px; gap: 12px; }
  .home-hero-title { font-size: 26px; }
  .home-scroll-hint { display: none; }
}
@media (max-width: 640px) {
  .home-features-grid { grid-template-columns: 1fr; }
  .home-float-card-bottom { display: none; }
}

/* ============================================================
   NEWS & ARTICLES PORTAL ("Đọc báo & Tin tức" / "Giới thiệu về ngành")
   Matching Image 2 (Listing View) and Image 3 (Reader View)
   ============================================================ */

.articles-portal-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.articles-header-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.header-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.articles-portal-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}
.portal-title-icon {
  font-size: 26px;
}

.articles-portal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Category Filter Chips & Sort */
.articles-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.articles-chips-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  max-width: 100%;
}
.articles-chips-scroll::-webkit-scrollbar {
  display: none;
}

.category-chip {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.category-chip:hover {
  background: var(--border);
  color: var(--text-primary);
}
.category-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.articles-sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 14px;
}

.articles-sort-select {
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

/* Main Portal Grid (Left Content 1fr, Right Sidebar 340px) */
.articles-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1024px) {
  .articles-main-grid {
    grid-template-columns: 1fr;
  }
}

/* Hero Featured Grid (Hero card on left + 3 subcards on right) */
.articles-featured-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 768px) {
  .articles-featured-grid {
    grid-template-columns: 1fr;
  }
}

.article-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.article-hero-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  border-color: var(--primary);
}

.hero-img-wrap {
  position: relative;
  width: 100%;
  height: 230px;
  overflow: hidden;
  background: var(--bg-subtle);
}
.hero-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.article-hero-card:hover .hero-card-img {
  transform: scale(1.05);
}

.hero-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-green {
  background: #ecfdf5;
  color: #059669;
}
.badge-subtle-green {
  background: rgba(0, 185, 107, 0.1);
  color: #00b96b;
}

.hero-card-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--text-primary);
  margin: 10px 0 8px;
}
.hero-card-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.article-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

/* Sub-featured 3 Cards Stack */
.article-subfeatured-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: space-between;
}

.article-subcard {
  display: flex;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  align-items: center;
}
.article-subcard:hover {
  transform: translateX(4px);
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.subcard-img {
  width: 125px;
  height: 85px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-subtle);
}

.subcard-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.subcard-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Horizontal Articles List */
.article-horizontal-card {
  display: flex;
  gap: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px;
  cursor: pointer;
  align-items: center;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.article-horizontal-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.h-card-img {
  width: 170px;
  height: 110px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-subtle);
}
@media (max-width: 640px) {
  .article-horizontal-card { flex-direction: column; align-items: stretch; }
  .h-card-img { width: 100%; height: 160px; }
}

.h-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.h-card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
}
.h-card-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Sidebar Box Styling */
.articles-sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
}

.sidebar-box-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-categories-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-cat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  transition: var(--transition);
}
.sidebar-cat-item:hover, .sidebar-cat-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.cat-item-badge {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

/* Sidebar Rankings List */
.sidebar-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-rank-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.sidebar-rank-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.sidebar-rank-item:hover .rank-title {
  color: var(--primary);
}

.rank-num {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.rank-num-1 { background: #d1fae5; color: #059669; }
.rank-num-2 { background: #d1fae5; color: #10b981; }
.rank-num-3 { background: #dbeafe; color: #2563eb; }
.rank-num-4, .rank-num-5 { background: var(--bg-subtle); color: var(--text-muted); }

.rank-info {
  flex: 1;
}
.rank-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rank-views {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
}

/* SINGLE ARTICLE READER VIEW (Matching Image 3) */
.article-reader-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.article-reader-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1024px) {
  .article-reader-grid { grid-template-columns: 1fr; }
}

.article-reader-main {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
}

.reader-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 14px 0 10px;
}

.reader-excerpt {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

.reader-cover-wrap {
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-subtle);
}
.reader-cover-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

/* Prose formatting */
.reader-article-body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-primary);
}
.reader-article-body .article-lead {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.7;
  color: var(--text-primary);
}
.reader-article-body h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  margin: 32px 0 14px;
  scroll-margin-top: 80px;
}
.reader-article-body h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 24px 0 10px;
  scroll-margin-top: 80px;
}
.reader-article-body ol, .reader-article-body ul {
  padding-left: 24px;
  margin: 16px 0;
}
.reader-article-body li {
  margin-bottom: 10px;
}

/* Table of Contents (TOC) Box Sticky */
.toc-sticky-box {
  position: sticky;
  top: calc(var(--header-height) + 16px);
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-item {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  transition: var(--transition);
  line-height: 1.4;
}
.toc-item:hover, .toc-item.active {
  color: var(--primary);
  font-weight: 700;
  border-left-color: var(--primary);
  background: var(--primary-light);
}
.toc-sub {
  padding-left: 24px;
  font-size: 12px;
}

/* Related articles cards */
.related-card {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  align-items: center;
  transition: var(--transition);
}
.related-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.related-card:hover .related-title {
  color: var(--primary);
}

.related-img {
  width: 76px;
  height: 56px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-subtle);
}

.related-info {
  flex: 1;
}
.related-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}



/* ============================================================
   Quill Image Resize Styles
   ============================================================ */
.quill-editor img {
  cursor: pointer;
}

.ql-editor img {
  max-width: 100%;
  height: auto;
}

/* Image resize handles */
.image-resize-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.image-resize-handle.bottom-right {
  bottom: -6px;
  right: -6px;
  cursor: nwse-resize;
}

.image-resize-handle.top-left {
  top: -6px;
  left: -6px;
  cursor: nwse-resize;
}

.image-resize-handle.top-right {
  top: -6px;
  right: -6px;
  cursor: nesw-resize;
}

.image-resize-handle.bottom-left {
  bottom: -6px;
  left: -6px;
  cursor: nesw-resize;
}

/* Display size tooltip */
.image-resize-display-size {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 17, 17, 0.9);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  z-index: 11;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Active image container */
.ql-editor .quill-image-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.ql-editor .quill-image-wrapper.active {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================================
   TinyMCE Editor Styles
   ============================================================ */

.word-editor-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* TinyMCE table styles in article view */
.article-prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 20px 0;
  border: 2px solid #333;
}

.article-prose table td,
.article-prose table th {
  border: 1px solid #666;
  padding: 12px 16px;
  vertical-align: top;
  background: white;
}

.article-prose table tr:first-child td,
.article-prose table tr:first-child th {
  background: #f0f0f0;
  font-weight: 700;
}

.article-prose table tr:nth-child(even) td {
  background: #fafafa;
}

.article-prose table tr:hover td {
  background: #f5f5f5;
}

/* Responsive */
@media (max-width: 768px) {
  .article-prose table {
    display: block;
    overflow-x: auto;
    font-size: 13px;
  }
  
  .article-prose table td,
  .article-prose table th {
    padding: 8px 10px;
    min-width: 60px;
  }
}

/* ============================================================
   Searchable Select Dropdown
   ============================================================ */
.searchable-select-wrapper {
  position: relative;
  width: 100%;
}

.searchable-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  cursor: text;
  transition: all 0.2s;
}

.searchable-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.searchable-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  z-index: 1000;
}

.searchable-dropdown.hidden {
  display: none;
}

.searchable-dropdown-group {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.searchable-dropdown-group:last-child {
  border-bottom: none;
}

.searchable-dropdown-label {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.searchable-dropdown-item {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.searchable-dropdown-item:hover {
  background: var(--primary-light);
}

.searchable-dropdown-item.selected {
  background: var(--primary-light);
  font-weight: 600;
  color: var(--primary);
}

.searchable-dropdown-code {
  font-weight: 600;
  color: var(--primary);
  min-width: 60px;
}

.searchable-dropdown-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================================
   Notifications Page - 90% GIỐNG MẪU (Xanh nhạt Pastel)
   ============================================================ */

/* Header */
.notifications-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  margin-bottom: 16px;
}

[data-theme="dark"] .notifications-header {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
}

.notifications-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notifications-icon {
  width: 40px;
  height: 40px;
  background: #10b981;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}

.notifications-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.notifications-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 2px 0 0 0;
}

.notifications-illustration {
  opacity: 0.2;
  font-size: 48px;
}

/* Filter Tabs */
.notifications-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  padding: 0 2px;
}

.notification-tab {
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.notification-tab:hover {
  border-color: #10b981;
  background: #ecfdf5;
  color: #10b981;
}

.notification-tab.active {
  background: #10b981;
  color: white;
  border-color: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.notification-tab i {
  font-size: 12px;
}

.tab-count {
  font-size: 10px;
  opacity: 0.85;
  font-weight: 700;
}

.notification-tab-more {
  padding: 7px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.notification-tab-more:hover {
  border-color: #10b981;
  color: #10b981;
}

/* Notifications List */
.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.18s;
  cursor: pointer;
  position: relative;
}

.notification-item:hover {
  border-color: #10b981;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.12);
  transform: translateY(-1px);
}

.notification-item.system {
  border-left: 3px solid #10b981;
}

.notification-item.premium {
  border-left: 3px solid #8b5cf6;
}

.notification-item.account {
  border-left: 3px solid #f59e0b;
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
  gap: 10px;
}

.notification-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.35;
}

.notification-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.notification-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}

.notification-time-detail {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.75;
}

.notification-mark-read {
  width: 14px;
  height: 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #10b981;
  font-size: 7px;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.notification-mark-read:hover {
  transform: scale(1.15);
}

.notification-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
}

.notification-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.notification-badge.success {
  background: #d1fae5;
  color: #065f46;
}

.notification-badge.premium {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}

.notification-badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.notification-arrow {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.15s;
  flex-shrink: 0;
  align-self: center;
  font-size: 11px;
}

.notification-arrow:hover {
  background: #ecfdf5;
  color: #10b981;
}

/* Empty State */
.notifications-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.notifications-empty i {
  font-size: 40px;
  margin-bottom: 10px;
  opacity: 0.35;
}

.notifications-empty p {
  font-size: 13px;
}

/* Pagination */
.notifications-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 16px 0;
}

/* Responsive */
@media (max-width: 768px) {
  .notifications-header {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  
  .notifications-header-left {
    flex-direction: column;
    align-items: center;
  }
  
  .notifications-illustration {
    display: none;
  }
  
  .notification-item {
    flex-direction: column;
    gap: 10px;
  }
  
  .notification-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .notification-meta {
    width: 100%;
    justify-content: space-between;
  }
}

/* ============================================================
   Notification Detail Page
   ============================================================ */

.notification-detail-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  margin-top: 20px;
}

.notification-detail-main {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 28px;
  border: 1.5px solid var(--border);
}

.notification-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.notification-detail-icon {
  width: 52px;
  height: 52px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.notification-detail-badge-top {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.notification-detail-badge-top.success {
  background: var(--success-light);
  color: var(--success);
}

.notification-detail-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.notification-mark-read-btn {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 10px;
}

.notification-detail-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px 0;
  line-height: 1.3;
}

.notification-detail-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 24px 0;
}

.notification-detail-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.notification-info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-subtle);
  border-radius: 8px;
}

.notification-info-item i {
  font-size: 20px;
}

.notification-info-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.notification-info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.notification-detail-content {
  line-height: 1.7;
  color: var(--text-secondary);
}

.notification-detail-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px 0;
}

.notification-detail-content p {
  margin: 0 0 16px 0;
  font-size: 14px;
}

.notification-detail-content ul {
  margin: 0 0 16px 20px;
  padding: 0;
}

.notification-detail-content li {
  margin-bottom: 8px;
  font-size: 14px;
}

.notification-detail-feedback {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1.5px solid var(--border);
}

.notification-detail-feedback h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.notification-detail-feedback p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
}

.notification-feedback-buttons {
  display: flex;
  gap: 12px;
}

/* Sidebar */
.notification-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.notification-related-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-subtle);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.notification-related-item:hover {
  background: var(--primary-light);
  transform: translateX(4px);
}

.notification-related-item > i:first-child {
  font-size: 18px;
  color: var(--primary);
}

.notification-related-item > i:last-child {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}

.notification-related-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.notification-related-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.notification-detail-help {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.notification-detail-help h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.notification-detail-help p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
}

/* Responsive */
@media (max-width: 900px) {
  .notification-detail-layout {
    grid-template-columns: 1fr;
  }
  
  .notification-detail-sidebar {
    order: -1;
  }
}

/* MOBILE SAFETY LAYER — only applies at tablet/mobile widths */
@media (max-width:768px){
html,body{max-width:100%;overflow-x:hidden}.app-main-wrapper,.page-container{min-width:0}.app-body{padding:16px 12px 30px}
.top-header{height:64px;padding:0 12px;gap:8px}.top-header-left{min-width:0;gap:8px;max-width:none}.menu-toggle-btn{display:flex;flex:0 0 42px;width:42px;height:42px;border-radius:14px}.search-bar-container{min-width:0;flex:1}.subject-search-input{height:42px;min-width:0;padding:0 12px 0 38px;font-size:14px}.subject-search-input::placeholder{color:transparent}.search-shortcut{display:none}.search-results-dropdown{position:fixed;top:72px;left:12px;right:12px;max-height:min(55dvh,430px);z-index:260}.search-item-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:210px}.top-header-right{flex:0 0 auto;gap:7px}#btn-theme-top{width:42px;height:42px;flex:0 0 42px}.btn-google-signin{min-width:42px;min-height:42px;padding:0 12px;justify-content:center;font-size:0;border-radius:14px}.btn-google-signin::after{content:'G';font-size:19px;font-weight:800;color:#4285f4}.user-avatar-name,.user-avatar-btn>.fa-chevron-down{display:none}.user-avatar-btn{min-height:42px;padding:4px}
#page-home{overflow:hidden}.home-hero-section{height:auto;min-height:0;padding:30px 20px 18px;gap:28px;align-items:stretch}.home-hero-left{gap:17px}.home-hero-badge{max-width:100%;padding:8px 13px;font-size:12px;line-height:1.35;white-space:normal}.home-hero-title{font-size:clamp(31px,9vw,42px);line-height:1.12;letter-spacing:-.6px}.home-hero-desc{max-width:none;font-size:16px;line-height:1.62;text-align:left;text-justify:auto}.home-hero-actions{display:grid;grid-template-columns:1fr;gap:12px;margin-top:3px}.home-cta-primary,.home-cta-secondary{width:100%;min-height:54px;padding:14px 18px!important;font-size:15px!important}.home-hero-right{min-height:250px;width:100%;overflow:visible}.home-hero-img{width:190px;height:245px;max-height:none;border-radius:22px}.home-hero-circle-bg{width:230px;height:230px}.home-float-card-top{top:12px;right:max(0px,calc(50% - 185px));padding:9px 12px}.home-float-card-bottom{display:none}.home-stats-row{display:grid;grid-template-columns:1fr 1fr;margin:0 12px 22px;padding:16px;gap:14px;border-radius:18px}.home-stat-item{min-width:0;gap:10px}.home-stat-icon{width:42px;height:42px;font-size:18px}.home-stat-num{font-size:20px}.home-stat-label{font-size:11px}
.tab-pill-container{width:calc(100% + 24px);margin-left:-12px;padding:6px 12px 10px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;-webkit-overflow-scrolling:touch}.tab-pill-container::-webkit-scrollbar{display:none}.tab-pill-btn{flex:0 0 auto;min-height:44px;padding:9px 14px;scroll-snap-align:start}.subject-pill-wrapper{width:100%;margin-top:5px}.subject-pill-select{width:100%;height:44px;font-size:14px}.subject-banner-bar{display:grid;grid-template-columns:1fr;gap:14px;padding:18px;border-radius:18px}.subject-banner-info{min-width:0;display:flex;flex-wrap:wrap;gap:8px}.subject-banner-name{width:100%;white-space:normal;overflow:visible;text-overflow:clip;font-size:17px;line-height:1.35}.subject-banner-credits{font-size:14px}.subject-banner-filter{display:grid;grid-template-columns:1fr;gap:7px;min-width:0}.subject-banner-filter label{font-size:12px!important}.block-filter-select{width:100%;max-width:100%;min-width:0;height:44px;font-size:13px}#exam-start-card{max-width:none!important;padding:22px 18px}.exam-start-grid{grid-template-columns:1fr;gap:10px}.exam-info-tile{min-width:0}.exam-info-tile select{max-width:100%}
.modal,.modal-content,.card,table,pre{max-width:100%}.card{min-width:0}.table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch}input,select,textarea,button{max-width:100%}
}
@media (max-width:480px){.top-header{padding:0 10px}.menu-toggle-btn,#btn-theme-top{width:40px;height:40px;flex-basis:40px}.btn-google-signin{min-width:40px;min-height:40px;padding:0 10px}.search-results-dropdown{left:10px;right:10px}.search-item-name{max-width:170px}.tab-pill-container{width:calc(100% + 20px);margin-left:-10px;padding-left:10px;padding-right:10px}.tab-pill-btn{min-height:42px;padding:8px 12px;font-size:13px}.tab-pill-btn span{white-space:nowrap}.subject-banner-bar{padding:16px}.subject-banner-name{font-size:16px}.block-filter-select{font-size:12px}}

/* MOBILE: Remaining content, admin, notification and modal safety */
@media (max-width:768px){
  #bank-tab .flex.justify-between.items-center{align-items:stretch!important;flex-direction:column;gap:14px}.bank-filter-chapter,.bank-filter-diff{width:100%}#bank-filter-chapter,#bank-filter-diff,#bank-search-input{width:100%!important;min-width:0!important}.search-wrap{width:100%}#bank-tab .flex.justify-between.items-center:last-child{flex-direction:row;align-items:center!important;gap:8px}#bank-tab .flex.justify-between.items-center:last-child .btn{white-space:nowrap;padding-left:10px;padding-right:10px}
  #toast-container{left:12px;right:12px;bottom:16px}.toast{min-width:0;max-width:none;width:100%;padding:12px 14px}
  .modal-overlay{padding:12px;align-items:flex-end}.modal-box{width:100%;max-height:calc(100dvh - 24px);overflow:auto;padding:20px 16px;border-radius:18px}.review-modal-box{width:100%!important;max-height:calc(100dvh - 24px)!important;padding:16px!important}.modal-header{gap:10px}.modal-header h2,.modal-header h3{font-size:16px}.modal-body{overflow-wrap:anywhere}
  .admin-page-banner{align-items:flex-start!important;flex-direction:column;gap:12px;padding:16px}.admin-page-banner h1{font-size:20px!important;line-height:1.3}.admin-page-banner .flex.items-center.gap-2.mb-1{align-items:flex-start!important;flex-wrap:wrap}.admin-page-banner #admin-server-sync-status{overflow-wrap:anywhere}.admin-nav-zones{padding:10px}.admin-zone-btn{min-width:0;flex:1 1 100%;min-height:42px}.admin-nav-group-btns{display:grid;grid-template-columns:1fr;gap:7px}
  #admin-subtab-users .card> .flex.justify-between.items-center{align-items:stretch!important;flex-direction:column;gap:12px}#admin-user-search{max-width:none!important;width:100%}.history-table{min-width:620px}.table-responsive{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .admin-article-list .article-card-admin{align-items:flex-start;flex-wrap:wrap;padding:14px;gap:12px}.article-card-admin .article-thumb{width:72px;height:56px}.article-card-admin .article-meta{flex-wrap:wrap;white-space:normal;gap:6px}.article-actions-row{width:100%;margin-left:0;justify-content:flex-end;flex-wrap:wrap}.word-editor-wrapper{padding:8px}.word-editor-wrapper .ql-toolbar.ql-snow{overflow-x:auto;white-space:nowrap}.word-editor-wrapper .ql-editor,.document-paper-view{padding:18px 16px!important;font-size:14px}
  .feedback-item{align-items:flex-start;flex-wrap:wrap}.feedback-item .fb-actions{width:100%;justify-content:flex-end;flex-wrap:wrap}.bank-workflow-steps{padding:5px 7px}.bank-step{padding:8px 10px;font-size:12px}
  .notification-detail-main{padding:20px 16px}.notification-detail-title{font-size:22px}.notification-detail-meta{width:100%;margin-left:0;justify-content:space-between;flex-wrap:wrap}.notification-detail-info{grid-template-columns:1fr;gap:10px}.notification-feedback-buttons{flex-wrap:wrap}.notification-feedback-buttons .btn{flex:1 1 140px}
}
@media (max-width:480px){.modal-overlay{padding:8px}.modal-box{max-height:calc(100dvh - 16px);padding:18px 14px}.notification-detail-main{padding:18px 14px}.article-card-admin .article-info h4{white-space:normal}.admin-page-banner h1{font-size:18px!important}}

/* MOBILE: keep the horizontal review tabs intentional and discoverable */
@media (max-width:768px){
  .tab-pill-container{position:relative;scroll-snap-type:x proximity;padding-right:54px!important;mask-image:linear-gradient(to right,#000 0, #000 calc(100% - 40px),transparent 100%)}
  .tab-pill-container::after{content:'›';position:sticky;right:0;display:grid;place-items:center;width:34px;height:38px;margin:-44px -44px 0 auto;border-radius:50%;background:var(--bg-card);color:var(--primary);font-size:28px;font-weight:400;box-shadow:-10px 0 16px var(--bg-base);pointer-events:none}
  .tab-pill-btn{scroll-snap-stop:always}.tab-pill-btn:last-child{margin-right:10px}
  .btn-google-signin::after{display:none}.btn-google-signin .google-icon{display:block;width:20px;height:20px}.btn-google-signin span{display:none}
}

/* Support ticket center */
.report-ticket-shell{max-width:1180px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:22px}.report-ticket-form-card,.report-ticket-history,.support-admin-ticket{background:var(--bg-card);border:1px solid var(--border);border-radius:18px;padding:24px;box-shadow:var(--shadow-sm)}.report-ticket-heading{display:flex;gap:14px;align-items:center;margin-bottom:22px}.report-ticket-heading h1{font-size:24px;margin:0}.report-ticket-heading p{margin:4px 0 0;color:var(--text-secondary);font-size:13px}.report-ticket-icon{width:46px;height:46px;border-radius:14px;display:grid;place-items:center;background:var(--primary-light);color:var(--primary);font-size:20px}.report-ticket-form-card label{display:grid;gap:7px;font-size:12px;font-weight:700;margin-bottom:14px}.report-ticket-form-card input,.report-ticket-form-card select,.report-ticket-form-card textarea{width:100%;padding:11px 12px;border:1px solid var(--border);border-radius:10px;background:var(--bg-subtle);color:var(--text-primary)}.report-ticket-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.report-ticket-result{margin:12px 0 0;color:var(--success);font-size:13px;font-weight:700}.report-history-heading{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--border);padding-bottom:12px}.report-history-heading h2{font-size:16px;margin:0}.report-history-heading span{background:var(--primary-light);color:var(--primary);font-weight:800;font-size:12px;padding:3px 8px;border-radius:999px}.report-ticket-history-list{display:grid;gap:10px;margin-top:14px}.report-history-item{padding:12px;border:1px solid var(--border);border-radius:12px}.report-history-item>div{display:flex;justify-content:space-between;gap:8px}.report-history-item h3{font-size:13px;margin:8px 0}.report-history-item p,.report-history-empty{margin:0;color:var(--text-muted);font-size:11px}.report-status{font-size:10px;font-weight:800;padding:4px 7px;border-radius:999px;background:var(--bg-subtle);white-space:nowrap}.report-status.acknowledged{color:#2563eb;background:#dbeafe}.report-status.processing{color:#b45309;background:#fef3c7}.report-status.fixed{color:#047857;background:var(--success-light)}.report-status.unable{color:#6b7280;background:var(--bg-subtle)}.report-status.submitted{color:#dc2626;background:var(--danger-light)}.support-admin-ticket{margin-bottom:12px}.support-admin-ticket header{display:flex;justify-content:space-between;gap:10px;align-items:center}.support-admin-ticket header>div{display:flex;align-items:center;gap:8px}.support-admin-ticket p{font-size:13px;margin:10px 0}.support-admin-ticket small,.support-admin-user{color:var(--text-muted)}.support-admin-history{display:grid;gap:5px;margin:12px 0;padding:10px;border-left:2px solid var(--primary);background:var(--bg-subtle);font-size:11px;color:var(--text-secondary)}.support-admin-ticket textarea{margin:8px 0}.support-admin-ticket .fb-actions{display:flex;flex-wrap:wrap;gap:7px}@media(max-width:800px){.report-ticket-shell{grid-template-columns:1fr}.report-ticket-grid{grid-template-columns:1fr}.report-ticket-form-card,.report-ticket-history{padding:18px}.support-admin-ticket{padding:16px}.support-admin-ticket header{align-items:flex-start;flex-direction:column}}

/* Restored news hero and notification center presentation */
.articles-header-section{position:relative;overflow:visible;border:0;border-radius:0;background:transparent;box-shadow:none}.articles-news-hero{position:relative;display:flex;align-items:center;min-height:146px;padding:22px 28px;overflow:visible;border:1px solid var(--border);border-radius:14px;background:var(--bg-card);box-shadow:var(--shadow-sm)}.articles-hero-copy{position:relative;z-index:2;width:min(64%,680px)}.articles-hero-eyebrow{display:inline-flex;gap:7px;padding:6px 10px;border-radius:var(--radius-sm);background:var(--primary-light);color:var(--primary);font-size:10px;font-weight:800}.articles-portal-title{margin:11px 0 7px;font-size:clamp(26px,3vw,38px);letter-spacing:-.04em}.articles-portal-title span{color:var(--primary)}.articles-hero-art{position:absolute;z-index:3;inset:0 4% 0 auto;width:310px;overflow:visible;pointer-events:none}.articles-hero-decor{position:absolute;inset:0;overflow:hidden;border-radius:0 14px 14px 0}.articles-hero-person-image{position:absolute;z-index:2;top:-22px;right:62px;width:198px;height:calc(100% + 22px);max-width:none;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 12px 12px rgba(15,23,42,.16))}
#notification-center-shell{max-width:1400px;margin:0 auto;display:grid;grid-template-columns:360px minmax(0,1fr);min-height:680px;background:var(--bg-card);border:1px solid var(--border);border-radius:18px;overflow:hidden}.notification-legacy{display:none}.notification-center-list-pane{padding:28px 18px;border-right:1px solid var(--border)}.notification-center-heading{display:flex;justify-content:space-between}.notification-center-heading h1{font-size:25px;margin:0}.notification-center-heading p{color:var(--text-secondary);font-size:13px}.notification-center-tabs{display:flex;gap:7px;margin-bottom:18px}.notification-center-tab{padding:8px 10px;border:1px solid var(--border);border-radius:10px;background:var(--bg-subtle)}.notification-center-tab.active{background:var(--primary);color:#fff}.notification-center-list{display:grid;gap:9px}.notification-center-item{display:grid;grid-template-columns:40px minmax(0,1fr);gap:10px;text-align:left;padding:12px;border:1px solid transparent;border-radius:12px;background:var(--bg-subtle);color:var(--text-primary)}.notification-center-item.selected{border-color:var(--primary);background:var(--primary-light)}.notification-center-item.is-read{opacity:.68}.notification-center-item-icon{width:40px;height:40px;border-radius:10px;display:grid;place-items:center;background:var(--primary-light);color:var(--primary)}.notification-center-item-copy strong,.notification-center-item-copy small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.notification-center-item-copy small{margin-top:4px;color:var(--text-secondary);font-size:11px}.notification-center-item time{grid-column:2;font-size:10px;color:var(--text-muted)}.notification-center-detail-pane{padding:28px;background:linear-gradient(135deg,var(--bg-card),var(--primary-light))}.notification-detail-toolbar{display:flex;justify-content:flex-end;margin-bottom:14px}.notification-detail-toolbar button{padding:9px 12px;border:1px solid var(--border);border-radius:10px;background:var(--bg-card)}.notification-detail-eyebrow{color:var(--primary);font-weight:800;font-size:12px}.notification-detail-content-card h2{font-size:29px;line-height:1.25;margin:18px 0 8px}.notification-detail-byline{font-size:12px;color:var(--text-muted);margin-bottom:26px}
@media(max-width:1000px){#notification-center-shell{grid-template-columns:1fr}.notification-center-list-pane{border-right:0;border-bottom:1px solid var(--border)}.notification-center-detail-pane{padding:18px}.notification-detail-art{display:none}}@media(max-width:800px){.articles-hero-art{display:none}.articles-hero-copy{width:100%}}@media(max-width:480px){.notification-center-list-pane{padding:18px 12px}.notification-center-detail-pane{padding:12px}.notification-center-tabs{overflow-x:auto}}

/* Notification character: contained in the right illustration area */
.notification-detail-content-card{position:relative;min-height:560px;max-width:900px;padding:30px 315px 30px 30px;overflow:hidden}.notification-detail-content-card article{position:relative;z-index:2}.notification-detail-art{position:absolute;inset:0 0 0 auto;width:300px;overflow:hidden;pointer-events:none}.notification-detail-character{position:absolute!important;z-index:2;right:-8px!important;bottom:-12px!important;top:auto!important;width:255px!important;height:390px!important;max-width:none!important;object-fit:contain!important;object-position:right bottom!important;filter:drop-shadow(0 10px 12px rgba(15,23,42,.14))}.notification-art-orb{position:absolute;border-radius:50%;background:rgba(16,185,129,.12)}.notification-art-orb-one{width:235px;height:235px;right:-16px;bottom:62px}.notification-art-orb-two{width:110px;height:110px;right:-44px;bottom:-30px;background:rgba(190,242,100,.24)}.notification-art-dots{position:absolute;width:62px;height:62px;background-image:radial-gradient(rgba(16,185,129,.42) 1.5px,transparent 1.6px);background-size:13px 13px}.notification-art-dots-top{top:78px;right:16px}.notification-art-dots-bottom{bottom:115px;left:8px}@media(max-width:1000px){.notification-detail-content-card{min-height:0;padding:28px}.notification-detail-art{display:none}}

/* Refine notification illustration balance */
.notification-detail-content-card{min-height:500px!important;max-width:920px!important;padding:30px 285px 30px 30px!important;overflow:hidden!important}.notification-detail-art{width:275px!important}.notification-detail-character{right:-18px!important;bottom:-8px!important;width:275px!important;height:425px!important}.notification-art-orb-one{width:225px!important;height:225px!important;right:-22px!important;bottom:76px!important}.notification-art-orb-two{width:100px!important;height:100px!important;right:-36px!important;bottom:-26px!important}.notification-art-dots-top{top:64px!important;right:10px!important}.notification-art-dots-bottom{bottom:105px!important;left:3px!important}
@media(max-width:1000px){.notification-detail-content-card{min-height:0!important;padding:28px!important}.notification-detail-art{display:none!important}}

/* Notification Center restored presentation */
#notification-center-shell{max-width:1440px;min-height:700px;grid-template-columns:390px minmax(0,1fr);background:#111;border-color:#242424;box-shadow:0 18px 50px rgba(0,0,0,.25)}.notification-center-list-pane{padding:28px 20px;background:#111;border-right:1px solid #292929}.notification-center-heading h1{color:#f8fafc;font-size:28px}.notification-center-heading p{color:#94a3b8}.notification-count{color:#34d399;font-weight:800}.notification-center-tabs{gap:8px}.notification-center-tab{background:#191919;border-color:#303030;color:#a3a3a3;font-weight:700}.notification-center-tab.active{background:#00b96b;border-color:#00b96b;color:#fff}.notification-center-item{background:#191919;border-color:transparent;color:#f8fafc;padding:15px}.notification-center-item:hover{background:#202020}.notification-center-item.selected{background:linear-gradient(135deg,rgba(0,185,107,.18),rgba(0,185,107,.05));border-color:#00b96b;box-shadow:inset 3px 0 #00b96b}.notification-center-item.is-read{opacity:.72}.notification-center-item-icon{background:rgba(0,185,107,.14);color:#34d399}.notification-center-item-copy strong{font-size:14px}.notification-center-item-copy small,.notification-center-item time{color:#94a3b8}.notification-center-detail-pane{position:relative;padding:34px 40px;background:radial-gradient(circle at 86% 78%,rgba(16,185,129,.18),transparent 34%),linear-gradient(135deg,#071b16,#03110e);color:#f8fafc}.notification-detail-toolbar{position:relative;z-index:5}.notification-detail-toolbar button{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.14);color:#e5e7eb}.notification-detail-content-card{position:relative;min-height:590px;max-width:none!important;padding:40px 360px 40px 38px!important;background:transparent!important;border:0!important;box-shadow:none!important;overflow:hidden!important}.notification-detail-eyebrow{color:#34d399;font-size:13px}.notification-detail-content-card h2{color:#fff;font-size:38px;max-width:560px}.notification-detail-byline{color:#a7b8b2}.notification-detail-content-card article{color:#f1f5f9;line-height:1.75;font-size:16px;max-width:580px}.notification-detail-art{display:block!important;position:absolute!important;inset:0 0 0 auto!important;width:355px!important;overflow:hidden!important}.notification-detail-character{display:block!important;position:absolute!important;z-index:3;right:-18px!important;bottom:-26px!important;top:auto!important;width:315px!important;height:470px!important;object-fit:contain!important;object-position:right bottom!important}.notification-art-orb-one{width:275px!important;height:275px!important;right:5px!important;bottom:84px!important;background:rgba(110,231,183,.17)!important}.notification-art-orb-two{width:150px!important;height:150px!important;right:-48px!important;bottom:-35px!important;background:rgba(132,204,22,.22)!important}.notification-art-dots-top{top:88px!important;right:22px!important}.notification-art-dots-bottom{bottom:128px!important;left:10px!important}@media(max-width:1000px){#notification-center-shell{grid-template-columns:1fr;min-height:0}.notification-center-list-pane{border-right:0;border-bottom:1px solid #292929}.notification-center-detail-pane{padding:22px}.notification-detail-content-card{min-height:0;padding:24px!important}.notification-detail-art{display:none!important}}@media(prefers-color-scheme:light){[data-theme="light"] #notification-center-shell{background:#fff;border-color:var(--border)}[data-theme="light"] .notification-center-list-pane{background:#fff;border-color:var(--border)}[data-theme="light"] .notification-center-heading h1,[data-theme="light"] .notification-center-item{color:#111}[data-theme="light"] .notification-center-item{background:#f8fafc}[data-theme="light"] .notification-center-detail-pane{background:radial-gradient(circle at 86% 78%,rgba(16,185,129,.15),transparent 34%),#f6fffb}[data-theme="light"] .notification-detail-content-card h2,[data-theme="light"] .notification-detail-content-card article{color:#10201b}[data-theme="light"] .notification-detail-byline{color:#64748b}}

/* Restore Articles portal surfaces and hero decoration */
.app-body{background:var(--bg-base)}#page-about.page-container{background:var(--bg-card);border-radius:20px;padding:24px;box-shadow:var(--shadow-sm)}[data-theme="dark"] #page-about.page-container{background:#050505;box-shadow:0 0 0 1px #171717}.articles-portal-container{max-width:var(--max-width);margin:0 auto}.articles-header-section{position:relative;overflow:visible;border:0;border-radius:0;background:transparent;box-shadow:none}.articles-news-hero{position:relative;display:flex;align-items:center;min-height:184px;padding:28px 40px;overflow:hidden;border:1px solid var(--border);border-radius:18px;background:linear-gradient(110deg,var(--bg-card) 46%,#ecfdf5 100%);box-shadow:var(--shadow-sm)}[data-theme="dark"] .articles-news-hero{background:linear-gradient(110deg,#111 46%,#08281e 100%);border-color:#242424}.articles-hero-copy{position:relative;z-index:3;width:min(64%,680px)}.articles-hero-art{position:absolute;z-index:2;inset:0 3% 0 auto;width:330px;overflow:visible;pointer-events:none}.articles-hero-decor{position:absolute;inset:0;overflow:hidden;border-radius:0 18px 18px 0}.articles-art-orb{position:absolute;border-radius:50%;background:rgba(16,185,129,.15)}.articles-art-orb-one{width:220px;height:220px;right:4px;bottom:-110px}.articles-art-orb-two{width:110px;height:110px;right:198px;top:-42px;background:rgba(20,184,166,.14)}.articles-art-dots{position:absolute;top:20px;right:24px;width:82px;height:64px;background-image:radial-gradient(rgba(16,185,129,.48) 1.5px,transparent 1.7px);background-size:13px 13px;transform:rotate(-12deg)}.articles-hero-person-image{position:absolute;z-index:3;right:52px;bottom:-10px;width:205px;height:218px;max-width:none;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 10px 10px rgba(15,23,42,.14))}[data-theme="dark"] .articles-art-orb{background:rgba(52,211,153,.16)}[data-theme="dark"] .articles-art-orb-two{background:rgba(45,212,191,.14)}@media(max-width:768px){#page-about.page-container{padding:16px}.articles-news-hero{padding:26px 22px;min-height:164px}.articles-hero-copy{width:74%}.articles-hero-art{width:260px;right:0;opacity:.46}.articles-hero-person-image{right:30px;width:172px;height:190px}.articles-portal-desc{max-width:92%}}@media(max-width:480px){#page-about.page-container{padding:0;background:transparent;box-shadow:none}.articles-news-hero{padding:24px 18px}.articles-hero-copy{width:100%}.articles-hero-art{display:none}}

/* Restore the original dark-green notification reading palette */
.notification-center-detail-pane{padding:30px 34px 36px!important;background:radial-gradient(circle at 86% 78%,rgba(16,185,129,.18),transparent 34%),linear-gradient(135deg,#071b16,#03110e)!important}.notification-detail-content-card{min-height:570px!important;padding:38px 330px 38px 38px!important;background:linear-gradient(145deg,#10251f,#091712)!important;border:1px solid rgba(110,231,183,.16)!important;border-radius:16px!important;box-shadow:0 18px 35px rgba(0,0,0,.28)!important}.notification-detail-content-card h2,.notification-detail-content-card article{color:#f8fafc!important}.notification-detail-byline{color:#a7b8b2!important}.notification-detail-art{right:0!important;width:320px!important}.notification-detail-character{right:-18px!important;bottom:-8px!important;width:315px!important;height:455px!important}.notification-art-orb-one{width:230px!important;height:230px!important;right:18px!important;bottom:80px!important}.notification-art-dots-top{right:18px!important}.notification-art-dots-bottom{left:0!important}@media(max-width:1000px){.notification-center-detail-pane{padding:18px!important}.notification-detail-content-card{min-height:0!important;padding:28px!important}}

/* Notification reading palette by theme */
[data-theme="light"] .notification-center-detail-pane{background:radial-gradient(circle at 86% 78%,rgba(16,185,129,.15),transparent 34%),#f7fffb!important}[data-theme="light"] .notification-detail-content-card{background:linear-gradient(145deg,#ffffff,#f1fff8)!important;border-color:rgba(16,185,129,.20)!important;box-shadow:0 18px 35px rgba(15,23,42,.12)!important}[data-theme="light"] .notification-detail-content-card h2,[data-theme="light"] .notification-detail-content-card article{color:#10201b!important}[data-theme="light"] .notification-detail-byline{color:#64748b!important}[data-theme="light"] .notification-detail-toolbar button{background:#fff!important;border-color:#d1fae5!important;color:#14532d!important}
[data-theme="dark"] .notification-center-detail-pane{background:#111111!important}[data-theme="dark"] .notification-detail-content-card{background:linear-gradient(145deg,#10251f,#091712)!important;border-color:rgba(110,231,183,.16)!important}[data-theme="dark"] .notification-detail-content-card h2,[data-theme="dark"] .notification-detail-content-card article{color:#f8fafc!important}[data-theme="dark"] .notification-detail-byline{color:#a7b8b2!important}

/* Keep read notifications distinguishable without fading their text. */
.notification-center-item.is-read{opacity:1;background:#171717;border-color:#222}
[data-theme="light"] .notification-center-item.is-read{background:#f1f5f9;border-color:#e2e8f0}

/* Light theme: override the restored dark notification list palette. */
[data-theme="light"] #notification-center-shell{background:#fff!important;border-color:#e2e8f0!important}
[data-theme="light"] .notification-center-list-pane{background:#fff!important;border-color:#e2e8f0!important}
[data-theme="light"] .notification-center-heading h1{color:#111827!important}
[data-theme="light"] .notification-center-heading p{color:#64748b!important}
[data-theme="light"] .notification-center-tab{background:#f8fafc!important;border-color:#e2e8f0!important;color:#475569!important}
[data-theme="light"] .notification-center-tab.active{background:#00b96b!important;border-color:#00b96b!important;color:#fff!important}
[data-theme="light"] .notification-center-item{background:#f8fafc!important;color:#111827!important}
[data-theme="light"] .notification-center-item:hover{background:#f1f5f9!important}
[data-theme="light"] .notification-center-item.selected{background:#ecfdf5!important;border-color:#00b96b!important}
[data-theme="light"] .notification-center-item-copy small,[data-theme="light"] .notification-center-item time{color:#64748b!important}

/* Articles hero: compact frame, larger anchored character */
#page-about.page-container{padding:16px!important}.articles-news-hero{min-height:210px!important;padding:28px 34px!important}.articles-hero-copy{width:min(60%,650px)!important}.articles-hero-art{inset:0 2% 0 auto!important;width:370px!important}.articles-hero-decor{border-radius:0 18px 18px 0!important}.articles-hero-person-image{right:34px!important;bottom:-14px!important;width:285px!important;height:270px!important;object-position:center bottom!important}.articles-art-orb-one{width:245px!important;height:245px!important;right:0!important;bottom:-125px!important}.articles-art-orb-two{width:125px!important;height:125px!important;right:220px!important;top:-48px!important}.articles-art-dots{top:22px!important;right:26px!important;width:92px!important;height:70px!important}@media(max-width:768px){#page-about.page-container{padding:12px!important}.articles-news-hero{min-height:180px!important;padding:24px 20px!important}.articles-hero-copy{width:70%!important}.articles-hero-art{width:285px!important}.articles-hero-person-image{right:18px!important;bottom:-12px!important;width:205px!important;height:210px!important}}

/* News hero matched to the approved compact reference */
.articles-news-hero{min-height:208px!important;padding:29px 34px!important;overflow:visible!important}.articles-hero-copy{width:min(64%,720px)!important}.articles-hero-art{height:208px!important;top:0!important;bottom:auto!important;width:340px!important;right:2.5%!important}.articles-hero-decor{overflow:hidden!important;border-radius:0 18px 18px 0!important}.articles-hero-person-image{right:36px!important;bottom:-1px!important;top:-31px!important;width:242px!important;height:240px!important;object-fit:contain!important;object-position:center bottom!important}.articles-art-orb-one{width:210px!important;height:210px!important;right:0!important;bottom:-100px!important}.articles-art-orb-two{width:105px!important;height:105px!important;right:205px!important;top:-35px!important}.articles-art-dots{top:22px!important;right:22px!important;width:82px!important;height:64px!important}@media(max-width:768px){.articles-news-hero{min-height:170px!important;padding:24px 20px!important;overflow:hidden!important}.articles-hero-art{height:170px!important;width:270px!important}.articles-hero-person-image{top:-18px!important;bottom:0!important;right:20px!important;width:190px!important;height:188px!important}}

/* Final compact article hero: frame fits character body */
.articles-news-hero{min-height:174px!important;height:174px!important;padding:24px 30px!important}.articles-hero-art{height:174px!important;width:315px!important;right:3%!important}.articles-hero-person-image{top:-38px!important;bottom:0!important;right:34px!important;width:225px!important;height:212px!important}.articles-art-orb-one{width:190px!important;height:190px!important;bottom:-92px!important}.articles-art-orb-two{width:98px!important;height:98px!important;top:-34px!important}.articles-art-dots{top:20px!important;width:78px!important;height:58px!important}@media(max-width:768px){.articles-news-hero{height:164px!important;min-height:164px!important}.articles-hero-art{height:164px!important}.articles-hero-person-image{top:-18px!important;height:182px!important;width:185px!important}}

/* Final responsive overrides: notification center and articles portal. */
@media (max-width:768px){
  #notification-center-shell{grid-template-columns:1fr!important;min-height:0!important;border-radius:16px!important}
  .notification-center-list-pane,.notification-center-detail-pane{padding:16px!important}
  .notification-center-list-pane{border-right:0!important;border-bottom:1px solid var(--border)!important}
  .notification-detail-content-card{min-height:0!important;padding:24px!important}
  .notification-detail-art{display:none!important}
  .notification-detail-content-card h2{font-size:clamp(28px,9vw,38px)!important;line-height:1.15!important;max-width:100%!important}
  .notification-center-heading h1{font-size:25px!important}
  .notification-center-heading p{font-size:12px!important}
  .notification-center-tabs{overflow-x:auto!important;white-space:nowrap!important;padding-bottom:2px}
  .notification-center-tab{flex:0 0 auto!important;font-size:12px!important;padding:8px 10px!important}
  .notification-center-item{padding:12px!important}
  .notification-center-item-copy strong{font-size:13px!important}
  .notification-center-item-copy small{font-size:12px!important}
  .notification-center-item time{font-size:11px!important}

  #page-about.page-container{padding:12px!important}
  .articles-news-hero{height:auto!important;min-height:0!important;padding:22px 18px!important;overflow:hidden!important}
  .articles-hero-copy{width:100%!important}
  .articles-hero-art{display:none!important}
  .articles-portal-title,.articles-portal-desc{max-width:100%!important}
  .articles-portal-title{font-size:clamp(30px,10vw,42px)!important;line-height:1.05!important;overflow-wrap:anywhere}
  .articles-portal-desc{font-size:15px!important;line-height:1.55!important}
  .articles-chips-scroll{overflow-x:auto!important;white-space:nowrap!important;-webkit-overflow-scrolling:touch}
}

@media (max-width:480px){
  html,body,.app-body,#page-about.page-container,#page-notifications{max-width:100%;overflow-x:hidden}
  .notification-center-list-pane,.notification-center-detail-pane{padding:14px!important}
  .notification-detail-content-card{padding:14px!important}
  .notification-detail-toolbar{margin-bottom:10px!important}
  .notification-detail-toolbar button{font-size:12px!important;padding:8px 10px!important}
  .notification-detail-content-card h2{font-size:clamp(28px,9vw,34px)!important}
  .notification-center-item{grid-template-columns:38px minmax(0,1fr)!important;gap:9px!important;padding:12px!important}
  .notification-center-item-icon{width:38px!important;height:38px!important}
  .articles-news-hero{padding:20px 16px!important}
}

/* ─── Account upgrade contact page: isolated route styling ─── */
.upgrade-contact-page{max-width:1060px;margin:0 auto;background:var(--bg-card);border:1px solid var(--border);border-radius:18px;overflow:hidden;box-shadow:var(--shadow-sm)}
.upgrade-contact-hero{position:relative;min-height:264px;padding:34px 38px;display:flex;align-items:center;overflow:hidden;background:linear-gradient(110deg,var(--bg-card) 0%,var(--bg-card) 58%,var(--primary-light) 100%)}
.upgrade-contact-copy{position:relative;z-index:2;width:59%;max-width:590px}.upgrade-contact-kicker{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border-radius:7px;background:var(--primary-light);color:var(--primary);font-size:11px;font-weight:800}.upgrade-contact-copy h1{margin:12px 0 8px;font-size:31px;line-height:1.18;letter-spacing:-1px}.upgrade-contact-copy h1 strong{color:var(--primary)}.upgrade-contact-copy>p{max-width:500px;color:var(--text-secondary);font-size:12px;line-height:1.6}
.upgrade-benefit-chips{display:flex;gap:8px;margin-top:20px}.upgrade-benefit-chips span{display:grid;grid-template-columns:22px 1fr;column-gap:7px;min-width:0;flex:1;padding:9px 8px;border:1px solid var(--border);border-radius:9px;background:var(--bg-card);font-size:9px;line-height:1.25}.upgrade-benefit-chips i{grid-row:span 2;color:var(--primary);font-size:15px}.upgrade-benefit-chips b{font-size:9px}.upgrade-benefit-chips small{color:var(--text-secondary);font-size:8px}
.upgrade-contact-art{position:absolute;z-index:1;right:15px;bottom:-38px;width:38%;height:100%;display:flex;align-items:flex-end;justify-content:center}.upgrade-contact-art img{position:relative;z-index:2;width:min(300px,100%);height:290px;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 14px 16px rgba(0,70,40,.15))}.upgrade-art-orb{position:absolute;border-radius:50%;background:rgba(0,185,107,.10)}.orb-one{width:230px;height:230px;right:5px;bottom:1px}.orb-two{width:160px;height:160px;right:130px;bottom:-65px;background:rgba(0,185,107,.06)}
.upgrade-contact-content{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(245px,.85fr);gap:20px;padding:25px 38px 32px}.upgrade-section-title h2,.upgrade-contact-perks h2{font-size:15px;letter-spacing:-.2px}.upgrade-section-title p{font-size:10px;color:var(--text-secondary);margin-top:2px}.upgrade-channel-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:13px}.upgrade-channel-card{display:flex;flex-direction:column;align-items:center;min-height:190px;padding:18px 14px 12px;border:1px solid var(--border);border-radius:11px;text-align:center;background:linear-gradient(145deg,var(--bg-card),#f1f5ff);transition:transform .2s,box-shadow .2s}.upgrade-channel-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-md)}.upgrade-channel-icon,.upgrade-zalo-mark{display:grid;place-items:center;width:35px;height:35px;margin-bottom:9px;border-radius:50%;background:#4f6ff5;color:#fff;font-size:20px}.upgrade-zalo-mark{background:#fff;color:#437cf1;border:1px solid #cbd8ff;font-size:10px;font-weight:800}.upgrade-channel-card h3{font-size:12px}.upgrade-channel-card p{margin:6px 0 13px;color:var(--text-secondary);font-size:10px;line-height:1.45}.upgrade-channel-card span{width:100%;margin-top:auto;padding:8px;border-radius:6px;background:#5947ff;color:#fff;font-size:10px;font-weight:700}.upgrade-contact-perks{padding:17px;border-radius:12px;background:linear-gradient(145deg,var(--primary-light),#e5fff1);border:1px solid rgba(0,185,107,.10)}.upgrade-contact-perks h2{color:var(--primary)}.upgrade-contact-perks ul{display:grid;gap:10px;margin:14px 0;list-style:none}.upgrade-contact-perks li{display:flex;gap:7px;font-size:10px;line-height:1.35}.upgrade-contact-perks li i{color:var(--primary)}.upgrade-contact-perks blockquote{padding:10px;border-radius:8px;background:rgba(255,255,255,.55);color:var(--text-secondary);font-size:10px;line-height:1.5}.upgrade-contact-perks blockquote i{color:var(--primary)}
[data-theme="dark"] .upgrade-contact-hero{background:linear-gradient(110deg,var(--bg-card) 0%,var(--bg-card) 58%,rgba(0,185,107,.10) 100%)}[data-theme="dark"] .upgrade-channel-card{background:linear-gradient(145deg,var(--bg-card),#172018)}[data-theme="dark"] .upgrade-contact-perks{background:linear-gradient(145deg,rgba(0,185,107,.15),rgba(0,185,107,.08))}[data-theme="dark"] .upgrade-contact-perks blockquote{background:rgba(255,255,255,.06)}
@media(max-width:760px){.upgrade-contact-hero{min-height:0;padding:27px 22px}.upgrade-contact-copy{width:100%;max-width:none}.upgrade-contact-art{opacity:.17;right:-8px;width:58%;pointer-events:none}.upgrade-benefit-chips{max-width:540px}.upgrade-contact-content{grid-template-columns:1fr;padding:22px}.upgrade-contact-perks{order:-1}.upgrade-channel-grid{max-width:540px}}
@media(max-width:480px){#page-upgrade.page-container{padding:10px!important}.upgrade-contact-page{border-radius:13px}.upgrade-contact-hero{padding:23px 17px}.upgrade-contact-copy h1{font-size:25px}.upgrade-contact-copy>p{font-size:11px}.upgrade-benefit-chips{display:grid;grid-template-columns:1fr 1fr}.upgrade-benefit-chips span:last-child{grid-column:1/-1}.upgrade-contact-art{display:none}.upgrade-contact-content{padding:18px 15px}.upgrade-channel-grid{grid-template-columns:1fr;gap:10px}.upgrade-channel-card{min-height:165px}.upgrade-contact-perks{padding:15px}}

/* Upgrade page desktop scale adjustment */
@media (min-width: 761px) {
  .upgrade-contact-page { max-width: 1240px; }
  .upgrade-contact-hero { min-height: 342px; padding: 42px 48px; }
  .upgrade-contact-copy { max-width: 670px; }
  .upgrade-contact-copy h1 { margin-top: 14px; font-size: 39px; }
  .upgrade-contact-copy > p { max-width: 590px; font-size: 14px; }
  .upgrade-contact-kicker { font-size: 12px; padding: 6px 12px; }
  .upgrade-benefit-chips { gap: 11px; margin-top: 25px; }
  .upgrade-benefit-chips span { padding: 12px 11px; grid-template-columns: 26px 1fr; font-size: 11px; }
  .upgrade-benefit-chips i { font-size: 18px; }
  .upgrade-benefit-chips b { font-size: 11px; }
  .upgrade-benefit-chips small { font-size: 10px; }
  .upgrade-contact-art { width: 45%; height: 110%; right: 22px; bottom: -42px; }
  .upgrade-contact-art img { width: min(390px, 100%); height: 390px; }
  .orb-one { width: 300px; height: 300px; }
  .orb-two { width: 210px; height: 210px; }
  .upgrade-contact-content { grid-template-columns: minmax(0, 1.7fr) minmax(290px, .9fr); gap: 28px; padding: 32px 48px 40px; }
  .upgrade-section-title h2, .upgrade-contact-perks h2 { font-size: 19px; }
  .upgrade-section-title p { font-size: 12px; }
  .upgrade-channel-grid { gap: 18px; margin-top: 17px; }
  .upgrade-channel-card { min-height: 235px; padding: 23px 18px 15px; }
  .upgrade-channel-icon, .upgrade-zalo-mark { width: 44px; height: 44px; font-size: 24px; }
  .upgrade-zalo-mark { font-size: 12px; }
  .upgrade-channel-card h3 { font-size: 15px; }
  .upgrade-channel-card p, .upgrade-channel-card span { font-size: 12px; }
  .upgrade-channel-card span { padding: 10px; }
  .upgrade-contact-perks { padding: 23px; }
  .upgrade-contact-perks ul { gap: 13px; margin: 18px 0; }
  .upgrade-contact-perks li, .upgrade-contact-perks blockquote { font-size: 12px; }
  .upgrade-contact-perks blockquote { padding: 13px; }
}
/* Study Space */
.study-space-shell{max-width:1440px;margin:0 auto;padding:28px 32px 42px}.study-space-header{display:flex;justify-content:space-between;gap:24px;padding:30px 34px;border:1px solid var(--border);border-radius:24px;background:linear-gradient(120deg,var(--card),color-mix(in srgb,var(--primary) 8%,var(--card)));margin-bottom:18px}.study-space-eyebrow{display:inline-flex;gap:8px;align-items:center;color:var(--primary);font-weight:800;font-size:12px;letter-spacing:.05em}.study-space-header h1{margin:10px 0 8px;font-size:clamp(28px,4vw,42px);line-height:1.1}.study-space-header p{margin:0;max-width:690px;color:var(--text-muted);line-height:1.6}.study-space-summary{min-width:120px;text-align:center;align-self:center;padding:14px;border:1px solid var(--border);border-radius:16px;background:var(--card)}.study-space-summary b{display:block;font-size:28px;color:var(--primary)}.study-space-summary span{font-size:12px;color:var(--text-muted)}.study-space-toolbar{padding:18px;border:1px solid var(--border);border-radius:20px;background:var(--card);margin-bottom:18px}.study-space-search{display:flex;align-items:center;gap:10px;padding:0 14px;border:1px solid var(--border);border-radius:12px;background:var(--muted);color:var(--text-muted)}.study-space-search input{width:100%;height:46px;border:0;outline:0;background:transparent;color:var(--foreground);font:inherit}.study-space-filter-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.study-space-filter{border:1px solid var(--border);border-radius:999px;background:var(--card);color:var(--foreground);padding:8px 12px;font:inherit;font-size:12px;cursor:pointer}.study-space-filter.active{background:var(--primary);border-color:var(--primary);color:var(--primary-foreground)}.study-space-article-toggle{display:inline-flex;gap:8px;align-items:center;margin-top:14px;font-size:13px;cursor:pointer}.study-space-article-toggle input{accent-color:var(--primary)}.study-space-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(300px,.8fr);gap:18px}.study-space-subject-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;align-content:start}.study-space-subject-card{min-height:180px;display:flex;flex-direction:column;align-items:flex-start;gap:10px;text-align:left;border:1px solid var(--border);border-radius:18px;padding:17px;background:var(--card);color:var(--foreground);cursor:pointer;font:inherit;transition:transform .16s,border-color .16s,box-shadow .16s}.study-space-subject-card:hover,.study-space-subject-card.selected{transform:translateY(-2px);border-color:var(--primary);box-shadow:0 12px 24px color-mix(in srgb,var(--primary) 14%,transparent)}.study-space-card-top{width:100%;display:flex;justify-content:space-between;gap:8px}.study-space-card-top b{color:var(--primary);font-size:13px}.study-space-card-top small,.study-space-card-meta{color:var(--text-muted);font-size:12px}.study-space-subject-card>strong{font-size:15px;line-height:1.4}.study-space-card-status{margin-top:auto;font-size:12px;color:var(--text-muted)}.study-space-card-status.has-content{color:var(--success)}.study-space-detail{position:sticky;top:20px;align-self:start;padding:25px;border:1px solid var(--border);border-radius:20px;background:var(--card)}.study-space-detail-code{display:inline-block;padding:6px 10px;border-radius:8px;background:color-mix(in srgb,var(--primary) 12%,transparent);color:var(--primary);font-weight:800;font-size:12px}.study-space-detail h2{font-size:25px;line-height:1.2;margin:14px 0 10px}.study-space-detail-meta,.study-space-detail-copy{color:var(--text-muted);line-height:1.6}.study-space-article-list{display:grid;gap:10px;margin-top:20px}.study-space-article-list article{display:flex;gap:10px;padding:12px;border:1px solid var(--border);border-radius:12px}.study-space-article-list article>i{color:var(--primary);padding-top:3px}.study-space-article-list strong{font-size:14px}.study-space-article-list p{margin:4px 0 0;color:var(--text-muted);font-size:12px;line-height:1.45}.study-space-no-articles,.study-space-no-selection,.study-space-empty{padding:25px;color:var(--text-muted);text-align:center}.study-space-no-articles i{display:block;font-size:26px;margin-bottom:8px;color:var(--primary)}
@media (max-width:768px){.study-space-shell{padding:18px 14px 28px}.study-space-header{padding:22px;display:block}.study-space-summary{margin-top:18px;width:100%}.study-space-layout{grid-template-columns:1fr}.study-space-detail{position:static}.study-space-subject-grid{grid-template-columns:1fr}.study-space-filter-row{max-height:114px;overflow:hidden}.study-space-subject-card{min-height:150px}}

/* Study Hub redesign — intentionally isolated to the Study Space page */
#study-space-root .study-hub-shell{max-width:1500px;margin:0 auto;padding:26px 28px 48px;display:grid;grid-template-columns:minmax(0,1fr) 276px;gap:18px;color:var(--foreground)}
#study-space-root .study-hub-main{min-width:0;display:grid;gap:18px}#study-space-root .study-hub-hero{position:relative;overflow:hidden;min-height:280px;padding:38px 42px;border:1px solid color-mix(in srgb,var(--primary) 14%,var(--border));border-radius:24px;background:linear-gradient(118deg,color-mix(in srgb,var(--primary) 5%,var(--card)),color-mix(in srgb,var(--success) 13%,var(--card)));display:grid;grid-template-columns:minmax(0,1.12fr) minmax(260px,.88fr)}
#study-space-root .study-hub-hero-copy{position:relative;z-index:2;max-width:620px}#study-space-root .study-hub-kicker{display:inline-flex;gap:8px;align-items:center;color:var(--primary);font-size:12px;font-weight:800;letter-spacing:.06em}#study-space-root .study-hub-hero h1{margin:18px 0 12px;font-size:clamp(31px,3vw,43px);line-height:1.18;letter-spacing:-.035em}#study-space-root .study-hub-hero h1 em{font-style:normal;color:var(--primary)}#study-space-root .study-hub-hero p{max-width:520px;margin:0;color:var(--text-muted);line-height:1.75;font-size:14px}#study-space-root .study-hub-hero-actions{display:flex;align-items:center;gap:16px;margin-top:22px}#study-space-root .study-hub-hero-actions button,#study-space-root .study-hub-support button{border:0;border-radius:12px;background:var(--primary);color:var(--primary-foreground);padding:11px 15px;font:inherit;font-weight:750;cursor:pointer;box-shadow:0 10px 20px color-mix(in srgb,var(--primary) 20%,transparent)}#study-space-root .study-hub-hero-actions span{font-size:12px;color:var(--text-muted)}#study-space-root .study-hub-hero-actions b{color:var(--primary)}
#study-space-root .study-hub-hero-art{position:relative;min-height:210px}#study-space-root .study-hub-art-orb{position:absolute;border-radius:50%;background:color-mix(in srgb,var(--primary) 15%,transparent)}#study-space-root .orb-one{width:260px;height:260px;right:28px;bottom:-95px}.study-hub-art-orb.orb-two{width:145px;height:145px;right:165px;top:8px;background:color-mix(in srgb,var(--success) 18%,transparent)}#study-space-root .study-hub-art-dots{position:absolute;inset:16px 0 0 35%;opacity:.4;background-image:radial-gradient(var(--primary) 1.4px,transparent 1.4px);background-size:12px 12px}#study-space-root .study-hub-art-placeholder{position:absolute;right:58px;bottom:16px;width:180px;height:185px;border:1px dashed color-mix(in srgb,var(--primary) 42%,var(--border));border-radius:46% 46% 24px 24px;background:color-mix(in srgb,var(--card) 55%,transparent);display:grid;place-content:center;text-align:center;color:var(--primary);gap:10px;z-index:1}#study-space-root .study-hub-art-placeholder i{font-size:57px}#study-space-root .study-hub-art-placeholder span{font-size:11px;font-weight:700;line-height:1.45}#study-space-root .study-hub-hero-stat{position:absolute;z-index:2;right:0;top:21px;padding:16px 20px;min-width:105px;border:1px solid var(--border);border-radius:15px;background:var(--card);text-align:center;box-shadow:0 10px 24px color-mix(in srgb,var(--foreground) 6%,transparent)}#study-space-root .study-hub-hero-stat b{display:block;color:var(--primary);font-size:30px}#study-space-root .study-hub-hero-stat span{font-size:11px;color:var(--text-muted)}
#study-space-root .study-hub-catalog{padding:20px;border:1px solid var(--border);border-radius:20px;background:var(--card)}#study-space-root .study-hub-search{display:flex;align-items:center;gap:11px;border:1px solid var(--border);border-radius:13px;padding:0 14px;color:var(--text-muted);background:var(--muted)}#study-space-root .study-hub-search input{width:100%;height:48px;border:0;outline:0;background:transparent;color:var(--foreground);font:inherit}#study-space-root .study-hub-filter-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:14px}#study-space-root .study-space-filter-row{display:flex;flex-wrap:wrap;gap:8px}#study-space-root .study-space-filter{border:1px solid var(--border);border-radius:999px;background:var(--card);color:var(--foreground);padding:9px 12px;font:inherit;font-size:12px;cursor:pointer}#study-space-root .study-space-filter.active{background:var(--primary);border-color:var(--primary);color:var(--primary-foreground)}#study-space-root .study-hub-more-filter{padding:9px 12px;border:1px solid var(--border);border-radius:999px;background:transparent;color:var(--text-muted);font:inherit;font-size:12px;white-space:nowrap;cursor:pointer}#study-space-root .study-hub-list-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;font-size:12px;color:var(--text-muted)}#study-space-root .study-space-article-toggle{display:inline-flex;align-items:center;gap:8px;color:var(--foreground);cursor:pointer}#study-space-root .study-space-article-toggle input{accent-color:var(--primary)}
#study-space-root .study-hub-subject-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}#study-space-root .study-hub-subject-card{position:relative;min-height:232px;padding:17px;border:1px solid var(--border);border-radius:18px;background:var(--card);color:var(--foreground);font:inherit;text-align:left;display:grid;grid-template-columns:44px 1fr;grid-template-rows:auto auto 1fr auto;column-gap:12px;cursor:pointer;transition:transform .18s,border-color .18s,box-shadow .18s}#study-space-root .study-hub-subject-card:hover{transform:translateY(-3px);border-color:var(--primary);box-shadow:0 15px 28px color-mix(in srgb,var(--primary) 13%,transparent)}#study-space-root .study-hub-subject-icon{grid-row:1/3;width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:color-mix(in srgb,var(--primary) 10%,transparent);color:var(--primary);font-size:18px}#study-space-root .study-hub-subject-top{display:flex;justify-content:space-between;align-items:center;gap:8px}#study-space-root .study-hub-subject-top b{color:var(--primary);font-size:12px}#study-space-root .study-hub-subject-top small{color:var(--text-muted);font-size:11px}#study-space-root .study-hub-subject-card>strong{grid-column:1/-1;margin-top:13px;font-size:15px;line-height:1.45}#study-space-root .study-hub-subject-meta{grid-column:1/-1;margin-top:10px;color:var(--text-muted);font-size:11px;line-height:1.55}#study-space-root .study-hub-subject-foot{grid-column:1/-1;align-self:end;margin-top:14px;display:flex;justify-content:space-between;align-items:center;color:var(--text-muted);font-size:11px}#study-space-root .study-hub-subject-foot>i{display:grid;place-items:center;width:29px;height:29px;border:1px solid var(--border);border-radius:50%;color:var(--primary)}#study-space-root .study-hub-subject-card[data-has-articles="true"] .study-hub-subject-foot span{color:var(--primary)}
#study-space-root .study-hub-ai-panel{align-self:start;position:sticky;top:18px;padding:14px;border:1px solid var(--border);border-radius:20px;background:var(--card);display:grid;gap:9px}#study-space-root .study-hub-ai-heading{padding:7px 5px 10px;border-bottom:1px solid var(--border)}#study-space-root .study-hub-ai-heading span,#study-space-root .study-hub-stats>span,#study-space-root .study-hub-support>div>span{font-size:10px;font-weight:850;letter-spacing:.055em;color:var(--primary)}#study-space-root .study-hub-ai-heading p{margin:5px 0 0;font-size:12px;color:var(--text-muted)}#study-space-root .study-hub-ai-tool{width:100%;display:grid;grid-template-columns:36px 1fr 21px;align-items:center;gap:10px;padding:10px;border:1px solid color-mix(in srgb,var(--border) 80%,transparent);border-radius:13px;background:transparent;color:var(--foreground);text-align:left;font:inherit;cursor:pointer;transition:background .16s,transform .16s}#study-space-root .study-hub-ai-tool:hover{background:var(--muted);transform:translateX(2px)}#study-space-root .study-hub-ai-tool>i{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;background:color-mix(in srgb,var(--primary) 10%,transparent);color:var(--primary)}#study-space-root .study-hub-ai-tool span{display:grid;gap:3px}#study-space-root .study-hub-ai-tool b{font-size:12px}#study-space-root .study-hub-ai-tool small{font-size:10px;line-height:1.35;color:var(--text-muted)}#study-space-root .study-hub-ai-tool em{font-style:normal;color:var(--primary);font-size:11px}.study-hub-ai-tool.violet>i{color:#7c3aed;background:#f0e9ff}.study-hub-ai-tool.orange>i{color:#ea580c;background:#fff0df}.study-hub-ai-tool.rose>i{color:#e11d48;background:#ffe7ee}
#study-space-root .study-hub-support{min-height:190px;padding:28px 30px;border:1px solid color-mix(in srgb,var(--success) 25%,var(--border));border-radius:21px;background:linear-gradient(105deg,color-mix(in srgb,var(--success) 7%,var(--card)),var(--card));display:flex;justify-content:space-between;gap:20px;overflow:hidden}#study-space-root .study-hub-support h2{margin:8px 0;font-size:23px}#study-space-root .study-hub-support p{max-width:440px;margin:0 0 16px;color:var(--text-muted);font-size:13px;line-height:1.55}#study-space-root .study-hub-support-visual{position:relative;min-width:190px;display:grid;place-items:center;color:var(--primary)}#study-space-root .study-hub-support-visual i:first-child{font-size:95px;filter:drop-shadow(0 12px 10px color-mix(in srgb,var(--primary) 20%,transparent))}#study-space-root .study-hub-support-visual i:last-child{position:absolute;right:13px;bottom:15px;padding:12px;border-radius:50%;background:var(--card);font-size:22px;color:var(--success)}#study-space-root .study-hub-stats{margin-top:4px;padding:14px;border-radius:14px;background:color-mix(in srgb,var(--primary) 5%,var(--card));display:grid;gap:10px}#study-space-root .study-hub-stats>div{display:grid;grid-template-columns:repeat(3,1fr);gap:3px}.study-hub-stats b{color:var(--primary);font-size:17px}.study-hub-stats small{font-size:9px;color:var(--text-muted)}#study-space-root .study-hub-stats button{border:0;border-radius:9px;background:color-mix(in srgb,var(--primary) 10%,transparent);padding:9px;color:var(--primary);font:inherit;font-size:11px;font-weight:750;cursor:pointer}
@media(max-width:1100px){#study-space-root .study-hub-shell{grid-template-columns:1fr}#study-space-root .study-hub-ai-panel{position:static;grid-template-columns:repeat(2,minmax(0,1fr))}#study-space-root .study-hub-ai-heading,#study-space-root .study-hub-stats{grid-column:1/-1}}
@media (max-width: 720px){#study-space-root .study-hub-shell{padding:16px 12px 30px}#study-space-root .study-hub-hero{padding:25px 21px;display:block;min-height:0}#study-space-root .study-hub-hero h1{font-size:34px;line-height:1.14}#study-space-root .study-hub-hero-art{height:125px;margin-top:10px}#study-space-root .study-hub-art-placeholder{right:22px;bottom:-5px;width:115px;height:118px;border-radius:37px 37px 16px 16px}#study-space-root .study-hub-art-placeholder i{font-size:35px}#study-space-root .study-hub-hero-stat{right:5px;top:-1px;padding:10px 12px;min-width:84px}#study-space-root .study-hub-hero-stat b{font-size:22px}#study-space-root .study-hub-filter-row{align-items:flex-start;flex-direction:column}#study-space-root .study-hub-list-meta{align-items:flex-start;flex-direction:column}#study-space-root .study-hub-subject-grid{grid-template-columns:1fr}#study-space-root .study-hub-ai-panel{grid-template-columns:1fr}#study-space-root .study-hub-support{padding:24px 21px;display:block}#study-space-root .study-hub-support-visual{height:100px;margin-top:5px}#study-space-root .study-hub-support-visual i:first-child{font-size:72px}}

/* Study Hub desktop density: ưu tiên danh mục môn học, tránh lãng phí vùng minh hoạ */
@media (min-width: 1101px){
  #study-space-root .study-hub-shell{max-width:none;padding:20px 22px 38px;grid-template-columns:minmax(0,1fr) 248px;gap:16px}
  #study-space-root .study-hub-main{gap:16px}
  #study-space-root .study-hub-hero{min-height:236px;padding:28px 32px;grid-template-columns:minmax(0,1.35fr) minmax(215px,.65fr)}
  #study-space-root .study-hub-hero h1{margin:12px 0 9px;font-size:clamp(30px,2.65vw,40px);line-height:1.12}
  #study-space-root .study-hub-hero p{max-width:610px;line-height:1.6}
  #study-space-root .study-hub-hero-actions{margin-top:16px}
  #study-space-root .study-hub-hero-art{min-height:175px}
  #study-space-root .orb-one{width:220px;height:220px;right:8px;bottom:-76px}
  #study-space-root .study-hub-art-orb.orb-two{width:120px;height:120px;right:135px;top:3px}
  #study-space-root .study-hub-art-placeholder{right:36px;bottom:4px;width:150px;height:154px}
  #study-space-root .study-hub-art-placeholder i{font-size:46px}
  #study-space-root .study-hub-hero-stat{top:10px;padding:11px 14px;min-width:90px}
  #study-space-root .study-hub-hero-stat b{font-size:25px}
  #study-space-root .study-hub-catalog{padding:17px}
  #study-space-root .study-hub-subject-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
  #study-space-root .study-hub-subject-card{min-height:196px;padding:14px}
  #study-space-root .study-hub-subject-card>strong{margin-top:10px}
  #study-space-root .study-hub-subject-meta{margin-top:7px}
  #study-space-root .study-hub-subject-foot{margin-top:10px}
  #study-space-root .study-hub-ai-panel{padding:12px;gap:7px}
  #study-space-root .study-hub-ai-tool{grid-template-columns:32px 1fr 16px;gap:8px;padding:8px}
  #study-space-root .study-hub-ai-tool>i{width:32px;height:32px}
}
@media (min-width:1101px) and (max-width:1280px){#study-space-root .study-hub-subject-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Desktop visual layer — scoped to Study Hub */
@media (min-width:1101px){
  #study-space-root .study-hub-shell{background:radial-gradient(circle at 8% 4%,color-mix(in srgb,var(--primary) 12%,transparent),transparent 23%),linear-gradient(145deg,color-mix(in srgb,var(--primary) 4%,var(--card)),transparent 46%);border-radius:28px}
  #study-space-root .study-hub-hero{isolation:isolate;border-color:color-mix(in srgb,var(--primary) 30%,var(--border));background:radial-gradient(circle at 84% 16%,color-mix(in srgb,var(--success) 24%,transparent),transparent 27%),linear-gradient(120deg,color-mix(in srgb,var(--primary) 13%,var(--card)),color-mix(in srgb,var(--success) 20%,var(--card)));box-shadow:0 18px 36px color-mix(in srgb,var(--primary) 13%,transparent)}
  #study-space-root .study-hub-hero::after{content:"";position:absolute;z-index:-1;width:300px;height:300px;right:-112px;top:-152px;border:1px solid color-mix(in srgb,var(--primary) 42%,transparent);border-radius:50%;box-shadow:0 0 0 34px color-mix(in srgb,var(--primary) 8%,transparent),0 0 0 68px color-mix(in srgb,var(--primary) 5%,transparent)}
  #study-space-root .study-hub-kicker{padding:7px 10px;border-radius:999px;background:color-mix(in srgb,var(--primary) 13%,var(--card));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary) 22%,transparent)}
  #study-space-root .study-hub-hero h1 em{color:color-mix(in srgb,var(--primary) 88%,var(--foreground));text-shadow:0 5px 18px color-mix(in srgb,var(--primary) 20%,transparent)}
  #study-space-root .study-hub-hero-actions button{background:linear-gradient(135deg,var(--primary),color-mix(in srgb,var(--primary) 72%,#22c55e));box-shadow:0 12px 24px color-mix(in srgb,var(--primary) 30%,transparent)}
  #study-space-root .study-hub-hero-stat{background:color-mix(in srgb,var(--card) 82%,transparent);border-color:color-mix(in srgb,var(--primary) 26%,var(--border));backdrop-filter:blur(10px);box-shadow:0 14px 28px color-mix(in srgb,var(--foreground) 11%,transparent)}
  #study-space-root .study-hub-catalog{border-color:color-mix(in srgb,var(--primary) 18%,var(--border));background:linear-gradient(155deg,color-mix(in srgb,var(--card) 94%,var(--primary)),var(--card));box-shadow:0 14px 28px color-mix(in srgb,var(--foreground) 5%,transparent)}
  #study-space-root .study-hub-search{border-color:color-mix(in srgb,var(--primary) 18%,var(--border));box-shadow:inset 0 1px 0 color-mix(in srgb,var(--card) 85%,transparent)}
  #study-space-root .study-space-filter.active{box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 17%,transparent),0 7px 14px color-mix(in srgb,var(--primary) 20%,transparent)}
  #study-space-root .study-hub-more-filter{background:color-mix(in srgb,var(--card) 72%,transparent)}
  #study-space-root .study-hub-list-meta{color:color-mix(in srgb,var(--foreground) 58%,var(--text-muted))}
  #study-space-root .study-hub-subject-card{overflow:hidden;border-color:color-mix(in srgb,var(--primary) 14%,var(--border));box-shadow:0 7px 16px color-mix(in srgb,var(--foreground) 4%,transparent)}
  #study-space-root .study-hub-subject-card::before{content:"";position:absolute;left:0;right:0;top:0;height:4px;background:linear-gradient(90deg,var(--primary),color-mix(in srgb,var(--success) 65%,var(--primary)),transparent)}
  #study-space-root .study-hub-subject-card:hover,#study-space-root .study-hub-subject-card:focus-visible{transform:translateY(-4px);border-color:color-mix(in srgb,var(--primary) 55%,var(--border));box-shadow:0 16px 27px color-mix(in srgb,var(--primary) 19%,transparent);outline:none}
  #study-space-root .study-hub-subject-icon{background:linear-gradient(135deg,color-mix(in srgb,var(--primary) 20%,var(--card)),color-mix(in srgb,var(--success) 12%,var(--card)));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary) 18%,transparent),0 5px 12px color-mix(in srgb,var(--primary) 11%,transparent)}
  #study-space-root .study-hub-subject-card[data-has-articles="true"]{background:linear-gradient(160deg,color-mix(in srgb,var(--primary) 5%,var(--card)),var(--card))}
  #study-space-root .study-hub-ai-panel{border-color:color-mix(in srgb,var(--primary) 24%,var(--border));background:linear-gradient(165deg,color-mix(in srgb,var(--primary) 10%,var(--card)),var(--card) 31%);box-shadow:0 14px 28px color-mix(in srgb,var(--foreground) 7%,transparent)}
  #study-space-root .study-hub-ai-heading{margin:-2px -2px 2px;padding:11px 9px;border:0;border-radius:12px;background:linear-gradient(135deg,color-mix(in srgb,var(--primary) 20%,var(--card)),color-mix(in srgb,var(--success) 12%,var(--card)))}
  #study-space-root .study-hub-ai-tool{border-color:color-mix(in srgb,var(--primary) 13%,var(--border));background:color-mix(in srgb,var(--card) 78%,transparent);box-shadow:0 3px 8px color-mix(in srgb,var(--foreground) 4%,transparent)}
  #study-space-root .study-hub-ai-tool:hover{background:var(--card);transform:translateY(-2px);box-shadow:0 10px 18px color-mix(in srgb,var(--primary) 14%,transparent)}
  #study-space-root .study-hub-ai-tool>i{background:linear-gradient(135deg,color-mix(in srgb,var(--primary) 22%,var(--card)),color-mix(in srgb,var(--success) 10%,var(--card)));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary) 14%,transparent)}
  #study-space-root .study-hub-stats{border:1px solid color-mix(in srgb,var(--primary) 16%,var(--border));background:linear-gradient(135deg,color-mix(in srgb,var(--primary) 11%,var(--card)),var(--card))}
}

/* Interactive lesson reader: restored 3-column study view */
.interactive-reader-shell{max-width:1500px;margin:0 auto;padding:20px;display:grid;grid-template-columns:290px minmax(0,1fr) 280px;gap:18px;background:var(--bg-base)}
.interactive-reader-left,.interactive-reader-right,.interactive-reader-main{min-width:0;background:var(--bg-card);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow-sm)}
.interactive-reader-left{padding:16px;position:sticky;top:78px;align-self:start;display:grid;gap:14px}.interactive-reader-left nav{display:grid;gap:5px}.interactive-reader-left nav a{padding:8px 10px;border-radius:9px;font-size:13px;color:var(--text-secondary)}.interactive-reader-left nav a:hover{background:var(--primary-light);color:var(--primary)}.interactive-reader-left nav .level-h3{padding-left:22px;font-size:12px}
.interactive-reader-main{padding:34px;min-height:640px}.interactive-reader-main header{padding:22px 24px;margin-bottom:26px;border-radius:16px;background:linear-gradient(135deg,color-mix(in srgb,var(--primary) 14%,var(--bg-card)),color-mix(in srgb,var(--success) 9%,var(--bg-card)))}.interactive-reader-main header>span{font-size:11px;font-weight:800;color:var(--primary);letter-spacing:.08em}.interactive-reader-main h1{margin:8px 0;font-size:32px;line-height:1.2}.interactive-reader-main header p{margin:0;color:var(--text-secondary)}
.interactive-reader-heading{scroll-margin-top:90px;margin:30px 0 12px;color:var(--text-primary)}.interactive-reader-text{color:var(--text-secondary);line-height:1.8;margin:0 0 16px}.interactive-reader-media{margin:22px 0;text-align:center}.interactive-reader-media img{max-width:100%;height:auto;border-radius:14px}.interactive-reader-media figcaption{margin-top:7px;font-size:12px;color:var(--text-muted)}.interactive-reader-callout{margin:20px 0;padding:16px;border-left:4px solid var(--primary);border-radius:0 12px 12px 0;background:var(--primary-light)}.interactive-reader-callout div{margin-top:6px;color:var(--text-secondary)}.interactive-reader-list{padding-left:24px;line-height:1.8}.interactive-reader-placeholder,.interactive-reader-legacy{padding:12px;border-radius:10px;background:var(--bg-subtle);color:var(--text-muted);font-size:13px}
.interactive-reader-right{position:sticky;top:78px;align-self:start;padding:14px;display:grid;gap:14px}.interactive-reader-right section{padding:14px;border:1px solid var(--border);border-radius:13px}.interactive-reader-right h3{margin:0 0 10px;font-size:14px}.interactive-reader-right textarea{width:100%;min-height:120px;border:1px solid var(--border);border-radius:10px;padding:9px;background:var(--bg-base);color:var(--text-primary);resize:vertical}.interactive-reader-right p{margin:0;color:var(--text-muted);font-size:12px}@media(max-width:1050px){.interactive-reader-shell{grid-template-columns:220px minmax(0,1fr)}.interactive-reader-right{grid-column:1/-1;position:static;grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:720px){.interactive-reader-shell{padding:12px;grid-template-columns:1fr}.interactive-reader-left,.interactive-reader-right{position:static}.interactive-reader-right{grid-template-columns:1fr}.interactive-reader-main{padding:19px}.interactive-reader-main h1{font-size:26px}}

/* Subject detail redesign — scoped to subject page */
.subject-detail-page-shell{max-width:1500px;margin:0 auto;padding:22px;background:var(--bg-base);border-radius:26px}
.subject-detail-layout{display:grid;grid-template-columns:minmax(0,1fr) 400px;gap:24px;align-items:start}
.subject-main-col{min-width:0;display:flex;flex-direction:column;gap:20px}
.subject-toc-sidebar{position:sticky;top:78px;align-self:start;min-width:0}
.subject-section-card{padding:24px;border:1px solid var(--border);border-radius:20px;background:var(--bg-card);box-shadow:0 8px 22px rgba(15,23,42,.045)}
.subject-section-title{margin:0 0 14px;font-size:20px;font-weight:800;letter-spacing:-.02em}
.subject-intro-text{margin:0;color:var(--text-secondary);line-height:1.7}
.subject-4cards-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.subject-info-card{display:flex;gap:14px;padding:18px;border:1px solid var(--border);border-radius:18px;background:var(--bg-card);box-shadow:0 6px 16px rgba(15,23,42,.035);transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.subject-info-card:hover{transform:translateY(-3px);border-color:color-mix(in srgb,var(--primary) 45%,var(--border));box-shadow:0 14px 26px rgba(15,23,42,.07)}
.card-icon-wrapper{flex:0 0 auto;display:grid;width:48px;height:48px;place-items:center;border-radius:14px;font-size:19px}.card-icon-objectives{background:var(--primary-light);color:var(--primary)}.card-icon-mainContent{background:#e8edff;color:#4e71d4}.card-icon-targetAudience{background:#fff3e4;color:#f37a23}.card-icon-learningFormat{background:#f6e8ff;color:#a44fd0}
.card-text-title{margin:0 0 5px;font-size:15px;font-weight:800}
.card-text-desc{margin:0;color:var(--text-secondary);font-size:13px;line-height:1.55}
.subject-instructor-card{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:20px 22px;border:1px solid var(--border);border-radius:18px;background:var(--bg-card)}
.instructor-left{display:flex;align-items:center;gap:14px;min-width:0}
.instructor-avatar{width:58px;height:58px;border-radius:50%;object-fit:cover}
.instructor-avatar-fallback{display:grid;width:58px;height:58px;place-items:center;border-radius:50%;background:var(--primary-light);color:var(--primary);font-size:24px}
.instructor-name{margin:0;font-size:16px;font-weight:800}
.instructor-role{margin:2px 0 0;color:var(--text-muted);font-size:13px}
.instructor-contact-btn{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:12px;background:var(--primary);color:var(--primary-foreground);font-size:13px;font-weight:700;white-space:nowrap}
.subject-detail-hero{--theme-main:#12a56c;--theme-soft:#dff8eb;--theme-rgb:18,165,108;position:relative;isolation:isolate;overflow:hidden;display:flex;align-items:center;min-height:0;margin-bottom:26px;padding:38px 40px;border:1px solid var(--border);border-radius:24px;background:linear-gradient(112deg,var(--bg-card) 42%,color-mix(in srgb,var(--theme-soft) 72%,var(--bg-card)) 100%);box-shadow:0 10px 28px rgba(15,23,42,.05)}
.subject-hero-copy{position:relative;z-index:2;max-width:720px}
.subject-meta-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px 12px}
.subject-detail-badge,.subject-meta-pill{display:inline-flex;align-items:center;gap:8px;padding:8px 13px;border-radius:999px;font-size:12px;font-weight:800;line-height:1}
.subject-detail-title{margin:20px 0 10px;font-size:clamp(30px,3.2vw,44px);font-weight:800;line-height:1.14;letter-spacing:-.035em}
.subject-detail-description{margin:0;color:var(--text-secondary);font-size:15px;line-height:1.65}
.subject-hero-art{position:absolute;inset:0 0 0 auto;width:46%;overflow:hidden;pointer-events:none;opacity:.9}
.subject-toc-sidebar .toc-card{border-radius:20px;box-shadow:0 8px 22px rgba(15,23,42,.05)}
.toc-overview-item{background:var(--primary-light);color:var(--primary-hover)}
.toc-chapter-header{font-size:13px}
@media(max-width:1100px){.subject-detail-layout{grid-template-columns:minmax(0,1fr) 340px}}
@media(max-width:992px){.subject-detail-layout{grid-template-columns:1fr}.subject-toc-sidebar{position:static;order:-1}.subject-4cards-grid{grid-template-columns:1fr}}
@media(max-width:700px){.subject-detail-page-shell{padding:12px}.subject-detail-hero{padding:24px;border-radius:18px}.subject-hero-art{display:none}.subject-4cards-grid{gap:12px}.subject-instructor-card{flex-direction:column;align-items:flex-start}.subject-detail-title{font-size:30px}}

/* Subject detail visual polish — editorial light composition */
#page-subject-detail{background:linear-gradient(180deg,#f7fbff 0%,#f4f8fc 100%)}
.subject-detail-page-shell{padding:16px 18px 28px;background:transparent;border-radius:0}
.subject-back-button{min-height:42px;margin-bottom:14px;padding:0 17px;border-color:#dce8ed;background:rgba(255,255,255,.82);box-shadow:0 4px 13px rgba(55,92,115,.06)}
.subject-detail-hero{min-height:274px;padding:34px 34px 28px;border-color:#dbeee6;background:radial-gradient(circle at 68% 14%,rgba(255,255,255,.86),transparent 28%),linear-gradient(112deg,#f8fffd 10%,#e7fbf2 60%,#ddf7ea 100%);box-shadow:0 13px 30px rgba(42,101,80,.075)}
.subject-detail-hero::before{content:"";position:absolute;z-index:0;inset:auto 36% -80px auto;width:260px;height:260px;border-radius:50%;background:rgba(51,190,121,.10);filter:blur(2px)}
.subject-hero-copy{max-width:58%}.subject-detail-badge{padding:8px 13px;background:#e6faef;color:#149967;box-shadow:inset 0 0 0 1px rgba(28,170,107,.10)}
.subject-detail-title{max-width:590px;margin:17px 0 12px;color:#07332b;font-size:clamp(31px,3vw,43px);line-height:1.12}.subject-detail-description{max-width:600px;color:#557176;font-size:15px}
.subject-meta-row .badge{border:1px solid #d7eee2!important;background:rgba(255,255,255,.68)!important;color:#347166!important;box-shadow:0 3px 9px rgba(48,125,91,.045)}
.subject-hero-art{width:47%;opacity:1}.subject-art-platform{background:linear-gradient(180deg,rgba(39,187,108,.40),rgba(39,187,108,.11))}.subject-art-emblem{background:linear-gradient(135deg,rgba(255,255,255,.95),rgba(55,193,119,.69));box-shadow:0 18px 32px rgba(23,132,79,.19)}
.subject-detail-layout{gap:18px}.subject-main-col{gap:16px}.subject-section-card{padding:20px 22px;border-color:#e1ebf0;border-radius:16px;box-shadow:0 7px 20px rgba(54,91,115,.045)}.subject-section-title{padding-bottom:10px;border-bottom:1px solid #eaf0f1;font-size:18px;color:#103d45}.subject-intro-text{font-size:14px;color:#5b727e}
.subject-4cards-grid{gap:12px}.subject-info-card{min-height:112px;padding:16px;border-color:#deebef;border-radius:14px;box-shadow:none}.subject-info-card:nth-child(1){background:linear-gradient(135deg,#fbfffc,#f0fff7)}.subject-info-card:nth-child(2){background:linear-gradient(135deg,#fcfdff,#f0f6ff)}.subject-info-card:nth-child(3){background:linear-gradient(135deg,#fffefb,#fff9e9)}.subject-info-card:nth-child(4){background:linear-gradient(135deg,#fffefe,#f7f2ff)}.subject-info-card:hover{transform:translateY(-2px);box-shadow:0 12px 22px rgba(42,101,80,.07)}.card-icon-wrapper{width:46px;height:46px;border-radius:50%}.card-text-title{color:#174557}.card-text-desc{color:#718592;font-size:12px}
.subject-instructor-card{padding:16px 18px;border-color:#dfeaf0;border-radius:15px;background:linear-gradient(90deg,#fff,#f8fcff)}.instructor-avatar-fallback{width:52px;height:52px;background:linear-gradient(135deg,#5fcb86,#40ad74);color:#fff}.instructor-contact-btn{background:transparent;color:#34816a;padding:8px 10px}.instructor-contact-btn:hover{background:#ecfaf2}
.subject-toc-sidebar .toc-card{padding:16px;border-color:#e1ebef;border-radius:17px;box-shadow:0 8px 24px rgba(54,91,115,.055)}.toc-header{padding-bottom:13px;margin-bottom:10px;color:#174557}.toc-overview-item{padding:11px 12px;border-radius:10px;background:linear-gradient(90deg,#e8fff0,#f4fff8);color:#189865}.toc-chapter-item{padding:7px 0}.toc-chapter-header{padding:9px 10px;color:#31535d}.toc-chapter-header:hover{background:#f2fbf7}.toc-lesson-list{gap:4px;margin-top:5px}.toc-lesson-item{padding:6px 10px;color:#78909a}.toc-lesson-item:hover{background:#f3faf7;color:#168d60}.toc-lesson-item.active{background:#eafff1;color:#138d5c}.toc-category-list{margin-top:12px;padding-top:12px}.toc-category-item{padding:10px 11px;color:#5d727c}.toc-category-item:hover{background:#f4fafb;color:#188d61}
@media(max-width:992px){.subject-hero-copy{max-width:68%}}@media(max-width:700px){.subject-detail-page-shell{padding:12px}.subject-detail-hero{padding:24px 20px}.subject-hero-copy{max-width:100%}.subject-meta-row .badge{font-size:11px!important;padding:7px 9px!important}.subject-section-card{padding:17px}.subject-info-card{min-height:0}}

/* Subject detail dark theme coherence */
[data-theme="dark"] #page-subject-detail{background:linear-gradient(180deg,#0d1718,#0a1112)}
[data-theme="dark"] .subject-detail-page-shell{background:transparent}
[data-theme="dark"] .subject-back-button{background:#132022;border-color:#263b3d;color:#e8f5f1}
[data-theme="dark"] .subject-detail-hero{background:radial-gradient(circle at 76% 12%,rgba(130,236,185,.16),transparent 30%),linear-gradient(112deg,#102322 12%,#0d2f29 58%,#164d3c 100%);border-color:#275047}
[data-theme="dark"] .subject-detail-title{color:#effff8}[data-theme="dark"] .subject-detail-description{color:#b9d3ca}
[data-theme="dark"] .subject-meta-row .badge{background:rgba(18,53,47,.78)!important;border-color:#397061!important;color:#c5ece0!important}
[data-theme="dark"] .subject-section-card,[data-theme="dark"] .subject-info-card,[data-theme="dark"] .subject-instructor-card,[data-theme="dark"] .subject-toc-sidebar .toc-card{background:#111f20;border-color:#263b3d;box-shadow:0 10px 25px rgba(0,0,0,.20)}
[data-theme="dark"] .subject-section-title,[data-theme="dark"] .card-text-title,[data-theme="dark"] .instructor-name,[data-theme="dark"] .toc-header{color:#e7f5f0}[data-theme="dark"] .subject-intro-text,[data-theme="dark"] .card-text-desc,[data-theme="dark"] .toc-lesson-item{color:#abc6bf}
[data-theme="dark"] .subject-info-card:nth-child(1){background:linear-gradient(135deg,#122821,#142c25)}[data-theme="dark"] .subject-info-card:nth-child(2){background:linear-gradient(135deg,#152035,#17263d)}[data-theme="dark"] .subject-info-card:nth-child(3){background:linear-gradient(135deg,#2c2516,#302819)}[data-theme="dark"] .subject-info-card:nth-child(4){background:linear-gradient(135deg,#241d34,#2a2140)}
[data-theme="dark"] .toc-overview-item{background:linear-gradient(90deg,#174b38,#163f31);color:#9df2c9}[data-theme="dark"] .toc-chapter-header{color:#d9ebe5}[data-theme="dark"] .toc-chapter-header:hover,[data-theme="dark"] .toc-lesson-item:hover{background:#17302c;color:#9ee9c7}[data-theme="dark"] .toc-lesson-item.active{background:#174b38;color:#a9f4d0}

/* Study Reader — immersive 3-column learning workspace */
.app-layout.study-reader-active>#app-sidebar,.app-layout.study-reader-active>.sidebar-overlay,.app-layout.study-reader-active>.app-main-wrapper>.top-header{display:none!important}.app-layout.study-reader-active>.app-main-wrapper{margin-left:0!important}.app-layout.study-reader-active .app-body{padding:0!important}.study-reader-page{min-height:100vh;background:#f5fffb;color:#183d40}.study-reader-frame{min-height:100vh;background:radial-gradient(circle at 7% 0%,rgba(109,244,190,.20),transparent 22%),radial-gradient(circle at 96% 4%,rgba(169,247,220,.24),transparent 20%),#f8fffd}.study-reader-header{height:76px;padding:0 30px;display:flex;align-items:center;gap:24px;border-bottom:1px solid #d7eee6;background:rgba(255,255,255,.8);backdrop-filter:blur(14px)}.study-reader-back{display:inline-flex;align-items:center;gap:8px;padding:11px 18px;border:1px solid #61cfa4;border-radius:999px;background:#ecfff6;color:#17634d;font:inherit;font-weight:800}.study-reader-crumb{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#6c8b8a;font-size:13px;font-weight:700}.study-reader-header-actions{display:flex;gap:8px}.study-reader-header-actions button{display:none;border:1px solid #cfe8df;border-radius:10px;background:#fff;color:#17785c;padding:8px 10px;font:inherit}.study-reader-grid{display:grid;grid-template-columns:280px minmax(0,1fr) 330px;gap:14px;padding:12px;min-height:calc(100vh - 76px)}.study-reader-toc,.study-reader-main,.study-reader-right-panel{min-width:0;border:1px solid #dcefe9;border-radius:20px;background:rgba(255,255,255,.9);box-shadow:0 9px 25px rgba(31,123,88,.08)}.study-reader-toc{padding:15px;overflow:auto}.study-reader-toc-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:13px;color:#1b5a4d;font-size:14px;font-weight:850}.study-reader-toc-head i{color:#11a976;margin-right:8px}.study-reader-progress{padding:4px 7px;border-radius:999px;background:#e7fff2;color:#119a69;font-size:11px}.study-reader-find-wrap{display:flex;align-items:center;gap:8px;padding:0 11px;border:1px solid #d5ebe4;border-radius:11px;background:#fafffd;color:#78a19a}.study-reader-find{width:100%;height:38px;border:0;outline:0;background:transparent;color:#244e51;font:inherit;font-size:12px}.study-reader-toc-list{display:grid;gap:5px;margin-top:14px}.study-reader-toc-list button{width:100%;display:flex;align-items:center;gap:8px;padding:9px;border:0;border-radius:10px;background:transparent;color:#527778;text-align:left;font:inherit;font-size:12px;cursor:pointer}.study-reader-toc-list button:hover,.study-reader-toc-list button.active{background:#e7fff2;color:#078c5e;font-weight:750}.study-reader-main{display:flex;flex-direction:column;overflow:hidden}.study-reader-toolbar{display:flex;gap:8px;align-items:center;overflow-x:auto;padding:12px;border-bottom:1px solid #e0efea;background:#fcfffe}.study-reader-toolbar button{flex:0 0 auto;border:1px solid #cfeae0;border-radius:10px;background:#fff;color:#27655a;padding:8px 11px;font:inherit;font-size:12px;font-weight:700}.study-reader-toolbar button:hover{border-color:#20c98c;background:#effff7;color:#078d61}.study-reader-content{flex:1;min-height:640px;padding:34px 42px;background:linear-gradient(135deg,#fff 20%,#fbfffd)}.study-reader-empty{display:grid;place-items:center;min-height:500px;text-align:center;color:#789291}.study-reader-empty i{display:block;margin-bottom:16px;color:#21bd87;font-size:56px}.study-reader-content h1,.study-reader-content h2,.study-reader-content h3{color:#123e43}.study-reader-content p{color:#537274;line-height:1.8}.study-reader-right-panel{padding:12px;display:grid;align-content:start;gap:12px;overflow:auto}.study-reader-note-paper,.study-reader-ai,.study-reader-share{border:1px solid #d5ede5;border-radius:16px;background:#fff;overflow:hidden}.study-reader-panel-title{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:12px 13px;color:#185b4d;font-size:14px;font-weight:850}.study-reader-panel-title i{color:#08ae76;margin-right:7px}.study-reader-panel-title small{color:#18a771;font-size:10px}.study-reader-note-paper textarea{box-sizing:border-box;width:100%;min-height:155px;border:0;border-top:1px solid #eff4e8;outline:0;padding:14px;background:linear-gradient(135deg,#fffde7,#fffefa);color:#506b69;font:13px/1.7 'Inter',sans-serif;resize:vertical}.study-reader-note-tools{display:flex;gap:7px;padding:9px 12px;border-top:1px solid #edf4ef}.study-reader-note-tools button{border:0;background:transparent;color:#567a77;padding:4px}.study-reader-ai{padding-bottom:13px;background:linear-gradient(145deg,#fbfffd,#effff7)}.study-reader-ai input{box-sizing:border-box;width:calc(100% - 26px);height:36px;margin:0 13px 9px;border:1px solid #d5eee5;border-radius:9px;padding:0 10px;font:12px 'Inter',sans-serif}.study-reader-ai-action{width:calc(100% - 26px);margin:0 13px;border:0;border-radius:999px;background:linear-gradient(135deg,#08b979,#0acb8c);box-shadow:0 8px 17px rgba(8,185,121,.22);color:#fff;padding:11px;font:700 12px 'Inter',sans-serif}.study-reader-ai-status,.study-reader-ai-result{margin:10px 13px 0;color:#6c8e88;font-size:11px;line-height:1.5}.study-reader-share{padding-bottom:12px}.study-reader-key-row{display:flex;gap:6px;padding:0 12px}.study-reader-key-row input{min-width:0;flex:1;height:35px;border:1px solid #d5ebe3;border-radius:9px;padding:0 9px;font:11px 'Inter',sans-serif}.study-reader-key-row button{border:0;border-radius:9px;background:#0bb87c;color:#fff;padding:0 10px;font:700 11px 'Inter',sans-serif}.study-reader-share-actions{display:flex;gap:8px;padding:12px}.study-reader-share-actions button{flex:1;border:1px solid #a8e5cc;border-radius:10px;background:#f5fffa;color:#168a61;padding:9px;font:700 12px 'Inter',sans-serif}.study-reader-share small{display:block;padding:0 12px;color:#78928c;font-size:10px}@media(max-width:1100px){.study-reader-grid{grid-template-columns:240px minmax(0,1fr)}.study-reader-right-panel{grid-column:1/-1;grid-template-columns:repeat(3,minmax(0,1fr));align-items:start}.study-reader-header-actions button{display:inline-flex;gap:6px;align-items:center}.study-reader-toc,.study-reader-right-panel{position:static}}@media(max-width:720px){.study-reader-header{height:62px;padding:0 12px;gap:10px}.study-reader-back{padding:8px 10px}.study-reader-back span,.study-reader-crumb{display:none}.study-reader-header-actions{margin-left:auto}.study-reader-header-actions button span{display:none}.study-reader-grid{display:block;padding:8px}.study-reader-main{min-height:calc(100vh - 78px)}.study-reader-content{min-height:560px;padding:22px 18px}.study-reader-toc,.study-reader-right-panel{display:none}.study-reader-toc.open,.study-reader-right-panel.open{display:grid;position:fixed;z-index:400;inset:70px 8px 8px;overflow:auto}.study-reader-right-panel.open{grid-template-columns:1fr}.study-reader-toolbar{padding:9px}.study-reader-toolbar button{font-size:11px;padding:7px 9px}}
.study-reader-welcome{max-width:760px;margin:20px auto;padding:38px;border-radius:22px;background:radial-gradient(circle at 90% 8%,rgba(128,246,196,.25),transparent 28%),linear-gradient(135deg,#fff,#f3fff9);border:1px solid #d9f2e8}.study-reader-welcome-icon{display:grid;width:75px;height:75px;place-items:center;margin:22px 0;border-radius:21px;background:linear-gradient(135deg,#d7fff0,#a9f5d2);color:#05a86d;font-size:34px}.study-reader-kicker{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border-radius:999px;background:#ddfff0;color:#0aa36b;font-size:12px;font-weight:850}.study-reader-welcome h1{margin:0 0 12px;font-size:clamp(32px,4vw,52px);line-height:1.05;letter-spacing:-.04em}.study-reader-welcome p{max-width:530px;font-size:15px}.study-reader-welcome-card{display:grid;gap:5px;margin-top:28px;padding:16px;border:1px solid #d3eee3;border-radius:14px;background:#fff;color:#537472}.study-reader-welcome-card b{color:#138b60}.study-reader-welcome-card span{font-size:12px}.study-reader-document-head{display:grid;grid-template-columns:62px 1fr;gap:14px;align-items:center;margin-bottom:28px;padding:20px;border-bottom:1px solid #dfeee8}.study-reader-document-head .study-reader-kicker{grid-column:1/-1}.study-reader-doc-number{display:grid;width:54px;height:54px;place-items:center;border-radius:14px;background:linear-gradient(135deg,#08bd79,#22d99a);color:#fff;font-size:22px;font-weight:850}.study-reader-document-head h1{margin:0;font-size:24px;line-height:1.2}.study-reader-document-head p{margin:5px 0 0;font-size:12px;color:#78918f}
.study-reader-lesson-hero{position:relative;overflow:hidden;display:grid;grid-template-columns:86px 1fr;gap:18px;align-items:center;margin:-12px -12px 24px;padding:28px 30px;border-radius:0 0 20px 20px;background:radial-gradient(circle at 85% 14%,rgba(93,241,187,.30),transparent 26%),linear-gradient(135deg,#fff,#e8fff5);min-height:190px}.study-reader-lesson-hero .study-reader-kicker{position:absolute;top:20px;left:30px}.study-reader-hero-book{display:grid;width:78px;height:78px;place-items:center;margin-top:30px;border-radius:22px;background:linear-gradient(135deg,#d6fff0,#a7f6d1);color:#00aa70;font-size:36px}.study-reader-lesson-hero h1{margin:35px 0 7px;font-size:clamp(28px,3vw,44px);line-height:1.06;letter-spacing:-.045em}.study-reader-lesson-hero p{max-width:470px;margin:0;color:#638482;font-size:14px}.study-reader-hero-orbit{position:absolute;right:-30px;bottom:-80px;width:250px;height:250px;border:28px solid rgba(57,209,143,.14);border-radius:50%}.study-reader-content .student-reader-body{max-width:760px;margin:auto}.study-reader-content .student-reader-body h2{padding:4px 0;border-radius:0;background:none;color:#111827}.study-reader-highlight{background:#fff19a;color:inherit;border-radius:3px;padding:0 2px}

/* Study Reader content safety and annotation surfaces */
.study-reader-embed{width:100%;min-height:540px;border:1px solid #d5ebe4;border-radius:14px;background:#fff}.study-reader-external{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:18px 0;padding:14px;border:1px solid #d5ebe4;border-radius:12px;background:#f7fffb}.study-reader-external small{color:#64827e;font-size:12px}.study-reader-toc-chapter{margin:12px 0 3px;padding:6px 8px;color:#1b5a4d;font-size:11px;font-weight:850;text-transform:uppercase}.reader-search-match{outline:2px solid #80e2ba;outline-offset:-2px}.study-reader-resource-picker .modal-box{max-width:560px}.study-reader-picker-list{display:grid;gap:10px;padding:18px}.study-reader-picker-list .btn{text-align:left;justify-content:flex-start}.study-reader-annotation-layer{position:absolute;inset:0;z-index:3;width:100%;height:100%;touch-action:none}.study-reader-content>*:not(.study-reader-annotation-layer){position:relative;z-index:1}

/* Study Reader responsive drawers */
@media (max-width:1100px){.study-reader-grid{grid-template-columns:minmax(0,1fr);padding:10px}.study-reader-header-actions button{display:inline-flex;align-items:center;gap:6px}.study-reader-toc,.study-reader-right-panel{position:fixed!important;z-index:410;top:86px;bottom:10px;width:min(360px,calc(100vw - 20px));display:grid!important;overflow:auto;box-shadow:0 18px 48px rgba(12,72,53,.22);transition:transform .2s ease}.study-reader-toc{left:10px;transform:translateX(calc(-100% - 20px))}.study-reader-right-panel{right:10px;grid-template-columns:1fr!important;transform:translateX(calc(100% + 20px))}.study-reader-toc.open,.study-reader-right-panel.open{transform:translateX(0)}.study-reader-main{min-height:calc(100vh - 96px)}.study-reader-toolbar{overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;white-space:nowrap}}
@media (max-width:720px){.study-reader-header{position:sticky;top:0;z-index:420}.study-reader-grid{padding:8px}.study-reader-toc,.study-reader-right-panel{top:70px;bottom:8px;width:calc(100vw - 16px)}.study-reader-content{padding:22px 16px}.study-reader-embed{min-height:360px}.study-reader-toolbar{gap:7px;padding:9px 8px}.study-reader-toolbar button{font-size:11px;padding:8px 9px}.study-reader-annotation-layer{touch-action:none}}

/* ═══ Study Reader Gen Z visual layer ═══ */
.study-reader-page{background:#edfff8!important;color:#18343b!important}.study-reader-frame{max-width:1680px;margin:auto;background:radial-gradient(circle at 2% 0%,#d8fff2 0,transparent 24%),radial-gradient(circle at 100% 2%,#dffff5 0,transparent 20%),#f7fffc!important}.study-reader-header{height:76px!important;padding:0 36px!important;border-bottom:1px solid rgba(70,184,150,.18)!important;background:rgba(255,255,255,.78)!important}.study-reader-brand{display:flex;align-items:center;gap:28px;min-width:0;flex:1}.study-reader-back{box-shadow:0 8px 20px rgba(20,159,112,.10)!important}.study-reader-crumb{font-size:14px!important;color:#6a878d!important}.study-reader-grid{grid-template-columns:292px minmax(0,1fr) 384px!important;gap:16px!important;padding:16px!important;min-height:calc(100vh - 76px)!important}.study-reader-toc,.study-reader-main,.study-reader-right-panel{border:1px solid rgba(119,213,183,.34)!important;border-radius:22px!important;background:rgba(255,255,255,.9)!important;box-shadow:0 14px 34px rgba(38,119,94,.08)!important}.study-reader-toc{padding:14px!important}.study-reader-course-card{display:grid;grid-template-columns:46px 1fr;gap:11px;align-items:start;padding:12px;margin-bottom:14px;border-radius:16px;background:linear-gradient(135deg,#e9fff5,#f9fffd)}.study-reader-course-icon{display:grid;place-items:center;width:46px;height:46px;border-radius:14px;background:#caffea;color:#00a96d;font-size:21px;box-shadow:0 8px 16px rgba(11,194,126,.14)}#study-reader-course-code{display:block;margin-bottom:4px;color:#17a878;font-size:10px;font-weight:900;letter-spacing:.07em;text-transform:uppercase}#study-reader-course-title{display:block;color:#143f43;font-size:15px;line-height:1.25}.study-reader-toc-head{margin:2px 2px 7px!important;font-size:12px!important}.study-reader-progress{background:transparent!important;color:#00a86f!important;font-size:14px!important}.study-reader-progress-track{height:7px;margin:0 2px 15px;border-radius:99px;background:#e4f5ee;overflow:hidden}.study-reader-progress-track i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#08c980,#23dca0);box-shadow:0 2px 8px rgba(0,190,125,.35)}.study-reader-find-wrap{height:40px;border-radius:13px!important;background:#fbfffd!important}.study-reader-toc-list{position:relative;margin:14px 0 0 8px!important;padding-left:9px!important;gap:3px!important}.study-reader-toc-list:before{content:"";position:absolute;top:6px;bottom:6px;left:0;width:2px;border-radius:9px;background:#d8eee7}.study-reader-toc-list button{position:relative;padding:10px 11px 10px 13px!important;border-radius:10px!important}.study-reader-toc-list button:before{content:"";position:absolute;left:-14px;width:8px;height:8px;border:2px solid #d3e7e1;border-radius:50%;background:#fff}.study-reader-toc-list button.active:before{border-color:#14ba80;background:#14ba80;box-shadow:0 0 0 4px #d8faeb}.study-reader-toc-chapter{margin:14px 0 4px!important;padding:7px 8px!important;color:#117458!important;font-size:11px!important}
.study-reader-main{position:relative;overflow:hidden!important}.study-reader-main-top{display:flex;align-items:center;justify-content:space-between;min-height:42px;padding:0 20px;border-bottom:1px solid #e4f2ed;color:#6c8990;font-size:12px;font-weight:750}.study-reader-main-top i{color:#0eb77b;margin-right:6px}.study-reader-page-count{padding:6px 10px;border-radius:9px;background:#f4fffb;font-size:11px}.study-reader-page-count b{color:#168a67}.study-reader-toolbar{gap:9px!important;padding:12px 18px!important;background:rgba(251,255,253,.88)!important}.study-reader-toolbar button{border-color:#ccece0!important;border-radius:12px!important;box-shadow:0 4px 10px rgba(37,133,102,.04);padding:9px 13px!important}.study-reader-toolbar button:first-child{background:#eafff4!important;color:#087e59!important}.study-reader-content{min-height:650px!important;padding:0!important;background:#fff!important}.study-reader-document-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 20px;border-top:1px solid #e4f2ed;color:#5d837d;font-size:11px;font-weight:750}.study-reader-document-footer i{color:#f2c94c;margin-right:5px}.study-reader-footer-progress{width:30%;height:5px;border-radius:99px;background:#e8f6f0}.study-reader-footer-progress i{display:block;width:28%;height:100%;border-radius:inherit;background:#10bd81}.study-reader-empty{min-height:650px!important;padding:42px!important;place-items:stretch!important;background:radial-gradient(circle at 87% 10%,#d6ffed 0,transparent 25%),linear-gradient(135deg,#fff 0%,#f4fffa 100%)}.study-reader-empty>div{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:500px;border:1px solid #e5f5ee;border-radius:20px;background:rgba(255,255,255,.7)}.study-reader-empty i{font-size:60px!important}.study-reader-empty p{font-size:16px!important}.study-reader-document-head{max-width:860px;margin:26px auto!important;padding:0 36px 22px!important}.study-reader-content .student-reader-body{max-width:820px!important;padding:0 36px 38px}
.study-reader-right-panel{position:relative;padding:14px!important;gap:14px!important;background:linear-gradient(180deg,#f9fffc,#edfff8)!important}.study-reader-panel-orb{position:absolute;top:-74px;right:-60px;width:180px;height:180px;border-radius:50%;background:#c8ffe9;opacity:.58;filter:blur(2px);pointer-events:none}.study-reader-note-paper,.study-reader-ai,.study-reader-share{position:relative;border-radius:18px!important;box-shadow:0 7px 18px rgba(44,125,99,.05)}.study-reader-note-paper{background:#fffef5!important}.study-reader-panel-title{padding:14px 16px!important;font-size:15px!important}.study-reader-note-paper textarea{min-height:170px!important;background:#fffef1!important;background-image:repeating-linear-gradient(transparent,transparent 30px,#f1edd1 31px)!important;padding:15px 16px!important}.study-reader-note-tools{padding:10px 14px!important}.study-reader-ai{padding:2px 0 15px!important;background:linear-gradient(145deg,#effff7,#e5fff3)!important}.study-reader-ai:before{content:"✦";position:absolute;right:17px;top:13px;color:#f2c94c;font-size:22px}.study-reader-ai-copy{margin:0 14px 12px;color:#62857e;font-size:12px;line-height:1.5}.study-reader-ai-action{border-radius:13px!important;padding:12px!important}.study-reader-share{background:#fff!important}.study-reader-share:after{content:"✧";position:absolute;right:13px;bottom:9px;color:#7ce2b9;font-size:28px}.study-reader-key-row,.study-reader-share-actions{position:relative;z-index:1}.study-reader-key-row input{height:39px!important;border-radius:11px!important}.study-reader-key-row button{border-radius:11px!important}.study-reader-share-actions button{border-radius:12px!important;background:#f4fff9!important}
@media(max-width:1100px){.study-reader-grid{grid-template-columns:minmax(0,1fr)!important}.study-reader-main-top{padding:0 14px}.study-reader-content{min-height:560px!important}}@media(max-width:720px){.study-reader-header{padding:0 13px!important}.study-reader-brand{gap:10px}.study-reader-grid{padding:8px!important}.study-reader-main-top{min-height:38px;font-size:11px}.study-reader-content{min-height:500px!important}.study-reader-empty{min-height:500px!important;padding:18px!important}.study-reader-empty>div{min-height:430px}.study-reader-document-footer{padding:12px}.study-reader-footer-progress{width:42%}.study-reader-content .student-reader-body{padding:0 20px 28px}.study-reader-document-head{padding:0 20px 20px!important}}

/* Study Reader full-viewport mode */
.app-layout.study-reader-active>.app-main-wrapper{position:fixed!important;inset:0!important;width:100vw!important;max-width:none!important;margin:0!important;flex:none!important;z-index:300;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior-y:contain}.app-layout.study-reader-active .app-body,.app-layout.study-reader-active #page-study-reader,.app-layout.study-reader-active .study-reader-frame{width:100%!important;max-width:none!important;min-width:0}.app-layout.study-reader-active #page-study-reader{min-height:100dvh!important}.app-layout.study-reader-active .study-reader-grid{min-height:calc(100dvh - 76px)!important;align-items:start}

/* Rich lesson cover — works even when a lesson body is empty */
.study-reader-document-head{position:relative;max-width:none!important;min-height:138px;margin:0!important;padding:28px 42px!important;overflow:hidden;border:0!important;background:linear-gradient(118deg,#fbfffd 0%,#effff7 58%,#d7ffed 100%)}.study-reader-document-head:before,.study-reader-document-head:after{display:none}.study-reader-document-head .study-reader-kicker{width:max-content;padding:7px 11px!important;background:#c9ffe8!important;color:#009d65!important}.study-reader-doc-number{width:54px!important;height:54px!important;border-radius:16px!important;box-shadow:0 10px 18px rgba(7,193,121,.18)}.study-reader-document-head h1{max-width:none;font-size:clamp(27px,2.7vw,39px)!important;letter-spacing:-.035em}.study-reader-document-head p{font-size:13px!important}.student-reader-body{min-height:330px}.student-reader-body:has(.interactive-reader-text:only-child){position:relative;overflow:hidden;padding-top:8px}.student-reader-body:has(.interactive-reader-text:only-child):after{content:"Hãy thêm nội dung bài học để bắt đầu hành trình khám phá ✦";display:block;margin-top:32px;padding:18px;border:1px dashed #a8e8ce;border-radius:14px;background:#f4fffa;color:#5d8c7d;font-size:13px}.study-reader-content .interactive-reader-text{font-size:16px;line-height:1.85}@media(max-width:720px){.study-reader-document-head{min-height:124px;padding:23px 22px!important}.study-reader-document-head h1{font-size:27px!important}.study-reader-doc-number{width:48px!important;height:48px!important}}

/* Annotation pen colors */
.study-reader-color-palette{display:inline-flex;align-items:center;gap:6px;margin-left:auto;padding-left:8px;border-left:1px solid #dcefe7}.study-reader-color-palette button{width:19px!important;height:19px!important;min-width:19px!important;padding:0!important;border:2px solid #fff!important;border-radius:50%!important;background:var(--annotation-color)!important;box-shadow:0 0 0 1px rgba(27,88,75,.16)!important}.study-reader-color-palette button[data-annotation-color="#10b981"]{--annotation-color:#10b981}.study-reader-color-palette button[data-annotation-color="#2563eb"]{--annotation-color:#2563eb}.study-reader-color-palette button[data-annotation-color="#8b5cf6"]{--annotation-color:#8b5cf6}.study-reader-color-palette button[data-annotation-color="#ec4899"]{--annotation-color:#ec4899}.study-reader-color-palette button[data-annotation-color="#f97316"]{--annotation-color:#f97316}.study-reader-color-palette button[data-annotation-color="#eab308"]{--annotation-color:#eab308}.study-reader-color-palette button[data-annotation-color="#1f2937"]{--annotation-color:#1f2937}.study-reader-color-palette button.active{transform:scale(1.22);box-shadow:0 0 0 2px #00ac70,0 4px 8px rgba(0,150,100,.2)!important}@media(max-width:720px){.study-reader-color-palette{margin-left:0;padding-left:3px;border-left:0}.study-reader-color-palette button{width:17px!important;height:17px!important;min-width:17px!important}}

/* Header resource download shortcut */
.study-reader-resource-link{display:inline-flex;align-items:center;gap:8px;max-width:300px;margin-left:auto;padding:10px 13px;border:1px solid #9de7c8;border-radius:12px;background:linear-gradient(135deg,#edfff6,#fafffd);color:#087e59;font-size:12px;font-weight:800;text-decoration:none;white-space:nowrap;overflow:hidden;box-shadow:0 6px 14px rgba(22,160,103,.08)}.study-reader-resource-link:hover{border-color:#19bf7e;background:#dcffed;transform:translateY(-1px)}.study-reader-resource-link span{overflow:hidden;text-overflow:ellipsis}@media(max-width:720px){.study-reader-resource-link{max-width:42px;margin-left:auto;padding:10px}.study-reader-resource-link span{display:none}}

/* Document Content Black Text Color Fix */
.student-reader-body,
.student-reader-body *,
.study-reader-content .student-reader-body,
.study-reader-content .student-reader-body *,
.document-paper-view,
.document-paper-view * {
  color: #111827 !important;
}

.study-reader-content .student-reader-body h1,
.study-reader-content .student-reader-body h2,
.study-reader-content .student-reader-body h3,
.study-reader-content .student-reader-body h4,
.study-reader-content .student-reader-body h5,
.study-reader-content .student-reader-body h6 {
  color: #111827 !important;
  background: none !important;
  padding: 4px 0 !important;
}

/* Admin subject configuration — scoped, keeps the current product visual language */
.subject-config-header{display:flex;justify-content:space-between;align-items:end;gap:16px;margin-bottom:16px}.subject-config-header h3{margin:0}.subject-config-header p{margin:5px 0 0;color:var(--text-muted);font-size:13px}.subject-config-header select{min-width:280px}.subject-config-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.subject-config-full{grid-column:1/-1}.subject-config-section h4{margin:0 0 14px}.subject-config-fields,.subject-config-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.subject-config-fields label,.subject-config-cards label{display:grid;gap:5px;font-weight:700;font-size:12px}.subject-config-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:10px;margin-top:16px}.subject-config-actions .btn{min-height:40px}@media(max-width:900px){.subject-config-grid{grid-template-columns:1fr}.subject-config-full{grid-column:auto}}@media(max-width:640px){.subject-config-header{display:grid;align-items:stretch}.subject-config-header select{min-width:0;width:100%}.subject-config-fields,.subject-config-cards{grid-template-columns:1fr}.subject-config-actions{justify-content:stretch}.subject-config-actions .btn{flex:1}}

/* Visual subject introduction canvas: editor and student renderer */
.subject-canvas-heading{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.subject-canvas-heading h4{margin:0}.subject-canvas-heading p{margin:4px 0 0;color:var(--text-muted);font-size:12px}.subject-canvas-toolbar{display:flex;flex-wrap:wrap;gap:7px}.subject-canvas-align{margin:14px 0}.subject-canvas-align button{width:34px;height:32px;border:1px solid var(--border);border-radius:8px;background:var(--bg-subtle);color:var(--text-primary);cursor:pointer}.subject-canvas-align .danger{color:var(--danger)}.subject-canvas-workbench{display:grid;grid-template-columns:minmax(0,1fr) 240px;gap:14px}.subject-intro-canvas{position:relative;min-height:620px;overflow:hidden;border:1px dashed color-mix(in srgb,var(--primary) 50%,var(--border));border-radius:14px;background:linear-gradient(45deg,color-mix(in srgb,var(--primary) 4%,var(--bg-card)) 25%,transparent 25%,transparent 75%,color-mix(in srgb,var(--primary) 4%,var(--bg-card)) 75%),var(--bg-card);background-size:22px 22px}.subject-canvas-empty{display:grid;place-items:center;height:620px;color:var(--text-muted);font-size:13px}.subject-canvas-item{position:absolute;box-sizing:border-box;display:grid;place-items:center;overflow:hidden;border:1px solid transparent;border-radius:8px;cursor:grab;user-select:none;background:var(--bg-card);box-shadow:var(--shadow-sm)}.subject-canvas-item.selected{border:2px solid var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 20%,transparent)}.subject-canvas-item img{width:100%;height:100%;object-fit:cover}.subject-canvas-text{padding:10px;width:100%;height:100%;white-space:pre-wrap;overflow:auto}.subject-canvas-resize{position:absolute;right:0;bottom:0;width:15px;height:15px;background:var(--primary);clip-path:polygon(100% 0,100% 100%,0 100%);cursor:nwse-resize}.subject-canvas-properties{padding:14px;border:1px solid var(--border);border-radius:12px;background:var(--bg-subtle)}.subject-canvas-properties h5{margin:0 0 12px}.subject-canvas-properties label{display:grid;gap:5px;margin:9px 0;font-size:12px;font-weight:700}.subject-canvas-properties textarea,.subject-canvas-properties input{width:100%;box-sizing:border-box}.subject-canvas-size{display:grid;grid-template-columns:1fr 1fr;gap:8px}.student-intro-canvas{position:relative;min-height:440px;overflow:hidden;border-radius:12px;background:var(--bg-subtle)}.student-intro-canvas-item{position:absolute;box-sizing:border-box;margin:0;overflow:hidden}.student-intro-canvas-item.text{padding:12px;color:var(--text-primary);line-height:1.65;background:color-mix(in srgb,var(--bg-card) 88%,transparent);border-radius:10px}.student-intro-canvas-item.image img{width:100%;height:100%;object-fit:cover;border-radius:10px}.student-intro-canvas-image-error{display:grid;place-items:center;width:100%;height:100%;padding:12px;box-sizing:border-box;border:1px dashed var(--danger);border-radius:10px;color:var(--danger);background:var(--bg-card);font-size:13px;text-align:center}.student-intro-canvas-item.video iframe{width:100%;height:100%;border:0;border-radius:10px}@media(max-width:760px){.subject-canvas-heading,.subject-canvas-workbench{display:grid;grid-template-columns:1fr}.subject-intro-canvas{min-height:420px}.student-intro-canvas{position:static;min-height:0;display:grid;gap:12px;background:transparent}.student-intro-canvas-item{position:static!important;width:100%!important;height:auto!important;min-height:0}.student-intro-canvas-item.text{background:var(--bg-subtle)}.student-intro-canvas-item.image img{height:auto}.student-intro-canvas-item.video{aspect-ratio:16/9}.student-intro-canvas-item.video iframe{height:100%}}
.subject-canvas-height-label{display:inline-flex!important;align-items:center;gap:5px;padding:0 8px;border:1px solid var(--border);border-radius:8px;font-size:12px;font-weight:700;color:var(--text-secondary);background:var(--bg-subtle);white-space:nowrap}.subject-canvas-height-label input{width:64px;border:0!important;background:transparent!important;color:var(--text-primary);font:inherit;outline:0}@media(max-width:760px){.student-intro-canvas{min-height:0!important}}
.subject-canvas-height-resize{position:absolute;z-index:110;right:10px;bottom:10px;width:34px;height:34px;border:1px solid var(--primary);border-radius:9px;background:var(--primary);color:var(--primary-foreground);cursor:ns-resize;box-shadow:0 5px 14px color-mix(in srgb,var(--primary) 32%,transparent)}

/* Student introduction renderer — presentation surface only; editor rules stay above. */
.student-intro-canvas{isolation:isolate;min-height:440px;border:1px solid var(--border);border-radius:18px;background:var(--bg-card);box-shadow:none}.student-intro-canvas::before,.student-intro-canvas::after,.student-intro-canvas-backdrop,.student-intro-canvas-course-label{display:none}.student-intro-canvas-item{z-index:1}.student-intro-canvas--text-only .student-intro-canvas-item.text{display:block;max-width:none;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;font-size:clamp(16px,1.35vw,19px);line-height:1.8;color:var(--text-primary);backdrop-filter:none}
.student-intro-canvas--has-media .student-intro-canvas-item.image,.student-intro-canvas--has-media .student-intro-canvas-item.video,.student-intro-canvas--mixed .student-intro-canvas-item.image,.student-intro-canvas--mixed .student-intro-canvas-item.video{border-radius:16px;box-shadow:0 16px 28px color-mix(in srgb,var(--text-primary) 16%,transparent)}.student-intro-canvas--has-media .student-intro-canvas-item.image img,.student-intro-canvas--mixed .student-intro-canvas-item.image img,.student-intro-canvas--has-media .student-intro-canvas-item.video iframe,.student-intro-canvas--mixed .student-intro-canvas-item.video iframe{border-radius:16px}
@media(max-width:760px){.student-intro-canvas{padding:18px;border-radius:14px}.student-intro-canvas--text-only .student-intro-canvas-item.text{max-width:none;padding:0;font-size:16px;background:transparent}.student-intro-canvas--has-media .student-intro-canvas-item.image,.student-intro-canvas--has-media .student-intro-canvas-item.video,.student-intro-canvas--mixed .student-intro-canvas-item.image,.student-intro-canvas--mixed .student-intro-canvas-item.video{box-shadow:var(--shadow-sm)}}

/* Review lesson editor */
#admin-subtab-review-lessons { padding: 20px; }
.review-lesson-admin-header, .review-lesson-admin-layout, .review-lesson-admin-meta, .review-lesson-admin-actions, .review-lesson-admin-media-grid { display: grid; gap: 14px; }
.review-lesson-admin-header { grid-template-columns: minmax(0,1fr) minmax(220px,320px); align-items: center; margin-bottom: 16px; }
.review-lesson-admin-header h3, .review-lesson-admin-header p { margin: 0; }
.review-lesson-admin-header p { color: var(--text-muted); margin-top: 4px; }
.review-lesson-admin-layout { grid-template-columns: minmax(180px,.7fr) minmax(360px,1.8fr) minmax(240px,.9fr); align-items: start; }
.review-lesson-admin-tree, .review-lesson-admin-editor, .review-lesson-admin-media { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 14px; }
.review-lesson-admin-tree h4, .review-lesson-admin-media h4 { margin: 0; }
.review-lesson-admin-chapter { border-top: 1px solid var(--border-color); margin-top: 12px; padding-top: 10px; }
.review-lesson-admin-chapter h5 { margin: 0 0 6px; font-size: 13px; }
.review-lesson-admin-tree-item { width: 100%; display: flex; justify-content: space-between; gap: 8px; text-align: left; border: 0; border-radius: 8px; background: transparent; color: var(--text-primary); padding: 8px; cursor: pointer; }
.review-lesson-admin-tree-item:hover, .review-lesson-admin-tree-item.active { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.review-lesson-admin-tree-item small { white-space: nowrap; color: var(--text-muted); }
.review-lesson-admin-meta { grid-template-columns: minmax(0,1fr) 140px; margin-bottom: 12px; }
.review-lesson-admin-meta label, #review-lesson-media-properties label { display: grid; gap: 5px; font-size: 12px; font-weight: 700; }
.review-lesson-admin-paper { background: #fff; border: 1px solid var(--border-color); border-radius: 8px; min-height: 520px; padding: 8px; }
.review-lesson-admin-paper .tox-tinymce { border: 0; border-radius: 6px; }
.review-lesson-admin-paper .tox .tox-toolbar, .review-lesson-admin-paper .tox .tox-toolbar__primary { background: var(--bg-secondary); }
#review-lesson-media-canvas { position: relative; min-height: 360px; margin: 12px 0; border: 1px dashed var(--border-color); border-radius: 10px; background: var(--bg-secondary); overflow: hidden; }
#review-lesson-media-canvas .review-lesson-media-item { position: absolute; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 2px solid transparent; border-radius: 7px; background: var(--bg-card); cursor: move; user-select: none; }
#review-lesson-media-canvas .review-lesson-media-item.selected { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); }
#review-lesson-media-canvas img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
#review-lesson-media-canvas .review-lesson-media-resize { position: absolute; right: -5px; bottom: -5px; width: 13px; height: 13px; border: 2px solid var(--bg-card); border-radius: 50%; background: var(--primary); cursor: nwse-resize; }
.review-lesson-admin-empty { color: var(--text-muted); text-align: center; margin-top: 150px; }
#review-lesson-media-properties { border-top: 1px solid var(--border-color); padding-top: 12px; }
#review-lesson-media-properties h5 { margin: 0 0 8px; }
.review-lesson-admin-media-grid { grid-template-columns: 1fr 1fr; margin: 10px 0; }
.review-lesson-admin-actions { display: flex; grid-template-columns: repeat(3,max-content); justify-content: flex-end; margin-top: 16px; }
.review-lesson-document { max-width: 860px; margin: 0 auto; line-height: 1.75; color: var(--text-primary); }
.review-lesson-document h2, .review-lesson-document h3, .review-lesson-document h4 { margin: 1.25em 0 .55em; line-height: 1.3; }
.review-lesson-document ul, .review-lesson-document ol { padding-left: 1.5em; margin: .75em 0; }
.review-lesson-document table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.review-lesson-document th, .review-lesson-document td { border: 1px solid var(--border-color); padding: 8px; vertical-align: top; }
.review-lesson-document blockquote { border-left: 3px solid var(--primary); padding-left: 14px; margin-left: 0; color: var(--text-muted); }
body.dark-mode #admin-subtab-review-lessons .review-lesson-admin-tree, body.dark-mode #admin-subtab-review-lessons .review-lesson-admin-editor, body.dark-mode #admin-subtab-review-lessons .review-lesson-admin-media, body.dark-mode #review-lesson-media-canvas .review-lesson-media-item { background: var(--bg-card); }
body.dark-mode #admin-subtab-review-lessons .review-lesson-admin-paper { background: var(--bg-secondary); }
@media (max-width:760px) { #admin-subtab-review-lessons .review-lesson-admin-header, #admin-subtab-review-lessons .review-lesson-admin-layout, #admin-subtab-review-lessons .review-lesson-admin-meta { grid-template-columns: 1fr; } #admin-subtab-review-lessons .review-lesson-admin-actions { justify-content: stretch; grid-template-columns: 1fr; } }
#admin-subtab-review-lessons .review-lesson-admin-layout { grid-template-columns: minmax(210px,.75fr) minmax(0,2.25fr); }
#admin-subtab-review-lessons .review-lesson-admin-media { color: var(--text-muted); line-height: 1.6; }
#admin-subtab-review-lessons .review-lesson-admin-media h4 { color: var(--text-primary); }
#admin-subtab-review-lessons .review-lesson-admin-paper img { max-width: 100%; height: auto; }
#admin-subtab-review-lessons .review-lesson-admin-paper iframe, #admin-subtab-review-lessons .review-lesson-admin-paper video { max-width: 100%; }
/* Floating media remains part of the Word document but can be repositioned freely. */
.review-lesson-document { position: relative; }
.review-lesson-document img.review-floating-media { position: absolute; display: block; max-width: 100%; z-index: 2; }
#admin-subtab-review-lessons .tox-edit-area__iframe { min-height: 520px; }
#admin-subtab-review-lessons .tox-edit-area img.review-floating-media { outline: 2px dashed var(--primary); outline-offset: 3px; cursor: move; }
#admin-subtab-review-lessons .tox-edit-area__iframe { min-height: 520px; }
#admin-subtab-review-lessons .tox-edit-area img.review-floating-media:hover { outline-style: solid; }

/* Study Reader dark mode — low-glare palette for extended reading */
[data-theme="dark"] .study-reader-page{background:#0b1213!important;color:#d7e4df!important}
[data-theme="dark"] .study-reader-frame{background:radial-gradient(circle at 4% 0%,rgba(44,125,97,.14),transparent 25%),radial-gradient(circle at 100% 4%,rgba(34,104,88,.12),transparent 22%),#0b1213!important}
[data-theme="dark"] .study-reader-header{border-color:#263a37!important;background:rgba(14,24,24,.88)!important}
[data-theme="dark"] .study-reader-back,[data-theme="dark"] .study-reader-header-actions button{border-color:#356357!important;background:#142522!important;color:#bfe8d9!important}
[data-theme="dark"] .study-reader-crumb{color:#91aaa3!important}
[data-theme="dark"] .study-reader-toc,[data-theme="dark"] .study-reader-main,[data-theme="dark"] .study-reader-right-panel{border-color:#263d38!important;background:#111d1c!important;box-shadow:0 14px 34px rgba(0,0,0,.25)!important}
[data-theme="dark"] .study-reader-course-card,[data-theme="dark"] .study-reader-right-panel{background:linear-gradient(155deg,#142522,#101b1a)!important}
[data-theme="dark"] .study-reader-course-icon,[data-theme="dark"] .study-reader-kicker{background:#173b31!important;color:#86d9b8!important}
[data-theme="dark"] #study-reader-course-title,[data-theme="dark"] .study-reader-toc-head,[data-theme="dark"] .study-reader-panel-title,[data-theme="dark"] .study-reader-content h1,[data-theme="dark"] .study-reader-content h2,[data-theme="dark"] .study-reader-content h3{color:#dcebe5!important}
[data-theme="dark"] .study-reader-find-wrap,[data-theme="dark"] .study-reader-toolbar,[data-theme="dark"] .study-reader-main-top{border-color:#263d38!important;background:#101b1a!important;color:#9bb6ae!important}
[data-theme="dark"] .study-reader-find,[data-theme="dark"] .study-reader-ai input,[data-theme="dark"] .study-reader-key-row input{color:#d7e4df!important;background:#0d1716!important;border-color:#315149!important}
[data-theme="dark"] .study-reader-toc-list:before{background:#29483f!important}
[data-theme="dark"] .study-reader-toc-list button{color:#a9c1ba!important}
[data-theme="dark"] .study-reader-toc-list button:hover,[data-theme="dark"] .study-reader-toc-list button.active{background:#17352e!important;color:#9ce3c4!important}
[data-theme="dark"] .study-reader-toolbar button{border-color:#315149!important;background:#162725!important;color:#c5ddd5!important}
[data-theme="dark"] .study-reader-toolbar button:first-child,[data-theme="dark"] .study-reader-toolbar button:hover{background:#1b4236!important;color:#a9ebca!important}
[data-theme="dark"] .study-reader-content,[data-theme="dark"] .study-reader-empty{background:linear-gradient(135deg,#101a19,#0d1615)!important}
[data-theme="dark"] .study-reader-document-head{background:linear-gradient(118deg,#142522 0%,#123126 60%,#174233 100%)!important}
[data-theme="dark"] .study-reader-note-paper,[data-theme="dark"] .study-reader-share{border-color:#29463f!important;background:#121f1d!important}
[data-theme="dark"] .study-reader-note-paper textarea{background:#16211a!important;background-image:repeating-linear-gradient(transparent,transparent 30px,#2a4035 31px)!important;color:#d4ded4!important}
[data-theme="dark"] .study-reader-ai{background:linear-gradient(145deg,#153127,#10241e)!important}
[data-theme="dark"] .study-reader-ai-copy,[data-theme="dark"] .study-reader-ai-status,[data-theme="dark"] .study-reader-ai-result,[data-theme="dark"] .study-reader-share small{color:#91aaa3!important}
[data-theme="dark"] .study-reader-share-actions button{border-color:#315149!important;background:#162d26!important;color:#a9e3c6!important}
[data-theme="dark"] .student-reader-body,[data-theme="dark"] .student-reader-body *,[data-theme="dark"] .document-paper-view,[data-theme="dark"] .document-paper-view *{color:#d5ded8!important}
[data-theme="dark"] .student-reader-body a{color:#8bdabd!important}
[data-theme="dark"] .study-reader-highlight{background:#665a20!important;color:#fff4ba!important}

/* Shared lesson document rhythm: keep Admin editor and User reader aligned */
.review-lesson-document,
#admin-subtab-review-lessons .tox-edit-area__iframe {
  --lesson-content-max: 820px;
}
.review-lesson-document {
  max-width: var(--lesson-content-max);
  margin: 0 auto;
  padding: 18px 24px 34px;
  line-height: 1.8;
}
.review-lesson-document p,
.study-reader-content .student-reader-body p {
  margin: 0 0 14px;
}
.review-lesson-document h2,
.review-lesson-document h3,
.review-lesson-document h4,
.study-reader-content .student-reader-body h2,
.study-reader-content .student-reader-body h3,
.study-reader-content .student-reader-body h4 {
  margin: 26px 0 10px;
  line-height: 1.3;
}
.review-lesson-document ul,
.review-lesson-document ol,
.study-reader-content .student-reader-body ul,
.study-reader-content .student-reader-body ol {
  margin: 0 0 16px;
  padding-left: 1.5em;
}
.review-lesson-document img:not(.review-floating-media),
.study-reader-content .student-reader-body img:not(.review-floating-media) {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px auto;
}
.review-lesson-document img.review-floating-media,
.study-reader-content .student-reader-body img.review-floating-media {
  max-width: min(70%, 560px);
  height: auto;
  box-sizing: border-box;
}
.review-lesson-document table,
.study-reader-content .student-reader-body table {
  width: 100%;
  margin: 16px 0;
}
@media (max-width: 720px) {
  .review-lesson-document { padding: 14px 18px 28px; }
  .review-lesson-document img.review-floating-media,
  .study-reader-content .student-reader-body img.review-floating-media { max-width: 82%; }
}

/* Study Hub hero illustration — hero_student.webp */
#study-space-root .study-hub-art-img{position:absolute;z-index:2;right:34px;bottom:0;height:222px;width:auto;border-radius:20px 20px 6px 6px;object-fit:cover;box-shadow:0 18px 34px color-mix(in srgb,var(--primary) 26%,transparent),0 4px 10px color-mix(in srgb,var(--foreground) 12%,transparent);border:2px solid color-mix(in srgb,var(--card) 78%,transparent)}
@media (max-width:1100px){#study-space-root .study-hub-art-img{right:24px;height:185px}}
@media (max-width:720px){#study-space-root .study-hub-art-img{right:20px;height:124px;border-radius:16px 16px 4px 4px}}

/* Study Hub cleanup: focus the hero on the learning action, not repeated counts */
#study-space-root .study-hub-hero-copy{max-width:680px}
#study-space-root .study-hub-hero-actions{display:flex;align-items:center;margin-top:22px}
#study-space-root .study-hub-hero-art{min-height:220px}
#study-space-root .study-hub-stats p{margin:7px 0 12px;color:var(--text-muted);font-size:12px;line-height:1.5}
#study-space-root .study-hub-stats button{margin-top:2px}
@media(max-width:720px){#study-space-root .study-hub-hero-actions{margin-top:18px}#study-space-root .study-hub-hero-art{min-height:145px}}

/* Study Hub hero character: match the larger anchored treatment used by News */
#study-space-root .study-hub-hero{overflow:visible}
#study-space-root .study-hub-hero-art{height:236px;min-height:236px;align-self:end;overflow:visible}
#study-space-root .study-hub-art-img{right:22px;bottom:-10px;height:278px;max-height:none;border:0;border-radius:0;box-shadow:0 18px 30px color-mix(in srgb,var(--primary) 20%,transparent);object-fit:contain;object-position:center bottom}
@media (max-width:1100px){#study-space-root .study-hub-hero-art{height:210px;min-height:210px}#study-space-root .study-hub-art-img{right:12px;height:246px}}
@media (max-width:720px){#study-space-root .study-hub-hero-art{height:158px;min-height:158px}#study-space-root .study-hub-art-img{right:12px;bottom:-5px;height:180px}}

/* Final Study Hub hero balance: contained character, clear copy, no panel overlap */
#study-space-root .study-hub-hero{overflow:hidden}
#study-space-root .study-hub-hero-art{height:210px;min-height:210px;overflow:hidden}
#study-space-root .study-hub-art-img{right:26px;bottom:0;height:238px;max-height:238px;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 14px 16px rgba(0,90,60,.16))}
@media(max-width:1100px){#study-space-root .study-hub-hero-art{height:190px;min-height:190px}#study-space-root .study-hub-art-img{right:10px;height:215px;max-height:215px}}
@media(max-width:720px){#study-space-root .study-hub-hero-art{height:135px;min-height:135px}#study-space-root .study-hub-art-img{right:8px;bottom:0;height:154px;max-height:154px}}

/* Keep the character fully visible while the hero still clips at its outer frame */
#study-space-root .study-hub-hero-art{overflow:visible}

/* Hero character final alignment: enlarge and anchor the feet to the frame bottom */
#study-space-root .study-hub-art-img{right:18px;bottom:-1px;height:268px;max-height:268px}
@media(max-width:1100px){#study-space-root .study-hub-art-img{right:8px;bottom:-1px;height:240px;max-height:240px}}
@media(max-width:720px){#study-space-root .study-hub-art-img{right:6px;bottom:-1px;height:174px;max-height:174px}}

/* Remove the grid-cell bottom gap so the character meets the hero frame */
#study-space-root .study-hub-art-img{bottom:-29px}
@media(max-width:1100px){#study-space-root .study-hub-art-img{bottom:-26px}}
@media(max-width:720px){#study-space-root .study-hub-art-img{bottom:-18px}}

/* Transparent character asset: no rectangular source background or artificial shadow */
#study-space-root .study-hub-art-img{filter:none;box-shadow:none;background:transparent}

/* Preserve Admin Enter paragraphs in the User reader without oversized gaps */
.study-reader-content .student-reader-body p,
.study-reader-content .student-reader-body div{margin:0 0 14px;line-height:1.8}
.study-reader-content .student-reader-body p:empty,
.study-reader-content .student-reader-body div:empty{min-height:1.8em;margin-bottom:0}
.study-reader-content .student-reader-body p br:only-child{display:block;content:"";min-height:1.8em}

/* Header notification shortcut: replaces the old sidebar entry */
.notification-top-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;color:var(--text-primary)}
.notification-top-btn .badge-dot{position:absolute;top:7px;right:7px;width:7px;height:7px;margin:0;border:2px solid var(--bg-card);border-radius:50%;background:var(--danger);display:block}
.notification-top-btn .badge-dot[hidden]{display:none}
@media(max-width:480px){.notification-top-btn{width:40px;height:40px;flex-basis:40px}}

/* Safe narrow viewport behavior: prevent Home Hero copy from collapsing beside the fixed artwork */
@media (max-width:1200px) and (min-width:901px){
  .home-hero-section{height:auto;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);gap:24px;padding:36px 32px 28px;}
  .home-hero-left{min-width:0;width:100%;}
  .home-hero-desc{max-width:720px;}
  .home-hero-right{width:100%;min-height:340px;height:340px;}
}
@media (max-width:900px){
  .home-hero-left{width:100%;min-width:0;}
  .home-hero-desc{max-width:none;overflow-wrap:break-word;word-break:normal;}
}

/* Study Hub hero artwork: larger, centered in its existing art column */
#study-space-root .study-hub-hero-art{min-height:250px;height:250px;align-self:end}
#study-space-root .study-hub-art-img{right:8px;bottom:-1px;height:320px;max-height:320px;object-fit:contain;object-position:center bottom}
@media(max-width:1100px){#study-space-root .study-hub-hero-art{min-height:220px;height:220px}#study-space-root .study-hub-art-img{right:2px;height:270px;max-height:270px}}
@media(max-width:720px){#study-space-root .study-hub-hero-art{min-height:150px;height:150px}#study-space-root .study-hub-art-img{right:0;height:195px;max-height:195px}}

/* Align enlarged Study Hub artwork with the hero frame bottom */
#study-space-root .study-hub-art-img{bottom:-29px}
@media(max-width:1100px){#study-space-root .study-hub-art-img{bottom:-26px}}
@media(max-width:720px){#study-space-root .study-hub-art-img{bottom:-18px}}

/* Study Hub hero artwork: stronger visual presence while preserving the existing layout */
#study-space-root .study-hub-art-img{right:-2px;bottom:-29px;height:400px;max-height:400px;width:auto;max-width:46%;object-fit:contain;object-position:center bottom}
#study-space-root .study-hub-hero-art{min-height:285px;height:285px}
@media(max-width:1100px){#study-space-root .study-hub-hero-art{min-height:235px;height:235px}#study-space-root .study-hub-art-img{right:-2px;bottom:-26px;height:330px;max-height:330px;max-width:48%}}
@media(max-width:720px){#study-space-root .study-hub-hero-art{min-height:165px;height:165px}#study-space-root .study-hub-art-img{right:0;bottom:-18px;height:225px;max-height:225px;max-width:56%}}

/* Correct only the Study Hub image scale; restore the original hero layout height */
#study-space-root .study-hub-hero-art{min-height:210px;height:210px;}
#study-space-root .study-hub-art-img{right:8px;bottom:-29px;height:400px;max-height:400px;max-width:none;width:auto;object-fit:contain;object-position:center bottom;}
@media(max-width:1100px){#study-space-root .study-hub-hero-art{min-height:190px;height:190px}#study-space-root .study-hub-art-img{right:2px;bottom:-26px;height:330px;max-height:330px;max-width:none}}
@media(max-width:720px){#study-space-root .study-hub-hero-art{min-height:135px;height:135px}#study-space-root .study-hub-art-img{right:0;bottom:-18px;height:225px;max-height:225px;max-width:none}}

/* Final image-only scale: enlarge the asset without enlarging or reshaping the hero */
#study-space-root .study-hub-art-img{right:0;bottom:-2px;width:360px;height:auto;max-width:none;max-height:none;object-fit:contain;object-position:center bottom}
@media(max-width:1100px){#study-space-root .study-hub-art-img{right:0;bottom:-2px;width:300px;height:auto}}
@media(max-width:720px){#study-space-root .study-hub-art-img{right:0;bottom:-2px;width:230px;height:auto}}

/* Anchor the image-only enlargement to the bottom edge of the existing hero */
#study-space-root .study-hub-art-img{bottom:-29px}
@media(max-width:1100px){#study-space-root .study-hub-art-img{bottom:-26px}}
@media(max-width:720px){#study-space-root .study-hub-art-img{bottom:-18px}}

/* Study Hub Gen Z visual layer — scoped to learning space only */
#study-space-root .study-hub-shell{position:relative;isolation:isolate;background:radial-gradient(circle at 12% 8%,rgba(71,225,173,.16),transparent 22%),radial-gradient(circle at 78% 0%,rgba(117,152,255,.11),transparent 21%);border-radius:28px}
#study-space-root .study-hub-hero{border-color:rgba(16,185,129,.34);background:linear-gradient(118deg,#f8fffd 0%,#effff7 52%,#ebfdf6 100%);box-shadow:0 18px 38px rgba(24,152,103,.12)}
#study-space-root .study-hub-hero::before{content:"";position:absolute;z-index:0;left:46%;top:18px;width:76px;height:16px;background:repeating-linear-gradient(90deg,#4f46e5 0 7px,transparent 7px 13px);opacity:.42;transform:rotate(-6deg)}
#study-space-root .study-hub-hero-copy{isolation:isolate}
#study-space-root .study-hub-kicker{border:1px solid rgba(16,185,129,.25);background:rgba(255,255,255,.76);box-shadow:0 5px 14px rgba(16,185,129,.1)}
#study-space-root .study-hub-hero h1{letter-spacing:0;text-wrap:balance}
#study-space-root .study-hub-hero-actions button{border:1px solid rgba(255,255,255,.55);border-radius:14px;box-shadow:0 11px 22px rgba(0,185,107,.24)}
#study-space-root .study-hub-catalog{position:relative;border-color:rgba(16,185,129,.22);background:linear-gradient(155deg,rgba(255,255,255,.96),rgba(241,255,248,.92));box-shadow:0 14px 28px rgba(32,91,75,.08)}
#study-space-root .study-hub-catalog::after{content:"";position:absolute;right:24px;bottom:17px;width:48px;height:10px;background:repeating-linear-gradient(90deg,#14b8a6 0 6px,transparent 6px 12px);opacity:.38}
#study-space-root .study-hub-search{background:#fff;border-color:rgba(20,184,166,.35);box-shadow:0 5px 16px rgba(20,184,166,.08)}
#study-space-root .study-space-filter{border-color:rgba(79,70,229,.16);background:#fff;box-shadow:0 3px 9px rgba(15,23,42,.04)}
#study-space-root .study-space-filter.active{background:linear-gradient(135deg,#00bd73,#0fd68b);border-color:#00bd73;box-shadow:0 8px 16px rgba(0,185,107,.26)}
#study-space-root .study-hub-subject-card{border-color:rgba(20,184,166,.2);background:linear-gradient(160deg,#fff,#f5fffa);box-shadow:0 8px 18px rgba(21,91,72,.07)}
#study-space-root .study-hub-subject-card::before{height:5px;background:linear-gradient(90deg,#00c47a,#14b8a6,#6366f1)}
#study-space-root .study-hub-subject-card:hover{transform:translateY(-5px) rotate(-.35deg);box-shadow:0 17px 28px rgba(25,143,103,.16)}
#study-space-root .study-hub-ai-panel{border-color:rgba(99,102,241,.22);background:linear-gradient(165deg,#fbfaff,#f3fff9 42%,#fff);box-shadow:0 16px 30px rgba(61,73,144,.1)}
#study-space-root .study-hub-ai-heading{background:linear-gradient(135deg,#e8fff4,#eef0ff);border:1px solid rgba(99,102,241,.13)}
#study-space-root .study-hub-ai-tool{border-color:rgba(20,184,166,.18);background:rgba(255,255,255,.82)}
#study-space-root .study-hub-ai-tool:hover{transform:translateX(-3px);border-color:rgba(99,102,241,.4);box-shadow:0 9px 18px rgba(99,102,241,.12)}
#study-space-root .study-hub-stats{border-color:rgba(251,146,60,.24);background:linear-gradient(135deg,#fffaf0,#f3fff9)}
[data-theme="dark"] #study-space-root .study-hub-shell{background:radial-gradient(circle at 12% 8%,rgba(16,185,129,.13),transparent 22%),radial-gradient(circle at 78% 0%,rgba(99,102,241,.13),transparent 21%)}
[data-theme="dark"] #study-space-root .study-hub-hero{background:linear-gradient(118deg,#0e1917,#102920 52%,#14251f);border-color:#265d4c}
[data-theme="dark"] #study-space-root .study-hub-catalog{background:linear-gradient(155deg,#101d1a,#12251f);border-color:#254c40}
[data-theme="dark"] #study-space-root .study-hub-search,[data-theme="dark"] #study-space-root .study-space-filter,[data-theme="dark"] #study-space-root .study-hub-ai-tool{background:#14231f;border-color:#285448}
[data-theme="dark"] #study-space-root .study-hub-ai-panel{background:linear-gradient(165deg,#151b2a,#10241e);border-color:#39476d}
[data-theme="dark"] #study-space-root .study-hub-ai-heading{background:linear-gradient(135deg,#173429,#1d2440);border-color:#334b68}
[data-theme="dark"] #study-space-root .study-hub-subject-card{background:linear-gradient(160deg,#12231e,#101b19);border-color:#254a40}
@media(max-width:720px){#study-space-root .study-hub-hero::before,#study-space-root .study-hub-catalog::after{display:none}#study-space-root .study-hub-subject-card:hover{transform:translateY(-2px)}}

/* Study Hub — calm base with small Gen Z stickers (overrides the heavy visual layer) */
#study-space-root .study-hub-shell{background:transparent}
#study-space-root .study-hub-hero{isolation:isolate;background:#fff;border-color:#d9eee5;box-shadow:0 12px 28px rgba(15,23,42,.06)}
#study-space-root .study-hub-hero::before{left:auto;right:300px;top:18px;width:48px;height:9px;background:repeating-linear-gradient(90deg,#6d5dfc 0 6px,transparent 6px 11px);opacity:.35;transform:rotate(-8deg)}
#study-space-root .study-hub-hero::after{content:"✦  ✧  ✦";position:absolute;z-index:1;right:28px;top:20px;color:#ffb703;font-size:18px;letter-spacing:6px;text-shadow:0 2px 0 #fff;pointer-events:none}
#study-space-root .study-hub-kicker{background:#fff;border-color:#ccebdc;box-shadow:none}
#study-space-root .study-hub-catalog{background:#fff;border-color:#dcebe6;box-shadow:0 10px 24px rgba(15,23,42,.05)}
#study-space-root .study-hub-catalog::after{right:26px;bottom:18px;width:44px;height:8px;background:repeating-linear-gradient(90deg,#14b8a6 0 5px,transparent 5px 10px);opacity:.32}
#study-space-root .study-hub-search{background:#fff;border-color:#bfe5d5;box-shadow:none}
#study-space-root .study-space-filter{background:#fff;border-color:#e0e7e4;box-shadow:none}
#study-space-root .study-space-filter.active{background:#00b96b;border-color:#00b96b;box-shadow:0 7px 14px rgba(0,185,107,.2)}
#study-space-root .study-hub-subject-card{background:#fff;border-color:#deebe6;box-shadow:0 6px 14px rgba(15,23,42,.045)}
#study-space-root .study-hub-subject-card:hover{transform:translateY(-4px);box-shadow:0 14px 24px rgba(15,23,42,.1)}
#study-space-root .study-hub-ai-panel{background:#fff;border-color:#dce8e3;box-shadow:0 12px 25px rgba(15,23,42,.06)}
#study-space-root .study-hub-ai-heading{background:#f5fff9;border-color:#d9eee4}
#study-space-root .study-hub-ai-tool{background:#fff;border-color:#dfeae5}
#study-space-root .study-hub-ai-tool:hover{transform:translateX(-2px);box-shadow:0 8px 16px rgba(15,23,42,.08)}
#study-space-root .study-hub-stats{background:#fff;border-color:#dfe9e5}
[data-theme="dark"] #study-space-root .study-hub-shell{background:#050505}
[data-theme="dark"] #study-space-root .study-hub-hero{background:#080808;border-color:#222;box-shadow:none}
[data-theme="dark"] #study-space-root .study-hub-hero::before{opacity:.5}[data-theme="dark"] #study-space-root .study-hub-hero::after{text-shadow:none}
[data-theme="dark"] #study-space-root .study-hub-catalog,[data-theme="dark"] #study-space-root .study-hub-ai-panel,[data-theme="dark"] #study-space-root .study-hub-stats{background:#0b0b0b;border-color:#242424;box-shadow:none}
[data-theme="dark"] #study-space-root .study-hub-search,[data-theme="dark"] #study-space-root .study-space-filter,[data-theme="dark"] #study-space-root .study-hub-ai-tool,[data-theme="dark"] #study-space-root .study-hub-subject-card{background:#101010;border-color:#282828;box-shadow:none}
[data-theme="dark"] #study-space-root .study-hub-ai-heading{background:#111;border-color:#292929}
@media(max-width:720px){#study-space-root .study-hub-hero::after{right:16px;top:13px;font-size:14px;letter-spacing:3px}#study-space-root .study-hub-hero::before{display:none}}

/* Lesson AI summary controls */
.study-reader-ai-modes{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:0 13px 10px}.study-reader-ai-modes button,.study-reader-ai-actions button{border:1px solid #cfe9df;border-radius:9px;background:#fff;color:#246457;padding:7px 5px;font:700 11px 'Inter',sans-serif}.study-reader-ai-modes button.active{background:#0bb87c;color:#fff;border-color:#0bb87c}.study-reader-ai-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:11px 13px 0}.study-reader-ai-actions button:last-child{grid-column:1/-1}.study-reader-ai-actions button:disabled{opacity:.5;cursor:not-allowed}.study-reader-ai-result section{margin:10px 13px 0;padding-top:9px;border-top:1px solid #dceee7}.study-reader-ai-result b{color:#17634d}.study-reader-ai-result ul{margin:6px 0 0;padding-left:17px}.study-reader-ai-result small{display:block;margin:10px 13px;color:#6c8e88}.admin-ai-summary-settings{margin-top:16px;padding:14px;border:1px solid var(--border);border-radius:12px;background:var(--bg-subtle)}.admin-ai-summary-heading{display:flex;justify-content:space-between;gap:8px;align-items:center;font-size:13px}.admin-ai-summary-status{font-size:11px;color:var(--success)}.admin-ai-summary-status.stale{color:var(--warning)}.admin-ai-summary-switch{display:flex;gap:8px;align-items:center;margin:12px 0;font-size:12px;font-weight:700}.admin-ai-summary-actions{display:grid;gap:7px}.admin-ai-summary-actions small{color:var(--text-muted);font-size:11px}@media(max-width:720px){.study-reader-ai-actions{grid-template-columns:1fr}.study-reader-ai-actions button:last-child{grid-column:auto}}
[data-theme="dark"] .study-reader-ai-modes button,[data-theme="dark"] .study-reader-ai-actions button{background:#14231f;color:#cbe4da;border-color:#315149}[data-theme="dark"] .study-reader-ai-result section{border-color:#315149}[data-theme="dark"] .study-reader-ai-result b{color:#9ce3c4}

/* ═══════════════════════════════════════════════════════════════
   CURRICULUM SUMMARY PAGE — Tóm Tắt Giáo Trình Cá Nhân
   ═══════════════════════════════════════════════════════════════ */
#page-curriculum-summary {
  min-height: calc(100vh - 64px);
  background: #f8fafc;
  width: auto;
  margin: -24px;
  padding: 24px 24px 48px;
}
[data-theme="dark"] #page-curriculum-summary { background: #0b0f19; }
@media (max-width: 768px) {
  #page-curriculum-summary {
    margin: -16px;
    padding: 16px 12px 32px;
  }
}


.curriculum-summary-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  position: relative;
}

/* ── HEADER ── */
.curriculum-summary-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  background: linear-gradient(135deg, #00b96b 0%, #0076a8 100%);
  border-radius: 24px;
  padding: 36px 40px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.curriculum-summary-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.curriculum-summary-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.curriculum-summary-header h1 {
  font-size: 38px;
  font-weight: 900;
  color: #fff;
  line-height: 1.12;
  margin: 0 0 12px;
}
.curriculum-summary-header h1 em { font-style: italic; opacity: 0.85; }
.curriculum-summary-header p {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  margin: 0;
}
.curriculum-summary-header-art {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}
.cs-art-orb {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}
.cs-art-orb-1 { width: 100px; height: 100px; top: 10px; left: 10px; animation: floatOrb 4s ease-in-out infinite; }
.cs-art-orb-2 { width: 60px; height: 60px; top: 30px; left: 30px; background: rgba(255,255,255,0.18); animation: floatOrb 4s ease-in-out infinite reverse; }
.cs-art-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  font-size: 48px;
  color: rgba(255,255,255,0.9);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}
@keyframes floatOrb { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ── BODY: 2 COL ── */
.curriculum-summary-body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  align-items: start;
}

/* ── INPUT PANEL ── */
.curriculum-input-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 2px 12px rgba(15,23,42,0.07);
}

/* DROPZONE */
.curriculum-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
  cursor: pointer;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.curriculum-dropzone:hover,
.curriculum-dropzone.drag-over {
  border-color: #3b82f6;
  background: #eff6ff;
}
.curriculum-dropzone.drag-over .curriculum-dropzone-inner { transform: scale(1.03); }
.curriculum-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  text-align: center;
  transition: transform 0.2s;
}
.curriculum-dropzone-icon {
  font-size: 36px;
  color: #3b82f6;
  margin-bottom: 4px;
  animation: floatOrb 3s ease-in-out infinite;
}
.curriculum-dropzone-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  margin: 0;
}
.curriculum-dropzone-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.curriculum-upload-btn { cursor: pointer; }

/* File Preview */
.curriculum-file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  width: 100%;
  background: var(--bg-subtle);
}
.curriculum-file-preview b { font-size: 13px; display: block; }
.curriculum-file-preview small { color: var(--text-muted); font-size: 11px; }
.curriculum-remove-file {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 14px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.curriculum-remove-file:hover { background: #fee2e2; color: #ef4444; }

/* OR DIVIDER */
.curriculum-or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.curriculum-or-divider::before,
.curriculum-or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* TEXT AREA */
.curriculum-text-area {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  background: #f8fafc;
  color: var(--text-primary);
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.curriculum-text-area:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.curriculum-char-count { color: var(--text-muted); font-size: 11px; text-align: right; display: block; }

/* MODE BUTTONS */
.curriculum-options-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.curriculum-mode-label { font-size: 12px; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.curriculum-mode-group { display: flex; gap: 6px; }
.curriculum-mode-btn {
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  padding: 7px 13px;
  font: 700 12px 'Inter', sans-serif;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s;
}
.curriculum-mode-btn:hover { border-color: #3b82f6; color: #2563eb; }
.curriculum-mode-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

/* TITLE INPUT */
.curriculum-title-input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 13px;
  font: 500 13px 'Inter', sans-serif;
  background: #f8fafc;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.curriculum-title-input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

/* RUN BUTTON */
.curriculum-run-btn {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 13px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: none;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 6px 20px rgba(37,99,235,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.2px;
}
.curriculum-run-btn:hover:not(:disabled) { opacity: 0.92; transform: translateY(-2px); box-shadow: 0 10px 28px rgba(37,99,235,0.35); }
.curriculum-run-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* STATUS */
.curriculum-status {
  min-height: 20px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}
.curriculum-status.loading { color: #4f46e5; }
.curriculum-status.error { color: var(--danger, #ef4444); }
.curriculum-status.success { color: #16a34a; }

/* ── OUTPUT PANEL ── */
.curriculum-output-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* RESULT CARD */
.curriculum-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  min-height: 200px;
  display: flex;
  align-items: stretch;
  flex-direction: column;
}
.curriculum-result-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 24px;
  flex: 1;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}
.curriculum-result-content { padding: 20px 24px; }
.curriculum-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.curriculum-result-header b { font-size: 15px; color: var(--text-primary); }
.curriculum-result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#curriculum-result-body section {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
#curriculum-result-body section:last-child { border-bottom: none; margin-bottom: 0; }
#curriculum-result-body b { font-size: 12px; color: #4f46e5; text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 6px; }
#curriculum-result-body ul { margin: 0; padding-left: 18px; }
#curriculum-result-body li { font-size: 13px; color: var(--text-primary); margin-bottom: 4px; line-height: 1.5; }
#curriculum-result-body small { display: block; margin-top: 10px; font-size: 11px; color: var(--text-muted); font-style: italic; }

/* HISTORY CARD */
.curriculum-history-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: 0 4px 20px rgba(99,102,241,0.04);
}
.curriculum-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
}
.curriculum-history-header b { color: var(--text-primary); }
.curriculum-history-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.curriculum-history-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 20px 0; font-style: italic; }
.curriculum-history-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  padding: 10px 13px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}
.curriculum-history-item:hover { border-color: #3b82f6; background: #eff6ff; }
.curriculum-history-item-title { font-size: 13px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.curriculum-history-item-meta { font-size: 11px; color: var(--text-muted); }
.curriculum-history-item-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #dbeafe;
  color: #1d4ed8;
  white-space: nowrap;
}

/* BTN GHOST/XS */
.btn-ghost { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; transition: background 0.15s, color 0.15s; }
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text-primary); }
.btn-xs { font-size: 11px; padding: 4px 10px; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .curriculum-summary-body { grid-template-columns: 1fr; }
  .curriculum-summary-header { grid-template-columns: 1fr; }
  .curriculum-summary-header-art { display: none; }
  .curriculum-summary-header { padding: 26px 22px; }
  .curriculum-summary-header h1 { font-size: 28px; }
  .curriculum-summary-shell { padding: 16px 12px 32px; }
}
@media (max-width: 480px) {
  .curriculum-mode-group { gap: 4px; }
  .curriculum-mode-btn { padding: 6px 10px; font-size: 11px; }
}

/* DARK MODE — Neutral dark blue-gray, không tím */
[data-theme="dark"] .curriculum-input-panel,
[data-theme="dark"] .curriculum-result-card,
[data-theme="dark"] .curriculum-history-card {
  background: #1e2433;
  border-color: #2d3748;
}
[data-theme="dark"] .curriculum-dropzone { background: #1a2030; border-color: #2563eb; }
[data-theme="dark"] .curriculum-dropzone:hover, [data-theme="dark"] .curriculum-dropzone.drag-over { background: rgba(37,99,235,0.08); border-color: #60a5fa; }
[data-theme="dark"] .curriculum-text-area,
[data-theme="dark"] .curriculum-title-input { background: #1a2030; border-color: #2d3748; color: #cbd5e1; }
[data-theme="dark"] .curriculum-mode-btn { background: #1a2030; border-color: #2d3748; color: #94a3b8; }
[data-theme="dark"] .curriculum-history-item { background: #1a2030; border-color: #2d3748; }
[data-theme="dark"] .curriculum-history-item:hover { background: rgba(59,130,246,0.08); }
[data-theme="dark"] .curriculum-history-card { background: #1e2433; border-color: #2d3748; }
[data-theme="dark"] .cs-header-hero { background: #1e2433; border-color: #2d3748; }
[data-theme="dark"] .cs-hero-copy h1 { color: #f1f5f9; }
[data-theme="dark"] .cs-hero-copy p { color: #94a3b8; }
[data-theme="dark"] .cs-mode-card { background: #1e2433; border-color: #2d3748; }
[data-theme="dark"] .cs-mode-card.active { background: #1e3a5f; border-color: #3b82f6; }
[data-theme="dark"] .cs-mode-card.active .cs-mc-icon { background: #2563eb; }
[data-theme="dark"] .cs-mc-icon { background: #1e3a5f; color: #60a5fa; }
[data-theme="dark"] .curriculum-history-card { background: #1e2433; }

/* ═══════════════════════════════════════════════════════════════
   GEN Z STICKERS & MODERN REDESIGN (MATCHING SCREENSHOTS 2, 3, 4)
   ═══════════════════════════════════════════════════════════════ */

/* ── INPUT / RESULT STAGE WRAPPERS ── */
.cs-input-stage {
  position: relative;
  z-index: 2;
}

.cs-result-stage {
  position: relative;
  z-index: 2;
}

/* ── STICKER OVERLAYS ── */
.cs-sticker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.cs-sticker-washi-tape {
  position: absolute;
  top: 14px;
  right: 180px;
  width: 90px;
  height: 18px;
  transform: rotate(-10deg);
  background: repeating-linear-gradient(90deg, #c084fc 0 10px, transparent 10px 15px);
  opacity: 0.8;
  border-radius: 2px;
}

.cs-sticker-sparkles {
  position: absolute;
  top: 18px;
  right: 80px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.cs-sparkle-star {
  animation: csSparkleTwinkle 2.5s infinite ease-in-out alternate;
}

@keyframes csSparkleTwinkle {
  0% { transform: scale(0.85) rotate(-5deg); opacity: 0.7; }
  100% { transform: scale(1.18) rotate(12deg); opacity: 1; filter: drop-shadow(0 0 6px #f59e0b); }
}

.cs-sticker-dot-grid {
  position: absolute;
  bottom: 12px;
  right: 28px;
  width: 140px;
  height: 45px;
  background-image: radial-gradient(#6ee7b7 2.5px, transparent 3px);
  background-size: 14px 14px;
  opacity: 0.6;
}

.cs-sticker-mint-wave {
  position: absolute;
  top: -80px;
  right: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 2px solid rgba(167, 243, 208, 0.4);
  background: radial-gradient(circle, rgba(209,250,229,0.3) 0%, transparent 70%);
}

/* ── Ẩn sticker khi dark mode ── */
.dark .cs-sticker-layer,
[data-theme="dark"] .cs-sticker-layer,
[data-theme="dark"] .cs-sticker-washi-tape,
[data-theme="dark"] .cs-sticker-sparkles,
[data-theme="dark"] .cs-sticker-dot-grid,
[data-theme="dark"] .cs-sticker-mint-wave,
[data-theme="dark"] .cs-sparkle-star {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* ── HEADER BANNER (SCREENSHOT 2 STYLE) ── */
/* ── FUTURISTIC HIGH-TECH HEADER HERO DECORATIONS ── */
.cs-header-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  background: #ffffff;
  border: 1px solid #d1fae5;
  border-radius: 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08);
  overflow: hidden;
}

.cs-hero-cyber-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 50%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 85% 30%, rgba(37, 99, 235, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.cs-hero-left {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 2;
}

.cs-hero-badge-icon {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: linear-gradient(135deg, #10b981 0%, #2563eb 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.35);
  flex-shrink: 0;
}

.cs-hero-pulse-ring {
  position: absolute;
  inset: -4px;
  border-radius: 22px;
  border: 2px solid rgba(16, 185, 129, 0.4);
  animation: csPulseRing 2.2s infinite ease-out;
  pointer-events: none;
}

@keyframes csPulseRing {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.12); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

.cs-hero-copy h1 {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px;
  letter-spacing: -0.4px;
}

.cs-hero-copy p {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

.cs-hero-kicker {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.cs-tech-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cs-tech-pill.green {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.cs-tech-pill.blue {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Right side stat cards on Hero */
.cs-hero-tech-widgets {
  display: flex;
  gap: 14px;
  position: relative;
  z-index: 2;
}

.cs-tech-stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.cs-stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.cs-stat-icon.green {
  background: #dcfce7;
  color: #10b981;
}

.cs-stat-icon.blue {
  background: #dbeafe;
  color: #2563eb;
}

.cs-stat-val {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.cs-stat-lbl {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
}

/* ── MODE RADIO CARDS (SCREENSHOT 2 STYLE) ── */
.cs-mode-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.cs-mode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.cs-mode-card:hover {
  border-color: #10b981;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.12);
}

.cs-mode-card.active {
  background: #f0fdf4;
  border-color: #10b981;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
}

.cs-mc-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #dcfce7;
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.cs-mode-card.active .cs-mc-icon {
  background: linear-gradient(135deg, #10b981 0%, #2563eb 100%);
  color: #ffffff;
}

.cs-mc-content {
  flex: 1;
}

.cs-mc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.cs-mc-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.cs-mc-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.cs-mode-card.active .cs-mc-check {
  display: flex;
}

/* ── DOCUMENT BANNER & TABS (SCREENSHOT 3 & 4 STYLE) ── */
.cs-doc-banner {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.cs-doc-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cs-doc-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fee2e2;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.cs-doc-details h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.cs-doc-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.cs-tab-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 24px;
}

.cs-tab-item {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-tab-item:hover { color: #2563eb; }

.cs-tab-item.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

/* ── RESULT WIDGETS (SCREENSHOT 3 STYLE) ── */
.cs-result-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

.cs-summary-main-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cs-overview-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 18px;
  padding: 20px 22px;
}

.cs-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cs-overview-header b {
  font-size: 16px;
  font-weight: 800;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-badge-count {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  background: #dcfce7;
  color: #15803d;
}

.cs-section-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
}

.cs-section-card h4 {
  font-size: 15px;
  font-weight: 800;
  color: #3b82f6;
  margin: 0 0 12px;
}

.cs-section-card ul {
  margin: 0;
  padding-left: 18px;
}

.cs-section-card li {
  font-size: 13.5px;
  line-height: 1.65;
  color: #334155;
  margin-bottom: 8px;
}

/* ── RIGHT WIDGETS (GREEN, PINK, PURPLE) ── */
.cs-widgets-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cs-widget-green {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 18px;
  padding: 18px 20px;
}

.cs-widget-green h5 {
  font-size: 14px;
  font-weight: 800;
  color: #15803d;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-widget-green ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cs-widget-green li {
  font-size: 13px;
  color: #166534;
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  line-height: 1.5;
}

.cs-widget-green li::before {
  content: "✓";
  font-weight: 800;
  color: #16a34a;
}

.cs-widget-pink {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 18px;
  padding: 18px 20px;
}

.cs-widget-pink h5 {
  font-size: 14px;
  font-weight: 800;
  color: #b91c1c;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-widget-pink ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cs-widget-pink li {
  font-size: 13px;
  color: #991b1b;
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  line-height: 1.5;
}

.cs-widget-pink li::before {
  content: "⚠";
  color: #ef4444;
}

.cs-widget-purple {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: 18px;
  padding: 18px 20px;
}

.cs-widget-purple h5 {
  font-size: 14px;
  font-weight: 800;
  color: #6b21a8;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-pill-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cs-pill-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #d8b4fe;
  color: #7e22ce;
  box-shadow: 0 2px 6px rgba(126, 34, 206, 0.06);
}

/* ── MINDMAP & DOC ASSISTANT (SCREENSHOT 4 STYLE) ── */
.cs-mindmap-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

.cs-mindmap-wrapper {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  height: 540px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.04);
}

.cs-mindmap-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.cs-mm-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.06);
  transition: all 0.15s;
}

.cs-mm-btn:hover {
  background: #f8fafc;
  color: #4f46e5;
}

.cs-mindmap-svg {
  width: 100%;
  height: 100%;
}

/* ── DOC ASSISTANT SIDEBAR WIDGET ── */
.cs-doc-assistant-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  height: 540px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.cs-da-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.cs-da-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.cs-da-title { font-size: 14px; font-weight: 800; color: var(--text-primary); margin: 0 0 2px; }
.cs-da-sub { font-size: 11px; color: var(--text-muted); margin: 0; }

.cs-da-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cs-da-welcome-bubble {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  font-size: 12.5px;
  color: #1e40af;
  line-height: 1.5;
}

.cs-da-bot-icon { font-size: 18px; color: #2563eb; flex-shrink: 0; }

.cs-da-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-da-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 12px;
  color: #334155;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.cs-da-chip:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #f0f9ff;
}

.cs-da-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.cs-da-msg { display: flex; flex-direction: column; }
.cs-da-msg-user { align-items: flex-end; }
.cs-da-msg-bot { align-items: flex-start; }

.cs-da-msg-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.5;
}

.cs-da-msg-user .cs-da-msg-bubble {
  background: #2563eb;
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.cs-da-msg-bot .cs-da-msg-bubble {
  background: #f1f5f9;
  color: #1e293b;
  border-bottom-left-radius: 2px;
}

.cs-da-typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  margin: 0 2px;
  animation: csTyping 1.2s infinite;
}

.cs-da-typing span:nth-child(2) { animation-delay: 0.2s; }
.cs-da-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes csTyping { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.cs-da-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.cs-da-input-group {
  display: flex;
  gap: 8px;
}

.cs-da-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 12.5px;
  background: #f8fafc;
  outline: none;
}

.cs-da-input:focus { border-color: #2563eb; }

.cs-da-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}

.cs-da-send-btn:hover { opacity: 0.9; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .cs-result-grid, .cs-mindmap-grid { grid-template-columns: 1fr; }
  .cs-mindmap-wrapper, .cs-doc-assistant-card { height: 420px; }
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE THEME OVERRIDES FOR CURRICULUM SUMMARY REDESIGN
   ═══════════════════════════════════════════════════════════════ */

/* Dark Mode Inputs & Controls */
[data-theme="dark"] .curriculum-input-panel,
[data-theme="dark"] .curriculum-history-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .curriculum-dropzone {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .curriculum-dropzone:hover,
[data-theme="dark"] .curriculum-dropzone.drag-over {
  background: #1e3a5f;
  border-color: #3b82f6;
}

[data-theme="dark"] .curriculum-dropzone-label {
  color: #f1f5f9;
}

[data-theme="dark"] .curriculum-text-area,
[data-theme="dark"] .curriculum-title-input {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .curriculum-text-area:focus,
[data-theme="dark"] .curriculum-title-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Header & Banner Cards */
[data-theme="dark"] .cs-header-hero {
  background: #1e293b;
  border-color: #059669;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .cs-hero-cyber-bg {
  background: radial-gradient(circle at 15% 50%, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 85% 30%, rgba(37, 99, 235, 0.15) 0%, transparent 50%);
}

[data-theme="dark"] .cs-hero-badge-icon {
  background: linear-gradient(135deg, #10b981 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .cs-tech-pill.green {
  background: #022c22;
  color: #34d399;
  border-color: #065f46;
}

[data-theme="dark"] .cs-tech-pill.blue {
  background: #1e3a5f;
  color: #60a5fa;
  border-color: #2563eb;
}

[data-theme="dark"] .cs-tech-stat-card {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .cs-stat-val {
  color: #f8fafc;
}

[data-theme="dark"] .cs-stat-lbl {
  color: #94a3b8;
}

[data-theme="dark"] .cs-hero-copy h1 {
  color: #f8fafc;
}

[data-theme="dark"] .cs-hero-copy p {
  color: #94a3b8;
}

[data-theme="dark"] .cs-doc-banner {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .cs-doc-badge {
  background: #450a0a;
  color: #fca5a5;
}

[data-theme="dark"] .cs-doc-details h3 {
  color: #f8fafc;
}

[data-theme="dark"] .cs-doc-meta {
  color: #94a3b8;
}

[data-theme="dark"] #cs-btn-back-input,
[data-theme="dark"] #cs-btn-reload-summary {
  background: #334155 !important;
  color: #f8fafc !important;
  border: 1px solid #475569 !important;
}

[data-theme="dark"] #cs-btn-back-input:hover,
[data-theme="dark"] #cs-btn-reload-summary:hover {
  background: #475569 !important;
}

/* Mode Cards */
[data-theme="dark"] .cs-mode-card {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .cs-mode-card:hover {
  border-color: #10b981;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .cs-mode-card.active {
  background: #022c22;
  border-color: #10b981;
}

[data-theme="dark"] .cs-mc-title {
  color: #f8fafc;
}

[data-theme="dark"] .cs-mc-desc {
  color: #94a3b8;
}

[data-theme="dark"] .cs-mc-icon {
  background: #064e3b;
  color: #34d399;
}

[data-theme="dark"] .cs-mode-card.active .cs-mc-icon {
  background: linear-gradient(135deg, #10b981 0%, #2563eb 100%);
  color: #ffffff;
}

/* Tab Bar */
[data-theme="dark"] .cs-tab-bar {
  border-bottom-color: #334155;
}

[data-theme="dark"] .cs-tab-item {
  color: #94a3b8;
}

[data-theme="dark"] .cs-tab-item:hover {
  color: #60a5fa;
}

[data-theme="dark"] .cs-tab-item.active {
  color: #34d399;
  border-bottom-color: #34d399;
}

/* Result Overview & Section Cards */
[data-theme="dark"] .cs-overview-card {
  background: #022c22;
  border-color: #065f46;
}

[data-theme="dark"] .cs-overview-header b {
  color: #34d399;
}

[data-theme="dark"] .cs-badge-count {
  background: #064e3b;
  color: #6ee7b7;
}

[data-theme="dark"] .cs-overview-card p {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .cs-section-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .cs-section-card h4 {
  color: #60a5fa;
}

[data-theme="dark"] .cs-section-card li {
  color: #cbd5e1;
}

/* Right Widgets */
[data-theme="dark"] .cs-widget-green {
  background: #022c22;
  border-color: #065f46;
}

[data-theme="dark"] .cs-widget-green h5 {
  color: #34d399;
}

[data-theme="dark"] .cs-widget-green li {
  color: #a7f3d0;
}

[data-theme="dark"] .cs-widget-green li::before {
  color: #34d399;
}

[data-theme="dark"] .cs-widget-pink {
  background: #450a0a;
  border-color: #991b1b;
}

[data-theme="dark"] .cs-widget-pink h5 {
  color: #fca5a5;
}

[data-theme="dark"] .cs-widget-pink li {
  color: #fecaca;
}

[data-theme="dark"] .cs-widget-pink li::before {
  color: #f87171;
}

[data-theme="dark"] .cs-widget-purple {
  background: #3b0764;
  border-color: #6b21a8;
}

[data-theme="dark"] .cs-widget-purple h5 {
  color: #e9d5ff;
}

[data-theme="dark"] .cs-pill-tag {
  background: #1e1b4b;
  border-color: #7e22ce;
  color: #d8b4fe;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Mindmap & Doc Assistant Sidebar */
[data-theme="dark"] .cs-mindmap-wrapper {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .cs-mm-btn {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .cs-mm-btn:hover {
  background: #1e3a5f;
  color: #60a5fa;
}

[data-theme="dark"] .cs-mm-card-rect {
  fill: #0f172a;
}

[data-theme="dark"] .cs-mm-item-text {
  fill: #cbd5e1;
}

[data-theme="dark"] .cs-doc-assistant-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .cs-da-header {
  background: #0f172a;
  border-bottom-color: #334155;
}

[data-theme="dark"] .cs-da-avatar {
  background: #2563eb;
  color: #ffffff;
}

[data-theme="dark"] .cs-da-title {
  color: #f8fafc;
}

[data-theme="dark"] .cs-da-sub {
  color: #94a3b8;
}

[data-theme="dark"] .cs-da-welcome-bubble {
  background: #1e3a8a;
  border-color: #1d4ed8;
  color: #bfdbfe;
}

[data-theme="dark"] .cs-da-bot-icon {
  color: #60a5fa;
}

[data-theme="dark"] .cs-da-chip {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .cs-da-chip:hover {
  background: #1e3a5f;
  border-color: #3b82f6;
  color: #60a5fa;
}

[data-theme="dark"] .cs-da-msg-bot .cs-da-msg-bubble {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
}

[data-theme="dark"] .cs-da-msg-user .cs-da-msg-bubble {
  background: #2563eb;
  color: #ffffff;
}

[data-theme="dark"] .cs-da-footer {
  background: #0f172a;
  border-top-color: #334155;
}

[data-theme="dark"] .cs-da-input {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .cs-da-input:focus {
  border-color: #3b82f6;
}

[data-theme="dark"] #cs-questions-body li {
  color: #cbd5e1 !important;
}

[data-theme="dark"] #cs-source-body {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .curriculum-history-item {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .curriculum-history-item:hover {
  border-color: #3b82f6;
  background: #1e3a5f;
}

[data-theme="dark"] .curriculum-history-item-title {
  color: #f8fafc;
}

[data-theme="dark"] .curriculum-history-item-badge {
  background: #1e3a5f;
  color: #60a5fa;
}



/* ═══════════════════════════════════════════════════════════════════
   HIERARCHICAL DOCUMENT SUMMARY STYLES
   ═══════════════════════════════════════════════════════════════════ */

.cs-hierarchical-summary {
  width: 100%;
}

.cs-chapter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.cs-chapter-tab-btn {
  flex-shrink: 0;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.cs-chapter-tab-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary);
}

.cs-chapter-tab-btn.active {
  background: linear-gradient(135deg, #10b981 0%, #2563eb 100%);
  border-color: #10b981;
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.cs-chapter-panes {
  min-height: 300px;
}

.cs-chapter-pane {
  animation: fadeInUp 0.3s ease;
}

.cs-lesson-details {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  transition: all 0.2s ease;
}

.cs-lesson-details:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: var(--primary-light);
}

.cs-lesson-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  user-select: none;
}

.cs-lesson-details summary::-webkit-details-marker {
  display: none;
}

.cs-lesson-details summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.2s ease;
  font-size: 10px;
  color: var(--text-muted);
}

.cs-lesson-details[open] summary::before {
  transform: rotate(90deg);
}

.cs-lesson-details[open] {
  background: var(--bg-tertiary);
}

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

/* Dark mode support */
[data-theme="dark"] .cs-chapter-tab-btn {
  background: #1f2937;
  border-color: #374151;
  color: #9ca3af;
}

[data-theme="dark"] .cs-chapter-tab-btn:hover {
  background: #374151;
  border-color: #10b981;
}

[data-theme="dark"] .cs-lesson-details {
  background: #1f2937;
  border-color: #374151;
}

[data-theme="dark"] .cs-lesson-details:hover {
  border-color: #10b981;
}

[data-theme="dark"] .cs-lesson-details[open] {
  background: #111827;
}
