:root{
  --bg-secondary:#ffffff;
  --text-primary:#0f172a;
  --text-secondary:#334155;
  --text-tertiary:#64748b;
  --border-color:#e2e8f0;
  --info:#2563eb;
  --info-light:#dbeafe;
  --info-light-2:#bfdbfe;
  --success:#16a34a;
  --success-light:#dcfce7;
  --success-light-2:#bbf7d0;
  --warning:#d97706;
  --warning-light:#fef3c7;
  --warning-light-2:#fde68a;
  --error:#dc2626;
  --error-light:#fee2e2;
  --error-light-2:#fecaca;
}

[data-theme="dark"]{
  --bg-secondary:#1e293b;
  --text-primary:#f1f5f9;
  --text-secondary:#cbd5e1;
  --text-tertiary:#94a3b8;
  --border-color:#334155;
  --info:#93c5fd;
  --info-light:#0b1f3a;
  --info-light-2:#0f2a4a;
  --success:#86efac;
  --success-light:#052e16;
  --success-light-2:#064e3b;
  --warning:#fbbf24;
  --warning-light:#3b2a06;
  --warning-light-2:#5a3b07;
  --error:#fca5a5;
  --error-light:#3f0a0a;
  --error-light-2:#5f1111;
}

body.dark-mode{
  --bg-secondary:#1e293b;
  --text-primary:#f1f5f9;
  --text-secondary:#cbd5e1;
  --text-tertiary:#94a3b8;
  --border-color:#334155;
  --info:#93c5fd;
  --info-light:#0b1f3a;
  --info-light-2:#0f2a4a;
  --success:#86efac;
  --success-light:#052e16;
  --success-light-2:#064e3b;
  --warning:#fbbf24;
  --warning-light:#3b2a06;
  --warning-light-2:#5a3b07;
  --error:#fca5a5;
  --error-light:#3f0a0a;
  --error-light-2:#5f1111;
}

body.dark-mode .bg-white,body.dark-mode .bg-gray-50,body.dark-mode .bg-gray-100,body.dark-mode .bg-slate-50,body.dark-mode .bg-slate-100{background-color:var(--bg-secondary)!important}
[data-theme="dark"] .bg-white,[data-theme="dark"] .bg-gray-50,[data-theme="dark"] .bg-gray-100,[data-theme="dark"] .bg-slate-50,[data-theme="dark"] .bg-slate-100{background-color:var(--bg-secondary)!important}

body.dark-mode .bg-yellow-50,body.dark-mode .bg-amber-50,body.dark-mode .bg-orange-50{background-color:var(--warning-light)!important}
body.dark-mode .bg-yellow-100,body.dark-mode .bg-amber-100,body.dark-mode .bg-orange-100{background-color:var(--warning-light-2)!important}
body.dark-mode .bg-yellow-200,body.dark-mode .bg-amber-200,body.dark-mode .bg-orange-200{background-color:var(--warning-light-2)!important}
[data-theme="dark"] .bg-yellow-50,[data-theme="dark"] .bg-amber-50,[data-theme="dark"] .bg-orange-50{background-color:var(--warning-light)!important}
[data-theme="dark"] .bg-yellow-100,[data-theme="dark"] .bg-amber-100,[data-theme="dark"] .bg-orange-100{background-color:var(--warning-light-2)!important}
[data-theme="dark"] .bg-yellow-200,[data-theme="dark"] .bg-amber-200,[data-theme="dark"] .bg-orange-200{background-color:var(--warning-light-2)!important}

body.dark-mode .bg-red-50,body.dark-mode .bg-rose-50{background-color:var(--error-light)!important}
body.dark-mode .bg-red-100,body.dark-mode .bg-rose-100{background-color:var(--error-light-2)!important}
body.dark-mode .bg-red-200,body.dark-mode .bg-rose-200{background-color:var(--error-light-2)!important}
[data-theme="dark"] .bg-red-50,[data-theme="dark"] .bg-rose-50{background-color:var(--error-light)!important}
[data-theme="dark"] .bg-red-100,[data-theme="dark"] .bg-rose-100{background-color:var(--error-light-2)!important}
[data-theme="dark"] .bg-red-200,[data-theme="dark"] .bg-rose-200{background-color:var(--error-light-2)!important}

body.dark-mode .bg-green-50,body.dark-mode .bg-emerald-50{background-color:var(--success-light)!important}
body.dark-mode .bg-green-100,body.dark-mode .bg-emerald-100{background-color:var(--success-light-2)!important}
body.dark-mode .bg-green-200,body.dark-mode .bg-emerald-200{background-color:var(--success-light-2)!important}
[data-theme="dark"] .bg-green-50,[data-theme="dark"] .bg-emerald-50{background-color:var(--success-light)!important}
[data-theme="dark"] .bg-green-100,[data-theme="dark"] .bg-emerald-100{background-color:var(--success-light-2)!important}
[data-theme="dark"] .bg-green-200,[data-theme="dark"] .bg-emerald-200{background-color:var(--success-light-2)!important}

body.dark-mode .bg-blue-50,body.dark-mode .bg-indigo-50,body.dark-mode .bg-sky-50{background-color:var(--info-light)!important}
body.dark-mode .bg-blue-100,body.dark-mode .bg-indigo-100,body.dark-mode .bg-sky-100{background-color:var(--info-light-2)!important}
body.dark-mode .bg-blue-200,body.dark-mode .bg-indigo-200,body.dark-mode .bg-sky-200{background-color:var(--info-light-2)!important}
[data-theme="dark"] .bg-blue-50,[data-theme="dark"] .bg-indigo-50,[data-theme="dark"] .bg-sky-50{background-color:var(--info-light)!important}
[data-theme="dark"] .bg-blue-100,[data-theme="dark"] .bg-indigo-100,[data-theme="dark"] .bg-sky-100{background-color:var(--info-light-2)!important}
[data-theme="dark"] .bg-blue-200,[data-theme="dark"] .bg-indigo-200,[data-theme="dark"] .bg-sky-200{background-color:var(--info-light-2)!important}

body.dark-mode .text-gray-900,body.dark-mode .text-gray-800,body.dark-mode .text-slate-900,body.dark-mode .text-slate-800,body.dark-mode .text-black{color:var(--text-primary)!important}
[data-theme="dark"] .text-gray-900,[data-theme="dark"] .text-gray-800,[data-theme="dark"] .text-slate-900,[data-theme="dark"] .text-slate-800,[data-theme="dark"] .text-black{color:var(--text-primary)!important}

body.dark-mode .text-gray-700,body.dark-mode .text-gray-600,body.dark-mode .text-slate-700,body.dark-mode .text-slate-600{color:var(--text-secondary)!important}
[data-theme="dark"] .text-gray-700,[data-theme="dark"] .text-gray-600,[data-theme="dark"] .text-slate-700,[data-theme="dark"] .text-slate-600{color:var(--text-secondary)!important}

body.dark-mode .text-gray-500,body.dark-mode .text-gray-400,body.dark-mode .text-slate-500,body.dark-mode .text-slate-400{color:var(--text-tertiary)!important}
[data-theme="dark"] .text-gray-500,[data-theme="dark"] .text-gray-400,[data-theme="dark"] .text-slate-500,[data-theme="dark"] .text-slate-400{color:var(--text-tertiary)!important}

body.dark-mode .text-amber-900,body.dark-mode .text-amber-800,body.dark-mode .text-amber-700,body.dark-mode .text-amber-600,body.dark-mode .text-yellow-900,body.dark-mode .text-yellow-800,body.dark-mode .text-yellow-700,body.dark-mode .text-yellow-600,body.dark-mode .text-orange-900,body.dark-mode .text-orange-800,body.dark-mode .text-orange-700,body.dark-mode .text-orange-600{color:var(--warning)!important}
[data-theme="dark"] .text-amber-900,[data-theme="dark"] .text-amber-800,[data-theme="dark"] .text-amber-700,[data-theme="dark"] .text-amber-600,[data-theme="dark"] .text-yellow-900,[data-theme="dark"] .text-yellow-800,[data-theme="dark"] .text-yellow-700,[data-theme="dark"] .text-yellow-600,[data-theme="dark"] .text-orange-900,[data-theme="dark"] .text-orange-800,[data-theme="dark"] .text-orange-700,[data-theme="dark"] .text-orange-600{color:var(--warning)!important}

body.dark-mode .text-red-900,body.dark-mode .text-red-800,body.dark-mode .text-red-700,body.dark-mode .text-red-600,body.dark-mode .text-rose-900,body.dark-mode .text-rose-800,body.dark-mode .text-rose-700,body.dark-mode .text-rose-600{color:var(--error)!important}
[data-theme="dark"] .text-red-900,[data-theme="dark"] .text-red-800,[data-theme="dark"] .text-red-700,[data-theme="dark"] .text-red-600,[data-theme="dark"] .text-rose-900,[data-theme="dark"] .text-rose-800,[data-theme="dark"] .text-rose-700,[data-theme="dark"] .text-rose-600{color:var(--error)!important}

body.dark-mode .text-green-900,body.dark-mode .text-green-800,body.dark-mode .text-green-700,body.dark-mode .text-green-600,body.dark-mode .text-emerald-900,body.dark-mode .text-emerald-800,body.dark-mode .text-emerald-700,body.dark-mode .text-emerald-600{color:var(--success)!important}
[data-theme="dark"] .text-green-900,[data-theme="dark"] .text-green-800,[data-theme="dark"] .text-green-700,[data-theme="dark"] .text-green-600,[data-theme="dark"] .text-emerald-900,[data-theme="dark"] .text-emerald-800,[data-theme="dark"] .text-emerald-700,[data-theme="dark"] .text-emerald-600{color:var(--success)!important}

body.dark-mode .text-blue-900,body.dark-mode .text-blue-800,body.dark-mode .text-blue-700,body.dark-mode .text-blue-600,body.dark-mode .text-indigo-900,body.dark-mode .text-indigo-800,body.dark-mode .text-indigo-700,body.dark-mode .text-indigo-600,body.dark-mode .text-sky-900,body.dark-mode .text-sky-800,body.dark-mode .text-sky-700,body.dark-mode .text-sky-600{color:var(--info)!important}
[data-theme="dark"] .text-blue-900,[data-theme="dark"] .text-blue-800,[data-theme="dark"] .text-blue-700,[data-theme="dark"] .text-blue-600,[data-theme="dark"] .text-indigo-900,[data-theme="dark"] .text-indigo-800,[data-theme="dark"] .text-indigo-700,[data-theme="dark"] .text-indigo-600,[data-theme="dark"] .text-sky-900,[data-theme="dark"] .text-sky-800,[data-theme="dark"] .text-sky-700,[data-theme="dark"] .text-sky-600{color:var(--info)!important}

body.dark-mode .border,body.dark-mode .border-gray-200,body.dark-mode .border-gray-100,body.dark-mode .border-gray-300,body.dark-mode .border-slate-200,body.dark-mode .border-slate-300{border-color:var(--border-color)!important}
[data-theme="dark"] .border,[data-theme="dark"] .border-gray-200,[data-theme="dark"] .border-gray-100,[data-theme="dark"] .border-gray-300,[data-theme="dark"] .border-slate-200,[data-theme="dark"] .border-slate-300{border-color:var(--border-color)!important}

body.dark-mode .border-l-amber-400,body.dark-mode .border-l-yellow-400,body.dark-mode .border-l-orange-400{border-left-color:var(--warning)!important}
body.dark-mode .border-l-red-400,body.dark-mode .border-l-rose-400{border-left-color:var(--error)!important}
body.dark-mode .border-l-green-400,body.dark-mode .border-l-emerald-400{border-left-color:var(--success)!important}
body.dark-mode .border-l-blue-400,body.dark-mode .border-l-indigo-400,body.dark-mode .border-l-sky-400{border-left-color:var(--info)!important}
[data-theme="dark"] .border-l-amber-400,[data-theme="dark"] .border-l-yellow-400,[data-theme="dark"] .border-l-orange-400{border-left-color:var(--warning)!important}
[data-theme="dark"] .border-l-red-400,[data-theme="dark"] .border-l-rose-400{border-left-color:var(--error)!important}
[data-theme="dark"] .border-l-green-400,[data-theme="dark"] .border-l-emerald-400{border-left-color:var(--success)!important}
[data-theme="dark"] .border-l-blue-400,[data-theme="dark"] .border-l-indigo-400,[data-theme="dark"] .border-l-sky-400{border-left-color:var(--info)!important}

body.dark-mode .highlight-box,body.dark-mode .info-box,body.dark-mode .warning-box,body.dark-mode .success-box,body.dark-mode .error-box{background-image:none!important;background-color:var(--bg-secondary)!important;color:var(--text-primary)!important}
[data-theme="dark"] .highlight-box,[data-theme="dark"] .info-box,[data-theme="dark"] .warning-box,[data-theme="dark"] .success-box,[data-theme="dark"] .error-box{background-image:none!important;background-color:var(--bg-secondary)!important;color:var(--text-primary)!important}

.edu-callout{background-color:var(--bg-secondary);color:var(--text-primary);border:1px solid var(--border-color);border-left-width:4px;border-radius:12px;padding:1rem}
.edu-callout--info{background-color:var(--info-light);border-left-color:var(--info)}
.edu-callout--success{background-color:var(--success-light);border-left-color:var(--success)}
.edu-callout--warning{background-color:var(--warning-light);border-left-color:var(--warning)}
.edu-callout--error{background-color:var(--error-light);border-left-color:var(--error)}

/* Additional dual-mode content safety (courses) */
body.dark-mode .bg-purple-50,body.dark-mode .bg-violet-50,body.dark-mode .bg-fuchsia-50,body.dark-mode .bg-pink-50,body.dark-mode .bg-teal-50,body.dark-mode .bg-cyan-50{background-color:var(--bg-secondary)!important}
[data-theme="dark"] .bg-purple-50,[data-theme="dark"] .bg-violet-50,[data-theme="dark"] .bg-fuchsia-50,[data-theme="dark"] .bg-pink-50,[data-theme="dark"] .bg-teal-50,[data-theme="dark"] .bg-cyan-50{background-color:var(--bg-secondary)!important}

body.dark-mode .text-purple-900,body.dark-mode .text-violet-900,body.dark-mode .text-fuchsia-900,body.dark-mode .text-pink-900,body.dark-mode .text-teal-900,body.dark-mode .text-cyan-900{color:var(--text-primary)!important}
[data-theme="dark"] .text-purple-900,[data-theme="dark"] .text-violet-900,[data-theme="dark"] .text-fuchsia-900,[data-theme="dark"] .text-pink-900,[data-theme="dark"] .text-teal-900,[data-theme="dark"] .text-cyan-900{color:var(--text-primary)!important}

body.dark-mode .prose,body.dark-mode .prose p,body.dark-mode .prose li,[data-theme="dark"] .prose,[data-theme="dark"] .prose p,[data-theme="dark"] .prose li{color:var(--text-secondary)!important}
body.dark-mode .prose h1,body.dark-mode .prose h2,body.dark-mode .prose h3,body.dark-mode .prose h4,[data-theme="dark"] .prose h1,[data-theme="dark"] .prose h2,[data-theme="dark"] .prose h3,[data-theme="dark"] .prose h4{color:var(--text-primary)!important}

body.dark-mode .shadow,body.dark-mode .shadow-md,body.dark-mode .shadow-lg,[data-theme="dark"] .shadow,[data-theme="dark"] .shadow-md,[data-theme="dark"] .shadow-lg{box-shadow:0 10px 30px rgba(0,0,0,.35)!important}

/* Tables with hard borders */
body.dark-mode table,[data-theme="dark"] table{color:var(--text-secondary)}
body.dark-mode th,[data-theme="dark"] th{color:#f8fafc}
body.dark-mode td,[data-theme="dark"] td{border-color:var(--border-color)!important}

/* Keep light mode readable when authors used muted slate */
html[data-theme="light"] body,body:not(.dark-mode){
  /* no-op anchor for cascade */
}
