:root {
  color-scheme: light;
  --paper: #f8f9fa;
  --surface: #ffffff;
  --panel: #eef1f6;
  --ink: #111827;
  --muted: #516174;
  --line: #cbd5e1;
  --light-line: #dde5ee;
  --strong-line: #96a8b9;
  --teal: #0f766e;
  --teal-soft: #dcefeb;
  --teal-ink: #0b5a53;
  --amber: #b45309;
  --amber-soft: #fff0db;
  --rose: #be123c;
  --rose-soft: #ffe7ee;
  --grid: #dde5eb;
  --trace: #b45309;
  --ground: #485c72;
  --scope: #102f30;
  --scope-line: #2c4d4c;
  --scope-ink: #f2f9f5;
  --scope-muted: #a1c2b8;
  --scope-sweep: #a6e4ce;
  --scope-copper: #f0b879;
  --mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #11181f;
  --surface: #17222b;
  --panel: #1e2a35;
  --ink: #eff5f7;
  --muted: #aabac8;
  --line: #3f5261;
  --light-line: #2d3c49;
  --strong-line: #647c8e;
  --teal: #76d8c4;
  --teal-soft: #203d39;
  --teal-ink: #a4e8db;
  --amber: #f2b076;
  --amber-soft: #402e22;
  --rose: #fb8ba8;
  --rose-soft: #442632;
  --grid: #334653;
  --trace: #f2aa66;
  --ground: #839eb4;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 18px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.52 var(--sans);
}
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3, h4 { line-height: 1.12; }
a { color: var(--teal-ink); text-decoration-thickness: 1px; text-underline-offset: 0.17em; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button[disabled] { opacity: 0.48; cursor: default; }
[hidden] { display: none !important; }
.shell { width: min(1280px, calc(100% - 72px)); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  inset: 13px auto auto 18px;
  z-index: 4;
  background: var(--surface);
  border: 1px solid var(--teal);
  padding: 8px 14px;
}

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 65px; display: flex; align-items: center; gap: 24px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 780;
  line-height: 1.08;
  letter-spacing: -0.025em;
  flex: 0 0 auto;
}
.brand-accent { color: var(--teal); }
.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font: 9px/1 var(--mono);
  letter-spacing: 0.12em;
}
.logo-mark rect { fill: #103a35; }
.logo-mark path {
  fill: none;
  stroke: #ebba82;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.header-nav { margin-left: auto; display: flex; gap: 29px; align-items: center; }
.header-nav a, .site-footer a { text-decoration: none; color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.header-nav a:hover, .site-footer a:hover { color: var(--teal); }
.header-controls { display: flex; align-items: center; gap: 9px; }
.theme-toggle, .mobile-menu summary {
  min-height: 40px;
  min-width: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
}
.theme-toggle:hover, .mobile-menu summary:hover { border-color: var(--teal); }
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; }
.mobile-menu { display: none; position: relative; }
.mobile-menu summary { font-size: 0.82rem; padding-inline: 10px; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu nav {
  position: absolute;
  right: 0;
  top: 47px;
  z-index: 3;
  background: var(--surface);
  border: 1px solid var(--strong-line);
  padding: 3px 7px;
  border-radius: 5px;
  min-width: 142px;
  box-shadow: 0 8px 18px #11182718;
}
.mobile-menu nav a { display: flex; align-items: center; min-height: 42px; padding: 5px 8px; text-decoration: none; }

.hero {
  padding: 46px 0 44px;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 76px);
  align-items: center;
}
.eyebrow { font: 600 0.73rem/1.2 var(--mono); color: var(--teal); letter-spacing: 0.12em; }
.hero h1 {
  margin-top: 17px;
  font-size: clamp(2.7rem, 4.5vw, 5rem);
  line-height: 0.99;
  font-weight: 750;
  letter-spacing: -0.052em;
}
.hero-desc { max-width: 35rem; margin-top: 22px; color: var(--muted); font-size: clamp(1rem, 1.35vw, 1.2rem); }
.hero-actions { display: flex; align-items: center; gap: 23px; flex-wrap: wrap; margin-top: 25px; }
.hero-button, .secondary-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 650;
}
.hero-button { border-radius: 4px; padding: 9px 14px; background: #0d665f; color: #ffffff; border: 1px solid #0d665f; }
.hero-button:hover { background: #0b504a; }
.secondary-link:hover { text-decoration: underline; }
.scope {
  color: var(--scope-ink);
  background: var(--scope);
  border: 1px solid #275250;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 35px -23px #0a2c2d9e;
}
.scope figcaption, .scope-readouts {
  display: flex;
  justify-content: space-between;
  gap: 13px;
  padding: 12px 18px;
  color: var(--scope-muted);
  font: 10px/1.25 var(--mono);
  letter-spacing: 0.075em;
}
.scope figcaption { border-bottom: 1px solid var(--scope-line); }
.scope figcaption i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #8ce5be; }
.scope-art { padding: 4px 8px 0; }
.scope-art svg { width: 100%; max-height: 254px; display: block; }
.scope-art svg path:not(.scope-layer, .scope-copper) { fill: none; }
.scope-grid { stroke: var(--scope-line); stroke-width: 1; }
.scope-ref { stroke: #73ac9e; stroke-width: 1; stroke-dasharray: 5 5; }
.scope-soft { stroke: #53867a; stroke-width: 1.1; stroke-dasharray: 4 5; }
.scope-sweep { stroke: var(--scope-sweep); stroke-width: 1.7; stroke-linecap: round; }
.scope-marker { fill: var(--scope-copper); stroke: var(--scope); stroke-width: 2; }
.scope-layer { fill: #244d41; stroke: #568076; }
.scope-copper { fill: var(--scope-copper); }
.scope-art text { fill: var(--scope-muted); font: 13px var(--mono); }
.scope-readouts { border-top: 1px solid var(--scope-line); padding-block: 13px 15px; gap: 0; }
.scope-readouts > div { min-width: 0; flex: 1; }
.scope-readouts > div + div { border-left: 1px solid var(--scope-line); padding-left: 15px; }
.scope-readouts strong { display: block; margin-top: 6px; color: var(--scope-ink); font-size: 1.32rem; letter-spacing: -0.06em; }
.scope-readouts strong, .meter strong { font-variant-numeric: tabular-nums; }
.scope-readouts small { color: var(--scope-muted); font-size: 0.66rem; letter-spacing: 0; }

.home-tools, .home-library { border-top: 1px solid var(--strong-line); padding: 24px 0 34px; }
.section-title { display: flex; justify-content: space-between; gap: 12px 22px; align-items: baseline; margin-bottom: 18px; }
.section-title h2, .field-guide h2 { font-size: clamp(1.35rem, 2vw, 2.1rem); letter-spacing: -0.045em; }
.section-title a, .section-title p { font-size: 0.88rem; }
.section-title p { color: var(--muted); }
.tool-family { margin-top: 20px; }
.tool-family h3 { color: var(--muted); font: 600 0.76rem var(--mono); margin-bottom: 9px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr)); gap: 12px; }
.tool-card {
  display: block;
  padding: 16px 18px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  text-decoration: none;
}
.tool-card:hover { border-color: var(--teal); background: var(--teal-soft); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--teal); }
.tool-symbol { font: 600 14px var(--mono); color: var(--amber); }
.tool-card h4 { margin-top: 11px; font-size: 1.08rem; font-weight: 690; letter-spacing: -0.02em; }
.tool-card p { margin-top: 5px; color: var(--muted); font-size: 0.87rem; }
.library-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: 9px; }
.library-grid details { border: 1px solid var(--line); border-radius: 5px; background: var(--surface); min-width: 0; }
.library-grid summary { min-height: 47px; padding: 8px 11px; display: flex; align-items: center; gap: 7px; font-size: 0.88rem; font-weight: 650; }
.library-grid summary::before { content: "+"; color: var(--teal); font: 1rem var(--mono); }
.library-grid details[open] summary::before { content: "−"; }
.library-grid summary small { margin-left: auto; font: 0.69rem var(--mono); color: var(--muted); white-space: nowrap; }
.library-grid ol { margin: 0; padding: 0 13px 8px 30px; }
.library-grid li { font-size: 0.77rem; }
.library-grid li a { display: inline-flex; align-items: center; min-height: 40px; }
.field-guide {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 23px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px 26px;
  margin-bottom: 44px;
}
.field-guide p { margin-top: 7px; color: var(--muted); font-size: 0.91rem; }

.bench-main { padding: 25px 0 41px; }
.bench-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(235px, 0.43fr);
  align-items: end;
  gap: 15px 25px;
  margin-bottom: 20px;
}
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px 8px; color: var(--muted); font: 0.74rem/1.4 var(--mono); }
.bench-head h1, .article-main h1, .not-found h1 {
  margin: 8px 0 7px;
  font-size: clamp(1.8rem, 3.25vw, 3.36rem);
  letter-spacing: -0.041em;
  overflow-wrap: anywhere;
}
.bench-head > div > p, .article-main > header p { color: var(--muted); max-width: 48rem; }
.route-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-width: 0; }
.route-picker { min-width: 0; }
.route-picker label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}
.route-picker select, .field select, .number-wrap, .share-box input {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 7px 9px;
  font-size: 0.84rem;
}
.route-picker select:hover, .field select:hover, .number-wrap:hover { border-color: var(--strong-line); }
.example-context {
  background: var(--teal-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 3px;
  padding: 10px 14px;
  margin-bottom: 15px;
  font-size: 0.88rem;
}
.example-context h2 { font-size: 0.83rem; margin-bottom: 4px; color: var(--teal-ink); }

.bench { display: grid; grid-template-columns: minmax(310px, 0.36fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.input-pane, .readout-top, .diagram-pane, .readout-table {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 0;
}
.input-pane { padding: 14px; }
.input-head, .readout-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.input-head h2, .readout-head h2 { font-size: 1.09rem; letter-spacing: -0.025em; }
.unit-switch { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); }
.unit-switch button {
  background: transparent;
  border: 0;
  border-radius: 3px;
  color: var(--muted);
  padding: 4px 9px;
  font: 650 0.75rem var(--mono);
  min-height: 40px;
  min-width: 40px;
}
.unit-switch button[aria-pressed="true"] { background: var(--surface); color: var(--teal-ink); box-shadow: 0 1px 3px #17222b24; }
fieldset { margin: 17px 0 0; padding: 0; border: 0; min-width: 0; }
fieldset legend {
  width: 100%;
  margin-bottom: 9px;
  padding: 6px 0 0;
  border-top: 1px solid var(--light-line);
  color: var(--teal);
  font: 650 0.75rem/1.3 var(--mono);
}
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.field { min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { line-height: 1.2; display: block; margin: 0 0 4px; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.field select { min-height: 42px; }
.number-wrap { padding: 0 6px 0 0; display: flex; align-items: stretch; position: relative; }
.number-wrap:focus-within { border-color: var(--teal); }
.number-wrap input {
  appearance: textfield;
  width: 100%;
  min-width: 0;
  padding: 6px 4px 6px 9px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--ink);
  font: 0.84rem var(--mono);
  font-variant-numeric: tabular-nums;
}
.number-wrap input::-webkit-inner-spin-button, .number-wrap input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.input-unit {
  align-self: center;
  pointer-events: none;
  color: var(--muted);
  font: 0.7rem var(--mono);
  white-space: nowrap;
}
.input-unit:empty { display: none; }

.readout-pane { display: grid; gap: 11px; min-width: 0; }
.readout-top { padding: 12px; }
.readout-head { padding: 0 2px 8px; }
.readout-head > span { color: var(--muted); font: 0.76rem/1.3 var(--mono); text-align: right; }
.meters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.meter {
  min-width: 0;
  min-height: 79px;
  background: var(--panel);
  border: 1px solid var(--light-line);
  border-top: 2px solid var(--strong-line);
  border-radius: 4px;
  padding: 9px 10px 7px;
}
.meter:first-child { border-top-color: var(--teal); }
.meter > span { display: block; color: var(--muted); font: 650 0.65rem/1.12 var(--mono); letter-spacing: 0.025em; }
.meter > div { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 5px; line-height: 1.06; margin-top: 10px; }
.meter strong { font: 650 clamp(0.95rem, 1.77vw, 1.76rem)/1.02 var(--mono); letter-spacing: -0.07em; overflow-wrap: anywhere; }
.meter small { font: 0.71rem var(--mono); color: var(--muted); }
.result-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 11px; margin-top: 10px; }
.status-pill {
  flex: 0 0 auto;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 4px 6px;
  color: var(--muted);
  background: var(--panel);
  font: 650 0.71rem/1.1 var(--mono);
}
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.status-pill.ok { color: var(--teal-ink); background: var(--teal-soft); }
.status-pill.warn { color: var(--amber); background: var(--amber-soft); }
.status-pill.danger { color: var(--rose); background: var(--rose-soft); }
.status-detail { color: var(--muted); font-size: 0.76rem; }
.input-error { color: var(--rose); background: var(--rose-soft); margin-top: 8px; padding: 6px; font-size: 0.83rem; }
.synth-actions:not(:empty) { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.diagram-pane { padding: 9px; }
.diagram-frame { min-width: 0; }
.engineering-drawing { display: block; width: 100%; height: auto; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; }
.toolbar-formats { display: flex; flex-wrap: wrap; gap: 4px; }
.toolbar > :last-child { margin-left: auto; }
.small-button {
  min-height: 40px;
  padding: 5px 9px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.77rem;
  font-weight: 650;
}
.small-button:not([disabled]):hover { background: var(--teal-soft); border-color: var(--teal); }
.small-button.primary { color: var(--teal-ink); border-color: var(--teal); }
.small-button.reset { margin-top: 13px; }
.share-box { margin-top: 8px; font-size: 0.77rem; }
.share-box label { color: var(--muted); display: block; padding-bottom: 3px; }
.share-box input { font-family: var(--mono); }
.action-status:not(:empty) { margin: 6px 2px 0; color: var(--teal-ink); font-size: 0.77rem; }

.result-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 390px), 1fr)); align-items: start; gap: 9px; }
.readout-table { overflow: hidden; }
.readout-table h3 { padding: 9px 10px; font-size: 0.86rem; }
.readout-table table, .report-results table { width: 100%; border-collapse: collapse; }
.readout-table th, .readout-table td { border-top: 1px solid var(--light-line); padding: 6px 9px; text-align: left; font-size: 0.79rem; overflow-wrap: anywhere; }
.readout-table thead th { background: var(--panel); color: var(--muted); font-weight: 640; }
.readout-table tbody th { color: var(--muted); font-weight: 550; }
.readout-table td { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 0.74rem; }
.method-note {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 7px 24px;
  margin-top: 19px;
  padding: 14px;
  background: var(--panel);
  border-left: 3px solid var(--strong-line);
}
.method-note h2 { margin-bottom: 4px; font-size: 1rem; }
.method-note p { font-size: 0.86rem; color: var(--muted); max-width: 53rem; }
.method-note p + p { margin-top: 6px; }
.method-note a { font-size: 0.82rem; font-weight: 650; flex: 0 0 auto; }
.tool-examples { margin-top: 27px; }
.example-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.example-grid article { min-width: 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.example-grid .current-example { border-color: var(--teal); background: var(--teal-soft); }
.example-grid article a { display: flex; justify-content: space-between; gap: 6px; align-items: center; min-height: 40px; text-decoration: none; font-size: 0.88rem; }
.example-grid article a:hover { text-decoration: underline; }
.example-grid p { color: var(--muted); font-size: 0.79rem; margin-top: 2px; }

.article-main { padding: 37px 0 48px; }
.article-main > header { max-width: 57rem; }
.article-main > header a { font-size: 0.84rem; }
.article-layout { display: grid; grid-template-columns: minmax(154px, 0.31fr) minmax(0, 1fr); align-items: start; gap: 28px; margin-top: 25px; }
.article-nav { display: grid; padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); gap: 7px; }
.article-nav strong { font: 600 0.77rem var(--mono); color: var(--muted); }
.article-nav a { font-size: 0.88rem; }
.article-layout article { max-width: 52rem; min-width: 0; }
.article-layout section { border-top: 1px solid var(--line); margin-bottom: 20px; padding-top: 11px; }
.article-layout h2 { margin-bottom: 8px; font-size: 1.42rem; letter-spacing: -0.03em; }
.article-layout article p { margin-bottom: 9px; font-size: 0.94rem; overflow-wrap: anywhere; }
.article-layout article li { font-size: 0.91rem; margin-bottom: 6px; overflow-wrap: anywhere; }
.not-found { min-height: 59vh; padding: 75px 0 50px; }
.not-found .hero-button { margin-top: 15px; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { min-height: 69px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 8px 0; gap: 5px 17px; }
.footer-inner p { font-size: 0.8rem; color: var(--muted); }
.footer-inner p strong { color: var(--ink); margin-right: 5px; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 6px 15px; }
.footer-inner nav a { display: flex; min-height: 40px; align-items: center; }
.print-sheet { display: none; }

.engineering-drawing text { fill: var(--ink); font-family: var(--mono); font-size: 12px; }
.engineering-drawing .diagram-heading { font-family: var(--sans); font-size: 13px; font-weight: 670; }
.engineering-drawing .svg-code { fill: var(--teal); font-size: 10px; font-weight: 600; }
.engineering-drawing .axis { fill: var(--muted); font-size: 10px; }
.engineering-drawing .axis-amber { fill: var(--amber); }
.engineering-drawing .axis-rose { fill: var(--rose); }
.engineering-drawing .annotation { fill: var(--muted); font-size: 12px; }
.diagram-base { fill: var(--panel); }
.drawing-panel { fill: var(--surface); stroke: var(--line); stroke-width: 0.85; }
.guide, .guide-dash, .smith-grid { fill: none; stroke: var(--grid); stroke-width: 0.9; }
.guide-dash { stroke-dasharray: 4 4; }
.dim, .marker-line { fill: none; stroke: var(--strong-line); stroke-width: 1.05; }
.marker-line { stroke: var(--ink); }
.substrate { fill: var(--panel); stroke: var(--line); stroke-width: 0.8; }
.cover, .trim { fill: var(--teal-soft); stroke: var(--teal); stroke-width: 0.7; }
.copper { fill: var(--trace); }
.plane, .rail { fill: var(--ground); }
.plane-line { stroke: var(--ground); stroke-width: 4; }
.air { fill: var(--panel); }
.via { fill: var(--teal); stroke: var(--surface); stroke-width: 0.8; }
.via-stub { fill: var(--rose); }
.field, .field-odd, .wire, .part, .trace { fill: none; stroke: var(--teal); stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.field { opacity: 0.84; }
.field-odd { stroke: var(--amber); }
.wire { stroke: var(--ground); stroke-width: 1.55; }
.part, .trace { stroke: var(--trace); stroke-width: 1.8; }
.trace { stroke-width: 4; }
.terminal { fill: var(--surface); stroke: var(--ink); stroke-width: 1.4; }
.sweep-main, .sweep-other { fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sweep-other { stroke: var(--amber); }
.threshold, .notch-mark { fill: none; stroke: var(--amber); stroke-width: 1.2; stroke-dasharray: 4 4; }
.notch-mark { stroke: var(--rose); }
.pin-ok, .pin-warn, .pin-danger { fill: var(--teal); stroke: var(--surface); stroke-width: 1.5; }
.pin-warn { fill: var(--amber); }
.pin-danger { fill: var(--rose); }
.smith-rim { fill: var(--panel); stroke: var(--strong-line); stroke-width: 1.1; }
.meter-rail, .meter-good { stroke: var(--light-line); stroke-width: 5; stroke-linecap: round; }
.meter-good { stroke: var(--teal-soft); }
.band-ok { fill: var(--teal-soft); stroke: var(--teal); stroke-width: 0.6; }
.band-warn { fill: var(--amber-soft); stroke: var(--amber); stroke-width: 0.6; }
.band-danger { fill: var(--rose-soft); stroke: var(--rose); stroke-width: 0.6; }

@media (max-width: 1070px) {
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bench-head { grid-template-columns: minmax(0, 1fr) minmax(216px, 0.51fr); }
  .bench { grid-template-columns: minmax(248px, 0.44fr) minmax(0, 1fr); }
  .meters { gap: 5px; }
  .meter { padding: 7px 6px; }
}
@media (max-width: 800px) {
  .shell { width: calc(100% - 38px); }
  .hero { gap: 22px; padding-block: 30px; align-items: start; }
  .hero h1 { font-size: clamp(2.4rem, 5.3vw, 3.55rem); }
  .header-nav { gap: 16px; }
  .section-title a { font-size: 0.78rem; }
  .example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .shell { width: calc(100% - 26px); }
  .header-inner { min-height: 57px; gap: 8px; justify-content: space-between; }
  .header-nav { display: none; }
  .mobile-menu { display: block; }
  .brand { gap: 7px; font-size: 0.92rem; }
  .brand small { font-size: 0.5rem; }
  .logo-mark { width: 31px; height: 31px; }
  .hero { display: block; padding: 30px 0 23px; }
  .hero h1 { font-size: clamp(2.3rem, 10vw, 4rem); margin-top: 11px; }
  .hero-desc { margin-top: 12px; }
  .hero-actions { gap: 4px 12px; margin-top: 12px; }
  .hero-actions a { min-height: 42px; font-size: 0.79rem; }
  .scope { margin-top: 19px; }
  .scope figcaption, .scope-readouts { padding: 9px 11px; font-size: 9px; }
  .scope-readouts > div + div { padding-left: 7px; }
  .scope-readouts strong { font-size: 1rem; }
  .home-tools, .home-library { padding-block: 16px 24px; }
  .tool-family { margin-top: 15px; }
  .tool-grid { gap: 7px; }
  .tool-card { padding: 11px 13px; }
  .tool-card h4 { margin-top: 6px; }
  .field-guide { display: block; padding: 13px; }
  .section-title { flex-wrap: wrap; margin-bottom: 10px; }
  .section-title p { margin-bottom: 3px; }
  .bench-main, .article-main { padding-top: 18px; }
  .bench-head { display: block; margin-bottom: 11px; }
  .route-controls { margin-top: 9px; }
  .bench-head > div > p { font-size: 0.92rem; }
  .bench { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .readout-pane { display: contents; }
  .readout-top { grid-row: 1; padding: 8px; }
  .input-pane { grid-row: 2; padding: 10px; }
  .diagram-pane { grid-row: 3; padding: 6px; }
  .result-tables { grid-row: 4; }
  .meter strong { font-size: clamp(0.91rem, 4.75vw, 1.5rem); }
  .meters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meter { min-height: 60px; padding: 7px 8px; }
  .meter > div { margin-top: 5px; }
  .readout-head > span { font-size: 0.66rem; }
  .toolbar { gap: 4px; }
  .toolbar > :last-child { margin-left: 0; }
  .small-button { padding-inline: 7px; }
  .method-note { display: block; }
  .method-note a { display: inline-block; margin-top: 6px; }
  .example-grid { grid-template-columns: 1fr; }
  .article-layout { display: block; }
  .article-nav { margin-bottom: 18px; }
}
@media (max-width: 425px) {
  .library-grid { grid-template-columns: 1fr; }
  .hero-actions { gap: 5px 11px; }
  .readout-table table:has(thead th:nth-child(3):last-child) { table-layout: fixed; }
  .readout-table thead tr:has(> th:nth-child(3):last-child) th:first-child { width: 35%; }
  .readout-table thead th:not(:first-child) { white-space: nowrap; }
  .readout-table th, .readout-table td { padding-inline: 6px; }
}

@page { size: A4 portrait; margin: 11mm 12mm; }
@media print {
  :root, :root[data-theme="dark"] {
    color-scheme: light;
    --paper: #ffffff;
    --surface: #ffffff;
    --panel: #edf2f3;
    --ink: #101820;
    --muted: #425262;
    --line: #b6c1ca;
    --grid: #cbd7db;
    --strong-line: #738795;
    --teal: #0f625c;
    --teal-soft: #dcefeb;
    --amber: #8b4716;
    --rose: #9a153a;
    --ground: #4c5e6e;
    --trace: #9b490d;
  }
  body { background: #ffffff; color: #111827; font: 9pt/1.34 var(--sans); }
  body > :not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; break-inside: avoid; }
  .print-sheet h1 { margin: 4pt 0 2pt; font-size: 20pt; letter-spacing: -0.035em; }
  .print-sheet h2 { font-size: 11pt; margin: 6pt 0 2pt; }
  .print-sheet h3 { font-size: 9pt; margin: 3pt 0 2pt; }
  .print-sheet p { margin: 3pt 0; }
  .report-head { font-size: 11pt; border-bottom: 1px solid #a2aeb9; padding-bottom: 4pt; }
  .report-head small, .report-model { color: #425262; }
  .print-values { margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #cbd5e1; }
  .print-values > div { padding: 2.3pt 4pt; min-width: 0; border-bottom: 1px solid #dce2e8; }
  .print-values dt { color: #425262; font-size: 7pt; }
  .print-values dd { margin: 0; font: 8pt/1.2 var(--mono); overflow-wrap: anywhere; }
  .report-diagram { margin: 5pt 0; }
  .report-diagram svg { max-height: 72mm; }
  .report-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(180pt, 1fr)); align-items: start; gap: 4pt 9pt; }
  .report-results th, .report-results td { text-align: left; padding: 1.5pt 3pt; border-bottom: 1px solid #d0d9e2; font-size: 7.5pt; overflow-wrap: anywhere; }
  .print-sheet .report-note { margin-top: 5pt; color: #374151; font-size: 7.3pt; }
  .print-article ul { margin: 3pt 0; }
  .print-article p { margin: 3pt 0; }
}
