/* ---------- Design tokens ---------- */
:root {
    --ink: #160f33;
    --ink-2: #24194f;
    --violet: #6c3bff;
    --violet-soft: #b39bff;
    --violet-wash: #f0eaff;
    --paper: #f7f5ff;
    --surface: #ffffff;
    --line: #e6e1f7;
    --text: #232136;
    --muted: #686580;
    --mint: #19d3a2;
    --mint-ink: #087a5c;
    --mint-wash: #e2f7f0;
    --amber: #ff9f1c;
    --amber-wash: #fff3dc;
    --rose: #f0386b;
    --rose-wash: #fde8ec;
    --radius-sm: .6rem;
    --radius: 1.1rem;
    --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
    --pink: #ff3d8b;
    --cyan: #00c2ff;
    --lime: #c6ff3d;
    --grad: linear-gradient(120deg, #6c3bff 0%, #ff3d8b 55%, #ff9f1c 100%);
    --grad-cool: linear-gradient(120deg, #6c3bff 0%, #00c2ff 100%);
    --shadow: 0 1px 2px rgba(22, 15, 51, .06), 0 8px 24px -12px rgba(76, 40, 190, .25);
    --shadow-lift: 0 2px 4px rgba(22, 15, 51, .06), 0 18px 40px -16px rgba(108, 59, 255, .45);
    --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

    --bs-body-font-family: var(--font-sans);
    --bs-body-color: var(--text);
    --bs-body-bg: var(--paper);
    --bs-border-color: var(--line);
    --bs-secondary-color: var(--muted);
    --bs-tertiary-bg: #f0eff7;
    --bs-primary: var(--violet);
    --bs-primary-rgb: 108, 59, 255;
    --bs-success-rgb: 14, 122, 92;
    --bs-warning-rgb: 201, 122, 6;
    --bs-danger-rgb: 201, 55, 79;
    --bs-info-rgb: 108, 59, 255;
    --bs-link-color: var(--violet);
    --bs-link-color-rgb: 108, 59, 255;
    --bs-link-hover-color: #4329b3;
    --bs-link-hover-color-rgb: 67, 41, 179;
    --bs-border-radius: var(--radius-sm);
    --bs-card-border-radius: var(--radius);
}

html, body {
    font-family: var(--font-sans);
    background: var(--paper);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--ink);
    font-weight: 600;
    letter-spacing: -.015em;
}

h1:focus { outline: none; }

code, pre, kbd { font-family: var(--font-mono); }

:focus-visible {
    outline: 2px solid var(--violet);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ---------- Bootstrap refinements (shared by student and admin pages) ---------- */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    padding: .5rem 1rem;
}

.btn-sm { padding: .3rem .7rem; }

.btn-primary {
    --bs-btn-bg: var(--violet);
    --bs-btn-border-color: var(--violet);
    --bs-btn-hover-bg: #4a30c2;
    --bs-btn-hover-border-color: #4a30c2;
    --bs-btn-active-bg: #3f27ad;
    --bs-btn-active-border-color: #3f27ad;
    --bs-btn-disabled-bg: #b3a7ec;
    --bs-btn-disabled-border-color: #b3a7ec;
}

.btn-outline-primary {
    --bs-btn-color: var(--violet);
    --bs-btn-border-color: #cbc2f5;
    --bs-btn-hover-bg: var(--violet-wash);
    --bs-btn-hover-color: var(--violet);
    --bs-btn-hover-border-color: var(--violet);
    --bs-btn-active-bg: var(--violet-wash);
    --bs-btn-active-color: var(--violet);
}

.btn-outline-secondary {
    --bs-btn-color: var(--text);
    --bs-btn-border-color: var(--line);
    --bs-btn-hover-bg: #ecebf4;
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-border-color: #d3d1e2;
}

.btn:focus, .btn:active:focus, .form-control:focus, .form-check-input:focus, .form-select:focus {
    box-shadow: 0 0 0 .2rem rgba(91, 63, 214, .2);
    border-color: var(--violet-soft);
}

.form-control, .form-select {
    border-color: var(--line);
    border-radius: var(--radius-sm);
}

.form-check-input:checked {
    background-color: var(--violet);
    border-color: var(--violet);
}

.card {
    --bs-card-border-color: var(--line);
    --bs-card-bg: var(--surface);
    --bs-card-cap-bg: transparent;
    border-radius: var(--radius);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: #f7f6fc;
    font-size: .92rem;
}

    .table > thead th {
        color: var(--muted);
        font-weight: 500;
        font-size: .82rem;
        border-bottom-color: var(--line);
        white-space: nowrap;
    }

    .table > tbody td { border-color: #eeedf5; }

/* Tables live inside a white surface even when the page markup did not add one. */
.table-responsive, .shell-content > .table, .shell-content > table.table {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .25rem .75rem;
}

.badge {
    font-weight: 500;
    border-radius: 999px;
    padding: .35em .7em;
}

.text-bg-success { background-color: var(--mint-wash) !important; color: var(--mint-ink) !important; }
.text-bg-warning { background-color: var(--amber-wash) !important; color: #8a5300 !important; }
.text-bg-danger { background-color: var(--rose-wash) !important; color: var(--rose) !important; }
.text-bg-primary, .text-bg-info { background-color: var(--violet-wash) !important; color: var(--violet) !important; }
.text-bg-secondary { background-color: #ecebf2 !important; color: var(--muted) !important; }

.progress {
    height: .5rem;
    background: #e7e6f1;
    border-radius: 999px;
}

.progress-bar { background-color: var(--violet); border-radius: 999px; }
.progress-bar.bg-success { background-color: var(--mint) !important; }

.alert { border-radius: var(--radius); border-width: 1px; }
.alert-success { background: var(--mint-wash); border-color: #b9ebdb; color: #0b5e47; }
.alert-danger { background: var(--rose-wash); border-color: #f5c4cd; color: #8f2337; }
.alert-warning { background: var(--amber-wash); border-color: #f3d79f; color: #7a4a00; }

.nav-pills {
    gap: .25rem;
    padding: .3rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius-sm) + .3rem);
    display: inline-flex;
    flex-wrap: wrap;
}

    .nav-pills .nav-link {
        color: var(--muted);
        border-radius: var(--radius-sm);
        padding: .4rem .9rem;
        font-size: .92rem;
    }

        .nav-pills .nav-link.active {
            background: var(--ink);
            color: #fff;
        }

.breadcrumb { --bs-breadcrumb-divider-color: var(--muted); }

/* ---------- Page header ---------- */
.page-head { margin-bottom: 2rem; }
.page-head h1 { font-size: clamp(1.6rem, 2.5vw, 2.1rem); margin-bottom: .35rem; }
.page-head p { color: var(--muted); max-width: 62ch; margin: 0; }

/* ---------- Home ---------- */
.welcome {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
    align-items: stretch;
}

@media (min-width: 992px) {
    .welcome { grid-template-columns: 1.5fr 1fr; }
}

.next-up {
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

    .next-up h2 { color: #fff; font-size: 1.6rem; margin: 0; max-width: 24ch; }
    .next-up p { color: rgba(255, 255, 255, .72); margin: 0; max-width: 60ch; }
    .next-up .lesson-no { font-family: var(--font-mono); color: var(--violet-soft); font-size: .95rem; }
    .next-up .btn-primary { align-self: flex-start; --bs-btn-bg: #fff; --bs-btn-color: var(--ink); --bs-btn-border-color: #fff; --bs-btn-hover-bg: var(--violet-wash); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--violet-wash); }

.progress-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem;
}

.ring {
    --p: 0;
    width: 8.5rem;
    height: 8.5rem;
    border-radius: 50%;
    background: conic-gradient(var(--mint) calc(var(--p) * 1%), #e9e8f2 0);
    display: grid;
    place-items: center;
    margin-bottom: 1.25rem;
}

    .ring > div {
        width: 6.6rem;
        height: 6.6rem;
        border-radius: 50%;
        background: var(--surface);
        display: grid;
        place-items: center;
        text-align: center;
        line-height: 1.1;
    }

    .ring strong { font-size: 1.7rem; color: var(--ink); display: block; }
    .ring span { font-size: .8rem; color: var(--muted); }

.module-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.module-bars li { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; font-size: .86rem; }
.module-bars .progress { grid-column: 1 / -1; height: .35rem; }
.module-bars .count { color: var(--muted); font-family: var(--font-mono); font-size: .8rem; }

/* Landing (signed out) */
.landing { padding: 2rem 0 1rem; }
.landing h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -.035em; max-width: 16ch; margin-bottom: 1.25rem; }
.landing .lead { color: var(--muted); max-width: 54ch; font-size: 1.15rem; margin-bottom: 2rem; }

.code-hero {
    margin-top: 3rem;
    background: var(--ink);
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
    color: #e8e6f7;
    font-family: var(--font-mono);
    font-size: .9rem;
    line-height: 1.75;
    overflow-x: auto;
    white-space: pre;
}

    .code-hero .k { color: #b6a8ff; }
    .code-hero .t { color: #7fe3c4; }
    .code-hero .s { color: #ffd38a; }
    .code-hero .c { color: #8a86a8; }

.landing-steps { display: grid; gap: 1rem; margin-top: 2.5rem; grid-template-columns: 1fr; counter-reset: step; }

@media (min-width: 768px) {
    .landing-steps { grid-template-columns: repeat(3, 1fr); }
}

.landing-steps li { list-style: none; border-top: 2px solid var(--ink); padding-top: .9rem; counter-increment: step; }
.landing-steps li::before { content: "Step " counter(step); display: block; font-size: .8rem; color: var(--muted); margin-bottom: .3rem; }
.landing-steps strong { display: block; color: var(--ink); margin-bottom: .25rem; }
.landing-steps p { color: var(--muted); font-size: .92rem; margin: 0; }

/* ---------- Learning path (the signature element) ---------- */
.path-module { margin-bottom: 2.75rem; }

.path-module-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
    padding-left: 3.25rem;
}

    .path-module-head h2 { font-size: 1.15rem; margin: 0; }
    .path-module-head span { color: var(--muted); font-size: .85rem; font-family: var(--font-mono); }

.path { list-style: none; margin: 0; padding: 0; position: relative; }

    .path::before {
        content: "";
        position: absolute;
        left: 1.05rem;
        top: 1.2rem;
        bottom: 1.2rem;
        width: 2px;
        background: var(--line);
    }

.path-step {
    position: relative;
    display: grid;
    grid-template-columns: 2.2rem 1fr;
    gap: 1rem;
    padding: .35rem 0;
}

.path-node {
    position: relative;
    z-index: 1;
    width: 2.2rem;
    height: 2.2rem;
    margin-top: 1rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: var(--font-mono);
    font-size: .78rem;
    font-weight: 600;
    background: var(--surface);
    border: 2px solid var(--line);
    color: var(--muted);
}

.is-completed .path-node { background: var(--mint); border-color: var(--mint); color: var(--ink); }
.is-inprogress .path-node { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 0 4px var(--amber-wash); }
.is-available .path-node { border-color: var(--violet); color: var(--violet); box-shadow: 0 0 0 4px var(--violet-wash); }
.is-completed + .path-step::before {
    content: "";
    position: absolute;
    left: 1.05rem;
    top: -1.5rem;
    height: 3rem;
    width: 2px;
    background: var(--mint);
}

.path-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    color: inherit;
    text-decoration: none;
}

a.path-card:hover { border-color: #c9c1f2; }
.is-locked .path-card { background: transparent; border-style: dashed; }
.is-locked .path-card h3, .is-locked .path-card p { color: var(--muted); }
.is-available .path-card, .is-inprogress .path-card { border-color: #cfc7f6; }

.path-card h3 { font-size: 1.02rem; margin: 0 0 .2rem; }
.path-card p { margin: 0; color: var(--muted); font-size: .88rem; max-width: 70ch; }

.path-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin-top: .5rem; font-size: .8rem; color: var(--muted); }
.path-meta .warn { color: var(--rose); }
.path-action { font-size: .88rem; font-weight: 500; color: var(--violet); white-space: nowrap; }
.is-locked .path-action { color: var(--muted); font-weight: 400; }

@media (max-width: 575.98px) {
    .path-card { grid-template-columns: 1fr; }
}

/* ---------- Lesson page ---------- */
.lesson-head { margin-bottom: 1.75rem; }
.lesson-head .lesson-no { font-family: var(--font-mono); color: var(--violet); font-size: .9rem; }
.lesson-head h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin: .25rem 0 .6rem; max-width: 30ch; letter-spacing: -.025em; }
.lesson-head .facts { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; color: var(--muted); font-size: .9rem; }

.stepper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    margin-bottom: 2rem;
    padding: 0;
    list-style: none;
}

    .stepper button {
        width: 100%;
        text-align: left;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        padding: .7rem .9rem;
        color: var(--muted);
        font-size: .9rem;
        line-height: 1.3;
        border-top: 3px solid var(--line);
    }

        .stepper button strong { display: block; color: var(--ink); font-weight: 600; font-size: .95rem; }
        .stepper button:hover { border-color: #cfc7f6; border-top-color: #cfc7f6; }
        .stepper button.active { border-top-color: var(--violet); box-shadow: 0 2px 0 rgba(91, 63, 214, .08); }
        .stepper button.done { border-top-color: var(--mint); }
        .stepper button.active.done { border-top-color: var(--violet); }

.lesson-layout { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }

.lesson-content {
    max-width: 76ch;
    line-height: 1.72;
    font-size: 1.02rem;
}

    .lesson-content h2 { font-size: 1.45rem; margin-top: 2.5rem; margin-bottom: .9rem; }
    .lesson-content h3 { font-size: 1.15rem; margin-top: 1.75rem; }
    .lesson-content p, .lesson-content li { color: #34314b; }
    .lesson-content li { margin-bottom: .3rem; }
    .lesson-content a { text-underline-offset: 3px; }

.lesson-content pre, .quiz-code {
    background: var(--ink);
    color: #e8e6f7;
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: .86rem;
    line-height: 1.6;
    margin: 1.1rem 0 1.4rem;
}

    .lesson-content pre code, .quiz-code code { color: inherit; background: none; padding: 0; font-size: inherit; }

.lesson-content :not(pre) > code {
    background: var(--violet-wash);
    color: #4127a8;
    padding: .1rem .35rem;
    border-radius: .3rem;
    font-size: .88em;
}

.lesson-content table { width: 100%; margin: 1.25rem 0; border-collapse: collapse; font-size: .93rem; background: var(--surface); }
.lesson-content th, .lesson-content td { border: 1px solid var(--line); padding: .5rem .7rem; vertical-align: top; }
.lesson-content th { background: #f2f1f8; color: var(--ink); font-weight: 600; text-align: left; }

.lesson-content blockquote {
    border-left: 3px solid var(--violet);
    background: var(--violet-wash);
    padding: .75rem 1.1rem;
    margin: 1.25rem 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

    .lesson-content blockquote p { color: var(--ink); }
    .lesson-content blockquote p:last-child { margin-bottom: 0; }

.lesson-content input[type=checkbox] { margin-right: .45rem; accent-color: var(--violet); }

.next-step-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    max-width: 76ch;
}

    .next-step-bar p { margin: 0; color: var(--muted); }

/* Quiz */
.quiz-intro { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; align-items: center; margin-bottom: 1.5rem; max-width: 820px; }
.quiz-intro p { margin: 0; color: var(--muted); }
.attempt-chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.attempt-chips span { font-family: var(--font-mono); font-size: .78rem; padding: .2rem .5rem; border-radius: 999px; background: #ecebf2; color: var(--muted); }
.attempt-chips span.pass { background: var(--mint-wash); color: var(--mint-ink); }

.quiz-result {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    max-width: 820px;
}

    .quiz-result.pass { background: var(--mint-wash); border: 1px solid #b9ebdb; }
    .quiz-result.fail { background: var(--rose-wash); border: 1px solid #f5c4cd; }
    .quiz-result .score { font-size: 2.2rem; font-weight: 600; color: var(--ink); line-height: 1; font-family: var(--font-mono); }
    .quiz-result p { margin: 0; color: var(--ink); }

.question {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1.4rem;
    margin-bottom: 1rem;
    max-width: 820px;
}

    .question.correct { border-color: #9fe0cb; }
    .question.wrong { border-color: #f0b3be; }
    .question .q-text { font-weight: 600; color: var(--ink); margin-bottom: .75rem; display: flex; gap: .6rem; }
    .question .q-no { font-family: var(--font-mono); color: var(--muted); font-weight: 500; }

.option {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .6rem .8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: .45rem;
    cursor: pointer;
    background: var(--surface);
}

    .option:hover { border-color: #cfc7f6; background: #fbfaff; }
    .option input { position: absolute; opacity: 0; pointer-events: none; }
    .option .letter {
        flex-shrink: 0;
        width: 1.6rem;
        height: 1.6rem;
        border-radius: .4rem;
        display: grid;
        place-items: center;
        font-family: var(--font-mono);
        font-size: .8rem;
        font-weight: 600;
        border: 1px solid var(--line);
        color: var(--muted);
    }

    .option.selected { border-color: var(--violet); background: var(--violet-wash); }
    .option.selected .letter { background: var(--violet); border-color: var(--violet); color: #fff; }
    .option:has(input:focus-visible) { outline: 2px solid var(--violet); outline-offset: 2px; }
    .option.is-correct { border-color: var(--mint); background: var(--mint-wash); }
    .option.is-correct .letter { background: var(--mint); border-color: var(--mint); color: var(--ink); }
    .option.is-wrong { border-color: var(--rose); background: var(--rose-wash); }
    .option.is-wrong .letter { background: var(--rose); border-color: var(--rose); color: #fff; }
    .option.locked { cursor: default; }

.explanation { font-size: .9rem; margin-top: .75rem; padding: .7rem .9rem; border-radius: var(--radius-sm); background: #f4f3fa; color: #3d3a55; }

.quiz-submit {
    position: sticky;
    bottom: 1rem;
    max-width: 820px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 1rem;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(29, 24, 56, .25);
}

    .quiz-submit span { font-size: .9rem; color: rgba(255, 255, 255, .75); }

/* Project upload */
.dropzone {
    border: 2px dashed #cfc7f6;
    border-radius: var(--radius);
    background: #fbfaff;
    padding: 1.5rem;
    text-align: center;
}

    .dropzone input[type=file] { max-width: 420px; margin: .75rem auto 0; }
    .dropzone p { margin: 0; color: var(--muted); font-size: .9rem; }

.submit-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; max-width: 76ch; margin-top: 2.5rem; }
.submit-panel h2 { font-size: 1.2rem; }

/* ---------- Template plumbing kept from the Blazor template ---------- */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--mint); }
.invalid { outline: 1px solid var(--rose); }
.validation-message { color: var(--rose); }

.blazor-error-boundary {
    background: var(--rose-wash);
    padding: 1rem 1rem 1rem 1.25rem;
    color: var(--rose);
    border-radius: var(--radius-sm);
}

    .blazor-error-boundary::after { content: "An error has occurred."; }

.darker-border-checkbox.form-check-input { border-color: #929292; }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Data tables: keep rows on one line and let the surface scroll horizontally on small screens. */
.table-responsive .table td, .table-responsive .table th { white-space: nowrap; }
.table a { text-decoration: none; font-weight: 500; }
.table a:hover { text-decoration: underline; }
.table .progress { min-width: 7rem; }


/* =====================================================================
   Vivid layer: display type, colour, motion. Motion is disabled by the
   prefers-reduced-motion rule near the top of this file.
   ===================================================================== */
body {
    background:
        radial-gradient(900px 500px at 100% -10%, rgba(255, 61, 139, .10), transparent 60%),
        radial-gradient(800px 600px at -10% 10%, rgba(0, 194, 255, .10), transparent 60%),
        var(--paper);
    background-attachment: fixed;
}

h1, h2, h3, .h1, .h2, .h3 {
    font-family: var(--font-display);
    letter-spacing: -.03em;
}

::selection { background: var(--pink); color: #fff; }


/* Buttons */
.btn-primary {
    background-image: var(--grad);
    background-size: 180% 100%;
    background-position: 0% 0;
    border: 0;
    box-shadow: 0 8px 20px -10px rgba(255, 61, 139, .7);
    transition: background-position .5s ease, transform .15s ease, box-shadow .2s ease;
}

    .btn-primary:hover { background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(255, 61, 139, .8); }
    .btn-primary:active { transform: translateY(1px) scale(.98); }
    .btn-primary:disabled { background-image: none; box-shadow: none; }

/* Cards and surfaces */
.card, .progress-panel, .question, .submit-panel, .next-step-bar, .table-responsive {
    border-color: var(--line);
    box-shadow: var(--shadow);
}

.card { transition: transform .2s ease, box-shadow .2s ease; }
.row .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

/* Stat tiles in admin get a coloured top edge, cycling through the accents. */
.row .col:nth-child(4n+1) .card { border-top: 4px solid var(--violet); }
.row .col:nth-child(4n+2) .card { border-top: 4px solid var(--pink); }
.row .col:nth-child(4n+3) .card { border-top: 4px solid var(--cyan); }
.row .col:nth-child(4n+4) .card { border-top: 4px solid var(--amber); }
.row .col .card .fs-4 { font-family: var(--font-display); font-size: 2rem !important; letter-spacing: -.03em; }

.progress-bar { background-image: var(--grad-cool); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.progress-bar.bg-success { background-image: linear-gradient(90deg, var(--mint), var(--cyan)); }

.nav-pills .nav-link.active { background: var(--grad); }

/* Landing */
.landing h1 {
    background: linear-gradient(100deg, var(--ink) 0%, var(--ink) 40%, var(--violet) 60%, var(--pink) 80%, var(--amber) 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: ink-sweep 6s ease-in-out infinite alternate;
}

@keyframes ink-sweep { from { background-position: 0% 0; } to { background-position: 100% 0; } }

.code-hero {
    position: relative;
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 30px 60px -30px rgba(108, 59, 255, .7);
}

    .code-hero::after {
        content: "";
        display: inline-block;
        width: .55em;
        height: 1.1em;
        margin-left: .15em;
        vertical-align: text-bottom;
        background: var(--lime);
        animation: caret 1s steps(1) infinite;
    }

@keyframes caret { 50% { opacity: 0; } }

.landing-steps li { border-top: 0; padding: 1.25rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.landing-steps li::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; }
.landing-steps li:nth-child(1)::after { background: var(--violet); }
.landing-steps li:nth-child(2)::after { background: var(--pink); }
.landing-steps li:nth-child(3)::after { background: var(--cyan); }

/* Home: next-up hero with a slowly drifting gradient */
.next-up {
    background: linear-gradient(130deg, #2a1470, #6c3bff 45%, #ff3d8b 85%, #ff9f1c);
    background-size: 220% 220%;
    animation: drift 14s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 60px -30px rgba(108, 59, 255, .8);
}

    .next-up > * { position: relative; }

    .next-up::before {
        content: "{ }";
        position: absolute;
        right: -1rem;
        bottom: -3.5rem;
        font-family: var(--font-mono);
        font-size: 12rem;
        font-weight: 700;
        color: rgba(255, 255, 255, .09);
        pointer-events: none;
    }

    .next-up .lesson-no { color: var(--lime); }
    .next-up h2 { font-size: 2rem; }

@keyframes drift { from { background-position: 0% 30%; } to { background-position: 100% 70%; } }

.ring { background: conic-gradient(from 0deg, var(--violet), var(--pink) calc(var(--p) * 1%), #ebe6fb 0); animation: ring-in 1.1s cubic-bezier(.2, .8, .2, 1) both; }
.ring strong { font-family: var(--font-display); }
@keyframes ring-in { from { transform: rotate(-90deg) scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

.xp-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }

.xp-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .85rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: .88rem;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

    .xp-chip.level { background: var(--ink); color: var(--lime); border-color: var(--ink); transform: rotate(-2deg); }
    .xp-chip b { font-family: var(--font-mono); }

/* Learning path: staggered entrance, vivid nodes, lift on hover */
.path-step { animation: step-in .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes step-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.path::before { background: repeating-linear-gradient(to bottom, var(--line) 0 6px, transparent 6px 12px); }
.path-card { box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
a.path-card:hover { transform: translateX(4px); box-shadow: var(--shadow-lift); border-color: var(--violet-soft); }
.is-locked .path-card { box-shadow: none; }

.is-completed .path-node { background: linear-gradient(135deg, var(--mint), var(--cyan)); border: 0; color: #fff; }
.is-completed + .path-step::before { background: linear-gradient(var(--mint), var(--cyan)); }
.is-available .path-node, .is-inprogress .path-node { background: var(--grad); border: 0; color: #fff; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 61, 139, .45); } 50% { box-shadow: 0 0 0 9px rgba(255, 61, 139, 0); } }

.path-module-head h2 { font-size: 1.35rem; }
.path-module-head h2::before { content: ""; display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .6rem; background: var(--grad); transform: rotate(45deg) translateY(-2px); }

/* Lesson page */
.lesson-head .lesson-no { display: inline-block; padding: .2rem .65rem; border-radius: 999px; background: var(--ink); color: var(--lime); font-size: .8rem; transform: rotate(-2deg); }
.stepper button { border-top-width: 4px; transition: transform .15s ease, box-shadow .2s ease; box-shadow: var(--shadow); }
.stepper button:hover { transform: translateY(-2px); }
.stepper button.active { border-top-color: var(--pink); box-shadow: var(--shadow-lift); }
.stepper button.done { border-top-color: var(--mint); }
.stepper button.active.done { border-top-color: var(--pink); }
.lesson-content h2::before { content: "#"; color: var(--pink); margin-right: .45rem; font-family: var(--font-mono); font-weight: 500; }
.lesson-content blockquote { border-left-color: var(--pink); background: linear-gradient(90deg, #fff0f6, #f3eeff); }
.lesson-content pre, .quiz-code { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 16px 30px -20px rgba(22, 15, 51, .6); }

/* Quiz */
.option { transition: transform .12s ease, border-color .15s ease, background-color .15s ease; }
.option:hover { transform: translateX(3px); }
.option.selected { animation: pop .25s ease; }
.option.selected .letter { background: var(--grad); border: 0; }
@keyframes pop { 50% { transform: scale(1.02); } }
.question { animation: step-in .4s ease both; }
.quiz-submit { background: linear-gradient(120deg, var(--ink), #2a1470); }
.quiz-result .score { font-family: var(--font-display); font-size: 3rem; }
.quiz-result.pass .score { background: linear-gradient(90deg, var(--mint-ink), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.quiz-result.pass { animation: pop .5s ease; }

/* Confetti burst shown once when a quiz is passed */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 2000; }

    .confetti i {
        position: absolute;
        top: -2rem;
        left: calc(var(--x) * 1%);
        width: .55rem;
        height: .9rem;
        border-radius: 2px;
        background: var(--c);
        animation: fall calc(1.6s + var(--d) * 1s) cubic-bezier(.3, .6, .4, 1) forwards;
        animation-delay: calc(var(--d) * .4s);
    }

@keyframes fall {
    from { transform: translateY(0) rotate(0); opacity: 1; }
    to { transform: translateY(105vh) rotate(calc(var(--r) * 1deg)); opacity: .9; }
}

/* Upload */
.dropzone { border-color: var(--violet-soft); background: linear-gradient(135deg, #faf7ff, #fff5fa); transition: border-color .2s ease, transform .2s ease; }
.dropzone:hover { border-color: var(--pink); }

/* Solid white call to action on the gradient hero so it stays readable. */
.next-up .btn-primary { background: #fff; color: var(--ink); box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .45); }
.next-up .btn-primary:hover { background: var(--lime); color: var(--ink); }

/* ---------- Sign-in and registration ---------- */
.auth-card {
    max-width: 440px;
    margin: 2rem auto;
    padding: 2.25rem 2rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + .3rem);
    box-shadow: var(--shadow-lift);
    position: relative;
    overflow: hidden;
    animation: step-in .45s cubic-bezier(.2, .8, .2, 1) both;
}

    .auth-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--grad); }
    .auth-card h1 { font-size: 1.9rem; margin-bottom: .25rem; }
    .auth-sub { color: var(--muted); margin-bottom: 1.5rem; }
    .auth-foot { margin: 1.25rem 0 0; text-align: center; color: var(--muted); font-size: .92rem; }

.external-logins { display: grid; gap: .6rem; }

.btn-provider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    width: 100%;
    padding: .75rem 1rem;
    background: var(--surface);
    border: 1px solid #c9c4dd;
    color: var(--ink);
    font-weight: 600;
    transition: border-color .15s ease, box-shadow .2s ease, transform .15s ease;
}

    .btn-provider:hover { border-color: var(--violet); box-shadow: var(--shadow-lift); transform: translateY(-1px); color: var(--ink); }

.auth-divider { display: flex; align-items: center; gap: .75rem; margin: 1.4rem 0; color: var(--muted); font-size: .82rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Floating labels already name the field; hide the duplicate placeholder text. */
.form-floating > .form-control::placeholder { color: transparent; }

/* ---------- Admin dashboard: activity chart and feed ---------- */
.dash-grid { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .dash-grid { grid-template-columns: 1.6fr 1fr; } }

.dash-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; box-shadow: var(--shadow); }

.chart-legend { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .8rem; color: var(--muted); }
.chart-legend span::before { content: ""; display: inline-block; width: .65rem; height: .65rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.chart-legend .q::before, .bars .q { background: var(--violet); }
.chart-legend .s::before, .bars .s { background: var(--pink); }
.chart-legend .r::before, .bars .r { background: var(--cyan); }

.bar-chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: .35rem; height: 13rem; align-items: end; }
.bar-day { display: flex; flex-direction: column; align-items: center; height: 100%; gap: .35rem; }
.bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); }
.bars span { width: 30%; min-height: 2px; border-radius: 3px 3px 0 0; transform-origin: bottom; animation: grow .8s cubic-bezier(.2, .8, .2, 1) both; }
.bar-day small { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; max-height: 16rem; overflow-y: auto; }
.feed li { display: grid; grid-template-columns: .7rem 1fr; gap: .7rem; font-size: .9rem; line-height: 1.4; }
.feed a { font-weight: 600; text-decoration: none; }
.feed small { display: block; color: var(--muted); font-size: .78rem; }
.feed-dot { width: .7rem; height: .7rem; border-radius: 50%; margin-top: .35rem; background: var(--muted); }
.feed-registered .feed-dot { background: var(--cyan); }
.feed-quizpassed .feed-dot { background: var(--mint); }
.feed-quizfailed .feed-dot { background: var(--amber); }
.feed-projectsubmitted .feed-dot { background: var(--pink); }
.feed-projectreviewed .feed-dot { background: var(--violet); }

button.xp-chip { cursor: pointer; }

/* Tables that should wrap text instead of scrolling sideways; action cells stay on one line. */
.table-responsive .table.table-wrap td, .table-responsive .table.table-wrap th { white-space: normal; }
.table-responsive .table.table-wrap td.text-end { white-space: nowrap; }
.table-wrap .btn-group-sm > .btn { padding: .25rem .55rem; font-size: .8rem; }


/* =====================================================================
   Admin kit
   ===================================================================== */
.person { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.person-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.person-name { font-weight: 600; color: var(--ink); text-decoration: none; }
a.person-name:hover { color: var(--violet); }
.person-email { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

.avatar-sm, .avatar-lg {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, hsl(var(--hue) 85% 58%), hsl(calc(var(--hue) + 40) 85% 52%));
}

.avatar-sm { width: 2.3rem; height: 2.3rem; font-size: .82rem; }
.avatar-lg { width: 4.5rem; height: 4.5rem; font-size: 1.5rem; box-shadow: 0 10px 24px -10px hsl(var(--hue) 80% 40%); }

.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--mint-wash); color: var(--mint-ink); }
.pill-bad { background: var(--rose-wash); color: var(--rose); }
.pill-wait { background: var(--amber-wash); color: #925800; }
.pill-none { background: #efedf6; color: var(--muted); }
.pill-admin { background: var(--violet-wash); color: var(--violet); }
.pill-locked { background: var(--ink); color: #fff; }

/* Segmented filter */
.seg { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .3rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }
.seg button { border: 0; background: none; padding: .4rem .9rem; border-radius: 999px; font-size: .88rem; font-weight: 500; color: var(--muted); display: inline-flex; gap: .4rem; align-items: center; }
.seg button b { font-family: var(--font-mono); font-size: .78rem; padding: .05rem .4rem; border-radius: 999px; background: #efedf6; color: var(--muted); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--ink); color: #fff; }
.seg button.on b { background: var(--lime); color: var(--ink); }

.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.search { position: relative; }
.search input { padding-left: 2.3rem; min-width: 17rem; border-radius: 999px; box-shadow: var(--shadow); }
.search::before { content: ""; position: absolute; left: .9rem; top: 50%; width: .75rem; height: .75rem; border: 2px solid var(--muted); border-radius: 50%; transform: translateY(-62%); z-index: 1; }
.search::after { content: ""; position: absolute; left: 1.5rem; top: 58%; width: .4rem; height: 2px; background: var(--muted); transform: rotate(45deg); z-index: 1; }

/* Data list: table rows styled as floating cards */
.data-wrap { overflow-x: auto; }
.data { width: 100%; border-collapse: separate; border-spacing: 0 .5rem; }
.data th { font-size: .78rem; font-weight: 500; color: var(--muted); padding: 0 1rem .1rem; text-align: left; white-space: nowrap; }
.data th button { border: 0; background: none; padding: 0; color: inherit; font: inherit; }
.data th button:hover, .data th button.on { color: var(--violet); }
.data td { background: var(--surface); padding: .8rem 1rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .9rem; }
.data td:first-child { border-left: 1px solid var(--line); border-radius: var(--radius) 0 0 var(--radius); }
.data td:last-child { border-right: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) 0; }
.data tbody tr:hover td { border-color: var(--violet-soft); }
.data tbody tr.dim td { opacity: .55; }
.data .num { font-family: var(--font-mono); font-size: .85rem; }
.data .muted { color: var(--muted); font-size: .82rem; }

.meter { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: center; min-width: 9rem; }
.meter .track { height: .45rem; border-radius: 999px; background: #ebe8f6; overflow: hidden; }
.meter .fill { height: 100%; border-radius: 999px; background: var(--grad-cool); }
.meter span { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }

.score { font-family: var(--font-mono); font-weight: 600; font-size: .82rem; padding: .15rem .5rem; border-radius: .4rem; }
.score.hi { background: var(--mint-wash); color: var(--mint-ink); }
.score.mid { background: var(--amber-wash); color: #925800; }
.score.lo { background: var(--rose-wash); color: var(--rose); }

.row-actions { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: nowrap; align-items: center; }
.btn-ghost { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: .3rem .75rem; font-size: .8rem; font-weight: 500; white-space: nowrap; text-decoration: none; display: inline-block; }
.btn-ghost:hover:not(:disabled) { border-color: var(--violet); color: var(--violet); }
.btn-ghost.danger:hover:not(:disabled) { border-color: var(--rose); color: var(--rose); background: var(--rose-wash); }
.btn-ghost.solid-danger { background: var(--rose); color: #fff; border-color: var(--rose); }
.btn-ghost:disabled { opacity: .4; }

.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty strong { display: block; font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); margin-bottom: .25rem; }

.toast-msg { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1.1rem; border-radius: var(--radius); margin-bottom: 1rem; animation: step-in .3s ease both; }
.toast-msg.ok { background: var(--mint-wash); color: #0b5e47; border: 1px solid #b9ebdb; }
.toast-msg.bad { background: var(--rose-wash); color: #8f2337; border: 1px solid #f5c4cd; }

/* KPI strip used on detail pages */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; box-shadow: var(--shadow); }
.kpi span { display: block; font-size: .78rem; color: var(--muted); }
.kpi strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--ink); letter-spacing: -.02em; }

/* Student profile header */
.profile { display: grid; grid-template-columns: auto 1fr auto; gap: 1.25rem; align-items: center; padding: 1.5rem; border-radius: calc(var(--radius) + .3rem); margin-bottom: 1.25rem; color: #fff; background: linear-gradient(130deg, #2a1470, #6c3bff 55%, #ff3d8b); box-shadow: 0 24px 50px -28px rgba(108, 59, 255, .8); }
.profile h1 { color: #fff; font-size: 1.8rem; margin: 0; }
.profile p { margin: .2rem 0 0; color: rgba(255, 255, 255, .8); font-size: .9rem; }
.profile .ring { width: 6rem; height: 6rem; margin: 0; background: conic-gradient(var(--lime) calc(var(--p) * 1%), rgba(255, 255, 255, .2) 0); }
.profile .ring > div { width: 4.6rem; height: 4.6rem; background: #3a1d9a; }
.profile .ring strong { color: #fff; font-size: 1.2rem; }
.profile .ring span { color: rgba(255, 255, 255, .7); font-size: .7rem; }
@media (max-width: 640px) { .profile { grid-template-columns: auto 1fr; } .profile .ring { display: none; } }

/* Lesson analytics cards */
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1rem; }
.lesson-stat { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.lesson-stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); color: inherit; }
.lesson-stat header { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: .9rem; }
.lesson-stat .no { font-family: var(--font-mono); font-size: .78rem; font-weight: 600; padding: .25rem .45rem; border-radius: .4rem; background: var(--ink); color: var(--lime); }
.lesson-stat h3 { font-size: 1rem; margin: 0; line-height: 1.3; }
.funnel { display: grid; gap: .4rem; }
.funnel div { display: grid; grid-template-columns: 5.5rem 1fr 2rem; gap: .5rem; align-items: center; font-size: .78rem; color: var(--muted); }
.funnel i { display: block; height: .5rem; border-radius: 999px; background: #ebe8f6; position: relative; overflow: hidden; }
.funnel i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--w) * 1%); border-radius: inherit; background: var(--c); animation: grow-x .9s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }
.funnel b { font-family: var(--font-mono); color: var(--ink); text-align: right; }
.lesson-stat footer { display: flex; justify-content: space-between; margin-top: .9rem; padding-top: .7rem; border-top: 1px dashed var(--line); font-size: .8rem; color: var(--muted); }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Question analytics */
.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin-bottom: .9rem; box-shadow: var(--shadow); display: grid; grid-template-columns: 4.5rem 1fr; gap: 1.1rem; }
.q-rate { text-align: center; }
.q-rate strong { display: block; font-family: var(--font-display); font-size: 1.6rem; line-height: 1; }
.q-rate span { font-size: .7rem; color: var(--muted); }
.q-rate.lo strong { color: var(--rose); }
.q-rate.mid strong { color: var(--amber); }
.q-rate.hi strong { color: var(--mint-ink); }
.q-card ol { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .3rem; }
.q-card li { font-size: .88rem; padding: .35rem .6rem; border-radius: .45rem; display: flex; gap: .5rem; }
.q-card li .l { font-family: var(--font-mono); font-weight: 600; color: var(--muted); }
.q-card li.right { background: var(--mint-wash); color: var(--mint-ink); font-weight: 600; }
.q-card li.trap { background: var(--rose-wash); color: var(--rose); }

/* Review queue */
.queue { display: grid; gap: .75rem; }
.queue-item { display: grid; grid-template-columns: minmax(12rem, 1.1fr) 2fr auto auto; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; box-shadow: var(--shadow); transition: border-color .15s ease; }
.queue-item:hover { border-color: var(--violet-soft); }
.queue-item .what { min-width: 0; }
.queue-item .what strong { display: block; font-size: .92rem; color: var(--ink); }
.queue-item .what span { font-size: .8rem; color: var(--muted); }
@media (max-width: 900px) { .queue-item { grid-template-columns: 1fr; } }

/* Review screen */
.review-grid { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .review-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } .review-grid > aside { position: sticky; top: 1.5rem; align-self: start; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.panel h2 { font-size: 1.1rem; margin-bottom: .9rem; }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .9rem 1.25rem; }
.facts-grid div span { display: block; font-size: .75rem; color: var(--muted); }
.facts-grid div strong { font-size: .92rem; color: var(--ink); font-weight: 600; word-break: break-word; }
.notes { background: #f6f4fd; border-radius: .6rem; padding: .8rem 1rem; white-space: pre-wrap; font-size: .9rem; margin-top: 1rem; }
.files { list-style: none; padding: 0; margin: 0; max-height: 22rem; overflow: auto; font-family: var(--font-mono); font-size: .8rem; }
.files li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem .5rem; border-radius: .35rem; }
.files li:nth-child(odd) { background: #f8f7fd; }
.files li span:last-child { color: var(--muted); white-space: nowrap; }
.files li.cs span:first-child { color: var(--violet); }
.files li.proj span:first-child { color: var(--pink); font-weight: 600; }
.decide { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1rem; }
.decide button { border: 2px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: .9rem .75rem; font-weight: 600; color: var(--ink); text-align: left; line-height: 1.25; }
.decide button small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; margin-top: .2rem; }
.decide button.ok.on { border-color: var(--mint); background: var(--mint-wash); }
.decide button.bad.on { border-color: var(--rose); background: var(--rose-wash); }
.grade { display: grid; grid-template-columns: 1fr 4rem; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.grade input[type=range] { accent-color: var(--violet); }
.grade output { font-family: var(--font-display); font-size: 1.6rem; text-align: right; color: var(--ink); }
.quick { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.quick button { border: 1px dashed #cfc7f6; background: #faf8ff; color: var(--violet); border-radius: 999px; font-size: .76rem; padding: .2rem .6rem; }
.quick button:hover { border-style: solid; }

.dash-panel .funnel div { grid-template-columns: minmax(8rem, 14rem) 1fr 2rem; }
.dash-panel .data { border-spacing: 0 .35rem; }
.dash-panel .data td { padding: .55rem .8rem; }


/* Lesson analytics: module groups and equal-height cards */
.la-module { margin-bottom: 2.25rem; }
.la-module-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.la-module-head h2 { font-size: 1.2rem; margin: 0; }
.la-module-head h2::before { content: ""; display: inline-block; width: .65rem; height: .65rem; border-radius: 3px; margin-right: .55rem; background: var(--grad); transform: rotate(45deg) translateY(-2px); }
.la-module-head span { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.la-project { display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: baseline; margin: -.4rem 0 .9rem; font-size: .8rem; color: var(--muted); }
.la-project strong { color: inherit; font-weight: 600; }
.la-project span { font-family: var(--font-mono); }

.lesson-stat { display: flex; flex-direction: column; min-height: 13.5rem; }
.lesson-stat header { margin-bottom: 1rem; }
.lesson-stat header > div { min-width: 0; }
.lesson-stat footer { margin-top: auto; align-items: center; gap: .5rem; }
.lesson-stat footer strong.hi { color: var(--mint-ink); }
.lesson-stat footer strong.mid { color: #925800; }
.lesson-stat footer strong.lo { color: var(--rose); }

.la-meta { display: flex; gap: .5rem; align-items: center; margin-top: .35rem; font-size: .76rem; color: var(--muted); }
.lvl { padding: .1rem .5rem; border-radius: 999px; font-weight: 600; font-size: .72rem; }
.lvl-beginner { background: var(--mint-wash); color: var(--mint-ink); }
.lvl-intermediate { background: #e3f6ff; color: #0072a3; }
.lvl-advanced { background: #fff0f6; color: #c2185b; }

.la-empty { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-radius: .7rem; background: repeating-linear-gradient(135deg, #faf9fe 0 10px, #f5f3fc 10px 20px); color: var(--muted); font-size: .85rem; }
.la-empty-icon { width: 2rem; height: 2rem; flex-shrink: 0; border-radius: 50%; border: 2px dashed #cfc7f6; position: relative; }
.la-empty-icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: .5rem; height: .5rem; border-radius: 50%; background: #cfc7f6; transform: translate(-50%, -50%); }
.la-link { font-size: .8rem; font-weight: 600; color: var(--violet); }
.lesson-stat.not-started .no { background: #ecebf4; color: var(--muted); }
.lesson-stat.not-started:hover .no { background: var(--ink); color: var(--lime); }


/* Quiz results */
.rank { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; font-family: var(--font-mono); font-weight: 700; font-size: .85rem; background: #efedf6; color: var(--muted); }
.rank-1 { background: linear-gradient(135deg, #ffd84d, #ff9f1c); color: var(--ink); box-shadow: 0 6px 16px -6px rgba(255, 159, 28, .8); }
.rank-2 { background: linear-gradient(135deg, #e6e9f2, #b8bfd1); color: var(--ink); }
.rank-3 { background: linear-gradient(135deg, #ffcfa8, #d98a4e); color: var(--ink); }
.points { display: flex; align-items: baseline; gap: .3rem; margin-bottom: .3rem; }
.points strong { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); }
.points span { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }

.grid-scores { border-collapse: separate; border-spacing: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; box-shadow: var(--shadow); }
.grid-scores th { font-family: var(--font-mono); font-size: .68rem; font-weight: 500; color: var(--muted); text-align: center; padding: 0 0 .3rem; }
.grid-scores th:first-child { text-align: left; min-width: 10rem; padding-left: .3rem; }
.grid-scores td:first-child { padding: 0 .75rem 0 .3rem; white-space: nowrap; font-size: .88rem; }
.grid-scores .cell { display: grid; place-items: center; width: 2rem; height: 1.8rem; border-radius: .35rem; font-family: var(--font-mono); font-size: .68rem; font-weight: 600; }
.grid-scores .cell.hi { background: var(--mint); color: var(--ink); }
.grid-scores .cell.mid { background: #ffd27a; color: var(--ink); }
.grid-scores .cell.lo { background: var(--rose); color: #fff; }
.grid-scores .cell.none { background: #f1eff8; }

/* Student comment on project upload */
.comment-box { margin-top: 1.25rem; }
.comment-box label { display: block; font-weight: 600; color: var(--ink); margin-bottom: .2rem; }
.comment-box label span { font-weight: 400; color: var(--muted); font-size: .85rem; }
.comment-box p { font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
.comment-box small { display: block; text-align: right; font-family: var(--font-mono); font-size: .72rem; color: var(--muted); margin-top: .25rem; }
.queue-comment { display: block; margin-top: .35rem; font-size: .82rem; color: var(--ink); background: #f6f4fd; border-left: 3px solid var(--violet-soft); padding: .3rem .6rem; border-radius: 0 .4rem .4rem 0; quotes: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34rem; }
