/* ============================================================
   VAB-CODE (vab-code) — Premium Dark-Mode Online IDE
   Inspired by Linear, Vercel Dashboard, VS Code
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Surface Layers (Linear / GitHub Developer Dark Mode) */
  --bg-deep:        #080b11;
  --bg-base:        #0c101a;
  --bg-surface:     #111726;
  --bg-raised:      #171f33;
  --bg-hover:       #1e2842;
  --bg-active:      #24304f;

  /* Crisp Border Tokens */
  --border:         rgba(255, 255, 255, 0.08);
  --border-subtle:  rgba(255, 255, 255, 0.05);
  --border-hover:   rgba(255, 255, 255, 0.16);
  --border-focus:   rgba(59, 130, 246, 0.6);

  /* High Contrast Typography */
  --text-primary:   #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;

  /* Theme Color Tokens — Restrained & Technical */
  --coral:          #ef4444;
  --teal:           #0d9488;
  --cobalt:         #2563eb;
  --lime:           #84cc16;

  --coral-glow:     rgba(239, 68, 68, 0.15);
  --teal-glow:      rgba(13, 148, 136, 0.15);
  --cobalt-glow:    rgba(37, 99, 235, 0.15);
  --lime-glow:      rgba(132, 204, 22, 0.15);

  /* Restrained Accent Palette */
  --accent:         #2563eb;
  --accent-bright:  #3b82f6;
  --accent-subtle:  rgba(59, 130, 246, 0.12);
  --green:          #10b981;
  --red:            #ef4444;
  --amber:          #f59e0b;
  --cyan:           #06b6d4;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --header-h: 56px;
  --bottom-bar-h: 36px;
  --langbar-h: 48px;

  /* Unified Radii */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Clean elevation shadows (Zero neon glows) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.5);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.7);
}

:focus-visible {
  outline: 2px solid var(--accent-bright) !important;
  outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

html, body {
  min-height: 100%;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* Shared Professional Utility Components */
.vab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.vab-btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-sm);
}
.vab-btn-primary:hover:not(:disabled) {
  background: var(--accent-bright);
}
.vab-btn-secondary {
  background: var(--bg-raised);
  color: var(--text-primary);
  border-color: var(--border);
}
.vab-btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}
.vab-btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.vab-btn-outline:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.04);
}
.vab-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.vab-card:hover {
  border-color: var(--border-hover);
}
.vab-input {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  transition: border-color 0.15s ease;
}
.vab-input:focus {
  outline: none;
  border-color: var(--accent-bright);
}
.vab-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

::selection {
  background: rgba(129,140,248,0.3);
  color: #fff;
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }


/* ---------- HEADER ---------- */
.header {
  height: var(--header-h);
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-sizing: border-box;
  overflow: visible;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 0;
  margin-left: auto;
}
.header-center { display: flex; align-items: center; }

/* Logo */
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; flex-shrink: 0; }
.logo-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: grid; place-items: center;
  overflow: hidden;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.logo-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}
.logo:hover .logo-icon {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(37, 99, 235, 0.16);
}
.logo-text-group {
  display: flex;
  flex-direction: column;
}
.logo-text {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
}
.logo-badge {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-bright);
  margin-top: -1px;
  white-space: nowrap;
}

/* Main Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 2px 4px;
  flex: 0 1 auto;
  min-width: 0;
  position: relative;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11.8px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}
.nav-link.active {
  color: #ffffff;
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.4);
  font-weight: 600;
}

/* More Dropdown (Priority+ Responsive Navigation) */
.nav-more-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.nav-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.8px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.nav-more-btn:hover,
.nav-more-dropdown.open .nav-more-btn {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}
.nav-more-btn.has-active {
  color: #ffffff;
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.4);
  font-weight: 600;
}
.nav-more-caret {
  transition: transform 0.2s ease;
}
.nav-more-dropdown.open .nav-more-caret {
  transform: rotate(180deg);
}
.nav-more-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 175px;
  background: rgba(13, 17, 28, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 24px rgba(56, 189, 248, 0.12);
  z-index: 10001;
  flex-direction: column;
  gap: 2px;
  animation: navMorePop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-more-dropdown.open .nav-more-menu {
  display: flex;
}
@keyframes navMorePop {
  from { opacity: 0; transform: translateY(-6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.nav-more-menu .nav-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: #cbd5e1;
  text-decoration: none;
  transition: all 0.12s ease;
}
.nav-more-menu .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.nav-more-menu .nav-link.active {
  background: rgba(59, 130, 246, 0.22);
  border: 1px solid #3b82f6;
  color: #60a5fa;
  font-weight: 600;
}

/* ========================================================
   Priority 1: Unified 3-Group Navigation System
   (Learn & Labs, Tools & Practice, Progress & Community)
   ======================================================== */
.nav-group-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.nav-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.nav-group-btn:hover,
.nav-group-dropdown.open .nav-group-btn {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}
.nav-group-btn.has-active {
  color: #ffffff;
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.45);
  font-weight: 600;
}
.nav-group-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}
.nav-caret {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-group-dropdown.open .nav-caret {
  transform: rotate(180deg);
}
.nav-group-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  background: rgba(13, 17, 28, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.8), 0 0 24px rgba(56, 189, 248, 0.12);
  z-index: 10002;
  flex-direction: column;
  gap: 4px;
  animation: navMorePop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-group-dropdown.open .nav-group-menu {
  display: flex;
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 9px;
  text-decoration: none;
  color: #cbd5e1;
  transition: all 0.12s ease;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}
.nav-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(2px);
}
.nav-dropdown-item.active {
  background: rgba(59, 130, 246, 0.22);
  border: 1px solid #3b82f6;
  color: #60a5fa;
  font-weight: 600;
}
.nav-dropdown-item:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}
.nav-item-icon {
  font-size: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.nav-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.nav-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.2;
}
.nav-dropdown-item:hover .nav-item-title {
  color: #38bdf8;
}
.nav-item-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.25;
  white-space: normal;
}

/* Mobile Menu Toggle Button */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* ---------- RESPONSIVE NAVIGATION BREAKPOINTS ---------- */
/* Intermediate Width Optimization (1024px - 1300px) */
@media (max-width: 1300px) {
  .header {
    padding: 0 12px;
    gap: 6px;
  }
  .header-left {
    gap: 6px;
  }
  .header-arena-btn {
    padding: 5px 8px;
  }
  .header-arena-btn span:not(.arena-icon) {
    display: none;
  }
  .header-scroll-jump-btn {
    display: none !important;
  }
  .runtime-badge {
    display: none !important;
  }
}

/* Mobile Navigation Breakpoint (<= 868px) */
@media (max-width: 868px) {
  .mobile-menu-btn {
    display: inline-flex !important;
  }
  .nav-more-dropdown {
    display: none !important;
  }
  .mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--header-h);
    background: rgba(4, 6, 12, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
  }
  .mobile-nav-backdrop.open {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    background: rgba(10, 14, 26, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    padding: 16px 20px;
    z-index: 99999;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    margin: 0 !important;
    border-radius: 0;
  }
  .main-nav.mobile-open {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    animation: navDrop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .main-nav .nav-link {
    justify-content: flex-start;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    text-align: left;
    min-height: 42px;
  }
  .main-nav .nav-link:hover,
  .main-nav .nav-link.active {
    background: rgba(59, 130, 246, 0.22);
    border-color: #3b82f6;
    color: #60a5fa;
  }
  .main-nav .nav-group-dropdown {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 6px;
    overflow: hidden;
    box-sizing: border-box;
  }
  .main-nav .nav-group-btn {
    width: 100%;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    background: transparent;
    border-radius: 8px;
    border: none;
    box-sizing: border-box;
  }
  .main-nav .nav-group-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
  }
  .main-nav .nav-group-menu {
    display: flex !important;
    position: static;
    min-width: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 0;
    padding: 4px 0 0 0;
    box-shadow: none;
    gap: 4px;
    animation: none;
    width: 100%;
    box-sizing: border-box;
  }
  .main-nav .nav-dropdown-item {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 13px;
    min-height: 44px;
    transform: none !important;
  }
  .main-nav .nav-dropdown-item:hover,
  .main-nav .nav-dropdown-item.active {
    background: rgba(59, 130, 246, 0.22);
    border-color: #3b82f6;
    color: #60a5fa;
  }
}

@keyframes navDrop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .header {
    padding: 0 10px;
    height: 52px;
  }
  .logo-badge {
    display: none !important;
  }
  .logo-text {
    font-size: 14px;
  }
  .header-left {
    gap: 6px;
  }
  .header-right {
    gap: 4px;
  }
  .header-login-btn {
    padding: 5px 8px;
    font-size: 11.5px;
  }
  .header-scroll-jump-btn {
    display: none !important;
  }
  .main-nav {
    padding: 12px 14px;
  }
}

@media (max-width: 360px) {
  .header {
    padding: 0 8px;
  }
  .logo {
    gap: 6px;
  }
  .logo-icon {
    width: 28px;
    height: 28px;
  }
  .logo-icon img {
    width: 18px;
    height: 18px;
  }
  .logo-text {
    font-size: 13px;
  }
  .mobile-menu-btn {
    width: 30px;
    height: 30px;
  }
}

/* ==========================================================================
   UNIVERSAL BACK NAVIGATION SYSTEM (PART B)
   ========================================================================== */
.vab-back-bar {
  width: 100%;
  background: rgba(10, 14, 26, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 16px;
  box-sizing: border-box;
  position: relative;
  z-index: 40;
}

.vab-back-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vab-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.vab-back-btn:hover {
  color: #ffffff;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateX(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

.vab-back-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.vab-back-btn svg {
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.vab-back-btn:hover svg {
  transform: translateX(-2px);
}

.vab-back-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vab-breadcrumb-link {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s ease;
}

.vab-breadcrumb-link:hover {
  color: #38bdf8;
  text-decoration: underline;
}

.vab-breadcrumb-sep {
  color: #475569;
  font-size: 11px;
}

.vab-breadcrumb-current {
  color: #f1f5f9;
  font-weight: 600;
}

/* Modal Back Buttons */
.vab-modal-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.15s ease;
}

.vab-modal-back-btn:hover {
  color: #fff;
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
}

/* Mobile Quick Actions inside mobile drawer */
.mobile-nav-quick-actions {
  display: none;
}

@media (max-width: 1300px) {
  .main-nav.mobile-open .mobile-nav-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
}

.mobile-nav-quick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 38px;
}

.mobile-nav-quick-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

/* Secondary Pages Branded Navigation Bar */
.page-brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 12px;
  box-sizing: border-box;
  max-width: 100%;
}
.page-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.page-brand-logo .logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-brand-logo .logo-icon img {
  width: 22px;
  height: 22px;
}
.page-brand-logo .brand-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.page-brand-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}
@media (max-width: 768px) {
  .page-brand-nav {
    gap: 4px 6px;
  }
  .page-brand-nav .nav-link {
    padding: 4px 8px;
    font-size: 12px;
  }
}
.page-brand-nav .nav-link {
  font-size: 13px;
  padding: 5px 12px;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: color var(--transition), background-color var(--transition);
}
.page-brand-nav .nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.page-brand-nav .nav-link.active {
  color: var(--accent-bright);
  background: rgba(37, 99, 235, 0.1);
  font-weight: 600;
}
.page-brand-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.page-brand-back:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ============================================================
   Shared Legal & Informational Page Layout Styles
   (about.html, contact.html, privacy.html, terms.html)
   ============================================================ */
.legal-container {
  max-width: 860px;
  margin: 40px auto 80px auto;
  padding: 0 24px;
  color: #e2e8f0;
  font-family: var(--font-sans, 'Inter', sans-serif);
  line-height: 1.7;
}

.legal-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.legal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 24px;
  margin-bottom: 28px;
}

.legal-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.legal-title {
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 8px 0;
}

.legal-subtitle {
  color: #94a3b8;
  font-size: 13px;
}

.legal-section {
  margin-bottom: 30px;
}

.legal-section h2 {
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 12px 0;
}

.legal-section p {
  color: #cbd5e1;
  font-size: 14.5px;
  margin: 0 0 12px 0;
}

.legal-section ul {
  margin: 0 0 16px 20px;
  color: #cbd5e1;
  font-size: 14px;
}

.legal-section li {
  margin-bottom: 8px;
}

.legal-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #38bdf8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  transition: gap 0.15s;
}

.legal-nav-back:hover {
  gap: 10px;
  text-decoration: underline;
}

/* Nav Tabs */
.nav-tabs { display: flex; gap: 4px; }
.nav-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font: 500 13px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}
.nav-tab:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px -2px rgba(129,140,248,0.4);
}

/* Runtime Badge */
.runtime-badge {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(52,211,153,0.08);
  border: 1px solid rgba(52,211,153,0.2);
  font: 500 11px var(--font-mono);
  color: var(--green);
}
.pulse-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}


/* ---------- WORKSPACE ---------- */
.workspace {
  height: calc(100vh - var(--header-h) - var(--bottom-bar-h, 36px));
  display: flex;
  flex-direction: column;
}

/* ---------- HEADER TOOLS BAR (UPSIDE TOOLS) ---------- */
.header-tools-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  max-width: 900px;
  margin: 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.header-tools-center::-webkit-scrollbar {
  display: none;
}

.header-tools-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
}

.header-selects-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.header-tools-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

.header-tools-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

/* ---------- BOTTOM NAVIGATION DOCK (BOTTOM OF WEBSITE) ---------- */
.bottom-app-bar {
  width: 100%;
  height: var(--bottom-bar-h, 36px);
  background: #080a11;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  flex-shrink: 0;
  z-index: 30;
  position: relative;
  box-sizing: border-box;
}

.bottom-app-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.bottom-app-bar-inner::-webkit-scrollbar {
  display: none;
}

.bottom-nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.bottom-nav-tab,
.bottom-nav-tab-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 6px;
  font: 500 12px var(--font-sans);
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.bottom-nav-tab:hover,
.bottom-nav-tab-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.bottom-nav-tab.active,
.bottom-nav-tab-link.active {
  background: rgba(36, 87, 255, 0.14);
  color: #93c5fd;
  border-color: rgba(36, 87, 255, 0.4);
  font-weight: 600;
  box-shadow: 0 0 10px rgba(36, 87, 255, 0.2);
}

.bottom-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.bottom-status-hint {
  font: 500 11px var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---------- COMPACT 2-TIER WORKSPACE TOOLBAR ---------- */
.lang-bar.compact-workspace-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.editor-toolbar,
.editor-toolbar-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 12px;
  gap: 10px;
  flex-wrap: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.editor-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.editor-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

.editor-tools-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
}

.primary-run-wrapper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Tier 2: Sub-Toolbar Directly Down to Python */
.editor-toolbar-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 5px 12px;
  gap: 8px;
  background: rgba(11, 14, 24, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 20;
  box-sizing: border-box;
}

.sub-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.sub-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin-left: auto;
}

.sub-toolbar-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 3px;
  flex-shrink: 0;
}

.sub-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  font: 500 11.5px var(--font-sans);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.sub-tool-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}
.sub-tool-btn:active {
  transform: scale(0.97);
}

.sub-tool-btn.format-tool-btn:hover {
  border-color: rgba(255, 107, 90, 0.5);
  color: #fff;
  box-shadow: 0 0 10px var(--coral-glow);
}
.sub-tool-btn.save-tool-btn {
  color: #5eead4;
  background: rgba(20, 187, 166, 0.08);
  border-color: rgba(20, 187, 166, 0.3);
}
.sub-tool-btn.save-tool-btn:hover {
  border-color: rgba(20, 187, 166, 0.7);
  color: #fff;
  box-shadow: 0 0 10px var(--teal-glow);
}
.sub-tool-btn.share-tool-btn {
  color: #93c5fd;
  background: rgba(36, 87, 255, 0.08);
  border-color: rgba(36, 87, 255, 0.3);
}
.sub-tool-btn.share-tool-btn:hover {
  border-color: rgba(36, 87, 255, 0.7);
  color: #fff;
  box-shadow: 0 0 10px var(--cobalt-glow);
}
.sub-tool-btn.lab-pdf-tool-btn {
  color: #5eead4;
  background: rgba(20, 187, 166, 0.08);
  border-color: rgba(20, 187, 166, 0.3);
}
.sub-tool-btn.lab-pdf-tool-btn:hover {
  border-color: rgba(20, 187, 166, 0.7);
  color: #fff;
  box-shadow: 0 0 10px var(--teal-glow);
}
.sub-tool-btn.clear-tool-btn:hover {
  border-color: rgba(255, 107, 90, 0.5);
  color: #fff;
}

/* File Name & Status Box */
.file-status-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.file-name {
  font: 600 11.5px var(--font-mono);
  color: var(--text-primary);
  padding: 5px 11px;
  border-radius: 7px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.save-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 600 11px var(--font-sans);
  color: var(--teal);
  user-select: none;
}

.save-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
}

.save-status-text {
  color: var(--teal);
  letter-spacing: 0.02em;
}

.toolbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 2px;
  flex-shrink: 0;
}

/* ========================================================= */
/* ICON 1: PROGRAMMING LANGUAGES POPUP MENU (Cobalt #2457ff) */
/* ========================================================= */
.lang-menu-wrapper {
  position: relative;
  display: inline-block;
}

.lang-menu-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(36, 87, 255, 0.4);
  background: rgba(36, 87, 255, 0.1);
  color: #f1f5f9;
  font: 600 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 0 10px rgba(36, 87, 255, 0.08);
  white-space: nowrap;
}

.lang-menu-trigger-btn:hover {
  background: rgba(36, 87, 255, 0.2);
  border-color: rgba(36, 87, 255, 0.7);
  box-shadow: 0 0 16px var(--cobalt-glow);
  transform: translateY(-1px);
  color: #fff;
}

.trigger-icon-box {
  display: grid;
  place-items: center;
  color: var(--cobalt);
}

.lang-trigger-label {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.lang-trigger-badge {
  font: 700 9.5px var(--font-mono);
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(36, 87, 255, 0.25);
  color: #93c5fd;
  border: 1px solid rgba(36, 87, 255, 0.45);
}

.chevron-arrow {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.7;
}

.lang-menu-wrapper.is-open .chevron-arrow,
.features-menu-wrapper.is-open .chevron-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

/* Floating Popover Container */
.lang-popover-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 120;
  width: 270px;
  background: rgba(11, 14, 23, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(36, 87, 255, 0.35);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px var(--cobalt-glow);
  padding: 8px;
  flex-direction: column;
  gap: 3px;
}

.lang-popover-menu.is-open {
  display: flex !important;
  animation: popoverFlyIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 8px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.popover-title {
  font: 700 10px var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.popover-hint {
  font: 600 9.5px var(--font-mono);
  color: var(--cobalt);
  background: rgba(36, 87, 255, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

.lang-popover-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.popover-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Staggered Cascading Animation - Coming one after one above the screen! */
.lang-popover-menu.is-open .lang-btn {
  opacity: 0;
  transform: translateY(14px);
  animation: slideUpOption 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.lang-popover-menu.is-open .lang-btn:nth-child(1) { animation-delay: 0.03s; }
.lang-popover-menu.is-open .lang-btn:nth-child(2) { animation-delay: 0.07s; }
.lang-popover-menu.is-open .lang-btn:nth-child(3) { animation-delay: 0.11s; }
.lang-popover-menu.is-open .lang-btn:nth-child(4) { animation-delay: 0.15s; }
.lang-popover-menu.is-open .lang-btn:nth-child(6) { animation-delay: 0.19s; }
.lang-popover-menu.is-open .lang-btn:nth-child(7) { animation-delay: 0.23s; }
.lang-popover-menu.is-open .lang-btn:nth-child(8) { animation-delay: 0.27s; }

.lang-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font: 500 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
}

.lang-btn:hover {
  background: rgba(36, 87, 255, 0.12);
  border-color: rgba(36, 87, 255, 0.3);
  color: #fff;
  transform: translateX(3px);
}

.lang-btn.active {
  background: rgba(36, 87, 255, 0.22);
  border-color: rgba(36, 87, 255, 0.65);
  color: #fff;
  box-shadow: inset 0 0 12px rgba(36, 87, 255, 0.25);
}

.lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.lang-btn-name {
  font: 600 12.5px var(--font-sans);
  flex: 1;
}

.lang-btn-tag {
  font: 500 9.5px var(--font-mono);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ========================================================= */
/* ICON 2: WORKBENCH FEATURES MENU (Teal #14bba6 & Coral)    */
/* ========================================================= */
.features-menu-wrapper {
  position: relative;
  display: inline-block;
}

.features-menu-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(20, 187, 166, 0.4);
  background: rgba(20, 187, 166, 0.1);
  color: #f1f5f9;
  font: 600 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 0 10px rgba(20, 187, 166, 0.08);
  white-space: nowrap;
}

.features-menu-trigger-btn:hover {
  background: rgba(20, 187, 166, 0.2);
  border-color: rgba(20, 187, 166, 0.7);
  box-shadow: 0 0 16px var(--teal-glow);
  transform: translateY(-1px);
  color: #fff;
}

.features-icon-box {
  color: var(--teal);
}

.features-trigger-label {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.features-trigger-badge {
  font: 700 9.5px var(--font-mono);
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(20, 187, 166, 0.25);
  color: #5eead4;
  border: 1px solid rgba(20, 187, 166, 0.45);
}

/* Floating Features Popover Container */
.features-popover-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 120;
  width: 325px;
  background: rgba(11, 14, 23, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(20, 187, 166, 0.35);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px var(--teal-glow);
  padding: 8px;
  flex-direction: column;
  gap: 4px;
}

.features-popover-menu.is-open {
  display: flex !important;
  animation: popoverFlyIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.features-popover-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Staggered Cascading Animation for Features Items */
.features-popover-menu.is-open .feature-menu-item {
  opacity: 0;
  transform: translateY(14px);
  animation: slideUpOption 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.features-popover-menu.is-open .feature-menu-item:nth-child(1) { animation-delay: 0.04s; }
.features-popover-menu.is-open .feature-menu-item:nth-child(2) { animation-delay: 0.10s; }
.features-popover-menu.is-open .feature-menu-item:nth-child(3) { animation-delay: 0.16s; }
.features-popover-menu.is-open .feature-menu-item:nth-child(4) { animation-delay: 0.22s; }

.feature-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
}

.feature-menu-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.09);
  transform: translateX(3px);
}

.feature-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.feature-item-icon.icon-teal {
  background: rgba(20, 187, 166, 0.14);
  color: var(--teal);
  border: 1px solid rgba(20, 187, 166, 0.35);
}

.feature-item-icon.icon-cobalt {
  background: rgba(36, 87, 255, 0.14);
  color: var(--cobalt);
  border: 1px solid rgba(36, 87, 255, 0.35);
}

.feature-item-icon.icon-coral {
  background: rgba(255, 107, 90, 0.14);
  color: var(--coral);
  border: 1px solid rgba(255, 107, 90, 0.35);
}

.feature-item-icon.icon-lime {
  background: rgba(200, 255, 61, 0.14);
  color: var(--lime);
  border: 1px solid rgba(200, 255, 61, 0.35);
}

.feature-item-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.feature-item-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feature-title {
  font: 600 12.5px var(--font-sans);
  color: var(--text-primary);
}

.feature-subtitle {
  font: 400 11px var(--font-sans);
  color: var(--text-muted);
}

/* Feature Badges */
.feature-pill {
  font: 700 10px var(--font-mono);
  padding: 1px 6px;
  border-radius: 4px;
}

.pill-teal {
  background: rgba(20, 187, 166, 0.2);
  color: var(--teal);
  border: 1px solid rgba(20, 187, 166, 0.4);
}

.pill-cobalt {
  background: rgba(36, 87, 255, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(36, 87, 255, 0.4);
}

.pill-coral {
  background: rgba(255, 107, 90, 0.2);
  color: var(--coral);
  border: 1px solid rgba(255, 107, 90, 0.4);
}

.pill-lime {
  background: rgba(200, 255, 61, 0.2);
  color: #d9f99d;
  border: 1px solid rgba(200, 255, 61, 0.4);
}

/* Animations */
@keyframes popoverFlyIn {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideUpOption {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Float Modals for Practice & Translate above screen */
.practice-dropdown-menu {
  position: fixed !important;
  top: 60px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 1000 !important;
  width: 440px !important;
  max-width: 92vw !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 35px var(--teal-glow) !important;
  border: 1px solid rgba(20, 187, 166, 0.35) !important;
}

.translate-menu {
  position: fixed !important;
  top: 60px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 1000 !important;
  min-width: 290px !important;
  max-width: 92vw !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 35px var(--lime-glow) !important;
  border: 1px solid rgba(200, 255, 61, 0.35) !important;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.toolbar-actions::-webkit-scrollbar {
  display: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.icon-btn svg {
  display: block;
  pointer-events: none;
}
.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}
.icon-btn:active {
  transform: scale(0.96);
}
.icon-btn.small { width: 28px; height: 28px; border: none; }

.save-code-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
  color: #e0f2fe;
  font: 600 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}
.save-code-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 14px -2px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}
.save-code-btn:active {
  transform: scale(0.97);
}

/* Core Lab Auto-Translator Badge */
.core-lang-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(167,139,250,0.08);
  border: 1px solid rgba(167,139,250,0.22);
  font: 500 11px var(--font-mono);
  color: #c4b5fd;
  white-space: nowrap;
}

/* Cross-Translate Toolbar Button & Dropdown */
.translate-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.translate-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(167,139,250,0.3);
  background: rgba(167,139,250,0.08);
  color: #e0e7ff;
  font: 600 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
}

.translate-btn:hover {
  background: rgba(167,139,250,0.18);
  border-color: rgba(167,139,250,0.5);
  box-shadow: 0 0 14px -3px rgba(167,139,250,0.35);
  transform: translateY(-1px);
}

.translate-btn:active {
  transform: scale(0.97);
}

.translate-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  border-color: var(--border);
  background: transparent;
  color: var(--text-muted);
}

.translate-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 45;
  min-width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  box-shadow: 0 16px 36px rgba(0,0,0,0.7), 0 0 20px rgba(129,140,248,0.15);
  padding: 6px;
  backdrop-filter: blur(12px);
  animation: toastIn 0.15s forwards;
}

.translate-menu-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 600 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 6px 8px 4px 8px;
}

.translate-menu-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.translate-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font: 500 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.translate-menu-item:hover {
  background: var(--bg-hover);
  color: #fff;
}

.translate-menu-footer {
  padding: 6px 8px 2px 8px;
  font: 500 9px var(--font-mono);
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* High-Contrast Translation Loading Overlay */
.translation-overlay {
  position: absolute;
  inset: 0;
  z-index: 35;
  background: rgba(6, 7, 10, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlayFadeIn 0.2s ease-out;
}

@keyframes overlayFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.translation-card {
  position: relative;
  max-width: 440px;
  width: 100%;
  background: linear-gradient(180deg, #151824 0%, #0d0f17 100%);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 25px 60px -10px rgba(0,0,0,0.85), 0 0 40px rgba(129, 140, 248, 0.25);
  overflow: hidden;
}

.translation-glow {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 120px;
  background: radial-gradient(circle, rgba(167,139,250,0.3) 0%, transparent 70%);
  pointer-events: none;
}

.translation-badge-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(52,211,153,0.1);
  border: 1px solid rgba(52,211,153,0.25);
  font: 500 10px var(--font-mono);
  color: var(--green);
  margin-bottom: 12px;
}

.translation-icon-wrapper {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 8px auto 16px;
  display: grid;
  place-items: center;
}

.translation-spin-ring {
  position: absolute;
  inset: 0;
  border: 2.5px solid transparent;
  border-top-color: #facc15;
  border-right-color: #a78bfa;
  border-radius: 50%;
  animation: spinRing 1s linear infinite;
}

@keyframes spinRing {
  to { transform: rotate(360deg); }
}

.translation-bolt-icon {
  width: 28px;
  height: 28px;
  color: #facc15;
  filter: drop-shadow(0 0 12px rgba(250,204,21,0.7));
  animation: boltPulse 1.2s ease-in-out infinite;
}

@keyframes boltPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(250,204,21,0.5)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 16px rgba(250,204,21,0.9)); }
}

.translation-title {
  font: 700 17px var(--font-sans);
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.translation-desc {
  font: 400 12px var(--font-sans);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.translation-meter {
  height: 4px;
  border-radius: 99px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-bottom: 14px;
  position: relative;
}

.translation-meter-bar {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #facc15, #a78bfa, #38bdf8);
  border-radius: 99px;
  animation: meterSlide 1.2s ease-in-out infinite;
}

@keyframes meterSlide {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(50%); }
  100% { transform: translateX(200%); }
}

.translation-foot {
  font: 500 10px var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Translation Success / Revert Banner */
.translation-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  background: linear-gradient(90deg, rgba(30,27,75,0.95), rgba(15,23,42,0.95));
  border-bottom: 1px solid rgba(167,139,250,0.3);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(8px);
  animation: bannerSlideDown 0.2s ease-out;
}

@keyframes bannerSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(250,204,21,0.15);
  border: 1px solid rgba(250,204,21,0.3);
  font: 700 9px var(--font-mono);
  color: #fde047;
  letter-spacing: 0.05em;
}

.banner-text {
  font: 500 12px var(--font-sans);
  color: var(--text-primary);
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.banner-btn.revert {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  font: 500 11px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}

.banner-btn.revert:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
  color: #fff;
}

.banner-close {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
}

.banner-close:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.08);
}

/* Run Button - High-Visibility Lime #c8ff3d */
.run-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px;
  border-radius: 8px;
  border: 1px solid rgba(200, 255, 61, 0.45);
  background: linear-gradient(135deg, #c8ff3d 0%, #a3e635 100%);
  color: #0b0f19 !important;
  font: 700 13px var(--font-sans);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 18px -2px rgba(200, 255, 61, 0.45), 0 0 10px rgba(200, 255, 61, 0.25);
  flex-shrink: 0;
  white-space: nowrap;
}
.run-btn svg {
  fill: #0b0f19;
  stroke: #0b0f19;
  display: block;
}
.run-btn:hover {
  background: linear-gradient(135deg, #d8ff63 0%, #c8ff3d 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px -2px rgba(200, 255, 61, 0.65), 0 0 16px rgba(200, 255, 61, 0.4);
}
.run-btn:active { transform: scale(0.97); }

.run-btn.running {
  background: linear-gradient(135deg, #ff6b5a, #f97316);
  color: #fff !important;
  border-color: rgba(255, 107, 90, 0.6);
  box-shadow: 0 4px 16px -4px rgba(255, 107, 90, 0.55);
  pointer-events: none;
}
.run-btn.running svg {
  fill: #fff;
  stroke: #fff;
}

.run-shortcut {
  font: 700 10px var(--font-mono);
  opacity: 0.85;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.16);
  color: #0b0f19;
}


/* ---------- EDITOR + OUTPUT SPLIT ---------- */
.editor-output-split {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Editor Panel */
.editor-panel {
  flex: 1;
  min-height: 120px;
  position: relative;
  background: var(--bg-deep);
}

/* Code Editor Wrapper (Left Side from Top to Bottom) */
.code-editor-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  width: 100%;
  height: 100%;
  background: #080a12;
  overflow: hidden;
  z-index: 5;
}

.editor-gutter {
  width: 52px;
  background: #05070d;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #64748b;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 22px;
  padding: 14px 10px 14px 6px;
  text-align: right;
  user-select: none;
  overflow: hidden;
  white-space: pre;
  flex-shrink: 0;
}

.fallback-editor {
  flex: 1;
  height: 100%;
  background: transparent;
  color: #f1f5f9;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 22px;
  padding: 14px 16px;
  border: none;
  outline: none;
  resize: none;
  tab-size: 4;
  white-space: pre;
  overflow: auto;
  caret-color: #38bdf8;
  word-wrap: normal;
}

/* Split Handle */
.split-handle {
  height: 6px;
  background: var(--bg-surface);
  cursor: row-resize;
  display: grid;
  place-items: center;
  transition: background 0.15s;
  position: relative;
  z-index: 5;
}
.split-handle:hover, .split-handle.dragging { background: var(--accent); }
.handle-grip {
  width: 40px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
}

/* Output Panel */
.output-panel {
  height: 260px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
}

/* Output Tabs */
.output-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 12px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.output-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: 500 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}
.output-tab:hover { color: var(--text-secondary); }
.output-tab.active {
  background: var(--bg-raised);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.active-output-lang-pill {
  display: inline-flex;
  align-items: center;
  font: 700 10.5px var(--font-mono);
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(36, 87, 255, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(36, 87, 255, 0.35);
  margin-left: 6px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Console */
.console-output {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  font: 13px/1.7 var(--font-mono);
}

.console-line { word-break: break-word; }
.console-line.stdout { color: var(--text-primary); }
.console-line.stderr { color: var(--red); }
.console-line.info   { color: var(--cyan); }
.console-line.success { color: var(--green); }
.console-line.warn   { color: var(--amber); }
.console-line.system { color: var(--accent-bright); }
.console-line.dim    { color: var(--text-muted); }

/* Blinking cursor at the end of output */
.cursor-blink {
  display: inline-block;
  width: 7px; height: 15px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Web Preview */
.web-preview {
  flex: 1;
  background: #fff;
}
.web-preview iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Status Bar */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  height: 26px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  font: 500 11px var(--font-mono);
  color: var(--text-muted);
}
.status-left, .status-right { display: flex; align-items: center; gap: 14px; }

.status-indicator { display: flex; align-items: center; gap: 6px; }
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.status-dot.green { background: var(--green); }
.status-dot.amber { background: var(--amber); }
.status-dot.red   { background: var(--red); }


/* ---------- PROBLEMS OVERLAY ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.overlay-content {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 64px -16px rgba(0,0,0,0.6);
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.overlay-header h2 {
  font: 700 18px var(--font-sans);
  color: var(--text-primary);
}
.overlay-header p {
  font: 400 12px var(--font-sans);
  color: var(--text-secondary);
  margin-top: 2px;
}

.problems-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.problem-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.problem-card:hover {
  border-color: var(--border-focus);
  background: var(--bg-active);
}
.problem-card .title {
  font: 600 14px var(--font-sans);
  color: var(--text-primary);
}
.problem-card .meta {
  display: flex; gap: 8px; margin-top: 4px;
}
.problem-card .tag {
  font: 500 10px var(--font-mono);
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-base);
  color: var(--text-muted);
}
.problem-card .difficulty {
  font: 700 11px var(--font-sans);
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(52,211,153,0.1);
  color: var(--green);
  border: 1px solid rgba(52,211,153,0.2);
  align-self: center;
}
.problem-card .difficulty.medium {
  background: rgba(251,191,36,0.1);
  color: var(--amber);
  border-color: rgba(251,191,36,0.2);
}


/* ---------- TOAST ---------- */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 10px 18px;
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font: 500 12px var(--font-sans);
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.5);
  transform: translateY(10px);
  opacity: 0;
  animation: toastIn 0.25s forwards;
}
.toast.success { border-color: rgba(52,211,153,0.3); }
.toast.error   { border-color: rgba(248,113,113,0.3); }

@keyframes toastIn {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(10px); }
}


/* ============================================================
   NEW FEATURES & FIXES:
   1. Compiler Lazy Loading Init Overlay (Problem 1 Fix)
   2. Lab Manual & Guides (Problem 3 AdSense Fix)
   3. Saved Code History & Warning Banner (Problem 4 Storage Fix)
   4. Cloud Sync Upgrade Modal
   ============================================================ */

/* Header Saved Code Button */
.header-action-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-primary);
  font: 500 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}
.header-action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: #fff;
}
.history-badge {
  font: 700 10px var(--font-mono);
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(167,139,250,0.18);
  color: #c4b5fd;
  border: 1px solid rgba(167,139,250,0.3);
}

/* PWA Install App Button */
.install-app-btn {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
  color: #e0f2fe;
}
.install-app-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 14px -3px rgba(56, 189, 248, 0.35);
}

/* Export All ZIP Button in Drawer */
.export-zip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  font: 600 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
}
.export-zip-btn:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 16px -3px rgba(56, 189, 248, 0.35);
  color: #fff;
  transform: translateY(-1px);
}
.export-zip-btn:active {
  transform: scale(0.97);
}

.badge-mini-accent {
  font: 700 9px var(--font-mono);
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(129,140,248,0.15);
  color: #a78bfa;
  border: 1px solid rgba(129,140,248,0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-mini-green {
  font: 700 9px var(--font-mono);
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(52,211,153,0.15);
  color: #34d399;
  border: 1px solid rgba(52,211,153,0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ──── 1. Compiler Lazy Loading Init Overlay ──── */
.compiler-init-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(4, 5, 8, 0.92);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlayFadeIn 0.25s ease-out;
}

.compiler-init-card {
  position: relative;
  max-width: 500px;
  width: 100%;
  background: linear-gradient(180deg, #151824 0%, #0b0d14 100%);
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: 20px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 30px 70px -10px rgba(0,0,0,0.9), 0 0 50px rgba(129, 140, 248, 0.2);
  overflow: hidden;
}

.init-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 140px;
  background: radial-gradient(circle, rgba(129,140,248,0.3) 0%, transparent 70%);
  pointer-events: none;
}

.init-icon-wrapper {
  position: relative;
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
}

.init-spin-ring {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-top-color: #818cf8;
  border-right-color: #34d399;
  border-radius: 50%;
  animation: spinRing 1.1s linear infinite;
}

.init-icon {
  width: 32px;
  height: 32px;
  color: #a78bfa;
  filter: drop-shadow(0 0 10px rgba(167,139,250,0.6));
}

.init-title {
  font: 700 18px var(--font-sans);
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.init-subtitle {
  font: 400 12px var(--font-sans);
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.init-progress-bar {
  height: 6px;
  border-radius: 99px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-bottom: 20px;
}

.init-progress-fill {
  height: 100%;
  width: 15%;
  background: linear-gradient(90deg, #818cf8, #a78bfa, #34d399);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.init-step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  background: rgba(0,0,0,0.3);
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.init-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 12px var(--font-sans);
  color: var(--text-muted);
}
.init-step.done { color: var(--green); }
.init-step.done .step-icon { color: var(--green); font-weight: 700; }
.init-step.active { color: #fff; font-weight: 600; }
.init-step.active .step-icon { color: #facc15; }

.init-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 500 11px var(--font-mono);
  color: var(--text-muted);
}


/* ──── 2. Lab Manual & Guides (Problem 3 Fix) ──── */
.guides-modal-content {
  max-width: 960px;
  width: 95vw;
  max-height: 88vh;
}

.guides-toolbar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-base);
}

.guides-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}
.guides-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font: 400 13px var(--font-sans);
  outline: none;
}

.guides-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-secondary);
  font: 500 11px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-chip:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.filter-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.guides-list {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.guide-article-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.guide-article-card:hover {
  border-color: rgba(129,140,248,0.4);
  background: var(--bg-active);
}

.guide-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.guide-title {
  font: 700 16px var(--font-sans);
  color: #fff;
  letter-spacing: -0.2px;
}

.guide-course-label {
  font: 500 11px var(--font-mono);
  color: #a78bfa;
  margin-top: 3px;
}

.guide-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.complexity-pill {
  font: 600 10px var(--font-mono);
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(251,191,36,0.12);
  color: #fde047;
  border: 1px solid rgba(251,191,36,0.25);
}

.guide-aim-text {
  font: 400 13px/1.6 var(--font-sans);
  color: var(--text-primary);
}

.guide-algo-box {
  background: var(--bg-base);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  font: 400 12px/1.6 var(--font-sans);
  color: var(--text-secondary);
}
.guide-algo-box strong { color: var(--text-primary); }

.guide-code-preview {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font: 12px/1.6 var(--font-mono);
  color: #e2e8f0;
  max-height: 160px;
  overflow-y: auto;
  white-space: pre;
}

.guide-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.btn-load-guide {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(129,140,248,0.3);
  background: rgba(129,140,248,0.12);
  color: #c4b5fd;
  font: 600 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-load-guide:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 16px -2px rgba(129,140,248,0.4);
}


/* ──── 3. Saved Code History & Warning Banner (Problem 4 Fix) ──── */
.history-modal-content {
  max-width: 720px;
  width: 95vw;
  max-height: 85vh;
}

.storage-warning-banner {
  margin: 14px 20px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.1), rgba(16, 185, 129, 0.05));
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.warning-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.15);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.warning-text {
  flex: 1;
}
.warning-title {
  font: 700 12.5px var(--font-sans);
  color: #34d399;
  margin-bottom: 2px;
}
.warning-desc {
  font: 400 11.5px/1.4 var(--font-sans);
  color: var(--text-secondary);
}

.save-snippet-bar {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.save-snippet-bar input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font: 400 13px var(--font-sans);
  color: var(--text-primary);
  outline: none;
}
.save-snippet-bar input:focus {
  border-color: var(--border-focus);
}

.save-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: var(--green);
  color: #064e3b;
  font: 700 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}
.save-submit-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ──── Storage Quota & Usage Bar ──── */
.storage-quota-bar {
  margin: 12px 20px 0;
  padding: 10px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.storage-quota-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 500 11.5px var(--font-sans);
}
.storage-quota-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-primary);
}
.storage-quota-label strong {
  color: #38bdf8;
  font-family: var(--font-mono);
}
.storage-quota-available {
  color: var(--text-muted);
  font: 500 10.5px var(--font-mono);
}
.storage-quota-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}
.storage-quota-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #34d399);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  transition: all 0.15s;
  gap: 12px;
}
.history-item:hover {
  border-color: var(--border-focus);
  background: var(--bg-active);
}

.history-item-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  min-width: 175px;
}
.history-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 500 10.5px var(--font-mono);
  color: var(--text-muted);
  flex-wrap: wrap;
}
.history-lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 700 10px var(--font-mono);
  letter-spacing: 0.04em;
}
.history-date {
  color: var(--text-muted);
  font-size: 10px;
}
.history-size-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #38bdf8;
  font: 700 9.5px var(--font-mono);
  letter-spacing: 0.02em;
}
.history-title-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.history-title {
  font: 600 13.5px var(--font-sans);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-size-details {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 500 10.5px var(--font-mono);
  color: var(--text-muted);
}
.history-size-tag strong {
  color: #a78bfa;
}
.history-preview-box {
  flex: 0 0 140px;
  max-width: 160px;
  background: var(--bg-deep);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 6px 10px;
  font: 11px var(--font-mono);
  color: #94a3b8;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.history-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.history-btn-load {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(129, 140, 248, 0.35);
  background: rgba(129, 140, 248, 0.15);
  color: #c4b5fd;
  font: 600 11px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}
.history-btn-load:hover {
  background: var(--accent);
  color: #fff;
}
.history-btn-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.08);
  color: #f87171;
  cursor: pointer;
  transition: all 0.15s;
}
.history-btn-del:hover {
  background: rgba(248, 113, 113, 0.22);
  border-color: #f87171;
}



/* ============================================================
   DAILY CODE TEST & AD CONTAINER SYSTEM
   ============================================================ */

/* ---------- Top Leaderboard Ad Banner (728x90) ---------- */
.top-ad-banner-wrapper {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 4px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  z-index: 10;
}
.ad-container-frame {
  position: relative;
  background: linear-gradient(135deg, rgba(24, 24, 27, 0.85), rgba(39, 39, 42, 0.65));
  border: 1px dashed rgba(161, 161, 170, 0.25);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.25s ease;
}
.ad-container-frame.ad-refreshed {
  animation: adPulse 0.5s ease-out;
}
@keyframes adPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(129, 140, 248, 0); }
  50% { transform: scale(1.008); box-shadow: 0 0 20px rgba(129, 140, 248, 0.35); border-color: rgba(129, 140, 248, 0.6); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(129, 140, 248, 0); }
}
.top-leaderboard {
  width: 100%;
  max-width: 728px;
  min-height: 58px;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.ad-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.ad-badge-tag {
  font: 700 8.5px var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.ad-impression-badge {
  font: 600 8.5px var(--font-mono);
  color: #34d399;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
}
.ad-content-box {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ad-sponsor-pill {
  font: 800 8.5px var(--font-sans);
  background: #f59e0b;
  color: #000;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.ad-sponsor-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ad-sponsor-headline {
  font: 600 12px var(--font-sans);
  color: #f4f4f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-sponsor-sub {
  font: 400 10.5px var(--font-sans);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-action-btn {
  font: 600 11px var(--font-sans);
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.ad-action-btn:hover {
  background: #4f46e5;
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.4);
}
.ad-refresh-shimmer {
  position: absolute;
  top: 0; left: -100%; width: 200%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: shimmerAnim 0.7s infinite;
  pointer-events: none;
}
@keyframes shimmerAnim {
  0% { transform: translateX(0); }
  100% { transform: translateX(50%); }
}

/* ---------- Workspace Split Layout Base ---------- */
.left-sidebar {
  width: 320px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.workspace-editor-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ---------- Daily Mind Workout Card ---------- */
.daily-workout-card {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 16px -6px rgba(0, 0, 0, 0.4);
}
.workout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.workout-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.workout-icon-box {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.25);
  display: grid;
  place-items: center;
}
.workout-heading {
  font: 700 13px var(--font-sans);
  color: #f4f4f5;
  margin: 0;
}
.workout-sub {
  font: 500 9.5px var(--font-sans);
  color: var(--text-muted);
}


/* Difficulty Toggle */
.difficulty-toggle-wrapper {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.toggle-label {
  font: 600 9.5px var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.difficulty-toggle-group {
  display: flex;
  background: var(--bg-raised);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
  gap: 4px;
}
.diff-toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font: 600 11px var(--font-sans);
  padding: 5px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.diff-toggle-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.diff-toggle-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px -2px rgba(129, 140, 248, 0.5);
}

/* Quiz Container */
.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.quiz-question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 600 10px var(--font-mono);
}
.quiz-lang-tag {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}
.quiz-qnum {
  color: var(--text-muted);
}
.quiz-prompt {
  font: 600 11.5px var(--font-sans);
  color: var(--text-primary);
  line-height: 1.4;
}
.quiz-code-snippet {
  background: #09090b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  color: #a5f3fc;
  overflow-x: auto;
  margin: 0;
  max-height: 140px;
}
.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quiz-option-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.quiz-option-item:hover:not(.disabled) {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}
.quiz-option-item.correct {
  background: rgba(52, 211, 153, 0.15) !important;
  border-color: #34d399 !important;
  color: #6ee7b7 !important;
}
.quiz-option-item.incorrect {
  background: rgba(248, 113, 113, 0.15) !important;
  border-color: #f87171 !important;
  color: #fca5a5 !important;
}
.quiz-option-item.disabled {
  cursor: default;
}
.option-label-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  font: 700 10px var(--font-mono);
  flex-shrink: 0;
  color: var(--text-secondary);
}
.quiz-option-item.correct .option-label-circle {
  background: #10b981;
  color: #000;
}
.quiz-option-item.incorrect .option-label-circle {
  background: #ef4444;
  color: #fff;
}
.option-text {
  font: 500 11px var(--font-mono);
  line-height: 1.35;
  color: var(--text-primary);
  flex: 1;
}

/* Explanation Box */
.quiz-explanation-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(129, 140, 248, 0.25);
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  animation: fadeIn 0.25s ease-out;
}
.explanation-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 700 11px var(--font-sans);
}
.explanation-header.correct { color: #34d399; }
.explanation-header.incorrect { color: #f87171; }
.explanation-status-icon {
  font-size: 13px;
}
.explanation-text {
  font: 400 11px var(--font-sans);
  color: #cbd5e1;
  line-height: 1.45;
  margin: 0;
}


/* Quiz Footer Actions */
.quiz-footer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}
.btn-quiz-next {
  display: flex;
  align-items: center;
  gap: 5px;
  font: 600 11px var(--font-sans);
  padding: 5px 11px;
  border-radius: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-quiz-next:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

/* ---------- Left Sidebar Ad Container ---------- */
.left-sidebar-ad {
  width: 100%;
  min-height: 130px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}
.ad-sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ad-side-title {
  font: 700 11.5px var(--font-sans);
  color: #f4f4f5;
  margin: 0;
}
.ad-side-desc {
  font: 400 10px var(--font-sans);
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
}
.side-btn {
  align-self: flex-start;
  margin-top: 4px;
  font-size: 10.5px;
  padding: 4px 9px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .left-sidebar { width: 280px; }
  .top-leaderboard { max-width: 100%; }
}

/* ---------- Ad-Blocker Notice Banner (Problem 4 Fix) ---------- */
.adblock-notice-banner {
  background: linear-gradient(135deg, rgba(24, 24, 27, 0.95), rgba(39, 39, 42, 0.9));
  border-bottom: 1px solid rgba(250, 204, 21, 0.3);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 15;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.adblock-notice-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.adblock-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 700 10px var(--font-mono);
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.3);
  color: #facc15;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.adblock-text {
  font: 500 11.5px var(--font-sans);
  color: #e4e4e7;
  line-height: 1.4;
  margin: 0;
}
.adblock-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn-adblock-whitelist {
  display: flex;
  align-items: center;
  gap: 5px;
  font: 600 11px var(--font-sans);
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(129, 140, 248, 0.15);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #c4b5fd;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-adblock-whitelist:hover {
  background: rgba(129, 140, 248, 0.25);
  color: #fff;
}
.btn-adblock-dismiss {
  font: 600 11px var(--font-sans);
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-adblock-dismiss:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ============================================================
   3-COLUMN IDE WORKSPACE
   Column 1 (Left):   Problem / Instructions & Examples
   Column 2 (Middle): Code Editor (Input Code)
   Column 3 (Right):  Console Output & Preview
   ============================================================ */

.workspace {
  width: 100%;
  display: block;
  padding: 24px 20px 48px;
  background: var(--bg-deep);
  box-sizing: border-box;
}

.workspace-body-split {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

/* ---------- COLUMN 1 (LEFT): Dedicated Google AdSense Slot ---------- */
.workspace-left-ad {
  flex: 0 0 220px;
  min-width: 160px;
  max-width: 480px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.ad-slot-header {
  padding: 8px 12px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ad-slot-badge {
  font: 700 9px var(--font-mono);
  color: #64748b;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ad-slot-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #060912;
  overflow: auto;
}

.google-ad-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 24px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  width: 100%;
  max-width: 250px;
  min-height: 480px;
}

.ad-ph-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-ph-title {
  font: 700 13px var(--font-sans);
  color: #cbd5e1;
}

.ad-ph-desc {
  font: 500 11px var(--font-mono);
  color: #64748b;
}

.ad-ph-note {
  font: 400 10.5px var(--font-sans);
  color: #475569;
  max-width: 180px;
  line-height: 1.4;
  margin-top: 6px;
}

/* Output Panel Bottom Ad Slot */
.output-bottom-ad {
  flex: 0 0 auto;
  min-height: 90px;
  max-height: 125px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ad-slot-container-output {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  background: #060912;
  overflow: hidden;
}

/* ---------- COLUMN 1 (LEFT): Problem / Instructions ---------- */
.workspace-left-problem {
  flex: 0 0 320px;
  min-width: 240px;
  max-width: 480px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-right: none;
  overflow: hidden;
}

.problem-panel-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.problem-select-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.problem-label {
  font: 700 10px var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.problem-selector {
  flex: 1;
  min-width: 0;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font: 600 12px var(--font-sans);
  padding: 5px 8px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.problem-selector:focus {
  border-color: var(--accent);
}

.problem-diff-badge {
  font: 700 10.5px var(--font-mono);
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.problem-diff-badge.easy {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.problem-diff-badge.medium {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.problem-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--font-sans);
}

.problem-title {
  font-size: 17px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
  margin: 0;
}

.problem-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.problem-tag {
  font: 500 11px var(--font-mono);
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(129, 140, 248, 0.1);
  border: 1px solid rgba(129, 140, 248, 0.2);
  color: #c7d2fe;
}

.problem-description {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.6;
}
.problem-description p {
  margin-bottom: 8px;
}
.problem-description code,
.problem-example-box code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #38bdf8;
}

.problem-section-heading {
  font: 700 11px var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-top: 4px;
}

.problem-example-box {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.6;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.problem-example-box .example-explain {
  color: var(--text-muted);
  font-size: 11.5px;
  margin-top: 2px;
}

.problem-constraints {
  padding-left: 20px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.6;
}

.btn-load-problem-code {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 8px;
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #e0e7ff;
  font: 600 12.5px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-load-problem-code:hover {
  background: rgba(129, 140, 248, 0.22);
  border-color: rgba(129, 140, 248, 0.55);
}

/* ---------- COLUMN 2 (MIDDLE): Code Input & Editor ---------- */
.workspace-left-editor {
  width: 100%;
  height: 540px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7);
}

.workspace-left-editor .lang-bar {
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  flex-shrink: 0;
}

.workspace-left-editor .editor-panel.full-height {
  flex: 1 1 0%;
  min-height: 0;
  height: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ---------- Editor Bottom Bar (Right Bottom of Input Code) ---------- */
.editor-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #090c14;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  min-height: 48px;
  z-index: 10;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.25);
}

.editor-bottom-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.editor-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  user-select: none;
}

.editor-runtime-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
  display: inline-block;
}

.editor-shortcut-hint {
  font-size: 11px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.editor-shortcut-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.editor-bottom-right {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.editor-bottom-right .run-btn {
  padding: 7px 20px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: 0 4px 18px -2px rgba(200, 255, 61, 0.5), 0 0 12px rgba(200, 255, 61, 0.3);
}

/* ---------- COLUMN 3 (RIGHT): Output Panel ---------- */
.workspace-right-column {
  width: 100%;
  min-height: 520px;
  height: auto;
  max-width: 100%;
  flex: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7);
}

.workspace-right-column .output-panel {
  flex: 1 1 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-surface);
  border-top: none;
}

/* Fullscreen Output Box Mode */
.output-panel.fullscreen-output {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 999999 !important;
  background: var(--bg-deep) !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9) !important;
  display: flex !important;
  flex-direction: column !important;
}

.output-panel.fullscreen-output .output-tabs {
  padding: 8px 16px !important;
  background: var(--bg-surface) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.output-panel.fullscreen-output .output-tabs .output-tab {
  padding: 8px 18px !important;
  font-size: 13px !important;
}

.output-panel.fullscreen-output .console-output {
  flex: 1 1 100% !important;
  height: auto !important;
  max-height: none !important;
  padding: 20px 24px !important;
  font-size: 14px !important;
}

.output-panel.fullscreen-output .web-preview-container,
.output-panel.fullscreen-output .testcases-panel {
  flex: 1 1 100% !important;
  height: auto !important;
  max-height: none !important;
}

/* ---------- Vertical Split Handles between Columns ---------- */
.split-handle-vertical {
  width: 6px;
  background: var(--border);
  cursor: col-resize;
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  z-index: 10;
}
.split-handle-vertical::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -5px;
  right: -5px;
  z-index: 2;
}
.split-handle-vertical:hover, .split-handle-vertical.dragging {
  background: var(--accent);
}
.handle-grip-v {
  width: 2px;
  height: 32px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 99px;
  transition: all 0.15s;
}
.split-handle-vertical:hover .handle-grip-v,
.split-handle-vertical.dragging .handle-grip-v {
  background: #fff;
  height: 44px;
}

/* Clean Output Area: Keep Workout Slot hidden in practice view for clean focused experience */
.daily-workout-slot,
.workout-collapsed-bar,
.workout-toggle-tab-btn,
#workoutSplitHandle {
  display: none !important;
}

.daily-workout-slot {
  flex: 1 1 50%;
  min-height: 140px;
  height: 50%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-base);
  border-top: 1px solid var(--border);
  transition: all 0.2s ease;
}

.workout-slot-header {
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.workout-slot-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Toggle buttons in output tabs */
.workout-toggle-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.25);
  color: #fef08a;
  font: 600 11px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
  margin-right: 6px;
}
.workout-toggle-tab-btn:hover {
  background: rgba(250, 204, 21, 0.18);
  border-color: rgba(250, 204, 21, 0.45);
}


/* Collapsed Bar indicator when Workout is closed */
.workout-collapsed-bar {
  padding: 6px 12px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  animation: fadeIn 0.2s ease;
}
.btn-reopen-workout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font: 600 11px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-reopen-workout:hover {
  background: var(--bg-hover);
  border-color: rgba(250, 204, 21, 0.4);
}

/* Workout Closed State */
.workspace-right-column.workout-closed .output-panel {
  flex: 1 1 100% !important;
  height: 100% !important;
}

.workspace-right-column.workout-closed .split-handle-horizontal,
.workspace-right-column.workout-closed .daily-workout-slot {
  display: none !important;
}

.workspace-right-column.workout-closed .workout-collapsed-bar {
  display: none !important;
}

.workout-toggle-tab-btn.active {
  background: rgba(250, 204, 21, 0.2);
  border-color: rgba(250, 204, 21, 0.5);
  color: #fff;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.2);
}

.workout-toggle-tab-btn:not(.active) {
  opacity: 0.8;
  filter: grayscale(0.2);
}

/* ============================================================
   NEW FEATURES: EDITOR CONTROLS, THEMES, STDIN & TEST CASES
   ============================================================ */

/* 1. Editor Controls Group (Font Size & Theme Dropdowns) */
.editor-controls-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.editor-select-sm {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font: 500 11.5px var(--font-sans);
  padding: 5px 8px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: all 0.15s;
}

.editor-select-sm:hover,
.editor-select-sm:focus {
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--text-primary);
  background: var(--bg-raised);
}

/* 2. Editor Themes */
.code-editor-wrapper.theme-vsdark {
  background: #080a12;
}
.code-editor-wrapper.theme-vsdark .editor-gutter {
  background: #05070d;
  color: #64748b;
  border-right-color: rgba(255, 255, 255, 0.08);
}
.code-editor-wrapper.theme-vsdark .fallback-editor {
  color: #f1f5f9;
  caret-color: #38bdf8;
}

.code-editor-wrapper.theme-monokai {
  background: #272822 !important;
}
.code-editor-wrapper.theme-monokai .editor-gutter {
  background: #1e1f1c !important;
  color: #75715e !important;
  border-right: 1px solid #3e3d32 !important;
}
.code-editor-wrapper.theme-monokai .fallback-editor {
  color: #f8f8f2 !important;
  caret-color: #f92672 !important;
}

.code-editor-wrapper.theme-dracula {
  background: #282a36 !important;
}
.code-editor-wrapper.theme-dracula .editor-gutter {
  background: #21222c !important;
  color: #6272a4 !important;
  border-right: 1px solid #44475a !important;
}
.code-editor-wrapper.theme-dracula .fallback-editor {
  color: #f8f8f2 !important;
  caret-color: #bd93f9 !important;
}

.code-editor-wrapper.theme-light {
  background: #ffffff !important;
}
.code-editor-wrapper.theme-light .editor-gutter {
  background: #f8fafc !important;
  color: #94a3b8 !important;
  border-right: 1px solid #e2e8f0 !important;
}
.code-editor-wrapper.theme-light .fallback-editor {
  color: #0f172a !important;
  caret-color: #2563eb !important;
}

/* 3. Share & Lab PDF Toolbar Buttons (Cobalt & Teal) */
.share-code-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(36, 87, 255, 0.1);
  border: 1px solid rgba(36, 87, 255, 0.35);
  color: #93c5fd;
  font: 600 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.share-code-btn svg { stroke: var(--cobalt); }
.share-code-btn:hover {
  background: rgba(36, 87, 255, 0.2);
  border-color: rgba(36, 87, 255, 0.7);
  box-shadow: 0 0 14px var(--cobalt-glow);
  color: #fff;
  transform: translateY(-1px);
}
.share-code-btn:active { transform: scale(0.97); }

.save-code-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(20, 187, 166, 0.1);
  border: 1px solid rgba(20, 187, 166, 0.35);
  color: #5eead4;
  font: 600 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.save-code-btn svg { stroke: var(--teal); }
.save-code-btn:hover {
  background: rgba(20, 187, 166, 0.2);
  border-color: rgba(20, 187, 166, 0.7);
  box-shadow: 0 0 14px var(--teal-glow);
  color: #fff;
  transform: translateY(-1px);
}

.lab-pdf-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(20, 187, 166, 0.1);
  border: 1px solid rgba(20, 187, 166, 0.35);
  color: #5eead4;
  font: 600 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.lab-pdf-btn svg { stroke: var(--teal); }
.lab-pdf-btn:hover {
  background: rgba(20, 187, 166, 0.2);
  border-color: rgba(20, 187, 166, 0.7);
  box-shadow: 0 0 14px var(--teal-glow);
  color: #fff;
  transform: translateY(-1px);
}
.lab-pdf-btn:active { transform: scale(0.97); }

.format-icon-btn:hover {
  border-color: rgba(255, 107, 90, 0.5) !important;
  box-shadow: 0 0 12px var(--coral-glow) !important;
}

/* 4. Collapsible Custom Input (stdin) Panel */
.custom-stdin-panel {
  background: #090d16;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s ease;
}

.custom-stdin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  cursor: pointer;
  user-select: none;
  background: rgba(15, 23, 42, 0.7);
  transition: background 0.15s;
}
.custom-stdin-header:hover {
  background: rgba(30, 41, 59, 0.8);
}

.custom-stdin-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 600 11.5px var(--font-sans);
  color: var(--text-primary);
}

.stdin-hint {
  font: 500 10px var(--font-mono);
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.custom-stdin-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stdin-btn-text {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font: 500 11px var(--font-sans);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}
.stdin-btn-text:hover {
  color: var(--red);
  background: rgba(239, 68, 68, 0.1);
}

.stdin-toggle-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font: 500 11px var(--font-sans);
  padding: 2px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}
.stdin-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.custom-stdin-body {
  padding: 8px 12px;
  background: #060911;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-stdin-textarea {
  width: 100%;
  height: 65px;
  background: #04060a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #38bdf8;
  font: 12.5px/18px var(--font-mono);
  padding: 8px 10px;
  resize: vertical;
  outline: none;
  white-space: pre;
}
.custom-stdin-textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2);
}

/* 5. Automated Test Cases Panel */
.testcases-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg-deep);
  padding: 12px 16px;
  gap: 12px;
}

.testcases-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.testcases-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.testcases-heading {
  font: 700 13px var(--font-sans);
  color: var(--text-primary);
}

.testcases-sub {
  font: 500 11px var(--font-sans);
  color: var(--text-muted);
}

.btn-run-tests {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  border: none;
  color: #fff;
  font: 700 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}
.btn-run-tests:hover {
  background: linear-gradient(135deg, #15803d, #16a34a);
  transform: translateY(-1px);
}

.testcases-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.testcase-card {
  background: #090d16;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}
.testcase-card.passed {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.04);
}
.testcase-card.failed {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.04);
}

.testcase-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.testcase-number {
  font: 700 12px var(--font-mono);
  color: var(--text-primary);
}

.testcase-status-badge {
  font: 700 10.5px var(--font-mono);
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.03em;
}
.testcase-status-badge.idle {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}
.testcase-status-badge.passed {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.testcase-status-badge.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.testcase-io-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font: 11.5px var(--font-mono);
}

.testcase-io-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.testcase-io-label {
  font: 600 10px var(--font-sans);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.testcase-io-code {
  background: #04060a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  padding: 6px 10px;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-all;
}
.testcase-io-code.expected {
  color: #86efac;
}
.testcase-io-code.actual {
  color: #fca5a5;
}

/* ============================================================
   ADSENSE COMPLIANCE: HEADER LINKS, SEO CONTENT & FOOTER
   ============================================================ */

/* Header Nav Links */
.nav-tab-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font: 500 12.5px var(--font-sans);
  transition: all 0.15s;
}
.nav-tab-link:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

/* Educational SEO Section */
.educational-seo-section {
  background: #060810;
  border-top: 1px solid var(--border);
  padding: 48px 24px;
  color: var(--text-secondary);
}

.seo-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Brand Overview Card (What is VAB-CODE?) */
.brand-overview-card {
  background: linear-gradient(135deg, rgba(14, 23, 42, 0.95), rgba(9, 13, 24, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  padding: 28px 32px;
  margin-bottom: 36px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.brand-overview-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #38bdf8, #818cf8);
}

.brand-overview-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 99px;
  font: 700 11px var(--font-sans);
  color: #38bdf8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.brand-overview-title {
  font: 800 22px/1.3 var(--font-sans);
  color: var(--text-primary);
  margin: 0 0 12px 0;
  letter-spacing: -0.01em;
}

.brand-overview-desc {
  font: 400 14.5px/1.7 var(--font-sans);
  color: #cbd5e1;
  margin: 0 0 16px 0;
}

.brand-overview-footer {
  display: flex;
  align-items: center;
}

.brand-overview-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 13px var(--font-sans);
  color: #38bdf8;
  text-decoration: none;
  transition: color 0.15s, gap 0.15s;
}

.brand-overview-link:hover {
  color: #7dd3fc;
  gap: 10px;
  text-decoration: underline;
}

@media (max-width: 640px) {
  .educational-seo-section {
    padding: 32px 12px;
  }
  .brand-overview-card {
    padding: 18px 14px;
  }
  .brand-overview-title {
    font-size: 19px;
  }
  .brand-overview-desc {
    font-size: 13.5px;
    line-height: 1.6;
  }
  .seo-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin-bottom: 32px !important;
  }
  .seo-card {
    min-width: 0 !important;
    padding: 16px !important;
    box-sizing: border-box !important;
  }
  .seo-faq-list {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .seo-faq-item {
    min-width: 0 !important;
    padding: 16px !important;
    box-sizing: border-box !important;
  }
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.seo-card {
  background: #090d18;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.seo-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.seo-card-header h3 {
  font: 700 15px var(--font-sans);
  color: var(--text-primary);
  margin: 0;
}

.seo-card p {
  font: 400 13.5px/1.6 var(--font-sans);
  color: #94a3b8;
  margin: 0;
}

.seo-faq-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 36px;
}

.seo-faq-title {
  font: 800 20px var(--font-sans);
  color: var(--text-primary);
  margin: 0 0 24px 0;
  text-align: center;
}

.seo-faq-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.seo-faq-item {
  background: #090d18;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 20px;
}

.seo-faq-item h4 {
  font: 600 14px var(--font-sans);
  color: #38bdf8;
  margin: 0 0 8px 0;
}

.seo-faq-item p {
  font: 400 13px/1.6 var(--font-sans);
  color: #cbd5e1;
  margin: 0;
}

/* Site Footer */
.site-footer {
  background: #04060b;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 48px 24px 24px 24px;
  color: #94a3b8;
  font-family: var(--font-sans);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 800 18px var(--font-sans);
  color: #fff;
  letter-spacing: -0.02em;
}

.footer-logo-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.45));
}

.footer-desc {
  font: 400 13px/1.6 var(--font-sans);
  color: #94a3b8;
  margin: 0;
  max-width: 340px;
}

.footer-meta {
  font: 500 11.5px var(--font-mono);
  color: var(--text-muted);
}

.footer-links-group h4 {
  font: 700 13px var(--font-sans);
  color: #f1f5f9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 14px 0;
}

.footer-links-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-links-group a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s;
}
.footer-links-group a:hover {
  color: #38bdf8;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  font-size: 12px;
  color: #64748b;
}

.footer-copyright {
  color: #64748b;
}

.footer-legal-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  max-width: 100%;
}

.footer-legal-inline a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s;
}
.footer-legal-inline a:hover {
  color: #38bdf8;
  text-decoration: underline;
}

/* ============================================================
   NEW ENHANCEMENTS: 
   1. Unsaved Changes Status Indicator
   2. Execution Stats Bar & Console Toolbar
   3. DSA Templates Starter Library Modal
   ============================================================ */

/* 1. Unsaved Changes Indicator */
.save-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  user-select: none;
}
.save-status-indicator:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
}
.save-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  transition: all 0.25s ease;
}
.save-status-dot.saved {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}
.save-status-dot.unsaved {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
  animation: unsavedPulse 1.8s infinite;
}
.save-status-dot.just-saved {
  background: #34d399;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.9);
  transform: scale(1.25);
}
@keyframes unsavedPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.9); }
}
.save-status-text {
  font: 500 11px var(--font-sans);
  color: var(--text-secondary);
}
.save-status-indicator:hover .save-status-text {
  color: var(--text-primary);
}

/* 1B. Practice Programs (20 Questions / 80 Codes) Dropdown Slot */
.practice-programs-wrapper {
  position: relative;
  display: inline-block;
}

.practice-programs-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.09);
  color: #ecfdf5;
  font: 600 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
}

.practice-programs-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 16px -3px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.practice-programs-btn:active {
  transform: scale(0.97);
}

.practice-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  font: 700 10px var(--font-mono);
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.practice-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 55;
  width: 360px;
  max-width: 90vw;
  background: #0d1017;
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.8), 0 0 24px rgba(16, 185, 129, 0.15);
  backdrop-filter: blur(16px);
  animation: toastIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.practice-menu-header {
  padding: 12px 14px 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.practice-menu-title-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.practice-menu-title-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 700 12px var(--font-sans);
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.practice-lang-pill {
  font: 600 10px var(--font-mono);
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
  text-transform: uppercase;
}

.practice-search-wrapper {
  position: relative;
}

.practice-search-input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-primary);
  font: 400 12px var(--font-sans);
  outline: none;
  transition: border-color 0.15s;
}

.practice-search-input:focus {
  border-color: rgba(52, 211, 153, 0.5);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.2);
}

.practice-menu-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.practice-menu-list::-webkit-scrollbar {
  width: 6px;
}
.practice-menu-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.practice-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}

.practice-menu-item:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
  transform: translateX(2px);
}

.practice-menu-item.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.4);
}

.practice-menu-item-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font: 700 11px var(--font-mono);
  color: #34d399;
}

.practice-menu-item-content {
  flex: 1;
  min-width: 0;
}

.practice-menu-item-title {
  font: 500 12px var(--font-sans);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.practice-menu-item-tag {
  font: 500 9px var(--font-mono);
  color: var(--text-muted);
  margin-top: 2px;
}

.practice-menu-footer {
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid var(--border);
  font: 500 10px var(--font-sans);
  color: var(--text-muted);
  text-align: center;
}

/* 2. DSA Templates Button */
.templates-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.08);
  color: #e0f2fe;
  font: 600 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
}
.templates-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 14px -3px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}
.templates-btn:active {
  transform: scale(0.97);
}

/* 3. Execution Stats Bar */
.exec-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: #090b11;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-secondary);
  animation: execSlideDown 0.2s ease-out;
}
@keyframes execSlideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.exec-stats-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.exec-stats-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.exec-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font: 700 10px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.exec-badge.success {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.exec-badge.error {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.exec-stat-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
}
.exec-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  font: 500 10px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
}
.exec-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.exec-action-btn:active {
  transform: scale(0.96);
}

/* 4. DSA Templates Modal */
.templates-modal-content {
  max-width: 860px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.badge-mini-blue {
  font: 700 9px var(--font-sans);
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 7px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.templates-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.2);
}
.template-filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font: 600 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.template-filter-btn:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.template-filter-btn.active {
  background: #38bdf8;
  color: #082f49;
  border-color: #38bdf8;
  font-weight: 700;
  box-shadow: 0 0 14px -3px rgba(56, 189, 248, 0.4);
}
.templates-grid {
  padding: 18px 20px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
  gap: 14px;
}
.template-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}
.template-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.5), 0 0 16px -4px rgba(56, 189, 248, 0.15);
  transform: translateY(-2px);
}
.template-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.template-card-title {
  font: 700 14px var(--font-sans);
  color: var(--text-primary);
}
.template-card-badge {
  font: 700 9px var(--font-mono);
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  white-space: nowrap;
}
.template-complexities {
  display: flex;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
}
.complexity-pill {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.complexity-pill strong {
  color: #a78bfa;
}
.template-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  flex: 1;
}
.template-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.template-langs-row {
  display: flex;
  gap: 4px;
}
.template-lang-pill {
  font: 600 10px var(--font-sans);
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
}
.btn-load-template {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  font: 700 11px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-load-template:hover {
  background: #38bdf8;
  color: #082f49;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}
.btn-load-template:active {
  transform: scale(0.96);
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE SYSTEM (PERFECT ALIGNMENT & FULL FEATURE SUPPORT)
   ========================================================================== */

/* Hidden on desktop */
.mobile-view-bar {
  display: none;
}

@media (max-width: 868px) {
  :root {
    --header-h: 48px;
  }

  /* Lock viewport and prevent sideways wobble */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    position: relative !important;
  }

  /* ---------- 1. CLEAN COMPACT HEADER (NO COLLISION, ZERO CLIPPING) ---------- */
  .header {
    height: 52px !important;
    padding: 0 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: sticky !important;
    top: 0 !important;
    overflow: visible !important;
    z-index: 1000 !important;
    box-sizing: border-box !important;
  }

  .header-left {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
  }

  .logo {
    gap: 7px !important;
  }

  .logo-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 7px !important;
  }

  .logo-icon img {
    width: 20px !important;
    height: 20px !important;
  }

  .logo-text {
    font-size: 14px !important;
    letter-spacing: -0.2px !important;
  }

  .logo-badge {
    display: none !important;
  }

  .header-center {
    display: none !important;
  }

  /* Compact Right Action Controls on Mobile & Tablet */
  .header-right {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    min-width: 0 !important;
  }

  /* Hide overflowing arena & jump buttons from top bar on screens <= 868px (accessible inside drawer) */
  .header-arena-group {
    display: none !important;
  }
  .header-scroll-jump-btn {
    display: none !important;
  }
  .runtime-badge {
    display: none !important;
  }

  .install-app-btn {
    padding: 6px !important;
    border-radius: 7px !important;
    min-width: 32px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .install-app-btn span {
    display: none !important;
  }

  #historyBtn {
    padding: 6px !important;
    border-radius: 7px !important;
    min-width: 32px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
  }
  #historyBtn span:not(.history-badge) {
    display: none !important;
  }
  .history-badge {
    font-size: 10px !important;
    padding: 1px 4px !important;
  }

  @media (max-width: 640px) {
    #historyBtn {
      display: none !important; /* Visible inside mobile drawer */
    }
  }

  /* ---------- 2. MOBILE VIEW SWITCHER BAR (NO STICKY OVERLAP) ---------- */
  .mobile-view-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 6px 10px !important;
    background: #090c15 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    position: static !important; /* Static block flow: never overlaps */
    width: 100% !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
  }

  .mobile-view-btn {
    flex: 1 !important;
    max-width: 130px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 6px 10px !important;
    border-radius: 7px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
  }

  .mobile-view-btn svg {
    width: 13px !important;
    height: 13px !important;
  }

  .mobile-view-btn.active {
    background: rgba(56, 189, 248, 0.15) !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.25) !important;
  }

  /* ---------- 3. WORKSPACE CONTAINER ---------- */
  .workspace {
    height: calc(100vh - 48px - 40px) !important;
    min-height: 480px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .workspace-body-split {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  .split-handle-vertical {
    display: none !important;
  }

  .workspace-left-ad {
    display: none !important;
  }

  /* ---------- 4. TWO-TIER NON-WRAPPING SCROLLABLE TOOLBARS ---------- */
  .lang-bar.compact-workspace-bar {
    padding: 4px 8px !important;
    background: #06080e !important;
    border-bottom: 1px solid var(--border) !important;
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    min-height: 44px !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  .lang-bar.compact-workspace-bar::-webkit-scrollbar { display: none !important; }

  .workspace-main-stack {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .workspace-left-editor {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .lang-menu-trigger-btn,
  .features-menu-trigger-btn {
    padding: 4px 8px !important;
    font-size: 11px !important;
    gap: 5px !important;
  }

  /* Tier 2: Editor Actions Row (SINGLE SCROLLABLE ROW - ZERO WRAPPING) */
  .editor-toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 5px 8px !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-bottom: none !important;
  }
  .editor-toolbar::-webkit-scrollbar { display: none !important; }

  .editor-toolbar-left {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
  }

  .toolbar-actions {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
  }

  .file-name { display: none !important; }
  .run-shortcut { display: none !important; }

  /* Run Code Button (Prominent First Item) */
  .run-btn {
    padding: 6px 12px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
  }

  .save-status-indicator {
    padding: 4px 6px !important;
    font-size: 10.5px !important;
    flex-shrink: 0 !important;
    border-radius: 5px !important;
  }

  .practice-programs-btn,
  .templates-btn,
  .translate-btn,
  .cv-lab-btn {
    padding: 5px 9px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border-radius: 6px !important;
    gap: 5px !important;
  }

  .editor-select-sm {
    height: 28px !important;
    font-size: 11px !important;
    padding: 3px 5px !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
  }

  .icon-btn {
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0 !important;
    border-radius: 6px !important;
  }
  .icon-btn svg {
    width: 13px !important;
    height: 13px !important;
  }

  .share-code-btn,
  .save-code-btn,
  .lab-pdf-btn {
    padding: 4px 8px !important;
    font-size: 10.5px !important;
    flex-shrink: 0 !important;
    height: 28px !important;
    border-radius: 6px !important;
  }

  /* ---------- 5. DOWN-SCROLL MOBILE DISPLAY (EDITOR ON TOP, OUTPUT DOWN) ---------- */
  .workspace-left-editor {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 480px !important;
    min-height: 420px !important;
    overflow: hidden !important;
    margin-bottom: 20px !important;
  }
  .workspace-right-column {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 460px !important;
    height: auto !important;
    overflow: hidden !important;
  }

  /* Code Area & Textarea */
  .workspace-left-editor .editor-panel.full-height {
    flex: 1 !important;
    height: auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .code-editor-wrapper {
    flex: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    overflow: hidden !important;
    font-size: 13px !important;
  }

  .editor-gutter {
    min-width: 28px !important;
    padding: 8px 3px !important;
    font-size: 11.5px !important;
  }

  .fallback-editor {
    flex: 1 !important;
    height: 100% !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    padding: 8px !important;
    box-sizing: border-box !important;
  }

  /* Output Terminal on Mobile */
  .workspace-right-column .output-panel {
    flex: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .output-tabs {
    padding: 0 6px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
  }
  .output-tabs::-webkit-scrollbar { display: none !important; }

  .output-tab {
    padding: 6px 10px !important;
    font-size: 11.5px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .output-terminal {
    font-size: 12px !important;
    padding: 8px 10px !important;
    line-height: 1.45 !important;
    flex: 1 !important;
  }

  /* Overlays on Mobile */
  .overlay {
    padding: 8px !important;
  }

  .overlay-content {
    max-height: 94vh !important;
    border-radius: 12px !important;
    width: 100% !important;
  }

  .overlay-header {
    padding: 12px 14px !important;
  }

  .overlay-header h2 {
    font-size: 16px !important;
  }

  .problems-list,
  .templates-list {
    grid-template-columns: 1fr !important;
    padding: 10px !important;
    gap: 8px !important;
  }

  .compiler-init-card {
    padding: 20px 14px !important;
    width: 95% !important;
  }

  /* Secondary Pages on Mobile */
  .legal-container,
  .founder-container,
  .guides-container,
  .about-container,
  .contact-container {
    padding: 0 8px !important;
    margin: 14px auto 30px auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .legal-card,
  .founder-card,
  .guides-card,
  .about-card,
  .contact-card {
    padding: 16px 12px !important;
    border-radius: 12px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  .page-brand-bar {
    padding: 8px 10px !important;
    margin-bottom: 14px !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
  }

  .footer-bottom {
    flex-direction: column !important;
    text-align: center !important;
    gap: 12px !important;
  }
  .footer-legal-inline {
    justify-content: center !important;
  }

  .features-grid,
  .pillars-grid,
  .contact-channels {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .features-grid > *,
  .pillars-grid > *,
  .contact-channels > * {
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 420px) {
  .logo-text {
    font-size: 13px !important;
  }

  .mobile-view-btn {
    padding: 5px 6px !important;
    font-size: 11px !important;
  }

  .run-btn {
    padding: 5px 10px !important;
    font-size: 11px !important;
  }
}

/* ============================================================
   COMPUTER VISION LAB (40 EXPERIMENTS) & VISION CANVAS STYLES
   ============================================================ */

/* CV Lab Toolbar Button */
.cv-lab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(6, 182, 212, 0.35);
  background: rgba(6, 182, 212, 0.08);
  color: #cffafe;
  font: 600 12px var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.cv-lab-btn:hover {
  background: rgba(6, 182, 212, 0.18);
  border-color: rgba(6, 182, 212, 0.55);
  box-shadow: 0 0 14px -3px rgba(6, 182, 212, 0.4);
  transform: translateY(-1px);
}
.cv-lab-btn:active {
  transform: scale(0.97);
}
.cv-count-badge {
  font: 700 9px var(--font-mono);
  background: #06b6d4;
  color: #082f49;
  padding: 1px 5px;
  border-radius: 10px;
  line-height: 1.2;
}

/* Mini Cyan Badge */
.badge-mini-cyan {
  font: 700 10px var(--font-mono);
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(6, 182, 212, 0.12);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* CV Lab Modal */
.cv-modal-content {
  max-width: 980px !important;
  width: 95vw !important;
  max-height: 88vh !important;
  display: flex;
  flex-direction: column;
}

.cv-filter-wrapper {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-surface);
}

.cv-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
.cv-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font: 13px var(--font-sans);
}
.cv-search-box input::placeholder {
  color: var(--text-muted);
}

.cv-categories-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.cv-categories-bar::-webkit-scrollbar {
  height: 4px;
}
.cv-categories-bar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.cv-cat-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font: 600 11.5px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.cv-cat-btn:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.cv-cat-btn.active {
  background: #06b6d4;
  color: #082f49;
  border-color: #06b6d4;
  font-weight: 700;
  box-shadow: 0 0 12px -2px rgba(6, 182, 212, 0.4);
}

/* CV Experiments Grid */
.cv-experiments-grid {
  padding: 16px 20px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
  flex: 1;
}

.cv-exp-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}
.cv-exp-card:hover {
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.5), 0 0 16px -4px rgba(6, 182, 212, 0.15);
  transform: translateY(-2px);
}

.cv-exp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.cv-exp-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cv-exp-num {
  font: 700 11px var(--font-mono);
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(6, 182, 212, 0.3);
}
.cv-exp-title {
  font: 700 13.5px var(--font-sans);
  color: var(--text-primary);
}
.cv-exp-cat {
  font: 600 10px var(--font-sans);
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.cv-exp-aim {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.cv-exp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}
.cv-exp-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.cv-exp-tag {
  font: 500 10px var(--font-mono);
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border-radius: 4px;
}
.cv-exp-load-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #cffafe;
  font: 600 11.5px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.cv-exp-load-btn:hover {
  background: #06b6d4;
  color: #082f49;
  border-color: #06b6d4;
  font-weight: 700;
}

/* Vision Output Tab Badge */
.vision-tab-badge {
  font: 700 9px var(--font-mono);
  background: #06b6d4;
  color: #082f49;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 4px;
}

/* Vision Output Container */
.vision-output {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #0b0f19;
}

.vision-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #0d121f;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-wrap: wrap;
}

.vision-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vision-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.vision-title {
  font: 600 12.5px var(--font-sans);
  color: var(--text-primary);
}
.vision-count-pill {
  font: 700 10px var(--font-mono);
  padding: 2px 7px;
  border-radius: 12px;
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.vision-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vision-upload-label {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 6px;
  color: #cffafe;
  font: 600 11px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
}
.vision-upload-label:hover {
  background: rgba(6, 182, 212, 0.22);
  border-color: rgba(6, 182, 212, 0.5);
}

.vision-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font: 500 11px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
}
.vision-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Empty State */
.vision-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  margin: auto;
  max-width: 440px;
}
.vision-empty-icon {
  margin-bottom: 14px;
  opacity: 0.9;
}
.vision-empty-heading {
  font: 700 15px var(--font-sans);
  color: var(--text-primary);
  margin-bottom: 6px;
}
.vision-empty-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.vision-hint-card {
  background: rgba(6, 182, 212, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  text-align: left;
}
.vision-hint-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.45;
  color: #e0f2fe;
}
.vision-hint-badge {
  font: 700 9.5px var(--font-mono);
  background: rgba(6, 182, 212, 0.2);
  color: #06b6d4;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Vision Images List */
.vision-images-list {
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.vision-image-card {
  background: #0f1626;
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.vision-image-card:hover {
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 16px -4px rgba(6, 182, 212, 0.2);
}

.vision-image-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: #141d33;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.vision-image-card-title {
  font: 700 13px var(--font-sans);
  color: #e0f2fe;
  display: flex;
  align-items: center;
  gap: 8px;
}
.vision-image-meta {
  font: 600 10.5px var(--font-mono);
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.vision-img-wrapper {
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080c14;
}
.vision-rendered-img {
  max-width: 100%;
  max-height: 380px;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  display: block;
}

.vision-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #141d33;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.vision-download-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #cffafe;
  font: 600 11.5px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
}
.vision-download-btn:hover {
  background: #06b6d4;
  color: #082f49;
  border-color: #06b6d4;
  font-weight: 700;
}

@media (max-width: 768px) {
  .cv-modal-content {
    width: 98vw !important;
    max-height: 92vh !important;
  }
  .cv-experiments-grid {
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }
  .vision-output-header {
    padding: 6px 10px;
  }
  .vision-rendered-img {
    max-height: 320px;
  }
}

/* ============================================================
   FULLY DOWN SCROLL PAGE ARCHITECTURE & FIRST VIEW HERO SECTION
   ============================================================ */

html {
  scroll-behavior: smooth !important;
}

/* ── 1. FIRST VIEW HERO SECTION — Professional Developer Platform ── */
.first-view-hero {
  width: 100%;
  background: radial-gradient(1100px 360px at 50% 0%, rgba(37, 99, 235, 0.08), transparent 70%),
              var(--bg-deep);
  border-bottom: 1px solid var(--border);
  padding: 44px 24px 36px;
  box-sizing: border-box;
  position: relative;
}

.hero-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Hero Top Header ── */
.hero-top-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  margin-bottom: 24px;
}

.hero-top-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
}

.hero-top-right,
.hero-right-scroll-card {
  display: none !important;
}

/* ── Top Header Quick Jump Scroll Button ── */
.header-scroll-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  font: 600 12px var(--font-sans);
  text-decoration: none;
  transition: all 0.15s ease;
}

.header-scroll-jump-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.hero-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 99px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  font: 500 12px var(--font-sans);
  color: #93c5fd;
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}

.hero-headline {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: #f8fafc;
  margin-bottom: 12px;
  max-width: 880px;
  letter-spacing: -0.025em;
}

.gradient-text {
  color: #60a5fa;
}

.hero-subtext {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 740px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

/* Hero Action CTAs */
.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.hero-primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 8px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #ffffff;
  font: 600 13.5px var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.hero-primary-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.hero-secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: #e2e8f0;
  font: 500 13.5px var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.hero-secondary-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: #ffffff;
}

/* Technical Credibility Bar */
.hero-stats-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 18px;
  background: rgba(17, 23, 38, 0.6);
  border: 1px solid var(--border);
  border-radius: 99px;
  font: 500 12px var(--font-sans);
  color: var(--text-muted);
  margin-bottom: 26px;
}
.hero-stats-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}
.hero-stats-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border);
}

/* ── Hero Engineering Departments Strip (Stage 5.2) ── */
.hero-departments-strip {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.hero-dept-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.hero-dept-strip-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-dept-strip-icon {
  font-size: 16px;
  line-height: 1;
}

.hero-dept-strip-heading {
  font-size: 13.5px;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.hero-dept-view-all {
  font-size: 12px;
  font-weight: 500;
  color: #38bdf8;
  text-decoration: none;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.hero-dept-view-all:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.hero-dept-pills-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.hero-dept-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
  min-width: 0;
  box-sizing: border-box;
}

.hero-dept-pill:hover,
.hero-dept-pill:focus-visible {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
  outline: none;
}

.hero-dept-pill-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.hero-dept-pill-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.hero-dept-pill-code {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-dept-pill-name {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-dept-pill-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 1080px) {
  .hero-dept-pills-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  .hero-dept-pills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-dept-strip-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .hero-dept-pills-grid {
    grid-template-columns: 1fr;
  }
  .hero-dept-pill {
    padding: 8px 10px;
  }
}

/* ── Dashboard Department Switcher & Guest Notice (Stage 5.2) ── */
.dash-dept-switcher-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}

.dash-dept-select {
  background: #0f172a;
  color: #94a3b8;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.dash-dept-select:hover,
.dash-dept-select:focus-visible {
  border-color: rgba(56, 189, 248, 0.5);
  color: #f1f5f9;
}

.dash-guest-notice {
  display: none;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.2);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #cbd5e1;
  box-sizing: border-box;
}

.dash-guest-notice-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.dash-guest-notice-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.dash-guest-notice-text {
  line-height: 1.45;
}

.dash-guest-notice-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dash-guest-sync-btn {
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.dash-guest-sync-btn:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38bdf8;
  color: #ffffff;
}

.dash-guest-dismiss-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.dash-guest-dismiss-btn:hover {
  color: #ffffff;
}

@media (max-width: 640px) {
  .dash-guest-notice {
    flex-direction: column;
    align-items: flex-start;
  }
  .dash-guest-notice-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* ── Stage 5.3: Learning Journey, First-Visit Guidance & Empty States ── */
.hero-learning-journey {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.hero-journey-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.hero-journey-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-journey-heading {
  font-size: 13.5px;
  font-weight: 600;
  color: #f1f5f9;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.hero-journey-sub {
  font-size: 11.5px;
  color: #94a3b8;
}

.hero-journey-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.hero-journey-step {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
  min-width: 0;
  box-sizing: border-box;
}

.hero-journey-step:hover,
.hero-journey-step:focus-visible {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
  outline: none;
}

.hero-journey-step-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-journey-step-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.hero-journey-step-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
}

.hero-journey-step-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.45;
  flex: 1;
}

.hero-journey-step-action {
  font-size: 11px;
  font-weight: 600;
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

@media (max-width: 992px) {
  .hero-journey-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .hero-journey-grid {
    grid-template-columns: 1fr;
  }
  .hero-journey-step {
    padding: 10px 12px;
  }
}

/* ── Contextual First-Visit Guidance Bars ── */
.first-visit-tip-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.22);
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 14px;
  box-sizing: border-box;
}

.first-visit-tip-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.first-visit-tip-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.first-visit-tip-text {
  line-height: 1.45;
}

.first-visit-tip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.first-visit-tip-link {
  font-size: 11px;
  font-weight: 600;
  color: #38bdf8;
  text-decoration: none;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  transition: all 0.15s ease;
}

.first-visit-tip-link:hover {
  background: rgba(56, 189, 248, 0.22);
  color: #ffffff;
}

.first-visit-tip-dismiss {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.first-visit-tip-dismiss:hover {
  color: #ffffff;
}

@media (max-width: 640px) {
  .first-visit-tip-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .first-visit-tip-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-journey-step,
  .hero-dept-pill,
  .first-visit-tip-bar {
    transition: none !important;
    transform: none !important;
  }
}

/* ── Hero Content Blocks ── */
.hero-block {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.block-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.block-title-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.block-icon-glow {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.block-heading {
  font-size: 15.5px;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.block-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.block-counter-badge {
  font: 600 11px var(--font-mono);
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  letter-spacing: 0.03em;
}

.block-counter-badge.pill-purple {
  background: rgba(37, 99, 235, 0.08);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.25);
}

/* ── Hero Languages Grid ── */
.hero-languages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.hero-lang-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  user-select: none;
}

.hero-lang-card:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.4);
}

.hero-lang-card.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6, 0 8px 20px -4px rgba(59, 130, 246, 0.25);
}

.lang-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.lang-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 11px var(--font-mono);
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.lang-icon-badge.py { color: #60a5fa; background: rgba(59, 130, 246, 0.14); border-color: rgba(59, 130, 246, 0.35); }
.lang-icon-badge.c { color: #38bdf8; background: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.35); }
.lang-icon-badge.cpp { color: #818cf8; background: rgba(129, 140, 248, 0.14); border-color: rgba(129, 140, 248, 0.35); }
.lang-icon-badge.java { color: #fb923c; background: rgba(251, 146, 60, 0.14); border-color: rgba(251, 146, 60, 0.35); }
.lang-icon-badge.html { color: #f87171; background: rgba(248, 113, 113, 0.14); border-color: rgba(248, 113, 113, 0.35); }
.lang-icon-badge.css { color: #38bdf8; background: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.35); }
.lang-icon-badge.js { color: #facc15; background: rgba(250, 204, 21, 0.14); border-color: rgba(250, 204, 21, 0.35); }
.lang-icon-badge.sql { color: #06b6d4; background: rgba(6, 182, 212, 0.14); border-color: rgba(6, 182, 212, 0.35); }

.lang-tag-pill {
  font: 600 10.5px var(--font-mono);
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.wasm-pill { color: #facc15; border-color: rgba(250, 204, 21, 0.25); background: rgba(250, 204, 21, 0.08); }
.c-pill { color: #22d3ee; border-color: rgba(34, 211, 238, 0.25); background: rgba(34, 211, 238, 0.08); }
.cpp-pill { color: #60a5fa; border-color: rgba(96, 165, 250, 0.25); background: rgba(96, 165, 250, 0.08); }
.java-pill { color: #fb923c; border-color: rgba(251, 146, 60, 0.25); background: rgba(251, 146, 60, 0.08); }
.html-pill { color: #f97316; border-color: rgba(249, 115, 22, 0.25); background: rgba(249, 115, 22, 0.08); }
.css-pill { color: #38bdf8; border-color: rgba(56, 189, 248, 0.25); background: rgba(56, 189, 248, 0.08); }
.js-pill { color: #eab308; border-color: rgba(234, 179, 8, 0.25); background: rgba(234, 179, 8, 0.08); }
.sql-pill { color: #22d3ee; border-color: rgba(6, 182, 212, 0.25); background: rgba(6, 182, 212, 0.08); }

.lang-card-body {
  flex: 1 1 auto;
  margin-bottom: 14px;
}

.lang-card-name {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 6px 0;
}

.lang-card-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  min-height: 38px;
}

.lang-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: #38bdf8;
}

.hero-lang-card:hover .lang-card-footer svg {
  transform: translateX(3px);
  transition: transform 0.15s ease;
}

/* ── Hero Subjects Grid ── */
.hero-subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.hero-subject-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.hero-subject-card:hover {
  transform: translateY(-2px);
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 10px 28px -4px rgba(0, 0, 0, 0.5);
}

.subject-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.subject-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-bright);
  border: 1px solid rgba(37, 99, 235, 0.2);
  flex-shrink: 0;
}

.subject-tag-badge {
  font: 600 10.5px var(--font-mono);
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.subject-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px 0;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.subject-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 16px 0;
  flex: 1 1 auto;
  min-height: 44px;
}

.subject-action-row {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  width: 100%;
}

.hero-subject-btn {
  width: 100%;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.hero-subject-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.hero-subject-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Category Accent Styles */
.btn-cobalt { background: rgba(37, 99, 235, 0.14); border-color: rgba(59, 130, 246, 0.35); color: #60a5fa; }
.btn-cobalt:hover { background: #2563eb; color: #fff; border-color: #2563eb; }

.btn-cyan { background: rgba(6, 182, 212, 0.14); border-color: rgba(6, 182, 212, 0.35); color: #22d3ee; }
.btn-cyan:hover { background: #0891b2; color: #fff; border-color: #0891b2; }

.btn-teal { background: rgba(20, 184, 166, 0.14); border-color: rgba(20, 184, 166, 0.35); color: #2dd4bf; }
.btn-teal:hover { background: #0d9488; color: #fff; border-color: #0d9488; }

.btn-amber { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.35); color: #fbbf24; }
.btn-amber:hover { background: #d97706; color: #fff; border-color: #d97706; }

.btn-lime { background: rgba(132, 204, 22, 0.14); border-color: rgba(132, 204, 22, 0.35); color: #a3e635; }
.btn-lime:hover { background: #65a30d; color: #fff; border-color: #65a30d; }

.btn-coral { background: rgba(244, 63, 94, 0.14); border-color: rgba(244, 63, 94, 0.35); color: #fb7185; }
.btn-coral:hover { background: #e11d48; color: #fff; border-color: #e11d48; }

.btn-emerald { background: rgba(16, 185, 129, 0.14); border-color: rgba(16, 185, 129, 0.35); color: #34d399; }
.btn-emerald:hover { background: #059669; color: #fff; border-color: #059669; }

.btn-blue { background: rgba(2, 132, 199, 0.14); border-color: rgba(2, 132, 199, 0.35); color: #38bdf8; }
.btn-blue:hover { background: #0284c7; color: #fff; border-color: #0284c7; }

/* Phase 3 Hub Buttons */
.btn-hub-dsa { background: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.35); color: #38bdf8; }
.btn-hub-dsa:hover { background: #0284c7; color: #fff; border-color: #0284c7; }

.btn-hub-toolkit { background: rgba(16, 185, 129, 0.14); border-color: rgba(16, 185, 129, 0.35); color: #34d399; }
.btn-hub-toolkit:hover { background: #059669; color: #fff; border-color: #059669; }

.btn-hub-arena { background: rgba(251, 191, 36, 0.14); border-color: rgba(251, 191, 36, 0.35); color: #fbbf24; }
.btn-hub-arena:hover { background: #d97706; color: #fff; border-color: #d97706; }

.btn-hub-ai { background: rgba(168, 85, 247, 0.14); border-color: rgba(168, 85, 247, 0.35); color: #c084fc; }
.btn-hub-ai:hover { background: #7c3aed; color: #fff; border-color: #7c3aed; }

.btn-hub-prep { background: rgba(250, 204, 21, 0.14); border-color: rgba(250, 204, 21, 0.35); color: #facc15; }
.btn-hub-prep:hover { background: #ca8a04; color: #fff; border-color: #ca8a04; }

/* ── Hero Scroll Cue Button ── */
.hero-scroll-cue {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.hero-scroll-cue-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
}

.hero-scroll-cue-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

/* Dynamic Interactive Cursor Sheen on Language & Subject Cards */
.hero-lang-card,
.hero-subject-card {
  position: relative;
  overflow: hidden;
}

/* ── Clean Scroll to Workspace Banner ── */
.hero-scroll-showcase {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 28px auto 8px;
  display: flex;
  justify-content: center;
}

.highlighted-scroll-btn {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  text-decoration: none;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
  background: var(--bg-surface);
}

.highlighted-scroll-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.scroll-btn-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-radius: var(--radius-lg);
  gap: 16px;
}

.scroll-btn-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.scroll-indicator-orb {
  position: relative;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.orb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-bright);
}

.scroll-label-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scroll-tagline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.neon-pill {
  font: 600 10px var(--font-mono);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-bright);
  border: 1px solid rgba(37, 99, 235, 0.25);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.scroll-hint-key {
  font: 500 11px var(--font-sans);
  color: var(--text-muted);
}

.scroll-headline-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scroll-main-text {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.scroll-chevron-stack {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-bright);
}

.scroll-btn-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-live-badge {
  font: 500 11px var(--font-sans);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

/* Floating Quick Jump Pill (Stays accessible while scrolling) */
.floating-quick-scroll {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: all 0.2s ease;
}

.floating-quick-scroll.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.floating-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font: 500 12px var(--font-sans);
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: all var(--transition);
}

.floating-quick-btn:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.quick-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-bright);
}

/* Professional focus and interaction states */
.editor-bottom-right .run-btn {
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition), box-shadow var(--transition);
}

.editor-bottom-right .run-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.sub-tool-btn, .header-action-btn, .output-tab, .diff-toggle-btn {
  transition: all var(--transition) !important;
}

.sub-tool-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-hover) !important;
  box-shadow: var(--shadow-sm);
}

.header-action-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-hover) !important;
  box-shadow: var(--shadow-sm);
}

.output-tab:hover {
  color: var(--text-primary) !important;
}

.output-tab.active {
  position: relative;
  color: var(--text-primary) !important;
}

.output-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

/* ── 2. FULLY DOWN SCROLL WORKSPACE LAYOUT (INPUT CODE ON TOP, OUTPUT DOWN) ── */
.workspace {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: auto !important;
  overflow: visible !important;
  padding: 24px 20px 48px !important;
  background: var(--bg-deep) !important;
  box-sizing: border-box !important;
}

.workspace-body-split {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 24px !important;
  width: 100% !important;
  max-width: 1600px !important;
  margin: 0 auto !important;
  height: auto !important;
  min-height: auto !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

/* Preserved Left Ad Bar: Sticky on Desktop alongside Input & Output */
.workspace-left-ad {
  flex: 0 0 240px !important;
  width: 240px !important;
  min-width: 220px !important;
  max-width: 280px !important;
  position: sticky !important;
  top: calc(var(--header-h) + 16px) !important;
  align-self: flex-start !important;
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-surface) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5) !important;
  overflow: hidden !important;
  height: auto !important;
  max-height: calc(100vh - var(--header-h) - 32px) !important;
  z-index: 10 !important;
}

/* Main Workspace Vertical Stack: Code Input on Top, Output Slot Down */
.workspace-main-stack {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 24px !important;
  width: 100% !important;
}

/* Input Code Container */
.workspace-left-editor {
  width: 100% !important;
  height: 540px !important;
  min-height: 480px !important;
  max-width: 100% !important;
  flex: none !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: var(--bg-surface) !important;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7) !important;
  overflow: hidden !important;
}

/* Output Slot Container: Positioned Down to Input Code */
.workspace-right-column {
  width: 100% !important;
  min-height: 520px !important;
  height: auto !important;
  max-width: 100% !important;
  flex: none !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: var(--bg-surface) !important;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7) !important;
  overflow: hidden !important;
}

.workspace-right-column .output-panel {
  min-height: 520px !important;
  height: auto !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
}

.workspace-right-column .console-output {
  min-height: 280px !important;
  max-height: 440px !important;
  overflow-y: auto !important;
}

/* Output Bottom Ad Bar: Preserved and prominent */
.output-bottom-ad {
  margin-top: auto !important;
  flex-shrink: 0 !important;
}

/* Dedicated Side-by-Side Split Constraints for Vision Lab */
body.vision-lab-page .workspace-left-editor,
.workspace-body-split:not(:has(.workspace-main-stack)) > .workspace-left-editor {
  flex: 1 1 50% !important;
  width: calc(50% - 12px) !important;
  max-width: calc(50% - 12px) !important;
  min-width: 0 !important;
}

body.vision-lab-page .workspace-right-column,
.workspace-body-split:not(:has(.workspace-main-stack)) > .workspace-right-column {
  flex: 1 1 50% !important;
  width: calc(50% - 12px) !important;
  max-width: calc(50% - 12px) !important;
  min-width: 0 !important;
}

@media (max-width: 868px) {
  body.vision-lab-page .workspace-left-editor,
  body.vision-lab-page .workspace-right-column,
  .workspace-body-split:not(:has(.workspace-main-stack)) > .workspace-left-editor,
  .workspace-body-split:not(:has(.workspace-main-stack)) > .workspace-right-column {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
  }
}

/* ── Responsive Adaptations for Fully Down Scroll ── */
@media (max-width: 1100px) {
  .workspace-body-split {
    flex-direction: column !important;
  }
  .workspace-left-ad {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
  }
}

@media (max-width: 868px) {
  .first-view-hero {
    padding: 28px 12px 24px !important;
  }
  .hero-headline {
    font-size: 24px !important;
  }
  .hero-block {
    padding: 16px 14px !important;
    margin-bottom: 16px !important;
  }
  .hero-languages-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .hero-subjects-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .workspace {
    padding: 12px 10px 32px !important;
  }
  .workspace-left-editor {
    height: 480px !important;
  }
  .workspace-right-column {
    min-height: 460px !important;
  }
  .workspace-right-column .console-output {
    min-height: 220px !important;
    max-height: 360px !important;
  }
}

@media (max-width: 420px) {
  .hero-languages-grid {
    grid-template-columns: 1fr !important;
  }
  .hero-block {
    padding: 12px 10px !important;
  }
}

@media (max-width: 360px) {
  .mobile-view-bar {
    padding: 4px 4px !important;
    gap: 3px !important;
  }
  .mobile-view-btn {
    padding: 5px 3px !important;
    gap: 3px !important;
    font-size: 10px !important;
    min-width: 0 !important;
  }
  .mobile-view-btn svg {
    width: 12px !important;
    height: 12px !important;
    flex-shrink: 0 !important;
  }
  .mobile-view-btn span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .workspace {
    padding: 8px 6px 24px !important;
  }
}

/* ============================================================
   INNER SCROLL OPTIONS & CONTROLS FOR INPUT AND OUTPUT SLOTS
   ============================================================ */

/* ── 1. HIGH-VISIBILITY CUSTOM INNER SCROLLBARS ── */
.fallback-editor {
  overflow-y: scroll !important;
  overflow-x: auto !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.45) rgba(8, 10, 18, 0.7);
  scroll-behavior: smooth;
}

.fallback-editor::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.fallback-editor::-webkit-scrollbar-track {
  background: rgba(8, 10, 18, 0.85);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.fallback-editor::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.35);
  border-radius: 99px;
  border: 2px solid rgba(8, 10, 18, 0.85);
  transition: all 0.2s ease;
}

.fallback-editor::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.85);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

/* Console Output Inner Scrollbar */
.console-output {
  overflow-y: scroll !important;
  overflow-x: auto !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 255, 61, 0.45) rgba(8, 10, 18, 0.7);
  scroll-behavior: smooth;
}

.console-output::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.console-output::-webkit-scrollbar-track {
  background: rgba(8, 10, 18, 0.85);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.console-output::-webkit-scrollbar-thumb {
  background: rgba(200, 255, 61, 0.35);
  border-radius: 99px;
  border: 2px solid rgba(8, 10, 18, 0.85);
  transition: all 0.2s ease;
}

.console-output::-webkit-scrollbar-thumb:hover {
  background: rgba(200, 255, 61, 0.85);
  box-shadow: 0 0 10px rgba(200, 255, 61, 0.6);
}

/* ── 2. INNER SCROLL CONTROLS (BUTTONS, LABELS, TOGGLES) ── */
.inner-scroll-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
}

.inner-scroll-label {
  font: 700 10.5px var(--font-mono);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.inner-scroll-label svg {
  color: #38bdf8;
}

.output-scroll-controls .inner-scroll-label svg {
  color: #c8ff3d;
}

.inner-scroll-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 5px;
  font: 600 11px var(--font-sans);
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.15s ease;
}

.inner-scroll-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.output-scroll-controls .inner-scroll-btn:hover {
  background: rgba(200, 255, 61, 0.15);
  color: #c8ff3d;
  border-color: rgba(200, 255, 61, 0.4);
  box-shadow: 0 0 8px rgba(200, 255, 61, 0.2);
}

.inner-scroll-btn.active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.25);
}

.auto-scroll-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.height-toggle-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (max-width: 480px) {
  .inner-scroll-controls {
    padding: 2px 4px !important;
    gap: 3px !important;
  }
  .inner-scroll-label {
    display: none !important;
  }
  .inner-scroll-btn {
    padding: 2px 5px !important;
    font-size: 10px !important;
  }
}

@media (max-width: 360px) {
  .mobile-view-bar {
    padding: 4px 6px !important;
    gap: 4px !important;
  }
  .mobile-view-btn {
    padding: 5px 6px !important;
    font-size: 11px !important;
    gap: 4px !important;
    min-width: 0 !important;
  }
  .mobile-view-btn svg {
    width: 12px !important;
    height: 12px !important;
  }
}

/* ── 3. EXPANDED INNER HEIGHT VIEWS ── */
.workspace-left-editor.is-expanded {
  height: 740px !important;
  transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.workspace-left-editor {
  transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.workspace-right-column.is-expanded {
  min-height: 680px !important;
  transition: min-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.workspace-right-column.is-expanded .console-output {
  min-height: 480px !important;
  max-height: 640px !important;
}

.workspace-right-column {
  transition: min-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   VAB-CODE GAMIFIED ARENA & USER DASHBOARD STYLES
   ========================================================================== */

/* ── 1. Header Arena Controls & Auth Pill ── */
.header-arena-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-arena-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font: 500 12.5px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.header-arena-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.arena-icon {
  display: inline-flex;
  align-items: center;
}

.header-auth-wrapper {
  display: inline-flex;
  align-items: center;
}

.header-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #ffffff;
  font: 600 12.5px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.header-login-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.header-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}

.header-profile-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.profile-streak-chip {
  font: 800 10px var(--font-mono);
  background: rgba(245, 158, 11, 0.2);
  color: #fde047;
  padding: 2px 6px;
  border-radius: 99px;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.profile-avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  color: #fff;
  font: 700 11px var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-text-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.profile-name-text {
  font: 700 11.5px var(--font-sans);
  color: #f1f5f9;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-rank-text {
  font: 600 9.5px var(--font-mono);
  color: #38bdf8;
}

/* ── 2. Arena Modals Backdrop & Frame ── */
.arena-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(5, 7, 12, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.arena-modal-card {
  width: 100%;
  max-width: 620px;
  background: rgba(13, 16, 26, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.85), 0 0 40px rgba(56, 189, 248, 0.15);
  overflow: hidden;
  animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.arena-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.arena-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.15s;
}

.arena-modal-close:hover {
  color: #fff;
}

.arena-modal-body {
  padding: 24px;
}

/* ── 3. User Dashboard Modal ── */
.dash-user-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dash-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
}

.dash-user-titles {
  display: flex;
  flex-direction: column;
}

.dash-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-name {
  font: 800 18px var(--font-sans);
  color: #f8fafc;
  margin: 0;
}

.dash-founder-badge {
  font: 700 10px var(--font-mono);
  background: linear-gradient(90deg, rgba(234, 179, 8, 0.25), rgba(245, 158, 11, 0.3));
  border: 1px solid #facc15;
  color: #fef08a;
  padding: 2px 7px;
  border-radius: 99px;
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
}

.dash-email {
  font-size: 12px;
  color: #94a3b8;
}

.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.dash-stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.dash-stat-box.box-lime { border-color: rgba(200, 255, 61, 0.3); background: rgba(200, 255, 61, 0.04); }
.dash-stat-box.box-cyan { border-color: rgba(56, 189, 248, 0.3); background: rgba(56, 189, 248, 0.04); }
.dash-stat-box.box-purple { border-color: rgba(168, 85, 247, 0.3); background: rgba(168, 85, 247, 0.04); }
.dash-stat-box.box-amber { border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.04); }

.dash-stat-label {
  font: 700 10.5px var(--font-mono);
  color: #94a3b8;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.dash-stat-value {
  font: 800 22px var(--font-sans);
  color: #fff;
  margin-bottom: 2px;
}

.dash-stat-box.box-lime .dash-stat-value { color: #c8ff3d; text-shadow: 0 0 12px rgba(200, 255, 61, 0.35); }
.dash-stat-box.box-cyan .dash-stat-value { color: #38bdf8; text-shadow: 0 0 12px rgba(56, 189, 248, 0.35); }
.dash-stat-box.box-purple .dash-stat-value { color: #c084fc; text-shadow: 0 0 12px rgba(168, 85, 247, 0.35); }
.dash-stat-box.box-amber .dash-stat-value { color: #fde047; text-shadow: 0 0 12px rgba(245, 158, 11, 0.35); }

.dash-stat-sub {
  font-size: 11px;
  color: #64748b;
}

.dash-actions-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.dash-action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  border: 1px solid transparent;
}

.dash-action-btn .btn-emoji {
  font-size: 24px;
}

.dash-action-btn.primary-lime-btn {
  background: linear-gradient(135deg, rgba(200, 255, 61, 0.15), rgba(200, 255, 61, 0.05));
  border-color: rgba(200, 255, 61, 0.4);
}
.dash-action-btn.primary-lime-btn:hover {
  background: rgba(200, 255, 61, 0.25);
  box-shadow: 0 0 20px rgba(200, 255, 61, 0.3);
  transform: translateY(-2px);
}

.dash-action-btn.secondary-cyan-btn {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(56, 189, 248, 0.05));
  border-color: rgba(56, 189, 248, 0.4);
}
.dash-action-btn.secondary-cyan-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
}

.dash-btn-text {
  display: flex;
  flex-direction: column;
}

.dash-btn-title {
  font: 700 14px var(--font-sans);
  color: #fff;
}

.dash-btn-desc {
  font-size: 11.5px;
  color: #94a3b8;
}

.dash-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-sync-badge {
  font: 600 11px var(--font-mono);
  color: #4ade80;
}

.dash-logout-btn {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 4px 10px;
  border-radius: 6px;
  font: 600 11px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}

.dash-logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fff;
}

/* ── 4. Daily 10 MCQ Challenge Arena ── */
.quiz-card {
  max-width: 680px;
}

.quiz-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quiz-badge {
  font: 800 10px var(--font-mono);
  color: #c8ff3d;
  letter-spacing: 0.06em;
}

.quiz-title {
  font: 800 18px var(--font-sans);
  color: #fff;
  margin: 0;
}

.quiz-body {
  padding: 24px;
}

.quiz-progress-track {
  margin-bottom: 20px;
}

.quiz-prog-row {
  display: flex;
  justify-content: space-between;
  font: 700 11.5px var(--font-mono);
  margin-bottom: 8px;
}

.quiz-prog-text { color: #94a3b8; }
.quiz-prog-lang { color: #38bdf8; background: rgba(56, 189, 248, 0.15); padding: 2px 7px; border-radius: 6px; }

.quiz-meter {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.quiz-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #c8ff3d);
  transition: width 0.3s ease;
}

.quiz-question-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.quiz-question-text {
  font: 600 15px var(--font-sans);
  color: #f1f5f9;
  line-height: 1.5;
  margin: 0;
}

.quiz-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.quiz-opt-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.quiz-opt-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateX(4px);
}

.opt-letter {
  font: 800 11px var(--font-mono);
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.opt-text {
  font: 500 13px var(--font-sans);
}

.quiz-opt-btn.correct {
  background: rgba(34, 197, 94, 0.2) !important;
  border-color: #22c55e !important;
  color: #86efac !important;
}

.quiz-opt-btn.wrong {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
}

.quiz-explanation-drawer {
  background: rgba(36, 87, 255, 0.1);
  border: 1px solid rgba(36, 87, 255, 0.35);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
  animation: fadeIn 0.2s ease;
}

.exp-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 700 12px var(--font-mono);
  color: #93c5fd;
  margin-bottom: 6px;
}

.exp-content {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.45;
  margin: 0;
}

.quiz-nav-row {
  display: flex;
  justify-content: flex-end;
}

.quiz-next-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 99px;
  background: linear-gradient(90deg, #38bdf8, #c8ff3d);
  color: #080a14;
  font: 700 13px var(--font-sans);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(200, 255, 61, 0.4);
  transition: all 0.2s;
}

.quiz-next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.6);
}

.quiz-finished-body {
  padding: 40px 24px;
  text-align: center;
}

.quiz-trophy-anim {
  font-size: 54px;
  margin-bottom: 14px;
  animation: bounceTrophy 1.5s infinite;
}

@keyframes bounceTrophy {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.quiz-fin-headline {
  font: 800 22px var(--font-sans);
  color: #fff;
  margin-bottom: 8px;
}

.quiz-fin-sub {
  font-size: 13px;
  color: #94a3b8;
  max-width: 440px;
  margin: 0 auto 20px;
}

.quiz-score-pill {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 28px;
  border-radius: 14px;
  background: rgba(200, 255, 61, 0.1);
  border: 1px solid rgba(200, 255, 61, 0.4);
  margin-bottom: 24px;
}

.score-label {
  font: 700 10.5px var(--font-mono);
  color: #94a3b8;
}

.score-points {
  font: 800 24px var(--font-mono);
  color: #c8ff3d;
}

.quiz-fin-btn {
  padding: 12px 28px;
  border-radius: 99px;
  font: 700 13px var(--font-sans);
  cursor: pointer;
  background: linear-gradient(90deg, #38bdf8, #c8ff3d);
  color: #081204;
  border: none;
}

/* ── 5. Real-Time Top 10 Leaderboard & Sticky Rank ── */
.leaderboard-card {
  max-width: 650px;
}

.lb-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lb-trophy-badge {
  font: 800 10.5px var(--font-mono);
  color: #facc15;
  letter-spacing: 0.08em;
}

.lb-main-title {
  font: 800 19px var(--font-sans);
  color: #fff;
  margin: 0;
}

.lb-sub-desc {
  font-size: 11.5px;
  color: #94a3b8;
}

.lb-modal-body {
  padding: 16px 20px 20px;
}

.leaderboard-list-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 14px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.15s ease;
}

.leaderboard-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.leaderboard-item.gold-rank {
  background: rgba(234, 179, 8, 0.1);
  border-color: rgba(234, 179, 8, 0.4);
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.15);
}

.leaderboard-item.silver-rank {
  background: rgba(203, 213, 225, 0.08);
  border-color: rgba(203, 213, 225, 0.35);
}

.leaderboard-item.bronze-rank {
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.35);
}

.lb-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lb-rank-badge {
  font: 800 13px var(--font-mono);
  min-width: 28px;
  text-align: center;
  color: #94a3b8;
}

.lb-rank-badge.gold-rank { color: #facc15; font-size: 18px; }
.lb-rank-badge.silver-rank { color: #cbd5e1; font-size: 18px; }
.lb-rank-badge.bronze-rank { color: #fdba74; font-size: 18px; }

.lb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 12px var(--font-sans);
  color: #fff;
}

.lb-user-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lb-name {
  font: 600 13px var(--font-sans);
  color: #f1f5f9;
}

.lb-founder-badge {
  font: 700 9px var(--font-mono);
  color: #fef08a;
  background: rgba(234, 179, 8, 0.25);
  border: 1px solid #facc15;
  padding: 1px 5px;
  border-radius: 4px;
}

.lb-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-streak-badge {
  font: 700 11px var(--font-mono);
  color: #fde047;
  background: rgba(245, 158, 11, 0.15);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.lb-xp-badge {
  font: 800 12px var(--font-mono);
  color: #c8ff3d;
  background: rgba(200, 255, 61, 0.12);
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid rgba(200, 255, 61, 0.3);
}

/* ── 6. Sticky "YOUR PLACE" Row (Below Top 10) ── */
.leaderboard-my-rank-wrapper {
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

.my-rank-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.15), rgba(200, 255, 61, 0.15));
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.2);
}

.my-rank-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.my-rank-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #38bdf8;
  color: #04243b;
  padding: 4px 10px;
  border-radius: 8px;
  line-height: 1.1;
}

.my-rank-label {
  font: 800 8px var(--font-mono);
  letter-spacing: 0.05em;
}

.my-rank-num {
  font: 800 15px var(--font-mono);
}

.my-rank-name-box {
  display: flex;
  flex-direction: column;
}

.my-rank-name {
  font: 700 13.5px var(--font-sans);
  color: #fff;
}

.my-rank-hint {
  font-size: 11px;
  color: #94a3b8;
}

.my-rank-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-xp-badge.my-xp {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
}

/* ── 5. Auth Gate Modal (Log In to Play / Log In to See) ── */
.auth-gate-card {
  max-width: 480px;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.12), rgba(13, 16, 26, 0.98) 70%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.9), 0 0 50px rgba(56, 189, 248, 0.18);
}

.auth-gate-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  justify-content: space-between;
}

.auth-gate-badge {
  font: 800 11px var(--font-mono);
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(200, 255, 61, 0.12);
  border: 1px solid rgba(200, 255, 61, 0.35);
  color: #c8ff3d;
}

.auth-gate-body {
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-gate-icon-orb {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(200, 255, 61, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 32px;
}

.auth-gate-title {
  font: 800 24px var(--font-sans);
  color: #f8fafc;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.auth-gate-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: #94a3b8;
  margin: 0 0 20px;
  max-width: 380px;
}

.auth-gate-features {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
  text-align: left;
}

.auth-gate-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
}

.gate-feat-icon {
  font-size: 18px;
}

.gate-feat-text {
  display: flex;
  flex-direction: column;
}

.gate-feat-text strong {
  font: 700 12.5px var(--font-sans);
  color: #f1f5f9;
}

.gate-feat-text span {
  font-size: 11px;
  color: #64748b;
}

.auth-gate-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  border: none;
  font: 700 14px var(--font-sans);
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(255, 255, 255, 0.18), 0 0 24px rgba(56, 189, 248, 0.25);
  transition: all 0.2s ease;
}

.auth-gate-google-btn:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 255, 255, 0.28), 0 0 35px rgba(56, 189, 248, 0.45);
}

.google-logo-svg {
  width: 18px;
  height: 18px;
}

.auth-gate-free-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

.auth-gate-free-note p {
  font-size: 11.5px;
  color: #64748b;
  margin: 0 0 6px;
}

.auth-gate-dismiss-btn {
  background: transparent;
  border: none;
  color: #38bdf8;
  font: 600 12px var(--font-mono);
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
}

.auth-gate-dismiss-btn:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* ── 6. Official AdSense Slots (Clean & Policy-Compliant) ── */
.workspace-left-ad {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

#leftAdSenseContainer {
  min-height: 580px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-bottom-ad-wrapper,
.pre-footer-ad-wrapper {
  width: 100%;
  max-width: 1380px;
  margin: 18px auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.ad-slot-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
}

.ad-slot-badge {
  font: 700 9px var(--font-mono);
  letter-spacing: 0.12em;
  color: #64748b;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: 4px;
}

.ad-slot-container,
.ad-slot-container-output,
.ad-slot-container-horizontal {
  min-height: 90px;
  background: rgba(13, 16, 26, 0.5);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1100px) {
  .workspace-left-ad {
    width: 220px;
  }
}

@media (max-width: 900px) {
  .workspace-left-ad {
    display: none;
  }
}

/* ============================================================
   EMBEDDED SYSTEMS (LPC-1768) HARDWARE KIT STYLES
   ============================================================ */

/* Navbar Button */
.embedded-kit-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.embedded-kit-btn:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
  color: #fff;
}
.embedded-kit-btn .emb-badge {
  background: #10b981;
  color: #022c22;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Output Tab Live Pulse */
.emb-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 5px;
  background: #64748b;
  display: inline-block;
  margin-left: 4px;
  transition: all 0.2s;
}
.emb-live-dot.active {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: embPulse 1.2s infinite alternate;
}
@keyframes embPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.3); opacity: 1; }
}

/* Embedded Output Panel */
.embedded-output {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  background: #090d16;
  color: #e2e8f0;
  padding: 14px;
  gap: 14px;
}

/* Hardware Toolbar */
.emb-hw-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.emb-hw-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.emb-hw-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
}
.emb-status-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.emb-status-pill.ready { background: rgba(100, 116, 139, 0.2); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }
.emb-status-pill.running { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); animation: embPulse 1s infinite alternate; }
.emb-status-pill.paused { background: rgba(245, 158, 11, 0.2); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.4); }

.emb-conn-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}
.emb-conn-pill.virtual { background: rgba(56, 189, 248, 0.12); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.25); }
.emb-conn-pill.connected { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.4); font-weight: 700; }

.emb-hw-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.emb-ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.emb-ctrl-btn:hover {
  background: #334155;
  border-color: rgba(255, 255, 255, 0.2);
}
.emb-ctrl-btn.primary {
  background: #10b981;
  color: #022c22;
  border-color: #10b981;
  font-weight: 700;
}
.emb-ctrl-btn.primary:hover {
  background: #059669;
}
.emb-ctrl-btn.active {
  background: #f59e0b;
  color: #451a03;
}
.emb-ctrl-btn.usb-btn {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}
.emb-ctrl-btn.usb-btn:hover {
  background: #0284c7;
  color: #fff;
}
.emb-speed-dropdown {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 6px;
  outline: none;
}

/* ── Realistic LPC-1768 PCB Board Container ── */
.lpc-pcb-board {
  background: radial-gradient(circle at 50% 30%, #0d2818 0%, #06190f 70%, #030d07 100%);
  border: 2px solid #165b33;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 0 25px rgba(22, 91, 51, 0.25);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* PCB Corner Mounting Holes */
.lpc-pcb-board::before,
.lpc-pcb-board::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, #020617 35%, #ca8a04 40%, #eab308 65%, #713f12 100%);
  border: 1px solid #ca8a04;
  z-index: 2;
}
.lpc-pcb-board::before { top: 10px; left: 10px; }
.lpc-pcb-board::after { top: 10px; right: 10px; }

/* PCB Silkscreen Header */
.pcb-silkscreen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
  padding-bottom: 8px;
}
.pcb-model-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #e2e8f0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.pcb-power-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  font-family: var(--font-mono);
}
.pcb-power-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

/* ── 7-Segment Display Module ── */
.seven-seg-module {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.seven-seg-module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.module-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: #fca5a5;
  letter-spacing: 0.06em;
}
.module-pins-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #94a3b8;
}

/* 4-Digit Display Bezel */
.four-digit-bezel {
  display: flex;
  justify-content: center;
  gap: 14px;
  background: #000;
  padding: 16px 20px;
  border-radius: 8px;
  border: 2px solid #262626;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.9);
}

.digit-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.digit-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
}

/* Single 7-Segment Display SVG */
.seven-seg-svg {
  width: 58px;
  height: 88px;
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.8));
}
.seven-seg-svg polygon,
.seven-seg-svg circle {
  fill: #220808; /* inactive segment dark crimson */
  transition: fill 0.08s ease, filter 0.08s ease;
}
.seven-seg-svg polygon.on,
.seven-seg-svg circle.on {
  fill: #ff2222 !important; /* intensely lit neon red */
  filter: drop-shadow(0 0 5px #ff1e1e) drop-shadow(0 0 8px #ff4d4d);
}

/* ── 8 Discrete LEDs Module (P0.4 to P0.11) ── */
.discrete-leds-module {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.discrete-leds-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.discrete-leds-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  background: #020617;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #1e293b;
}
.led-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.led-pin-name {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
}
.led-pin-num {
  font-family: var(--font-mono);
  font-size: 8px;
  color: #64748b;
}

.hardware-led-lens {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #15803d 0%, #052e16 80%);
  border: 2px solid #475569;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
  transition: all 0.12s ease;
}
.hardware-led-lens.lit {
  background: radial-gradient(circle at 35% 35%, #86efac 0%, #22c55e 60%, #15803d 100%);
  border-color: #86efac;
  box-shadow: 0 0 12px #22c55e, 0 0 20px rgba(34, 197, 94, 0.7);
}

/* ── Buzzer & MCU Chip Row ── */
.mcu-peripherals-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 768px) {
  .mcu-peripherals-row { grid-template-columns: 1fr; }
}

.mcu-chip-box {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.mcu-ic-package {
  width: 52px;
  height: 52px;
  background: #111827;
  border: 2px solid #374151;
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.mcu-ic-package::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4b5563;
}
.mcu-label-nxp {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  color: #9ca3af;
  text-align: center;
  line-height: 1.1;
}
.mcu-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mcu-name {
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
}
.mcu-sub {
  font-size: 10.5px;
  color: #94a3b8;
  font-family: var(--font-mono);
}

/* Buzzer Box */
.buzzer-box {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.buzzer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.buzzer-cylinder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #334155 0%, #0f172a 80%);
  border: 2px solid #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.buzzer-cylinder::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #000;
}
.buzzer-cylinder.beeping {
  border-color: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.8);
  animation: buzzerRing 0.15s infinite alternate;
}
@keyframes buzzerRing {
  0% { transform: scale(0.95); }
  100% { transform: scale(1.05); }
}

/* ── Live Register Bar ── */
.lpc-registers-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 600px) {
  .lpc-registers-bar { grid-template-columns: repeat(2, 1fr); }
}
.reg-card {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.reg-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: #94a3b8;
  font-weight: 600;
}
.reg-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.05em;
}

/* ── Telemetry Log Box ── */
.emb-telemetry-term {
  background: #020408;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #a3e635;
  height: 90px;
  overflow-y: auto;
  line-height: 1.4;
}
.emb-telemetry-term .time {
  color: #64748b;
}

/* ── Embedded Lab Modal ── */
.emb-modal-content {
  max-width: 1040px !important;
  width: 95vw !important;
  max-height: 90vh !important;
  display: flex;
  flex-direction: column;
}
.emb-exp-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}
.emb-exp-card:hover {
  border-color: #10b981;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
  transform: translateY(-2px);
}
.emb-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.emb-card-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.emb-card-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 7px;
  border-radius: 6px;
}
.emb-card-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}
.emb-card-badge.badge-gold {
  background: rgba(234, 179, 8, 0.18);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
  font-weight: 700;
}
.emb-cat-tag {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}
.emb-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.3;
}
.emb-card-aim {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.45;
}
.emb-pin-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 2px solid #10b981;
}
.emb-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}
.emb-action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.emb-action-btn.primary {
  background: #10b981;
  color: #022c22;
  font-weight: 700;
}
.emb-action-btn.primary:hover {
  background: #059669;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
.emb-action-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}
.emb-action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ============================================================
   VAB-CODE (vab-code) — Phase 2: Visualizers, Quizzes & Dashboard
   ============================================================ */

.vis-wrapper {
  background: #080a12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
}
.vis-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.vis-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #94a3b8;
}
.vis-select, .vis-input {
  background: #0f172a;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  outline: none;
}
.vis-select:focus, .vis-input:focus {
  border-color: #38bdf8;
}
.vis-slider {
  accent-color: #38bdf8;
  cursor: pointer;
  height: 6px;
}
.vis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.vis-wrapper svg {
  max-width: 100% !important;
  height: auto;
}
#bstCanvasContainer {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.vis-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.vis-btn.primary {
  background: #0284c7;
  color: #ffffff;
}
.vis-btn.primary:hover {
  background: #0369a1;
}
.vis-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}
.vis-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.vis-telemetry {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 0;
  font-size: 12.5px;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Sorting Visualizer Stage */
.sort-bars-stage {
  height: 220px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 20px 10px 10px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  margin-top: 14px;
}
.sort-bar {
  flex: 1;
  background: #38bdf8;
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: height 0.1s ease, background-color 0.15s ease;
  min-width: 14px;
}
.sort-bar.comparing {
  background: #fbbf24 !important;
}
.sort-bar.swapping {
  background: #ef4444 !important;
}
.sort-bar.sorted {
  background: #4ade80 !important;
}
.bar-label {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-family: var(--font-mono);
  color: #94a3b8;
}

/* Data Structure Track */
.ds-stage {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  margin-top: 14px;
  padding: 16px;
}
.ds-stack-track {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  width: 100%;
  max-width: 280px;
  border-bottom: 3px solid #38bdf8;
  border-left: 2px solid rgba(56, 189, 248, 0.3);
  border-right: 2px solid rgba(56, 189, 248, 0.3);
  padding: 10px;
}
.ds-queue-track {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  border-top: 2px dashed rgba(255, 255, 255, 0.1);
  border-bottom: 2px dashed rgba(255, 255, 255, 0.1);
  padding: 14px 10px;
}
.ds-item-box {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 10px 16px;
  color: #f1f5f9;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  animation: dsPopIn 0.2s ease;
}
.ds-item-box.active-edge {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}
@keyframes dsPopIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
.ds-tag-badge {
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: #64748b;
}

/* CPU Gantt Chart */
.cpu-stage {
  margin-top: 14px;
}
.gantt-title {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
}
.gantt-chart-bar {
  display: flex;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}
.gantt-block {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #0f172a;
  font-size: 13px;
  position: relative;
  border-right: 1px solid rgba(0, 0, 0, 0.3);
}
.gantt-time-label {
  position: absolute;
  bottom: 2px;
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: rgba(0, 0, 0, 0.7);
}
.gantt-time-label.start { left: 4px; }
.gantt-time-label.end { right: 4px; }

/* Subnet Card */
.subnet-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.subnet-label {
  font-size: 11.5px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.subnet-val {
  font-size: 14px;
  font-weight: 600;
}

/* DFA Simulator Nodes */
.dfa-nodes-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 30px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  margin-top: 14px;
}
.dfa-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #64748b;
  transition: all 0.2s ease;
}
.node-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #cbd5e1;
  font-size: 15px;
  font-family: var(--font-mono);
  transition: all 0.2s ease;
}
.node-circle.double {
  border-style: double;
  border-width: 4px;
}
.dfa-node.active .node-circle {
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
  transform: scale(1.08);
}
.dfa-node.accept-node.active .node-circle {
  border-color: #4ade80;
  color: #4ade80;
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.4);
}
.dfa-arrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #475569;
}

/* Interactive Quiz Modal Tab & Components */
.quiz-box {
  background: #080a12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  margin-top: 14px;
}
.quiz-q-block {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.quiz-q-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 12px;
}
.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quiz-opt-btn {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 14px;
  color: #cbd5e1;
  text-align: left;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s ease;
}
.quiz-opt-btn:hover:not(:disabled) {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.05);
}
.quiz-opt-btn.correct {
  background: rgba(34, 197, 94, 0.15) !important;
  border-color: #22c55e !important;
  color: #4ade80 !important;
  font-weight: 600;
}
.quiz-opt-btn.incorrect {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: #ef4444 !important;
  color: #f87171 !important;
}
.quiz-explanation {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid #38bdf8;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: #94a3b8;
  animation: dsPopIn 0.2s ease;
}

/* Learning Progress Strip on Labs Page */
.progress-dashboard-strip {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.progress-stat-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stat-circle-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.stat-info-text {
  display: flex;
  flex-direction: column;
}
.stat-val {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
}
.stat-lbl {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bookmark-btn {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bookmark-btn:hover {
  color: #fbbf24;
}
.bookmark-btn.active {
  color: #fbbf24;
}

/* ==========================================================================
   MCQ GAME PROMOTIONAL POPUP MODAL
   ========================================================================== */
.mcq-promo-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(8, 11, 17, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: promoFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mcq-promo-card {
  position: relative;
  width: 100%;
  max-width: 410px;
  background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.12), rgba(17, 23, 38, 0.98) 72%);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 20px;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.12);
  animation: promoPopIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.mcq-promo-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 22px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.mcq-promo-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.mcq-promo-orb {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px auto;
  border-radius: 16px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.mcq-promo-badge {
  display: inline-block;
  font: 700 11px var(--font-mono);
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.mcq-promo-title {
  font: 800 20px/1.3 var(--font-sans);
  color: #f8fafc;
  margin: 0 0 8px 0;
  letter-spacing: -0.015em;
}

.mcq-promo-text {
  font: 400 13.5px/1.55 var(--font-sans);
  color: #94a3b8;
  margin: 0 0 22px 0;
}

.mcq-promo-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mcq-promo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 99px;
  font: 700 13px var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.mcq-promo-btn.primary {
  background: linear-gradient(135deg, #2563eb, #38bdf8); /* #c8ff3d compat */
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.mcq-promo-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
}

.mcq-promo-btn.secondary {
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.mcq-promo-btn.secondary:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

@keyframes promoFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes promoPopIn {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .mcq-promo-backdrop,
  .mcq-promo-card {
    animation: none !important;
  }
}

@media (max-width: 480px) {
  .mcq-promo-card {
    padding: 24px 18px 20px;
    max-width: 340px;
  }
  .mcq-promo-title {
    font-size: 19px;
  }
  .mcq-promo-text {
    font-size: 13px;
  }
  .mcq-promo-actions {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }
  .mcq-promo-btn {
    width: 100%;
  }
}

/* ========================================================
   VAB-CODE PHASE 4 — STUDENT ENGAGEMENT & REWARDS STYLING
   Weekly Challenges, Leaderboards, Badges & Certificates
   ======================================================== */

/* Challenge Card & Filters */
.dash-challenges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.challenge-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.challenge-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 0 15px -3px rgba(56, 189, 248, 0.1);
}

.challenge-card.completed {
  border-color: rgba(16, 185, 129, 0.4);
}

.challenge-card.claimed {
  border-color: rgba(100, 116, 139, 0.3);
  background: rgba(15, 23, 42, 0.4);
}

.challenge-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.challenge-dept-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.challenge-diff-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}
.challenge-diff-pill.beginner { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.challenge-diff-pill.intermediate { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.challenge-diff-pill.advanced { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

.challenge-xp-badge {
  font-size: 11.5px;
  font-weight: 800;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.12);
  padding: 3px 8px;
  border-radius: 8px;
}

.challenge-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.35;
  margin-bottom: 8px;
}

.challenge-card-desc {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 14px;
}

.challenge-notice-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11.5px;
  color: #fde68a;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.challenge-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

.challenge-claim-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  border: none;
}
.challenge-claim-btn.ready {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.challenge-claim-btn.ready:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}
.challenge-claim-btn.claimed {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  cursor: default;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.challenge-claim-btn.incomplete {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  text-decoration: none;
}
.challenge-claim-btn.incomplete:hover {
  background: rgba(56, 189, 248, 0.2);
}

/* Leaderboards Styling */
.dash-lb-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.lb-timeframe-toggles {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.lb-tf-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lb-tf-btn.active {
  background: #38bdf8;
  color: #0f172a;
  font-weight: 700;
}

.lb-dept-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lb-dept-btn {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lb-dept-btn:hover {
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.2);
}
.lb-dept-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

.lb-tiebreaker-box {
  background: rgba(56, 189, 248, 0.05);
  border: 1px dashed rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: #94a3b8;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 640px) {
  .lb-podium { grid-template-columns: 1fr; }
}

.lb-podium-card {
  background: rgba(15, 23, 42, 0.8);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.lb-podium-card.rank-1 {
  border-color: rgba(234, 179, 8, 0.4);
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.08) 0%, rgba(15, 23, 42, 0.9) 100%);
  transform: translateY(-4px);
}
.lb-podium-card.rank-2 {
  border-color: rgba(203, 213, 225, 0.3);
  background: linear-gradient(180deg, rgba(203, 213, 225, 0.05) 0%, rgba(15, 23, 42, 0.9) 100%);
}
.lb-podium-card.rank-3 {
  border-color: rgba(217, 119, 6, 0.3);
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.05) 0%, rgba(15, 23, 42, 0.9) 100%);
}

.lb-podium-medal {
  font-size: 26px;
  margin-bottom: 6px;
}
.lb-podium-name {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 4px;
}
.lb-podium-dept {
  font-size: 11px;
  color: #38bdf8;
  font-weight: 600;
  margin-bottom: 8px;
}
.lb-podium-xp {
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
}
.lb-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.lb-table td {
  padding: 12px 14px;
  font-size: 13px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.lb-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.lb-table tr.current-user td {
  background: rgba(56, 189, 248, 0.08);
  font-weight: 700;
}

.lb-you-badge {
  font-size: 10.5px;
  background: #38bdf8;
  color: #0f172a;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

/* Digital Badges Gallery */
.dash-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.badge-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
}
.badge-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.badge-card.rarity-common { border-color: rgba(148, 163, 184, 0.3); }
.badge-card.rarity-rare { border-color: rgba(56, 189, 248, 0.4); box-shadow: 0 0 10px rgba(56, 189, 248, 0.1); }
.badge-card.rarity-epic { border-color: rgba(168, 85, 247, 0.4); box-shadow: 0 0 12px rgba(168, 85, 247, 0.15); }
.badge-card.rarity-legendary { border-color: rgba(245, 158, 11, 0.4); box-shadow: 0 0 15px rgba(245, 158, 11, 0.2); }

.badge-icon-box {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: rgba(255, 255, 255, 0.05);
}
.badge-card.unlocked .badge-icon-box {
  background: rgba(56, 189, 248, 0.15);
}

.badge-title {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.badge-rarity-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 10px;
  display: inline-block;
  margin-bottom: 8px;
}
.rarity-common .badge-rarity-pill { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.rarity-rare .badge-rarity-pill { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.rarity-epic .badge-rarity-pill { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.rarity-legendary .badge-rarity-pill { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.badge-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.45;
  margin-bottom: 12px;
}

.badge-status-tag {
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
}
.badge-status-tag.locked {
  color: #64748b;
}

/* Verifiable Certificates & Print Styling */
.dash-certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.cert-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cert-icon-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.cert-icon-large {
  font-size: 32px;
}

.cert-title {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
}
.cert-track {
  font-size: 12px;
  color: #38bdf8;
  font-weight: 600;
}

.cert-desc {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 16px;
}

.cert-progress-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 16px;
}
.cert-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.cert-action-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.cert-action-btn.eligible {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #0f172a;
}
.cert-action-btn.eligible:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}
.cert-action-btn.locked {
  background: rgba(255, 255, 255, 0.05);
  color: #64748b;
  cursor: not-allowed;
}

/* Certificate Preview Modal */
.cert-modal-card {
  background: #ffffff;
  color: #0f172a;
  max-width: 680px;
  width: 95%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.cert-paper {
  border: 10px double #ca8a04;
  padding: 36px 32px;
  margin: 16px;
  background: #fffdf5;
  text-align: center;
  position: relative;
}

.cert-paper-header {
  font-family: serif;
  font-size: 26px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.cert-paper-subtitle {
  font-size: 12.5px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 22px;
}

.cert-paper-recipient {
  font-family: serif;
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  border-bottom: 2px solid #e2e8f0;
  display: inline-block;
  padding: 0 24px 6px;
  margin-bottom: 16px;
}

.cert-paper-body {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto 24px;
}

.cert-paper-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid #e2e8f0;
  padding-top: 18px;
  margin-top: 18px;
}

.cert-paper-seal {
  font-size: 32px;
  color: #ca8a04;
}

.cert-paper-meta {
  text-align: left;
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

/* Institutional Safeguards Notice */
.safeguards-notice-box {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 12.5px;
  color: #fca5a5;
  line-height: 1.45;
  margin-top: 24px;
}

@media print {
  body * {
    visibility: hidden;
  }
  #certificateModalBackdrop,
  #certificateModalBackdrop * {
    visibility: visible;
  }
  #certificateModalBackdrop {
    position: absolute;
    left: 0;
    top: 0;
    background: transparent;
    padding: 0;
  }
  .dash-modal-header,
  .dash-modal-footer,
  .cert-modal-header-actions {
    display: none !important;
  }
  .cert-paper {
    border: 8px double #ca8a04;
    margin: 0;
    padding: 40px;
  }
}

/* ============================================================
   GLOBAL INTERACTIVE WATER-DROP MASCOT (VAB-CODE)
   ============================================================ */
.vab-mascot-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  user-select: none;
  touch-action: manipulation;
  pointer-events: auto;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

.vab-mascot-bubble {
  position: relative;
  margin-bottom: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(13, 18, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(6px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}
.vab-mascot-bubble::after {
  content: "";
  position: absolute;
  bottom: -5px;
  right: 24px;
  width: 10px;
  height: 10px;
  background: rgba(13, 18, 30, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transform: rotate(45deg);
}
.vab-mascot-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.vab-mascot-wrapper {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  outline: none;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.vab-mascot-wrapper:hover {
  transform: translateY(-3px) scale(1.05);
  filter: drop-shadow(0 12px 28px rgba(56, 189, 248, 0.35));
}
.vab-mascot-wrapper:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 4px;
}

.vab-mascot-squash {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center bottom;
}
.vab-mascot-squash.booped {
  animation: vabMascotSquash 0.42s ease-in-out;
}

@keyframes vabMascotSquash {
  0% { transform: scale(1, 1); }
  20% { transform: scale(1.15, 0.85); }
  45% { transform: scale(0.92, 1.10); }
  70% { transform: scale(1.04, 0.96); }
  100% { transform: scale(1, 1); }
}

.vab-mascot-sprite {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-size: 300% 300%;
  background-position: 50% 50%;
  pointer-events: none;
  border-radius: 50%;
}

.vab-mascot-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 10px;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.vab-mascot-badge:hover {
  color: #f8fafc;
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.2);
  transform: scale(1.15);
}

.vab-mascot-popover {
  position: absolute;
  bottom: 82px;
  right: 0;
  width: 220px;
  background: rgba(10, 15, 26, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(14px);
  display: none;
  flex-direction: column;
  gap: 10px;
  animation: vabPopoverFade 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9995;
}
.vab-mascot-popover.open {
  display: flex;
}

@keyframes vabPopoverFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.vab-mascot-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}
.vab-mascot-popover-title {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.02em;
}
.vab-mascot-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}
.vab-mascot-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.vab-mascot-section-label {
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.vab-mascot-swatches {
  display: flex;
  gap: 8px;
}
.vab-mascot-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.vab-mascot-swatch:hover {
  transform: scale(1.15);
}
.vab-mascot-swatch.active {
  border-color: #ffffff;
  transform: scale(1.12);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}
.vab-mascot-swatch.swatch-blue { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.vab-mascot-swatch.swatch-gold { background: linear-gradient(135deg, #fde047, #d97706); }
.vab-mascot-swatch.swatch-silver { background: linear-gradient(135deg, #f1f5f9, #64748b); }
.vab-mascot-swatch.swatch-red { background: linear-gradient(135deg, #f87171, #dc2626); }

.vab-mascot-sound-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.15s;
}
.vab-mascot-sound-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.vab-mascot-sound-status {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}
.vab-mascot-sound-status.on {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

@media (max-width: 640px) {
  .vab-mascot-container {
    bottom: 16px;
    right: 16px;
  }
  .vab-mascot-wrapper {
    width: 54px;
    height: 54px;
  }
  .vab-mascot-popover {
    bottom: 68px;
    right: 0;
    width: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vab-mascot-squash.booped {
    animation: none !important;
  }
  .vab-mascot-wrapper {
    transition: none !important;
  }
  .vab-mascot-bubble {
    transition: none !important;
  }
}

/* ============================================================
   VAB-CODE Learning Analytics Dashboard & Native SVG Charts (Stage 2)
   ============================================================ */
.dash-analytics-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.dash-analytics-banner-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-analytics-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  padding: 3px 8px;
  width: fit-content;
}
.dash-analytics-banner-desc {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.4;
}
.dash-analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 960px) {
  .dash-analytics-grid {
    grid-template-columns: 1fr;
  }
}
.dash-analytics-card {
  background: rgba(18, 22, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
}
.dash-analytics-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  gap: 8px;
}
.dash-analytics-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-analytics-range-selector {
  display: inline-flex;
  gap: 4px;
  background: rgba(15, 23, 42, 0.6);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.dash-analytics-range-btn {
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}
.dash-analytics-range-btn:hover {
  color: #f8fafc;
}
.dash-analytics-range-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}
.dash-analytics-range-btn.active {
  background: #38bdf8;
  color: #080a12;
  font-weight: 700;
}
.dash-analytics-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 20px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  margin: 10px 0;
}
.dash-empty-icon {
  font-size: 32px;
  margin-bottom: 10px;
}
.dash-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 6px;
}
.dash-empty-desc {
  font-size: 12.5px;
  color: #94a3b8;
  max-width: 440px;
  line-height: 1.5;
  margin-bottom: 8px;
}
.dash-analytics-caption {
  font-size: 11px;
  color: #64748b;
  font-style: italic;
}
.dash-chart-svg-wrap {
  width: 100%;
  overflow: hidden;
  position: relative;
}
.dash-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.dash-chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.dash-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #94a3b8;
}
.dash-chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.dash-speed-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #f59e0b;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
}
.dash-speed-stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.dash-speed-stat-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
}
.dash-speed-stat-val {
  font-size: 20px;
  font-weight: 800;
  color: #f8fafc;
}
.dash-speed-stat-lbl {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}
.dash-analytics-duration-box {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
}
.dash-analytics-note {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.5;
  margin-top: 10px;
}
.dash-mastery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.dash-mastery-item {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.dash-mastery-item:hover {
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}
.dash-mastery-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.dash-mastery-title {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-mastery-pct {
  font-size: 13.5px;
  font-weight: 800;
  color: #38bdf8;
}
.dash-mastery-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.dash-mastery-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.dash-mastery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: #94a3b8;
  flex-wrap: wrap;
  gap: 6px;
}
.dash-events-tag {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
}
.dash-quiz-trajectory-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.dash-quiz-trajectory-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
}
.dash-quiz-trajectory-name {
  color: #f8fafc;
  font-weight: 600;
}
.dash-quiz-trajectory-score {
  font-weight: 700;
  color: #38bdf8;
}
.dash-analytics-disclaimer {
  font-size: 11.5px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid #38bdf8;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  margin-top: 12px;
  line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
  .dash-mastery-bar-fill,
  .dash-mastery-item,
  .dash-analytics-range-btn {
    transition: none !important;
  }
}











