:root {
  color-scheme: light;
  --page: #f4f3eb;
  --paper: #fffef9;
  --panel: #eeefe6;
  --scope: #f9faf3;
  --scope-band: #eef2e8;
  --grid: #dbe2d7;
  --line: #d2d8ca;
  --line-strong: #a3b3a5;
  --ink: #1e302e;
  --muted: #4d615a;
  --sense: #0f766e;
  --sense-ink: #0c5f58;
  --sense-soft: #e1f1eb;
  --loss: #c2410c;
  --loss-ink: #983408;
  --loss-soft: #faede1;
  --near: #966003;
  --near-soft: #f9f0d8;
  --problem: #a13120;
  --problem-soft: #faede8;
  --plane: #66958f;
  --focus: #0369a1;
  --shadow: 0 14px 38px -24px #1c323060, 0 2px 4px #1c32300a;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #16211f;
  --paper: #21302d;
  --panel: #2a3934;
  --scope: #1b2c29;
  --scope-band: #243630;
  --grid: #3a4d44;
  --line: #3d534a;
  --line-strong: #637e73;
  --ink: #f1f4df;
  --muted: #c1ccbb;
  --sense: #73dfc6;
  --sense-ink: #94e9d5;
  --sense-soft: #233e36;
  --loss: #ffad70;
  --loss-ink: #ffbd88;
  --loss-soft: #432e24;
  --near: #f0c673;
  --near-soft: #443926;
  --problem: #ffa79a;
  --problem-soft: #4e2d28;
  --plane: #6ba99f;
  --focus: #85d6ff;
  --shadow: 0 14px 38px -24px #0009, 0 2px 4px #0003;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 16px; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--sans); line-height: 1.55; }
[hidden] { display: none !important; }
a { color: var(--sense-ink); text-underline-offset: 0.18em; }
a:hover { color: var(--loss-ink); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
h1, h2, h3 { line-height: 1.13; }
svg { display: block; max-width: 100%; }
.wrap { width: min(1240px, calc(100% - 72px)); margin-inline: auto; }

.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: absolute; z-index: 10; inset: 6px auto auto 6px; padding: 9px 12px; background: var(--paper);
}

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { position: relative; min-height: 66px; display: flex; gap: 24px; align-items: center; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.16rem;
  letter-spacing: -0.045em; font-weight: 780; text-decoration: none; white-space: nowrap;
}
.brand svg { width: 32px; height: 30px; border-radius: 6px; background: var(--ink); }
.brand path { fill: none; stroke: #ffb373; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .brand svg { background: #38534a; }
.site-nav { display: flex; gap: 25px; align-items: center; margin-left: auto; }
.site-nav > a, .nav-tools > summary, .theme-toggle {
  min-height: 44px; display: flex; align-items: center; white-space: nowrap; color: var(--muted);
  font-weight: 650; text-decoration: none; font-size: 0.87rem;
}
.site-nav > a:hover, .nav-tools > summary:hover, .theme-toggle:hover { color: var(--sense-ink); }
.nav-tools { position: relative; }
.nav-tools > summary { cursor: pointer; gap: 8px; }
.nav-tools > summary::marker, details > summary::-webkit-details-marker { display: none; }
.nav-tools > summary::after { content: ""; border: solid currentColor; border-width: 0 1.5px 1.5px 0; width: 6px; height: 6px; transform: translateY(-2px) rotate(45deg); }
.nav-tools[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.nav-tools ul {
  position: absolute; z-index: 5; top: 48px; left: -18px; width: 252px; padding: 7px;
  margin: 0; list-style: none; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow);
}
.nav-tools li a {
  display: flex; align-items: center; min-height: 40px; padding: 5px 11px; border-radius: 4px;
  font-size: 0.86rem; font-weight: 650; text-decoration: none;
}
.nav-tools li a:hover { background: var(--sense-soft); color: var(--sense-ink); }
.theme-toggle {
  justify-content: center; padding-inline: 12px; min-width: 92px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel);
}

.site-footer { margin-top: 65px; border-top: 1px solid var(--line); background: var(--paper); }
.footer-inner { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; align-items: center; min-height: 88px; padding-block: 12px; }
.footer-inner > div { display: flex; gap: 22px; }
.footer-inner > div > a { display: flex; align-items: center; min-height: 42px; font-size: 0.9rem; }
.footer-inner .brand { font-size: 1rem; }

.eyebrow { color: var(--sense-ink); font: 700 0.78rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.09em; }
.button, .action-bar button {
  display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 44px; padding: 8px 15px;
  border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); background: var(--paper);
  font-size: 0.86rem; font-weight: 680; text-decoration: none;
}
.button:hover, .action-bar button:hover:not(:disabled) { border-color: var(--sense); background: var(--sense-soft); color: var(--sense-ink); }
.button.primary, .action-bar .primary { background: var(--sense-ink); color: var(--paper); border-color: var(--sense-ink); }
.button.primary:hover, .action-bar .primary:hover:not(:disabled) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.button.secondary { background: transparent; }
.button.secondary:hover { background: var(--sense-soft); }

.home-hero {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.88fr); align-items: center; gap: clamp(24px, 5vw, 80px);
  padding: clamp(28px, 5vw, 72px) clamp(26px, 4.6vw, 69px);
  margin-top: 27px; border: 1px solid var(--line); border-top: 3px solid var(--loss); border-radius: 7px;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(90deg, transparent 0 31px, var(--scope-band) 31px 32px),
    repeating-linear-gradient(0deg, transparent 0 31px, var(--scope-band) 31px 32px);
  box-shadow: var(--shadow);
}
.home-intro h1 { font-size: clamp(2.75rem, 4.68vw, 4.55rem); font-weight: 730; letter-spacing: -0.05em; margin: 11px 0 16px; line-height: 1.01; }
.home-intro > p:not(.eyebrow) { font-size: clamp(1rem, 1.4vw, 1.13rem); color: var(--muted); max-width: 43ch; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 23px; }
.hero-scope {
  min-width: 0; display: block; color: var(--ink); text-decoration: none; background: var(--scope); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 9px; box-shadow: 0 10px 30px -20px #1c323066;
}
.hero-scope:hover { border-color: var(--sense); color: var(--sense-ink); }
.hero-scope > header {
  min-height: 43px; padding: 2px 10px 8px; display: flex; justify-content: space-between; align-items: center;
  gap: 8px; font: 620 0.75rem/1.2 var(--mono);
}
.hero-scope > header strong { color: var(--ink); white-space: nowrap; }
.hero-scope > header span { color: var(--muted); }
.hero-scope i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--sense); }
.hero-scope .anatomy { border: 1px solid var(--line); }
.scope-link {
  display: flex; min-height: 41px; gap: 6px; padding: 8px 9px 0; align-items: center; justify-content: space-between;
  font-size: 0.79rem; color: var(--sense-ink); font-weight: 690;
}

.directory, .examples-directory { margin-top: 42px; }
.directory > h2, .section-intro h2, .bench-notes h2, .related-examples h2 {
  font-size: clamp(1.44rem, 2.7vw, 2rem); font-weight: 740; letter-spacing: -0.045em;
}
.directory-group { margin-top: 18px; }
.directory-group > h3 {
  border-bottom: 1px solid var(--line-strong); padding-bottom: 7px; margin-bottom: 9px; color: var(--sense-ink);
  font: 720 0.76rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.07em;
}
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tool-card {
  display: grid; grid-template-columns: auto 1fr auto; align-content: start; align-items: center; gap: 8px 12px;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 5px; padding: 15px;
  text-decoration: none;
}
.tool-card:hover { color: var(--ink); border-color: var(--sense); background: var(--scope); }
.tool-card h3 { font-weight: 720; font-size: 1.01rem; }
.tool-card p { grid-column: 2 / -1; color: var(--muted); font-size: 0.84rem; align-self: start; }
.tool-symbol { display: grid; place-items: center; width: 43px; height: 34px; background: var(--sense-soft); border-radius: 4px; }
.tool-symbol svg { width: 30px; height: 23px; stroke: var(--sense); fill: none; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.directory-group:nth-of-type(2) .tool-symbol { background: var(--loss-soft); }
.directory-group:nth-of-type(2) .tool-symbol svg { stroke: var(--loss); }
.card-arrow { color: var(--sense-ink); grid-column: 3; grid-row: 1; }
.section-intro > p { margin: 8px 0 17px; color: var(--muted); }
.example-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; align-items: start; }
.example-groups details { background: var(--paper); border: 1px solid var(--line); border-radius: 5px; }
.example-groups summary, .result-details summary {
  display: list-item; cursor: pointer; min-height: 44px; padding: 10px 12px; font-weight: 700; color: var(--ink);
}
.example-groups summary { list-style-position: inside; }
.example-groups summary span { color: var(--muted); font: 550 0.79rem var(--mono); }
.example-groups ul, .related-examples ul { padding: 0; margin: 0; list-style: none; }
.example-groups ul a, .related-examples li a {
  min-height: 40px; display: flex; align-items: center; padding: 7px 12px; font-size: 0.86rem; text-decoration: none;
  border-top: 1px solid var(--line); line-height: 1.3;
}
.example-groups ul a:hover, .related-examples li a:hover { background: var(--sense-soft); color: var(--sense-ink); }

.breadcrumbs { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-top: 18px; color: var(--muted); font: 0.78rem var(--mono); }
.breadcrumbs > a { display: flex; align-items: center; min-height: 40px; }
.worksheet-header { padding-bottom: 17px; }
.worksheet-header h1, .document-header h1, .error-page h1 {
  font-size: clamp(2rem, 3.35vw, 3rem); letter-spacing: -0.041em; font-weight: 730; max-width: 27ch; line-height: 1.06;
}
.worksheet-header h1 { max-width: none; }
.worksheet-header p, .document-header p, .error-page > p:not(.eyebrow) { color: var(--muted); font-size: clamp(0.95rem, 1.5vw, 1.12rem); margin-top: 9px; max-width: 91ch; }
.worksheet-jumps { display: flex; align-items: center; gap: 15px; margin-top: 6px; }
.worksheet-jumps a, .return-readout, .compact-edit { display: inline-flex; align-items: center; min-height: 40px; font-size: 0.83rem; font-weight: 670; }
.return-readout, .compact-edit { display: none; }
.bench-layout { display: grid; grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.72fr); gap: 15px; align-items: start; }
.inputs-panel, .readout-panel {
  min-width: 0; padding: 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 7px;
  box-shadow: var(--shadow);
}
.inputs-panel { border-top: 3px solid var(--line-strong); }
.readout-panel { border-top: 3px solid var(--sense); }
.panel-header { display: flex; min-height: 40px; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.panel-header h2 { font-size: 1.13rem; letter-spacing: -0.024em; font-weight: 740; }
.unit-switch { display: inline-flex; gap: 3px; border-radius: 6px; background: var(--panel); padding: 3px; }
.unit-switch button {
  min-height: 40px; min-width: 43px; background: transparent; border: 1px solid transparent; border-radius: 4px;
  color: var(--muted); font: 700 0.82rem var(--mono);
}
.unit-switch button[aria-pressed="true"] { color: var(--sense-ink); background: var(--paper); border-color: var(--line-strong); }
fieldset { min-width: 0; margin: 13px 0 0; padding: 8px 0 0; border: 0; border-top: 1px solid var(--line); }
fieldset legend { padding: 0 7px 0 0; color: var(--sense-ink); font: 720 0.73rem var(--mono); }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 9px 9px; }
.input-field { min-width: 0; }
.span-field { grid-column: 1 / -1; }
.input-field label {
  display: block; margin-bottom: 3px; color: var(--muted); font-size: 0.76rem; line-height: 1.3; font-weight: 650;
}
.input-field input, .input-field select, .share-box input {
  min-height: 44px; padding: 7px 8px; background: var(--scope); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 4px;
}
.input-field select { width: 100%; padding-right: 11px; font-size: 0.82rem; }
.input-with-unit {
  display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 4px; min-width: 0; background: var(--scope);
}
.input-with-unit:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.input-with-unit:has([aria-invalid="true"]), .input-field select[aria-invalid="true"] { border-color: var(--problem); }
.input-with-unit input {
  width: 100%; min-width: 0; border: 0; background: transparent; font: 660 0.91rem var(--mono);
  padding-right: 3px; appearance: textfield; outline: none;
}
.input-with-unit input::-webkit-inner-spin-button, .input-with-unit input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.input-with-unit span { padding-right: 8px; white-space: nowrap; font: 0.72rem var(--mono); color: var(--muted); pointer-events: none; }
.field-help { color: var(--muted); font-size: 0.72rem; line-height: 1.35; margin-top: 3px; }
.input-error, .noscript { margin-top: 12px; padding: 10px; color: var(--problem); background: var(--problem-soft); border-left: 3px solid var(--problem); font-size: 0.86rem; }
.empty-readout { padding: 35px 16px; background: var(--problem-soft); color: var(--problem); border: 1px solid var(--line); border-radius: 5px; }
.empty-readout p { margin-top: 6px; }

.telemetry { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 5px 0 10px; }
.telemetry-cell {
  min-width: 0; min-height: 72px; padding: 9px 9px 8px; background: var(--panel);
  border: 1px solid var(--line); border-top: 2px solid var(--sense); border-radius: 4px;
}
.telemetry-cell:nth-child(even) { border-top-color: var(--loss); }
.telemetry dt { color: var(--muted); font: 690 clamp(0.63rem, 1.1vw, 0.73rem)/1.2 var(--mono); }
.telemetry dd {
  margin-top: 5px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 5px; overflow-wrap: anywhere;
  font: 720 clamp(1.1rem, 2.1vw, 1.7rem)/1.12 var(--mono); letter-spacing: -0.06em;
}
.telemetry dd small { font: 610 0.71rem var(--mono); letter-spacing: 0; color: var(--muted); }

.scope { background: var(--scope); border: 1px solid var(--line-strong); border-radius: 5px; overflow: hidden; }
.anatomy { width: 100%; height: auto; color: var(--ink); }
.scope > .anatomy { max-height: 315px; }
.scope figcaption {
  padding: 8px 10px; background: var(--paper); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8rem; line-height: 1.4;
}
.scope-face { fill: var(--scope); }
.legend-bed { fill: var(--scope-band); }
.scope-text { fill: var(--ink); font: 650 15px var(--mono); }
.channel { font-size: 15px; font-weight: 720; letter-spacing: -0.45px; }
.plot-scale { fill: var(--muted); font-size: 12px; }
.axis-text { fill: var(--muted); font-size: 12px; }
.legend-name { font-size: 12px; }
.legend-name.sense { fill: var(--sense-ink); }
.legend-name.loss { fill: var(--loss-ink); }
.legend-name.neutral { fill: var(--muted); }
.legend-value { font-size: 15px; font-weight: 740; }
.gridline { stroke: var(--grid); stroke-width: 0.9; fill: none; }
.axis, .laminate-line { fill: none; stroke: var(--line-strong); stroke-width: 1.35; }
.timing, .reference-trace { stroke: var(--line-strong); stroke-dasharray: 4 3; stroke-width: 1.3; fill: none; }
.limit-trace { stroke: var(--loss); stroke-width: 1.35; stroke-dasharray: 4 4; fill: none; }
.current-trace, .voltage-trace { fill: none; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.current-trace { stroke: var(--sense); }
.voltage-trace { stroke: var(--loss); }
.sense-dot, .loss-dot { stroke: var(--scope); stroke-width: 1.2; }
.sense-dot { fill: var(--sense); }
.loss-dot, .voltage-fill { fill: var(--loss); }
.overlap-fill, .idle-zone { fill: var(--loss); opacity: 0.12; }
.laminate, .core-shape { fill: var(--panel); stroke: var(--line-strong); stroke-width: 1.3; }
.reference-plane { fill: var(--plane); }
.halo { fill: var(--loss); opacity: 0.16; }
.hot-copper { fill: var(--loss); }

.screening {
  margin-top: 10px; padding: 10px 11px; display: grid; gap: 10px 18px; grid-template-columns: minmax(0, 1fr) minmax(205px, 0.95fr);
  border: 1px solid var(--line); border-radius: 5px; background: var(--scope); font-size: 0.79rem;
}
.screening-copy { display: flex; align-items: flex-start; gap: 8px; }
.screening-copy p { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.status-light { flex: 0 0 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--sense); }
[data-level="near"] .status-light { background: var(--near); }
[data-level="over"] .status-light { background: var(--problem); }
.screening[data-level="over"] { background: var(--problem-soft); }
.screening[data-level="near"] { background: var(--near-soft); }
.gauges { min-width: 0; display: grid; align-items: start; align-content: center; gap: 4px; }
.gauge p { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 6px; font-size: 0.71rem; }
.gauge strong { font: 680 0.69rem/1.55 var(--mono); color: var(--ink); }
.gauge svg { width: 100%; height: 7px; }
.meter-bed { fill: var(--line); }
.meter-fill { fill: var(--sense); }
.gauge[data-level="near"] .meter-fill { fill: var(--near); }
.gauge[data-level="over"] .meter-fill { fill: var(--problem); }
.meter-line { fill: none; stroke: var(--ink); stroke-width: 0.65; }

.result-details { margin-top: 10px; border: 1px solid var(--line); border-radius: 5px; }
.result-details summary { padding-inline: 11px; list-style-position: inside; font-size: 0.85rem; }
.result-details table { width: 100%; border-collapse: collapse; font-size: 0.82rem; table-layout: fixed; }
.result-details th, .result-details td { padding: 7px 10px; border-top: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; line-height: 1.35; }
.result-details th { width: 58%; font-weight: 570; color: var(--muted); }
.result-details td { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 650; }
.result-details tr:nth-child(odd) { background: var(--scope); }

.action-panel { margin-top: 10px; }
.action-bar { display: flex; align-items: stretch; gap: 5px; flex-wrap: wrap; }
.action-bar button { padding-inline: 10px; font-size: 0.77rem; }
.action-bar button:disabled { opacity: 0.52; }
.share-box { display: block; font-size: 0.79rem; margin-top: 9px; color: var(--muted); }
.share-box input { display: block; width: 100%; font: 0.78rem var(--mono); margin-top: 3px; }
.action-feedback:not(:empty) { padding-top: 5px; color: var(--sense-ink); font-size: 0.8rem; }

.bench-notes, .related-examples { margin-top: 32px; }
.bench-notes { padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.example-notes { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(220px, 1fr); gap: 22px; align-items: start; }
.example-entry { margin-top: 10px; }
.example-notes .equation + p { color: var(--muted); }
.formula-list { display: grid; gap: 12px; margin-top: 13px; }
.formula-list section { min-width: 0; }
.formula-list h3, .preset-readout h3 { font-size: 0.91rem; margin-bottom: 4px; }
.equation { padding: 6px 9px; margin-bottom: 4px; background: var(--scope); border-left: 2px solid var(--sense); font: 0.79rem/1.5 var(--mono); overflow-wrap: anywhere; }
.formula-list p:not(.equation) { color: var(--muted); font-size: 0.88rem; }
.preset-readout { padding: 13px; border: 1px solid var(--line); background: var(--panel); border-radius: 5px; font-size: 0.81rem; }
.preset-readout dl > div { border-top: 1px solid var(--line); padding: 7px 0; }
.preset-readout dd { font: 710 0.91rem var(--mono); margin-top: 2px; }
.preset-readout > p { margin-top: 8px; color: var(--sense-ink); }
.related-examples > div { display: flex; gap: 9px 16px; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 11px; }
.related-examples > div a { font-size: 0.85rem; }
.related-examples ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.related-examples li a { justify-content: space-between; gap: 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.related-examples li a:hover { background: var(--sense-soft); }

.document-header { margin: 44px 0 23px; }
.document-layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); align-items: start; gap: 16px; }
.document-index, .document-content > section {
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 17px;
}
.document-index h2 { font-size: 1rem; }
.document-index ul { list-style: none; margin: 7px 0 0; padding: 0; }
.document-index li a { display: flex; align-items: center; min-height: 40px; font-size: 0.83rem; }
.document-content > section + section { margin-top: 11px; }
.document-content h2 { font-size: 1.36rem; letter-spacing: -0.035em; margin-bottom: 7px; }
.document-content section > p { margin-top: 6px; color: var(--muted); }
.source-title { margin: 13px 0 4px; font-size: 0.93rem; }
.document-content ul { margin: 5px 0 0; padding-left: 20px; font-size: 0.87rem; }
.privacy-content { max-width: 860px; }
.error-page { margin: 13vh auto 0; max-width: 730px; padding: clamp(22px, 5vw, 54px); background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--loss); box-shadow: var(--shadow); border-radius: 7px; }
.error-page .eyebrow { margin: 23px 0 6px; color: var(--loss-ink); }
.error-page .button { margin-top: 18px; }

@media (max-width: 1040px) {
  .wrap { width: calc(100% - 44px); }
  .site-nav { gap: 17px; }
  .home-hero { gap: 24px; }
  .hero-break { display: none; }
  .bench-layout { grid-template-columns: minmax(245px, 0.88fr) minmax(0, 1.6fr); }
  .screening { grid-template-columns: 1fr; gap: 6px; }
  .telemetry-cell { padding-inline: 7px; }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 30px); }
  .header-inner { min-height: 58px; gap: 10px; }
  .brand { font-size: 1.02rem; gap: 6px; }
  .brand svg { width: 28px; height: 27px; }
  .site-nav > .nav-examples, .site-nav > .nav-method { display: none; }
  .theme-toggle { min-width: 0; padding-inline: 8px; font-size: 0.74rem; }
  .nav-tools { position: static; }
  .nav-tools summary { font-size: 0.81rem; }
  .nav-tools ul { top: 51px; left: auto; right: 0; max-width: calc(100vw - 30px); }
  .home-hero { grid-template-columns: 1fr; margin-top: 16px; padding: 23px 17px 17px; gap: 18px; }
  .home-intro h1 { font-size: clamp(2.48rem, 8.6vw, 4.3rem); }
  .hero-scope { max-width: 515px; width: 100%; }
  .hero-actions .button { padding-inline: 10px; font-size: 0.81rem; }
  .tool-grid, .example-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory, .examples-directory { margin-top: 29px; }
  .breadcrumbs { margin-top: 7px; }
  .worksheet-header { padding-bottom: 11px; }
  .worksheet-jumps { margin-top: 2px; }
  .compact-edit, .return-readout { display: inline-flex; }
  .bench-layout { display: flex; flex-direction: column; gap: 11px; }
  .readout-panel { order: -1; }
  .readout-panel, .inputs-panel { width: 100%; padding: 10px; }
  .return-readout { margin-top: 5px; }
  .readout-header { margin-bottom: 3px; }
  .telemetry dd { font-size: clamp(1.11rem, 3.8vw, 1.4rem); }
  .telemetry-cell { min-height: 59px; padding: 7px; }
  .screening { grid-template-columns: minmax(0, 1fr); }
  .example-notes, .document-layout { grid-template-columns: minmax(0, 1fr); }
  .document-header { margin-top: 25px; }
  .document-index ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 9px; }
  .site-footer { margin-top: 43px; }
}
@media (max-width: 475px) {
  .tool-grid, .example-groups, .related-examples ul { grid-template-columns: minmax(0, 1fr); }
  .telemetry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .telemetry-cell { min-height: 56px; }
  .worksheet-header h1 { font-size: clamp(1.97rem, 8.2vw, 2.42rem); }
  .action-bar button { flex-grow: 1; }
  .panel-header h2 { font-size: 1.02rem; }
}
@media (max-width: 355px) {
  .wrap { width: calc(100% - 24px); }
  .header-inner { gap: 6px; }
  .brand { font-size: 0.96rem; }
  .theme-toggle { padding-inline: 5px; font-size: 0.67rem; }
  .nav-tools summary { font-size: 0.73rem; gap: 6px; }
  .home-intro h1 { font-size: 2.42rem; }
}

#print-sheet { display: none; }
@page { size: A4; margin: 12mm; }
@page methods { size: A4 portrait; margin: 8mm; }
@media print {
  :root[data-theme] {
    color-scheme: light; --page: #fff; --paper: #fff; --panel: #eef1ec; --scope: #fcfdfa; --scope-band: #eef2ec;
    --grid: #dbe2db; --line: #c6d1c5; --line-strong: #85978d; --ink: #182a25; --muted: #42574c;
    --sense: #0f766e; --sense-ink: #0c625a; --loss: #b63b09; --loss-ink: #983408; --plane: #66958f;
  }
  body { background: #fff; }
  .site-header, .site-footer { display: none; }
  .home-page .wrap, .document-page .wrap { width: auto; margin-inline: 0; }
  .home-page .home-hero { grid-template-columns: 1fr 1.2fr; margin: 0; padding: 2mm 4mm; gap: 5mm; box-shadow: none; }
  .home-page .home-intro h1 { font-size: 23pt; margin: 2mm 0; }
  .home-page .home-intro > p:not(.eyebrow) { font-size: 9pt; }
  .home-page .hero-break, .home-page .hero-actions { display: none; }
  .home-page .hero-scope { max-width: 79mm; justify-self: end; padding: 1.5mm; box-shadow: none; }
  .home-page .hero-scope > header, .home-page .scope-link { min-height: 0; padding: 1mm; font-size: 8pt; }
  .home-page .directory, .home-page .examples-directory { margin: 4mm 0 0; }
  .home-page .directory > h2, .home-page .section-intro h2 { font-size: 13pt; }
  .home-page .directory-group { margin: 2mm 0 0; }
  .home-page .directory-group > h3 { padding-bottom: .5mm; margin-bottom: 1mm; font-size: 8pt; }
  .home-page .tool-grid, .home-page .example-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1mm; }
  .home-page .example-groups { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-page .tool-card { display: block; padding: 1.3mm; break-inside: avoid; }
  .home-page .tool-card h3 { font-size: 8pt; }
  .home-page .tool-card p, .home-page .section-intro > p { margin: .6mm 0; font-size: 7.5pt; line-height: 1.15; }
  .home-page .tool-symbol, .home-page .card-arrow { display: none; }
  .home-page .example-groups details { break-inside: avoid; }
  .home-page .example-groups summary, .home-page .example-groups summary span { min-height: 0; font-size: 8pt; }
  .home-page .example-groups summary, .home-page .example-groups ul a { padding: .7mm 1.25mm; }
  .home-page .example-groups ul a { min-height: 0; font-size: 7.5pt; line-height: 1.12; }
  .document-page { font: 8pt/1.08 Arial, sans-serif; }
  .document-page:has(.document-layout) { page: methods; }
  .document-header { margin: 0 0 3mm; }
  .document-header h1 { font-size: 17pt; }
  .document-header p { margin: 1mm 0 0; font-size: 9pt; }
  .document-layout { display: block; }
  .document-index, .document-layout .document-content > section > a,
  .document-content .source-title { display: none; }
  .document-layout .document-content { columns: 2; column-gap: 5mm; }
  .document-layout .document-content > section:first-child { column-span: all; }
  .document-content > section { border: 0; border-top: .2mm solid var(--line); padding: .7mm 0; }
  .document-content > section + section { margin-top: .5mm; }
  .document-content h2 { margin: 0; font-size: 10pt; break-after: avoid; }
  .document-content section > p { margin: .45mm 0 0; }
  .document-content .formula-list { display: block; margin: .7mm 0; }
  .document-content .formula-list section { break-inside: avoid; }
  .document-content .formula-list section + section { margin-top: .7mm; }
  .document-content .formula-list h3 { display: inline; font-size: 8pt; margin: 0 .65mm 0 0; }
  .document-content .formula-list p:not(.equation), .document-content ul { font-size: 8pt; }
  .document-content .formula-list p:not(.equation) { display: inline; }
  .document-content .formula-list p:not(.equation)::before { content: " · "; }
  .document-content .equation { display: inline; border: 0; padding: 0; margin: 0; font-size: 7pt; line-height: 1.1; }
  .document-content ul { margin: .5mm 0 0; padding: 0; }
  .document-content li { display: inline; }
  .document-content li + li::before { content: " · "; }
  .worksheet-page > :not(#print-sheet) { display: none !important; }
  #print-sheet { display: block; font-size: 9pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .print-heading { border-bottom: 1pt solid var(--line-strong); padding-bottom: 2.5mm; margin-bottom: 3mm; }
  .print-heading h1 { font-size: 19pt; margin: 1.5mm 0; }
  .print-figure { max-width: 115mm; margin: 0 auto 2.5mm; }
  .print-figure svg { border: 0.6pt solid var(--line); }
  .print-columns { display: grid; grid-template-columns: 1fr 1.13fr; gap: 5mm; }
  .print-columns h2 { font-size: 11pt; padding-bottom: 1.5mm; }
  .print-columns dl > div { display: grid; grid-template-columns: 1.32fr 1fr; gap: 1.5mm; padding: 0.8mm 0; border-top: 0.45pt solid var(--line); break-inside: avoid; line-height: 1.22; }
  .print-columns dd { font-family: var(--mono); overflow-wrap: anywhere; }
}
