:root {
  color-scheme: light;
  --page: #f7f4ec;
  --paper: #fffdf8;
  --recess: #efeae0;
  --ink: #1a2133;
  --muted: #4c566d;
  --line: #d4cfc3;
  --indigo: #263c73;
  --indigo-soft: #e8eef9;
  --amber: #e89c32;
  --amber-dark: #263c73;
  --solar: #b8660a;
  --mark-ink: #262c25;
  --dark-slate: #fffdf8;
  --soft-amber: #fbf0da;
  --green: #1f6b47;
  --soft-green: #e4f3eb;
  --negative: #a52820;
  --soft-negative: #fdeeee;
  --diagram-wall: #cbd2de;
  --diagram-wire: #b8660a;
  --diagram-wire-2: #263c73;
  --diagram-wire-3: #68738a;
  --diagram-wire-4: #a5523b;
  --shadow: #1a21330d;
  --display: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, monospace;
  --frame: 76rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  font-family: var(--body);
  line-height: 1.55;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #141720;
  --paper: #1c202c;
  --recess: #242938;
  --ink: #edf0f7;
  --muted: #a6aec4;
  --line: #384054;
  --indigo: #7ea6ff;
  --indigo-soft: #24304d;
  --amber: #f2aa44;
  --amber-dark: #84abff;
  --solar: #f5b352;
  --mark-ink: #141720;
  --dark-slate: #1c202c;
  --soft-amber: #3a2f1d;
  --green: #6ad39e;
  --soft-green: #1c3528;
  --negative: #f08078;
  --soft-negative: #3c2222;
  --diagram-wall: #4b556b;
  --diagram-wire: #f2aa44;
  --diagram-wire-2: #84abff;
  --diagram-wire-3: #95a0b8;
  --diagram-wire-4: #de8a73;
  --shadow: #00000040;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); }
a { color: var(--amber-dark); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible {
  outline: 3px solid var(--amber-dark);
  outline-offset: 3px;
}
:target { scroll-margin-top: 1.25rem; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; overflow-wrap: break-word; }
h1, h2 { letter-spacing: -.038em; }
h3 { letter-spacing: -.018em; }
main { min-height: 67dvh; }
svg { max-width: 100%; }
.frame { width: min(100%, var(--frame)); padding-inline: var(--gutter); margin-inline: auto; }

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.skip-link:focus { position: absolute; top: .4rem; left: .4rem; z-index: 4; background: var(--paper); padding: .65rem 1rem; }

.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; align-items: center; min-height: 4.5rem; gap: clamp(.65rem, 3vw, 2.15rem); }
.wordmark {
  display: inline-flex; gap: .58rem; color: var(--ink); align-items: center; text-decoration: none;
  font-family: var(--display); font-weight: 800; font-size: 1.25rem; letter-spacing: -.06em; white-space: nowrap;
}
.wordmark > span > span { color: var(--amber-dark); }
.brand-mark { color: var(--indigo); flex: none; }
.masthead nav { margin-inline-start: auto; display: flex; align-items: center; flex-wrap: wrap; gap: clamp(.55rem, 2.25vw, 1.8rem); }
.masthead nav a, .footer nav a { font-size: .9rem; font-weight: 650; color: var(--muted); text-decoration: none; }
.masthead nav a:hover, .masthead nav a[aria-current], .footer nav a:hover { color: var(--amber-dark); }
.theme-button {
  display: inline-grid; place-items: center; inline-size: 2.45rem; block-size: 2.45rem; flex: none;
  border: 1px solid var(--line); background: var(--recess); border-radius: .65rem; padding: .45rem;
}
.theme-button:hover { border-color: var(--amber-dark); }
.theme-button svg { fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; }
.theme-button[aria-pressed="false"] .theme-sun, .theme-button[aria-pressed="true"] .theme-moon { display: none; }

.home-hero { background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; grid-template-columns: 1fr minmax(19rem, .94fr); align-items: center; gap: clamp(1.5rem, 6vw, 5rem); padding-block: clamp(2.8rem, 5.35vw, 4.75rem); }
.hero-copy { container-type: inline-size; }
.hero-copy .eyebrow { display: inline-flex; padding: .24rem .62rem; border-radius: .35rem; background: var(--indigo-soft); border: 1px solid var(--line); color: var(--indigo); }
.eyebrow { font: 650 .82rem/1.35 var(--mono); letter-spacing: .085em; text-transform: uppercase; color: var(--amber-dark); }
.hero-copy h1 { font-size: clamp(2.5rem, 13.5cqi, 5.3rem); line-height: .96; margin-block: .9rem 1.2rem; }
.hero-copy > p:not(.eyebrow) { font-size: clamp(1rem, 1.8vw, 1.19rem); color: var(--muted); max-width: 33rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-block-start: 1.55rem; }
.hero-schematic { display: block; width: 100%; }
.hero-grid-dot { fill: var(--indigo); opacity: .18; }
.hero-card-bg { fill: var(--recess); stroke: var(--line); stroke-width: 1.5; }
.hero-card-panel { fill: var(--paper); stroke: var(--line); stroke-width: 1.5; }
.hero-card-bus { fill: var(--indigo-soft); stroke: var(--indigo); stroke-width: 1.3; }
.hero-bus-line { stroke: var(--solar); fill: none; stroke-width: 5; stroke-linecap: round; }
.hero-bus-rung { fill: none; stroke: var(--line); stroke-width: 2; }
.hero-feeder-line { fill: none; stroke: var(--solar); stroke-width: 2; }
.hero-tap { fill: var(--indigo); }
.hero-grid-label { font: 700 11px var(--mono); letter-spacing: .07em; fill: var(--ink); }
.hero-output rect { fill: var(--paper); stroke: var(--line); stroke-width: 1.3; }
.hero-icon { fill: none; stroke: var(--indigo); stroke-width: 1.65; stroke-linejoin: round; stroke-linecap: round; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: .62rem; min-height: 2.8rem; padding: .52rem .9rem;
  font-size: .92rem; font-weight: 720; line-height: 1.3; text-align: center; text-decoration: none; color: var(--ink);
}
.button.primary { background: var(--indigo); color: #fffdf8; }
:root[data-theme="dark"] .button.primary { color: #141720; }
.button.primary:hover { filter: brightness(1.1); }
.button.secondary { border-color: var(--line); background: var(--paper); }
.button.secondary:hover:enabled, a.button.secondary:hover { border-color: var(--amber-dark); color: var(--amber-dark); }
.button.hero-link { border-color: var(--line); background: var(--recess); color: var(--ink); }
.button.hero-link:hover { border-color: var(--indigo); color: var(--indigo); }
.home-hero :focus-visible { outline-color: var(--indigo); }

.home-content { padding-block: clamp(2.3rem, 5vw, 4rem); }
.section-head { display: flex; gap: .45rem 1.5rem; align-items: baseline; flex-wrap: wrap; margin-bottom: 1.25rem; }
.section-head h2 { font-size: clamp(1.95rem, 4vw, 2.7rem); }
.section-head p { color: var(--muted); }
.catalog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; }
.tool-card {
  display: grid; grid-template-rows: auto auto auto 1fr; align-content: start; gap: .65rem; padding: 1.1rem;
  border-radius: .85rem; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  box-shadow: 0 2px 6px var(--shadow); text-decoration: none;
}
.tool-card:hover { border-color: var(--amber-dark); }
.card-mark {
  display: inline-grid; place-items: center; width: 2.65rem; height: 2.65rem;
  color: var(--amber-dark); background: var(--soft-amber); border-radius: .55rem;
}
.tool-icon { fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.code-label { color: var(--muted); font: .77rem/1.45 var(--mono); }
.tool-card h3 { font-size: 1.19rem; }
.tool-card p { color: var(--muted); font-size: .91rem; }
.guide-directory { margin-top: clamp(2.75rem, 6vw, 4.9rem); }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; align-items: start; }
.guide-list { border: 1px solid var(--line); border-radius: .7rem; background: var(--paper); }
.guide-list summary { display: flex; align-items: center; gap: .65rem; padding: .84rem 1rem; font-weight: 700; list-style: none; }
.guide-list summary::-webkit-details-marker { display: none; }
.guide-list summary::after { content: "+"; color: var(--amber-dark); font: 1.35rem/1 var(--mono); }
.guide-list[open] summary::after { content: "−"; }
.guide-count { margin-inline-start: auto; flex: none; color: var(--muted); font: .78rem var(--mono); }
.guide-list ul { margin: 0; padding: .2rem 1rem .9rem 2rem; }
.guide-list li + li { margin-top: .4rem; }
.guide-list li a { font-size: .93rem; }
summary { cursor: pointer; }
.scope-strip {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  border-top: 1px solid var(--line); margin-top: 2.65rem; padding-top: 1.45rem;
}
.scope-strip p { color: var(--muted); margin-top: .35rem; }

.tool-frame, .info-frame { padding-block: 1.3rem 3.5rem; }
.info-frame { padding-top: clamp(2rem, 6vw, 4.4rem); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .65rem; list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: .89rem; }
.breadcrumbs li + li::before { content: "/"; margin-inline-end: .65rem; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.tool-head { margin-block: clamp(1.5rem, 4vw, 3.25rem) 1.7rem; max-width: 59rem; }
.info-frame .tool-head { margin-top: 0; }
.tool-head h1 { font-size: clamp(2.25rem, 5.4vw, 4.35rem); line-height: 1.02; margin-block: .48rem .8rem; }
.tool-head .lede { max-width: 49rem; color: var(--muted); font-size: clamp(1.02rem, 1.8vw, 1.23rem); }
.tool-head .button { margin-top: 1.05rem; }

.workspace { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1rem; align-items: start; }
.worksheet-panel { min-width: 0; border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); box-shadow: 0 3px 9px var(--shadow); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  border-bottom: 1px solid var(--line); padding: .85rem clamp(.85rem, 2.3vw, 1.35rem);
}
.panel-head h2 { font-size: 1.28rem; }
form { padding: clamp(.85rem, 2.3vw, 1.35rem); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .83rem .75rem; align-items: start; }
.field[data-control="placement"], .field[data-control="basis"] { grid-column: 1 / -1; }
.field label { display: block; line-height: 1.35; font-size: .91rem; font-weight: 690; margin-bottom: .28rem; }
.field small { display: block; color: var(--muted); font-size: .79rem; line-height: 1.4; margin-top: .28rem; }
.control { position: relative; }
.control input, .control select {
  width: 100%; min-width: 0; min-height: 2.75rem; background: var(--recess); color: var(--ink);
  border: 1px solid var(--line); border-radius: .53rem; padding: .44rem .58rem; font-size: 1rem;
}
.control input { font-variant-numeric: tabular-nums; }
.control input::-webkit-inner-spin-button { appearance: none; }
.control input { appearance: textfield; }
.control select { appearance: none; padding-inline-end: 1.55rem; text-overflow: ellipsis; }
.control.select::after {
  content: ""; position: absolute; top: 43%; right: .78rem; width: .37rem; height: .37rem;
  border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg); pointer-events: none;
}
.control.has-unit input { padding-inline-end: 4.3rem; }
.unit { position: absolute; right: .56rem; top: 50%; transform: translateY(-50%); color: var(--muted); font: .77rem var(--mono); pointer-events: none; }
.advanced { margin-top: 1.1rem; border-top: 1px solid var(--line); }
.advanced summary { padding: .7rem .1rem; color: var(--amber-dark); font-weight: 680; font-size: .93rem; }
.advanced .field-grid { margin-top: .25rem; }
.wire-inputs { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.wire-inputs h3 { font-size: 1rem; margin-bottom: .7rem; }
.wire-row { min-inline-size: 0; margin: 0 0 .65rem; border: 1px solid var(--line); border-radius: .66rem; padding: .6rem .7rem .7rem; }
.wire-row legend { font-size: .84rem; padding-inline: .25rem; color: var(--muted); }
.wire-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(3.1rem, .55fr); align-items: start; gap: .5rem; }
.wire-fields:has([data-control="area"]:not([hidden])) { grid-template-columns: minmax(0, 1.4fr) minmax(3.1rem, .5fr) minmax(5.25rem, 1fr); }
.wire-fields .has-unit input { padding-inline-end: 2rem; }
.wire-row .quiet-button { margin-top: .45rem; }
.quiet-button { background: transparent; border: 0; border-radius: .35rem; color: var(--amber-dark); font-size: .87rem; font-weight: 700; padding: .35rem .45rem; }
.quiet-button:hover:enabled { background: var(--soft-amber); }
.result-jump { display: none; margin: 0 1rem .9rem; font-weight: 670; }
.no-script { padding: .7rem 1rem; color: var(--muted); }

.live-indicator { font: .78rem var(--mono); color: var(--muted); }
#result-readout { padding: clamp(.85rem, 2.3vw, 1.35rem); }
.primary-result { display: grid; gap: .3rem; justify-items: start; border-radius: .7rem; padding: .9rem 1rem 1.05rem; background: var(--recess); border-inline-start: 4px solid var(--amber); }
.result-chip { padding: .18rem .44rem; border-radius: .32rem; font-size: .84rem; font-weight: 690; color: var(--muted); background: var(--paper); }
.result-chip.pass { color: var(--green); background: var(--soft-green); }
.result-chip.review { color: var(--amber-dark); background: var(--soft-amber); }
.primary-result strong { font: 770 clamp(1.9rem, 4.8vw, 3.05rem)/1.04 var(--display); letter-spacing: -.045em; max-width: 100%; overflow-wrap: anywhere; }
.primary-result p { color: var(--muted); font-size: .86rem; }
.result-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-block: .8rem; }
.result-facts > div { min-width: 0; padding: .62rem .65rem .52rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.result-facts dt { color: var(--muted); font-size: .83rem; line-height: 1.4; }
.result-facts dd { font-family: var(--mono); font-size: .93rem; font-weight: 650; margin-top: .23rem; }
.readout-figure { background: var(--recess); border: 1px solid var(--line); border-radius: .7rem; overflow: hidden; padding: .45rem .65rem .55rem; }
.readout-figure svg { display: block; width: min(100%, 31rem); margin: auto; }
.readout-figure figcaption { margin-top: .28rem; text-align: center; font-size: .79rem; color: var(--muted); }
.diagram-label { fill: var(--muted); font: 670 11px var(--mono); }
.diagram-value { fill: var(--ink); font: 760 18px var(--display); }
.diagram-hair { fill: none; stroke: var(--muted); stroke-width: 1.35; }
.raceway-wall { fill: var(--diagram-wall); stroke: var(--muted); stroke-width: 1.2; }
.raceway-inner { fill: var(--paper); stroke: var(--muted); stroke-width: 1.2; }
.wire { stroke: var(--ink); stroke-width: 1; }
.wire-0 { fill: var(--diagram-wire); }
.wire-1 { fill: var(--diagram-wire-2); }
.wire-2 { fill: var(--diagram-wire-3); }
.wire-3 { fill: var(--diagram-wire-4); }
.diagram-node, .bus-enclosure { fill: var(--paper); stroke: var(--muted); stroke-width: 1.1; }
.trace-hot, .trace-neutral, .trace-ground, .busbar, .bus-loads { fill: none; stroke-linecap: round; stroke-width: 2; }
.trace-hot { stroke: var(--amber-dark); }
.trace-neutral { stroke: var(--diagram-wire-3); }
.trace-ground { stroke: var(--green); stroke-dasharray: 4 3; }
.trace-dash { stroke-dasharray: 5 4; }
.busbar { stroke: var(--diagram-wire); stroke-width: 7; }
.bus-loads { stroke: var(--line); }
.terminal-dot { fill: var(--ink); }
.bar-track { fill: var(--line); }
.bar-value { fill: var(--diagram-wire-2); }
.bar-final { fill: var(--diagram-wire); }
.schem-box { fill: var(--paper); stroke: var(--line); stroke-width: 1.2; }
.schem-card { fill: var(--paper); stroke: var(--line); stroke-width: 1.1; }
.schem-badge-indigo { fill: var(--indigo-soft); stroke: var(--indigo); stroke-width: 1; }
.schem-badge-ok { fill: var(--soft-green); stroke: var(--green); stroke-width: 1; }
.schem-badge-warn { fill: var(--soft-amber); stroke: var(--solar); stroke-width: 1; }
.schem-badge-fail { fill: var(--soft-negative); stroke: var(--negative); stroke-width: 1; }
.schem-title { fill: var(--muted); font: 700 10.5px var(--mono); letter-spacing: .04em; }
.schem-label { fill: var(--muted); font: 700 10px var(--mono); }
.schem-val { fill: var(--ink); font: 750 15.5px var(--display); }
.schem-val-accent { fill: var(--indigo); font: 750 15.5px var(--display); }
.schem-sub { fill: var(--muted); font: 600 10.5px var(--mono); }
.schem-text-ok { fill: var(--green); font: 700 10.5px var(--mono); }
.schem-text-warn { fill: var(--solar); font: 700 10.5px var(--mono); }
.schem-text-fail { fill: var(--negative); font: 700 10.5px var(--mono); }
.schem-wire-hot { fill: none; stroke: var(--solar); stroke-width: 2.3; stroke-linecap: round; }
.schem-wire-neu { fill: none; stroke: var(--indigo); stroke-width: 2; stroke-linecap: round; }
.schem-wire-egc { fill: none; stroke: var(--green); stroke-width: 1.7; stroke-dasharray: 4 3; }
.schem-arrow-hot { fill: var(--solar); }
.schem-fill-ok { fill: var(--green); }
.schem-fill-warn { fill: var(--solar); }
.schem-fill-fail { fill: var(--negative); }
.schem-fill-accent { fill: var(--indigo); }
.schem-limit { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 2.5 2; }
.diagram-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .55rem; }
.diagram-actions .button { min-height: 2.2rem; padding: .34rem .7rem; font-size: .82rem; }
@media print { .diagram-actions { display: none !important; } }
.result-notes { margin: .85rem 0 0; padding: .6rem .65rem .6rem 1.65rem; background: var(--soft-amber); border-radius: .5rem; font-size: .88rem; }
.result-notes li + li, .checklist li + li { margin-top: .35rem; }
.scroll-table { margin-top: .9rem; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: .6rem; }
.scroll-table table { width: 100%; border-collapse: collapse; text-align: left; font-size: .82rem; font-variant-numeric: tabular-nums; }
.scroll-table caption { background: var(--recess); text-align: left; font-weight: 700; padding: .58rem .7rem; font-size: .92rem; }
.scroll-table th, .scroll-table td { padding: .45rem .57rem; border-top: 1px solid var(--line); vertical-align: top; }
.scroll-table th { font-weight: 650; }
.scroll-table thead th { color: var(--muted); }
.checklist { margin-block: 1.2rem 0; font-size: .9rem; }
.checklist ul { padding-left: 1.15rem; margin: .45rem 0 0; }
.export-bar { display: flex; flex-wrap: wrap; gap: .45rem; padding: .8rem clamp(.85rem, 2.3vw, 1.35rem); border-top: 1px solid var(--line); }
.export-bar .button { font-size: .86rem; min-height: 2.55rem; }
.input-error { padding: .9rem; background: var(--soft-amber); border-radius: .65rem; }
.input-error p { margin-top: .35rem; }

.article-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(15rem, 1fr); gap: clamp(1.5rem, 5vw, 4rem); margin-top: 2.8rem; }
.article-body { max-width: 49rem; }
.article-section + .article-section { margin-top: 1.85rem; }
.article-section h2 { font-size: 1.55rem; margin-bottom: .52rem; }
.article-section p + p { margin-top: .55rem; }
.article-section p, .article-section li { color: var(--muted); }
.steps { padding-inline-start: 1.45rem; }
.steps li { padding-inline-start: .2rem; margin-bottom: .7rem; }
.steps h3 { color: var(--ink); font-size: 1.02rem; margin-bottom: .25rem; }
.method-note { padding: .8rem .95rem; border-inline-start: 3px solid var(--amber); background: var(--recess); border-radius: .35rem; }
.faq { border-top: 1px solid var(--line); padding-block: .62rem; }
.faq summary { font-weight: 690; }
.faq p { margin: .4rem 0 0; }
.sources ul, .article-aside ul { margin: .45rem 0; padding-inline-start: 1.1rem; }
.sources li + li, .article-aside li + li { margin-top: .35rem; }
.article-aside section { background: var(--paper); border: 1px solid var(--line); border-radius: .8rem; margin-bottom: 1rem; padding: 1rem 1.1rem; font-size: .94rem; }
.article-aside h2 { font-size: 1.17rem; }
.guide-index-link { display: inline-block; margin-top: .32rem; font-weight: 650; }
.footer { border-top: 1px solid var(--line); background: var(--paper); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1.4rem; padding-block: 1.1rem; }
.footer .brand-mark { width: 1.7rem; height: 1.7rem; }
.footer p { font-size: .88rem; color: var(--muted); }
.footer nav { display: flex; gap: .85rem; margin-inline-start: auto; }

@media (max-width: 62rem) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { gap: 1.5rem; }
  .field-grid { gap: .7rem .55rem; }
}
@media (max-width: 48rem) {
  .workspace, .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-layout { margin-top: 2rem; }
  .result-jump { display: inline-block; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-schematic { width: min(100%, 31rem); }
}
@media (max-width: 34rem) {
  .masthead-inner { flex-wrap: wrap; gap: .55rem; padding-block: .62rem; }
  .masthead nav { flex: 1 0 100%; order: 2; margin: 0; gap: 1.35rem; }
  .theme-button { margin-inline-start: auto; }
  .wordmark { font-size: 1.16rem; }
  .wordmark .brand-mark { width: 2rem; height: 2rem; }
  .guide-grid { grid-template-columns: minmax(0, 1fr); }
  .scroll-table table:has(thead th:nth-child(4)) { min-width: 26rem; }
  .panel-head { padding-block: .66rem; }
  .control.has-unit input { padding-inline-end: 3.2rem; }
  .unit { font-size: .72rem; }
}
@media (max-width: 23rem) {
  .wire-fields, .wire-fields:has([data-control="area"]:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-grid { grid-template-columns: minmax(0, 1fr); }
  .button { padding-inline: .65rem; }
}
@media print {
  :root, :root[data-theme] { color-scheme: light; }
  body { background: white; color: black; }
  .masthead, .footer, .skip-link, .export-bar, .breadcrumbs, .tool-head .button,
  .quiet-button, .add-wire, .result-jump, .article-aside, .live-indicator { display: none !important; }
  .frame { width: 100%; max-width: none; padding: 0; }
  .tool-head { margin: 0 0 .75rem; }
  .tool-head h1 { font-size: 24pt; }
  .workspace, .article-layout { display: block; }
  .worksheet-panel { margin: 0 0 .5rem; box-shadow: none; }
  .field-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .field, .readout-figure, .primary-result, tr, .result-facts > div { break-inside: avoid; }
  .readout-figure svg { width: min(100%, 19rem); }
  .control input, .control select { border-color: #aaa; color: black; background: white; }
  .article-section { margin-block: .7rem; }
}
