:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #182e2a;
  background: #f2f4ed;
  --ink: #182e2a;
  --muted: #536760;
  --line: #d6e0d7;
  --green: #174f40;
  --wash: #e5efe4;
  --paper: #fffefa;
  --dark: #18362e;
  --accent: #d1efa6;
  --radius: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--green); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #327a51; outline-offset: 3px; }
main:focus { outline: none; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 4; background: white; padding: 12px; border-radius: 8px; }

.app-shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: #172b26; border-right: 1px solid #25483e; padding: 28px 14px 18px;
  display: flex; flex-direction: column; gap: 32px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 750; line-height: 1.22; font-size: .92rem; text-decoration: none; }
.sidebar .brand { margin-inline: 6px; }
.sidebar .brand, .sidebar nav a, .sidebar summary { color: #f1f7ed; }
.brand-icon {
  display: block; width: 34px; height: 34px; object-fit: cover;
  border-radius: 9px; flex: 0 0 auto;
}
.brand small, .sidebar-foot small { display: block; color: var(--muted); font-size: .69rem; margin-top: 4px; font-weight: 550; }
.sidebar small { color: #b4c7b9; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a, .nav-library summary { padding: 11px 12px; text-decoration: none; border-radius: 8px; font-weight: 600; font-size: .9rem; }
.sidebar nav a:hover, .nav-library summary:hover { background: #224136; }
.sidebar nav a[aria-current] { background: #294d3f; color: #e1f4c6; box-shadow: inset 3px 0 var(--accent); }
.sidebar :focus-visible { outline-color: var(--accent); }
.nav-library { margin-top: 14px; border-top-color: #3d594d; }
.nav-library summary::marker { color: #b4c7b9; }
.nav-library a { display: block; margin: 2px 0 0 10px; }
.sidebar-foot { margin-top: auto; padding: 8px; }
.signin-page {
  min-height: 100svh; display: grid; place-items: center;
  background: radial-gradient(ellipse at top, #dceadd, #f2f4ed 65%);
}
.signin-wrap { width: min(100%, 510px); padding: 22px; }
.signin-card { padding: clamp(24px, 6vw, 42px); gap: 15px; }
.signin-logo { display: block; border-radius: 16px; }
.signin-card h1 { font-size: clamp(2.05rem, 8vw, 2.8rem); }
.signin-card form { margin-top: 8px; }
.signin-card form p:empty { display: none; }
main { width: min(100%, 1280px); padding: 40px clamp(20px, 4vw, 62px) 92px; margin: 0 auto; }
h1, h2, h3, p, figure { margin: 0; }
h1 { font-size: clamp(2.25rem, 5vw, 3.65rem); font-weight: 660; line-height: 1.04; letter-spacing: -.055em; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); line-height: 1.18; letter-spacing: -.035em; font-weight: 730; }
h3 { font-size: 1.01rem; line-height: 1.36; }
p, li { line-height: 1.57; }
.page-head { display: grid; gap: 11px; margin-bottom: 28px; }
.page-head p { color: var(--muted); max-width: 68ch; }
.section { margin-top: 22px; }
.section > h2 { margin-bottom: 12px; }

.hero {
  background: var(--dark); color: #fbfcf4; border-radius: 22px; padding: clamp(23px, 4vw, 42px);
  border: 1px solid #132d22; min-height: 245px;
  background-image: radial-gradient(ellipse at 100% 0%, #285342 0%, transparent 65%);
}
.hero-main { display: grid; gap: 12px; align-content: center; height: 100%; min-height: 156px; }
.hero h2 { font-size: clamp(1.85rem, 4.8vw, 3.2rem); max-width: 23ch; letter-spacing: -.05em; }
.hero p { color: #c5ded1; max-width: 59ch; }
.hero .eyebrow { color: var(--accent); }
.hero .btn { background: var(--accent); color: #16362a; }
.hero-action { margin-top: 6px; }
.track-meter { display: grid; gap: 5px; color: var(--muted); font-size: .8rem; font-weight: 650; }
progress { appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: 999px; background: #e6eee3; accent-color: var(--green); }
progress::-webkit-progress-bar { background: #e6eee3; border-radius: 999px; }
progress::-webkit-progress-value { background: var(--green); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 999px; }
.eyebrow { font-size: .71rem; font-weight: 780; letter-spacing: .09em; text-transform: uppercase; color: var(--green); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(225px,100%), 1fr)); gap: 14px; }
.stack { display: grid; gap: 13px; min-width: 0; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(15px, 2.4vw, 23px); display: grid; align-content: start; gap: 10px; min-width: 0;
}
.card p, .muted, .metadata { color: var(--muted); }
.metadata { font-size: .81rem; overflow-wrap: anywhere; }
.inline { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.between { justify-content: space-between; }
.chip { display: inline-flex; background: var(--wash); border-radius: 999px; padding: 4px 9px; color: #2a5540; font-size: .74rem; font-weight: 720; line-height: 1.25; }
.btn, button {
  border-radius: 9px; border: 1px solid transparent; cursor: pointer; font: inherit;
  font-size: .88rem; font-weight: 730; padding: 10px 14px; min-height: 42px; line-height: 1.35;
}
.btn { display: inline-flex; align-items: center; background: var(--green); color: white; text-decoration: none; }
.btn:hover { filter: brightness(1.11); }
.btn.secondary, button.secondary { background: #e9f0e7; border-color: #d2e0d3; color: #214c37; }
button.secondary:hover, .btn.secondary:hover { background: #e0ecdf; filter: none; }
button:disabled, .btn:disabled { opacity: .59; cursor: default; }
label { font-size: .86rem; color: var(--ink); font-weight: 650; }
.field { display: grid; gap: 6px; min-width: 0; }
input, select, textarea {
  border-radius: 9px; border: 1px solid #9fb5a6; padding: 9px 11px; font: inherit;
  min-width: 0; max-width: 100%; background: #fff; color: var(--ink);
}
input, select { min-height: 42px; }
input[type="checkbox"], input[type="range"] { accent-color: var(--green); min-height: auto; }
textarea { width: 100%; resize: vertical; min-height: 82px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #62776d; }
input[readonly] { background: #f2f5ee; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 0 0 16px; }
.toolbar .search { flex: 1 1 220px; }
.toolbar select { max-width: min(100%,28rem); }
.table-wrap { max-width: 100%; overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .86rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #e9f0e8; }
td a { overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
details { border-top: 1px solid var(--line); padding-top: 9px; }
details.card { border-top: 1px solid var(--line); }
details p { margin-top: 6px; }
summary { font-weight: 700; cursor: pointer; }
summary::marker { color: var(--green); }
.compact { margin: 0; padding-left: 1.25em; }
.outline { margin: 0; padding-left: 1.8em; }
.outline li { padding: 6px 10px; margin-left: 6px; }
.outline li[aria-current] { background: var(--wash); border-radius: 8px; }
.outline li[aria-current] .chip { background: var(--green); color: white; }
.outline li + li { border-top: 1px solid #eef2ec; }
.course-map { max-width: 58rem; }
.course-chapter { border-left: 3px solid var(--line); }
.course-chapter.current { border-left-color: var(--green); }
.course-chapter summary span { margin-left: 5px; }
.chapter-count { float: right; color: var(--muted); font-size: .84rem; }
.course-chapter .outline { margin: 12px 0 0; padding-left: 24px; }
.course-chapter .outline .chip { margin-left: 7px; }
.lesson-scene { max-width: 70rem; margin-inline: auto; }
.lesson-banner {
  position: relative; overflow: hidden; display: grid; align-content: center; gap: 12px;
  min-height: 170px; padding: clamp(19px, 3.6vw, 38px); margin-bottom: 19px;
  border-radius: 20px; color: #f7fcf2; background: #17362f;
  background-image: radial-gradient(ellipse at 97% 18%, #285747 0%, transparent 63%);
}
.lesson-banner h1 { position: relative; font-size: clamp(2rem, 4.45vw, 3.4rem); font-weight: 660; }
.lesson-banner .eyebrow { color: var(--accent); letter-spacing: .065em; }
.lesson-banner > p:last-child { color: #d3e5d9; max-width: 64ch; font-size: .95rem; }
.lesson-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.lesson-panel { border-radius: 19px; padding: clamp(18px, 3vw, 32px); box-shadow: 0 10px 28px #244a3520; gap: 16px; }
.lesson-panel .eyebrow { color: #416c56; }
.lesson-panel .problem { color: var(--ink); font-size: clamp(1.17rem, 2.5vw, 1.6rem); font-weight: 630; line-height: 1.36; }
.lesson-panel .response-form { gap: 15px; }
.lesson-panel input { min-height: 48px; font-variant-numeric: tabular-nums; }
.lesson-actions { gap: 10px; }
.lesson-guide { border: 1px solid #d0dfd2; border-radius: 17px; padding: 17px; background: #e9f1e6; }
.lesson-guide h2 { font-size: .98rem; letter-spacing: -.01em; }
.lesson-guide ol { display: grid; gap: 4px; list-style: none; padding: 0; margin: 14px 0 0; }
.lesson-guide li { display: grid; grid-template-columns: 14px 1fr; gap: 9px; align-items: center; color: #4a6253; padding: 6px 0; font-size: .83rem; }
.lesson-guide li span { width: 10px; height: 10px; margin-inline: auto; border-radius: 50%; border: 1px solid #769180; }
.lesson-guide li[aria-current] { font-weight: 740; color: #173d33; }
.lesson-guide li[aria-current] span { border-color: #225943; background: #225943; outline: 3px solid #cddece; }
.lesson-gauge { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #cfdfd2; color: #3f5e4d; font-size: .81rem; }
.probe-meter { display: flex; gap: 5px; }
.probe-meter span { flex: 1; height: 5px; border-radius: 4px; background: #cbdacc; }
.probe-meter .filled { background: #34735a; }
.lesson-specimen {
  padding: 13px 14px 9px; border-radius: 15px; color: #d7eee0; background-color: #203b32;
  background-image: linear-gradient(#dbeed411 1px, transparent 1px), linear-gradient(90deg,#dbeed411 1px,transparent 1px);
  background-size: 15px 15px;
}
.lesson-specimen figcaption { font-size: .78rem; font-weight: 630; }
.lesson-specimen canvas { width: 100%; max-width: 17rem; margin: 7px auto 0; }
.example-steps { display: grid; gap: 11px; margin: 0; padding: 0; counter-reset: explanation; list-style: none; }
.example-steps li { display: grid; grid-template-columns: 30px 1fr; column-gap: 11px; padding: 11px 13px; border-radius: 11px; background: #f0f5ed; }
.example-steps li::before { counter-increment: explanation; content: counter(explanation); grid-row: 1 / span 2; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #d8e8d6; color: #194f3d; font-size: .82rem; font-weight: 720; }
.example-steps p { grid-column: 2; margin-top: 4px; font-size: .93rem; }
.worked-code { max-width: 100%; overflow: auto; margin: 0; padding: 14px 16px; border-radius: 10px; color: #eef6ec; background: var(--dark); font-size: .84rem; line-height: 1.48; }
.setup-choices { display: grid; gap: 8px; }
.setup-choices button { text-align: left; background: #f5f8f1; border-color: #c9dccd; color: var(--ink); }
.setup-choices button:hover, .setup-choices button[aria-pressed="true"] { background: #e0efdf; border-color: #6d977e; }
.lesson-scene .scratch-panel textarea { margin-top: 10px; }
.industry-grid { margin-top: 12px; }
.rows { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rows label { display: flex; gap: 8px; align-items: start; }
.rows input { margin-top: .36em; }
canvas { display: block; max-width: 100%; height: auto; }
.tool { background: #f0f6ef; border: 1px solid var(--line); border-radius: 11px; padding: 13px; margin-top: 10px; }
.measurements { display: flex; gap: 9px; flex-wrap: wrap; }
.measurements > div { background: #edf4eb; border-radius: 9px; padding: 11px 13px; flex: 1 0 104px; }
.measurements strong { font-size: 1.14rem; display: block; }

.breadcrumbs { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .81rem; margin-bottom: 13px; }
.response-form { display: grid; gap: 11px; }
.response-form .field { max-width: 19rem; }
.scratch-panel h2 { font-size: 1.02rem; letter-spacing: -.01em; }
.scratch-panel textarea { min-height: 148px; }
.practice-next { margin-top: 3px; }
.study-help { display: grid; gap: 8px; }
.study-help details { background: #f3f6ef; border: 1px solid #dce6dc; padding: 9px 12px; border-radius: 9px; }
.feedback { padding: 13px 15px; background: #e8f2e7; border-left: 3px solid #518261; border-radius: 9px; color: #203f2e; }
.feedback p { color: inherit; }
.feedback .metadata { margin-top: 6px; color: var(--muted); }
.feedback.issue { background: #fff0dd; color: #563a1e; border-left-color: #b47d39; }
.work-choices { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
.work-choices legend { margin-bottom: 12px; font-weight: 700; }
.work-choices label { display: flex; align-items: baseline; gap: 9px; }
.work-choices label { min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; }
.work-choices label:has(input:checked) { background: #e8f2e7; border-color: #6e987b; }
.work-choices input { width: auto; min-height: auto; padding: 0; margin: 0; flex: none; accent-color: var(--green); }
.starter-files { margin-block: 4px; }
.response-label { font-size: .79rem; font-weight: 700; margin-bottom: 5px; }

.quick-mode .app-shell { display: block; }
.quick-mode .sidebar { display: none; }
.quick-mode main { max-width: 1110px; padding: clamp(15px, 4vw, 42px) clamp(14px, 4vw, 47px) 88px; }
.quick-page { display: grid; gap: clamp(17px, 3vw, 29px); }
.quick-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px; }
.quick-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 19px; font-size: .87rem; font-weight: 650; }
.quick-links a { padding-block: 5px; }
.quick-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 15px; align-items: start; }
.quick-card {
  display: grid; gap: 15px; padding: clamp(18px, 4vw, 34px); background: var(--paper);
  border: 1px solid var(--line); border-radius: 22px; min-width: 0;
}
.quick-card h1 { max-width: 22ch; font-size: clamp(2.05rem, 4.3vw, 3.35rem); }
.quick-prompt { font-size: .98rem; max-width: 61ch; }
.quick-context { display: grid; min-width: 0; gap: 12px; }
.schematic {
  background-color: var(--dark); color: #c3efdb; border-radius: var(--radius); padding: 15px 14px;
  background-image: linear-gradient(#eaf8ed10 1px, transparent 1px),linear-gradient(90deg,#eaf8ed10 1px,transparent 1px);
  background-size: 16px 16px;
}
.schematic figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-inline: 4px; font-size: .73rem; font-weight: 700; }
.schematic canvas { width: 100%; max-width: 420px; margin: 3px auto 0; }
.why-card { display: grid; gap: 6px; padding: 12px 15px; color: var(--muted); font-size: .89rem; }
.why-card h2 { color: var(--ink); font-size: .9rem; letter-spacing: 0; }
.quick-choices { display: grid; gap: 8px; }
.choice {
  display: flex; gap: 12px; align-items: center; min-height: 49px; text-align: left; padding: 8px 12px;
  background: #f3f7ef; border: 1px solid #bbcdbb; color: var(--ink);
}
.choice:hover { background: #e2efe1; border-color: #7a9c86; }
.choice-key {
  display: inline-grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px;
  font-family: ui-monospace, monospace; font-size: .82rem; background: #e0eadf; border-radius: 6px; color: #244b38;
}
.quick-scratch { font-size: .88rem; }
.quick-scratch .field { margin-top: 7px; }
.quick-entry-form .field { flex: 1 1 145px; max-width: 225px; }
.align-end { align-self: end; }
.resume-note { font-size: .85rem; padding: 8px 10px; border-radius: 8px; background: var(--wash); }
.save-bar {
  position: fixed; bottom: 12px; right: 14px; z-index: 2; border: 1px solid var(--line);
  background: #f3f7ed; color: #2d5140; box-shadow: 0 4px 16px #1a3d2517;
  border-radius: 999px; padding: 7px 13px; font-size: .78rem; font-weight: 680;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; max-width: calc(100% - 28px);
}
.save-bar:has(#save-status:empty) { display: none; }
.save-bar.save-warning { border-radius: 12px; color: #573d22; background: #fff1dc; }
.save-bar button { font-size: .78rem; min-height: 36px; padding: 6px 9px; }
.notification {
  position: fixed; z-index: 3; right: 14px; bottom: 66px; max-width: calc(100% - 28px);
  background: var(--dark); color: white; border-radius: 9px; padding: 10px 14px;
}
.notification:empty { display: none; }
.backup-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 14px; margin: 0; font-size: .87rem; }
.backup-details dd { margin: 0; color: var(--muted); }
@media (min-width: 880px) {
  .quick-workspace { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
}
@media (min-width: 1060px) {
  .lesson-grid { grid-template-columns: minmax(0, 1fr) minmax(220px, 27%); }
}
@media (max-width: 790px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 14px; gap: 9px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { margin: 0; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .sidebar nav a, .nav-library summary { padding: 8px; font-size: .81rem; }
  .nav-library { margin: 0; border: 0; padding-top: 0; flex-basis: 100%; }
  .nav-library a { display: inline-block; margin: 0 3px 1px 0; }
  .sidebar-foot { display: none; }
  main { padding: 27px 15px 90px; }
  th, td { padding: 7px; }
}
@media (max-width: 520px) {
  .quick-header { gap: 5px 10px; }
  .quick-links { gap: 5px 13px; font-size: .8rem; }
  .quick-card { padding: 16px; gap: 12px; border-radius: 16px; }
  .quick-prompt { font-size: .93rem; }
  .quick-context { gap: 4px; }
  .schematic { padding: 12px; }
  .backup-details { grid-template-columns: 1fr; }
  .backup-details dd { padding-bottom: 5px; }
  .save-bar.save-warning { left: 12px; right: 12px; max-width: none; justify-content: flex-start; }
}
.saved-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.evidence-attempt strong { color: var(--ink); }
