:root {
  --font-body: "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  --primary: #285e82;
  --primary-strong: #204b68;
  --primary-soft: rgba(40, 94, 130, 0.12);
  --primary-soft-strong: rgba(40, 94, 130, 0.2);
  --primary-border: rgba(40, 94, 130, 0.34);
  --primary-border-soft: rgba(40, 94, 130, 0.28);
  --secondary-surface: #eef5fa;
  --page-bg: #fcfcfc;
  --surface-raised: #ffffff;
  --text: #2d3135;
  --heading: var(--primary);
  --heading-ink: #24455e;
  --link: var(--primary);
  --muted-text: #6c737a;
  --line: #d8d9d6;
  --line-strong: #c7cbc8;
  --interactive-bg: var(--secondary-surface);
  --interactive-border: var(--line);
  --interactive-controls-bg: #e4eaee;
  --interactive-controls-border: #d9e0e6;
  --interactive-back-bg: rgba(108, 115, 122, 0.2);
  --interactive-back-hover-bg: rgba(108, 115, 122, 0.34);
  --interactive-radius: 8px;
  --interactive-padding: 1.35rem;
  --topbar-height: 62px;
  --sidebar-width: 220px;
  --reading-width: 720px;
  --math-mtext-font: "Times New Roman", Times, serif;
  --inline-math-offset: 0.12ex;
  --accent: #c8742c;
  --accent-soft: rgba(200, 116, 44, 0.14);
  --graph-slate: #475a69;
  --graph-slate-strong: #33414c;
  --graph-muted: var(--muted-text);
  --tooltip-bg: var(--graph-slate-strong);
  --tooltip-text: #faf8f3;
  --tooltip-border: var(--graph-slate);
  --error-bg: #fbeeea;
  --error-border: #e2bcb2;
  --error-text: #8c453a;
  --incorrect-text: #c8742c;
  --success-bg: rgba(84, 130, 92, 0.08);
  --success-border: rgba(84, 130, 92, 0.3);
  --success-text: #3f6a49;
  --invest: var(--primary);
  --dep: var(--graph-slate);
  --shock: var(--accent);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-padding-top: calc(var(--topbar-height) + 16px);
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
}

h1,
h2,
h3,
button,
label,
legend,
.site-title,
.sidebar-title,
.chapter-link,
.chapter-rail-link,
.section-nav-link,
.section-nav-group-label,
.builder-progress,
.builder-control {
  font-family: var(--font-display);
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}

a:hover {
  color: var(--primary-strong);
  text-decoration-color: currentColor;
}

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--page-bg);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  width: min(100%, 1280px);
  margin: 0 auto;
  min-height: var(--topbar-height);
  padding: 0.65rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-breadcrumbs {
  display: flex;
  align-items: center;
  min-width: 0;
}

.site-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.32rem;
  color: var(--muted-text);
  font-size: 0.8rem;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--font-display);
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.site-title a:hover {
  color: var(--text);
}

.site-breadcrumb-link {
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}

.site-breadcrumb-link:hover {
  color: var(--text);
}

.site-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.site-brand-name {
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.site-brand:hover .site-brand-name {
  color: var(--primary-strong);
}

.site-crumb-rule {
  flex: none;
  width: 1px;
  height: 16px;
  margin: 0 0.35rem;
  background: var(--line-strong);
}

.site-page-context {
  overflow: hidden;
  color: var(--muted-text);
  font-size: 0.85rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.site-breadcrumb-separator {
  white-space: nowrap;
  color: inherit;
}

.chapter-nav {
  display: none;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.chapter-link {
  display: inline-block;
  white-space: nowrap;
  color: var(--graph-slate);
  text-decoration: none;
  padding: 0.28rem 0.56rem;
  border: 1px solid var(--line);
  background: var(--surface-raised);
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.2;
  scroll-snap-align: start;
}

.chapter-link:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.chapter-link.is-active {
  border-color: var(--primary-border-soft);
  color: var(--heading);
  background: var(--primary-soft);
}

.page-shell {
  width: min(100%, 1300px);
  margin: 0 auto;
  padding: 2rem 1.5rem 3.5rem;
  display: grid;
  grid-template-columns:
    minmax(170px, var(--sidebar-width))
    minmax(0, var(--reading-width))
    minmax(170px, var(--sidebar-width));
  gap: 2.4rem;
  align-items: start;
}

.page-shell.page-shell-single {
  width: min(100%, 1120px);
  grid-template-columns: minmax(0, 920px);
  justify-content: center;
}

.main-column.main-column-wide {
  min-width: 0;
}

body.is-home-view .page-shell {
  width: min(100%, 1120px);
  grid-template-columns: minmax(0, 920px);
  justify-content: center;
}

body.is-home-view .chapter-sidebar,
body.is-home-view .toc-sidebar {
  display: none;
}

.chapter-sidebar,
.toc-sidebar {
  position: sticky;
  top: calc(var(--topbar-height) + 1.1rem);
  max-height: calc(100vh - var(--topbar-height) - 1.6rem);
  padding-right: 0.35rem;
}

.chapter-sidebar {
  overflow: auto;
}

.toc-sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-right: 0;
}

.sidebar-title {
  margin: 0 0 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted-text);
}

.chapter-rail-links,
.section-nav-links {
  display: grid;
  gap: 0.3rem;
}

.toc-sidebar .section-nav-links {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 0.35rem;
  align-content: start;
}

.chapter-rail-link {
  display: block;
  color: var(--muted-text);
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.35;
  border-left: 2px solid transparent;
  padding: 0.1rem 0 0.1rem 0.55rem;
}

.chapter-rail-link:hover {
  color: var(--text);
}

.chapter-rail-link.is-active {
  color: var(--heading);
  border-left-color: var(--primary-border-soft);
}

.section-nav-group-label {
  display: block;
  color: var(--muted-text);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  margin-top: 0.52rem;
  padding: 0.14rem 0.5rem;
}

.section-nav-link {
  display: block;
  color: var(--muted-text);
  text-decoration: none;
  font-size: 0.78rem;
  line-height: 1.35;
  padding: 0.12rem 0.5rem;
  border-left: 2px solid transparent;
}

.section-nav-link-nested {
  padding-left: 1.15rem;
}

.section-nav-link:hover,
.section-nav-group-link:hover {
  color: var(--graph-slate);
}

.section-nav-link.is-active,
.section-nav-group-link.is-active {
  color: var(--heading);
  border-left-color: var(--primary-border-soft);
}

.section-nav-link-break {
  color: var(--graph-slate);
}

.section-nav-separator {
  border-top: 1px solid var(--line-strong);
  margin: 0.62rem 0.5rem 0.35rem;
}

.section-nav-endmatter-label {
  margin-top: 0;
  margin-bottom: 0.1rem;
}

.section-nav-endmatter-link {
  color: var(--graph-slate);
}

.section-nav-footer {
  flex: 0 0 auto;
  padding-right: 0.35rem;
}

.main-column {
  min-width: 0;
}

.page-header {
  margin-bottom: 2.25rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--line);
}

.page-header h1 {
  margin: 0;
  color: var(--heading);
  font-size: 2.25rem;
  line-height: 1.2;
  font-weight: 600;
}

.page-header .page-chapter-label {
  margin: 0 0 0.45rem;
  color: var(--muted-text);
  font-size: 0.8rem;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
}

.notes-flow {
  min-width: 0;
}

.notes-pdf-link {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--link);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.notes-pdf-link:hover {
  text-decoration: underline;
}

.status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 1rem 1.1rem;
}

.status-card h3 {
  margin: 0 0 0.35rem;
  color: var(--heading);
  font-size: 1.2rem;
}

.status-card p {
  margin: 0;
  color: var(--muted-text);
}

.status-card.status-error {
  border-color: var(--error-border);
  background: var(--error-bg);
}

.status-card.status-error h3,
.status-card.status-error p {
  color: var(--error-text);
}

.notes-major-heading {
  margin: 2.9rem 0 1rem;
  color: var(--heading);
  font-size: 1.75rem;
  line-height: 1.25;
  font-weight: 600;
}

.note-section {
  padding: 0.25rem 0;
  margin: 0 0 0.8rem;
  scroll-margin-top: calc(var(--topbar-height) + 20px);
}

.note-section.is-active {
  border-left: 2px solid var(--primary-border-soft);
  padding-left: 0.8rem;
}

.note-section h3 {
  margin: 0 0 0.7rem;
  color: var(--heading);
  font-size: 1.375rem;
  line-height: 1.3;
  font-weight: 600;
}

.note-section h4 {
  margin: 0 0 0.65rem;
  color: var(--heading);
  font-size: 1.08rem;
  line-height: 1.35;
  font-weight: 600;
}

.note-body {
  line-height: 1.62;
}

.note-body p {
  margin: 0 0 1rem;
}

.note-body ul,
.note-body ol {
  margin: 0 0 1rem 1.3rem;
  padding: 0;
}

.note-body ol {
  margin-left: 3rem;
}

.note-body ol > li + li {
  margin-top: 0.4rem;
}

.note-body img[src*="/content/figures/"] {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.2rem auto;
}

.figure-placeholder {
  margin: 0.45rem 0 0.9rem;
  color: var(--muted-text);
  font-size: 0.85rem;
  font-style: italic;
}

.note-equation {
  margin: 0.95rem auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  overflow-x: auto;
}

.note-equation:has(+ .note-equation) {
  margin-bottom: 0.2rem;
}

.note-equation + .note-equation {
  margin-top: 0.2rem;
}

.note-equation mjx-container[jax="CHTML"][display="true"] {
  font-size: 1.12em !important;
}

.note-equation-indented {
  margin: 0.35rem 0 0.75rem 1.3rem;
  text-align: left;
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 0.15rem;
}

.note-equation-indented mjx-container[jax="CHTML"][display="true"] {
  margin: 0;
  text-align: left;
}

.note-equation-mixed {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.28rem;
}

.note-equation-mixed .mixed-text,
.note-equation-mixed .mixed-op {
  font-family: "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.06rem;
  line-height: 1.35;
}

mjx-container[jax="CHTML"] mjx-mtext,
mjx-container[jax="CHTML"] mjx-utext {
  font-family: var(--math-mtext-font) !important;
  font-style: normal;
}

mjx-container[jax="CHTML"]:not([display="true"]) {
  vertical-align: var(--inline-math-offset) !important;
}

.note-equation mjx-mi,
.note-equation mjx-mo,
.note-equation mjx-c,
.note-body mjx-mi,
.note-body mjx-mo,
.note-body mjx-c {
  pointer-events: auto !important;
}

.note-equation .eq-term,
.note-body .eq-term {
  cursor: help;
  border-bottom: 0;
}

.note-equation .eq-term.eq-term-active,
.note-body .eq-term.eq-term-active,
.note-equation mjx-mtext .eq-term,
.note-equation mjx-utext .eq-term,
.note-body mjx-mtext .eq-term,
.note-body mjx-utext .eq-term {
  border-bottom: 0;
  background: transparent;
}

.note-checks {
  margin-top: 1.1rem;
  border-top: 1px dashed var(--line-strong);
  padding-top: 0.55rem;
}

.check-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px dashed var(--line);
  padding: 0.33rem 0;
  font-size: 0.95rem;
}

.check-row:last-child {
  border-bottom: 0;
}

.definition-list {
  margin: 0.95rem 0 1.05rem 1.2rem;
}

.note-callout {
  margin: 1.35rem 0 1.55rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--primary-border-soft);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: var(--primary-soft);
}

.note-callout > :first-child {
  margin-top: 0;
}

.note-callout > :last-child {
  margin-bottom: 0;
}

.note-callout-label {
  margin: 0 0 0.45rem;
  color: var(--heading);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.note-callout ol,
.note-callout ul {
  margin: 0.55rem 0 0.65rem 1.35rem;
}

.note-callout.growth-rate-rules {
  padding: var(--interactive-padding);
  border: 0;
  background: var(--secondary-surface);
}

.growth-rate-rules .note-callout-label {
  color: var(--heading-ink);
  font-size: 1.05rem;
  font-weight: 600;
}

.note-table-wrap {
  margin: 1rem 0 1.2rem;
  overflow-x: auto;
}

.note-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.98rem;
  line-height: 1.4;
}

.note-table th,
.note-table td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.note-table thead th {
  color: var(--heading);
  font-weight: 600;
}

.note-table tbody th {
  text-align: left;
  color: var(--text);
  font-weight: 600;
}

.note-table tbody tr:last-child th,
.note-table tbody tr:last-child td {
  border-bottom: 0;
}

.derivative-rules-table {
  min-width: 30rem;
}

.derivative-rules-table th,
.derivative-rules-table td {
  padding: 0.85rem 0.8rem;
  text-align: left;
  vertical-align: middle;
}

.note-figure {
  margin: 1.15rem 0 1.35rem;
}

.note-figure img,
.note-figure object,
.note-figure svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.note-figure figcaption {
  margin-top: 0.55rem;
  color: var(--muted-text);
  font-size: 0.92rem;
}

.stock-flow-figure {
  padding: 0.3rem 0 0.1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stock-flow-grid {
  display: grid;
  gap: 0;
}

.stock-flow-card {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(216, 217, 214, 0.78);
}

.stock-flow-card:last-child {
  border-bottom: 0;
}

.stock-flow-context {
  margin: 0 0 0.55rem;
  color: var(--graph-slate);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.stock-flow-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
}

.stock-flow-side {
  display: grid;
  gap: 0.22rem 0.65rem;
  align-items: center;
}

.stock-flow-side-in {
  grid-template-columns: auto minmax(84px, 1fr);
  grid-template-areas:
    "term track";
  text-align: right;
}

.stock-flow-side-out {
  grid-template-columns: minmax(84px, 1fr) auto;
  grid-template-areas:
    "track term";
  text-align: left;
}

.stock-flow-term {
  grid-area: term;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--graph-slate-strong);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
}

.stock-flow-side-in .stock-flow-term {
  justify-self: end;
}

.stock-flow-side-out .stock-flow-term {
  justify-self: start;
}

.stock-flow-track {
  grid-area: track;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 1.7rem;
  padding: 0 0.95rem 0 0.65rem;
  background: rgba(40, 94, 130, 0.14);
  color: var(--primary-strong);
  clip-path: polygon(0 0, calc(100% - 0.95rem) 0, 100% 50%, calc(100% - 0.95rem) 100%, 0 100%);
}

.stock-flow-track-label {
  display: block;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

.stock-flow-stock {
  min-width: 145px;
  padding: 0.78rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: transparent;
  text-align: center;
}

.stock-flow-stock-name {
  display: block;
  color: var(--heading);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.stock-flow-stock-kind {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted-text);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.output-split-figure {
  padding: 0.3rem 0 0.1rem;
}

.output-split-diagram {
  display: grid;
  gap: 0.5rem;
}

.output-split-total-label {
  color: var(--heading);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: none;
}

.output-split-top-title {
  text-transform: none;
}

.output-split-top-meta {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: none;
}

.output-split-bar {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
  min-height: 5.2rem;
  border: 2px solid var(--line-strong);
  border-radius: 0;
  overflow: hidden;
  background: var(--surface-raised);
}

.output-split-segment {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.9rem 0.65rem;
}

.output-split-segment-kind {
  color: var(--graph-slate);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.output-split-segment-label {
  color: var(--graph-slate-strong);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.output-split-segment-consumption {
  background: rgba(40, 94, 130, 0.08);
}

.output-split-segment-saving {
  background: rgba(200, 116, 44, 0.12);
  border-right: 2px solid rgba(40, 94, 130, 0.18);
}

.output-split-scale {
  position: relative;
  display: grid;
  grid-template-columns: 0 minmax(0, 3fr) minmax(0, 7fr);
  align-items: start;
  color: var(--muted-text);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1;
}

.output-split-scale-start,
.output-split-scale-mid,
.output-split-scale-end {
  position: relative;
  padding-top: 0.55rem;
}

.output-split-scale-start {
  justify-self: start;
}

.output-split-scale-mid {
  grid-column: 2;
  justify-self: end;
  transform: translateX(50%);
}

.output-split-scale-end {
  grid-column: 3;
  justify-self: end;
}

.output-split-scale-start::before,
.output-split-scale-mid::before,
.output-split-scale-end::before {
  content: "";
  position: absolute;
  top: 0;
  width: 0;
  height: 0.45rem;
  border-left: 2px solid var(--line-strong);
}

.output-split-scale-start::before {
  left: 0;
}

.output-split-scale-mid::before {
  left: 50%;
  transform: translateX(-50%);
}

.output-split-scale-end::before {
  right: 0;
}

.definition-row {
  display: block;
  padding: 0.2rem 0;
}

.definition-term {
  display: inline;
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
}

.definition-value {
  display: inline;
  color: var(--text);
  line-height: 1.4;
}

.interactive-break,
.equation-builder,
.chart-card {
  margin: 2.2rem 0;
  border: 0;
  border-radius: var(--interactive-radius);
  background: var(--interactive-bg);
  padding: var(--interactive-padding);
  scroll-margin-top: calc(var(--topbar-height) + 20px);
}

.interactive-break h3,
.chart-card h3,
.equation-builder-label {
  margin: 0 0 1.05rem;
  color: var(--heading-ink);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.equation-builder-reference {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding-bottom: 0.55rem;
  border-bottom: 0;
}

.builder-reference-expression {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  text-align: center;
}

.builder-preview-stack {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
}

.builder-preview-text {
  color: var(--muted-text);
  font-size: 0.98rem;
  line-height: 1.4;
  text-align: center;
  width: min(100%, 28rem);
}

.builder-reference-item,
.builder-reference-connector {
  color: var(--text);
}

.equation-builder-reference mjx-container[jax="CHTML"] {
  font-size: 1.24em !important;
}

.equation-builder-equation {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.32rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--line);
}

.equation-builder-layout-vertical .equation-builder-equation {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.42rem;
}

.equation-builder-layout-vertical .builder-term,
.equation-builder-layout-vertical .builder-part {
  display: block;
  text-align: center;
}

.equation-builder-layout-vertical .builder-part {
  display: none;
}

.equation-builder[data-builder-inline-statements="true"] .equation-builder-equation {
  width: 100%;
  margin: 0 auto 0.45rem;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.7rem;
  border-bottom: 0;
  padding-bottom: 0;
}

.equation-builder[data-builder-inline-statements="true"] .builder-step {
  display: none;
  width: 100%;
  max-width: 100%;
  text-align: center;
}

.equation-builder[data-builder-inline-statements="true"] .builder-step.is-active,
.equation-builder[data-builder-inline-statements="true"] .builder-step.is-muted {
  display: block;
}

.equation-builder[data-builder-inline-statements="true"] .builder-step-statement {
  width: min(100%, 24rem);
  margin: 0 auto 0.24rem;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
}

.equation-builder[data-builder-inline-statements="true"] .builder-step.is-muted .builder-step-statement {
  color: rgba(40, 94, 130, 0.58);
}

.equation-builder[data-builder-inline-statements="true"] .builder-step.is-active .builder-step-statement {
  color: var(--primary);
}

.builder-summary-stack {
  display: inline-flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
}

.equation-explorer-intro {
  color: var(--graph-slate);
  font-size: 0.96rem;
  line-height: 1.45;
  margin-bottom: 0.7rem;
}

.equation-explorer-preview {
  display: grid;
  gap: 0.42rem;
  margin-bottom: 0.9rem;
  justify-items: center;
}

.equation-explorer-preview-equation {
  min-height: 1.5rem;
}

.equation-explorer-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  gap: 1.3rem;
  align-items: center;
}

.equation-explorer-controls {
  display: grid;
  gap: 0.85rem;
  justify-self: center;
  align-self: center;
  width: min(100%, 300px);
  padding: 1.1rem 1.1rem 1.15rem;
  border: 1px solid rgba(40, 94, 130, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  transform: translateX(-10%);
}

.equation-explorer-control-group {
  display: grid;
  gap: 0.35rem;
}

.equation-explorer-control-label {
  color: var(--graph-slate);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.equation-explorer-option-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-raised);
}

.equation-explorer-option {
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: transparent;
  color: var(--graph-slate);
  border-radius: 0;
  padding: 0.52rem 0.45rem;
  font-size: 0.86rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.equation-explorer-option:last-child {
  border-right: 0;
}

.equation-explorer-option:hover {
  background: rgba(40, 94, 130, 0.08);
  color: var(--primary-strong);
}

.equation-explorer-option.is-active {
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 700;
}

.equation-explorer-grid {
  display: grid;
  gap: 1rem;
  width: 100%;
  justify-items: start;
  justify-self: stretch;
  padding-left: clamp(1.5rem, 5vw, 4.5rem);
}

.equation-explorer-row {
  display: grid;
  gap: 0.18rem;
  width: 100%;
  max-width: 100%;
}

.equation-explorer-row-label {
  color: var(--primary);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  width: min(100%, 25.5rem);
  margin: 0 0 0.12rem;
  text-align: left;
}

.equation-explorer-row-expression {
  display: grid;
  gap: 0.16rem;
  width: min(100%, 25.5rem);
  margin: 0;
  padding-left: 1.2rem;
}

.equation-explorer-row-equation,
.equation-explorer-row-result,
.equation-explorer-row-expression mjx-container[jax="CHTML"] {
  min-height: 1.5rem;
}

.equation-explorer-row-equation,
.equation-explorer-row-result {
  text-align: left;
}

.equation-explorer-row-result {
  color: var(--primary-strong);
  font-weight: 700;
}

.equation-explorer-finish {
  margin-top: 1rem;
}

@media (max-width: 760px) {
  .equation-explorer-workspace {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .equation-explorer-grid {
    width: 100%;
    justify-self: stretch;
    justify-items: center;
    padding-left: 0;
  }

  .equation-explorer-row-expression {
    gap: 0.18rem;
    width: min(100%, 24rem);
    margin: 0 auto;
    padding-left: 0.7rem;
  }

  .equation-explorer-controls {
    width: 100%;
    transform: none;
  }
}

.flow-diagram-builder .builder-preview-stack {
  justify-items: start;
  margin-bottom: 0.95rem;
}

.flow-diagram-builder .builder-preview-text {
  width: min(100%, 40rem);
  text-align: left;
}

.flow-diagram-builder .builder-reference-expression {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.table-walkthrough-statements p {
  margin: 0;
}

.mrs-comparison-answer {
  width: min(100%, 40rem);
  text-align: left;
}

.mrs-comparison-answer p + p {
  margin-top: 0.75rem;
}

.mrs-comparison-answer .note-equation {
  margin: 0.8rem 0;
  text-align: center;
}

.table-walkthrough-statements {
  margin-top: 0.95rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.table-walkthrough-statements details {
  pointer-events: auto;
  margin-top: 0.75rem;
  text-align: left;
}

.table-walkthrough-statements summary {
  cursor: pointer;
}

.table-walkthrough-statements details p {
  margin-top: 0.5rem;
}

.table-walkthrough-layout {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.table-walkthrough-table-shell {
  min-width: 0;
  max-width: 100%;
}

.table-walkthrough-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.table-walkthrough-table {
  width: max-content;
  min-width: max(100%, 32rem);
  border-collapse: collapse;
  table-layout: fixed;
  background: rgba(255, 255, 255, 0.7);
}

.table-walkthrough-table th,
.table-walkthrough-table td {
  padding: 0.55rem 0.52rem;
  border: 1px solid rgba(180, 190, 198, 0.58);
  color: var(--graph-slate-strong);
  font-size: 0.9rem;
  line-height: 1.25;
  text-align: center;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.78);
  transition: background-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.table-walkthrough-table thead th {
  background: rgba(228, 234, 238, 0.82);
  color: var(--graph-slate);
  font-weight: 700;
}

.table-walkthrough-table tbody th[scope="row"] {
  text-align: left;
  font-weight: 700;
}

.table-walkthrough-table [data-table-cell-id].is-active {
  background: rgba(40, 94, 130, 0.12);
  box-shadow: inset 0 0 0 1px var(--primary-border);
  color: var(--primary-strong);
}

.table-walkthrough-workspace-heading {
  margin-bottom: 0.7rem;
  color: var(--primary);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
}

.table-walkthrough-workspace-body {
  display: grid;
  gap: 0.22rem;
}

.table-walkthrough-group-heading {
  margin-top: 0.4rem;
  color: var(--heading);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
}

.table-walkthrough-group-heading:first-child {
  margin-top: 0;
}

.table-walkthrough-row {
  display: block;
  padding: 0.12rem 0;
  color: var(--graph-slate);
  font-family: var(--font-display);
  font-size: 0.94rem;
  line-height: 1.55;
  transition: color 160ms ease, background-color 160ms ease;
}

.table-walkthrough-row[data-workspace-group-ref]:not([data-workspace-group-ref=""]) {
  padding-left: 1rem;
}

.table-walkthrough-row-label {
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.55;
  margin-right: 0.4rem;
}

.table-walkthrough-row-equation {
  color: var(--graph-slate);
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.table-walkthrough-inline-result {
  color: var(--heading);
  font-weight: 700;
}

.table-walkthrough-operator,
.table-walkthrough-equals {
  color: var(--muted-text);
  margin: 0 0.18rem;
}

.table-walkthrough-row.is-active {
  color: var(--primary-strong);
}

.table-walkthrough-row.is-emphasis {
  color: var(--accent);
}

.table-walkthrough-row.is-complete {
  opacity: 0.94;
}

.flow-diagram-overview {
  width: min(100%, 44rem);
  margin: 0 auto 0.95rem;
  text-align: left;
}

.flow-diagram-overview-heading {
  color: var(--primary);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
}

.flow-diagram-overview-body {
  color: var(--graph-slate);
  font-size: 0.95rem;
  line-height: 1.5;
}

.flow-diagram-overview-body p {
  margin: 0.35rem 0 0;
}

.flow-diagram-overview-body p:first-child {
  margin-top: 0.35rem;
}

.flow-diagram-mode-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.flow-diagram-mode-button {
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--graph-slate);
  padding: 0.46rem 0.82rem;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.flow-diagram-mode-button:hover {
  border-color: var(--primary-border);
  background: rgba(40, 94, 130, 0.07);
  color: var(--primary-strong);
}

.flow-diagram-mode-button.is-active {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.flow-diagram-scene {
  padding: 0.35rem 0 0.05rem;
}

.flow-diagram-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.flow-diagram-node-box {
  fill: var(--surface-raised);
  stroke: var(--line-strong);
  stroke-width: 0.38;
}

.flow-diagram-node-label {
  fill: var(--primary-strong);
  font-family: var(--font-display);
  font-size: 4.6px;
  font-weight: 600;
}

.flow-diagram-flow {
  opacity: 1;
  transition: opacity 180ms ease;
}

.flow-diagram-flow.is-active {
  opacity: 1;
}

.flow-diagram-flow.is-inactive {
  opacity: 0.2;
}

.flow-diagram-flow-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 0.6;
  stroke-linecap: round;
}

.flow-diagram-flow-arrowhead {
  fill: currentColor;
}

.flow-diagram-flow-label {
  fill: currentColor;
  font-family: var(--font-display);
  font-size: 2.7px;
  font-weight: 600;
}

.flow-diagram-calculation {
  margin-top: 0.3rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.flow-diagram-calculation-heading {
  color: var(--primary);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
}

.flow-diagram-calculation-body,
.flow-diagram-calculation-details {
  color: var(--graph-slate);
  font-size: 0.95rem;
  line-height: 1.5;
}

.flow-diagram-calculation-body p,
.flow-diagram-calculation-details p {
  margin: 0.45rem 0 0;
}

.flow-diagram-calculation-body p:first-child,
.flow-diagram-calculation-details p:first-child {
  margin-top: 0.35rem;
}

.flow-diagram-calculation-details {
  margin-top: 0.35rem;
}

@media (max-width: 760px) {
  .flow-diagram-mode-row {
    gap: 0.4rem;
  }

  .flow-diagram-mode-button {
    padding: 0.42rem 0.7rem;
    font-size: 0.78rem;
  }

  .flow-diagram-calculation-heading {
    font-size: 0.94rem;
  }

  .flow-diagram-overview-heading {
    font-size: 0.94rem;
  }

  .flow-diagram-overview-body,
  .flow-diagram-calculation-body,
  .flow-diagram-calculation-details {
    font-size: 0.9rem;
  }
}

.equation-builder[data-builder-inline-statements="true"] .builder-term {
  display: block;
  width: fit-content;
  margin: 0 auto;
  text-align: center;
}

.equation-builder-equation .is-hidden {
  display: none;
}

.equation-builder-equation mjx-container[jax="CHTML"] {
  font-size: 1.24em !important;
}

.builder-term {
  border-radius: 4px;
  padding: 0.08rem 0.2rem;
  color: var(--muted-text);
  transition: color 160ms ease, opacity 160ms ease;
}

.builder-part {
  color: rgba(45, 49, 53, 0.52);
}

.builder-term.is-active {
  color: #374151;
  font-weight: 700;
}

.builder-term.is-muted {
  color: rgba(45, 49, 53, 0.52);
  opacity: 1;
}

.equation-builder-transform .equation-builder-equation {
  display: block;
  padding-bottom: 0.85rem;
}

.builder-transform-canvas {
  width: 100%;
}

.builder-transform-stage {
  display: flex;
  justify-content: center;
  width: 100%;
}

.builder-transform-expression {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: min(100%, 100%);
  min-height: 2.8rem;
}

.builder-transform-side {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.builder-transform-token,
.builder-transform-relation {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  border-radius: 0.32rem;
  padding: 0.08rem 0.22rem;
  color: #374151;
  transition: color 180ms ease, opacity 180ms ease, background-color 180ms ease;
}

.builder-transform-token.is-muted {
  color: rgba(45, 49, 53, 0.52);
}

.builder-transform-token.is-active {
  color: #374151;
  font-weight: 700;
}

.builder-transform-token.is-eliminated {
  color: rgba(45, 49, 53, 0.44);
}

.builder-transform-token.is-eliminated::after {
  content: "";
  position: absolute;
  left: 0.14rem;
  right: 0.14rem;
  top: 50%;
  border-top: 2px solid rgba(200, 116, 44, 0.72);
  transform: rotate(-7deg);
  pointer-events: none;
}

.builder-transform-token.is-eliminated mjx-container[jax="CHTML"] {
  opacity: 0.66;
}

.builder-term .builder-math-change,
.builder-term mjx-container .builder-math-change {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 0.22rem;
  animation: builder-math-change-fade 420ms ease-out;
}

@keyframes builder-math-change-fade {
  from {
    background: rgba(40, 94, 130, 0.28);
  }
  to {
    background: var(--primary-soft);
  }
}

.equation-builder-statements {
  margin-top: 0.9rem;
  min-height: 2.88rem;
  display: grid;
  place-items: center;
}

.builder-statement {
  display: block;
  grid-area: 1 / 1;
  visibility: hidden;
  width: fit-content;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--graph-slate);
  padding: 0;
  font-size: 0.92rem;
  line-height: 1.4;
  text-align: center;
  margin: 0 auto;
  cursor: default;
  pointer-events: none;
}

.builder-statement.is-active {
  visibility: visible;
}

.equation-builder[data-builder-mode="single"] .equation-builder-statements {
  display: grid;
  gap: 0.4rem;
  min-height: 0;
}

.equation-builder[data-builder-mode="single"] .builder-statement {
  display: block;
  grid-area: auto;
  visibility: visible;
  width: 100%;
  opacity: 1;
  color: rgba(45, 49, 53, 0.52);
  text-align: left;
  margin: 0;
  cursor: pointer;
  pointer-events: auto;
}

.equation-builder[data-builder-mode="single"] .builder-statement.is-active {
  color: var(--primary);
  font-weight: 700;
  cursor: default;
}

.equation-builder[data-builder-mode="single"].graph-builder-graph .equation-builder-statements {
  display: grid;
  place-items: center;
  min-height: 2.88rem;
}

.equation-builder[data-builder-mode="single"].graph-builder-graph .builder-statement {
  display: block;
  grid-area: 1 / 1;
  visibility: hidden;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  pointer-events: none;
  cursor: default;
  text-align: center;
  opacity: 1;
  color: var(--graph-slate);
  font-weight: 400;
}

.equation-builder[data-builder-mode="single"].graph-builder-graph .builder-statement.is-active {
  visibility: visible;
  color: var(--graph-slate);
  font-weight: 400;
}

.graph-builder .equation-builder-equation {
  display: block;
  padding-bottom: 0;
  border-bottom: 0;
}

.graph-stage-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: start;
}

.graph-stage-panel {
  flex: 1 1 100%;
  min-width: 0;
}

.graph-stage-grid-2 .graph-stage-panel {
  flex-basis: calc(50% - 0.5rem);
  max-width: calc(50% - 0.5rem);
}

.graph-stage-panel-label {
  margin: 0 0 0.45rem;
  color: var(--graph-slate);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

@supports (display: grid) {
  .graph-stage-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .graph-stage-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .graph-stage-grid-2 .graph-stage-panel {
    max-width: none;
  }

  .solow-dynamics-builder .graph-stage-grid,
  .graph-pair-builder .graph-stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .solow-dynamics-builder
    .graph-stage-grid:not(:has(.graph-stage-panel:not([hidden]) ~ .graph-stage-panel:not([hidden]))),
  .graph-pair-builder
    .graph-stage-grid:not(:has(.graph-stage-panel:not([hidden]) ~ .graph-stage-panel:not([hidden]))) {
    grid-template-columns: minmax(0, 1fr);
  }
}

.graph-stage-canvas,
.builder-graph-svg,
.graph-builder .builder-term,
.graph-builder .builder-term svg,
.graph-builder .builder-term img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.builder-graph-label,
.builder-graph-marker text,
.curve-label,
.reference-label,
.series-label,
.shock-label {
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
}

.builder-math-label-layer {
  pointer-events: none;
}

.builder-math-label-layer .math-graph-label {
  visibility: visible;
  pointer-events: none;
  font-weight: 500;
  line-height: 1.05;
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
}

.builder-math-label-layer .math-graph-label mjx-container[jax="CHTML"] mjx-mtext,
.builder-math-label-layer .math-graph-label mjx-container[jax="CHTML"] mjx-utext {
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif !important;
}

.graph-stack-builder .graph-stage-grid {
  grid-template-columns: minmax(0, 1fr);
}

.graph-stack-builder .graph-stage-panel {
  flex-basis: 100%;
  max-width: none;
}

:is(.econ11-graph, .solow-dynamics-builder) .builder-math-label-layer .math-graph-label,
:is(.econ11-graph, .solow-dynamics-builder) .builder-math-label-layer .math-graph-label mjx-container[jax="CHTML"],
:is(.econ11-graph, .solow-dynamics-builder) .builder-math-label-layer .math-graph-label mjx-mtext,
:is(.econ11-graph, .solow-dynamics-builder) .builder-math-label-layer .math-graph-label mjx-utext {
  max-width: none;
  white-space: nowrap !important;
  overflow-wrap: normal;
}

:is(.econ11-graph, .solow-dynamics-builder) .builder-math-label-layer .math-graph-label {
  width: max-content;
}

@media (max-width: 860px) {
  .graph-stage-grid-2,
  .graph-stage-grid-3,
  .econ11-graph .graph-stage-grid,
  .solow-dynamics-builder .graph-stage-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .graph-stage-grid-2 .graph-stage-panel,
  .graph-stage-grid-3 .graph-stage-panel {
    flex-basis: 100%;
    max-width: none;
  }
}

@media (min-width: 600px) and (max-width: 860px) {
  [data-equation-builder="math-soc-builder"] .graph-stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.equation-builder-controls {
  margin-top: 0.95rem;
  margin-right: calc(-1 * var(--interactive-padding));
  margin-bottom: calc(-1 * var(--interactive-padding));
  margin-left: calc(-1 * var(--interactive-padding));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 4fr) minmax(0, 1fr);
  align-items: stretch;
  min-height: 2.65rem;
  border-bottom: 1px solid var(--interactive-controls-border);
  background: var(--interactive-controls-bg);
  border-radius: 0 0 var(--interactive-radius) var(--interactive-radius);
  overflow: hidden;
}

.equation-builder-reveal {
  margin-top: 0.95rem;
  margin-right: calc(-1 * var(--interactive-padding));
  margin-bottom: calc(-1 * var(--interactive-padding));
  margin-left: calc(-1 * var(--interactive-padding));
  display: flex;
  min-height: 2.65rem;
  border-bottom: 1px solid var(--interactive-controls-border);
  background: transparent;
  border-radius: 0 0 var(--interactive-radius) var(--interactive-radius);
  overflow: hidden;
}

.builder-reveal-control {
  appearance: none;
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 100%;
  padding: 0.5rem 0.8rem;
  border: 0;
  background: var(--primary);
  color: var(--surface-raised);
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.builder-reveal-control:hover:not(:disabled) {
  background: var(--primary-strong);
  color: var(--surface-raised);
}

.builder-reveal-control:focus-visible,
.builder-control:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.builder-reveal-control:disabled {
  opacity: 0.56;
  cursor: default;
}

.builder-progress-slot {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-width: 0;
  padding: 0;
  background: transparent;
}

.builder-progress-stack {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.24rem;
  padding: 0.08rem 1rem 0.22rem;
}

.builder-progress-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(45, 49, 53, 0.68);
  text-align: center;
}

.builder-progress {
  position: relative;
  width: 100%;
  max-width: none;
  height: 0.22rem;
  border-radius: 999px;
  background: rgba(108, 115, 122, 0.16);
  overflow: hidden;
}

.builder-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--primary);
  transition: width 220ms ease;
}

.builder-control {
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  min-height: 100%;
  width: 100%;
  padding: 0.5rem 0.8rem;
  font-size: 0.86rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.builder-control[data-builder-back] {
  background: var(--interactive-back-bg);
  color: rgba(45, 49, 53, 0.78);
}

.builder-control[data-builder-back]:hover:not(:disabled) {
  background: var(--interactive-back-hover-bg);
  color: var(--text);
}

.builder-control:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.56);
}

.builder-control-next,
.builder-control[data-builder-next] {
  background: var(--primary);
  color: var(--surface-raised);
}

.builder-control-next:hover:not(:disabled),
.builder-control[data-builder-next]:hover:not(:disabled) {
  background: var(--primary-strong);
}

.builder-control-next:disabled,
.builder-control[data-builder-next]:disabled,
.builder-control:disabled {
  opacity: 0.56;
  cursor: default;
}

.chart {
  min-height: 320px;
  position: relative;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-note {
  margin: 0.75rem 0 0;
  color: var(--muted-text);
  font-size: 0.9rem;
}

.axis path,
.axis line {
  stroke: var(--graph-slate);
}

.axis text,
.axis-label {
  fill: var(--graph-slate);
  font-size: 0.9rem;
}

.axis-title-label {
  font-size: 1.05rem;
  font-weight: 600;
}

.investment-line {
  fill: none;
  stroke: var(--invest);
  stroke-width: 2.5;
}

.depreciation-line {
  fill: none;
  stroke: var(--dep);
  stroke-width: 2.4;
}

.depreciation-shock-line {
  fill: none;
  stroke: var(--shock);
  stroke-width: 2.2;
  stroke-dasharray: 6 3;
}

.invest-label {
  fill: var(--invest);
}

.dep-label {
  fill: var(--dep);
}

.dep-shock-label {
  fill: var(--shock);
}

.math-graph-label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.math-graph-label {
  position: absolute;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  font-size: 1.1rem;
  line-height: 1;
  pointer-events: auto;
  visibility: hidden;
}

.term-tooltip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  max-width: 320px;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  border: 1px solid var(--tooltip-border);
  border-radius: 8px;
  padding: 0.5rem 0.62rem;
  font-size: 0.8rem;
  line-height: 1.35;
}

.chapter-endmatter {
  margin-top: 3.2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1.9rem;
}

.endmatter-block h2 {
  margin: 0 0 0.7rem;
  color: var(--heading);
  font-size: 1.75rem;
  line-height: 1.25;
  font-weight: 600;
}

.endmatter-block p {
  margin: 0;
}

.endmatter-list {
  margin: 0;
  padding-left: 1.2rem;
}

.endmatter-list li + li {
  margin-top: 0.45rem;
}

.practice-bullet-list {
  list-style: none;
  margin: 0.65rem 0 0.2rem;
  padding-left: 0;
}

.practice-bullet-list li {
  margin: 0.18rem 0;
}

.practice-table {
  width: 100%;
  margin: 0.75rem 0 0.4rem;
  border-collapse: collapse;
  font-size: 0.96rem;
}

.practice-table th,
.practice-table td {
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.practice-table th {
  font-weight: 600;
  color: var(--graph-slate-strong);
  background: rgba(238, 245, 250, 0.72);
}

.check-question-list {
  display: grid;
  gap: 0.95rem;
}

.endmatter-check-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.endmatter-check-understanding {
  padding: 1.2rem 1.2rem 1.3rem;
  border-radius: 1rem;
  background: var(--interactive-bg);
}

.endmatter-check-header h2 {
  margin-bottom: 0;
}

.check-reset-button {
  appearance: none;
  border: 1px solid rgba(108, 115, 122, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted-text);
  padding: 0.34rem 0.72rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.check-reset-button:hover {
  background: rgba(40, 94, 130, 0.05);
  border-color: rgba(40, 94, 130, 0.22);
  color: var(--heading);
}

.check-question {
  padding: 0.35rem 0 0.45rem;
  border: 0;
  border-bottom: 1px solid rgba(108, 115, 122, 0.16);
  border-radius: 0;
  background: transparent;
  transition: none;
}

.check-question.is-correct-response {
  border-bottom-color: rgba(84, 130, 92, 0.24);
}

.check-question.is-incorrect-response {
  border-bottom-color: rgba(200, 116, 44, 0.24);
}

.check-question-prompt {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin: 0 0 0.8rem;
}

.check-question-number {
  flex: 0 0 auto;
  color: var(--muted-text);
  font-weight: 600;
}

.check-choice-list {
  display: grid;
  gap: 0.45rem;
}

.check-choice {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(108, 115, 122, 0.24);
  border-radius: 0.72rem;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.check-choice:hover:not(:disabled) {
  background: rgba(40, 94, 130, 0.05);
  border-color: rgba(40, 94, 130, 0.24);
  box-shadow: 0 8px 20px rgba(40, 94, 130, 0.06);
  transform: translateX(2px);
}

.check-choice:disabled {
  cursor: default;
}

.check-choice-text {
  display: block;
  min-width: 0;
}

.check-choice.is-correct {
  color: var(--success-text);
  border-color: var(--success-border);
  background: var(--success-bg);
}

.check-choice.is-incorrect {
  color: rgba(71, 90, 105, 0.88);
  border-color: rgba(200, 116, 44, 0.3);
  background: rgba(200, 116, 44, 0.08);
}

.check-feedback {
  margin: 0.8rem 0 0;
  color: var(--muted-text);
  font-size: 0.95rem;
  line-height: 1.5;
  padding-top: 0.15rem;
}

.check-feedback-status,
.check-feedback-answer {
  display: block;
  margin-bottom: 0.18rem;
}

.check-feedback-status {
  font-weight: 600;
}

.check-feedback-status.is-correct {
  color: var(--success-text);
}

.check-feedback-status.is-incorrect {
  color: var(--incorrect-text);
}

.check-feedback-answer {
  color: var(--text);
}

.chapter-next-link {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  text-decoration: none;
}

.chapter-next-link:hover {
  text-decoration: underline;
}

.home-landing {
  display: grid;
  gap: 2rem;
}

.home-section-heading {
  display: grid;
  gap: 0.18rem;
}

.home-section-kicker {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.home-section-title {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.25;
}

body.is-home-view .page-header .page-chapter-label:empty {
  display: none;
}

.home-contents {
  display: block;
}

.home-tools {
  display: grid;
  gap: 1rem;
}

.home-tool-list,
.home-chapter-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.home-tool-item,
.home-chapter-item {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.home-tool-copy,
.home-chapter-copy {
  min-width: 0;
}

.home-tool-label,
.home-chapter-label {
  margin: 0 0 0.25rem;
  color: var(--muted-text);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.home-tool-title,
.home-chapter-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
}

.home-tool-title-link,
.home-chapter-title-link {
  color: var(--link);
  text-decoration: none;
}

.home-tool-title-link:hover,
.home-chapter-title-link:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

.home-tool-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted-text);
  max-width: 68ch;
}

.home-chapter-status {
  margin: 0.45rem 0 0;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 600;
}

.coming-soon-page {
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--secondary-surface);
}

.coming-soon-kicker {
  margin: 0 0 0.45rem;
  color: var(--muted-text);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.coming-soon-title {
  margin: 0;
  color: var(--heading);
  font-size: 1.7rem;
  line-height: 1.2;
}

.coming-soon-message {
  margin: 0.8rem 0 0;
  max-width: 46rem;
  color: var(--muted-text);
}

.coming-soon-tools {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.coming-soon-tools-label {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.coming-soon-tool-link {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--primary-border-soft);
  border-radius: 12px;
  background: var(--surface-raised);
  text-decoration: none;
}

.coming-soon-tool-link:hover {
  background: var(--primary-soft);
}

.coming-soon-tool-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.coming-soon-tool-subtitle {
  color: var(--muted-text);
  font-size: 0.92rem;
}

.page-shell.page-shell-tool {
  width: min(100%, 1440px);
  grid-template-columns: minmax(0, 1fr);
  justify-content: center;
}

.main-column.main-column-tool {
  min-width: 0;
}

.tool-page-header {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
}

.tool-page-intro {
  max-width: 82ch;
  margin: 0;
  color: var(--muted-text);
}

.tool-page-header .page-chapter-label {
  margin: 0;
}

.tool-page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tool-page-link {
  color: var(--link);
  font-size: 0.95rem;
  text-decoration: none;
}

.tool-page-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.solow-tool-page {
  display: grid;
  gap: 0.7rem;
}

.solow-builder {
  margin-top: 0.35rem;
}

.solow-builder-equation {
  display: block;
  padding-bottom: 0;
}

.solow-shock-picker {
  display: grid;
  grid-template-columns: max-content max-content max-content;
  column-gap: 3rem;
  row-gap: 0.3rem;
  align-items: start;
  justify-content: start;
  margin-bottom: 0.65rem;
}

.solow-shock-group {
  display: grid;
  gap: 0.32rem;
}

.solow-shock-picker .solow-shock-group:first-child {
  grid-column: 1;
  grid-row: 1;
}

.solow-shock-picker .solow-shock-group:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
  min-width: 12rem;
  justify-items: start;
  align-content: start;
}

.solow-shock-group-title {
  margin: 0;
  color: var(--graph-slate);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.solow-shock-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.solow-shock-options-targets .solow-shock-button {
  min-width: 4rem;
}

.solow-shock-button {
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--graph-slate);
  padding: 0.4rem 0.72rem;
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.solow-shock-button:hover {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--primary);
}

.solow-shock-button.is-active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--heading);
}

.solow-shock-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.45rem;
  align-self: end;
  margin-top: 0;
  grid-column: 3;
  grid-row: 1;
}

.solow-action-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: var(--surface-raised);
  padding: 0.42rem 0.8rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, opacity 150ms ease;
}

.solow-action-button:hover:not(:disabled) {
  background: var(--primary-strong);
}

.solow-action-button:disabled {
  opacity: 0.48;
  cursor: default;
}

.solow-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.solow-panel-head {
  display: grid;
  gap: 0.08rem;
  margin-bottom: 0.45rem;
}

.solow-panel {
  min-width: 0;
  padding: 0.78rem 0.82rem 0.68rem;
  background: rgba(255, 255, 255, 0.28);
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.solow-panel-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.18;
}

.solow-panel:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.solow-panel:nth-child(-n + 2) {
  border-bottom: 1px solid var(--line);
}

.solow-panel-equation {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.82rem;
}

.solow-chart {
  min-height: 212px;
  position: relative;
}

.solow-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.solow-panel-note {
  margin: 0;
  padding-top: 0.48rem;
  color: var(--graph-slate);
  font-size: 0.82rem;
  line-height: 1.35;
}

.solow-panel-note.is-muted {
  color: rgba(74, 84, 92, 0.72);
}

.solow-math-label-layer {
  pointer-events: none;
}

@media (max-width: 900px) {
  .solow-shock-picker {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
    row-gap: 0.9rem;
  }

  .solow-shock-picker .solow-shock-group:first-child,
  .solow-shock-picker .solow-shock-group:nth-child(2),
  .solow-shock-actions {
    grid-column: auto;
    grid-row: auto;
  }

  .solow-shock-picker .solow-shock-group:nth-child(2) {
    min-width: 0;
  }

  .solow-shock-actions {
    flex-wrap: wrap;
  }
}

.solow-math-label {
  visibility: visible;
  font-size: 0.98rem;
  line-height: 1;
  pointer-events: none;
}

.solow-math-label mjx-container[jax="CHTML"] {
  margin: 0;
}

.solow-panel.is-active .solow-panel-title {
  color: var(--heading);
}

.solow-panel.is-current {
  background: rgba(40, 94, 130, 0.06);
  box-shadow: inset 0 0 0 1px rgba(40, 94, 130, 0.2);
}

.solow-panel.is-current .solow-panel-title {
  color: var(--primary-strong);
}

.solow-panel.is-current .solow-panel-equation {
  color: var(--graph-slate);
}

.solow-panel.is-pending .solow-chart {
  opacity: 0.92;
}

.golden-rule-marginal-visual {
  margin: 1.5rem 0 1.7rem;
  padding: 1.1rem 0 0;
  border-top: 1px solid rgba(71, 90, 105, 0.18);
}

.golden-rule-marginal-svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 0.85rem;
  overflow: visible;
}

.golden-rule-marginal-svg-heading {
  fill: var(--heading);
  font-family: var(--font-serif);
  font-size: 22px;
  font-style: italic;
  font-weight: 600;
}

.golden-rule-marginal-svg-subheading {
  fill: var(--body);
  font-size: 18px;
  font-weight: 500;
}

.golden-rule-marginal-svg-label {
  fill: var(--body);
  font-size: 18px;
  font-weight: 600;
}

.golden-rule-marginal-svg-line-label {
  fill: rgb(200, 116, 44);
  font-size: 18px;
  font-weight: 600;
}

.golden-rule-marginal-svg-bar {
  fill: rgba(71, 90, 105, 0.18);
  stroke: rgba(71, 90, 105, 0.18);
  stroke-width: 1.5;
}

.golden-rule-marginal-svg-bracket-positive {
  fill: none;
  stroke: rgb(62, 145, 102);
  stroke-width: 3;
}

.golden-rule-marginal-svg-bracket-negative {
  fill: none;
  stroke: rgb(183, 72, 72);
  stroke-width: 3;
}

.golden-rule-marginal-svg-bracket-label-positive {
  fill: rgb(62, 145, 102);
  font-size: 16px;
  font-weight: 600;
}

.golden-rule-marginal-svg-bracket-label-negative {
  fill: rgb(183, 72, 72);
  font-size: 16px;
  font-weight: 600;
}

.golden-rule-marginal-svg-bar-label {
  fill: var(--heading);
  font-size: 17px;
  font-weight: 600;
}

.golden-rule-marginal-svg-result {
  fill: var(--body);
  font-size: 18px;
  font-weight: 600;
}

.golden-rule-marginal-equality {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(71, 90, 105, 0.12);
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 1240px) {
  .page-shell {
    gap: 1.6rem;
    grid-template-columns: minmax(160px, 210px) minmax(0, var(--reading-width)) minmax(150px, 200px);
  }
}

@media (max-width: 1120px) {
  .page-shell {
    grid-template-columns: minmax(0, var(--reading-width)) minmax(170px, 210px);
  }

  .chapter-sidebar {
    display: none;
  }

  .chapter-nav {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
  }

  .chapter-link {
    flex: 0 0 auto;
  }

}

@media (max-width: 920px) {
  .endmatter-check-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding-top: 0.58rem;
    padding-bottom: 0.58rem;
  }

  .site-title {
    align-self: auto;
  }

  .site-breadcrumbs,
  .chapter-nav {
    width: 100%;
  }

  .page-shell {
    padding-top: 1.55rem;
    grid-template-columns: minmax(0, var(--reading-width));
  }

  .toc-sidebar {
    display: none;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .notes-major-heading,
  .endmatter-block h2 {
    font-size: 1.6rem;
  }

  .solow-panel-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .solow-panel:nth-child(odd) {
    border-right: 0;
  }

  .solow-panel:nth-child(-n + 2) {
    border-bottom: 0;
  }

  .solow-panel + .solow-panel {
    border-top: 1px solid var(--line);
  }

  .golden-rule-marginal-svg {
    min-height: 32rem;
  }
}

@media (max-width: 700px) {
  body {
    font-size: 17px;
  }

  .topbar-inner {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .page-shell {
    padding: 1.35rem 0.85rem 2.4rem;
  }

  .page-header {
    margin-bottom: 1.65rem;
    padding-bottom: 1rem;
  }

  .page-header h1 {
    font-size: 1.8rem;
  }

  .tool-page-links {
    flex-direction: column;
    align-items: start;
  }

  .note-section h3 {
    font-size: 1.28rem;
  }

  .interactive-break,
  .equation-builder,
  .chart-card {
    --interactive-padding: 1rem;
    margin: 1.7rem 0;
    padding: var(--interactive-padding);
  }

  .math-graph-label {
    font-size: 1rem;
    max-width: 7.5rem;
    white-space: normal;
    line-height: 1.12;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .math-graph-label mjx-container[jax="CHTML"],
  .math-graph-label mjx-container[jax="CHTML"] mjx-mtext,
  .math-graph-label mjx-container[jax="CHTML"] mjx-utext {
    max-width: 100%;
    white-space: normal !important;
  }

  .stock-flow-figure {
    padding: 0.2rem 0 0;
  }

  .stock-flow-card {
    padding: 0.85rem 0;
  }

  .stock-flow-context {
    font-size: 0.76rem;
  }

  .stock-flow-row {
    gap: 0.55rem;
    grid-template-columns: minmax(0, 1fr) minmax(104px, auto) minmax(0, 1fr);
  }

  .stock-flow-side {
    gap: 0.18rem 0.28rem;
  }

  .stock-flow-side-in {
    grid-template-columns: auto minmax(52px, 1fr);
  }

  .stock-flow-side-out {
    grid-template-columns: minmax(52px, 1fr) auto;
  }

  .stock-flow-term {
    min-width: 0;
    font-size: 0.72rem;
  }

  .stock-flow-track {
    min-height: 1.35rem;
    padding: 0 0.58rem 0 0.42rem;
  }

  .stock-flow-track-label {
    font-size: 0.58rem;
    letter-spacing: 0;
  }

  .stock-flow-stock {
    min-width: 0;
    padding: 0.72rem 0.7rem;
  }

  .stock-flow-stock-name {
    font-size: 0.92rem;
  }

  .output-split-total-label {
    font-size: 0.74rem;
  }

  .output-split-bar {
    min-height: 4.5rem;
  }

  .output-split-segment {
    padding: 0.75rem 0.45rem;
  }

  .output-split-segment-consumption {
    border-right: 0;
  }

  .output-split-segment-saving {
    border-right: 2px solid rgba(40, 94, 130, 0.18);
  }

  .output-split-segment-kind {
    font-size: 0.68rem;
  }

  .output-split-segment-label {
    font-size: 1rem;
  }

  .output-split-scale {
    font-size: 0.68rem;
  }

  .table-walkthrough-table-wrap {
    margin: 0 calc(var(--interactive-padding) * -0.2);
    padding: 0 calc(var(--interactive-padding) * 0.2) 0.2rem;
  }

  .table-walkthrough-table {
    min-width: 31rem;
  }
}
