/* V229.78: navbar search styles removed from this legacy Level-3 aggregate.
   Canonical authority: /components/navbar/search.css */
@import url("/assets/css/cms-font.css");
/* =====================================================================
   styles.css — Global UI
   Mobile-fast update: keep global behavior, reduce first-paint blocking from page head (Navbar, Sidebar, Footer & Mobile Drawer)
   ===================================================================== */

/* =====================================================================
   --- 1. ROOT VARIABLES ---
   ===================================================================== */
:root {
  --logo-hat-start: #e9d5ff;
  --logo-hat-end: var(--color-sec);
  --logo-string-start: #dbeafe;
  --logo-string-end: var(--primary-light);

  --primary: #1c3f94;
  --primary-light: #4361ee;
  --secondary: #1e293b;
  --bg-light: #f8fafc;
  --text-main: #1b263b;
  --white: #ffffff;

  --color-sec: #9c27b0;
  --color-mid: #ff9800;
  --color-pri: #4CAF50;

  --sidebar-purple-hover: #6a1b9a;
  --sidebar-orange-hover: #ef6c00;
  --sidebar-green-hover: #2e7d32;

  --header-h: 48px;
  --radius: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --shadow: 0 4px 15px rgba(0,0,0,0.08);
  --shadow-hover: 10px 25px rgba(0,0,0,0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --brand-logo-size: 36px;
  --brand-logo-overlap: -10px;

  /* ============================================================
     Sidebar stage-title font controls.
     Change only these values when you want to tune title font sizes.
     ============================================================ */
  --sidebar-title-pc-ar-font-size: 1.10rem;
  --sidebar-title-pc-fr-font-size: 1.00rem;

  --sidebar-title-pc-collapsed-ar-font-size: 1.00rem;
  --sidebar-title-pc-collapsed-fr-font-size: 0.82rem;

  --sidebar-title-mobile-ar-font-size: 0.90rem;
  --sidebar-title-mobile-fr-font-size: 0.86rem;
}

html.dark-mode,
body.dark-mode {
  --bg-light: #0f172a;
  --text-main: #f1f5f9;
  --white: #1e293b;
  --secondary: #020617;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
  --sidebar-purple-hover: #b27ad9;
  --sidebar-orange-hover: #ffbf1d;
  --sidebar-green-hover: #44e680;
}


@media (max-width: 480px) {
  :root {
    --brand-logo-size: 34px;
    --brand-logo-overlap: -8px;
  }
}

/* =====================================================================
   --- 2. BASE STYLES ---
   ===================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Tajawal", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

body {
  background: var(--bg-light);
  color: var(--text-main);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.no-scroll {
  overflow: hidden;
}

ul { list-style: none; }

a {
  text-decoration: none;
  color: inherit;
  transition: 0.2s;
}

button {
  font-family: inherit;
  cursor: pointer;
}

#navbar-slot {
  display: contents;
}

#mode-switcher .mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 1em;
  width: 1em;
  height: 1em;
  overflow: hidden;
  font-size: 1em;
  line-height: 1;
  vertical-align: -0.125em;
}

#mode-switcher .mode-icon-stack {
  display: inline-grid;
  place-items: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  vertical-align: -0.125em;
}

#mode-switcher svg.mode-icon {
  grid-area: 1 / 1;
  fill: currentColor;
}

#mode-switcher .theme-icon-light path {
  fill: currentColor !important;
}

#sidebar-toggle-btn .sidebar-toggle-icon-stack {
  display: inline-grid;
  place-items: center;
  width: 1.12em;
  height: 1.12em;
  line-height: 1;
  pointer-events: none;
  transform: scale(1);
  transform-origin: center center;
  transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#sidebar-toggle-btn .sidebar-toggle-icon {
  grid-area: 1 / 1;
  width: 1.12em;
  height: 1.12em;
  fill: none;
  stroke: currentColor;
}

#sidebar-toggle-btn .sidebar-toggle-icon path {
  stroke: currentColor;
}

#sidebar-toggle-btn .sidebar-toggle-icon-ar {
  transform: rotate(180deg);
  transform-origin: center;
}

#sidebar-toggle-btn .sidebar-toggle-icon-fr {
  display: none;
  transform: none;
  transform-origin: center;
}

html[dir="ltr"] #sidebar-toggle-btn .sidebar-toggle-icon-ar,
body[dir="ltr"] #sidebar-toggle-btn .sidebar-toggle-icon-ar {
  display: none;
}

html[dir="ltr"] #sidebar-toggle-btn .sidebar-toggle-icon-fr,
body[dir="ltr"] #sidebar-toggle-btn .sidebar-toggle-icon-fr {
  display: block;
}

html[dir="rtl"] #sidebar-toggle-btn .sidebar-toggle-icon-ar,
body[dir="rtl"] #sidebar-toggle-btn .sidebar-toggle-icon-ar,
html:not([dir]) #sidebar-toggle-btn .sidebar-toggle-icon-ar {
  display: block;
}

@media (hover: hover) and (pointer: fine) {
  #sidebar-toggle-btn:hover .sidebar-toggle-icon-stack {
    transform: scale(1.04);
  }
}

#sidebar-toggle-btn:active .sidebar-toggle-icon-stack {
  transform: scale(0.94);
}

#mobile-menu-btn .mobile-menu-icon,
#close-mobile-btn .mobile-menu-icon {
  width: 1.12em;
  height: 1.12em;
  flex: 0 0 1.12em;
  pointer-events: none;
  transform: scale(1);
  transform-origin: center center;
  transition:
    transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1),
    color 0.12s ease;
}

#mobile-menu-btn .mobile-menu-icon,
#mobile-menu-btn .mobile-menu-icon path {
  fill: currentColor;
  stroke: currentColor;
}

#close-mobile-btn .mobile-menu-icon,
#close-mobile-btn .mobile-menu-icon path {
  fill: currentColor;
  stroke: none;
}

#close-mobile-btn .mobile-menu-icon rect {
  fill: transparent;
}

@media (hover: hover) and (pointer: fine) {
  #mobile-menu-btn:hover .mobile-menu-icon,
  #close-mobile-btn:hover .mobile-menu-icon {
    transform: scale(1.04);
  }
}

#mobile-menu-btn:active .mobile-menu-icon,
#close-mobile-btn:active .mobile-menu-icon {
  transform: scale(0.94);
}

.menu-toggle .nav-chevron {
  width: 0.78em;
  height: 0.78em;
  flex: 0 0 0.78em;
  fill: currentColor;
}

#mode-switcher .theme-icon-dark {
  display: none;
}

html.dark-mode #mode-switcher .theme-icon-light,
body.dark-mode #mode-switcher .theme-icon-light {
  display: none;
}

html.dark-mode #mode-switcher .theme-icon-dark,
body.dark-mode #mode-switcher .theme-icon-dark {
  display: inline-flex;
}

/* =====================================================================
   --- 2.1 INTERACTIVE ELEMENTS: NO MOBILE SELECTION/TAP RECTANGLE ---
   Keeps links/buttons usable while removing the phone blue/gray selection flash.
   ===================================================================== */
.app-header,
.app-header *,
.mobile-sidebar-container,
.mobile-sidebar-container *,
.levels-sidebar,
.levels-sidebar * {
  -webkit-tap-highlight-color: transparent;
}

.app-title,
.app-title *,
.action-btn,
.mobile-btn,
#language-switcher,
.menu-toggle,
.sub-menu a,
.pc-collapse-btn,
.close-btn,
.quick-link,
.quick-link *,
.accordion-btn,
.accordion-btn *,
.accordion-links a,
.accordion-links a *,
.level-btn,
.level-btn * {
  -webkit-user-select: none;
  user-select: none;
}

.app-title::selection,
.app-title *::selection,
.action-btn::selection,
.mobile-btn::selection,
.menu-toggle::selection,
.sub-menu a::selection,
.mobile-sidebar-container ::selection,
.levels-sidebar ::selection {
  background: transparent;
  color: inherit;
}

@media (hover: none), (pointer: coarse) {
  .app-title,
  .action-btn,
  .mobile-btn,
  #language-switcher,
  .close-btn,
  .quick-link,
  .accordion-btn,
  .accordion-links a,
  .level-btn {
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }

  .app-title:focus,
  .action-btn:focus,
  .mobile-btn:focus,
  #language-switcher:focus,
  .close-btn:focus,
  .quick-link:focus,
  .accordion-btn:focus,
  .accordion-links a:focus,
  .level-btn:focus {
    outline: none;
  }
}

/* =====================================================================
   --- 3. HEADER AND NAVBAR ---
   ===================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;

  height: var(--header-h);
  min-height: var(--header-h);

  display: flex;
  align-items: center;

  background: var(--white);
  box-shadow: var(--shadow);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(
    to right,
    var(--color-sec),
    var(--primary-light),
    var(--color-mid),
    var(--color-pri)
  ) 1;

  transition:
    transform 0.22s ease,
    background-color 0.22s ease,
    box-shadow 0.22s ease;
}

.app-header.hide-on-scroll {
  transform: translateY(-100%);
  box-shadow: none;
}

.header-container {
  width: 95%;
  max-width: 1400px;
  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Brand block: stable, sharp, and lifted away from the bottom border. */
.app-title {
  position: relative;
  top: -1.5px;

  height: var(--header-h);
  max-height: var(--header-h);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;

  overflow: visible;
  text-align: center;
  cursor: pointer;
  transform-origin: center center;

  transition: opacity 0.12s ease;
}

.schoolep-logo {
  position: relative;
  z-index: 2;

  width: var(--brand-logo-size, 36px);
  height: var(--brand-logo-size, 36px);
  margin: 0 auto var(--brand-logo-overlap, -17px);
  flex-shrink: 0;

  transform: none;
  filter: none;
  opacity: 1;
  backface-visibility: hidden;
  image-rendering: auto;
  transition: opacity 0.12s ease;
}

#navbar-logo-slot,
#mobile-logo-slot,
#footer-logo-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  overflow: visible;
}

.logo-text {
  position: relative;
  z-index: 3;

  display: block;
  margin-top: 1px;
  padding-bottom: 2px;

  color: transparent;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.2;

  background: linear-gradient(
    to right,
    var(--color-sec),
    var(--primary-light),
    var(--color-mid),
    var(--color-pri),
    var(--color-sec)
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;

  transform: none;
  filter: none;
  opacity: 1;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  will-change: opacity;
  animation: logo-glow-light 4s linear infinite;
  transition: opacity 0.12s ease;
}

.dark-mode .logo-text,
html.dark-mode .logo-text,
body.dark-mode .logo-text {
  background: linear-gradient(
    to right,
    #c084fc,
    #60a5fa,
    #fbbf24,
    #4ade80,
    #c084fc
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  animation: logo-glow-dark 4s linear infinite;
}

/* Brand hover/tap: two vertical accent lines around the logo.
   The logo itself never scales, blurs, or moves, so it stays sharp.
*/
.app-title::before,
.app-title::after {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 8px;
  z-index: 0;

  width: 3px;
  border-radius: 999px;
  pointer-events: none;

  background: linear-gradient(
    180deg,
    var(--color-sec),
    var(--primary-light),
    var(--color-mid),
    var(--color-pri)
  );
  background-size: 100% 220%;

  opacity: 0;
  filter: none;

  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.app-title::before {
  inset-inline-start: -9px;
  transform: translateX(4px) scaleY(0.55);
}

.app-title::after {
  inset-inline-end: -9px;
  transform: translateX(-4px) scaleY(0.55);
}

@media (hover: hover) and (pointer: fine) {
  .app-title:hover::before,
  .app-title:hover::after {
    opacity: 1;
    animation: brand-vertical-line-flow 1.2s linear infinite;
  }

  .app-title:hover::before {
    transform: translateX(0) scaleY(1);
  }

  .app-title:hover::after {
    transform: translateX(0) scaleY(1);
  }

  .app-title:hover,
  .app-title:hover .schoolep-logo,
  .app-title:hover .logo-text {
    transform: none;
    filter: none;
    opacity: 1;
  }
}

.app-title:active::before,
.app-title:active::after {
  opacity: 1;
  animation: brand-vertical-line-flow 0.85s linear infinite;
}

.app-title:active::before {
  transform: translateX(0) scaleY(0.88);
}

.app-title:active::after {
  transform: translateX(0) scaleY(0.88);
}

.app-title:active,
.app-title:active .schoolep-logo,
.app-title:active .logo-text {
  transform: none;
  filter: none;
  opacity: 1;
}

@keyframes brand-vertical-line-flow {
  0% {
    background-position: 50% 0%;
  }

  100% {
    background-position: 50% 220%;
  }


}@keyframes logo-glow-light {
  0%, 100% { opacity: 0.94; }
  50% { opacity: 1; }
}

@keyframes logo-glow-dark {
  0%, 100% { opacity: 0.94; }
  50% { opacity: 1; }
}

/* Header action buttons: fast scale feedback without shake or blur. */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn,
.mobile-btn,
#language-switcher {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 50%;
  outline: none;

  background: var(--bg-light);
  color: var(--text-main);
  box-shadow: none;

  font-size: 0.9rem;
  line-height: 1;

  cursor: pointer;
  touch-action: manipulation;
  transform: translateZ(0) scale(1);
  transform-origin: center center;
  filter: none;
  -webkit-tap-highlight-color: transparent;

  transition:
    transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1),
    color 0.12s ease,
    background-color 0.12s ease,
    box-shadow 0.12s ease;
}

.action-btn i,
.mobile-btn i {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  line-height: 1;
  pointer-events: none;
  transform: scale(1);
  transform-origin: center center;
  filter: none;

  transition:
    transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1),
    color 0.12s ease;
}

@media (hover: hover) and (pointer: fine) {
  .action-btn:hover,
  .mobile-btn:hover {
    background: var(--bg-light);
    color: var(--primary-light);
    transform: translateY(-1px) scale(1.08);
    box-shadow: 0 6px 14px rgba(67, 97, 238, 0.10);
    filter: none;
  }

  .action-btn:hover i,
  .mobile-btn:hover i {
    transform: scale(1.04);
    filter: none;
  }
}

.action-btn:active,
.mobile-btn:active {
  background: var(--bg-light);
  color: var(--primary-light);
  transform: translateY(0) scale(0.94);
  box-shadow: 0 3px 10px rgba(67, 97, 238, 0.10);
  filter: none;
}

.action-btn:focus-visible,
.mobile-btn:focus-visible,
#language-switcher:focus-visible {
  color: var(--primary-light);
  box-shadow:
    0 0 0 3px rgba(67, 97, 238, 0.16),
    0 6px 14px rgba(67, 97, 238, 0.10);
}

html.dark-mode .action-btn,
html.dark-mode .mobile-btn,
html.dark-mode #language-switcher,
body.dark-mode .action-btn,
body.dark-mode .mobile-btn,
body.dark-mode #language-switcher {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

@media (hover: hover) and (pointer: fine) {
  html.dark-mode .action-btn:hover,
  html.dark-mode .mobile-btn:hover,
  html.dark-mode #language-switcher:hover,
  body.dark-mode .action-btn:hover,
  body.dark-mode .mobile-btn:hover,
  body.dark-mode #language-switcher:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #93c5fd;
    box-shadow: 0 6px 14px rgba(147, 197, 253, 0.10);
    filter: none;
  }
}

html.dark-mode .action-btn:active,
html.dark-mode .mobile-btn:active,
html.dark-mode #language-switcher:active,
body.dark-mode .action-btn:active,
body.dark-mode .mobile-btn:active,
body.dark-mode #language-switcher:active {
  color: #93c5fd;
}

/* Language flag: button can react, flag stays controlled and sharp. */
#language-switcher {
  overflow: hidden;
}

#language-switcher:hover,
#language-switcher:focus-visible {
  transform: translateY(-1px) scale(1.015);
  filter: none;
}

#language-switcher:active {
  transform: translateY(0) scale(0.96);
  filter: none;
}

#language-icon {
  display: block;
  width: 22px;
  height: 16px;

  border-radius: 3px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.10);

  transform: scale(0.95);
  transform-origin: center center;
  pointer-events: none;
  filter: none;

  transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#language-icon.fi-fr,
html[lang^="ar"] #language-icon,
html:not([lang]) #language-icon {
  background-color: #ffffff;
  background-image: linear-gradient(
    90deg,
    #0055a4 0 33.333%,
    #ffffff 33.333% 66.666%,
    #ef4135 66.666% 100%
  );
}

#language-icon.fi-ma,
html[lang^="fr"] #language-icon {
  background-color: #c1272d;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Crect width='30' height='20' fill='%23c1272d'/%3E%3Cpath d='M15 4.2 18.4 14.7 9.5 8.2 20.5 8.2 11.6 14.7Z' fill='none' stroke='%23006233' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E");
}

#language-switcher:hover #language-icon,
#language-switcher:focus-visible #language-icon {
  transform: scale(0.95);
  filter: none;
}

#language-switcher:active #language-icon {
  transform: scale(0.92);
  filter: none;
}

/* Desktop navigation: hover underline and smooth dropdowns. */
.desktop-nav .menu-root {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-item {
  position: relative;
}

.menu-toggle {
  position: relative;

  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 6px 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;

  color: var(--text-main);
  font-size: 1.1em;
  font-weight: 800;
  line-height: 1;

  cursor: pointer;
  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    transform 0.18s ease;
}

.menu-toggle::after {
  content: "";
  position: absolute;
  inset-inline-start: 16px;
  bottom: -5px;

  width: 0;
  height: 2px;
  border-radius: 999px;
  background: currentColor;

  transition: width 0.22s ease;
}

.desktop-nav .menu-root > li:nth-child(1) .menu-toggle { color: var(--color-pri); }
.desktop-nav .menu-root > li:nth-child(2) .menu-toggle { color: var(--color-mid); }
.desktop-nav .menu-root > li:nth-child(3) .menu-toggle { color: var(--color-sec); }

@media (hover: hover) and (pointer: fine) {
  .menu-item:hover .menu-toggle {
    background: rgba(0, 0, 0, 0.03);
    transform: translateY(-1px);
  }

  .menu-item:hover .menu-toggle::after {
    width: calc(100% - 32px);
  }

  html.dark-mode .menu-item:hover .menu-toggle,
  body.dark-mode .menu-item:hover .menu-toggle {
    background: rgba(255, 255, 255, 0.05);
  }
}

.menu-toggle i {
  font-size: 0.8em;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.18s ease;
}

.menu-item:hover .menu-toggle i {
  transform: rotate(180deg);
}

.sub-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  z-index: 1010;

  min-width: 180px;
  padding: 6px;

  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius);
  box-shadow: var(--shadow);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);

  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

[dir="ltr"] .sub-menu {
  right: auto;
  left: 50%;
}

.sub-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;

  width: 0;
  height: 0;
  transform: translateX(-50%);

  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--white);
}

.sub-menu::after {
  content: "";
  position: absolute;
  top: -15px;
  left: 0;

  width: 100%;
  height: 15px;
  background: transparent;
}

.dark-mode .sub-menu::before,
html.dark-mode .sub-menu::before,
body.dark-mode .sub-menu::before {
  border-bottom-color: #1e293b;
}

.menu-item:hover .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.sub-menu li a {
  display: block;
  padding: 10px 20px;

  color: var(--text-main);
  border-radius: 6px;

  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;

  transition:
    color 0.16s ease,
    background-color 0.16s ease,
    transform 0.16s ease;
}

.sub-menu li a:hover {
  transform: translateY(-1px);
}

.desktop-nav .menu-root > li:nth-child(1) .sub-menu li a:hover {
  color: var(--color-pri);
  background: rgba(76, 175, 80, 0.10);
}

.desktop-nav .menu-root > li:nth-child(2) .sub-menu li a:hover {
  color: var(--color-mid);
  background: rgba(255, 152, 0, 0.10);
}

.desktop-nav .menu-root > li:nth-child(3) .sub-menu li a:hover {
  color: var(--color-sec);
  background: rgba(156, 39, 176, 0.10);
}

/* =====================================================================
   --- 4. LAYOUT & SIDEBAR CORE ---
   ===================================================================== */
#sidebar-slot { display: contents; }

.main-wrapper {
  display: flex;
  gap: 25px;
  margin: 30px auto 0 auto;
  width: 95%;
  max-width: 1400px;
  flex: 1;
  align-items: flex-start;
}

.content-area {
  flex: 1;
  min-width: 0;
  width: 100%;
  transition: width 0.3s;
  position: relative;
  z-index: 1;
}

.levels-sidebar {
  position: relative;
  top: auto;
  order: -1;
  width: 215px;
  flex-shrink: 0;
  transition: width 0.3s ease;
  z-index: 600;
  overflow: visible;
}

.sidebar-card {
  background: var(--white);
  border-radius: 20px;
  padding: 16px 10px 12px 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.level-group {
  margin-bottom: 4px;
  width: 100%;
  transition: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* =====================================================================
   --- 5. SIDEBAR TITLES (EXPANDED - COMPLETELY STATIC) ---
   ===================================================================== */
.level-group h4 {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--sidebar-title-pc-ar-font-size, 1.10rem);
  font-weight: 900;
  margin: 0 auto 12px auto;
  padding: 8px 18px;
  border-radius: 999px;
  text-align: center;
text-transform: none;
letter-spacing: 0;
  width: auto;
  min-width: 118px;
  max-width: 145px;
  white-space: nowrap;

  transition: none;
  box-shadow: none;
  cursor: default;

  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}


/* Specific Accent Borders & Colors (Light Mode) */
.level-group:nth-child(1) h4 { border-bottom: 4px solid var(--color-sec); color: var(--color-sec); }
.level-group:nth-child(2) h4 { border-bottom: 4px solid var(--color-mid); color: var(--color-mid); }
.level-group:nth-child(3) h4 { border-bottom: 4px solid var(--color-pri); color: var(--color-pri); }

/* Dark Mode Static Style Base */
html.dark-mode .level-group h4 {
  background: #1e293b;
  border: 1px solid #334155;
  border-bottom-width: 4px;
  border-bottom-style: solid;
  text-shadow: none;
  box-shadow: none;
}

/* Lighter Accent Colors for Dark Mode Contrast */
html.dark-mode .level-group:nth-child(1) h4 { border-bottom-color: #c084fc; color: #c084fc; }
html.dark-mode .level-group:nth-child(2) h4 { border-bottom-color: #fbbf24; color: #fbbf24; }
html.dark-mode .level-group:nth-child(3) h4 { border-bottom-color: #4ade80; color: #4ade80; }

/* =====================================================================
   --- 5.1 SIDEBAR TITLE FONT SIZE CONTROL BY LANGUAGE (PC EXPANDED) ---
   Controls the upper stage titles in the normal desktop/sidebar state.
   ===================================================================== */
@media (min-width: 993px) {
  html[dir="rtl"] .levels-sidebar:not(.pc-collapsed) .level-group h4,
  body[dir="rtl"] .levels-sidebar:not(.pc-collapsed) .level-group h4 {
    font-size: var(--sidebar-title-pc-ar-font-size, 1.10rem);
  }

  html[dir="ltr"] .levels-sidebar:not(.pc-collapsed) .level-group h4,
  body[dir="ltr"] .levels-sidebar:not(.pc-collapsed) .level-group h4 {
    font-size: var(--sidebar-title-pc-fr-font-size, 1.00rem);
  }
}

/* =====================================================================
   --- 6. SIDEBAR BUTTONS (CLICKABLE) ---
   ===================================================================== */
.level-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 95%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.90rem;
  color: #fff;
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.level-btn i {
  font-size: 1.15rem;
  width: 20px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

.btn-text { transition: opacity 0.2s ease, transform 0.2s ease; opacity: 1; }

.level-group:nth-child(1) .level-btn { background: var(--color-sec); }
.level-group:nth-child(1) .level-btn:hover { background: var(--sidebar-purple-hover); transform: translateY(-2px); }
.level-group:nth-child(2) .level-btn { background: var(--color-mid); }
.level-group:nth-child(2) .level-btn:hover { background: var(--sidebar-orange-hover); transform: translateY(-2px); }
.level-group:nth-child(3) .level-btn { background: var(--color-pri); }
.level-group:nth-child(3) .level-btn:hover { background: var(--sidebar-green-hover); transform: translateY(-2px); }

/* =====================================================================
   --- 7. PC COLLAPSED MODE ---
   ===================================================================== */
@media (min-width: 993px) {
  /* Shrink Sidebar */
  .levels-sidebar.pc-collapsed { width: 80px; overflow: visible; }
  .levels-sidebar.pc-collapsed .sidebar-card {
    padding: 16px 5px 12px 5px;
    overflow: visible;
  }

  /* Group Spacing */
  .levels-sidebar.pc-collapsed .level-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 15px; 
    margin-bottom: 0;
  }
  
  .levels-sidebar.pc-collapsed .level-group:first-child { margin-top: 0; }

  /* Static Mini Capsules */
  .levels-sidebar.pc-collapsed .level-group h4 {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--sidebar-title-pc-collapsed-ar-font-size, 1.00rem); 
    font-weight: 900;
text-transform: none;
letter-spacing: 0;
    width: auto;
    min-width: 60px;
    max-width: 70px;
    padding: 5px 7px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
    margin-bottom: 4px; 
    border-radius: 18px;
    white-space: nowrap;
    
    /* Strictly Static */
    transition: none;
    box-shadow: none;
    cursor: default;
    
    /* Light Mode */
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
  }

  .levels-sidebar.pc-collapsed .level-group:nth-child(1) h4 { border-bottom: 2px solid var(--color-sec); color: var(--color-sec); }
  .levels-sidebar.pc-collapsed .level-group:nth-child(2) h4 { border-bottom: 2px solid var(--color-mid); color: var(--color-mid); }
  .levels-sidebar.pc-collapsed .level-group:nth-child(3) h4 { border-bottom: 2px solid var(--color-pri); color: var(--color-pri); }

  html.dark-mode .levels-sidebar.pc-collapsed .level-group h4 {
    background: #0f172a;
    border: 1px solid #334155;
    border-bottom-width: 2px; 
    border-bottom-style: solid;
    text-shadow: none;
    box-shadow: none;
  }

  html.dark-mode .levels-sidebar.pc-collapsed .level-group:nth-child(1) h4 { border-bottom-color: #c084fc; color: #c084fc; }
  html.dark-mode .levels-sidebar.pc-collapsed .level-group:nth-child(2) h4 { border-bottom-color: #fbbf24; color: #fbbf24; }
  html.dark-mode .levels-sidebar.pc-collapsed .level-group:nth-child(3) h4 { border-bottom-color: #4ade80; color: #4ade80; }

  /* PC collapsed sidebar stage-title font control by language */
  html[dir="rtl"] .levels-sidebar.pc-collapsed .level-group h4,
  body[dir="rtl"] .levels-sidebar.pc-collapsed .level-group h4 {
    font-size: var(--sidebar-title-pc-collapsed-ar-font-size, 1.00rem);
  }

  html[dir="ltr"] .levels-sidebar.pc-collapsed .level-group h4,
  body[dir="ltr"] .levels-sidebar.pc-collapsed .level-group h4 {
    font-size: var(--sidebar-title-pc-collapsed-fr-font-size, 0.82rem);
  }

  /* Center buttons */
  .levels-sidebar.pc-collapsed .level-btn {
    justify-content: center;
    width: 50px;
    height: 50px;
    padding: 0;
    margin: 5px auto; 
    border-radius: 12px;
    overflow: visible;
    position: relative;
  }
  .levels-sidebar.pc-collapsed .level-btn i { font-size: 1.4rem; margin: 0; }

  /* PERFECTLY ALIGNED TOOLTIP */
  .levels-sidebar.pc-collapsed .btn-text {
    position: absolute;
    top: 50%; 
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    background: #1e293b;
    color: #fff;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1; 
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .levels-sidebar.pc-collapsed .btn-text::after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
  }

  /* DIRECTIONAL TOOLTIP LOGIC */
  [dir="rtl"] .levels-sidebar.pc-collapsed .btn-text { right: calc(100% + 15px); transform: translateY(-50%) translateX(10px); }
  [dir="rtl"] .levels-sidebar.pc-collapsed .btn-text::after { left: 100%; border-left-color: #1e293b; }
  [dir="rtl"] .levels-sidebar.pc-collapsed .level-btn:hover .btn-text { opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0); }

  [dir="ltr"] .levels-sidebar.pc-collapsed .btn-text { left: calc(100% + 15px); transform: translateY(-50%) translateX(-10px); }
  [dir="ltr"] .levels-sidebar.pc-collapsed .btn-text::after { right: 100%; border-right-color: #1e293b; }
  [dir="ltr"] .levels-sidebar.pc-collapsed .level-btn:hover .btn-text { opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0); }

  /* Dark Mode Tooltips */
  html.dark-mode .levels-sidebar.pc-collapsed .btn-text { background: #334155; }
  html.dark-mode[dir="rtl"] .levels-sidebar.pc-collapsed .btn-text::after, [dir="rtl"] .dark-mode .levels-sidebar.pc-collapsed .btn-text::after { border-left-color: #334155; }
  html.dark-mode[dir="ltr"] .levels-sidebar.pc-collapsed .btn-text::after, [dir="ltr"] .dark-mode .levels-sidebar.pc-collapsed .btn-text::after { border-right-color: #334155; }
}

/* =====================================================================
   --- 8. PC COLLAPSE TOGGLE BUTTON (MOVED UP TO CORNER) ---
   ===================================================================== */
.pc-collapse-btn {
  position: absolute;
  top: 2px; /* Sits perfectly on the top edge border! */
  width: 30px;
  height: 30px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  cursor: pointer;
  z-index: 200;
  transition: var(--transition);
}

.pc-collapse-btn i { transition: transform 0.3s ease; font-size: 0.8rem; }

/* LTR (French) */
[dir="ltr"] .pc-collapse-btn { right: -15px; } /* Half outside right border */
[dir="ltr"] .pc-collapse-btn i { transform: rotate(180deg); }
[dir="ltr"] .levels-sidebar.pc-collapsed .pc-collapse-btn i { transform: rotate(0deg); }

/* RTL (Arabic) */
[dir="rtl"] .pc-collapse-btn { left: -15px; } /* Half outside left border */
[dir="rtl"] .pc-collapse-btn i { transform: rotate(0deg); }
[dir="rtl"] .levels-sidebar.pc-collapsed .pc-collapse-btn i { transform: rotate(180deg); }

.pc-collapse-btn:hover { background: var(--primary-light); transform: scale(1.1); }

/* =====================================================================
   --- 9. FOOTER ---
   ===================================================================== */
.app-footer { background: var(--secondary); color: #fff; padding: 25px 4% 15px; margin-top: 30px; }

/* PC: 4 Columns */
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; max-width: 1400px; margin: 0 auto; }
.footer-col { display: flex; flex-direction: column; align-items: flex-start; text-align: start; }

/* Center the first column (Logo & Description) on all screens */
.footer-col:first-child { 
  align-items: center; 
  text-align: center; 
}
/* Force nested logo containers to center their content */
.footer-col:first-child > * {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.footer-col h3 { margin-bottom: 12px; font-size: 1.1rem; color: #fff; display: flex; align-items: center; gap: 8px; }
.footer-col h3 i { color: var(--primary-light); }
html.dark-mode .footer-col h3 i { color: #bae6fd; }

.footer-col ul { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.footer-col ul li a { color: #cbd5e1; display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; transition: color 0.3s, transform 0.3s; }
.footer-col ul li a:hover,
.footer-col ul li a:focus-visible {
  color: #ffffff;
  transform: translateX(-5px);
}

html.dark-mode .footer-col ul li a:hover,
html.dark-mode .footer-col ul li a:focus-visible,
body.dark-mode .footer-col ul li a:hover,
body.dark-mode .footer-col ul li a:focus-visible {
  color: #ffffff;
}
/* Mobile: 2 Columns (Creates a perfect 2x2 grid) */
@media (max-width: 768px) {
  .footer-grid { 
    grid-template-columns: repeat(2, 1fr); /* Forces exactly 2 items per row */
    gap: 20px 10px; 
  }
  
  .footer-col:first-child { 
    grid-column: auto; /* Ensures the logo only takes up 1 of the 2 mobile slots */
    align-items: center; 
    text-align: center; 
  }
}

.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 12px; margin-top: 20px; text-align: center; color: #94a3b8; font-size: 0.8rem; }

/* FOOTER ICON DIRECTION FIX */
.footer-col ul li a i { display: inline-block; transition: transform 0.3s ease; }
[dir="ltr"] .footer-col ul li a i { transform: rotate(180deg); }
[dir="rtl"] .footer-col ul li a i { transform: rotate(0deg); }
/* =====================================================================
   --- 10. GLOBALS AND OVERLAYS ---
   ===================================================================== */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;

  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.16s ease;
}

.sidebar-overlay.active,
.mobile-sidebar-container.active .sidebar-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

html.schoolep-language-switching .levels-sidebar,
body.schoolep-language-switching .levels-sidebar,
html.schoolep-language-switching .mobile-sidebar,
body.schoolep-language-switching .mobile-sidebar {
  visibility: hidden !important;
  transition: none !important;
  animation: none !important;
}

html.schoolep-language-switching #levels-overlay,
body.schoolep-language-switching #levels-overlay,
html.schoolep-language-switching .mobile-sidebar-container,
body.schoolep-language-switching .mobile-sidebar-container {
  visibility: hidden !important;
  pointer-events: none !important;
  transition: none !important;
}

@media (max-width: 992px) {
  html.resource-sidebar-open,
  body.resource-sidebar-open,
  body.no-scroll {
    overflow: hidden;
    touch-action: none;
  }

  #levels-overlay.sidebar-overlay,
  #levels-overlay.levels-overlay {
    z-index: 1999;
    width: 100vw;
    height: 100dvh;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  #levels-overlay.sidebar-overlay.active,
  #levels-overlay.levels-overlay.active,
  html.resource-sidebar-open #levels-overlay.sidebar-overlay,
  html.resource-sidebar-open #levels-overlay.levels-overlay,
  body.resource-sidebar-open #levels-overlay.sidebar-overlay,
  body.resource-sidebar-open #levels-overlay.levels-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  html.dark-mode #levels-overlay.sidebar-overlay,
  body.dark-mode #levels-overlay.sidebar-overlay,
  html.dark-mode #levels-overlay.levels-overlay,
  body.dark-mode #levels-overlay.levels-overlay {
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .levels-sidebar,
  .levels-sidebar.active {
    z-index: 2002;
  }

  .mobile-sidebar-container {
    z-index: 2000;
  }
}

@media (min-width: 993px) {
  #levels-overlay.sidebar-overlay,
  #levels-overlay.levels-overlay {
    display: none;
  }
}

/* =====================================================================
   --- 11. MOBILE NAVBAR DRAWER + MOBILE LEVEL SIDEBAR ---
   Clean single-pass mobile section: no repeated overrides below.
   ===================================================================== */
@media (max-width: 992px) {
  /* 11.01 — Global mobile layout switches */
  .desktop-nav,
  .pc-collapse-btn {
    display: none !important;
  }

  .main-wrapper {
    flex-direction: column;
    align-items: stretch;
    margin-top: 20px;
  }

  .header-container {
    width: 94%;
  }

  .header-actions {
    gap: 7px;
  }

  .action-btn,
  .mobile-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
  }

  .action-btn i,
  .mobile-btn i {
    font-size: 0.92rem;
  }

  /* =====================================================================
     11.02 — MOBILE RESOURCE SIDEBAR / FILTER SIDEBAR
     ---------------------------------------------------------------------
     This section controls the small resource/level sidebar opened by the
     filter button on phones and tablets.

     Important:
     - This is NOT the main mobile navbar drawer.
     - This controls only .levels-sidebar.
     - Arabic stays compact with fixed button width.
     - French uses equal-width buttons sized to show the full labels.
     - Icon + text start from the language side:
       Arabic / RTL = right.
       French / LTR = left.

     Main variables:
     --resource-sidebar-width        = full drawer width.
     --resource-button-width         = Arabic/fallback fixed button width.
     --resource-button-fit           = final width mode, fixed for equal button sizes.
     --resource-button-min-width     = fixed equal button minimum width.
     --resource-button-max-width     = fixed equal button maximum width.
     --resource-button-height        = button height.
     --resource-button-padding-x     = horizontal inner spacing.
     --resource-button-padding-y     = vertical inner spacing.
     --resource-button-gap           = space between icon and text.
     --resource-button-font-size     = text size.
     --resource-icon-box             = fixed icon column width.
     --resource-icon-size            = icon size.
     ===================================================================== */

  .levels-sidebar {
    /* Drawer position */
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;

    /* Arabic / default compact values */
    --resource-sidebar-width: min(70vw, 190px);
    --resource-button-width: 150px;
    --resource-button-height: 38px;

    --resource-button-padding-y: 8px;
    --resource-button-padding-x: 12px;

    --resource-button-gap: 5px;
    --resource-button-radius: 10px;

    --resource-button-font-size: 0.8rem;
    --resource-button-line-height: 1;

    --resource-icon-box: 17px;
    --resource-icon-size: 0.92rem;

    width: var(--resource-sidebar-width);

    background: var(--white);
    z-index: 2001;

    transform: translateX(-110%);
    transition: transform 0.3s ease;

    overflow-y: auto;
    padding-top: 6px;

    box-shadow: 10px 0 20px rgba(0, 0, 0, 0.10);
  }

  /* Arabic / RTL drawer opens from the right */
  html[dir="rtl"] .levels-sidebar,
  body[dir="rtl"] .levels-sidebar {
    left: auto;
    right: 0;
    transform: translateX(110%);
    box-shadow: -10px 0 20px rgba(0, 0, 0, 0.10);
  }

  /* French / LTR drawer opens from the left with equal-width buttons */
 html[dir="ltr"] .levels-sidebar,
body[dir="ltr"] .levels-sidebar {
  left: 0;
  right: auto;

  /*
    White sidebar X length.
    Keep it only a little wider than the 162px buttons.
  */
  --resource-sidebar-width: clamp(184px, 60vw, 195px);

  --resource-button-width: 162px;
  --resource-button-fit: var(--resource-button-width);
  --resource-button-min-width: var(--resource-button-width);
  --resource-button-max-width: var(--resource-button-width);

  --resource-button-gap: 6px;
  --resource-button-font-size: 0.82rem;
  --resource-button-padding-x: 10px;

  transform: translateX(-110%);
  box-shadow: 10px 0 20px rgba(0, 0, 0, 0.10);
}


  /* Open state added by JS or first-paint persisted shell state */
  .levels-sidebar.active,
  html.resource-sidebar-open .levels-sidebar,
  body.resource-sidebar-open .levels-sidebar,
  html[dir="rtl"] .levels-sidebar.active,
  body[dir="rtl"] .levels-sidebar.active,
  html[dir="ltr"] .levels-sidebar.active,
  body[dir="ltr"] .levels-sidebar.active {
    transform: translateX(0) !important;
  }

  /* Dark mode background for the resource drawer */
  html.dark-mode .levels-sidebar,
  body.dark-mode .levels-sidebar {
    background: #0f172a;
  }

  /* Inner card/panel */
.levels-sidebar .sidebar-card {
  padding: 6px 6px 12px;
  border-radius: 18px;
}
  /* Stage groups: Lycée / Collège / Primaire */
  .levels-sidebar .level-group {
    width: 100%;
    align-items: center;
    margin-bottom: 4px;
  }

  /* Stage title pills */
  .levels-sidebar .level-group h4 {
    display: flex;
    align-items: center;
    justify-content: center;

    width: auto;
    min-width: 110px;
    max-width: 132px;

    margin: 0 auto 10px;
    padding: 7px 14px;

    border-radius: 999px;

    font-size: var(--sidebar-title-mobile-ar-font-size, 0.90rem);
    font-weight: 900;
    letter-spacing: 0.3px;
    line-height: 1.1;

    white-space: nowrap;
    text-align: center;
  }

  /* French title pills need a little more room */
  html[dir="ltr"] .levels-sidebar .level-group h4,
  body[dir="ltr"] .levels-sidebar .level-group h4 {
    min-width: 122px;
    max-width: 165px;
    font-size: var(--sidebar-title-mobile-fr-font-size, 0.86rem);
  }

  /* Mobile resource-sidebar stage-title font control by language */
  html[dir="rtl"] .levels-sidebar .level-group h4,
  body[dir="rtl"] .levels-sidebar .level-group h4 {
    font-size: var(--sidebar-title-mobile-ar-font-size, 0.90rem);
  }

  html[dir="ltr"] .levels-sidebar .level-group h4,
  body[dir="ltr"] .levels-sidebar .level-group h4 {
    font-size: var(--sidebar-title-mobile-fr-font-size, 0.86rem);
  }

  /* Resource buttons */
  .levels-sidebar .level-btn {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;

    /*
      Arabic keeps fixed width through --resource-button-width.
      French also uses a fixed width so every button has the same X size.
    */
    width: var(--resource-button-fit, var(--resource-button-width));
    min-width: var(--resource-button-min-width, var(--resource-button-width));
    max-width: var(--resource-button-max-width, var(--resource-button-width));

    height: var(--resource-button-height);

    padding: var(--resource-button-padding-y) var(--resource-button-padding-x);
    margin: 0 auto 10px;

    gap: var(--resource-button-gap);

    border-radius: var(--resource-button-radius);

    font-size: var(--resource-button-font-size);
    line-height: var(--resource-button-line-height);

    white-space: nowrap;
    overflow: hidden;
  }

  /* Icon column: fixed width keeps all labels aligned */
  .levels-sidebar .level-btn i {
    width: var(--resource-icon-box);
    min-width: var(--resource-icon-box);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: var(--resource-icon-size);
    line-height: 1;

    flex-shrink: 0;
  }

  /* Button text */
  .levels-sidebar .btn-text {
    flex: 1 1 auto;
    min-width: 0;

    text-align: start;
    line-height: 1;

    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
  }

  /* Arabic baseline correction */
  html[dir="rtl"] .levels-sidebar .btn-text,
  body[dir="rtl"] .levels-sidebar .btn-text {
    transform: translateY(1.5px);
  }

  /* French baseline correction */
  html[dir="ltr"] .levels-sidebar .btn-text,
  body[dir="ltr"] .levels-sidebar .btn-text {
    transform: translateY(2.5px);
  }

  /* Extra-small phone guard for resource sidebar */
  @media (max-width: 380px) {
    .levels-sidebar {
      --resource-sidebar-width: min(72vw, 185px);
      --resource-button-width: 140px;
      --resource-button-font-size: 0.82rem;
      --resource-button-padding-x: 10px;
      --resource-button-gap: 5px;
    }
html[dir="ltr"] .levels-sidebar,
body[dir="ltr"] .levels-sidebar {
  --resource-sidebar-width: clamp(184px, 62vw, 195px);

  --resource-button-width: 168px;
  --resource-button-fit: var(--resource-button-width);
  --resource-button-min-width: var(--resource-button-width);
  --resource-button-max-width: var(--resource-button-width);

  --resource-button-font-size: 0.88rem;
  --resource-button-gap: 5px;
  --resource-button-padding-x: 9px;
}
  }

  /* 11.03 — Collapsed resource sidebar on mobile widths */
  .levels-sidebar.pc-collapsed .sidebar-card {
    padding: 16px 5px 12px;
    overflow: visible;
    align-items: center;
  }

  .levels-sidebar.pc-collapsed .level-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 12px;
    margin-bottom: 0;
  }

  .levels-sidebar.pc-collapsed .level-group:first-child {
    margin-top: 0;
  }

  .levels-sidebar.pc-collapsed .level-group h4 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 52px;
    max-width: 62px;
    margin: 0 auto 5px;
    padding: 5px 7px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    white-space: nowrap;
  }

  .levels-sidebar.pc-collapsed .level-btn {
    justify-content: center;
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: 50px;
    padding: 0 !important;
    margin: 5px auto !important;
    gap: 0;
    border-radius: 12px;
    overflow: visible;
    position: relative;
  }

  .levels-sidebar.pc-collapsed .level-btn i {
    width: auto;
    min-width: 0;
    margin: 0;
    font-size: 1.35rem;
  }

  .levels-sidebar.pc-collapsed .btn-text {
    position: absolute;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    background: #1e293b;
    color: #fff;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.30);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .levels-sidebar.pc-collapsed .btn-text::after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
  }

  html[dir="rtl"] .levels-sidebar.pc-collapsed .btn-text,
  body[dir="rtl"] .levels-sidebar.pc-collapsed .btn-text {
    right: calc(100% + 15px);
    transform: translateY(-50%) translateX(10px);
  }

  html[dir="rtl"] .levels-sidebar.pc-collapsed .btn-text::after,
  body[dir="rtl"] .levels-sidebar.pc-collapsed .btn-text::after {
    left: 100%;
    border-left-color: #1e293b;
  }

  html[dir="rtl"] .levels-sidebar.pc-collapsed .level-btn:hover .btn-text,
  body[dir="rtl"] .levels-sidebar.pc-collapsed .level-btn:hover .btn-text {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
  }

  html[dir="ltr"] .levels-sidebar.pc-collapsed .btn-text,
  body[dir="ltr"] .levels-sidebar.pc-collapsed .btn-text {
    left: calc(100% + 15px);
    transform: translateY(-50%) translateX(-10px);
  }

  html[dir="ltr"] .levels-sidebar.pc-collapsed .btn-text::after,
  body[dir="ltr"] .levels-sidebar.pc-collapsed .btn-text::after {
    right: 100%;
    border-right-color: #1e293b;
  }

  html[dir="ltr"] .levels-sidebar.pc-collapsed .level-btn:hover .btn-text,
  body[dir="ltr"] .levels-sidebar.pc-collapsed .level-btn:hover .btn-text {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
  }

  html.dark-mode .levels-sidebar.pc-collapsed .btn-text,
  body.dark-mode .levels-sidebar.pc-collapsed .btn-text {
    background: #334155;
  }

  html.dark-mode[dir="rtl"] .levels-sidebar.pc-collapsed .btn-text::after,
  body.dark-mode[dir="rtl"] .levels-sidebar.pc-collapsed .btn-text::after {
    border-left-color: #334155;
  }

  html.dark-mode[dir="ltr"] .levels-sidebar.pc-collapsed .btn-text::after,
  body.dark-mode[dir="ltr"] .levels-sidebar.pc-collapsed .btn-text::after {
    border-right-color: #334155;
  }

  /* 11.04 — Mobile main navigation drawer shell */
   .mobile-sidebar-container {
    position: fixed;
    inset: 0;
    z-index: 2000;
    visibility: hidden;
    pointer-events: none;

    transition: none;
  }

  .mobile-sidebar-container.active {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .mobile-sidebar {
    position: absolute;
    top: 0;
    right: 0;

    /* Narrower mobile drawer: takes less than half the screen width */
    width: min(68vw, 255px);
    height: 100vh;

    background: rgba(255, 255, 255, 0.97);
    color: #1e293b;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    box-shadow: -20px 0 42px rgba(15, 23, 42, 0.16);
    transform: translateX(110%);

    /* Faster mobile navbar open */
    transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);

    display: flex;
    flex-direction: column;
    z-index: 1600;

    border-left: 1px solid rgba(226, 232, 240, 0.95);
    overflow: hidden;

    will-change: transform;
  }

  /* Arabic / RTL drawer opens from the right */
  html[dir="rtl"] .mobile-sidebar,
  body[dir="rtl"] .mobile-sidebar {
    right: 0;
    left: auto;
    transform: translateX(110%);
    box-shadow: -20px 0 42px rgba(15, 23, 42, 0.16);
    border-left: 1px solid rgba(226, 232, 240, 0.95);
    border-right: none;
  }

  /* French / LTR drawer opens from the left */
  html[dir="ltr"] .mobile-sidebar,
  body[dir="ltr"] .mobile-sidebar {
    right: auto;
    left: 0;
    transform: translateX(-110%);
    box-shadow: 20px 0 42px rgba(15, 23, 42, 0.16);
    border-left: none;
    border-right: 1px solid rgba(226, 232, 240, 0.95);
  }

  .mobile-sidebar-container.active .mobile-sidebar,
  html[dir="rtl"] .mobile-sidebar-container.active .mobile-sidebar,
  body[dir="rtl"] .mobile-sidebar-container.active .mobile-sidebar,
  html[dir="ltr"] .mobile-sidebar-container.active .mobile-sidebar,
  body[dir="ltr"] .mobile-sidebar-container.active .mobile-sidebar {
    transform: translateX(0);
  }
  
  html.dark-mode .mobile-sidebar,
  body.dark-mode .mobile-sidebar {
    background: linear-gradient(180deg, rgba(12, 30, 53, 0.98), rgba(26, 38, 57, 0.98));
    color: #f8fafc;
    box-shadow: -22px 0 46px rgba(0, 0, 0, 0.35);
    border-left-color: rgba(255, 255, 255, 0.12);
  }

  html.dark-mode[dir="ltr"] .mobile-sidebar,
  body.dark-mode[dir="ltr"] .mobile-sidebar {
    box-shadow: 22px 0 46px rgba(0, 0, 0, 0.35);
    border-right-color: rgba(255, 255, 255, 0.12);
  }

  /* 11.05 — Mobile drawer header and centered brand */
  .drawer-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(80px, 19vw, 96px);
    padding: 9px 42px 8px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  }

  html.dark-mode .drawer-head,
  body.dark-mode .drawer-head {
    border-bottom-color: rgba(255, 255, 255, 0.12);
  }

  .drawer-brand {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
  }

  #mobile-sidebar-container .drawer-brand .app-title,
  #mobile-sidebar-container .drawer-brand .drawer-brand-link {
    position: relative;
    top: 5px;
    width: min(100%, 172px);
    height: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 0 auto;
    overflow: visible;
    text-align: center;
    text-decoration: none;
    flex-shrink: 0;
  }

  #mobile-sidebar-container .drawer-brand #mobile-logo-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    height: clamp(28px, 8vw, 36px);
    overflow: visible;
  }

  #mobile-sidebar-container .drawer-brand .schoolep-logo {
    width: clamp(30px, 8.5vw, var(--brand-logo-size, 36px));
    height: clamp(30px, 8.5vw, var(--brand-logo-size, 36px));
    margin: 0 auto var(--brand-logo-overlap, -12px);
    flex-shrink: 0;
  }

  #mobile-sidebar-container .drawer-brand .logo-text {
    max-width: 100%;
    margin: 0 auto;
    padding-bottom: 2px;
    line-height: 1.08;
    font-size: clamp(1rem, 4.7vw, 1.15rem);
    text-align: center;
    white-space: nowrap;
  }


  /* Mobile main drawer logo bars only.
     Keeps the top navbar logo unchanged; moves the two vertical bars closer
     around the logo inside the hamburger-opened drawer. */
  #mobile-sidebar-container .drawer-brand .app-title::before,
  #mobile-sidebar-container .drawer-brand .drawer-brand-link::before {
    inset-inline-start: 28px;
  }

  #mobile-sidebar-container .drawer-brand .app-title::after,
  #mobile-sidebar-container .drawer-brand .drawer-brand-link::after {
    inset-inline-end: 28px;
  }

  @media (max-width: 380px) {
    #mobile-sidebar-container .drawer-brand .app-title::before,
    #mobile-sidebar-container .drawer-brand .drawer-brand-link::before {
      inset-inline-start: 20px;
    }

    #mobile-sidebar-container .drawer-brand .app-title::after,
    #mobile-sidebar-container .drawer-brand .drawer-brand-link::after {
      inset-inline-end: 20px;
    }
  }

  .drawer-brand-text {
    width: 100%;
    max-width: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2px auto 0;
    padding: 0 4px;
    text-align: center;
  }

  .drawer-brand-text strong {
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 800;
  }

  .drawer-brand-text small {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
    color: #64748b;
    font-size: clamp(0.62rem, 2.75vw, 0.76rem);
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    transform: none;
  }

  html[dir="rtl"] .drawer-brand-text small,
  body[dir="rtl"] .drawer-brand-text small,
  html[dir="ltr"] .drawer-brand-text small,
  body[dir="ltr"] .drawer-brand-text small {
    transform: none;
  }

  @media (max-width: 380px) {
    .drawer-brand-text small {
      font-size: clamp(0.58rem, 2.55vw, 0.68rem);
    }
  }
  
  html.dark-mode .drawer-brand-text small,
  body.dark-mode .drawer-brand-text small {
    color: rgba(248, 250, 252, 0.72);
  }

  .brand-badge {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .close-btn {
    position: absolute;
    top: 8px;

    width: 30px;
    height: 30px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0;
    font-size: 1rem;
    z-index: 3;

    transition:
      transform 0.18s ease,
      background-color 0.18s ease,
      border-color 0.18s ease,
      color 0.18s ease;
  }

  html[dir="rtl"] .close-btn,
  body[dir="rtl"] .close-btn {
    left: 8px;
    right: auto;
  }

  html[dir="ltr"] .close-btn,
  body[dir="ltr"] .close-btn {
    right: 8px;
    left: auto;
  }

  .close-btn:hover,
  .close-btn:active {
    background: #eef2ff;
    border-color: rgba(67, 97, 238, 0.28);
    color: var(--primary-light);
    transform: scale(0.95);
  }

  html.dark-mode .close-btn,
  body.dark-mode .close-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.14);
  }

  html.dark-mode .close-btn:hover,
  html.dark-mode .close-btn:active,
  body.dark-mode .close-btn:hover,
  body.dark-mode .close-btn:active {
    background: rgba(147, 197, 253, 0.14);
    border-color: rgba(147, 197, 253, 0.32);
    color: #93c5fd;
  }

  /* 11.06 — Mobile drawer body and row system */
  .drawer-body {
    --drawer-row-height: 36px;
    --drawer-row-radius: 9px;
    --drawer-icon-column: 20px;
    --drawer-title-column: 76px;
    --drawer-icon-title-gap: 5px;
    --drawer-button-width: 88%;

    flex: 1;
    overflow-y: auto;
    padding: 7px 6px 10px;
    display: grid;
    gap: 6px;
    align-content: flex-start;
  }

  .quick-link,
  .accordion-btn {
    height: var(--drawer-row-height);
    min-height: var(--drawer-row-height);
    padding: 0 8px;
    display: grid;
    grid-template-columns: var(--drawer-icon-column) var(--drawer-title-column);
    align-items: center;
    justify-items: start;
    justify-content: center;
    column-gap: var(--drawer-icon-title-gap);
    line-height: 1;
  }

  .quick-link {
    width: var(--drawer-button-width);
    justify-self: center;
    text-decoration: none;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--drawer-row-radius);
    font-weight: 900;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
    transition:
      transform 0.18s ease,
      background-color 0.18s ease,
      border-color 0.18s ease,
      color 0.18s ease;
  }

  .quick-link:hover,
  .quick-link:active {
    transform: translateY(-1px);
    color: var(--primary-light);
    background: #eef2ff;
    border-color: rgba(67, 97, 238, 0.24);
  }

  html.dark-mode .quick-link,
  body.dark-mode .quick-link {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  }

  html.dark-mode .quick-link:hover,
  html.dark-mode .quick-link:active,
  body.dark-mode .quick-link:hover,
  body.dark-mode .quick-link:active {
    color: #93c5fd;
    background: rgba(147, 197, 253, 0.14);
    border-color: rgba(147, 197, 253, 0.32);
  }

.quick-link span,
.accordion-title {
  grid-column: 2;
  grid-row: 1;

  display: inline-flex;
  align-items: center;
  justify-content: flex-start;

  height: 100%;
  min-height: 0;

  margin: 0;
  padding: 0;

  line-height: 1;
  white-space: nowrap;
  text-align: start;
  justify-self: start;
}

/* Arabic text baseline correction */
html[dir="rtl"] .quick-link span,
html[dir="rtl"] .accordion-title,
body[dir="rtl"] .quick-link span,
body[dir="rtl"] .accordion-title {
  transform: translateY(3px);
}

/* French text baseline correction */
html[dir="ltr"] .quick-link span,
html[dir="ltr"] .accordion-title,
body[dir="ltr"] .quick-link span,
body[dir="ltr"] .accordion-title {
  transform: translateY(4.15px);
}

.quick-link i,
.accordion-btn .chevron {
  grid-column: 1;
  grid-row: 1;
  width: var(--drawer-icon-column);
  height: var(--drawer-icon-column);
  min-width: var(--drawer-icon-column);
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0.9rem;
  justify-self: center;
  transform-origin: center center;
}

  .accordion-item.active .chevron {
    transform: rotate(180deg);
  }

  /* 11.07 — Mobile accordion cards and links */
  .accordion-list {
    display: grid;
    gap: 6px;
    width: 100%;
  }

  .accordion-item {
    width: var(--drawer-button-width);
    justify-self: center;
    min-height: var(--drawer-row-height);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--drawer-row-radius);
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
    transition:
      background-color 0.18s ease,
      border-color 0.18s ease,
      box-shadow 0.18s ease;
  }

  .accordion-item.active {
    box-shadow: 0 5px 12px rgba(15, 23, 42, 0.08);
  }

  /* Active secondary stage: purple */
  .accordion-list .accordion-item:nth-child(1).active {
    background: rgba(156, 39, 176, 0.08);
    border-color: rgba(156, 39, 176, 0.26);
    box-shadow: 0 5px 12px rgba(156, 39, 176, 0.10);
  }

  /* Active middle stage: orange */
  .accordion-list .accordion-item:nth-child(2).active {
    background: rgba(255, 152, 0, 0.09);
    border-color: rgba(255, 152, 0, 0.28);
    box-shadow: 0 5px 12px rgba(255, 152, 0, 0.11);
  }

  /* Active primary stage: green */
  .accordion-list .accordion-item:nth-child(3).active {
    background: rgba(76, 175, 80, 0.09);
    border-color: rgba(76, 175, 80, 0.26);
    box-shadow: 0 5px 12px rgba(76, 175, 80, 0.10);
  }
  html.dark-mode .accordion-item,
  body.dark-mode .accordion-item {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  }

  html.dark-mode .accordion-item.active,
  body.dark-mode .accordion-item.active {
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
  }

  /* Dark active secondary stage: purple */
  html.dark-mode .accordion-list .accordion-item:nth-child(1).active,
  body.dark-mode .accordion-list .accordion-item:nth-child(1).active {
    background: rgba(192, 132, 252, 0.13);
    border-color: rgba(192, 132, 252, 0.34);
  }

  /* Dark active middle stage: orange */
  html.dark-mode .accordion-list .accordion-item:nth-child(2).active,
  body.dark-mode .accordion-list .accordion-item:nth-child(2).active {
    background: rgba(251, 191, 36, 0.13);
    border-color: rgba(251, 191, 36, 0.34);
  }

  /* Dark active primary stage: green */
  html.dark-mode .accordion-list .accordion-item:nth-child(3).active,
  body.dark-mode .accordion-list .accordion-item:nth-child(3).active {
    background: rgba(74, 222, 128, 0.13);
    border-color: rgba(74, 222, 128, 0.34);
  }

  .accordion-btn {
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: center;
  }

  .accordion-title {
    font-size: 0.96rem;
    font-weight: 900;
  }

  .accordion-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s ease;
  }

  .accordion-item.active .accordion-content {
    grid-template-rows: 1fr;
  }

  .accordion-content-inner {
    overflow: hidden;
  }

.accordion-links {
  padding: 6px 5px 8px;
  display: grid;
  gap: 7px;
}

.accordion-links a {
  width: 88%;
  justify-self: center;
  min-height: 31px;
  padding: 4px 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
  color: #334155;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 750;
  line-height: 1.1;
  transition:
    transform 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

  .accordion-links a:hover,
  .accordion-links a:active {
    transform: translateY(-1px);
  }

  /* Stage-colored hover and active states for mobile drawer sub-buttons.
     Order: 1 = secondary, 2 = middle, 3 = primary. */
  .accordion-list .accordion-item:nth-child(1) .accordion-links a:hover,
  .accordion-list .accordion-item:nth-child(1) .accordion-links a:active {
    color: var(--color-sec);
    background: rgba(156, 39, 176, 0.10);
    border-color: rgba(156, 39, 176, 0.24);
  }

  .accordion-list .accordion-item:nth-child(2) .accordion-links a:hover,
  .accordion-list .accordion-item:nth-child(2) .accordion-links a:active {
    color: var(--color-mid);
    background: rgba(255, 152, 0, 0.10);
    border-color: rgba(255, 152, 0, 0.26);
  }

  .accordion-list .accordion-item:nth-child(3) .accordion-links a:hover,
  .accordion-list .accordion-item:nth-child(3) .accordion-links a:active {
    color: var(--color-pri);
    background: rgba(76, 175, 80, 0.10);
    border-color: rgba(76, 175, 80, 0.24);
  }

  html.dark-mode .accordion-links a,
  body.dark-mode .accordion-links a {
    color: rgba(248, 250, 252, 0.92);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.10);
  }

  html.dark-mode .accordion-list .accordion-item:nth-child(1) .accordion-links a:hover,
  html.dark-mode .accordion-list .accordion-item:nth-child(1) .accordion-links a:active,
  body.dark-mode .accordion-list .accordion-item:nth-child(1) .accordion-links a:hover,
  body.dark-mode .accordion-list .accordion-item:nth-child(1) .accordion-links a:active {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.14);
    border-color: rgba(192, 132, 252, 0.32);
  }

  html.dark-mode .accordion-list .accordion-item:nth-child(2) .accordion-links a:hover,
  html.dark-mode .accordion-list .accordion-item:nth-child(2) .accordion-links a:active,
  body.dark-mode .accordion-list .accordion-item:nth-child(2) .accordion-links a:hover,
  body.dark-mode .accordion-list .accordion-item:nth-child(2) .accordion-links a:active {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.14);
    border-color: rgba(251, 191, 36, 0.32);
  }

  html.dark-mode .accordion-list .accordion-item:nth-child(3) .accordion-links a:hover,
  html.dark-mode .accordion-list .accordion-item:nth-child(3) .accordion-links a:active,
  body.dark-mode .accordion-list .accordion-item:nth-child(3) .accordion-links a:hover,
  body.dark-mode .accordion-list .accordion-item:nth-child(3) .accordion-links a:active {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.14);
    border-color: rgba(74, 222, 128, 0.32);
  }

/* 11.08 — School-stage colors inside mobile drawer
   Text and chevron arrows share the same color.
   Order: 1 = secondary, 2 = middle, 3 = primary.
*/

/* Light mode */
.accordion-list .accordion-item:nth-child(1) .accordion-title,
.accordion-list .accordion-item:nth-child(1) .accordion-btn .chevron {
  color: var(--color-sec);
}

.accordion-list .accordion-item:nth-child(2) .accordion-title,
.accordion-list .accordion-item:nth-child(2) .accordion-btn .chevron {
  color: var(--color-mid);
}

.accordion-list .accordion-item:nth-child(3) .accordion-title,
.accordion-list .accordion-item:nth-child(3) .accordion-btn .chevron {
  color: var(--color-pri);
}

/* Dark mode */
html.dark-mode .accordion-list .accordion-item:nth-child(1) .accordion-title,
html.dark-mode .accordion-list .accordion-item:nth-child(1) .accordion-btn .chevron,
body.dark-mode .accordion-list .accordion-item:nth-child(1) .accordion-title,
body.dark-mode .accordion-list .accordion-item:nth-child(1) .accordion-btn .chevron {
  color: #c084fc;
}

html.dark-mode .accordion-list .accordion-item:nth-child(2) .accordion-title,
html.dark-mode .accordion-list .accordion-item:nth-child(2) .accordion-btn .chevron,
body.dark-mode .accordion-list .accordion-item:nth-child(2) .accordion-title,
body.dark-mode .accordion-list .accordion-item:nth-child(2) .accordion-btn .chevron {
  color: #fbbf24;
}

html.dark-mode .accordion-list .accordion-item:nth-child(3) .accordion-title,
html.dark-mode .accordion-list .accordion-item:nth-child(3) .accordion-btn .chevron,
body.dark-mode .accordion-list .accordion-item:nth-child(3) .accordion-title,
body.dark-mode .accordion-list .accordion-item:nth-child(3) .accordion-btn .chevron {
  color: #4ade80;
}


  /* 11.09 — Extra-narrow phone guard */
  @media (max-width: 380px) {
    .mobile-sidebar {
      width: 58vw;
    }

    .drawer-body {
      --drawer-button-width: 90%;
      --drawer-title-column: 70px;
    }

    .quick-link,
    .accordion-btn {
      padding-inline: 6px;
    }

    .accordion-title,
    .quick-link {
      font-size: 0.92rem;
    }

    .accordion-links a {
      width: 90%;
      font-size: 0.88rem;
    }
  }
}

/* =====================================================================
   --- 11.10 MOBILE TOP NAVBAR BRAND POSITION ---
   Keeps desktop unchanged. Moves only the visible top mobile navbar logo
   down as one centered brand block.
   ===================================================================== */
@media (max-width: 992px) {
  .app-header .app-title {
    top: 0px;
  }
}

/* =====================================================================
   --- 12. DESKTOP-ONLY VISIBILITY FIXES ---
   ===================================================================== */
@media (min-width: 993px) {
  .mobile-sidebar-container,
  .mobile-btn,
  #sidebar-toggle-btn {
    display: none !important;
  }
}

/* =====================================================================
   --- 13. BRAND + LANGUAGE NO-FLASH SAFEGUARDS ---
   ===================================================================== */
#navbar-slot .app-title,
#mobile-sidebar-container .drawer-brand .app-title,
html.schoolep-brand-ready #navbar-slot .app-title,
html.schoolep-brand-ready #mobile-sidebar-container .drawer-brand .app-title {
  opacity: 1;
  visibility: visible;
}

#language-switcher {
  opacity: 1;
  visibility: visible;
}

#language-icon {
  opacity: 1;
}

/* =====================================================================
   --- 14. MOBILE PERFORMANCE + STABILITY PATCH ---
   Purpose: improve first render and scrolling on phones without changing
   navbar/sidebar/footer icons or core behavior.
   ===================================================================== */
@media (max-width: 768px) {
  html,
  body {
    text-rendering: optimizeSpeed;
  }

  .app-header {
    min-height: var(--header-h);
    contain: layout paint style;
  }

  #navbar-slot,
  #sidebar-slot,
  #footer-slot {
    contain: layout style;
  }

  .app-title .schoolep-logo,
  .app-title .logo-text,
  .action-btn,
  .mobile-btn,
  #language-switcher,
  .level-btn,
  .accordion-btn,
  .accordion-links a {
    will-change: auto !important;
  }

  .logo-text {
    animation-duration: 8s;
  }

  .action-btn,
  .mobile-btn,
  #language-switcher,
  .quick-link,
  .accordion-btn,
  .accordion-links a,
  .level-btn {
    transition-duration: 0.14s !important;
  }

  .mobile-sidebar,
  .levels-sidebar {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-sidebar-container,
  .levels-sidebar,
  .sidebar-card {
    contain: layout paint style;
  }

  .main-wrapper,
  .content-area {
    max-width: 100%;
  }
}

@media (max-width: 768px), (hover: none), (pointer: coarse) {
  .app-title:hover .schoolep-logo,
  .app-title:hover .logo-text,
  .action-btn:hover,
  .mobile-btn:hover,
  #language-switcher:hover,
  .level-btn:hover,
  .accordion-btn:hover,
  .accordion-links a:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* =====================================================================
   Footer report issue link - global red style
   ---------------------------------------------------------------------
   Used by the hardcoded index footer and every injected footer component.
   The report system is a normal page link, not a floating button/modal.
   ===================================================================== */
.app-footer .footer-report-issue-item {
  margin-top: 2px;
}

.app-footer .footer-col ul li a.footer-report-issue-link,
.app-footer .footer-report-issue-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #e2e8f0;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.45;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 0.16s ease,
    transform 0.16s ease;
}

.app-footer .footer-report-issue-link i {
  color: #ff0400;
  font-size: 0.92rem;
  line-height: 1;
  transform: none;
  transition:
    color 0.16s ease,
    transform 0.16s ease;
}

/* Prevent the generic footer chevron-direction rule from rotating this icon. */
html[dir="rtl"] .app-footer .footer-report-issue-link i,
html[dir="ltr"] .app-footer .footer-report-issue-link i,
body[dir="rtl"] .app-footer .footer-report-issue-link i,
body[dir="ltr"] .app-footer .footer-report-issue-link i {
  transform: none;
}

.app-footer .footer-report-issue-link:hover,
.app-footer .footer-report-issue-link:focus-visible {
  color: #ffffff;
  outline: none;
}

html[dir="rtl"] .app-footer .footer-report-issue-link:hover,
html[dir="rtl"] .app-footer .footer-report-issue-link:focus-visible,
body[dir="rtl"] .app-footer .footer-report-issue-link:hover,
body[dir="rtl"] .app-footer .footer-report-issue-link:focus-visible {
  transform: translateX(-3px);
}

html[dir="ltr"] .app-footer .footer-report-issue-link:hover,
html[dir="ltr"] .app-footer .footer-report-issue-link:focus-visible,
body[dir="ltr"] .app-footer .footer-report-issue-link:hover,
body[dir="ltr"] .app-footer .footer-report-issue-link:focus-visible {
  transform: translateX(3px);
}

.app-footer .footer-report-issue-link:hover i,
.app-footer .footer-report-issue-link:focus-visible i {
  color: #ff3b30;
}

html.dark-mode .app-footer .footer-report-issue-link i,
body.dark-mode .app-footer .footer-report-issue-link i {
  color: #ff0400;
}

html[data-report-page] .footer-report-issue-item {
  display: none;
}

/* =====================================================================
   Footer information pages
   ===================================================================== */
.info-page-content {
  --info-accent: #2563eb;
  --info-accent-rgb: 37, 99, 235;
  --info-text: #0f172a;
  --info-muted: #64748b;
  --info-card: #ffffff;
  --info-border: rgba(15, 23, 42, 0.10);
  --info-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  color: var(--info-text);
  min-height: calc(100vh - var(--header-h, 70px) - 160px);
}

html.dark-mode .info-page-content,
body.dark-mode .info-page-content {
  --info-text: #f8fafc;
  --info-muted: #cbd5e1;
  --info-card: #111827;
  --info-border: rgba(255, 255, 255, 0.12);
  --info-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.info-page-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--info-muted);
  font-size: 13px;
  font-weight: 700;
}

.info-page-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: inherit;
  text-decoration: none;
}

.info-page-breadcrumb a:hover,
.info-page-breadcrumb a:focus-visible {
  color: var(--info-accent);
  outline: none;
}

.info-page-hero {
  margin-bottom: 18px;
  padding: 28px 26px;
  border: 1px solid var(--info-border);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(var(--info-accent-rgb), 0.18), transparent 36%),
    linear-gradient(135deg, var(--info-card), rgba(255, 255, 255, 0.86));
  box-shadow: var(--info-shadow);
}

html[dir="ltr"] .info-page-hero {
  background:
    radial-gradient(circle at top left, rgba(var(--info-accent-rgb), 0.18), transparent 36%),
    linear-gradient(135deg, var(--info-card), rgba(255, 255, 255, 0.86));
}

html.dark-mode .info-page-hero,
body.dark-mode .info-page-hero {
  background:
    radial-gradient(circle at top right, rgba(var(--info-accent-rgb), 0.18), transparent 36%),
    linear-gradient(135deg, var(--info-card), rgba(15, 23, 42, 0.82));
}

.info-page-hero-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.info-page-icon {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--info-accent), #1d4ed8);
  box-shadow: 0 14px 28px rgba(var(--info-accent-rgb), 0.28);
  font-size: 1.45rem;
}

.info-page-title {
  margin: 0;
  color: var(--info-text);
  font-size: clamp(1.55rem, 2.2vw, 2.2rem);
  font-weight: 900;
  line-height: 1.25;
}

.info-page-subtitle {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--info-muted);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.8;
}

.info-page-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.info-page-section {
  padding: 20px;
  border: 1px solid var(--info-border);
  border-radius: 18px;
  background: var(--info-card);
  box-shadow: var(--info-shadow);
}

.info-page-section h2 {
  margin: 0 0 10px;
  color: var(--info-text);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.35;
}

.info-page-section p {
  margin: 0;
  color: var(--info-muted);
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.85;
}

@media (max-width: 1100px) {
  .info-page-sections {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .info-page-hero {
    padding: 20px 16px;
    border-radius: 20px;
  }

  .info-page-hero-top {
    align-items: flex-start;
    gap: 12px;
  }

  .info-page-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 1.18rem;
  }
}


/* =====================================================================
   M1 refresh layout stability
   ---------------------------------------------------------------------
   Keeps /pages/m1/m1.html visually fixed during reload:
   - no sidebar width/transform transition during boot
   - no smooth scroll restoration fighting browser refresh
   - footer space is reserved before the shared footer is injected
   ===================================================================== */
html.schoolep-stable-page,
html.schoolep-stable-page body {
  scroll-behavior: auto !important;
  overflow-anchor: none;
}

html.schoolep-sidebar-boot .main-wrapper,
html.schoolep-sidebar-boot .content-area,
html.schoolep-sidebar-boot .levels-sidebar,
html.schoolep-sidebar-boot .levels-sidebar *,
html.schoolep-sidebar-boot #sidebar-slot,
html.schoolep-sidebar-boot #sidebar-slot * {
  transition: none !important;
  animation: none !important;
}

@media (min-width: 993px) {
  html.schoolep-sidebar-boot:not(.schoolep-pc-sidebar-expanded) .levels-sidebar {
    width: 80px !important;
  }

  html.schoolep-sidebar-boot.schoolep-pc-sidebar-expanded .levels-sidebar {
    width: 215px !important;
  }

  html.schoolep-sidebar-boot:not(.schoolep-pc-sidebar-expanded) .levels-sidebar .sidebar-card {
    padding: 16px 5px 12px 5px;
  }
}

html.schoolep-stable-page #footer-slot {
  display: block;
  min-height: 210px;
  contain: layout style;
}

@media (max-width: 768px) {
  html.schoolep-stable-page #footer-slot {
    min-height: 320px;
  }
}


/* =====================================================================
   Shared shell stability guard — v20260603-sidebar-footer-stable
   ---------------------------------------------------------------------
   Prevents the desktop resource sidebar from painting expanded for one
   frame before script.js hydrates it. Default = closed/collapsed.
   If localStorage says the user opened it, the shared shell adds the
   expanded class before writing the sidebar HTML.
   ===================================================================== */
@media (min-width: 993px) {
  html.schoolep-sidebar-boot:not(.schoolep-shell-sidebar-expanded) .levels-sidebar:not(.pc-collapsed) {
    width: 80px !important;
    overflow: visible !important;
  }

  html.schoolep-sidebar-boot:not(.schoolep-shell-sidebar-expanded) .levels-sidebar:not(.pc-collapsed) .sidebar-card {
    padding: 16px 5px 12px 5px !important;
    overflow: visible !important;
  }

  html.schoolep-sidebar-boot:not(.schoolep-shell-sidebar-expanded) .levels-sidebar:not(.pc-collapsed) .level-group {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin-top: 15px !important;
    margin-bottom: 0 !important;
  }

  html.schoolep-sidebar-boot:not(.schoolep-shell-sidebar-expanded) .levels-sidebar:not(.pc-collapsed) .level-group:first-child {
    margin-top: 0 !important;
  }

  html.schoolep-sidebar-boot:not(.schoolep-shell-sidebar-expanded) .levels-sidebar:not(.pc-collapsed) .level-group h4 {
    width: auto !important;
    min-width: 60px !important;
    max-width: 70px !important;
    padding: 5px 7px !important;
    margin: 0 auto 4px auto !important;
    border-radius: 18px !important;
    font-size: var(--sidebar-title-pc-collapsed-ar-font-size, 1.00rem) !important;
    white-space: nowrap !important;
  }

  html[dir="ltr"].schoolep-sidebar-boot:not(.schoolep-shell-sidebar-expanded) .levels-sidebar:not(.pc-collapsed) .level-group h4 {
    font-size: var(--sidebar-title-pc-collapsed-fr-font-size, 0.82rem) !important;
  }

  html.schoolep-sidebar-boot:not(.schoolep-shell-sidebar-expanded) .levels-sidebar:not(.pc-collapsed) .level-btn {
    justify-content: center !important;
    width: 50px !important;
    height: 50px !important;
    padding: 0 !important;
    margin: 5px auto !important;
    border-radius: 12px !important;
    overflow: visible !important;
    position: relative !important;
  }

  html.schoolep-sidebar-boot:not(.schoolep-shell-sidebar-expanded) .levels-sidebar:not(.pc-collapsed) .level-btn i {
    font-size: 1.4rem !important;
    margin: 0 !important;
  }

  html.schoolep-sidebar-boot:not(.schoolep-shell-sidebar-expanded) .levels-sidebar:not(.pc-collapsed) .btn-text {
    opacity: 0 !important;
    visibility: hidden !important;
  }
}


/* =====================================================================
   Global sidebar state guard — v20260617-no-flicker-v2
   ---------------------------------------------------------------------
   The sidebar follows one saved state across pages like language/dark mode.
   These selectors let the html boot class control the drawer before JS
   finishes hydrating the component, preventing close/open flicker.
   ===================================================================== */
@media (max-width: 992px) {
  html.resource-sidebar-open #sidebar-slot .levels-sidebar,
  body.resource-sidebar-open #sidebar-slot .levels-sidebar,
  html.resource-sidebar-open .levels-sidebar,
  body.resource-sidebar-open .levels-sidebar {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  html.resource-sidebar-open #levels-overlay,
  body.resource-sidebar-open #levels-overlay {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

@media (min-width: 993px) {
  html.schoolep-sidebar-boot.schoolep-shell-sidebar-expanded .levels-sidebar {
    width: 215px !important;
  }

  html.schoolep-sidebar-boot.schoolep-shell-sidebar-collapsed .levels-sidebar {
    width: 80px !important;
  }
}


/* =====================================================================
   SIDEBAR GLOBAL STATE — FIRST PAINT LOCK (v3)
   One localStorage-controlled sidebar state across all pages.
   Prevents desktop open→close and mobile close→open flashes on reload/back.
   ===================================================================== */
html.schoolep-sidebar-boot .levels-sidebar,
html.schoolep-sidebar-boot .levels-sidebar *,
html.schoolep-sidebar-boot #sidebar-slot,
html.schoolep-sidebar-boot #sidebar-slot * {
  transition: none !important;
  animation: none !important;
}

@media (min-width: 993px) {
  html.schoolep-shell-sidebar-collapsed .levels-sidebar {
    width: 80px !important;
    overflow: visible !important;
  }

  html.schoolep-shell-sidebar-expanded .levels-sidebar {
    width: 215px !important;
  }

  html.schoolep-shell-sidebar-collapsed .levels-sidebar .sidebar-card {
    padding: 16px 5px 12px 5px !important;
    overflow: visible !important;
  }

  html.schoolep-shell-sidebar-collapsed .levels-sidebar .level-group {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin-top: 15px !important;
    margin-bottom: 0 !important;
  }

  html.schoolep-shell-sidebar-collapsed .levels-sidebar .level-group:first-child {
    margin-top: 0 !important;
  }

  html.schoolep-shell-sidebar-collapsed .levels-sidebar .level-group h4 {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: var(--sidebar-title-pc-collapsed-ar-font-size, 1.00rem) !important;
    font-weight: 900 !important;
    width: auto !important;
    min-width: 60px !important;
    max-width: 70px !important;
    padding: 5px 7px !important;
    margin: 0 auto 4px auto !important;
    border-radius: 18px !important;
    white-space: nowrap !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
  }

  html[dir="ltr"].schoolep-shell-sidebar-collapsed .levels-sidebar .level-group h4,
  body[dir="ltr"].schoolep-shell-sidebar-collapsed .levels-sidebar .level-group h4 {
    font-size: var(--sidebar-title-pc-collapsed-fr-font-size, 0.82rem) !important;
  }

  html.schoolep-shell-sidebar-collapsed .levels-sidebar .level-btn {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    justify-content: center !important;
    gap: 0 !important;
    overflow: visible !important;
  }

  html.schoolep-shell-sidebar-collapsed .levels-sidebar .level-btn i {
    font-size: 1.4rem !important;
    margin: 0 !important;
  }

  html.schoolep-shell-sidebar-collapsed .levels-sidebar .btn-text {
    position: absolute !important;
    top: 50% !important;
    width: max-content !important;
    max-width: 220px !important;
    padding: 8px 12px !important;
    border-radius: 10px !important;
    background: #1e293b !important;
    color: #fff !important;
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: 9999 !important;
    white-space: nowrap !important;
  }

  html[dir="rtl"].schoolep-shell-sidebar-collapsed .levels-sidebar .btn-text,
  body[dir="rtl"].schoolep-shell-sidebar-collapsed .levels-sidebar .btn-text {
    right: calc(100% + 15px) !important;
    transform: translateY(-50%) translateX(10px) !important;
  }

  html[dir="ltr"].schoolep-shell-sidebar-collapsed .levels-sidebar .btn-text,
  body[dir="ltr"].schoolep-shell-sidebar-collapsed .levels-sidebar .btn-text {
    left: calc(100% + 15px) !important;
    transform: translateY(-50%) translateX(-10px) !important;
  }

  html[dir="rtl"].schoolep-shell-sidebar-collapsed .levels-sidebar .level-btn:hover .btn-text,
  body[dir="rtl"].schoolep-shell-sidebar-collapsed .levels-sidebar .level-btn:hover .btn-text,
  html[dir="ltr"].schoolep-shell-sidebar-collapsed .levels-sidebar .level-btn:hover .btn-text,
  body[dir="ltr"].schoolep-shell-sidebar-collapsed .levels-sidebar .level-btn:hover .btn-text {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(-50%) translateX(0) !important;
  }
}

@media (max-width: 992px) {
  html.schoolep-sidebar-boot .levels-sidebar,
  html.schoolep-sidebar-boot .levels-sidebar * {
    transition: none !important;
    animation: none !important;
  }

  html:not(.resource-sidebar-open) #sidebar-slot .levels-sidebar:not(.active) {
    visibility: hidden !important;
    pointer-events: none !important;
  }

  html.resource-sidebar-open #sidebar-slot .levels-sidebar,
  body.resource-sidebar-open #sidebar-slot .levels-sidebar {
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateX(0) !important;
  }
}


/* ============================================================
   2026-06 language/hover fix
   Faster card and resource-button hover response.
   Interaction timing only; no layout/design rewrite.
   ============================================================ */
.lesson-block,
.lesson-card,
.lesson-header,
.card-title,
.res-toggle,
.exam-toggle-btn,
.res-link,
.quiz-link,
.video-link,
.res-item,
.supervised-res-item,
.accordion-btn,
.accordion-links a,
.level-btn,
.quick-link {
  transition-duration: 0.06s !important;
  transition-delay: 0s !important;
}

.lesson-block:hover,
.lesson-card:hover,
.res-toggle:hover,
.exam-toggle-btn:hover,
.res-link:hover,
.quiz-link:hover,
.video-link:hover,
.level-btn:hover,
.quick-link:hover {
  transition-duration: 0.04s !important;
}


/* SCHOOLEP PHASE 2: shared utility classes */
.is-hidden{display:none;}
.svg-symbols{position:absolute;width:0;height:0;overflow:hidden;}
.footer-description{color:#cbd5e1;line-height:1.6;text-align:center;}

/* Active resource category: keep the clicked/current sidebar button visibly marked without a side stripe. */
.levels-sidebar .level-btn.active,
.levels-sidebar .level-btn[aria-current="page"] {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.58), 0 10px 22px rgba(15,23,42,.24);
  filter: saturate(1.15) brightness(.9);
  transform: translateY(-1px);
}
.levels-sidebar .level-btn.active::after,
.levels-sidebar .level-btn[aria-current="page"]::after {
  content: none;
  display: none;
}
html.dark-mode .levels-sidebar .level-btn.active,
body.dark-mode .levels-sidebar .level-btn.active,
html.dark-mode .levels-sidebar .level-btn[aria-current="page"],
body.dark-mode .levels-sidebar .level-btn[aria-current="page"] {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.78), 0 0 0 3px rgba(255,255,255,.08), 0 12px 28px rgba(0,0,0,.34);
  filter: saturate(1.25) brightness(1.12);
}
.level-group:nth-child(1) .level-btn.active,
.level-group:nth-child(1) .level-btn[aria-current="page"] {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.62), 0 0 20px rgba(156,39,176,.3), 0 10px 22px rgba(15,23,42,.24);
}
.level-group:nth-child(2) .level-btn.active,
.level-group:nth-child(2) .level-btn[aria-current="page"] {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.62), 0 0 20px rgba(255,152,0,.28), 0 10px 22px rgba(15,23,42,.24);
}
.level-group:nth-child(3) .level-btn.active,
.level-group:nth-child(3) .level-btn[aria-current="page"] {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.62), 0 0 20px rgba(34,197,94,.28), 0 10px 22px rgba(15,23,42,.24);
}
html.dark-mode .level-group:nth-child(1) .level-btn.active,
body.dark-mode .level-group:nth-child(1) .level-btn.active,
html.dark-mode .level-group:nth-child(1) .level-btn[aria-current="page"],
body.dark-mode .level-group:nth-child(1) .level-btn[aria-current="page"] {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.78), 0 0 24px rgba(156,39,176,.48), 0 12px 28px rgba(0,0,0,.34);
}
html.dark-mode .level-group:nth-child(2) .level-btn.active,
body.dark-mode .level-group:nth-child(2) .level-btn.active,
html.dark-mode .level-group:nth-child(2) .level-btn[aria-current="page"],
body.dark-mode .level-group:nth-child(2) .level-btn[aria-current="page"] {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.78), 0 0 24px rgba(255,152,0,.44), 0 12px 28px rgba(0,0,0,.34);
}
html.dark-mode .level-group:nth-child(3) .level-btn.active,
body.dark-mode .level-group:nth-child(3) .level-btn.active,
html.dark-mode .level-group:nth-child(3) .level-btn[aria-current="page"],
body.dark-mode .level-group:nth-child(3) .level-btn[aria-current="page"] {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.78), 0 0 24px rgba(34,197,94,.44), 0 12px 28px rgba(0,0,0,.34);
}
/* V59 footer arrows and sidebar media icon */
.footer-link-arrow{display:inline-grid;place-items:center;min-width:1em;color:currentColor;font-weight:900;font-size:1.05em;line-height:1;transition:transform .3s ease}.footer-link-arrow::before{content:"‹"}[dir="ltr"] .footer-link-arrow::before{content:"›"}.footer-col ul li a:hover .footer-link-arrow{transform:translateX(-2px)}[dir="ltr"] .footer-col ul li a:hover .footer-link-arrow{transform:translateX(2px)}
.schoolep-dual-icon{display:inline-flex;align-items:center;justify-content:center;gap:2px;min-width:1.25em}.schoolep-dual-icon i{font-size:.74em!important;line-height:1;transform:none!important}.levels-sidebar .schoolep-dual-icon{flex-direction:column;gap:0}


/* =====================================================================
   Canonical mobile footer labels/order — 2026-07-01
   Top mobile row: SchoolEP logo + Niveaux scolaires.
   French legal labels stay compact without changing desktop wording.
   ===================================================================== */
@media (max-width: 768px) {
  .app-footer .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .app-footer .footer-col:first-child { order: 1; }
  .app-footer .footer-col:nth-child(3) { order: 2; }
  .app-footer .footer-col[data-footer-col="resources"],
  .app-footer .footer-col:nth-child(2) { order: 3; }
  .app-footer .footer-col:last-child { order: 4; }

  html[lang="fr"] .app-footer [data-mobile-fr] {
    font-size: 0 !important;
    line-height: 1;
  }

  html[lang="fr"] .app-footer h3 [data-mobile-fr]::after {
    content: attr(data-mobile-fr);
    font-size: 1.1rem;
    line-height: 1.35;
  }

  html[lang="fr"] .app-footer a [data-mobile-fr]::after {
    content: attr(data-mobile-fr);
    font-size: 0.9rem;
    line-height: 1.45;
  }

  html[lang="fr"] .app-footer .footer-report-issue-link [data-mobile-fr]::after {
    font-size: 0.92rem;
  }
}


/* V60.4 footer: every navigation link uses the exact same chevron geometry. */
.app-footer .footer-col ul li a > i:first-child:not(.fa-life-ring) {
  position: static !important;
  top: auto !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 1em;
  width: 1em;
  min-width: 1em;
  margin: 0 !important;
  color: currentColor;
  font-size: .82em;
  line-height: 1;
}
@media (max-width:768px){
  .app-footer .footer-grid { align-items: start; }
  .app-footer .footer-col:first-child,
  .app-footer .footer-col:nth-child(3) { grid-row: 1; }
  .app-footer .footer-col[data-footer-col="resources"],
  .app-footer .footer-col:nth-child(2),
  .app-footer .footer-col:last-child { grid-row: 2; }
}


/* V60.5 — sidebar icons are independent from page-specific CDN/CSS loading. */
@font-face {
  font-family: "Schoolep FA Free";
  font-style: normal;
  font-weight: 900;
  font-display: block;
  src: url("/assets/vendor/fontawesome/webfonts/fa-solid-900.woff2") format("woff2");
}
@font-face {
  font-family: "Schoolep FA Brands";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/assets/vendor/fontawesome/webfonts/fa-brands-400.woff2") format("woff2");
}
.levels-sidebar i.fa-solid::before,
.levels-sidebar i.fas::before {
  font-family: "Schoolep FA Free" !important;
  font-style: normal !important;
  font-weight: 900 !important;
  speak: never;
}
.levels-sidebar i.fa-brands::before,
.levels-sidebar i.fab::before {
  font-family: "Schoolep FA Brands" !important;
  font-style: normal !important;
  font-weight: 400 !important;
  speak: never;
}
.levels-sidebar .level-btn > i.schoolep-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  min-width: 1.25em;
  height: 1.25em;
  line-height: 1 !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.levels-sidebar .fa-book-open::before { content: "" !important; }
.levels-sidebar .fa-pencil-ruler::before { content: "" !important; }
.levels-sidebar .fa-clipboard-check::before { content: "" !important; }
.levels-sidebar .fa-centercode::before { content: "" !important; }
.levels-sidebar .fa-school-circle-exclamation::before { content: "" !important; }
.levels-sidebar .fa-school-circle-check::before { content: "" !important; }
.levels-sidebar .fa-google-scholar::before { content: "" !important; }
.levels-sidebar .fa-graduation-cap::before { content: "" !important; }
.levels-sidebar .fa-user-graduate::before { content: "" !important; }
.levels-sidebar .fa-chevron-right::before { content: "" !important; }



/* =====================================================================
   V60.8 — GLOBAL NAVBAR SEARCH
   Desktop: opens on hover, focus, or click. Mobile: click only.
   ===================================================================== */

























/* =====================================================================
   V60.9 — mobile search visibility, footer order, breadcrumb icon lift
   ===================================================================== */

@media (max-width:992px){
  
  
  
  
  html.schoolep-search-open .app-header,
  body.schoolep-search-open .app-header{transform:none!important;overflow:visible!important;contain:none!important}
}
@media (max-width:768px){
  .app-footer .footer-col:first-child{order:1!important;grid-row:1!important}
  .app-footer .footer-col[data-footer-col="resources"],
  .app-footer .footer-col:nth-child(2){order:2!important;grid-row:1!important}
  .app-footer .footer-col:nth-child(3){order:3!important;grid-row:2!important}
  .app-footer .footer-col:last-child{order:4!important;grid-row:2!important}
}


/* =====================================================================
   V60.11 — RICH GLOBAL SEARCH LIBRARY + PRECISE MOBILE CENTERING
   ===================================================================== */




























/* V60.12 — exact visual-viewport centering for mobile search. */



/* V60.16 — reliable compact search only. Breadcrumb rules intentionally unchanged. */




/* V60.17 — compact empty search state and human-readable school levels. */




/* V60.18 — concise search result identity: educational path + subject only. */






/* V60.20 — structured search tags remain compact text, not repeated badges. */



/* V60.21 — stage-aware search metadata and instant-target feedback. */








.lesson-block.search-target-highlight{
  animation:schoolep-search-target-pulse 1.05s ease-in-out 2;
  outline:3px solid rgba(67,97,238,.28);
  outline-offset:4px;
  box-shadow:0 0 0 8px rgba(67,97,238,.08),0 18px 38px rgba(15,23,42,.14)!important;
}
@keyframes schoolep-search-target-pulse{0%,100%{transform:translateZ(0)}50%{transform:translateY(-2px)}}
@media (prefers-reduced-motion:reduce){.lesson-block.search-target-highlight{animation:none}}

/* =====================================================================
   V60.22 — STRUCTURED SEARCH NAVIGATOR
   Content selector + filter chips + quick level/subject tree.
   ===================================================================== */














































/* =====================================================================
   V60.23 — one-filter search, reliable vertical scrolling, precise
   content first and related full pages last.
   ===================================================================== */












/* =====================================================================
   V60.29 — navbar search: ORIGINAL desktop, compact mirrored MOBILE only.
   Existing Font Awesome markup is rendered as SVG masks on mobile so the
   light/dark colour continues to follow currentColor.
   ===================================================================== */



/* =====================================================================
   V61.1 — clean navbar search category dropdown.
   The option list is portalled to <body>, so it cannot be clipped or
   compressed by the navbar search panel on desktop, tablet, or mobile.
   ===================================================================== */


.schoolep-native-search-select{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  margin:-1px!important;
  padding:0!important;
  border:0!important;
  overflow:hidden!important;
  clip:rect(0 0 0 0)!important;
  clip-path:inset(50%)!important;
  white-space:nowrap!important;
  pointer-events:none!important;
  opacity:0!important;
}























/* Keep the search panel itself stable; only its internal results scroll. */




/* V61.1 RTL physical-order correction.
   Keep the custom grid itself LTR so named grid areas map to physical
   left-to-right columns; only the Arabic label text is RTL. */



/* V61.2 — navbar category menu uses the same visual system as the main
   search-page category list while remaining compact inside the navbar. */







/* V61.3 — Level 3 static bilingual shell: no title/hero/breadcrumb language flicker. */
.schoolep-i18n-fr{display:none!important}
.schoolep-i18n-ar{display:inline!important}
html[lang^="fr"] .schoolep-i18n-ar{display:none!important}
html[lang^="fr"] .schoolep-i18n-fr{display:inline!important}
html[lang^="ar"] .schoolep-i18n-fr{display:none!important}
html[lang^="ar"] .schoolep-i18n-ar{display:inline!important}
#page-title[data-schoolep-static-hero="1"]{display:block!important;text-align:center!important;min-height:1.55em!important}

/* V61.3 — Navbar search must keep PC-like layout on every device. */








/* V229.85 Level-3 mobile shell performance; desktop unchanged. */
@media (max-width: 960px), (hover: none) and (pointer: coarse) {
  .sidebar-overlay,
  #levels-overlay.sidebar-overlay,
  #levels-overlay.levels-overlay,
  .mobile-sidebar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    will-change: auto !important;
  }
}

/* V229.88 — canonical full-page shell parity for Level-3 aggregate. */
.app-container {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.app-container > .main-wrapper { flex: 1 0 auto; }
.app-container > #footer-slot { width: 100%; margin-top: auto; flex: 0 0 auto; }
.app-container > #footer-slot > .app-footer { width: 100%; }
