/* MassSpec.Tips course layer.
   Extends the original graph-paper, frosted blue panels and serif headings.
   Reference content and interactive components keep their existing hooks. */
:root {
  --bg: #e8eef2;
  --panel: #f7fbff;
  --panel-2: #eef6fc;
  --ink: #0f1a24;
  --muted: #445463;
  --line: #bfd0df;
  --brand: #0f6e8a;
  --brand-deep: #0b566d;
  --accent: #1d8fb4;
  --accent-soft: #dff2fa;
  --shadow: 0 16px 40px rgba(11, 26, 38, .08);
  --radius: 18px;
  --serif: "IBM Plex Serif", Georgia, serif;
  --sans: "Space Grotesk", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html { scroll-padding-top: 1.5rem; }
body {
  color: var(--ink);
  font: 1rem/1.65 var(--sans);
  background:
    linear-gradient(rgba(15, 110, 138, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 110, 138, .055) 1px, transparent 1px),
    radial-gradient(circle at 12% 8%, rgba(29, 143, 180, .13), transparent 42%),
    linear-gradient(180deg, #e3ebf1 0%, #e8eef2 30%, #edf3f7 100%);
  background-size: 24px 24px, 24px 24px, auto, auto;
}
a { color: var(--brand-deep); text-underline-offset: .2em; }
a:hover { color: var(--brand); }
:focus-visible, .ms-lab :focus-visible {
  outline: 3px solid #8b4816;
  outline-offset: 4px;
}
button, input, select, textarea { font: inherit; }
input { accent-color: var(--brand); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.22; letter-spacing: -.025em; }
h1 { font-size: clamp(2rem, 3.6vw, 3.25rem); font-weight: 600; }
h2 { font-size: clamp(1.65rem, 2.5vw, 2.25rem); font-weight: 600; }
h3 { font-size: 1.35rem; font-weight: 600; }
p { margin: 0 0 1rem; }
[hidden] { display: none !important; }
.shell, .masthead, .course-footer, .article-header-shell, .article-main-shell,
.reference-page .header-shell, .reference-page .section-shell, .reference-page .site-nav {
  width: min(1160px, calc(100% - 2.5rem));
  margin-inline: auto;
}
.eyebrow {
  margin: 0 0 .6rem;
  color: var(--brand-deep);
  font: 700 .8rem/1.6 var(--mono);
  text-transform: uppercase;
  letter-spacing: .09em;
}
.lede { max-width: 58ch; color: var(--muted); font: 1.1rem/1.75 var(--sans); margin: 0; }
.small-note, .fine-print { font-size: .8rem; line-height: 1.6; color: var(--muted); }

/* A compact navigation panel leaves the teaching content close to the top. */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: 1rem;
  padding: .8rem 1.25rem;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(248, 252, 255, .92);
  box-shadow: 0 8px 24px rgba(11, 26, 38, .045);
  backdrop-filter: blur(10px);
}
.wordmark { color: var(--ink); font: 700 1.35rem/1.3 var(--sans); text-decoration: none; letter-spacing: -.045em; white-space: nowrap; }
.wordmark > span:last-child { font-weight: 400; color: var(--brand-deep); }
.brand-mark { display: inline-flex; width: 30px; height: 32px; align-items: center; justify-content: center; margin-right: .5rem; border-radius: 8px; background: var(--brand); color: #fff !important; font-size: 1.45rem; }
.masthead nav { display: flex; align-items: center; gap: .3rem; }
.masthead nav a { color: var(--muted); padding: .65rem .85rem; border: 1px solid transparent; border-radius: 999px; font-size: .9rem; text-decoration: none; }
.masthead nav a:hover, .masthead nav a[aria-current] { background: var(--accent-soft); color: var(--brand-deep); border-color: #aacbdc; }
.nav-start { color: var(--brand-deep); border: 1px solid #adc7d7; background: #fff; border-radius: 999px; padding: .6rem 1rem; font-size: .875rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.nav-start span { display: none; }
.button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 46px;
  padding: .7rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 700 .9rem/1.45 var(--sans);
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.button-primary, .btn-primary { color: #fff; background: var(--brand); box-shadow: 0 6px 16px rgba(15, 110, 138, .16); }
.button-primary:hover, .button-primary:focus-visible, .btn-primary:hover, .btn-primary:focus-visible { color: #fff; background: var(--brand-deep); transform: none; }
.button-light, .btn-secondary { color: var(--brand-deep); background: #fff; border-color: var(--line); }
.button-light:hover, .btn-secondary:hover { background: var(--accent-soft); border-color: #93b6ca; }
.button-row { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.5rem; }

/* Homepage: the original paired-panel composition, with a real teaching plot. */
.home-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 1rem; padding: 1.25rem 0 2.75rem; align-items: stretch; }
.home-intro, .spectrum-card, .lesson-hero, .lab-hero,
.lesson-card, .lesson-toc, .lesson-body, .lab-feature, .closing-question,
.next-study, .reference-item {
  border: 1px solid rgba(191, 208, 223, .95);
  background: rgba(247, 251, 255, .92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.home-intro { padding: 2rem; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; border-radius: 24px; backdrop-filter: blur(10px); }
.home-hero h1 { margin: .2rem 0 1.2rem; font-size: clamp(2.1rem, 3.5vw, 3rem); line-height: 1.14; }
.home-hero h1 em, .lab-hero h1 em { font-style: normal; color: var(--brand-deep); }
.hero-note { margin: 1.2rem 0 0; color: var(--muted); font-size: .8rem; line-height: 1.7; }
.spectrum-card { padding: 1.5rem; border-radius: 24px; background: rgba(239, 247, 253, .96); }
.spectrum-topline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .35rem 1rem; font: .75rem/1.6 var(--mono); text-transform: uppercase; letter-spacing: .025em; color: var(--muted); }
.spectrum-topline .dot { display: none; }
.spectrum-card h2 { font-size: 1.5rem; margin: 1.1rem 0 .5rem; }
.spectrum-card > p { color: var(--muted); font-size: .95rem; }
.hero-plot { width: 100%; display: block; height: auto; margin: 1rem 0; }
.hero-plot text { fill: var(--muted); font: 11px var(--sans); }
.hero-plot .peak { stroke: var(--brand); stroke-width: 3; }
.hero-plot .peak-major { stroke-width: 5; }
.hero-plot .plotgrid { stroke: #c6d7e2; stroke-width: .8; stroke-dasharray: 3 4; }
.plot-reading { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: .875rem; line-height: 1.55; }
.plot-reading .read-number { color: var(--brand-deep); font: 500 1.65rem/1.3 var(--sans); font-variant-numeric: tabular-nums; }
.plot-reading > div { flex: 1 1 180px; }
.plot-reading strong { display: block; font-weight: 700; }
.spectrum-card > .small-note { font-size: .75rem; margin: .75rem 0 0; }
.section-rule { padding: 0 0 3rem; }
.section-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.25rem; }
.section-top > div { flex: 1; min-width: 0; }
.section-top h2 { margin: 0; max-width: 29ch; }
.section-top > p { flex: 0 1 370px; color: var(--muted); font-size: 1rem; margin: 0; }
.lesson-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.lesson-card { display: flex; flex-direction: column; padding: 1.6rem; background: linear-gradient(145deg, #f9fcff, #edf6fc); position: relative; overflow: hidden; }
.lesson-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--brand), #8fc9de); }
.card-meta { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; color: var(--muted); font: .75rem/1.65 var(--mono); }
.lesson-number { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; border: 1px solid #a9c7d9; border-radius: 12px; background: #dff0f8; color: var(--brand-deep); font: 600 1.25rem var(--serif); }
.lesson-card h3 { margin: 0 0 .75rem; font-size: 1.5rem; max-width: 29ch; }
.lesson-card p { color: var(--muted); font-size: 1rem; max-width: 52ch; margin-bottom: 1.25rem; }
.lesson-card > a { align-self: flex-start; margin-top: auto; font-size: .925rem; font-weight: 700; padding: .3rem 0; }
.lesson-card > a span { display: none; }
.lesson-card:hover { border-color: #8baec4; }
.path-note { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: 1rem; color: var(--muted); font-size: .875rem; }
.path-note strong { color: var(--ink); }
.lab-feature { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; padding: 2rem; background: rgba(229, 241, 249, .96); }
.lab-feature h2 { margin: 0 0 1rem; }
.lab-feature p { color: var(--muted); max-width: 55ch; }
.lab-preview { min-width: 0; padding: 1.25rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.lab-preview svg { display: block; width: 100%; height: auto; }
.lab-preview-foot { display: flex; gap: 1.25rem; justify-content: space-between; border-top: 1px solid var(--line); padding-top: .8rem; font-size: .8rem; color: var(--muted); }
.lab-preview-foot strong { display: block; font-size: 1rem; color: var(--ink); }
.reference-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.reference-item { display: flex; align-items: flex-start; gap: 1rem; text-decoration: none; padding: 1.4rem; box-shadow: 0 8px 22px rgba(11, 26, 38, .04); }
.reference-item > div { min-width: 0; }
.reference-item h3 { margin: 0 0 .4rem; font-size: 1.25rem; }
.reference-item p { color: var(--muted); font-size: .95rem; margin: 0; }
.reference-item:hover { border-color: #8baec4; background: #fff; }
.reference-icon { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 38px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--brand-deep); font-size: 1.5rem; }
.reference-item .arrow { display: none; }
.closing-question { display: grid; grid-template-columns: 1.1fr 1fr; align-items: start; gap: 2rem; padding: 2rem; margin-bottom: 1.5rem; }
.closing-question h2 { margin: 0 0 1rem; font-size: 1.75rem; }
.closing-question > div > p:not(.eyebrow) { color: var(--muted); }
.closing-question details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.15rem; }
.closing-question summary { cursor: pointer; color: var(--brand-deep); font-weight: 700; }
.closing-question details p { margin: 1rem 0 0; }
.next-study { padding: 1.75rem 2rem; margin: 2rem 0; }
.next-study.shell { margin: 1.5rem auto 2rem; }
.next-study h2 { margin: 0 0 .8rem; font-size: 1.65rem; }
.next-study p:not(.eyebrow) { max-width: 78ch; color: var(--muted); }
.next-study p:last-child { margin-bottom: 0; }

/* Learning pages read as one sheet, with distinct places to predict and check. */
.breadcrumb { display: inline-block; margin-bottom: 1rem; font-size: .875rem; }
.lesson-hero { margin-top: 1.25rem; padding: 2rem 2.25rem 1.5rem; background: linear-gradient(120deg, rgba(248, 252, 255, .96), rgba(233, 245, 253, .94)); }
.lesson-hero h1 { margin: 0 0 1rem; max-width: 25ch; }
.lesson-hero .lede { max-width: 70ch; }
.meta-divider { padding: 0 .5rem; }
.lesson-progress { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.lesson-progress a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); text-decoration: none; font: 700 .875rem var(--mono); }
.lesson-progress a[aria-current] { border-color: var(--brand); background: var(--brand); color: #fff; }
.lesson-layout { display: grid; grid-template-columns: 215px minmax(0, 1fr); gap: 1.25rem; align-items: start; padding-top: 1.25rem; }
.lesson-toc { position: sticky; top: 1.25rem; padding: 1.15rem; max-height: calc(100vh - 2.5rem); overflow: auto; box-shadow: 0 8px 22px rgba(11, 26, 38, .05); }
.lesson-toc nav { display: flex; flex-direction: column; gap: .15rem; }
.lesson-toc nav a { display: flex; align-items: baseline; gap: .6rem; padding: .55rem .25rem; color: var(--muted); font-size: .875rem; line-height: 1.5; text-decoration: none; border-radius: 7px; }
.lesson-toc nav a > span { color: var(--brand-deep); font: .75rem var(--mono); }
.lesson-toc nav a:hover, .lesson-toc nav a[aria-current] { background: var(--accent-soft); color: var(--brand-deep); }
.toc-note { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font: 1.05rem/1.65 var(--serif); }
.lesson-body { min-width: 0; padding: 2rem; background: rgba(250, 253, 255, .97); }
.lesson-body p, .lesson-body li { font-size: 1.0625rem; line-height: 1.8; }
.lesson-body > p, .lesson-body > ul, .lesson-body > ol { max-width: 70ch; }
.lesson-body ul, .lesson-body ol { padding-left: 1.5rem; }
.lesson-body li + li { margin-top: .45rem; }
.lesson-body h2 { margin: 3rem 0 1.25rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: 1.85rem; scroll-margin-top: 1.5rem; }
.lesson-body h3 { margin: 1.65rem 0 .8rem; font-size: 1.35rem; line-height: 1.4; }
.lesson-body h4 { margin: 1.25rem 0 .65rem; font-size: 1.05rem; }
.lesson-body strong { font-weight: 700; }
.lesson-body code { padding: .1rem .3rem; border: 1px solid #c6dbe8; border-radius: 5px; background: #eaf4fb; font: .91em/1.7 var(--mono); overflow-wrap: anywhere; }
.lesson-body pre { max-width: 100%; overflow: auto; white-space: pre-wrap; }
.table-scroll { max-width: 100%; overflow: auto; margin: 1.4rem 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.lesson-body table { width: 100%; min-width: 430px; border-collapse: collapse; font: .925rem/1.65 var(--sans); }
.lesson-body th, .lesson-body td { text-align: left; vertical-align: top; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.lesson-body th { background: #e9f3fa; color: var(--brand-deep); font-weight: 700; }
.lesson-body td[align="right"], .lesson-body th[align="right"] { text-align: right; }
.lesson-body tr:last-child td { border-bottom: 0; }
.answer-reveal { margin: 1.25rem 0; padding: 0 1.15rem; border: 1px solid #aecbde; border-radius: 12px; background: #edf6fc; }
.answer-reveal summary { min-height: 48px; padding: .85rem 0; color: var(--brand-deep); cursor: pointer; font-weight: 700; font-size: .95rem; line-height: 1.6; }
.answer-reveal[open] summary { border-bottom: 1px solid var(--line); margin-bottom: .8rem; }
.answer-reveal > :last-child { margin-bottom: 1rem; }
.answer-reveal p, .answer-reveal li { font-size: 1rem; }
.lab-intro { color: var(--muted); }

/* Reusable learning treatments; content remains ordinary semantic HTML. */
.lesson-overview, .overview, .lab-guide, .learning-goals, .prediction-card, .worked-example, .checkpoint,
.calculation-step, .lesson-takeaway, .evidence-note, .decision-note {
  margin: 1.25rem 0;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f0f7fc;
}
.lesson-overview, .overview { margin-top: 0; background: #edf6fc; }
.lab-guide { max-width: 85ch; background: rgba(247, 251, 255, .96); }
.lab-guide h2, .lab-guide h3 { font-size: 1.3rem; margin: 0 0 .8rem; }
.lab-guide p, .lab-guide li { font-size: 1rem; line-height: 1.75; }
.lab-guide > :last-child { margin-bottom: 0; }
.lesson-body .overview h2, .lesson-body .overview h3 { margin-top: 0; padding-top: 0; border-top: 0; }
.ms-flight-plot { display: block; width: 100%; height: auto; color: var(--brand); }
.lesson-overview h2, .learning-goals h2, .prediction-card h3, .worked-example h3,
.checkpoint h3, .lesson-takeaway h3 { margin-top: 0; padding-top: 0; border-top: 0; }
.prediction-card, .checkpoint { border-left: 4px solid var(--brand); background: #eaf5fc; }
.worked-example, .calculation-step { background: #fff; }
.lesson-overview > :last-child, .learning-goals > :last-child, .prediction-card > :last-child,
.worked-example > :last-child, .checkpoint > :last-child, .calculation-step > :last-child,
.lesson-takeaway > :last-child, .evidence-note > :last-child, .decision-note > :last-child { margin-bottom: 0; }

/* Interactive labs share the original palette and a restrained, functional hierarchy. */
.lab-hero { margin-top: 1.25rem; padding: 2rem; }
.lab-hero h1 { margin: 0 0 1rem; }
.lab-jumps { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.lab-context { margin: 1.75rem 0 .75rem; color: var(--muted); font-size: .9rem; }
.ms-lab { color: var(--ink); background: rgba(250, 253, 255, .98); border-color: var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 1.75rem; }
.ms-lab a { color: var(--brand-deep); }
.ms-lab h2 { font-family: var(--serif); letter-spacing: -.025em; font-size: 1.85rem; }
.ms-lab h3 { font-family: var(--sans); font-weight: 700; font-size: 1rem; }
.ms-number { background: var(--accent-soft); color: var(--brand-deep); border: 1px solid #b9d9e8; font-family: var(--mono); }
.ms-lab-heading p, .ms-field small, .ms-scroll-hint, .ms-retention, .ms-second, .ms-plot-kicker, .ms-metrics dt { color: var(--muted); }
.ms-eyebrow, .ms-plot-kicker, .ms-predict strong { font: 700 .8rem/1.6 var(--mono); letter-spacing: .055em; }
.ms-predict { background: #eaf5fb; border-left-color: var(--brand); border-radius: 0 10px 10px 0; }
.ms-predict p { font: 1.0625rem/1.75 var(--sans); }
.ms-layout { min-width: 0; }
.ms-controls, .ms-display { min-width: 0; max-width: 100%; }
.ms-controls { background: #eaf3fa; border: 1px solid #c3d7e5; }
.ms-field label { font-size: .9rem; }
.ms-field input, .ms-field select { border-color: #87a8bf; border-radius: 8px; color: var(--ink); }
.ms-field small { font-size: .8rem; }
.ms-lab button { color: var(--brand-deep); border-color: #9ab7ca; border-radius: 999px; font-size: .875rem; }
.ms-lab button:hover { background: #e2f0f9; }
.ms-lab button[aria-pressed="true"] { background: #dbeefa; border-color: var(--brand); color: var(--brand-deep); }
.ms-lab .ms-reset { color: #fff; background: var(--brand); border-color: var(--brand); }
.ms-lab .ms-reset:hover { background: var(--brand-deep); }
.ms-plot, .ms-table-wrap, .ms-flight-plot { width: 100%; max-width: 100%; min-width: 0; }
.ms-plot { border: 1px solid #cfdee8; border-radius: 10px; background: #fff; }
.ms-plot text { fill: var(--muted); }
.ms-stick, .ms-sum { stroke: var(--brand); }
.ms-axis { stroke: #879faf; }
.ms-gridline { stroke: #dbe6ee; }
.ms-metrics > div { border-top-color: var(--line); }
.ms-metrics dd { color: var(--brand-deep); }
.ms-readout { font-size: 1rem; }
.ms-assumptions { border: 1px solid #c2d8e7; background: #edf6fc; font-size: .9rem; }
.ms-lab summary { color: var(--brand-deep); font-size: .925rem; }
.ms-lab table { font-size: .825rem; }
.ms-legend, .ms-scroll-hint, .ms-metrics dt { font-size: .8rem; }
.ms-check-feedback { color: var(--brand-deep); font-size: .95rem; }
.lesson-body .ms-lab { padding: 1.25rem; margin-top: 1.25rem; box-shadow: none; background: #f5faff; }
.lesson-body .ms-layout { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
.lesson-body .ms-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; padding: 1rem; }
.lesson-body .ms-controls > h3, .lesson-body .ms-controls > .ms-reset { grid-column: 1 / -1; }
.lesson-body .ms-lab h2 { font-size: 1.65rem; border: 0; margin: 0 0 .65rem; padding: 0; }
.lesson-body .ms-lab p { font-size: 1rem; }

/* Existing reference pages retain their original panels, instead of flattening them. */
.article-page .site-header { padding-top: 0; }
.article-header-shell { grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 1rem; margin-top: 1.25rem; }
.article-hero { padding: 1.75rem; }
.article-hero h1 { font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.15; max-width: 24ch; }
.article-lede { font-size: 1.0625rem; line-height: 1.75; }
.article-meta-panel { padding: 1.4rem; font-size: .95rem; }
.article-meta-panel h2 { font-size: 1.15rem; }
.keyword-chip { font-size: .8rem; }
.article-main-shell { margin-top: 1.25rem; }
.article-layout { grid-template-columns: 215px minmax(0, 1fr); gap: 1.25rem; }
.article-toc { padding: 1.15rem; top: 1.25rem; max-height: calc(100vh - 2.5rem); overflow: auto; }
.article-toc h2 { font-size: 1rem; }
.article-toc a { font-size: .875rem; }
.article-toc li + li { margin-top: .45rem; }
.article-content, .plot-panel, .tool-controls { min-width: 0; }
.article-content { gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
.article-panel { min-width: 0; padding: 1.75rem; border-radius: 18px; }
.article-panel h2 { font-size: 1.65rem; line-height: 1.3; }
.article-panel h3 { font-size: 1.2rem; line-height: 1.4; margin-top: 1.4rem; }
.article-panel > p, .article-panel > ul, .article-panel > ol { font-size: 1.0625rem; line-height: 1.8; max-width: 72ch; }
.mini-panel { background: #f0f7fc; padding: 1rem; }
.mini-panel h3 { margin-top: 0; }
.eq-block { max-width: 100%; overflow-x: auto; }
.eq-note { font-size: .925rem; }
.math-table { min-width: 460px; font-size: .925rem; }
.article-panel .table-scroll { margin: 1rem 0; }
.article-page .tool-layout { grid-template-columns: minmax(190px, .8fr) minmax(0, 1.6fr); gap: 1rem; }
.article-page .tool-readout { font-size: .85rem; line-height: 1.65; overflow-wrap: anywhere; }
.article-page #stabilityPlot { min-height: 0; height: auto; max-width: 100%; overflow: hidden; }
.article-page #stabilityPlot svg { display: block; width: 100%; height: auto; }
.article-page #scanSlopeNumber { width: 100%; min-height: 44px; max-width: 100%; padding: .55rem; border: 1px solid #87a8bf; border-radius: 8px; font: 1rem var(--sans); }
.article-page .control-row .filter-btn { min-height: 44px; margin: .2rem 0; font-size: .85rem; }
.article-page .checkbox-list label { padding: .35rem 0; }
.article-page input[type="range"] { max-width: 100%; }
#slopeError:empty { display: none; }
#slopeError { padding: .65rem; border-radius: 8px; color: #862b24; background: #fff0ed; font-size: .875rem; }
.reference-page .header-shell { margin-top: 1.25rem; grid-template-columns: 1.25fr .75fr; }
.reference-page .brand-block { padding: 1.75rem; }
.reference-page .brand-block h1 { max-width: 21ch; font-size: clamp(2rem, 3.4vw, 3rem); }
.reference-page .brand-block::after { opacity: .3; }
.reference-page .hero-panel { align-self: stretch; padding: 1.5rem; }
.reference-page .site-nav { position: static; margin-top: 1rem; }
.reference-page .site-nav a { font-size: .9rem; }
.reference-page .section-heading h2 { font-size: 1.9rem; }
.reference-page .section-heading p { max-width: 82ch; }
.reference-page .search-strip .eyebrow { color: #e3f3fb; }
.reference-page .search-strip .section-shell { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); padding: 1.5rem; }
.reference-page .search-strip .section-shell > * { min-width: 0; }
.reference-page .search-box { display: block; }
.reference-page .search-strip h2 { font-size: 1.6rem; }
.catalog-help { grid-column: 1 / span 2; font-size: .9rem; line-height: 1.65; margin: 0; }
.catalog-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1.25rem; margin-top: 1rem; }
.catalog-tools label { display: inline-flex; align-items: center; gap: .65rem; min-height: 44px; font-size: .95rem; }
.catalog-tools input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; }
.catalog-tools button { min-height: 44px; padding: .6rem 1rem; font-size: .9rem; border-radius: 999px; }
.reference-page .search-box input:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.reference-page .path-card, .reference-page .topic-card, .reference-page .tutorial-card { border-color: var(--line); background: rgba(247, 251, 255, .96); }
.reference-page .path-card h3, .reference-page .topic-card h3, .reference-page .tutorial-card h3 { line-height: 1.35; }
.outline-label { align-self: start; background: #e6f1f8; border: 1px solid #c0d6e5; color: var(--muted); padding: .3rem .5rem; border-radius: 999px; font: .75rem/1.6 var(--mono); }

.course-footer { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 2rem; margin-top: 2.5rem; padding: 1.75rem 0 2rem; border-top: 1px solid #a9c1d1; }
.course-footer > p { margin: 0; color: var(--muted); font-size: .9rem; }
.course-footer nav { display: flex; justify-content: flex-end; align-items: start; flex-wrap: wrap; gap: .75rem 1.25rem; grid-column: 2; grid-row: 1 / 3; font-size: .875rem; }
.course-footer .fine-print { max-width: 82ch; grid-column: 1 / -1; margin-top: .5rem; font-size: .8rem; }

@media (max-width: 1050px) {
  .home-intro { padding: 1.6rem; }
  .home-hero h1 { font-size: 2.4rem; }
  .spectrum-card { padding: 1.25rem; }
  .lesson-layout, .article-layout { grid-template-columns: 185px minmax(0, 1fr); gap: 1rem; }
  .lesson-toc, .article-toc { padding: 1rem; }
  .lesson-body, .article-panel { padding: 1.5rem; }
  .article-header-shell { grid-template-columns: 1fr; }
  .article-meta-panel { padding: 1.25rem 1.5rem; }
  .article-page .tool-layout { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .shell, .masthead, .course-footer, .article-header-shell, .article-main-shell,
  .reference-page .header-shell, .reference-page .section-shell, .reference-page .site-nav { width: calc(100% - 2rem); }
  .masthead { gap: .75rem; padding: .65rem 1rem; }
  .nav-start { display: none; }
  .masthead nav a { padding: .65rem .6rem; }
  .home-hero { grid-template-columns: 1fr; gap: 1rem; padding-bottom: 2rem; }
  .home-intro { padding: 2rem; }
  .home-hero h1 { font-size: clamp(2.1rem, 5vw, 2.8rem); }
  .home-hero .lede { max-width: 62ch; }
  .spectrum-card { padding: 1.5rem; }
  .hero-plot { max-height: 320px; }
  .section-top { display: block; }
  .section-top > p { margin-top: .8rem; max-width: 60ch; }
  .lab-feature, .closing-question { grid-template-columns: 1fr; gap: 1.5rem; }
  .lab-feature { padding: 1.5rem; }
  .lesson-layout, .article-layout { display: block; }
  .lesson-toc, .article-toc { position: static; max-height: none; margin-bottom: 1rem; }
  .lesson-toc nav { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .8rem; }
  .toc-note { display: none; }
  .lesson-hero { padding: 1.5rem; }
  .lesson-hero h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
  .lesson-body h2 { margin-top: 2.5rem; }
  .article-toc ol { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1.5rem; }
  .article-toc li + li { margin-top: 0; }
  .reference-page .header-shell { grid-template-columns: 1fr; }
  .reference-page .search-strip .section-shell { grid-template-columns: minmax(0, 1fr); }
  .catalog-help { grid-column: 1; }
  .ms-layout, .lesson-body .ms-layout { grid-template-columns: minmax(0, 1fr); }
  .course-footer { grid-template-columns: 1fr; }
  .course-footer nav { grid-column: auto; grid-row: auto; justify-content: flex-start; margin-top: .5rem; }
}
@media (max-width: 580px) {
  .masthead { flex-wrap: wrap; justify-content: center; gap: .4rem; padding: .7rem; }
  .wordmark { font-size: 1.3rem; }
  .masthead nav { justify-content: center; width: 100%; gap: .35rem; }
  .masthead nav a { padding: .45rem .95rem; font-size: .9rem; }
  .home-intro, .spectrum-card { padding: 1.3rem; border-radius: 18px; }
  .home-hero h1 { font-size: 2.15rem; }
  .home-hero .lede { font-size: 1.0625rem; }
  .button-row { width: 100%; }
  .button-row .button { width: 100%; }
  .lesson-grid, .reference-grid { grid-template-columns: 1fr; }
  .lesson-card { padding: 1.35rem; }
  .lesson-card h3 { font-size: 1.4rem; }
  .section-rule { padding-bottom: 2rem; }
  .section-top h2 { font-size: 1.85rem; }
  .lab-feature, .closing-question, .next-study, .lab-hero { padding: 1.3rem; }
  .lab-feature h2 { font-size: 1.75rem; }
  .lab-preview { padding: 1rem; }
  .lab-preview-foot { gap: .75rem; }
  .lab-preview-foot strong { font-size: .95rem; }
  .reference-item { padding: 1.2rem; gap: .8rem; }
  .lesson-hero { padding: 1.3rem; }
  .lesson-hero h1 { font-size: 2rem; }
  .lesson-hero .eyebrow { font-size: .75rem; }
  .lesson-body { padding: 1.2rem; }
  .lesson-body p, .lesson-body li { font-size: 1rem; }
  .lesson-body h2 { font-size: 1.65rem; }
  .lesson-body h3 { font-size: 1.25rem; }
  .lesson-toc nav { display: block; }
  .lesson-toc nav a { padding: .5rem .3rem; }
  .lesson-body .ms-lab { padding: 1rem; }
  .lesson-body .ms-controls { display: block; }
  .lesson-body .ms-lab-heading { flex-wrap: wrap; gap: .6rem; }
  .lesson-body .ms-lab h2 { font-size: 1.45rem; }
  .ms-lab { padding: 1.2rem; }
  .ms-lab h2 { font-size: 1.55rem; }
  .ms-predict { padding: 1rem; }
  .ms-assumptions { padding: 1rem; }
  .ms-metrics { grid-template-columns: 1fr; }
  .answer-reveal { padding: 0 1rem; }
  .article-hero, .article-meta-panel, .article-panel { padding: 1.3rem; }
  .article-hero h1 { font-size: 2rem; }
  .article-panel > p, .article-panel > ul, .article-panel > ol { font-size: 1rem; }
  .article-toc ol { display: block; }
  .article-toc li + li { margin-top: .45rem; }
  .reference-page .brand-block, .reference-page .hero-panel { padding: 1.3rem; }
  .reference-page .brand-block h1 { font-size: 2rem; }
  .reference-page .section-heading h2 { font-size: 1.6rem; }
  .course-footer nav { gap: .5rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .masthead, .lesson-toc, .course-footer, .article-toc, .nav-start { display: none; }
  body, .article-page { background: #fff; color: #000; font-size: 11pt; }
  .shell, .article-header-shell, .article-main-shell { width: 100%; }
  .lesson-layout, .article-layout { display: block; }
  .lesson-hero, .lesson-body, .article-panel, .ms-lab { background: #fff; box-shadow: none; }
  .lesson-body { border: 0; padding: 0; }
  .answer-reveal > * { display: block !important; }
  .ms-lab, .table-scroll { break-inside: avoid; }
  a { color: inherit; }
}
