body { font-family: "Source Sans 3", system-ui, sans-serif; }
html:not(.dark) body,
html:not(.dark) body.bg-paper {
  background: #fff !important;
}
html:not(.dark) nav,
html:not(.dark) nav.bg-paper\/95,
html:not(.dark) .sticky {
  background: #fff !important;
}
.nav-link.active, .quiz-tab.active { background: #0f172a; color: #fff; }
.quiz-option.correct { background: #d1fae5; border-color: #059669; }
.quiz-option.incorrect { background: #ffe4e6; border-color: #e11d48; }
.prose p { margin-top: 0.75rem; }
.prose ul, .prose ol { margin-top: 0.6rem; }
.video-wrap { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 0.75rem; background: #0f172a; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.teacher { border-left: 4px solid #b45309; background: #fff7ed; }
.exam-tip { border-left: 4px solid #1d4ed8; background: #eff6ff; }
.trap { border-left: 4px solid #be123c; background: #fff1f2; }
.say-this { border-left: 4px solid #047857; background: #ecfdf5; }

.theme-toggle,
.print-paper-btn {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
}
.theme-toggle:hover,
.print-paper-btn:hover { border-color: #0f172a; }
.toolbar-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

html.dark {
  color-scheme: dark;
}
html.dark body {
  background: #000 !important;
  color: #e5e7eb !important;
}
html.dark header.bg-ink,
html.dark .bg-ink {
  background: #000 !important;
}
html.dark nav,
html.dark nav.bg-paper\/95,
html.dark .sticky {
  background: #000 !important;
  border-color: #262626 !important;
}
html.dark .nav-link,
html.dark .quiz-tab,
html.dark .theme-toggle,
html.dark .print-paper-btn,
html.dark .toggle-ms {
  background: #111 !important;
  color: #e5e7eb !important;
  border-color: #333 !important;
}
html.dark .nav-link.active,
html.dark .quiz-tab.active {
  background: #fff !important;
  color: #000 !important;
}
html.dark .bg-white,
html.dark .bg-exam,
html.dark .exam-sheet,
html.dark .bg-paper {
  background-color: #000 !important;
  color: #e5e7eb !important;
}
html.dark a.block.bg-white,
html.dark article,
html.dark section.bg-white,
html.dark #mark-scheme,
html.dark .rounded-2xl.bg-white {
  background-color: #0a0a0a !important;
  border-color: #333 !important;
  color: #e5e7eb !important;
}
html.dark .exam-sheet {
  background-color: #0a0a0a !important;
  border-color: #333 !important;
}
html.dark .text-ink,
html.dark .text-slate-800,
html.dark .text-slate-700,
html.dark .text-slate-600,
html.dark .text-slate-500 {
  color: #d4d4d4 !important;
}
html.dark .text-slate-300 {
  color: #a3a3a3 !important;
}
html.dark .border-slate-200,
html.dark .border-slate-300,
html.dark .border-slate-800,
html.dark .border-b-2 {
  border-color: #333 !important;
}
html.dark .teacher { background: #1a1208 !important; color: #fde68a !important; }
html.dark .exam-tip { background: #0a1628 !important; color: #bfdbfe !important; }
html.dark .trap { background: #1a080c !important; color: #fecdd3 !important; }
html.dark .say-this { background: #052e1c !important; color: #a7f3d0 !important; }
html.dark .quiz-option { background: #111; border-color: #333; }
html.dark .quiz-option.correct { background: #064e3b !important; border-color: #10b981 !important; }
html.dark .quiz-option.incorrect { background: #4c0519 !important; border-color: #f43f5e !important; }
html.dark .bg-slate-50,
html.dark tbody tr.bg-slate-50 { background: #0a0a0a !important; }
html.dark thead,
html.dark .bg-slate-900 { background: #111 !important; color: #e5e7eb !important; }
html.dark footer { border-color: #262626 !important; color: #a3a3a3 !important; }
html.dark .katex { color: #e5e7eb; }
html.dark svg rect[fill="#fff"],
html.dark svg rect[fill="#ffffff"] { fill: #111; }
html.dark svg text { fill: #e5e7eb; }
html.dark svg line[stroke="#0f172a"] { stroke: #e5e7eb; }

@media print {
  html.dark body,
  html.dark .exam-sheet,
  html.dark .bg-white,
  html.dark .bg-exam,
  html.dark article {
    background: #fff !important;
    color: #000 !important;
  }
  html.dark .katex { color: #000; }
  body { background: #fff !important; }
  .no-print, header, nav, footer, .video-card, .theme-toggle, .print-paper-btn, .toolbar-cluster { display: none !important; }
  .exam-sheet { box-shadow: none !important; border: none !important; }
  .page-break { page-break-before: always; }
  a { text-decoration: none; color: inherit; }
}
