#site-header-container { display: block; width: 100%; min-height: 60px; position: sticky; top: 0; z-index: 1000; }
/* ===================================================================
   PULSETRACKAI - SYSTEMS & ENGINEERING ACADEMY DESIGN SYSTEM
   Professional, high-contrast, responsive documentation layout
   =================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", Consolas, "Courier New", monospace;
  
  /* Color Palette - Dark Theme (Default) */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: #1f2937;
  --bg-subtle: #1e293b;
  --bg-code: #0d131f;
  
  --border-color: #374151;
  --border-focus: #38bdf8;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --brand-primary: #0ea5e9;
  --brand-secondary: #38bdf8;
  --brand-accent: #10b981;
  --brand-warning: #f59e0b;
  --brand-danger: #ef4444;
  --brand-purple: #8b5cf6;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.35);
  
  --sidebar-width: 295px;
  --toc-width: 230px;
  --header-height: 64px;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #f1f5f9;
  --bg-subtle: #e2e8f0;
  --bg-code: #1e293b;
  
  --border-color: #cbd5e1;
  --border-focus: #0284c7;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  
  --brand-primary: #0284c7;
  --brand-secondary: #0ea5e9;
  --brand-accent: #059669;
  --brand-warning: #d97706;
  --brand-danger: #dc2626;
  --brand-purple: #7c3aed;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.7;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--brand-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--brand-accent);
  text-decoration: underline;
}

/* Top Progress Bar */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease-out;
}

/* ===================================================================
   CANONICAL SITE NAVIGATION HEADER (PULSETRACKAI UNIFIED)
   =================================================================== */

header.site-header-nav,
header.site-header {
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  box-sizing: border-box;
}

.header-brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- BRAND / LOGO --- */
.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  user-select: none;
}

.logo-placeholder {
  width: 36px;
  height: 36px;
  background: #0052cc;
  color: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  line-height: 1;
  font-family: 'Inter', system-ui, sans-serif;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 82, 204, 0.2);
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.4px;
  text-transform: none;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.logo-text .brand-ai {
  color: #0052cc;
  font-weight: 800;
}

/* --- NAVIGATION MENU --- */
.nav-menu {
  display: flex;
  list-style: none;
  gap: 6px;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  color: #334155;
  text-decoration: none !important;
  font-weight: 500;
  font-size: 15px;
  border-radius: 8px;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.nav-link:hover,
.nav-item:hover .nav-link,
.nav-link.active {
  color: #0052cc !important;
  background-color: #eff6ff;
  font-weight: 600;
}

/* --- DROPDOWNS --- */
.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background-color: #ffffff;
  min-width: 250px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid #e2e8f0;
  z-index: 1100;
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 10px 18px;
  color: #334155;
  text-decoration: none !important;
  font-size: 14.5px;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.dropdown a:hover,
.dropdown a:focus {
  background-color: #f8fafc;
  color: #0052cc !important;
  padding-left: 22px;
}

/* --- VISITOR COUNTER PILL & ACTIONS --- */
.header-actions-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.visitor-counter {
  background: #0f172a;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
  user-select: none;
}

/* --- COURSE DRAWER TOGGLE (Mobile only on course pages) --- */
.course-drawer-toggle {
  display: none;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  padding: 7px 11px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: all 0.2s ease;
}

.course-drawer-toggle:hover {
  background: #eff6ff;
  border-color: #0052cc;
  color: #0052cc;
}

/* --- MOBILE SITE MENU TOGGLE --- */
.mobile-menu-toggle {
  display: none;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: 16px;
  padding: 7px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: #f8fafc;
}

@media (max-width: 900px) {
  .course-drawer-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 868px) {
  .nav-container {
    padding: 10px 16px;
    flex-wrap: wrap;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .visitor-counter {
    margin-left: auto;
    padding: 6px 12px;
    font-size: 12px;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 4px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    margin-top: 10px;
  }

  .nav-menu.mobile-active {
    display: flex;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    width: 100%;
    padding: 10px 14px;
    box-sizing: border-box;
  }

  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid #e2e8f0;
    border-radius: 0;
    padding: 4px 0 6px 12px;
    margin-left: 12px;
    background: transparent;
  }

  .dropdown a {
    padding: 8px 12px;
    font-size: 13.5px;
  }
}

.site-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  backdrop-filter: blur(12px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo-img {
  height: 38px;
  width: auto;
  display: block;
}

.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  transition: all 0.2s ease;
}

.mobile-nav-toggle:hover {
  background: var(--bg-subtle);
  border-color: var(--brand-secondary);
}

.header-center {
  flex: 1;
  max-width: 440px;
  margin: 0 1.5rem;
}

.search-trigger-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.search-trigger-btn:hover {
  border-color: var(--brand-secondary);
  color: var(--text-main);
}

.search-trigger-btn kbd {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-nav-link {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.header-nav-link:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
  text-decoration: none;
}

.theme-toggle-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  color: var(--text-main);
  border-color: var(--brand-secondary);
}

/* ===================================================================
   LAYOUT CONTAINER & THREE-COLUMN ARCHITECTURE
   =================================================================== */

.app-layout {
  display: flex;
  flex: 1;
  max-width: 1680px;
  margin: 0 auto;
  width: 100%;
  position: relative;
}

/* ===================================================================
   LEFT CURRICULUM SIDEBAR
   =================================================================== */

.course-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 50;
  transition: transform 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.course-sidebar::-webkit-scrollbar {
  width: 5px;
}

.course-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.course-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.course-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--brand-secondary);
}

.sidebar-header {
  padding: 1.15rem 1.15rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
}

.sidebar-progress-box {
  margin-top: 0.65rem;
}

.sidebar-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.progress-track, .sidebar-progress-track {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill, .sidebar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  width: 0%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.sidebar-nav {
  padding: 0.75rem 0.65rem 3.5rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-module-list, .module-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-module-group {
  margin-bottom: 1.15rem;
}

.module-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand-secondary);
  padding: 0.75rem 0.5rem 0.35rem;
  display: block;
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
  margin-bottom: 0.35rem;
}

.lesson-nav-item, .module-nav-item {
  margin: 0.2rem 0;
  list-style: none;
}

.lesson-nav-link, .module-nav-link {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.42;
  text-decoration: none !important;
  transition: all 0.18s ease;
  border-left: 3px solid transparent;
  word-break: break-word;
  overflow-wrap: break-word;
}

.lesson-nav-link:hover, .module-nav-link:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  text-decoration: none !important;
}

.lesson-nav-item.active .lesson-nav-link,
.lesson-nav-link.active,
.module-nav-item.active .module-nav-link,
.module-nav-link.active {
  background: rgba(14, 165, 233, 0.12);
  color: var(--brand-secondary);
  border-left-color: var(--brand-secondary);
  font-weight: 600;
}

.lesson-nav-item.completed .lesson-nav-link::after,
.module-nav-item.completed .module-nav-link::after {
  content: "✓";
  color: var(--brand-accent);
  margin-left: auto;
  font-weight: bold;
  font-size: 0.8rem;
}

.lesson-num-badge, .nav-lesson-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand-secondary);
  background: var(--bg-subtle);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1.25;
  margin-top: 0.12rem;
  border: 1px solid rgba(56, 189, 248, 0.2);
  letter-spacing: -0.02em;
}

.lesson-title-text, .nav-lesson-title {
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ===================================================================
   MAIN CONTENT AREA & TYPOGRAPHY
   =================================================================== */

.main-content {
  flex: 1;
  min-width: 0;
  padding: 2.25rem 3.25rem 5rem;
  max-width: 920px;
  margin: 0;
  overflow-wrap: break-word;
}

.main-content h1, .lesson-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.main-content h2 {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-top: 2.5rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(55, 65, 81, 0.35);
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

.main-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
  margin-top: 2rem;
  margin-bottom: 0.65rem;
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

.main-content h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brand-secondary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.main-content p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-main);
  margin-bottom: 1.25rem;
}

.main-content ul, .main-content ol {
  margin: 0 0 1.35rem 1.75rem;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-main);
}

.main-content li {
  margin-bottom: 0.45rem;
}

.main-content li > ul, .main-content li > ol {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
  margin-left: 1.25rem;
}

/* ===================================================================
   IN-PAGE RIGHT TABLE OF CONTENTS
   =================================================================== */

.right-toc-sidebar {
  width: var(--toc-width);
  min-width: var(--toc-width);
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2.25rem 1.15rem 3.5rem;
  flex-shrink: 0;
  display: block;
  border-left: 1px solid var(--border-color);
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.right-toc-sidebar::-webkit-scrollbar {
  width: 4px;
}

.right-toc-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.toc-heading, .toc-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-color);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 0.35rem;
}

.toc-list a {
  display: block;
  font-size: 0.83rem;
  color: var(--text-muted);
  text-decoration: none !important;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: break-word;
}

.toc-list a:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
  border-left-color: var(--brand-secondary);
  text-decoration: none !important;
}

.toc-list a.active {
  color: var(--brand-secondary);
  font-weight: 600;
  background: rgba(14, 165, 233, 0.08);
  border-left-color: var(--brand-secondary);
}

/* ===================================================================
   BREADCRUMBS & LESSON HEADER
   =================================================================== */

.breadcrumbs, .breadcrumb-bar, .breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.breadcrumbs a, .breadcrumb-bar a, .breadcrumb-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover, .breadcrumb-bar a:hover, .breadcrumb-nav a:hover {
  color: var(--brand-secondary);
}

.breadcrumbs .separator, .breadcrumb-bar .separator, .breadcrumb-nav .separator {
  color: var(--text-dim);
}

.lesson-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.lesson-meta-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-module {
  background: var(--bg-subtle);
  color: var(--brand-secondary);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.badge-compat {
  background: rgba(16, 185, 129, 0.15);
  color: var(--brand-accent);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ===================================================================
   CODE BLOCKS & MONOSPACE
   =================================================================== */

/* Inline Code */
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-subtle);
  color: var(--brand-secondary);
  padding: 0.2em 0.45em;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.15);
  word-break: break-word;
}

[data-theme="light"] code {
  background: #e2e8f0;
  color: #0369a1;
  border-color: rgba(2, 132, 199, 0.2);
}

/* Code Blocks */
pre, pre.code-block, .code-block-wrapper pre {
  background: var(--bg-code) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  padding: 1.25rem 1.5rem !important;
  margin: 1.6rem 0 !important;
  overflow-x: auto !important;
  font-family: var(--font-mono) !important;
  font-size: 0.92rem !important;
  line-height: 1.65 !important;
  color: #f1f5f9 !important;
  box-shadow: var(--shadow-sm) !important;
  position: relative !important;
  tab-size: 4;
}

[data-theme="light"] pre,
[data-theme="light"] pre.code-block,
[data-theme="light"] .code-block-wrapper pre {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

pre code {
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  border: none !important;
  font-size: inherit !important;
  font-family: inherit !important;
  line-height: inherit !important;
  box-shadow: none !important;
}

.code-block-wrapper {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin: 1.75rem 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.code-block-wrapper pre {
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
}

.code-lang-tag {
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--brand-secondary);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.code-title {
  font-family: var(--font-sans);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.copy-code-btn, .pre-copy-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 5px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pre-copy-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  opacity: 0;
  z-index: 5;
  background: rgba(30, 41, 59, 0.9);
}

pre:hover .pre-copy-btn, .pre-copy-btn:focus {
  opacity: 1;
}

.copy-code-btn:hover, .pre-copy-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--brand-secondary);
}

.copy-code-btn.copied, .pre-copy-btn.copied {
  color: var(--brand-accent);
  border-color: var(--brand-accent);
}

/* Syntax Highlighting */
.syn-kw { color: #f472b6; font-weight: 600; }
.syn-type { color: #38bdf8; font-weight: 600; }
.syn-fn { color: #fbbf24; }
.syn-str { color: #34d399; }
.syn-num { color: #a78bfa; }
.syn-cmt { color: #94a3b8; font-style: italic; }
.syn-event { color: #f87171; font-weight: 600; }

/* ===================================================================
   SYSTEM DIAGRAMS, ARCHITECTURAL FLOWS & DATA STRUCTURES
   =================================================================== */

.diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2rem 0;
  padding: 1.75rem;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  max-width: 100%;
  overflow-x: auto;
}

.diagram h3 {
  margin-top: 0;
  margin-bottom: 1.25rem;
  font-size: 1.15rem;
  color: var(--brand-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.box {
  background: #1e3a8a;
  color: #f8fafc;
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  min-width: 120px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(56, 189, 248, 0.3);
  margin: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.box.secondary {
  background: #065f46;
  border-color: rgba(16, 185, 129, 0.4);
}

.box.accent {
  background: #991b1b;
  border-color: rgba(239, 68, 68, 0.4);
}

.box.bus {
  background: #334155;
  border-color: rgba(148, 163, 184, 0.3);
  width: 85%;
  margin: 1rem 0;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.box.neutral {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.box.cpu-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: transparent;
  border: 2px dashed var(--brand-secondary);
  padding: 1.25rem;
  border-radius: 10px;
  width: auto;
  justify-content: center;
}

.arrow-down, .arrow-up, .arrow-both, .arrow-right {
  font-size: 1.5rem;
  color: var(--brand-secondary);
  margin: 0.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arrow-right {
  margin: 0 0.75rem;
}

.row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  margin: 1rem 0;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.col {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0.5rem;
}

.flow-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-card);
  padding: 1.75rem;
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  margin: 2rem 0;
  max-width: 100%;
  overflow-x: auto;
}

.horizontal-flow {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--bg-subtle);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.address-labels, .address-fields {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.field-page, .field-offset {
  padding: 0.6rem 1rem;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-mono);
}

.address-box, .memory-item, .memory-block {
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  padding: 0.6rem 1rem;
  border: 1px solid var(--border-color);
  margin: 0.35rem 0;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pc-pointer {
  background: rgba(14, 165, 233, 0.15);
  border-left: 4px solid var(--brand-secondary);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-style: italic;
  border-radius: 0 6px 6px 0;
  color: var(--text-main);
}

/* Callouts, Notes, Warnings */
.note, .callout {
  background: rgba(14, 165, 233, 0.08);
  border-left: 4px solid var(--brand-secondary);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
  color: var(--text-main);
}

.callout-title {
  font-weight: 700;
  color: var(--brand-secondary);
  margin-bottom: 0.35rem;
}

.warning, .callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid var(--brand-warning);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
  color: var(--text-main);
}

/* ===================================================================
   TABLES
   =================================================================== */

.table-container {
  width: 100%;
  overflow-x: auto;
  margin: 1.75rem 0;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

table, .main-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  text-align: left;
  line-height: 1.6;
}

th, td, .main-content th, .main-content td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

th, .main-content th {
  background: var(--bg-secondary);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border-color);
}

[data-theme="light"] th, [data-theme="light"] .main-content th {
  background: #f1f5f9;
}

tr:last-child td, .main-content tr:last-child td {
  border-bottom: none;
}

tr:nth-child(even) td, .main-content tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

[data-theme="light"] tr:nth-child(even) td,
[data-theme="light"] .main-content tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}

.main-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 1.5rem auto;
}

/* ===================================================================
   COMPREHENSIVE INTERACTIVE QUIZ SYSTEM
   =================================================================== */

.quiz-container,
.knowledge-quiz,
.module-quiz-container {
  background: var(--bg-card);
  border: 1.5px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 2.25rem 2rem;
  margin: 3.5rem 0 2.5rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
  position: relative;
}

.quiz-header-bar,
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.quiz-main-title,
.quiz-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.quiz-meta-badges,
.quiz-badge-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quiz-count-badge,
.quiz-badge {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-block;
}

.quiz-instruction-text,
.quiz-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.5rem;
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.quiz-score-pill {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.35rem 0.95rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.quiz-progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 1.75rem;
}

.quiz-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0284c7, #10b981);
  border-radius: 9999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-question-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quiz-question-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
}

.quiz-q-num {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #38bdf8;
  margin-bottom: 0.65rem;
  background: rgba(56, 189, 248, 0.1);
  padding: 0.25rem 0.65rem;
  border-radius: 5px;
}

.quiz-q-text,
.question-prompt {
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text-main);
  margin-bottom: 1.35rem;
}

/* --- QUIZ OPTIONS (Full Width, Distinct, Tactile) --- */
.quiz-options-grid,
.options-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.85rem !important;
  width: 100% !important;
}

.quiz-option-btn,
.option-btn {
  width: 100% !important;
  min-height: 52px;
  display: flex !important;
  align-items: center !important;
  gap: 1.1rem !important;
  padding: 0.95rem 1.35rem !important;
  background: var(--bg-subtle, rgba(15, 23, 42, 0.65)) !important;
  border: 1.5px solid rgba(148, 163, 184, 0.2) !important;
  border-radius: 10px !important;
  color: var(--text-main) !important;
  font-size: 1rem !important;
  line-height: 1.5 !important;
  text-align: left !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  user-select: none;
}

.quiz-option-btn:hover:not(:disabled),
.option-btn:hover:not(:disabled) {
  background: rgba(14, 165, 233, 0.12) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  transform: translateX(4px);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.2);
}

.quiz-option-btn:focus-visible,
.option-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.quiz-opt-letter,
.option-key-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 34px !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #38bdf8 !important;
  font-family: var(--font-mono) !important;
  font-weight: 700 !important;
  font-size: 0.92rem !important;
  flex-shrink: 0 !important;
  transition: all 0.2s ease !important;
}

.quiz-option-btn:hover:not(:disabled) .quiz-opt-letter,
.option-btn:hover:not(:disabled) .option-key-badge {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

.quiz-opt-text {
  flex: 1;
  word-break: break-word;
  line-height: 1.5;
}

.quiz-option-btn code,
.option-btn code {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* --- EVALUATED STATES --- */
.quiz-option-btn.opt-correct,
.option-btn.selected-correct {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10b981 !important;
  color: #34d399 !important;
  font-weight: 600 !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.3) !important;
}

.quiz-option-btn.opt-correct .quiz-opt-letter,
.option-btn.selected-correct .option-key-badge {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

.quiz-option-btn.opt-incorrect,
.option-btn.selected-wrong {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
  color: #f87171 !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.3) !important;
}

.quiz-option-btn.opt-incorrect .quiz-opt-letter,
.option-btn.selected-wrong .option-key-badge {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}

.quiz-option-btn:disabled:not(.opt-correct):not(.opt-incorrect),
.option-btn:disabled:not(.selected-correct):not(.selected-wrong) {
  opacity: 0.65;
  cursor: default;
  pointer-events: none;
}

/* --- EXPLANATION CARDS --- */
.quiz-explanation-card {
  margin-top: 1.35rem;
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  font-size: 0.96rem;
  line-height: 1.65;
  display: none;
  animation: fadeInExplanation 0.3s ease;
}

@keyframes fadeInExplanation {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.quiz-explanation-card.expl-correct,
.quiz-explanation-card.correct {
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  color: #a7f3d0 !important;
  display: block;
}

.quiz-explanation-card.expl-incorrect,
.quiz-explanation-card.incorrect {
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  color: #fecaca !important;
  display: block;
}

.quiz-explanation-title {
  font-weight: 700;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- COMPLETION BANNER --- */
.quiz-completion-banner {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(16, 185, 129, 0.18));
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  border-radius: 14px;
  padding: 2.5rem 2rem;
  text-align: center;
  margin-top: 2.25rem;
  display: none;
  animation: fadeInBanner 0.4s ease;
}

@keyframes fadeInBanner {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.quiz-completion-score {
  font-size: 2.25rem;
  font-weight: 800;
  color: #38bdf8;
  margin: 0.5rem 0 1rem;
}

.quiz-completion-text {
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 650px;
  margin: 0 auto;
  color: var(--text-main);
}

.quiz-retry-btn {
  background: #0284c7;
  color: white;
  border: none;
  padding: 0.85rem 2.25rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: all 0.2s ease;
}

.quiz-retry-btn:hover {
  background: #0369a1;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

/* --- LIGHT THEME OVERRIDES --- */
body.light-theme .quiz-container {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

body.light-theme .quiz-question-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

body.light-theme .quiz-question-card:hover {
  border-color: #0052cc;
}

body.light-theme .quiz-q-num {
  color: #0052cc;
  background: #eff6ff;
}

body.light-theme .quiz-option-btn,
body.light-theme .option-btn {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

body.light-theme .quiz-option-btn:hover:not(:disabled),
body.light-theme .option-btn:hover:not(:disabled) {
  background: #eff6ff !important;
  border-color: #0052cc !important;
  color: #0052cc !important;
}

body.light-theme .quiz-opt-letter,
body.light-theme .option-key-badge {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0052cc !important;
}

body.light-theme .quiz-option-btn:hover:not(:disabled) .quiz-opt-letter,
body.light-theme .option-btn:hover:not(:disabled) .option-key-badge {
  background: #0052cc !important;
  color: #ffffff !important;
  border-color: #0052cc !important;
}

body.light-theme .quiz-option-btn.opt-correct,
body.light-theme .option-btn.selected-correct {
  background: #ecfdf5 !important;
  border-color: #10b981 !important;
  color: #065f46 !important;
}

body.light-theme .quiz-option-btn.opt-correct .quiz-opt-letter,
body.light-theme .option-btn.selected-correct .option-key-badge {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

body.light-theme .quiz-option-btn.opt-incorrect,
body.light-theme .option-btn.selected-wrong {
  background: #fef2f2 !important;
  border-color: #ef4444 !important;
  color: #991b1b !important;
}

body.light-theme .quiz-option-btn.opt-incorrect .quiz-opt-letter,
body.light-theme .option-btn.selected-wrong .option-key-badge {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}

body.light-theme .quiz-explanation-card.expl-correct,
body.light-theme .quiz-explanation-card.correct {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  color: #065f46 !important;
}

body.light-theme .quiz-explanation-card.expl-incorrect,
body.light-theme .quiz-explanation-card.incorrect {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #991b1b !important;
}

body.light-theme .quiz-completion-banner {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border-color: #0052cc;
}

/* ===================================================================
   ADSENSE SLOTS (Anti-CLS Compliant)
   =================================================================== */

.ad-slot-container {
  margin: 2.5rem 0;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  background: var(--bg-card);
  border-radius: 8px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.ad-label-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

/* ===================================================================
   PREVIOUS / NEXT LESSON NAVIGATION
   =================================================================== */

.lesson-page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.nav-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  text-decoration: none !important;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.nav-card:hover {
  border-color: var(--brand-secondary);
  background: var(--bg-subtle);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.nav-card.next {
  text-align: right;
  grid-column: 2;
}

.nav-card-dir {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.nav-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

/* ===================================================================
   SEARCH MODAL
   =================================================================== */

.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.search-modal-backdrop.open {
  display: flex;
}

.search-modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 90%;
  max-width: 640px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  max-height: 75vh;
  display: flex;
  flex-direction: column;
}

.search-modal-header {
  display: flex;
  align-items: center;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  gap: 0.75rem;
}

.search-modal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.05rem;
  outline: none;
}

.search-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.search-results-container {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem 0;
}

.search-result-item {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(55, 65, 81, 0.4);
  display: block;
  text-decoration: none !important;
  transition: background 0.15s ease;
}

.search-result-item:hover {
  background: var(--bg-subtle);
}

.search-result-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.search-result-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.4;
}

/* ===================================================================
   COURSE PORTAL & CURRICULUM HUBS
   =================================================================== */

.course-portal-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.hero-hub-title {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.curriculum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.curriculum-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.5rem;
  text-decoration: none !important;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.curriculum-card:hover {
  border-color: var(--brand-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.curriculum-card-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--brand-secondary);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.curriculum-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.curriculum-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.curriculum-card-footer {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Course badges */
.badge-c {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-cpp {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-os {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-capl {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}


/* ===================================================================
   PULSETRACKAI UNIFIED FOOTER (MATCHING CANONICAL DESIGN)
   =================================================================== */

footer.site-main-footer,
footer.site-footer,
footer {
    background-color: #0b1329 !important;
    color: #94a3b8 !important;
    padding: 48px 20px 22px !important;
    margin-top: 60px !important;
    border-top: 1px solid #1e293b !important;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    box-sizing: border-box;
    width: 100%;
    display: block !important;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 36px;
    padding-bottom: 30px;
}

/* Column 1: Brand */
.footer-brand-col {
    flex: 1.4;
    min-width: 280px;
    max-width: 440px;
}

.footer-brand-title {
    color: #ffffff !important;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px 0;
    letter-spacing: -0.3px;
}

.footer-tagline {
    color: #94a3b8 !important;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 18px 0;
}

.footer-action-panel {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-action-btn {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.footer-action-btn:hover {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.footer-action-btn.liked {
    background: #fee2e2 !important;
    color: #ef4444 !important;
    border-color: #fca5a5 !important;
}

/* Column 2: Subscribe */
.footer-subscribe-col {
    flex: 1.1;
    min-width: 280px;
    max-width: 380px;
}

.footer-section-title {
    color: #ffffff !important;
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 14px 0;
    letter-spacing: -0.2px;
}

.footer-subscribe-inputs {
    display: flex;
    gap: 6px;
    align-items: center;
}

.footer-sub-input {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    padding: 8px 12px;
    font-size: 13.5px;
    border-radius: 4px;
    outline: none;
    flex: 1;
    min-width: 0;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.footer-sub-input:focus {
    border-color: #0052cc !important;
    box-shadow: 0 0 0 2px rgba(0, 82, 204, 0.2);
}

.footer-sub-btn {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.footer-sub-btn:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

.footer-sub-msg {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
}

/* Column 3: Social Channels */
.footer-social-col {
    flex: 1;
    min-width: 240px;
}

.footer-social-grid {
    display: flex;
    gap: 12px;
    align-items: center;
}

.footer-social-link {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #1e293b !important;
    color: #94a3b8 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.footer-social-link:hover {
    color: #ffffff !important;
    transform: translateY(-2px);
}

.footer-social-link.fb:hover { background: #1877f2 !important; color: #fff !important; }
.footer-social-link.ig:hover { background: #e1306c !important; color: #fff !important; }
.footer-social-link.x:hover { background: #000000 !important; color: #fff !important; }
.footer-social-link.yt:hover { background: #ff0000 !important; color: #fff !important; }

/* Footer Bottom Line */
.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: #94a3b8 !important;
    line-height: 1.6;
}

@media (max-width: 868px) {
    .footer-content {
        flex-direction: column;
        gap: 28px;
    }

    .footer-brand-col,
    .footer-subscribe-col,
    .footer-social-col {
        max-width: 100%;
        width: 100%;
    }

    .footer-subscribe-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .footer-sub-btn {
        width: 100%;
        padding: 10px;
        text-align: center;
    }
}

/* ===================================================================
   RESPONSIVE BREAKPOINTS
   =================================================================== */

@media (max-width: 1280px) {
  .right-toc-sidebar {
    display: none !important;
  }
  .main-content {
    max-width: 1000px;
    padding: 2.25rem 2.5rem 4.5rem;
  }
}

@media (max-width: 900px) {
  .mobile-nav-toggle {
    display: block;
  }
  
  .course-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    z-index: 950;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    width: 295px;
  }
  
  .course-sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    padding: 1.75rem 1.25rem 3.5rem;
    max-width: 100%;
  }
  
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  
  .lesson-title, .main-content h1 {
    font-size: 1.85rem;
  }
  
  .main-content h2 {
    font-size: 1.35rem;
  }
  
  .hero-hub-title {
    font-size: 2.25rem;
  }
  
  .header-center {
    display: none;
  }
}

@media (max-width: 600px) {
  .main-content {
    padding: 1.25rem 1rem 3rem;
  }
  
  .lesson-title, .main-content h1 {
    font-size: 1.6rem;
  }
  
  .lesson-page-nav {
    grid-template-columns: 1fr;
  }
  
  .nav-card.next {
    grid-column: 1;
    text-align: left;
  }
  
  .footer-inner {
    grid-template-columns: 1fr;
  }
  
  .curriculum-grid {
    grid-template-columns: 1fr;
  }
}
