.headerlogo {
            color: white;
            transition: color 0.3s ease;
        }

        :root { --brand:#3b82f6; --brand-2:#60a5fa; --brand-dark:#93c5fd; --navy:#eaf1ff; --soft:rgba(59,130,246,.18); --bg:#070d1f; --card:#0f1a36; --line:#1d2d57; --muted:#93a4c8; --text:#c3d0ee; --cyan:#22d3ee; }
        body { background: var(--bg); }

        .ml-hero { padding: 10px 0 50px; }
        .ml-hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 700; color: var(--navy); line-height: 1.15; }
        .ml-hero h1 span { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
        .ml-hero .lead { color: var(--text); max-width: 520px; }
        .ml-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 26px; border-radius: 50px; border: 2px solid var(--brand); font-weight: 600; cursor: pointer; transition: transform .25s, box-shadow .25s, background .25s, color .25s; text-decoration: none; }
        .ml-btn.solid { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 8px 20px rgba(13,110,253,.35); }
        .ml-btn.ghost { background: transparent; color: var(--brand); }
        .ml-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(13,110,253,.35); }
        .ml-btn.ghost:hover { background: var(--brand); color: #fff; }
        .stats { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
        .stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 20px; min-width: 104px; }
        .stat b { display: block; font-size: 1.6rem; color: var(--brand); line-height: 1.1; }
        .stat small { color: var(--muted); }

        .lab { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 18px 60px rgba(59,130,246,.25); overflow: hidden; }
        .lab-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
        .lab-bar .seg { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 50px; padding: 6px 14px; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: .2s; }
        .lab-bar .seg i.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
        .lab-bar .seg.on { background: var(--soft); border-color: var(--brand); color: var(--brand-dark); }
        .lab-bar .seg:hover { transform: translateY(-2px); }
        .lab-bar label { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 6px; margin-left: auto; }
        .lab-bar input[type=range] { width: 90px; accent-color: var(--brand); }
        #mlCanvas { display: block; width: 100%; height: 340px; cursor: crosshair; touch-action: manipulation;
            background: linear-gradient(#3b82f61f 1px, transparent 1px) 0 0/40px 40px, linear-gradient(90deg, #3b82f61f 1px, transparent 1px) 0 0/40px 40px, #0a1330; }
        .lab-foot { padding: 10px 16px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
        .lab-foot b { color: var(--navy); }

        .sec-title { text-align: center; margin: 10px 0 24px; }
        .sec-title h2 { font-weight: 700; color: var(--navy); }
        .sec-title p { color: var(--muted); margin: 0; }
        .chips-wrap { display: flex; justify-content: center; margin: 14px 0 4px; }
        .chips { display: flex; gap: 10px; overflow-x: auto; padding: 6px 4px 10px; max-width: 100%; scrollbar-width: none; }
        .chips::-webkit-scrollbar { display: none; }
        .chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border: 1px solid transparent; border-radius: 50px; background: var(--card); color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; border-color: var(--line); transition: transform .25s, box-shadow .25s, background .25s, color .25s; }
        .chip i { color: var(--brand); }
        .chip .count { font-size: 12px; padding: 1px 8px; border-radius: 50px; background: var(--soft); color: var(--brand-dark); }
        .chip:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(13,110,253,.25); }
        .chip.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 8px 20px rgba(13,110,253,.35); }
        .chip.active i { color: #fff; }
        .chip.active .count { background: rgba(255,255,255,.25); color: #fff; }
        .chips.levels .chip { padding: 6px 14px; font-size: 13px; }
        .chip:focus-visible, .seg:focus-visible, .ml-btn:focus-visible { outline: 3px solid var(--brand-dark); outline-offset: 2px; }
        .result-count { text-align: center; color: var(--muted); font-size: 14px; margin: 4px 0 6px; }

        .ml-col { opacity: 0; }
        .ml-col.is-hidden { display: none; }
        .ml-col.show { animation: cardIn .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d, 0s); }
        @keyframes cardIn { from { opacity: 0; transform: translateY(36px) scale(.95); } to { opacity: 1; transform: none; } }

        .ml-card { position: relative; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; text-align: left; display: flex; flex-direction: column; overflow: hidden;
            box-shadow: 0 6px 20px rgba(0,0,0,.35); transition: transform .15s ease-out, box-shadow .3s; will-change: transform; }
        .ml-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
            background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(96,165,250,.20), transparent 70%); }
        .ml-card:hover { border-color: transparent; box-shadow: 0 22px 44px rgba(59,130,246,.30); }
        .ml-card:hover::before { opacity: 1; }
        .ml-card .top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
        .ml-card .thumb { width: 72px; height: 72px; border-radius: 50%; flex: none; padding: 3px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); transition: transform .6s; }
        .ml-card:hover .thumb { transform: rotate(360deg); }
        .ml-card .thumb img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--card); }
        .pill { display: inline-block; padding: 3px 12px; border-radius: 50px; font-size: 12px; font-weight: 500; color: var(--brand-dark); background: var(--soft); }
        .level { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; color: var(--muted); }
        .level i { width: 16px; height: 5px; border-radius: 4px; background: var(--line); }
        .level i.on { background: var(--brand); }
        .ml-card h5 { font-weight: 600; color: var(--navy); margin-bottom: 8px; }
        .ml-card p { color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 18px; }
        .read-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--brand); text-decoration: none; }
        .read-link span { display: inline-block; transition: transform .25s; }
        .ml-card:hover .read-link span { transform: translateX(6px); }
        .ml-card .stretch::after { content: ""; position: absolute; inset: 0; } /* whole card is clickable */

        .no-results { display: none; text-align: center; padding: 60px 0; }
        .no-results.visible { display: block; animation: cardIn .5s both; }
        .no-results i { font-size: 48px; color: var(--brand); }

        /* ---------- Learning path ---------- */
        .path { display: flex; justify-content: space-between; gap: 14px; margin: 24px 0 0; position: relative; flex-wrap: wrap; }
        .path::before { content: ""; position: absolute; top: 28px; left: 8%; right: 8%; height: 3px; background: repeating-linear-gradient(90deg, var(--brand) 0 8px, transparent 8px 16px); opacity: .45; }
        .step { flex: 1 1 140px; text-align: center; background: none; border: 0; cursor: pointer; position: relative; opacity: 0; transform: translateY(20px); transition: opacity .6s, transform .6s; transition-delay: var(--d, 0s); }
        .step.in { opacity: 1; transform: none; }
        .step .num { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; background: var(--bg); border: 3px solid var(--brand); color: var(--brand); font-weight: 700; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; transition: .3s; position: relative; z-index: 1; }
        .step:hover .num { background: var(--brand); color: #fff; transform: scale(1.12); box-shadow: 0 8px 20px rgba(13,110,253,.4); }
        .step b { display: block; color: var(--navy); }
        .step small { color: var(--muted); }

        @media (max-width: 767px) { .path::before { display: none; } #mlCanvas { height: 280px; } .lab-bar label { margin-left: 0; } }
        @media (prefers-reduced-motion: reduce) { .ml-col.show, .no-results.visible { animation: none; opacity: 1; } .step { transition: none; opacity: 1; transform: none; } .ml-card, .ml-card .thumb, .chip { transition: none; } }
    
        /* ===== extra polish ===== */
        #topics { position: relative; overflow: hidden; }
        #topics::before, #topics::after { content: ""; position: absolute; border-radius: 50%; filter: blur(100px); pointer-events: none; z-index: 0; }
        #topics::before { width: 520px; height: 520px; background: #3b82f6; opacity: .22; top: -120px; left: -120px; animation: drift 16s ease-in-out infinite alternate; }
        #topics::after { width: 460px; height: 460px; background: #22d3ee; opacity: .14; bottom: 5%; right: -120px; animation: drift 20s ease-in-out infinite alternate-reverse; }
        #topics .container-xxl { position: relative; z-index: 1; }
        @keyframes drift { to { transform: translate(80px, 60px) scale(1.15); } }

        .ml-hero h1 span { background: linear-gradient(90deg, var(--brand-2), var(--cyan), var(--brand-2)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s linear infinite; }
        @keyframes shine { to { background-position: 200% center; } }
        .sec-title h2::after { content: ""; display: block; width: 56px; height: 4px; border-radius: 4px; margin: 12px auto 0; background: linear-gradient(90deg, var(--brand), var(--cyan)); }

        .stat { transition: transform .25s, border-color .25s; }
        .stat:hover { transform: translateY(-4px); border-color: var(--brand); }
        .stat b { background: linear-gradient(90deg, var(--brand-2), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }

        .ml-btn.solid { position: relative; overflow: hidden; }
        .ml-btn.solid::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg); animation: sweep 3.5s ease-in-out infinite; }
        @keyframes sweep { 0% { left: -60%; } 60%, 100% { left: 140%; } }

        .cv-wrap { position: relative; }
        .hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 50px; font-size: 14px; color: #fff; background: rgba(15,26,54,.85); border: 1px solid var(--brand); backdrop-filter: blur(6px); animation: pulse 2s ease-in-out infinite; }
        @keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,.55); } 50% { box-shadow: 0 0 0 14px rgba(59,130,246,0); } }

        .ml-card::after { content: ""; position: absolute; inset: 0; border-radius: 20px; padding: 1.5px; pointer-events: none; opacity: 0; transition: opacity .35s;
            background: linear-gradient(135deg, var(--brand), var(--cyan), var(--brand-2));
            -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
        .ml-card:hover::after { opacity: 1; }
        .ml-card .thumb { background: conic-gradient(from 0deg, var(--brand), var(--cyan), var(--brand-2), var(--brand)); box-shadow: 0 0 0 4px rgba(59,130,246,.15); }
        .ml-card:hover .thumb { box-shadow: 0 0 22px rgba(34,211,238,.45); }
        .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); }
        .avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); }
        @media (prefers-reduced-motion: reduce) { #topics::before, #topics::after, .ml-hero h1 span, .ml-btn.solid::after, .hint { animation: none; } }

        /* ===== engagement features ===== */
        #scrollBar { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 99999; background: linear-gradient(90deg, var(--brand), var(--cyan)); }
        .totop { position: fixed; right: 22px; bottom: 22px; z-index: 999; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--brand); background: var(--card); color: #fff; font-size: 20px; cursor: pointer; opacity: 0; transform: translateY(20px); pointer-events: none; transition: .3s; box-shadow: 0 8px 22px rgba(59,130,246,.35); }
        .totop.on { opacity: 1; transform: none; pointer-events: auto; }
        .totop:hover { background: var(--brand); }
        .toast { position: fixed; left: 50%; bottom: 28px; z-index: 99999; transform: translate(-50%, 20px); opacity: 0; background: var(--card); color: #fff; border: 1px solid var(--brand); padding: 10px 20px; border-radius: 50px; font-size: 14px; pointer-events: none; transition: .3s; }
        .toast.on { opacity: 1; transform: translate(-50%, 0); }

        .resume { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 6px auto 30px; max-width: 760px; padding: 12px 20px; border-radius: 16px; color: var(--text); background: linear-gradient(90deg, rgba(59,130,246,.18), rgba(34,211,238,.12)); border: 1px solid var(--line); animation: cardIn .6s both; }
        .resume[hidden] { display: none; }
        .resume a { color: #fff; font-weight: 600; text-decoration: underline; text-decoration-color: var(--cyan); }
        .resume button { background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }

        .tools { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 6px; }
        .sort { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 50px; padding: 8px 16px; font-size: 14px; cursor: pointer; }
        .sort:focus-visible { outline: 3px solid var(--brand-dark); outline-offset: 2px; }

        .save { position: absolute; top: 14px; right: 14px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: rgba(7,13,31,.6); color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer; transition: .25s; }
        .save:hover { transform: scale(1.15); color: #fff; border-color: var(--brand); }
        .save[aria-pressed="true"] { color: #fb7185; border-color: #fb7185; background: rgba(251,113,133,.12); animation: pop .35s; }
        @keyframes pop { 50% { transform: scale(1.35); } }
        .seen { display: none; font-size: 12px; font-weight: 600; color: var(--cyan); }
        .visited .seen { display: inline; }
        .visited .ml-card { border-color: rgba(34,211,238,.35); }
        .ml-col.flash .ml-card { animation: flash 1.1s ease 2; }
        @keyframes flash { 50% { box-shadow: 0 0 0 4px rgba(34,211,238,.5), 0 20px 50px rgba(34,211,238,.4); transform: scale(1.03); } }

        .stepcnt { display: block; font-style: normal; font-size: 12px; color: var(--cyan); margin-top: 2px; }
        .prog { max-width: 560px; margin: 34px auto 0; text-align: center; color: var(--muted); font-size: 14px; }
        .bar { height: 10px; border-radius: 10px; background: var(--line); overflow: hidden; margin-bottom: 8px; }
        .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--cyan)); transition: width .9s ease; }

        .quiz { max-width: 720px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: 0 18px 50px rgba(59,130,246,.18); }
        .q-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
        .q-dots { display: flex; gap: 6px; } .q-dots i { width: 22px; height: 5px; border-radius: 4px; background: var(--line); } .q-dots i.on { background: var(--brand); }
        .quiz h4 { color: var(--navy); font-weight: 600; margin-bottom: 14px; }
        .q-opt { display: block; width: 100%; text-align: left; margin: 10px 0; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; transition: .2s; }
        .q-opt:hover:not(:disabled) { border-color: var(--brand); background: var(--soft); transform: translateX(4px); }
        .q-opt.ok { border-color: #34d399; background: rgba(52,211,153,.14); color: #fff; }
        .q-opt.bad { border-color: #fb7185; background: rgba(251,113,133,.14); color: #fff; }
        .q-fb { margin: 12px 0; min-height: 24px; color: var(--text); }
        .quiz .score { font-size: 3rem; font-weight: 700; background: linear-gradient(90deg, var(--brand-2), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
        .quiz .center { text-align: center; }
        @media (prefers-reduced-motion: reduce) { .save, .ml-col.flash .ml-card, .resume { animation: none; } .q-opt, .bar i { transition: none; } }

        /* dark overrides for the site's own search bar styles */
        .search-form .search-input { background: var(--card) !important; color: #fff !important; border: 1px solid var(--line) !important; }
        .search-form .search-input::placeholder { color: var(--muted); }
        .search-form .search-input:focus { border-color: var(--brand) !important; box-shadow: 0 0 0 4px rgba(59,130,246,.25) !important; }
        .search-form .search-icon { color: var(--brand-2) !important; }
        .no-results h4 { color: var(--navy); } .no-results p { color: var(--muted); }