/* EduResource ZA - shared navigation shell
   Palette: crimson A+ (#d6073b), navy (#0f172a), warm-white surface (#fff)
   Every original page keeps its own content. This file only adds the rail. */
:root{
  --edu-red:#d6073b;--edu-red-dark:#ae0932;--edu-red-soft:#fff1f3;
  --edu-navy:#0f172a;--edu-blue:#d6073b;
  --edu-bg:#f8f9fc;--edu-card:#fff;--edu-ink:#172033;
  --edu-muted:#64748b;--edu-line:#e5e8ef;
  --edu-text:#172033;--edu-heading:#0f172a;
  --edu-primary:#d6073b;--edu-primary-hover:#ae0932;
  --edu-surface:#ffffff;--edu-surface-muted:#f8fafc;
  --edu-border:#e2e8f0;--edu-border-hover:#cbd5e1;
  --edu-code-bg:#f1f5f9;
}
html.dark, .dark{
  --edu-bg:#0b1220;--edu-card:#111c2e;--edu-ink:#f1f5f9;
  --edu-muted:#94a3b8;--edu-line:#1e293b;--edu-red-soft:#2a1520;
  --edu-text:#e2e8f0;--edu-heading:#f8fafc;
  --edu-primary:#f43f5e;--edu-primary-hover:#fb7185;
  --edu-surface:#111c2e;--edu-surface-muted:#0b1220;
  --edu-border:#1e293b;--edu-border-hover:#334155;
  --edu-code-bg:#1e293b;
}
.edu-skip{
  position:fixed;top:-100px;left:244px;z-index:200;
  background:#fff;color:#d6073b;font-weight:700;font-size:13px;
  padding:10px 18px;border-radius:0 0 10px 10px;
  box-shadow:0 4px 12px #0002;text-decoration:none;
  font-family:'Plus Jakarta Sans',system-ui,sans-serif;
  transition:top .15s;
}
.edu-skip:focus{top:0}
:root {
  --edu-rail-width: 280px;
}
body.edu-rail-collapsed, body.edu-nav-collapsed {
  --edu-rail-width: 0px;
}
.edu-rail{
  position:fixed;inset:0 auto 0 0;width:280px;z-index:50;
  background:var(--edu-card);border-right:1px solid var(--edu-line);
  padding:20px 14px 20px;display:flex;flex-direction:column;gap:3px;
  font:13px/1.5 'Plus Jakarta Sans',system-ui,sans-serif;
  color:var(--edu-ink);overflow-y:auto;box-sizing:border-box;
  -webkit-font-smoothing:antialiased;
  transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .2s ease;
}
body.edu-rail-collapsed .edu-rail,
body.edu-nav-collapsed .edu-rail{
  transform: translateX(-100%);
  pointer-events: none;
}
.edu-rail-header{
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  margin: 0 0 16px !important;
  padding: 0 0 14px !important;
  border-bottom: 1px solid var(--edu-line) !important;
}
.edu-rail-header .edu-logo{
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
}
.edu-rail-header .edu-logo span{
  white-space: nowrap !important;
  overflow: visible !important;
}
.edu-rail-header .edu-logo small,
.edu-logo small{
  display: none !important;
}
.edu-logo{
  display:inline-flex!important;gap:8px;align-items:center;
  margin:0 4px 22px!important;
  text-decoration:none;color:var(--edu-ink)!important;
  white-space:nowrap!important;
}
.edu-logo img{width:32px;height:42px;object-fit:contain;flex-shrink:0}
.edu-logo span:not(.edu-tier-pill-label):not(.edu-tier-pill span){
  display:inline-flex!important;
  align-items:baseline!important;
  gap:4px!important;
  font-family:'Plus Jakarta Sans',system-ui,sans-serif!important;
  font-size:15px!important;
  font-weight:800!important;
  letter-spacing:-.3px!important;
  line-height:1.2!important;
  color:var(--edu-ink)!important;
  white-space:nowrap!important;
}
.dark .edu-logo span:not(.edu-tier-pill-label):not(.edu-tier-pill span){color:#fff!important}
.edu-logo b{
  display:inline!important;
  font-family:inherit!important;
  font-size:inherit!important;
  font-weight:inherit!important;
  letter-spacing:inherit!important;
  line-height:inherit!important;
  vertical-align:baseline!important;
  color:var(--edu-red, #d6073b)!important;
  margin:0!important;padding:0!important;
}
.edu-logo-meta{
  display:inline-flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  justify-content:center!important;
  gap:2px!important;
  min-width:0!important;
}
.edu-tier-pill,
.edu-logo .edu-tier-pill,
.edu-logo-meta .edu-tier-pill{
  display:inline-flex!important;
  align-items:center!important;
  gap:4px!important;
  padding:2px 8px 2px 6px!important;
  border-radius:9999px!important;
  font-family:'Plus Jakarta Sans',system-ui,sans-serif!important;
  font-size:9.5px!important;
  font-weight:800!important;
  letter-spacing:.06em!important;
  text-transform:uppercase!important;
  line-height:1!important;
  user-select:none!important;
  cursor:default!important;
  white-space:nowrap!important;
  margin-top:2px!important;
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
  transition:all .3s cubic-bezier(0.16, 1, 0.3, 1)!important;
}
.edu-tier-pill svg,
.edu-logo .edu-tier-pill svg{
  flex-shrink:0!important;
  width:10px!important;
  height:10px!important;
  color:#ffffff!important;
  fill:#ffffff!important;
  filter:drop-shadow(0 0 2px rgba(255,255,255,0.7))!important;
}
.edu-tier-pill span,
.edu-tier-pill .edu-tier-pill-label,
.edu-logo .edu-tier-pill span,
.edu-logo .edu-tier-pill .edu-tier-pill-label,
.edu-logo-meta .edu-tier-pill span,
.edu-logo-meta .edu-tier-pill .edu-tier-pill-label,
html:not(.dark) .edu-logo .edu-tier-pill span,
html:not(.dark) .edu-logo .edu-tier-pill .edu-tier-pill-label,
html.dark .edu-logo .edu-tier-pill span,
html.dark .edu-logo .edu-tier-pill .edu-tier-pill-label{
  display:inline!important;
  font-family:'Plus Jakarta Sans',system-ui,sans-serif!important;
  font-size:9.5px!important;
  font-weight:800!important;
  letter-spacing:.06em!important;
  text-transform:uppercase!important;
  line-height:1!important;
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
  text-shadow:0 1px 2px rgba(0,0,0,0.35)!important;
}
.edu-tier-pill.edu-tier-pro,
.edu-tier-pill[data-tier="pro"]{
  background:linear-gradient(135deg, #e11d48 0%, #be123c 50%, #881337 100%)!important;
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
  border:1px solid rgba(255,255,255,0.35)!important;
  box-shadow:0 0 10px rgba(225,29,72,0.45), 0 2px 4px rgba(0,0,0,0.2), inset 0 1px 1px rgba(255,255,255,0.4)!important;
  text-shadow:0 1px 2px rgba(0,0,0,0.35)!important;
  animation:eduEtherealCrimson 3.5s ease-in-out infinite alternate!important;
}
.edu-tier-pill.edu-tier-elite,
.edu-tier-pill[data-tier="elite"]{
  background:linear-gradient(135deg, #7c3aed 0%, #4f46e5 45%, #be123c 100%)!important;
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
  border:1px solid rgba(251,191,36,0.75)!important;
  box-shadow:0 0 12px rgba(124,58,237,0.55), 0 0 6px rgba(245,158,11,0.4), inset 0 1px 1px rgba(255,255,255,0.5)!important;
  text-shadow:0 1px 2px rgba(0,0,0,0.4)!important;
  animation:eduEtherealCelestial 3.5s ease-in-out infinite alternate!important;
}
@keyframes eduEtherealCrimson{
  0%{box-shadow:0 0 6px rgba(225,29,72,0.4), inset 0 1px 1px rgba(255,255,255,0.3); border-color:rgba(255,255,255,0.3);}
  100%{box-shadow:0 0 14px rgba(225,29,72,0.7), inset 0 1px 1px rgba(255,255,255,0.5); border-color:rgba(255,255,255,0.55);}
}
@keyframes eduEtherealCelestial{
  0%{box-shadow:0 0 8px rgba(124,58,237,0.45), 0 0 4px rgba(245,158,11,0.3), inset 0 1px 1px rgba(255,255,255,0.35); border-color:rgba(251,191,36,0.6);}
  100%{box-shadow:0 0 18px rgba(124,58,237,0.8), 0 0 8px rgba(245,158,11,0.6), inset 0 1px 1px rgba(255,255,255,0.65); border-color:rgba(251,191,36,0.95);}
}
.edu-user-is-subscribed .edu-upgrade{
  display:none!important;
}
.edu-rail-label{
  font-size:9px;font-weight:800;letter-spacing:1.8px;
  color:#94a3b8;text-transform:uppercase;
  margin:18px 10px 6px;padding:0;
}
.edu-rail a:not(.edu-logo),.edu-rail summary{
  display:flex;align-items:center;gap:11px;
  border-radius:9px;padding:9px 11px;
  color:var(--edu-muted);text-decoration:none;
  font-weight:600;font-size:12px;
  transition:background .12s,color .12s;
  cursor:pointer;list-style:none;
}
.edu-rail a:not(.edu-logo):hover,
.edu-rail summary:hover,
.edu-rail a[aria-current=page]{
  background:var(--edu-red-soft);color:var(--edu-red-dark);
}
.edu-rail a[aria-current=page]{
  box-shadow:inset 3px 0 0 var(--edu-red);font-weight:800;
}
.edu-rail [data-icon]{
  display:flex;width:18px;height:18px;flex-shrink:0;
  align-items:center;justify-content:center;
}
.edu-rail [data-icon] svg{width:18px;height:18px}
.edu-rail .edu-tutor-mark{font-size:13px;font-weight:900;letter-spacing:-.09em;line-height:1;white-space:nowrap}
.edu-board-menu{margin:0;padding:0;border:0;}
.edu-board-menu>summary{position:relative;}
.edu-board-menu>summary::after{
  content:'\25be';font-size:10px;margin-left:auto;color:#94a3b8;
  transition:transform .2s;
}
.edu-board-menu[open]>summary::after{transform:rotate(180deg)}
.edu-board-menu[open]>summary{color:var(--edu-red-dark);background:var(--edu-red-soft);}
.edu-board-menu a{padding-left:32px!important;font-size:11px;}
.edu-upgrade{
  margin-top:auto;background:linear-gradient(130deg,#fff1f3,#fff8f3);
  padding:14px;border-radius:12px;border:1px solid #f8dce2;
}
.dark .edu-upgrade{background:#291c2a!important;border-color:#4b2436;}
.edu-upgrade strong{font-size:11px;color:#881337;display:block;margin-bottom:4px}
.dark .edu-upgrade strong{color:#fda4af}
.edu-upgrade p{font-size:11px;color:var(--edu-muted);line-height:1.5;margin:0 0 10px}
.edu-upgrade a{
  display:block;text-align:center;
  background:var(--edu-red)!important;color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
  border-radius:8px;padding:8px;font-size:11px;font-weight:800;
  text-decoration:none;
}
.edu-upgrade a:hover{background:var(--edu-red-dark)!important;color:#ffffff!important}
.edu-rail-account{
  margin-top:10px;padding:10px 11px 2px;
  display:flex;align-items:center;gap:8px;
  border-top:1px solid var(--edu-line);
}
.edu-signin{
  font-size:11px;font-weight:700;
  background:var(--edu-red)!important;
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
  border-radius:8px;padding:8px 14px;
  text-align:center;text-decoration:none;flex:1;
}
.edu-signin:hover{background:var(--edu-red-dark)!important;color:#ffffff!important;text-decoration:none}
[data-edu-theme]{border:0;background:none;cursor:pointer;font-size:16px;color:var(--edu-muted);padding:4px;}
[data-edu-theme]:hover{color:var(--edu-ink)}
.edu-mobile-signin{display:none}
.edu-mobile-home,.edu-mobile-topbar{display:none!important}
/* Universal accordion behavior & contrast protection */
.accordion-content {
  transition: max-height 0.35s ease-in-out, opacity 0.25s ease-in-out !important;
}
.accordion-content.active,
.accordion-button.active + .accordion-content,
.accordion-content[style*="max-height"]:not([style*="max-height: 0px"]):not([style*="max-height:0px"]):not([style*="max-height: 0"]):not([style*="max-height:0"]) {
  opacity: 1 !important;
  visibility: visible !important;
}
.accordion-button.active i.fa-chevron-down {
  transform: rotate(180deg) !important;
}
.dark .accordion-content .bg-gray-50,
.dark .accordion-content .p-4 {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
}
.dark .accordion-content a.bg-gray-50,
.dark .accordion-content a {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #f1f5f9 !important;
}
.dark .accordion-content a:hover {
  background-color: #334155 !important;
}
.dark .accordion-content a span {
  color: #f1f5f9 !important;
}
.dark .accordion-content a i {
  color: #f43f5e !important;
}
.edu-menu-scrim{
  display:none;position:fixed;inset:0;z-index:44;
  background:#0f172a55;backdrop-filter:blur(2px);
}
.edu-menu-scrim.active{display:block}
/* Sidebar Toggle Button: Docked inside pane header when open, Floating fixed when collapsed */
.edu-rail-header .edu-sidebar-toggle,
.edu-rail-header .edu-mobile-menu,
.edu-sidebar-toggle.edu-toggle-docked,
.edu-mobile-menu.edu-toggle-docked {
  position: static !important;
  inset: auto !important;
  margin-left: auto !important;
  display: inline-flex !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--edu-card) !important;
  color: var(--edu-ink) !important;
  border: 1px solid var(--edu-line) !important;
  border-radius: 9px !important;
  cursor: pointer !important;
  padding: 0 !important;
  box-shadow: none !important;
  flex-shrink: 0 !important;
  transition: background .15s, color .15s, border-color .15s !important;
}

.edu-sidebar-toggle.edu-toggle-docked:hover,
.edu-mobile-menu.edu-toggle-docked:hover {
  background: var(--edu-red-soft) !important;
  color: var(--edu-red-dark) !important;
  border-color: var(--edu-red) !important;
}

.edu-sidebar-toggle.edu-toggle-floating,
.edu-mobile-menu.edu-toggle-floating,
body.edu-nav-collapsed .edu-sidebar-toggle,
body.edu-rail-collapsed .edu-sidebar-toggle,
body.edu-nav-collapsed .edu-mobile-menu,
body.edu-rail-collapsed .edu-mobile-menu {
  display: inline-flex !important;
  position: fixed !important;
  top: 16px !important;
  left: 16px !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--edu-card) !important;
  color: var(--edu-ink) !important;
  border: 1px solid var(--edu-line) !important;
  border-radius: 10px !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08) !important;
  cursor: pointer !important;
  padding: 0 !important;
  z-index: 70 !important;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s !important;
}

.edu-sidebar-toggle.edu-toggle-floating:hover,
.edu-mobile-menu:hover {
  background: var(--edu-red-soft) !important;
  color: var(--edu-red-dark) !important;
  border-color: var(--edu-red) !important;
  transform: scale(1.04);
}

.dark .edu-sidebar-toggle, .dark .edu-mobile-menu {
  background: #19222e !important;
  border-color: #2b384a !important;
  color: #e2e8f0 !important;
}

.dark .edu-sidebar-toggle:hover, .dark .edu-mobile-menu:hover {
  background: #2a1b24 !important;
  color: #fda4af !important;
  border-color: #f43f5e !important;
}

.edu-sidebar-toggle svg, .edu-mobile-menu svg {
  display: block;
  flex-shrink: 0;
}

.edu-with-rail{
  padding-left: var(--edu-rail-width, 248px) !important;
  transition: padding-left .22s cubic-bezier(0.16, 1, 0.3, 1);
}
body.edu-rail-collapsed.edu-with-rail,
body.edu-nav-collapsed.edu-with-rail,
body.edu-rail-collapsed,
body.edu-nav-collapsed {
  padding-left: 0 !important;
}
.edu-with-rail>header:not(.study-top){position:relative!important}
.edu-with-rail main{min-width:0}

/* Universal footer and logo alignment protection */
.edu-premium-footer,
.edu-with-rail .edu-premium-footer {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
  position: relative !important;
}

.footer-logo {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  text-decoration: none !important;
}
.footer-logo img {
  width: 36px !important;
  height: 48px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
}
.footer-logo span {
  display: inline-block !important;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif !important;
  font-size: 19px !important;
  font-weight: 800 !important;
  letter-spacing: -0.5px !important;
  line-height: 1.2 !important;
  color: #ffffff !important;
  vertical-align: middle !important;
}
.footer-logo b {
  display: inline !important;
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit !important;
  line-height: inherit !important;
  vertical-align: baseline !important;
  color: var(--edu-red, #d6073b) !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Completely remove the deprecated back button */
.top-home { display: none !important; }
.edu-rail a:focus-visible,.edu-rail summary:focus-visible,
.edu-with-rail a:focus-visible,button:focus-visible,
input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:3px solid #eab308;outline-offset:3px;border-radius:3px;
}
.edu-account-dialog{
  border:0;border-radius:20px;padding:36px;
  box-shadow:0 24px 64px #0f172a33;
  max-width:380px;width:90%;text-align:center;
  font-family:'Plus Jakarta Sans',system-ui,sans-serif;
}
.edu-account-dialog::backdrop{background:#0f172a77;backdrop-filter:blur(4px)}
.edu-account-dialog img{margin:0 auto 10px;display:block}
.edu-account-dialog h2{font-size:20px;font-weight:800;margin:6px 0;letter-spacing:-.5px}
.edu-account-copy{font-size:12px;color:var(--edu-muted);line-height:1.6;margin:0 0 18px}
.edu-google-signin,.edu-account-signout,.edu-account-browse{
  display:block;width:100%;padding:13px;
  border:0;border-radius:10px;margin-top:10px;
  font:700 13px 'Plus Jakarta Sans',system-ui,sans-serif;
  cursor:pointer;
}
.edu-google-signin{background:#d6073b;color:#fff}
.edu-google-signin:hover{background:#ae0932}
.edu-account-dashboard{
  display:block;width:100%;padding:11px;
  border:1px solid var(--edu-line);border-radius:10px;
  margin-top:8px;font-size:12px;font-weight:600;color:var(--edu-ink);
  text-decoration:none;box-sizing:border-box;
}
.edu-account-dashboard:hover{background:var(--edu-red-soft)}
.edu-account-signout{background:none;border:1px solid var(--edu-line);color:var(--edu-muted)}
.edu-account-browse{background:none;border:0;color:var(--edu-muted);font-size:11px}
.edu-account-status{font-size:11px;color:#059669;margin:6px 0 0;display:block;min-height:18px}
.edu-account-small{font-size:10px;color:#94a3b8;margin:10px 0 0;line-height:1.5}
.edu-account-close{
  position:absolute;top:12px;right:14px;
  background:none;border:0;font-size:22px;cursor:pointer;
  color:var(--edu-muted);line-height:1;
}
.edu-account-close:hover{color:var(--edu-ink)}
.edu-account-dialog .buddy-kicker{font-size:9px;letter-spacing:1.3px;color:#be123c;font-weight:800;}
.edu-page-trail{
  font:11px/1.6 'Plus Jakarta Sans',system-ui,sans-serif;
  color:var(--edu-muted);margin:0 0 22px;
  display:flex;gap:9px;align-items:baseline;flex-wrap:wrap;
}
.edu-page-trail a{color:var(--edu-red-dark)}
.dark .edu-page-trail a{color:#fda4af}
@media(max-width:1050px){
  body.edu-menu-open{overflow:hidden;}
  .edu-rail{
    transform:translateX(-100%) !important;transition:transform .22s cubic-bezier(0.16, 1, 0.3, 1);
    width:260px !important;top:0 !important;padding-top:20px;z-index:85 !important;
    overscroll-behavior:contain;
  }
  .edu-rail.edu-open{transform:none !important;pointer-events:auto !important;box-shadow:16px 0 40px rgba(15,23,42,0.25) !important;}
  .edu-with-rail{padding-left:0!important;padding-top:54px!important}
  .edu-sidebar-toggle, .edu-mobile-menu{
    display:inline-flex !important;
    left:14px !important;top:12px !important;
    z-index:90 !important;
  }
  body.edu-menu-open .edu-sidebar-toggle,
  body.edu-menu-open .edu-mobile-menu{
    left:268px !important;
  }
  .edu-mobile-signin{
    display:flex;position:fixed;top:0;right:10px;
    height:50px;align-items:center;z-index:51;
    font-size:11px;font-weight:700;
    color:var(--edu-red-dark);text-decoration:none;
  }
  .edu-skip{left:16px}
}
@media print{
  .edu-rail,.edu-mobile-menu,.edu-mobile-signin,.edu-buddy,
  .edu-menu-scrim{display:none!important}
  .edu-with-rail{padding:0!important}
}

/* Dedicated Grid Search Component */
.paper-search {
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 0 14px !important;
  min-height: 42px !important;
  box-sizing: border-box !important;
  transition: border-color .15s, box-shadow .15s !important;
}
.paper-search:focus-within {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
}
.paper-search .paper-search-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: none !important;
}
.paper-search input {
  width: 100% !important;
  min-width: 0 !important;
  padding: 10px 0 !important;
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  color: inherit !important;
  font-family: inherit !important;
  font-size: 13px !important;
}
.paper-search input::placeholder {
  color: #94a3b8 !important;
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.01ms!important;
    transition-duration:.01ms!important;
  }
}

/* ==========================================================================
   Comprehensive Dark Mode Visibility & Contrast Guard
   ========================================================================== */
html.dark {
  color-scheme: dark;
  background-color: var(--edu-bg) !important;
  color: var(--edu-text) !important;
}

html.dark body {
  background-color: var(--edu-bg) !important;
  color: var(--edu-text) !important;
}

/* Headings in dark mode */
html.dark h1, html.dark h2, html.dark h3, html.dark h4, html.dark h5, html.dark h6 {
  color: var(--edu-heading) !important;
}

/* Tailwind text colors that default to dark */
html.dark .text-slate-900, html.dark .text-gray-900, html.dark .text-black,
html.dark .text-slate-950, html.dark .text-gray-950, html.dark .text-neutral-900,
html.dark .text-zinc-900 {
  color: #f8fafc !important;
}

html.dark .text-slate-800, html.dark .text-gray-800, html.dark .text-neutral-800, html.dark .text-zinc-800 {
  color: #f1f5f9 !important;
}

html.dark .text-slate-700, html.dark .text-gray-700, html.dark .text-neutral-700, html.dark .text-zinc-700 {
  color: #e2e8f0 !important;
}

html.dark .text-slate-600, html.dark .text-gray-600, html.dark .text-neutral-600, html.dark .text-zinc-600 {
  color: #94a3b8 !important;
}

html.dark .text-slate-500, html.dark .text-gray-500, html.dark .text-neutral-500 {
  color: #94a3b8 !important;
}

/* Background surfaces */
html.dark .bg-white {
  background-color: var(--edu-card) !important;
  color: var(--edu-text) !important;
  border-color: var(--edu-line) !important;
}

html.dark .bg-slate-50, html.dark .bg-gray-50, html.dark .bg-neutral-50,
html.dark .bg-slate-100, html.dark .bg-gray-100, html.dark .bg-neutral-100 {
  background-color: var(--edu-bg) !important;
  border-color: var(--edu-line) !important;
}

html.dark .bg-slate-200, html.dark .bg-gray-200, html.dark .bg-neutral-200 {
  background-color: #1e293b !important;
}

/* Borders */
html.dark .border-slate-200, html.dark .border-gray-200, html.dark .border-gray-300,
html.dark .border-slate-100, html.dark .border-gray-100, html.dark .border-neutral-200 {
  border-color: var(--edu-line) !important;
}

/* Form inputs */
html.dark input:not([type="checkbox"]):not([type="radio"]),
html.dark select,
html.dark textarea {
  background-color: #111c2e !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}
html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748b !important;
}

/* KaTeX math formulas in dark mode */
html.dark .katex {
  color: #f1f5f9 !important;
}
html.dark .katex .mord,
html.dark .katex .mbin,
html.dark .katex .mrel,
html.dark .katex .mop,
html.dark .katex .mpunct,
html.dark .katex .minner {
  color: #f1f5f9 !important;
}

/* Study Guides & Mock Exams specific elements */
html.dark .guide-section {
  background: var(--edu-card) !important;
  border-color: var(--edu-line) !important;
  color: var(--edu-text) !important;
}
html.dark .guide-hero {
  background: var(--edu-card) !important;
  border-color: var(--edu-line) !important;
  color: var(--edu-text) !important;
}
html.dark .formula-box {
  background: rgba(244, 63, 94, 0.08) !important;
  border-color: rgba(244, 63, 94, 0.3) !important;
  color: #fda4af !important;
}
html.dark .worked-problem {
  background: #151f32 !important;
  border-color: #24334c !important;
  color: #e2e8f0 !important;
}
html.dark .worked-problem-title {
  color: #fb7185 !important;
}
html.dark .pitfall-box {
  background: rgba(245, 158, 11, 0.12) !important;
  border-left-color: #f59e0b !important;
  color: #fef3c7 !important;
}
html.dark .pitfall-box strong {
  color: #fbbf24 !important;
}
html.dark .diagram-container {
  background: #0b1220 !important;
  border-color: var(--edu-line) !important;
}
html.dark .bilingual-tag {
  color: #94a3b8 !important;
}

/* Premium Notes (.page) in Dark Mode */
html.dark .page {
  background: #111c2e !important;
  color: #e2e8f0 !important;
  border: 1px solid #1e293b !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5) !important;
}
html.dark .page h1 {
  color: #f43f5e !important;
}
html.dark .page h2 {
  color: #f1f5f9 !important;
  border-bottom-color: #334155 !important;
}
html.dark .page h3, html.dark .page h4, html.dark .page h5, html.dark .page h6 {
  color: #e2e8f0 !important;
}
html.dark .page p, html.dark .page li {
  color: #cbd5e1 !important;
}
html.dark .page-header {
  border-bottom-color: #334155 !important;
}
html.dark .page-header .left {
  color: #f1f5f9 !important;
}
html.dark .page-header .right {
  color: #94a3b8 !important;
}
html.dark .page .formula-box {
  background: #172236 !important;
  border-color: #3b82f6 !important;
  color: #93c5fd !important;
}
html.dark .page .info-box {
  background: #2a1520 !important;
  border-left-color: #f43f5e !important;
  color: #fecdd3 !important;
}
html.dark .page .example-box {
  background: #151f30 !important;
  border-color: #24334a !important;
  color: #e2e8f0 !important;
}
html.dark .page .example-box h4 {
  color: #60a5fa !important;
}
html.dark .page::after {
  color: #475569 !important;
}

/* SVG Vector Diagrams in Dark Mode */
html.dark svg text {
  fill: #f1f5f9 !important;
}
html.dark svg [stroke="#000"],
html.dark svg [stroke="#000000"],
html.dark svg [stroke="#1a2744"],
html.dark svg [stroke="#0f172a"],
html.dark svg [stroke="#333"],
html.dark svg [stroke="#333333"],
html.dark svg [stroke="#222"] {
  stroke: #cbd5e1 !important;
}
html.dark svg [fill="#000"],
html.dark svg [fill="#000000"],
html.dark svg [fill="#1a2744"],
html.dark svg [fill="#0f172a"],
html.dark svg [fill="#333"],
html.dark svg [fill="#333333"] {
  fill: #cbd5e1 !important;
}
html.dark svg rect[fill="#fff"],
html.dark svg rect[fill="#ffffff"],
html.dark svg rect[fill="white"] {
  fill: #111c2e !important;
  stroke: #334155 !important;
}

/* Tables in Dark Mode */
html.dark table th {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}
html.dark table td {
  border-color: #24334a !important;
  color: #cbd5e1 !important;
}
html.dark table tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.02) !important;
}

/* High-Yield Curriculum Diagram Cards */
.edu-diagram-card {
  margin: 24px auto;
  max-width: 820px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.edu-diagram-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.edu-diagram-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
}
.edu-diagram-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  color: #d6073b;
  background: #fff1f3;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(214, 7, 59, 0.15);
}
.edu-diagram-actions {
  display: flex;
  gap: 8px;
}
.edu-diagram-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  transition: all 0.15s ease;
}
.edu-diagram-btn:hover {
  color: #0f172a;
  background: #e2e8f0;
  border-color: #94a3b8;
}
.edu-diagram-img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  background: transparent;
}
.edu-diagram-caption {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.5;
  text-align: left;
}
.edu-diagram-caption strong {
  color: #0f172a;
  display: block;
  margin-bottom: 3px;
  font-size: 0.95rem;
}

/* Dark mode overrides for diagram cards */
html.dark .edu-diagram-card {
  background: #111c2e !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}
html.dark .edu-diagram-card:hover {
  border-color: #334155 !important;
}
html.dark .edu-diagram-header {
  border-bottom-color: #1e293b !important;
}
html.dark .edu-diagram-badge {
  color: #fb7185 !important;
  background: #2a1520 !important;
  border-color: rgba(251, 113, 133, 0.3) !important;
}
html.dark .edu-diagram-btn {
  color: #cbd5e1 !important;
  background: #1e293b !important;
  border-color: #334155 !important;
}
html.dark .edu-diagram-btn:hover {
  color: #ffffff !important;
  background: #24334a !important;
  border-color: #475569 !important;
}
html.dark .edu-diagram-caption {
  border-top-color: #1e293b !important;
  color: #94a3b8 !important;
}
html.dark .edu-diagram-caption strong {
  color: #f1f5f9 !important;
}

/* Preserve crisp paper aesthetic when printing */
@media print {
  html.dark, html.dark body, html.dark .page {
    background: white !important;
    color: black !important;
  }
  html.dark .page h1 { color: #c0392b !important; }
  html.dark .page h2, html.dark .page h3 { color: #1a2744 !important; }
  html.dark .page p, html.dark .page li { color: black !important; }
  html.dark svg text { fill: black !important; }
}


/* === EduResource ZA: Prominent Plans & Pricing System === */
.edu-rail a.edu-rail-plans-link {
  color: var(--edu-red-dark, #ae0932) !important;
  font-weight: 700 !important;
  background: var(--edu-red-soft, #fff1f3) !important;
  border: 1px solid #fecdd3 !important;
  margin: 4px 0 !important;
  box-shadow: 0 1px 3px rgba(214, 7, 59, 0.08) !important;
}
.dark .edu-rail a.edu-rail-plans-link {
  color: #fda4af !important;
  background: #2a1520 !important;
  border-color: #881337 !important;
}
.edu-pro-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d6073b, #f43f5e);
  color: #ffffff !important;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(214, 7, 59, 0.3);
}
.edu-upgrade-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--edu-red, #d6073b);
  background: rgba(214, 7, 59, 0.1);
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
}
.dark .edu-upgrade-badge {
  color: #fda4af;
  background: rgba(253, 164, 175, 0.15);
}
.edu-upgrade-cta {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-top: 8px !important;
  background: linear-gradient(135deg, #d6073b, #e11d48) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-radius: 9px !important;
  padding: 9px 12px !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(214, 7, 59, 0.25) !important;
  transition: transform .15s ease, box-shadow .15s ease !important;
}
.edu-upgrade-cta:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(214, 7, 59, 0.35) !important;
}
.edu-mobile-plans {
  display: none;
}
@media (max-width: 1050px) {
  .edu-mobile-plans {
    display: inline-flex !important;
    position: fixed !important;
    top: 9px !important;
    right: 76px !important;
    height: 32px !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 0 11px !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #d6073b, #f43f5e) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    z-index: 75 !important;
    box-shadow: 0 2px 10px rgba(214, 7, 59, 0.35) !important;
    transition: transform .15s ease !important;
  }
  .edu-mobile-plans:hover {
    transform: scale(1.04) !important;
  }
}

/* Subscription Dialog Upgrade Button Text Color Safeguard */
.edu-sub-dialog-plan,
.edu-sub-dialog-plan:link,
.edu-sub-dialog-plan:visited,
.edu-sub-dialog-plan:hover,
.edu-sub-dialog-plan:active,
.edu-sub-dialog-plan:focus {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 800 !important;
}

/* ==========================================================================
   Remove Ads Conversion Banner (Bottom of Screen across site)
   ========================================================================== */
#edu-remove-ads-banner {
  position: fixed;
  bottom: calc(var(--edu-auto-ad-bottom, 0px) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 998;
  width: calc(100% - 32px);
  max-width: 820px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(225, 29, 72, 0.4);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(225, 29, 72, 0.2);
  color: #f8fafc;
  padding: 10px 14px 10px 18px;
  box-sizing: border-box;
  animation: eduBannerSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

html.dark #edu-remove-ads-banner {
  background: rgba(10, 15, 30, 0.94);
  border-color: rgba(225, 29, 72, 0.5);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(225, 29, 72, 0.25);
}

#edu-remove-ads-banner.edu-ad-banner-hiding {
  opacity: 0;
  transform: translate(-50%, 15px);
  pointer-events: none;
}

.edu-ad-banner-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.edu-ad-banner-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.2), rgba(190, 18, 60, 0.4));
  border: 1px solid rgba(225, 29, 72, 0.4);
  color: #fb7185;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(225, 29, 72, 0.3);
}

.edu-ad-banner-content {
  flex: 1;
  min-width: 0;
}

.edu-ad-banner-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.edu-ad-banner-title strong {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.edu-ad-banner-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1.5px 7px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.edu-ad-banner-desc {
  margin: 2px 0 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edu-ad-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.edu-ad-banner-cta,
.edu-ad-banner-cta:link,
.edu-ad-banner-cta:visited {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none !important;
  padding: 8px 16px;
  border-radius: 9999px;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.45);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.edu-ad-banner-cta:hover,
.edu-ad-banner-cta:focus,
.edu-ad-banner-cta:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.6);
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-decoration: none !important;
}

.edu-ad-banner-close {
  background: transparent;
  border: none;
  color: #64748b;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.edu-ad-banner-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

@keyframes eduBannerSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 25px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Mobile responsive adjustments */
@media (max-width: 840px) {
  #edu-remove-ads-banner {
    bottom: calc(var(--edu-auto-ad-bottom, 0px) + 78px + env(safe-area-inset-bottom));
    padding: 8px 10px 8px 12px;
    border-radius: 16px;
  }
  .edu-ad-banner-desc {
    display: none;
  }
  .edu-ad-banner-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .edu-ad-banner-title strong {
    font-size: 13px;
  }
  .edu-ad-banner-cta {
    font-size: 11.5px;
    padding: 7px 12px;
  }
}

@media (max-width: 480px) {
  .edu-ad-banner-badge {
    display: none;
  }
  #edu-remove-ads-banner {
    width: calc(100% - 20px);
  }
}

.edu-user-is-subscribed #edu-remove-ads-banner {
  display: none !important;
}

