
    /* ========== CSS Variables ========== */
    :root { 
      --glass: rgba(255,255,255,0.08); 
      --glass-border: rgba(255,255,255,0.12);
      --glass-hover: rgba(255,255,255,0.15);
      --bg-main: #0b1020;
      --overlay-bg: rgba(2,6,23,0.6);
    }
  
    /* ========== Base Styles ========== */
    html, body {
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, Arial;
      overflow-x: hidden;
      overflow-y: auto;
    }
    
    body { 
      background: var(--bg-main);
      overscroll-behavior: none;
    }
    
    body.modal-open { 
      overflow: hidden;
    }
  
    /* ========== Hide ALL Scrollbars ========== */
    * {
      scrollbar-width: none !important;
      -ms-overflow-style: none !important;
    }
    
    *::-webkit-scrollbar {
      width: 0 !important;
      height: 0 !important;
      display: none !important;
    }
  
    /* ========== Background Effects ========== */
    .starfield {
      position: fixed;
      inset: 0;
      background:
        radial-gradient(1200px 600px at 10% 10%, rgba(147,51,234,.15), transparent),
        radial-gradient(900px 500px at 90% 20%, rgba(20,184,166,.18), transparent),
        radial-gradient(1000px 600px at 50% 90%, rgba(59,130,246,.12), transparent),
        var(--bg-main);
      z-index: -1;
    }
    
    .twinkle {
      position: absolute;
      width: 2px;
      height: 2px;
      background: #fff;
      border-radius: 9999px;
      opacity: .8;
      animation: twinkle 4s infinite ease-in-out;
    }
    
    @keyframes twinkle {
      0%, 100% { opacity: .2; transform: scale(.8) }
      50% { opacity: 1; transform: scale(1.4) }
    }
    
    @media (prefers-reduced-motion: reduce) {
      .twinkle { animation: none }
    }
  
    /* ========== Glass Effects ========== */
    .glass {
      background: var(--glass);
      backdrop-filter: blur(10px);
      border: 1px solid var(--glass-border);
    }
  
    .shine {
      position: relative;
      overflow: hidden;
    }
    
    .shine:after {
      content: "";
      position: absolute;
      inset: -200% -50%;
      background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,.25) 50%, transparent 60%);
      transform: translateX(-100%);
      animation: shine 7s infinite;
    }
    
    @keyframes shine {
      to { transform: translateX(100%) }
    }
  
    /* ========== Typography ========== */
    .holo {
      background: linear-gradient(90deg, #c084fc, #22d3ee);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }
  
    /* ========== Buttons ========== */
    .btn {
      transition: transform .2s ease, box-shadow .2s ease;
    }
    
    .btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 10px 30px rgba(34,211,238,.2);
    }
  
    /* ========== Drawers ========== */
    .drawer {
      position: fixed;
      top: 0;
      height: 100%;
      max-width: 100%;
      transition: transform .35s cubic-bezier(.4,0,.2,1);
      z-index: 60;
    }
    
    .drawer-right {
      right: 0;
      width: 420px;
      transform: translateX(100%);
    }
    
    .drawer-left {
      left: 0;
      width: 320px;
      transform: translateX(-100%);
    }
    
    .drawer.open {
      transform: translateX(0);
    }
  
    /* ========== Modals ========== */
    dialog {
      border: 0;
      padding: 0;
      background: transparent;
      margin: 0;
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      max-height: 90vh;
      max-width: 90vw;
    }
    
    dialog[open] {
      display: block;
      animation: modalFadeIn 0.3s ease-out;
    }
    
    dialog::backdrop {
      background: rgba(11, 16, 32, 0.85);
      backdrop-filter: blur(4px);
      animation: backdropFadeIn 0.3s ease-out;
    }
    
    .modal-panel {
      background: rgba(255, 255, 255, 0.08);
      backdrop-filter: blur(20px) saturate(150%);
      border: 1px solid rgba(255, 255, 255, 0.12);
      box-shadow: 
        0 0 40px rgba(147, 51, 234, 0.15),
        0 0 80px rgba(20, 184, 166, 0.1);
      max-height: 85vh;
      position: relative;
      overflow: hidden;
    }
    
    /* Modal gradient overlays */
    .modal-panel::before {
      content: "";
      position: absolute;
      top: -50%;
      right: -50%;
      width: 200%;
      height: 200%;
      background: radial-gradient(circle, rgba(147, 51, 234, 0.1) 0%, transparent 70%);
      pointer-events: none;
    }
    
    .modal-panel::after {
      content: "";
      position: absolute;
      bottom: -50%;
      left: -50%;
      width: 200%;
      height: 200%;
      background: radial-gradient(circle, rgba(20, 184, 166, 0.1) 0%, transparent 70%);
      pointer-events: none;
    }
    
    .modal-panel > * {
      position: relative;
      z-index: 1;
    }
    
    /* Course modal specific */
    #courseModalTitle {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }
    
    #lessonsList {
      max-height: 400px;
      overflow-y: auto;
      padding-right: 8px;
    }
    
    #lessonsList li button {
      width: 100%;
      text-align: left;
      padding: 12px 16px;
      border-radius: 12px;
      background: var(--glass);
      border: 1px solid var(--glass-border);
      transition: all 0.2s;
      font-size: 14px;
    }
    
    #lessonsList li button:not(:disabled):hover {
      background: rgba(34, 211, 238, 0.1);
      border-color: rgba(34, 211, 238, 0.3);
      transform: translateX(4px);
    }
    
    #lessonsList li button:disabled {
      cursor: not-allowed;
      opacity: 0.5;
    }
    
    .locked {
      opacity: 0.6;
      filter: grayscale(0.5);
    }
  
    /* ========== Animations ========== */
    @keyframes modalFadeIn {
      from {
        opacity: 0;
        transform: translate(-50%, -48%);
      }
      to {
        opacity: 1;
        transform: translate(-50%, -50%);
      }
    }
    
    @keyframes backdropFadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }
  
    /* ========== Form Elements ========== */
    select.glass {
      background: rgba(2, 6, 23, .85);
      color: #fff;
      border-color: var(--glass-border);
    }
    
    select.glass:focus {
      outline: none;
      box-shadow: 0 0 0 2px rgba(34, 211, 238, .45);
    }
    
    option {
      color: var(--bg-main);
      background: #fff;
    }
  
    /* ========== Overlay ========== */
    #overlay {
      position: fixed;
      inset: 0;
      background: var(--overlay-bg);
      z-index: 50;
    }
    
    #overlay.hidden {
      display: none;
    }
  
    /* ========== Mobile Responsive ========== */
    @media (max-width: 640px) {
      /* Typography */
      .text-6xl { font-size: 2rem !important; }
      .text-4xl { font-size: 1.5rem !important; }
      .text-3xl { font-size: 1.25rem !important; }
      .text-2xl { font-size: 1.125rem !important; }
      
      /* Modals full screen */
      dialog {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        top: 0;
        left: 0;
        transform: none;
      }
      
      .modal-panel {
        width: 100%;
        height: 100%;
        border-radius: 0;
        padding: 20px;
        max-height: 100%;
      }
      
      dialog[open] {
        animation: modalSlideUp 0.3s ease-out;
      }
      
      @keyframes modalSlideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
      }
      
      /* Drawers */
      .drawer-right {
        width: 100%;
      }
      
      /* Grid layouts */
      #coursesGrid {
        grid-template-columns: 1fr !important;
      }
      
      #plans .grid {
        grid-template-columns: 1fr !important;
      }
      
      #home .grid {
        grid-template-columns: 1fr !important;
      }
      
      /* Touch-friendly buttons */
      .btn {
        min-height: 44px;
        min-width: 44px;
      }
      
      /* Spacing */
      .px-4 { padding-left: 1rem; padding-right: 1rem; }
      .py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
    }
  
    /* ========== Tablet Responsive ========== */
    @media (min-width: 641px) and (max-width: 1024px) {
      #coursesGrid {
        grid-template-columns: repeat(2, 1fr) !important;
      }
      
      dialog {
        max-width: 80vw;
      }
    }

/* ===== Fix modal scrolling ===== */
.modal-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden; /* keep glow edges clipped */
}

dialog { 
  overscroll-behavior: contain; /* prevent background scroll on touch devices */
}

#legalBody,
#courseModal .mt-4 {
  flex: 1 1 auto;
  min-height: 0;            /* critical for flex children to allow overflow */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* momentum scroll on iOS */
  max-height: 75vh;         /* safety cap inside the 85–90vh panel */
  padding-right: 2px;       /* avoid scrollbar overlay on content */
}

