:root {
  color-scheme: light;
  --paper: #e9eeea;
  --sheet: #f6f9f6;
  --white: #fbfdfa;
  --ink: #172620;
  --muted: #4d6359;
  --line: #aabdaf;
  --fine: #c9d7cc;
  --dark: #142621;
  --deep: #0e201b;
  --mint: #90edc4;
  --purple: #473c66;
  --orange: #ffc486;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.5 var(--sans); }
a { color: #264a3a; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .15em; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .56; cursor: default; }
:focus-visible { outline: 3px solid #8b410f; outline-offset: 3px; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
h1, h2, h3 { line-height: 1.13; }
button {
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid #9bb09f;
  border-radius: 5px;
  background: var(--white);
  font-size: .93rem;
  font-weight: 700;
}
button:hover:enabled { background: #e0eae1; border-color: #5f7a69; }
button.accent { background: var(--orange); border-color: #86532c; color: #292018; }
button.accent:hover:enabled { background: #ffd4aa; border-color: #643b1e; }
.shell { width: min(1240px, calc(100% - 72px)); margin-inline: auto; }
.skip { position: absolute; top: 10px; left: 10px; transform: translateY(-150%); padding: 10px; background: var(--white); }
.skip:focus { transform: none; z-index: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.header { border-bottom: 1px solid var(--line); }
.nav { min-height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.nav nav { display: flex; gap: clamp(12px, 3vw, 32px); align-items: center; }
.brand { display: inline-flex; gap: 9px; align-items: center; color: var(--ink); text-decoration: none; font: 850 1.16rem/1 var(--mono); letter-spacing: -.055em; }
.nav nav a { font-size: .92rem; font-weight: 660; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-block: clamp(28px, 4.1vw, 52px) 22px; }
.intro h1, .guide h1 { font-size: clamp(2.48rem, 5.4vw, 5.03rem); letter-spacing: -.082em; line-height: .99; }
.intro p { margin-top: 13px; max-width: 67ch; font-size: clamp(1rem, 1.45vw, 1.14rem); color: var(--muted); }
.scope { font: 690 .88rem/1.3 var(--mono); white-space: nowrap; color: var(--muted); padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.examples button { min-height: 41px; border-color: var(--line); background: #eef4ee; }
.examples button[aria-pressed="true"] { color: #0e3926; background: #bbddcc; border-color: #58836d; }
.bench { display: grid; grid-template-columns: minmax(258px, .86fr) minmax(0, 2.12fr); gap: 12px; align-items: start; }
.settings { background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; padding: clamp(15px, 2.1vw, 25px); }
.settings h2 { font-size: 1.3rem; margin-bottom: 10px; letter-spacing: -.04em; }
.field { display: block; min-width: 0; font-size: .89rem; font-weight: 680; }
.field small { color: var(--muted); font-size: .78rem; font-weight: 510; margin-left: 4px; }
.settings > .field + .field, .tolerances > .field + .field { margin-top: 9px; }
.valuebox { display: flex; align-items: center; min-height: 39px; margin-top: 3px; border: 1px solid #98af9f; border-radius: 4px; background: var(--white); }
.valuebox input { width: 100%; min-width: 0; min-height: 38px; padding: 7px 9px; background: transparent; border: 0; color: var(--ink); font: 570 .97rem/1.15 var(--mono); }
.valuebox > span { padding-inline: 7px 9px; color: var(--muted); font: .82rem/1 var(--mono); white-space: nowrap; }
.field > select { width: 100%; min-width: 0; min-height: 40px; margin-top: 3px; border: 1px solid #98af9f; border-radius: 4px; padding: 7px 6px; color: var(--ink); background: var(--white); }
.input-help, .pair-tip { font-size: .81rem; color: var(--muted); margin-block: 8px 12px; }
.tolerances { padding-block: 5px; border-top: 1px solid var(--fine); margin-bottom: 9px; }
summary { cursor: pointer; padding-block: 5px; font-size: .91rem; font-weight: 700; }
.tolerances .field { margin-top: 6px; }
.settings button[type="submit"] { width: 100%; }
.form-error { background: #ffe4cf; color: #652a13; padding: 9px; font-size: .88rem; border-radius: 4px; margin-block: 8px; }
.instrument { background: var(--dark); color: #edf4ef; border: 1px solid #183e2d; border-radius: 9px; box-shadow: 0 6px 15px rgb(20 50 34 / 12%); min-width: 0; }
.measure { display: grid; grid-template-columns: 1fr minmax(0, .68fr); align-items: end; gap: 16px; padding: clamp(16px, 2.4vw, 30px); }
.measure h2 { color: #c2dad0; font-weight: 680; font-size: .98rem; }
.readout { color: var(--mint); margin-block: 6px 5px; font: 620 clamp(2.46rem, 5.4vw, 5.4rem)/.98 var(--mono); letter-spacing: -.1em; overflow-wrap: anywhere; }
.drop { color: #fad3a7; font: .85rem/1.38 var(--mono); }
.comparison { display: grid; gap: 12px; min-width: 0; }
.comparison div { border-left: 1px solid #4d7062; padding-left: 11px; }
.comparison dt, .telemetry dt { font-size: .79rem; color: #bfdbcf; }
.comparison dd { margin-top: 3px; color: #eafaef; font: 650 clamp(.93rem, 1.45vw, 1.18rem)/1.25 var(--mono); overflow-wrap: anywhere; }
.diagram { background: var(--deep); border-block: 1px solid #335749; padding-inline: 7px; }
canvas { display: block; width: 100%; min-width: 0; }
#schematic { height: 204px; }
.diagram figcaption { padding: 0 11px 9px; text-align: center; font-size: .77rem; color: #c8dfd4; }
.telemetry { padding: 15px clamp(14px, 2.4vw, 28px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.telemetry div + div { border-left: 1px solid #456456; padding-left: 11px; }
.telemetry dd { margin-top: 3px; color: var(--mint); font: 580 clamp(.91rem, 1.5vw, 1.22rem)/1.25 var(--mono); overflow-wrap: anywhere; }
.notice { margin-block: 10px; background: var(--sheet); border: 1px solid var(--fine); padding: 12px; }
.experiment, .parts { margin-top: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); padding: clamp(14px, 2.4vw, 26px); }
.plot-heading, .parts-lead { display: flex; justify-content: space-between; align-items: end; gap: 12px 24px; margin-bottom: 13px; }
.plot-heading h2, .parts h2, .notes h2, .guide h2 { font-size: clamp(1.58rem, 3.2vw, 2.25rem); letter-spacing: -.055em; }
.plot-heading p, .parts-lead p { color: var(--muted); margin-top: 5px; }
.plot-heading .point { color: #254f3a; font: 660 .94rem/1.35 var(--mono); white-space: nowrap; }
.plot { border: 1px solid #426555; border-radius: 6px; background: var(--dark); overflow: hidden; }
#load-plot { height: 215px; }
.plot figcaption { color: #c8dfd4; font-size: .79rem; padding: 0 12px 10px; }
.sweep-controls { display: flex; gap: 14px; align-items: end; margin-top: 13px; }
.sweep-controls label { flex: 1; min-width: 0; font-size: .86rem; font-weight: 680; }
input[type="range"] { display: block; margin: 6px 0 0; width: 100%; min-height: 28px; cursor: ew-resize; accent-color: #916341; }
.electrical { margin-top: 16px; border-top: 1px solid var(--fine); padding-top: 5px; }
.electrical dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 138px), 1fr)); gap: 13px; padding: 5px 0 10px; }
.electrical dt { font-size: .81rem; color: var(--muted); }
.electrical dd { font: 650 .97rem/1.3 var(--mono); }
.electrical p { color: var(--muted); font-size: .88rem; }
.parts .conditions { color: #2b5a42; font: 620 .83rem/1.4 var(--mono); max-width: 43ch; }
.parts-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.finder-status { margin-block: 11px; color: var(--muted); font-size: .9rem; }
.pairs-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--fine); }
.pairs-list:empty { border: 0; }
.pairs-list li { display: grid; grid-template-columns: 1fr 1.2fr .7fr auto; align-items: center; gap: 10px 15px; padding: 10px 0; border-bottom: 1px solid var(--fine); }
.pairs-list li > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pairs-list strong { font: 700 .98rem/1.3 var(--mono); overflow-wrap: anywhere; }
.pairs-list span { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.part-names span { font-family: var(--mono); }
.pair-draw { color: #29543f; }
.notes { max-width: 69ch; margin-block: 31px 38px; }
.notes p { color: var(--muted); margin-top: 8px; }
.footer { display: flex; gap: 15px; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding: 15px 0 24px; }
.footer strong { font-family: var(--mono); }
.footer a { font-size: .89rem; }
.guide { margin-top: clamp(24px, 5vw, 66px); }
.guide > header { max-width: 820px; }
.guide h1 { max-width: 15ch; }
.guide p { color: var(--muted); margin-block: 12px; font-size: 1.05rem; }
.guide > header > p { max-width: 58ch; }
.guide-action { display: inline-block; padding: 9px 12px; border-radius: 5px; background: var(--orange); color: #3b2919; border: 1px solid #86532c; font-weight: 700; }
.guide-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(16px, 4vw, 52px); margin-block: 25px 38px; }
.guide article section { border-top: 1px solid var(--line); margin-bottom: 22px; padding-top: 17px; }
.formula { padding: 12px; background: var(--dark); color: var(--mint); border-radius: 5px; font: 620 .91rem/1.5 var(--mono); overflow-wrap: anywhere; }
.reference { align-self: start; padding: 19px; border-radius: 7px; border: 1px solid var(--line); background: var(--white); }
.reference h2 { font-size: 1.4rem; }
.reference dl { margin: 13px 0 20px; }
.reference dl div { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; padding-bottom: 5px; border-bottom: 1px solid var(--fine); }
.reference dt { font-size: .9rem; color: var(--muted); }
.reference dd { font: 710 .97rem/1.25 var(--mono); white-space: nowrap; }
.reference h3 { font-size: 1rem; }
.reference ul { padding-left: 18px; margin: 8px 0 0; }
.reference li { margin-top: 6px; }
@media (max-width: 830px) {
  .shell { width: calc(100% - 36px); }
  .parts-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parts-fields button { justify-self: start; }
  .bench { grid-template-columns: minmax(213px, .86fr) minmax(0, 1.65fr); }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 24px); }
  .nav { min-height: 54px; gap: 8px; }
  .brand { font-size: .99rem; gap: 5px; }
  .brand img { width: 23px; height: 23px; }
  .nav nav { gap: 10px; }
  .nav nav a { font-size: .76rem; }
  .intro { align-items: start; flex-direction: column; gap: 11px; margin-bottom: 13px; }
  .intro h1 { font-size: clamp(2.2rem, 9vw, 3.44rem); }
  .intro p { margin-top: 8px; }
  .scope { padding: 4px 7px; font-size: .79rem; }
  .examples { gap: 5px; }
  .examples button { min-height: 39px; font-size: .81rem; padding: 5px 7px; }
  .bench { display: flex; flex-direction: column-reverse; }
  .bench > * { width: 100%; }
  .measure { padding: 13px; grid-template-columns: minmax(0, 1fr) minmax(0, .82fr); gap: 8px; }
  .measure h2 { font-size: .87rem; }
  .readout { font-size: clamp(1.83rem, 7.2vw, 2.65rem); letter-spacing: -.082em; }
  .drop { font-size: .74rem; }
  .comparison { gap: 8px; }
  .comparison dt, .telemetry dt { font-size: .72rem; }
  .comparison dd { font-size: .87rem; }
  #schematic { height: 179px; }
  .diagram figcaption { text-align: left; }
  .plot-heading, .parts-lead { align-items: start; flex-direction: column; gap: 7px; }
  .pairs-list li { grid-template-columns: 1fr 1fr; }
  .pairs-list li > button { justify-self: end; }
  .experiment, .parts { margin-top: 16px; }
  #load-plot { height: 176px; }
  .sweep-controls { align-items: start; flex-wrap: wrap; gap: 8px; }
  .sweep-controls label { min-width: 100%; }
  .guide-layout { grid-template-columns: 1fr; }
}
