:root {
  color-scheme: light;
  --plum-950: #24150f;
  --plum-900: #3b2419;
  --plum-700: #6b3f2a;
  --violet-700: #8a3f22;
  --teal-800: #17685d;
  --teal-700: #23786b;
  --mint-300: #9fd0a6;
  --mint-100: #edf5e8;
  --coral-700: #b6402b;
  --amber-300: #f4b942;
  --cream: #f6eedc;
  --paper: #fffdf7;
  --ink: #2d211a;
  --muted: #66584f;
  --line: #b9aa99;
  --soft-line: #ded2c2;
  --code-bg: #201713;
  --code-surface: #34251f;
  --code-ink: #fff8e8;
  --focus: #17685d;
  --danger: #9d2f24;
  --success: #176142;
  --topbar-height: 61px;
  font-family: "Trebuchet MS", Aptos, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; overflow-y: auto; background: var(--cream); color: var(--ink); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button, a, input { touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .55; }

.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;
}

.skip-link {
  position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-150%);
  border: 3px solid var(--amber-300); border-radius: 8px; padding: 10px 16px;
  background: var(--paper); color: var(--ink); font-weight: 900; text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

:where(a, button, input, textarea):focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--plum-950);
}

.topbar {
  position: sticky; z-index: 30; top: 0; display: grid;
  grid-template-columns: auto auto minmax(260px, 1fr) auto;
  align-items: center; min-height: var(--topbar-height); padding: 7px 12px;
  background: var(--plum-900); color: white; border-bottom: 4px solid var(--mint-300);
}

.wordmark {
  color: white; font-family: "Trebuchet MS", sans-serif; font-size: 1.42rem;
  font-weight: 400; letter-spacing: -.04em; text-decoration: none;
}
.wordmark span:first-child { color: var(--mint-300); font-family: ui-monospace, monospace; font-weight: 900; letter-spacing: -.08em; }
.wordmark span:last-child { margin-left: 5px; color: var(--amber-300); font-size: .8em; }
.global-search {
  justify-self: start; display: flex; align-items: center; gap: 8px; width: min(470px, 40vw);
  min-height: 44px; border: 2px solid #8f7ba0; border-radius: 12px; padding: 7px 12px;
  background: #3d2551;
}
.global-search:focus-within { border-color: var(--mint-300); }
.global-search input { width: 100%; border: 0; outline: 0; background: transparent; color: white; }
.global-search input:focus-visible { box-shadow: none; }
.global-search input::placeholder { color: #e8dff0; opacity: 1; }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 9px; }
.icon-button, .nav-button, .sign-in-button {
  min-width: 44px; min-height: 44px; border: 2px solid white; border-radius: 10px;
  background: transparent; color: white; font-weight: 800;
}
.icon-button { font-size: 1.15rem; }
.nav-button { padding: 0 15px; }
.cohort-nav { display: inline-flex; align-items: center; border-color: var(--amber-300); background: var(--amber-300); color: var(--ink); text-decoration: none; }
.sign-in-button { border-color: var(--mint-300); padding: 0 18px; background: var(--mint-300); color: var(--ink); }
.nav-button:hover, .icon-button:hover { background: #4a2b61; }
.sign-in-button:hover { background: #b4f0da; }
.account-menu { position: relative; }
.account-button {
  display: flex; align-items: center; gap: 8px; min-height: 44px; border: 2px solid var(--mint-300);
  border-radius: 10px; padding: 0 12px; background: transparent; color: white; font-weight: 800;
}
.account-button img, .account-button > span:first-of-type { width: 28px; height: 28px; border-radius: 50%; }
.account-button img { object-fit: cover; }
.account-button > span:first-of-type { display: grid; place-items: center; background: var(--amber-300); color: var(--ink); font-weight: 900; }
.sign-out-button {
  position: absolute; top: 50px; right: 0; z-index: 40; width: 140px; min-height: 44px;
  border: 2px solid var(--plum-900); border-radius: 9px; padding: 10px;
  background: white; color: var(--ink); box-shadow: 0 10px 34px rgba(23, 11, 36, .28); font-weight: 800;
}
.menu-button { display: inline-block; margin-right: 4px; }
.close-menu { display: block; border-color: var(--plum-900); color: var(--plum-900); }
.mobile-search { display: none; }

.platform-shell { display: grid; grid-template-columns: minmax(0, 1fr); height: calc(100vh - var(--topbar-height)); height: calc(100dvh - var(--topbar-height)); min-height: 560px; overflow: hidden; align-items: stretch; }
.curriculum {
  position: fixed; z-index: 25; inset: var(--topbar-height) auto 0 0; display: flex; flex-direction: column; min-width: 0;
  width: min(380px, 92vw); height: calc(100vh - var(--topbar-height)); height: calc(100dvh - var(--topbar-height)); overflow: hidden;
  transform: translateX(-101%); transition: transform .2s ease; border-right: 2px solid var(--soft-line); background: var(--paper); box-shadow: 18px 0 45px rgba(23, 11, 36, .24);
}
.curriculum.is-open { transform: translateX(0); }
.curriculum-head { display: flex; justify-content: space-between; padding: 22px 20px 17px; border-bottom: 1px solid var(--soft-line); background: linear-gradient(135deg, var(--mint-100), white 72%); }
.overline { margin: 0 0 8px; color: var(--coral-700); font-size: .73rem; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.curriculum h1 { margin: 0; color: var(--plum-900); font-size: 1.14rem; line-height: 1.35; }
.track-switcher {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 11px 12px;
  border-bottom: 1px solid var(--soft-line); background: var(--cream);
}
.track-button {
  min-height: 44px; border: 2px solid var(--plum-700); border-radius: 9px; padding: 0 5px;
  background: white; color: var(--plum-700); font-size: .76rem; font-weight: 900;
}
.track-button:hover { background: var(--mint-100); }
.track-button.is-active { border-color: var(--plum-700); background: var(--plum-700); color: white; }
.track-button.is-active::before { content: "✓ "; color: var(--mint-300); }
.curriculum-filter-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; padding: 18px 20px 15px; }
.filter-field { display: grid; gap: 6px; font-size: .78rem; color: var(--muted); }
.filter-field span { font-weight: 800; color: var(--plum-900); }
.filter-field input,
.filter-field select { width: 100%; min-height: 44px; border: 2px solid #d3c8dc; border-radius: 10px; padding: 0 12px; background: white; color: var(--ink); }
.progress-card { padding: 15px 20px 18px; border-bottom: 1px solid var(--soft-line); }
.progress-copy { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: .8rem; }
.progress-copy span { color: var(--muted); }
.progress-track { height: 11px; overflow: hidden; border: 1px solid #8d7e98; border-radius: 999px; background: #eee8f0; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--teal-800); transition: width .25s ease; }
.progress-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.progress-actions button { min-height: 36px; border: 2px solid var(--plum-700); border-radius: 7px; background: white; color: var(--plum-900); font-size: .72rem; font-weight: 900; }
.progress-actions button:not(:disabled):hover { background: var(--mint-100); }
.progress-actions button:disabled { border-color: #a89dad; background: #eee8f0; color: #625969; opacity: 1; }
.badge-summary { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; }
.progress-badge, .progress-streak { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 8px 12px; background: #f5f1ff; color: var(--plum-900); font-size: .76rem; font-weight: 700; }
.progress-badge { background: #efe5ff; }
.progress-streak { background: #e5fbf4; color: var(--teal-800); }
.challenge-list { flex: 1; overflow: auto; padding: 8px 0 20px; scroll-padding-block: 16px; }
.chapter-title { padding: 15px 20px 8px; color: var(--muted); font-size: .71rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.challenge-item {
  display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px;
  width: 100%; min-height: 52px; border: 0; border-left: 6px solid transparent; padding: 8px 14px;
  background: transparent; color: var(--ink); text-align: left;
}
.challenge-item:hover { background: var(--mint-100); }
.challenge-item.is-active { border-left-color: var(--coral-700); background: #f8eaf0; font-weight: 900; }
.challenge-item.is-active .challenge-name::after { content: " — current"; color: var(--danger); font-size: .72rem; }
.challenge-number {
  display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid #766681;
  border-radius: 50%; color: var(--muted); font-size: .74rem; font-weight: 800;
}
.challenge-item.is-complete .challenge-number { border-color: var(--teal-800); background: var(--teal-800); color: white; }
.challenge-name { font-size: .84rem; line-height: 1.3; }
.challenge-time { color: var(--muted); font-size: .71rem; }
.curriculum-foot { display: flex; gap: 11px; padding: 15px 20px; border-top: 1px solid var(--soft-line); background: var(--mint-100); }
.curriculum-foot span { color: var(--coral-700); font-weight: 900; }
.curriculum-foot p { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.4; }

.workspace { display: grid; grid-template-columns: minmax(360px, 38%) minmax(0, 62%); min-width: 0; height: 100%; min-height: 0; overflow: hidden; align-items: stretch; }
.lesson-panel, .code-panel { min-width: 0; min-height: 0; }
.lesson-panel { display: flex; flex-direction: column; height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; border-right: 2px solid var(--soft-line); background: var(--paper); }
.panel-tabs { position: sticky; z-index: 3; top: 0; display: flex; justify-content: space-between; align-items: center; min-height: 50px; border-bottom: 1px solid var(--soft-line); padding: 0 14px 0 20px; background: var(--cream); }
.panel-title { color: var(--plum-900); }
.tab { min-height: 40px; border: 2px solid transparent; border-radius: 8px; padding: 0 12px; background: transparent; color: var(--teal-800); font-weight: 900; }
.tab:hover { border-color: var(--teal-800); }
.exercise-guide { margin: 18px clamp(24px, 4vw, 54px) 0; border: 2px solid #b99dca; border-radius: 12px; background: #f8f1fc; color: var(--ink); }
.exercise-guide summary { min-height: 46px; padding: 12px 16px; color: var(--plum-900); font-weight: 900; cursor: pointer; }
.exercise-guide summary:hover { background: #eee2f5; }
.exercise-guide summary:focus-visible { outline: 3px solid var(--plum-900); outline-offset: 3px; }
.exercise-guide ol { margin: 0; padding: 3px 22px 5px 46px; }
.exercise-guide li, .exercise-guide p { font-size: .88rem; line-height: 1.55; }
.exercise-guide li { margin: 7px 0; padding-left: 3px; }
.exercise-guide p { margin: 8px 16px 16px; border-left: 4px solid var(--teal-700); padding: 9px 12px; background: white; }
.exercise-guide code { border-radius: 4px; padding: .08em .28em; background: #e8daef; color: #5a176f; font-family: ui-monospace, monospace; }
.setup-checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 14px 16px 18px; border: 1px solid #c9b3d5; border-radius: 10px; padding: 13px; background: white; }
.setup-checklist legend { padding: 0 6px; color: var(--plum-900); font-weight: 900; }
.setup-checklist label { display: flex; align-items: center; gap: 8px; font-size: .86rem; }
.setup-checklist input { width: 18px; height: 18px; accent-color: var(--teal-700); }
.setup-checklist strong { grid-column: 1 / -1; color: var(--teal-700); font-size: .84rem; }
.lesson-content { flex: 1; overflow: visible; padding: 34px clamp(24px, 4vw, 54px) 44px; scroll-padding-block: 20px; }
.lesson-content h2 { margin: 0 0 11px; color: var(--plum-900); font-size: clamp(1.7rem, 2.35vw, 2.35rem); font-weight: 900; letter-spacing: -.025em; line-height: 1.1; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 25px; color: var(--muted); font-size: .78rem; }
.lesson-content p, .lesson-content li { font-size: .97rem; line-height: 1.65; }
.lesson-content p, .lesson-content li, .callout, .challenge-name { overflow-wrap: anywhere; }
.lesson-content h3 { margin: 29px 0 10px; color: var(--plum-900); font-size: 1.04rem; }
.lesson-content h4 { margin: 18px 0 7px; color: var(--plum-900); font-size: .96rem; }
.lesson-content ol { padding-left: 27px; }
.lesson-content li { margin: 9px 0; padding-left: 5px; }
.lesson-content code { border-radius: 4px; padding: .08em .28em; background: #eee7f3; color: #5a176f; font-family: ui-monospace, monospace; }
.concept-card, .terminal-card, .expected-card, .troubleshooting-card { margin: 18px 0; border: 1px solid #d9c9e2; border-radius: 12px; padding: 16px 18px; background: #fff; }
.concept-card { border-left: 5px solid var(--teal-700); }
.terminal-card { border-color: #31313b; background: #1d1d24; color: #f7f3fa; }
.terminal-card h3 { color: #fff; margin-top: 0; }
.terminal-card pre { overflow-x: auto; margin: 10px 0 0; border-radius: 8px; padding: 13px; background: #0e0e13; color: #b7f7dd; white-space: pre-wrap; }
.copy-command { margin-top: 12px; border: 1px solid #8fe3c5; border-radius: 7px; padding: 8px 11px; background: transparent; color: #b7f7dd; font-weight: 900; cursor: pointer; }
.expected-card { border-left: 5px solid #c79315; background: #fffaf0; }
.troubleshooting-card { background: #f8f4fa; }
.walkthrough-dialog { width: min(920px, calc(100% - 28px)); max-height: 92dvh; border: 0; border-radius: 18px; padding: 28px; color: var(--ink); background: var(--paper); box-shadow: 0 24px 80px #160d1f66; }
.walkthrough-dialog::backdrop { background: #160d1fcc; }
.walkthrough-dialog h2 { margin: 4px 44px 8px 0; color: var(--plum-900); font-size: clamp(1.7rem, 4vw, 2.6rem); }
.walkthrough-lead { color: var(--muted); }
.walkthrough-dialog video { display: block; width: 100%; max-height: 56vh; border-radius: 12px; background: #111; }
.video-chapters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.video-chapters button { border: 1px solid #bda8c9; border-radius: 999px; padding: 8px 11px; background: white; color: var(--plum-900); font-weight: 800; cursor: pointer; }
.video-transcript { border-top: 1px solid var(--soft-line); padding-top: 12px; }
.video-transcript summary { cursor: pointer; font-weight: 900; }
.video-transcript li { margin: 8px 0; line-height: 1.5; }
.utility-dialog { width: min(650px, calc(100vw - 30px)); max-height: calc(100dvh - 30px); border: 3px solid var(--plum-900); border-radius: 18px; padding: 30px; color: var(--ink); background: var(--paper); }
.utility-dialog::backdrop { background: rgba(23, 11, 36, .78); }
.utility-dialog h2 { margin: 4px 40px 12px 0; color: var(--plum-900); }
.utility-dialog label { display: block; margin: 12px 0 6px; font-weight: 800; }
.utility-dialog textarea, .utility-dialog input[type="search"] { box-sizing: border-box; width: 100%; border: 2px solid #bda8c9; border-radius: 9px; padding: 11px; font: inherit; }
.dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; }
.glossary-list { display: grid; gap: 11px; margin: 18px 0 0; }
.glossary-list div { border-left: 4px solid var(--teal-700); padding: 5px 12px; background: #f8f4fa; }
.glossary-list dt { color: var(--plum-900); font-weight: 900; }
.glossary-list dd { margin: 4px 0 0; line-height: 1.5; }
.callout { margin: 23px 0; border: 2px solid var(--teal-700); border-left-width: 7px; border-radius: 0 12px 12px 0; padding: 14px 16px; background: var(--mint-100); }
.callout strong { display: block; margin-bottom: 5px; color: var(--teal-800); }
.test-list { margin: 14px 0; padding: 0; list-style: none; }
.test-list li { position: relative; padding-left: 26px; }
.test-list li::before { content: "◇"; position: absolute; left: 0; color: var(--coral-700); font-weight: 900; }
.learning-steps li { margin-bottom: 14px; }
.syntax-lesson { margin: 24px 0; border: 2px solid #8d68a6; border-radius: 12px; padding: 16px 18px; background: #f7f0ff; }
.syntax-lesson h3 { margin-top: 0; }
.syntax-lesson ul { padding-left: 22px; }
.syntax-lesson li { margin: 10px 0; line-height: 1.55; }
.syntax-lesson p { margin-bottom: 0; line-height: 1.55; }
.lesson-actions { position: sticky; z-index: 3; bottom: 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; min-height: 64px; border-top: 1px solid var(--soft-line); padding: 9px 16px; background: color-mix(in srgb, var(--cream) 96%, transparent); backdrop-filter: blur(8px); }
.text-button { min-height: 44px; border: 2px solid transparent; border-radius: 8px; padding: 0 11px; background: transparent; color: var(--teal-800); font-weight: 900; }
.text-button:hover { border-color: var(--teal-800); }
.square-button { width: 44px; height: 44px; margin-left: 7px; border: 2px solid var(--plum-900); border-radius: 9px; background: white; color: var(--plum-900); font-size: 1.4rem; }

.code-panel { display: grid; grid-template-columns: minmax(420px, 62%) minmax(260px, 38%); grid-template-rows: 50px minmax(0, 1fr) auto; grid-template-areas: "editor-head console" "editor console" "runner console"; height: 100%; min-height: 0; overflow: hidden; background: var(--code-bg); color: white; }
.editor-head { grid-area: editor-head; }
.editor-wrap { grid-area: editor; }
.runner-bar { grid-area: runner; }
.console { grid-area: console; border-left: 2px solid #6f5a7d; }
.editor-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #6f5a7d; background: var(--code-surface); }
.file-tab { align-self: stretch; display: flex; align-items: center; gap: 9px; border-top: 4px solid var(--mint-300); padding: 0 18px; background: var(--code-bg); font-family: ui-monospace, monospace; font-size: .82rem; }
.python-icon { display: grid; place-items: center; width: 28px; height: 24px; border-radius: 5px; background: var(--teal-800); color: white; font-size: .64rem; font-weight: 900; }
.unsaved-dot { color: var(--amber-300); }
.editor-status { padding-right: 16px; color: #ddd1e6; font-size: .72rem; }
.editor-wrap { display: grid; grid-template-columns: 50px minmax(0, 1fr); min-height: 0; overflow: hidden; }
.editor-area { position: relative; min-height: 0; overflow: hidden; }
.line-numbers { margin: 0; overflow: hidden; border-right: 1px solid #584167; padding: 18px 10px; color: #c1afca; font: 14px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; text-align: right; user-select: none; }
.code-editor { position: relative; width: 100%; height: 100%; resize: none; border: 0; outline: 0; padding: 18px; background: transparent; color: var(--code-ink); caret-color: var(--mint-300); tab-size: 4; font: 14px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; overflow: auto; }
.code-editor:focus-visible { outline: 3px solid var(--mint-300); outline-offset: -4px; box-shadow: inset 0 0 0 6px var(--amber-300); }
.runner-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 9px 12px; border-top: 1px solid #6f5a7d; border-bottom: 1px solid #6f5a7d; padding: 9px 13px; background: var(--code-surface); }
.runner-bar > div { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.secondary-button, .primary-button { min-height: 44px; border: 2px solid transparent; border-radius: 9px; padding: 0 16px; font-weight: 900; }
.secondary-button { border-color: #d8c9e2; background: #3d2551; color: white; }
.secondary-button:hover { background: #513369; }
.primary-button { border-color: var(--amber-300); background: var(--amber-300); color: var(--ink); }
.primary-button:hover { background: #ffe08e; }
.shortcut { color: #d2c4db; font-size: .7rem; }
.console { min-height: 0; overflow: hidden; background: #20102f; }
.console-head { display: flex; justify-content: space-between; align-items: center; min-height: 44px; border-bottom: 1px solid #60466f; padding: 0 14px; color: var(--mint-300); }
.clear-button { min-height: 36px; border: 2px solid transparent; border-radius: 7px; padding: 0 10px; background: transparent; color: #f1e9f5; font-weight: 800; }
.clear-button:hover { border-color: #f1e9f5; }
.console-output { height: calc(100% - 44px); overflow: auto; padding: 13px 17px; font: 13px/1.65 ui-monospace, monospace; }
.console-output p { margin: 5px 0; }
.console-muted { color: #d1c3da; }
.console-pass { color: #7ff0bd; }
.console-fail { color: #ff9db2; }
.console-info { color: #8fe3e0; }

.success-dialog, .auth-dialog, .solution-dialog { border: 3px solid var(--plum-900); border-radius: 18px; color: var(--ink); box-shadow: 0 24px 90px rgba(23, 11, 36, .48); }
.success-dialog::backdrop, .auth-dialog::backdrop, .solution-dialog::backdrop { background: rgba(23, 11, 36, .78); }
.success-dialog { width: min(480px, calc(100vw - 34px)); padding: 38px; text-align: center; }
.success-dialog h2, .auth-dialog h2 { margin: 7px 0 10px; color: var(--plum-900); font-size: 2rem; line-height: 1.15; }
.success-dialog p:not(.overline), .auth-dialog > p:not(.overline) { color: var(--muted); line-height: 1.55; }
.success-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; background: var(--teal-800); color: white; font-size: 2rem; }
.success-dialog .primary-button { margin-top: 11px; }
.auth-dialog { width: min(440px, calc(100vw - 34px)); padding: 38px; }
.solution-dialog { width: min(820px, calc(100vw - 34px)); max-height: calc(100dvh - 34px); padding: 32px; }
.solution-dialog h2 { margin: 7px 0 10px; color: var(--plum-900); font-size: 1.8rem; }
.solution-code { max-height: min(52vh, 520px); overflow: auto; border: 2px solid #6f5a7d; border-radius: 10px; padding: 18px; background: var(--code-surface); color: var(--code-ink); font: 14px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }
.solution-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.dialog-close { position: absolute; top: 9px; right: 11px; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 1.7rem; }
.oauth-buttons { display: grid; gap: 11px; margin: 26px 0 17px; }
.oauth-button { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 50px; border: 2px solid var(--plum-900); border-radius: 10px; background: white; color: var(--ink); font-weight: 900; }
.oauth-button span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--mint-100); color: var(--plum-900); font-size: .73rem; }
.github-button { background: var(--plum-900); color: white; }
.auth-message { min-height: 24px; margin: 0; font-size: .78rem; text-align: center; }
.auth-message.is-error { color: var(--danger) !important; font-weight: 800; }
.sync-note { display: inline-flex; align-items: center; gap: 5px; color: var(--success); font-size: .74rem; font-weight: 800; }
.backdrop { position: fixed; inset: var(--topbar-height) 0 0; z-index: 18; background: rgba(23, 11, 36, .7); }

.confetti-container {
  position: fixed;
  inset: var(--topbar-height) 0 0 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: 0;
  border-radius: 99px;
  will-change: transform, opacity;
  animation-name: confetti-fall;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
}

@keyframes confetti-fall {
  to {
    transform: translate3d(0, 110vh, 0) rotate(720deg);
    opacity: 0;
  }
}
.token-comment { color: #8cc7c9; }
.token-string { color: #fff9b6; }
.token-keyword { color: #9d95ff; font-weight: 700; }
.token-todo { color: #ffcf56; font-weight: 700; }

body.light-editor .code-panel, body.light-editor .code-editor { background: #fffdf8; color: var(--ink); }
body.light-editor .line-numbers { background: #f1eaf4; color: #67566f; }
body.light-editor .console { background: var(--plum-900); }

.cohort-section { padding: clamp(54px, 7vw, 96px) clamp(20px, 6vw, 90px); background: linear-gradient(150deg, #fff9f1 0%, #f5eaff 52%, #e5fff5 100%); border-top: 6px solid var(--plum-900); }
.cohort-section h2, .cohort-section h3 { color: var(--plum-900); }
.cohort-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(290px, .65fr); gap: clamp(30px, 6vw, 80px); max-width: 1180px; margin: 0 auto 42px; align-items: center; }
.cohort-hero h2 { max-width: 760px; margin: 0; font-size: clamp(2.25rem, 5vw, 4.8rem); letter-spacing: -.055em; line-height: .98; }
.cohort-lead { max-width: 720px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); line-height: 1.65; }
.cohort-benefits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px; padding: 0; list-style: none; }
.cohort-benefits li { position: relative; padding-left: 26px; line-height: 1.45; font-weight: 800; }
.cohort-benefits li::before { content: "✓"; position: absolute; left: 0; color: var(--teal-800); }
.founder-card { display: grid; gap: 10px; border: 3px solid var(--plum-900); border-radius: 22px; padding: 30px; background: var(--paper); box-shadow: 12px 12px 0 var(--mint-300); }
.portfolio-code-card { max-width: 1180px; margin: 0 auto 48px; padding: clamp(24px, 4vw, 42px); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: clamp(22px, 4vw, 46px); align-items: center; border: 3px solid var(--plum-900); border-radius: 22px; background: var(--amber-100); box-shadow: 12px 12px 0 var(--plum-900); }
.portfolio-code-number { width: clamp(88px, 10vw, 130px); aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: var(--plum-900); color: var(--mint-300); font-size: clamp(2.6rem, 6vw, 5rem); font-weight: 900; letter-spacing: -.08em; }
.portfolio-code-card h3 { margin: 4px 0 10px; font-size: clamp(2rem, 4vw, 3.6rem); line-height: .95; letter-spacing: -.045em; }
.portfolio-code-card p:not(.overline) { margin: 0; max-width: 720px; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.portfolio-code-card ul { margin: 17px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.portfolio-code-card li { padding: 7px 10px; border: 1px solid var(--plum-900); border-radius: 999px; background: white; font-size: .76rem; font-weight: 900; }
.portfolio-code-link { min-width: 190px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-radius: 10px; background: var(--plum-900); color: white; font-size: .86rem; font-weight: 900; text-decoration: none; }
.price-kicker { color: var(--coral-700); font-size: .78rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.price { color: var(--plum-900); font-size: clamp(3.6rem, 8vw, 5.7rem); line-height: 1; }
.price-note { color: var(--muted); line-height: 1.45; }
.checkout-button, .email-form button { min-height: 52px; border: 2px solid var(--plum-900); border-radius: 10px; padding: 0 18px; background: var(--plum-900); color: white; font-weight: 900; }
.checkout-button { display: grid; place-items: center; text-align: center; text-decoration: none; }
.checkout-button:hover, .email-form button:hover { background: var(--violet-700); }
.checkout-status { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 1180px; margin: 0 auto 48px; }
.pricing-card { display: flex; flex-direction: column; border: 2px solid #c8b8d2; border-radius: 18px; padding: 26px; background: rgba(255,255,255,.9); }
.pricing-card.featured { border: 4px solid var(--violet-700); transform: translateY(-8px); box-shadow: 0 14px 38px #33154d22; }
.plan-name { margin: 0; color: var(--coral-700); font-size: .75rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.pricing-card h3 { margin: 7px 0; font-size: 1.45rem; }
.plan-price { margin: 0 0 12px; color: var(--plum-900); font-size: 2.4rem; font-weight: 900; }
.pricing-card ul { flex: 1; padding-left: 21px; line-height: 1.7; }
.plan-link { display: grid; place-items: center; min-height: 48px; border: 2px solid var(--plum-900); border-radius: 9px; padding: 8px 12px; background: white; color: var(--plum-900); text-align: center; text-decoration: none; font-weight: 900; }
button.plan-link { width: 100%; }
.featured .plan-link { background: var(--amber-300); }
.signup-and-faq { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 24px; max-width: 1180px; margin: 0 auto; }
.signup-card, .faq-card { border: 2px solid var(--plum-900); border-radius: 18px; padding: clamp(24px, 4vw, 38px); background: var(--paper); }
.signup-card h3, .faq-card h3 { margin: 5px 0 12px; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.signup-card > p:not(.overline) { color: var(--muted); line-height: 1.55; }
.email-form { display: grid; gap: 9px; margin-top: 22px; }
.email-form > label:first-child { font-weight: 900; }
.email-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.email-row input { min-height: 52px; min-width: 0; border: 2px solid #8f7ba0; border-radius: 10px; padding: 0 14px; color: var(--ink); }
.email-form .remove-interest { background: white; color: var(--plum-900); }
.consent-row { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.consent-row input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--teal-800); }
.contact-choices { display: grid; gap: 9px; margin: 5px 0; border: 1px solid var(--soft-line); border-radius: 10px; padding: 12px; }
.contact-choices legend { padding: 0 5px; color: var(--plum-900); font-size: .82rem; font-weight: 900; }
.form-help { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.honeypot { position: absolute; left: -10000px; }
.signup-status { min-height: 24px; margin: 0; color: var(--teal-800); font-weight: 800; }
.signup-status.is-error { color: var(--danger); }
.signup-status.is-paused { color: var(--muted); }
.email-form :disabled { cursor: not-allowed; opacity: .62; }
.faq-card details { border-top: 1px solid var(--soft-line); padding: 14px 2px; }
.faq-card summary { color: var(--plum-900); font-weight: 900; cursor: pointer; }
.faq-card details p { margin-bottom: 0; color: var(--muted); line-height: 1.55; }
.legal-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 28px clamp(20px, 6vw, 90px); border-top: 2px solid var(--plum-900); background: var(--plum-950); color: white; }
.legal-footer p { max-width: 760px; margin: 0; line-height: 1.55; }
.legal-footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 20px; }
.legal-footer a { color: var(--amber-100); font-weight: 800; }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: minmax(330px, 40%) minmax(0, 60%); }
  .code-panel { grid-template-columns: minmax(360px, 60%) minmax(220px, 40%); }
  .global-search { width: min(360px, 34vw); }
  .shortcut { display: none; }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  body.nav-open { overflow: hidden; }
  .topbar { grid-template-columns: auto 1fr auto; }
  .menu-button { display: inline-block; margin-right: 8px; }
  .global-search { display: none; }
  .wordmark { justify-self: center; }
  .nav-button { display: none; }
  .platform-shell { display: block; height: auto; min-height: calc(100dvh - var(--topbar-height)); overflow: visible; }
  .curriculum { position: fixed; z-index: 25; inset: var(--topbar-height) auto 0 0; width: min(360px, 92vw); max-height: calc(100dvh - var(--topbar-height)); transform: translateX(-101%); transition: transform .2s ease; box-shadow: 18px 0 45px rgba(23, 11, 36, .24); }
  .curriculum.is-open { transform: translateX(0); }
  .curriculum-head { display: flex; justify-content: space-between; }
  .close-menu { display: block; border-color: var(--plum-900); color: var(--plum-900); }
  .mobile-search { display: grid; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--soft-line); background: white; color: var(--muted); font-size: .76rem; font-weight: 800; }
  .mobile-search input { width: 100%; min-height: 44px; border: 2px solid var(--plum-700); border-radius: 9px; padding: 0 12px; background: white; color: var(--ink); }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(680px, 76dvh); height: auto; overflow: visible; }
  .lesson-panel { height: auto; min-height: 500px; overflow: visible; }
  .panel-tabs { top: var(--topbar-height); }
  .lesson-actions { position: static; backdrop-filter: none; }
  .code-panel { grid-template-columns: minmax(0, 1fr); grid-template-rows: 50px minmax(360px, 1fr) auto minmax(190px, 32%); grid-template-areas: "editor-head" "editor" "runner" "console"; height: min(900px, 88dvh); min-height: 680px; }
  .console { border-left: 0; border-top: 2px solid #6f5a7d; }
  .backdrop { top: var(--topbar-height); }
  .cohort-hero, .signup-and-faq { grid-template-columns: 1fr; }
  .portfolio-code-card { grid-template-columns: auto 1fr; }
  .portfolio-code-link { grid-column: 1 / -1; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-card.featured { transform: none; }
  .legal-footer { grid-template-columns: 1fr; }
  .legal-footer nav { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .top-actions .icon-button { display: none; }
  .topbar { padding-inline: 7px; }
  .wordmark { font-size: 1.18rem; }
  .sign-in-button { padding: 0 11px; }
  .account-button #userName { display: none; }
  .lesson-content { padding: 28px 22px 38px; }
  .exercise-guide { margin-inline: 22px; }
  .setup-checklist { grid-template-columns: 1fr; }
  .lesson-content h2 { font-size: clamp(1.55rem, 8vw, 2rem); }
  .workspace { grid-template-rows: auto minmax(720px, 82dvh); }
  .runner-bar { align-items: stretch; flex-direction: column; }
  .runner-bar > div { justify-content: space-between; }
  .code-panel { grid-template-rows: 50px minmax(270px, 1fr) 112px minmax(180px, 34%); }
  .editor-status { display: none; }
  .success-dialog, .auth-dialog { max-height: calc(100dvh - 24px); overflow: auto; }
  .cohort-section { padding-inline: 16px; }
  .portfolio-code-card { grid-template-columns: 1fr; box-shadow: 7px 7px 0 var(--plum-900); }
  .portfolio-code-number { width: 82px; }
  .cohort-benefits, .email-row { grid-template-columns: 1fr; }
  .email-form button { width: 100%; }
}

@media (max-width: 420px) {
  :root { --topbar-height: 60px; }
  .topbar { gap: 4px; padding-inline: 5px; }
  .wordmark { font-size: 1.05rem; }
  .wordmark span:last-child { display: none; }
  .top-actions { gap: 5px; }
  .sign-in-button { padding-inline: 9px; font-size: .82rem; }
  .curriculum { width: min(100vw, 360px); }
  .track-switcher { gap: 5px; padding-inline: 8px; }
  .track-button { font-size: .7rem; }
  .panel-tabs { padding-inline: 12px; }
  .lesson-content { padding: 24px 17px 34px; }
  .exercise-guide { margin-inline: 17px; }
  .lesson-actions { padding-inline: 10px; }
  .editor-wrap { grid-template-columns: 42px minmax(0, 1fr); }
  .line-numbers { padding-inline: 7px; font-size: 13px; }
  .code-editor { padding: 16px 12px; font-size: 13px; }
  .runner-bar > div:last-child { display: grid; grid-template-columns: 1fr 1.45fr; }
  .runner-bar button { width: 100%; padding-inline: 8px; font-size: .78rem; }
  .success-dialog, .auth-dialog { width: calc(100vw - 20px); padding: 30px 22px; }
  .auth-dialog h2, .success-dialog h2 { padding-right: 24px; font-size: 1.65rem; }
}

@media (max-height: 560px) and (min-width: 901px) {
  .curriculum-head { padding-block: 13px; }
  .progress-card { padding-block: 10px; }
  .chapter-title { padding-top: 10px; }
  .challenge-item { min-height: 46px; }
  .lesson-content { padding-top: 24px; }
}

@supports (padding: max(0px)) {
  .topbar { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .curriculum { padding-bottom: env(safe-area-inset-bottom); }
}

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

@media (forced-colors: active) {
  :where(a, button, input, textarea):focus-visible { outline: 3px solid Highlight; box-shadow: none; }
  .track-button.is-active, .challenge-item.is-active, .challenge-item.is-complete .challenge-number { forced-color-adjust: none; }
}
