:root {
  color-scheme: light;
  --paper: #f5f4ef;
  --surface: #fffefa;
  --ink: #182523;
  --muted: #687572;
  --line: #e5e8e2;
  --green: #16785e;
  --green-dark: #0e5f49;
  --mint: #c6f0d8;
  --soft-green: #e8f5ed;
  --amber: #d99547;
  --red: #b24c42;
  --shadow: 0 18px 50px rgba(31, 49, 43, .07);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-optical-sizing: auto;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid #47a98b; outline-offset: 3px; }
.topbar { height: 72px; padding: 0 clamp(20px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(33, 58, 50, .08); }
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; font-size: 15px; letter-spacing: -.03em; font-weight: 750; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--green); color: white; font-family: Georgia, serif; font-size: 21px; font-style: italic; font-weight: 700; }
.brand-period { color: var(--green); }
.topbar-right { display: flex; align-items: center; gap: 22px; }
.saved-label { color: var(--muted); font-size: 12px; }
.quiet-button { border: 0; background: none; color: #78827f; font-size: 12px; padding: 8px 0; }
.quiet-button:hover { color: var(--red); }
.page-shell { max-width: 1320px; margin: 0 auto; padding: 36px clamp(18px, 5vw, 76px) 24px; }
.welcome-card { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; min-height: 248px; padding: 42px clamp(26px, 5vw, 64px); background: #183d34; border-radius: 22px; color: #fbfff9; box-shadow: var(--shadow); }
.welcome-copy, .welcome-aside { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 16px; font-size: 10px; line-height: 1.2; font-weight: 750; letter-spacing: .17em; }
.welcome-card .eyebrow { color: #b1d6c5; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin: 0 8px 1px 0; border-radius: 50%; background: #9de6b9; box-shadow: 0 0 0 4px rgba(157, 230, 185, .12); }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 630px; margin-bottom: 12px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 5.2vw, 64px); line-height: .98; font-weight: 500; letter-spacing: -.055em; }
h1 em { color: #a8e4be; font-weight: 400; }
.welcome-description { max-width: 520px; margin: 0; color: #ceded6; font-size: 14px; }
.welcome-aside { min-width: 215px; display: grid; grid-template-columns: 54px 1fr; align-items: center; column-gap: 14px; row-gap: 12px; }
.progress-ring { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#a8e4be var(--progress, 0%), rgba(255,255,255,.17) 0); position: relative; }
.progress-ring::before { content: ""; position: absolute; inset: 4px; border-radius: inherit; background: #183d34; }
.progress-ring span { position: relative; font-size: 11px; font-weight: 750; }
.welcome-aside strong, .welcome-aside div:nth-child(2) span { display: block; }
.welcome-aside strong { font-size: 14px; }
.welcome-aside div:nth-child(2) span { color: #b8ccc2; font-size: 11px; }
.primary-button { border: 0; border-radius: 10px; background: #c9f0d7; color: #153e32; padding: 12px 16px; font-size: 13px; font-weight: 750; transition: transform .16s ease, background .16s ease; }
.primary-button:hover { background: #dcf7e5; transform: translateY(-1px); }
.primary-button:active { transform: scale(.98); }
.welcome-cta { grid-column: 1 / -1; width: 100%; text-align: left; display: flex; justify-content: space-between; align-items: center; }
.welcome-glow { pointer-events: none; position: absolute; width: 480px; height: 480px; right: 17%; top: -310px; border-radius: 50%; border: 1px solid rgba(197, 240, 216, .13); box-shadow: 0 0 0 45px rgba(197,240,216,.025), 0 0 0 95px rgba(197,240,216,.025), 0 0 0 150px rgba(197,240,216,.02); }
.course-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 38px 2px 18px; }
.muted-eyebrow { color: #85918d; margin-bottom: 8px; }
h2 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: 29px; line-height: 1.1; letter-spacing: -.04em; font-weight: 500; }
.course-note { max-width: 360px; margin: 0 0 2px; color: var(--muted); font-size: 12px; text-align: right; }
.workspace { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 18px; align-items: start; }
.stage-rail, .lesson-area { background: var(--surface); border: 1px solid rgba(39, 68, 57, .08); border-radius: 16px; box-shadow: 0 8px 30px rgba(31, 49, 43, .035); }
.stage-rail { padding: 17px 12px 13px; }
.rail-heading { display: flex; justify-content: space-between; padding: 0 9px 13px; color: #8b9691; font-size: 9px; font-weight: 750; letter-spacing: .13em; }
.rail-heading span:last-child { color: var(--green); letter-spacing: .03em; }
.stage-nav { display: grid; gap: 4px; }
.stage-link { border: 0; background: transparent; color: var(--ink); border-radius: 10px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 9px; text-align: left; padding: 9px; min-height: 51px; width: 100%; transition: background .15s ease; }
.stage-link:hover { background: #f4f7f2; }
.stage-link[aria-current="step"] { background: #eaf5ed; }
.stage-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: #687572; background: #f0f2ed; font-size: 10px; font-weight: 750; }
.stage-link[aria-current="step"] .stage-number { background: #d0ecd9; color: #176249; }
.stage-link.is-complete .stage-number { background: #17785e; color: white; }
.stage-title { display: block; font-size: 11px; font-weight: 700; line-height: 1.25; }
.stage-meta { display: block; margin-top: 3px; color: #8b9691; font-size: 9px; }
.stage-progress { color: #87938e; font-size: 9px; font-variant-numeric: tabular-nums; }
.rail-tip { margin: 18px 5px 0; padding: 13px 11px; display: flex; gap: 10px; background: #f7f7f0; border-radius: 10px; }
.tip-icon { color: #b27b32; font-size: 15px; }
.rail-tip p { margin: 0; color: #727c76; font-size: 10px; line-height: 1.55; }
.rail-tip strong { color: #31433b; }
.lesson-area { min-height: 465px; overflow: hidden; }
.stage-overview { padding: clamp(23px, 4vw, 42px); }
.lesson-kicker { margin-bottom: 10px; color: var(--green); font-size: 10px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.overview-title { font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 3.2vw, 40px); letter-spacing: -.045em; font-weight: 500; line-height: 1.05; margin-bottom: 10px; }
.overview-description { max-width: 650px; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.overview-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.overview-actions .primary-button { background: var(--green); color: white; }
.overview-actions .primary-button:hover { background: var(--green-dark); }
.subtle-text { color: #858f8a; font-size: 11px; }
.prompt-map-heading { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 19px; margin-bottom: 12px; }
.prompt-map-heading strong { font-size: 11px; }
.prompt-map-heading span { color: #8a9590; font-size: 10px; }
.prompt-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 7px; }
.prompt-dot { aspect-ratio: 1; min-height: 30px; border: 1px solid #e4e8e2; border-radius: 9px; background: #fff; color: #6e7974; font-size: 10px; font-weight: 700; }
.prompt-dot:hover { border-color: #73b69a; background: #f4faf5; }
.prompt-dot.is-done { border-color: #147557; background: #e4f3e8; color: #176b52; }
.prompt-dot.is-later { border-color: #edd5b5; background: #fff6e9; color: #9d6a2c; }
.prompt-dot.is-current { box-shadow: 0 0 0 2px #16785e; }
.question-shell { padding: clamp(22px, 3.8vw, 40px); }
.question-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.question-category { display: inline-flex; align-items: center; gap: 7px; color: #71807a; font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.category-dot { width: 7px; height: 7px; border-radius: 50%; background: #d89d51; }
.question-count { color: #86918d; font-size: 10px; }
.question-title { max-width: 750px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(22px, 3vw, 31px); font-weight: 500; letter-spacing: -.035em; line-height: 1.2; margin-bottom: 20px; }
.question-instruction { color: var(--muted); font-size: 12px; margin: -12px 0 20px; }
.choices { display: grid; gap: 9px; border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.choice { display: flex; gap: 11px; align-items: flex-start; width: 100%; text-align: left; border: 1px solid #e5e9e3; background: #fff; color: var(--ink); border-radius: 10px; padding: 12px 14px; font-size: 12px; line-height: 1.5; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.choice:hover { border-color: #9bc7ae; background: #fcfefb; }
.choice.is-selected { border-color: #398b6c; background: #edf7ef; box-shadow: 0 0 0 1px #398b6c inset; }
.choice-input { width: 16px; height: 16px; margin: 3px 0 0; flex: 0 0 16px; accent-color: var(--green); }
.choice-key { flex: 0 0 21px; width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid #dce3dc; border-radius: 50%; color: #7e8983; font-size: 9px; font-weight: 750; }
.answer-box { display: block; width: 100%; min-height: 145px; resize: vertical; border: 1px solid #dfe5df; border-radius: 10px; padding: 13px 14px; background: #fbfcf9; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.65; }
.answer-box::placeholder { color: #a1aba6; }
.starter-code { white-space: pre-wrap; margin: 0 0 10px; padding: 13px 14px; border-radius: 9px; background: #20332e; color: #e1eee6; font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow: auto; }
.hint-panel, .model-panel, .feedback { margin-top: 13px; border-radius: 9px; padding: 12px 14px; font-size: 12px; line-height: 1.6; }
.hint-panel { background: #fff7e9; color: #735632; border: 1px solid #f2e2c7; }
.model-panel { background: #f0f7f1; border: 1px solid #d9e9dc; color: #344a3e; }
.model-answer { margin-top: 5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.model-answer.code-answer { margin-top: 8px; padding: 11px; border-radius: 7px; background: #20332e; color: #e1eee6; white-space: pre; overflow: auto; font: 11px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.model-panel pre { margin: 8px 0 0; padding: 11px; overflow: auto; border-radius: 7px; background: #20332e; color: #e1eee6; white-space: pre-wrap; font: 11px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.feedback { display: none; }
.feedback.is-visible { display: block; }
.feedback.is-good { background: #eaf6ed; color: #17654d; }
.feedback.is-retry { background: #fff3ec; color: #985541; }
.question-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.tool-group { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-button { border: 1px solid #e1e6e0; border-radius: 8px; background: white; color: #43514b; padding: 9px 12px; font-size: 11px; font-weight: 650; }
.tool-button:hover { background: #f6f8f4; border-color: #bccdc1; }
.tool-button.primary { background: var(--green); border-color: var(--green); color: white; }
.tool-button.primary:hover { background: var(--green-dark); }
.tool-button:disabled { cursor: not-allowed; opacity: .5; }
.question-bottom { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px; }
.text-button { border: 0; background: none; color: #697772; padding: 6px 0; font-size: 11px; }
.text-button:hover { color: var(--green-dark); }
.text-button:disabled { color: #bdc4bf; cursor: not-allowed; }
.page-footer { display: flex; justify-content: space-between; gap: 16px; padding: 19px 3px 0; color: #929c97; font-size: 10px; }
.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; }

@media (max-width: 850px) {
  .workspace { grid-template-columns: 1fr; }
  .stage-rail { padding: 11px; }
  .stage-nav { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 3px; }
  .stage-link { min-width: 190px; }
  .rail-tip { display: none; }
  .rail-heading { padding-bottom: 8px; }
  .lesson-area { min-height: 410px; }
}
@media (max-width: 600px) {
  .topbar { height: 60px; padding: 0 17px; }
  .saved-label { display: none; }
  .page-shell { padding: 19px 14px 18px; }
  .welcome-card { display: block; padding: 28px 23px 22px; border-radius: 17px; }
  .welcome-copy { margin-bottom: 22px; }
  h1 { font-size: 43px; }
  .welcome-description { font-size: 12px; }
  .welcome-aside { grid-template-columns: 46px 1fr; min-width: 0; }
  .progress-ring { width: 46px; height: 46px; }
  .welcome-cta { grid-column: 1 / -1; }
  .course-heading { align-items: start; flex-direction: column; gap: 8px; margin: 28px 2px 14px; }
  .course-note { text-align: left; font-size: 11px; }
  h2 { font-size: 26px; }
  .stage-link { min-width: 166px; grid-template-columns: 27px 1fr auto; gap: 7px; padding: 8px; }
  .stage-title { font-size: 10px; }
  .stage-meta { font-size: 8px; }
  .stage-number { width: 25px; height: 25px; }
  .stage-rail { border-radius: 13px; }
  .lesson-area { border-radius: 13px; }
  .stage-overview, .question-shell { padding: 22px 18px; }
  .question-tools { align-items: stretch; }
  .question-tools .tool-group { flex: 1; }
  .question-tools .tool-group:last-child { justify-content: flex-end; }
  .tool-button { padding: 9px 10px; }
  .page-footer { flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
