:root {
  --red: #d71920;
  --red-dark: #9f1117;
  --blue: #2f8fff;
  --ink: #eef3f8;
  --muted: #9ca9b7;
  --panel: rgba(18, 24, 34, 0.9);
  --border: rgba(255, 255, 255, 0.11);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -10%, rgba(215, 25, 32, 0.25), transparent 38rem),
    radial-gradient(circle at 0 100%, rgba(47, 143, 255, 0.13), transparent 30rem),
    #090c11;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 42px 42px;
}

a { color: inherit; }

.shell {
  width: min(1060px, calc(100% - 2rem));
  margin: 0 auto;
}

.shell-wide { width: min(1760px, calc(100% - 3rem)); margin: 0 auto; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .025em;
  text-decoration: none;
}

.brand img { width: 46px; height: 46px; object-fit: contain; }
.brand span { color: var(--red); }

.nav-actions { display: flex; align-items: center; gap: .65rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: .62rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255,255,255,.045);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:hover { border-color: rgba(215,25,32,.65); background: rgba(215,25,32,.1); }
.button.admin { color: #ffd0d2; border-color: rgba(215,25,32,.42); }
.button.test-student-start { color: #b9dcff; border-color: rgba(47,143,255,.45); background: rgba(47,143,255,.1); }
.button.test-student-return { color: #ffe3a4; border-color: rgba(245,158,11,.48); background: rgba(245,158,11,.11); }

.test-student-banner {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 1rem;
  padding: .75rem .9rem;
  border: 1px solid rgba(245,158,11,.35);
  border-radius: 10px;
  color: #f8dda1;
  background: rgba(245,158,11,.09);
  font-size: .78rem;
}
.test-student-banner span { color: #baa982; }

.page-center {
  min-height: calc(100vh - 73px);
  display: grid;
  place-items: center;
  padding: 3rem 0 5rem;
}

.login-card, .welcome-card {
  width: min(100%, 680px);
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 28px 90px rgba(0,0,0,.36);
  backdrop-filter: blur(14px);
}

.login-card { max-width: 520px; text-align: center; }

.eyebrow {
  margin: 0 0 .6rem;
  color: #ff6f73;
  font-size: .71rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.15rem, 8vw, 4rem);
  line-height: 1;
  letter-spacing: -.045em;
}

.lede { margin: 1rem auto 0; max-width: 560px; color: var(--muted); line-height: 1.7; }

.signin-area {
  min-height: 48px;
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.domain-note { margin: 1rem 0 0; color: #758394; font-size: .77rem; }

.alert {
  margin: 0 0 1.25rem;
  padding: .8rem 1rem;
  border: 1px solid rgba(255,91,96,.4);
  border-radius: 8px;
  color: #ffd5d6;
  background: rgba(215,25,32,.12);
  font-size: .86rem;
  line-height: 1.5;
}

.profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
}

.avatar {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255,255,255,.14);
  border-radius: 50%;
  object-fit: cover;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  font-weight: 800;
}

.profile-name { font-weight: 750; }
.profile-email { margin-top: .18rem; color: var(--muted); font-size: .82rem; }

.status-pill {
  display: inline-flex;
  margin-top: 1.15rem;
  padding: .35rem .65rem;
  border-radius: 999px;
  color: #8de8b1;
  background: rgba(34,197,94,.11);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.admin-copy { margin-top: 1.5rem; color: var(--muted); line-height: 1.65; }

.dashboard-main { padding: 3rem 0 5rem; }

.course-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--border);
}

.course-heading h1 { font-size: clamp(2.25rem, 6vw, 4rem); }

.course-intro {
  max-width: 620px;
  margin: .9rem 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.verified-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 0 0 auto;
  padding: .75rem .9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}

.verified-user .avatar { width: 38px; height: 38px; }
.verified-label, .verified-email { display: block; }
.verified-label { color: #8de8b1; font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.verified-email { margin-top: .18rem; color: var(--muted); font-size: .74rem; }

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

.course-card {
  aspect-ratio: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 17px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.065), rgba(255,255,255,.018)),
    #101620;
  box-shadow: 0 14px 36px rgba(0,0,0,.18);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  color: inherit;
  text-decoration: none;
}

.course-card:focus-visible { outline: 3px solid rgba(47,143,255,.75); outline-offset: 3px; }

.course-card::before {
  content: "";
  position: absolute;
  width: 145px;
  height: 145px;
  top: -90px;
  right: -70px;
  border-radius: 50%;
  background: rgba(215,25,32,.12);
  pointer-events: none;
}

.course-card.is-current { border-color: rgba(215,25,32,.38); }
.course-card.is-current:hover { transform: translateY(-4px); border-color: rgba(215,25,32,.72); box-shadow: 0 18px 42px rgba(0,0,0,.26), 0 0 24px rgba(215,25,32,.09); }
.course-card.is-complete { border-color: rgba(34,197,94,.42); background: linear-gradient(145deg, rgba(34,197,94,.11), rgba(255,255,255,.018)), #101620; }
.course-card.is-complete::before { background: rgba(34,197,94,.14); }
.course-card.is-locked { color: #8793a1; background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012)), #0d1219; }
.course-card.is-locked::before { background: rgba(148,163,184,.07); }

.card-header-row { display: flex; align-items: center; justify-content: space-between; min-height: 30px; }

.topic-number {
  color: #ff777b;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .13em;
}

.is-locked .topic-number { color: #687482; }

.lock-mark { filter: grayscale(1); font-size: .9rem; opacity: .6; }
.complete-mark { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; color: #07160d; background: #5ce28e; font-weight: 900; }

.course-card h2 {
  position: relative;
  max-width: 95%;
  margin: 1rem 0 0;
  font-size: clamp(1.05rem, 2.1vw, 1.35rem);
  line-height: 1.18;
  letter-spacing: -.025em;
}

.card-progress { margin-top: auto; }

.progress-summary {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: .55rem;
  margin-bottom: .55rem;
}

.progress-summary span { max-width: 78%; color: var(--muted); font-size: .66rem; line-height: 1.35; }
.is-locked .progress-summary span { color: #687482; }
.progress-summary strong { color: var(--ink); font-size: .82rem; }
.is-locked .progress-summary strong { color: #7c8794; }

.progress-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.075);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red-dark), #ff5056);
}

.is-complete .progress-track span { background: linear-gradient(90deg, #15803d, #5ce28e); }

.module-main { padding: 2.25rem 0 5rem; }

.back-link {
  display: inline-flex;
  margin-bottom: 1.75rem;
  color: #bbc7d4;
  font-size: .84rem;
  font-weight: 750;
  text-decoration: none;
}

.back-link:hover { color: #fff; }

.module-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: end;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.module-heading h1 { font-size: clamp(2.25rem, 7vw, 4.5rem); }

.module-intro {
  max-width: 760px;
  margin: 1rem 0 0;
  color: #b3bfcc;
  line-height: 1.7;
}

.module-instructions {
  max-width: 760px;
  margin: .65rem 0 0;
  color: #8f9dab;
  font-size: .85rem;
  line-height: 1.6;
}

.module-progress-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}

.locked-notice {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(245,158,11,.27);
  border-radius: 12px;
  color: #d9c9a6;
  background: rgba(245,158,11,.075);
  font-size: .85rem;
  line-height: 1.5;
}

.lesson-list { display: grid; gap: .75rem; }

.lesson-row {
  display: grid;
  grid-template-columns: 40px 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 112px;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.055), rgba(255,255,255,.018)), #101620;
  transition: transform .15s ease, border-color .15s ease;
}

.lesson-link { color: inherit; text-decoration: none; cursor: pointer; }
.lesson-link:hover { transform: translateY(-2px); border-color: rgba(215,25,32,.62); box-shadow: 0 14px 34px rgba(0,0,0,.22); }
.lesson-link:focus-visible { outline: 3px solid rgba(47,143,255,.75); outline-offset: 2px; }

.lesson-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  border: 2px solid #657180;
  color: transparent;
  font-size: .85rem;
  font-weight: 900;
}

.lesson-number {
  color: #ff777b;
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: .06em;
}

.lesson-copy h2 { margin: 0; font-size: 1.08rem; letter-spacing: -.015em; }
.lesson-copy p { margin: .42rem 0 0; color: #aab6c4; font-size: .86rem; line-height: 1.55; }
.lesson-details { display: grid; gap: .32rem; margin-top: .48rem; }
.lesson-details p { margin: 0; }
.lesson-details strong { color: #dbe4ed; font-size: .76rem; }

.lesson-state {
  min-width: 62px;
  color: #ffb1b4;
  font-size: .74rem;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

/* Complete: green icon + border, matches business "finished graded work" checkmark */
.lesson-row.is-complete { border-color: rgba(34,197,94,.42); }
.lesson-row.is-complete .lesson-icon { border-color: #22c55e; background: #22c55e; color: #07130b; }
.lesson-row.is-complete .lesson-state { color: #8de8b1; }

/* Explore (ungraded overview lessons like Your Coding Journey): blue, matches business resource links */
.lesson-row.is-explore { border-color: rgba(99,213,255,.34); }
.lesson-row.is-explore:hover { border-color: rgba(99,213,255,.72); }
.lesson-row.is-explore .lesson-icon { border-color: #63d5ff; color: #bceeff; }

/* Bonus activities: gold, matches business teacher-resource treatment but distinct hue.
   No lesson-number column, so this row only has 3 children (icon, copy, state). */
.lesson-row.is-bonus {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  border-color: rgba(255,212,59,.35);
  background: linear-gradient(135deg, rgba(255,212,59,.09), rgba(255,212,59,.02)), #15140e;
}
.lesson-row.is-bonus:hover { border-color: #ffd43b; }
.lesson-row.is-bonus .lesson-icon { border-color: #ffd43b; color: #ffd43b; }
.lesson-row.is-bonus .lesson-state { color: #ffd43b; }

/* Locked: dimmed, matches business locked dashboard cards */
.lesson-row.is-locked { color: #8793a1; background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012)), #0d1219; }
.lesson-row.is-locked .lesson-icon { border-color: #4a5563; color: #4a5563; }
.lesson-row.is-locked .lesson-number { color: #778391; }
.lesson-row.is-locked .lesson-state { color: #778391; }

.lesson-list.is-preview .lesson-row { background: rgba(255,255,255,.025); }
.lesson-list.is-preview .lesson-number { color: #778391; }
.lesson-list.is-preview .lesson-state { color: #a4afbb; }

.module-notes { display: grid; gap: .75rem; margin-top: 1.25rem; }

.module-note {
  padding: 1rem 1.2rem;
  border: 1px solid rgba(47,143,255,.22);
  border-radius: 12px;
  background: rgba(47,143,255,.07);
}

.module-note.project-note { border-color: rgba(215,25,32,.3); background: rgba(215,25,32,.075); }
.module-note p { margin: 0; color: #b8c4d0; line-height: 1.6; }
.module-note .note-label { margin-bottom: .35rem; color: var(--ink); font-size: .7rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }

.admin-main { padding: 2.5rem 0 5rem; }

.admin-heading,
.student-detail-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.35rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.admin-heading h1,
.student-detail-heading h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
.admin-heading p:not(.eyebrow),
.student-detail-heading p { max-width: 720px; margin: .8rem 0 0; color: var(--muted); line-height: 1.6; }

.admin-count,
.student-overall-card {
  flex: 0 0 auto;
  display: grid;
  min-width: 150px;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255,255,255,.04);
}

.admin-count strong,
.student-overall-card strong { font-size: 1.65rem; }
.admin-count span,
.student-overall-card span { margin-top: .2rem; color: var(--muted); font-size: .72rem; }
.student-overall-card { max-width: 230px; }

.admin-empty {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--muted);
  background: var(--panel);
  text-align: center;
}
.admin-empty h2 { margin: 0; color: var(--ink); }

.admin-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0 0 .85rem; color: var(--muted); font-size: .72rem; }
.admin-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-dot.complete { background: #5ce28e; }
.legend-dot.active { background: #60a5fa; }
.legend-dot.ready { background: #7c8794; }
.legend-dot.unavailable { background: #353d48; }

.student-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0d1219;
  box-shadow: 0 18px 50px rgba(0,0,0,.2);
}

.student-progress-table { width: 100%; min-width: 1640px; border-collapse: separate; border-spacing: 0; }
.student-progress-table th,
.student-progress-table td { padding: .7rem .45rem; border-right: 1px solid rgba(255,255,255,.065); border-bottom: 1px solid rgba(255,255,255,.065); text-align: center; }
.student-progress-table thead th { position: sticky; top: 0; z-index: 2; color: #8593a2; background: #121923; font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; }
.student-progress-table tbody tr:last-child > * { border-bottom: 0; }
.student-progress-table tr > *:last-child { border-right: 0; }
.student-progress-table .student-column { position: sticky; left: 0; z-index: 1; width: 220px; min-width: 220px; padding-left: .9rem; background: #111821; text-align: left; }
.student-progress-table thead .student-column { z-index: 3; background: #151d28; }
.student-progress-table .current-column { width: 230px; min-width: 230px; text-align: left; }
.student-progress-table tbody tr:hover td,
.student-progress-table tbody tr:hover .student-column { background-color: #151d28; }

.student-name-link { display: block; color: #f2f6fa; font-size: .84rem; font-weight: 800; text-decoration: none; }
.student-name-link:hover { color: #ff8589; }
.student-column > span,
.current-column span { display: block; margin-top: .2rem; overflow: hidden; color: #7f8d9c; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.student-name-link .test-account-badge { display: inline-flex; margin-left: .3rem; padding: .15rem .35rem; border-radius: 999px; color: #b9dcff; background: rgba(47,143,255,.13); font-size: .55rem; letter-spacing: .05em; text-transform: uppercase; vertical-align: middle; }
.current-column strong { display: block; color: #dce5ee; font-size: .73rem; }

.overall-progress,
.unit-progress-cell { display: grid; place-items: center; min-height: 48px; border-radius: 8px; text-decoration: none; }
.overall-progress { min-width: 62px; color: #f0f5fa; background: rgba(255,255,255,.045); }
.overall-progress strong,
.unit-progress-cell strong { font-size: .73rem; }
.overall-progress span,
.unit-progress-cell span { margin-top: .12rem; color: #8896a5; font-size: .58rem; }
.unit-progress-cell { min-width: 48px; padding: .25rem; border: 1px solid transparent; }
.unit-progress-cell.complete { color: #91edb4; border-color: rgba(34,197,94,.22); background: rgba(34,197,94,.1); }
.unit-progress-cell.active { color: #9bc9ff; border-color: rgba(47,143,255,.24); background: rgba(47,143,255,.1); }
.unit-progress-cell.ready { color: #a7b2be; background: rgba(255,255,255,.035); }
.unit-progress-cell.unavailable { color: #485360; background: rgba(255,255,255,.018); }
.unit-progress-cell:hover,
.overall-progress:hover { border-color: rgba(215,25,32,.5); background: rgba(215,25,32,.09); }
.admin-table-help { margin: .7rem 0 0; color: #778594; font-size: .72rem; }

.student-detail-main .back-link { margin-bottom: 1.2rem; }
.admin-flash { margin-bottom: 1rem; padding: .85rem 1rem; border: 1px solid rgba(34,197,94,.3); border-radius: 10px; color: #a8efc2; background: rgba(34,197,94,.1); font-size: .84rem; }
.admin-flash.error { border-color: rgba(215,25,32,.4); color: #ffd1d3; background: rgba(215,25,32,.12); }
.student-unit-list { display: grid; gap: .8rem; }

.student-unit-card { scroll-margin-top: 1rem; overflow: hidden; border: 1px solid var(--border); border-radius: 13px; background: rgba(15,21,30,.9); }
.student-unit-card > header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; }
.student-unit-card h2 { display: inline; margin: 0 0 0 .6rem; font-size: 1rem; }
.unit-number-label { color: #ff777b; font-size: .65rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.unit-card-progress { display: flex; align-items: baseline; gap: .45rem; }
.unit-card-progress strong { color: #9cebb9; font-size: .9rem; }
.unit-card-progress span,
.not-published-label { color: #778594; font-size: .68rem; }

.admin-assignment-list { border-top: 1px solid var(--border); }
.admin-assignment-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid rgba(255,255,255,.065); }
.admin-assignment-row:last-child { border-bottom: 0; }
.assignment-status-icon { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; color: #8693a1; background: rgba(255,255,255,.055); font-size: .72rem; font-weight: 900; }
.admin-assignment-row.complete .assignment-status-icon { color: #082012; background: #5ce28e; }
.admin-assignment-row.active .assignment-status-icon { color: #cde5ff; background: rgba(47,143,255,.28); }
.assignment-admin-copy h3 { margin: 0; font-size: .84rem; }
.assignment-admin-copy p { margin: .25rem 0 0; color: #82909f; font-size: .68rem; }
.completion-badge { display: inline-flex; padding: .38rem .58rem; border-radius: 999px; color: #9cebb9; background: rgba(34,197,94,.1); font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.manual-complete-button { padding: .52rem .7rem; border: 1px solid rgba(34,197,94,.35); border-radius: 7px; color: #a8efc2; background: rgba(34,197,94,.1); font: inherit; font-size: .7rem; font-weight: 800; cursor: pointer; }
.manual-complete-button:hover { border-color: rgba(34,197,94,.7); background: rgba(34,197,94,.18); }
.saved-code-review { margin-top: .55rem; }
.saved-code-review summary { width: fit-content; color: #9bc9ff; font-size: .68rem; font-weight: 750; cursor: pointer; }
.saved-code-review pre { max-height: 320px; margin: .55rem 0 0; padding: .8rem; overflow: auto; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; color: #dce5ee; background: #090d12; font-size: .73rem; line-height: 1.5; }

.overview-lesson-main { padding: 2.25rem 0 5rem; }
.overview-titlebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.overview-titlebar h1 { font-size: clamp(2rem, 6vw, 3.7rem); }
.overview-titlebar > div > p:last-child { max-width: 720px; margin: .8rem 0 0; color: #aebac7; line-height: 1.6; }
.overview-titlebar .lesson-step-nav { flex: 0 0 auto; }
.lesson-nav-button.is-locked { pointer-events: none; }

.overview-content-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); align-items: start; gap: 1rem; }
.overview-reading-card,
.overview-video-card,
.overview-quiz-card { border: 1px solid var(--border); border-radius: 15px; background: rgba(16,22,32,.92); box-shadow: 0 16px 40px rgba(0,0,0,.18); }
.overview-reading-card { padding: 1.25rem; }
.overview-reading-card section { margin-top: 1.1rem; }
.overview-reading-card h2,
.overview-video-card h2,
.overview-quiz-card h2 { margin: 0; font-size: 1.05rem; }
.overview-reading-card section h2 { color: #eef3f8; }
.overview-reading-card section p { margin: .4rem 0 0; color: #aebac7; font-size: .88rem; line-height: 1.65; }
.overview-takeaway { margin-top: 1.2rem; padding: .9rem 1rem; border: 1px solid rgba(47,143,255,.25); border-radius: 10px; background: rgba(47,143,255,.08); }
.overview-takeaway strong { color: #9bc9ff; font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; }
.overview-takeaway p { margin: .35rem 0 0; color: #d7e3ee; font-size: .86rem; line-height: 1.55; }

.overview-activity-card { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-top: 1rem; padding: 1.15rem 1.25rem; border: 1px solid rgba(255,212,59,.25); border-radius: 15px; background: rgba(255,212,59,.06); box-shadow: 0 16px 40px rgba(0,0,0,.18); }
.overview-activity-card .panel-kicker { color: #ffd43b; }
.overview-activity-card h2 { margin: 0; font-size: 1.05rem; }
.overview-activity-card p { margin: .4rem 0 0; max-width: 560px; color: #aebac7; font-size: .86rem; line-height: 1.6; }
.overview-activity-card .quiz-continue-button { flex: 0 0 auto; background: #ffd43b; border-color: rgba(255,212,59,.4); color: #141414; }
.overview-activity-card .quiz-continue-button:hover { background: #ffe066; }
@media (max-width: 760px) { .overview-activity-card { flex-direction: column; align-items: flex-start; } }

.overview-video-card { padding: 1rem; }
.video-embed { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: #05070a; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.overview-video-card h2 { margin-top: .85rem; line-height: 1.35; }
.overview-video-card > p:not(.panel-kicker) { margin: .28rem 0 0; color: #7f8c9a; font-size: .74rem; }
.video-fallback-link { display: inline-flex; margin-top: .7rem; color: #9bc9ff; font-size: .74rem; font-weight: 750; text-decoration: none; }
.video-fallback-link:hover { color: #d5eaff; }

.journey-intro-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); align-items: start; gap: 1rem; }
.journey-guide-card,
.journey-tree-card { border: 1px solid var(--border); border-radius: 15px; background: rgba(16,22,32,.92); box-shadow: 0 16px 40px rgba(0,0,0,.18); }
.journey-guide-card { padding: 1.25rem; }
.journey-guide-card h2 { margin: 0; font-size: 1.22rem; }
.journey-guide-card > p:not(.panel-kicker) { margin: .55rem 0 0; color: #aebac7; font-size: .84rem; line-height: 1.6; }
.journey-guide-card ol { display: grid; gap: .55rem; margin: 1rem 0 0; padding-left: 1.25rem; color: #94a4b5; font-size: .8rem; line-height: 1.5; }
.journey-guide-card strong { color: #e8eff6; }

.journey-tree-card { margin-top: 1rem; padding: 1.25rem; overflow: hidden; }
.journey-tree-heading { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.journey-tree-heading h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 2rem); }
.journey-tree-heading > div > p:last-child { margin: .35rem 0 0; color: #8f9dab; font-size: .82rem; }
.journey-hint { flex: 0 0 auto; padding: .42rem .65rem; border: 1px solid rgba(47,143,255,.3); border-radius: 999px; color: #9bc9ff; background: rgba(47,143,255,.08); font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

.journey-map { position: relative; margin-top: 1rem; padding: 1rem; border: 1px solid rgba(255,255,255,.07); border-radius: 14px; background: radial-gradient(circle at 50% 45%, rgba(34,197,94,.11), transparent 42%), linear-gradient(180deg, rgba(47,143,255,.045), rgba(10,15,21,.4)); }
.journey-canopy { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; padding-bottom: 2rem; }
.journey-canopy::after { content: ''; position: absolute; right: 12%; bottom: .75rem; left: 12%; height: 2px; background: linear-gradient(90deg, transparent, rgba(87,187,120,.65) 12%, rgba(87,187,120,.65) 88%, transparent); }
.journey-branch { --branch-color: #68cc8a; position: relative; min-width: 0; padding: .9rem; border: 1px solid color-mix(in srgb, var(--branch-color) 42%, transparent); border-top: 3px solid var(--branch-color); border-radius: 11px; background: rgba(7,13,18,.78); }
.journey-branch:nth-child(7n + 2) { --branch-color: #62a9ef; }
.journey-branch:nth-child(7n + 3) { --branch-color: #a98eea; }
.journey-branch:nth-child(7n + 4) { --branch-color: #ef7d83; }
.journey-branch:nth-child(7n + 5) { --branch-color: #e8b45f; }
.journey-branch:nth-child(7n + 6) { --branch-color: #5bc7c1; }
.journey-branch:nth-child(7n + 7) { --branch-color: #dd80bd; }
.journey-branch::after { content: ''; position: absolute; left: 50%; bottom: -1.6rem; width: 2px; height: 1.6rem; background: color-mix(in srgb, var(--branch-color) 58%, transparent); }
.journey-branch-heading { display: flex; align-items: flex-start; gap: .65rem; min-height: 88px; }
.journey-branch-heading > span { display: grid; flex: 0 0 auto; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: color-mix(in srgb, var(--branch-color) 14%, transparent); font-size: 1rem; }
.journey-branch-heading h3 { margin: 0; color: #f2f6fa; font-size: .92rem; line-height: 1.25; }
.journey-branch-heading p { margin: .3rem 0 0; color: #82919f; font-size: .68rem; line-height: 1.45; }
.journey-leaves { display: flex; flex-wrap: wrap; gap: .36rem; margin-top: .65rem; }
.journey-leaf,
.journey-roots button { padding: .4rem .52rem; border: 1px solid color-mix(in srgb, var(--branch-color, #68cc8a) 28%, transparent); border-radius: 999px; color: #c6d2dc; background: color-mix(in srgb, var(--branch-color, #68cc8a) 8%, #0a1016); font: inherit; font-size: .65rem; line-height: 1.25; cursor: pointer; transition: transform .15s, color .15s, border-color .15s, background .15s; }
.journey-leaf:hover,
.journey-leaf:focus-visible,
.journey-leaf.is-active { transform: translateY(-2px); border-color: var(--branch-color); color: #fff; background: color-mix(in srgb, var(--branch-color) 19%, #0a1016); outline: none; }

.journey-trunk { position: relative; display: grid; justify-items: center; margin-top: -.1rem; }
.journey-trunk::before { content: ''; width: 2px; height: 1.35rem; background: rgba(87,187,120,.65); }
.journey-stage { position: relative; z-index: 1; display: grid; min-width: 230px; padding: .7rem 1.1rem; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; color: #fff; font: inherit; text-align: center; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.journey-stage small { font-size: .59rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; opacity: .72; }
.journey-stage strong { margin-top: .1rem; font-size: 1.22rem; }
.journey-stage span { margin-top: .08rem; font-size: .68rem; opacity: .75; }
.journey-stage.coding-two { background: linear-gradient(135deg, #155f86, #263f78); }
.journey-stage.coding-one { background: linear-gradient(135deg, #9f151b, #d71920); box-shadow: 0 8px 24px rgba(215,25,32,.2); }
.journey-stage:hover,
.journey-stage:focus-visible,
.journey-stage.is-active { transform: scale(1.025); border-color: rgba(255,255,255,.5); box-shadow: 0 8px 28px rgba(0,0,0,.32); outline: none; }
.journey-trunk-line { width: 11px; height: 2rem; background: linear-gradient(90deg, #4c2b18, #98613c 48%, #4c2b18); }
.journey-roots { position: relative; display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)); gap: .55rem; width: min(680px, 100%); margin-top: 1.5rem; }
.journey-roots::before { content: ''; position: absolute; top: -1.5rem; left: 50%; width: 72%; height: 1.5rem; border-top: 2px solid rgba(154,102,62,.8); border-right: 2px solid rgba(154,102,62,.8); border-left: 2px solid rgba(154,102,62,.8); border-radius: 50% 50% 0 0; transform: translateX(-50%); }
.journey-roots button { --branch-color: #b47a51; border-radius: 8px; }
.journey-roots button:hover,
.journey-roots button:focus-visible,
.journey-roots button.is-active { transform: translateY(2px); border-color: #d69a6d; color: #fff; background: rgba(180,122,81,.18); outline: none; }

.journey-detail { display: flex; align-items: flex-start; gap: .8rem; min-height: 88px; margin-top: 1rem; padding: 1rem; border: 1px solid rgba(47,143,255,.3); border-radius: 11px; background: linear-gradient(135deg, rgba(47,143,255,.11), rgba(34,197,94,.06)); }
.journey-detail-icon { display: grid; flex: 0 0 auto; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: #dcecff; background: rgba(47,143,255,.18); }
.journey-detail strong { color: #f2f7fb; font-size: .92rem; }
.journey-detail p { margin: .28rem 0 0; color: #acbbc9; font-size: .8rem; line-height: 1.55; }
.journey-reality-note { margin: .7rem .2rem 0; color: #71808f; font-size: .68rem; line-height: 1.5; }

/* The pathways view uses a route map instead of a literal career tree. */
.journey-map { display: grid; grid-template-columns: 1fr; gap: 1.2rem; align-items: start; background: radial-gradient(circle at 50% 12%, rgba(47,143,255,.1), transparent 30%), linear-gradient(135deg, rgba(10,15,21,.58), rgba(17,27,36,.72)); }
.journey-canopy { grid-column: 1; grid-row: 2; grid-template-columns: 1fr; gap: .65rem; padding: 0; }
.journey-canopy::after,
.journey-branch::after { display: none; }
.journey-routes-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding: .25rem .15rem .6rem; border-bottom: 1px solid rgba(255,255,255,.08); color: #eaf1f7; font-size: 1.15rem; font-weight: 850; letter-spacing: -.01em; text-transform: none; }
.journey-routes-heading strong { color: #c6d2dc; font-size: .7rem; letter-spacing: 0; text-transform: none; }
.journey-branch { display: grid; grid-template-columns: minmax(225px, .72fr) minmax(0, 1.28fr); align-items: center; gap: .8rem; padding: .78rem .85rem; border-top: 1px solid color-mix(in srgb, var(--branch-color) 35%, transparent); border-left: 4px solid var(--branch-color); }
.journey-branch-heading { min-height: 0; }
.journey-branch-heading p { max-width: 340px; }
.journey-leaves { margin-top: 0; }
.journey-trunk { grid-column: 1; grid-row: 1; position: static; display: grid; grid-template-columns: minmax(180px, 1fr) 42px minmax(180px, 1fr) 42px minmax(220px, 1.15fr); align-items: center; justify-items: stretch; gap: .55rem; margin: 0; padding: 1rem; border: 1px solid rgba(47,143,255,.2); border-radius: 12px; background: linear-gradient(90deg, rgba(23,40,57,.94), rgba(9,15,21,.96)); }
.journey-trunk::before { display: none; }
.journey-route-label { grid-column: 1 / -1; margin: 0 0 .15rem; color: #8ab9e5; font-size: .68rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.journey-stage { width: 100%; min-width: 0; }
.journey-trunk-line { position: relative; width: 100%; height: 2px; background: linear-gradient(90deg, #d71920, #408bc2); }
.journey-trunk-line::after { content: '▶'; position: absolute; top: 50%; right: -.25rem; color: #70aee0; font-size: .55rem; transform: translateY(-50%); }
.journey-trunk-line.toolkit-line { background: linear-gradient(90deg, #408bc2, #67df93); }
.journey-toolkit { display: grid; align-content: center; gap: .2rem; width: 100%; min-height: 82px; margin: 0; padding: .72rem; border: 1px dashed rgba(103,223,147,.32); border-radius: 9px; text-align: center; background: rgba(34,197,94,.055); }
.journey-toolkit small { color: #7da58b; font-size: .58rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.journey-toolkit strong { color: #c4e8d0; font-size: .72rem; }
.journey-roots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; width: 100%; margin-top: .7rem; }
.journey-roots::before { display: none; }
.journey-roots button { padding: .38rem .35rem; font-size: .61rem; }
.journey-route-note { grid-column: 1 / -1; margin: .25rem 0 0; color: #728292; font-size: .65rem; line-height: 1.5; text-align: center; }
.journey-detail { border-left: 4px solid var(--blue); }
.journey-exit-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding: 1rem 1.15rem; border: 1px solid rgba(103,223,147,.25); border-radius: 13px; background: rgba(34,197,94,.065); }
.journey-exit-card > div { display: grid; gap: .2rem; }
.journey-exit-card strong { color: #baf1ce; font-size: .88rem; }
.journey-exit-card span { color: #829b8b; font-size: .74rem; line-height: 1.45; }
.journey-exit-card .quiz-continue-button { flex: 0 0 auto; }

.overview-quiz-card { margin-top: 1rem; padding: 1.25rem; }
.overview-quiz-card > h2 { font-size: 1.25rem; }
.quiz-intro { margin: .45rem 0 1rem; color: #8f9dab; font-size: .82rem; }
.quiz-feedback { margin: 0 0 1rem; padding: .75rem .85rem; border: 1px solid rgba(245,158,11,.35); border-radius: 9px; color: #f3d79c; background: rgba(245,158,11,.09); font-size: .8rem; }
.quiz-feedback.error { border-color: rgba(215,25,32,.4); color: #ffd1d3; background: rgba(215,25,32,.1); }
.quiz-question { margin: 0; padding: 1rem 0; border: 0; border-top: 1px solid rgba(255,255,255,.08); }
.quiz-question.is-incorrect { margin: 0 -.7rem; padding: 1rem .7rem; border-radius: 9px; background: rgba(245,158,11,.07); }
.quiz-question legend { display: flex; align-items: center; gap: .55rem; width: 100%; color: #e7edf4; font-size: .87rem; font-weight: 750; }
.quiz-question legend span { display: grid; flex: 0 0 auto; width: 24px; height: 24px; place-items: center; border-radius: 50%; color: #ffb2b5; background: rgba(215,25,32,.16); font-size: .68rem; }
.quiz-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-top: .7rem; }
.quiz-options label { display: flex; align-items: center; gap: .55rem; min-height: 46px; padding: .65rem .75rem; border: 1px solid rgba(255,255,255,.09); border-radius: 8px; color: #aebac7; background: rgba(255,255,255,.025); font-size: .78rem; cursor: pointer; }
.quiz-options label:has(input:checked) { border-color: rgba(47,143,255,.48); color: #e1edf9; background: rgba(47,143,255,.1); }
.quiz-options input { accent-color: var(--blue); }
.quiz-submit-button,
.quiz-continue-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .7rem 1rem; border: 1px solid rgba(34,197,94,.4); border-radius: 8px; color: #082012; background: #67df93; font: inherit; font-size: .8rem; font-weight: 850; text-decoration: none; cursor: pointer; }
.quiz-submit-button:hover,
.quiz-continue-button:hover { background: #82e8a7; }
.quiz-complete-message { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1rem 0; padding: .9rem 1rem; border: 1px solid rgba(34,197,94,.3); border-radius: 10px; color: #a8efc2; background: rgba(34,197,94,.09); }
.quiz-complete-message span { color: #8ba798; font-size: .78rem; }

.lesson-page { height: 100vh; overflow: hidden; }
.lesson-page .topbar { min-height: 64px; height: 64px; }
.lesson-page .brand img { width: 40px; height: 40px; }

.lesson-main {
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0 1rem;
}

.lesson-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 0 0 auto;
  margin-bottom: .9rem;
}

.lesson-titlebar .eyebrow { margin-bottom: .25rem; }
.lesson-titlebar h1 { font-size: clamp(1.45rem, 3vw, 2.2rem); letter-spacing: -.035em; }

.lesson-title-actions { display: flex; align-items: center; gap: .65rem; }
.lesson-step-nav { display: flex; align-items: center; gap: .4rem; }

.lesson-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: .5rem .72rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: #d7e0e9;
  background: rgba(255,255,255,.045);
  font-size: .72rem;
  font-weight: 800;
  text-decoration: none;
}

.lesson-nav-button:hover { border-color: rgba(47,143,255,.55); background: rgba(47,143,255,.09); }
.lesson-nav-button.next:not(.is-locked) { border-color: rgba(34,197,94,.35); color: #a7f3c0; background: rgba(34,197,94,.09); }
.lesson-nav-button.is-locked { color: #687482; background: rgba(255,255,255,.025); cursor: not-allowed; opacity: .7; }

.save-status {
  flex: 0 0 auto;
  padding: .4rem .7rem;
  border-radius: 999px;
  color: #aab6c4;
  background: rgba(255,255,255,.055);
  font-size: .69rem;
  font-weight: 800;
}

.save-status[data-state="complete"] { color: #8de8b1; background: rgba(34,197,94,.12); }
.save-status[data-state="error"] { color: #ffb7ba; background: rgba(215,25,32,.12); }

.lesson-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: .85rem;
  flex: 1 1 auto;
}

.instruction-panel,
.coding-lab {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15,21,30,.94);
}

.instruction-scroll { height: 100%; overflow-y: auto; padding: 1.25rem; }
.panel-kicker { margin: 0 0 .35rem; color: #ff777b; font-size: .66rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.instruction-panel h2 { margin: 0; font-size: 1.45rem; }
.instruction-panel h3 { margin: 1.35rem 0 .55rem; font-size: .9rem; }
.instruction-panel p, .instruction-panel li { color: #b4c0cd; font-size: .82rem; line-height: 1.6; }
.learning-goals ul, .challenge-card ol { margin: .45rem 0 0; padding-left: 1.25rem; }
.learning-goals li + li, .challenge-card li + li { margin-top: .3rem; }

.command-guide { display: grid; grid-template-columns: auto 1fr; gap: .55rem .7rem; align-items: center; }
.command-guide code { padding: .3rem .45rem; border: 1px solid rgba(47,143,255,.2); border-radius: 5px; color: #9ed0ff; background: rgba(47,143,255,.08); font-size: .76rem; }
.command-guide span { color: #9ca9b7; font-size: .76rem; }

.challenge-card { margin-top: 1.4rem; padding: 1rem; border: 1px solid rgba(215,25,32,.3); border-radius: 11px; background: rgba(215,25,32,.075); }
.challenge-card h3 { margin: 0; color: #fff; font-size: 1rem; }
.challenge-card p:last-child { margin-bottom: 0; }

.outcome-example {
  margin: 1rem 0 0;
  padding: .85rem;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 11px;
  background: rgba(255,255,255,.045);
}

.outcome-example figcaption { display: grid; gap: .08rem; margin-bottom: .7rem; }
.outcome-example figcaption .panel-kicker { margin: 0; }
.outcome-example figcaption strong { font-size: .86rem; }
.outcome-example svg { display: block; width: 100%; height: auto; max-height: 155px; border-radius: 9px; }
.outcome-example > p { margin: .6rem 0 0; color: #98a6b5; font-size: .72rem; line-height: 1.45; }

.idea-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-top: 1.1rem; }
.idea-card { margin: 0; padding: .6rem; border: 1px solid rgba(255,255,255,.13); border-radius: 10px; background: rgba(255,255,255,.045); }
.idea-card svg { display: block; width: 100%; height: auto; border-radius: 7px; }
.idea-card figcaption { margin-top: .45rem; color: #98a6b5; font-size: .66rem; line-height: 1.4; }
.idea-gallery-note { margin: .6rem 0 0; color: #98a6b5; font-size: .72rem; line-height: 1.45; }
@media (max-width: 640px) {
  .idea-gallery { grid-template-columns: 1fr; }
}

.preview-note { margin-top: 1rem; padding: .85rem 1rem; border: 1px solid rgba(47,143,255,.32); border-radius: 11px; background: rgba(47,143,255,.075); }
.preview-note strong { display: block; margin-bottom: .3rem; color: #cfe6ff; font-size: .8rem; }
.preview-note p { margin: 0; color: #a9c3dc; font-size: .78rem; line-height: 1.55; }

.check-feedback { display: grid; gap: .25rem; margin-top: 1rem; padding: .9rem 1rem; border: 1px solid rgba(245,158,11,.35); border-radius: 10px; color: #ffe0a3; background: rgba(245,158,11,.1); font-size: .8rem; }
.check-feedback[hidden] { display: none; }
.check-feedback span { color: #d4c5a8; line-height: 1.5; }

.success-card { display: grid; gap: .25rem; margin-top: 1rem; padding: .9rem 1rem; border: 1px solid rgba(34,197,94,.35); border-radius: 10px; color: #a7f3c0; background: rgba(34,197,94,.1); font-size: .8rem; }
.success-card[hidden] { display: none; }
.success-card span { color: #b8c9bf; line-height: 1.45; }
.success-card a { justify-self: start; margin-top: .4rem; color: #b6f5ca; font-weight: 800; text-decoration: none; }
.success-card a:hover { color: #fff; }

.efficiency-feedback { display: grid; gap: .3rem; margin-top: 1rem; padding: .9rem 1rem; border: 1px solid rgba(47,143,255,.35); border-radius: 10px; color: #b9dcff; background: rgba(47,143,255,.1); font-size: .8rem; }
.efficiency-feedback[hidden] { display: none; }
.efficiency-feedback span { color: #b7c7d8; line-height: 1.5; }

.coding-lab { display: flex; flex-direction: column; }
.lab-toolbar { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .45rem .6rem .45rem 1rem; border-bottom: 1px solid var(--border); background: #111923; }
.lab-tabs { align-self: stretch; display: flex; align-items: center; color: #c9d3dd; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .76rem; }
.lab-tabs .active { height: 100%; display: flex; align-items: center; border-bottom: 2px solid var(--red); }
.lab-actions { display: flex; gap: .4rem; }

.lab-button { min-height: 36px; padding: .45rem .75rem; border: 1px solid transparent; border-radius: 7px; font: inherit; font-size: .73rem; font-weight: 800; cursor: pointer; }
.lab-button:disabled { cursor: not-allowed; opacity: .45; }
.lab-button.run { color: #fff; background: linear-gradient(135deg, #b41319, var(--red)); }
.lab-button.run:hover:not(:disabled) { background: #ef2830; }
.lab-button.check { color: #07160d; background: linear-gradient(135deg, #45c977, #7ce6a3); }
.lab-button.check:hover:not(:disabled) { background: #91edb3; }
.lab-button.secondary, .lab-button.stop { color: #c3ced9; border-color: var(--border); background: rgba(255,255,255,.045); }
.lab-button.stop { color: #ffb8ba; }

.lab-grid { min-height: 0; display: grid; grid-template-columns: minmax(320px, .9fr) minmax(380px, 1.1fr); flex: 1 1 auto; }
.editor-pane, .result-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.editor-pane { border-right: 1px solid var(--border); }
.pane-label { min-height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 .8rem; border-bottom: 1px solid var(--border); color: #82909e; background: #0c1219; font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.runtime-label { color: #5f6e7e; }

.editor-wrap { position: relative; min-height: 0; display: grid; grid-template-columns: 48px 1fr; flex: 1 1 auto; overflow: hidden; background: #0a0f15; }
.line-numbers, #code-editor { margin: 0; padding: 1rem 0; border: 0; font: 14px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; tab-size: 4; }
.line-numbers { overflow: hidden; padding-right: .75rem; color: #4f5b68; background: #090d12; text-align: right; user-select: none; }
#code-editor { width: 100%; height: 100%; resize: none; outline: none; padding-right: 1rem; padding-left: 1rem; color: #e6edf3; caret-color: #ff5a60; background: #0a0f15; white-space: pre; overflow: auto; }
#code-editor::selection { background: rgba(47,143,255,.3); }
.editor-wrap.is-codemirror { display: block; }
.editor-wrap.is-codemirror > .line-numbers { display: none; }
.codemirror-host { width: 100%; height: 100%; overflow: hidden; }
.codemirror-host .cm-editor { height: 100%; }

.turtle-canvas { min-height: 320px; flex: 1 1 auto; overflow: hidden; background-color: #fff; background-image: linear-gradient(#eef1f4 1px, transparent 1px), linear-gradient(90deg, #eef1f4 1px, transparent 1px); background-size: 24px 24px; }
.turtle-canvas canvas { display: block; max-width: 100%; }
.console-panel { flex: 0 0 122px; min-height: 0; border-top: 1px solid var(--border); background: #080c11; }
.console-title { padding: .4rem .75rem; border-bottom: 1px solid rgba(255,255,255,.06); color: #687685; font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
#program-output { height: 82px; margin: 0; overflow: auto; padding: .65rem .75rem; color: #b5c1cd; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre-wrap; }

.sandbox-page { height: 100vh; overflow: hidden; }
.sandbox-page .topbar { min-height: 64px; height: 64px; }
.sandbox-page .brand img { width: 40px; height: 40px; }
.sandbox-main { height: calc(100vh - 64px); display: flex; flex-direction: column; padding: 1rem 0; }
.sandbox-titlebar { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; flex: 0 0 auto; margin-bottom: .8rem; }
.sandbox-titlebar .eyebrow { margin-bottom: .2rem; }
.sandbox-titlebar h1 { font-size: clamp(1.5rem, 3vw, 2.15rem); letter-spacing: -.035em; }
.sandbox-titlebar > p { max-width: 560px; margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.5; text-align: right; }
.sandbox-lab { flex: 1 1 auto; }
.sandbox-lab .lab-grid { grid-template-columns: minmax(320px, .72fr) minmax(520px, 1.28fr); }
.sandbox-lab .console-panel { flex-basis: 108px; }
.sandbox-lab #program-output { height: 68px; }

/* Admin lesson answer key */
.answer-key-heading { margin-bottom: 1rem; }
.answer-key-layout { display: grid; grid-template-columns: minmax(260px, 330px) minmax(0, 1fr); align-items: start; gap: 1rem; }
.answer-key-nav,
.answer-key-detail { border: 1px solid var(--border); border-radius: 14px; background: rgba(15,21,30,.94); }
.answer-key-nav { position: sticky; top: 1rem; max-height: calc(100vh - 95px); overflow-y: auto; padding: .8rem; }
.answer-key-nav section + section { margin-top: 1rem; }
.answer-key-nav h2 { margin: 0 0 .45rem; padding: 0 .35rem; color: #8d9aa8; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.answer-key-links { display: grid; gap: .28rem; }
.answer-key-links a { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: .45rem; min-height: 44px; padding: .48rem .55rem; border: 1px solid transparent; border-radius: 8px; color: #c2ccd6; text-decoration: none; }
.answer-key-links a:hover { border-color: rgba(47,143,255,.28); background: rgba(47,143,255,.06); }
.answer-key-links a.current { border-color: rgba(215,25,32,.4); color: #fff; background: rgba(215,25,32,.1); }
.answer-key-links a span { color: #ff8589; font: 750 .7rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.answer-key-links a strong { overflow: hidden; font-size: .75rem; line-height: 1.3; text-overflow: ellipsis; }
.answer-key-detail { min-width: 0; padding: 1.25rem; }
.answer-key-detail > header { position: relative; padding-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.answer-key-detail > header h2 { margin: .25rem 0 0; font-size: clamp(1.45rem, 3vw, 2.2rem); }
.answer-key-badge { display: inline-flex; margin-top: .65rem; padding: .32rem .55rem; border: 1px solid rgba(34,197,94,.3); border-radius: 999px; color: #9ce9b8; background: rgba(34,197,94,.08); font-size: .66rem; font-weight: 800; }
.answer-key-panel { margin-top: 1rem; padding: 1rem; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; background: rgba(255,255,255,.025); }
.answer-key-panel.grading { border-color: rgba(47,143,255,.25); background: rgba(47,143,255,.06); }
.answer-key-panel.warning { border-color: rgba(245,158,11,.3); background: rgba(245,158,11,.07); }
.answer-key-panel h3,
.answer-key-quiz h3 { margin: 0; color: #eef3f8; font-size: .92rem; }
.answer-key-panel p { margin: .45rem 0 0; color: #aebac7; font-size: .8rem; line-height: 1.6; }
.answer-key-code-panel { margin-top: 1rem; overflow: hidden; border: 1px solid rgba(255,255,255,.11); border-radius: 11px; background: #080d12; }
.answer-key-code-panel > div { display: flex; align-items: center; justify-content: space-between; padding: .65rem .85rem; border-bottom: 1px solid rgba(255,255,255,.08); background: #111923; }
.answer-key-code-panel h3 { margin: 0; font-size: .86rem; }
.answer-key-code-panel > div span { color: #718090; font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.answer-key-code-panel pre { max-height: 620px; margin: 0; overflow: auto; padding: 1rem; color: #dce7f0; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 4; white-space: pre; }
.answer-key-quiz { margin-top: 1rem; }
.answer-key-quiz ol { display: grid; gap: .6rem; margin: .65rem 0 0; padding: 0; list-style: none; counter-reset: answer-question; }
.answer-key-quiz li { display: grid; grid-template-columns: 1fr; gap: .4rem; padding: .85rem; border: 1px solid rgba(255,255,255,.09); border-radius: 9px; background: rgba(255,255,255,.025); counter-increment: answer-question; }
.answer-key-quiz li span { color: #b4c0cd; font-size: .8rem; line-height: 1.45; }
.answer-key-quiz li span::before { content: counter(answer-question) '. '; color: #ff777b; font-weight: 850; }
.answer-key-quiz li strong { color: #9ce9b8; font-size: .8rem; }
.answer-key-checklist { margin-top: 1rem; padding: 1rem; border: 1px solid rgba(34,197,94,.28); border-radius: 10px; background: rgba(34,197,94,.06); }
.answer-key-checklist h3 { margin: 0; color: #c6f3d6; font-size: .92rem; }
.answer-key-checklist ul { display: grid; gap: .5rem; margin: .75rem 0 0; padding: 0; list-style: none; }
.answer-key-checklist li { position: relative; padding-left: 1.4rem; color: #b6c7bc; font-size: .8rem; line-height: 1.45; }
.answer-key-checklist li::before { content: '✓'; position: absolute; left: 0; color: #67df93; font-weight: 900; }

@media (max-width: 760px) {
  .course-heading { align-items: flex-start; flex-direction: column; gap: 1.15rem; }
  .verified-user { width: 100%; }
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .course-card { padding: 1rem; border-radius: 14px; }
  .course-card h2 { font-size: clamp(.92rem, 4.3vw, 1.15rem); }
  .progress-summary span { font-size: .6rem; }
  .module-heading { grid-template-columns: 1fr; gap: 1.25rem; }
  .module-progress-card { max-width: none; }
  .lesson-row { grid-template-columns: 34px 44px minmax(0, 1fr); }
  .lesson-state { grid-column: 3; justify-self: start; margin-top: .3rem; }
}

@media (max-width: 1100px) {
  .lesson-page { height: auto; overflow: auto; }
  .lesson-main { height: auto; min-height: calc(100vh - 64px); }
  .lesson-workspace { grid-template-columns: 1fr; }
  .instruction-panel { max-height: none; }
  .coding-lab { min-height: 760px; }
  .overview-content-grid { grid-template-columns: 1fr; }
  .journey-intro-grid { grid-template-columns: 1fr; }
  .journey-map { grid-template-columns: 1fr; }
  .journey-trunk { grid-column: 1; grid-row: 1; position: static; }
  .journey-canopy { grid-column: 1; grid-row: 2; grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .shell-wide { width: min(100% - 1rem, 1760px); }
  .lesson-page .topbar { height: auto; min-height: 64px; padding: .5rem 0; }
  .sandbox-page { height: auto; overflow: auto; }
  .sandbox-page .topbar { height: auto; min-height: 64px; padding: .5rem 0; }
  .sandbox-main { height: auto; min-height: calc(100vh - 64px); }
  .sandbox-titlebar { align-items: flex-start; flex-direction: column; gap: .35rem; }
  .sandbox-titlebar > p { text-align: left; }
  .sandbox-lab { min-height: 850px; }
  .lesson-titlebar { align-items: flex-start; }
  .lesson-title-actions { align-items: flex-end; flex-direction: column; }
  .lab-toolbar { align-items: flex-start; flex-direction: column; padding: .65rem; }
  .lab-tabs { min-height: 28px; }
  .lab-actions { width: 100%; }
  .lab-button { flex: 1; }
  .lab-grid { grid-template-columns: 1fr; }
  .editor-pane { min-height: 360px; border-right: 0; border-bottom: 1px solid var(--border); }
  .result-pane { min-height: 500px; }
  .admin-heading,
  .student-detail-heading { align-items: flex-start; flex-direction: column; }
  .admin-count,
  .student-overall-card { width: 100%; max-width: none; }
  .admin-assignment-row { grid-template-columns: 30px minmax(0, 1fr); }
  .assignment-admin-action { grid-column: 2; }
  .test-student-banner { align-items: flex-start; flex-direction: column; }
  .overview-titlebar { align-items: flex-start; flex-direction: column; }
  .overview-titlebar .lesson-step-nav { width: 100%; }
  .overview-titlebar .lesson-nav-button { flex: 1; }
  .quiz-options { grid-template-columns: 1fr; }
  .quiz-complete-message { align-items: flex-start; flex-direction: column; }
  .journey-tree-heading { align-items: flex-start; flex-direction: column; gap: .65rem; }
  .journey-map { padding: .7rem; }
  .journey-canopy { grid-template-columns: 1fr; }
  .journey-canopy::after,
  .journey-branch::after { display: none; }
  .journey-trunk { margin-top: .8rem; }
  .journey-trunk { grid-template-columns: 1fr; justify-items: stretch; }
  .journey-route-label,
  .journey-route-note { grid-column: 1; }
  .journey-trunk-line { justify-self: center; width: 2px; height: 1.8rem; background: linear-gradient(#d71920, #408bc2); }
  .journey-trunk-line.toolkit-line { background: linear-gradient(#408bc2, #67df93); }
  .journey-trunk-line::after { content: '▼'; top: auto; right: auto; bottom: -.3rem; left: 50%; transform: translateX(-50%); }
  .journey-branch { grid-template-columns: 1fr; }
  .journey-leaves { margin-top: .25rem; }
  .journey-routes-heading { align-items: flex-start; flex-direction: column; gap: .25rem; }
  .journey-exit-card { align-items: flex-start; flex-direction: column; }
  .answer-key-layout { grid-template-columns: 1fr; }
  .answer-key-nav { position: static; max-height: 380px; }
}

@media (max-width: 520px) {
  .lesson-titlebar { flex-direction: column; }
  .lesson-title-actions { width: 100%; align-items: stretch; }
  .lesson-step-nav { width: 100%; }
  .lesson-nav-button { flex: 1; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 1.25rem, 1060px); }
  .topbar { min-height: 64px; }
  .brand img { width: 40px; height: 40px; }
  .button { padding: .55rem .7rem; }
  .page-center { min-height: calc(100vh - 65px); padding: 1.5rem 0 3rem; }
  .profile { align-items: flex-start; }
  .module-main { padding-top: 1.5rem; }
  .lesson-row { grid-template-columns: 1fr; gap: .55rem; padding: 1rem; }
  .lesson-icon, .lesson-number, .lesson-state { grid-column: 1; }
  .lesson-state { text-align: left; }
}

@media (max-width: 380px) {
  .course-grid { grid-template-columns: 1fr; }
}
