/* From Software to Silicon — a reading surface and a working instrument. */
:root {
  color-scheme: light;
  --paper: #f5f3e9;
  --paper-raised: #fbfaf5;
  --ink: #172a31;
  --ink-muted: #536467;
  --line: #cdd3c8;
  --teal: #126f6b;
  --teal-dark: #105550;
  --teal-wash: #e4ece3;
  --navy: #142b35;
  --navy-deep: #10232b;
  --navy-line: #3e5961;
  --instrument-ink: #e9f0e7;
  --instrument-muted: #b7c9c7;
  --signal: #b9dd75;
  --signal-blue: #7ed2d4;
  --warning: #f0c16e;
  --error: #9a3d2f;
  --radius: 6px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; scroll-padding-top: 1.5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
button { touch-action: manipulation; }
a { color: var(--teal-dark); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--teal); text-decoration-thickness: 2px; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--teal); outline-offset: 4px;
}
.table-wrap:focus-visible, .waveform-wrap:focus-visible, pre:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
::selection { color: var(--navy-deep); background: #d4e8af; }
img, svg { max-width: 100%; }
button, input, select, textarea { min-height: 44px; }
button:disabled { cursor: not-allowed; opacity: .5; }
button, .button { border: 1px solid var(--teal-dark); border-radius: var(--radius); padding: .7rem 1.05rem; font-weight: 650; line-height: 1.3; background: var(--teal-dark); color: var(--paper-raised); text-decoration: none; transition: background-color .15s ease, border-color .15s ease; }
button:hover:not(:disabled), .button:hover { background: var(--teal); border-color: var(--teal); color: var(--paper-raised); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; gap: .65rem; }
button.secondary, .button.secondary { background: transparent; color: var(--teal-dark); border-color: var(--line); }
button.secondary:hover, .button.secondary:hover { background: var(--teal-wash); }
p { margin: 0 0 1.1rem; }
h1, h2, h3, h4 { color: var(--ink); }
h1, h2 { font-family: var(--serif); font-weight: 500; }
h1 { font-size: clamp(3.5rem, 6.65vw, 6.1rem); line-height: .99; letter-spacing: -.055em; margin: 1.25rem 0 1.4rem; }
h2 { font-size: clamp(2.1rem, 3.3vw, 3.1rem); line-height: 1.1; letter-spacing: -.035em; margin: .7rem 0 1.2rem; }
h3 { font-size: 1.13rem; line-height: 1.3; letter-spacing: -.02em; margin: 0 0 .7rem; }
h4 { font-size: .94rem; line-height: 1.4; margin: 0 0 .7rem; }
ul, ol { margin: .5rem 0 1.25rem; padding-left: 1.35rem; }
li + li { margin-top: .45rem; }
strong { font-weight: 650; }
small { font-size: .8rem; }
code, pre, kbd, samp { font-family: var(--mono); }
code { font-size: .875em; padding: .08em .28em; background: #e7e9df; border-radius: 3px; overflow-wrap: anywhere; }
pre { margin: 1rem 0; padding: 1.25rem 1.4rem; background: var(--navy-deep); border: 1px solid var(--navy-line); border-radius: var(--radius); color: var(--instrument-ink); font-size: .8rem; line-height: 1.7; overflow-x: auto; tab-size: 2; }
pre code { background: transparent; color: inherit; padding: 0; overflow-wrap: normal; font-size: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: 1rem; left: 1rem; z-index: 10; transform: translateY(-200%); padding: .75rem 1rem; background: var(--paper-raised); border: 2px solid var(--teal); }
.skip-link:focus { transform: translateY(0); }

.site-header, .course-hero, .course-nav, .shell, body > footer, main > footer { width: calc(100% - 6rem); max-width: 1360px; margin-inline: auto; }
.site-header { display: flex; align-items: center; gap: 1.2rem; min-height: 92px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: -.035em; font-size: 1.25rem; white-space: nowrap; }
.brand::before { content: ""; display: inline-block; width: 21px; height: 21px; margin-right: .65rem; border: 2px solid var(--teal); border-radius: 50% 50% 50% 0; transform: rotate(-35deg); }
.brand span { margin-left: .8rem; color: var(--ink-muted); font: 400 .75rem/1.4 var(--mono); letter-spacing: .01em; }
.edition { margin-left: auto; color: var(--ink-muted); font-family: var(--mono); text-transform: uppercase; letter-spacing: .09em; font-size: .75rem; }
.site-header button { font-size: .77rem; min-height: 44px; padding: .55rem .9rem; background: transparent; color: var(--ink); border-color: #a8b7af; }
.site-header button:hover:not(:disabled) { color: var(--teal-dark); background: var(--teal-wash); border-color: var(--teal); }
.course-hero { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; padding-block: 4.25rem 4rem; }
.hero-copy { max-width: 650px; }
.eyebrow { color: var(--teal-dark); text-transform: uppercase; letter-spacing: .13em; font-family: var(--mono); font-weight: 550; font-size: .75rem; line-height: 1.5; }
.lede { color: var(--ink-muted); font-size: clamp(1.05rem, 1.6vw, 1.2rem); line-height: 1.6; max-width: 34rem; margin-bottom: 1.6rem; }
.meta { display: flex; flex-wrap: wrap; gap: .45rem 1rem; margin: 1.4rem 0 1.9rem; color: var(--ink-muted); font-family: var(--mono); font-size: .75rem; }
.meta span + span::before { content: "·"; margin-right: 1rem; }
.hero-instrument { position: relative; margin: 0; background: var(--navy); color: var(--instrument-ink); border: 1px solid var(--navy-line); border-radius: 8px; padding: 1.5rem; box-shadow: 0 14px 0 -8px #d9ddd2; }
.hero-instrument svg { display: block; width: 100%; height: auto; }
.hero-instrument svg g[fill="none"] > rect { fill: #1b3540; stroke: #95b1b3; }
.hero-instrument svg g[fill="none"] > path:first-of-type { stroke: var(--signal-blue); }
.hero-instrument svg g[fill="none"] > path:last-child { stroke: var(--signal); }
.hero-instrument svg g[fill="currentColor"] > text:last-child { fill: var(--signal); }
.hero-instrument figcaption, .hero-instrument > p { margin: 1rem 0 0; color: var(--instrument-muted); font-family: var(--mono); font-size: .75rem; line-height: 1.5; }
.hero-instrument .eyebrow { color: var(--signal); }
.course-nav { display: flex; gap: .8rem 2.25rem; align-items: center; padding-block: 1.1rem; border-block: 1px solid var(--line); }
.course-nav a { color: var(--ink-muted); min-height: 36px; display: inline-flex; align-items: center; font-size: .81rem; text-decoration: none; }
.course-nav a:hover, .course-nav a[aria-current] { color: var(--teal-dark); }
.course-nav a[aria-current] { font-weight: 650; }
.course-nav a:last-child { margin-left: auto; }
.shell { display: grid; grid-template-columns: 198px minmax(0, 1fr); gap: 3.5rem; padding-block: 3.6rem 5rem; align-items: start; }
.sidebar { position: sticky; top: 2rem; }
.sidebar h2, .sidebar h3, .sidebar > p { margin: 0 0 .9rem; color: var(--ink-muted); font-family: var(--mono); font-size: .75rem; font-weight: 500; line-height: 1.4; text-transform: uppercase; letter-spacing: .1em; }
.sidebar nav { display: grid; gap: .25rem; }
@media (min-width: 851px) {
  .sidebar nav { max-height: calc(100vh - 4rem); overflow-y: auto; }
}
.sidebar a { display: block; min-height: 44px; padding: .65rem .65rem .65rem .9rem; border-left: 2px solid transparent; color: var(--ink-muted); font-size: .8rem; line-height: 1.45; text-decoration: none; }
.sidebar a:hover { border-color: var(--line); color: var(--teal-dark); background: #ecefe4; }
.sidebar a[aria-current], .sidebar a.active { border-color: var(--teal); color: var(--teal-dark); background: #e6ece1; font-weight: 650; }
.sidebar a span, .sidebar a small { display: block; font-family: var(--mono); font-size: .75rem; color: var(--ink-muted); margin-bottom: .15rem; }
.lesson { min-width: 0; overflow-wrap: anywhere; }
.lesson-goal { max-width: 49rem; color: var(--ink-muted); font-size: 1.1rem; line-height: 1.6; margin-bottom: 2rem; }
.teaching-block { max-width: 53rem; margin-bottom: 2.2rem; }
.teaching-block > h3 { margin: 1.65rem 0 .8rem; font-size: 1.2rem; }
.teaching-block > p { max-width: 49rem; }
.teaching-block figure { margin: 1.5rem 0; }
.teaching-block figcaption { margin-top: .7rem; color: var(--ink-muted); font-size: .8rem; }
.source-note { color: var(--ink-muted); font-size: .78rem; }
.lesson-footer { margin-top: 2.5rem; }
.save-status { width: calc(100% - 6rem); max-width: 1360px; margin: 1.1rem auto 3rem; color: var(--ink-muted); font: .75rem/1.6 var(--mono); }
main > .lesson-section { width: calc(100% - 6rem); max-width: 1360px; margin-inline: auto; }
main > .lesson-section > .shell { width: 100%; margin: 0; padding-block: .5rem 0; }
.lesson-section { margin: 0 0 4.6rem; scroll-margin-top: 2rem; }
.lesson-section + .lesson-section { padding-top: 3.75rem; border-top: 1px solid var(--line); }
.section-heading { max-width: 46rem; margin-bottom: 2rem; }
.section-heading > p:last-child { color: var(--ink-muted); max-width: 42rem; }
.section-heading h2 + p { font-size: 1.05rem; }
.lesson-section > p, .lesson-section > ul, .lesson-section > ol { max-width: 47rem; }
.concept-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; margin: 1.75rem 0; }
.concept-card { border-top: 3px solid var(--teal); background: #edeedf; padding: 1.35rem 1.2rem 1.1rem; }
.concept-card p { font-size: .88rem; line-height: 1.65; color: #43575a; margin-bottom: 0; }
.concept-card .eyebrow { margin-bottom: .65rem; }
.callout { margin: 1.8rem 0; padding: 1.25rem 1.5rem; background: var(--teal-wash); border-left: 3px solid var(--teal); color: #294d4e; font-size: .9rem; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--teal-dark); }
.callout.warning { border-color: #a66f29; background: #efe7d2; color: #5f4a25; }
.callout.warning strong { color: #68491d; }

.lab-workspace { min-width: 0; background: var(--navy); border: 1px solid var(--navy-line); border-radius: 9px; overflow: hidden; color: var(--instrument-ink); margin: 2rem 0 1.25rem; box-shadow: 0 12px 0 -7px #d8ddd2; }
.lab-workspace h2, .lab-workspace h3, .lab-workspace h4 { color: var(--instrument-ink); }
.lab-workspace a { color: var(--signal-blue); }
.lab-workspace code { background: #29444c; color: var(--instrument-ink); }
.lab-workspace :focus-visible { outline-color: var(--signal); }
.lab-topline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; padding: 1rem 1.5rem; border-bottom: 1px solid var(--navy-line); }
.lab-topline h3 { margin: 0; font-size: 1rem; }
.lab-topline .eyebrow { color: var(--instrument-muted); font-size: .75rem; }
.status-pill { display: inline-flex; align-items: center; gap: .45rem; flex-shrink: 0; padding: .3rem .65rem; border: 1px solid #59715c; border-radius: 30px; color: var(--signal); background: #213e3e; font-family: var(--mono); font-size: .75rem; line-height: 1.5; white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.lab-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); }
.control-panel { min-width: 0; padding: 1.4rem 1.2rem; border-right: 1px solid var(--navy-line); background: #182f38; }
.control-panel .field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .8rem; }
.control-panel > p { color: var(--instrument-muted); font-size: .8rem; }
.control-panel > .eyebrow { color: var(--signal); margin: .1rem 0 .9rem; }
.control-panel > button { width: 100%; margin-top: .3rem; color: var(--navy-deep); background: var(--signal); border-color: var(--signal); font-size: .8rem; }
.control-panel > button:hover:not(:disabled) { background: #ceeaa0; color: var(--navy-deep); border-color: #ceeaa0; }
.control-panel .prediction-grid { grid-template-columns: 1fr; gap: .65rem; margin: .85rem 0 1rem; }
.control-panel .prediction-grid .field { display: grid; grid-template-columns: minmax(0, 1fr) 106px; align-items: center; gap: .5rem; margin: 0; color: var(--instrument-muted); font-weight: 400; }
.control-panel .prediction-grid input { padding-inline: .5rem; font-size: .8rem; }
.control-panel h4 { color: var(--instrument-muted); font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.field { display: grid; gap: .4rem; margin: 0 0 1rem; font-size: .76rem; color: var(--ink-muted); }
.lab-workspace .field { color: var(--instrument-muted); }
.field label { display: block; }
.field input, .field select, .field textarea { display: block; width: 100%; min-width: 0; padding: .55rem .7rem; color: var(--ink); background: var(--paper-raised); border: 1px solid #748b8b; border-radius: 4px; font-size: .83rem; font-variant-numeric: tabular-nums; }
.field textarea { min-height: 110px; resize: vertical; }
.field input[type="range"] { padding: 0; background: transparent; accent-color: var(--signal); border: 0; }
.field input[type="checkbox"] { display: inline-block; width: 20px; min-height: 20px; accent-color: var(--signal); }
.field small { color: var(--ink-muted); font-size: .75rem; line-height: 1.5; }
.lab-workspace .field small { color: var(--instrument-muted); }
.fine { color: var(--ink-muted); font-size: .8rem; }
.controls { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.25rem 0 .5rem; }
.controls button { flex: 1 1 auto; min-height: 44px; padding: .65rem .65rem; color: var(--instrument-ink); background: #294550; border: 1px solid #64818a; font-size: .75rem; font-weight: 600; }
.controls button:hover:not(:disabled) { background: #355964; border-color: var(--signal-blue); }
.controls button.primary { color: var(--navy-deep); background: var(--signal); border-color: var(--signal); }
.controls button.primary:hover:not(:disabled) { color: var(--navy-deep); background: #ceeaa0; border-color: #ceeaa0; }
.signal-panel { min-width: 0; padding: 1.4rem 1.4rem 1.25rem; }
.signal-panel > p { font-size: .75rem; color: var(--instrument-muted); }
.signal-panel > .eyebrow { color: var(--signal); }
.signal-panel h4 { color: var(--instrument-muted); font-family: var(--mono); font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1.45rem; }
.metric { padding: .6rem .55rem .65rem; background: #1b3540; border: 1px solid #36545d; border-radius: 3px; text-align: center; min-width: 0; }
.metric strong { display: block; color: var(--signal); font: 500 1.45rem/1.4 var(--mono); font-variant-numeric: tabular-nums; }
.metric span { display: block; color: var(--instrument-muted); font-family: var(--mono); font-size: .75rem; line-height: 1.6; letter-spacing: .02em; overflow-wrap: anywhere; }
.waveform-wrap { overflow-x: auto; margin-bottom: 1.2rem; border: 1px solid #36525b; border-radius: 4px; }
.waveform-wrap > p { min-height: 140px; display: flex; justify-content: center; align-items: center; margin: 0; padding: 1rem; color: var(--instrument-muted); font: .8rem/1.6 var(--mono); text-align: center; background: var(--navy-deep); }
.waveform-scroll-hint { display: none; margin: -.4rem 0 1rem; color: var(--instrument-muted); font: .75rem/1.6 var(--mono); }
.waveform { display: block; width: 100%; height: auto; background: var(--navy-deep); border: 1px solid #36525b; border-radius: 4px; margin-bottom: 1.2rem; }
.waveform-wrap .waveform { min-width: 720px; border: 0; margin-bottom: 0; }
.waveform text { font-family: var(--mono); font-size: 14px; }
.fifo { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .4rem; margin: .6rem 0 1.1rem; }
.fifo > p { grid-column: 1 / -1; margin: 0 0 .4rem; color: var(--instrument-muted); font: .75rem/1.6 var(--mono); }
.fifo-slot { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: .15rem; min-width: 0; min-height: 48px; text-align: center; overflow-wrap: anywhere; padding: .4rem .2rem; background: #344e44; border: 1px solid #8aa366; border-radius: 3px; color: #e1f2c9; font: 600 .75rem/1.4 var(--mono); }
.fifo-slot small { font-size: .75rem; font-weight: 400; color: #c6d6b4; }
.fifo-slot.empty { border-color: #43616b; background: #1a3540; color: #8fa8ad; font-weight: 400; }
.lab-workspace .table-wrap { border-color: #36525b; }
.lab-workspace table { color: var(--instrument-ink); font-size: .75rem; }
.lab-workspace th { color: var(--instrument-muted); background: #1c3540; border-color: #36525b; font-size: .75rem; }
.lab-workspace td { border-color: #36525b; }
.lab-workspace tbody tr:nth-child(even) { background: #172f39; }
.lab-workspace .empty { color: var(--instrument-muted); }
.lab-workspace > details { margin: 0; padding: .5rem 1.4rem; border-top: 1px solid var(--navy-line); }
.lab-workspace > details summary { color: var(--instrument-muted); }
.lab-workspace .feedback { color: var(--instrument-ink); background: #233f43; border-color: var(--signal); }
.lab-workspace .feedback:empty { display: none; }
.lab-workspace .feedback.error { color: #ffcfb5; background: #4f3630; border-color: #e9a080; }
.lab-workspace caption { padding: .8rem; font-size: .75rem; text-align: left; color: var(--instrument-muted); }
.lab-workspace > .callout { background: #213e43; border-color: var(--signal); color: var(--instrument-muted); margin: 0; border-radius: 0; font-size: .8rem; }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .82rem; text-align: left; font-variant-numeric: tabular-nums; }
th { font-family: var(--mono); font-size: .75rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; background: #eceee3; }
th, td { padding: .75rem .85rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { font-family: var(--mono); }
tbody tr:last-child td { border-bottom: 0; }

.practice-card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.75rem; margin: 1.8rem 0; }
.practice-card > .eyebrow { margin-bottom: .65rem; }
.practice-card > p { font-size: .92rem; max-width: 45rem; }
.practice-card h3 { font-size: 1.15rem; }
.practice-card label { color: var(--ink); font-weight: 550; font-size: .81rem; line-height: 1.4; }
.practice-card input, .practice-card textarea, .prediction-grid input, .prediction-grid select { width: 100%; min-width: 0; color: var(--ink); background: var(--paper-raised); padding: .65rem .75rem; border: 1px solid #9dadab; border-radius: 4px; font-variant-numeric: tabular-nums; }
.practice-card textarea { min-height: 110px; resize: vertical; margin-top: .5rem; }
.prediction-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin: 1.25rem 0; }
.prediction-grid label { display: grid; gap: .6rem; align-content: start; }
.prediction-grid input { font-family: var(--mono); }
.prediction-grid small { display: block; color: var(--ink-muted); font-weight: 400; font-size: .75rem; }
.practice-card > button { margin-top: .25rem; }
.practice-card .hint-button { background: transparent; color: var(--teal-dark); border-color: #acbcb1; margin-left: .4rem; }
.practice-card .hint-button:hover { background: var(--teal-wash); border-color: var(--teal); }
.inline-check fieldset { margin: 0 0 1rem; padding: 0; border: 0; min-width: 0; }
.inline-check legend { margin-bottom: .9rem; font-size: 1rem; font-weight: 600; line-height: 1.5; }
.inline-check fieldset label { display: flex; align-items: flex-start; gap: .7rem; min-height: 48px; margin-bottom: .6rem; padding: .8rem; background: #f2f3ea; border: 1px solid var(--line); border-radius: 4px; font-weight: 400; }
.inline-check fieldset label:has(input:checked) { background: #e5eee1; border-color: var(--teal); }
.inline-check input[type="radio"] { flex: 0 0 18px; width: 18px; height: 18px; min-height: 18px; margin: 2px 0 0; padding: 0; accent-color: var(--teal); }
.feedback:empty, .hint:empty { display: none; }
.feedback { margin: 1.2rem 0 0; padding: 1rem 1.1rem; border-left: 3px solid var(--teal); background: #e5eee3; color: #284f43; font-size: .85rem; }
.feedback p:last-child { margin-bottom: 0; }
.feedback.error, .error { color: var(--error); background: #f2e5dc; border-color: var(--error); }
.error:not(.feedback) { padding: .65rem .8rem; margin: .75rem 0; font-size: .84rem; }
.hint, details { margin-top: 1.15rem; border-top: 1px solid var(--line); padding-top: .8rem; font-size: .85rem; }
summary { color: var(--teal-dark); cursor: pointer; min-height: 44px; padding-block: .5rem; font-size: .8rem; font-weight: 600; }
summary::marker { font-size: .75rem; }
details > p { margin: .5rem 0 .75rem; color: var(--ink-muted); }
.evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.75rem 0; }
.evidence-card { border: 1px solid var(--line); padding: 1.2rem 1.3rem; border-radius: var(--radius); }
.evidence-card h3 { font-size: .96rem; }
.evidence-card p { color: var(--ink-muted); font-size: .84rem; margin-bottom: 0; }
.evidence-card .eyebrow { margin-bottom: .6rem; }
.evidence-card .status-pill { color: var(--teal-dark); background: var(--teal-wash); border-color: #aac1ad; margin-bottom: 1rem; }
.evidence-card:not(:first-child) .status-pill { color: #705d39; background: #eee9d9; border-color: #cdbf9c; }
.evidence-card.verified { border-top: 3px solid var(--teal); }
.evidence-card.unverified { border-top: 3px solid #ad945f; }
.roadmap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.8rem; margin: 1.5rem 0; }
.module-card { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: .85rem; padding: 1.45rem 0; border-top: 1px solid var(--line); }
.roadmap .module-card { display: block; min-width: 0; padding: 1.45rem 0; color: var(--ink); background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; font: inherit; text-transform: none; letter-spacing: normal; }
.module-card > .eyebrow { margin-bottom: .8rem; }
.module-card ul { font-size: .84rem; }
.module-card > .number, .module-card > .module-number { color: var(--teal); font: .75rem/1.6 var(--mono); }
.module-card h3 { margin-bottom: .5rem; font-size: 1rem; }
.module-card p { color: var(--ink-muted); font-size: .84rem; margin-bottom: .6rem; }
.module-card .planned, .planned { display: inline-block; color: #6b674f; background: #e9e7d8; border: 1px solid #d2d0bd; border-radius: 3px; padding: .16rem .4rem; font: .75rem/1.5 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.module-card .ready, .ready { display: inline-block; color: #305c4c; background: #deebdc; border: 1px solid #b4cdb3; border-radius: 3px; padding: .16rem .4rem; font: .75rem/1.5 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.sources { padding-left: 1.3rem; font-size: .85rem; color: var(--ink-muted); }
.sources li { padding-left: .35rem; margin-bottom: .8rem; }
.sources a { color: var(--teal-dark); overflow-wrap: anywhere; }
.sources > ul { padding-left: 1.3rem; }
.sources dt { color: var(--ink); font-weight: 650; margin-top: .8rem; }
.sources dd { margin-left: 0; margin-top: .3rem; }
footer { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding-block: 1.75rem 2.4rem; color: var(--ink-muted); font-size: .75rem; }
footer p { margin-bottom: .5rem; }

@media (min-width: 1500px) {
  .course-hero { padding-block: 5rem 4.6rem; }
}
@media (max-width: 1100px) {
  .site-header, .course-hero, .course-nav, .shell, body > footer, main > footer { width: calc(100% - 3.5rem); }
  main > .lesson-section, .save-status { width: calc(100% - 3.5rem); }
  .course-hero { gap: 2.25rem; }
  .hero-instrument { padding: 1rem; }
  .shell { grid-template-columns: 158px minmax(0, 1fr); gap: 2rem; }
  .lab-grid { grid-template-columns: 280px minmax(0, 1fr); }
  .control-panel, .signal-panel { padding: 1rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .metric { display: flex; align-items: center; justify-content: space-between; gap: .5rem; text-align: left; padding: .45rem .65rem; }
  .metric strong { font-size: 1.2rem; }
  .metric span { max-width: 6.5rem; font-size: .75rem; }
  .waveform-scroll-hint { display: block; }
  .concept-grid { gap: .75rem; }
  .concept-card { padding: 1.1rem .9rem; }
}
@media (max-width: 850px) {
  .course-hero { grid-template-columns: 1fr; padding-block: 3.25rem; gap: 2.5rem; }
  .hero-copy { max-width: 640px; }
  h1 { max-width: 670px; font-size: clamp(3.5rem, 9vw, 5.5rem); }
  .hero-instrument { max-width: 650px; padding: 1.25rem; }
  .course-nav { gap: 1.5rem; overflow-x: auto; }
  .course-nav a { white-space: nowrap; }
  .shell { display: block; padding-top: 2.5rem; }
  .sidebar { position: static; padding-bottom: 1.3rem; margin-bottom: 2.7rem; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: flex; overflow-x: auto; gap: .4rem; }
  .sidebar a { flex: 0 0 auto; max-width: 210px; border-left: 0; border-bottom: 2px solid transparent; padding: .65rem .85rem; }
  .sidebar h2, .sidebar h3, .sidebar > p { margin-bottom: .6rem; }
  .lesson-section { margin-bottom: 3.5rem; }
  .lesson-section + .lesson-section { padding-top: 3rem; }
  .lab-grid { grid-template-columns: 280px minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 1rem; }
  body { font-size: 15px; }
  .site-header, .course-hero, .course-nav, .shell, body > footer, main > footer { width: calc(100% - 2.25rem); }
  main > .lesson-section, .save-status { width: calc(100% - 2.25rem); }
  .site-header { min-height: 78px; gap: .6rem; flex-wrap: wrap; padding-block: 1rem; }
  .brand { font-size: 1.1rem; }
  .brand::before { width: 18px; height: 18px; margin-right: .5rem; }
  .brand span { display: none; }
  .edition { display: none; }
  .site-header button { margin-left: auto; font-size: .75rem; max-width: 135px; min-height: 44px; }
  .course-hero { padding-block: 2.5rem; gap: 2rem; }
  h1 { font-size: clamp(3.1rem, 12.7vw, 4.5rem); margin-top: .9rem; letter-spacing: -.05em; }
  .eyebrow { font-size: .75rem; letter-spacing: .1em; }
  .lede { font-size: 1.02rem; line-height: 1.6; }
  .meta { font-size: .75rem; gap: .45rem .75rem; }
  .meta span + span::before { content: ""; margin: 0; }
  .hero-instrument { padding: .85rem; }
  .hero-instrument svg text { font-size: 23px; }
  .hero-instrument svg text[letter-spacing] { display: none; }
  .hero-instrument figcaption, .hero-instrument > p { font-size: .75rem; }
  .course-nav { gap: 1.3rem; padding-block: .8rem; }
  .course-nav a { font-size: .75rem; min-height: 44px; }
  .course-nav a:last-child { margin-left: 0; }
  .shell { padding-top: 2rem; padding-bottom: 2rem; }
  .sidebar { margin-bottom: 2.2rem; }
  .sidebar a { font-size: .75rem; padding-inline: .6rem; }
  .section-heading { margin-bottom: 1.45rem; }
  h2 { font-size: 2.15rem; }
  .section-heading h2 + p { font-size: .96rem; }
  .concept-grid { grid-template-columns: 1fr; gap: .8rem; }
  .concept-card { padding: 1.2rem; }
  .concept-card h3 { margin-bottom: .5rem; }
  .callout { padding: 1.05rem 1.1rem; font-size: .83rem; }
  .lab-topline { padding: .9rem 1rem; align-items: flex-start; flex-wrap: wrap; gap: .6rem; }
  .lab-topline h3 { font-size: .91rem; }
  .status-pill { font-size: .75rem; }
  .lab-grid { grid-template-columns: 1fr; }
  .control-panel { border-right: 0; border-bottom: 1px solid var(--navy-line); padding: 1.1rem 1rem; }
  .control-panel .field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .8rem; }
  .control-panel .prediction-grid .field { grid-template-columns: minmax(0, 1fr) minmax(100px, .7fr); }
  .field { margin-bottom: .75rem; font-size: .75rem; }
  .field input, .field select { font-size: .81rem; padding-inline: .5rem; }
  .controls { margin-top: .5rem; }
  .controls button { min-height: 46px; }
  .signal-panel { padding: 1.15rem .8rem; }
  .metrics { gap: .45rem; margin-bottom: 1.1rem; }
  .metric strong { font-size: 1.3rem; }
  .metric span { font-size: .75rem; }
  .fifo { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; }
  .fifo-slot { min-height: 45px; font-size: .75rem; }
  .fifo-slot small { font-size: .75rem; }
  .waveform-wrap { overflow-x: auto; }
  .waveform-wrap .waveform { min-width: 720px; }
  .signal-panel > .waveform { min-height: 150px; }
  .lab-workspace th, .lab-workspace td { padding: .65rem .6rem; }
  .practice-card { padding: 1.25rem 1.1rem; }
  .prediction-grid { grid-template-columns: 1fr; gap: 1rem; }
  .prediction-grid label { grid-template-columns: minmax(0, 1fr) minmax(90px, .7fr); align-items: center; gap: .8rem; }
  .prediction-grid label small { grid-column: 1 / -1; margin-top: -.4rem; }
  .practice-card > button { width: 100%; }
  .practice-card .hint-button { margin-left: 0; margin-top: .7rem; }
  .evidence-grid, .roadmap { grid-template-columns: 1fr; }
  .evidence-card { padding: 1.15rem; }
  .module-card { padding-block: 1.2rem; }
  pre { padding: 1rem; font-size: .75rem; }
  .sources { font-size: .8rem; }
  footer { display: block; padding-block: 1.5rem 2rem; }
  footer span { display: block; margin-bottom: .35rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  body { background: white; font-size: 11pt; }
  .site-header, .course-hero, .course-nav, .shell, body > footer, main > footer { width: 100%; max-width: none; }
  .shell { display: block; }
  .sidebar, .course-nav, .site-header button, .controls { display: none; }
  .course-hero { padding-block: 1rem; gap: 2rem; }
  h1 { font-size: 42pt; }
  .lesson-section { break-inside: avoid; }
  .lab-workspace { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  a { color: inherit; }
}

/* Long protocol/URI terms must wrap inside narrow source notes. */
.sources, .source-note, #history { overflow-wrap: anywhere; }

.route-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 1rem; margin: 1.5rem 0 2.5rem; }
.route-card { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-raised); min-width: 0; }
.route-card h4 { font-size: 1.1rem; }
.route-card li p { font-size: .85rem; margin-top: .3rem; }

/* accessibility-08: teaching text has a 16px floor; compact navigation stays separate. */
.teaching-block > p:not(.source-note) { font-size: 17px; }
.practice-card > p:not(.eyebrow):not(.fine), .practice-card label,
.inline-check legend, .feedback, .callout, .concept-card p, .evidence-card p,
.route-card > p:not(.eyebrow), .route-card li p { font-size: 16px; }
.practice-card input, .practice-card textarea { font-size: 16px; }
.embedded-visual .fpga-visual :is(.fv-scope, .fv-footnote, .fv-feedback p, .fv-details p, .fv-mode p, .fv-saved, .fv-choice) { font-size: 16px; }
@media (max-width: 600px) { body { font-size: 16px; } }
.lab-workspace > .callout { font-size: 16px; }
.embedded-visual .fpga-visual :is(.fv-metric-notes p, .fv-past-prediction p) { font-size: 16px; }
