:root {
            color-scheme: light;
            /* Light Theme Variables */
            --bg-primary: #f9fafb; /* gray-50 */
            --bg-secondary: #ffffff; /* white */
            --bg-tertiary: #f3f4f6; /* gray-100 */
            --bg-nav: rgba(255, 255, 255, 0.7);
            --bg-modal-backdrop: rgba(17, 24, 39, 0.7);
            --bg-code: #e5e7eb;
            --bg-details-open: #f3f4f6;

            --text-strong: #111827; /* gray-900 */
            --text-primary: #374151; /* gray-700 */
            --text-secondary: #6b7281; /* gray-500 */
            --text-accent: #0891b2; /* cyan-600 */
            --text-code: #1d4ed8;
            --text-on-brand: #ffffff;

            --border-primary: #e5e7eb; /* gray-200 */
            --border-secondary: #d1d5db; /* gray-300 */

            --ring-focus: #06b6d4; /* cyan-500 */

            --color-brand: #0e7490; /* cyan-700 */
            --color-brand-hover: #155e75; /* cyan-800 */

            --color-xp: #f59e0b; /* amber-500 */
            --color-easy: #16a34a; /* green-600 */
            --color-medium: #d97706; /* amber-600 */
            --color-hard: #dc2626; /* red-600 */

            --status-inprogress: #ca8a04; /* yellow-500 */
            --status-done: #16a34a; /* green-500 */
        }

        html.dark {
            /* Dark Theme Variables */
            --bg-primary: #111827; /* gray-900 */
            --bg-secondary: #1f2937; /* gray-800 */
            --bg-tertiary: #374151; /* gray-700 */
            --bg-nav: rgba(31, 41, 55, 0.6);
            --bg-modal-backdrop: rgba(0, 0, 0, 0.8);
            --bg-code: #374151;
            --bg-details-open: #374151;

            --text-strong: #ffffff;
            --text-primary: #d1d5db; /* gray-300 */
            --text-secondary: #9ca3af; /* gray-400 */
            --text-accent: #67e8f9; /* cyan-300 */
            --text-code: #93c5fd;
            --text-on-brand: #ffffff;

            --border-primary: #374151; /* gray-700 */
            --border-secondary: #4b5563; /* gray-600 */

            --ring-focus: #06b6d4; /* cyan-500 */

            --color-brand: #06b6d4; /* cyan-500 */
            --color-brand-hover: #0891b2; /* cyan-600 */

            --color-xp: #facc15; /* yellow-400 */
            --color-easy: #4ade80; /* green-400 */
            --color-medium: #facc15; /* yellow-400 */
            --color-hard: #f87171; /* red-400 */

            --status-inprogress: #eab308; /* yellow-500 */
            --status-done: #22c55e; /* green-500 */
        }

        [hidden] { display: none !important; }

        body {
            font-family: 'Poppins', sans-serif;
            background-color: var(--bg-primary);
            color: var(--text-primary);
            transition: background-color 0.3s ease, color 0.3s ease;
        }

        /* Theme Toggle Switch Styles */
        .theme-switch {
            position: relative;
            display: none;
            width: 50px;
            height: 28px;
        }
        .theme-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #4b5563;
            transition: .4s;
            border-radius: 28px;
        }
        .slider:before {
            position: absolute;
            content: "";
            height: 20px;
            width: 20px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
            /* Sun icon */
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="%23f59e0b"><path stroke-linecap="round" stroke-linejoin="round" d="M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z" /></svg>');
            background-repeat: no-repeat;
            background-position: center;
        }
        input:checked + .slider {
            background-color: var(--color-brand);
        }
        input:checked + .slider:before {
            transform: translateX(22px);
             /* Moon icon */
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="white"><path stroke-linecap="round" stroke-linejoin="round" d="M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z" /></svg>');
        }

        .modal-transition {
            transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
        }
        .modal-enter-from, .modal-leave-to { opacity: 0; transform: scale(0.95); }
        .modal-enter-to, .modal-leave-from { opacity: 1; transform: scale(1); }

        .steps-content ol, .steps-content ul {
            list-style-position: inside;
            margin-left: 1rem;
            margin-top: 0.5rem;
            margin-bottom: 1rem;
        }
        .steps-content ol { list-style-type: decimal; }
        .steps-content ul { list-style-type: disc; margin-left: 1.5rem; }
        .steps-content li { margin-bottom: 0.75rem; }
        .steps-content code { background-color: var(--bg-code); color: var(--text-code); padding: 0.25rem 0.5rem; border-radius: 0.375rem; font-family: monospace; font-size: 0.875rem; }
        .steps-content strong { color: var(--text-strong); }
        .steps-content h4 { font-size: 1.125rem; font-weight: 600; color: var(--text-strong); margin-top: 1rem; margin-bottom: 0.5rem; }
        .steps-content table {
            min-width: 100%;
            background-color: var(--bg-tertiary);
            border-radius: 0.5rem;
            text-align: left;
        }
        .steps-content th, .steps-content td { padding: 0.75rem; font-size: 0.875rem; }
        .steps-content th { font-weight: 600; color: var(--text-primary); background-color: var(--bg-tertiary); }
        .steps-content td { border-top: 1px solid var(--border-primary); }

        details[open] summary { background-color: var(--bg-details-open); }

        #toast-container { position: fixed; top: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
        .toast { background-color: var(--bg-secondary); color: var(--text-strong); padding: 12px 20px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); border-left: 4px solid var(--color-brand); opacity: 0; transform: translateX(100%); animation: slideIn 0.5s forwards, fadeOut 0.5s 2.5s forwards; }
        @keyframes slideIn { to { opacity: 1; transform: translateX(0); } }
        @keyframes fadeOut { to { opacity: 0; transform: translateX(100%); } }

        /* Stijlen voor video en PDF knop */
        .video-container {
            position: relative;
            padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
            height: 0;
            overflow: hidden;
            max-width: 100%;
            background: #000;
            border-radius: 0.75rem;
            margin-bottom: 1.5rem;
        }
        .video-container iframe {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }
        /* --- Progress‑ring --- */
        .progress-ring__background {
          stroke: var(--border-secondary);
          fill: transparent;
        }

        .progress-ring__circle {
          stroke: var(--color-brand);
          fill: transparent;
          stroke-linecap: round;
          transition: stroke-dashoffset 0.35s;
          transform-origin: center;
        }

        .progress-ring__text {
            font-size: 9px;
            font-weight: 700;
            fill: var(--text-strong);
        }

        .info-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.375rem; /* 6px */
            font-size: 0.75rem; /* 12px */
            font-weight: 500;
            padding: 0.25rem 0.5rem;
            border-radius: 9999px;
            background-color: var(--bg-tertiary);
            color: var(--text-secondary);
        }

        .info-badge.premium {
            color: var(--color-hard);
            background-color: rgba(220, 38, 38, 0.1); /* red-600 with 10% opacity */
        }

        html.dark .info-badge.premium {
            background-color: rgba(248, 113, 113, 0.15); /* red-400 with 15% opacity */
        }

        .tag-pill {
            display: inline-block;
            font-size: 0.75rem;
            font-weight: 500;
            padding: 0.125rem 0.625rem;
            border-radius: 9999px;
            background-color: var(--bg-tertiary);
            color: var(--text-secondary);
            border: 1px solid var(--border-primary);
        }

        /* Stijlen voor de nieuwe filterknoppen */
        .filter-btn {
            padding: 6px 16px;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.2s ease-in-out;
            border: 2px solid transparent;
            cursor: pointer;
            color: var(--text-secondary);
        }

        .filter-btn:hover {
            color: var(--text-strong);
        }

        .filter-btn.active {
            background-color: var(--bg-secondary);
            color: var(--text-strong);
            box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
            border-color: var(--border-secondary);
        }

        html.dark .filter-btn.active {
            box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
        }

        /* Stijlen voor de leerdoelen knop op de kaart */
        .show-objectives-btn {
            color: var(--text-secondary);
            transition: color 0.2s;
            padding: 0.25rem;
            border-radius: 9999px;
        }
        .show-objectives-btn:hover {
            color: var(--color-brand);
            background-color: var(--bg-tertiary);
        }

        /* Gedeelde stijlen voor het leerdoelenblok */
        .learning-objectives-block {
            padding: 1rem;
            margin-top: 1rem;
            background-color: rgba(59, 130, 246, 0.05); /* blue-500 met lage opacity */
            border: 1px solid rgba(59, 130, 246, 0.2);
            border-radius: 0.75rem;
        }

        html.dark .learning-objectives-block {
            background-color: rgba(59, 130, 246, 0.1);
            border-color: rgba(59, 130, 246, 0.3);
        }

        .learning-objectives-title {
            font-weight: 600;
            color: #1d4ed8; /* blue-700 */
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        html.dark .learning-objectives-title {
            color: #93c5fd; /* blue-300 */
        }

        .learning-objectives-list {
            list-style-type: disc;
            list-style-position: inside;
            font-size: 0.875rem;
            color: #1e40af; /* blue-800 */
        }
        html.dark .learning-objectives-list {
            color: #bfdbfe; /* blue-200 */
        }
        .learning-objectives-list li {
            margin-bottom: 0.25rem;
        }

        .auth-shell { max-width: 1120px; margin: 0 auto; }
        .auth-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2.5rem; }
        .auth-brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--text-strong); font-size: 1.25rem; font-weight: 700; text-decoration: none; }
        .auth-brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #0e7490; color: #fff; }
        .auth-back { color: var(--text-primary); font-size: .875rem; text-decoration: none; }
        .auth-back:hover { color: var(--text-accent); text-decoration: underline; }
        .auth-layout { display: grid; grid-template-columns: 1.08fr 1fr; overflow: hidden; border: 1px solid var(--border-primary); border-radius: 24px; background: var(--bg-secondary); box-shadow: 0 20px 60px -30px rgba(15, 23, 42, .3); }
        .auth-intro { position: relative; padding: 3rem; color: #374151; background: radial-gradient(ellipse at top left, #cffafe, transparent 75%), #f0f9ff; }
        .auth-eyebrow { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.5rem; font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
        .auth-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #0891b2; }
        .auth-intro h1 { max-width: 12ch; margin: 0 0 1rem; color: #111827; font-size: clamp(2rem, 3.5vw, 2.75rem); font-weight: 600; line-height: 1.2; letter-spacing: -.04em; }
        .auth-lead { margin: 0; max-width: 36ch; color: #4b5563; font-size: .9375rem; line-height: 1.8; }
        .auth-benefits { display: grid; gap: 1.25rem; margin: 2rem 0 0; padding: 0; list-style: none; }
        .auth-benefits li { display: flex; align-items: flex-start; gap: .875rem; }
        .auth-benefit-icon { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border: 1px solid #a5f3fc; border-radius: 10px; color: #0e7490; background: #ffffff; }
        .auth-benefits strong { display: block; margin-bottom: .2rem; color: #111827; font-size: .875rem; font-weight: 600; }
        .auth-benefits p { margin: 0; color: #4b5563; font-size: .8125rem; line-height: 1.65; }
        .auth-intro-note { margin: 2rem 0 0; padding-top: 1.25rem; border-top: 1px solid #a5f3fc; color: #4b5563; font-size: .75rem; line-height: 1.7; }
        .auth-demo-link { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1rem; color: #0e7490; font-size: .8125rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
        .auth-demo-link:hover { color: #155e75; }
        .auth-panel { align-self: center; padding: 3rem; }
        .auth-panel-label { margin: 0 0 .5rem; color: var(--text-accent); font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
        .auth-panel h2 { margin: 0 0 .75rem; color: var(--text-strong); font-size: 1.75rem; font-weight: 600; letter-spacing: -.03em; }
        .auth-panel-intro { margin: 0 0 2rem; color: var(--text-primary); font-size: .875rem; line-height: 1.7; }
        .auth-field { margin-bottom: 1.25rem; }
        .auth-field label { display: block; margin-bottom: .5rem; color: var(--text-strong); font-size: .8125rem; font-weight: 500; }
        .auth-field input { box-sizing: border-box; width: 100%; min-height: 48px; padding: .75rem 1rem; border: 1px solid var(--border-secondary); border-radius: 10px; background: var(--bg-secondary); color: var(--text-strong); font: inherit; font-size: 1rem; }
        .auth-field input::placeholder { color: var(--text-secondary); opacity: 1; }
        .auth-field input:focus { outline: 3px solid var(--ring-focus); outline-offset: 2px; border-color: var(--color-brand); }
        .auth-field-hint { margin: .5rem 0 0; color: var(--text-secondary); font-size: .75rem; line-height: 1.6; }
        .auth-submit, .auth-register { display: flex; align-items: center; justify-content: center; gap: .75rem; width: 100%; min-height: 48px; padding: .75rem 1rem; border-radius: 10px; font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; transition: background-color .2s, border-color .2s; }
        .auth-submit { border: 1px solid #0e7490; background: #0e7490; color: #fff; }
        .auth-submit:hover { border-color: #155e75; background: #155e75; }
        .auth-divider { display: flex; align-items: center; gap: .75rem; margin: 1.5rem 0 1rem; color: var(--text-secondary); font-size: .75rem; }
        .auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border-primary); }
        .auth-register { border: 1px solid var(--border-secondary); background: var(--bg-secondary); color: var(--text-strong); }
        .auth-register:hover { border-color: var(--text-secondary); background: var(--bg-tertiary); }
        .auth-error { margin: 1rem 0 0; color: #b91c1c; font-size: .8125rem; line-height: 1.6; overflow-wrap: anywhere; }
        .auth-error:empty { margin: 0; }
        html.dark .auth-error { color: #fca5a5; }
        .auth-reset { display: block; min-height: 44px; margin-top: .5rem; padding: .5rem 0; background: transparent; border: 0; color: var(--text-accent); font: inherit; font-size: .8125rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
        .auth-reset:disabled { opacity: .65; cursor: wait; }
        .auth-status { margin: 1rem 0 0; color: var(--text-primary); font-size: .8125rem; line-height: 1.7; }
        .auth-status:empty { margin: 0; }
        .auth-help { margin: 1.5rem 0 0; color: var(--text-secondary); font-size: .75rem; line-height: 1.8; text-align: center; }
        .auth-help a, .auth-footer a { color: var(--text-accent); text-decoration: underline; text-underline-offset: 3px; }
        .auth-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .75rem 1.5rem; margin-top: 1.5rem; color: var(--text-secondary); font-size: .75rem; line-height: 1.8; }
        .auth-footer p { margin: 0; }
        .auth-shell a:focus-visible, .auth-shell button:focus-visible { outline: 3px solid var(--ring-focus); outline-offset: 4px; }
        .learner-dashboard { color: var(--text-strong); }
        .learner-hero-card { overflow: hidden; border-color: #cfe9dc !important; background: radial-gradient(ellipse at 85% 15%, #e1f6ed 0, transparent 38%), linear-gradient(110deg, #f3fbf7, #ffffff) !important; }
        #toggle-dashboard-btn { display: none; }
        #dashboard-content > div:first-child { align-items: flex-start; }
        #dashboard-content h1 { margin-bottom: .35rem; color: #173a31; font-size: clamp(1.55rem, 3vw, 2.15rem); letter-spacing: -.04em; }
        #dashboard-content .progress-bar-background { height: 8px; overflow: hidden; border-radius: 99px; background: #dcebe3; }
        #dashboard-content .progress-bar-fill { height: 100%; border-radius: inherit; background: var(--status-done); }
        #dashboard-content .cta-button { display: inline-flex; min-height: 44px; align-items: center; gap: .6rem; padding: .65rem 1rem; border: 0; border-radius: 9px; background: var(--color-brand); color: #fff; font-size: .8125rem; font-weight: 600; cursor: pointer; }
        #dashboard-content .cta-button:hover { background: var(--color-brand-hover); }
        .dashboard-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
        .dashboard-kicker { margin: 0 0 .4rem; color: var(--color-brand); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
        .dashboard-section-heading h2 { margin: 0; color: var(--text-strong); font-size: clamp(1.25rem, 2vw, 1.65rem); font-weight: 700; letter-spacing: -.03em; }
        .dashboard-section-heading > div > p:last-child { margin: .4rem 0 0; color: var(--text-secondary); font-size: .875rem; }
        .dashboard-browse-link { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem 0; border: 0; background: transparent; color: var(--color-brand); font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer; }
        .dashboard-category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
        .dashboard-category-card { display: grid; min-height: 145px; grid-template-columns: 38px 1fr; grid-template-rows: auto auto 5px auto; align-content: start; align-items: center; column-gap: .8rem; row-gap: .45rem; padding: 1rem; border: 1px solid var(--border-primary); border-radius: 14px; background: var(--bg-secondary); color: var(--text-strong); text-align: left; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
        .dashboard-category-card:hover { transform: translateY(-2px); border-color: var(--color-brand); box-shadow: 0 10px 24px rgba(15, 23, 42, .08); }
        .dashboard-category-icon { display: grid; width: 38px; height: 38px; grid-row: 1 / 3; place-items: center; border-radius: 11px; background: color-mix(in srgb, var(--color-brand) 11%, white); color: var(--color-brand); font-size: 1.1rem; font-weight: 700; }
        .dashboard-category-title { overflow: hidden; font-size: .875rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
        .dashboard-category-count, .dashboard-category-completed { color: var(--text-secondary); font-size: .72rem; }
        .dashboard-category-progress { height: 5px; grid-column: 1 / -1; overflow: hidden; border-radius: 99px; background: var(--bg-tertiary); }
        .dashboard-category-progress span { display: block; height: 100%; border-radius: inherit; background: var(--status-done); transition: width .25s ease; }
        .dashboard-category-completed { grid-column: 1 / -1; }
        .active-category-filter { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .55rem .35rem .75rem; border: 1px solid var(--border-secondary); border-radius: 999px; background: var(--bg-secondary); color: var(--text-primary); font-size: .75rem; }
        .active-category-filter[hidden] { display: none; }
        .active-category-filter button { display: grid; width: 22px; height: 22px; place-items: center; border: 0; border-radius: 50%; background: var(--bg-tertiary); color: var(--text-primary); font-size: 1rem; cursor: pointer; }
        .learner-dashboard button:focus-visible, #view-controls button:focus-visible { outline: 3px solid var(--ring-focus); outline-offset: 3px; }
        @media (max-width: 900px) {
            .dashboard-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        }
        @media (max-width: 700px) {
            #dashboard-content > div:first-child { gap: .75rem; }
            #dashboard-content > div:first-child > .text-right { text-align: left; }
            #dashboard-content .cta-button { width: 100%; justify-content: center; }
            .dashboard-section-heading { align-items: start; flex-direction: column; }
            .dashboard-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
            .dashboard-category-card { min-height: 132px; padding: .8rem; }
            #view-controls > div { align-items: flex-start; }
            #view-controls .flex.items-center.gap-4.flex-wrap { width: 100%; }
            #exercise-controls { flex-wrap: wrap; gap: .5rem; }
        }
        @media (max-width: 380px) {
            .dashboard-category-grid { grid-template-columns: 1fr; }
            .dashboard-category-card { min-height: 112px; }
        }
        @media (max-width: 900px) {
            .auth-intro, .auth-panel { padding: 2rem; }
        }
        @media (max-width: 700px) {
            .auth-topbar { margin-bottom: 1.5rem; }
            .auth-layout { grid-template-columns: 1fr; border-radius: 18px; }
            .auth-intro, .auth-panel { padding: 1.75rem; }
            .auth-panel { order: -1; }
            .auth-intro h1 { max-width: 20ch; font-size: 2rem; }
            .auth-lead { max-width: none; }
            .auth-benefits { gap: 1rem; margin-top: 1.5rem; }
            .auth-intro-note { margin-top: 1.5rem; }
            .auth-eyebrow { margin-bottom: 1rem; }
        }
        @media (prefers-reduced-motion: reduce) {
            .auth-shell button { transition: none; }
        }
