/* --- BASE WEBSITE STYLES --- */
:root {
    --navy: #0b2149;
    --ink: #21242c;
    --mute: #5f6b84;
    --bg: #fff;
    --soft: #f4f7ff;
    --line: #dbe0ec;
    
    /* BRAND COLORS */
    --blue: #2563EB; 
    --blue-d: #1D4ED8;
    --ps: #0c8f6f;
    --ct: #7a3fe0;
    --ye: #ffb100;
    --ok: #0a8f4c;
    --bad: #d92916;
    
    --footer-bg: #0b2149;
    --footer-text: #b8c4de;
  }
  
  /* DARK MODE OVERRIDES */
  html.dark-mode, body.dark-mode {
    --bg: #0b1120; 
    --soft: #151e2f; 
    --ink: #e2e8f0; 
    --navy: #f8fafc; 
    --mute: #94a3b8;
    --line: #1e293b; 
    --blue: #3B82F6;
    --blue-d: #2563EB;
    --footer-bg: #060b14;
    --footer-text: #94a3b8;
  }
  
  *{box-sizing:border-box;margin:0}
  body{font:400 16px/1.65 "Google Sans Flex",Lato,system-ui,-apple-system,sans-serif;color:var(--ink);background:var(--bg);transition:background 0.3s, color 0.3s;}
  h1,h2,h3{font-weight:900;line-height:1.15;letter-spacing:-.02em;color:var(--navy)}
  a{color:inherit;text-decoration:none}
  .wrap{max-width:1120px;margin:0 auto;padding:0 24px}
  
  /* Header */
  .bar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 24px;height:72px;background:var(--bg);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:50;transition:background 0.3s, border-color 0.3s;}
  .logo{display:inline-flex;align-items:baseline;font:900 30px/1 "Google Sans Flex",Lato,system-ui,sans-serif;letter-spacing:-.045em;color:var(--navy)}
  .logo span{color:var(--blue);margin-left:.16em}
  .logo i{width:.2em;height:.2em;border-radius:50%;background:var(--ps);margin-left:.07em}
  .logo.light{color:#fff}.logo.light span{color:#9fc0ff}.logo.light i{background:#3ddcb4}
  .bar nav{display:flex;gap:30px;font-weight:700;font-size:15px}
  .bar nav a{color:var(--ink);padding:6px 0;border-bottom:3px solid transparent}
  .bar nav a:hover{color:var(--blue);border-color:var(--blue)}
  .nav-right{display:flex;align-items:center;gap:20px}
  .lesson-user{font-weight:700;font-size:15px;color:var(--navy);white-space:nowrap;max-width:220px;overflow:hidden;text-overflow:ellipsis}
  .login{font-weight:700;color:var(--navy);font-size:15px}
  .login:hover{color:var(--blue)}
  
  .theme-btn { background: var(--soft); border: 1px solid var(--line); cursor: pointer; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; color: var(--navy); padding: 0; }
  .theme-btn:hover { background: var(--line); transform: scale(1.05); }
  
  .btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;font:700 16px "Google Sans Flex",Lato,system-ui,sans-serif;padding:11px 24px;border-radius:8px;border:2px solid var(--blue);background:var(--blue);color:#fff;cursor:pointer;transition:all .15s}
  .btn:hover{background:var(--blue-d);border-color:var(--blue-d);transform:translateY(-1px);box-shadow:0 4px 12px rgba(37, 99, 235,.2)}
  .btn.alt{background:var(--bg);color:var(--blue)}.btn.alt:hover{background:var(--soft);box-shadow:none}
  .btn.go{background:var(--ps);border-color:var(--ps)}.btn.go:hover{background:#09745a;border-color:#09745a}
  .btn-large{padding:14px 32px;font-size:17px}
  .full-width{width:100%;margin-top:10px}
  .btn[disabled]{opacity:.4;cursor:default}
  
  .btn:focus-visible,.opt:focus-visible,.qn:focus-visible,a:focus-visible{outline:3px solid var(--ye);outline-offset:2px}
  .chip{display:inline-block;font:700 12px "Google Sans Flex",Lato,sans-serif;letter-spacing:.06em;text-transform:uppercase;padding:4px 10px;border-radius:6px;color:#fff}
  .mode-screen{position:fixed;inset:0;background:var(--soft);display:flex;align-items:center;justify-content:center;z-index:2000;padding:24px;}
  .mode-card{background:var(--bg);border:1px solid var(--line);border-radius:16px;padding:40px;max-width:520px;width:100%;text-align:center;box-shadow:0 20px 40px rgba(11,33,73,.08);}
  .mode-card h1{font-size:2rem;margin-bottom:12px;}
  .mode-lead{color:var(--mute);margin-bottom:28px;}
  .mode-note{color:var(--mute);font-size:14px;margin:10px 0 24px;}
  .section-label{display:block;font-size:12px;font-weight:900;letter-spacing:.06em;text-transform:uppercase;color:var(--blue);margin-bottom:4px;text-align:center;}
  .opt.correct{border-color:var(--ok);background:#e8f5e9;}
  .opt.wrong{border-color:var(--bad);background:#ffebee;}
  .opt.locked{cursor:default;}
  .header-timer-wrapper{display:flex;flex-direction:column;align-items:center;}
  
  /* Hero & Homepage */
  .hero{background:linear-gradient(180deg,var(--soft) 0%,var(--bg) 100%);padding:80px 0;transition:background 0.3s;}
  .hero .wrap{display:grid;grid-template-columns:1.1fr 1fr;gap:56px;align-items:center}
  .badge{display:inline-block;background:var(--bg);border:1px solid var(--line);padding:6px 14px;border-radius:99px;font-size:14px;font-weight:700;color:var(--navy);margin-bottom:20px;box-shadow:0 2px 8px rgba(0,0,0,.04)}
  .hero h1{font-size:clamp(2.5rem,5vw,3.8rem);margin-bottom:20px}
  .hero h1 em{font-style:normal;color:var(--blue)}
  .hero p.sub{color:var(--mute);font-size:1.15rem;margin:0 0 32px;max-width:52ch}
  .hero-cta{display:flex;gap:16px;margin-bottom:24px}
  .trust-points{display:flex;gap:20px;font-size:14px;font-weight:700;color:var(--ps)}
  .trust-points span::before{content:"·";margin-right:6px}
  .preview{background:var(--bg);border:1px solid var(--line);border-radius:16px;padding:28px;box-shadow:0 20px 40px rgba(11,33,73,.08);transform:rotate(-1deg)}
  .pv-top{display:flex;justify-content:space-between;align-items:center;font-size:14px;color:var(--mute);margin-bottom:16px}
  .pv-timer{font-family:monospace;font-weight:700;font-size:16px;color:var(--navy);background:var(--soft);padding:2px 8px;border-radius:4px}
  .pv-q{font-weight:700;color:var(--navy);margin-bottom:16px;font-size:1.05rem}
  .pv-opt{border:2px solid var(--line);border-radius:8px;padding:12px 16px;margin-bottom:10px;font-size:15px;color:var(--mute);font-weight:700}
  .pv-opt.on{border-color:var(--blue);background:var(--soft);color:var(--navy);box-shadow:0 4px 12px rgba(37, 99, 235,.1)}
  .pv-bar{height:8px;border-radius:99px;background:var(--line);margin-top:18px;overflow:hidden}.pv-bar i{display:block;height:100%;width:23%;background:var(--blue)}
  
  section{padding:80px 0}
  h2{font-size:2.2rem;margin-bottom:12px;text-align:center}
  .lead{color:var(--mute);margin-bottom:48px;max-width:60ch;text-align:center;margin-left:auto;margin-right:auto;font-size:1.1rem}
  .grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(300px,100%),1fr));gap:24px}
  .card{background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:32px;transition:background 0.3s, border-color 0.3s;}
  .card h3{font-size:1.2rem;margin-bottom:8px}.card p{color:var(--mute)}
  .testimonials-sec { background: var(--bg) !important; transition: background 0.3s; }
  
  /* Pricing */
  .pricing-sec{background:var(--soft); transition:background 0.3s;}
  .price-card{background:var(--bg);border:1px solid var(--line);border-radius:16px;padding:40px 32px;position:relative;display:flex;flex-direction:column}
  .price-card.featured{border:2px solid var(--blue);box-shadow:0 12px 32px rgba(37, 99, 235,.12);transform:scale(1.02);z-index:1}
  .tag{position:absolute;top:-14px;left:50%;transform:translateX(-50%);background:var(--blue);color:#fff;font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.05em;padding:6px 16px;border-radius:99px}
  .price-card h3{font-size:1.4rem;margin-bottom:8px}
  .price{font-size:3rem;font-weight:900;color:var(--navy);margin-bottom:8px;line-height:1}
  .price span{font-size:1rem;color:var(--mute);font-weight:700}
  .desc{color:var(--mute);margin-bottom:24px;font-size:15px;border-bottom:1px solid var(--line);padding-bottom:24px}
  .price-card ul{list-style:none;padding:0;margin:0 0 32px 0;flex-grow:1}
  .price-card li{font-size:15px;margin-bottom:12px;color:var(--navy);font-weight:700}
  .price-card li.disabled{color:var(--mute);opacity:.6}
  
  /* Footer */
  footer{background:var(--footer-bg);color:var(--footer-text);padding:64px 0 0;font-size:15px;transition:background 0.3s;}
  .footer-content{display:flex;justify-content:space-between;align-items:flex-start;flex-wrap:wrap;gap:40px;border-bottom:1px solid rgba(255,255,255,.1);padding-bottom:40px}
  .footer-brand p{max-width:300px;margin-top:16px}
  .footer-links{display:flex;gap:30px;flex-wrap:wrap}
  .footer-links a:hover{color:#fff}
  .footer-bottom{text-align:center;padding:24px;font-size:13px;opacity:.7}
  
  /* Results */
  .score{text-align:center;padding:56px 0 16px}
  .score .big{font:900 clamp(3.5rem,12vw,6rem)/1 "Google Sans Flex",Lato,system-ui,sans-serif;color:var(--navy)}.score .big span{color:var(--mute);font-weight:400}
  .skill{margin:16px 0}.skill div:first-child{display:flex;justify-content:space-between;font-weight:700;color:var(--navy)}
  .track{height:12px;border-radius:99px;background:var(--line);overflow:hidden;margin-top:6px}.track i{display:block;height:100%;border-radius:99px}
  details{background:var(--bg);border:1px solid var(--line);border-left:5px solid var(--line);border-radius:8px;padding:14px 18px;margin-bottom:8px}
  details.ok{border-left-color:var(--ok)}details.no{border-left-color:var(--bad)}
  summary{cursor:pointer;font-weight:700;color:var(--navy)}details p{margin-top:10px;color:var(--mute)}
  .fig{margin:14px 0;max-width:560px}.fig svg{width:100%;height:auto;display:block}
  .dt{border-collapse:collapse;width:100%;max-width:560px;font-size:15px}.dt th,.dt td{border:1px solid var(--line);padding:8px 12px;text-align:center}.dt th{background:var(--soft);font-weight:700;color:var(--navy)}
  
  /* --- EXAM STYLES --- */
  body.exam-active { padding-bottom: 72px; margin: 0; display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: var(--bg); }
  .exam-active .bar { position: relative; z-index: 100; flex-shrink: 0; }
  .header-timer-wrapper { position: absolute; left: 50%; transform: translateX(-50%); display:flex; flex-direction:column; align-items:center; }
  .timer { font-family: monospace; font-weight: 700; font-size: 20px; color: var(--navy); background: var(--soft); padding: 4px 12px; border-radius: 8px; border: 1px solid var(--line); }
  .timer.low { color: var(--bad); background: #ffebee; border-color: #ffcdd2; }
  
  .prog { height: 4px; background: var(--line); width: 100%; flex-shrink: 0; z-index: 99; }
  .prog i { display: block; height: 100%; background: var(--blue); width: 0%; transition: width 0.3s; }
  
  .top-nav-dots { display: flex; justify-content: center; gap: 6px; padding: 12px 24px; overflow-x: auto; background: var(--bg); border-bottom: 1px solid var(--line); flex-shrink: 0; z-index: 99; }
  .dot { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--mute); border: 2px solid var(--line); cursor: pointer; flex-shrink: 0; transition: all 0.2s; }
  .dot:hover { background: var(--soft); }
  .dot.cur { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 2px rgba(37, 99, 235,.2); }
  .dot.done { background: var(--blue); border-color: var(--blue); color: #fff; }
  .dot.fl { border: 1px solid var(--ye); color: #b47a00; }
  .dot.done.fl { border: 1px solid var(--ye); box-shadow: 0 0 0 1px var(--ye); }
  .dot.cur.fl { border: 1px solid var(--ye); color: #b47a00; box-shadow: 0 0 0 1px rgba(255, 177, 0, 0.4); }
  
  .ex { display: flex; flex: 1; overflow: hidden; position: relative; }
  .q-wrapper { flex: 1; overflow-y: auto; padding: 40px 24px; display: flex; justify-content: center; }
  .q { max-width: 800px; width: 100%; }
  .stim { font-size: 1.15rem; line-height: 1.8; color: var(--ink); margin: 24px 0; }
  .ask { font-weight: 700; color: var(--navy); font-size: 1.1rem; margin-bottom: 16px; }
  .opts { display: flex; flex-direction: column; gap: 12px; }
  .opt { display: flex; align-items: flex-start; gap: 16px; width: 100%; text-align: left; background: var(--bg); border: 2px solid var(--line); border-radius: 8px; padding: 16px; font-size: 1.05rem; color: var(--ink); cursor: pointer; transition: all 0.2s; line-height: 1.5; }
  .opt:hover { border-color: var(--mute); }
  .opt.sel { border-color: var(--blue); background: var(--soft); box-shadow: 0 4px 12px rgba(37, 99, 235,.1); }
  .opt b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: var(--soft); color: var(--navy); font-size: 14px; flex-shrink: 0; }
  .opt.sel b { background: var(--blue); color: #fff; }
  
  .modal-overlay { position: fixed; inset: 0; background: rgba(11,33,73,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
  .modal-overlay.active { opacity: 1; pointer-events: auto; }
  .modal-box { background: var(--bg); border-radius: 16px; padding: 32px; max-width: 400px; width: 90%; box-shadow: 0 20px 40px rgba(0,0,0,0.2); text-align: center; transform: translateY(20px); transition: transform 0.2s; }
  .modal-overlay.active .modal-box { transform: translateY(0); }
  .modal-box h3 { margin-bottom: 12px; color: var(--navy); font-size: 1.4rem; }
  .modal-box p { color: var(--mute); margin-bottom: 24px; font-size: 1.05rem; line-height: 1.5; }
  .modal-actions { display: flex; gap: 12px; justify-content: center; }
  
  /* --- LMS LESSON STYLES --- */
  body.lesson-active { padding-bottom: 72px; margin: 0; display: flex; flex-direction: column; height: 100vh; background: var(--bg); overflow: hidden; }
  .lms-container { display: flex; flex: 1; overflow: hidden; position: relative; }
  
  #drawing-canvas { 
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    z-index: 7; /* Pen Canvas is ALWAYS on top for clicks */
    pointer-events: none; 
    touch-action: none;
    cursor: crosshair; 
  }
  
  #highlighter-canvas { 
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    z-index: 6; /* Highlighter is behind the pen layer */
    pointer-events: none; 
    touch-action: none;
    opacity: 0.4; /* Flat 2% opacity applied by CSS */
  }

  #drawing-canvas.active { pointer-events: auto; }
  /* Lesson player: draw over the lesson title bar too (.lms-topbar has z-index 10) */
  .lms-main #drawing-canvas { z-index: 12; }
  .lms-main #highlighter-canvas { z-index: 11; }
  
  .lms-sidebar { width: 300px; background: var(--bg); border-right: 1px solid var(--line); display: flex; flex-direction: column; transition: margin-left 0.3s ease; overflow-y: auto; z-index: 10; }
  .lms-sidebar.hidden { margin-left: -300px; }
  .sidebar-header { padding: 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
  .sidebar-header h3 { font-size: 1.2rem; margin: 0; color: var(--navy); }
  .sidebar-section-title { padding: 20px 24px 8px; font-size: 0.75rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; color: var(--blue); }
  .sidebar-section-title:first-child { padding-top: 16px; }
  .sidebar-group { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px dashed var(--line); }
  .sidebar-group:last-child { border-bottom: none; margin-bottom: 0; }
  .sidebar-group-title { display: block; padding: 0 24px; font-size: 0.85rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; color: var(--navy); margin-bottom: 8px; text-decoration: none; transition: color 0.2s; }
  .sidebar-group-title:hover { color: var(--blue); }
  .sidebar-group-title.active-group { color: var(--blue); }
  .sidebar-link { display: block; padding: 10px 24px 10px 32px !important; color: var(--ink); font-size: 14px !important; font-weight: 700; text-decoration: none; transition: background 0.2s, color 0.2s; cursor: pointer; }
  .sidebar-link:hover { background: var(--soft); color: var(--blue); }
  .sidebar-link.active { background: var(--soft); border-right: 4px solid var(--blue); color: var(--blue); }
  
  .lms-main { flex: 1; overflow-y: auto; position: relative; display: flex; flex-direction: column; }
  .lms-topbar { padding: 16px 32px; background: var(--bg); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; z-index: 10; }
  .topbar-left { display: flex; align-items: center; gap: 16px; }
  .menu-btn { background: none; border: none; cursor: pointer; padding: 8px; border-radius: 8px; color: var(--navy); display: grid; place-items: center; }
  .menu-btn:hover { background: var(--soft); }
  
  .lms-content { padding: 40px 20px; flex: 1; display: flex; justify-content: center; position: relative; z-index: 2; }
  .slide { width: 100%; max-width: 900px; }
  .slide h2 { font-size: 2.2rem; margin-bottom: 32px; text-align: left; }
  .slide p { font-size: 1.15rem; line-height: 1.8; margin-bottom: 24px; color: var(--ink); }
  .slide li { font-size: 1.15rem; line-height: 1.8; margin-bottom: 16px; }
  .slide-container-hidden { display: none !important; }
  .slide-container-visible { display: block !important; }
  
  /* Footer Nav */
  .exam-footer { position: fixed; bottom: 0; left: 0; width: 100%; height: 72px; background: var(--bg); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; z-index: 100; box-shadow: 0 -4px 12px rgba(0,0,0,0.03); }
  .footer-left, .footer-right { display: flex; align-items: center; flex: 1; }
  .footer-right { justify-content: flex-end; }
  .footer-center { display: flex; align-items: center; justify-content: center; flex: 1; }
  .q-counter { font-weight: 700; color: var(--navy); font-size: 15px; }
  .exam-footer .btn { cursor: pointer; pointer-events: auto; }
  .exam-footer .btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
  .arrow-btn { padding: 10px 20px; }
  
  /* Themes (Courses keep their own colors) */
  body.theme-ps { --theme-color: var(--ps); }
  body.theme-ps #slide-progress { background: var(--ps) !important; }
  body.theme-ps .exam-footer .btn:not(.alt) { background: var(--ps); border-color: var(--ps); }
  body.theme-ps .slide h2 { color: var(--ps); }
  body.theme-ps .sidebar-link.active { border-right-color: var(--ps); color: var(--ps); }
  body.theme-ps .tool-btn.active { background: var(--ps); border-color: var(--ps); }
  
  body.theme-ct { --theme-color: var(--ct); }
  body.theme-ct #slide-progress { background: var(--ct) !important; }
  body.theme-ct .exam-footer .btn:not(.alt) { background: var(--ct); border-color: var(--ct); }
  body.theme-ct .slide h2 { color: var(--ct); }
  body.theme-ct .sidebar-link.active { border-right-color: var(--ct); color: var(--ct); }
  body.theme-ct .tool-btn.active { background: var(--ct); border-color: var(--ct); }
  
  .slide .btn { background: var(--theme-color, var(--blue)); border-color: var(--theme-color, var(--blue)); color: #fff; }
  .slide .btn:hover { background: var(--theme-color, var(--blue)); filter: brightness(0.9); }
  
  /* Photoshop Floating Toolbar */
  .ps-toolbar { 
    position: fixed; 
    top: 200px; 
    left: calc(100% - 120px); 
    display: flex; 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 12px; 
    z-index: 999; 
    transition: left 0.3s ease; 
  }
  .ps-toolbar.sidebar-hidden { left: 24px; }
  
  .tool-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
  .tool-btn:hover { background: var(--soft); color: var(--blue); }
  
  .tool-btn.main-toggle { width: 52px; height: 52px; border-radius: 16px; border: 2px solid var(--blue); color: var(--blue); }
  
  .ps-tools-panel { 
    display: none; 
    position: absolute; 
    top: 60px; 
    right: 0; 
    flex-direction: column; 
    align-items: center; 
    gap: 12px; 
    background: var(--bg); 
    border: 1px solid var(--line); 
    border-radius: 12px; 
    padding: 12px 8px; 
    box-shadow: 0 8px 24px rgba(0,0,0,0.12); 
  }
  
  .ps-tools-panel.active { 
    display: flex; 
  }
  
  .ps-tools-panel .tool-btn.active { 
    background: var(--soft); 
    border-color: currentColor; 
    color: currentColor; 
  }
  
  .ps-divider { width: 24px; height: 1px; background: var(--line); margin: 2px 0; }
  
  /* 2 columns 3 rows color grid */
  .color-swatches { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 8px; 
    justify-items: center; 
  }
  .swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; transition: transform 0.1s; }
  .swatch:hover { transform: scale(1.1); }
  .swatch.active { border-color: var(--navy); box-shadow: 0 0 0 2px var(--bg) inset; }
  
  /* 2 Thickness Buttons */
  .brush-sizes { display: flex; flex-direction: column; gap: 6px; align-items: center; }
  .size-btn { width: 32px; height: 32px; border-radius: 6px; border: 1px solid transparent; background: transparent; cursor: pointer; display: grid; place-items: center; }
  .size-btn:hover { background: var(--soft); }
  .size-btn.active { background: var(--soft); border-color: var(--line); }
  
  .sidebar-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 44px;
    background: var(--bg);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 20;
    color: var(--mute);
    transition: all 0.3s ease, background 0.2s;
    padding: 0;
    opacity: 0.7;
  }
  
  .sidebar-toggle:hover {
    opacity: 1;
    background: var(--soft);
    color: var(--blue);
  }
  
  .hide-arrow {
    left: 299px; 
    border-radius: 0 8px 8px 0;
    border-left: none;
  }
  
  .show-arrow {
    left: 0;
    border-radius: 0 8px 8px 0;
    border-left: none;
    display: none;
  }

/* Solution Box Styling */
.solution-box {
    margin-top: 32px; 
    padding: 32px; 
    background: var(--soft); 
    border-left: 6px solid var(--blue); 
    border-radius: 8px;
}
.solution-box h3 {
    margin: 0 0 20px 0; 
    font-size: 1.4rem; 
    color: var(--blue);
    display: flex;
    align-items: center;
    gap: 12px;
}
.solution-box p, .solution-box div {
    font-size: 1.15rem; 
    line-height: 1.8; 
    color: var(--ink); 
    margin-bottom: 0;
}

/* =========================================
   DARK MODE LESSON FIX (Corrected)
   ========================================= */

/* --- 1. SOLUTION BOXES --- */

/* Force the background of the solution box to be dark */
html.dark-mode .lms-content div[id$="-answer"] {
    background-color: var(--soft) !important;
    border-left-color: var(--ps) !important;
}

/* Force all text and MathJax inside the solution box to be light */
html.dark-mode .lms-content div[id$="-answer"] *,
html.dark-mode .lms-content div[id$="-answer"] p,
html.dark-mode .lms-content div[id$="-answer"] strong,
html.dark-mode .lms-content div[id$="-answer"] mjx-container,
html.dark-mode .lms-content div[id$="-answer"] mjx-container * {
    color: var(--ink) !important;
    -webkit-text-fill-color: var(--ink) !important;
}

/* Keep the "Solution" text green */
html.dark-mode .lms-content div[id$="-answer"] strong:first-child {
    color: var(--ps) !important;
}


/* --- 2. QUIZ OPTIONS --- */

/* Default Option Box */
html.dark-mode .lms-content .opt {
    background-color: var(--soft) !important;
    border-color: var(--line) !important;
    color: var(--ink) !important;
}

html.dark-mode .lms-content .opt * {
    color: var(--ink) !important;
    -webkit-text-fill-color: var(--ink) !important;
}

/* The A, B, C, D badges */
html.dark-mode .lms-content .opt b {
    background-color: var(--line) !important;
    color: var(--navy) !important;
}

/* Selected Option */
html.dark-mode .lms-content .opt.sel {
    background-color: rgba(59, 130, 246, 0.15) !important;
    border-color: var(--blue) !important;
}

html.dark-mode .lms-content .opt.sel b {
    background-color: var(--blue) !important;
    color: #fff !important;
}

/* Correct Option (from your JS checkAnswer logic) */
html.dark-mode .lms-content .opt[style*="background: #e8f5e9"],
html.dark-mode .lms-content .opt[style*="background: #d4edda"] {
    background-color: rgba(10, 143, 76, 0.15) !important;
    border-color: var(--ok) !important;
}

/* Incorrect Option (from your JS checkAnswer logic) */
html.dark-mode .lms-content .opt[style*="background: #ffebee"],
html.dark-mode .lms-content .opt[style*="background: #f8d7da"] {
    background-color: rgba(217, 41, 22, 0.15) !important;
    border-color: var(--bad) !important;
}
/* --- GENERATED TEST FIGURES (scripts/generate_tests.py) --- */
/* SVG classes keep figures readable in both light and dark mode. */
.fig svg, .opt svg { color: var(--ink); }
.fig svg text, .opt svg text { fill: var(--ink); font-family: "Google Sans Flex",Lato, system-ui, sans-serif; }
svg .s  { stroke: var(--ink); fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg .sd { stroke: var(--ink); fill: none; stroke-width: 1.5; stroke-dasharray: 5 4; }
svg .gr { stroke: var(--line); fill: none; stroke-width: 1; }
svg .ax { stroke: var(--mute); fill: none; stroke-width: 1.5; }
svg .ac { stroke: var(--blue); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
svg .ac2 { stroke: var(--ps); fill: none; stroke-width: 2.5; stroke-linecap: round; }
svg .f0 { fill: var(--bg); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
svg .f1 { fill: rgba(37, 99, 235, .14); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
svg .f2 { fill: rgba(12, 143, 111, .18); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
svg .f3 { fill: rgba(255, 177, 0, .22); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
svg .bar { fill: var(--blue); }
svg .bar2 { fill: var(--ps); }
svg .bar3 { fill: var(--ye); }
svg .dt-ink { fill: var(--ink); }
svg .tm { fill: var(--mute) !important; }
svg .tb { font-weight: 700; }
.opt .opt-fig { display: block; max-width: 220px; }
.opt .opt-fig svg { width: 100%; height: auto; display: block; }
.dt caption { caption-side: top; font-weight: 700; color: var(--navy); padding-bottom: 6px; text-align: left; }
.dt td.l, .dt th.l { text-align: left; }
.dt tr.grp td { background: var(--soft); font-style: italic; text-align: left; }
/* inline maths: fractions, roots, column vectors */
.fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .92em; line-height: 1.15; margin: 0 2px; }
.fr > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 3px; }
.fr > span:last-child { padding: 0 3px; }
.rt { white-space: nowrap; }
.rt > span { border-top: 1.5px solid currentColor; padding: 0 2px; }
.cv { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; line-height: 1.1; border-left: 1.5px solid currentColor; border-right: 1.5px solid currentColor; border-radius: 6px; padding: 0 5px; margin: 0 2px; font-size: .92em; }
.passage { border-left: 3px solid var(--ct); padding: 4px 0 4px 16px; }
.opt .ot { display: block; min-width: 0; }
/* opaque cube faces (isometric drawings must hide what is behind them) */
svg .ct { fill: #ffffff; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
svg .cl { fill: #DBE7FD; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
svg .cr { fill: #c9ece1; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
html.dark-mode svg .ct { fill: #1e293b; }
html.dark-mode svg .cl { fill: #24345A; }
html.dark-mode svg .cr { fill: #1d4a3e; }
.opt { font-family: inherit; }

/* --- COURSE LANDING PAGE (ace-the-nuet.html) --- */
.cl-hero { position: relative; overflow: hidden; color: #fff; padding: 96px 0 88px;
  background: radial-gradient(1200px 500px at 85% -10%, rgba(59, 130, 246, .55), transparent 60%),
              radial-gradient(900px 500px at -10% 110%, rgba(12, 143, 111, .45), transparent 60%),
              linear-gradient(160deg, #0b1534 0%, #0B1A3A 55%, #0b2149 100%); }
.cl-hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.cl-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: #BFDBFE; margin-bottom: 18px; }
.cl-eyebrow::before { content: ""; width: 28px; height: 2px; background: #BFDBFE; }
.cl-hero h1 { color: #fff; font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.02; margin-bottom: 20px; }
.cl-hero h1 em { font-style: normal; background: linear-gradient(90deg, #93C5FD, #6ee7c8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cl-hero .cl-sub { color: #cfd6ea; font-size: 1.2rem; max-width: 50ch; margin-bottom: 32px; }
.cl-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 36px; }
.cl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: 900 17px "Google Sans Flex",Lato, system-ui, sans-serif; padding: 16px 30px; border-radius: 999px; border: 0; cursor: pointer; transition: transform .15s, box-shadow .15s; text-decoration: none; }
.cl-btn.primary { background: linear-gradient(90deg, #3B82F6, #2563EB); color: #fff; box-shadow: 0 10px 30px rgba(37, 99, 235, .45); }
.cl-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(37, 99, 235, .55); }
.cl-btn.ghost { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .28); }
.cl-btn.ghost:hover { background: rgba(255, 255, 255, .14); }
.cl-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 28px; justify-content: start; }
.cl-stats b { display: block; font-size: 1.9rem; font-weight: 900; color: #fff; line-height: 1; }
.cl-stats span { font-size: 13px; color: #aab4cf; letter-spacing: .03em; }
.cl-visual { position: relative; border-radius: 24px; padding: 28px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(6px); }
.cl-visual h4 { color: #fff; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 18px; }
.cl-path { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.cl-path li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: center; color: #e6e9f5; font-weight: 700; }
.cl-path li i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 14px; color: #fff; }
.cl-path li small { display: block; color: #aab4cf; font-weight: 400; font-size: 13px; }
.cl-section { padding: 88px 0; }
.cl-section.soft { background: var(--soft); }
.cl-kicker { display: block; text-align: center; font-size: 13px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); margin-bottom: 10px; }
.cl-outcomes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cl-outcome { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.cl-outcome .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 16px; color: #fff; font-weight: 900; }
.cl-outcome h3 { font-size: 1.15rem; margin-bottom: 8px; }
.cl-outcome p { color: var(--mute); font-size: .98rem; }
.cl-rhythm { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin: 0 auto 28px; max-width: 900px; }
.cl-day { border-radius: 14px; padding: 16px 8px; text-align: center; border: 1px solid var(--line); background: var(--bg); }
.cl-day b { display: block; font-size: 13px; color: var(--mute); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.cl-day span { font-weight: 900; color: var(--navy); font-size: .95rem; }
.cl-day.math { border-top: 4px solid var(--blue); }
.cl-day.crit { border-top: 4px solid var(--ps); }
.cl-day.rest { border-top: 4px solid var(--line); opacity: .8; }
.cl-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 900px; margin: 0 auto; }
.cl-fact { text-align: center; padding: 8px 12px; }
.cl-fact b { display: block; font-size: 2.2rem; font-weight: 900; color: var(--blue); }
.cl-fact p { color: var(--mute); }
.cl-phase { max-width: 900px; margin: 0 auto 36px; }
.cl-phase-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.cl-phase-head .num { font-size: 13px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: #fff; padding: 5px 12px; border-radius: 99px; }
.cl-phase-head h3 { font-size: 1.35rem; }
.cl-week { border: 1px solid var(--line); border-radius: 14px; background: var(--bg); margin-bottom: 10px; overflow: hidden; }
.cl-week summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 84px 1fr 24px; gap: 14px; align-items: center; padding: 18px 20px; }
.cl-week summary::-webkit-details-marker { display: none; }
.cl-week summary .wk { font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.cl-week summary .tt { font-weight: 900; color: var(--navy); }
.cl-week summary .pl { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--blue); font-weight: 900; transition: transform .2s; }
.cl-week[open] summary .pl { transform: rotate(45deg); }
.cl-week .body { padding: 0 20px 20px 118px; color: var(--ink); }
.cl-week .body p { color: var(--mute); margin-bottom: 10px; }
.cl-week .body ul { margin: 0; padding-left: 18px; }
.cl-week .body li { margin-bottom: 6px; }
.cl-fit { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 900px; margin: 0 auto; }
.cl-fit .card h3 { margin-bottom: 14px; font-size: 1.2rem; }
.cl-fit ul { list-style: none; padding: 0; margin: 0; }
.cl-fit li { padding: 8px 0 8px 30px; position: relative; color: var(--ink); }
.cl-fit li::before { position: absolute; left: 0; top: 7px; font-weight: 900; }
.cl-fit .yes li::before { content: "✓"; color: var(--ok); }
.cl-fit .no li::before { content: "✕"; color: var(--bad); }
.cl-faq { max-width: 820px; margin: 0 auto; }
.cl-faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.cl-faq summary { cursor: pointer; font-weight: 900; color: var(--navy); font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.cl-faq summary::-webkit-details-marker { display: none; }
.cl-faq summary::after { content: "+"; color: var(--blue); font-size: 1.3rem; line-height: 1; }
.cl-faq details[open] summary::after { content: "–"; }
.cl-faq p { color: var(--mute); margin-top: 10px; }
.cl-final { text-align: center; color: #fff; padding: 88px 0;
  background: radial-gradient(800px 400px at 50% -20%, rgba(59, 130, 246, .5), transparent 60%), linear-gradient(160deg, #0b1534, #0B1A3A); }
.cl-final h2 { color: #fff; font-size: clamp(2rem, 4.5vw, 3rem); }
.cl-final p { color: #cfd6ea; max-width: 56ch; margin: 0 auto 30px; font-size: 1.1rem; }
@media (max-width: 900px) {
  .cl-hero .wrap { grid-template-columns: 1fr; }
  .cl-outcomes, .cl-facts { grid-template-columns: 1fr; }
  .cl-fit { grid-template-columns: 1fr; }
  .cl-rhythm { grid-template-columns: repeat(4, 1fr); }
  .cl-stats { grid-template-columns: repeat(2, auto); }
  .cl-week summary { grid-template-columns: 1fr 24px; }
  .cl-week summary .wk { grid-column: 1 / -1; }
  .cl-week .body { padding: 0 20px 20px 20px; }
}
/* course landing: day-by-day lesson list inside each week */
.cl-days { list-style: none; padding: 0; margin: 16px 0 0; border-top: 1px solid var(--line); }
.cl-days li { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cl-days li:last-child { border-bottom: 0; }
.cl-days .d { font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); padding-top: 2px; }
.cl-days .t { color: var(--navy); font-weight: 700; }
.cl-days .t small { display: block; color: var(--mute); font-weight: 400; font-size: .9rem; margin-top: 2px; }
.cl-days .m { font-size: 13px; color: var(--mute); white-space: nowrap; padding-top: 2px; }
.cl-days .tag { display: inline-block; font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; margin-left: 8px; vertical-align: 2px; color: #fff; }
.cl-days .tag.mock { background: var(--bad); }
.cl-days .tag.rest { background: var(--mute); }
.cl-days li.rest .t { color: var(--mute); }
.cl-week .body h5 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); margin: 18px 0 0; }
.cl-week .body > p.goal-h { font-size: 13px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); margin: 14px 0 6px; }
@media (max-width: 900px) { .cl-days li { grid-template-columns: 56px 1fr; } .cl-days .m { grid-column: 2; } }

