:root {
  color-scheme: light;
  --canvas: #faf9f6;
  --paper: #fffefa;
  --panel: #f1efe9;
  --ink: #161922;
  --muted: #54595c;
  --line: #d3cfc4;
  --grid: #e4e1d9;
  --teal: #0f5c6e;
  --teal-soft: #e3efec;
  --button-ink: #fffdf6;
  --load: #c2410c;
  --load-soft: #f7e4d6;
  --crimson: #b91c1c;
  --crimson-soft: #f7e3e1;
  --accent-secondary: #52637d;
  --sans: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --wrap: 1312px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #191c21;
  --paper: #20252a;
  --panel: #282d31;
  --ink: #f1eee5;
  --muted: #bcc2bf;
  --line: #454b4c;
  --grid: #353d40;
  --teal: #83c8cf;
  --teal-soft: #233d42;
  --button-ink: #132326;
  --load: #f5a781;
  --load-soft: #47342d;
  --crimson: #ff9b9b;
  --crimson-soft: #4c2b2f;
  --accent-secondary: #a4b4d6;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.1; }
h2 { letter-spacing: -.035em; }
a { color: var(--teal); }
button, input, select { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
.wrap { width: min(calc(100% - 88px), var(--wrap)); margin-inline: auto; }
.skip {
  position: fixed;
  z-index: 10;
  top: 10px;
  left: 10px;
  transform: translateY(-200%);
  background: var(--paper);
  padding: 10px 16px;
}
.skip:focus { transform: none; }
.button, .quiet-button, .export-menu > summary, .nav-dropdown > summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 4px;
  font-weight: 650;
  font-size: .86rem;
  padding: 9px 14px;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
  text-decoration: none;
}
.primary-button {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--button-ink);
  padding-inline: 17px;
}
.primary-button:hover { filter: brightness(1.12); }
.quiet-button:hover, .export-menu > summary:hover, .nav-dropdown > summary:hover { border-color: var(--teal); }
.text-link { text-underline-offset: 4px; font-size: .92rem; font-weight: 650; }

.topbar { border-bottom: 1px solid var(--line); background: var(--canvas); }
.topbar-inner { display: flex; align-items: center; gap: 28px; min-height: 70px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.19rem;
  font-weight: 750;
  letter-spacing: -.055em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.brand > span > span { color: var(--teal); }
.brand img { display: block; flex: 0 0 auto; }
.desktop-nav { display: flex; gap: clamp(20px, 3.5vw, 51px); margin-left: auto; align-items: center; }
.desktop-nav a, .footer-inner nav a, .nav-dropdown nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 650;
}
.desktop-nav a:hover, .footer-inner nav a:hover, .desktop-nav a[aria-current="page"] { color: var(--teal); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.theme-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--teal);
  border-radius: 4px;
}
.theme-button:hover { border-color: var(--teal); }
.theme-button span, .theme-button svg { display: block; }
:root[data-theme="light"] .sun-icon, :root[data-theme="dark"] .moon-icon { display: none; }
.nav-dropdown { display: none; }
.nav-dropdown, .export-menu { position: relative; }
.nav-dropdown summary::-webkit-details-marker, .export-menu summary::-webkit-details-marker { display: none; }
.nav-dropdown > summary::after, .export-menu > summary::after {
  content: "";
  height: 6px;
  width: 6px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-2px);
}
.nav-dropdown[open] > summary::after, .export-menu[open] > summary::after { transform: rotate(225deg); }
.nav-dropdown nav, .export-options {
  position: absolute;
  z-index: 4;
  min-width: 148px;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  gap: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 8px 18px #171b2425;
  padding: 4px;
}
.nav-dropdown nav a, .export-options button {
  display: flex;
  align-items: center;
  text-align: left;
  padding: 8px 11px;
  min-height: 41px;
  white-space: nowrap;
}
.nav-dropdown nav a:hover, .export-options button:hover:enabled { background: var(--panel); color: var(--teal); }
.export-options button { border: 0; background: transparent; font-size: .87rem; font-weight: 650; }

.home-hero { border-bottom: 1px solid var(--line); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.07fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(36px, 5.5vw, 86px);
  padding-block: clamp(42px, 5.7vw, 88px);
}
.eyebrow, .sheet-id, .tool-category {
  color: var(--teal);
  font-family: var(--mono);
  font-weight: 650;
  font-size: .75rem;
  letter-spacing: .085em;
  line-height: 1.5;
  text-transform: uppercase;
}
.hero-copy h1 {
  margin-top: 17px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3.6rem, 6.3vw, 6.15rem);
  letter-spacing: -.073em;
  line-height: .98;
}
.hero-copy h1 em { color: var(--teal); font-weight: 500; }
.hero-intro {
  font-size: clamp(1.01rem, 1.55vw, 1.28rem);
  color: var(--muted);
  max-width: 490px;
  margin-top: 24px;
  line-height: 1.53;
}
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 23px; margin-top: 27px; }
.hero-figure {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  min-width: 0;
}
.hero-drawing { display: block; width: 100%; height: auto; }
.hero-figure figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 16px;
  border-top: 1px solid var(--line);
  padding: 10px 15px;
  color: var(--muted);
  font-size: .76rem;
  font-family: var(--mono);
}
.draft-grid, .draft-guide, .draft-thin, .draft-frame, .draft-force, .draft-spectrum { fill: none; }
.draft-grid { stroke: var(--grid); stroke-width: .8; }
.draft-guide { stroke: var(--teal); stroke-width: .8; stroke-dasharray: 4 5; opacity: .65; }
.draft-thin { stroke: var(--muted); stroke-width: .9; opacity: .74; }
.draft-wash { fill: var(--teal-soft); opacity: .78; }
.draft-frame { stroke: var(--teal); stroke-width: 1.75; }
.draft-force { stroke: var(--load); stroke-width: 2.4; }
.draft-spectrum { stroke: var(--teal); stroke-width: 2.5; }
.draft-point { fill: var(--load); stroke: var(--panel); stroke-width: 1.25; }
.draft-strong, .draft-text { font-family: var(--mono); fill: var(--muted); font-size: 10.5px; letter-spacing: .075em; }
.draft-strong { font-size: 12px; font-weight: 700; fill: var(--ink); }

.home-tools { padding-block: 40px 0; scroll-margin-top: 20px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px 24px; margin-bottom: 18px; }
.section-title h2, .reference-strip h2 { font-size: clamp(1.65rem, 3vw, 2.15rem); font-weight: 720; }
.section-title p { color: var(--muted); font-size: .92rem; font-family: var(--mono); }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tool-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 211px;
  gap: 8px;
  padding: 18px 20px 14px;
  border: solid var(--line);
  border-width: 0 1px 1px 0;
  background: var(--paper);
  text-decoration: none;
  color: var(--ink);
}
.tool-card h3 { font-size: 1.12rem; letter-spacing: -.035em; }
.tool-card p, .reference-strip p { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.tool-card:hover { background: var(--teal-soft); }
.tool-card:focus-visible { z-index: 1; }
.tool-go { justify-self: end; color: var(--teal); }
.tool-go svg { display: block; }
.reference-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 19px;
  padding: 23px 26px;
  background: var(--panel);
  border-block: 1px solid var(--line);
  margin-block: 35px 52px;
}
.reference-strip h2 { font-size: 1.42rem; margin-bottom: 5px; }
.site-footer { border-top: 1px solid var(--line); padding-block: 24px 34px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 28px; }
.footer-inner p { color: var(--muted); font-size: .8rem; margin-top: 7px; }
.footer-inner nav { display: flex; align-items: center; gap: 7px 21px; flex-wrap: wrap; }

.calc-page, .editorial-page { padding-top: 21px; padding-bottom: 52px; }
.crumb { margin-bottom: 21px; }
.crumb ol { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0; padding: 0; list-style: none; }
.crumb li { color: var(--muted); font-size: .79rem; }
.crumb li + li::before { content: "/"; color: var(--muted); margin-inline: 9px; }
.crumb a { color: var(--teal); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.page-heading { margin-bottom: 24px; }
.page-heading h1, .not-found h1 {
  font-family: var(--serif);
  font-size: clamp(2.15rem, 4.35vw, 4.3rem);
  font-weight: 500;
  letter-spacing: -.063em;
  line-height: 1.05;
  max-width: 1140px;
  overflow-wrap: anywhere;
}
.page-heading .eyebrow { margin-bottom: 7px; }
.page-heading p:not(.eyebrow), .not-found p:not(.eyebrow) { color: var(--muted); max-width: 790px; margin-top: 10px; }

.worksheet {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
}
.worksheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  padding: 9px 15px;
  border-radius: 5px 5px 0 0;
}
.sheet-id { display: flex; align-items: center; gap: 10px; }
.sheet-mark {
  display: inline-block;
  width: 11px;
  height: 12px;
  border: 1px solid currentColor;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, currentColor 3px 4px);
  flex: 0 0 auto;
}
.worksheet-actions, .unit-switch { display: flex; align-items: center; gap: 7px; }
.unit-switch { gap: 0; }
.unit-switch button {
  background: var(--paper);
  color: var(--muted);
  border: 1px solid var(--line);
  min-width: 43px;
  min-height: 44px;
  font-size: .79rem;
  font-weight: 720;
  font-family: var(--mono);
}
.unit-switch button:first-child { border-radius: 4px 0 0 4px; }
.unit-switch button:last-child { border-radius: 0 4px 4px 0; border-left: 0; }
.unit-switch button[aria-pressed="true"] { background: var(--teal-soft); color: var(--teal); }
.worksheet-grid {
  display: grid;
  grid-template-columns: minmax(288px, .86fr) minmax(0, 1.8fr);
  grid-template-rows: auto auto 1fr;
  grid-template-areas: "inputs summary" "inputs figures" "inputs detail";
}
.worksheet-grid > * { min-width: 0; }
.inputs { grid-area: inputs; border-right: 1px solid var(--line); padding: 15px 17px 18px; }
.sheet-heading { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.sheet-heading h2, .details-panel h2 { font-size: 1.25rem; }
.reset-button {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: .82rem;
  font-weight: 650;
  padding: 5px 4px;
}
fieldset { border: 0; padding: 9px 0 0; margin: 10px 0 19px; min-width: 0; }
fieldset legend {
  padding: 0;
  font-weight: 720;
  font-size: .8rem;
  line-height: 1.4;
  color: var(--teal);
}
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.field { min-width: 0; }
.field:has([name="system"], [name="method"], [name="enclosure"], [name="exposure"], [name="obstruction"]) { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 4px; font-size: .81rem; font-weight: 630; line-height: 1.25; }
.field-control { position: relative; }
.field-control span {
  position: absolute;
  inset: 0 9px 0 auto;
  display: flex;
  align-items: center;
  color: var(--muted);
  pointer-events: none;
  font-size: .69rem;
  font-family: var(--mono);
  white-space: nowrap;
}
.field-control input, .field-control select, .share-dialog input {
  min-width: 0;
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--canvas);
  padding: 6px 9px;
  font-size: .97rem;
}
.field-control input { font: 600 .9rem var(--mono); }
.field-control.has-unit input { padding-right: 3.5rem; }
.field-control:has([name="mass"]) input { padding-right: 4.62rem; }
.field-control input::-webkit-inner-spin-button, .field-control input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.field-control select { padding-right: 18px; }
.field-help { color: var(--muted); font-size: .71rem; line-height: 1.4; margin-top: 5px; }
.advanced { border-top: 1px solid var(--line); padding-top: 5px; }
.advanced summary, .reference-details summary {
  font-weight: 700;
  min-height: 42px;
  padding-block: 9px;
  color: var(--teal);
  font-size: .87rem;
}
.advanced > p, .inputs noscript p { font-size: .76rem; color: var(--muted); }

.summary { grid-area: summary; padding: 16px 17px 0; }
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: solid var(--line);
  border-width: 1px 0 1px 1px;
}
.metric {
  min-width: 0;
  min-height: 89px;
  background: var(--canvas);
  border-right: 1px solid var(--line);
  padding: 10px 12px;
}
.metric:first-child { box-shadow: inset 0 3px 0 var(--teal); }
.metric dt {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 650;
  letter-spacing: .052em;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.metric dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 5px; margin-top: 8px; }
.metric-value {
  font-family: var(--mono);
  font-size: clamp(1.12rem, 1.8vw, 1.65rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}
.metric-word { font-family: var(--sans); font-size: clamp(1rem, 1.5vw, 1.32rem); letter-spacing: -.035em; }
.metric-unit { color: var(--muted); font-size: .74rem; font-family: var(--mono); overflow-wrap: anywhere; }
.metric-ok { background: var(--teal-soft); }
.metric-caution { background: var(--load-soft); }
.metric-fail { background: var(--crimson-soft); }
.metric-ok .metric-value { color: var(--teal); }
.metric-caution .metric-value { color: var(--load); }
.metric-fail .metric-value { color: var(--crimson); }
.notices:empty, .action-status:empty { display: none; }
.notices { display: grid; gap: 6px; margin-top: 10px; }
.notice, .invalid {
  background: var(--panel);
  border-inline-start: 3px solid var(--line);
  padding: 7px 10px;
  font-size: .77rem;
}
.notice strong { color: var(--ink); font-size: .8rem; }
.notice p { margin-top: 1px; color: var(--muted); }
.notice-caution { background: var(--load-soft); border-color: var(--load); }
.notice-fail, .invalid { background: var(--crimson-soft); border-color: var(--crimson); }
.notice-ok { background: var(--teal-soft); border-color: var(--teal); }
.invalid { margin-top: 10px; color: var(--crimson); font-weight: 700; }
.action-status { color: var(--teal); margin-top: 7px; font-size: .8rem; }

.sheet-figure {
  grid-area: figures;
  margin: 13px 17px 0;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 4px;
  overflow: hidden;
}
.schematic { display: block; width: 100%; height: auto; }
.sheet-figure figcaption { padding: 9px 12px 11px; font-size: .76rem; color: var(--muted); border-top: 1px solid var(--line); }
.empty-figure { min-height: 144px; display: grid; place-content: center; padding: 17px; color: var(--muted); }
.schematic text { fill: var(--ink); font-family: var(--sans); font-variant-numeric: tabular-nums; }
.schematic .svg-title { font-size: 15.4px; font-weight: 720; }
.schematic .svg-note { font-size: 12.2px; font-weight: 560; }
.schematic .svg-small { font-size: 10.6px; fill: var(--muted); }
.schematic .svg-number { font-size: 11.85px; font-weight: 650; font-family: var(--mono); fill: var(--teal); }
.panel-bg { fill: var(--paper); stroke: var(--line); stroke-width: 1; }
.ink, .grid, .dim, .plate, .guide, .accent, .load, .load-dash, .inside, .muted-curve, .data-curve, .fail-stroke, .wall-x, .wall-y, .gap {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.ink { stroke: var(--ink); stroke-width: 1.5; }
.grid { stroke: var(--grid); stroke-width: 1; }
.dim { stroke: var(--muted); stroke-width: .9; opacity: .83; }
.guide { stroke: var(--muted); stroke-dasharray: 5 4; stroke-width: 1; }
.accent, .plate { stroke: var(--teal); stroke-width: 1.7; }
.accent-head, .inside-head { fill: var(--teal); }
.load, .load-dash { stroke: var(--load); stroke-width: 2; }
.load-dash { stroke-dasharray: 4 4; }
.load-head, .active-dot { fill: var(--load); }
.active-dot { stroke: var(--paper); stroke-width: 1.4; }
.accent-dot, .data-bar { fill: var(--teal); }
.inside { stroke: var(--teal); stroke-width: 1.25; stroke-dasharray: 4 3; }
.muted-curve { stroke: var(--muted); stroke-width: 1.7; stroke-dasharray: 4 3; }
.data-curve { stroke: var(--teal); stroke-width: 2.3; }
.beam, .band { fill: var(--teal-soft); }
.beam { stroke: var(--teal); stroke-width: 1.3; }
.hot-band, .hot-shape { fill: var(--load-soft); }
.hot-shape { stroke: var(--load); stroke-width: 1.35; }
.bar-bg { fill: var(--panel); }
.fail-band { fill: var(--crimson-soft); }
.fail-stroke { stroke: var(--crimson); stroke-width: 1.5; }
.wall-x, .wall-y { stroke: var(--teal); stroke-width: 5; }
.wall-y { stroke: var(--accent-secondary); }
.gap { stroke: var(--paper); stroke-width: 6; }
.cr-dot { fill: var(--paper); stroke: var(--teal); stroke-width: 2; }

.details-panel { grid-area: detail; padding: 17px; }
.details-panel h2 { margin-bottom: 10px; }
.result-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.result-rows div, .print-values div { display: flex; align-items: baseline; justify-content: space-between; min-width: 0; gap: 6px; }
.result-rows div { padding: 4px 0; border-bottom: 1px solid var(--grid); }
.result-rows dt { color: var(--muted); font-size: .77rem; }
.result-rows dd { font: 650 .76rem/1.35 var(--mono); text-align: right; overflow-wrap: anywhere; }
.table-block { margin-top: 16px; }
table { width: 100%; border-collapse: collapse; table-layout: auto; font-size: .76rem; }
caption { text-align: left; font-size: .89rem; font-weight: 720; padding-bottom: 6px; }
th, td { border: 1px solid var(--line); padding: 5px 6px; vertical-align: top; overflow-wrap: anywhere; }
thead { background: var(--panel); }
th { text-align: left; }
td { text-align: right; font-family: var(--mono); }
.cell-label { display: none; }

.explain-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .95fr); gap: clamp(24px, 4.8vw, 70px); margin-top: 31px; }
.methods { max-width: 760px; min-width: 0; }
.methods > h2, .examples-section > h2, .editorial-tools > h2 { font-size: 1.45rem; margin-bottom: 13px; }
.methods section { margin-bottom: 19px; }
.methods h3 { margin-bottom: 6px; font-size: 1.02rem; }
.methods p { color: var(--muted); font-size: .91rem; }
.example-reading, .scope-note { background: var(--panel); border-left: 3px solid var(--teal); padding: 10px 13px 12px; }
.example-reading h2 { font-size: 1.03rem; letter-spacing: -.02em; margin-bottom: 6px; }
.example-reading p + p { margin-top: 6px; }
.scope-note { border-left-color: var(--load); }
.reference-details { border-top: 1px solid var(--line); }
.reference-details ul { margin: 0 0 12px; padding-left: 20px; }
.reference-details li { font-size: .84rem; margin-block: 5px; }
.reference-details li span { display: block; color: var(--muted); overflow-wrap: anywhere; font: .71rem/1.4 var(--mono); }
.examples-section ul, .editorial-tools ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.examples-section a, .editorial-tools a {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  border-bottom: 1px solid var(--line);
  padding: 8px 3px;
  font-size: .89rem;
  font-weight: 640;
  text-decoration: none;
}
.examples-section a:hover, .editorial-tools a:hover { text-decoration: underline; text-underline-offset: 3px; }
.examples-section svg, .editorial-tools svg { flex: 0 0 auto; }

.share-dialog {
  width: min(calc(100% - 28px), 480px);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 16px 20px;
}
.share-dialog::backdrop { background: #1419218a; }
.share-dialog p { color: var(--muted); font-size: .88rem; margin-block: 9px; }
.share-dialog label { display: block; margin-bottom: 5px; font-size: .82rem; font-weight: 700; }
.share-dialog input { font-family: var(--mono); }
.share-dialog [data-action="copy"] { margin-top: 10px; }
.share-dialog [data-copy-status]:empty { display: none; }
.not-found { min-height: 80vh; display: grid; align-items: center; padding-block: 40px; }
.not-found .button { margin-top: 23px; }
.print-sheet { display: none; }

@media (max-width: 1050px) {
  .wrap { width: calc(100% - 52px); }
  .hero-grid { gap: 32px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-card { min-height: 158px; }
  .result-rows { grid-template-columns: 1fr; }
}

@media (max-width: 740px) {
  .wrap { width: calc(100% - 30px); }
  .topbar-inner { min-height: 60px; gap: 10px; justify-content: space-between; }
  .brand { font-size: 1.1rem; }
  .brand img { width: 30px; height: 30px; }
  .desktop-nav { display: none; }
  .nav-dropdown { display: block; }
  .hero-grid { grid-template-columns: 1fr; padding-block: 37px 26px; gap: 24px; }
  .hero-copy h1 { font-size: clamp(3.18rem, 13vw, 5rem); margin-top: 12px; }
  .hero-intro { margin-top: 17px; }
  .hero-actions { margin-top: 18px; }
  .home-tools { padding-top: 27px; }
  .section-title { flex-wrap: wrap; gap: 3px 10px; }
  .section-title p { font-size: .76rem; }
  .tool-card { padding: 12px 12px 9px; gap: 6px; }
  .tool-card h3 { font-size: .98rem; }
  .tool-card p { font-size: .78rem; }
  .tool-category { font-size: .67rem; }
  .reference-strip { flex-wrap: wrap; padding: 16px 12px; margin-block: 25px 34px; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
  .calc-page, .editorial-page { padding-top: 14px; padding-bottom: 37px; }
  .page-heading { margin-bottom: 18px; }
  .page-heading p:not(.eyebrow) { font-size: .92rem; }
  .crumb { margin-bottom: 13px; }
  .crumb li { font-size: .73rem; }
  .worksheet-bar { justify-content: flex-end; gap: 6px; flex-wrap: wrap; padding: 6px 9px; }
  .sheet-id { margin-right: auto; font-size: .62rem; gap: 5px; }
  .sheet-mark { width: 9px; height: 10px; }
  .worksheet-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "summary" "inputs" "figures" "detail"; }
  .summary { padding: 10px 10px 0; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom-width: 0; }
  .metric { border-bottom: 1px solid var(--line); min-height: 61px; padding: 8px 9px; }
  .metric dd { margin-top: 4px; }
  .metric-value { font-size: 1.14rem; }
  .metric-word { font-size: 1rem; }
  .inputs { border-right: 0; padding: 10px 10px 4px; }
  .field-control input, .field-control select, .share-dialog input { font-size: 16px; }
  .sheet-figure { margin: 9px 10px 0; }
  .sheet-figure [data-diagram] { max-width: 475px; margin-inline: auto; }
  .details-panel { padding: 13px 10px; }
  .table-block table, .table-block tbody { display: block; }
  .table-block thead {
    position: absolute;
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
  .table-block caption { display: block; }
  .table-block tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); margin-bottom: 6px; }
  .table-block tbody th { display: block; grid-column: 1 / -1; background: var(--panel); border: 0; padding: 4px 7px; }
  .table-block td { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1px 4px; border-width: 0 0 1px; padding: 4px 5px; }
  .table-block td:nth-child(even) { border-right: 1px solid var(--line); }
  .cell-label { display: inline; font: 600 .68rem/1.25 var(--sans); color: var(--muted); }
  .explain-grid { grid-template-columns: 1fr; gap: 21px; margin-top: 23px; }
}

@media (max-width: 365px) {
  .wrap { width: calc(100% - 24px); }
  .topbar-inner { gap: 6px; }
  .topbar .brand { font-size: .98rem; gap: 7px; }
  .topbar .brand img { width: 27px; height: 27px; }
  .nav-actions { gap: 5px; }
  .nav-dropdown > summary { gap: 7px; padding-inline: 9px; }
  .hero-actions { gap: 12px; }
  .sheet-id { display: none; }
  .worksheet-actions { justify-content: space-between; width: 100%; }
  .field-control.has-unit input { padding-right: 2.4rem; }
  .field-control:has([name="mass"]) input { padding-right: 4.0rem; }
  .tool-card p { font-size: .75rem; }
}

@page { size: A4 portrait; margin: 12mm; }
@media print {
  :root, :root[data-theme="dark"] {
    color-scheme: light;
    --canvas: #fff;
    --paper: #fff;
    --panel: #f1efe9;
    --ink: #161922;
    --muted: #444a4c;
    --line: #c3c0b8;
    --grid: #dedcd5;
    --teal: #0f5c6e;
    --teal-soft: #e3efec;
    --load: #9e350a;
    --load-soft: #f7e4d6;
    --crimson: #b91c1c;
    --crimson-soft: #f7e3e1;
    --accent-secondary: #52637d;
  }
  * { print-color-adjust: exact; }
  .screen-root { display: none !important; }
  body { font-size: 9pt; line-height: 1.32; }
  .print-sheet { display: block; }
  .print-sheet header { border-bottom: 1px solid var(--teal); padding-bottom: 3mm; margin-bottom: 3mm; }
  .print-sheet header span { color: var(--teal); font-weight: 760; }
  .print-sheet header p { float: right; margin: 0; font-size: 8pt; }
  .print-sheet h1 { font: 500 22pt/1.08 var(--serif); margin-top: 2mm; }
  .print-sheet h2 { font-size: 9pt; margin-bottom: 1.1mm; }
  .print-sheet h3 { font-size: 10pt; margin-bottom: 1mm; }
  .print-sheet section { margin-top: 2.8mm; break-inside: avoid; }
  .print-sheet li { margin-bottom: 1mm; }
  .print-unit { color: var(--muted); font-size: 8pt; }
  .print-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 4mm; }
  .print-values div { border-top: 1px solid var(--grid); padding-block: .75mm; }
  .print-values dt { font-size: 7.1pt; color: var(--muted); }
  .print-values dd { font-size: 7.2pt; font-weight: 700; text-align: right; }
  .print-values dt, .print-values dd { overflow-wrap: anywhere; }
  .print-figure { margin-top: 3mm; border: 1px solid var(--line); background: var(--panel); break-inside: avoid; }
  .print-figure .schematic { width: 100%; }
  .print-sheet .table-block { margin-top: 2mm; break-inside: avoid; }
  .print-sheet table { display: table; font-size: 7pt; }
  .print-sheet caption { display: table-caption; font-size: 7.6pt; padding-bottom: .6mm; }
  .print-sheet thead { display: table-header-group; position: static; width: auto; height: auto; clip-path: none; }
  .print-sheet tbody { display: table-row-group; }
  .print-sheet tr { display: table-row; }
  .print-sheet tr > :is(th, td) { display: table-cell; border: 1px solid var(--line); padding: .25mm .9mm; }
  .print-sheet .cell-label { display: none; }
  .print-notices { margin: 2mm 0; padding-left: 5mm; }
  .print-sheet > footer { margin-top: 3mm; border-top: 1px solid var(--line); padding-top: 1.8mm; color: var(--muted); font-size: 7.8pt; }
}
