:root {
  color-scheme: light;
  --canvas: #eef2f2;
  --paper: #fcfdfd;
  --plate: #f1f7f7;
  --ink: #152a34;
  --muted: #485f69;
  --line: #cddadd;
  --line-strong: #9eb4bc;
  --cool: #0891b2;
  --cyan: #0e7490;
  --cyan-dark: #07566b;
  --cool-soft: #e3f5f7;
  --heat: #c2410c;
  --hot-soft: #fff1e9;
  --danger: #dc2626;
  --slate: #546e7b;
  --grid: #dbe9eb;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-block-start: 16px; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  text-rendering: optimizeLegibility;
}
a { color: var(--cyan-dark); text-underline-offset: .16em; }
a:hover { color: var(--cyan); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--cool);
  outline-offset: 3px;
}
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.028em; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
svg { display: block; }
.sr-only, .skip {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  z-index: 3;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 8px 12px;
  background: var(--paper);
  clip-path: none;
}
.container { width: calc(100% - 64px); max-width: 1216px; margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); background: var(--paper); }
.masthead-inner, .footer-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}
.masthead nav, .site-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px; }
.masthead nav a, .site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
  text-decoration: none;
}
.masthead nav a:hover, .site-footer nav a:hover { color: var(--cyan-dark); text-decoration: underline; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.13rem;
  font-weight: 780;
  letter-spacing: -.045em;
  min-height: 42px;
}
.brand-accent { color: var(--cyan-dark); }
.site-footer { margin-top: 58px; border-top: 1px solid var(--line); background: var(--paper); }
.footer-inner { min-height: 72px; }
.footer-brand { color: var(--ink); font-size: .9rem; font-weight: 690; text-decoration: none; }

.eyebrow {
  color: var(--cyan-dark);
  font: 650 .72rem/1.35 var(--mono);
  text-transform: uppercase;
  letter-spacing: .065em;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.07fr) minmax(0, .93fr);
  align-items: center;
  gap: 52px;
  padding: 54px 0 46px;
  border-bottom: 1px solid var(--line-strong);
}
.hero h1 {
  max-width: 10.5ch;
  margin-top: 12px;
  font-size: clamp(2.55rem, 5.1vw, 4.85rem);
  font-weight: 780;
  letter-spacing: -.061em;
  line-height: 1;
}
.hero-description {
  max-width: 37ch;
  margin-top: 19px;
  color: var(--muted);
  font-size: clamp(1rem, 1.48vw, 1.22rem);
  line-height: 1.52;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 19px; margin-top: 22px; }
.primary-button, .text-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  font-size: .91rem;
  font-weight: 720;
}
.primary-button {
  padding: 8px 14px;
  border-radius: 5px;
  background: var(--cyan-dark);
  color: #fff;
  text-decoration: none;
}
.primary-button:hover { color: #fff; background: var(--cyan); }
.text-link { text-decoration-thickness: 1px; }
.hero-figure {
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: 0 15px 35px -27px #17384770;
}
.hero-figure figcaption {
  padding: 3px 5px 10px;
  color: var(--muted);
  font: 650 .73rem/1.45 var(--mono);
  letter-spacing: .045em;
  text-transform: uppercase;
}
.facility-drawing { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.home-section { margin-top: 38px; }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 18px; margin-bottom: 16px; }
.section-heading h2 { font-size: clamp(1.65rem, 3vw, 2.35rem); }
.section-heading p { color: var(--muted); }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tool-tile {
  position: relative;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--cool);
  border-radius: 4px 4px 7px 7px;
  background: var(--paper);
}
.tool-tile:hover { border-color: var(--cool); background: #f7fcfc; }
.tool-tile:focus-within { outline: 2px solid var(--cool); outline-offset: 1px; }
.tile-heading { display: flex; align-items: center; gap: 8px; }
.glyph { flex: 0 0 auto; width: 23px; height: 23px; fill: none; stroke: var(--cyan); stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.tool-tile h3 { margin: 10px 0 6px; font-size: 1.18rem; }
.tool-tile h3 a { color: var(--ink); text-decoration: none; }
.tool-tile h3 a::after { position: absolute; inset: 0; content: ""; }
.tool-tile h3 a span { color: var(--cyan); font-size: .83em; white-space: nowrap; }
.tool-tile p { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.case-directory { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; align-items: start; }
.case-group { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.case-group summary { cursor: pointer; min-height: 44px; padding: 10px 13px; color: var(--ink); font-weight: 700; }
.case-group summary::marker { color: var(--cyan); }
.case-group .case-links { margin: 0 13px 10px; }
.case-links { list-style: none; padding: 0; margin: 8px 0 0; }
.case-links li + li { border-top: 1px solid var(--line); }
.case-links a { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-block: 6px; }
.case-links a span { flex: 0 0 auto; }
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 9px;
  margin: 18px 0 12px;
  color: var(--muted);
  font-size: .86rem;
}
.crumbs a { display: inline-flex; min-height: 40px; align-items: center; }
.tool-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}
.tool-heading > .glyph {
  width: 44px;
  height: 44px;
  padding: 9px;
  border: 1px solid #a5cbd3;
  border-radius: 6px;
  background: var(--cool-soft);
}
.tool-heading > div { min-width: 0; }
.tool-heading h1, .text-page h1 {
  font-size: clamp(1.92rem, 4.1vw, 3.15rem);
  letter-spacing: -.052em;
  font-weight: 780;
}
.tool-heading p, .text-lede { margin-top: 8px; max-width: 78ch; color: var(--muted); font-size: 1rem; }
.workspace {
  display: grid;
  grid-template-columns: minmax(322px, .91fr) minmax(0, 1.85fr);
  grid-template-areas: "input readout" "input results";
  gap: 12px;
  align-items: start;
}
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.readout { grid-area: readout; padding: 14px; border-color: var(--line-strong); border-top: 2px solid var(--cyan); }
.inputs { grid-area: input; padding: 15px; }
.results { grid-area: results; padding: 14px; }
.board-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.board-heading h2 { font-size: 1.28rem; }
.board-heading p + h2 { margin-top: 4px; font-size: 1.42rem; }
.live { display: inline-flex; align-items: center; gap: 5px; color: var(--cyan-dark); font: 650 .73rem var(--mono); }
.live::before { width: 6px; height: 6px; border-radius: 50%; background: var(--cool); content: ""; }
.unit-toggle { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--canvas); }
.unit-toggle button {
  min-height: 40px;
  min-width: 45px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: 700 .8rem var(--mono);
}
.unit-toggle button[aria-pressed="true"] { color: var(--cyan-dark); border-color: var(--line-strong); background: var(--paper); }
fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
fieldset + fieldset { margin-top: 17px; }
legend {
  width: 100%;
  padding: 8px 0 7px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: .92rem;
  font-weight: 740;
}
.field-note { margin-bottom: 8px; color: var(--muted); font-size: .82rem; line-height: 1.44; }
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}
.field { min-width: 0; }
.field:has(select) { grid-column: 1 / -1; }
.field label, #share-box label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: .79rem;
  font-weight: 660;
  line-height: 1.3;
}
.field label.sr-only { position: absolute; }
.field input, .field select, #share-url {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 7px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
}
.field input, #share-url { font: 600 .94rem var(--mono); font-variant-numeric: tabular-nums; }
.field select { font-size: .89rem; }
.number { position: relative; }
.number.with-unit { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.number.with-unit input { border-radius: 5px 0 0 5px; position: relative; z-index: 1; }
.number input { appearance: textfield; }
.number input::-webkit-inner-spin-button, .number input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.input-unit {
  display: flex;
  align-items: center;
  padding-inline: 6px;
  border: 1px solid var(--line-strong);
  border-left: 0;
  border-radius: 0 5px 5px 0;
  background: var(--plate);
  color: var(--muted);
  font: 650 .68rem var(--mono);
  white-space: nowrap;
}
.field [aria-invalid="true"] { border-color: var(--danger); background: var(--hot-soft); }
.climate-grid {
  display: grid;
  grid-template-columns: 1.3rem repeat(2, minmax(0, 1fr));
  gap: 5px 8px;
  align-items: center;
}
.climate-grid > span { font: 650 .74rem var(--mono); color: var(--muted); }
.input-error { margin-top: 10px; color: #9e2c09; font-size: .87rem; font-weight: 650; }
.reset-button {
  margin-top: 15px;
  min-height: 42px;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: transparent;
  color: var(--cyan-dark);
  font-size: .86rem;
  font-weight: 670;
}
.reset-button:hover, .actions button:hover:not(:disabled) { background: var(--cool-soft); border-color: var(--cool); }
.anatomy { display: block; width: 100%; height: auto; }
#diagram { max-width: 680px; margin-inline: auto; }
.diagram-placeholder {
  display: grid;
  min-height: 170px;
  place-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--plate);
  color: var(--muted);
  text-align: center;
}
.readout-status { margin-top: 8px; border-left: 3px solid var(--cool); background: var(--cool-soft); color: #124757; padding: 6px 9px; font-size: .85rem; font-weight: 670; }
.readout-status[data-tone="warn"] { border-left-color: var(--heat); background: var(--hot-soft); color: #8e320d; }
.actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.actions button {
  min-height: 42px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 680;
}
.actions button:first-child { border-color: #a5cbd3; color: var(--cyan-dark); background: var(--cool-soft); }
#share-box { margin-top: 10px; }
.action-status:not(:empty) { margin-top: 7px; color: var(--muted); font-size: .83rem; }
.result-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .88rem; }
.result-table th, .result-table td { padding: 6px 7px; border-top: 1px solid var(--line); }
.result-table th { width: 60%; text-align: left; font-weight: 570; }
.result-table td { text-align: right; font: 680 .86rem/1.45 var(--mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result-table td span { font-size: .78em; color: var(--muted); }
.result-table tbody tr:nth-child(even) { background: var(--plate); }

.anatomy text, .facility-drawing text { fill: var(--ink); stroke: none; }
.diagram-card { fill: var(--paper); stroke: var(--line); stroke-width: 1; }
.diagram-surface { fill: var(--canvas); stroke: none; }
.plot-plate { fill: var(--plate); stroke: var(--line); stroke-width: 1; }
.plot-grid { fill: none; stroke: var(--grid); stroke-width: .55; }
.telemetry-label { font: 700 10.15px var(--mono); letter-spacing: .15px; }
.telemetry-value { font: 730 17px var(--mono); letter-spacing: -.55px; }
.anatomy .telemetry-unit, .anatomy .diagram-small, .facility-drawing .diagram-small { fill: var(--muted); font: 650 10.2px var(--mono); }
.diagram-label { font: 680 10.7px var(--sans); }
.diagram-value { font: 720 10.9px var(--mono); }
.node, .cool-node, .warm-node, .idle-node, .pump-symbol {
  fill: var(--paper); stroke: var(--slate); stroke-width: 1;
}
.cool-node, .pump-symbol { fill: #def3f5; stroke: var(--cyan); }
.warm-node { fill: #fff0e7; stroke: var(--heat); }
.idle-node { fill: var(--plate); stroke: var(--line-strong); stroke-dasharray: 3 3; }
.rack-slot { fill: #e1e9eb; stroke: #8fa6ae; stroke-width: .6; }
.slot-line { stroke: var(--slate); stroke-width: .9; }
.rack-outline { fill: none; stroke: var(--slate); stroke-width: 1.05; stroke-linejoin: round; }
.cool, .warm, .neutral, .loss, .baseline, .limit-tick { fill: none; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.cool { stroke: var(--cyan); }
.warm, .loss { stroke: var(--heat); }
.neutral { stroke: var(--slate); }
.loss, .dashed { stroke-width: 1; stroke-dasharray: 3 3; }
.baseline { stroke: var(--line-strong); stroke-width: 1; }
.limit-tick { stroke: var(--ink); stroke-width: 1.1; }
.cool-fill, .bar-fill { fill: var(--cool); stroke: none; }
.warm-fill, .bar-warn { fill: var(--heat); stroke: none; }
.neutral-fill { fill: var(--slate); stroke: none; }
.light-fill { fill: #779ba4; stroke: none; }
.bar-track { fill: #dce8eb; stroke: none; }

.tool-notes { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, .8fr); gap: 12px; margin-top: 18px; align-items: start; }
.tool-notes:has(.steps) .method-panel:first-child { grid-column: 1 / -1; }
.method-panel {
  min-width: 0;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.method-panel h2 { font-size: 1.33rem; }
.method-panel h3 { margin-top: 15px; font-size: 1.04rem; }
.method-panel p { margin-top: 8px; color: var(--muted); }
.equations {
  margin: 10px 0 0;
  padding: 9px 12px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--plate);
  font: 600 .84rem/1.6 var(--mono);
  overflow-wrap: anywhere;
}
.equations li + li { margin-top: 3px; }
.steps { margin: 9px 0 0; padding-left: 1.38rem; }
.steps li + li { margin-top: 5px; }
.source-list { margin: 10px 0 0; padding-left: 1.25rem; font-size: .87rem; }
.source-list li + li { margin-top: 4px; }
.text-page { max-width: 840px; }
.text-page .method-panel { margin-top: 12px; }
.text-page .text-lede { margin-bottom: 18px; }
.text-page .method-panel h2:not(:first-child) { margin-top: 16px; }
.print-sheet { display: none; }

@media (max-width: 1050px) {
  .hero { gap: 26px; padding-top: 42px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .container { width: calc(100% - 32px); }
  .masthead-inner { min-height: 0; padding-top: 6px; flex-wrap: wrap; gap: 0 14px; }
  .masthead nav { flex-wrap: wrap; gap: 0 15px; }
  .masthead nav a { font-size: .82rem; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 19px; padding: 29px 0 24px; }
  .hero h1 { max-width: 15ch; }
  .hero-description { margin-top: 13px; }
  .hero-actions { margin-top: 12px; }
  .hero-figure { padding: 8px; }
  .hero-figure figcaption { padding-bottom: 7px; }
  .home-section { margin-top: 24px; }
  .section-heading { margin-bottom: 10px; }
  .case-directory, .tool-notes { grid-template-columns: minmax(0, 1fr); }
  .crumbs { margin-top: 8px; margin-bottom: 6px; }
  .tool-heading { gap: 9px; margin-bottom: 14px; }
  .tool-heading > .glyph { width: 34px; height: 34px; padding: 6px; }
  .tool-heading p { font-size: .92rem; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-areas: "readout" "input" "results"; }
  .panel { padding: 10px; }
  .board-heading p + h2 { font-size: 1.27rem; }
  .site-footer { margin-top: 32px; }
  .footer-inner { flex-wrap: wrap; gap: 0 14px; }
  .site-footer nav { gap: 0 13px; }
}
@media (max-width: 420px) {
  .tool-grid { grid-template-columns: minmax(0, 1fr); }
  .tool-tile { padding: 12px; }
  .tool-heading h1 { font-size: clamp(1.65rem, 7.9vw, 2.1rem); }
  .tool-heading > .glyph { display: none; }
  .masthead nav { gap: 0 13px; }
  .field label { font-size: .75rem; }
  .input-unit { padding-inline: 4px; }
  .result-table th, .result-table td { padding-inline: 4px; }
  .method-panel { padding: 13px; }
}

@page { size: A4; margin: 10mm; }
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #14262e; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body:has(.print-sheet) > :not(.tool-page), .tool-page > :not(.print-sheet) { display: none !important; }
  .tool-page { display: block; width: auto; max-width: none; margin: 0; }
  .print-sheet { display: block; font-size: 9.6px; line-height: 1.28; }
  .print-brand { margin-bottom: 4px; font: 700 10px var(--mono); color: var(--cyan-dark); }
  .print-sheet .print-title { margin: 0 0 4px; font-size: 20px; }
  #print-status { margin-bottom: 7px; }
  #print-diagram { max-width: 427px; margin: 0 auto 8px; }
  .print-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .print-columns h2 { margin-bottom: 3px; font-size: 12px; }
  .print-columns dl { margin: 0; }
  .print-columns dl > div { display: grid; grid-template-columns: 1.18fr 1fr; gap: 4px; padding: 2px 0; border-top: 1px solid var(--line); }
  .print-columns dd { margin: 0; text-align: right; overflow-wrap: anywhere; font: 650 9px/1.28 var(--mono); }
  .print-footnote { margin-top: 8px; color: var(--muted); font-size: 9px; }
}
