:root {
  color-scheme: light;
  --background: #fcfcfc;
  --surface: #ffffff;
  --text: #000000;
  --muted: #667085;
  --line: #d7deea;
  --primary: #2563eb;
  --primary-strong: #1746a2;
  --accent: #e53935;
  --accent-strong: #b71c1c;
  --soft: #eaf1ff;
  --yellow: #f9c74f;
  --progress-base: #edf0f4;
  --progress-revealed: #aeb6c2;
  --plot-background: #ffffff;
  --plot-grid: #dce3ee;
  --plot-axis: #64748b;
  --plot-curve: #2563eb;
  --plot-tangent: #e53935;
  --point-ring: #ffffff;
  --shadow: 0 12px 30px rgba(31, 65, 135, 0.08);
  --lesson-nav-background: #dbe8fb;
  --lesson-nav-selected: #ffffff;
  --lesson-nav-text: #000000;
  --corner: 10px;
  --control-corner: 8px;
}
.visually-hidden {
  width: 1px !important;
  height: 1px !important;
  position: absolute !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #222222;
  --surface: #111111;
  --text: #ffffff;
  --muted: #b4b4b4;
  --line: #303030;
  --primary: #64a0ff;
  --primary-strong: #8bb8ff;
  --accent: #ff625e;
  --accent-strong: #ff8b88;
  --soft: #151515;
  --yellow: #ffd166;
  --progress-base: #34373b;
  --progress-revealed: #777f89;
  --plot-background: #000000;
  --plot-grid: #292929;
  --plot-axis: #a0a0a0;
  --plot-curve: #64a0ff;
  --plot-tangent: #ff625e;
  --point-ring: #000000;
  --shadow: none;
  --lesson-nav-background: #29456f;
  --lesson-nav-selected: #4775b3;
  --lesson-nav-text: #ffffff;
  --callout-blue-background: #1a2d4c;
  --callout-red-background: #3b2025;
  --callout-yellow-background: #382f19;
  --callout-orange-background: #3b271a;
  --callout-neutral-background: #2c2d31;
}

.lesson .lede,
.lesson section > p,
.lesson .hint p,
.lesson .solution div,
.lesson .reflection p {
  color: var(--text);
}

* {
  box-sizing: border-box;
  font-variant-numeric: lining-nums;
}
*::before, *::after, *::marker { font-variant-numeric: lining-nums; }
html {
  overflow-anchor: none;
  scroll-behavior: smooth;
  background: #050505;
  font-variant-numeric: lining-nums;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: #050505;
  color: var(--text);
  font-family: "Alegreya Sans", system-ui, sans-serif;
  font-variant-numeric: lining-nums;
  font-size: 1.125rem;
  line-height: 1.62;
}

a { color: inherit; }
.site-header {
  width: 100%;
  min-height: 80px;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid #242424;
  background: #000000;
  color: #ffffff;
}

.wordmark {
  width: 38px;
  display: grid;
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: .9rem;
  line-height: .85;
}

.fraction-bar { height: 1.5px; margin: 4px 0; background: var(--accent); }
.site-header nav { display: flex; gap: 30px; grid-column: 2; }

nav a {
  color: var(--muted);
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
}

.site-header nav a { color: #aeb4bf; }
.site-header nav a:hover,
.site-header nav a[aria-current="page"] { color: #ffffff; }
.site-header nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 7px; }

.theme-toggle {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: #d4d7dc;
  font: inherit;
  cursor: pointer;
}
.toggle-track {
  width: 38px;
  height: 22px;
  position: relative;
  flex: 0 0 auto;
  border: 1px solid #686b70;
  border-radius: 999px;
  background: #34363a;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.toggle-track::after {
  content: "";
  width: 16px;
  height: 16px;
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  transition: transform 160ms ease;
}

[data-theme="dark"] .toggle-track {
  border-color: var(--primary);
  background: var(--primary);
}

[data-theme="dark"] .toggle-track::after { transform: translateX(16px); }

.theme-label {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1;
}
.theme-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 3px; }

main {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  flex: 1 0 auto;
  background: var(--background);
  box-shadow: 0 0 0 100vmax var(--background);
  clip-path: inset(0 -100vmax);
}
.hero { max-width: 650px; padding: 52px 0 50px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 28px; font-size: clamp(3.1rem, 6.6vw, 5.7rem); line-height: .98; letter-spacing: -.035em; }
h2 { font-size: 1.85rem; line-height: 1.12; letter-spacing: -.018em; }
.lede { max-width: 720px; color: var(--muted); font-size: clamp(1.28rem, 2.2vw, 1.6rem); line-height: 1.48; }
.hero h1 { margin-bottom: 14px; font-size: 2.5rem; line-height: 1.12; letter-spacing: -.018em; }
.hero .lede { max-width: 620px; font-size: 1.08rem; line-height: 1.6; }

.home-section { padding: 54px 0 110px; border-top: 1px solid var(--line); }
.section-heading { max-width: 660px; padding: 54px 0 42px; }
.section-heading h2 { margin-bottom: 12px; font-size: 2.5rem; }
.section-heading p:last-child { color: var(--muted); }
.home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.home-grid-two { grid-template-columns: repeat(2, 1fr); }

.card {
  min-height: 275px;
  padding: 4px 30px 8px 0;
  border-right: 1px solid var(--line);
}
.card + .card { padding-left: 30px; }
.card:last-child { padding-right: 0; border-right: 0; }
.card h2 { margin-bottom: 14px; }
.card p { color: var(--muted); }
.text-link { color: var(--primary); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.text-link:hover { color: var(--primary-strong); }

.listing-page { max-width: 1040px; padding: 56px 0 100px; }
.page-intro { max-width: 700px; margin-bottom: 52px; }
.page-intro h1 { margin-bottom: 16px; font-size: 2.5rem; line-height: 1.12; letter-spacing: -.018em; }
.page-intro .lede { max-width: 650px; font-size: 1.15rem; line-height: 1.58; }

.part-card-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 52px;
}
.part-card {
  aspect-ratio: 3 / 4;
  min-width: 0;
  position: relative;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--corner);
  background: #111111;
  color: #ffffff;
  box-shadow: var(--shadow);
  cursor: pointer;
  isolation: isolate;
}
.part-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .08) 62%, rgba(0, 0, 0, .18) 100%);
  transition: background-color 160ms ease;
}
.part-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 220ms ease, filter 220ms ease;
}
.part-card.is-planned img {
  filter: grayscale(1);
}
.part-card-label {
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  z-index: 2;
  font: 700 clamp(1.3rem, 2.3vw, 1.8rem)/1 "Alegreya Sans", system-ui, sans-serif;
  letter-spacing: -.02em;
  text-align: left;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .65);
}
.part-card-status {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: start center;
  padding-top: 18px;
  background: rgba(6, 10, 16, .22);
  color: #ffffff;
  font: 700 clamp(.82rem, 1.4vw, 1rem)/1 "Alegreya Sans", system-ui, sans-serif;
  letter-spacing: .14em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .85);
  text-transform: uppercase;
}
.part-card:hover img { transform: scale(1.035); }
.part-card.is-selected {
  outline: 4px solid var(--accent);
  outline-offset: 3px;
}
.part-card.is-selected:not(.is-planned) img { filter: saturate(1.08) contrast(1.04); }
.part-card:focus-visible {
  outline: 4px solid var(--primary);
  outline-offset: 3px;
}

.curriculum-list { border-top: 1px solid var(--line); }
[data-part-panel][hidden] { display: none; }
.curriculum-part {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 30px;
  padding: 34px 0 0;
}
.part-number { padding-top: 4px; color: var(--primary); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.part-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.part-heading h2 { margin-bottom: 10px; }
.part-content > p { max-width: 670px; margin-bottom: 0; color: var(--muted); }
.status { flex: 0 0 auto; color: var(--primary); font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.status.planned { color: var(--muted); }
.chapter-list { margin-top: 30px; }
.chapter { margin-top: 30px; }
.chapter:first-child { margin-top: 0; }
.chapter h3 { margin: 0 0 10px; font-size: 1.45rem; line-height: 1.2; }
.chapter h3 a { color: var(--primary); text-decoration: none; }
.chapter h3 a:hover, .chapter h3 a:focus-visible { color: var(--primary-strong); text-decoration: underline; text-underline-offset: 3px; }
.chapter ol { margin: 0; padding: 0; list-style: none; }
.chapter li {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.chapter li span { color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.chapter li a { display: contents; color: var(--primary); font-weight: 700; }
.chapter li a span { color: var(--primary); }
.chapter li.chapter-review { grid-template-columns: minmax(0, 1fr) auto; }
.chapter li.chapter-review a { display: block; }
.chapter li.chapter-review.planned-section::after { grid-column: 2; }
.planned-section { color: var(--muted); }
.planned-section::after {
  content: "Planned";
  grid-column: 3;
  align-self: center;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.capstone { margin: 30px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); }
.capstone strong { color: var(--text); }
.capstone a { color: var(--primary); text-decoration: none; }
.capstone a:hover, .capstone a:focus-visible { color: var(--primary-strong); text-decoration: underline; text-underline-offset: 3px; }
.part-image-credit {
  grid-column: 1 / -1;
  margin: 34px 0 0;
  padding: 12px 0 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
  text-align: right;
}
.part-image-credit a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
  text-underline-offset: 3px;
}
.part-image-credit a:hover { color: var(--text); }
.part-outline { margin-top: 22px; }
.part-outline summary {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.part-outline summary::-webkit-details-marker { display: none; }
.part-outline summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}
.part-outline[open] summary::before { transform: rotate(45deg) translate(-2px, -2px); }
.part-outline summary:hover { color: var(--primary-strong); }
.part-outline summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 30%, transparent); outline-offset: 4px; }

.demo-list { border-top: 1px solid var(--line); }
.demo-list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: end;
  padding: 34px 0 38px;
  border-bottom: 1px solid var(--line);
}
.demo-list-item h2 { margin-bottom: 10px; }
.demo-list-item p { max-width: 620px; margin-bottom: 0; color: var(--muted); }
.demo-list-item .text-link { white-space: nowrap; }

.reading-layout {
  max-width: none;
  width: calc(100% - clamp(230px, 23vw, 300px));
  margin: 0 0 0 clamp(230px, 23vw, 300px);
  padding: 28px 0 96px;
}
.lesson-index {
  width: clamp(230px, 23vw, 300px);
  height: auto;
  position: fixed;
  top: 80px;
  bottom: var(--lesson-index-footer-inset, 0px);
  left: 0;
  z-index: 2;
  overflow-y: auto;
  padding: 32px 24px 48px;
  background: var(--lesson-nav-background);
  color: var(--lesson-nav-text);
  font-size: 1.125rem;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--lesson-nav-text) 42%, transparent) transparent;
}
.lesson-index::-webkit-scrollbar { width: 7px; }
.lesson-index::-webkit-scrollbar-track { background: transparent; }
.lesson-index::-webkit-scrollbar-thumb { border-radius: 999px; background: color-mix(in srgb, var(--lesson-nav-text) 42%, transparent); }
.lesson { width: min(680px, calc(100% - 40px)); margin: 0 auto; }
.lesson-index a { color: var(--lesson-nav-text); font-weight: 700; }
.lesson-index-toggle { display: none; }
.curriculum-navigation-part, .curriculum-navigation-chapter { margin: 0; }
.navigation-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 5px; align-items: start; }
.navigation-row a { min-width: 0; padding: 5px 2px; line-height: 1.22; text-decoration: none; }
.navigation-row a:hover, .navigation-row a:focus-visible { text-decoration: underline; }
.navigation-chevron {
  width: 20px;
  height: 30px;
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.navigation-chevron::before, .navigate-chevron::before {
  content: "";
  width: 7px;
  height: 7px;
  position: absolute;
  top: 10px;
  left: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s ease;
}
.is-open > .navigation-row .navigation-chevron::before { transform: rotate(45deg); }
.navigation-children { display: none; }
.is-open > .navigation-children { display: block; }
.part-children { margin-left: 9px; padding: 3px 0 8px 10px; border-left: 1px solid color-mix(in srgb, var(--lesson-nav-text) 30%, transparent); }
.curriculum-navigation-part + .curriculum-navigation-part { margin-top: 8px; }
.curriculum-navigation-chapter + .curriculum-navigation-chapter { margin-top: 3px; }
.chapter-row :is(a, .unavailable-chapter) { font-size: 1rem; font-weight: 600; }
.chapter-row .unavailable-chapter { color: var(--muted); }
.section-children { margin: 2px 0 7px 25px; padding: 0; list-style: none; }
.section-children li { margin: 1px 0; border-radius: 5px; font-size: .96rem; line-height: 1.25; }
.section-children a, .section-children .planned-lesson { display: grid; grid-template-columns: 35px minmax(0, 1fr); gap: 3px; padding: 5px 7px; }
.section-children .special-page a, .section-children .special-page .planned-lesson { grid-template-columns: 72px minmax(0, 1fr); }
.section-children .review-page a, .section-children .review-page .planned-lesson { grid-template-columns: minmax(0, 1fr); }
.section-children a { font-weight: 500; text-decoration: none; }
.section-children .planned-lesson { opacity: .68; }
.section-children .current-lesson { background: var(--lesson-nav-selected); }
.section-children .current-lesson a { color: var(--text); font-weight: 700; }
.chapter-kicker { margin-bottom: 6px; color: var(--muted); font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.chapter-landing > h1 { margin-bottom: 28px; font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1; }
.chapter-image-placeholder {
  display: grid;
  min-height: 280px;
  margin-bottom: 32px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--corner);
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
}
.chapter-introduction { margin-bottom: 40px; font-size: 1.15rem; line-height: 1.6; }
.chapter-lesson-list h2 { margin-bottom: 14px; }
.chapter-lesson-list ol { margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.chapter-lesson-list li { border-bottom: 1px solid var(--line); }
.chapter-lesson-list a, .chapter-lesson-list li > div { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 17px 4px; text-decoration: none; }
.chapter-lesson-list .chapter-special-page a, .chapter-lesson-list .chapter-special-page > div { grid-template-columns: 76px minmax(0, 1fr) auto; }
.chapter-lesson-list .review-page a, .chapter-lesson-list .review-page > div { grid-template-columns: minmax(0, 1fr) auto; }
.chapter-lesson-list a:hover strong, .chapter-lesson-list a:focus-visible strong { text-decoration: underline; }
.chapter-lesson-list small { color: var(--muted); }
.lesson-index h2 { margin-bottom: 18px; font-size: 1.55rem; line-height: 1.15; }
.chapter-label { margin-bottom: 4px; color: var(--lesson-nav-text); font-size: 1.35rem; line-height: 1.2; }
.lesson-index ol { margin: 0; padding: 0; list-style: none; }
.chapter-navigation li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 7px;
  margin: 2px -12px;
  padding: 7px 12px;
  line-height: 1.3;
}
.chapter-navigation li > span, .chapter-navigation a span { color: var(--lesson-nav-text); font-variant-numeric: lining-nums tabular-nums; }
.chapter-navigation a { display: contents; }
.chapter-navigation .current-lesson {
  border-radius: 7px;
  background: var(--lesson-nav-selected);
}
.chapter-navigation .current-lesson a { color: var(--text); font-weight: 700; }
.chapter-navigation .planned-lesson { color: var(--lesson-nav-text); }
.chapter-navigation.reference-navigation li { grid-template-columns: minmax(0, 1fr); }
.reference-page-title { min-width: 0; overflow-wrap: anywhere; }
.status-label { text-transform: capitalize; }
.lesson-heading { margin-bottom: 30px; }
.lesson-heading h1 { margin-bottom: 16px; font-size: 2.5rem; line-height: 1.12; letter-spacing: -.018em; }
.lesson-heading .lede { max-width: 640px; font-size: 1.15rem; line-height: 1.58; }
.lesson-splash {
  margin: 0 0 34px;
  overflow: hidden;
  border-radius: var(--corner);
  background: var(--surface);
}
.lesson-splash img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.lesson-media {
  width: 100%;
  margin: 30px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--corner);
  background: var(--surface);
}
.lesson-image-expand {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: zoom-in;
}
.lesson-image-expand img,
.lesson-video-frame video { display: block; width: 100%; height: auto; }
.lesson-video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.lesson-video-frame iframe,
.lesson-video-frame video { width: 100%; height: 100%; border: 0; }
.lesson-media figcaption { padding: 15px 18px; border-top: 1px solid var(--line); color: var(--muted); }
.lesson-media figcaption > :first-child { margin-top: 0; }
.lesson-media figcaption > :last-child { margin-bottom: 0; }
.media-credit,
.media-video-link { margin: 0; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.media-lightbox {
  width: min(76rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 2.75rem 1rem 1rem;
  border: 0;
  border-radius: var(--corner);
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1rem 4rem #0008;
}
.media-lightbox::backdrop { background: #000b; }
.media-lightbox img { display: block; max-width: 100%; max-height: calc(100vh - 10rem); margin: 0 auto; object-fit: contain; }
.media-lightbox-close { position: absolute; top: .55rem; right: .65rem; border: 0; color: var(--text); background: transparent; font-size: 1.7rem; }
.photo-credit {
  margin: 0;
  padding: .45rem .65rem .5rem;
  color: var(--muted) !important;
  font-size: .78rem;
  line-height: 1.4;
  text-align: right;
}
.photo-credit a { color: inherit; text-decoration: underline; text-underline-offset: .14em; }
.lesson-part.overview > p:not(.photo-credit) {
  max-width: 680px;
  font-size: 1.15rem;
  line-height: 1.65;
}
.lesson section { margin-bottom: 62px; }
.lesson section > p { color: var(--text); }
.lesson p.lesson-spacer { min-height: 1.4em; }

.lesson-table-wrap {
  max-width: 100%;
  margin: 1.5rem 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--corner);
  background: var(--surface);
}
.lesson-table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
  color: var(--text);
}
.lesson-table caption {
  padding: .75rem 1rem;
  color: var(--muted);
  font-size: .95rem;
  text-align: left;
}
.lesson-table :is(th, td) {
  min-width: 6rem;
  padding: .7rem .85rem;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.lesson-table tr > :last-child { border-right: 0; }
.lesson-table th { background: color-mix(in srgb, var(--surface) 82%, var(--text)); font-weight: 600; }
.lesson-table .inline-response { white-space: nowrap; }

@media print {
  .lesson-table-wrap { overflow: visible; break-inside: avoid; }
  .lesson-table { min-width: 0; }
}

.objectives { margin: 28px 0 34px; padding: 20px 0; border-top: 1px solid var(--line); }
.objectives h3 { margin: 0 0 10px; font-size: 1.15rem; }
.objectives ul { margin-bottom: 0; }
.lesson-phase-navigation {
  display: flex;
  align-items: stretch;
  gap: 34px;
  width: fit-content;
  min-height: 46px;
  position: sticky;
  top: 80px;
  z-index: 50;
  isolation: isolate;
  margin-top: -28px;
  margin-bottom: 46px;
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  scroll-margin-top: 98px;
}
.lesson-phase-navigation::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: calc((100vw - clamp(230px, 23vw, 300px) - min(680px, calc(100vw - clamp(230px, 23vw, 300px) - 40px))) / -2);
  width: calc(100vw - clamp(230px, 23vw, 300px));
  background: var(--background);
}
.lesson-phase-navigation a {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 0;
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 700;
}
.lesson-phase-navigation a[aria-current="page"] { color: var(--text); }
.lesson-phase-navigation a[aria-current="page"]::after {
  content: "";
  height: 2px;
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  background: var(--text);
}
.lesson-part { scroll-margin-top: 28px; }
html[data-lesson-view] .lesson > .lesson-part { display: none; }
html[data-lesson-view="overview"] .lesson > .lesson-part[data-phase="overview"],
html[data-lesson-view="explore"] .lesson > .lesson-part[data-phase="explore"],
html[data-lesson-view="learn"] .lesson > .lesson-part[data-phase="learn"],
html[data-lesson-view="apply"] .lesson > .lesson-part[data-phase="apply"] { display: block; }
.explore-settings {
  display: none;
  position: fixed;
  z-index: 70;
  isolation: isolate;
  top: 98px;
  right: 22px;
  color: var(--text);
}
[data-lesson-view="explore"] .explore-settings { display: block; }
body[data-inline-lesson]:not(.inline-authoring-viewing) .explore-settings { display: none; }
.explore-progress {
  display: none;
  width: 64px;
  height: 64px;
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
}
[data-lesson-view="explore"] .explore-progress { display: block; }
body[data-inline-lesson] .explore-progress { display: none; }
[data-lesson-view="explore"] body[data-inline-lesson].inline-authoring-viewing .explore-progress { display: block; }
.explore-progress-face {
  box-sizing: border-box;
  width: 64px;
  height: 64px;
  display: block;
  overflow: visible;
  border: 1px solid var(--progress-edge);
  border-radius: 50%;
  transform: rotate(-90deg);
}
.explore-progress-face circle {
  fill: none;
  stroke-width: 11px;
}
.explore-progress-base { stroke: var(--progress-base); }
.explore-progress-reveal {
  stroke: var(--progress-revealed);
  transition: stroke-dasharray .5s ease;
}
.explore-progress-answer {
  stroke: transparent;
  transition: stroke-dasharray .5s ease, stroke .2s ease;
}
.explore-progress-answer.is-learner { stroke: var(--primary); }
.explore-progress-answer.is-automatic { stroke: var(--yellow); }
.explore-settings summary::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 11px;
  border: 1px solid var(--progress-edge);
  border-radius: 50%;
  background: var(--surface);
}
.explore-settings summary {
  --progress-edge: var(--line);
  width: 64px;
  height: 64px;
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  list-style: none;
}
.explore-settings summary::-webkit-details-marker { display: none; }
.explore-settings summary:hover {
  color: var(--primary);
}
.explore-settings summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent);
  outline-offset: 3px;
}
.explore-settings summary .explore-settings-icon {
  position: relative;
  z-index: 2;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.explore-settings-menu {
  width: max-content;
  min-width: 210px;
  position: absolute;
  z-index: 2;
  top: 72px;
  right: 0;
  overflow: hidden;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--corner);
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(20, 32, 55, .18);
}
.explore-settings-menu button {
  width: 100%;
  display: block;
  padding: 9px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .94rem;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}
.explore-settings-menu button:hover,
.explore-settings-menu button:focus-visible {
  outline: none;
  background: var(--soft);
  color: var(--primary-strong);
}
.explore-settings-menu hr {
  height: 1px;
  margin: 5px 6px;
  border: 0;
  background: var(--line);
}
.answer-all-overlay {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 18, 30, .48);
}
.answer-all-overlay[hidden] { display: none; }
.answer-all-confirmation {
  width: min(440px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--corner);
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(10, 18, 30, .3);
}
.answer-all-confirmation h2 { margin: 0 0 10px; font-size: 1.35rem; }
.answer-all-confirmation p { margin: 0; color: var(--muted); line-height: 1.5; }
.answer-all-confirmation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.answer-all-confirmation-actions button {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.answer-all-confirmation-actions button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--background);
}
.explore-fragment[hidden],
.exploration > [data-explore-segment][hidden],
.explore-checkpoint[hidden] { display: none; }
.explore-fragment.is-newly-revealed,
.exploration > [data-explore-segment].is-newly-revealed {
  animation: explore-reveal .45s ease-out both;
}
@keyframes explore-reveal {
  from { opacity: 0; color: var(--primary); }
  to { opacity: 1; color: inherit; }
}
.authoring-checkpoint,
.inline-checkpoint-command {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 .35em;
  padding: 3px 9px;
  border: 1px dashed var(--inline-ui-border, var(--line));
  border-radius: 999px;
  background: var(--inline-ui-surface, var(--soft));
  color: var(--inline-ui-accent, var(--primary));
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.25;
  vertical-align: .12em;
}
@media (prefers-reduced-motion: reduce) {
  .explore-fragment.is-newly-revealed,
  .exploration > [data-explore-segment].is-newly-revealed { animation: none; }
  .explore-progress { transition: none; }
}
.lesson-part.concepts > .guidance-callout:first-child { margin-top: 0; }
.lesson-part.apply > .exercise-set:first-child {
  padding-top: 0;
  border-top: 0;
}
.block-kind { color: var(--text); }
.content-list { margin: 20px 0; padding-left: 1.65rem; }
.content-list > li { padding-left: .25rem; }
.content-list > li + li { margin-top: .65rem; }
.content-list > li > p { margin: 0; }
.content-list > li > p + p { margin-top: .65rem; }
.content-list .content-list { margin: .65rem 0 0; }
.content-list > li > .content-list:first-child { margin-top: 0; }
.vocab-shell { position: relative; display: inline-block; }
.vocab { color: inherit; font-style: normal; font-weight: 650; cursor: help; text-decoration-line: underline; text-decoration-style: dotted; text-decoration-color: var(--primary); text-decoration-thickness: 1.5px; text-underline-offset: .18em; }
.vocab:hover, .vocab:focus-visible { color: var(--primary); }
.vocab-popover { display: none; position: absolute; z-index: 30; left: 50%; bottom: calc(100% + .55rem); width: min(20rem, calc(100vw - 1.5rem)); padding: .8rem .9rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); box-shadow: 0 10px 28px rgb(0 0 0 / .16); color: var(--text); font-size: .92rem; font-weight: 400; line-height: 1.35; pointer-events: none; transform: translateX(calc(-50% + var(--vocab-shift, 0px))); }
.vocab-popover > * { display: block; }
.vocab-popover > span { margin-top: .3rem; }
.vocab-shell:hover > .vocab-popover, .vocab-shell:focus-within > .vocab-popover, .vocab-shell.is-vocab-open > .vocab-popover { display: block; }
.chapter-vocabulary { margin: 1.5rem 0 2rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--corner); background: var(--surface); }
.chapter-vocabulary h2 { margin-top: 0; }
.chapter-vocabulary dl { display: grid; gap: .85rem; margin-bottom: 0; }
.chapter-vocabulary dl > div { display: grid; grid-template-columns: minmax(9rem, .35fr) 1fr; gap: 1rem; }
.chapter-vocabulary dt { font-weight: 700; }
.chapter-vocabulary dd { margin: 0; }
@media (max-width: 600px) { .chapter-vocabulary dl > div { grid-template-columns: 1fr; gap: .15rem; } }
.lesson-interactive { margin: 30px 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--corner); background: var(--surface); }
.desmos-plot { width: 100%; height: 410px; background: var(--plot-background); }
.desmos-plot.desmos-stacked { height: auto; }
.desmos-graph-surface { width: 100%; height: 410px; }
.desmos-expression-surface { width: 100%; height: 300px; border-top: 1px solid var(--line); }
.formal-block .lesson-interactive,
.guidance-callout .lesson-interactive,
.you-try .lesson-interactive {
  width: 560px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.formal-block .desmos-plot:not(.desmos-stacked),
.formal-block .desmos-graph-surface,
.guidance-callout .desmos-plot:not(.desmos-stacked),
.guidance-callout .desmos-graph-surface,
.you-try .desmos-plot:not(.desmos-stacked),
.you-try .desmos-graph-surface {
  width: 100%;
  height: 350px;
}
.desmos-embed[data-calculator="3d"][data-control-orientation="false"] .dcg-3d-orientation-pillbox { display: none !important; }
.lesson-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 30px 0;
  align-items: start;
}
.lesson-column { min-width: 0; }
.lesson-column > :first-child { margin-top: 0; }
.lesson-column > :last-child { margin-bottom: 0; }
.lesson-column > .lesson-interactive { margin: 0; }
.lesson-column > .desmos-embed .desmos-plot:not(.desmos-stacked),
.lesson-column > .desmos-embed .desmos-graph-surface {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}
.lesson-column > .desmos-embed .desmos-expression-surface { height: 260px; }
.desmos-bridge {
  display: grid;
  gap: 18px;
  margin: 24px 0 30px;
  padding: 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--corner);
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}
.desmos-bridge h4 { margin: 0; }
.desmos-bridge-readouts { display: flex; flex-wrap: wrap; gap: 12px; }
.desmos-bridge-readout {
  display: grid;
  grid-template-columns: auto minmax(3.5rem, auto);
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-corner);
  background: var(--surface);
}
.desmos-bridge-readout output { color: var(--primary); font-weight: 800; text-align: right; }
.desmos-bridge-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; }
.desmos-bridge-controls label { display: grid; flex: 1 1 18rem; gap: 7px; font-weight: 700; }
.desmos-bridge-controls input[type="range"] { width: 100%; accent-color: var(--primary); }
.desmos-bridge-controls button {
  min-height: 2.6rem;
  padding: 8px 14px;
  border: 1px solid var(--primary);
  border-radius: var(--control-corner);
  background: var(--surface);
  color: var(--primary);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.desmos-bridge-controls button:hover { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }

.desmos-control {
  display: grid;
  grid-template-columns: minmax(2.5rem, auto) minmax(8rem, 34rem) minmax(2.5rem, auto);
  align-items: center;
  column-gap: 10px;
  row-gap: 3px;
  margin: 18px 0;
  color: var(--ink-soft);
  font-weight: 700;
}
.desmos-control-readout {
  display: inline-flex;
  grid-column: 1 / -1;
  align-items: baseline;
  gap: .2em;
  color: var(--ink);
}
.desmos-control-readout[hidden],
.desmos-control-min[hidden],
.desmos-control-max[hidden] { display: none; }
.desmos-control-label { color: var(--ink); }
.desmos-control-value {
  display: inline-block;
  min-width: 7ch;
  color: var(--ink);
  font-family: "STIX Two Math", "Cambria Math", serif;
  font-size: 1.05em;
  font-variant-numeric: lining-nums tabular-nums;
  font-weight: 500;
  text-align: left;
}
.desmos-control-min,
.desmos-control-max {
  min-width: 2.5ch;
  color: var(--ink-soft);
  font-variant-numeric: lining-nums tabular-nums;
  font-weight: 500;
}
.desmos-control-min { justify-self: end; }
.desmos-control-max { justify-self: start; }
.desmos-value {
  padding: 0 .18em;
  border: 1px solid var(--line);
  border-radius: .18em;
}
.desmos-value.mq-math-mode {
  position: relative;
  top: .34em;
}
.desmos-control input[type="range"] {
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.desmos-control:has(.desmos-control-min[hidden]):has(.desmos-control-max[hidden]) input[type="range"] {
  grid-column: 1 / -1;
}
.desmos-control input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(to right, transparent calc(var(--desmos-zero-position, 50%) - 1px), var(--desmos-zero-color, transparent) calc(var(--desmos-zero-position, 50%) - 1px), var(--desmos-zero-color, transparent) calc(var(--desmos-zero-position, 50%) + 1px), transparent calc(var(--desmos-zero-position, 50%) + 1px)),
    #dfe2e5;
}
.desmos-control input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 32%, white);
  box-shadow: 0 1px 2px rgb(0 0 0 / .18);
}
.desmos-control input[type="range"]:is(:hover, :active)::-webkit-slider-thumb {
  background: var(--primary);
}
.desmos-control input[type="range"]::-moz-range-track {
  height: 6px;
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(to right, transparent calc(var(--desmos-zero-position, 50%) - 1px), var(--desmos-zero-color, transparent) calc(var(--desmos-zero-position, 50%) - 1px), var(--desmos-zero-color, transparent) calc(var(--desmos-zero-position, 50%) + 1px), transparent calc(var(--desmos-zero-position, 50%) + 1px)),
    #dfe2e5;
}
.desmos-control input[type="range"]::-moz-range-progress {
  height: 6px;
  background: transparent;
}
.desmos-control input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 32%, white);
  box-shadow: 0 1px 2px rgb(0 0 0 / .18);
}
.desmos-control input[type="range"]:is(:hover, :active)::-moz-range-thumb {
  background: var(--primary);
}
.desmos-control input[type="range"]:focus-visible { outline: none; }
.desmos-control input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent);
  outline-offset: 3px;
}
.desmos-control input[type="range"]:focus-visible::-moz-range-thumb {
  outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent);
  outline-offset: 3px;
}
.desmos-control :is(input[type="number"], select) {
  width: min(100%, 18rem);
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
@media (max-width: 560px) {
  .desmos-control { grid-template-columns: minmax(2rem, auto) minmax(0, 1fr) minmax(2rem, auto); column-gap: 7px; }
  .lesson-columns { grid-template-columns: 1fr; }
}
.desmos-condition {
  margin: 16px 0;
  padding: 14px 16px;
  border-left: 4px solid var(--secondary);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--secondary) 8%, var(--surface));
}
.desmos-condition > :first-child { margin-top: 0; }
.desmos-condition > :last-child { margin-bottom: 0; }
.activity-reset {
  padding: 9px 14px;
  border: 1px solid var(--primary);
  border-radius: 9px;
  background: var(--surface);
  color: var(--primary);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.activity-reset:hover { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.lesson-interactive figcaption { padding: 15px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.exercise-activity { margin: 28px 0; padding: 26px 28px; border-radius: var(--corner); border-left: 3px solid var(--yellow); background: color-mix(in srgb, var(--yellow) 10%, var(--surface)); }
.prompt { font-weight: 600; }
.inline-exercise { padding-block: 20px; }
.inline-exercise .prompt p { margin: 0; line-height: 2.5; }
.inline-response {
  display: inline-flex;
  position: relative;
  z-index: 1;
  align-items: center;
  gap: 6px;
  margin-inline: .18em;
  vertical-align: baseline;
}
.inline-response:has(dy-dropdown.is-open) { z-index: 1000; }
.inline-response:has(> .math-symbol-palette.is-active),
.response-check:has(> .math-symbol-palette.is-active) { z-index: 1000; }
.inline-response input[type="text"],
.inline-response select {
  width: auto;
  min-width: 4.5rem;
  height: 2.15rem;
  box-sizing: border-box;
  padding: 4px 30px 4px 9px;
  border: 2px solid var(--line);
  border-radius: var(--control-corner);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  line-height: 1.2;
}
.mathquill-native-input {
  width: 1px !important;
  height: 1px !important;
  position: absolute !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.mathquill-response-field {
  min-width: 4.5rem;
  min-height: 2.15rem;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  padding: 4px 30px 4px 9px;
  border: 2px solid var(--line);
  border-radius: var(--control-corner);
  background: var(--surface);
  color: var(--text);
  cursor: text;
}
.mathquill-response-field[hidden] { display: none !important; }
.mathquill-response-field.mq-focused {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
.mathquill-response-field.is-locked {
  cursor: default;
}
.matrix-response-editor {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .28rem;
  /* Keep the right bracket clear of the response check/X overlay. */
  padding: .35rem 1.7rem .35rem .45rem;
  border: 2px solid var(--line);
  border-radius: var(--control-corner);
  background: var(--surface);
  vertical-align: middle;
}
.matrix-response-editor:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
.matrix-response-dimensions {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  color: var(--muted);
  font-size: .72em;
  line-height: 1;
}
.matrix-response-dimensions input[type="number"] {
  width: 2.35rem;
  height: 1.55rem;
  padding: 1px 2px;
  border: 1px solid var(--line);
  border-radius: .3rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: center;
  appearance: textfield;
}
.matrix-response-dimensions input::-webkit-inner-spin-button { appearance: none; }
.matrix-response-dimensions input.is-invalid { border-color: #c73939; }
.matrix-response-frame {
  position: relative;
  padding: .18rem .55rem;
}
.matrix-response-frame::before,
.matrix-response-frame::after {
  content: "";
  position: absolute;
  inset-block: 0;
  width: .38rem;
  border-block: 2px solid currentColor;
}
.matrix-response-frame::before { left: 0; border-left: 2px solid currentColor; }
.matrix-response-frame::after { right: 0; border-right: 2px solid currentColor; }
.matrix-response-grid {
  display: grid;
  align-items: center;
  gap: .2rem .35rem;
}
.matrix-response-cell {
  position: relative;
  display: inline-flex;
  min-width: 2.25rem;
  min-height: 1.65rem;
  align-items: center;
  justify-content: center;
  padding: .08rem .2rem;
  border-radius: .25rem;
  color: var(--text);
  text-align: center;
}
.matrix-response-cell::after {
  content: "0";
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: color-mix(in srgb, var(--muted) 58%, transparent);
  pointer-events: none;
}
.matrix-response-cell.is-implicit-zero::after { display: grid; }
.matrix-response-cell.mq-focused { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.matrix-response-cell .mq-root-block {
  min-width: .4rem;
  text-align: center;
}
.matrix-response-editor.is-locked { cursor: default; }
.inline-response.is-correct .matrix-response-editor {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
}
.inline-response.is-incorrect .matrix-response-editor {
  border-color: #c73939;
  background: color-mix(in srgb, #c73939 8%, var(--surface));
}
.math-symbol-palette {
  width: max-content;
  max-width: calc(100vw - 16px);
  display: none;
  position: absolute;
  z-index: 2147483647;
  top: calc(100% + 5px);
  left: 0;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: .48rem;
  background: var(--surface);
  box-shadow: 0 .35rem 1rem color-mix(in srgb, var(--text) 18%, transparent);
}
.math-symbol-palette.is-active,
.math-symbol-palette.is-open,
.math-symbol-palette:focus-within {
  display: inline-flex;
}
.math-symbol-palette-symbols {
  display: none;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px;
}
.math-symbol-palette-shortcut {
  display: none;
  min-height: 1.2em;
  padding: 0 .3rem .1rem;
  color: var(--muted);
  font-size: .82em;
  line-height: 1.2;
  white-space: nowrap;
}
.math-symbol-palette.is-open .math-symbol-palette-shortcut {
  display: block;
}
.math-symbol-palette.is-open .math-symbol-palette-symbols {
  display: inline-flex;
}
.math-symbol-palette.is-open .math-symbol-palette-trigger {
  display: none;
}
.math-symbol-palette :is(.math-symbol-palette-trigger, .math-symbol-palette-button) {
  display: inline-grid;
  place-items: center;
  height: 1.7rem;
  border: 1px solid var(--line);
  border-radius: .38rem;
  background: color-mix(in srgb, var(--soft) 58%, var(--surface));
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.math-symbol-palette-trigger {
  padding: 0 .55rem;
  line-height: 1;
}
.math-symbol-palette-button {
  width: 1.7rem;
  padding: 0;
}
.math-symbol-palette-button mjx-container {
  margin: 0 !important;
  font-size: inherit;
}
.math-symbol-palette :is(.math-symbol-palette-trigger, .math-symbol-palette-button):hover,
.math-symbol-palette :is(.math-symbol-palette-trigger, .math-symbol-palette-button):focus-visible {
  border-color: var(--primary);
  background: var(--soft);
  color: var(--primary-strong);
  outline: none;
}
.math-symbol-palette :is(.math-symbol-palette-trigger, .math-symbol-palette-button):disabled {
  opacity: .42;
  cursor: default;
}
.inline-response.is-correct .mathquill-response-field {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
}
.inline-response.is-correct.is-revealed .mathquill-response-field {
  border-color: var(--yellow);
  background: color-mix(in srgb, var(--yellow) 24%, var(--surface));
}
.inline-response.is-incorrect .mathquill-response-field {
  border-color: #c73939;
  background: color-mix(in srgb, #c73939 8%, var(--surface));
}
.inline-response input::placeholder { color: var(--muted); opacity: .7; text-align: center; }
.inline-response select {
  min-width: 8rem;
  appearance: none;
  -webkit-appearance: none;
}
.inline-response select.awaiting-answer { color: var(--muted); }
.inline-response input[readonly],
.inline-response select:disabled {
  opacity: 1;
  cursor: default;
  -webkit-text-fill-color: currentColor;
}
.inline-response .response-feedback {
  position: absolute;
  right: 9px;
  color: currentColor;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}
.inline-response.is-incorrect .response-feedback {
  font-size: 1.25rem;
}
.inline-response.is-correct { color: var(--primary); }
.inline-response.is-correct input,
.inline-response.is-correct select,
.inline-response.is-correct .custom-dropdown-trigger {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
}
.inline-response.is-correct.is-revealed { color: color-mix(in srgb, var(--yellow) 72%, var(--text)); }
.inline-response.is-correct.is-revealed input,
.inline-response.is-correct.is-revealed select,
.inline-response.is-correct.is-revealed .custom-dropdown-trigger {
  border-color: var(--yellow);
  background: color-mix(in srgb, var(--yellow) 24%, var(--surface));
}
.response-hint {
  width: 1.5em;
  height: 1.5em;
  position: relative;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: .08em;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1;
  vertical-align: -.12em;
  cursor: help;
}
.inline-response.has-incorrect-attempt:not(.is-correct) + .response-hint {
  display: inline-flex;
}
.response-hint:hover,
.response-hint:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}
.response-hint-tooltip {
  width: max-content;
  max-width: min(260px, calc(100vw - 32px));
  position: absolute;
  left: calc(50% + var(--response-hint-tooltip-shift, 0px));
  bottom: calc(100% + 8px);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(20, 32, 55, .16);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%, 3px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  pointer-events: none;
}
.response-hint:hover .response-hint-tooltip,
.response-hint:focus .response-hint-tooltip,
.response-hint:focus-within .response-hint-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}
dy-dropdown {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
}
dy-dropdown.is-open { z-index: 1000; }
.custom-dropdown-native {
  width: 1px !important;
  height: 1px !important;
  position: absolute !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.custom-dropdown-trigger {
  min-width: 8.5em;
  padding: .28em 1.9em .28em .65em;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.custom-dropdown-trigger::after {
  content: " ";
  width: .4em;
  height: .4em;
  position: absolute;
  top: 50%;
  right: .6em;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
}
:is(.inline-response, .response-check):is(.is-correct, .is-incorrect) .custom-dropdown-trigger::after {
  display: none;
}
.custom-dropdown-trigger.awaiting-answer { color: var(--muted); }
.custom-dropdown-trigger:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 30%, transparent);
  outline-offset: 2px;
}
.custom-dropdown-list {
  min-width: 100%;
  width: max-content;
  max-width: min(28rem, 85vw);
  position: absolute;
  z-index: 90;
  top: calc(100% + 5px);
  left: 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(20, 32, 55, .2);
}
.custom-dropdown-list[hidden] { display: none; }
.custom-dropdown-list button {
  width: 100%;
  display: block;
  padding: 7px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.custom-dropdown-list button:hover,
.custom-dropdown-list button:focus-visible,
.custom-dropdown-list button[aria-selected="true"] {
  outline: none;
  background: var(--soft);
  color: var(--primary-strong);
}
.inline-response.is-incorrect { color: #c73939; }
.inline-response.is-incorrect input,
.inline-response.is-incorrect select,
.inline-response.is-incorrect .custom-dropdown-trigger {
  border-color: #c73939;
  background: color-mix(in srgb, #c73939 8%, var(--surface));
}
.responses { display: grid; gap: 16px; margin: 22px 0; }
.responses,
.inline-response { font-variant-numeric: lining-nums; }
.response-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.response-row > * { flex: 1 1 12rem; }
.response-row label,
.responses > :is(.numeric-response, .select-response) { display: grid; gap: 7px; color: var(--muted); font-size: .9rem; }
.response-row input[type="text"], .response-row select,
.responses > :is(.numeric-response, .select-response) :is(input[type="text"], select) { width: 100%; }
.response-row :is(input[type="text"], select),
.responses > :is(.numeric-response, .select-response) :is(input[type="text"], select) {
  height: 44px;
  padding: 9px 34px 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--control-corner);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.response-check { position: relative; }
.response-check .response-feedback {
  position: absolute;
  right: 10px;
  bottom: 11px;
  font-weight: 700;
  pointer-events: none;
}
.response-check.is-correct { color: var(--primary); }
.response-check.is-correct input,
.response-check.is-correct select { border-color: var(--primary); }
.response-check.is-incorrect { color: #c73939; }
.response-check.is-incorrect input,
.response-check.is-incorrect select { border-color: #c73939; }
input[type="text"], textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--control-corner);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
input[type="text"] { min-width: 0; padding: 9px 10px; }
textarea { margin-bottom: 16px; padding: 10px 12px; resize: vertical; }
.hint, .solution, .proof { margin-top: 14px; }
.hint summary, .solution summary, .proof summary { width: fit-content; color: var(--primary); font-weight: 700; cursor: pointer; }
.hint > p, .solution > div, .proof > div { margin: 10px 0 0; color: var(--muted); }
.reflection { margin: 32px 0; padding: 22px 25px; border-radius: var(--corner); border-left: 3px solid var(--primary); background: var(--soft); }
.reflection p { margin: 5px 0 0; color: var(--muted); }
.subsection { margin-bottom: 52px !important; }
.subsection h3, .exercise-set h3 { margin-bottom: 16px; font-size: 1.55rem; line-height: 1.2; }
.formal-block { margin: 30px 0; padding: 25px 28px; border: 1px solid var(--line); border-radius: var(--corner); background: var(--surface); }
.formal-block.definition, .formal-block.fact { border-left: 4px solid var(--primary); }
.formal-block.example { border-left: 4px solid var(--accent); }
.formal-block.principle { border-left: 4px solid var(--yellow); }
.formal-block.theorem, .formal-block.proposition, .formal-block.lemma, .formal-block.corollary { border-left: 4px solid var(--primary); }
.block-kind { margin: 0 0 7px; color: var(--muted); font-size: .76rem; font-weight: 800; letter-spacing: .09em; line-height: 1.2; text-transform: uppercase; }
.formal-block h4 { margin: 0 0 12px; font-size: 1.28rem; }
.formal-block p:last-child, .statement { margin-bottom: 0; }
.guidance-callout, .you-try { margin: 30px 0; padding: 22px 25px; border: 1px solid var(--line); border-radius: var(--corner); background: var(--soft); }
.guidance-callout.tip { border-left: 4px solid var(--primary); }
.guidance-callout.warning { border-left: 4px solid #d96a24; }
.guidance-callout.note { border-left: 4px solid var(--muted); }
.guidance-callout.reflection { border-left: 4px solid var(--primary); }
.you-try { border-left: 4px solid var(--accent); background: var(--surface); }
.guidance-callout h4, .you-try h4 { margin: 0 0 10px; font-size: 1.28rem; }
.guidance-callout p:last-child, .you-try-prompt > :last-child { margin-bottom: 0; }
.exercise-set { margin-bottom: 54px !important; padding-top: 28px; border-top: 1px solid var(--line); }
.exercises { display: grid; gap: 28px; margin: 0; padding-left: 2rem; }
.exercise-item { padding-left: .35rem; }
.exercise-item::marker, .task-item::marker { color: var(--muted); font-weight: 700; font-variant-numeric: lining-nums; }
.exercise-content > .exercise-activity { margin: 0; }
.tasks { display: grid; gap: 18px; margin: 20px 0; padding-left: 1.65rem; color: inherit; }
.task-item { padding-left: .25rem; }
.task-content > .exercise-activity { margin: 0; }
.exercise-set .exercise-activity { background: var(--surface); }
.choices { display: grid; gap: 10px; margin: 20px 0; padding: 0; border: 0; }
.choices legend { margin-bottom: 8px; color: var(--muted); font-size: .9rem; }
.choices label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: var(--control-corner);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.choices label:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); }
.choices label:focus-within { outline: 2px solid color-mix(in srgb, var(--primary) 30%, transparent); }
.choices input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.choices.is-correct label:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
  color: var(--primary);
}
.choices.is-correct label:has(input:checked)::after {
  content: "✓";
  font-weight: 700;
}
.choices.is-incorrect label:has(input:checked) {
  border-color: #c73939;
  background: color-mix(in srgb, #c73939 8%, var(--surface));
  color: #c73939;
}
.choices.is-incorrect label:has(input:checked)::after {
  content: "×";
  font-weight: 700;
}
.choices label:has(input:disabled) { cursor: default; }
.phase-sequence-navigation { display: flex; justify-content: space-between; gap: 24px; margin-top: 54px; padding-top: 22px; border-top: 1px solid var(--line); }
.phase-sequence-navigation a { color: var(--primary); font-weight: 700; }
.phase-sequence-navigation .next-phase { margin-left: auto; text-align: right; }

.comparison, .readout { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 30px 0; overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.comparison div, .readout div { display: grid; gap: 4px; padding: 20px; background: var(--surface); }
.comparison span, .readout span { color: var(--muted); font-size: .9rem; }
.callout { padding: 32px 34px; border-left: 3px solid var(--primary); background: var(--soft); }
.callout h2 { font-size: 2.2rem; }

:root[data-theme="dark"] .exercise-activity,
:root[data-theme="dark"] .formal-block.principle {
  background: var(--callout-yellow-background);
}
:root[data-theme="dark"] .reflection,
:root[data-theme="dark"] .formal-block.definition,
:root[data-theme="dark"] .formal-block.fact,
:root[data-theme="dark"] .formal-block.theorem,
:root[data-theme="dark"] .formal-block.proposition,
:root[data-theme="dark"] .formal-block.lemma,
:root[data-theme="dark"] .formal-block.corollary,
:root[data-theme="dark"] .guidance-callout.tip,
:root[data-theme="dark"] .guidance-callout.reflection,
:root[data-theme="dark"] .callout {
  background: var(--callout-blue-background);
}
:root[data-theme="dark"] .formal-block.example,
:root[data-theme="dark"] .you-try {
  background: var(--callout-red-background);
}
:root[data-theme="dark"] .guidance-callout.warning {
  background: var(--callout-orange-background);
}
:root[data-theme="dark"] .guidance-callout.note {
  background: var(--callout-neutral-background);
}

.lesson-nav { display: flex; justify-content: space-between; padding-top: 28px; border-top: 1px solid var(--line); }

.demo-page { padding: 56px 0 96px; }
.demo-intro { max-width: 700px; margin-bottom: 36px; }
.demo-intro h1 { margin-bottom: 16px; font-size: 2.5rem; line-height: 1.12; letter-spacing: -.018em; }
.demo-intro .lede { max-width: 650px; font-size: 1.15rem; line-height: 1.58; }
.interactive-card { overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.plot-wrap { padding: 14px; background: var(--plot-background); }
#calculator, #calculator-3d, #calculator-domain-coloring { width: 100%; height: min(64vw, 580px); min-height: 420px; }
.desmos-message { height: 100%; display: grid; place-content: center; gap: 8px; padding: 28px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }
.desmos-message strong { color: var(--text); font-size: 1.3rem; }
.desmos-message code { color: var(--primary); }
.desmos-caption { margin: 0; padding: 17px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 1rem; }
.demo-controls { padding: 28px 34px 32px; border-top: 1px solid var(--line); }
.demo-controls label { display: block; font-size: 1.2rem; }
input[type="range"] { width: 100%; margin: 20px 0 10px; accent-color: var(--accent); }
.readout { grid-template-columns: repeat(3, 1fr); }
.hint { margin-bottom: 0; color: var(--muted); font-size: 1rem; }
.demo-explanation { max-width: 680px; padding-top: 68px; }
.demo-explanation p { color: var(--muted); }
.demo-links { display: flex; flex-wrap: wrap; gap: 12px 28px; }

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  width: 100%;
  margin: 0;
  padding: 18px 20px;
  background: #050505;
  color: #f5f5f5;
  font-size: .9rem;
}
footer p { margin: 0; }
.site-footer-links { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.site-footer-links > a { color: inherit; font-weight: 700; text-underline-offset: .16em; }
.privacy-page { max-width: 760px; }
.privacy-content { display: grid; gap: 34px; }
.privacy-content section { margin: 0; }
.privacy-content h2 { margin: 0 0 10px; font-size: 1.45rem; }
.privacy-content p { margin: 0; color: var(--muted); }
.privacy-content p + p { margin-top: 12px; }
.privacy-content ul { margin: 12px 0 0; color: var(--muted); }
.privacy-content strong { color: var(--text); }
.license-link {
  display: inline-flex;
  align-items: center;
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}
.license-link:hover, .license-link:focus-visible { text-decoration: underline; }
.license-icon { display: block; width: 88px; height: 31px; }

@media (max-width: 760px) {
  /* Give the browser enough real scroll range to place even the final answer
     near the top while its keyboard is open. This space exists only for the
     active editing session and collapses again when the field loses focus. */
  body:has(.math-symbol-palette.is-active) .lesson { padding-bottom: 100dvh; }

  .site-header {
    width: 100%;
    min-height: 104px;
    padding: 12px 20px;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    row-gap: 8px;
  }
  .site-header nav { grid-column: 1 / -1; grid-row: 2; justify-self: center; gap: 24px; }
  .theme-toggle { grid-column: 2; grid-row: 1; }
  .hero { padding: 40px 0 42px; }
  .home-grid, .reading-layout { grid-template-columns: 1fr; }
  .home-grid-two { grid-template-columns: 1fr; }
  .card, .card + .card { min-height: 0; padding: 28px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .card:last-child { border-bottom: 0; }
  .reading-layout { gap: 32px; padding-top: 0; }
  .lesson-index, .lesson { grid-column: 1; }
  .lesson {
    width: 100%;
    position: relative;
    padding-inline: 16px;
  }
  .chapter-landing { padding-top: 20px; }
  .reading-layout { width: 100%; margin-left: 0; }
  .lesson-index {
    width: 100%;
    height: auto;
    min-height: 0;
    position: relative;
    top: auto;
    z-index: 20;
    overflow: visible;
    padding: 0;
    border-bottom: 1px solid var(--line);
  }
  .lesson-index-toggle {
    display: flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }
  .navigate-chevron { width: 20px; height: 28px; position: relative; }
  .navigate-chevron::before { transform: rotate(45deg); }
  .mobile-navigation-open .navigate-chevron::before { transform: rotate(225deg); }
  .curriculum-navigation {
    display: none;
    width: 100%;
    max-height: min(68dvh, 560px);
    position: absolute;
    top: 100%;
    left: 0;
    overflow-y: auto;
    padding: 18px 20px 24px;
    border-top: 1px solid color-mix(in srgb, var(--lesson-nav-text) 22%, transparent);
    background: var(--lesson-nav-background);
    box-shadow: 0 16px 26px rgba(0, 0, 0, .2);
    scrollbar-width: thin;
  }
  .mobile-navigation-open .curriculum-navigation { display: block; }
  .lesson-index.mobile-navigation-open { z-index: 60; }
  .navigation-chevron { display: none; }
  .navigation-row { display: block; }
  .navigation-children, .is-open > .navigation-children { display: none; }
  .curriculum-navigation-part.is-current > .part-children,
  .curriculum-navigation-chapter.is-current > .section-children { display: block; }
  .part-children { margin: 0 0 8px 8px; padding: 0 0 0 10px; border-left: 1px solid color-mix(in srgb, var(--lesson-nav-text) 30%, transparent); }
  .section-children { margin-left: 12px; }
  .curriculum-navigation-part + .curriculum-navigation-part { margin-top: 7px; }
  .navigation-row a { display: block; padding: 8px 5px; }
  .curriculum-navigation-part.is-current > .part-row a { text-decoration: underline; text-underline-offset: 3px; }
  .chapter-image-placeholder { min-height: 210px; }
  .comparison, .readout { grid-template-columns: 1fr; }
  .response-row { display: grid; grid-template-columns: 1fr; }
  .exercise-activity, .formal-block { padding: 22px 20px; }
  .desmos-plot { height: 340px; }
  .desmos-plot.desmos-stacked { height: auto; }
  .desmos-graph-surface { height: 340px; }
  .desmos-expression-surface { height: 260px; }
  .demo-controls { padding: 24px 20px; }
  .plot-wrap { padding: 8px; }
  #calculator, #calculator-3d { height: 520px; min-height: 0; }
  .desmos-caption { padding: 17px 20px; }
  .lesson-nav { gap: 18px; }
  .listing-page { padding-top: 42px; }
  .page-intro { margin-bottom: 38px; }
  .part-card-list {
    width: calc(100% + 20px);
    grid-template-columns: repeat(5, 142px);
    gap: 10px;
    margin-bottom: 42px;
    padding: 8px 20px 12px 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .part-card {
    scroll-snap-align: start;
    border-radius: 8px;
  }
  .part-card.is-selected { outline: 0; }
  .part-card.is-selected::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    border: 4px solid var(--accent);
    border-radius: inherit;
    pointer-events: none;
  }
  .part-card-label { font-size: 1.35rem; }
  .curriculum-part { grid-template-columns: 1fr; gap: 10px; }
  .part-heading { align-items: flex-start; }
  .chapter li { grid-template-columns: 38px 1fr; }
  .planned-section::after { display: none; }
  .demo-list-item { grid-template-columns: 1fr; gap: 18px; align-items: start; }
  .lesson-phase-navigation {
    box-sizing: border-box;
    width: 100vw;
    min-height: 46px;
    top: 104px;
    gap: 34px;
    margin-top: 0;
    margin-left: calc(50% - 50vw);
    padding-inline: 16px;
  }
  .lesson-phase-navigation::before { right: 0; bottom: 0; left: 0; width: 100%; }
  [data-lesson-view="explore"] .lesson-part.exploration { padding-top: 48px; }
  .explore-settings {
    width: 64px;
    height: 64px;
    position: absolute;
    top: calc(100% + 13px);
    right: 12px;
    left: auto;
    background: transparent;
  }
  .explore-settings-menu {
    width: min(210px, calc(100vw - 24px));
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .part-card img { transition: none; }
}
.algebra-checkpoint {
  margin: 0 0 2rem;
  padding: 1rem;
  border: 1px solid var(--border-color, #b9c9c1);
  border-radius: 0.75rem;
  background: var(--surface, #fff);
}

.algebra-checkpoint-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.algebra-checkpoint-heading h3,
.algebra-checkpoint-heading p {
  margin: 0 0 0.35rem;
}

.algebra-checkpoint-presets,
.algebra-checkpoint-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.algebra-checkpoint button,
.algebra-checkpoint input {
  font: inherit;
}

.algebra-checkpoint button {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border-color, #9bb3a8);
  border-radius: 0.45rem;
  background: var(--surface, #fff);
  color: inherit;
  cursor: pointer;
}

.algebra-checkpoint-fields label {
  display: grid;
  gap: 0.2rem;
  min-width: 7rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.algebra-checkpoint-fields label:first-child,
.algebra-checkpoint-fields label:nth-child(2) {
  flex: 1 1 15rem;
}

.algebra-checkpoint-fields input {
  min-width: 0;
  padding: 0.5rem;
  border: 1px solid var(--border-color, #9bb3a8);
  border-radius: 0.4rem;
  background: var(--surface, #fff);
  color: inherit;
}

.algebra-checkpoint-status {
  padding: 0.65rem 0.8rem;
  border-radius: 0.45rem;
  background: color-mix(in srgb, currentColor 6%, transparent);
}

.algebra-checkpoint-status.is-error {
  color: #a12626;
}

.algebra-checkpoint-table-wrap {
  overflow-x: auto;
}

.algebra-checkpoint table {
  width: 100%;
  border-collapse: collapse;
}

.algebra-checkpoint th,
.algebra-checkpoint td {
  padding: 0.5rem;
  border-top: 1px solid var(--border-color, #d3ddd8);
  text-align: left;
  vertical-align: top;
}

.algebra-checkpoint-math {
  min-width: 10rem;
  text-align: center !important;
}

.algebra-checkpoint-math mjx-container[display="true"] {
  margin: 0 !important;
}

.algebra-checkpoint pre {
  max-width: 34rem;
  margin: 0.4rem 0 0;
  overflow-x: auto;
  font-size: 0.75rem;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .algebra-checkpoint-heading {
    display: block;
  }
}
.exercise-item, .task-item { position: relative; }
.exercise-reroll-control,
.exercise-item > .inline-randomization-control,
.task-item > .inline-randomization-control { position: absolute; top: 0; right: -4.25rem; display: flex; align-items: center; gap: .45rem; z-index: 2; }
.exercise-reroll-button { width: 2.35rem; height: 2.1rem; padding: .1rem; border: 0; background: transparent; color: #197653; cursor: pointer; }
.exercise-reroll-button:focus-visible, .reroll-all-exercises:focus-visible { outline: 2px solid #197653; outline-offset: 2px; }
.exercise-reroll-dice-icon { display: block; width: 100%; height: 100%; overflow: visible; }
.exercise-reroll-dice-icon rect { fill: currentColor; stroke: var(--surface, #fff); stroke-width: .6; }
.exercise-reroll-dice-icon circle { fill: var(--surface, #fff); }
.exercise-attempt-history {
  display: flex;
  align-items: center;
  gap: .28rem;
  min-width: 6rem;
  font: 800 .72rem/1 system-ui, sans-serif;
  position: absolute;
  right: 2.55rem;
  top: 50%;
  padding: .34rem .42rem;
  border: 1px solid var(--line, #cad6d0);
  border-radius: 999px;
  background: var(--surface, #fff);
  box-shadow: 0 .2rem .7rem rgb(20 38 30 / .14);
  opacity: 0;
  visibility: hidden;
  transform: translate(.35rem, -50%);
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  pointer-events: none;
}
.exercise-reroll-control:hover .exercise-attempt-history,
.exercise-reroll-control:has(.exercise-reroll-button:focus-visible) .exercise-attempt-history,
.exercise-attempt-history.is-recent {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
  transition-delay: 0s;
}
.exercise-attempt-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  border: 2px solid #aeb5b1;
  border-radius: 50%;
  background: #dfe3e1;
}
.exercise-attempt-slot.is-correct {
  border-color: #2d67dc;
  background: #e8efff;
  color: #2d67dc;
}
.exercise-attempt-slot.is-retry {
  border-color: #c79616;
  background: #fff6cf;
  color: #b27c00;
}
.exercise-attempt-slot.is-incorrect {
  border-color: #c94343;
  background: #fff0f0;
  color: #c94343;
}
@media (prefers-reduced-motion: reduce) {
  .exercise-attempt-history { transition: none; }
}
#apply { position: relative; }
#apply > .reroll-all-exercises { position: absolute; top: 0; right: 0; float: none; margin: 0; padding: .35rem .65rem; border: 1px solid var(--line, #cad6d0); border-radius: .4rem; background: var(--surface, #fff); color: #197653; font: 650 .9rem "Alegreya Sans", system-ui, sans-serif; cursor: pointer; }

@media (max-width: 900px) and (pointer: coarse) {
  .exercise-reroll-control { right: 0; }
  .exercise-item:has(> .exercise-reroll-control) > .exercise-content,
  .task-item:has(> .exercise-reroll-control) > .task-content { padding-right: 4.25rem; }
}

/* Display math can occur within a source paragraph. Keep its HTML wrapper
   phrasing-safe while retaining the visual block layout. */
span.math-display-block {
  display: block;
  max-width: 100%;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
span.math-display-block > mjx-container[display="true"] {
  width: max-content !important;
  min-width: 100%;
  margin-inline: 0 !important;
  text-align: center !important;
}
.math-response-display-content {
  width: max-content;
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .18em;
  padding-block: .75em;
}
.math-response-display-fragment > mjx-container { margin: 0 !important; }
.math-response-display .inline-response { flex: 0 0 auto; vertical-align: middle; }
.math-response-display:has(.inline-response:focus-within, .math-symbol-palette.is-active, .math-symbol-palette.is-open) .math-response-display-content {
  /* The symbol palette is absolutely positioned below its response field.
     Give it room inside the display's clipped vertical viewport. */
  padding-bottom: 5rem;
}
span.math-display-block.is-horizontally-scrollable {
  padding-bottom: 1.35rem;
  border-inline: 1px solid color-mix(in srgb, var(--muted) 32%, transparent);
}
span.math-display-block.is-horizontally-scrollable::after {
  content: "Scroll to see the full equation \2194";
  width: 100%;
  position: sticky;
  left: 0;
  display: block;
  margin-top: .15rem;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
}
@media (max-width: 760px) {
  span.math-display-block.is-list-breakout {
    width: calc(100% + var(--math-breakout-left, 0px) + var(--math-breakout-right, 0px));
    max-width: none;
    margin-left: calc(-1 * var(--math-breakout-left, 0px));
  }
  span.math-display-block.is-horizontally-scrollable::after { content: "Swipe to see the full equation \2194"; }
}

.lesson mark[data-text-highlight] { padding: .04em .14em; border-radius: .25em; color: inherit; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.lesson mark[data-text-highlight="red"] { background: #ffb8b8; }
.lesson mark[data-text-highlight="blue"] { background: #a9c8ff; }
.lesson mark[data-text-highlight="green"] { background: #bce8c5; }
.lesson mark[data-text-highlight="yellow"] { background: #ffe58f; }
.lesson mark[data-text-highlight="orange"] { background: #ffc99b; }
.lesson mark[data-text-highlight="violet"] { background: #d0b8f5; }
.lesson mark[data-text-highlight="cyan"] { background: #a7e4ea; }
.lesson mark[data-text-highlight="rose"] { background: #f5c6e2; }
.lesson mark[data-text-highlight="lime"] { background: #d7e69b; }
.lesson mark[data-text-highlight="gray"] { background: #d9dfdc; }
:root[data-theme="dark"] .lesson mark[data-text-highlight="red"] { background: #71343a; }
:root[data-theme="dark"] .lesson mark[data-text-highlight="blue"] { background: #304f91; }
:root[data-theme="dark"] .lesson mark[data-text-highlight="green"] { background: #25603d; }
:root[data-theme="dark"] .lesson mark[data-text-highlight="yellow"] { background: #66531c; }
:root[data-theme="dark"] .lesson mark[data-text-highlight="orange"] { background: #713f1d; }
:root[data-theme="dark"] .lesson mark[data-text-highlight="violet"] { background: #533d78; }
:root[data-theme="dark"] .lesson mark[data-text-highlight="cyan"] { background: #1d5b66; }
:root[data-theme="dark"] .lesson mark[data-text-highlight="rose"] { background: #713854; }
:root[data-theme="dark"] .lesson mark[data-text-highlight="lime"] { background: #485a22; }
:root[data-theme="dark"] .lesson mark[data-text-highlight="gray"] { background: #414a46; }

/* Rounded MathJax \bbox backgrounds from the authoring highlight palette. */
.lesson mjx-container rect:is(
  [fill="red"], [fill="blue"], [fill="green"], [fill="yellow"],
  [fill="orange"], [fill="violet"], [fill="cyan"], [fill="rose"],
  [fill="lime"], [fill="gray"],
  [fill="#ffb8b8"], [fill="#a9c8ff"], [fill="#bce8c5"], [fill="#ffe58f"],
  [fill="#ffc99b"], [fill="#d0b8f5"], [fill="#a7e4ea"], [fill="#f5c6e2"],
  [fill="#d7e69b"], [fill="#d9dfdc"],
  [fill="#dbe7ff"], [fill="#d8f3df"], [fill="#fff0b3"], [fill="#f7dce7"],
  [fill="#ffe2bd"], [fill="#eadfff"], [fill="#d8f3f5"], [fill="#ffdcd8"],
  [fill="#eaf3c5"], [fill="#e3e9e6"], [fill="#c8c8ff"], [fill="#caffcf"],
  [fill="#fff3a8"], [fill="#f1cad8"]
) {
  rx: 180px;
  ry: 180px;
}
.lesson mjx-container rect[fill="red"] { fill: #ffb8b8; }
.lesson mjx-container rect[fill="blue"] { fill: #a9c8ff; }
.lesson mjx-container rect[fill="green"] { fill: #bce8c5; }
.lesson mjx-container rect[fill="yellow"] { fill: #ffe58f; }
.lesson mjx-container rect[fill="orange"] { fill: #ffc99b; }
.lesson mjx-container rect[fill="violet"] { fill: #d0b8f5; }
.lesson mjx-container rect[fill="cyan"] { fill: #a7e4ea; }
.lesson mjx-container rect[fill="rose"] { fill: #f5c6e2; }
.lesson mjx-container rect[fill="lime"] { fill: #d7e69b; }
.lesson mjx-container rect[fill="gray"] { fill: #d9dfdc; }
:root[data-theme="dark"] .lesson mjx-container rect[fill="red"] { fill: #71343a; }
:root[data-theme="dark"] .lesson mjx-container rect[fill="blue"] { fill: #304f91; }
:root[data-theme="dark"] .lesson mjx-container rect[fill="green"] { fill: #25603d; }
:root[data-theme="dark"] .lesson mjx-container rect[fill="yellow"] { fill: #66531c; }
:root[data-theme="dark"] .lesson mjx-container rect[fill="orange"] { fill: #713f1d; }
:root[data-theme="dark"] .lesson mjx-container rect[fill="violet"] { fill: #533d78; }
:root[data-theme="dark"] .lesson mjx-container rect[fill="cyan"] { fill: #1d5b66; }
:root[data-theme="dark"] .lesson mjx-container rect[fill="rose"] { fill: #713854; }
:root[data-theme="dark"] .lesson mjx-container rect[fill="lime"] { fill: #485a22; }
:root[data-theme="dark"] .lesson mjx-container rect[fill="gray"] { fill: #414a46; }
:root[data-theme="dark"] .lesson mjx-container rect:is([fill="#ffb8b8"], [fill="#ffdcd8"]) { fill: #71343a; }
:root[data-theme="dark"] .lesson mjx-container rect:is([fill="#a9c8ff"], [fill="#dbe7ff"], [fill="#c8c8ff"]) { fill: #304f91; }
:root[data-theme="dark"] .lesson mjx-container rect:is([fill="#bce8c5"], [fill="#d8f3df"], [fill="#caffcf"]) { fill: #25603d; }
:root[data-theme="dark"] .lesson mjx-container rect:is([fill="#ffe58f"], [fill="#fff0b3"], [fill="#fff3a8"]) { fill: #66531c; }
:root[data-theme="dark"] .lesson mjx-container rect:is([fill="#ffc99b"], [fill="#ffe2bd"]) { fill: #713f1d; }
:root[data-theme="dark"] .lesson mjx-container rect:is([fill="#d0b8f5"], [fill="#eadfff"]) { fill: #533d78; }
:root[data-theme="dark"] .lesson mjx-container rect:is([fill="#a7e4ea"], [fill="#d8f3f5"]) { fill: #1d5b66; }
:root[data-theme="dark"] .lesson mjx-container rect:is([fill="#f5c6e2"], [fill="#f7dce7"], [fill="#f1cad8"]) { fill: #713854; }
:root[data-theme="dark"] .lesson mjx-container rect:is([fill="#d7e69b"], [fill="#eaf3c5"]) { fill: #485a22; }
:root[data-theme="dark"] .lesson mjx-container rect:is([fill="#d9dfdc"], [fill="#e3e9e6"]) { fill: #414a46; }
