:root {
  color-scheme: light;
  --canvas: #fbfaf7;
  --paper: #fff;
  --ink: #172830;
  --deep: #142e37;
  --muted: #425861;
  --line: #d4dcd9;
  --blue: #135969;
  --blue-dark: #123d48;
  --orange: #a04e26;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --body: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 78px; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 17px/1.7 var(--body); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #418798; outline-offset: 3px; }
h1, h2, h3, h4, p, figure { margin: 0; }
canvas { display: block; width: 100%; max-width: 100%; }
i { font-family: Georgia, serif; }
.skip-link, .sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(100%); overflow: hidden; white-space: nowrap; }
.skip-link:focus { width: auto; height: auto; clip-path: none; z-index: 7; top: 6px; left: 12px; background: white; padding: 8px 12px; }
.shell { width: min(1224px, calc(100% - 92px)); margin-inline: auto; min-width: 0; }
.site-header { position: sticky; top: 0; z-index: 4; background: #112e37; color: #f6faf8; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 66px; position: relative; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 670; white-space: nowrap; }
.brand-mark { width: 32px; height: 32px; position: relative; background: #d9ece8; color: #164c57; border-radius: 4px; }
.brand-mark::before { content: ""; position: absolute; inset: auto 6px 7px; border-bottom: 1px solid; }
.brand-mark i { position: absolute; left: 8px; bottom: 9px; width: 15px; height: 6px; border: 1.4px solid; border-radius: 2px; }
.brand-mark i::before { content: ""; position: absolute; width: 1.6px; height: 12px; background: currentColor; left: 6px; bottom: 4px; transform: rotate(25deg); transform-origin: bottom; }
.brand-mark i::after { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: currentColor; left: 10px; bottom: 13px; }
#navigation { display: flex; align-items: stretch; gap: 10px; }
#navigation > .nav-item, .nav-group > summary { display: flex; align-items: center; gap: 8px; min-height: 66px; padding: 0 9px; border-bottom: 3px solid transparent; font-size: 15px; font-weight: 620; white-space: nowrap; list-style: none; }
#navigation > .nav-item:hover, #navigation > .nav-item[aria-current], .nav-group.active > summary, .nav-group[open] > summary, .nav-group > summary:hover { border-bottom-color: #a2d3c9; color: #e0f5ef; }
.nav-group { position: relative; }
.nav-group > summary::-webkit-details-marker, .theory-details > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.nav-group[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.nav-menu { position: absolute; right: 0; top: 100%; z-index: 2; width: min(390px, 85vw); padding: 7px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); box-shadow: 0 9px 24px #122b3724; }
.nav-menu a { display: grid; grid-template-columns: 2ch 1fr; gap: 11px; align-items: baseline; min-height: 44px; padding: 8px 10px; font-size: 15px; }
.nav-menu a:hover, .nav-menu a[aria-current] { background: #e4f0ed; color: #104755; }
.nav-menu a span { color: var(--blue); font: 14px var(--mono); }
.nav-toggle { display: none; }

.intro { margin-top: clamp(26px, 4.8vw, 70px); padding-bottom: clamp(24px, 4vw, 51px); border-bottom: 2px solid #264550; }
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; color: var(--blue); font-size: 15px; font-weight: 640; }
.breadcrumb span + span { padding-left: 12px; border-left: 1px solid #9aaead; color: var(--muted); }
h1 { max-width: 29em; margin: 11px 0 12px; color: var(--deep); font-size: clamp(30px, 4.35vw, 52px); line-height: 1.22; letter-spacing: -.038em; font-weight: 740; }
.intro p { max-width: 41em; font-size: clamp(16px, 1.5vw, 20px); color: var(--muted); }
.settings-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 14px; }
.experiment-heading { display: flex; align-items: center; gap: 8px 16px; margin-top: 6px; }
.experiment-heading > h1 { flex: 1; min-width: 0; margin: 0; }
.pdf-export { flex-shrink: 0; }
.intro .pdf-status { margin: 4px 0 0; font-size: 14px; }
#experiment-print { display: none; }
.section { margin-top: clamp(25px, 3.6vw, 46px); }
.report-part { border-bottom: 1px solid var(--line); padding-bottom: clamp(23px, 3.8vw, 40px); }
.section-header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 15px; margin-bottom: 14px; }
.section-header h2, .theory-details h2 { color: var(--deep); font-size: clamp(22px, 2.4vw, 30px); font-weight: 720; line-height: 1.3; }
.task-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.35fr); align-items: start; gap: 25px clamp(24px, 6vw, 92px); }
#experiment-description { color: var(--deep); font-size: clamp(17px,1.65vw,21px); font-weight: 510; line-height: 1.65; }
#experiment-tasks { margin: 0; padding-left: 1.4em; }
#experiment-tasks > li { padding-left: .35em; }
#experiment-tasks li + li { margin-top: 5px; }
#experiment-tasks li::marker, .derivation li::marker { color: var(--blue); font-weight: 690; }
.theory-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0; list-style: none; }
.theory-details > summary::after { content: "+"; display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid #9cb2b2; border-radius: 50%; color: var(--blue); font: 26px/1 var(--mono); }
.theory-details[open] > summary::after { content: "−"; }
.theory-details > summary:hover::after { background: #e2eeeb; }
#theory-deck { max-width: 64em; margin-top: 6px; color: var(--muted); font-size: 16px; }
.lesson { min-width: 0; }
.lesson h3, .result-details h3, .result-summary h3 { font-size: 19px; line-height: 1.4; color: var(--deep); font-weight: 690; }
.lesson p, .result-details p, .result-summary p { margin-top: 6px; }
.theory-details .theory { margin-top: 17px; }
.theory h3:not(:first-child) { margin-top: 24px; }
.theory p { max-width: 61em; }
.theory .formula { overflow-x: auto; color: var(--deep); padding: 2px 4px; overscroll-behavior-inline: contain; }
.theory .formula .katex-display { min-width: 100%; width: max-content; margin: .47em auto; text-align: center; }
.theory .formula .katex-display > .katex { text-align: center; }
.derivation { margin: 10px 0 0; padding-left: 1.5em; }
.theory .derivation > li + li { margin-top: 15px; }
.derivation h4 { font-size: 17px; color: var(--deep); }

.panel { min-width: 0; }
.workspace { display: grid; gap: 18px; }
.settings { border: 1px solid #c7d3ce; border-radius: 8px; background: #eef3ef; padding: 14px 19px 12px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.panel-head h3, .chart-header h3 { font-size: 19px; line-height: 1.45; color: var(--deep); }
.text-button { border: 0; background: transparent; color: var(--blue-dark); padding: 4px 0; font-size: 15px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
#settings-title { margin: 0; }
.settings-core { display: grid; gap: 14px; margin-top: 13px; }
.settings-selectors, .field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(188px, 100%), 1fr));
  gap: 9px 11px;
  align-items: stretch;
}
.settings-selectors:not(:has(> :not([hidden]))), #experiment-fields:empty { display: none; }
.settings-selectors > div, #gain-lock-settings, .field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid #d3dfe7;
  border-radius: 7px;
  background: var(--paper);
}
.settings-selectors select { width: 100%; min-height: 42px; padding: 5px 8px; }
#benchmark-description { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; }
#gain-lock-settings { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; }
#gain-lock { accent-color: var(--blue); }
.acceptance-note { margin: 6px 0 10px; color: var(--blue-dark); font-weight: 650; }
.preset-label, .field-label { color: var(--ink); font-size: 15px; font-weight: 610; }
.field-symbol { display: inline-block; white-space: nowrap; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset legend { color: var(--blue-dark); padding: 0; font-size: 15px; font-weight: 690; }
#experiment-fields { display: grid; gap: 8px; }
.field-cluster { min-width: 0; border: 1px solid #cbd9e6; border-radius: 7px; background: var(--paper); }
.field-cluster[open] { background: #e7eff7; }
.field-cluster > summary {
  display: grid;
  grid-template-columns: 14px max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 4px 9px;
  min-height: 45px;
  padding: 9px 12px;
  border-radius: inherit;
  line-height: 1.5;
  list-style: none;
}
.field-cluster > summary::-webkit-details-marker { display: none; }
.field-cluster > summary::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border: solid var(--blue-dark);
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
.field-cluster[open] > summary::before { transform: translateY(2px) rotate(225deg); }
.field-cluster > summary:hover { background: #e3edf6; }
.cluster-title { color: var(--blue-dark); font-size: 16px; font-weight: 670; }
.cluster-values { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--muted); font-size: 13px; }
.cluster-value strong { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 620; }
.field-cluster[open] .cluster-values { display: none; }
.field-cluster .field-grid { padding: 0 9px 9px; }
.field-grid > .field:only-child { flex-direction: row; align-items: center; justify-content: space-between; }
.field-grid > .field:only-child .input-wrap { width: min(50%, 205px); margin-top: 0; }
.field-label { line-height: 1.35; }
.input-wrap { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.input-wrap small { flex: 0 0 auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
input[type="number"], select { min-width: 0; border: 1px solid #9aadaa; border-radius: 5px; background: var(--paper); }
.input-wrap input { flex: 1 1 0; width: 100%; min-height: 42px; padding: 7px 8px; font: 16px/1.45 var(--mono); }
.condition-note { margin-top: 10px; font-size: 14px; color: var(--muted); }
.stage { border: 1px solid #c7d3ce; border-radius: 8px; overflow: hidden; background: var(--paper); }
.stage .panel-head { padding: 11px 16px; }
.stage-heading, .stage-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 10px; }
.status { color: var(--blue-dark); border-radius: 4px; background: #e8f1ee; padding: 1px 7px; font-size: 14px; }
.status[data-state="warning"] { color: #7a3723; background: #f6e7dc; }
.status[data-state="complete"] { color: #165d4b; background: #dff0e8; }
.primary, .secondary { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; border-radius: 5px; border: 1px solid transparent; font-size: 15px; font-weight: 650; line-height: 1.35; padding: 7px 13px; white-space: nowrap; }
.primary { background: var(--blue); color: #fff; }
.primary:hover { background: var(--blue-dark); }
.secondary { color: var(--blue-dark); background: var(--paper); border-color: #aebfbc; }
.secondary:hover:not(:disabled) { background: #eaf2ef; }
.settings-note, .run-note { margin: 0 16px 8px; color: var(--muted); font-size: 14px; }
.run-note, .input-error { color: #8a3b23 !important; }
#apparatus { height: clamp(205px, 21vw, 276px); }
.readouts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 11px 15px; border-bottom: 1px solid var(--line); }
.readouts div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.readouts span { display: block; color: var(--muted); font-size: 14px; }
.readouts #read-force-label { display: inline; }
.readouts strong { color: var(--deep); font: 670 clamp(16px, 1.75vw, 24px)/1.5 var(--mono); }
.readouts small { margin-left: 4px; color: var(--muted); font-size: 13px; }
.playback { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 12px; padding: 10px 15px; }
.playback input { width: 100%; min-width: 0; min-height: 36px; accent-color: var(--blue); }
.playback output { white-space: nowrap; font: 14px var(--mono); color: var(--muted); }
.playback select { min-height: 42px; padding: 4px 7px; font-size: 15px; }

.evidence-switch { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid #c6d5d0; border-radius: 6px; background: #edf2ef; }
.evidence-switch button, .plot-switch button { padding: 6px 13px; min-height: 42px; border: 1px solid transparent; border-radius: 4px; background: transparent; font-size: 15px; font-weight: 630; color: var(--blue-dark); }
.evidence-switch button:hover, .plot-switch button:hover { background: #e0ebe7; }
.evidence-switch button[aria-pressed="true"] { color: #fff; background: var(--blue-dark); }
.plot-section { margin-top: 14px; }
.chart-header { flex-wrap: wrap; }
.chart-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.analysis-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.analysis-grid[data-count="1"] { grid-template-columns: minmax(0,1fr); }
.analysis-grid[data-count="1"] canvas { width: min(100%,850px); margin-inline: auto; }
.analysis-grid:is([data-count="3"], [data-count="5"]) > :last-child { grid-column: 1 / -1; }
.chart { display: flex; flex-direction: column; padding: 10px 12px 8px; border: 1px solid #cdd7d3; border-radius: 6px; background: var(--paper); }
.chart figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 8px; flex-wrap: wrap; }
.chart h4 { font-size: 17px; margin-bottom: 5px; }
.chart canvas { height: clamp(225px, 22vw, 285px); }
.analysis-grid .chart { gap: 4px; }
.analysis-grid .chart canvas { height: clamp(245px, 26vw, 320px); }
.analysis-grid .chart figcaption { align-content: start; }
.chart-notes:has(.legend[hidden]):not(:has(.plot-caption)) { display: none; }
@supports (grid-template-rows: subgrid) {
  .analysis-grid .chart {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 3;
  }
}
@media (min-width: 1120px) {
  .analysis-grid:is([data-count="3"], [data-count="5"]) { grid-template-columns: repeat(6, minmax(0,1fr)); }
  .analysis-grid:is([data-count="3"], [data-count="5"]) > .chart { grid-column: span 2; }
  .analysis-grid[data-count="5"] > .chart:nth-child(n+4) { grid-column: span 3; }
}
.view-guide, .figure-note, .plot-caption { color: var(--muted); font-size: 15px; }
.view-guide { margin-bottom: 12px; max-width: 65em; }
.figure-note, .plot-caption { margin-top: 6px; }
.plot-caption { font-size: 14px; }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 13px; color: var(--muted); font-size: 14px; }
.legend > span, .legend > label, .plot-option { display: inline-flex; align-items: center; gap: 5px; min-height: 27px; }
.legend input, .plot-option input { accent-color: var(--blue); margin: 0; }
.plot-option { color: var(--muted); font-size: 14px; white-space: nowrap; }
.line { display: inline-block; width: 15px; border-top: 2px solid #245985; flex: none; }
.baseline-line { border-color: #ba6340; border-top-style: dashed; }
.limit-line { border-color: #7e8692; border-top-style: dashed; }
.supplemental { margin-top: 4px; }
.plot-switch { display: none; }
.modal-reading, .comparison-toolbar { background: #e8f1ef; padding: 7px 11px; color: var(--blue-dark); font-size: 15px; }
.modal-reading { width: fit-content; margin: 0 0 10px; }
.comparison-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 9px; font-variant-numeric: tabular-nums; }

.results-panel { border-top: 1px solid var(--line); }
.result-summary, .result-details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.result-details ul { margin: 7px 0 0; padding-left: 20px; color: var(--muted); }
.result-details summary { font-weight: 650; color: var(--blue-dark); }
.table-scroll { overflow-x: auto; }
.frequency-metrics { margin-top: 13px; }
.frequency-metrics .release-table { font-variant-numeric: tabular-nums; }
.frequency-metrics .release-table :is(th, td) { text-align: left; vertical-align: top; }
.frequency-metrics .release-table :is(th, td):last-child { text-align: center; }
.frequency-metrics .figure-note { padding-bottom: 3px; }
.metrics-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; text-align: left; }
.metrics-table thead { background: #e8f1ef; }
.metrics-table th, .metrics-table td { border-bottom: 1px solid var(--line); padding: 8px 12px; }
.metrics-table tbody th { font-weight: 650; }
.event-time { color: var(--blue-dark); margin-right: 8px; font: 14px var(--mono); }
:is(.problem-page, .experiment-example) {
  --canvas: #f1f4f7;
  --ink: #162333;
  --deep: #0b2945;
  --muted: #35475a;
  --line: #cdd7e2;
  --blue: #245985;
  --blue-dark: #1d476c;
}
:is(.problem-page, .experiment-example) .site-header { background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line); }
:is(.problem-page, .experiment-example) .brand-mark { color: #eaf3fc; background: var(--blue-dark); }
:is(.problem-page, .experiment-example) .nav-group > summary:hover, :is(.problem-page, .experiment-example) .nav-group[open] > summary,
:is(.problem-page, .experiment-example) #navigation > .nav-item:hover, :is(.problem-page, .experiment-example) #navigation > .nav-item[aria-current] { color: var(--blue-dark); border-bottom-color: var(--blue); }
.experiment-example #navigation .nav-group.active > summary { color: inherit; }
:is(.problem-page, .experiment-example) .nav-menu a:hover { background: #eaf2fa; color: var(--blue-dark); }
:is(.problem-page, .experiment-example) .nav-toggle { color: var(--blue-dark); background: #edf3f8; border-color: var(--line); }
:is(.problem-page, .experiment-example) .intro { margin-top: clamp(22px,4vw,46px); padding-bottom: 19px; border-color: var(--line); }
:is(.problem-page, .experiment-example) .intro h1 { margin: 0; font-size: clamp(28px,3.8vw,45px); }
#problem-view p { text-indent: 2em; }
.experiment-example #experiment-objective > p,
.experiment-example .theory p,
.experiment-example :is(#open-loop-instructions, #closed-loop-instructions) > p,
.experiment-example .open-loop-results p { text-indent: 2em; max-width: none; }
#experiment-intro { margin-top: clamp(14px, 2.2vw, 30px); }
.experiment-example .task-layout { display: block; }
.experiment-example :is(#experiment-tasks, .derivation) { padding-left: 1.9em; list-style: none; counter-reset: report-item; }
.experiment-example :is(#experiment-tasks, .derivation) > li { position: relative; padding-left: 0; counter-increment: report-item; }
.experiment-example :is(#experiment-tasks, .derivation) > li::before {
  position: absolute;
  left: -1.9em;
  content: "(" counter(report-item) ")";
  color: var(--blue);
  font-weight: 690;
}
.experiment-example #sim h3, .experiment-example .open-loop-results h3 {
  margin: 0 0 6px;
  color: var(--deep);
  font-size: 19px;
  font-weight: 690;
  line-height: 1.4;
}
.report-steps { margin: 0 0 19px; padding-left: 1.55em; }
.report-steps li + li { margin-top: 6px; }
.report-steps li::marker { color: var(--blue); font-weight: 690; }
.experiment-example :is(#open-loop-instructions, #closed-loop-instructions) { margin-bottom: 11px; }
.experiment-example .settings { padding-block: 9px 10px; border-color: var(--line); background: #edf3f8; }
.experiment-example .stage, .experiment-example .chart, .experiment-example .secondary { border-color: var(--line); }
.experiment-example .status { background: #e7f0f8; }
.experiment-example .status[data-state="warning"] { background: #f6e7dc; }
.experiment-example .status[data-state="complete"] { background: #dff0e8; }
.release-controls { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.release-controls > .preset-label { flex-basis: 100%; }
.release-controls button { padding-inline: 10px; }
.experiment-example #evidence { margin-top: 18px; padding: 0; border: 0; }
.experiment-example .evidence-head { justify-content: end; margin-bottom: 0; }
.experiment-example #time-charts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.experiment-example #time-charts > .chart { display: flex; }
.experiment-example #time-charts figcaption { order: 1; justify-content: center; text-align: center; }
.experiment-example #time-charts h4 { margin: 4px 0 0; font-size: 15px; }
.experiment-example #time-domain-results-title + .evidence-head { margin-top: -5px; }
.experiment-example .signal-diagram { border-block: 0; }
.open-loop-metrics { margin-top: 16px; }
.open-loop-metrics .release-table { min-width: 0; font-variant-numeric: tabular-nums; }
.open-loop-metrics .release-table :is(th, td) { text-align: left; vertical-align: top; }
.open-loop-metrics .release-table :is(th, td):nth-child(2) { white-space: nowrap; }
.open-loop-metrics .release-table td:last-child { max-width: none; }
.open-loop-results > section + section { margin-top: 17px; }
.open-loop-results p + p { margin-top: 5px; }
.open-loop-results h4 { margin: 10px 0 3px; color: var(--deep); }
.open-loop-results .table-scroll { margin-top: 9px; }
.open-loop-results .release-table { min-width: 750px; font-variant-numeric: tabular-nums; }
.release-table caption { color: var(--deep); font-size: 15px; font-weight: 650; padding: 4px 4px 7px; caption-side: top; }
.release-table thead { background: #e6eef7; }
.release-table th, .release-table td { text-align: center; }
.release-table th:last-child, .release-table td:last-child { max-width: 23em; text-align: left; }

.problem-copy p + p { margin-top: .65em; }
.model-figure { display: grid; justify-items: center; margin: 20px 0 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 14px 16px 10px; }
.model-figure img { display: block; width: min(100%, 490px); height: auto; }
.model-figure figcaption { padding-top: 4px; font-size: 15px; color: var(--deep); text-align: center; }
.shared-model { border: 1px solid var(--line); border-radius: 10px; padding: clamp(12px,1.6vw,18px); background: var(--paper); }
.shared-model > p { color: var(--muted); }
.shared-model fieldset { border-top: 1px solid var(--line); padding-top: 7px; margin-top: 12px; }
.shared-model fieldset legend { padding-right: 10px; font-size: 16px; }
.slider-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; grid-auto-rows: 1fr; }
.parameter-slider { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: minmax(36px,1fr) auto auto; align-items: baseline; column-gap: 8px; min-width: 0; padding: 6px 10px; border: 1px solid #dce6ef; border-radius: 7px; background: #f7fafd; line-height: 1.35; }
.slider-name { color: var(--ink); font-size: 15px; font-weight: 630; }
.slider-value { color: var(--blue-dark); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.slider-value span { font: 680 15px/1.35 var(--mono); }
.parameter-slider input[type="range"] { grid-column: 1 / -1; width: 100%; min-width: 0; min-height: 23px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.slider-limits { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1px 8px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.model-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
#model-note { color: #226255; font-size: 15px; }
.control-objectives p + p { margin-top: .45em; }
.control-objectives { display: grid; grid-template-columns: minmax(0,1fr); list-style: none; margin: 0; padding: 0; }
.control-objectives li { padding: 15px 0; }
.control-objectives li + li { border-top: 1px solid var(--line); }
.control-objectives h3 { font-size: 19px; color: var(--deep); margin-bottom: 5px; }
.site-footer { display: flex; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; padding-block: 26px; color: var(--muted); font-size: 14px; }

.signal-diagram { margin: 8px 0 15px; padding-top: 7px; border-block: 1px solid #e0e7ee; }
.diagram-scroll { overflow-x: auto; background: var(--paper); border-radius: 6px; }
.tikz-diagram { display: block; width: 100%; min-width: min(100%, 620px); max-width: 930px; height: auto; margin-inline: auto; }
.stability-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(205px, 100%), 1fr)); gap: 10px; }
.stability-card { display: grid; gap: 5px; align-content: start; min-width: 0; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.stability-card > span { color: var(--muted); font-size: 14px; }
.stability-card strong { color: var(--deep); overflow-wrap: anywhere; }
#stability-content .view-guide { margin-top: 12px; }
.signal-diagram figcaption { margin: 3px 0 9px; color: var(--ink); font-size: 15px; font-weight: 600; text-align: center; }


@media (max-width: 1000px) {
  .shell { width: calc(100% - 48px); }
  .header-inner { min-height: 60px; }
  #navigation { display: none; position: absolute; top: 100%; right: 0; width: min(100%, 400px); max-height: calc(100dvh - 62px); overflow: auto; padding: 6px; border: 1px solid #b4c6c3; background: var(--paper); color: var(--ink); box-shadow: 0 9px 24px #122b3724; }
  #site-header[data-menu-open="true"] #navigation { display: block; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; min-height: 44px; border: 1px solid #6d8e93; border-radius: 5px; background: transparent; font-size: 15px; }
  .nav-toggle span { width: 15px; height: 1.5px; background: currentColor; box-shadow: 0 4px currentColor, 0 -4px currentColor; }
  #navigation > .nav-item, .nav-group > summary { justify-content: space-between; min-height: 44px; border: 0; }
  #navigation > .nav-item:hover, #navigation > .nav-item[aria-current], .nav-group.active > summary, .nav-group[open] > summary, .nav-group > summary:hover { background: #e1eeea; color: var(--blue-dark); }
  .nav-menu { position: static; width: auto; box-shadow: none; border: 0; padding-left: 7px; }
  .task-layout { gap: 22px; }
  :is(.problem-page, .experiment-example) .nav-group > summary:hover, :is(.problem-page, .experiment-example) .nav-group[open] > summary,
  :is(.problem-page, .experiment-example) #navigation > .nav-item:hover, :is(.problem-page, .experiment-example) #navigation > .nav-item[aria-current] { background: #eaf2fa; }
}

@media (max-width: 860px) {
  .slider-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (min-width: 721px) and (max-width: 980px) {
  .experiment-example #time-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .experiment-example #time-charts > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  html { scroll-padding-top: 67px; }
  body { font-size: 16px; }
  .shell { width: calc(100% - 28px); }
  .brand { font-size: 16px; }
  .nav-toggle { color: #fff; }
  .intro { margin-top: 22px; padding-bottom: 21px; }
  .section { margin-top: 22px; }
  .task-layout { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .parameter-slider { padding-inline: 9px; }
  .parameter-slider input[type="range"] { min-height: 44px; }
  #experiment-tasks { margin-top: 0; }
  .theory .katex-display { font-size: .92em; }
  .experiment-example #time-charts { grid-template-columns: minmax(0,1fr); }
  .experiment-example #closed-loop-metrics th:nth-child(2), .experiment-example #closed-loop-metrics td:nth-child(2) { white-space: normal; }
  .experiment-example .release-table { display: table; }
  .experiment-example .release-table thead {
    position: static;
    clip-path: none;
    width: auto;
    height: auto;
    overflow: visible;
  }
  .experiment-example .release-table tbody { display: table-row-group; }
  .experiment-example .release-table tr { display: table-row; }
  .experiment-example .release-table th, .experiment-example .release-table td {
    display: table-cell;
    padding: 6px 9px;
    border-bottom: 1px solid var(--line);
  }
  .experiment-example .release-table td:last-child { font-size: inherit; color: inherit; }

  .settings { padding-inline: 12px; }
  .settings-selectors, .field-grid { gap: 7px; }
  .settings-selectors { grid-template-columns: repeat(auto-fit, minmax(min(142px, 100%), 1fr)); }
  .field-grid { grid-template-columns: repeat(auto-fit, minmax(min(144px, 100%), 1fr)); }
  .field-cluster > summary { grid-template-columns: 12px minmax(0, 1fr); }
  .cluster-values { grid-column: 2; }
  .input-wrap small { font-size: 11px; }
  .tikz-diagram { min-width: 560px; }
  .stability-grid { grid-template-columns: minmax(0,1fr); }
  .text-button { min-height: 44px; font-size: 14px; }
  .input-wrap input, #scenario-settings select, #centering-settings select, .primary, .secondary, .playback select { min-height: 44px; }
  .condition-note { font-size: 14px; }
  .stage .panel-head { padding-inline: 11px; }
  .stage-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; }
  #apparatus { height: clamp(175px,49vw,218px); }
  .readouts { padding-inline: 9px; }
  .readouts div + div { padding-left: 7px; }
  .readouts span { font-size: 13px; }
  .readouts small { font-size: 12px; margin-left: 2px; }
  .playback { grid-template-columns: auto minmax(0,1fr) auto; gap: 5px 8px; padding-inline: 9px; }
  .playback input { grid-column: 1 / -1; grid-row: 1; margin: 0; }
  .playback output { justify-self: center; font-size: 12px; }
  .evidence-switch { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 4px; gap: 4px; }
  .evidence-switch button, .plot-switch button { min-height: 44px; padding-inline: 5px; }
  .plot-switch { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; margin-bottom: 9px; background: #e5eeea; border-radius: 5px; }
  .plot-switch button { flex: 1 1 auto; white-space: normal; }
  .plot-switch button[aria-pressed="true"] { background: #fff; border-color: #aebfbc; }
  .chart-grid, .analysis-grid, .analysis-grid[data-count="1"] { grid-template-columns: minmax(0,1fr); }
  .chart-grid:has(.is-selected) [data-plot-panel]:not(.is-selected) { display: none; }
  .chart { padding-inline: 8px; }
  .chart canvas, .analysis-grid .chart canvas { height: clamp(225px,66vw,284px); }
  .analysis-grid .chart { display: flex; grid-row: auto; }
  .legend > label, .plot-option { min-height: 44px; }
  .metrics-table { display: block; min-width: 0; }
  .metrics-table thead { position: absolute; clip-path: inset(100%); width: 1px; height: 1px; overflow: hidden; }
  .metrics-table tbody { display: block; }
  .metrics-table tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px 8px; padding: 8px 1px; border-bottom: 1px solid var(--line); }
  .metrics-table th, .metrics-table td { border: 0; padding: 0; }
  .metrics-table th, .metrics-table td:last-child { grid-column: 1 / -1; }
  .metrics-table td[data-label]::before { content: attr(data-label); display: block; font-size: 13px; color: var(--muted); }
  .metrics-table td:last-child { font-size: 14px; color: var(--muted); }
}

@media (max-width: 520px) {
  .experiment-heading { flex-direction: column; align-items: flex-start; }
  .experiment-heading > h1 { flex: none; }
  .slider-grid { grid-template-columns: minmax(0,1fr); }
}

@media (max-width: 350px) {
  .shell { width: calc(100% - 20px); }
  h1 { font-size: 27px; }
  .settings, .shared-model { padding-inline: 9px; }
  .settings-selectors, .field-grid { grid-template-columns: minmax(0, 1fr); }
  .readouts span { font-size: 12px; }
}

.evidence-preview { margin-top: 12px; padding: 11px 13px; border-left: 3px solid #91aea8; background: #eef2ee; color: var(--muted); font-size: 15px; }

/* Ball-and-plate case */
:root {
  --canvas: #f1f4f7;
  --paper: #fff;
  --ink: #162333;
  --deep: #0b2945;
  --muted: #35475a;
  --line: #cdd7e2;
  --blue: #245985;
  --blue-dark: #1d476c;
}
.site-header .brand-mark, .desktop-bar .brand-mark { background: url("figures/mark.svg") center/contain no-repeat; }
:is(.site-header,.desktop-bar) .brand-mark::before { content: none; }
.nav-menu a[aria-current=page], .nav-group.active > summary { background: #dbe8f4; color: var(--blue-dark); }
.nav-menu strong { font-weight: 560; }
.problem-copy .math { display: inline-block; max-width: 100%; }
#problem-view p { text-indent: 2em; }
#problem-view .model-actions p { text-indent: 0; }
#experiment-tasks > li::before, .experiment-example #experiment-tasks > li::before { content: "（" counter(report-item) "）"; left: -2.3em; }
.experiment-example #experiment-tasks { padding-left: 2.3em; }
.report-steps { list-style: none; counter-reset: operation; padding-inline-start: 2.3em; }
.report-steps > li { counter-increment: operation; position: relative; }
.report-steps > li::before { content: "（" counter(operation) "）"; color: var(--blue); position: absolute; left: -2.3em; font-weight: 650; }
#experiment-principle .formula { max-width: 100%; }
fieldset { border: 0; margin-inline: 0; padding-inline: 0; min-width: 0; }
.settings-selectors > div { background: var(--paper); }
.input-wrap input, .settings-selectors select, .playback select {
  border: 1px solid var(--line); background: var(--paper); border-radius: 5px; color: var(--ink);
}
.field-range { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.field:only-child .field-range { white-space: nowrap; }
.field-cluster .field-grid { align-items: stretch; }
#apparatus { background: #e9f2fa; }
.readouts strong { font-size: clamp(14px,1.4vw,20px); white-space: nowrap; }
.comparison-toolbar { background: #edf3f8; border: 1px solid var(--line); border-radius: 5px; }
.evidence-switch { background: #edf3f8; border-color: var(--line); }
.evidence-switch button:hover, .plot-switch button:hover { background: #e2edf7; }
.settings .field-cluster .field { border-color: var(--line); }
.chart figcaption { flex-direction: column; align-items: center; row-gap: 2px; }
.chart figcaption .legend { justify-content: center; gap: 0 12px; font-size: 13px; }
.chart figcaption .legend > span { min-height: 21px; }
.chart figcaption h4 { text-align: center; font-size: 15px; }
.chart-grid[data-count="4"] { grid-template-columns: repeat(2,minmax(0,1fr)); }
#current-evaluation .metrics-table { min-width: 0; }
.release-table caption { text-align: center; }
#records .metrics-table { min-width: 820px; max-width: none; white-space: normal; }
#discussion-tail, #discussion > p { margin-top: 7px; }
#discussion-tail > h3:not(:first-child) { margin-top: 13px; }
#plot-view .view-guide { margin-top: 8px; }
@media (min-width: 1001px) {
  .nav-group:last-child > .nav-menu { right: 0; }
}
@media (max-width:720px) {
  .chart-grid[data-count="4"] { grid-template-columns: minmax(0,1fr); }
  .readouts strong { font-size: clamp(11px,3.45vw,15px); }
  .readouts small { font-size: 10px; }
  #current-evaluation .release-table { width: 100%; }
  .chart figcaption .legend > span { min-height: 19px; }
}
.readouts > div { min-width: 0; }
.readouts span small { white-space: nowrap; margin-left: 0; }
@media (max-width: 350px) {
  .readouts strong { white-space: normal; }
}

/* Three electrical/mechanical readings per row, in both shells. */
.readouts { grid-template-columns: repeat(3,minmax(0,1fr)); row-gap: 4px; }
.readouts > div:nth-child(3n+1) { padding-left: 0; border-left: 0; }
.readouts > div:nth-child(n+4) { padding-top: 4px; border-top: 1px solid var(--line); }
.readouts strong { white-space: normal; }
.experiment-example .model-figure img { width: min(100%, 620px); }
.experiment-example .settings-selectors > div { min-width: 0; }
#apparatus { touch-action: none; cursor: grab; }
#apparatus:active { cursor: grabbing; }
