:root {
    --bg: #10111b;
    --sidebar: #13141f;
    --surface: #191a28;
    --surface-2: #202132;
    --surface-3: #282a3d;

    --border: rgba(255,255,255,.075);

    --text: #f5f5ff;
    --muted: #9698b2;

    --purple: #a68bff;
    --purple-bright: #b29bff;
    --green: #68e4ad;
    --orange: #ffb86b;
    --blue: #82b5ff;
    --red: #ff747f;

    --radius: 18px;
    --sidebar-width: 248px;

    font-family: "DM Sans", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

button,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
select:focus-visible {
    outline: 2px solid var(--purple);
    outline-offset: 3px;
}

button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

a {
    color: inherit;
    text-decoration: none;
}

[hidden] {
    display: none !important;
}

.app-shell {
    min-height: 100vh;
}

/* SIDEBAR */

.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;

    display: flex;
    flex-direction: column;

    padding: 27px 17px 17px;

    background: var(--sidebar);
    border-right: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;

    margin: 0 0 43px 7px;

    font-family: "Space Grotesk", sans-serif;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -1px;
}

.brand-icon {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 11px;
    background: linear-gradient(140deg, #bba8ff, #8564ff);

    color: #171329;
    font-weight: 800;
}

.brand-period,
.accent-period {
    color: var(--purple);
}

.sidebar-label {
    padding: 0 11px;
    margin-bottom: 12px;

    color: #777990;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.3px;
}

.navigation {
    display: grid;
    gap: 5px;
    margin-bottom: 35px;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 13px;

    border: 1px solid transparent;
    border-radius: 10px;

    padding: 12px 13px;

    background: transparent;
    color: #a6a7bf;

    text-align: left;
    transition: .2s ease;
}

.nav-item:hover {
    background: rgba(255,255,255,.035);
    color: white;
}

.nav-item.active {
    background: rgba(166,139,255,.12);
    color: var(--purple-bright);
    border-color: rgba(166,139,255,.12);
}

.nav-icon {
    width: 21px;
    font-size: 19px;
    text-align: center;
}

.journey-card {
    display: grid;
    grid-template-columns: 35px 1fr;
    gap: 10px;

    padding: 15px 12px;

    background: linear-gradient(
        145deg,
        rgba(166,139,255,.12),
        rgba(104,228,173,.035)
    );

    border: 1px solid rgba(166,139,255,.13);
    border-radius: 13px;
}

.journey-emoji {
    font-size: 23px;
}

.journey-card strong {
    font-size: 12px;
}

.journey-card p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.journey-progress {
    grid-column: 1 / -1;
    margin-top: 5px;
}

.progress-track {
    height: 5px;
    background: rgba(255,255,255,.08);
    border-radius: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #987aff, #68e4ad);
    transition: width .4s ease;
}

.journey-progress > span {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 10px;
}

.sidebar-bottom {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: auto;
    padding: 14px 3px 3px;

    border-top: 1px solid var(--border);
}

.avatar {
    width: 35px;
    height: 35px;

    display: grid;
    place-items: center;

    flex-shrink: 0;
    border-radius: 50%;

    background: #343049;
    color: var(--purple-bright);
    font-weight: 800;
}

.sidebar-user {
    min-width: 0;
    flex: 1;
}

.sidebar-user strong,
.sidebar-user span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user strong {
    font-size: 12px;
}

.sidebar-user span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

/* MAIN */

.main-area {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.topbar {
    min-height: 75px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    padding: 0 36px;

    background: rgba(16,17,27,.86);
    border-bottom: 1px solid var(--border);
}

.breadcrumb {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
}

.breadcrumb-divider {
    color: #55566b;
}

.breadcrumb strong {
    color: var(--text);
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 17px;
}

.streak-chip {
    display: flex;
    align-items: center;
    gap: 6px;

    padding: 9px 12px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;

    font-size: 11px;
}

.streak-chip span:last-child {
    color: var(--muted);
}

.top-avatar {
    border: 1px solid rgba(166,139,255,.2);
    cursor: pointer;
}

.content-area {
    width: 100%;
    max-width: 1650px;
    flex: 1;

    margin: 0 auto;
    padding: 33px 36px 45px;
}

.page {
    display: none;
    animation: fadeIn .22s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1,
h2,
h3 {
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: -.65px;
}

h1 {
    margin: 12px 0 8px;
    font-size: clamp(27px, 3vw, 35px);
    line-height: 1.2;
}

h2 {
    margin: 0;
    font-size: 21px;
}

h3 {
    margin: 0;
    font-size: 16px;
}

p {
    line-height: 1.65;
}

.muted {
    color: var(--muted);
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--purple);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.status-dot {
    width: 7px;
    height: 7px;
    display: inline-block;

    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px rgba(104,228,173,.35);
}

.welcome-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 25px;
}

.welcome-row p,
.page-heading p {
    margin: 8px 0 0;
    font-size: 13px;
}

/* BUTTONS */

.primary-button,
.secondary-button,
.hero-button {
    min-height: 41px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    padding: 0 17px;

    border-radius: 10px;
    border: 1px solid transparent;

    font-weight: 700;
    font-size: 12px;

    transition: transform .2s ease, background .2s ease;
}

.primary-button {
    background: var(--purple);
    color: #171329;
}

.primary-button:hover {
    background: #c0b0ff;
    transform: translateY(-1px);
}

.secondary-button {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}

.secondary-button:hover {
    background: var(--surface-3);
}

.hero-button {
    background: #c1afff;
    color: #1c1631;
    margin-top: 14px;
}

.icon-button {
    width: 35px;
    height: 35px;

    display: inline-grid;
    place-items: center;

    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;

    color: var(--muted);
}

.icon-button:hover {
    background: var(--surface-2);
    color: white;
}

.text-button {
    background: none;
    border: none;
    color: var(--purple);
    font-weight: 700;
    font-size: 12px;
}

.full-width {
    width: 100%;
}

/* HERO */

.hero-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    min-height: 310px;

    display: grid;
    grid-template-columns: 1.05fr 1fr;
    align-items: center;

    padding: 35px 39px;

    border: 1px solid rgba(166,139,255,.16);
    border-radius: 22px;

    background:
        radial-gradient(
            ellipse at 85% 45%,
            rgba(119,91,206,.18),
            transparent 50%
        ),
        linear-gradient(120deg, #211d35, #191a2b 60%, #1b2030);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 460px;
}

.hero-tag {
    display: inline-flex;
    gap: 7px;
    align-items: center;

    color: var(--purple-bright);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .9px;
}

.hero-content h2 {
    margin-top: 19px;
    font-size: clamp(32px, 4vw, 46px);
    line-height: 1.08;
    letter-spacing: -2px;
}

.hero-content h2 span {
    color: var(--purple-bright);
}

.hero-content p {
    max-width: 365px;
    margin: 15px 0 4px;

    color: #b2b1c9;
    font-size: 12px;
}

.hero-art {
    min-height: 235px;
    position: relative;

    display: grid;
    place-items: center;
}

.art-glow {
    position: absolute;
    width: 260px;
    height: 220px;

    background: rgba(134,102,255,.16);
    filter: blur(65px);
    border-radius: 50%;
}

.code-window {
    width: min(330px, 100%);
    position: relative;
    z-index: 2;

    overflow: hidden;

    background: rgba(18,19,31,.94);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 13px;

    box-shadow: 0 20px 65px rgba(0,0,0,.27);

    transform: rotate(-2deg);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%,100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-7px) rotate(-1deg); }
}

.code-window-header {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 13px 15px;

    border-bottom: 1px solid var(--border);

    color: #9292ac;
    font-size: 10px;
}

.window-dots {
    display: flex;
    gap: 4px;
}

.window-dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #5c5d71;
}

.window-dots i:first-child {
    background: #ff7e86;
}

.window-dots i:nth-child(2) {
    background: #ffcc78;
}

.window-dots i:last-child {
    background: #68e4ad;
}

.mini-code {
    padding: 14px 18px 12px;

    color: #e4dfff;
    font: 11px/1.9 monospace;
}

.mini-code div span {
    display: inline-block;
    width: 20px;
    color: #62647f;
}

.mini-code b {
    color: #c4a5ff;
}

.mini-code em {
    color: #91d8b4;
    font-style: normal;
}

.code-success {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 10px 15px;

    background: rgba(104,228,173,.07);
    border-top: 1px solid rgba(104,228,173,.1);

    color: #9cebc8;
    font-size: 10px;
}

.code-success span {
    width: 17px;
    height: 17px;

    display: grid;
    place-items: center;

    background: rgba(104,228,173,.15);
    border-radius: 50%;
}

.floating-code {
    position: absolute;
    z-index: 3;

    padding: 10px 12px;

    background: #27243b;
    border: 1px solid rgba(166,139,255,.18);
    border-radius: 9px;

    font: 10px monospace;
}

.code-one {
    top: 20px;
    left: 0;
}

.code-purple {
    color: #c2a8ff;
}

.code-blue {
    color: #83b9ff;
}

.floating-badge {
    position: absolute;
    z-index: 3;

    display: grid;
    place-items: center;

    width: 38px;
    height: 38px;

    border-radius: 12px;
    font-weight: 800;

    box-shadow: 0 10px 30px rgba(0,0,0,.2);
}

.badge-top {
    top: 18px;
    right: 4px;

    background: #322b4a;
    color: var(--purple);
    font-size: 14px;
}

.badge-bottom {
    right: 12px;
    bottom: 17px;

    background: #203c36;
    color: var(--green);
}

/* STATS */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;

    margin: 22px 0 35px;
}

.stat-card {
    padding: 19px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;

    transition: transform .2s ease, border-color .2s ease;
}

.stat-card:hover,
.course-card:hover {
    transform: translateY(-3px);
    border-color: rgba(166,139,255,.2);
}

.stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-icon {
    width: 33px;
    height: 33px;

    display: grid;
    place-items: center;

    border-radius: 10px;
    font-size: 17px;
}

.purple-icon { color: var(--purple); background: rgba(166,139,255,.12); }
.green-icon { color: var(--green); background: rgba(104,228,173,.1); }
.orange-icon { color: var(--orange); background: rgba(255,184,107,.1); }
.blue-icon { color: var(--blue); background: rgba(130,181,255,.1); }

.stat-caption {
    color: #73758f;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .6px;
}

.stat-card h3 {
    margin: 18px 0 4px;
    font-size: 28px;
}

.stat-card p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

/* SECTION HEADINGS */

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    margin: 30px 0 17px;
}

.section-heading p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 11px;
}

/* COURSE CARDS */

.course-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.course-card {
    min-width: 0;
    padding: 19px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;

    transition: transform .2s ease, border-color .2s ease;
}

.course-icon {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    margin-bottom: 18px;
    border-radius: 12px;

    font-size: 20px;
    font-weight: 800;
}

.html-icon { color: #ffb57c; background: rgba(255,181,124,.12); }
.css-icon { color: #81bcff; background: rgba(129,188,255,.12); }
.js-icon { color: #ffe28a; background: rgba(255,226,138,.12); font-size: 12px; }

.course-tag {
    color: var(--purple);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .9px;
}

.course-info h3 {
    margin-top: 8px;
}

.course-info p {
    min-height: 38px;
    margin: 8px 0 17px;

    color: var(--muted);
    font-size: 11px;
}

.course-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    padding-top: 13px;
    border-top: 1px solid var(--border);
}

.course-bottom > span {
    color: var(--muted);
    font-size: 10px;
}

.course-bottom button {
    border: none;
    background: none;
    color: var(--purple);
    font-weight: 700;
    font-size: 11px;
}

/* ASSESSMENT BANNER */

.assessment-banner {
    display: flex;
    align-items: center;
    gap: 18px;

    margin-top: 20px;
    padding: 22px;

    background: linear-gradient(110deg, #201e34, #1c202c);
    border: 1px solid rgba(166,139,255,.13);
    border-radius: 16px;
}

.assessment-symbol,
.assessment-type-icon {
    width: 47px;
    height: 47px;

    flex-shrink: 0;

    display: grid;
    place-items: center;

    border-radius: 13px;

    background: rgba(166,139,255,.12);
    color: var(--purple);

    font-size: 21px;
}

.assessment-copy {
    flex: 1;
    min-width: 0;
}

.assessment-copy h3 {
    margin-top: 6px;
}

.assessment-copy p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 11px;
}

/* LEARNING PAGE */

.page-heading {
    margin-bottom: 27px;
}

.learning-notice {
    display: flex;
    align-items: flex-start;
    gap: 13px;

    padding: 17px;

    background: rgba(130,181,255,.055);
    border: 1px solid rgba(130,181,255,.13);
    border-radius: 13px;
}

.learning-notice > span {
    font-size: 23px;
}

.learning-notice strong {
    font-size: 12px;
}

.learning-notice p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.lesson-list {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.lesson-card {
    display: flex;
    align-items: center;
    gap: 16px;

    padding: 18px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.lesson-number {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;
    flex-shrink: 0;

    border-radius: 12px;
    background: var(--surface-3);

    color: var(--purple);
    font-weight: 800;
}

.lesson-details {
    min-width: 0;
    flex: 1;
}

.lesson-details h3 {
    margin-top: 5px;
}

.lesson-details p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.lesson-action {
    flex-shrink: 0;
}

.lesson-unit {
    margin-top: 24px;
}

.lesson-unit-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.lesson-unit-heading h2 {
    margin-top: 6px;
}

.lesson-unit-heading p,
.unit-locked-note {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.unit-progress,
.assessment-progress {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.unit-lesson-list {
    display: grid;
    gap: 10px;
}

.lesson-card.locked {
    opacity: .6;
}

.lesson-study {
    margin-top: 24px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
}

.lesson-study-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.lesson-study-header h2 {
    margin-top: 8px;
}

.lesson-study-header p {
    margin-top: 6px;
}

#lessonConcept {
    margin: 18px 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.lesson-example {
    margin-top: 16px;
    padding: 16px;
    background: #141520;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.lesson-example pre {
    margin: 9px 0 0;
    color: #d4c9ff;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: 12px/1.8 Consolas, monospace;
}

.lesson-question {
    display: grid;
    justify-items: start;
    gap: 10px;
    margin-top: 20px;
}

.lesson-question label {
    font-size: 13px;
    font-weight: 700;
}

.lesson-question select {
    min-width: min(100%, 300px);
}

#lessonFeedback {
    min-height: 18px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

/* PRACTICE LAB */

.practice-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.editor-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 11px;
}

.lab-layout {
    display: grid;
    grid-template-columns: minmax(230px, .8fr) minmax(0, 1.8fr);
    align-items: start;
    gap: 18px;
}

.challenge-panel,
.editor-card,
.output-card,
.hint-card {
    min-width: 0;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.challenge-panel {
    padding: 19px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;

    margin-bottom: 20px;

    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .7px;
}

.difficulty-pill {
    padding: 5px 8px;
    border-radius: 6px;

    background: rgba(104,228,173,.09);
    color: var(--green);
    font-size: 9px;
}

.challenge-panel h2 {
    font-size: 20px;
    line-height: 1.35;
}

.challenge-panel > p {
    color: var(--muted);
    font-size: 11px;
}

.challenge-divider {
    height: 1px;
    margin: 19px 0;

    background: var(--border);
}

.challenge-label {
    margin: 18px 0 10px;

    color: #8587a1;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .8px;
}

#challengeInstructions {
    padding-left: 19px;
    color: #b6b7cd;
    font-size: 11px;
    line-height: 2;
}

.example-box {
    padding: 12px;

    background: rgba(104,228,173,.05);
    border: 1px solid rgba(104,228,173,.11);
    border-radius: 9px;
}

.example-box span {
    display: block;
    margin-bottom: 8px;

    color: var(--green);
    font-size: 9px;
    font-weight: 800;
}

.example-box code {
    color: #c9ecd9;
    font-size: 11px;
}

.test-cases {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.test-case {
    display: flex;
    justify-content: space-between;
    gap: 8px;

    padding: 10px;

    background: var(--surface-2);
    border-radius: 8px;

    font: 10px monospace;
}

.test-case .test-result {
    color: var(--muted);
}

.test-case.pass .test-result {
    color: var(--green);
}

.test-case.fail .test-result {
    color: var(--red);
}

.editor-column {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.editor-card {
    overflow: hidden;
}

.editor-toolbar,
.editor-footer,
.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding: 12px 15px;
}

.editor-toolbar {
    border-bottom: 1px solid var(--border);
}

.file-tab {
    display: flex;
    align-items: center;
    gap: 9px;

    min-width: 0;

    font-size: 11px;
}

.file-dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;

    border-radius: 50%;
    background: #ffe28a;
}

.file-unsaved {
    color: var(--orange);
}

.editor-toolbar-right {
    display: flex;
    align-items: center;
    gap: 5px;
}

#languageSelect {
    max-width: 130px;
    padding: 7px;

    background: var(--surface-2);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 7px;

    font-size: 10px;
}

.CodeMirror {
    height: 400px;

    padding-top: 8px;

    background: #171824 !important;

    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.7;
}

.CodeMirror-gutters {
    background: #171824 !important;
    border-right: 1px solid rgba(255,255,255,.06) !important;
}

.CodeMirror-linenumber {
    color: #656780;
}

.CodeMirror-cursor {
    border-left: 2px solid #c5b7ff !important;
}

/* Red error underline and line highlight */

.CodeMirror-lint-mark-error {
    background-image: none !important;

    border-bottom: 2px wavy var(--red);

    background-color: rgba(255,116,127,.12);
}

.CodeMirror-lint-mark-warning {
    border-bottom: 2px wavy var(--orange);
}

.CodeMirror-lint-marker-error {
    color: var(--red);
}

.CodeMirror-lint-marker-warning {
    color: var(--orange);
}

.CodeMirror-lint-line-error {
    background: rgba(255,116,127,.055);
}

.CodeMirror-lint-line-warning {
    background: rgba(255,184,107,.04);
}

.editor-footer {
    border-top: 1px solid var(--border);

    color: var(--muted);
    font-size: 10px;
}

#editorErrorCount.has-errors {
    color: var(--red);
}

#editorErrorCount.has-warnings {
    color: var(--orange);
}

.run-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.run-description {
    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--muted);
    font-size: 10px;
}

.program-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 10px;
}

.program-inputs input {
    width: min(210px, 32vw);
    padding: 8px 10px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.terminal-icon {
    color: var(--green);
    font-family: monospace;
    font-size: 15px;
}

.run-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.run-button {
    background: var(--green);
    color: #10291e;
}

.run-button:hover {
    background: #9af2c8;
}

.output-card {
    overflow: hidden;
}

.output-header {
    border-bottom: 1px solid var(--border);
}

.output-header > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.output-header strong {
    font-size: 11px;
}

.output-header > span {
    color: var(--muted);
    font-size: 10px;
}

.output-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
}

.output-content {
    min-height: 95px;
    max-height: 320px;
    overflow: auto;

    padding: 15px;

    color: #d7d8e8;
    font: 11px/1.8 Consolas, monospace;

    overflow-wrap: anywhere;
}

.code-preview-frame {
    display: block;
    width: 100%;
    height: 380px;
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.output-placeholder {
    margin: 0;
    color: #73758e;
    font: 11px/1.8 "DM Sans", sans-serif;
}

.output-line {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.output-line.error {
    color: var(--red);
}

.output-line.success {
    color: var(--green);
}

.output-line.warning {
    color: var(--orange);
}

.output-line.info {
    color: var(--blue);
}

.hint-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    padding: 15px;
}

.hint-icon {
    color: var(--purple);
    font-size: 19px;
}

.hint-card > div {
    min-width: 0;
    flex: 1;
}

.hint-card strong {
    font-size: 11px;
}

.hint-card p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
}

/* ASSESSMENTS */

.assessment-types {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.assessment-type-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    padding: 23px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
}

.assessment-type-card.locked {
    opacity: .72;
}

.assessment-type-icon {
    margin-bottom: 18px;
}

.assessment-type-card h3 {
    margin-top: 10px;
}

.assessment-type-card p {
    flex: 1;
    color: var(--muted);
    font-size: 12px;
}

.assessment-type-card .primary-button {
    margin-top: 12px;
}

.assessment-progress {
    margin-top: 10px;
}

.assessment-workspace {
    margin-top: 25px;
    padding: 23px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
}

.assessment-task-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.assessment-task {
    display: grid;
    gap: 7px;
    padding: 13px;
    text-align: left;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}

.assessment-task span,
.assessment-task small {
    color: var(--muted);
    font-size: 10px;
}

.assessment-task strong {
    font-size: 12px;
}

.assessment-task.selected {
    border-color: var(--purple);
}

.assessment-task.complete small {
    color: var(--green);
}

.assessment-workspace-header {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.assessment-workspace-header h2 {
    margin-top: 10px;
}

.assessment-workspace-header p {
    color: var(--muted);
    font-size: 12px;
}

.assessment-code-label {
    margin: 20px 0 9px;

    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.assessment-code {
    padding: 17px;

    background: #141520;
    border: 1px solid var(--border);
    border-radius: 10px;

    color: #d4c9ff;

    white-space: pre-wrap;
    overflow-wrap: anywhere;

    font: 12px/1.8 Consolas, monospace;
}

/* PROGRESS */

.progress-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.progress-main-card {
    padding: 24px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
}

.progress-main-card h2 {
    margin-top: 18px;
    font-size: 37px;
}

.progress-main-card p {
    color: var(--muted);
    font-size: 12px;
}

.large-track {
    height: 8px;
    margin-top: 18px;
}

.activity-list {
    display: grid;
    gap: 10px;
}

.activity-row {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 15px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.activity-check {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 10px;
    background: rgba(104,228,173,.1);
    color: var(--green);
}

.activity-row > div:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.activity-row strong {
    font-size: 12px;
}

.activity-row p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.activity-row > span {
    color: var(--muted);
    font-size: 10px;
}

.empty-state {
    padding: 45px 20px;
    text-align: center;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
}

.empty-state > span {
    font-size: 28px;
    color: var(--purple);
}

.empty-state h3 {
    margin-top: 14px;
}

.empty-state p {
    color: var(--muted);
    font-size: 12px;
}

/* AUTH MODAL */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;

    display: grid;
    place-items: center;

    padding: 18px;

    background: rgba(4,5,12,.77);
    backdrop-filter: blur(8px);
}

.auth-modal {
    position: relative;

    width: min(100%, 410px);

    padding: 35px 29px 28px;

    background: #1b1c2a;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;

    text-align: center;

    box-shadow: 0 30px 100px rgba(0,0,0,.4);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
}

.auth-brand {
    margin: 0 auto 22px;
}

.auth-modal h2 {
    margin-top: 14px;
}

.auth-modal > p {
    color: var(--muted);
    font-size: 12px;
}

.google-button {
    width: 100%;
    min-height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;

    margin-top: 23px;
    padding: 10px;

    background: #f8f8fb;
    border: 0;
    border-radius: 10px;

    color: #20202a;
    font-weight: 700;
}

.google-button:hover {
    background: #e9e8f1;
}

.google-logo {
    font-size: 19px;
    font-weight: 800;
    color: #4285f4;
}

.auth-footnote {
    margin-top: 18px;
    font-size: 10px !important;
}

.auth-error {
    margin-top: 15px;
    padding: 11px;

    background: rgba(255,116,127,.09);
    border: 1px solid rgba(255,116,127,.2);
    border-radius: 8px;

    color: var(--red);
    font-size: 11px;
}

/* TOAST */

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 200;

    max-width: min(400px, calc(100vw - 32px));

    padding: 13px 17px;

    background: #29283d;
    border: 1px solid rgba(166,139,255,.2);
    border-radius: 11px;

    color: var(--text);
    font-size: 12px;

    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;

    transition: .25s ease;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* FOOTER */

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;

    padding: 19px 36px;

    border-top: 1px solid var(--border);

    color: #777991;
    font-size: 10px;
}

.app-footer > span:first-child {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 800;
}

/* ACCESSIBILITY */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;

    overflow: hidden;
    clip: rect(0,0,0,0);

    white-space: nowrap;
    border: 0;
}

.mobile-menu {
    display: none;
}

/* RESPONSIVE */

@media (max-width: 1250px) {
    :root {
        --sidebar-width: 220px;
    }

    .content-area {
        padding: 28px 25px 38px;
    }

    .topbar {
        padding: 0 25px;
    }

    .hero-card {
        padding: 29px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .course-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lab-layout {
        grid-template-columns: minmax(210px, .7fr) minmax(0, 1.5fr);
    }
}

@media (max-width: 900px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        width: 260px;
        transform: translateX(-105%);
        transition: transform .25s ease;
        box-shadow: 20px 0 70px rgba(0,0,0,.25);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-area {
        margin-left: 0;
    }

    .mobile-menu {
        display: inline-grid;
        flex-shrink: 0;
    }

    .topbar {
        padding: 0 20px;
    }

    .breadcrumb {
        margin-right: auto;
    }

    .content-area {
        padding: 25px 20px 35px;
    }

    .hero-card {
        grid-template-columns: 1fr 1fr;
        padding: 25px;
    }

    .lab-layout {
        grid-template-columns: 1fr;
    }

    .challenge-panel {
        order: 1;
    }

    .editor-column {
        order: 0;
    }

    .challenge-panel {
        padding: 18px;
    }
}

@media (max-width: 650px) {
    .topbar {
        min-height: 65px;
        padding: 0 13px;
        gap: 8px;
    }

    .breadcrumb {
        gap: 6px;
        font-size: 10px;
    }

    .topbar-right {
        gap: 8px;
    }

    .streak-chip {
        gap: 4px;
        padding: 8px;
    }

    .streak-chip span:last-child {
        display: none;
    }

    .top-avatar {
        width: 31px;
        height: 31px;
    }

    .content-area {
        padding: 23px 13px 30px;
    }

    .welcome-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }

    .welcome-row .primary-button {
        width: 100%;
    }

    .hero-card {
        grid-template-columns: 1fr;
        padding: 25px 20px 10px;
    }

    .hero-content h2 {
        font-size: 37px;
    }

    .hero-art {
        min-height: 230px;
        margin-top: 15px;
    }

    .code-one {
        left: 0;
    }

    .badge-top {
        right: 0;
    }

    .stats-grid {
        gap: 10px;
        margin: 15px 0 28px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card h3 {
        margin-top: 14px;
        font-size: 25px;
    }

    .stat-caption {
        font-size: 8px;
    }

    .stat-card p {
        font-size: 10px;
    }

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

    .course-card {
        display: grid;
        grid-template-columns: 45px 1fr;
        column-gap: 12px;
    }

    .course-icon {
        grid-row: 1 / 3;
        margin-bottom: 0;
    }

    .course-info p {
        min-height: 0;
        margin-bottom: 10px;
    }

    .course-bottom {
        grid-column: 1 / -1;
        margin-top: 14px;
    }

    .assessment-banner {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 17px;
    }

    .assessment-copy {
        flex-basis: calc(100% - 70px);
    }

    .assessment-banner > .primary-button {
        width: 100%;
    }

    .section-heading {
        margin-top: 25px;
    }

    .section-heading h2 {
        font-size: 19px;
    }

    .practice-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .CodeMirror {
        height: 340px;
        font-size: 12px;
    }

    .editor-toolbar {
        padding: 10px;
    }

    .editor-footer {
        padding: 10px;
        font-size: 9px;
    }

    .run-toolbar {
        align-items: stretch;
    }

    .run-description {
        width: 100%;
    }

    .run-buttons {
        width: 100%;
    }

    .run-buttons button {
        flex: 1;
    }

    .output-content {
        max-height: 260px;
    }

    .hint-card {
        flex-wrap: wrap;
    }

    .hint-card > .text-button {
        margin-left: auto;
    }

    .assessment-types {
        grid-template-columns: 1fr;
    }

    .assessment-task-list {
        grid-template-columns: 1fr;
    }

    .assessment-type-card {
        padding: 19px;
    }

    .progress-overview {
        grid-template-columns: 1fr;
    }

    .lesson-card {
        align-items: flex-start;
        padding: 14px;
    }

    .lesson-action {
        padding: 0 10px;
    }

    .app-footer {
        padding: 17px 13px;
        font-size: 9px;
    }

    .app-footer span:last-child {
        text-align: right;
    }

    .auth-modal {
        padding: 32px 20px 23px;
    }
}

@media (max-width: 360px) {
    .breadcrumb span:first-child,
    .breadcrumb-divider {
        display: none;
    }

    .stat-card {
        padding: 11px;
    }

    .stat-caption {
        letter-spacing: 0;
    }

    .hero-content h2 {
        font-size: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}