:root {
  color-scheme: light;
  --page: #eeeae0;
  --paper: #fcfaf5;
  --recess: #e5e0d4;
  --ink: #243332;
  --muted: #51605d;
  --line: #cfcabd;
  --line-strong: #a39f93;
  --iron: #253534;
  --rust: #934628;
  --amber: #f2b976;
  --amber-wash: #fbebd5;
  --teal: #0c655f;
  --teal-wash: #dcebe4;
  --tank: #596661;
  --warn: #84391e;
  --warn-bg: #fbe5d8;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --system: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 0; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--page); color: var(--ink); font: 1rem/1.55 var(--system); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
img, svg { max-width: 100%; }
figure, h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.14; }
a { color: var(--teal); text-underline-offset: .18em; }
a:hover { color: var(--rust); }
:where(a, button, input, select):focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
code { font-family: var(--mono); font-size: .89em; }
.site-width { width: min(82rem, calc(100% - 5rem)); margin-inline: auto; }

.skip {
  position: absolute; z-index: 3; inset: .5rem auto auto .5rem;
  transform: translateY(-150%); background: var(--paper); padding: .6rem 1rem; border-radius: .25rem;
}
.skip:focus { transform: none; }
.site-header { background: var(--iron); color: var(--paper); border-bottom: 3px solid #bd7c50; }
.header-width {
  width: min(82rem, calc(100% - 5rem)); min-height: 4.35rem; margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: .64rem; font-size: 1.22rem; font-weight: 770; letter-spacing: -.035em; }
.brand img { display: block; flex: none; }
.site-header a { color: var(--paper); text-decoration: none; }
.site-header a:hover { color: var(--amber); }
.site-header a:focus-visible { outline-color: var(--amber); }
.site-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: clamp(.7rem, 3vw, 2rem); }
.site-header nav a { font-size: .9rem; font-weight: 590; }
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; background: var(--recess); color: var(--muted); }
.footer-width { min-height: 4.35rem; display: flex; gap: 1rem 1.45rem; align-items: center; flex-wrap: wrap; padding-block: .75rem; }
.footer-width span { font-weight: 740; color: var(--iron); margin-right: auto; }
.footer-width a { font-size: .875rem; }

.hero {
  display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  gap: clamp(1.5rem, 4.5vw, 4.8rem); padding-block: 3.35rem 2.8rem; align-items: center;
}
.hero h1 { font-size: clamp(2.65rem, 4.7vw, 4.65rem); letter-spacing: -.048em; font-weight: 790; }
.hero-copy > p { margin-top: 1.25rem; color: var(--muted); font-size: clamp(1.03rem, 1.4vw, 1.21rem); max-width: 34rem; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.3rem; margin-top: 1.55rem; }
.button, .actions button, .quiet {
  box-sizing: border-box; min-height: 2.65rem; border-radius: .36rem; border: 1px solid var(--line-strong);
  background: var(--paper); color: var(--ink); font-weight: 680; font-size: .875rem;
}
.button { display: inline-flex; align-items: center; justify-content: center; padding: .55rem 1rem; text-decoration: none; }
.primary { color: #fff9f1; background: var(--rust); border-color: var(--rust); }
.primary:hover { color: #fff9f1; background: #74331c; border-color: #74331c; }
.text-link { font-size: .92rem; font-weight: 660; }
.hero-diagram { min-width: 0; background: var(--iron); padding: .78rem; border-radius: .82rem; box-shadow: 0 12px 28px -20px #172625b0; }
.hero-diagram figcaption { display: flex; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; padding: .07rem .25rem .65rem; }
.hero-diagram figcaption span { color: #f6eee0; font-weight: 680; }
.hero-diagram a { color: var(--amber); }
.hero-diagram a:hover { color: #fff7e5; }
.hero-diagram a:focus-visible { outline-color: var(--amber); }

.tool-library { padding-top: 1.35rem; border-top: 1px solid var(--line-strong); }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.section-title h2 { font-size: clamp(1.65rem, 3vw, 2.25rem); letter-spacing: -.045em; }
.section-title p { color: var(--muted); font-size: .9rem; }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; }
.tool-card {
  display: flex; flex-direction: column; align-items: start; gap: .55rem;
  padding: 1rem 1.05rem; min-height: 10.8rem; border: 1px solid var(--line);
  border-top: 3px solid var(--rust); border-radius: .5rem; background: var(--paper); color: var(--ink); text-decoration: none;
}
.tool-card:nth-child(4n + 2), .tool-card:nth-child(4n + 3) { border-top-color: var(--teal); }
.tool-card h3 { font-size: 1.13rem; letter-spacing: -.025em; }
.tool-card p { color: var(--muted); font-size: .9rem; }
.tool-card:hover { color: var(--teal); border-color: var(--teal); background: #fffdf7; }
.example-count { margin-top: auto; font-size: .81rem; font-weight: 680; color: var(--teal); padding-top: .25rem; }

.breadcrumbs {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .22rem .55rem; padding-top: 1.1rem;
  color: var(--muted); font-size: .85rem; overflow-wrap: anywhere;
}
.breadcrumbs a { font-weight: 630; }
.tool-heading { max-width: 70rem; padding-block: .78rem 1.35rem; }
.tool-heading h1, .info h1, .missing-page h1 { font-size: clamp(2.05rem, 4vw, 3.45rem); letter-spacing: -.046em; font-weight: 785; }
.tool-heading p:not(.example-label), .intro { font-size: 1.05rem; color: var(--muted); max-width: 61rem; margin-top: .6rem; }
.example-label { font-size: .82rem; font-weight: 740; color: var(--rust); margin-bottom: .25rem; }
.workspace {
  display: grid; grid-template-columns: minmax(19rem, .73fr) minmax(0, 1.27fr);
  grid-template-areas: "inputs diagram" "inputs results";
  gap: .9rem 1rem; align-items: start;
}
.panel { min-width: 0; border: 1px solid var(--line); background: var(--paper); border-radius: .58rem; padding: 1rem; }
.input-rail { grid-area: inputs; min-width: 0; }
.input-rail .safety { margin: .8rem 0 0; }
.display { grid-area: diagram; }
.results { grid-area: results; }
.panel-heading, .display figcaption {
  display: flex; align-items: center; justify-content: space-between; column-gap: .8rem; row-gap: .18rem;
}
.panel-heading h2, .display h2 { font-size: 1.28rem; letter-spacing: -.032em; }
.display figcaption { margin-bottom: .62rem; }
.display figcaption span, .result-system { color: var(--muted); font-size: .855rem; text-align: right; }
.quiet { padding-inline: .75rem; min-height: 2.5rem; }
.quiet:hover, .actions button:not(:disabled):hover { background: var(--teal-wash); border-color: var(--teal); color: var(--teal); }
.units {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .28rem;
  background: var(--recess); border: 1px solid var(--line); border-radius: .43rem;
  padding: .22rem; margin-block: .72rem .87rem;
}
.units button {
  border: 1px solid transparent; border-radius: .3rem; color: var(--muted); background: transparent;
  padding: .3rem .2rem; min-height: 2.5rem; font-size: .875rem; font-weight: 710;
}
.units button[aria-pressed="true"] { color: var(--paper); background: var(--teal); border-color: var(--teal); }
.units button[aria-pressed="false"]:hover { color: var(--ink); background: var(--paper); }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem .7rem; align-items: start; }
.field { min-width: 0; }
.field-select { grid-column: 1 / -1; }
.field label, .share-box label { display: block; font-size: .875rem; line-height: 1.3; font-weight: 690; margin-bottom: .3rem; }
.field small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.4; margin-top: .32rem; }
.number-wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  border: 1px solid var(--line-strong); border-radius: .38rem; background: #fffdf8;
}
.number-wrap:focus-within { outline: 2px solid var(--teal); outline-offset: 1px; }
.number-wrap input {
  min-width: 0; width: 100%; min-height: 2.63rem; padding: .44rem .4rem .44rem .55rem;
  border: 0; outline: none; background: transparent; color: var(--ink);
  font-family: var(--mono); font-size: .98rem; appearance: textfield;
}
.number-wrap input::-webkit-inner-spin-button, .number-wrap input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.number-wrap:has([aria-invalid="true"]) { border-color: var(--warn); background: var(--warn-bg); }
.input-unit { color: var(--muted); font-size: .77rem; white-space: nowrap; padding-right: .52rem; }
.input-unit:empty { padding: 0; }
.select-wrap { position: relative; }
.select-wrap select, .share-box input {
  width: 100%; min-width: 0; min-height: 2.7rem; border: 1px solid var(--line-strong);
  border-radius: .38rem; background: #fffdf8; color: var(--ink);
}
.select-wrap select { appearance: none; font-size: .94rem; padding: .35rem 2rem .35rem .6rem; }
.select-chevron {
  position: absolute; pointer-events: none; right: .86rem; top: 43%; width: .48rem; height: .48rem;
  border: solid var(--teal); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.notice {
  color: var(--teal); background: var(--teal-wash); border-left: 3px solid var(--teal);
  border-radius: .18rem; padding: .48rem .6rem; margin: .58rem 0;
  font-size: .865rem; line-height: 1.47;
}
.notice-warning, .notice-error { color: var(--warn); background: var(--warn-bg); border-color: var(--warn); }
.notice-error { font-weight: 660; }
.readouts { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.results .readouts { margin-top: .47rem; }
.readouts:has(tbody:empty) { display: none; }
.readouts tr { border-bottom: 1px solid #e1dcd0; }
.readouts tr:nth-child(odd) { background: #f4f0e7; }
.readouts th, .readouts td { padding: .44rem .57rem; font-size: .9rem; vertical-align: middle; }
.readouts th { text-align: left; font-weight: 570; }
.readouts td { font-family: var(--mono); font-weight: 640; text-align: right; overflow-wrap: anywhere; }
.value-unit { margin-inline-start: .35em; font: 600 .88em var(--system); color: var(--muted); }
.alternate-value { display: inline-block; margin-left: .7rem; color: var(--muted); font-size: .83em; font-weight: 490; }
.actions { margin-top: .85rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.actions button { padding: .35rem .68rem; }
.actions [data-action="share"] { color: var(--teal); border-color: var(--teal); }
.share-box { margin-top: .7rem; }
.share-box input { padding-inline: .55rem; font-family: var(--mono); font-size: .83rem; }
.action-status { min-height: 0; color: var(--muted); font-size: .85rem; margin-top: .46rem; }
.action-status:empty { margin: 0; }

.safety {
  border: 1px solid #d8b48c; border-left: 4px solid var(--rust); border-radius: .42rem;
  padding: .85rem 1rem; margin-block: 1.2rem; background: var(--amber-wash); color: #513b2d;
}
.safety h2 { font-size: 1.03rem; margin-bottom: .27rem; color: #5e341f; }
.safety p { font-size: .9rem; }
.tool-reading { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, .55fr); gap: 1.2rem 2rem; margin-top: 1.7rem; }
.tool-reading h2, .info h2 { font-size: 1.44rem; letter-spacing: -.03em; }
.formula-list { padding-left: 1.55rem; margin: .7rem 0 1rem; }
.formula-list li { padding: .36rem 0 .46rem .25rem; }
.formula-list li::marker { color: var(--rust); font-weight: 750; }
.formula-list h3 { font-size: 1rem; margin-bottom: .22rem; }
.formula-list p, .assumption, .conventions, .info section > p { color: var(--muted); }
.conventions, .info section > p { margin-top: .52rem; }
.source-links { padding-left: 1.25rem; font-size: .88rem; }
.source-links li + li { margin-top: .3rem; }
.example-list { list-style: none; margin: .7rem 0 0; padding: 0; }
.example-list li + li { margin-top: .42rem; }
.example-list a { display: flex; align-items: center; min-height: 2.55rem; padding: .47rem .65rem; background: var(--paper); border: 1px solid var(--line); border-radius: .3rem; font-size: .92rem; font-weight: 630; }
.example-list a:hover { border-color: var(--teal); }
.worked-values { margin-bottom: .95rem; }
.worked-values caption, .conversion-table caption { text-align: left; font-weight: 720; padding: .4rem 0; }
.info { max-width: 52rem; }
.info h1 { margin-top: .75rem; }
.info section { margin-top: 1.55rem; }
.conversion-table { margin-block: .65rem; }
.conversion-table td { text-align: left; font-family: var(--system); font-weight: 500; }
.missing-page { padding-block: 3rem; }
.missing-page > p:not(.example-label) { margin-block: .55rem 1.1rem; }
.print-sheet { display: none; }

.schematic { display: block; width: 100%; height: auto; font-family: var(--system); overflow: hidden; }
.schematic .artboard { fill: #eee9de; }
.schematic .meter-cell { fill: #fffaf1; stroke: #c7bdab; stroke-width: 1; }
.schematic .meter-label { fill: #405250; font: 770 15.7px var(--system); letter-spacing: .25px; }
.schematic .meter-value { fill: #243534; font: 740 26px var(--mono); }
.schematic .meter-unit { fill: #53635d; font: 630 14px var(--system); }
.schematic .anatomy-panel { fill: #f8f4ea; stroke: #c9c0b0; stroke-width: 1; }
.schematic .panel-grid { fill: none; stroke: #e7e1d4; stroke-width: 1; }
.schematic .diagram-label, .schematic .legend-label { fill: #364845; font: 690 15px var(--system); }
.schematic .legend-label { font-weight: 580; }
.schematic .machine-label { fill: #253534; font: 780 22px var(--system); }
.schematic .check-label { fill: #334845; font: 725 16px var(--system); }
.schematic .check-value { fill: #26413c; font: 730 16px var(--mono); }
.schematic .empty-label { fill: #53635d; font: 700 18px var(--system); }
.schematic .pressure-line, .schematic .return-line, .schematic .tank-line, .schematic .heat-line,
.schematic .shaft-line, .schematic .seal-line, .schematic .axis, .schematic .curve,
.schematic .guide-curve, .schematic .guide-line, .schematic .shell-line {
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.schematic .pressure-line { stroke: #9c482b; stroke-width: 4; }
.schematic .return-line { stroke: #17756b; stroke-width: 4; }
.schematic .tank-line { stroke: #63716a; stroke-width: 3; stroke-dasharray: 6 4; }
.schematic .heat-line { stroke: #a85331; stroke-width: 3; stroke-dasharray: 3 5; }
.schematic .shaft-line { stroke: #42534c; stroke-width: 5; }
.schematic .seal-line { stroke: #364843; stroke-width: 3; }
.schematic .shell, .schematic .shell-line { stroke: #43534c; stroke-width: 2.5; }
.schematic .shell { fill: #f0ecdf; }
.schematic .piston { fill: #53625b; stroke: #33423c; stroke-width: 2; }
.schematic .rod { fill: #a6aaa0; stroke: #35443d; stroke-width: 2; }
.schematic .pressure-fill { fill: #9c482b; }
.schematic .return-fill { fill: #17756b; }
.schematic .tank-fill { fill: #63716a; }
.schematic .pressure-wash { fill: #f1c99f; }
.schematic .return-wash { fill: #bcdad0; }
.schematic .tank-wash { fill: #d0d6c9; }
.schematic .heat-wash { fill: #e6ac85; stroke: #a85331; stroke-width: 2; }
.schematic .guide-line { stroke: #d1caba; stroke-width: 1.1; }
.schematic .axis { stroke: #596963; stroke-width: 1.8; }
.schematic .curve { stroke: #9c482b; stroke-width: 3.6; }
.schematic .guide-curve { stroke: #687974; stroke-width: 2; stroke-dasharray: 5 5; }
.schematic .pressure-point { fill: #9c482b; stroke: #fffcf4; stroke-width: 2.3; }
.schematic .return-point { fill: #17756b; stroke: #fffcf4; stroke-width: 2.3; }
.schematic .bar-track { fill: #d7d0c2; }
.schematic .bar-fill { fill: #17756b; }
.schematic .bar-alert { fill: #9c482b; }
.schematic .check-tick { stroke: #263935; stroke-width: 1.5; }

@media (max-width: 69rem) {
  .site-width, .header-width { width: calc(100% - 3rem); }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 49rem) {
  .site-width, .header-width { width: calc(100% - 2rem); }
  .hero { grid-template-columns: 1fr; gap: 1.35rem; padding-block: 1.8rem 1.5rem; }
  .hero-copy > p { margin-top: .75rem; }
  .hero-actions { margin-top: 1rem; }
  .hero-diagram { width: min(100%, 39rem); }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-areas: "diagram" "inputs" "results"; }
  .tool-reading { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: .82rem; }
  .tool-heading { padding-bottom: 1rem; }
}

@media (max-width: 35rem) {
  .header-width { flex-wrap: wrap; gap: .45rem 1rem; padding-block: .6rem .66rem; }
  .site-header nav { width: 100%; justify-content: space-between; gap: .25rem .62rem; }
  .site-header nav a { line-height: 1.35; padding: .22rem 0; font-size: .84rem; }
  .brand { font-size: 1.12rem; }
  .brand img { width: 32px; height: 32px; }
  .hero h1 { font-size: clamp(2.4rem, 10.5vw, 3.2rem); }
  .hero-diagram { padding: .55rem; }
  .hero-diagram figcaption { padding: .03rem .16rem .45rem; font-size: .82rem; }
  .tool-grid { grid-template-columns: 1fr; gap: .68rem; }
  .tool-card { min-height: 0; padding: .83rem .89rem; }
  .breadcrumbs { padding-top: .83rem; }
  .tool-heading h1, .info h1, .missing-page h1 { font-size: clamp(1.9rem, 8.2vw, 2.7rem); }
  .tool-heading p:not(.example-label) { font-size: .98rem; }
  .display figcaption span { font-size: .77rem; line-height: 1.25; }
  .alternate-value { display: block; margin-left: 0; }
  .readouts th, .readouts td { padding-inline: .4rem; font-size: .86rem; }
}

@page { size: A4 portrait; margin: 11mm; }
@media print {
  :root { --page: white; --paper: white; }
  html, body { background: white; color: #172320; font-size: 9.5pt; }
  .site-header, .site-footer, .skip, .tool-page > :not(.print-sheet) { display: none !important; }
  .site-width { width: 100%; margin: 0; }
  .print-sheet { display: block; break-inside: avoid; }
  .print-sheet header { border-bottom: 1px solid #9a9f94; padding-bottom: 2mm; }
  .print-sheet header h2 { font-size: 17pt; margin-block: 1.6mm; }
  .print-brand { font-weight: 780; color: var(--teal); }
  .print-art { width: min(140mm, 100%); margin: 3mm auto; }
  .print-sheet .schematic { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .print-tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5mm; }
  .print-tables h3 { margin-bottom: 1mm; font-size: 10.5pt; }
  .print-sheet .readouts th, .print-sheet .readouts td { padding: .75mm 1.35mm; font-size: 8pt; line-height: 1.29; }
  .print-sheet .readouts td { overflow-wrap: anywhere; }
  .print-sheet .notice { font-size: 8pt; padding: 1mm 2mm; margin: 1mm 0; }
  .print-sheet > p { font-size: 8.2pt; line-height: 1.35; margin-top: 2mm; }
  .print-safety { font-weight: 680; }
}
