:root {
  color-scheme: light;
  --canvas: #f6f1e7;
  --paper: #fffdf8;
  --panel: #eee9dc;
  --indigo: #262642;
  --ink: #222339;
  --muted: #55576a;
  --rule: #d3ccbf;
  --rule-strong: #aba497;
  --grid: #e7e0d2;
  --vapor: #b45309;
  --vapor-strong: #a13b12;
  --vapor-pale: #f6e3c4;
  --liquid: #0f766e;
  --liquid-strong: #115e59;
  --liquid-pale: #d9ede6;
  --danger: #a33229;
  --danger-pale: #fbe9e2;
  --font: "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 0.75rem; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font: 1rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--liquid-strong); text-underline-offset: 0.19em; }
a:hover { color: var(--vapor-strong); }
:focus-visible { outline: 2px solid var(--liquid); outline-offset: 3px; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
p, dl, figure { margin: 0; }
h1, h2, h3 { margin: 0; line-height: 1.1; }
svg { display: block; max-width: 100%; }
.shell { width: min(1260px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: absolute; inset: 0 auto auto 1rem; transform: translateY(-130%); padding: 0.65rem 1rem; background: var(--paper); z-index: 5; }
.skip:focus { transform: none; }

.masthead { border-top: 4px solid var(--indigo); border-bottom: 1px solid var(--rule-strong); background: var(--paper); }
.mast-inner { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand { color: var(--indigo); display: inline-flex; align-items: center; gap: 9px; min-height: 44px; text-decoration: none; font-weight: 760; letter-spacing: -0.02em; }
.brand-mark { width: 31px; height: 32px; color: var(--indigo); }
.brand-mark .brand-vapor { stroke: var(--vapor); }
.brand-mark .brand-liquid { stroke: var(--liquid); }
.desktop-nav { display: flex; align-items: center; gap: 1.6rem; }
.desktop-nav a, .mobile-nav a { color: var(--muted); text-decoration: none; font-weight: 650; font-size: 0.88rem; }
.desktop-nav a:hover, .mobile-nav a:hover { color: var(--liquid-strong); text-decoration: underline; }
.mobile-nav { display: none; }
.mobile-nav summary { min-height: 42px; padding: 0.62rem 0; color: var(--indigo); font-size: 0.9rem; font-weight: 700; }

.hero { display: grid; grid-template-columns: 1.05fr 1fr; margin-top: 30px; border: 1px solid var(--rule-strong); background: var(--paper); }
.hero-copy { padding: clamp(1.6rem, 4.4vw, 4rem); align-self: center; }
.eyebrow, .section-code, .card-tag, .panel-code {
  color: var(--liquid-strong); font: 700 0.72rem/1.35 var(--mono); letter-spacing: 0.075em; text-transform: uppercase;
}
.hero h1 { margin: 0.85rem 0 1rem; font: 500 clamp(2.65rem, 5.1vw, 5rem)/0.99 var(--display); letter-spacing: -0.058em; color: var(--indigo); }
.hero p:not(.eyebrow) { max-width: 42ch; color: var(--muted); font-size: clamp(0.98rem, 1.2vw, 1.1rem); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1.05rem; margin-top: 1.5rem; }
.primary-link, .outline-link {
  min-height: 43px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0.55rem 0.88rem; gap: 0.45rem; text-decoration: none; font-weight: 700; font-size: 0.88rem; border: 1px solid var(--indigo);
}
.primary-link { color: var(--paper); background: var(--indigo); }
.primary-link:hover { background: var(--liquid-strong); border-color: var(--liquid-strong); color: white; }
.outline-link { color: var(--indigo); background: var(--paper); }
.outline-link:hover { border-color: var(--liquid); color: var(--liquid-strong); }
.hero-plate {
  display: grid; align-content: center; min-width: 0; padding: 22px 22px 16px; border-left: 1px solid var(--rule-strong);
  background-color: #f1ecdf;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 21px 21px;
}
.hero-svg { width: 100%; height: auto; margin-inline: auto; }
.plate-key { display: flex; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; border-top: 1px solid var(--rule-strong); padding-top: 9px; margin-top: 11px; font: 650 0.69rem/1.4 var(--mono); color: var(--muted); }
.key-phases { display: flex; gap: 13px; }
.key-phases span { display: inline-flex; align-items: center; gap: 5px; }
.phase-mark { display: inline-block; width: 12px; height: 3px; background: var(--liquid); }
.phase-mark.is-vapor { background: var(--vapor); }

.index-section, .examples-section { margin-top: 42px; }
.section-heading { display: flex; align-items: baseline; gap: 0.9rem 1.25rem; justify-content: space-between; margin-bottom: 15px; }
.section-heading h2, .reference h1, .missing h1 { font: 500 clamp(2rem, 4.4vw, 3.6rem)/1.05 var(--display); letter-spacing: -0.045em; color: var(--indigo); }
.section-heading p { max-width: 42ch; color: var(--muted); font-size: 0.9rem; }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-left: 1px solid var(--rule); border-top: 1px solid var(--rule); }
.tool-card {
  position: relative; display: flex; min-width: 0; min-height: 194px; flex-direction: column; align-items: start; gap: 6px;
  padding: 16px 15px 13px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  text-decoration: none; color: var(--ink); background: var(--paper);
}
.tool-card:hover { color: var(--ink); box-shadow: inset 0 -3px 0 var(--liquid); background: #fbfcf6; }
.tool-card-top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; }
.tool-glyph { color: var(--indigo); background-color: var(--panel); padding: 4px; flex-shrink: 0; }
.tool-card h3 { font-size: 1.02rem; margin: 3px 0; }
.tool-card p { font-size: 0.82rem; color: var(--muted); }
.card-method { margin-top: auto; padding-top: 4px; color: var(--liquid-strong); font: 600 0.65rem/1.45 var(--mono); }
.examples-section { margin-bottom: 45px; }
.example-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 10px; }
.example-index details { border: 1px solid var(--rule); background: var(--paper); min-width: 0; }
.example-index summary { padding: 0.72rem 0.9rem; min-height: 44px; color: var(--indigo); font-weight: 700; font-size: 0.9rem; }
.example-index summary span { float: right; color: var(--muted); font: 600 0.72rem/1.8 var(--mono); }
.example-index ul, .example-links, .source-links { margin: 0; padding-left: 1.2rem; }
.example-index ul { margin: 0 0.8rem 0.65rem; }
.example-index li, .example-links li, .source-links li { padding: 0.23rem 0; font-size: 0.9rem; }

.crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem 0.55rem; font-size: 0.78rem; color: var(--muted); margin: 18px 0 12px; }
.crumb a { color: var(--liquid-strong); }
.calc-head { display: flex; justify-content: space-between; align-items: end; gap: 0.8rem 1.1rem; padding: 0 0 16px; border-bottom: 1px solid var(--rule-strong); }
.calc-head h1 { margin: 5px 0 7px; color: var(--indigo); font: 500 clamp(2rem, 4.5vw, 3.75rem)/1.02 var(--display); letter-spacing: -0.043em; }
.calc-head p:not(.eyebrow) { color: var(--muted); max-width: 72ch; font-size: 0.95rem; }
.calc-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 0.55rem; }
.unit-switch { display: flex; border: 1px solid var(--rule-strong); background: var(--paper); }
.unit-switch button {
  background: transparent; border: 0; min-width: 53px; min-height: 42px; padding: 0.4rem 0.5rem;
  font: 700 0.81rem var(--mono); color: var(--indigo);
}
.unit-switch button + button { border-left: 1px solid var(--rule-strong); }
.unit-switch button[aria-pressed="true"] { color: white; background: var(--indigo); }
.mobile-jump { display: none; }
.case-context { background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--vapor); margin-top: 13px; padding: 9px 13px; font-size: 0.9rem; }
.workspace { display: grid; grid-template-columns: minmax(275px, 0.82fr) minmax(0, 1.7fr); gap: 13px; grid-template-areas: "inputs readout"; align-items: start; margin-top: 14px; }
.readout { grid-area: readout; display: grid; gap: 12px; min-width: 0; }
.inputs, .instrument-panel, .details-panel, .worked-panel, .equations, .related { border: 1px solid var(--rule-strong); background: var(--paper); min-width: 0; }
.inputs { grid-area: inputs; }
.panel-head { display: flex; gap: 0.4rem 0.8rem; align-items: baseline; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--rule); background: var(--panel); }
.panel-head h2 { font-size: 1rem; }
.panel-head p { color: var(--muted); font: 600 0.71rem/1.45 var(--mono); }
.form-region { margin: 0; padding: 9px 13px 14px; border: 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.form-region:last-child { border-bottom: 0; }
.form-region legend {
  float: left; width: 100%; margin: 2px 0 7px; padding: 0; color: var(--liquid-strong);
  font: 700 0.72rem/1.4 var(--mono); line-height: 1.45; text-transform: uppercase; letter-spacing: 0.035em;
}
.field-note { clear: both; color: var(--muted); font-size: 0.74rem; margin: 0 0 7px; }
.field-grid { clear: both; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 9px; }
.mixture-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.field-choice { grid-column: 1 / -1; }
.field label { display: block; color: var(--indigo); font-size: 0.78rem; line-height: 1.28; font-weight: 650; overflow-wrap: anywhere; }
.field small { color: var(--muted); font-size: 0.68rem; line-height: 1.3; }
.input-shell { min-width: 0; display: flex; align-items: center; background: white; border: 1px solid var(--rule-strong); }
.input-shell:focus-within { border-color: var(--liquid); outline: 2px solid var(--liquid); outline-offset: 1px; }
.input-shell input, .field select {
  min-height: 41px; min-width: 0; width: 100%; color: var(--ink); border: 1px solid var(--rule-strong);
  background-color: white; padding: 0.43rem 0.5rem; font-size: 0.93rem;
}
.input-shell input { border: 0; background: transparent; font-family: var(--mono); outline: 0; appearance: textfield; }
.input-shell input::-webkit-inner-spin-button, .input-shell input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.input-shell .unit { flex-shrink: 0; max-width: 51%; padding: 0 5px 0 0; color: var(--muted); font: 600 0.67rem/1.1 var(--mono); overflow-wrap: anywhere; }

.telemetry { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--rule-strong); }
.kpi { min-width: 0; padding: 10px clamp(7px, 1.1vw, 15px) 11px; border-right: 1px solid var(--rule); }
.kpi:last-child { border-right: 0; }
.kpi dt { color: var(--muted); font: 700 0.68rem/1.35 var(--mono); text-transform: uppercase; letter-spacing: 0.015em; }
.kpi dd {
  margin: 3px 0 0; color: var(--indigo); font: 650 clamp(1.07rem, 2.05vw, 1.7rem)/1.2 var(--mono);
  letter-spacing: -0.055em; overflow-wrap: anywhere;
}
.kpi:first-child dd { color: var(--liquid-strong); }
.kpi .unit { color: var(--muted); font-size: 0.65rem; letter-spacing: -0.02em; white-space: nowrap; }
.figure-title { display: flex; align-items: baseline; justify-content: space-between; gap: 5px 15px; flex-wrap: wrap; padding: 10px 14px 6px; }
.figure-title h2 { color: var(--indigo); font-size: 0.95rem; letter-spacing: -0.015em; }
.figure-title span { color: var(--muted); font: 600 0.64rem/1.3 var(--mono); text-transform: uppercase; }
.diagram {
  min-width: 0; background-color: #faf7ee;
  background-image: linear-gradient(#eee9dd 1px, transparent 1px), linear-gradient(90deg, #eee9dd 1px, transparent 1px);
  background-size: 16px 16px;
}
.diagram .process-svg { width: min(100%, 530px); height: auto; margin-inline: auto; }
.screening { border-top: 1px solid var(--rule-strong); padding: 10px 14px 11px; }
.screen-content { --state: var(--liquid-strong); }
.screen-content[data-level="watch"] { --state: var(--vapor-strong); }
.screen-content[data-level="danger"] { --state: var(--danger); }
.screen-content[data-level="idle"] { --state: var(--muted); }
.screen-state { display: flex; align-items: center; gap: 0.45rem; color: var(--state); font-size: 0.88rem; }
.indicator { background: currentColor; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; }
.screen-content p { color: var(--muted); font-size: 0.78rem; margin: 3px 0 8px; }
.screen-reading, .screen-scale { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; font: 600 0.68rem/1.35 var(--mono); color: var(--muted); }
.screen-reading strong { color: var(--state); white-space: nowrap; font-size: 0.77rem; }
.screen-track { width: 100%; height: 12px; margin: 3px 0 2px; overflow: hidden; }
.screen-rail { fill: var(--panel); }
.screen-fill { fill: var(--state); }
.screen-mark { stroke: var(--vapor-strong); stroke-width: 1.7; }
.screen-limit { stroke: var(--indigo); stroke-width: 1.7; }
.error { border: 1px solid var(--danger); color: var(--danger); background: var(--danger-pale); padding: 10px 13px; font-weight: 670; }
[data-result-status="invalid"] .instrument-panel, [data-result-status="invalid"] .details-panel, [data-result-status="invalid"] .worked-panel { opacity: 0.52; }

.action-bar { display: flex; min-width: 0; gap: 5px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--rule); background: var(--panel); }
.action-bar button {
  min-height: 41px; background: var(--paper); border: 1px solid var(--rule-strong); padding: 0.38rem 0.65rem;
  color: var(--indigo); font-size: 0.8rem; font-weight: 700;
}
.action-bar button:first-child { background: var(--indigo); color: white; border-color: var(--indigo); }
.action-bar button:hover:enabled { border-color: var(--liquid); box-shadow: inset 0 -2px 0 var(--liquid); }
.action-bar button:disabled { cursor: default; opacity: 0.4; }
.action-feedback:empty { display: none; }
.action-feedback, .share-box { color: var(--liquid-strong); font-size: 0.83rem; }
.share-box { display: grid; gap: 0.3rem; font-weight: 700; }
.share-box input { min-height: 42px; min-width: 0; border: 1px solid var(--rule-strong); padding: 0.4rem; font: 0.8rem var(--mono); background: var(--paper); color: var(--ink); }
table { width: 100%; border-collapse: collapse; }
table caption { padding: 10px 12px; text-align: left; font-weight: 750; border-bottom: 1px solid var(--rule); background: var(--panel); }
th, td { padding: 6px 12px; border-bottom: 1px solid var(--grid); }
th { text-align: left; }
.output-table th { color: var(--muted); font-size: 0.83rem; font-weight: 550; width: 61%; }
.output-table td, .mixture-output td { font: 650 0.84rem/1.35 var(--mono); text-align: right; overflow-wrap: anywhere; }
.output-table .unit { color: var(--muted); font-size: 0.72rem; }
.output-table tr:nth-child(even), .mixture-output tbody tr:nth-child(even) { background: #faf7ee; }
.output-table tr:last-child > * { border-bottom: 0; }
.mixture-output th { font-size: 0.76rem; }
.mixture-output thead th:not(:first-child) { text-align: right; }
.root-list { border-top: 1px solid var(--rule); padding: 7px 12px; font-size: 0.84rem; color: var(--muted); }
.root-list span { font-family: var(--mono); color: var(--ink); }
.print-basis { display: none; }
.worked-panel { padding: 12px 14px; }
.worked-panel h2 { margin-bottom: 4px; font-size: 1.05rem; }
.worked-panel ol { margin: 5px 0 6px; padding-left: 1.28rem; }
.worked-panel li { margin-top: 7px; font-size: 0.86rem; }
.worked-panel li p, .worked-panel > p { color: var(--muted); }
.worked-panel > p { margin-top: 8px; font-size: 0.8rem; }

.supplement { margin: 15px 0 42px; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(225px, 0.82fr); gap: 13px; align-items: start; }
.equations, .related { padding: 14px; }
.equations h2, .related h2, .reference section h2 { color: var(--indigo); font-size: 1.1rem; margin: 0 0 9px; }
.equations p, .reference section p { font-size: 0.86rem; color: var(--muted); margin: 8px 0 0; max-width: 85ch; }
.equations dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.equations dl div { padding: 8px; min-width: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: #faf7ee; }
.equations dt { font-size: 0.76rem; font-weight: 750; }
.equations dd { margin: 3px 0 0; font: 0.75rem/1.45 var(--mono); overflow-wrap: anywhere; }
.related p { font-size: 0.86rem; margin: 8px 0; }
.reference { margin-top: 30px; margin-bottom: 37px; max-width: 980px; }
.reference > p { color: var(--muted); margin-top: 10px; max-width: 70ch; }
.reference section { border: 1px solid var(--rule); background: var(--paper); padding: 15px 17px; margin-top: 12px; }
.reference code { font-family: var(--mono); font-size: 0.83em; }
.missing { margin: 55px auto; max-width: 650px; border: 1px solid var(--rule-strong); padding: clamp(18px, 5vw, 46px); background: var(--paper); }
.missing h1 { margin: 7px 0 12px; }
.missing p:not(.eyebrow) { margin: 0 0 19px; color: var(--muted); }
.site-footer { border-top: 1px solid var(--rule-strong); background: var(--paper); }
.footer-inner { display: flex; justify-content: space-between; align-items: baseline; gap: 10px 20px; flex-wrap: wrap; padding-block: 12px; font-size: 0.81rem; color: var(--muted); }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-inner a { display: inline-flex; align-items: center; min-height: 40px; }

.process-svg text { font-family: var(--mono); fill: var(--indigo); }
.process-svg .caption { font-size: 11px; font-weight: 750; letter-spacing: 0.025em; fill: var(--muted); }
.process-svg .label, .process-svg .legend { font-size: 11px; font-weight: 630; }
.process-svg .value { font-size: 14px; font-weight: 710; letter-spacing: -0.025em; }
.process-svg .tick { font-size: 10.8px; font-weight: 600; fill: var(--muted); }
.ink-line, .vessel-outline, .equipment-line, .vapor-line, .liquid-line, .stair-line, .dash-line,
.q-line, .dim-line, .grid-line, .axis, .mesh-line, .packing-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ink-line, .vessel-outline, .equipment-line { stroke: var(--indigo); stroke-width: 1.75; }
.vessel { fill: var(--paper); stroke: var(--indigo); stroke-width: 1.75; }
.vapor-line { stroke: var(--vapor); stroke-width: 2.25; }
.liquid-line { stroke: var(--liquid); stroke-width: 2.25; }
.stair-line { stroke: var(--indigo); stroke-width: 2.1; }
.dash-line { stroke: var(--muted); stroke-width: 1.15; stroke-dasharray: 5 4; }
.q-line { stroke: var(--vapor-strong); stroke-width: 1.25; stroke-dasharray: 4 4; }
.soft-dash { stroke-dasharray: 5 4; stroke-width: 1.5; }
.grid-line { stroke: var(--grid); stroke-width: 1; }
.axis, .dim-line { stroke: var(--rule-strong); stroke-width: 1.1; }
.plot-fill { fill: #fffdf8; }
.liquid-fill { fill: var(--liquid-pale); }
.vapor-fill { fill: var(--vapor-pale); }
.mesh-fill { fill: #e9e5df; }
.mesh-line, .packing-line { stroke: var(--liquid-strong); stroke-width: 1; }
.perforation, .dim-point { fill: var(--indigo); }
.vapor-point { fill: var(--vapor); stroke: var(--paper); stroke-width: 1; }
.liquid-point { fill: var(--liquid); stroke: var(--paper); stroke-width: 1; }
.operating-point { fill: var(--indigo); stroke: var(--paper); stroke-width: 1.6; }
.instrument { fill: var(--paper); stroke: var(--indigo); stroke-width: 1.2; }
.tip { stroke: none; }
.tip.vapor-line { fill: var(--vapor); }
.tip.liquid-line { fill: var(--liquid); }
.tip.equipment-line { fill: var(--indigo); }

@media (max-width: 1030px) {
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .shell { width: calc(100% - 30px); }
  .mast-inner { min-height: 54px; }
  .desktop-nav { display: none; }
  .mobile-nav { display: block; }
  .mobile-nav nav {
    position: absolute; z-index: 3; right: 15px; top: 55px; display: grid; min-width: 180px; padding: 4px 9px;
    border: 1px solid var(--rule-strong); background: var(--paper); box-shadow: 0 7px 15px #2223391a;
  }
  .mobile-nav a { display: flex; align-items: center; min-height: 42px; padding: 0 4px; }
  .hero { grid-template-columns: 1fr; margin-top: 14px; }
  .hero-copy { padding: 19px 17px 20px; }
  .hero h1 { font-size: clamp(2.45rem, 10vw, 4.35rem); }
  .hero-actions { margin-top: 0.95rem; }
  .hero-plate { border-left: 0; border-top: 1px solid var(--rule-strong); padding: 10px 8px 9px; }
  .hero-svg { max-width: 520px; }
  .plate-key { padding-inline: 6px; }
  .index-section, .examples-section { margin-top: 28px; }
  .section-heading { display: block; margin-bottom: 10px; }
  .section-heading p { margin-top: 6px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-card { padding-inline: 10px; }
  .tool-card .card-tag { font-size: 0.59rem; overflow-wrap: anywhere; }
  .example-index { grid-template-columns: minmax(0, 1fr); }
  .crumb { margin: 12px 0 8px; }
  .calc-head { display: block; padding-bottom: 10px; }
  .calc-head h1 { font-size: clamp(1.95rem, 8.3vw, 3.45rem); }
  .calc-head p:not(.eyebrow) { font-size: 0.86rem; }
  .calc-tools { margin-top: 8px; justify-content: space-between; }
  .mobile-jump { display: inline-flex; align-items: center; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-areas: "readout" "inputs"; gap: 10px; margin-top: 9px; }
  .readout { gap: 8px; }
  .kpi { padding: 8px 5px 8px 7px; }
  .kpi dt { font-size: 0.59rem; }
  .kpi dd { font-size: clamp(0.95rem, 4.5vw, 1.36rem); }
  .kpi .unit { display: block; margin-top: 2px; font-size: 0.61rem; overflow-wrap: anywhere; white-space: normal; }
  .figure-title { padding: 7px 8px 5px; }
  .figure-title h2 { font-size: 0.82rem; }
  .figure-title span { font-size: 0.58rem; }
  .screening { padding: 8px 9px; }
  .screen-content p { font-size: 0.74rem; }
  .screen-reading, .screen-scale { font-size: 0.61rem; }
  .action-bar { padding: 6px; gap: 4px; }
  .action-bar button { min-height: 41px; padding-inline: 0.5rem; }
  .output-table th, .output-table td { padding: 6px 8px; font-size: 0.77rem; }
  .mixture-output th, .mixture-output td { padding-inline: 6px; font-size: 0.73rem; }
  .supplement { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 10px; }
}

@media (max-width: 350px) {
  .shell { width: calc(100% - 22px); }
  .tool-card-top { flex-wrap: wrap; gap: 4px; }
  .kpi dt { font-size: 0.55rem; }
  .field-grid { column-gap: 6px; }
  .field label { font-size: 0.72rem; }
  .input-shell .unit { font-size: 0.58rem; }
}

@page { size: A4 portrait; margin: 11mm 12mm; }

@media print {
  :root, body { background: white; color: #171927; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .shell { width: auto; max-width: none; margin: 0; }
  .masthead, .site-footer, .skip, .crumb, .calc-tools, .inputs, .action-bar, .action-feedback,
  .share-box, .supplement, .worked-panel, .case-context, .error[hidden] { display: none !important; }
  .calc-head { display: block; padding: 0 0 8px; }
  .calc-head h1 { font-size: 25pt; }
  .calc-head p:not(.eyebrow) { display: none; }
  .workspace { display: block; margin-top: 6pt; }
  .readout { display: block; }
  .instrument-panel, .details-panel, .print-basis { break-inside: avoid; margin-bottom: 6pt; }
  .telemetry { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi { padding: 5px 8px; }
  .kpi dt { font-size: 7.4pt; }
  .kpi dd { font-size: 15pt; }
  .kpi .unit { display: inline; font-size: 7pt; }
  .figure-title { padding: 5px 8px; }
  .figure-title h2 { font-size: 9pt; }
  .diagram .process-svg { width: 308px; height: auto; }
  .screening { padding: 4px 8px; }
  .screen-state { font-size: 8pt; }
  .screen-content p { font-size: 7.5pt; margin: 1px 0 3px; }
  .screen-reading, .screen-scale { font-size: 6.8pt; }
  .screen-track { height: 7px; margin: 1px 0; }
  table caption { padding: 3px 7px; font-size: 8pt; }
  .output-table th, .output-table td, .mixture-output th, .mixture-output td { padding: 1.6px 7px; font-size: 7.4pt; line-height: 1.2; }
  .output-table .unit { font-size: 6.9pt; }
  .root-list { padding: 1.6px 7px; font-size: 7.4pt; line-height: 1.2; }
  .print-basis { display: block; padding: 4px 7px; border: 1px solid #b9b4a6; }
  .print-basis h2 { font-size: 8pt; margin-bottom: 3px; }
  .print-basis dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 8px; }
  .print-basis dt { font-size: 6.8pt; color: #49495a; }
  .print-basis dd { margin: 0; font: 7.1pt/1.15 var(--mono); overflow-wrap: anywhere; }
}

.back-to-readout { margin: 0 12px 12px; }
