:root {
  color-scheme: light;
  --paper: #faf8f4;
  --ink: #1c1917;
  --muted: #595d54;
  --line: #d6d5cb;
  --forest: #284f3b;
  --pale: #e9eee4;
  --rust: #9a4829;
  --orange: #c46b45;
  --surface: #fffdfa;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  border: 0;
  background: transparent;
}
a {
  color: var(--forest);
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex='0']:focus-visible {
  outline: 3px solid #a84e25;
  outline-offset: 3px;
}
button:hover:enabled {
  filter: brightness(0.95);
}
button:active:enabled {
  transform: translateY(1px);
}
.frame {
  width: min(1232px, calc(100% - 104px));
  margin-inline: auto;
}
.skip,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  width: auto;
  height: auto;
  clip-path: none;
  background: var(--paper);
  padding: 10px;
  z-index: 8;
}
.mast {
  border-bottom: 1px solid var(--line);
}
.mast-inner {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  font: 700 24px/1 var(--serif);
  letter-spacing: -0.9px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
}
.brand svg {
  width: 30px;
  height: 30px;
  color: var(--forest);
}
.mast-divider {
  background: var(--line);
  height: 20px;
  width: 1px;
}
.mast-sub,
.guide-link {
  font-size: 13px;
  color: var(--muted);
}
.guide-link {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  padding: 9px 0 9px 9px;
}
.guide-link svg {
  width: 17px;
  height: 17px;
}
.hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  gap: 48px;
  padding-block: 31px 32px;
}
.hero-copy {
  padding-block: 3px;
}
.eyebrow {
  font: 600 10.5px/1.5 var(--mono);
  text-transform: uppercase;
  letter-spacing: 1.55px;
  color: var(--forest);
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
}
.category-mark {
  width: 8px;
  height: 8px;
  border: 2px solid var(--rust);
  transform: rotate(45deg);
}
h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
}
h1 {
  font-size: clamp(41px, 4.5vw, 72px);
  letter-spacing: -0.058em;
  line-height: 1.02;
  margin: 12px 0 14px;
}
h1 span {
  display: block;
  color: var(--forest);
  font-style: italic;
}
.hero-copy > p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 55ch;
}
.hero-meta,
.hero-meta span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.hero-meta {
  gap: 12px;
  margin-top: 17px;
  color: var(--muted);
  font-size: 12px;
}
.hero-meta svg {
  width: 15px;
  height: 15px;
}
.hero-meta .dot {
  color: #aaa99f;
}
.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
}
.course {
  display: grid;
  grid-template-columns: 242px minmax(0, 1fr);
  border-top: 1px solid #b9bbae;
  padding: 30px 0 52px;
  gap: 37px;
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 0 23px 0 0;
  align-self: start;
}
.side-heading,
.progress > div:first-child,
.lab-top,
.diagram-head,
.graph-head,
.dialog-top,
.trace-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.side-heading {
  margin: 4px 0 16px;
}
.side-heading .eyebrow {
  color: var(--muted);
}
.side-count {
  font: 11px var(--mono);
  color: var(--muted);
}
.desktop-nav {
  display: grid;
  gap: 4px;
}
.desktop-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  line-height: 1.24;
  padding: 8px 10px;
  color: #484b43;
  text-decoration: none;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 520;
  border: 1px solid transparent;
}
.desktop-nav a:hover {
  background: #efeee8;
}
.desktop-nav a[aria-current='step'] {
  color: #294c37;
  background: #e8ede2;
  border-color: #d3ddcc;
  font-weight: 700;
}
.nav-num {
  font: 11px var(--mono);
  color: #62675d;
  background: #f0eee7;
  border: 1px solid #d7d6cc;
  border-radius: 4px;
  min-width: 26px;
  height: 24px;
  display: grid;
  place-items: center;
}
.desktop-nav a[aria-current] .nav-num {
  color: white;
  background: var(--forest);
  border-color: var(--forest);
}
.completed .nav-num {
  color: var(--forest);
  border-color: #9eb29b;
}
.mobile-nav {
  display: none;
}
.progress {
  margin: 23px 5px 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.progress strong {
  font: 11px var(--mono);
}
.progress-track {
  display: flex;
  gap: 4px;
  margin-top: 9px;
}
.progress-track i {
  height: 4px;
  flex: 1;
  background: #dfdfd4;
  border-radius: 2px;
}
.progress-track i.done {
  background: var(--forest);
}
#lesson {
  min-width: 0;
  outline: 0;
}
.lesson-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 2px 0 7px;
}
.lesson-meta .eyebrow {
  color: var(--rust);
}
.tiny-line {
  width: 17px;
  height: 1px;
  background: #c9c7bb;
}
.lesson-kind {
  font-size: 12px;
  color: var(--muted);
}
#lesson-title {
  font-size: clamp(32px, 3.2vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.047em;
}
.lesson-intro {
  margin: 9px 0 18px;
  color: #4e5049;
  line-height: 1.6;
  max-width: 82ch;
  font-size: 15px;
}
.figure-box,
.lab {
  border: 1px solid #cfcfc2;
  background: #fffdf8;
  border-radius: 9px;
  overflow: hidden;
}
.figure-box {
  background-color: #f4f4e9;
  background-image: radial-gradient(#c8cbb7 0.65px, transparent 0.75px);
  background-size: 11px 11px;
  padding: 14px 18px 15px;
}
.diagram-head {
  align-items: baseline;
  margin-bottom: 12px;
}
.diagram-head h3 {
  font: 600 13px var(--sans);
  color: #344734;
}
.diagram-head small {
  font: 10px var(--mono);
  color: #626857;
}
.rack {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  flex: 1;
}
.slot {
  padding: 7px 9px;
  border: 1px solid var(--edge);
  background: var(--fill);
  border-radius: 4px;
  min-width: 0;
}
.slot small,
.slot strong {
  display: block;
}
.slot small {
  font: 10px var(--mono);
  color: #474e42;
}
.slot strong {
  font: 600 14px/1.6 var(--mono);
  overflow-wrap: anywhere;
}
.r0 {
  --fill: #dce9d6;
  --edge: #8eab85;
}
.r1 {
  --fill: #f5e1bd;
  --edge: #c5a36d;
}
.r2 {
  --fill: #dfe9ed;
  --edge: #8ea8b5;
}
.r3 {
  --fill: #ebe1ec;
  --edge: #b19bb6;
}
.memory-slot {
  background: #fffdf8;
  border: 1px solid #c6b8a2;
  border-radius: 4px;
  min-width: 111px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.memory-slot small {
  font: 10px var(--mono);
  color: #68553e;
}
.memory-slot b {
  font: 600 12px/1.7 var(--sans);
}
.wire {
  align-self: center;
  color: #7d826e;
}
.mini-example {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: 8px;
}
.mini-example span {
  white-space: pre-line;
  background: #fffdf6;
  border: 1px solid #cbcebd;
  border-radius: 4px;
  padding: 8px 10px;
  font: 12px/1.5 var(--mono);
  overflow-wrap: anywhere;
}
.fig-note {
  font-size: 12px;
  color: #505747;
  margin: 9px 0 0;
}
#activity {
  margin: 16px 0 22px;
  padding: 17px 19px 18px;
  border: 1px solid #d9c8b6;
  background: #f9f1e6;
  border-radius: 8px;
}
.activity-kicker {
  color: var(--rust);
  font: 600 10px/1.5 var(--mono);
  letter-spacing: 1.35px;
  text-transform: uppercase;
}
.activity-prompt,
#activity legend {
  font: 600 17px/1.45 var(--sans);
  margin: 3px 0 8px;
}
#activity fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.activity-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0;
}
.activity-choice,
#activity .activity-choices label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fffdf8;
  border: 1px solid #c9bfad;
  border-radius: 5px;
  font-size: 13px;
  padding: 8px 12px;
  cursor: pointer;
}
.activity-choice[aria-pressed='true'],
#activity label:has(:checked) {
  border-color: var(--forest);
  background: var(--pale);
  box-shadow: inset 0 0 0 1px var(--forest);
}
input[type='radio'],
input[type='checkbox'] {
  accent-color: var(--forest);
}
.activity-submit,
.primary,
.secondary,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 5px;
  font-weight: 600;
}
.activity-submit,
.primary {
  background: var(--forest);
  border: 1px solid var(--forest);
  color: #fffdf7;
  padding: 9px 15px;
  font-size: 13px;
}
.secondary,
.small-button {
  background: #fffdf9;
  border: 1px solid #c5c6b9;
  color: var(--forest);
  padding: 7px 10px;
  font-size: 12px;
}
.activity-note,
.activity-feedback,
.activity-repair {
  font-size: 14px;
}
.activity-feedback {
  margin-top: 11px;
}
.activity-feedback p + p,
#activity details {
  margin-top: 7px;
}
#activity summary {
  cursor: pointer;
}
#activity .activity-rule {
  font: 13px/1.6 var(--mono);
  white-space: pre-wrap;
}
.lab {
  background: var(--surface);
}
.lab-top {
  padding: 18px 20px 12px;
}
.lab-top .eyebrow {
  font-size: 9px;
}
.lab-top h3 {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -1px;
}
.live-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 11px var(--mono);
  color: #36533b;
}
.live-label i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #528454;
}
.controls {
  padding: 4px 20px 16px;
  display: flex;
  align-items: center;
  gap: 8px 15px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #4c5045;
}
.controls label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.controls select,
.mobile-nav select {
  border: 1px solid #c3c5b9;
  border-radius: 4px;
  padding: 6px;
  background: var(--paper);
}
.toggle {
  font-weight: 600;
  padding: 4px 0;
}
.toggle input {
  width: 30px;
  height: 17px;
  appearance: none;
  border-radius: 12px;
  background: #c6c8bc;
  position: relative;
  border: 1px solid #94988c;
  cursor: pointer;
}
.toggle input:before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 11px;
  height: 11px;
  background: white;
  border-radius: 50%;
}
.toggle input:checked {
  background: var(--forest);
}
.toggle input:checked:before {
  left: 15px;
}
.toggle:has(:disabled) {
  color: #686961;
}
.gate-note {
  font-size: 12px;
  color: var(--muted);
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  background: #f2f2e9;
  border-block: 1px solid var(--line);
  padding: 0 10px;
  gap: 2px;
}
.tabs button {
  padding: 10px 12px 9px;
  font-size: 12px;
  font-weight: 550;
  color: #5b5e51;
  border-bottom: 2px solid transparent;
}
.tabs button[aria-selected='true'] {
  color: var(--forest);
  border-bottom-color: var(--forest);
}
.lab-body {
  padding: 16px 20px 19px;
}
.mode-help,
.graph-detail,
.trace-detail,
.status-note {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}
.graph-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 155px;
  gap: 15px;
  align-items: center;
}
.graph-svg {
  width: 100%;
  height: auto;
  max-height: 278px;
  background-image: radial-gradient(#d9dacd 0.8px, transparent 0.8px);
  background-size: 12px 12px;
  border: 1px solid #dfdfd3;
  border-radius: 5px;
}
.graph-svg g[role='button'] {
  cursor: pointer;
}
.graph-detail {
  font: 12px/1.55 var(--mono);
  min-height: 2em;
  margin: 4px 0 10px;
  overflow-wrap: anywhere;
}
.key {
  border-left: 1px solid var(--line);
  padding-left: 14px;
}
.key div {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 11px var(--mono);
  margin: 7px 0;
}
.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--fill);
  border: 1px solid var(--edge);
}
.trace-control {
  border-top: 1px solid var(--line);
  padding-top: 11px;
  flex-wrap: wrap;
  font-size: 12px;
}
.trace-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}
.trace-detail {
  margin: 8px 0 0;
}
.stack {
  font: 12px/1.5 var(--mono);
  color: var(--forest);
  margin-top: 6px;
  overflow-wrap: anywhere;
}
.table-scroll {
  max-width: 100%;
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font: 12px/1.5 var(--mono);
  text-align: left;
}
th,
td {
  border-bottom: 1px solid #e0dfd4;
  padding: 6px 8px;
  vertical-align: top;
}
th {
  font-weight: 600;
  color: var(--forest);
  background: #f2f3eb;
}
td {
  overflow-wrap: anywhere;
}
td code {
  white-space: pre;
}
caption {
  text-align: left;
  font: 12px/1.6 var(--sans);
  color: var(--muted);
  padding: 3px 0 8px;
}
.editor {
  display: block;
  width: 100%;
  height: 245px;
  padding: 12px;
  background: #f6f5ed;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #29372b;
  font: 13px/1.55 var(--mono);
  tab-size: 2;
}
.editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.error {
  color: #9b3420;
  font-weight: 600;
  font-size: 13px;
}
.lab details {
  margin-top: 10px;
  font-size: 13px;
}
.lab summary {
  cursor: pointer;
  color: var(--forest);
  font-weight: 600;
}
.lab pre {
  white-space: pre-wrap;
  font: 12px/1.5 var(--mono);
  overflow-wrap: anywhere;
}
.metrics {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.metric {
  border: 1px solid var(--line);
  padding: 8px 13px;
  min-width: 85px;
  border-radius: 5px;
}
.metric strong,
.metric span {
  display: block;
}
.metric strong {
  font: 500 26px/1.25 var(--serif);
}
.metric span {
  font: 10px var(--mono);
  color: var(--muted);
}
.metric:last-child {
  background: #e8eee2;
  border-color: #c7d4c1;
}
.lesson-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  gap: 10px;
}
.text-button {
  font-size: 13px;
  color: var(--forest);
  padding: 9px 0;
}
.site-footer {
  border-top: 1px solid var(--line);
  padding: 17px 0;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}
.site-footer span:first-child {
  font: 600 16px var(--serif);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  padding: 24px;
  width: min(500px, calc(100% - 32px));
  max-height: 86vh;
}
dialog::backdrop {
  background: #1d251ed0;
}
dialog h2 {
  font-size: 30px;
  line-height: 1.15;
  margin: 10px 0;
}
dialog h3 {
  font-size: 20px;
  margin: 15px 0 2px;
}
dialog p {
  font-size: 14px;
  color: var(--muted);
}
dialog .secondary {
  margin-top: 10px;
}
#close-guide {
  font-size: 24px;
  padding: 0 6px;
}
@media (min-width: 1500px) {
  .frame {
    max-width: 1260px;
  }
}
@media (max-width: 950px) {
  .frame {
    width: calc(100% - 48px);
  }
  .hero {
    gap: 22px;
  }
  .course {
    grid-template-columns: 195px minmax(0, 1fr);
    gap: 23px;
  }
  .sidebar {
    padding-right: 16px;
  }
  .desktop-nav a {
    font-size: 12px;
    padding-left: 6px;
    gap: 8px;
  }
  .memory-slot {
    min-width: 75px;
  }
  .slot {
    padding: 6px;
  }
  .graph-grid {
    grid-template-columns: minmax(0, 1fr) 100px;
  }
  .hero-copy > p {
    font-size: 14px;
  }
}
@media (max-width: 700px) {
  .frame {
    width: calc(100% - 32px);
  }
  .mast-inner {
    height: 52px;
    gap: 12px;
  }
  .brand {
    font-size: 21px;
  }
  .brand svg {
    width: 25px;
  }
  .mast-divider,
  .mast-sub {
    display: none;
  }
  .hero {
    grid-template-columns: 1fr;
    padding: 21px 0 18px;
    gap: 15px;
  }
  .hero h1 {
    font-size: 40px;
    margin: 8px 0;
  }
  h1 span {
    display: inline;
  }
  .hero-eyebrow {
    font-size: 9px;
  }
  .hero-meta {
    margin-top: 10px;
    font-size: 11px;
  }
  .hero-art {
    display: none;
  }
  .course {
    display: block;
    padding: 0 0 30px;
  }
  .sidebar {
    border: 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 0;
  }
  .side-heading {
    margin: 0;
    display: block;
  }
  .side-heading .eyebrow {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .side-count,
  .desktop-nav,
  .progress {
    display: none;
  }
  .mobile-nav {
    display: block;
    max-width: 72%;
  }
  .mobile-nav select {
    font-size: 12px;
    width: 100%;
    padding: 7px 5px;
  }
  .lesson-meta {
    margin-top: 20px;
  }
  #lesson-title {
    font-size: 33px;
  }
  .lesson-intro {
    font-size: 14px;
    line-height: 1.5;
    margin: 8px 0 12px;
  }
  .figure-box {
    padding: 12px;
  }
  .rack {
    gap: 5px;
    flex-wrap: wrap;
  }
  .slots {
    flex: 1 1 100%;
  }
  .slot {
    padding: 4px 7px;
  }
  .wire {
    display: none;
  }
  .memory-slot {
    flex-direction: row;
    gap: 8px;
    align-items: center;
    padding: 4px 8px;
    min-width: 0;
  }
  .diagram-head small {
    font-size: 9px;
  }
  .fig-note {
    font-size: 11px;
  }
  .lab-body {
    padding: 12px;
  }
  .lab-top {
    padding: 14px 12px 9px;
  }
  .controls {
    padding: 5px 12px 12px;
  }
  .tabs {
    padding: 0 4px;
  }
  .tabs button {
    padding: 9px 7px;
    font-size: 11px;
  }
  .graph-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .key {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border: 0;
    padding: 1px;
  }
  .key div {
    font-size: 10px;
    gap: 4px;
  }
  .graph-detail {
    font-size: 11px;
  }
  .diagram-head {
    margin-bottom: 8px;
  }
  #activity {
    padding: 13px;
    margin: 12px 0 15px;
  }
  .activity-choices {
    gap: 5px;
  }
  .mini-example {
    grid-template-columns: 1fr;
  }
  .mini-example span {
    padding: 6px 9px;
  }
  .lesson-footer {
    margin-top: 14px;
  }
  .status-note {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}
.example-mark {
  color: #63765c;
  font: 12px var(--mono);
  margin-right: 7px;
}
.reference-row {
  margin-top: 10px;
  font-size: 12px;
}
.reference-row a {
  color: var(--muted);
  text-underline-offset: 3px;
}
.spill-list {
  font: 12px var(--mono);
  color: var(--muted);
}
.activity-feedback-title {
  font-size: 14px;
}
.activity-note,
.activity-repair {
  border-top: 1px solid #d9cbbb;
  margin-top: 12px;
  padding-top: 12px;
}
.activity-note p,
.activity-feedback p {
  margin-top: 3px;
}
.activity-choice input {
  margin: 0;
}
.lesson-footer button[hidden] {
  display: none;
}
.lesson-footer #next {
  margin-left: auto;
}
#storage-warning:empty {
  display: none;
}
.activity-fieldset legend {
  padding: 0;
}
.mini-example span {
  display: flex;
  align-items: baseline;
}
.graph-svg:has(g:nth-of-type(14)) {
  max-height: none;
}
.activity-kicker {
  margin-bottom: 4px;
}
.snapshot-grid {
  display: grid;
  grid-template-columns: 63px repeat(4, minmax(0, 1fr));
  gap: 4px 7px;
  align-items: center;
}
.snapshot-grid > small {
  font: 10px var(--mono);
  color: #4d594a;
  letter-spacing: 1px;
}
.snapshot-grid .slot {
  padding: 2px 8px;
}
.moment {
  font: 550 11px var(--sans);
  color: #545d4d;
}
.lesson-illustration {
  display: block;
  margin: 5px auto 0;
  width: min(100%, 485px);
  height: auto;
}
.rule-builder {
  margin-top: 12px;
  border-top: 1px solid #d9cbbb;
  padding-top: 10px;
}
.rule-form {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.rule-field {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.rule-field select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px;
  max-width: 100%;
}
.rule-code,
.rule-result {
  font-size: 13px;
}
.rule-code {
  white-space: pre-wrap;
}
.rule-result {
  margin: 8px 0;
}
.rule-example {
  margin: 6px 0;
}
@media (max-width: 700px) {
  .snapshot-grid {
    grid-template-columns: 48px repeat(4, minmax(0, 1fr));
    gap: 3px;
  }
  .snapshot-grid .slot {
    padding: 3px 4px;
  }
  .snapshot-grid .slot strong {
    font-size: 11px;
  }
  .moment {
    font-size: 10px;
  }
  .figure-box .fig-note {
    line-height: 1.5;
  }
}
.run-compare {
  font: 600 12px var(--mono);
  color: var(--rust);
}
.reading-links {
  margin-top: 12px;
}
.reading-links summary {
  color: var(--forest);
  cursor: pointer;
}
.reading {
  width: min(740px, calc(100% - 36px));
  margin: 30px auto;
}
.reading h1 {
  font-size: 40px;
}
.reading section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.reading h2 {
  font-size: 34px;
  letter-spacing: -1px;
}
.reading h3 {
  font-size: 22px;
  margin: 13px 0 5px;
}
.reading img {
  display: block;
  width: min(100%, 480px);
  height: auto;
  margin: 14px auto;
}
.reading p,
.reading pre {
  margin: 9px 0;
}
.reading pre {
  padding: 10px;
  background: #eeeee3;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.reading section > a {
  display: inline-block;
  margin-top: 12px;
}
@media print {
  .reading a {
    color: inherit;
  }
  .reading section {
    break-before: page;
  }
}
.snapshot-grid {
  grid-template-columns: 82px repeat(4, minmax(0, 1fr));
}
@media (max-width: 700px) {
  .snapshot-grid {
    grid-template-columns: 62px repeat(4, minmax(0, 1fr));
  }
}
.compare-work {
  margin: 13px 0 7px;
}
.controls:empty {
  display: none;
}
@media (max-width: 700px) {
  .metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }
  .metric {
    min-width: 0;
    padding: 7px 8px;
  }
  .metric span {
    font-size: 10px;
  }
}
.swatch.mem {
  --fill: #f4d7ca;
  --edge: #9a4829;
}
/* Start Here & Deep Teaching Upgrades */
.teach-section,
.worked-section {
  margin: 18px 0;
}
.teach-prose {
  margin-top: 8px;
  font-size: 15.5px;
  line-height: 1.65;
}
.teach-prose p {
  margin: 0 0 11px;
}
.worked-card {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 15px 16px;
  border-radius: 6px;
}
.worked-card svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 11px;
}
.worked-title {
  font: 700 15px/1.3 var(--sans);
  color: var(--ink);
  margin: 0 0 8px;
}
.worked-steps {
  margin: 0;
  padding-left: 20px;
}
.worked-steps li {
  margin-bottom: 6px;
  font-size: 14.5px;
  line-height: 1.5;
}
.worked-result {
  margin-top: 10px;
  padding: 9px 12px;
  background: var(--pale);
  border-left: 3px solid var(--forest);
  font-size: 14.5px;
}
.takeaway-box {
  border: 1px solid var(--line);
  border-left: 4px solid var(--forest);
  background: #f5f9f4;
  padding: 14px 16px;
  margin-top: 20px;
  border-radius: 4px;
}
.takeaway-box h3 {
  margin: 0 0 6px;
  font: 700 11.5px/1.2 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--forest);
}
.takeaway-box p {
  margin: 0 0 7px;
  font-size: 14.5px;
}
.takeaway-box p:last-child {
  margin-bottom: 0;
}
.primer-section {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 18px;
  margin: 16px 0;
  border-radius: 6px;
}
.primer-kicker {
  display: block;
  font: 700 11px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 5px;
}
.primer-section h2,
.primer-section h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.25;
}
.primer-section svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  margin: 12px 0;
}
.primer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.primer-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.primer-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 12px 13px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 4px;
}
.primer-card strong {
  display: block;
  font: 700 11.5px/1.3 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
  color: var(--ink);
}
.primer-card.safe {
  border-top: 3px solid var(--forest);
}
.primer-card.danger {
  border-top: 3px solid var(--rust);
}
.primer-card.info {
  border-top: 3px solid #2b4c7e;
}
.primer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.primer-btn {
  font: 600 13px/1.2 var(--mono);
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}
.primer-btn[aria-pressed='true'] {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}
.desk-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.desk-slot {
  border: 1px solid var(--forest);
  background: var(--pale);
  border-radius: 5px;
  padding: 10px;
  text-align: center;
}
.desk-slot small {
  display: block;
  font: 600 10.5px var(--mono);
  color: var(--muted);
}
.desk-slot strong {
  display: block;
  margin-top: 3px;
  font: 700 14px var(--mono);
  color: var(--forest);
}
.warehouse-box {
  border: 1px dashed var(--rust);
  background: #fdf2f0;
  border-radius: 5px;
  padding: 10px 12px;
  font-size: 14px;
}
.warehouse-box.clean {
  border-color: var(--forest);
  background: #f2f8f3;
}
.cta-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--forest);
  color: #fff;
  border-radius: 5px;
  font: 600 14.5px/1.2 var(--sans);
  text-decoration: none;
}
.lbl {
  font: 14.5px var(--sans);
  fill: var(--ink);
}
.lbl.muted {
  fill: var(--muted);
  font-size: 12.5px;
}
.lbl.mono {
  font: 12.5px var(--mono);
  fill: var(--ink);
}
.lbl.ok {
  fill: var(--forest);
  font-weight: 700;
}
.lbl.bad {
  fill: var(--rust);
  font-weight: 700;
}
.lbl.cobalt {
  fill: #2b4c7e;
  font-weight: 700;
}
@media (max-width: 700px) {
  .primer-grid,
  .primer-grid.three,
  .desk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .primer-grid,
  .primer-grid.three {
    grid-template-columns: 1fr;
  }
}

/* Interactive 3D stage */
.stage-3d-block { margin: 16px 0; }
.ivy3d-wrap { margin: 8px 0 0; border: 1px solid #d9d4c7; background: #FAF8F4; }
.ivy3d-viewport { position: relative; width: 100%; height: 340px; overflow: hidden; background: #FAF8F4; }
.ivy3d-gl, .ivy3d-hud { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ivy3d-gl { touch-action: none; cursor: grab; }
.ivy3d-gl:active { cursor: grabbing; }
.ivy3d-gl:focus-visible { outline: 3px solid #1d4ed8; outline-offset: -3px; }
.ivy3d-hud { pointer-events: none; }
.ivy3d-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px; border-top: 1px solid #d9d4c7; background: #f3efe6; }
.ivy3d-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ivy3d-group-label { font: 600 13px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif; color: #44403c; }
.ivy3d-btn { font: 14px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif; min-height: 40px; padding: 6px 12px; border: 1px solid #a8a29e; border-radius: 6px; background: #fff; color: #1f2328; cursor: pointer; }
.ivy3d-btn[aria-pressed="true"] { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.ivy3d-btn:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
.ivy3d-action { background: #fdf6e7; }
.ivy3d-hint { font: 13px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; color: #57534e; }
.ivy3d-caption { margin: 0; padding: 10px 12px; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: #1f2328; border-top: 1px solid #d9d4c7; }
@media (max-width: 480px) { .ivy3d-viewport { height: 280px; } .ivy3d-btn { padding: 6px 9px; font-size: 13px; } }
