
        /* ==========================================================================
           CSS Variables & Tokens
        ========================================================================== */
        :root {
            --app-viewport-height: 100vh;
            --hue-primary: 215;
            --color-primary: #00a79d;
            --color-primary-glow: rgba(0, 167, 157, 0.25);

            --color-accent: #fff200;
            --color-accent-glow: rgba(255, 242, 0, 0.25);

            --color-success: #3eaf46;
            --color-error: #ef4444;

            /* Light Theme */
            --bg-body: #ffffff;
            --bg-card: #f2faf9;
            --lesson-card-bg: #ffffff;
            --bg-glass: rgba(255, 255, 255, 0.7);
            --border-glass: rgba(255, 255, 255, 0.5);

            --text-main: #333333;
            --text-muted: #555859;

            --input-bg: #ffffff;
            --input-border: #bcc8d0;

            --header-bg: rgba(255, 255, 255, 0.8);
            --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
            --shadow-hover: 0 20px 40px -10px rgba(0, 0, 0, 0.12);

            --font-primary: 'Roboto', system-ui, sans-serif;
            --font-heading: 'Roboto', system-ui, sans-serif;

            --radius-sm: 12px;
            --radius-md: 20px;
            --radius-lg: 32px;
            --radius-pill: 999px;

            --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        @supports (height: 100dvh) {
            :root { --app-viewport-height: 100dvh; }
        }

        html[data-theme=dark], body.dark-mode {
            /* Dark Theme */
            --bg-body: #282829;
            --bg-card: #383839;
            --lesson-card-bg: #383839;
            --bg-glass: rgba(15, 23, 42, 0.7);
            --border-glass: rgba(255, 255, 255, 0.05);

            --text-main: #ffffff;
            --text-muted: #e2eaf0;

            --input-bg: #333333;
            --input-border: #737677;

            --header-bg: rgba(2, 6, 23, 0.8);
            --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
            --shadow-hover: 0 20px 40px -10px rgba(0, 0, 0, 0.7);

            --color-primary: #12ccc1;
            --color-accent: #fff200;
        }

        /* ==========================================================================
           Reset & Base Styles
        ========================================================================== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html {
            overflow-x: clip;
            -webkit-text-size-adjust: 100%;
            text-size-adjust: 100%;
        }

        body {
            font-family: var(--font-primary);
            background-color: var(--bg-body);
            color: var(--text-main);
            line-height: 1.6;
            min-height: var(--app-viewport-height);
            overflow-x: hidden;
            position: relative;
            transition: background-color var(--transition-smooth), color var(--transition-smooth);
        }

        h1, h2, h3, h4, h5, h6 {
            font-family: var(--font-heading);
            font-weight: 700;
        }

        .bg-shape {
            display: none;
        }

        .shape1 {
            width: 50vw;
            height: 50vw;
            background: var(--color-primary);
            top: -20vh;
            left: -20vw;
        }

        .shape2 {
            width: 60vw;
            height: 60vw;
            background: var(--color-accent);
            bottom: -30vh;
            right: -20vw;
            animation-duration: 25s;
            animation-delay: -5s;
            opacity: 0.2;
        }

        @keyframes float {
            0% {
                transform: translate(0, 0) scale(1);
            }

            100% {
                transform: translate(10vw, 5vh) scale(1.1);
            }
        }

        h1,
        h2,
        h3,
        h4,
        h5,
        h6 {
            font-weight: 700;
            line-height: 1.2;
            margin-bottom: 0.5em;
            letter-spacing: -0.02em;
        }

        p {
            margin-bottom: 1rem;
        }

        button {
            font-family: var(--font-primary);
            cursor: pointer;
            border: none;
            outline: none;
        }

        input,
        select {
            font-family: var(--font-primary);
        }

        .hidden {
            display: none !important;
        }

        .mt-10 {
            margin-top: 10px;
        }

        .mt-20 {
            margin-top: 20px;
        }

        .mt-30 {
            margin-top: 30px;
        }

        .full-width {
            width: 100%;
        }

        .logo {
            font-size: 2rem;
            font-weight: 700;
            letter-spacing: -1px;
            display: flex;
            align-items: center;
            gap: 0.2rem;
        }

        .logo-text-lms {
            color: #073763;
            font-weight: 700;
        }

        body.dark-mode .logo-text-lms {
            color: #ffffff;
        }

        .logo-large {
            font-size: 4rem;
            font-weight: 800;
            color: var(--text-main);
            margin-bottom: 1rem;
            letter-spacing: -2px;
        }

        .logo-large span {
            color: var(--color-accent);
        }

        #app {
            display: flex;
            flex-direction: column;
            min-height: var(--app-viewport-height);
        }

        #main-header {
            background: var(--header-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-bottom: 1px solid var(--border-glass);
            position: sticky;
            top: 0;
            z-index: 100;
            transition: all var(--transition-smooth);
        }

        /* Keep the course completion indicator visible after the header leaves
           the natural scroll position.  It is toggled by academy.js once the
           learner starts scrolling the lesson. */
        #course-header-progress.is-floating {
            position: fixed !important;
            top: 0 !important;
            bottom: auto !important;
            left: 0 !important;
            z-index: 110;
            box-shadow: 0 1px 8px rgba(15, 23, 42, 0.18);
        }

        #course-header-progress.is-test-progress #course-header-progress-bar {
            background: var(--color-accent) !important;
        }

        .header-content {
            max-width: 1400px;
            margin: 0 auto;
            padding: 1rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: relative;
        }

        .nav-controls {
            display: flex;
            align-items: center;
            gap: 1.5rem;
        }

        .profile-identity {
            display: flex;
            flex-direction: column;
            min-width: 0;
            line-height: 1.15;
            text-align: left;
        }

        .profile-client-id {
            margin-top: 0.12rem;
            font-size: 0.68em;
            font-weight: 600;
            letter-spacing: 0.02em;
            opacity: 0.72;
        }

        .badge {
            background: var(--color-accent);
            color: #000;
            padding: 0.3rem 0.8rem;
            border-radius: var(--radius-pill);
            font-size: 0.8rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .badge-outline {
            background: transparent;
            border: 1px solid var(--text-muted);
            color: var(--text-muted);
        }

        #main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            padding: 2rem;
            max-width: 1400px;
            margin: 0 auto;
            width: 100%;
            position: relative;
        }

        .view {
            display: none;
            flex: 1;
            animation: fadeIn var(--transition-smooth) forwards;
        }

        .view.active {
            display: flex;
            flex-direction: column;
        }

        /* Components */
        .glass-panel {
            background: var(--bg-glass);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-soft);
            transition: var(--transition-smooth);
        }

        .card {
            background: var(--bg-card);
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-lg);
            padding: 2.5rem;
            box-shadow: var(--shadow-soft);
            transition: var(--transition-smooth);
        }






        .btn-section-locked {
            background: var(--button-disabled-bg);
            color: var(--button-disabled-ink);
            box-shadow: none;
            cursor: not-allowed;
        }

        .btn-section-locked::before {
            display: none;
        }

        .section-stopwatch {
            display: block;
            margin: 6px auto 0;
            width: 20px;
            height: 20px;
            transform: rotate(-90deg);
        }

        .section-stopwatch-track {
            stroke: #00a79d;
            opacity: 0.22;
        }

        .section-stopwatch-arc {
            stroke: #00a79d;
            opacity: 0.85;
            stroke-dasharray: 37.70;
            stroke-dashoffset: 37.70;
        }

        .section-stopwatch-arc.running {
            animation: sweepArc var(--section-unlock-delay, 30s) linear forwards;
        }

        .section-countdown {
            display: block;
            min-height: 1em;
            margin-top: 3px;
            font-size: 0.72rem;
            font-variant-numeric: tabular-nums;
            opacity: 0.82;
        }

        @keyframes sweepArc {
            to {
                stroke-dashoffset: 0;
            }
        }

        @keyframes continueUnlock {
            0% {
                transform: scale(0.93);
            }

            55% {
                transform: scale(1.04);
            }

            100% {
                transform: scale(1);
            }
        }





        .btn-back {
            background: rgba(255, 255, 255, 0.78);
            border: 1px solid rgba(15, 23, 42, 0.14);
            box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
            color: #1e3a8a;
            font-weight: 700;
            padding: 0.5rem 0.85rem;
            margin-bottom: 2rem;
            transition: var(--transition-bounce);
            display: inline-flex;
            align-self: flex-start;
            align-items: center;
            border-radius: var(--radius-pill);
            font-size: 1.1rem;
            line-height: 1.2;
        }

        .btn-back:hover {
            background: #ffffff;
            border-color: rgba(30, 58, 138, 0.42);
            box-shadow: 0 8px 18px rgba(30, 58, 138, 0.16);
            color: #172554;
            transform: translateX(-4px);
        }

        .btn-back:focus-visible {
            outline: 3px solid var(--color-accent);
            outline-offset: 3px;
        }

        body.dark-mode .btn-back {
            background: rgba(15, 23, 42, 0.8);
            border-color: rgba(191, 219, 254, 0.35);
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
            color: #dbeafe;
        }

        body.dark-mode .btn-back:hover {
            background: #1e3a8a;
            border-color: #bfdbfe;
            color: #ffffff;
        }

        label {
            font-weight: 600;
            font-size: 0.9rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        input[type="text"],
        input[type="password"],
        input[type="url"],
        select {
            width: 100%;
            padding: 1.2rem 1.5rem;
            border-radius: var(--radius-md);
            border: 2px solid var(--input-border);
            background: var(--input-bg);
            color: var(--text-main);
            font-size: 1rem;
            transition: var(--transition-fast);
        }

        input:focus,
        select:focus {
            border-color: var(--color-primary);
            background: var(--bg-card);
            outline: none;
            box-shadow: 0 0 0 4px var(--color-primary-glow);
        }

        .toggle-label {
            display: flex;
            align-items: center;
            gap: 1rem;
            cursor: pointer;
            background: var(--input-bg);
            padding: 1.2rem;
            border-radius: var(--radius-md);
            border: 1px solid var(--input-border);
            transition: var(--transition-fast);
        }

        .toggle-label:hover {
            border-color: var(--color-primary);
        }

        .toggle-label input[type="checkbox"] {
            width: 24px;
            height: 24px;
            accent-color: var(--color-primary);
            cursor: pointer;
        }

        .toggle-label input[type="radio"] {
            width: 24px;
            height: 24px;
            accent-color: var(--color-primary);
            cursor: pointer;
        }

        .divider {
            display: flex;
            align-items: center;
            text-align: center;
            color: var(--text-muted);
            font-weight: 700;
            margin: 2rem 0;
            text-transform: uppercase;
            letter-spacing: 2px;
            font-size: 0.8rem;
        }

        .divider::before,
        .divider::after {
            content: '';
            flex: 1;
            border-bottom: 1px solid var(--border-glass);
        }

        .divider::before {
            margin-right: 1em;
        }

        .divider::after {
            margin-left: 1em;
        }

        /* Switch Toggle for Dark Mode & Filters */
        .switch {
            position: relative;
            display: inline-block;
            width: 60px;
            height: 34px;
        }

        .switch input {
            position: absolute;
            inset: 0;
            opacity: 0;
            width: 100%;
            height: 100%;
            margin: 0;
            z-index: 2;
            cursor: pointer;
        }
        .switch input:focus-visible + .slider { outline: 3px solid var(--color-accent); outline-offset: 3px; }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: var(--input-border);
            transition: .4s;
            border-radius: 34px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 26px;
            width: 26px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }

        input:checked+.slider {
            background-color: var(--color-primary);
        }

        input:focus+.slider {
            box-shadow: 0 0 1px var(--color-primary);
        }

        input:checked+.slider:before {
            transform: translateX(26px);
        }

        /* Dashboard Grids */
        .dashboard-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            flex-wrap: wrap;
            gap: 1rem;
            width: 100%;
        }

        .category-section {
            margin-bottom: 4rem;
        }

        .category-title {
            border-bottom: 3px solid var(--color-accent);
            display: inline-block;
            padding-bottom: 0.5rem;
            margin-bottom: 2rem;
            font-size: 1.5rem;
        }

        .course-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 2rem;
        }

        .course-card {
            background: var(--bg-card);
            border-radius: var(--radius-lg);
            padding: 2rem;
            box-shadow: var(--shadow-soft);
            transition: var(--transition-bounce);
            display: flex;
            flex-direction: column;
            border: 1px solid var(--border-glass);
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }

        .course-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 6px;
            background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
            transform: scaleX(0);
            transform-origin: left;
            transition: var(--transition-smooth);
        }

        .course-card:hover {
            transform: translateY(-10px) scale(1.02);
            box-shadow: var(--shadow-hover);
            border-color: var(--border-glass);
        }

        .course-card:hover::before {
            transform: scaleX(1);
        }

        .course-card.locked {
            opacity: 0.4;
            filter: grayscale(100%);
            cursor: not-allowed;
            pointer-events: auto;
        }

        .course-card.locked:hover {
            transform: none;
            box-shadow: var(--shadow-soft);
            border-color: var(--border-glass);
        }

        .course-card.locked::before {
            display: none;
        }

        .course-card h3 {
            margin: 0 0 0.5rem 0;
            font-size: 1.4rem;
            line-height: 1.3;
        }

        .course-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 1rem;
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--text-muted);
            letter-spacing: 0.5px;
            flex: 1;
            text-transform: none;
        }

        /* Visual Dashboard Stats (Learner) */
        .dashboard-overview {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 2rem;
            margin-bottom: 3rem;
        }

        .cert-banner {
            display: flex;
            align-items: center;
            gap: 2rem;
            padding: 2.5rem;
            background: #e6f8f6;
            color: var(--text-main);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-soft);
            position: relative;
            overflow: hidden;
            border: 1px solid rgba(0, 167, 157, 0.22);
        }

        .cert-banner::after {
            content: '';
            position: absolute;
            top: -50%;
            right: -20%;
            width: 300px;
            height: 300px;
            background: radial-gradient(circle, rgba(0, 167, 157, 0.14) 0%, rgba(0, 167, 157, 0) 70%);
            border-radius: 50%;
            pointer-events: none;
        }

        .cert-banner-icon {
            font-size: 5rem;
        }

        #bundle-cert-icon {
            display: grid;
            place-items: center;
            width: 5rem;
            height: 5rem;
            flex-shrink: 0;
            overflow: hidden;
            border-radius: 20px;
        }

        .cert-banner-text h3 {
            color: var(--text-main);
            font-size: 1.8rem;
            margin-bottom: 0.5rem;
        }

        .cert-banner-text p {
            color: var(--text-muted);
            font-size: 1rem;
        }

        .progress-bar-container {
            height: 12px;
            background: rgba(0, 0, 0, 0.2);
            border-radius: var(--radius-pill);
            overflow: hidden;
            margin-top: 1.5rem;
        }

        .progress-bar {
            height: 100%;
            background: var(--color-accent);
            width: 0%;
            transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 0 10px var(--color-accent-glow);
        }

        .language-test-next-step {
            flex: 0 0 100%;
            position: relative;
            z-index: 1;
        }

        .language-test-next-step-card {
            margin-top: 1rem;
            padding: 1.05rem;
            border: 1px solid rgba(37, 99, 235, 0.2);
            border-radius: 20px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(237, 245, 255, 0.9));
            box-shadow: 0 12px 26px rgba(28, 66, 135, 0.1);
            color: var(--text-main);
            text-align: left;
        }

        .language-test-next-step-heading {
            display: flex;
            align-items: flex-start;
            gap: 0.8rem;
        }

        .language-test-next-step-icon {
            flex: 0 0 auto;
            display: grid;
            width: 2.55rem;
            height: 2.55rem;
            place-items: center;
            border-radius: 13px;
            background: var(--color-primary);
            box-shadow: 0 5px 12px rgba(37, 99, 235, 0.24);
            font-size: 1.25rem;
            line-height: 1;
        }

        .language-test-next-step-content {
            min-width: 0;
            margin: 0.8rem 0 0 3.35rem;
        }

        .language-test-next-step-heading-copy {
            min-width: 0;
            flex: 1;
        }

        .language-test-next-step-card h3 {
            margin: 0;
            color: inherit;
            font-size: 1.1rem;
            line-height: 1.25;
        }

        .language-test-next-step-card p {
            margin: 0;
            line-height: 1.45;
        }

        .language-test-requirement {
            margin-top: 0.32rem !important;
            color: var(--text-muted);
            font-size: 0.88rem;
            font-weight: 650;
        }

        .language-test-action-copy {
            margin-top: 0 !important;
            color: var(--text-muted);
            font-size: 0.92rem;
        }

        .language-test-contact {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.8rem;
            margin-top: 0.8rem;
            padding: 0.72rem 0.78rem;
            border: 1px solid rgba(37, 99, 235, 0.14);
            border-radius: 14px;
            background: rgba(37, 99, 235, 0.06);
        }

        .language-test-contact-person {
            display: flex;
            align-items: center;
            min-width: 0;
            gap: 0.55rem;
        }

        .language-test-contact-avatar {
            display: grid;
            flex: 0 0 auto;
            width: 2rem;
            height: 2rem;
            place-items: center;
            border-radius: 50%;
            background: rgba(37, 99, 235, 0.13);
            font-size: 0.95rem;
        }

        .language-test-contact-label {
            display: block;
            margin-bottom: 0.05rem;
            color: var(--text-muted);
            font-size: 0.68rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        .language-test-contact strong {
            display: block;
            overflow: hidden;
            font-size: 0.94rem;
            line-height: 1.25;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .language-test-contact-actions {
            display: flex;
            flex-wrap: wrap;
            flex: 0 0 auto;
            gap: 0.45rem;
        }



        .language-test-compact-status {
            display: flex;
            align-items: center;
            gap: 0.45rem;
            margin-top: 0.9rem;
            padding: 0.55rem 0.7rem;
            border: 1px solid rgba(255, 255, 255, 0.45);
            border-radius: var(--radius-sm);
            background: rgba(0, 0, 0, 0.12);
            color: #fff;
            font-size: 0.82rem;
            font-weight: 700;
            line-height: 1.3;
        }

        #bundle-cert-banner .language-test-next-step-card {
            background: var(--bg-card);
            border-color: var(--input-border);
            box-shadow: none;
            color: var(--text-main);
        }

        #bundle-cert-banner .language-test-action-copy,
        #bundle-cert-banner .language-test-contact-label {
            color: var(--text-muted);
        }

        #bundle-cert-banner .language-test-contact {
            background: var(--bg-card);
            border-color: var(--input-border);
        }

        #bundle-cert-banner .language-test-next-step-icon {
            background: var(--color-accent);
            box-shadow: 0 5px 12px rgba(255, 225, 82, 0.2);
        }

        #bundle-cert-banner .language-test-contact-avatar {
            background: var(--shell-soft);
        }

        #bundle-cert-banner .language-test-contact strong {
            color: var(--text-main);
        }



        /* Keep the certificate view calm and opaque in dark mode. */
        html[data-theme=dark] #bundle-cert-banner,
        body.dark-mode #bundle-cert-banner {
            background: linear-gradient(135deg, #243f43 0%, #243a55 100%);
            border: 1px solid rgba(18, 204, 193, 0.34);
            box-shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
        }

        html[data-theme=dark] #bundle-cert-banner::after,
        body.dark-mode #bundle-cert-banner::after {
            background: radial-gradient(circle, rgba(18, 204, 193, 0.12) 0%, rgba(18, 204, 193, 0) 70%);
            opacity: 0.65;
        }

        html[data-theme=dark] #bundle-cert-banner .progress-bar-container,
        body.dark-mode #bundle-cert-banner .progress-bar-container {
            background: rgba(226, 234, 240, 0.18);
        }

        html[data-theme=dark] #bundle-cert-banner .progress-bar,
        body.dark-mode #bundle-cert-banner .progress-bar {
            box-shadow: none;
        }

        html[data-theme=dark] #bundle-cert-banner .language-test-next-step-card,
        body.dark-mode #bundle-cert-banner .language-test-next-step-card {
            background: #2b3a43;
            border-color: rgba(226, 234, 240, 0.24);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
        }

        html[data-theme=dark] #bundle-cert-banner .language-test-action-copy,
        html[data-theme=dark] #bundle-cert-banner .language-test-contact-label,
        body.dark-mode #bundle-cert-banner .language-test-action-copy,
        body.dark-mode #bundle-cert-banner .language-test-contact-label {
            color: #f5f7f8;
        }

        html[data-theme=dark] #bundle-cert-banner .language-test-contact,
        body.dark-mode #bundle-cert-banner .language-test-contact {
            background: #232d33;
            border-color: rgba(226, 234, 240, 0.24);
        }

        html[data-theme=dark] #bundle-cert-banner .language-test-contact-avatar,
        body.dark-mode #bundle-cert-banner .language-test-contact-avatar {
            background: #3a484f;
            border-color: rgba(226, 234, 240, 0.24);
            color: #ffffff;
        }

        html[data-theme=dark] #bundle-cert-banner #toggle-completed-wrapper,
        body.dark-mode #bundle-cert-banner #toggle-completed-wrapper {
            border-top-color: rgba(226, 234, 240, 0.22) !important;
        }

        html[data-theme=dark] .stat-card.glass-panel,
        body.dark-mode .stat-card.glass-panel {
            background: #383839;
            border-color: #4c555a;
            box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
        }

        /* Keep the icon beside the heading without letting its height create
           an artificial gap before the explanatory sentence. */
        @container (min-width: 421px) {
            #bundle-cert-banner .language-test-next-step-card {
                position: relative;
                display: block;
            }

            #bundle-cert-banner .language-test-next-step-heading {
                display: block;
            }

            #bundle-cert-banner .language-test-next-step-icon {
                position: absolute;
                top: 1.9rem;
                left: 1.05rem;
            }

            #bundle-cert-banner .language-test-next-step-heading-copy {
                margin-left: 3.35rem;
                padding-top: 0.45rem;
            }

            #bundle-cert-banner .language-test-next-step-content {
                margin: 0 0 0 3.35rem;
            }
        }

        .stats-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
        }

        .stat-card {
            padding: 2rem;
            text-align: center;
            display: flex;
            flex-direction: column;
            justify-content: center;
            position: relative;
        }

        .stat-value {
            font-size: 3.5rem;
            font-weight: 800;
            color: var(--text-main);
            line-height: 1;
            margin-bottom: 0.5rem;
            background: -webkit-linear-gradient(45deg, var(--color-primary), var(--color-accent));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .stat-label {
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            font-size: 0.85rem;
            letter-spacing: 1.5px;
        }

        /* Article Viewer */
        .article-container {
            max-width: 900px;
            margin: 0 auto;
            width: 100%;
            padding: 4rem !important;
        }

        .article-meta {
            margin-bottom: 2rem;
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
            text-transform: uppercase;
        }

        .article-title {
            font-size: 3rem;
            color: var(--text-main);
            margin-bottom: 0.5rem;
            line-height: 1.2;
            letter-spacing: -1px;
        }

        .article-subtitle {
            color: var(--text-muted);
            font-size: 1.4rem;
            font-weight: 500;
            margin-bottom: 3rem;
        }

        .article-content {
            display: flex;
            flex-direction: column;
            gap: 2.5rem;
            font-size: 1.2rem;
            line-height: 1.8;
            color: var(--text-main);
        }

        .article-content h2 {
            color: var(--text-main);
            margin-top: 1rem;
            font-size: 2rem;
            padding-bottom: 0.5rem;
        }

        .article-content ul {
            padding-left: 2rem;
        }

        .article-content .details-box {
            background: var(--input-bg);
            padding: 2rem;
            border-left: 5px solid var(--color-primary);
            border-radius: 0 var(--radius-md) var(--radius-md) 0;
            font-weight: 500;
            font-style: italic;
        }

        .video-wrapper {
            position: relative;
            padding-bottom: 56.25%;
            height: 0;
            overflow: hidden;
            border-radius: var(--radius-lg);
            background: #000;
            box-shadow: var(--shadow-hover);
        }

        .video-wrapper iframe, .video-wrapper video {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: none;
        }

        /* YouTube's embed shows a Copy link / Share bar at the top; it lives inside the
           cross-origin iframe, so block pointer events over that strip instead. */
        .video-wrapper:has(iframe[src*="youtube"])::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4rem;
            z-index: 1;
        }

        .video-wrapper p {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1.5rem;
            margin: 0;
            color: #fff;
            text-align: center;
        }

        .course-section {
            transition: opacity 0.4s ease;
        }

        /* Quiz Viewer */
        .test-container {
            max-width: 800px;
            margin: 0 auto;
            width: 100%;
            padding: 4rem !important;
        }

        .test-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
        }

        .test-header h2 {
            margin: 0;
        }

        .quiz-question-container {
            min-height: 400px;
        }

        .question-text {
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 3rem;
            color: var(--text-main);
            line-height: 1.4;
        }

        .options-grid {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .option-label {
            display: flex;
            align-items: center;
            padding: 1.5rem 2rem;
            background: var(--input-bg);
            border: 2px solid var(--input-border);
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: var(--transition-bounce);
            font-weight: 600;
            font-size: 1.1rem;
            text-transform: none;
            letter-spacing: normal;
            color: var(--text-main);
        }

        .option-label:hover {
            border-color: var(--color-primary);
            transform: translateX(10px);
            background: var(--bg-card);
        }

        .option-label input[type="radio"] {
            margin-right: 1.5rem;
            width: 24px;
            height: 24px;
            accent-color: var(--color-primary);
            cursor: pointer;
        }

        .option-label.selected {
            border-color: var(--color-primary);
            background: var(--bg-card);
            box-shadow: 0 10px 20px var(--color-primary-glow);
            transform: translateX(10px);
        }

        /* Results & Certificate Utilities */
        #view-quiz-results {
            justify-content: center;
            align-items: center;
            text-align: center;
        }

        .results-card {
            padding: 5rem 3rem;
            text-align: center;
            max-width: 600px;
            width: 100%;
        }

        .score-circle {
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 3rem auto;
            position: relative;
            transition: background 1.5s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: var(--shadow-hover);
        }

        .score-circle::before {
            content: '';
            position: absolute;
            inset: 15px;
            background: var(--bg-card);
            border-radius: 50%;
            z-index: 1;
            transition: background-color var(--transition-smooth);
        }

        .confetti-container {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            pointer-events: none;
            z-index: 100;
            overflow: hidden;
        }

        .confetti-piece {
            position: absolute;
            width: 15px;
            height: 15px;
            opacity: 0;
            border-radius: 2px;
        }

        /* Exportable Certificate */
        .exportable-certificate {
            container-type: inline-size;
            position: relative;
            width: 100%;
            aspect-ratio: 210 / 297;
            background:
                radial-gradient(120% 120% at 100% 100%, #e9edf0 0%, rgba(244, 246, 247, 0) 45%),
                radial-gradient(120% 120% at 0% 0%, #eef1f3 0%, rgba(244, 246, 247, 0) 40%),
                linear-gradient(135deg, #ffffff 0%, #f6f8f9 50%, #ffffff 100%);
            overflow: hidden;
            box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18);
            font-family: 'Roboto', sans-serif;
            max-width: 900px;
            margin: 0 auto;
        }

        .exportable-certificate .cert-swoosh,
        .exportable-certificate .cert-frame {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
            pointer-events: none;
        }

        .exportable-certificate .cert-content {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            padding: 6% 9% 20%;
            overflow: hidden;
            z-index: 2;
        }

        .exportable-certificate .cert-logo {
            width: 17%;
            aspect-ratio: 1;
            border-radius: 28px;
            overflow: hidden;
            margin-top: 2%;
            flex-shrink: 0;
        }

        .exportable-certificate .cert-logo img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .exportable-certificate h1 {
            font-family: 'Roboto', sans-serif;
            font-weight: 400;
            font-size: 6.0cqw;
            letter-spacing: 7px;
            color: #3a3a3a;
            margin: 3% 0 0;
            padding-left: 7px;
            text-transform: uppercase;
        }

        .exportable-certificate .cert-given {
            font-size: 2.5cqw;
            color: #4a4a4a;
            margin-top: 2.5%;
            letter-spacing: 0.5px;
        }

        .exportable-certificate .cert-recipient {
            font-family: 'Playfair Display', serif;
            font-style: italic;
            font-weight: 600;
            font-size: 6.0cqw;
            color: #1a3a63;
            margin-top: 2%;
        }

        .exportable-certificate .cert-name-line {
            width: 60%;
            border-bottom: 1.5px solid #1a3a63;
            margin-top: 2%;
        }

        .exportable-certificate .cert-label {
            font-size: 2.5cqw;
            font-weight: 400;
            color: #4a4a4a;
            letter-spacing: 0.3px;
            margin-top: 2.5%;
        }

        .exportable-certificate .cert-course {
            font-family: 'Playfair Display', serif;
            font-weight: 600;
            font-size: 5.5cqw;
            line-height: 1.12;
            color: #1a3a63;
            margin-top: 1.5%;
            max-width: 92%;
        }

        .exportable-certificate .cert-topics-label {
            font-size: 2.2cqw;
            font-weight: 500;
            letter-spacing: 1px;
            text-transform: uppercase;
            color: #6a7077;
            margin-top: 4%;
            align-self: flex-start;
        }

        .exportable-certificate .cert-topics {
            font-size: 1.9cqw;
            font-weight: 300;
            color: #4a4a4a;
            line-height: 2.0;
            margin-top: 0.6%;
            width: 100%;
            text-align: left;
        }

        .exportable-certificate .cert-topics.two-col {
            column-count: 2;
            column-gap: 6%;
        }

        .exportable-certificate .cert-topic-item {
            break-inside: avoid;
        }

        .exportable-certificate .cert-topic-item::before {
            content: '— ';
            color: #2fc4b2;
            font-weight: 500;
        }

        .exportable-certificate .cert-signatures {
            position: absolute;
            bottom: 8%;
            left: 10%;
            right: 10%;
            display: grid;
            grid-template-columns: 35% 1fr 35%;
            z-index: 2;
        }

        .exportable-certificate .cert-sig-above {
            align-self: end;
            text-align: center;
        }

        .exportable-certificate .cert-sig-below {
            align-self: start;
            text-align: center;
        }

        .exportable-certificate .cert-sig-scribble {
            width: 62%;
            height: auto;
            display: block;
            margin: 0 auto 4px;
            transform: rotate(-4deg);
        }

        .exportable-certificate .cert-sig-name {
            font-size: 1.3cqw;
            color: #666;
            font-style: italic;
            margin-top: 3px;
        }

        .exportable-certificate .cert-sig-date {
            font-family: 'Roboto', sans-serif;
            font-weight: 500;
            font-size: 1.75cqw;
            color: #1a3a63;
            letter-spacing: 1px;
            padding-bottom: 6px;
        }

        .exportable-certificate .cert-sig-line {
            border-bottom: 1.5px solid #1a3a63;
            margin-bottom: 8px;
        }

        .exportable-certificate .cert-sig-label {
            font-size: 1.6cqw;
            letter-spacing: 4px;
            color: #555;
            text-transform: uppercase;
        }

        .exportable-certificate .cert-disclaimer {
            position: absolute;
            bottom: 4.5%;
            left: 0;
            right: 0;
            text-align: center;
            font-size: 1.4cqw;
            letter-spacing: 0.3px;
            color: #aab0b6;
            font-weight: 300;
            font-style: italic;
            z-index: 2;
        }

        #profile-certificates-list .exportable-certificate {
            max-width: 440px;
        }

        /* Animations */
        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(40px);
            }

            to {
                opacity: 1;
            }
        }

        @keyframes scaleUp {
            from {
                opacity: 0;
                transform: scale(0.9);
            }

            to {
                opacity: 1;
            }
        }

        @keyframes pulse {

            0%,
            100% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.05);
            }
        }

        @keyframes fall {
            0% {
                opacity: 1;
                top: -10%;
                transform: translateX(0) rotate(0deg);
            }

            100% {
                opacity: 0;
                top: 100%;
                transform: translateX(100px) rotate(720deg);
            }
        }

        .fade-in-up {
            opacity: 0;
            /* Hold the first transform during stagger delays: otherwise a button
               jumps under the pointer when the animation starts and loses clicks. */
            animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
        }

        .scale-up {
            opacity: 0;
            animation: scaleUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
        }

        .stagger-1 {
            animation-delay: 0.1s;
        }

        .stagger-2 {
            animation-delay: 0.2s;
        }

        .stagger-3 {
            animation-delay: 0.3s;
        }

        /* Responsive UI */
        @media (max-width: 900px) {
            .dashboard-overview {
                grid-template-columns: minmax(0, 1fr);
            }

            .stats-grid {
                grid-template-columns: 1fr 1fr;
            }
        }

        @media (max-width: 768px) {
            #main-content {
                padding: 0;
            }

            .dashboard-overview,
            .dashboard-header,
            .course-grid,
            #profile-certificates-list {
                padding: 0 0.5rem;
            }

            #profile-certificates-list .exportable-certificate {
                max-width: 320px;
            }

            .dashboard-overview {
                gap: 1rem;
                margin-bottom: 1.5rem;
            }

            .bg-shape {
                display: none;
            }

            .header-content {
                padding: 0.6rem 1rem;
                flex-direction: row;
                justify-content: space-between;
                align-items: center;
                gap: 0.5rem;
            }

            .nav-controls {
                flex-wrap: nowrap;
                justify-content: flex-end;
                gap: 0.5rem;
            }

            .nav-controls .btn-secondary {
                font-size: 0.8rem;
                padding: 0.4rem 0.8rem;
            }

            .logo {
                font-size: 1.4rem;
            }

            .logo img {
                height: 1.8rem !important;
                margin-right: 0.3rem !important;
            }

            .cert-banner {
                flex-direction: column;
                text-align: center;
                padding: 1rem;
                gap: 0.5rem;
                border-radius: 12px;
            }

            .stats-grid {
                grid-template-columns: 1fr 1fr;
                gap: 0.5rem;
            }

            .cert-banner>div:last-child {
                padding-top: 0.5rem;
                margin-top: 0.2rem;
            }

            #btn-claim-certificate {
                padding: 0.6rem 1rem;
                font-size: 0.9rem;
                width: 100%;
            }

            .language-test-next-step-card {
                padding: 0.9rem;
            }

            .language-test-next-step-icon {
                width: 2.3rem;
                height: 2.3rem;
                border-radius: 11px;
                font-size: 1.15rem;
            }

            .language-test-next-step-content {
                margin-left: 0;
            }

            .language-test-contact {
                align-items: stretch;
                flex-direction: column;
            }

            .language-test-contact-actions {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                width: 100%;
            }


            .language-test-compact-status {
                justify-content: center;
                text-align: left;
                font-size: 0.78rem;
            }

            .article-container,
            .test-container {
                padding: 1rem 0.5rem !important;
                border-radius: 0;
                border: none;
                background: transparent;
                box-shadow: none;
                margin: 0;
            }

            .article-title {
                font-size: 1.5rem;
            }

            .test-header {
                margin-bottom: 0.8rem;
            }

            .test-header h2 {
                font-size: 1rem;
            }

            #test-progress-text {
                font-size: 0.7rem;
                padding: 0.2rem 0.6rem;
            }

            .question-text {
                font-size: 0.85rem;
                margin-bottom: 1.2rem;
            }

            .options-grid {
                gap: 0.5rem;
            }

            .option-label {
                padding: 0.8rem 1rem;
                font-size: 0.95rem;
                border-radius: 6px;
            }

            .option-label input[type="radio"] {
                width: 18px;
                height: 18px;
                margin-right: 0.8rem;
            }

            .quiz-question-container {
                min-height: auto;
            }

            #btn-next-question {
                font-size: 0.8rem;
                padding: 0.8rem;
                margin-top: 1rem;
            }

            .stat-value {
                font-size: 1.5rem !important;
                margin-bottom: 0.1rem;
            }

            .stat-card {
                padding: 0.8rem;
            }

            .stat-label {
                font-size: 0.65rem;
            }

            .cert-banner-text h3 {
                font-size: 1.1rem;
                margin-bottom: 0.2rem;
            }

            .cert-banner-text p {
                font-size: 0.8rem;
                margin-bottom: 0.5rem;
                line-height: 1.2;
            }

            .cert-banner-icon {
                font-size: 2rem;
            }

            .progress-bar-container {
                height: 6px;
                margin-top: 0.5rem;
            }

            /* Courses List */
            .course-grid {
                grid-template-columns: 1fr;
                gap: 0.8rem;
            }

            .course-card {
                padding: 1rem;
            }

            .course-card h3 {
                font-size: 1.1rem;
                margin: 0 0 0.5rem 0;
            }

            .course-meta {
                font-size: 0.65rem;
            }


        }

        .global-lang-bar {
            position: absolute;
            top: 1rem;
            right: 2rem;
            z-index: 1000;
        }

        .global-lang-select {
            width: auto !important;
            min-width: 100px;
            padding: 0.5rem 1rem !important;
            border-radius: var(--radius-pill) !important;
            background-color: var(--bg-card) !important;
            border: 1px solid var(--border-glass) !important;
            box-shadow: var(--shadow-soft) !important;
            font-size: 1rem !important;
            color: var(--text-main) !important;
            cursor: pointer;
        }

        .global-lang-select:hover {
            border-color: var(--color-primary) !important;
        }

        @media (max-width: 768px) {
            .global-lang-bar {
                top: 0.5rem;
                right: 0.5rem;
            }

            .global-lang-select {
                font-size: 0.9rem !important;
                padding: 0.3rem 0.8rem !important;
            }
        }

        .skel {
            background: linear-gradient(90deg, var(--input-border) 25%, var(--bg-card) 50%, var(--input-border) 75%);
            background-size: 200% 100%;
            animation: shimmer 1.5s ease-in-out infinite;
            border-radius: 8px;
        }

.skeleton-line {
            height: 1rem;
            max-width: 100%;
        }

        .skeleton-line-title {
            width: min(70%, 18rem);
            height: 1.5rem;
        }

        .skeleton-line-description-short {
            width: 68%;
        }

        @keyframes shimmer {
            0% {
                background-position: 200% 0;
            }

            100% {
                background-position: -200% 0;
            }
        }

        /* Interactive Games Elements */
        .game-card {
            background: var(--input-bg);
            border: 2px solid var(--input-border);
            border-radius: var(--radius-md);
            padding: 1.5rem;
            margin: 2rem 0;
            box-shadow: var(--shadow-soft);
        }

        .game-instructions {
            color: var(--text-muted);
            margin-bottom: 2rem;
            font-weight: 500;
            font-size: 1.1rem;
        }

        .game-feedback {
            margin-top: 1.5rem;
            font-weight: 700;
            text-align: center;
            min-height: 24px;
            transition: 0.3s;
            font-size: 1.1rem;
        }

        .sequence-list {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            margin-bottom: 2rem;
        }

        .sequence-item {
            background: var(--bg-card);
            border: 2px solid var(--input-border);
            border-radius: 12px;
            padding: 1rem 1.5rem;
            display: flex;
            align-items: center;
            gap: 1rem;
            cursor: grab;
            transition: box-shadow 0.2s, border-color 0.2s;
            user-select: none;
            font-weight: 600;
            touch-action: none;
        }

        .sequence-item:hover {
            border-color: var(--color-primary);
        }

        .sortable-ghost {
            opacity: 0.4;
            background: var(--input-border);
            border: 2px dashed var(--text-muted);
        }

        .sortable-drag {
            cursor: grabbing !important;
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
            background: var(--bg-card);
            border-color: var(--color-primary);
            opacity: 1 !important;
        }

        .drag-handle-game {
            color: var(--text-muted);
            font-size: 1.5rem;
            display: flex;
            align-items: center;
            cursor: grab;
        }

        .sequence-item.correct {
            border-color: var(--color-success);
            background: rgba(16, 185, 129, 0.1);
        }

        .sequence-item.incorrect {
            border-color: var(--color-error);
            background: rgba(239, 68, 68, 0.1);
        }

        .cloze-text {
            font-size: 1.2rem;
            line-height: 2;
            color: var(--text-main);
        }

        .cloze-select {
            font-family: inherit;
            font-size: 1.1rem;
            padding: 0.4rem;
            border: 2px solid var(--input-border);
            border-radius: 8px;
            background: var(--bg-card);
            cursor: pointer;
            color: var(--text-main);
            font-weight: 600;
            margin: 0 0.3rem;
        }

        .triage-card {
            background: var(--bg-card);
            border: 2px solid var(--color-primary);
            border-radius: 12px;
            padding: 3rem 2rem;
            text-align: center;
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 2rem;
        }

        .triage-buttons {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .triage-buttons .btn-secondary {
            flex: 1;
            min-width: 120px;
        }

        .chat-msg {
            padding: 1rem;
            border-radius: 12px;
            margin-bottom: 1rem;
            max-width: 85%;
            line-height: 1.4;
            font-size: 1.1rem;
        }

        .msg-patient {
            background: var(--bg-card);
            border: 1px solid var(--input-border);
            align-self: flex-start;
        }

        .msg-system {
            background: rgba(16, 185, 129, 0.1);
            color: var(--color-success);
            border: 1px solid var(--color-success);
            align-self: flex-end;
            font-weight: 700;
        }

        .chat-container {
            display: flex;
            flex-direction: column;
            margin-bottom: 1.5rem;
        }

        .chat-options {
            display: flex;
            flex-direction: column;
            gap: 0.8rem;
        }

        .chat-btn {
            background: var(--bg-card);
            border: 2px solid var(--color-primary);
            padding: 1rem;
            border-radius: 12px;
            cursor: pointer;
            text-align: left;
            font-family: inherit;
            font-weight: 600;
            font-size: 1rem;
            transition: 0.2s;
            color: var(--text-main);
        }

        .chat-btn:hover {
            background: var(--color-primary);
            color: white;
        }

        .matching-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.5rem;
        }

        .match-col {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .match-item {
            padding: 1.2rem;
            border: 2px solid var(--input-border);
            border-radius: 12px;
            background: var(--bg-card);
            cursor: pointer;
            font-weight: 600;
            text-align: center;
            transition: 0.2s;
            font-size: 1.1rem;
        }

        .match-item.selected {
            border-color: var(--color-primary);
            background: var(--color-primary-glow);
        }

        .match-item.matched {
            border-color: var(--color-success);
            background: rgba(16, 185, 129, 0.1);
            cursor: default;
        }

        @media (max-width: 768px) {
            .game-card {
                padding: 1rem 0.8rem;
                margin: 0.8rem 0;
            }

            .game-instructions {
                font-size: 0.9rem;
                margin-bottom: 0.8rem;
            }

            .sequence-item {
                padding: 0.6rem 0.8rem;
                font-size: 0.95rem;
                gap: 0.5rem;
                border-radius: 6px;
            }

            .drag-handle-game {
                font-size: 1rem;
            }

            .cloze-text {
                font-size: 0.95rem;
                line-height: 1.5;
            }

            .cloze-select {
                font-size: 0.95rem;
                padding: 0.3rem;
            }

            .triage-card {
                padding: 1rem 0.5rem;
                font-size: 1rem;
                margin-bottom: 0.8rem;
                border-radius: 6px;
            }

            .triage-buttons {
                flex-direction: column;
            }

            .triage-buttons .btn-secondary {
                font-size: 0.95rem;
                padding: 0.8rem;
            }

            .chat-msg {
                font-size: 0.95rem;
                padding: 0.8rem;
                margin-bottom: 0.5rem;
                border-radius: 8px;
            }

            .chat-btn {
                font-size: 0.95rem;
                padding: 0.8rem;
                border-radius: 8px;
            }

            .matching-grid {
                gap: 0.4rem;
                grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
                width: 100%;
                min-width: 0;
            }

            .match-col {
                gap: 0.4rem;
                min-width: 0;
                overflow: hidden;
            }

            .match-item {
                padding: 0.6rem 0.2rem;
                font-size: 0.85rem;
                border-radius: 6px;
                overflow-wrap: break-word;
                word-break: break-all;
                hyphens: auto;
                line-height: 1.2;
                min-width: 0;
                max-width: 100%;
            }
        }

        /* Home Page Course Hub */
        .home-course-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 2rem;
            margin-top: 1rem;
        }

        .home-course-card {
            display: flex;
            align-items: center;
            gap: 2rem;
            padding: 2.5rem;
            background: linear-gradient(135deg, var(--color-primary), #1e40af);
            color: white;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-soft);
            position: relative;
            overflow: hidden;
            border: none;
            cursor: default;
            transition: var(--transition-bounce);
            flex-wrap: wrap;
        }

        .home-course-card::after {
            content: '';
            position: absolute;
            top: -50%;
            right: -20%;
            width: 300px;
            height: 300px;
            background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
            border-radius: 50%;
            pointer-events: none;
        }

        .home-course-card:hover {
            transform: translateY(-6px) scale(1.01);
            box-shadow: var(--shadow-hover);
        }

        .home-course-card .cert-banner-icon {
            z-index: 1;
            font-size: 4rem;
        }

        .home-course-card .cert-banner-text {
            z-index: 1;
            flex: 1;
            min-width: 250px;
        }

        .home-course-card .cert-banner-text h3 {
            color: white;
            font-size: 1.8rem;
            margin-bottom: 0.5rem;
        }

        .home-course-card .cert-banner-text p {
            color: rgba(255, 255, 255, 0.8);
            font-size: 1rem;
        }

        .home-course-card.completed-bundle {
            background: linear-gradient(135deg, #059669, #10b981);
        }

        .home-course-card.locked-bundle {
            cursor: not-allowed;
            filter: grayscale(75%);
            opacity: 0.62;
        }

        .home-course-card.locked-bundle:hover {
            transform: none;
            box-shadow: var(--shadow-soft);
        }

        .home-card-desc {
            display: -webkit-box;
            -webkit-line-clamp: 3;
            line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
            margin-bottom: 0;
            text-align: left;
        }

        .home-card-desc.expanded {
            display: block;
            overflow: visible;
        }




        .student-view-title {
            margin-bottom: 1.5rem;
            font-size: 1.8rem;
        }

        .home-title {
            font-size: 2rem;
            margin-bottom: 0.5rem;
        }


        @media (max-width: 768px) {

            /* view-home: pad content to match the 0.5rem system used by other views */
            #view-home .fade-in-up.stagger-1,
            #home-course-grid {
                padding: 0 0.5rem;
            }

            #view-home .fade-in-up.stagger-1 {
                margin-top: 0.5rem;
            }

            /* view-student: back btn and title weren't in the original padding list */
            #view-student .btn-back,
            #view-student .student-view-title {
                padding-left: 0.5rem;
                padding-right: 0.5rem;
            }

            .btn-back {
                margin-bottom: 0.5rem;
            }

            .student-view-title {
                margin-bottom: 0.5rem;
                font-size: 1.3rem;
            }

            /* Home page compactness */
            .home-title {
                font-size: 1.4rem;
                margin-bottom: 0.25rem;
            }


            .home-course-grid {
                gap: 0.75rem;
                margin-top: 0.25rem;
            }

            /* Home card: column layout, full-width text block so content centres properly */
            .home-course-card {
                flex-direction: column;
                align-items: center;
                text-align: center;
                padding: 1rem;
                gap: 0.5rem;
            }

            .home-course-card .cert-banner-icon {
                font-size: 2rem;
            }

            .home-course-card .cert-banner-text {
                width: 100%;
                min-width: 0;
            }





            .home-course-card .cert-banner-text h3 {
                font-size: 1.1rem;
                margin-bottom: 0.25rem;
            }

            .home-course-card .cert-banner-text p {
                font-size: 0.85rem;
            }

            /* dashboard-overview: contain it fully within the viewport */
            .dashboard-overview {
                grid-template-columns: minmax(0, 1fr);
                width: 100%;
                max-width: 100%;
                overflow: hidden;
            }

            #bundle-cert-banner {
                /* The desktop card uses a 100% flex basis for a new row.  In a
                   column layout that basis becomes 100% of the banner height,
                   which pushed the next-step card out of the visible area. */
                flex-wrap: nowrap !important;
                align-items: stretch !important;
                width: 100%;
                box-sizing: border-box;
            }

            #bundle-cert-banner .cert-banner-text {
                min-width: 0 !important;
                width: 100%;
            }

            #bundle-cert-banner .language-test-next-step {
                flex: 0 0 auto;
                width: 100%;
            }

            /* category-title: give it breathing room from the edge */
            .category-section {
                padding-left: 0.5rem;
                padding-right: 0.5rem;
            }

            /* content-body: override the 2rem inline padding on its .card wrapper */
            .content-group.card {
                padding: 1rem 0.75rem !important;
            }
        }

        @media (max-width: 360px) {
            .header-content {
                padding: 0.4rem 0.5rem;
                gap: 0.25rem;
            }

            .logo {
                font-size: 1rem;
                gap: 0.1rem;
                min-width: 0;
                overflow: hidden;
            }

            .logo img {
                height: 1.3rem !important;
                margin-right: 0.15rem !important;
            }

            .nav-controls {
                gap: 0.3rem;
                flex-shrink: 0;
            }

            .global-lang-select {
                min-width: 55px !important;
                padding: 0.2rem 0.35rem !important;
                font-size: 0.8rem !important;
            }
        }

        .locked-toast {
            position: fixed;
            top: 50%;
            left: 50%;
            bottom: auto !important;
            transform: translateX(-50%) translateY(-50%);
            background: var(--text-main);
            color: var(--bg-body);
            width: max-content;
            max-width: min(560px, calc(100vw - 32px));
            height: auto;
            min-height: 0;
            box-sizing: border-box;
            padding: 0.9rem 1.25rem;
            border-radius: var(--radius-pill);
            font-weight: 700;
            line-height: 1.35;
            text-align: center;
            z-index: 9999;
            pointer-events: none;
            white-space: normal;
            overflow-wrap: anywhere;
            animation: toast-in 0.3s ease, toast-out 0.4s ease 2.1s forwards;
        }

        /* Focused interaction polish -------------------------------------------------
           Keep the lesson UI calm and legible at both theme extremes. These rules
           intentionally live at the end so they also cover the responsive shell
           overrides above. */
        .language-test-next-step-icon,
        .language-test-status-icon,
        .language-test-contact-avatar {
            color: #1955ae;
        }

        .language-test-next-step-icon {
            width: 2.7rem;
            height: 2.7rem;
            background: #e7f0ff;
            border: 1px solid #c4d9fb;
            box-shadow: 0 6px 14px rgba(37, 99, 235, 0.16);
        }

        .language-test-next-step-icon svg,
        .language-test-status-icon svg,
        .language-test-contact-avatar svg {
            display: block;
            width: 1.35rem;
            height: 1.35rem;
            fill: none;
            stroke: currentColor;
            stroke-linecap: round;
            stroke-linejoin: round;
            stroke-width: 1.8;
        }

        .language-test-contact-avatar {
            background: #e7f0ff;
            border: 1px solid #c4d9fb;
            box-shadow: none;
        }

        .language-test-status-icon {
            display: inline-grid;
            flex: 0 0 auto;
            width: 1.45rem;
            height: 1.45rem;
            place-items: center;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.16);
        }

        .language-test-status-icon svg {
            width: 1rem;
            height: 1rem;
        }

        html[data-theme=dark] .language-test-next-step-icon,
        body.dark-mode .language-test-next-step-icon {
            background: #1d4ed8;
            border-color: #60a5fa;
            color: #fff;
            box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
        }

        html[data-theme=dark] .language-test-contact-avatar,
        body.dark-mode .language-test-contact-avatar {
            background: #183a72;
            border-color: #3b82f6;
            color: #dbeafe;
        }

        html[data-theme=dark] .language-test-status-icon,
        body.dark-mode .language-test-status-icon {
            color: #bfdbfe;
            background: rgba(96, 165, 250, 0.2);
        }

        #bundle-cert-banner .language-test-next-step-icon {
            background: var(--color-accent);
            border-color: transparent;
            color: #14324a;
        }

        #bundle-cert-banner .language-test-contact-avatar {
            background: rgba(255, 255, 255, 0.16);
            border-color: rgba(255, 255, 255, 0.26);
            color: #fff;
        }





        .course-card {
            transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
        }

        .course-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
            border-color: var(--color-primary);
        }

        .course-card.locked:hover {
            transform: none;
            box-shadow: var(--shadow-soft);
        }

        #view-course-article .article-container {
            max-width: 1080px;
            padding: clamp(1rem, 3vw, 3rem) !important;
        }

        #view-course-article .article-container > .content-group.card {
            margin-inline: auto;
            max-width: 920px;
            padding: 0.85rem 1rem !important;
            border: 1px solid var(--input-border);
            background: var(--lesson-card-bg);
            box-shadow: var(--shadow-soft);
        }

        #view-course-article .article-title {
            max-width: 820px;
            font-size: clamp(1.5rem, 3.5vw, 2.25rem);
            line-height: 1.15;
            letter-spacing: -0.03em;
            text-wrap: balance;
            margin-bottom: 0;
        }

        #view-course-article .article-container > .content-group.card .article-meta {
            margin-bottom: 0.5rem;
        }

        #view-course-article .article-subtitle {
            max-width: 820px;
            margin-bottom: 0;
            font-size: clamp(1rem, 1.7vw, 1.3rem);
            line-height: 1.55;
        }

        #view-course-article .article-content {
            max-width: 920px;
            margin-inline: auto;
            gap: 1.5rem;
            font-size: 1rem;
            line-height: 1.7;
        }

        #view-course-article .article-content .course-section {
            margin-bottom: 1.5rem !important;
            padding-bottom: 1.5rem !important;
        }

        #view-course-article .article-content .content-group.card {
            padding: clamp(1.1rem, 2.5vw, 2rem) !important;
            border: 1px solid var(--input-border);
            border-radius: var(--radius-md);
            background: var(--lesson-card-bg);
            box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
        }

        #view-course-article .article-content .content-body,
        #view-course-article .article-content p {
            font-size: 1rem !important;
            line-height: 1.7 !important;
            overflow-wrap: anywhere;
        }

        #view-course-article .article-content h2 {
            font-size: clamp(1.35rem, 2.3vw, 1.85rem) !important;
            line-height: 1.25;
        }

        #view-course-article .game-card {
            margin: 0;
            padding: clamp(1rem, 2.4vw, 1.5rem);
            border: 1px solid var(--input-border);
            border-top: 3px solid var(--color-primary);
            border-radius: var(--radius-md);
            background: var(--bg-card);
            box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
        }

        #view-course-article .game-card h3 {
            margin-bottom: 0.45rem !important;
            font-size: clamp(1.2rem, 2.3vw, 1.55rem) !important;
            line-height: 1.3;
        }

        #view-course-article .game-instructions {
            margin-bottom: 1.25rem;
            font-size: 1rem;
            line-height: 1.55;
        }

        #view-course-article .sequence-list,
        #view-course-article .chat-options,
        #view-course-article .match-col {
            gap: 0.7rem;
        }

        #view-course-article .sequence-item,
        #view-course-article .chat-btn,
        #view-course-article .match-item,
        #view-course-article .triage-buttons .btn-secondary {
            min-height: 48px;
            padding: 0.8rem 1rem;
            border-width: 1px;
            border-radius: 12px;
            font-size: 1rem;
            line-height: 1.4;
            overflow-wrap: anywhere;
            word-break: normal;
            transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
        }

        #view-course-article .sequence-item:hover,
        #view-course-article .chat-btn:hover,
        #view-course-article .match-item:hover {
            transform: translateY(-1px);
            box-shadow: 0 5px 12px rgba(15, 23, 42, 0.1);
        }

        #view-course-article .cloze-text {
            font-size: 1rem;
            line-height: 1.75;
            overflow-wrap: anywhere;
        }

        #view-course-article .cloze-select {
            max-width: 100%;
            min-height: 42px;
            padding: 0.45rem 0.65rem;
            font-size: 1rem;
        }

        #view-course-article .triage-card {
            margin-bottom: 1.25rem;
            padding: clamp(1.2rem, 4vw, 2rem);
            border-width: 1px;
            font-size: clamp(1.1rem, 2.5vw, 1.45rem);
            line-height: 1.4;
        }

        #view-course-article .matching-grid {
            gap: 1rem;
        }

        @media (max-width: 680px) {
            #view-course-article .article-container {
                padding: 0.75rem 0 !important;
            }

            #view-course-article .article-container > div:first-child {
                padding-inline: 0.25rem;
            }

            #view-course-article .article-title {
                font-size: clamp(1.35rem, 6vw, 1.75rem);
            }

            #view-course-article .article-content .content-group.card {
                border-radius: 18px;
            }

            #view-course-article .matching-grid {
                gap: 0.55rem;
            }

            #view-course-article .match-item {
                padding-inline: 0.2rem;
                font-size: 0.92rem;
            }
        }

        @keyframes toast-in {
            from {
                opacity: 0;
                transform: translateX(-50%) translateY(calc(-50% + 10px));
            }

            to {
                opacity: 1;
                transform: translateX(-50%) translateY(-50%);
            }
        }

        @keyframes toast-out {
            to {
                opacity: 0;
                transform: translateX(-50%) translateY(calc(-50% + 10px));
            }
        }

        .rate-limit-toast {
            position: fixed;
            top: 1.5rem;
            left: 50%;
            transform: translateX(-50%) translateY(-120%);
            background: var(--color-error, #e53e3e);
            color: #fff;
            padding: 0.9rem 1.6rem;
            border-radius: 10px;
            font-size: 0.95rem;
            font-weight: 500;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
            z-index: 9999;
            transition: transform 0.3s ease;
            max-width: 90vw;
            text-align: center;
            pointer-events: none;
            visibility: hidden;
        }

        .rate-limit-toast.visible {
            transform: translateX(-50%) translateY(0);
            visibility: visible;
        }

        /* ============================================================
           AI VOICE HELPER
           ============================================================ */
        .ai-helper-fab {
            position: fixed;
            bottom: 1.5rem;
            right: 1.5rem;
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background: var(--color-accent);
            color: #000;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
            cursor: pointer;
            box-shadow: 0 4px 15px var(--color-accent-glow);
            transition: var(--transition-bounce);
            z-index: 950;
        }

        .ai-helper-fab:hover {
            transform: translateY(-3px) scale(1.05);
            box-shadow: 0 8px 25px var(--color-accent-glow);
        }

        .ai-helper-popover {
            position: fixed;
            bottom: 5.5rem;
            right: 1.5rem;
            width: 320px;
            max-width: calc(100vw - 2rem);
            background: var(--bg-card);
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-lg);
            box-shadow: 0 12px 48px rgba(0, 0, 0, 0.22);
            padding: 1.5rem;
            z-index: 951;
        }

        .ai-helper-popover h3 {
            margin: 0 0 0.5rem 0;
            font-size: 1.15rem;
            color: var(--text-main);
        }

        .ai-helper-popover>p {
            font-size: 0.9rem;
            color: var(--text-muted);
            margin: 0 0 1rem 0;
            line-height: 1.5;
        }

        .ai-helper-steps {
            margin: 0 0 1.2rem 0;
            padding-left: 1.2rem;
            font-size: 0.9rem;
            color: var(--text-main);
            line-height: 1.6;
        }

        .ai-helper-cta {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            width: 100%;
            text-align: center;
            text-decoration: none;
            margin-bottom: 0.8rem;
        }

        .ai-helper-reassurance {
            font-size: 0.8rem;
            color: var(--text-muted);
            font-style: italic;
            margin: 0;
        }

        .ai-helper-info-note {
            display: flex;
            align-items: flex-start;
            gap: 0.5rem;
            margin-top: 0.9rem;
            padding-top: 0.9rem;
            border-top: 1px solid var(--border-glass);
            font-size: 0.78rem;
            color: var(--text-muted);
            line-height: 1.5;
        }

        .ai-helper-info-note .ai-helper-i {
            flex-shrink: 0;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            border: 1.5px solid var(--text-muted);
            font-size: 0.7rem;
            font-weight: 700;
            font-style: italic;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-top: 0.1rem;
        }

        .ai-helper-info-note svg {
            flex-shrink: 0;
            vertical-align: -3px;
        }

        .ai-helper-pretest-card {
            background: var(--bg-card);
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-md);
            padding: 1rem 1.5rem;
            margin-bottom: 1rem;
            text-align: center;
        }

        @media (max-width: 480px) {
            .ai-helper-pretest-card {
                padding: 0.75rem 1rem;
                margin-bottom: 0.75rem;
            }
        }

        .ai-helper-pretest-card h4 {
            margin: 0 0 0.4rem 0;
            font-size: 1.1rem;
            color: var(--text-main);
        }

        .funeasylearn-title {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        .funeasylearn-logo {
            flex: none;
            width: 24px;
            height: 24px;
            border-radius: 6px;
            object-fit: contain;
        }

        .ai-helper-pretest-card>p {
            font-size: 0.9rem;
            color: var(--text-muted);
            margin: 0 0 0.75rem 0;
        }

        @media (max-width: 480px) {
            .ai-helper-pretest-card>p {
                margin-bottom: 0.5rem;
            }
        }

        .ai-helper-pretest-cta {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            text-decoration: none;
            border: 1px solid var(--input-border);
        }

        .funeasylearn-actions-row {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 0.75rem;
        }

        .funeasylearn-actions-row>a {
            flex: 0 0 auto;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            text-decoration: none;
            border: 1px solid var(--input-border);
        }

        .article-actions {
            text-align: center;
        }

        .article-actions :is(.btn-primary, .btn-secondary) {
            font-size: 1.1rem;
        }

        @media (max-width: 480px) {
            .article-actions :is(.btn-primary, .btn-secondary) {
                padding-inline: 0.85rem;
                padding-block: 0.4rem;
                min-height: 40px;
            }
        }

        .ai-helper-pretest-footer {
            font-size: 0.8rem;
            color: var(--text-muted);
            font-style: italic;
            margin: 0.5rem 0 0 0;
        }

        @media (max-width: 480px) {
            .ai-helper-popover {
                bottom: 5rem;
                right: 1rem;
                width: calc(100vw - 2rem);
            }

            .ai-helper-fab {
                bottom: 1rem;
                right: 1rem;
            }
        }

        /* Academy application shell: fixed landmarks, with one content scroll. */
        :root {
            --shell-header-height: 76px;
            --shell-nav-height: 80px;
            --shell-ink: #073763;
            --shell-blue: #0e819c;
            --shell-soft: #e2eaf0;
            --shell-green: var(--color-success);
            --shell-green-soft: #eaf6f0;
            /* Language pill / install button on the (now white) header —
               same e2eaf0 as --shell-soft, at 50% so it still reads as a
               chip against the white bar behind it rather than disappearing
               into it. Not color-mix(): unsupported browsers resolve an
               unrecognized value to transparent, with no fallback. */
            --shell-chip-bg: rgba(226, 234, 240, .5);
        }

        html[data-theme=dark], body.dark-mode { --shell-ink: #ffffff; --shell-blue: #12ccc1; --shell-soft: #333333; --shell-green: #8bdf91; --shell-green-soft: #333333; --shell-chip-bg: rgba(51, 51, 51, .5); }
        #app { padding-top: calc(var(--shell-header-height) + env(safe-area-inset-top, 0px)); padding-bottom: calc(var(--shell-nav-height) + env(safe-area-inset-bottom, 0px) + 24px); }
        .bg-shape { display: none; }
        #main-header { position: fixed; inset: 0 0 auto; height: calc(var(--shell-header-height) + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); border-bottom: 1px solid var(--input-border); background: var(--bg-body); z-index: 120; }
        /* justify-content: flex-start overrides the base .header-content's
           space-between (line 248) — with that, hiding #shell-back (most
           views) pushes the logo to the far right instead of the left, and
           showing it (lesson view) pushes the logo further right still,
           straight under #shell-top-right's fixed language/install widget. */
        .header-content { height: 100%; max-width: 1220px; padding: 0 32px; gap: 16px; flex-wrap: nowrap; justify-content: flex-start; }
        .shell-logo { display: inline-flex; align-items: center; min-height: 44px; gap: 0; border: 0; padding: 0; background: none; color: var(--shell-ink); font: 700 26px/1 var(--font-primary); cursor: pointer; white-space: nowrap; flex: none; }
        .shell-logo img { width: 38px !important; height: 38px !important; margin-right: 10px !important; box-shadow: none !important; }
        .shell-logo .logo-text-lms { color: var(--shell-ink); -webkit-text-fill-color: currentColor; background: none; }
        /* Lesson/article view shows #shell-back — the wordmark isn't needed
           next to it (the icon alone still shows a way home), and dropping
           it frees the ~90px narrow phones need so the logo doesn't run
           under #shell-top-right's fixed language/install widget. */
        #shell-back:not([hidden]) ~ .shell-logo .logo-text-lms { display: none; }
        .shell-context { padding-left: 20px; border-left: 1px solid var(--input-border); color: var(--text-muted); font-size: 15px; }
        .shell-context:empty { display: none; }
        .nav-controls { margin-left: auto; flex: none; gap: 10px; align-items: center; }
        .shell-icon-button, .shell-install { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 8px; cursor: pointer; font: 600 14px/1.2 var(--font-primary); border: 0; border-radius: 12px; }
        .shell-icon-button { width: 44px; color: var(--shell-ink); background: var(--input-bg); font-size: 28px; }
        /* Language picker + install widget, fixed to the screen's top-right
           corner — moved out of #main-header so both stay visible even where
           the header itself is hidden (desktop), instead of duplicating the
           language select or the install prompt per view. */
        #shell-top-right {
            position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 16px; z-index: 150;
            display: flex; align-items: center; gap: 10px;
        }
        .shell-install {
            padding: 10px 15px; color: var(--shell-ink); background: var(--shell-chip-bg); box-shadow: var(--shadow-soft);
        }
        /* Keep the full native language list, with a compact visible value. */
        .header-language-picker { position: relative; width: 84px; height: 44px; flex: 0 0 84px; border-radius: 12px; color: var(--shell-ink); background: var(--shell-chip-bg); box-shadow: var(--shadow-soft); }
        .header-language-current { position: absolute; inset: 0; display: flex; align-items: center; gap: 6px; padding: 0 9px; pointer-events: none; font: 700 14px/1 var(--font-primary); }
        .header-language-current svg { width: 12px; height: 12px; margin-left: auto; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
        .header-language-flag { width: 22px; height: 16px; flex: none; background-position: center; background-repeat: no-repeat; background-size: contain; }
        /* Existing Atena flag assets are embedded for offline use. */
        .header-language-flag[data-language="en"] { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAUCAMAAADImI+JAAAAjVBMVEUAJH0OMIQPMYUQMoVYcKpieK9iea99j71+kL1/kb6Akr6erM6frM6frc6grc+suNTAyd/PFCvaTF7bTV/bTl/bUGHbUWLcVGTcVWXgZXTmucPnipbni5bnjJfnusToj5nowMnpwMnw1tzzwsjzw8nzxsv0x8z14eb32Nz32d357vH57/H79fb8+Pn///8pdguvAAAA4ElEQVR42sXTyRKCMBBF0WZQAUENDogTggMo+v7/8yRpSRm0LHfe9VkknQ7FB+AaWtTmQjTBpTZrsJqJxZmWQtHI/gxtTzGAglxTEzLbMauHRI6iR3kA24DM5ifJHCKSdJ+IKVMNX1jEzKSjHsOe32Uu1x8XWbqugDvDcpNuL8Bt0n8CQjeGb5H4sT/Cny+jxzO5AZdtuikZ3oFqnWbFWI9H5UQ1cJqL2c5vBz66AsepSPYBD9xk3usThh3qDDXrLAXTWCxzSSU7L5i9r1nU0IOixGzFzIAmJcUG375CqOgDi8Q+w2/CRkgAAAAASUVORK5CYII="); }
        .header-language-flag[data-language="de"] { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAUCAIAAACMMcMmAAAAKklEQVRIx2NgGAWjgAbAh/aI4S7t0agdI9COzx00Rwz/z9Ecjdox8uwAACkGSkKIaGlAAAAAAElFTkSuQmCC"); }
        .header-language-flag[data-language="sk"] { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAUCAMAAACtdX32AAAAjVBMVEUAOKgBOKgGPaoINqQfOJskQqMmVrUnOJYoV7Y4Yrk6Y7lDbL9Ebb9Hb8BIcMFYSpSIHlKPHU6QHU2QaJiQaJmlGUCnuuG5yOe6yefGjKTOESbPGCzQHDDSJjrVM0XVNUfXO0zZRFXZTFzZY3LZZ3bcV2bfZHLjeoXoj5nrn6jtp6/zxcr44OL54eT///9qwhsZAAAAg0lEQVR42sXJRxKCUBBF0SaJGQygPPhE+WT3vzxTObG7HOoZ3apL16/+vzNAayDjO7w7KRRtW0Cdww/0sIoxjeOEeE2SbZLrrtN5shH3PK37YejrdCZuswSaBihNEkXBznH2QUSyhWsZhuUu+fGfDjaRffQZwkvleRdw9A6lIG7mZ/sGeKg8DoeW6hkAAAAASUVORK5CYII="); }
        .header-language-flag[data-language="cz"] { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAUCAYAAACaq43EAAAAoElEQVRIx2PwLZn3+PWHL//pDRgEXev+Kwd3/N1w8Ar9LYbhhOaV/+nlexSLQVg1pPM/PXyPYTG9fI/TYlr7Hq/FtPQ9URbTwvdEW0xt35NsMbV8T5bFio5l/6eqWP+/LiJFNibZ4mDT2P/HJZQospQki6nhS5ItppYvibaY2r4kymJa+BKvxbT0JU6Lae1LDIvp5UsUi90tkl/Ry5fIGACwRleWx3yf/AAAAABJRU5ErkJggg=="); }
        .header-language-flag[data-language="bg"] { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAUCAYAAAADU1RxAAAAQElEQVRIx2P8DwQMAwwYRx0x6ohB6Yi+C/uPDbgjGKbl/R91xKgjRh2BzRHbzBUGPoteUxP6P+qIUUeMOgILAAAvtzUTyoSCcQAAAABJRU5ErkJggg=="); }
        .header-language-flag[data-language="ro"] { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAUCAIAAAAVyRqTAAAAKUlEQVRIx2Ng0K7Hg/5cFMODzgmq4UEMo0aPGj1q9KjRo0aPGj0UjQYAXzHKL165l44AAAAASUVORK5CYII="); }
        .header-language-flag[data-language="hu"] { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAUCAIAAABwJOjsAAAAOElEQVRIx2O8pKzDMBCAcdTiUYtpZvGj/NKBsfj///+jFo9aPMwsDt/SOjAWM/S6jVo8avHwshgAT5ohESWuYagAAAAASUVORK5CYII="); }
        .header-language-flag[data-language="pl"] { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAUAQMAAADWX60MAAAABlBMVEXcFDz////vuDXSAAAAEElEQVQI12P4DwQMJBEkAwCtUSfZb7JSvgAAAABJRU5ErkJggg=="); }
        .header-language-flag[data-language="lt"] { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAUCAIAAACMMcMmAAAANElEQVRIx2P8u1OYgcaAcdSOkWfHsnkqNLeDIctl1I5RO6huR72dKc3tOKiuO2rHqB3UBgBSBxe3gsmmOAAAAABJRU5ErkJggg=="); }
        .header-language-flag[data-language="hr"] { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAUCAYAAAD/Rn+7AAABzElEQVRIx2O4Jir+fzBjhhHhwOvikmD6ioLy/6vS8hBxMcmBd+Cq2Nz/8zKq/zc55v/vNYn9H9wz6X9gz4T/Ac7N/5Nd6/7PKWj+vz4+Z+AcmLh69f+2g7H/+5W8/7cKO/5PDLf6H5Zi9z88RP5/Vmz0/2knC/9nb5wzcA7s7pj/v/jcrf9FjoX/8xXD//vHxP/3ryn7HxFg+78/KfV/upbu/80N3ZQ58K6d/Wly8U1P30urkgu/XUxI//Ciqvr9HXv7x3dtbB+/qK55DxT7uDaz7PvVoPCrZNthY3eK4T+F4Jau/v/HcQlg9oOAwP/3PbzAbJAYSI5C8INiB75buOj/657e/0/S0v+/mTzl/5up08BskNj7ZcsH3oE/79///2n7dnB6+Xr02P9vZ8+C2SCx30+fDbwDB30Uv6ip/f+ysQkcYk+zc/4/zcgCs1/UN/wHZpaBd+CX/fv/fzlwACOKP+/cBRan2IHyuk37KMFZPs0Xn/VP+gNy0IuqGnCIgtjP+ib9zfFruUSJ2XK6TXsZmISK/lOKvYzL/t9Ysfn/zeiE/5diUv+fX7Pnv4d59X9qmE0VB8Iwq1DBf3YgpqaZVHUgLfCoA4e9AwHlPIoPJw983QAAAABJRU5ErkJggg=="); }
        .header-language-flag[data-language="uk"] { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAUAQMAAACgZR+HAAAABlBMVEU6dcT53RayzM22AAAAEklEQVQI12NgIBn8////D0kEAOHoJ7uJYmEzAAAAAElFTkSuQmCC"); }
        .header-language-flag[data-language="ru"] { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAUCAYAAACaq43EAAAAOUlEQVR42u3TUQ0AIAwD0aIGt5OFBtx0mCBNljsD7+uWXwoEDPwPrvKJwJINDDwLvtqZnSwZGHgU3Kx2NIuI4wdUAAAAAElFTkSuQmCC"); }
        .header-lang-select { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 44px; margin: 0; padding: 0; opacity: 0; color: var(--shell-ink); background: var(--bg-card); border: 0; font: 16px/1.2 var(--font-primary); cursor: pointer; }
        .header-language-picker:focus-within { outline: 3px solid var(--shell-blue); outline-offset: 3px; }
        @media (forced-colors: active) { .header-language-picker { border: 1px solid ButtonText; } }
        .shell-install:hover { filter: brightness(.96); }
        .shell-install svg, .shell-icon-button svg, .shell-nav svg, .shell-avatar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
        .shell-install[hidden], .shell-icon-button[hidden], #shell-featured[hidden], .shell-section-heading[hidden] { display: none !important; }
        #main-content { max-width: 1180px; padding: 38px 32px 24px; }

        .shell-page-heading { margin-bottom: 26px; }
        .shell-page-heading h2 { margin: 4px 0 8px; color: var(--shell-ink); font-size: clamp(28px, 3.4vw, 38px); font-weight: 700; line-height: 1.16; letter-spacing: -.8px; text-align: left; }
        .shell-page-heading p { color: var(--text-muted); font-size: 16px; line-height: 1.5; margin: 0; max-width: 680px; }
        .shell-page-heading .shell-eyebrow { color: var(--shell-ink); font-size: 14px; margin-bottom: 9px; }
        .shell-page-heading-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
        .shell-page-heading-row h2 { margin: 4px 0 8px; }
        .shell-section-heading { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 26px 0 14px; }
        .shell-section-heading h3 { font-size: clamp(22px, 3vw, 28px); font-weight: 700; color: var(--shell-ink); margin: 0; text-align: center; }
        .home-course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 0; }
        .home-course-card, .home-course-card.completed-bundle { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: start; gap: 12px 16px; padding: 24px; background: var(--input-bg); color: var(--text-main); border: 2px solid var(--input-border); border-radius: 22px; box-shadow: 0 3px 12px #123c5d04; min-width: 0; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
        .home-course-card::after { display: none; }
        .home-course-card:hover { transform: none; box-shadow: 0 5px 18px #123c5d09; }
        .home-course-card:not(.completed-bundle):not(.locked-bundle) { border-color: var(--color-primary); box-shadow: 0 6px 20px rgba(7, 55, 99, .1); }
        .home-course-card.completed-bundle { border-color: transparent; background: var(--shell-green-soft); }
        .home-course-card.locked-bundle { border-color: transparent; background: var(--shell-soft); }
        .home-course-card .cert-banner-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 48px; height: 48px; margin: 0; font-size: 29px; background: var(--shell-soft); color: var(--shell-ink); border-radius: 14px; line-height: 1; filter: none; overflow: hidden; }
        .cert-banner-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
        .home-course-card:not(.completed-bundle):not(.locked-bundle) .cert-banner-icon { background: var(--color-primary); color: #fff; }
        .home-course-card.completed-bundle .cert-banner-icon { background: var(--shell-green-soft); color: var(--shell-green); }
        .home-course-card.locked-bundle .cert-banner-icon { background: var(--bg-card); color: var(--text-muted); }
        .home-course-card .cert-banner-text { position: relative; z-index: 1; width: auto; min-width: 0; flex: initial; text-align: left; }
        .home-course-card .cert-banner-text h3 { margin: 7px 0 9px; color: var(--shell-ink); font-size: 22px; font-weight: 700; line-height: 1.23; letter-spacing: -.3px; overflow-wrap: anywhere; }
        .home-course-card .cert-banner-text p { font-size: 14px; line-height: 1.55; color: var(--text-muted); }
        .home-course-card .shell-course-state { display: inline-block; color: var(--shell-blue); font-size: 12px; font-weight: 600; line-height: 1.4; }
        .home-course-card.completed-bundle .shell-course-state { color: var(--shell-green); }
        .shell-course-progress-label { margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
        .home-course-card .progress-bar-container { height: 8px; margin: 9px 0 0; background: var(--input-border); border: 0; border-radius: var(--radius-pill); overflow: hidden; }
        .home-course-card .progress-bar { background: var(--color-primary); border-radius: var(--radius-pill); }
        .home-course-card.completed-bundle .progress-bar { background: var(--shell-green); }
        .home-course-card { position: relative; }
        .home-course-card > div:last-child { grid-column: 2; width: 100%; margin: 2px 0 0; }
        .home-card-action { gap: 10px; }
        .home-card-lock-overlay { grid-column: 1 / -1; grid-row: 1 / -1; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 0 !important; font-size: 5rem; opacity: .3; filter: grayscale(0); pointer-events: none; }

        /* Courses tab: one bordered card per category above a stack of compact rows.
           Rows reuse .home-course-card's markup/dataset (search/filter/sort keep
           working unmodified), visually collapsed to icon + name + status + a chevron
           (the whole row opens the course). */
        .courses-group-card { grid-column: 1 / -1; border: 2px solid var(--input-border); border-radius: 20px; padding: 14px 16px; margin-bottom: 18px; }
        .courses-group-card[hidden] { display: none; }
        .courses-group-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; margin-bottom: 2px; border-bottom: 1px solid var(--input-border); }
        .courses-group-title h3 { margin: 0; color: var(--shell-ink); font-size: 21px; }
        .courses-group-count { font-size: 13px; color: var(--text-muted); }
        .courses-group-toggle { display: flex; align-items: center; gap: 10px; flex: none; cursor: pointer; }
        .courses-group-toggle > span:first-child { font-size: 13px; font-weight: 600; color: var(--shell-blue); }
        .courses-group-toggle .switch { width: 44px; height: 24px; }
        .courses-group-toggle .switch .slider:before { width: 18px; height: 18px; left: 3px; bottom: 3px; }
        .courses-group-toggle .switch input:checked + .slider:before { transform: translateX(20px); }

        /* Grid, not a row: badge top-left, status/name/progress below it
           (still left-aligned), chevron in its own column, vertically
           centered against the whole (now taller) row. */
        /* .completed-bundle/.locked-bundle repeated here (not just
           .home-course-card) to out-specificity the mobile compact-card
           rule (.home-course-card.completed-bundle { grid-template-columns:
           42px ... }) below — same specificity would otherwise let that
           later rule win back the old 2-column split on these rows. */
        .courses-group-rows .home-course-card,
        .courses-group-rows .home-course-card.completed-bundle,
        .courses-group-rows .home-course-card.locked-bundle {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            grid-template-areas: "badge action" "text action";
            align-items: start;
            row-gap: 6px;
            column-gap: 12px;
            padding: 12px 0;
            border: 0;
            border-bottom: 1px solid var(--input-border);
            border-radius: 0;
            box-shadow: none;
            background: transparent !important;
            cursor: pointer;
        }
        .courses-group-rows .home-course-card:last-child { border-bottom: 0; }
        .academy-course-surface .courses-group-rows .home-course-card::before { display: none; }
        /* Always a circle, regardless of status, so a real course image (or
           the icon placeholder, same rule either way) never shows a square
           corner peeking out from behind it. */
        .courses-group-rows .home-course-card .cert-banner-icon { grid-area: badge; flex: none; width: 44px; height: 44px; font-size: 20px; border-radius: 50%; }
        .academy-course-surface .courses-group-rows .home-course-card:not(.completed-bundle):not(.locked-bundle) .cert-banner-icon { background: var(--color-primary); border: 0; box-shadow: none; color: #fff; }
        .academy-course-surface .courses-group-rows .home-course-card.completed-bundle .cert-banner-icon { background: var(--shell-green-soft); border: 0; box-shadow: none; color: var(--shell-green); }
        .academy-course-surface .courses-group-rows .home-course-card.locked-bundle .cert-banner-icon { background: var(--shell-soft); border: 0; box-shadow: none; color: var(--text-muted); }
        .courses-group-rows .home-course-card .cert-banner-text { grid-area: text; min-width: 0; text-align: left; }
        .courses-group-rows .home-course-card .cert-banner-text h3 { margin: 0; font-size: 15px; }
        .courses-group-rows .home-course-card .shell-course-state { font-size: 12px; }
        .courses-group-rows .home-course-card .shell-course-progress-label { margin-top: 4px; font-size: 11px; }
        .courses-group-rows .home-course-card .progress-bar-container { width: 160px; max-width: 100%; height: 6px; margin-top: 4px; }
        /* !important: these fight the tone-accent system's own higher-specificity
           display rules (e.g. .academy-course-surface .home-course-card:not(...)
           .progress-bar-container), which is a different card variant entirely. */
        .courses-group-rows .home-course-card .home-card-desc,
        .courses-group-rows .home-course-card .home-card-desc-toggle,
        .courses-group-rows .home-course-card .language-test-compact-status,
        .courses-group-rows .home-course-card .home-card-lock-overlay,
        .courses-group-rows .home-course-card .home-card-open-btn {
            display: none !important;
        }
        .courses-group-rows .home-course-card > div:last-child { grid-area: action; align-self: center; justify-self: end; flex: none; width: auto; margin: 0; }
        .courses-group-rows .home-course-card > div:last-child { width: 22px; height: 22px; background: var(--shell-blue); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
        .courses-group-rows .home-course-card.locked-bundle > div:last-child { background: var(--text-muted); opacity: .6; }

        .home-category-heading { grid-column: 1 / -1; margin: 12px 0 0; color: var(--shell-ink); font-size: 21px; font-weight: 700; }
        .home-category-container { grid-column: 1 / -1; padding: 0; }
        /* Mobile: one column, so a category's courses (current + collapsed
           done/locked rows) stay in reading order instead of a stray card
           landing in a second column apart from the rest of its group. */
        .home-category-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 4px; }
        /* Desktop (>=768px, see the shell-sidebar block above): two columns
           work because the current course explicitly spans both — it's the
           only thing forcing a row break, so done/locked rows still pair up
           correctly within their own group instead of drifting into a
           neighboring group's column. `dense` matters here: a done course
           often precedes the current one in sequence (e.g. A1 done, A2
           current), and without it that lone done row would leave a gap
           instead of pairing with the locked row that comes after the hero. */
        @media (min-width: 768px) {
            .home-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; }
            .home-category-grid .mini-course-card:not(.completed-bundle):not(.locked-bundle) { grid-column: 1 / -1; }
        }
        /* The active/new course card: badge, tag, subtitle, percent, name and
           the progress bar are all separate grid items (see miniCourseCard()
           in modules/ui.mjs) purely so grid-template-areas can reflow them —
           mobile stacks them in rows, desktop lays badge | content | button
           out as one horizontal row — with no JS/markup branching between
           breakpoints (that was the source of an earlier "items over items"
           bug when the two got out of sync on resize). Sizes/gaps below are
           the design's own mobile spec; the desktop override follows. */
        .mini-course-card {
            position: relative; display: grid; min-width: 0; padding: 16px;
            background: var(--input-bg); color: var(--text-main);
            border: 2px solid var(--input-border); border-radius: 22px;
            box-shadow: 0 3px 12px #123c5d04;
            transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
        }
        .mini-course-card:not(.completed-bundle):not(.locked-bundle) {
            grid-template-columns: 56px 1fr auto;
            grid-template-areas: "tag tag pct" "badge name name" "badge sub sub" "bar bar bar" "button button button";
            column-gap: 14px; row-gap: 12px;
            border-color: var(--color-primary); box-shadow: 0 6px 20px rgba(7, 55, 99, .1);
        }
        .mini-course-card.completed-bundle { border-color: transparent; background: var(--shell-green-soft); }
        .mini-course-card.locked-bundle { border-color: transparent; background: var(--shell-soft); opacity: .82; }
        .mini-course-tag {
            grid-area: tag; justify-self: start; align-self: center;
            padding: 3px 10px; border-radius: var(--radius-pill);
            background: var(--shell-soft); color: var(--shell-ink);
            font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
        }
        .mini-course-pct { grid-area: pct; justify-self: end; align-self: center; font: 700 16px var(--font-heading); color: var(--shell-blue); }
        .mini-course-card .cert-banner-icon { grid-area: badge; align-self: center; position: relative; z-index: 1; display: grid; place-items: center; width: 48px; height: 48px; margin: 0; font-size: 25px; background: var(--shell-soft); color: var(--shell-ink); border-radius: 14px; line-height: 1; overflow: hidden; }
        /* Same size/shape as .mini-course-code-badge, so a real course image
           (rendered here) is a clean circle too, with no square corners
           showing whichever of the two — image or code letter — is used. */
        .mini-course-card:not(.completed-bundle):not(.locked-bundle) .cert-banner-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--color-primary); color: #fff; }
        .mini-course-card.completed-bundle .cert-banner-icon { background: var(--shell-green-soft); color: var(--shell-green); }
        /* A real course image is its own background — the status-tinted fill
           must not show behind it (most visible on completed's pale-green
           circle, where a course photo with any transparent padding let the
           tint bleed through, looking like the placeholder was still there). */
        .mini-course-card .cert-banner-icon:has(> img) { background: none !important; }
        .mini-course-card.locked-bundle .cert-banner-icon { background: var(--bg-card); color: var(--text-muted); }
        .mini-course-code-badge {
            grid-area: badge; align-self: center; width: 56px; height: 56px; display: grid; place-items: center;
            border-radius: 50%; background: var(--color-primary); color: #fff;
            font: 700 20px var(--font-heading);
        }
        .mini-course-name { grid-area: name; align-self: center; margin: 0; color: var(--shell-ink); font-size: 15px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
        .mini-course-sub { grid-area: sub; align-self: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-muted); }
        .mini-course-lock-note { margin: 0; font-size: 12px; color: var(--text-muted); }
        .mini-course-card .progress-bar-container { grid-area: bar; height: 10px; margin: 0; background: var(--input-border); border: 0; border-radius: var(--radius-pill); overflow: hidden; }
        .mini-course-card .progress-bar { background: var(--color-primary); border-radius: var(--radius-pill); }
        .mini-course-card.completed-bundle .progress-bar { background: var(--shell-green); }
        /* #app doubles the specificity of shell.css's :is(body,#app) :is(.btn-primary,.btn-secondary)
           base button rule, which otherwise wins (it's concatenated after this file) and silently
           discards this block's padding/font-size/white-space. font-size is deliberately NOT
           !important so the shrink-to-fit script can still override it via an inline style. */
        #app .mini-course-card .mini-course-action {
            grid-area: button;
            width: 100%;
            min-height: 48px;
            padding: 0 24px;
            font-size: 16px;
            font-weight: 600;
            letter-spacing: normal;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        /* The one card worth tapping gets the "chunky" 3D-shadow CTA; done/
           locked rows keep the compact pill so they stay out of the way. */
        #app .mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-action {
            box-shadow: 0 3px 0 rgba(7, 55, 99, .25);
        }
        /* Done and locked courses don't need the full card — only the one
           course actually worth opening does. Collapse the rest to a single
           compact row so a group's real estate goes to what's actionable. */
        .mini-course-card.completed-bundle,
        .mini-course-card.locked-bundle {
            grid-template-columns: 32px 1fr auto;
            grid-template-areas: "badge name button";
            align-items: center;
            padding: 10px 12px;
            border-radius: 16px;
            column-gap: 12px;
        }
        .mini-course-card.completed-bundle .cert-banner-icon,
        .mini-course-card.locked-bundle .cert-banner-icon {
            width: 32px;
            height: 32px;
            font-size: 16px;
            border-radius: 50%;
        }
        .mini-course-card.completed-bundle .mini-course-body,
        .mini-course-card.locked-bundle .mini-course-body {
            grid-area: name; display: flex; flex-direction: column; gap: 2px; min-width: 0;
        }
        .mini-course-card.completed-bundle .mini-course-name,
        .mini-course-card.locked-bundle .mini-course-name {
            font-size: 14px;
        }
        #app .mini-course-card.completed-bundle .mini-course-action,
        #app .mini-course-card.locked-bundle .mini-course-action {
            width: auto;
            min-width: 0;
            min-height: 32px;
            padding: 5px 12px;
            font-size: 12px;
            box-shadow: none;
        }
        /* Locked courses are opened via the card's own click handler (which
           shows the "complete X first" toast); the disabled button underneath
           it would just repeat that with no extra affordance, so it's hidden. */
        #app .mini-course-card.locked-bundle .mini-course-action { display: none; }

        /* Desktop: badge | content | button as one horizontal row — content
           itself stacks tag+subtitle+percent, name, then the bar. */
        @media (min-width: 768px) {
            .mini-course-card { padding: 18px; }
            .mini-course-card:not(.completed-bundle):not(.locked-bundle) {
                grid-template-columns: 60px auto 1fr auto auto;
                grid-template-areas: "badge tag sub pct button" "badge name name name button" "badge bar bar bar button";
                column-gap: 18px; row-gap: 6px;
            }
            .mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-tag,
            .mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-pct { justify-self: unset; }
            .mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-name { font-size: 21px; }
            .mini-course-code-badge,
            .mini-course-card:not(.completed-bundle):not(.locked-bundle) .cert-banner-icon { width: 60px; height: 60px; }
            #app .mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-action {
                width: auto; min-width: 0; min-height: 46px; align-self: center;
            }
            .mini-course-card.completed-bundle,
            .mini-course-card.locked-bundle {
                grid-template-columns: 34px 1fr auto;
                padding: 12px 14px;
            }
            .mini-course-card.completed-bundle .cert-banner-icon,
            .mini-course-card.locked-bundle .cert-banner-icon { width: 34px; height: 34px; }
            .mini-course-card.locked-bundle { border: 1px solid var(--input-border); }
        }

        @media (max-width: 480px) {
            .home-category-container { padding: 14px; }
            .home-category-heading { margin-bottom: 12px; font-size: 16px; }
            .home-category-grid { gap: 14px; }
            .mini-course-card { padding: 16px; }
            #app .mini-course-card .mini-course-action {
                padding-inline: 0.4rem;
                font-size: 11px;
            }
        }


        .home-course-card.locked-bundle { filter: none; opacity: 1; }

        .home-course-card .home-card-desc { -webkit-line-clamp: 2; line-clamp: 2; }


        .home-course-card .language-test-compact-status { color: var(--text-main); background: var(--input-bg); border: 1px solid var(--input-border); font-weight: 400; line-height: 1.5; padding: 12px; }
        .home-course-card .language-test-next-step { background: var(--input-bg); color: var(--text-main); border: 1px solid var(--input-border); margin-top: 14px; }
        .home-course-card .language-test-next-step p { color: inherit; }


        .home-welcome-card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-bottom: 26px; padding: 22px 26px; border: 1px solid var(--input-border); border-radius: var(--radius-lg); background: var(--bg-card); }
        .home-welcome-text { min-width: 0; }
        .home-welcome-card .shell-eyebrow { color: var(--shell-blue); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 4px; }
        .home-welcome-card .home-title { margin: 0; color: var(--shell-ink); font-size: 34px; font-weight: 700; line-height: 1.2; letter-spacing: -.4px; overflow-wrap: anywhere; }

        @media (max-width: 767px) {
            .home-welcome-card { flex-direction: column; align-items: stretch; padding: 18px; }
        }
        .shell-nav { position: fixed; z-index: 130; bottom: 20px; left: 50%; transform: translateX(-50%); width: min(540px, calc(100% - 32px)); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 8px; background: var(--bg-card); border: 1px solid var(--input-border); border-radius: 24px; box-shadow: 0 8px 40px #123c5d14; }
        .shell-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; min-width: 0; padding: 4px 2px; color: var(--text-muted); background: none; border: 0; font: 500 12px/1.3 var(--font-primary); cursor: pointer; border-radius: 14px; overflow-wrap: anywhere; }
        .shell-nav-icon { display: grid; place-items: center; width: 46px; height: 30px; border-radius: var(--radius-pill); }
        .shell-nav button[aria-current=page] { color: var(--shell-blue); font-weight: 700; }
        .shell-nav button[aria-current=page] .shell-nav-icon { background: var(--shell-soft); }
        .shell-nav button:hover { background: var(--input-bg); }
        #btn-back-from-profile { display: none; }

        /* Profile: identity — mobile shows a centered avatar/name/ID block;
           desktop hides it and shows .profile-header-row (kicker + title)
           instead, with the avatar living in the sidebar's own copy. */
        .profile-header-row { display: none; }
        .shell-profile-identity {
            display: flex; flex-direction: column; align-items: center; text-align: center;
            gap: 10px; width: 100%; padding: 8px 0 0; margin-bottom: 24px;
            color: var(--text-main); background: none; border: 0; font: 700 30px/1.2 var(--font-heading);
        }
        .shell-avatar { display: grid; place-items: center; position: relative; width: 88px; height: 88px; border-radius: 50%; background: var(--shell-soft); color: var(--shell-ink); border: 3px solid var(--color-accent); overflow: hidden; flex-shrink: 0; }
        .shell-avatar svg { width: 38px; height: 38px; }
        .shell-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
        .shell-avatar--sm { width: 40px; height: 40px; border-width: 2px; }
        .shell-avatar--sm svg { width: 20px; height: 20px; }

        /* Stats grid: 2x2 on mobile, one row of four on desktop (see the
           >=768px override below), each tile a flat tinted tile. */
        .profile-stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 24px; }
        .profile-stat-card { background: var(--shell-soft); border-radius: 18px; padding: 14px 16px; }
        .profile-stat-value { font-size: 32px; font-weight: 800; line-height: 1.1; color: var(--shell-ink); margin-bottom: 4px; }
        .profile-stat-value .profile-stat-suffix { font-size: 18px; font-weight: 600; color: var(--text-muted); }
        .profile-stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }

        /* Scores by course / Settings / Account: single column on mobile
           (see the >=768px override for the two-column desktop body). */
        .profile-body { display: flex; flex-direction: column; gap: 24px; }
        .profile-col-main, .profile-col-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
        .profile-scores-card { display: grid; gap: 0; border: 1.5px solid var(--input-border); border-radius: var(--radius-md); padding: 4px 14px; }
        .profile-account-card { border: 1.5px solid var(--input-border); border-radius: var(--radius-md); padding: 0 14px; }
        .profile-account-row {
            display: flex; align-items: center; justify-content: space-between; gap: 12px;
            min-height: 52px; padding: 12px 0; border-bottom: 1px solid var(--input-border);
            color: var(--text-main); font-weight: 600; font-size: 15px; text-decoration: none;
        }
        .profile-account-card .profile-account-row:last-child { border-bottom: 0; }
        .profile-account-row::after {
            content: ''; flex: none; width: 8px; height: 8px;
            border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
            transform: rotate(-45deg);
        }
        .shell-account-actions { padding: 0; }
        .shell-account-actions button {
            width: 100%; min-height: 48px; border: 1.5px solid var(--input-border); border-radius: var(--radius-pill);
            color: var(--text-main); background: none; box-shadow: none; font-size: 16px; font-weight: 700;
        }

        /* ==========================================================================
           Desktop shell (>=768px): a persistent left sidebar replaces the mobile
           header + bottom nav. Below 768px none of this applies — the mobile
           header/#shell-nav layout (above) is untouched. Placed after the base
           rules it overrides (.home-welcome-card, #app, #main-content, etc.) so
           equal-specificity source order resolves the way these comments say.
        ========================================================================== */
        .shell-sidebar, .home-welcome-text--desktop, .home-aside-column { display: none; }
        @media (min-width: 768px) {
            /* The whole shell (sidebar + main) is boxed to 1170px and
               centered — on wider screens the excess becomes a gutter,
               tinted with the app's mint tone, while the shell itself (and
               #shell-top-right, pinned to its right edge) stays white and
               lines up with that centered box, not the raw window edge. */
            :root { --shell-gutter: max(0px, calc((100vw - 1170px) / 2)); }
            /* #app itself still spans the full viewport (the sidebar is
               position:fixed, out of its box model) — the gutter color
               belongs on body, showing everywhere neither the (white)
               sidebar nor the (white) main content covers it. */
            body { background: var(--bg-card); }
            /* The mobile header stays around on desktop too, but as a bare
               white bar (its own mobile content — back arrow/logo/context —
               is hidden below): a persistent top navbar the sidebar starts
               under, instead of the sidebar running the full viewport
               height and the top-right widget floating over nothing. */
            #shell-nav { display: none !important; }
            #main-header {
                inset: 0 var(--shell-gutter) auto var(--shell-gutter);
                z-index: 130;
            }
            .header-content { display: none; }
            #app { padding-top: 0; padding-bottom: 0; }
            #main-content {
                margin: calc(var(--shell-header-height) + env(safe-area-inset-top, 0px)) var(--shell-gutter) 0 calc(var(--shell-gutter) + 240px);
                max-width: min(930px, calc(100vw - 240px)); width: auto; padding: 28px 40px 40px;
                background: var(--bg-body);
            }
            /* 40px matches #main-content's own right padding, so the widget
               lines up with the page's content margin instead of sitting
               right at the boxed area's edge (the gutter). */
            #shell-top-right { right: calc(var(--shell-gutter) + 40px); }
            /* Sidebar background follows the page (white in light, dark
               gray in dark) — it must NOT be a permanently-navy block: with
               --shell-ink flipping to white in dark mode, that would have
               made the sidebar go white exactly when it shouldn't. */
            .shell-sidebar {
                display: flex; flex-direction: column; position: fixed;
                inset: calc(var(--shell-header-height) + env(safe-area-inset-top, 0px)) auto 0 var(--shell-gutter);
                width: 240px; padding: 24px 16px; background: var(--bg-body); color: var(--text-main);
                border-right: 1px solid var(--input-border);
                z-index: 140; overflow-y: auto;
            }
            .shell-sidebar-logo {
                display: flex; align-items: center; gap: 10px; margin-bottom: 24px;
                padding: 0 10px; border: 0; background: none; color: var(--shell-ink);
                font: 700 22px/1.2 var(--font-heading); letter-spacing: -.2px; cursor: pointer;
            }
            .shell-sidebar-logo img { width: 32px; height: 32px; border-radius: 50%; flex: none; }
            .shell-sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
            .shell-sidebar-nav button {
                display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px;
                border: 0; border-radius: 12px; background: none; color: var(--text-muted);
                font: 600 15px/1.2 var(--font-primary); text-align: left; cursor: pointer;
            }
            .shell-sidebar-nav button:hover { background: var(--bg-card); color: var(--shell-ink); }
            .shell-sidebar-nav button[aria-current=page] { background: var(--shell-soft); color: var(--shell-ink); font-weight: 700; }
            html[data-theme=dark] .shell-sidebar-nav button[aria-current=page],
            body.dark-mode .shell-sidebar-nav button[aria-current=page] { background: rgba(18, 204, 193, .14); color: var(--shell-blue); }
            .shell-sidebar-nav .shell-nav-icon { width: auto; height: auto; background: none !important; }
            .shell-sidebar-nav svg { width: 21px; height: 21px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

            /* Sits at the bottom of the sidebar: shell-sidebar-nav's flex:1
               already fills the space above it, so it needs no margin-top:auto. */
            .shell-sidebar-user {
                display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px;
                padding: 10px 12px; border: 0; border-radius: 16px; background: var(--shell-soft);
                color: var(--text-main); text-align: left; cursor: pointer;
            }
            .shell-sidebar-user .js-profile-name { display: block; font-size: 14px; font-weight: 700; color: var(--shell-ink); }
            .shell-sidebar-user .profile-client-id { font-size: 12px; }

            /* Home view: greeting full-width, then [courses | 300px aside]. */
            .home-welcome-card { display: none; }
            .home-welcome-text--desktop { display: block; margin-bottom: 28px; }
            .home-welcome-text--desktop .shell-eyebrow { color: var(--shell-blue); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 2px; }
            .home-welcome-text--desktop .home-title { margin: 0; color: var(--shell-ink); font-size: 36px; font-weight: 700; line-height: 1.2; letter-spacing: -.4px; }
            /* The right-rail stats are gone on desktop Home — just the
               course list, full width. */
            .home-desktop-layout { display: block; }
            .home-aside-column { display: none; }
            /* Profile: no avatar block — the name becomes the page title and
               the avatar moves into the sidebar's own identity card. */
            .profile-header-row { display: flex; flex-direction: column; margin-bottom: 24px; }
            .profile-header-row .shell-eyebrow { color: var(--shell-blue); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; }
            .profile-header-title { margin: 0; color: var(--shell-ink); font-size: 36px; font-weight: 700; line-height: 1.2; letter-spacing: -.4px; overflow-wrap: anywhere; }
            .shell-profile-identity { display: none; }

            /* Stats: one row of four, number beside label. */
            .profile-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
            .profile-stat-card { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px; border: 1px solid var(--input-border); background: var(--bg-card); }
            .profile-stat-value { font-size: 28px; margin-bottom: 0; }
            .profile-stat-label { font-size: 13px; }

            /* Two-column body: scores by course on the left, settings/
               account/sign-out stacked on the right. */
            .profile-body { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }

            /* Group "done" count next to each Home category heading. */
            .home-category-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 20px; }
            .home-category-done { font-size: 13px; font-weight: 600; color: var(--text-muted); }
            .home-category-grid { gap: 12px; }
        }
        @media (max-width: 767px) {
            .home-category-done { display: none; }
        }
        .profile-identity { min-width: 0; overflow-wrap: anywhere; }
        .profile-client-id { margin-top: 6px; color: var(--text-muted); font-size: 13px; font-weight: 400; }
        .shell-settings-title { margin: 8px 0 4px; font-size: 19px; color: var(--shell-ink); }
        .shell-settings-group { border: 1.5px solid var(--input-border); border-radius: var(--radius-md); padding: 0 16px; }
        .shell-settings-row { display: flex; align-items: center; flex-direction: row; gap: 14px; min-height: 70px; padding: 12px 0; border-bottom: 1px solid var(--input-border); }
        .shell-settings-group .shell-settings-row:last-child { border-bottom: 0; }
        .shell-settings-icon { flex: none; width: 20px; height: 20px; color: var(--shell-blue); }
        .shell-settings-row label { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; }
        .shell-settings-row .global-lang-select { max-width: 55%; width: 200px; min-height: 44px; border-radius: 10px; border: 1px solid var(--input-border); background: var(--input-bg); color: var(--text-main); padding: 8px 12px; font: inherit; font-size: 16px; }
        /* .shell-settings-row label above (the "Dark Mode" text label) also
           matches this element — it's a <label> too — and its flex:1;
           flex-basis:0% wins over any width set here unless flex is reset. */
        .shell-settings-row .switch { flex: none; margin: 0; width: 36px; height: 20px; }
        .shell-settings-row .switch .slider:before { width: 14px; height: 14px; left: 3px; bottom: 3px; }
        .shell-settings-row .switch input:checked + .slider:before { transform: translateX(16px); }
        .shell-certificate-status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
        .shell-certificate-pending, .shell-empty { padding: 24px; border: 1px solid var(--input-border); border-radius: 20px; background: var(--bg-card); }
        .shell-certificate-pending h3 { font-size: 20px; line-height: 1.3; margin-bottom: 12px; color: var(--shell-ink); }
        .shell-certificate-pending > p, .shell-empty { color: var(--text-muted); font-size: 14px; }
        #view-profile .language-test-next-step-card, #view-results .language-test-next-step-card, #view-certificates .language-test-next-step-card { background: var(--input-bg); color: var(--text-main); border: 1px solid var(--input-border); box-shadow: none; }
        #view-profile .language-test-contact, #view-results .language-test-contact, #view-certificates .language-test-contact { background: var(--shell-soft); border-color: var(--input-border); }
        #view-results #profile-certificates-list, #view-certificates #profile-certificates-list { padding: 0; }
        #view-results .divider { font-size: 19px; margin-top: 0; }
        .shell-dialog { position: fixed; margin: auto; inset: 0; width: min(460px, calc(100% - 32px)); max-height: calc(var(--app-viewport-height) - 40px); overflow-y: auto; padding: 26px; background: var(--bg-card); color: var(--text-main); border: 1px solid var(--input-border); border-radius: 24px; box-shadow: 0 20px 70px #0003; }
        .shell-dialog::backdrop { background: #0b243a88; backdrop-filter: blur(4px); }
        .shell-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
        .shell-dialog h2 { font-size: 24px; margin: 0; }
        .shell-dialog p { color: var(--text-muted); font-size: 15px; line-height: 1.6; }
        .shell-install-step { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--input-border); }
        .shell-install-actions { display: grid; gap: 10px; margin-top: 18px; }
        .shell-install-actions a, .shell-install-actions button { min-height: 48px; display: flex; align-items: center; justify-content: center; padding: 0 16px; border: 0; border-radius: 12px; font: 700 15px/1.2 var(--font-primary); cursor: pointer; text-decoration: none; color: var(--shell-ink); background: var(--shell-chip-bg); box-shadow: var(--shadow-soft); }
        .shell-install-actions a:focus-visible, .shell-install-actions button:focus-visible { outline: 3px solid var(--shell-blue); outline-offset: 3px; }
        .shell-install-actions #shell-install-play:has(img:not([hidden])) { min-height: 0; padding: 0; background: none; box-shadow: none; }
        #shell-install-play-badge { display: block; width: auto; height: 64px; max-width: 100%; margin-inline: auto; }
        .shell-install-actions #shell-install-play { min-height: 54px; font-size: 16px; color: #fff; background: var(--shell-blue); text-align: center; }
        html[data-theme=dark] .shell-install-actions #shell-install-play, body.dark-mode .shell-install-actions #shell-install-play { color: #000; }
        .shell-install-actions .secondary { font-weight: 600; box-shadow: none; border: 1px solid var(--input-border); background: transparent; }
        .shell-install-actions [hidden] { display: none; }
        #course-header-progress, #course-header-progress.is-floating { position: fixed !important; top: calc(var(--shell-header-height) + env(safe-area-inset-top, 0px)) !important; inset-inline: 0; height: 4px !important; z-index: 121; }
        #view-student > .btn-back, #btn-back-from-article { display: none; }
        .ai-helper-fab { bottom: calc(var(--shell-nav-height) + env(safe-area-inset-bottom, 0px) + 24px); }
        .ai-helper-popover { bottom: calc(var(--shell-nav-height) + env(safe-area-inset-bottom, 0px) + 92px); max-height: calc(var(--app-viewport-height) - var(--shell-header-height) - var(--shell-nav-height) - 115px); overflow-y: auto; }
        .locked-toast { bottom: auto !important; }
        #chatButtonDoprava { display: none !important; }
        #app button:focus-visible, #app select:focus-visible, .shell-dialog button:focus-visible { outline: 3px solid var(--shell-blue); outline-offset: 3px; }
        @media (max-width: 767px) {
            :root { --shell-header-height: 64px; --shell-nav-height: 74px; }
            .header-content { padding: 0 max(18px, env(safe-area-inset-left)); gap: 8px; }
            .shell-logo { font-size: 21px; }
            .shell-logo img { width: 32px !important; height: 32px !important; margin-right: 7px !important; }
            .shell-context { display: none; }
            .shell-install { font-size: 12px; padding: 8px 11px; gap: 5px; min-height: 40px; }
            .shell-install svg { width: 18px; height: 18px; }
            /* Take the free space between the logo and the right edge: the
               widget is bounded on the left by the measured logo end
               (--shell-logo-end, set in syncShellLogoEnd), and the select
               only shrinks (ellipsis) once that space is used up. */
            #shell-top-right { left: var(--shell-logo-end, 0px); right: 12px; gap: 6px; justify-content: flex-end; }
            #shell-back { width: 44px; min-height: 44px; }
            #main-content { padding: 25px 18px 18px; }
            .shell-page-heading { margin-bottom: 22px; }
            .shell-page-heading p { font-size: 14px; }
            .shell-page-heading h2 { font-size: 30px; }
            .shell-nav { bottom: 0; left: 0; transform: none; width: 100%; border: 0; border-top: 1px solid var(--input-border); border-radius: 22px 22px 0 0; padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left)); }
            .shell-nav button { min-height: 59px; font-size: 11px; }
            .home-course-grid { grid-template-columns: 1fr; gap: 14px; }
            .home-course-card, .home-course-card.completed-bundle { padding: 20px; gap: 12px; grid-template-columns: 42px minmax(0, 1fr); }
            .home-course-card .cert-banner-icon { width: 42px; height: 42px; font-size: 25px; }
            .home-course-card .cert-banner-text h3 { font-size: 20px; }

            .shell-section-heading { margin-top: 22px; }
            .shell-settings-title { font-size: 21px; }
            .shell-settings-row { padding: 12px 0; flex-direction: row; }
            .shell-certificate-status { grid-template-columns: 1fr; }
            #view-student .dashboard-overview { padding: 0; }
            .article-container.card, .test-container.card { padding: 14px; border-radius: 18px; }
            .article-container .content-group.card { padding: 18px !important; }
            .ai-helper-fab { right: 16px; bottom: calc(var(--shell-nav-height) + env(safe-area-inset-bottom, 0px) + 14px); }
            .ai-helper-popover { right: 16px; bottom: calc(var(--shell-nav-height) + env(safe-area-inset-bottom, 0px) + 80px); }
        }
        @media (max-width: 360px) {
            .header-content { padding-inline: 12px; }
            .shell-logo { font-size: 18px; }
            #main-content { padding-inline: 12px; }
        }
        /* Icon-only install + a narrower language select: below 400px the
           full pill plus select measured as overlapping the logo (down to
           actual overlap below 340px, ~7px clearance at 375px — too tight
           to trust across devices/fonts), even with the logo at its
           shortest (see #shell-back:not([hidden]) above). */
        @media (max-width: 400px) {
            .shell-install { font-size: 11px; padding-inline: 8px; gap: 4px; }
            .shell-install span { display: none; }
            .shell-install svg { width: 15px; height: 15px; }
        }
        @media (prefers-reduced-motion: reduce) {
            .view, .fade-in-up, .shell-nav, .home-course-card { animation: none; transition: none; }
            .fade-in-up, .scale-up { opacity: 1; transform: none; animation: none !important; }
            html { scroll-behavior: auto; }
        }
    
/* Profile rows use the full container width, including the consultant action. */
#profile-course-progress { display: grid; gap: 0; }
/* Rows sit inside .profile-scores-card's own border, so they lose their
   own card chrome and become divided rows instead. */
#profile-course-progress .shell-progress-row { padding: 12px 0; border: 0; border-bottom: 1px solid var(--input-border); border-radius: 0; background: none; }
#profile-course-progress .shell-progress-row:last-child { border-bottom: 0; }
.shell-progress-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 20px 28px; align-items: center; padding: 24px; border: 1px solid var(--input-border); border-radius: 20px; background: var(--bg-card); }
.shell-progress-overview, .shell-progress-heading > h3 { min-width: 0; }
.shell-progress-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.shell-progress-heading h3 { font-size: 1rem; line-height: 1.4; margin: 0; flex: 1 1 220px; }
.shell-progress-badge { display: inline-block; font-size: .75rem; line-height: 1.5; padding: 5px 10px; border-radius: 9px; color: var(--text-muted); background: var(--input-bg); }
.shell-progress-badge.is-complete { background: var(--shell-green-soft); color: var(--shell-green); }
.shell-progress-metrics { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 8px; font-size: .85rem; color: var(--text-muted); }
.shell-progress-metrics strong { color: var(--text-main); }
.shell-progress-track { height: 7px; border-radius: 8px; overflow: hidden; background: var(--input-border); }
.shell-progress-track > span { display: block; height: 100%; border-radius: inherit; background: var(--color-primary); }
.shell-progress-score { font-size: .85rem; color: var(--text-muted); margin: 10px 0 0; }
.shell-progress-open { max-width: 180px; }
.shell-progress-next { grid-column: 1 / -1; min-width: 0; }
.shell-progress-next .language-test-next-step-card { margin: 0; }
.language-test-next-step-card { container-type: inline-size; }
.language-test-contact { flex-wrap: wrap; flex-direction: row; }
.language-test-contact-person { flex: 1 1 180px; }
.language-test-contact-person > div { min-width: 0; }
.language-test-contact strong { white-space: normal; overflow-wrap: anywhere; }
.language-test-contact-actions { flex-wrap: wrap; max-width: 100%; }

.language-test-contact-button .ui-icon { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
@container (max-width: 420px) {
    .language-test-next-step-content { margin-left: 0; }
    .language-test-contact { align-items: stretch; }
    .language-test-contact-actions { width: 100%; }

}
.shell-certificate-status { grid-template-columns: minmax(0,1fr); align-items: start; }
.shell-certificate-pending { min-width: 0; }
.shell-certificate-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.shell-certificate-heading .shell-eyebrow { margin: 0 0 4px; }
.shell-certificate-heading h3 { margin: 0; }
.shell-certificate-symbol { display: grid; place-items: center; flex: 0 0 48px; height: 48px; border-radius: 15px; background: var(--shell-soft); color: var(--shell-blue); font-size: 24px; }
.is-earned .shell-certificate-symbol { color: var(--shell-green); background: var(--shell-green-soft); }
.shell-certificate-view { margin-top: 12px; }
.shell-certificate-detail { margin-top: 24px; text-align: center; }
.shell-certificate-detail .exportable-certificate { margin: 0 auto 24px; max-width: 100%; }
.shell-certificate-detail[hidden], .home-course-card[hidden], .shell-empty[hidden] { display: none !important; }
.shell-empty { text-align: center; padding: 48px 24px; border: 1px dashed var(--input-border); border-radius: 20px; background: var(--bg-card); color: var(--text-muted); }
.shell-empty h3 { margin: 12px 0; color: var(--text-main); }
.shell-empty p { margin: 0 auto 24px; max-width: 480px; }
.shell-empty-icon { display: inline-block; color: var(--shell-blue); font-size: 42px; }
.shell-catalog-tools { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 12px; padding: 16px; border: 1px solid var(--input-border); background: var(--bg-card); border-radius: 20px; position: relative; }
.shell-catalog-tools label { display: grid; gap: 8px; min-width: 0; font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.shell-catalog-tools [hidden] { display: none; }
.shell-catalog-tools input, .shell-catalog-tools select { min-width: 0; width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--input-border); border-radius: 12px; background: var(--input-bg); color: var(--text-main); font: inherit; font-size: 16px; }
.shell-catalog-filters summary { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 14px; border: 1px solid var(--input-border); border-radius: 12px; color: var(--shell-blue); background: var(--input-bg); font-size: .9rem; font-weight: 600; cursor: pointer; list-style: none; }
.shell-catalog-filters summary::-webkit-details-marker { display: none; }
.shell-catalog-filters summary svg { width: 15px; height: 15px; flex: none; transition: transform .18s; }
.shell-catalog-filters[open] summary svg { transform: rotate(180deg); }
.shell-catalog-filters summary:focus-visible { outline: 2px solid var(--shell-blue); outline-offset: 3px; }
#shell-filter-count { min-width: 20px; border-radius: 10px; padding: 1px 5px; background: var(--shell-blue); color: white; text-align: center; font-size: .75rem; }
.shell-filter-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(620px, 100%); display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; max-height: min(60vh,460px); overflow: auto; padding: 20px; border: 1px solid var(--input-border); border-radius: 20px; background: var(--bg-card); box-shadow: 0 12px 36px rgba(15,23,42,.16); }
#shell-filter-reset { align-self: end; justify-self: start; min-height: 48px; }
.shell-result-count { font-size: .85rem; color: var(--text-muted); margin: 20px 0 16px; }
#catalog-grid-slot { margin-top: 20px; }
@media (max-width: 680px) {
    .shell-catalog-tools { padding: 12px; gap: 8px; }
    .shell-filter-panel { grid-template-columns: minmax(0,1fr); padding: 16px; gap: 12px; }
    .shell-progress-row { grid-template-columns: minmax(0,1fr); padding: 16px; gap: 16px; }
    .shell-progress-open { justify-self: start; max-width: none; }
    .shell-certificate-pending { padding: 18px; }
    .shell-progress-heading { gap: 8px; }
}
/* Shared course cards: Home and Catalog use one component style.
   Use sRGB alpha layers: unsupported color-mix(var()) resets older browsers
   to transparent at computed-value time, even with an earlier fallback. */
.academy-course-surface .home-course-card:not(.shell-featured-card),
.academy-course-surface .shell-progress-row {
    --home-card-accent: #12ccc1;
    --home-card-accent-rgb: 18, 204, 193;
    --home-card-tint: rgba(18, 204, 193, 0.06);
    --home-card-track: rgba(18, 204, 193, 0.18);
    --home-card-ink: #333333;
    --home-card-button-border: rgba(18, 204, 193, 0.35);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--home-card-tint);
    border-color: var(--home-card-button-border);
    box-shadow: 0 10px 24px rgba(18, 60, 93, 0.08);
}

/* Each tone is one brand color (fff200 / e2eaf0 / 12ccc1 / 00a79d) expressed at
   different opacities: solid for the accent bar, ~6% for the card fill, ~18%
   for the progress track. No second hue, no gradients. */
.academy-course-surface .home-course-card[data-card-tone=mint],
.academy-course-surface .shell-progress-row[data-card-tone=mint] {
    --home-card-accent: #00a79d;
    --home-card-accent-rgb: 0, 167, 157;
    --home-card-tint: rgba(0, 167, 157, 0.06);
    --home-card-track: rgba(0, 167, 157, 0.18);
    --home-card-ink: #333333;
    --home-card-button-border: rgba(0, 167, 157, 0.35);
}

.academy-course-surface .home-course-card[data-card-tone=blue],
.academy-course-surface .shell-progress-row[data-card-tone=blue] {
    --home-card-accent: #12ccc1;
    --home-card-accent-rgb: 18, 204, 193;
    --home-card-tint: rgba(18, 204, 193, 0.06);
    --home-card-track: rgba(18, 204, 193, 0.18);
    --home-card-ink: #333333;
    --home-card-button-border: rgba(18, 204, 193, 0.35);
}

.academy-course-surface .home-course-card[data-card-tone=amber],
.academy-course-surface .shell-progress-row[data-card-tone=amber] {
    --home-card-accent: #fff200;
    --home-card-accent-rgb: 255, 242, 0;
    --home-card-tint: rgba(255, 242, 0, 0.08);
    --home-card-track: rgba(255, 242, 0, 0.28);
    --home-card-ink: #333333;
    --home-card-button-border: rgba(255, 242, 0, 0.55);
}

.academy-course-surface .home-course-card[data-card-tone=violet],
.academy-course-surface .shell-progress-row[data-card-tone=violet] {
    --home-card-accent: #e2eaf0;
    --home-card-accent-rgb: 226, 234, 240;
    --home-card-tint: rgba(226, 234, 240, 0.4);
    --home-card-track: rgba(226, 234, 240, 0.9);
    --home-card-ink: #383839;
    --home-card-button-border: rgba(226, 234, 240, 0.9);
}

.academy-course-surface .home-course-card:not(.shell-featured-card)::before,
.academy-course-surface .shell-progress-row::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    z-index: 0;
    height: 5px;
    background: var(--home-card-accent);
}

.academy-course-surface .home-course-card:not(.shell-featured-card)::after {
    display: none;
}

.academy-course-surface .home-course-card:not(.shell-featured-card) > *:not(.home-card-lock-overlay),
.academy-course-surface .shell-progress-row > * {
    position: relative;
    z-index: 1;
}

.academy-course-surface .home-course-card:not(.shell-featured-card) .cert-banner-icon {
    background: linear-gradient(rgba(var(--home-card-accent-rgb), 0.16), rgba(var(--home-card-accent-rgb), 0.16)), #fff;
    border: 1px solid rgba(var(--home-card-accent-rgb), 0.18);
    box-shadow: 0 8px 16px rgba(var(--home-card-accent-rgb), 0.18);
    /* The glyph stays on ink rather than the accent: fff200 (amber) as a
       stroke color is nearly invisible against its own pale badge fill. */
    color: var(--home-card-ink);
}



html[data-theme=dark] .academy-course-surface .home-course-card:not(.shell-featured-card),
body.dark-mode .academy-course-surface .home-course-card:not(.shell-featured-card),
html[data-theme=dark] .academy-course-surface .shell-progress-row,
body.dark-mode .academy-course-surface .shell-progress-row {
    background: linear-gradient(rgba(var(--home-card-accent-rgb), .08), rgba(var(--home-card-accent-rgb), .08)), var(--bg-card);
    border-color: rgba(var(--home-card-accent-rgb), 0.4);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

html[data-theme=dark] .academy-course-surface .home-course-card:not(.shell-featured-card) .cert-banner-icon,
body.dark-mode .academy-course-surface .home-course-card:not(.shell-featured-card) .cert-banner-icon {
    background: linear-gradient(rgba(var(--home-card-accent-rgb), 0.2), rgba(var(--home-card-accent-rgb), 0.2)), var(--bg-card);
    border-color: rgba(var(--home-card-accent-rgb), 0.38);
    box-shadow: none;
}

@media (max-width: 767px) {
    .academy-course-surface .home-course-card:not(.shell-featured-card),
    .academy-course-surface .shell-progress-row {
        box-shadow: 0 8px 20px rgba(18, 60, 93, 0.08);
    }
}





.academy-course-surface .home-course-card:not(.shell-featured-card) .progress-bar-container {
    display: block;
    width: 100%;
    min-width: 0;
    background: var(--home-card-track);
}
.academy-course-surface .home-course-card:not(.shell-featured-card) .progress-bar {
    background: var(--home-card-accent);
}
.academy-course-surface .home-course-card .language-test-compact-status {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    overflow-wrap: anywhere;
    background: linear-gradient(rgba(var(--home-card-accent-rgb), 0.08), rgba(var(--home-card-accent-rgb), 0.08)), var(--bg-card);
    border-color: var(--home-card-button-border);
}
.academy-course-surface .home-course-card .language-test-status-icon {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 10px;
    background: linear-gradient(rgba(var(--home-card-accent-rgb), 0.18), rgba(var(--home-card-accent-rgb), 0.18)), #fff;
    color: var(--home-card-ink);
}
.academy-course-surface .home-course-card .language-test-status-icon svg {
    width: 1.3rem;
    height: 1.3rem;
    stroke-width: 2;
}

html[data-theme=dark] .academy-course-surface .home-course-card .language-test-compact-status,
body.dark-mode .academy-course-surface .home-course-card .language-test-compact-status {
    background: linear-gradient(rgba(var(--home-card-accent-rgb), 0.12), rgba(var(--home-card-accent-rgb), 0.12)), #101e32;
    border-color: rgba(var(--home-card-accent-rgb), 0.34);
}
html[data-theme=dark] .academy-course-surface .home-course-card .language-test-status-icon,
body.dark-mode .academy-course-surface .home-course-card .language-test-status-icon {
    background: linear-gradient(rgba(var(--home-card-accent-rgb), 0.28), rgba(var(--home-card-accent-rgb), 0.28)), #122541;
    color: #eff6ff;
}



/* Media controls use the same ink, surfaces and outline icons as the app shell. */
.shell-certificate-symbol svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.audio-card.card { margin-bottom: 24px; padding: 28px; text-align: center; border: 1px solid var(--input-border); border-radius: 22px; background: var(--bg-card); box-shadow: 0 6px 22px #123c5d08; }
.audio-word { margin-bottom: 20px; }
.audio-eyebrow { color: var(--shell-blue); font: 600 11px/1.4 var(--font-primary); text-transform: uppercase; letter-spacing: 1.3px; }
.audio-card .audio-term { margin: 8px 0 5px; font-size: clamp(22px, 3vw, 28px); line-height: 1.3; color: var(--shell-ink); }
.audio-card .audio-gloss { margin: 0; font-size: 16px; line-height: 1.5; color: var(--text-muted); }
.lesson-audio-player { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 440px; margin-inline: auto; padding: 12px; border: 1px solid var(--input-border); border-radius: 18px; background: linear-gradient(125deg, var(--shell-soft), var(--bg-card)); }
.audio-play { position: relative; display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: #00a79d; color: #fff; cursor: pointer; box-shadow: 0 4px 10px #00a79d35; }
.audio-play:hover { filter: brightness(1.1); }
.audio-play svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.audio-play-symbol { fill: currentColor; stroke-width: 0; }
.audio-pause-symbol { display: none; stroke-width: 3; }
.is-playing .audio-play-symbol { display: none; }
.is-playing .audio-pause-symbol { display: block; }
.is-loading .audio-play::after { content: ''; position: absolute; inset: -4px; border: 2px solid transparent; border-top-color: var(--shell-blue); border-radius: 50%; animation: audio-loading 1s linear infinite; }
.audio-timeline { flex: 1; min-width: 0; }
.audio-seek { display: block; width: 100%; min-width: 0; height: 28px; margin: 0; padding: 0; border: 0; box-shadow: none; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
.audio-seek::-webkit-slider-runnable-track { height: 5px; border-radius: 4px; background: linear-gradient(to right, var(--shell-blue) var(--audio-progress, 0%), var(--input-border) var(--audio-progress, 0%)); }
.audio-seek::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 13px; height: 13px; margin-top: -4px; border: 2px solid var(--bg-card); border-radius: 50%; background: var(--shell-blue); box-shadow: 0 1px 4px #123c5d25; }
.audio-seek::-moz-range-track { height: 5px; border-radius: 4px; background: var(--input-border); }
.audio-seek::-moz-range-progress { height: 5px; border-radius: 4px; background: var(--shell-blue); }
.audio-seek::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid var(--bg-card); border-radius: 50%; background: var(--shell-blue); }
.audio-seek:disabled { cursor: default; opacity: .6; }
.audio-time { display: flex; justify-content: space-between; color: var(--text-muted); font: 500 11px/1.2 var(--font-primary); font-variant-numeric: tabular-nums; }
.audio-speed { flex: 0 0 74px; width: 74px; min-height: 44px; padding: 6px; color: var(--shell-ink); background: var(--bg-card); border: 1px solid var(--input-border); border-radius: 10px; font: 600 12px/1.2 var(--font-primary); cursor: pointer; }
.audio-play:focus-visible, .audio-seek:focus-visible, .audio-speed:focus-visible { outline: 2px solid var(--shell-blue); outline-offset: 4px; }
.audio-card .audio-error { margin: 12px 0 0; color: var(--text-main); font-size: 13px; line-height: 1.5; }
.audio-error[hidden], .audio-card audio[hidden] { display: none; }
@media (max-width: 480px) {
    .audio-card.card { padding: 18px 12px; }
    .lesson-audio-player { gap: 10px; padding: 10px; }
    .audio-play { flex-basis: 44px; width: 44px; height: 44px; }
    .audio-speed { flex-basis: 64px; width: 64px; padding: 4px; }
}
@media (prefers-reduced-motion: reduce) { .is-loading .audio-play::after { animation: none; } }

@keyframes audio-loading { to { transform: rotate(360deg); } }

.ui-icon { display:inline-block; flex:none; vertical-align:middle; fill:none; stroke:currentColor; }

.home-card-action { position:relative; z-index:1; display:flex; align-items:center; gap:10px; width:100%; }
.home-card-action .home-card-open-btn { flex:1; width:auto; min-width:0; }




.home-course-card .cert-banner-icon { color:var(--home-card-accent, var(--shell-blue)); }

.content-state, .content-loading { grid-column: 1 / -1; width: 100%; min-width: 0; }
.content-state { padding: clamp(24px,4vw,48px); border: 1px solid var(--input-border); border-radius: 24px; background: var(--bg-card); text-align: center; }
.content-state-icon { display: inline-flex; color: var(--shell-blue); background: var(--input-bg); padding: 16px; border-radius: 20px; }
.content-state h3 { margin: 20px 0 12px; color: var(--text-main); }
.content-state p { margin: 0 auto 24px; max-width: 560px; color: var(--text-muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#view-student.is-loading > .dashboard-overview, #view-student.is-loading > .student-view-title { display: none; }
.content-skeletons { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(240px,100%),1fr)); gap: 20px; }
.content-skeletons--profile,
.content-skeletons--course,
.content-skeletons--lesson,
.content-skeletons--certificate { grid-template-columns: minmax(0,1fr); }
.content-skeleton { display: grid; gap: 18px; padding: 28px; border: 1px solid var(--input-border); border-radius: 24px; background: var(--bg-card); }
.content-skeleton .skeleton-line { min-height: 16px; margin: 0; }
.content-skeleton .skeleton-line-title { min-height: 24px; }
.content-skeleton .skeleton-line-medium { width: min(58%, 26rem); }
.content-skeleton .skeleton-line-short { width: min(34%, 12rem); }
.content-skeleton .skeleton-line-progress { width: 100%; height: 12px; border-radius: 999px; }
.content-skeleton .skeleton-line-row { width: 100%; min-height: 48px; border-radius: 12px; }
.content-skeleton .skeleton-avatar { width: 64px; height: 64px; border-radius: 50%; }
.content-skeleton .skeleton-icon { width: 52px; height: 52px; border-radius: 16px; }
.content-skeleton .skeleton-media { width: 100%; min-height: 180px; border-radius: 16px; }
.skeleton-stack { display: grid; gap: 12px; min-width: 0; }
.skeleton-stack--lesson { gap: 14px; }
.content-skeleton--profile { grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 18px 20px; }
.content-skeleton--profile .skeleton-profile-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.content-skeleton--profile .skeleton-line-stat { min-height: 72px; border-radius: 14px; }
.skeleton-course-heading,
.skeleton-certificate-heading { display: flex; align-items: center; gap: 18px; }
.content-skeleton--course .skeleton-course-rows { display: grid; gap: 12px; }
@media (prefers-reduced-motion: reduce) { .content-skeleton .skel { animation: none; } }

@media (max-width: 560px) {
    .content-skeleton { padding: 20px; border-radius: 18px; }
    .content-skeleton--profile { grid-template-columns: auto minmax(0,1fr); }
    .content-skeleton--profile .skeleton-profile-stats { grid-template-columns: 1fr; }
    .content-skeleton .skeleton-line-medium { width: 72%; }
    .content-skeleton .skeleton-line-short { width: 48%; }
    .content-skeleton .skeleton-media { min-height: 130px; }
}

/* Mobile course cards should use the available width for useful content.
   Descriptions remain available on the course detail screen. */
@media (max-width: 767px) {
    #main-content { padding-inline: 8px; }
    #home-course-grid { padding-inline: 0; }
    .home-course-grid { gap: 10px; }
    .home-course-card,
    .home-course-card.completed-bundle {
        padding: 14px;
        gap: 10px 12px;
    }
    .home-course-card .home-card-desc,
    .home-course-card .home-card-desc-toggle {
        display: none !important;
    }
    .home-course-card .cert-banner-text h3 { margin-bottom: 5px; }
    .home-course-card .shell-course-progress-label { margin-top: 10px; }
}

@media (max-width: 380px) {
    #main-content { padding-inline: 4px; }
    .home-course-card,
    .home-course-card.completed-bundle { padding: 12px; }
}

/* Home v2 design polish (Academy Desktop and mobile v2). Quiet hairlines and a
   neutral surface for the shell chrome: pill nav, outlined user card and
   lighter settings/profile cards. Scoped to shell components only, so lesson,
   quiz and certificate views keep their own borders. */
:root {
    --shell-line: #e2eaf0;
    --shell-surface: #f4f7fa;
    --text-muted: #4a4c4f;
}
html[data-theme=dark], body.dark-mode {
    --shell-line: #383839;
    --shell-surface: #1b1c1d;
}
.shell-settings-group,
.profile-account-card,
.profile-scores-card,
.profile-stat-card { border: 1px solid var(--shell-line); }
.shell-settings-row,
.profile-account-row { border-bottom-color: var(--shell-line); }
.shell-settings-row { min-height: 56px; padding: 8px 0; }
.shell-account-actions button { min-height: 46px; border: 1px solid var(--shell-line); }
@media (min-width: 768px) {
    .shell-sidebar { border-right-color: var(--shell-line); }
    .shell-sidebar-nav button { border-radius: var(--radius-pill); }
    .shell-sidebar-nav button:hover { background: var(--shell-surface); }
    .shell-sidebar-nav button[aria-current=page] { font-weight: 600; }
    .shell-sidebar-user { background: none; border: 1px solid var(--shell-line); }
    .profile-stat-card { background: var(--shell-surface); }
}

/* Desktop/mobile v2 additions: launcher Home, first-login picker, language
   popover, lesson-done screen, reminder + certificates rows. Course images are
   untouched; only chrome around them changes. */
:root { --shell-accent: #073763; }
html[data-theme=dark], body.dark-mode { --shell-accent: #ffffff; }
.mini-course-card:not(.completed-bundle):not(.locked-bundle) { border-color: var(--shell-accent); }
.mini-course-code-badge[data-level="A0"] { background: #cdf3f0; color: #0a6b66; }
.mini-course-code-badge[data-level="A1"] { background: #a8ece6; color: #0a6b66; }
.mini-course-code-badge[data-level="A2"] { background: #7fe0d8; color: #0a6b66; }
.mini-course-code-badge[data-level="B1"] { background: #1fa69c; color: #fff; }
.mini-course-code-badge[data-level="B2"] { background: #178a82; color: #fff; }
.mini-course-code-badge[data-level="C1"] { background: #12706a; color: #fff200; }
.mini-course-code-badge[data-level="C2"] { background: #0d5551; color: #fff200; }

.home-text-button { min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--radius-pill); background: none; color: var(--shell-blue); font: 500 14px var(--font-primary); cursor: pointer; }
.home-text-button:hover { background: var(--shell-surface); }

/* Launcher Home */
.home-resume { margin-bottom: 20px; }
.home-subjects, .home-other { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.home-subjects-head h4, .home-other-heading { margin: 0; font: 700 18px/1.3 var(--font-heading); color: var(--shell-ink); }
.home-choose-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; }
.home-choose-button svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.home-tile-list { display: flex; flex-direction: column; gap: 8px; }
.home-tile-list[hidden] { display: none; }
.home-tile {
    display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: 0 14px;
    border: 1.5px solid var(--shell-line); border-radius: 16px; background: var(--bg-body); color: var(--text-main);
    font: inherit; text-align: left; cursor: pointer;
}
.home-tile:hover { background: var(--shell-surface); }
.home-tile-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--shell-blue); color: #fff; }
.home-tile-mark svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.home-tile-mark--flag { background: var(--shell-surface); box-shadow: 0 0 0 1px var(--shell-line); }
.home-tile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-tile-text strong { font: 600 17px var(--font-primary); color: var(--shell-ink); overflow-wrap: anywhere; }
.home-tile-text small { font-size: 14px; color: var(--text-muted); }
.home-tile-chevron { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--text-muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.home-other-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 48px; padding: 0 4px;
    border: 0; border-top: 1.5px solid var(--shell-line); background: none; color: var(--shell-ink);
    font: 600 16px var(--font-primary); cursor: pointer;
}
.home-other-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.home-other-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.home-pick-prompt { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 20px; padding: 20px; border: 1.5px solid var(--shell-line); border-radius: 16px; }
.home-pick-prompt strong { font: 600 17px var(--font-primary); color: var(--shell-ink); }
.home-pick-prompt p { margin: 0; font-size: 15px; color: var(--text-muted); }
.home-pick-prompt .btn-secondary { margin-top: 8px; }
.home-back-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.home-back-button { display: flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 14px 0 8px; border: 0; border-radius: var(--radius-pill); background: var(--shell-surface); color: var(--shell-ink); font: 500 13px var(--font-primary); cursor: pointer; }
.home-back-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.home-back-bar .home-category-heading { flex: 1; justify-content: flex-start; align-items: center; margin: 0; }
.home-back-bar .home-category-heading .header-language-flag { margin-right: 8px; }
.home-back-bar .home-category-done { margin-left: auto; }

/* First-login picker */
.home-onboarding { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(7, 55, 99, .55); overflow-y: auto; }
.home-onboarding[hidden] { display: none; }
.home-onboarding-modal { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px; border-radius: 24px; background: var(--bg-body); box-shadow: 0 24px 60px rgba(7, 55, 99, .3); }
body.has-onboarding { overflow: hidden; }
.home-onboarding-bar { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.home-onboarding-bar-tools { display: flex; align-items: center; gap: 8px; }
.home-onboarding-bar-tools .shell-icon-button[hidden] { display: none; }
.home-onboarding-dots { display: flex; gap: 6px; }
.home-onboarding-dots[hidden] { display: none; }
.home-onboarding-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--shell-line); }
.home-onboarding-dots i.is-current { width: 22px; border-radius: 99px; background: var(--shell-ink); }
.home-onboarding-bar img { width: 52px; height: 52px; object-fit: contain; }
.home-onboarding-modal h2 { margin: 0; text-align: center; font: 700 clamp(24px, 5vw, 30px)/1.15 var(--font-heading); color: var(--shell-ink); }
.home-onboarding-grid { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.home-onboarding-card { display: flex; flex-direction: column; overflow: hidden; border: 1.5px solid var(--shell-line); border-radius: 24px; background: var(--bg-body); }
.home-onboarding-card-head { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 20px 20px; background: var(--shell-surface); }
.home-onboarding-card-head h3 { margin: 0; font: 700 24px var(--font-heading); color: var(--shell-ink); text-align: center; }
.home-onboarding-card-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--shell-ink); color: var(--bg-body); }
.home-onboarding-card-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.home-onboarding-options { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.home-onboarding-option { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 0 16px; border: 1.5px solid var(--shell-line); border-radius: 16px; background: var(--bg-body); color: var(--text-main); font: inherit; text-align: left; cursor: pointer; }
.home-onboarding-option:hover { background: var(--shell-surface); }
.home-onboarding-option[aria-pressed="true"] { border: 2px solid var(--shell-ink); background: var(--shell-surface); }
.home-onboarding-option-name { flex: 1; font: 600 18px var(--font-primary); color: var(--shell-ink); overflow-wrap: anywhere; }
.home-onboarding-check { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid var(--shell-line); color: transparent; }
.home-onboarding-check svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-onboarding-option[aria-pressed="true"] .home-onboarding-check { background: var(--shell-ink); border-color: var(--shell-ink); color: var(--bg-body); }
.home-onboarding-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.home-onboarding-actions .btn-primary { min-width: min(320px, 100%); min-height: 56px; }
.home-onboarding-actions .btn-primary:disabled { opacity: .45; cursor: not-allowed; }

/* Sidebar language + theme controls and the shared language popover */
.shell-sidebar-tools { display: none; }
.sidebar-lang-button, .sidebar-theme-button { display: flex; align-items: center; justify-content: center; border: 1px solid var(--shell-line); background: var(--bg-body); color: var(--text-muted); cursor: pointer; }
.sidebar-lang-button { gap: 6px; height: 36px; padding: 0 10px; border-radius: var(--radius-pill); }
.sidebar-lang-button svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-theme-button { width: 44px; height: 44px; flex: none; border-radius: 50%; color: var(--shell-ink); }
.sidebar-theme-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-lang-button:hover, .sidebar-theme-button:hover { background: var(--shell-surface); }
.lang-popover { position: fixed; z-index: 400; width: 280px; max-height: calc(100vh - 32px); overflow-y: auto; display: flex; flex-direction: column; padding: 6px; border: 1px solid var(--shell-line); border-radius: 16px; background: var(--bg-body); box-shadow: 0 16px 40px rgba(7, 55, 99, .18); }
.lang-popover[hidden] { display: none; }
.lang-popover button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 0 12px; border: 0; border-radius: 12px; background: none; color: var(--text-main); font: inherit; text-align: left; cursor: pointer; }
.lang-popover button:hover, .lang-popover button:focus-visible { background: var(--shell-surface); }
.lang-popover .header-language-flag { width: 28px; height: 20px; }
.lang-popover-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lang-popover-text strong { font: 600 16px var(--font-primary); color: var(--shell-ink); }
.lang-popover-text small { font-size: 13px; color: var(--text-muted); }
.lang-popover svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--shell-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-onboarding-bar .sidebar-lang-button { height: 44px; }
@media (min-width: 768px) {
    .shell-sidebar-tools { display: flex; gap: 8px; margin-top: 12px; }
    #view-home .home-welcome-text--desktop .home-title { font-size: 24px; }
    .home-desktop-layout { max-width: 720px; }
    .home-category-grid .mini-course-card { min-width: 0; }
}

/* Settings: reminder text and the certificates link row */
.settings-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-weight: 600; font-size: 15px; }
.settings-row-text small { font-weight: 400; font-size: 14px; color: var(--text-muted); }
.shell-settings-link { width: 100%; border: 0; border-bottom: 1px solid var(--shell-line); background: none; color: var(--text-main); font: inherit; text-align: left; cursor: pointer; }
.shell-settings-link .settings-row-text { color: var(--text-main); }
.settings-row-value { font-size: 15px; color: var(--text-muted); }
.settings-row-chevron { width: 18px; height: 18px; flex: none; stroke: var(--text-muted); }
#btn-back-from-certificates { margin-bottom: 16px; }

/* Lesson done */
.result-lesson-course { margin: 8px 0 0; font-size: 14px; color: var(--text-muted); }
.result-lesson-progress { width: 100%; max-width: 300px; margin: 16px auto 0; display: flex; flex-direction: column; gap: 6px; }
.result-lesson-progress[hidden], .result-lesson-course[hidden], .result-lesson-next[hidden] { display: none; }
.result-lesson-progress-row { display: flex; justify-content: space-between; font-size: 15px; color: var(--text-muted); }
.result-lesson-progress-row strong { color: var(--shell-ink); }
.result-lesson-progress .progress-bar-container { height: 6px; margin: 0; }
.result-lesson-next { margin: 16px 0 0; font-size: 14px; color: var(--text-muted); }
.results-card.is-passed .score-circle { width: 72px !important; height: 72px !important; margin: 0 auto 8px; background: #3eaf46 !important; box-shadow: none; }
.results-card.is-passed .score-circle::before { display: none; }
.results-card.is-passed #result-score { font-size: 0 !important; color: #fff; }
.results-card.is-passed #result-score svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.results-card.is-passed { display: flex; flex-direction: column; align-items: center; padding: 3rem 1.5rem; }
.results-card.is-passed #result-title { margin-top: 8px; font: 700 clamp(28px, 6vw, 36px)/1.1 var(--font-heading); color: var(--shell-ink); }
.results-card.is-passed > * { order: 9; }
.results-card.is-passed .score-circle { order: 0; }
.results-card.is-passed #result-title { order: 1; }
.results-card.is-passed #result-lesson-course { order: 2; }
.results-card.is-passed #result-lesson-progress { order: 3; }
.results-card.is-passed #result-message { order: 4; }
.results-card.is-passed #result-progress-msg { order: 5; }
.results-card.is-passed #result-language-test-next-step { order: 6; }
.results-card.is-passed #result-lesson-next { order: 7; }
.results-card.is-passed .form-actions { order: 8; }
.results-card.is-passed #btn-finish-course { border: 0; background: none; box-shadow: none; color: var(--text-muted); font-weight: 500; }
.results-card.is-passed .form-actions { width: 100%; max-width: 320px; }
#view-home #home-course-grid { display: block; }
@media (max-width: 480px) {
    #app .mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-action { min-height: 48px; font-size: 15px; padding-inline: 12px; }
}
/* Flags fill their circle (cropped to cover) instead of shrinking inside it. */
.home-tile-mark--flag { overflow: hidden; background: none; }
.home-tile-mark--flag .header-language-flag { width: 100%; height: 100%; background-size: cover; }
.home-onboarding-option > .header-language-flag,
.lang-popover .header-language-flag { width: 36px; height: 36px; flex: none; border-radius: 50%; background-size: cover; box-shadow: 0 0 0 1px var(--shell-line); }
.lang-popover .header-language-flag { width: 28px; height: 28px; }
/* Reminder alarms */
.remind-alarms { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 12px; border-bottom: 1px solid var(--shell-line); }
.remind-alarms[hidden] { display: none; }
.remind-alarm { display: flex; align-items: center; gap: 8px; padding: 0 4px 0 12px; border: 1px solid var(--shell-line); border-radius: 12px; background: var(--shell-surface); }
.remind-alarm .switch { flex: none; margin: 0; width: 36px; height: 20px; }
.remind-alarm .switch .slider:before { width: 14px; height: 14px; left: 3px; bottom: 3px; }
.remind-alarm .switch input:checked + .slider:before { transform: translateX(16px); }
.remind-remove { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: none; color: var(--text-muted); cursor: pointer; }
.remind-remove:hover { background: var(--bg-card); }
.remind-remove svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.remind-add { align-self: flex-start; }
.remind-clock { flex: 1; min-height: 44px; padding: 0; border: 0; background: none; text-align: left; font: 700 20px/1 var(--font-primary); font-variant-numeric: tabular-nums; color: var(--shell-ink); cursor: pointer; }
.remind-chips { display: flex; gap: 8px; }
.remind-chips button { flex: 1; min-height: 44px; padding: 0 8px; border: 1px solid var(--shell-line); border-radius: 12px; background: var(--bg-body); color: var(--text-main); font: 600 14px var(--font-primary); cursor: pointer; }
.remind-chips button[aria-pressed="true"] { background: var(--shell-ink); border-color: var(--shell-ink); color: var(--bg-body); }
.remind-wheels { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; }
.remind-wheels b { font-size: 24px; color: var(--shell-ink); }
.remind-wheel { width: 84px; height: 132px; padding: 44px 0; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.remind-wheel::-webkit-scrollbar { display: none; }
.remind-wheel div { height: 44px; display: grid; place-items: center; scroll-snap-align: center; font: 600 22px var(--font-primary); color: var(--shell-ink); }
.remind-wheel-band { position: absolute; left: 0; right: 0; top: 44px; height: 44px; border-top: 2px solid var(--shell-ink); border-bottom: 2px solid var(--shell-ink); pointer-events: none; }
.remind-missed { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-size: 15px; font-weight: 600; }
.remind-missed .switch { flex: none; margin: 0; width: 36px; height: 20px; }
.remind-missed .switch .slider:before { width: 14px; height: 14px; left: 3px; bottom: 3px; }
.remind-missed .switch input:checked + .slider:before { transform: translateX(16px); }
.home-onboarding-frequency { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.home-onboarding-frequency h3 { margin: 0; font: 600 18px var(--font-primary); color: var(--shell-ink); text-align: center; }
.home-onboarding-frequency h3[hidden], .home-onboarding-frequency[hidden], .home-onboarding-grid[hidden] { display: none; }
.home-onboarding-current { margin: 0; text-align: center; font-size: 14px; font-weight: 600; color: var(--text-muted); }
.home-onboarding-current[hidden] { display: none; }
.home-frequency-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.home-frequency-options button { min-height: 52px; min-width: 96px; padding: 0 18px; border: 1.5px solid var(--shell-line); border-radius: 16px; background: var(--bg-body); color: var(--shell-ink); font: 600 17px var(--font-primary); cursor: pointer; }
.home-frequency-options button[aria-pressed="true"] { border: 2px solid var(--shell-ink); background: var(--shell-surface); }
.remind-save { align-self: stretch; min-height: 48px; }
.remind-save:disabled { opacity: .45; cursor: not-allowed; }
.remind-feedback { margin: 0; min-height: 1.4em; text-align: center; font-size: 14px; font-weight: 600; color: var(--color-success, #3eaf46); }
.remind-feedback:empty { min-height: 0; }
.remind-quiet-hours { margin: 0; text-align: center; font-size: 14px; opacity: .85; }
/* Dutch flag for course groups (not a UI language, so no bundled PNG). */
.header-language-flag[data-language="nl"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 6'%3E%3Crect width='9' height='2' fill='%23AE1C28'/%3E%3Crect y='2' width='9' height='2' fill='%23fff'/%3E%3Crect y='4' width='9' height='2' fill='%2321468B'/%3E%3C/svg%3E"); }
.remind-dialog { text-align: center; }
.remind-dialog .shell-dialog-heading { text-align: left; }
.remind-dialog-clock { margin-bottom: 12px; font: 700 40px/1 var(--font-primary); font-variant-numeric: tabular-nums; color: var(--shell-ink); }
.remind-dialog .remind-chips { margin-bottom: 8px; }
.remind-dialog .remind-save { width: 100%; margin-top: 14px; }
.home-onboarding-card-head { flex-direction: row; justify-content: flex-start; padding: 14px 16px; }
.home-onboarding-card-icon { width: 44px; height: 44px; }
.home-onboarding-card-icon svg { width: 22px; height: 22px; }
.home-onboarding-card-head h3 { font-size: 18px; text-align: left; }
.home-onboarding-options { padding: 12px; }
.home-onboarding-actions { width: 100%; }
.home-onboarding-actions .btn-primary { width: 100%; }
.home-onboarding-actions .home-text-button[hidden] { display: none; }
/* Home greeting: first name, then "Your learning" underneath. */
.home-welcome-text .shell-eyebrow, .home-welcome-text--desktop .shell-eyebrow { margin: 4px 0 0; color: var(--text-muted); font-size: 15px; font-weight: 500; letter-spacing: 0; text-transform: none; }
/* Profile photo at the top right on phones once the install button is gone. */
.shell-top-avatar { display: none; }
@media (max-width: 767px) {
    #shell-install[hidden] ~ .shell-top-avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
    .shell-top-avatar .shell-avatar { width: 40px; height: 40px; }
}
/* Flag-only language picker (round, flag fills the circle). */
.header-language-picker { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; overflow: hidden; }
.header-language-current { justify-content: center; padding: 0; gap: 0; }
.header-language-current .header-language-flag { width: 32px; height: 32px; border-radius: 50%; background-size: cover; }
/* Hamburger menu (phones; the desktop sidebar is the menu there). */
.shell-menu-button { flex: none; margin-left: -8px; color: var(--shell-ink); }
.shell-menu { position: fixed; inset: 0; z-index: 260; background: rgba(7, 55, 99, .5); }
.shell-menu[hidden] { display: none; }
body.has-menu { overflow: hidden; }
.shell-menu-panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); display: flex; flex-direction: column; gap: 2px; padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--bg-body); box-shadow: 8px 0 40px rgba(0, 0, 0, .25); overflow-y: auto; }
.shell-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 12px; }
.shell-menu-brand { display: flex; align-items: center; gap: 10px; font: 700 20px var(--font-heading); color: var(--shell-ink); }
.shell-menu-brand img { width: 36px; height: 36px; border-radius: 50%; }
.shell-menu-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 48px; padding: 0 14px; border: 0; border-radius: 14px; background: none; color: var(--text-main); font: 500 16px var(--font-primary); text-align: left; text-decoration: none; cursor: pointer; }
.shell-menu-item svg { width: 22px; height: 22px; flex: none; color: var(--shell-blue); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.shell-menu-item[aria-current=page] { background: var(--shell-soft); color: var(--shell-ink); font-weight: 600; }
html[data-theme=dark] .shell-menu-item[aria-current=page] { background: rgba(18, 204, 193, .14); color: var(--shell-blue); }
.shell-menu-item:hover { background: var(--shell-surface); }
.shell-menu-link { min-height: 44px; font-size: 15px; color: var(--text-muted); }
.shell-menu-panel hr { width: 100%; margin: 8px 0; border: 0; border-top: 1px solid var(--shell-line); }
.shell-menu-user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px 8px 0; border: 0; background: none; text-align: left; color: var(--text-main); cursor: pointer; }
.shell-menu-user .js-profile-name { display: block; font-size: 14px; font-weight: 700; color: var(--shell-ink); }
@media (min-width: 768px) { .shell-menu-button, .shell-menu { display: none !important; } }

/* Crisp vector flags (replace the small bitmap flags). */
.header-language-flag[data-language="en"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect width='90' height='60' fill='%23012169'/%3E%3Cpath d='M0 0L90 60M90 0L0 60' stroke='%23fff' stroke-width='12'/%3E%3Cpath d='M0 0L90 60M90 0L0 60' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M45 0V60M0 30H90' stroke='%23fff' stroke-width='20'/%3E%3Cpath d='M45 0V60M0 30H90' stroke='%23C8102E' stroke-width='12'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="de"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect y='0' width='90' height='20' fill='%23000'/%3E%3Crect y='20' width='90' height='20' fill='%23dd0000'/%3E%3Crect y='40' width='90' height='20' fill='%23ffce00'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="sk"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect y='0' width='90' height='20' fill='%23fff'/%3E%3Crect y='20' width='90' height='20' fill='%230b4ea2'/%3E%3Crect y='40' width='90' height='20' fill='%23ee1c25'/%3E%3Cpath d='M17 12h24v22c0 9-9 14-12 16-3-2-12-7-12-16z' fill='%23ee1c25' stroke='%23fff' stroke-width='1.4'/%3E%3Cpath d='M27.5 17h3v26h-3zM22 24h14v3H22zM24 30h10v3H24z' fill='%23fff'/%3E%3Cpath d='M17 38q6-9 12-3 6-6 12 3-2 9-12 14-10-5-12-14z' fill='%230b4ea2'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="cz"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect width='90' height='30' fill='%23fff'/%3E%3Crect y='30' width='90' height='30' fill='%23d7141a'/%3E%3Cpath d='M0 0L45 30L0 60z' fill='%2311457e'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="ro"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect x='0' width='30' height='60' fill='%23002b7f'/%3E%3Crect x='30' width='30' height='60' fill='%23fcd116'/%3E%3Crect x='60' width='30' height='60' fill='%23ce1126'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="hu"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect y='0' width='90' height='20' fill='%23cd2a3e'/%3E%3Crect y='20' width='90' height='20' fill='%23fff'/%3E%3Crect y='40' width='90' height='20' fill='%23436f4d'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="pl"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect y='0' width='90' height='30' fill='%23fff'/%3E%3Crect y='30' width='90' height='30' fill='%23dc143c'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="bg"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect y='0' width='90' height='20' fill='%23fff'/%3E%3Crect y='20' width='90' height='20' fill='%2300966e'/%3E%3Crect y='40' width='90' height='20' fill='%23d62612'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="lt"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect y='0' width='90' height='20' fill='%23fdb913'/%3E%3Crect y='20' width='90' height='20' fill='%23006a44'/%3E%3Crect y='40' width='90' height='20' fill='%23c1272d'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="hr"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect y='0' width='90' height='20' fill='%23ff0000'/%3E%3Crect y='20' width='90' height='20' fill='%23fff'/%3E%3Crect y='40' width='90' height='20' fill='%23171796'/%3E%3Cpath d='M34 14h22v20c0 6-6 10-11 12-5-2-11-6-11-12z' fill='%23fff' stroke='%23ff0000' stroke-width='1.2'/%3E%3Crect x='36.0' y='17.0' width='3.6' height='4.8' fill='%23ff0000'/%3E%3Crect x='39.6' y='17.0' width='3.6' height='4.8' fill='%23fff'/%3E%3Crect x='43.2' y='17.0' width='3.6' height='4.8' fill='%23ff0000'/%3E%3Crect x='46.8' y='17.0' width='3.6' height='4.8' fill='%23fff'/%3E%3Crect x='50.4' y='17.0' width='3.6' height='4.8' fill='%23ff0000'/%3E%3Crect x='36.0' y='20.8' width='3.6' height='4.8' fill='%23fff'/%3E%3Crect x='39.6' y='20.8' width='3.6' height='4.8' fill='%23ff0000'/%3E%3Crect x='43.2' y='20.8' width='3.6' height='4.8' fill='%23fff'/%3E%3Crect x='46.8' y='20.8' width='3.6' height='4.8' fill='%23ff0000'/%3E%3Crect x='50.4' y='20.8' width='3.6' height='4.8' fill='%23fff'/%3E%3Crect x='36.0' y='25.6' width='3.6' height='4.8' fill='%23ff0000'/%3E%3Crect x='39.6' y='25.6' width='3.6' height='4.8' fill='%23fff'/%3E%3Crect x='43.2' y='25.6' width='3.6' height='4.8' fill='%23ff0000'/%3E%3Crect x='46.8' y='25.6' width='3.6' height='4.8' fill='%23fff'/%3E%3Crect x='50.4' y='25.6' width='3.6' height='4.8' fill='%23ff0000'/%3E%3Crect x='36.0' y='30.4' width='3.6' height='4.8' fill='%23fff'/%3E%3Crect x='39.6' y='30.4' width='3.6' height='4.8' fill='%23ff0000'/%3E%3Crect x='43.2' y='30.4' width='3.6' height='4.8' fill='%23fff'/%3E%3Crect x='46.8' y='30.4' width='3.6' height='4.8' fill='%23ff0000'/%3E%3Crect x='50.4' y='30.4' width='3.6' height='4.8' fill='%23fff'/%3E%3Crect x='36.0' y='35.2' width='3.6' height='4.8' fill='%23ff0000'/%3E%3Crect x='39.6' y='35.2' width='3.6' height='4.8' fill='%23fff'/%3E%3Crect x='43.2' y='35.2' width='3.6' height='4.8' fill='%23ff0000'/%3E%3Crect x='46.8' y='35.2' width='3.6' height='4.8' fill='%23fff'/%3E%3Crect x='50.4' y='35.2' width='3.6' height='4.8' fill='%23ff0000'/%3E%3Cpath d='M34 12l4 3 3-4 4 3 4-3 3 4 4-3v4H34z' fill='%23171796'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="uk"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect y='0' width='90' height='30' fill='%230057b7'/%3E%3Crect y='30' width='90' height='30' fill='%23ffd700'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="ru"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect y='0' width='90' height='20' fill='%23fff'/%3E%3Crect y='20' width='90' height='20' fill='%230039a6'/%3E%3Crect y='40' width='90' height='20' fill='%23d52b1e'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="nl"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect y='0' width='90' height='20' fill='%23ae1c28'/%3E%3Crect y='20' width='90' height='20' fill='%23fff'/%3E%3Crect y='40' width='90' height='20' fill='%2321468b'/%3E%3C/svg%3E"); }
/* Top-right language picker: a rounded-rectangle flag. */
.header-language-picker { width: 56px; height: 44px; flex: 0 0 56px; border-radius: 12px; overflow: visible; }
.header-language-current .header-language-flag { width: 36px; height: 24px; border-radius: 6px; background-size: cover; background-position: center; box-shadow: 0 0 0 1px rgba(7, 55, 99, .2); }
.header-language-flag { background-size: cover; }
/* Hamburger on the right, drawer slides in from the right. */
.shell-menu-button { margin: 0 -6px 0 0; }
.shell-menu-panel { left: auto; right: 0; box-shadow: -8px 0 40px rgba(0, 0, 0, .25); }
/* Profile is a single column now (settings and account only). */
.profile-body { grid-template-columns: minmax(0, 1fr); max-width: 640px; margin-left: auto; margin-right: auto; }
/* The "x of y courses" line is not shown; screen readers still hear it as the list narrows. */
.shell-result-count { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Progress bars are always the Academy teal, in every theme and card tone. */
.progress-bar, .home-course-card .progress-bar, .home-course-card.completed-bundle .progress-bar,
.academy-course-surface .home-course-card:not(.shell-featured-card) .progress-bar,
.mini-course-card .progress-bar, .mini-course-card.completed-bundle .progress-bar,
html[data-theme=dark] #bundle-cert-banner .progress-bar, body.dark-mode #bundle-cert-banner .progress-bar,
#course-header-progress-bar, #course-header-progress.is-test-progress #course-header-progress-bar { background: #00a79d !important; box-shadow: none !important; }
/* Home card status tags: in progress is yellow, completed is green. */
.mini-course-tag.is-progress { background: #fff200; color: #073763; }
.mini-course-tag.is-done { background: #3eaf46; color: #fff; }
.mini-course-body .mini-course-tag { display: inline-block; margin-bottom: 4px; }
/* Hamburger drawer: slides in from the right with a soft backdrop. */
.shell-menu { display: block; opacity: 0; visibility: hidden; background: rgba(7, 55, 99, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); transition: opacity .3s ease, visibility 0s linear .34s; }
.shell-menu[hidden] { display: none; }
.shell-menu.is-open { opacity: 1; visibility: visible; transition: opacity .3s ease; }
.shell-menu-panel { width: min(320px, 88vw); padding-left: 14px; padding-right: 14px; gap: 4px; border-radius: 28px 0 0 28px; background: var(--bg-body); box-shadow: -18px 0 50px rgba(7, 55, 99, .32); transform: translateX(104%); transition: transform .34s cubic-bezier(.22, .9, .3, 1); will-change: transform; }
.shell-menu.is-open .shell-menu-panel { transform: none; }
.shell-menu-panel > * { opacity: 0; transform: translateX(18px); transition: opacity .32s ease, transform .32s cubic-bezier(.22, .9, .3, 1); }
.shell-menu.is-open .shell-menu-panel > * { opacity: 1; transform: none; }
.shell-menu.is-open .shell-menu-panel > :nth-child(1) { transition-delay: .06s; } .shell-menu.is-open .shell-menu-panel > :nth-child(2) { transition-delay: .10s; }
.shell-menu.is-open .shell-menu-panel > :nth-child(3) { transition-delay: .14s; } .shell-menu.is-open .shell-menu-panel > :nth-child(4) { transition-delay: .18s; }
.shell-menu.is-open .shell-menu-panel > :nth-child(5) { transition-delay: .22s; } .shell-menu.is-open .shell-menu-panel > :nth-child(6) { transition-delay: .24s; }
.shell-menu.is-open .shell-menu-panel > :nth-child(n+7) { transition-delay: .28s; }
.shell-menu-head { padding: 4px 4px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--shell-line); }
.shell-menu-item { min-height: 52px; padding: 0 10px; gap: 14px; border-radius: 18px; transition: background .15s ease, transform .15s ease; }
.shell-menu-item:active { transform: scale(.98); }
.shell-menu-item svg { width: 38px; height: 38px; padding: 8px; border-radius: 13px; background: var(--shell-surface); }
.shell-menu-item[aria-current=page] svg { background: var(--bg-body); box-shadow: 0 2px 8px rgba(7, 55, 99, .12); }
.shell-menu-link { min-height: 44px; padding-left: 58px; }
.shell-menu-panel hr { margin: 10px 4px; width: auto; }
.shell-menu-user { margin-top: auto; padding: 12px; border: 1px solid var(--shell-line); border-radius: 20px; background: var(--shell-surface); }
@media (prefers-reduced-motion: reduce) {
    .shell-menu, .shell-menu.is-open, .shell-menu-panel, .shell-menu-panel > * { transition: none; transform: none; }
    .shell-menu-panel > * { opacity: 1; }
}
/* Phone Home: a quiet greeting and severely simplified course cards. */
@media (max-width: 767px) {
    .home-welcome-card { display: block; margin-bottom: 20px; padding: 0; background: none; border: 0; box-shadow: none; }
    .home-welcome-card .home-title { font-size: 26px; }

    /* Active course: icon, status, name, progress, open. Nothing else. */
    #app .mini-course-card:not(.completed-bundle):not(.locked-bundle) {
        grid-template-columns: 60px minmax(0, 1fr) auto;
        grid-template-areas: "badge tag tag" "badge name name" "badge sub sub" "bar bar pct" "button button button";
        column-gap: 14px; row-gap: 4px; padding: 16px;
    }
    .mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-tag { padding: 3px 10px; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
    .mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-name { font-size: 20px; line-height: 1.2; }
    .mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-sub { font-size: 14px; }
    .mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-pct { align-self: center; font-size: 15px; }
    .mini-course-card:not(.completed-bundle):not(.locked-bundle) .progress-bar-container { margin-top: 12px; align-self: center; }
    .mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-pct { margin-top: 12px; }
    .mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-code-badge,
    .mini-course-card:not(.completed-bundle):not(.locked-bundle) .cert-banner-icon { width: 60px; height: 60px; border-radius: 16px; }
    #app .mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-action { margin-top: 10px; min-height: 48px; font-size: 16px; }
    .home-category-grid { gap: 12px; }
}

/* More flags for course languages, and flag-as-course-icon styling. */
.header-language-flag[data-language="fr"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect x='0' width='30' height='60' fill='%230055a4'/%3E%3Crect x='30' width='30' height='60' fill='%23fff'/%3E%3Crect x='60' width='30' height='60' fill='%23ef4135'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="es"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect width='90' height='60' fill='%23aa151b'/%3E%3Crect y='15' width='90' height='30' fill='%23f1bf00'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="it"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect x='0' width='30' height='60' fill='%23009246'/%3E%3Crect x='30' width='30' height='60' fill='%23fff'/%3E%3Crect x='60' width='30' height='60' fill='%23ce2b37'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="pt"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect width='36' height='60' fill='%23006600'/%3E%3Crect x='36' width='54' height='60' fill='%23ff0000'/%3E%3Ccircle cx='36' cy='30' r='9' fill='%23ffcc00'/%3E%3Ccircle cx='36' cy='30' r='5' fill='%23ff0000'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="tr"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect width='90' height='60' fill='%23e30a17'/%3E%3Ccircle cx='33' cy='30' r='15' fill='%23fff'/%3E%3Ccircle cx='38' cy='30' r='12' fill='%23e30a17'/%3E%3Cpolygon points='52.0,23.0 53.6,27.7 58.7,27.8 54.7,30.9 56.1,35.7 52.0,32.8 47.9,35.7 49.3,30.9 45.3,27.8 50.4,27.7' fill='%23fff'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="sl"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect y='0' width='90' height='20' fill='%23fff'/%3E%3Crect y='20' width='90' height='20' fill='%230058a3'/%3E%3Crect y='40' width='90' height='20' fill='%23ed1c24'/%3E%3C/svg%3E"); }
.header-language-flag[data-language="sr"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 60' preserveAspectRatio='none'%3E%3Crect y='0' width='90' height='20' fill='%23c6363c'/%3E%3Crect y='20' width='90' height='20' fill='%230c4076'/%3E%3Crect y='40' width='90' height='20' fill='%23fff'/%3E%3C/svg%3E"); }
#app .cert-banner-icon.course-flag-icon, .mini-course-card .cert-banner-icon.course-flag-icon { padding: 0; overflow: hidden; background: none !important; box-shadow: 0 0 0 1px rgba(7, 55, 99, .18); }
.course-flag-icon .header-language-flag { display: block; width: 100%; height: 100%; border-radius: inherit; background-size: cover; background-position: center; box-shadow: none; }

/* Home hero card, modelled on the reference: icon, status, name, count, progress. */
#app .mini-course-card:not(.completed-bundle):not(.locked-bundle) {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    grid-template-areas: "badge tag tag" "badge name name" "badge sub sub" "bar bar pct" "button button button";
    column-gap: 16px; row-gap: 4px; padding: 18px; align-items: start;
    border: 1px solid var(--shell-line); border-radius: 24px; background: var(--input-bg); box-shadow: 0 6px 20px rgba(7, 55, 99, .08);
    transition: box-shadow .2s ease, transform .15s ease;
}
#app .mini-course-card:not(.completed-bundle):not(.locked-bundle):hover { box-shadow: 0 10px 28px rgba(7, 55, 99, .14); }
#app .mini-course-card:not(.completed-bundle):not(.locked-bundle):active { transform: scale(.99); }
.mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-code-badge,
.mini-course-card:not(.completed-bundle):not(.locked-bundle) .cert-banner-icon { width: 64px; height: 64px; border-radius: 18px; align-self: start; }
.mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-tag { align-self: end; justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 0; border-radius: 0; background: none; color: var(--shell-blue); font-size: 17px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-tag::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--shell-blue); flex: none; }
.mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-tag:not(.is-progress) { color: var(--text-muted); }
.mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-tag:not(.is-progress)::before { background: var(--input-border); }
.mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-name { align-self: start; font-size: 22px; line-height: 1.15; font-weight: 700; }
.mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-sub { align-self: start; font-size: 15px; white-space: normal; }
.mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-pct { align-self: end; margin-top: 14px; font-size: 22px; font-weight: 700; color: var(--shell-blue); }
.mini-course-card:not(.completed-bundle):not(.locked-bundle) .progress-bar-container { height: 12px; margin-top: 8px; align-self: start; }



/* Featured course: bar and percentage share a row; a real Continue button opens the course. */
#app .mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-action { grid-area: button; position: static; width: 100%; min-height: 48px; margin: 14px 0 0; padding: 0 22px; font-size: 16px; font-weight: 700; color: #073763; background: #fff200; box-shadow: 0 3px 0 rgba(7, 55, 99, .25); }
/* Confirm hiding a course from Home: fades in with a soft scale-up. */


















/* Profile header: avatar, name and client ID centred, with a copy button. Shown at every width. */
.profile-header-row { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 20px; text-align: center; }
#btn-profile { display: none !important; }
.profile-header-avatar { width: 72px; height: 72px; }
.profile-header-avatar svg { width: 36px; height: 36px; }
.profile-header-row .profile-header-title { font-size: 28px; line-height: 1.2; }
.profile-id-row { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; }
.profile-id-row[hidden] { display: none; }
.profile-id-row .profile-client-id { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .02em; color: var(--text-muted); }
.profile-copy-id { position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--shell-blue); cursor: pointer; transition: background .15s ease, color .15s ease; }
.profile-copy-id:hover { background: var(--shell-surface); }
.profile-copy-id svg { grid-area: 1 / 1; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: opacity .15s ease, transform .2s ease; }
.profile-copy-id .done-icon { opacity: 0; transform: scale(.6); }
.profile-copy-id.is-copied { color: #3eaf46; }
.profile-copy-id.is-copied .copy-icon { opacity: 0; transform: scale(.6); }
.profile-copy-id.is-copied .done-icon { opacity: 1; transform: none; }
.profile-copy-status { min-width: 0; font-size: 13px; font-weight: 600; color: #3eaf46; }
.profile-copy-status:empty { display: none; }
/* Courses tab: group header with a count badge, and compact rows (icon | text | chevron, completion underneath). */
.courses-group-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.courses-group-number { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 11px; border-radius: 999px; background: var(--shell-ink); color: var(--bg-body); font: 700 15px var(--font-primary); box-shadow: 0 2px 0 rgba(7, 55, 99, .25); flex: none; }
.courses-group-rows .home-course-card,
.courses-group-rows .home-course-card.completed-bundle,
.courses-group-rows .home-course-card.locked-bundle {
    grid-template-columns: 48px minmax(0, 1fr) 44px;
    grid-template-areas: "badge state action" "badge name action" "label label label" "bar bar bar";
    column-gap: 12px; row-gap: 2px; align-items: center;
}
.courses-group-rows .home-course-card .cert-banner-icon { width: 48px; height: 48px; }
.courses-group-rows .home-course-card .cert-banner-text { display: contents; }
.courses-group-rows .home-course-card .shell-course-state { grid-area: state; align-self: end; font-size: 13px; }
.courses-group-rows .home-course-card .cert-banner-text h3 { grid-area: name; align-self: start; font-size: 16px; line-height: 1.25; }
.courses-group-rows .home-course-card .shell-course-progress-label { grid-area: label; margin-top: 10px; font-size: 12px; }
.courses-group-rows .home-course-card .progress-bar-container { grid-area: bar; width: 100%; max-width: none; height: 6px; margin-top: 4px; }
.courses-group-rows .home-course-card .language-test-next-step { grid-column: 1 / -1; }

/* Progress tracks stay neutral too (the not-started card tone used a yellow track). */
.home-course-card .progress-bar-container, .academy-course-surface .home-course-card:not(.shell-featured-card) .progress-bar-container { background: var(--shell-soft) !important; }
.mini-course-card:not(.completed-bundle):not(.locked-bundle) .progress-bar-container { align-self: center; }
.mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-pct { align-self: center; margin-top: 12px; }
.mini-course-card:not(.completed-bundle):not(.locked-bundle) .mini-course-pct { line-height: 1; margin-top: 12px; padding-bottom: 0; }
.mini-course-card:not(.completed-bundle):not(.locked-bundle) .progress-bar-container { margin-top: 12px; margin-bottom: 0; }
/* Profile on larger screens: wider, with Settings and Account side by side. */
@media (min-width: 768px) {
    .profile-body { max-width: 760px; }
}
@media (min-width: 1000px) {
    #view-profile .profile-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; row-gap: 16px; max-width: 1040px; align-items: start; }
    #view-profile .profile-col-side { display: contents; }
    #view-profile .profile-col-side > div:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; }
    #view-profile .profile-col-side > div:nth-child(2) { grid-column: 2; grid-row: 1; }
    #view-profile .profile-col-side > #profile-account-actions { grid-column: 2; grid-row: 2; }
    #view-profile .profile-header-row { margin-bottom: 28px; }
}
/* Courses tab groups: only the current course shows; the rest fold behind a chevron in the header. */
.courses-group-rows .home-course-card.is-folded { display: none; }
.courses-group-expand { display: grid; place-items: center; width: 44px; height: 44px; flex: none; margin: -6px -8px -6px 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--shell-ink); cursor: pointer; transition: background .15s ease; }
.courses-group-expand:hover { background: var(--shell-surface); }
.courses-group-expand svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .28s cubic-bezier(.22, .9, .3, 1); }
.courses-group-expand[aria-expanded="true"] svg { transform: rotate(180deg); }
.courses-group-card.is-filtering .courses-group-expand { visibility: hidden; }
.courses-group-card:not(.is-open) .courses-group-rows .home-course-card:not(.is-folded) { border-bottom: 0; }
/* Completed and locked courses (Courses tab rows and Home cards): a tint over the whole card,
   a tick or padlock over the course logo. The tint ignores clicks so buttons keep working. */
.home-course-card.completed-bundle, .home-course-card.locked-bundle,
.mini-course-card.completed-bundle, .mini-course-card.locked-bundle { position: relative; }
.academy-course-surface .home-course-card.completed-bundle::after, .academy-course-surface .home-course-card.locked-bundle::after,
.academy-course-surface .mini-course-card.completed-bundle::after, .academy-course-surface .mini-course-card.locked-bundle::after {
    content: ""; display: block; position: absolute; inset: 0; grid-column: 1 / -1; grid-row: auto; width: auto; height: auto; z-index: 2; border-radius: inherit; pointer-events: none;
}
.academy-course-surface .home-course-card.completed-bundle::after, .academy-course-surface .mini-course-card.completed-bundle::after { background: rgba(46, 160, 90, .22); background: color-mix(in srgb, var(--shell-green) 24%, transparent); }
.academy-course-surface .home-course-card.locked-bundle::after, .academy-course-surface .mini-course-card.locked-bundle::after { background: rgba(130, 138, 150, .42); }
.home-course-card.completed-bundle .cert-banner-icon, .home-course-card.locked-bundle .cert-banner-icon,
.mini-course-card.completed-bundle .cert-banner-icon, .mini-course-card.locked-bundle .cert-banner-icon { position: relative; overflow: hidden; }
.home-course-card.completed-bundle .cert-banner-icon::after, .home-course-card.locked-bundle .cert-banner-icon::after,
.mini-course-card.completed-bundle .cert-banner-icon::after, .mini-course-card.locked-bundle .cert-banner-icon::after {
    position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; border-radius: inherit; font-weight: 800; line-height: 1;
}
.home-course-card.completed-bundle .cert-banner-icon::after, .mini-course-card.completed-bundle .cert-banner-icon::after { content: "✓"; background: rgba(46, 160, 90, .82); color: #fff; font-size: 1.4em; }
.home-course-card.locked-bundle .cert-banner-icon::after, .mini-course-card.locked-bundle .cert-banner-icon::after { content: "🔒"; background: rgba(90, 98, 110, .72); font-size: .9em; }
.home-course-card.completed-bundle .cert-banner-icon-fallback, .home-course-card.locked-bundle .cert-banner-icon-fallback,
.mini-course-card.completed-bundle .cert-banner-icon-fallback, .mini-course-card.locked-bundle .cert-banner-icon-fallback { visibility: hidden; }
.home-course-card.locked-bundle .home-card-lock-overlay { display: none; }
/* Home cards have their own padding, so the tint spans the whole card instead of a grid area. */
.academy-course-surface .mini-course-card.completed-bundle::after, .academy-course-surface .mini-course-card.locked-bundle::after { grid-column: auto; grid-row: auto; width: auto; height: auto; }
/* Courses tab rows are flat, so their tint is a rounded panel that reaches a little past the row. */
.academy-course-surface .courses-group-rows .home-course-card.completed-bundle::after,
.academy-course-surface .courses-group-rows .home-course-card.locked-bundle::after { inset: 2px -8px; border-radius: 18px; }
.academy-course-surface .courses-group-rows .home-course-card.completed-bundle:not(.is-folded),
.academy-course-surface .courses-group-rows .home-course-card.locked-bundle:not(.is-folded) { overflow: visible; }
/* Results: lessons bar, course and certificate rings, score numbers and the Home courses. */
.results-stats { margin: 0 0 20px; --rs-blue: var(--shell-blue); --rs-green: var(--shell-green); --rs-amber: #f2b441; --rs-red: #ee6b6b; --rs-grey: var(--input-border); }
.rs-card { margin: 0 0 8px; padding: 12px; border: 1px solid var(--input-border); border-radius: 18px; background: var(--bg-card); }
.rs-track { fill: none; stroke: var(--shell-soft); stroke-width: 3.6; }
.rs-arc { fill: none; stroke-width: 3.6; stroke-linecap: round; }
.rs-arc.is-blue { stroke: var(--rs-blue); } .rs-arc.is-green { stroke: var(--rs-green); } .rs-arc.is-amber { stroke: var(--rs-amber); } .rs-arc.is-grey { stroke: var(--rs-grey); }
/* a number and its short name */
.rs-cell { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; text-align: center; }
.rs-cell strong { color: var(--shell-ink); font-size: 21px; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.rs-cell span { color: var(--text-muted); font-size: 11px; font-weight: 600; line-height: 1.2; }
.rs-row4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.rs-row4 .rs-cell + .rs-cell { border-left: 1px solid var(--input-border); }
.rs-activity { padding: 12px 14px; }
.rs-act-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rs-act-head > strong { color: var(--shell-ink); font-size: 13px; font-weight: 800; }
.rs-seg { display: inline-flex; overflow: hidden; border: 1px solid var(--input-border); border-radius: 999px; }
.rs-seg button { min-height: 30px; padding: 4px 14px; border: 0; background: transparent; color: var(--text-muted); font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.rs-seg button[aria-pressed="true"] { background: var(--shell-ink); color: var(--bg-card); }
.rs-act-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 8px 0 10px; }
.rs-act-total strong { color: var(--shell-ink); font-size: 22px; font-weight: 800; line-height: 1.1; }
.rs-act-total span { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.rs-act-readout { margin-left: auto; color: var(--shell-ink); font-size: 12px; font-style: normal; font-weight: 700; }
.rs-act-bars { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.rs-act-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; border-radius: 6px; cursor: default; }
.rs-act-area { display: flex; align-items: flex-end; justify-content: center; height: 72px; border-bottom: 1px solid var(--input-border); }
.rs-act-area i { display: block; width: min(100%, 28px); border-radius: 4px 4px 0 0; background: var(--rs-blue); }
.rs-act-col.is-zero i { height: 2px !important; border-radius: 0; background: var(--rs-grey); }
.rs-act-col.is-null i { height: 0 !important; }
.rs-act-col.is-null .rs-act-area { border-bottom-style: dashed; }
.rs-act-label { overflow: hidden; color: var(--text-muted); font-size: 11px; font-weight: 600; text-align: center; text-overflow: clip; white-space: nowrap; }
@media (max-width: 420px) { .rs-act-label { font-size: 10px; } }
.rs-act-col.is-current .rs-act-label { color: var(--shell-ink); font-weight: 800; }
.rs-act-col:hover i, .rs-act-col:focus-visible i { filter: brightness(1.15); }
.rs-level { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 14px 14px; text-align: center; --lv: var(--rs-grey); border-color: var(--lv); background: color-mix(in srgb, var(--lv) 12%, var(--bg-card)); }
.rs-level.is-learner { --lv: var(--rs-blue); } .rs-level.is-expert { --lv: var(--rs-green); } .rs-level.is-master { --lv: var(--rs-amber); }
.rs-level.is-champion { --lv: #e0a100; background: linear-gradient(135deg, color-mix(in srgb, #f2b441 32%, var(--bg-card)), color-mix(in srgb, #ee6b6b 16%, var(--bg-card))); }
.rs-level.is-champion .rs-level-name::before { content: "\1F3C6"; margin-right: 6px; }
.rs-rank { display: flex; flex-direction: column; align-items: center; }
.rs-rank strong { color: var(--shell-ink); font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.rs-rank span { margin-top: 2px; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.rs-level-name { padding: 3px 16px; border: 1px solid var(--lv); border-radius: 999px; background: color-mix(in srgb, var(--lv) 22%, transparent); color: var(--shell-ink); font-size: 15px; font-weight: 800; }
.rs-level-bar { width: min(100%, 260px); margin-top: 2px; }
.rs-level em { color: var(--text-muted); font-size: 12px; font-style: normal; font-weight: 600; }
.rs-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin: 10px 0 0; }
.rs-meta .rs-legend { margin: 0; }
.rs-points { margin: 0; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.rs-points strong { color: var(--shell-ink); font-size: 16px; font-weight: 800; }
.rs-meta + .rs-courses { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--input-border); }
.result-lesson-points { margin: 8px 0 0; color: var(--color-success); font-size: 16px; font-weight: 800; }
.result-lesson-points[hidden] { display: none; }
/* lessons: one stacked bar */
.rs-line { display: flex; align-items: baseline; gap: 6px; margin: 0 0 8px; }
.rs-line strong { color: var(--shell-ink); font-size: 26px; font-weight: 800; line-height: 1; }
.rs-line em { color: var(--text-muted); font-size: 14px; font-style: normal; font-weight: 700; }
.rs-line span { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.rs-line b { margin-left: auto; color: var(--rs-blue); font-size: 18px; font-weight: 800; }
.rs-stack { display: flex; gap: 3px; height: 14px; }
.rs-stack i { display: block; min-width: 0; border-radius: 999px; }
.rs-stack .is-green, .rs-legend .is-green::before { background: var(--rs-green); }
.rs-stack .is-blue, .rs-legend .is-blue::before { background: var(--rs-blue); }
.rs-stack .is-red, .rs-legend .is-red::before { background: var(--rs-red); }
.rs-stack .is-grey, .rs-legend .is-grey::before { background: var(--rs-grey); }
.rs-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 9px 0 0; padding: 0; list-style: none; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.rs-legend li { display: inline-flex; align-items: center; gap: 5px; }
.rs-legend li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.rs-legend b { color: var(--shell-ink); font-size: 13px; }
.rs-legend.is-stacked { flex-direction: column; gap: 4px; margin: 0; }
/* course status donut + certificates ring */
.rs-duo { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px; margin: 0 0 8px; }
.rs-duo .rs-card { margin: 0; }
.rs-donut-card { display: flex; align-items: center; gap: 10px; padding: 10px; }
.rs-donut-card .rs-legend { font-size: 11.5px; white-space: nowrap; }
.rs-ring-box { position: relative; display: grid; place-items: center; flex: none; width: 64px; height: 64px; }
.rs-ring-box svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.rs-ring-box strong { position: relative; color: var(--shell-ink); font-size: 16px; font-weight: 800; white-space: nowrap; }
.rs-ring-box strong small { color: var(--text-muted); font-size: 11px; font-weight: 700; }
.rs-donut-card:last-child { flex-direction: column; justify-content: center; gap: 4px; text-align: center; }
.rs-caption { color: var(--text-muted); font-size: 11px; font-weight: 600; line-height: 1.2; }
/* courses on Home */
.rs-courses { display: grid; gap: 10px; margin: 0 0 12px; padding: 0; list-style: none; }
.rs-course-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; color: var(--shell-ink); font-size: 12.5px; font-weight: 600; }
.rs-course-head span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-course-head b { flex: none; font-weight: 800; }
.rs-course-head em { flex: none; min-width: 34px; color: var(--rs-amber); font-size: 11.5px; font-style: normal; font-weight: 800; text-align: right; }
.rs-bar.rs-bar-lessons { height: 12px; }
.rs-bar { height: 7px; border-radius: 999px; background: var(--shell-soft); overflow: hidden; }
.rs-bar i { display: block; height: 100%; border-radius: inherit; background: var(--rs-blue); }
.rs-course.is-done .rs-bar i { background: var(--rs-green); }
.rs-add { width: 100%; min-height: 44px; }
.results-certificates-heading { margin: 16px 0 10px; }
.results-certificates-heading h3 { margin: 0 0 4px; font-size: 20px; }
.results-certificates-heading p { margin: 0; color: var(--text-muted); font-size: 14px; }
/* Certificates: one card, one row per certificate (name, score, view). */
.rs-certs { padding: 2px 14px; }
.rs-cert-list { margin: 0; padding: 0; list-style: none; }
.rs-cert { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 12px 0; }
.rs-cert + .rs-cert { border-top: 1px solid var(--input-border); }
.rs-cert-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--shell-soft); color: var(--text-muted); }
.rs-cert.is-earned .rs-cert-icon { background: rgba(46, 160, 90, .22); color: var(--rs-green); }
.rs-cert-icon svg { width: 18px; height: 18px; }
.rs-cert-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rs-cert-name strong { color: var(--shell-ink); font-size: 14px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.rs-cert-name span { color: var(--rs-green); font-size: 13px; font-weight: 800; }
.rs-cert .shell-certificate-view { min-height: 36px; padding: 0 10px; font-size: 12px; letter-spacing: 0; white-space: nowrap; }
.rs-cert .shell-certificate-detail, .rs-cert .rs-cert-next { grid-column: 1 / -1; }
.rs-cert .shell-certificate-detail[hidden] { display: none; }
@media (min-width: 768px) {
    .results-stats { max-width: 800px; }
    .rs-card { padding: 18px; }
    .rs-cell strong { font-size: 28px; }
    .rs-donut-card { padding: 16px; }
    .rs-ring-box { width: 92px; height: 92px; }
    .rs-ring-box strong { font-size: 22px; }
}

        /* Bundle overview: compact card — logo left, info right */
        .dashboard-overview { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 1.25rem; }
        #bundle-cert-banner { display: grid !important; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "icon text btn" "next next next" "toggle toggle toggle"; align-items: center !important; gap: 6px 12px; padding: 12px 16px; background: var(--input-bg); border: 2px solid var(--color-primary); border-radius: 18px; box-shadow: none; text-align: left; }
        #bundle-cert-banner::after { display: none; }
        #bundle-cert-banner #bundle-cert-icon { grid-area: icon; width: 40px; height: 40px; border-radius: 10px; font-size: 24px; }
        #bundle-cert-banner #bundle-cert-icon img { width: 100%; height: 100%; object-fit: contain; }
        #bundle-cert-banner .cert-banner-text { grid-area: text; min-width: 0 !important; width: auto; }
        #bundle-cert-banner .cert-banner-text h3 { margin: 0; font-size: 17px; line-height: 1.2; }
        #bundle-cert-banner .cert-banner-text p { margin: 0; font-size: 13px; line-height: 1.3; }
        #bundle-cert-banner .progress-bar-container { height: 6px; margin-top: 6px; }
        #bundle-cert-banner #btn-claim-certificate { grid-area: btn; width: auto; margin: 0; padding: 6px 14px; font-size: 13px !important; }
        #bundle-cert-banner .language-test-next-step { grid-area: next; width: 100%; }
        #bundle-cert-banner #toggle-completed-wrapper { grid-area: toggle; width: auto; justify-content: flex-start !important; gap: 8px !important; margin-top: 0 !important; padding-top: 6px !important; }
        #bundle-cert-banner #toggle-completed-text { font-size: 13px; font-weight: 600 !important; }
        #bundle-cert-banner .switch { width: 34px; height: 18px; flex: none; }
        #bundle-cert-banner .switch .slider:before { width: 12px; height: 12px; left: 3px; bottom: 3px; }
        #bundle-cert-banner .switch input:checked + .slider:before { transform: translateX(16px); }
        @media (max-width: 768px) {
            #bundle-cert-banner { grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "icon text" "btn btn" "next next" "toggle toggle"; padding: 10px 12px; }
            #bundle-cert-banner #btn-claim-certificate { width: 100%; }
        }

        /* Course cards: description clamped to 1 row with a toggle; action and score share one row */
        .course-desc { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
        .course-desc.expanded { display: block; -webkit-line-clamp: unset; }
        .course-desc-toggle { display: block; width: 28px; height: 12px; margin: 0 auto; padding: 0; background: none; border: 0; color: var(--color-primary); cursor: pointer; position: relative; }
        .course-desc-toggle::before { content: ''; position: absolute; left: 50%; top: 0; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateX(-50%) rotate(45deg); }
        .course-desc-toggle[aria-expanded="true"]::before { top: 4px; transform: translateX(-50%) rotate(-135deg); }
        .course-card:has(.course-desc-wrap) { padding: 1.25rem 1.5rem; }
        .course-card-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: auto; padding-top: 0.4rem; }
        .course-desc-toggle[hidden] { display: none; }
        @media (max-width: 768px) {
            .category-section { padding-left: 0.2rem; padding-right: 0.2rem; }
            #student-course-container .course-grid { padding-left: 0; padding-right: 0; }
            .course-card:has(.course-desc-wrap) { padding: 1rem 0.9rem; }
        }

        /* Claim button doubles as the progress bar while the certificate is locked */
        #bundle-cert-banner #btn-claim-certificate:disabled { opacity: 1; cursor: default; color: var(--text-main); border: 1px solid var(--color-accent); background: linear-gradient(90deg, var(--color-accent) var(--cert-pct, 0%), var(--shell-soft, #eef2f6) var(--cert-pct, 0%)); }
        #student-course-container { margin-top: 1.25rem; }
        .course-card { border: 2px solid var(--input-border); }
        /* Courses tab rows sit flat on the group card: no tint, shadow or tone border of their own;
           only the status (completed, locked, hidden) colors a row. */
        .academy-course-surface .courses-group-rows .home-course-card:not(.shell-featured-card) { background: transparent; box-shadow: none; border-color: var(--input-border); }

        .academy-course-surface .courses-group-rows .home-course-card:not(.shell-featured-card):is(:hover, :focus-within, :active) { transform: none; box-shadow: none; }
        .courses-group-rows .home-course-card { transition: none; }
        .courses-group-card { background: var(--input-bg); }
        /* Dark mode paints every Home-style card with a tinted gradient, shadow and tone border at a higher specificity; the rows must stay flat. */
        html[data-theme=dark] .academy-course-surface .courses-group-rows .home-course-card:not(.shell-featured-card),
        body.dark-mode .academy-course-surface .courses-group-rows .home-course-card:not(.shell-featured-card) { background: transparent; box-shadow: none; border-color: var(--input-border); }


/* Certificates: label + count window in the sidebar, bottom nav and mobile menu. */
.shell-nav-label { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.cert-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: #3eaf46; color: #fff; font: 700 11px/1 var(--font-primary); }
.cert-count[hidden] { display: none; }
.shell-menu-item .shell-nav-label { flex: 1; justify-content: flex-start; }
.shell-sidebar-nav .shell-nav-label { justify-content: flex-start; }
.rs-cert-icon.has-media { background: var(--bg-card); border: 1px solid var(--input-border); overflow: hidden; }
.rs-cert-icon img { width: 100%; height: 100%; object-fit: cover; }
.rs-cert-icon .header-language-flag { width: 100%; height: 100%; }
.rs-cert .shell-certificate-view { margin-top: 0; align-self: center; }

/* Owl buddy: corner-docked, never interactive, slides in only for a reason. */
#owl-buddy { position: fixed; z-index: 140; left: max(16px, env(safe-area-inset-left)); bottom: calc(var(--shell-nav-height, 80px) + env(safe-area-inset-bottom, 0px) + 6px); width: 96px; aspect-ratio: 480 / 394; pointer-events: none; user-select: none; -webkit-user-select: none; transform: scale(.82); transform-origin: 30% 100%; opacity: 0; transition: transform .3s cubic-bezier(.22, 1.3, .36, 1), opacity .22s ease; will-change: transform, opacity; }
#owl-buddy[hidden] { display: none; }
#owl-buddy.in { transform: none; opacity: 1; }
#owl-buddy .owl-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
#owl-buddy video.owl-media { opacity: 0; transition: opacity .12s linear; }
#owl-buddy video.owl-media.on { opacity: 1; }
#owl-buddy .owl-bubble { position: absolute; left: 8%; bottom: calc(100% - 6px); width: max-content; max-width: min(220px, calc(100vw - 32px)); padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--bg-card, #fff); color: var(--text-main, #123c5d); border: 1px solid var(--input-border, #d4e5e2); box-shadow: 0 6px 20px rgba(7, 55, 99, .14); font: 600 13px/1.35 var(--font-primary, inherit); opacity: 0; transform: translateY(6px) scale(.96); transform-origin: bottom left; transition: opacity .2s ease .25s, transform .2s ease .25s; }
#owl-buddy .owl-bubble.on { opacity: 1; transform: none; }
#owl-buddy .owl-bubble:empty { display: none; }
@media (min-width: 768px) {
    #owl-buddy { width: 150px; left: calc(var(--shell-gutter, 0px) + 240px + 24px); bottom: 20px; }
    #owl-buddy .owl-bubble { font-size: 14px; max-width: 260px; }
}
@media (max-height: 480px) and (orientation: landscape) { #owl-buddy { width: 72px; } }
@media (prefers-reduced-motion: reduce) { #owl-buddy { transform: none; transition: opacity .2s ease; } #owl-buddy .owl-bubble { transition: opacity .2s ease; transform: none; } }
/* Support page: the owl sits top right, under the language/menu widget, with its speech bubble to its left. */
body:has(#app[data-view="support"]) #owl-buddy:not(.owl-docked) { top: calc(env(safe-area-inset-top, 0px) + 68px); bottom: auto; left: auto; right: max(12px, env(safe-area-inset-right)); transform-origin: 70% 0; }
body:has(#app[data-view="support"]) #owl-buddy:not(.owl-docked) .owl-bubble { left: auto; right: calc(100% + 2px); top: 50%; bottom: auto; max-width: min(220px, calc(100vw - 96px - 30px)); border-radius: 14px 4px 14px 14px; transform: translateY(-50%) scale(.96); transform-origin: right center; }
body:has(#app[data-view="support"]) #owl-buddy:not(.owl-docked) .owl-bubble.on { transform: translateY(-50%); }
@media (min-width: 768px) {
    body:has(#app[data-view="support"]) #owl-buddy:not(.owl-docked) { top: 84px; right: calc(var(--shell-gutter, 0px) + 40px); }
    body:has(#app[data-view="support"]) #owl-buddy:not(.owl-docked) .owl-bubble { max-width: 260px; }
}
@media (prefers-reduced-motion: reduce) { body:has(#app[data-view="support"]) #owl-buddy:not(.owl-docked) .owl-bubble { transform: translateY(-50%); } }
#owl-debug { position: fixed; z-index: 2000; left: 8px; bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px; max-width: min(420px, calc(100vw - 16px)); padding: 8px; border-radius: 10px; background: rgba(7, 55, 99, .92); color: #fff; font: 12px/1.3 system-ui, sans-serif; }
#owl-debug strong { flex: 1 0 100%; }
#owl-debug button { padding: 4px 8px; border: 0; border-radius: 6px; background: #fff; color: #073763; font: inherit; cursor: pointer; }

/* Docked owl: in the flow of a modal (row = owl + speech), so nothing is ever covered. */
.home-onboarding-owl { width: 100%; min-height: 72px; }
.home-onboarding-owl[hidden], .home-onboarding-owl:empty { display: none; }
#owl-buddy.owl-docked { position: relative; inset: auto; z-index: auto; width: 100%; min-height: 72px; aspect-ratio: auto; padding-left: 92px; display: flex; align-items: center; transform: scale(.9); transform-origin: left center; }
#owl-buddy.owl-docked.in { transform: none; }
#owl-buddy.owl-docked .owl-media { right: auto; width: 84px; height: auto; aspect-ratio: 480 / 394; top: 50%; transform: translateY(-50%); inset-inline-start: 0; }
#owl-buddy.owl-docked .owl-bubble { position: relative; left: auto; right: auto; bottom: auto; max-width: none; width: auto; flex: 1; border-radius: 4px 14px 14px 14px; transform: none; transition: opacity .2s ease .15s; text-align: left; }

/* Sequence game: the real card moves into its new slot while held (lit up, elastic toward the pointer); no floating copy. */
.sequence-item { position: relative; transition: box-shadow .2s, border-color .2s, background-color .2s, translate .2s ease-out, rotate .2s ease-out; }
.seq-pos { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--input-bg); color: var(--text-muted); font-size: .85rem; font-weight: 700; transition: background-color .2s, color .2s; }
.sequence-item.sortable-chosen:not(.sortable-ghost) { border-color: var(--color-primary); box-shadow: 0 0 0 4px rgba(14, 129, 156, .22); }
/* the held card = Sortable's in-list placeholder: fully visible, lit, sitting in its new position */
.sequence-item.sortable-ghost, #view-course-article .sequence-item.sortable-ghost { opacity: 1; z-index: 2; border: 2px solid var(--color-primary); background: var(--bg-card); box-shadow: 0 0 0 4px rgba(14, 129, 156, .28), 0 8px 18px rgba(7, 55, 99, .16); scale: 1.015; transition: box-shadow .2s, border-color .2s, background-color .2s; cursor: grabbing; }
.sequence-item.sortable-ghost .seq-pos { background: var(--color-primary); color: #fff; }
.sequence-item.sortable-ghost .drag-handle-game { color: var(--color-primary); }
/* Sortable's pointer-following clone is only a tracking helper: keep it invisible */
.sequence-item.sortable-drag, #view-course-article .sequence-item.sortable-drag { opacity: 0 !important; pointer-events: none; box-shadow: none; }
.sequence-list.is-dragging .sequence-item:not(.sortable-ghost):not(.sortable-drag) { opacity: .92; }
.sequence-item.seq-dropped { animation: seq-drop .45s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes seq-drop { 0% { scale: 1.02; box-shadow: 0 0 0 4px rgba(14, 129, 156, .28); border-color: var(--color-primary); } 60% { scale: .995; } 100% { scale: 1; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) {
    .sequence-item { transition: box-shadow .2s, border-color .2s, background-color .2s; }
    .sequence-item.sortable-ghost, #view-course-article .sequence-item.sortable-ghost { scale: 1; }
    .sequence-item.seq-dropped { animation: none; }
}

/* Support view: short lead, IBAN with copy button, team. */
.support-card, .support-team { max-width: 800px; }
.support-card { padding: 36px 28px 32px; border: 1px solid var(--input-border); border-radius: 24px; background: var(--bg-card); box-shadow: var(--shadow-soft); text-align: center; }
.support-card h3 { margin: 0 0 12px; color: var(--shell-ink); font-size: clamp(24px, 3vw, 32px); font-weight: 700; line-height: 1.18; letter-spacing: -.4px; text-wrap: balance; }
.support-lead { margin: 0 0 26px; color: var(--text-main); font-size: 17px; line-height: 1.55; text-wrap: pretty; }
.support-iban { padding: 16px 16px 16px 20px; border: 2px solid var(--shell-blue); border-radius: 18px; background: var(--shell-soft); text-align: left; }
.support-iban-label { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.support-iban-row { display: flex; align-items: center; gap: 16px; }
.support-iban-value { flex: 1; min-width: 0; color: var(--shell-ink); font: 700 clamp(22px, 2.6vw, 28px)/1.3 var(--font-primary); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; user-select: all; }
.support-iban-copy { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none; min-width: 132px; min-height: 52px; padding: 0 24px; font-size: 16px; font-weight: 700; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.support-iban-copy:active { transform: scale(.97); }
.support-iban-copy svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.support-iban-copy.is-copied { background: #3eaf46; border-color: #3eaf46; }
.support-member h4 { margin: 0 0 6px; color: var(--text-main); font-size: 21px; letter-spacing: -.2px; font-weight: 700; }
.support-team { margin-top: 40px; }
.support-team > h3 { margin: 0 0 16px; color: var(--shell-ink); font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
/* Equal boxes: same width, same height, fixed header height in every card. */
.support-team-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 14px; }
/* Picture left, spanning two equal cells on its right: the name sits on the bottom of the upper cell,
   the role hangs from the top of the lower cell, so both meet at the picture's middle however many
   lines the role takes. Below: the description. */
.support-member { display: grid; grid-template-columns: 80px minmax(0, 1fr); grid-template-rows: 40px 40px 1fr; column-gap: 12px; align-items: center; padding: 18px 16px 22px; border: 1px solid var(--input-border); border-radius: 20px; background: var(--bg-card); }
.support-member-avatar { grid-column: 1; grid-row: 1 / span 2; display: block; width: 80px; height: 80px; border: 2px solid var(--shell-blue); border-radius: 50%; background: #fff; object-fit: cover; }
.support-member h4 { grid-column: 2; grid-row: 1; align-self: end; margin: 0 0 2px; line-height: 1.2; text-align: center; }
.support-member-role { grid-column: 2; grid-row: 2; align-self: start; display: block; line-height: 1.3; color: var(--shell-blue); font-size: 13px; font-weight: 600; text-align: center; }
.support-member p { grid-column: 1 / -1; grid-row: 3; align-self: start; margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--input-border); color: var(--text-muted); font-size: 15px; line-height: 1.5; text-align: left; }
/* The whole Atena team: one full-width card under the three contributors. */
.support-atena { margin-top: 14px; border: 1px solid var(--input-border); border-radius: 20px; background: var(--bg-card); overflow: hidden; }
.support-atena img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; }
.support-atena-body { padding: 16px 18px 18px; }
.support-atena-body h4 { margin: 0 0 6px; color: var(--text-main); font-size: 17px; font-weight: 700; }
.support-atena-body p { margin: 0; color: var(--text-muted); font-size: 15px; line-height: 1.55; text-wrap: pretty; }
/* Three columns need a wide content area; with the sidebar open that starts at about 1040px. */
@media (max-width: 1040px) {
    .support-team-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
    .support-atena { margin-top: 12px; }
    .support-atena-body { padding: 14px 14px 16px; }
    .support-card { padding: 26px 12px 22px; border-radius: 20px; }
    .support-card h3 { font-size: 24px; }
    .support-lead { margin-bottom: 20px; font-size: 16px; }
    .support-iban { padding: 14px 10px 10px; text-align: center; }
    .support-iban-row { flex-direction: column; align-items: stretch; gap: 12px; }
    .support-iban-value { font-size: clamp(15px, 5vw, 22px); text-align: center; }
    .support-team { margin-top: 32px; }
    .support-team > h3 { font-size: 20px; }
    .support-team-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .support-member { padding: 16px 16px 20px; }
}

/* Recommend to a friend pop-up: a headline, large tiles three to a row, Copy link. Sized for older eyes and thumbs. */
.share-dialog .shell-icon-button { width: 48px; min-height: 48px; }
.share-dialog .shell-dialog-heading { margin-bottom: 22px; }
.share-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 0; }
.share-tile { flex: 0 0 33.33%; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0; border: 0; border-radius: 14px; background: none; color: var(--text-main); font: 600 15px/1.2 var(--font-primary); text-align: center; text-decoration: none; overflow-wrap: anywhere; cursor: pointer; }
.share-tile[hidden] { display: none; }
.share-tile:focus-visible { outline: 3px solid var(--shell-blue); outline-offset: 3px; }
.share-tile-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--shell-blue); color: #fff; transition: transform .15s ease, filter .15s ease; }
.share-tile:hover .share-tile-icon { filter: brightness(1.08); }
.share-tile:active .share-tile-icon { transform: scale(.94); }
.share-tile-icon svg, .share-copy svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.share-whatsapp { background: #25d366; }
.share-messenger { background: #0084ff; }
.share-viber { background: #7360f2; }
.share-instagram { background: linear-gradient(45deg, #f9a03f, #e1306c 50%, #833ab4); }
.share-dialog .share-status { margin: 16px 0 0; color: var(--shell-blue); font-size: 14px; font-weight: 600; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
.share-dialog .share-status:empty { display: none; }
.share-dialog .share-copy { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; margin-top: 22px; padding: 0 16px; font-size: 17px; font-weight: 700; letter-spacing: 0; }
.share-copy svg { width: 22px; height: 22px; flex: none; }
.share-copy.is-copied { background: #3eaf46; border-color: #3eaf46; color: #fff; }
@media (max-width: 380px) { .share-tile-icon { width: 54px; height: 54px; } .shell-dialog.share-dialog { padding: 20px 12px; } }

/* One automatic invitation, presented only at a safe Home visit. */
.academy-invitation { position: fixed; inset: 0; margin: 0; width: 100%; max-width: none; height: 100%; max-height: none; padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); box-sizing: border-box; border: 0; background: var(--bg-card); color: var(--text-main); overflow-y: auto; }
.academy-invitation::backdrop { background: #0b243a88; }
.invitation-content { display: flex; min-height: 100%; max-width: 580px; margin: auto; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 24px; }
.invitation-close { position: absolute; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); }
.invitation-owl { width: min(240px, 55vw); height: auto; object-fit: contain; }
.invitation-content h2 { margin: 0; font-size: clamp(26px, 4vw, 38px); line-height: 1.2; text-wrap: balance; }
.invitation-content p { margin: 0; max-width: 480px; font-size: 18px; line-height: 1.6; color: var(--text-muted); text-wrap: pretty; }
.invitation-actions { display: flex; flex-direction: column; align-items: stretch; width: min(100%, 340px); gap: 12px; }
.invitation-actions button { min-height: 52px; padding: 12px 24px; font-size: 17px; }
.academy-invitation button:focus-visible { outline: 3px solid var(--shell-blue); outline-offset: 4px; }
@media (max-height: 580px) { .invitation-content { gap: 16px; } .invitation-owl { width: 140px; } }

:root { --app-safe-bottom: env(safe-area-inset-bottom, 0px); }
html { min-height: 100%; }
body { padding-bottom: calc(1rem + var(--app-safe-bottom)); }
#app[hidden], #academy-gate[hidden], [data-pwa][hidden] { display: none !important; }
#academy-gate { position: relative; z-index: 10; max-width: 29rem; margin: max(2rem, env(safe-area-inset-top)) auto 2rem; padding: 2rem; border: 1px solid #d4e5e2; border-radius: 1.5rem; background: #fff; color: #16332e; box-shadow: 0 12px 50px #103a2a15; }
#academy-gate h1 { margin: .5rem 0 1rem; font-size: 1.9rem; }
#academy-gate img { width: 96px; height: 96px; object-fit: contain; border-radius: .5rem; }
#academy-gate label { display: block; margin-top: 1rem; font-weight: 600; }
#academy-gate input, #academy-gate select { width: 100%; min-height: 44px; padding: .7rem; border: 1px solid #77958f; border-radius: .5rem; color: #16332e; background: white; font-size: 16px; }
#academy-gate button, .academy-app-button { padding: .65rem 1rem; min-height: 44px; border: 1px solid #176b63; border-radius: .6rem; background: #176b63; color: white; cursor: pointer; font: inherit; }
#academy-gate button { margin-top: 1rem; width: 100%; }
#academy-gate button:disabled, .academy-app-button:disabled { opacity: .6; cursor: wait; }
.academy-app-links { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .9rem; margin-top: 1rem; }
.academy-app-links a { color: #176b63; text-decoration: underline; }
#academy-status { min-height: 1.5em; white-space: pre-line; margin: 1rem 0; }
#academy-status[role=alert] { color: #a52b28; }
#academy-social-login { margin-top: 1rem; }
#academy-gate .academy-social-divider { display: flex; align-items: center; gap: .75rem; color: var(--text-muted); font-size: .9rem; }
.academy-social-divider::before, .academy-social-divider::after { content: ''; height: 1px; flex: 1; background: var(--input-border); }
.academy-social-intro { margin: .5rem 0; font-size: .9rem; color: var(--text-muted); }
#academy-gate .academy-social-button { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: .65rem; min-height: 48px; padding: .75rem; border: 1px solid #747775; border-radius: .6rem; background: #fff; color: #1f1f1f; box-shadow: none; font-weight: 600; }
#academy-gate .academy-social-button svg { flex: none; }
#academy-gate .academy-social-button:hover:not(:disabled) { background: #f3f6fc; }
#academy-gate .academy-social-facebook { background: #0866ff; border-color: #0866ff; color: #fff; }
#academy-gate .academy-social-facebook:hover:not(:disabled) { background: #0758db; }
#academy-startup-spinner { display: none; }
/* The anonymous shell checks the session before showing private content. Only
   sign-in/errors need the full card; the ordinary startup is a quiet loader. */
#academy-gate[data-state=loading] { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow-y: auto; max-width: none; margin: 0; padding: 2rem; border: 0; border-radius: 0; background: transparent; color: var(--text-muted); box-shadow: none; text-align: center; }
#academy-gate[data-state=loading] > :not(#academy-status):not(#academy-startup-spinner):not(noscript) { display: none !important; }
#academy-gate[data-state=loading] #academy-startup-spinner { position: relative; display: grid; place-items: center; width: 124px; height: 124px; border-radius: 50%; filter: drop-shadow(0 16px 26px rgba(15, 23, 42, .12)); }
#academy-gate[data-state=loading] .academy-startup-spinner-ring { position: absolute; inset: 0; border: 5px solid transparent; border-radius: 50%; background: conic-gradient(from -35deg, var(--color-primary) 0 34%, var(--color-accent) 34% 53%, #38c8bb 53% 67%, rgba(226, 232, 240, .9) 67% 100%) border-box; -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: academy-startup-spin 1.25s cubic-bezier(.55, .1, .35, .9) infinite; }
#academy-gate[data-state=loading] .academy-startup-spinner-ring::after { content: ''; position: absolute; inset: -8px; border: 1px solid rgba(37, 99, 235, .13); border-radius: 50%; }
#academy-gate[data-state=loading] .academy-startup-spinner-core { position: relative; z-index: 1; display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; background: transparent; }
#academy-gate[data-state=loading] .academy-startup-spinner-core img { width: 88px; height: 88px; border-radius: 50%; object-fit: contain; filter: drop-shadow(0 5px 9px rgba(15, 23, 42, .16)); }
#academy-gate[data-state=loading] #academy-status { max-width: 22rem; font-size: 1.08rem; font-weight: 600; letter-spacing: .01em; margin: 1.25rem 0 0; color: var(--text-muted); }
#academy-gate:not([hidden]) ~ #ai-helper-fab, #academy-gate:not([hidden]) ~ #ai-helper-popover { display: none !important; }
@keyframes academy-startup-spin { to { transform: rotate(360deg); } }
/* Keep the sign-in card centred in the available viewport without locking its
   height. On short screens and when the keyboard is open, the minimum margin
   falls back to a small gutter so the whole form remains scrollable. */
#academy-gate[data-state=action] { margin-top: max(1rem, calc((var(--app-viewport-height) - 38rem) / 2)); margin-bottom: max(1rem, env(safe-area-inset-bottom)); }
#academy-app-notice { position: fixed; z-index: 10001; bottom: calc(var(--shell-nav-height, 0px) + 1.5rem + var(--app-safe-bottom)); left: max(.75rem, env(safe-area-inset-left)); right: max(.75rem, env(safe-area-inset-right)); max-width: 48rem; margin: auto; display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; padding: .85rem 1rem; border-radius: .8rem; color: #16332e; background: #fff; border: 2px solid #176b63; box-shadow: 0 4px 24px #0002; }
#academy-app-notice span { flex: 1; min-width: 12rem; }
#academy-app-notice button { flex-shrink: 0; }
#main-header { padding-top: max(.5rem, env(safe-area-inset-top)); }
.header-content, #app > main { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
button, a, input, select { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #eab308; outline-offset: 3px; }
@media (max-width: 520px) { #academy-gate { margin: 1rem; padding: 1.4rem; } .nav-controls { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (max-width: 520px) { #academy-gate[data-state=loading] #academy-startup-spinner { width: 108px; height: 108px; } #academy-gate[data-state=loading] .academy-startup-spinner-core { width: 84px; height: 84px; } #academy-gate[data-state=loading] .academy-startup-spinner-core img { width: 80px; height: 80px; } }
@media (prefers-reduced-motion: reduce) { #academy-gate[data-state=loading] .academy-startup-spinner-ring { animation: none !important; } }
/* The saved theme is applied in the document head, before CSS or authentication. */
html[data-theme=dark] { color-scheme: dark; }
html[data-theme=light] { color-scheme: light; }
#academy-gate { background: var(--bg-card); color: var(--text-main); border-color: var(--input-border); }
#academy-gate input, #academy-gate select { color: var(--text-main); background: var(--input-bg); border-color: var(--input-border); }
#academy-gate button, .academy-app-button { background: var(--color-primary); border-color: var(--color-primary); }
.academy-app-links a { color: var(--shell-blue, #165fb8); }
#academy-gate[data-state=loading] { background: radial-gradient(ellipse at center, rgba(0,108,255,.06), transparent 60%); color: var(--text-main); }
#academy-gate[data-state=loading] #academy-status { color: var(--text-main); }
#academy-gate[data-state=loading] .academy-startup-spinner-ring { background: conic-gradient(from -35deg, var(--color-primary) 0 40%, var(--color-accent) 40% 62%, var(--input-border) 62% 100%) border-box; }
#academy-app-notice { color: var(--text-main); background: var(--bg-card); border-color: var(--input-border); }

/* Action buttons have two global visual roles. Components only set layout.
   Navigation, media controls and icon-only utilities keep their own affordance. */
:root {
    --button-primary-bg: #fff200;
    --button-primary-bg-hover: #f2e600;
    --button-primary-ink: #073763;
    --button-secondary-bg: #ffffff;
    --button-secondary-hover: #e2eaf0;
    --button-secondary-ink: #073763;
    --button-disabled-bg: #e2eaf0;
    --button-disabled-ink: #555859;
}
html[data-theme=dark], body.dark-mode {
    --button-secondary-bg: #383839;
    --button-secondary-hover: #505052;
    --button-secondary-ink: #ffffff;
    --button-disabled-bg: #383839;
    --button-disabled-ink: #c3c9cd;
}
:is(body, #app) :is(.btn-primary, .btn-secondary) {
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    max-width: 100%;
    padding: 0.6rem 1.5rem;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    outline: 0;
    border-radius: 999px;
    font: 700 1rem/1.4 var(--font-primary);
    letter-spacing: 1px;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    white-space: normal;
    overflow-wrap: anywhere;
    box-sizing: border-box;
    box-shadow: none;
    backdrop-filter: none;
    transform: none;
    filter: none;
    opacity: 1;
    cursor: pointer;
    transition: background-color 160ms ease;
}
:is(body, #app) :is(.btn-primary, .btn-secondary):not([hidden]):not(.hidden):not(.btn-back) { display: inline-flex; }
:is(body, #app) .btn-primary {
    background: var(--button-primary-bg);
    color: var(--button-primary-ink);
    box-shadow: 0 3px 0 rgba(7, 55, 99, .25);
}
:is(body, #app) .btn-secondary {
    background: var(--button-secondary-bg);
    color: var(--button-secondary-ink);
    border: 1.5px solid var(--input-border);
    font-size: 0.9rem;
    font-weight: 600;
}
:is(body, #app) .btn-primary::before { content: none; }
:is(body, #app) .btn-primary:hover:not(:disabled) {
    background: var(--button-primary-bg-hover);
}
:is(body, #app) .btn-primary:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(7, 55, 99, .25);
}
:is(body, #app) .btn-secondary:hover:not(:disabled) {
    background: var(--button-secondary-hover);
    color: var(--button-secondary-ink);
}
:is(body, #app) :is(.btn-primary, .btn-secondary):focus-visible {
    outline: 3px solid var(--text-main);
    outline-offset: 3px;
    box-shadow: 0 0 0 3px var(--bg-card);
}
:is(body, #app) :is(.btn-primary, .btn-secondary):is(:disabled, .btn-section-locked) {
    background: var(--button-disabled-bg);
    color: var(--button-disabled-ink);
    box-shadow: none;
    opacity: 1;
    cursor: not-allowed;
}
html[data-theme=dark] #app #btn-claim-certificate,
body.dark-mode #app #btn-claim-certificate {
    background: #3b4044;
    color: #ffffff;
}
#app .home-card-desc-toggle { width: max-content; justify-self: start; margin-top: 4px; }
#app .home-card-action .home-card-open-btn {
    width: auto;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
}

#app .shell-section-heading { flex-wrap: wrap; }
#app .shell-section-heading .btn-secondary { margin-left: auto; }

/* Centered so it never covers the owl (bottom corner) */
#academy-app-notice { top: 50%; bottom: auto; transform: translateY(-50%); width: fit-content; max-width: min(48rem, calc(100% - 1.5rem)); }
#academy-update-notice { position: fixed; z-index: 10000; bottom: calc(var(--shell-nav-height, 0px) + .75rem + var(--app-safe-bottom)); right: max(.75rem, env(safe-area-inset-right)); max-width: min(26rem, calc(100% - 1.5rem)); box-sizing: border-box; padding: .7rem .9rem; border: 1px solid var(--input-border); border-radius: .8rem; background: var(--bg-card, #fff); color: var(--text-main, #123b54); box-shadow: 0 3px 18px #0002; font-size: .9rem; line-height: 1.4; }
