/* ACPressureChart.com — service-bay instrument design system */
:root {
  --ink-950: #151715;
  --ink-900: #1b1d1b;
  --ink-850: #20231f;
  --ink-800: #282b27;
  --ink-700: #393d37;
  --ink-500: #6c7168;
  --paper-50: #fbfaf6;
  --paper-100: #f3f0e7;
  --paper-150: #ece7dc;
  --paper-200: #e0d9cb;
  --paper-300: #c8bfae;
  --orange: #f5672f;
  --orange-dark: #c9471a;
  --orange-soft: #ffddd0;
  --low: #2685bc;
  --low-soft: #d9edf7;
  --high: #d94a3f;
  --high-soft: #f8deda;
  --ok: #2d7d5e;
  --ok-soft: #dcefe7;
  --attention: #a56512;
  --attention-soft: #f6e8c9;
  --warning: #b63d32;
  --warning-soft: #f8dedb;
  --neutral-soft: #e9e7df;
  --white: #ffffff;
  --shadow-instrument: 0 32px 80px rgba(0, 0, 0, 0.32), 0 3px 0 rgba(255,255,255,0.06) inset;
  --shadow-paper: 0 16px 44px rgba(38, 31, 20, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --shell: 1240px;
  --header-height: 72px;
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  background: var(--ink-950);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink-900);
  background: var(--paper-100);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

p,
h1,
h2,
h3,
ol,
ul {
  margin-top: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
  letter-spacing: -0.035em;
}

p {
  text-wrap: pretty;
}

code,
kbd,
samp,
.number-with-unit input,
.pressure-input input,
.pt-readout strong,
.reference-strip strong,
.gauge-reading,
.thermal-results strong,
.calibration-tag,
.result-badge,
.formula-tag,
.source-list__type,
.api-panel__tag {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.clipboard-helper {
  position: fixed;
  inset: auto auto 0 -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 16px;
  top: 12px;
  padding: 10px 14px;
  color: var(--ink-950);
  background: var(--paper-50);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.session-toast {
  position: fixed;
  z-index: 1100;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 13px 12px 15px;
  color: var(--paper-50);
  background: rgba(27, 29, 27, 0.97);
  border: 1px solid #454a43;
  border-radius: 13px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.3);
}

.session-toast[hidden] {
  display: none;
}

.session-toast > span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.session-toast strong {
  font-size: 0.78rem;
}

.session-toast small {
  color: #9ea59a;
  font-size: 0.66rem;
}

.session-toast button {
  min-height: 44px;
  padding: 8px 11px;
  color: var(--orange);
  background: transparent;
  border: 1px solid #555b52;
  border-radius: 9px;
  font-size: 0.68rem;
  font-weight: 760;
  white-space: nowrap;
}

.session-toast button:hover {
  background: #292c28;
  border-color: var(--orange);
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

::selection {
  color: var(--ink-950);
  background: var(--orange-soft);
}

[hidden] {
  display: none !important;
}

/* Header */
.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  min-height: var(--header-height);
  color: var(--paper-100);
  background: rgba(21, 23, 21, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-header__inner {
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 36px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand__mark {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
}

.brand__text {
  display: grid;
  line-height: 1.15;
}

.brand__text strong {
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.brand__text small {
  margin-top: 4px;
  color: #aeb3aa;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  color: #c8ccc4;
  font-size: 0.84rem;
  font-weight: 650;
  text-decoration: none;
  transition: color 140ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--white);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.offline-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #bdc2b9;
  font-size: 0.75rem;
  white-space: nowrap;
}

.offline-state__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #58b68e;
  box-shadow: 0 0 0 4px rgba(88, 182, 142, 0.12);
}

.offline-state.is-offline .offline-state__dot {
  background: #d9a347;
  box-shadow: 0 0 0 4px rgba(217, 163, 71, 0.12);
}

/* Shared controls */
.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 760;
  line-height: 1;
  text-decoration: none;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button--primary {
  min-width: 170px;
  color: var(--white);
  background: var(--orange);
  box-shadow: 0 8px 24px rgba(245, 103, 47, 0.22);
}

.button--primary:hover {
  background: #ff7440;
}

.button--quiet {
  color: inherit;
  background: transparent;
  border-color: currentColor;
  border-color: color-mix(in srgb, currentColor 24%, transparent);
}

.button--quiet:hover {
  background: color-mix(in srgb, currentColor 7%, transparent);
}

.button--ink {
  color: var(--paper-50);
  background: var(--ink-900);
}

.button--ink:hover {
  background: var(--ink-700);
}

.button--small {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
}

.button--result {
  min-height: 40px;
  color: var(--ink-800);
  background: var(--paper-50);
  border-color: var(--paper-200);
  font-size: 0.78rem;
}

.button--result:hover {
  background: var(--white);
  border-color: var(--paper-300);
}

.select-wrap {
  position: relative;
  display: block;
}

.select-wrap::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 14px;
  color: currentColor;
  pointer-events: none;
  transform: translateY(-55%);
}

select {
  appearance: none;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field__label,
.field-group legend,
.ambient-control legend {
  color: #d6dad2;
  font-size: 0.74rem;
  font-weight: 780;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.field select,
.field input,
.inline-select select {
  width: 100%;
  min-height: 48px;
  color: var(--paper-50);
  background: #252824;
  border: 1px solid #444940;
  border-radius: 10px;
}

.field select,
.inline-select select {
  padding: 0 40px 0 13px;
}

.field input {
  padding: 0 13px;
}

.field select:hover,
.field input:hover,
.inline-select select:hover {
  border-color: #666d62;
}

.field__hint {
  min-height: 1.3em;
  color: #969d92;
  font-size: 0.72rem;
  line-height: 1.35;
}

.control-grid {
  display: grid;
  gap: 14px;
}

.control-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.segmented {
  display: flex;
  align-items: stretch;
  padding: 4px;
  background: #252824;
  border: 1px solid #41453e;
  border-radius: 12px;
}

.segmented__button {
  min-height: 40px;
  flex: 1 1 0;
  padding: 8px 12px;
  color: #aeb4aa;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.2;
}

.segmented__button:hover {
  color: var(--white);
}

.segmented__button.is-active,
.segmented__button[aria-pressed="true"] {
  color: var(--ink-950);
  background: var(--paper-100);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.segmented--large .segmented__button {
  min-height: 48px;
}

.segmented__icon {
  margin-right: 7px;
  font-family: var(--font-mono);
}

.segmented--compact {
  width: 118px;
  flex: 0 0 auto;
}

.segmented--compact .segmented__button {
  min-height: 34px;
  padding: 6px 10px;
}

/* Hero and instrument */
.hero {
  position: relative;
  overflow: clip;
  color: var(--paper-100);
  background: var(--ink-950);
  padding: 62px 0 48px;
}

.hero__backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.48;
  background-image:
    radial-gradient(circle at 78% 8%, rgba(245,103,47,0.18), transparent 27%),
    linear-gradient(rgba(255,255,255,0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.026) 1px, transparent 1px);
  background-size: auto, 36px 36px, 36px 36px;
  mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%);
}

.hero__inner {
  position: relative;
}

.hero__heading {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  align-items: end;
  gap: 48px;
  margin-bottom: 28px;
}

.eyebrow {
  margin-bottom: 10px;
  color: #c5c9c1;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow--dark {
  color: var(--orange-dark);
}

.hero h1 {
  max-width: 800px;
  margin-bottom: 0;
  font-size: clamp(2.4rem, 5vw, 5.15rem);
  line-height: 0.96;
  letter-spacing: -0.065em;
}

.hero__lede {
  max-width: 540px;
  margin-bottom: 3px;
  color: #b7bdb3;
  font-size: 1rem;
  line-height: 1.65;
}

.instrument {
  display: grid;
  grid-template-columns: minmax(0, 0.93fr) minmax(0, 1.07fr);
  overflow: hidden;
  min-height: 650px;
  background: var(--ink-850);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-instrument);
}

.instrument__controls,
.instrument__result {
  min-width: 0;
  padding: 28px;
}

.instrument__controls {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.025), transparent 42%),
    var(--ink-850);
}

.instrument__result {
  position: relative;
  color: var(--ink-900);
  background:
    linear-gradient(rgba(41, 35, 28, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41, 35, 28, 0.035) 1px, transparent 1px),
    var(--paper-100);
  background-size: 24px 24px;
  border-left: 1px solid rgba(0,0,0,0.12);
}

.instrument__topline,
.result-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.instrument__kicker {
  margin-bottom: 4px;
  color: #8f968b;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.instrument__controls h2,
.instrument__result h2 {
  margin-bottom: 0;
  font-size: 1.22rem;
  letter-spacing: -0.03em;
}

.instrument__controls h2 {
  color: var(--paper-50);
}

.calibration-tag,
.result-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.calibration-tag {
  color: #b6bcb2;
  border: 1px solid #454a42;
}

.result-badge {
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid #bddfce;
}

.result-badge--attention {
  color: var(--attention);
  background: var(--attention-soft);
  border-color: #e6cb91;
}

.result-badge--warning {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #e9b7b1;
}

.result-badge--neutral {
  color: var(--ink-700);
  background: var(--neutral-soft);
  border-color: var(--paper-300);
}

.result-topline__badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.elevation-badge {
  min-height: 44px;
  padding: 5px 9px;
  color: var(--orange-dark);
  background: var(--orange-soft);
  border: 1px solid #efb8a2;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 800;
  white-space: nowrap;
}

.elevation-badge:hover {
  border-color: var(--orange-dark);
}

.field-group,
.ambient-control {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-group legend,
.ambient-control legend {
  margin-bottom: 8px;
}

#pressure-form {
  display: grid;
  gap: 17px;
}

.ambient-control {
  padding: 14px;
  background: #1d201d;
  border: 1px solid #3e433c;
  border-radius: 13px;
}

.ambient-control__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.number-with-unit {
  display: inline-flex;
  align-items: baseline;
  color: var(--paper-50);
}

.number-with-unit input {
  width: 104px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font-size: 2rem;
  font-weight: 760;
  line-height: 1;
}

.number-with-unit span {
  color: #9ca397;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.stepper {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.stepper__button {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: #d8ddd5;
  background: #2b2f2a;
  border: 1px solid #4b5148;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 760;
  line-height: 1;
  touch-action: manipulation;
  user-select: none;
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease, transform 80ms ease;
}

.stepper__button:hover,
.stepper__button:focus-visible {
  color: var(--paper-50);
  background: #353a34;
  border-color: var(--orange);
}

.stepper__button:active {
  transform: translateY(1px);
}

.stepper--ambient {
  grid-template-columns: 44px auto 44px;
  align-items: center;
}

.stepper--ambient .number-with-unit {
  align-self: center;
  justify-content: center;
  min-width: 92px;
}

.elevation-settings {
  margin-top: 9px;
  color: #c9cec6;
  background: #181a18;
  border: 1px solid #343932;
  border-radius: 10px;
}

.elevation-settings summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px;
  cursor: pointer;
  list-style: none;
}

.elevation-settings summary::-webkit-details-marker {
  display: none;
}

.elevation-settings summary span {
  color: #9da49a;
  font-size: 0.68rem;
  font-weight: 720;
}

.elevation-settings summary strong {
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 760;
}

.elevation-settings summary::after {
  content: "+";
  color: #7f877d;
  font-family: var(--font-mono);
}

.elevation-settings[open] summary::after {
  content: "−";
}

.elevation-settings__body {
  display: grid;
  gap: 8px;
  padding: 0 10px 11px;
  border-top: 1px solid #30342f;
}

.stepper--elevation {
  grid-template-columns: 44px minmax(76px, 1fr) 62px 44px;
  gap: 5px;
  padding-top: 10px;
}

.elevation-entry {
  display: flex;
  min-width: 0;
}

.elevation-entry input,
.stepper--elevation select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  color: var(--paper-50);
  background: #242824;
  border: 1px solid #444a42;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.elevation-entry input {
  padding: 0 10px;
  text-align: right;
}

.stepper--elevation select {
  padding: 0 24px 0 8px;
}

.elevation-settings__body p {
  margin: 0;
  color: #858d82;
  font-size: 0.62rem;
  line-height: 1.45;
}

.range {
  width: 100%;
  height: 24px;
  margin: 10px 0 0;
  appearance: none;
  background: transparent;
}

.range::-webkit-slider-runnable-track {
  height: 5px;
  background: linear-gradient(90deg, var(--low), var(--orange), var(--high));
  border-radius: 999px;
}

.range::-moz-range-track {
  height: 5px;
  background: linear-gradient(90deg, var(--low), var(--orange), var(--high));
  border-radius: 999px;
}

.range::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -7.5px;
  appearance: none;
  background: var(--paper-50);
  border: 4px solid var(--orange);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.range::-moz-range-thumb {
  width: 13px;
  height: 13px;
  background: var(--paper-50);
  border: 4px solid var(--orange);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.range-scale {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  color: #858c81;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.range-scale span:nth-child(2) {
  text-align: center;
}

.mobile-reference-peek {
  display: none;
}

.pressure-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.pressure-heading > div {
  display: grid;
}

.pressure-heading small {
  color: #8e958a;
  font-size: 0.7rem;
}

.inline-select select {
  min-height: 34px;
  width: 82px;
  padding: 0 28px 0 10px;
  font-size: 0.74rem;
}

.pressure-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pressure-input {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 9px;
  min-width: 0;
  padding: 13px 14px 14px 17px;
  overflow: hidden;
  background: #20231f;
  border: 1px solid #40453e;
  border-radius: 13px;
}

.pressure-input::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--low);
}

.pressure-input--high::before {
  background: var(--high);
}

.pressure-input__port {
  align-self: start;
  color: var(--low);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.pressure-input--high .pressure-input__port {
  color: #ec766e;
}

.pressure-input__name {
  min-width: 0;
  overflow: hidden;
  color: #9ea59a;
  font-size: 0.68rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pressure-input__stepper {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.pressure-input__entry {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.pressure-input__stepper .pressure-input__entry {
  grid-column: auto;
  align-items: center;
  min-width: 0;
}

.pressure-input__entry input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--paper-50);
  background: transparent;
  border: 0;
  font-size: clamp(1.55rem, 2.6vw, 2.15rem);
  font-weight: 760;
  line-height: 1.2;
}

.pressure-input__entry input::placeholder {
  color: #62685f;
  font-size: 0.95rem;
  font-weight: 500;
}

.pressure-input__entry span {
  color: #8e958a;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.mode-context {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  color: #b5bbb1;
  background: #1d201d;
  border: 1px solid #3d423b;
  border-radius: 11px;
}

.mode-context__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 32px;
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  border: 1px solid #4a4f47;
  border-radius: 7px;
}

.mode-context p {
  margin: 0;
  font-size: 0.73rem;
  line-height: 1.45;
}

.mode-context strong {
  color: var(--paper-50);
}

.advanced {
  color: #d0d5cc;
  background: #1d201d;
  border: 1px solid #3d423b;
  border-radius: 12px;
}

.advanced summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 750;
  list-style: none;
}

.advanced summary::-webkit-details-marker {
  display: none;
}

.advanced summary::after {
  content: "+";
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 1.15rem;
}

.advanced[open] summary::after {
  content: "−";
}

.advanced summary small {
  margin-left: auto;
  color: #858d82;
  font-size: 0.68rem;
  font-weight: 500;
}

.advanced__body {
  display: grid;
  gap: 16px;
  padding: 0 14px 14px;
  border-top: 1px solid #363b35;
}

.advanced__body > .control-grid {
  padding-top: 14px;
}

.number-with-unit--field,
.number-with-unit--paper {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 10px;
}

.number-with-unit--field {
  background: #252824;
  border: 1px solid #444940;
}

.number-with-unit--field input,
.number-with-unit--paper input {
  width: 100%;
  min-height: auto;
  padding: 0;
  font-size: 1rem;
}

.stepper--field {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
}

.stepper--field .number-with-unit--field {
  min-width: 0;
  padding-inline: 9px;
}

.target-grid {
  padding-top: 0 !important;
}

.target-note {
  margin: -4px 0 0;
  color: #8f968b;
  font-size: 0.65rem;
  line-height: 1.5;
}

.envelope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.envelope-grid fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #3f443d;
  border-radius: 10px;
}

.envelope-grid legend {
  padding: 0 5px;
  color: #9fa69b;
  font-size: 0.66rem;
}

.mini-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 7px;
}

.mini-pair label {
  display: grid;
  color: #8e958a;
  font-size: 0.62rem;
}

.mini-pair input {
  width: 100%;
  min-height: 34px;
  margin-top: 4px;
  padding: 0 7px;
  color: var(--paper-50);
  background: #272a26;
  border: 1px solid #454a43;
  border-radius: 7px;
}

.mini-pair label span {
  display: none;
}

.advanced__note {
  margin: 0;
  color: #858c81;
  font-size: 0.68rem;
}

.form-message {
  padding: 10px 12px;
  color: #ffd9d5;
  background: rgba(180, 55, 44, 0.2);
  border: 1px solid rgba(235, 119, 108, 0.45);
  border-radius: 9px;
  font-size: 0.76rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.instant-note {
  margin-left: auto;
  color: #81887e;
  font-size: 0.67rem;
}

/* Result */
.reference-strip {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1px 1fr auto;
  align-items: center;
  gap: 17px;
  padding: 13px 14px;
  background: rgba(255,255,255,0.74);
  border: 1px solid var(--paper-200);
  border-radius: 13px;
}

.reference-strip > div {
  display: grid;
  gap: 2px;
}

.reference-strip span {
  color: var(--ink-500);
  font-size: 0.68rem;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reference-strip strong {
  color: var(--ink-900);
  font-size: clamp(1.05rem, 2vw, 1.42rem);
  letter-spacing: -0.045em;
}

.reference-strip strong small {
  color: var(--ink-500);
  font-size: 0.58em;
  font-weight: 600;
}

.reference-strip__divider {
  width: 1px;
  height: 34px;
  background: var(--paper-200);
}

.info-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--ink-700);
  background: var(--paper-150);
  border: 1px solid var(--paper-300);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
}

.gauges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 14px;
}

.gauge-wrap {
  min-width: 0;
  overflow: hidden;
  background: rgba(255,255,255,0.58);
  border: 1px solid var(--paper-200);
  border-radius: 16px;
}

.gauge-saturation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 7px 11px;
  background: rgba(255,255,255,0.48);
  border-top: 1px solid var(--paper-200);
}

.gauge-saturation span {
  color: var(--ink-500);
  font-size: 0.62rem;
  font-weight: 730;
  text-transform: uppercase;
}

.gauge-saturation strong {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gauge-svg {
  width: 100%;
  color: var(--ink-900);
}

.gauge-face {
  fill: #f8f6ef;
  stroke: #d7d0c2;
  stroke-width: 1.5;
}

.gauge-arc {
  fill: none;
  stroke: #d8d3c9;
  stroke-width: 10;
  stroke-linecap: round;
}

.gauge-band {
  fill: none;
  stroke: var(--low);
  stroke-width: 10;
  stroke-linecap: round;
}

.gauge-wrap--high .gauge-band {
  stroke: var(--high);
}

.gauge-tick {
  stroke: #8d9189;
  stroke-width: 1;
}

.gauge-tick--major {
  stroke: #555b53;
  stroke-width: 1.5;
}

.gauge-tick-label {
  fill: #777d74;
  font-family: var(--font-mono);
  font-size: 8px;
  text-anchor: middle;
}

.gauge-needle {
  stroke: var(--ink-900);
  stroke-width: 3;
  stroke-linecap: round;
}

.gauge-hub {
  fill: var(--ink-900);
  stroke: var(--paper-50);
  stroke-width: 3;
}

.gauge-side-label {
  fill: var(--low);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 1px;
  text-anchor: middle;
}

.gauge-wrap--high .gauge-side-label {
  fill: var(--high);
}

.gauge-reading {
  fill: var(--ink-900);
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -1px;
  text-anchor: middle;
}

.gauge-unit,
.gauge-status {
  fill: #777d74;
  font-family: var(--font-mono);
  font-size: 8px;
  text-anchor: middle;
}

.gauge-status--below {
  fill: var(--attention);
}

.gauge-status--above {
  fill: var(--warning);
}

.gauge-status--within {
  fill: var(--ok);
}

.gauge-empty .gauge-needle {
  opacity: 0.22;
}

.pt-handoff {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -2px 0 12px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.5);
  border: 1px dashed var(--paper-300);
  border-radius: 10px;
}

.pt-handoff > span {
  color: var(--ink-500);
  font-size: 0.64rem;
  font-weight: 730;
  white-space: nowrap;
}

.pt-handoff > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.pt-handoff button {
  min-height: 44px;
  padding: 6px 9px;
  color: var(--ink-700);
  background: var(--paper-50);
  border: 1px solid var(--paper-300);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 730;
}

.pt-handoff button:hover {
  color: var(--orange-dark);
  border-color: var(--orange);
}

.thermal-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.thermal-results > div {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 2px 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.58);
  border: 1px solid var(--paper-200);
  border-radius: 11px;
}

.thermal-results span {
  color: var(--ink-500);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.thermal-results strong {
  font-size: 1.15rem;
}

.thermal-results small {
  grid-column: 1 / -1;
  color: var(--ink-500);
  font-size: 0.65rem;
}

.thermal-results .thermal-target {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--paper-200);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 720;
}

.thermal-target[data-relation="above"] {
  color: var(--warning);
}

.thermal-target[data-relation="below"] {
  color: var(--attention);
}

.thermal-target[data-relation="match"] {
  color: var(--ok);
}

.diagnosis {
  position: relative;
  display: grid;
  grid-template-columns: 7px 1fr;
  gap: 14px;
  margin-top: 12px;
  padding: 15px;
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--paper-200);
  border-radius: 14px;
}

.diagnosis__marker {
  width: 7px;
  min-height: 100%;
  background: var(--ok);
  border-radius: 999px;
}

.diagnosis--attention .diagnosis__marker {
  background: var(--attention);
}

.diagnosis--warning .diagnosis__marker {
  background: var(--warning);
}

.diagnosis--neutral .diagnosis__marker {
  background: var(--ink-500);
}

.diagnosis__label {
  margin-bottom: 2px;
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.diagnosis h3 {
  margin-bottom: 5px;
  font-size: 1rem;
}

.diagnosis p:not(.diagnosis__label) {
  margin-bottom: 8px;
  color: #555a53;
  font-size: 0.75rem;
  line-height: 1.45;
}

.diagnosis ol {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 18px;
  color: #555a53;
  font-size: 0.7rem;
}

.result-notes {
  margin-top: 10px;
  border-top: 1px solid var(--paper-200);
  border-bottom: 1px solid var(--paper-200);
}

.result-notes summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-700);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 740;
  list-style: none;
}

.result-notes summary::-webkit-details-marker {
  display: none;
}

.result-notes summary span:last-child {
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 500;
}

.result-notes ul {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding-left: 18px;
  color: #666b63;
  font-size: 0.69rem;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.result-actions .button {
  min-width: 0;
  min-height: 44px;
  padding-inline: 9px;
}

.action-status {
  min-height: 1.3em;
  margin: 5px 0 0;
  color: var(--ok);
  font-size: 0.67rem;
  text-align: center;
}

.action-status.is-error {
  color: var(--warning);
}

.result-flash {
  animation: result-settle 280ms ease both;
}

@keyframes result-settle {
  from { opacity: 0.65; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.trust-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.12);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.trust-rail span {
  padding: 13px 16px;
  color: #8f978c;
  font-size: 0.69rem;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.1);
}

.trust-rail span:last-child {
  border-right: 0;
}

.trust-rail strong {
  color: #d7dbd3;
}

/* Sections */
.section {
  padding: 94px 0;
}

.section--light {
  background: var(--paper-100);
}

.section--paper {
  background: var(--paper-50);
  border-top: 1px solid var(--paper-200);
  border-bottom: 1px solid var(--paper-200);
}

.section--dark {
  color: var(--paper-100);
  background: var(--ink-900);
}

.section-grid--intro {
  display: grid;
  grid-template-columns: minmax(240px, 0.62fr) minmax(0, 1.38fr);
  gap: 78px;
  align-items: start;
}

.section-heading h2 {
  max-width: 820px;
  margin-bottom: 16px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.section-heading > p:not(.eyebrow) {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--ink-500);
  line-height: 1.7;
}

.section-heading--row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  align-items: end;
  gap: 50px;
  margin-bottom: 38px;
}

.section-heading--row h2 {
  margin-bottom: 0;
}

.section-heading--on-dark > p:not(.eyebrow) {
  color: #adb3a9;
}

/* Pattern matrix */
.pattern-matrix {
  border-top: 1px solid var(--paper-300);
}

.pattern-row {
  width: 100%;
  display: grid;
  grid-template-columns: 128px 1fr auto;
  align-items: center;
  gap: 22px;
  min-height: 90px;
  padding: 16px 0;
  color: var(--ink-900);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--paper-300);
  text-align: left;
  transition: padding 150ms ease, background-color 150ms ease;
}

.pattern-row:hover,
.pattern-row:focus-visible {
  padding-inline: 14px;
  background: rgba(255,255,255,0.55);
}

.pattern-row__pair {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
  border: 1px solid var(--paper-300);
  border-radius: 8px;
}

.pattern-row__pair b {
  padding: 8px 7px;
  color: var(--low);
  background: var(--low-soft);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-align: center;
}

.pattern-row__pair b:last-child {
  color: var(--high);
  background: var(--high-soft);
  border-left: 1px solid var(--paper-300);
}

.pattern-row > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.pattern-row strong {
  font-size: 0.98rem;
}

.pattern-row small {
  color: var(--ink-500);
  font-size: 0.73rem;
}

.pattern-row > span:last-child {
  color: var(--orange-dark);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 750;
}

/* PT tool */
.pt-tool {
  display: grid;
  grid-template-columns: minmax(280px, 0.64fr) minmax(0, 1.36fr);
  overflow: hidden;
  background: var(--paper-100);
  border: 1px solid var(--paper-300);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-paper);
}

.pt-tool__controls {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 26px;
  background: var(--paper-150);
  border-right: 1px solid var(--paper-300);
}

.segmented--paper {
  background: var(--paper-200);
  border-color: var(--paper-300);
}

.segmented--paper .segmented__button {
  color: var(--ink-500);
  font-size: 0.72rem;
}

.segmented--paper .segmented__button.is-active {
  color: var(--paper-50);
  background: var(--ink-900);
}

.field--paper .field__label {
  color: var(--ink-700);
}

.field--paper select,
.field--paper input {
  color: var(--ink-900);
  background: var(--paper-50);
  border-color: var(--paper-300);
}

.pt-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.8fr);
  gap: 12px;
}

.number-with-unit--paper {
  color: var(--ink-900);
  background: var(--paper-50);
  border: 1px solid var(--paper-300);
}

.number-with-unit--paper span {
  color: var(--ink-500);
}

.pt-unit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pt-unit-row label {
  flex: 1 1 120px;
  display: grid;
  gap: 5px;
  color: var(--ink-500);
  font-size: 0.67rem;
  font-weight: 700;
}

.pt-unit-row select {
  min-height: 38px;
  padding: 0 10px;
  color: var(--ink-900);
  background: var(--paper-50);
  border: 1px solid var(--paper-300);
  border-radius: 8px;
}

.pt-elevation-chip {
  min-height: 44px;
  width: 100%;
  padding: 7px 10px;
  color: var(--orange-dark);
  background: var(--orange-soft);
  border: 1px solid #efbaa5;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 730;
  text-align: left;
}

.pt-elevation-chip:hover {
  border-color: var(--orange-dark);
}

.form-message--paper {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #e5b5af;
}

.pt-tool__output {
  min-width: 0;
  padding: 26px;
}

.pt-readout {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--paper-300);
}

.pt-readout > span {
  align-self: end;
  color: var(--ink-500);
  font-size: 0.75rem;
}

.pt-readout > strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.9;
  letter-spacing: -0.07em;
}

.pt-readout > strong small {
  color: var(--ink-500);
  font-size: 0.32em;
  letter-spacing: 0;
}

.pt-readout__curves {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--ink-500);
  font-size: 0.7rem;
}

.pt-readout__curves span {
  display: inline-flex;
  gap: 5px;
}

.pt-readout__curves b {
  color: var(--ink-800);
  font-family: var(--font-mono);
}

.curve-chart {
  margin-top: 18px;
}

.curve-chart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink-700);
  font-size: 0.72rem;
  font-weight: 720;
}

.curve-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-500);
  font-size: 0.62rem;
  font-weight: 500;
}

.curve-legend i {
  width: 18px;
  height: 2px;
  display: inline-block;
  background: var(--orange);
}

.curve-legend__dew {
  background: var(--low) !important;
}

#pt-curve-chart {
  width: 100%;
  height: auto;
  margin-top: 8px;
  overflow: visible;
}

.chart-grid {
  stroke: #ddd8ce;
  stroke-width: 1;
}

.chart-axis {
  fill: #777c74;
  font-family: var(--font-mono);
  font-size: 10px;
}

.chart-bubble,
.chart-dew {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.chart-bubble {
  stroke: var(--orange);
}

.chart-dew {
  stroke: var(--low);
  stroke-dasharray: 7 5;
}

.chart-area {
  fill: rgba(245,103,47,0.07);
}

.chart-marker-line {
  stroke: var(--ink-700);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.chart-marker-dot {
  fill: var(--ink-900);
  stroke: var(--paper-50);
  stroke-width: 3;
}

.chart-marker-label {
  fill: var(--ink-900);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 750;
}

.chart-details {
  margin-top: 22px;
  background: var(--paper-100);
  border: 1px solid var(--paper-300);
  border-radius: 14px;
}

.chart-details > summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 17px;
  cursor: pointer;
  font-weight: 760;
  list-style: none;
}

.chart-details > summary::-webkit-details-marker {
  display: none;
}

.chart-details > summary span:last-child {
  color: var(--ink-500);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
}

.chart-details__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 17px;
  border-top: 1px solid var(--paper-300);
  border-bottom: 1px solid var(--paper-300);
}

.chart-details__toolbar p {
  margin: 0;
  color: var(--ink-500);
  font-size: 0.72rem;
}

.table-scroll {
  max-height: 520px;
  overflow: auto;
  overscroll-behavior: contain;
}

.pressure-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.pressure-table caption {
  padding: 12px 17px;
  color: var(--ink-500);
  font-size: 0.72rem;
  text-align: left;
}

.pressure-table th,
.pressure-table td {
  padding: 10px 17px;
  border-top: 1px solid var(--paper-200);
  text-align: right;
}

.pressure-table th:first-child,
.pressure-table td:first-child {
  text-align: left;
}

.pressure-table thead th {
  position: sticky;
  z-index: 2;
  top: 0;
  color: var(--ink-700);
  background: var(--paper-150);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.pressure-table tbody td {
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.pressure-table tbody tr:hover,
.pressure-table tbody tr.is-highlighted {
  background: var(--orange-soft);
}

/* Cycle */
.cycle-explainer {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 70px;
  align-items: center;
}

.cycle-diagram {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, 170px);
  gap: 70px 120px;
  padding: 36px;
  border: 1px solid #3d413c;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px),
    var(--ink-850);
  background-size: 28px 28px;
}

.cycle-node {
  position: relative;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 4px;
  min-width: 0;
  padding: 18px;
  background: var(--ink-900);
  border: 1px solid #52584f;
  border-radius: 16px;
  text-align: center;
}

.cycle-node span {
  position: absolute;
  top: 10px;
  left: 12px;
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.cycle-node strong {
  font-size: 0.96rem;
}

.cycle-node small {
  color: #969d92;
  font-size: 0.69rem;
}

.cycle-node--meter {
  grid-column: 2;
  grid-row: 2;
}

.cycle-node--evaporator {
  grid-column: 1;
  grid-row: 2;
}

.cycle-arrow {
  position: absolute;
  z-index: 1;
  color: #8e958a;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  text-transform: uppercase;
}

.cycle-arrow--top {
  top: 114px;
  left: 38%;
}

.cycle-arrow--right {
  top: 47%;
  right: 75px;
}

.cycle-arrow--bottom {
  bottom: 114px;
  left: 39%;
}

.cycle-arrow--left {
  top: 47%;
  left: 75px;
}

.formula-stack {
  display: grid;
  gap: 18px;
}

.formula-stack article {
  padding: 20px 0;
  border-top: 1px solid #424740;
}

.formula-stack article:last-of-type {
  border-bottom: 1px solid #424740;
}

.formula-tag {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--orange);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.formula-stack h3 {
  margin-bottom: 7px;
  font-size: 1.18rem;
}

.formula-stack p {
  margin-bottom: 12px;
  color: #aeb4aa;
  font-size: 0.8rem;
}

.formula-stack code {
  display: block;
  padding: 10px 12px;
  color: #e2e6df;
  background: #131513;
  border: 1px solid #393d38;
  border-radius: 8px;
  font-size: 0.73rem;
  white-space: normal;
}

.formula-stack__note {
  margin: 0;
  padding-left: 13px;
  color: #92998e !important;
  border-left: 3px solid var(--orange);
}

/* Method and sources */
.method-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.28fr);
  gap: 34px 80px;
}

.method-layout__heading {
  grid-row: 1 / span 2;
}

.text-link {
  display: inline-flex;
  gap: 8px;
  margin-top: 22px;
  color: var(--orange-dark);
  font-weight: 760;
  text-decoration: none;
}

.method-steps {
  border-top: 1px solid var(--paper-300);
}

.method-steps article {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 20px;
  padding: 21px 0;
  border-bottom: 1px solid var(--paper-300);
}

.method-steps article > span {
  color: var(--orange-dark);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
}

.method-steps h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.method-steps p {
  margin: 0;
  color: var(--ink-500);
  font-size: 0.78rem;
}

.safety-panel {
  grid-column: 2;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 17px;
  padding: 20px;
  color: var(--paper-100);
  background: var(--ink-900);
  border-radius: 14px;
}

.safety-panel__signal {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: var(--ink-950);
  background: var(--orange);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 850;
}

.safety-panel h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.safety-panel p {
  margin: 0;
  color: #b3b9af;
  font-size: 0.75rem;
}

.source-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: 44px 80px;
}

.source-list {
  border-top: 1px solid var(--paper-300);
}

.source-list article {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 20px;
  padding: 21px 0;
  border-bottom: 1px solid var(--paper-300);
}

.source-list__type {
  color: var(--orange-dark);
  font-size: 0.63rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.source-list h3 {
  margin-bottom: 5px;
  font-size: 1rem;
}

.source-list p {
  margin-bottom: 8px;
  color: var(--ink-500);
  font-size: 0.75rem;
}

.source-list a {
  color: var(--orange-dark);
  font-size: 0.72rem;
  font-weight: 760;
  text-decoration: none;
}

.api-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 28px 40px;
  padding: 28px;
  color: var(--paper-100);
  background: var(--ink-900);
  border-radius: var(--radius-lg);
}

.api-panel__tag {
  display: block;
  margin-bottom: 9px;
  color: var(--orange);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.api-panel h3 {
  margin-bottom: 8px;
  font-size: 1.4rem;
}

.api-panel p {
  margin: 0;
  color: #aeb4aa;
  font-size: 0.79rem;
}

.api-example {
  align-self: center;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px;
  background: #101210;
  border: 1px solid #3a3f38;
  border-radius: 10px;
}

.api-example code {
  align-self: center;
  min-width: 0;
  overflow: hidden;
  color: #d7dcd3;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 18px;
  border-top: 1px solid #3b4039;
}

.api-links a {
  padding: 7px 10px;
  color: #c8cec4;
  border: 1px solid #484e45;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-decoration: none;
}

.api-links a:hover {
  color: var(--white);
  border-color: #737b6d;
}

/* Questions */
.questions__grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(0, 1.3fr);
  gap: 80px;
}

.question-list {
  border-top: 1px solid var(--paper-300);
}

.question-list details {
  border-bottom: 1px solid var(--paper-300);
}

.question-list summary {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  font-weight: 760;
  list-style: none;
}

.question-list summary::-webkit-details-marker {
  display: none;
}

.question-list summary::after {
  content: "+";
  color: var(--orange-dark);
  font-family: var(--font-mono);
  font-size: 1.2rem;
}

.question-list details[open] summary::after {
  content: "−";
}

.question-list p {
  max-width: 760px;
  margin-bottom: 20px;
  color: var(--ink-500);
  font-size: 0.82rem;
}

/* Footer */
.site-footer {
  color: #b7bdb3;
  background: var(--ink-950);
}

.site-footer__top,
.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.site-footer__top {
  min-height: 126px;
  border-bottom: 1px solid #343833;
}

.site-footer__top p {
  max-width: 460px;
  margin: 0;
  color: #858d82;
  font-size: 0.76rem;
  text-align: right;
}

.brand--footer {
  color: var(--paper-100);
}

.site-footer__bottom {
  min-height: 68px;
  font-size: 0.7rem;
}

.site-footer__bottom nav {
  display: flex;
  gap: 20px;
}

.site-footer__bottom a {
  color: #b5bbb1;
  text-decoration: none;
}

.site-footer__bottom a:hover {
  color: var(--white);
}

/* Dialogs */
.legal-dialog {
  width: min(calc(100% - 32px), 720px);
  max-height: min(86vh, 820px);
  padding: 0;
  overflow: hidden;
  color: var(--ink-900);
  background: var(--paper-50);
  border: 1px solid var(--paper-300);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.45);
}

.legal-dialog::backdrop {
  background: rgba(12,14,12,0.78);
}

.legal-dialog__header,
.legal-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 20px;
  background: var(--paper-100);
}

.legal-dialog__header {
  border-bottom: 1px solid var(--paper-300);
}

.legal-dialog__header span {
  color: var(--orange-dark);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-dialog__header h2 {
  margin: 2px 0 0;
  font-size: 1.35rem;
}

.dialog-close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--ink-700);
  background: transparent;
  border: 1px solid var(--paper-300);
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
}

.legal-dialog__body {
  max-height: calc(86vh - 150px);
  padding: 22px 24px;
  overflow-y: auto;
}

.legal-dialog__body p {
  color: var(--ink-500);
  font-size: 0.82rem;
}

.legal-dialog__body h3 {
  margin: 24px 0 5px;
  font-size: 0.96rem;
}

.legal-dialog__footer {
  justify-content: flex-end;
  border-top: 1px solid var(--paper-300);
}

.noscript-notice {
  position: fixed;
  z-index: 500;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 14px;
  color: var(--ink-950);
  background: #ffe7a5;
  border: 1px solid #d39c1e;
  border-radius: 10px;
  text-align: center;
}

/* Responsive */
@media (max-width: 1120px) {
  .site-nav {
    gap: 18px;
  }

  .instrument {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }

  .instrument__controls,
  .instrument__result {
    padding: 22px;
  }

  .cycle-diagram {
    gap: 56px 70px;
  }
}

@media (max-width: 960px) {
  :root {
    --header-height: 64px;
  }

  .site-header__inner {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    display: none;
  }

  .hero {
    padding-top: 42px;
  }

  .hero__heading,
  .section-heading--row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero__lede {
    max-width: 720px;
  }

  .instrument {
    grid-template-columns: 1fr;
  }

  .instrument__result {
    border-top: 1px solid rgba(0,0,0,0.16);
    border-left: 0;
  }

  .trust-rail {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-rail span:nth-child(2) {
    border-right: 0;
  }

  .trust-rail span:nth-child(-n+2) {
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .section-grid--intro,
  .cycle-explainer,
  .method-layout,
  .source-layout,
  .questions__grid {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .method-layout__heading {
    grid-row: auto;
  }

  .safety-panel {
    grid-column: auto;
  }

  .pt-tool {
    grid-template-columns: 1fr;
  }

  .pt-tool__controls {
    border-right: 0;
    border-bottom: 1px solid var(--paper-300);
  }

  .api-panel {
    grid-template-columns: 1fr;
  }

  .api-links,
  .api-panel {
    grid-column: auto;
  }

  .cycle-diagram {
    max-width: 720px;
    width: 100%;
    justify-self: center;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(calc(100% - 28px), var(--shell));
  }

  .brand__text small,
  .offline-state {
    display: none;
  }

  .header-actions .button {
    min-width: 0;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 13vw, 4.4rem);
  }

  .hero__heading {
    margin-bottom: 22px;
  }

  .instrument {
    border-radius: 22px;
  }

  .envelope-grid,
  .gauges,
  .thermal-results,
  .pt-entry-row {
    grid-template-columns: 1fr;
  }

  #pressure-form > .control-grid--two,
  .pressure-inputs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .advanced__body .control-grid--two {
    grid-template-columns: 1fr;
  }

  .mobile-reference-peek {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: stretch;
    gap: 8px;
    padding: 9px;
    color: var(--ink-900);
    background: var(--paper-100);
    border: 1px solid var(--paper-300);
    border-radius: 12px;
  }

  .mobile-reference-peek > div {
    display: grid;
    align-content: center;
    gap: 2px;
    min-width: 0;
    padding: 4px 7px;
  }

  .mobile-reference-peek span {
    color: var(--ink-500);
    font-size: 0.58rem;
    font-weight: 760;
    letter-spacing: 0.055em;
    text-transform: uppercase;
  }

  .mobile-reference-peek strong {
    min-width: 0;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-reference-peek strong small {
    color: var(--ink-500);
    font-size: 0.7em;
  }

  .mobile-reference-peek button {
    min-height: 44px;
    padding: 8px 10px;
    color: var(--paper-50);
    background: var(--ink-900);
    border: 0;
    border-radius: 8px;
    font-size: 0.67rem;
    font-weight: 760;
    white-space: nowrap;
  }

  .gauge-wrap {
    max-width: 390px;
    width: 100%;
    justify-self: center;
  }

  .pressure-input__stepper {
    grid-template-columns: minmax(0, 1fr) 44px;
    grid-template-rows: 44px 44px;
    gap: 5px 6px;
  }

  .pressure-input__stepper .stepper__button:first-child {
    grid-column: 2;
    grid-row: 1;
  }

  .pressure-input__stepper .pressure-input__entry {
    grid-column: 1;
    grid-row: 1 / 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: 0;
  }

  .pressure-input__stepper .pressure-input__entry input {
    width: 100%;
    min-width: 44px;
  }

  .pressure-input__stepper .pressure-input__entry span {
    min-height: 16px;
    line-height: 1.1;
  }

  .pressure-input__stepper .stepper__button:last-child {
    grid-column: 2;
    grid-row: 2;
  }

  .pt-handoff {
    align-items: stretch;
    flex-direction: column;
  }

  .pt-handoff > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pt-handoff button,
  .elevation-badge,
  .pt-elevation-chip {
    min-height: 44px;
  }

  .result-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: sticky;
    z-index: 8;
    bottom: 8px;
    padding: 7px;
    background: rgba(243,240,231,0.95);
    border: 1px solid var(--paper-300);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(40,32,22,0.16);
  }

  .brand,
  .button--small,
  .segmented--compact .segmented__button,
  .inline-select select,
  .result-actions .button,
  .pt-unit-row select,
  .info-button,
  .result-notes summary {
    min-height: 44px;
  }

  .info-button {
    width: 44px;
    height: 44px;
  }

  .range {
    height: 44px;
  }

  .number-with-unit input,
  .pressure-input__entry input {
    min-height: 44px;
  }

  .result-actions .button {
    padding-inline: 9px;
    font-size: 0.7rem;
  }

  .section {
    padding: 70px 0;
  }

  .section-heading h2 {
    font-size: clamp(2rem, 11vw, 3.4rem);
  }

  .pattern-row {
    grid-template-columns: 108px 1fr;
    gap: 14px;
  }

  .pattern-row > span:last-child {
    display: none;
  }

  .pt-readout {
    grid-template-columns: 1fr;
  }

  .pt-readout > strong {
    grid-row: auto;
    grid-column: auto;
  }

  .chart-details__toolbar,
  .site-footer__top,
  .site-footer__bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer__top,
  .site-footer__bottom {
    justify-content: center;
    padding-block: 26px;
  }

  .site-footer__top p {
    text-align: left;
  }

  .site-footer__bottom nav {
    flex-wrap: wrap;
  }

  .cycle-diagram {
    grid-template-rows: repeat(2, 125px);
    gap: 54px 34px;
    padding: 20px;
  }

  .cycle-arrow--top,
  .cycle-arrow--bottom {
    left: 38%;
  }

  .cycle-arrow--right {
    right: 30px;
  }

  .cycle-arrow--left {
    left: 30px;
  }

  .source-list article {
    grid-template-columns: 78px 1fr;
  }

  .api-example {
    grid-template-columns: 1fr;
  }

  .api-example code {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 520px) {
  .site-header__inner {
    gap: 10px;
  }

  .brand__mark {
    width: 36px;
    height: 36px;
  }

  .brand__text strong {
    font-size: 0.86rem;
  }

  .hero {
    padding-top: 28px;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 11.5vw, 3.65rem);
  }

  .hero__lede {
    font-size: 0.86rem;
    line-height: 1.55;
  }

  .instrument__controls,
  .instrument__result,
  .pt-tool__controls,
  .pt-tool__output {
    padding: 18px;
  }

  .instrument__topline,
  .result-topline {
    margin-bottom: 17px;
  }

  .calibration-tag {
    display: none;
  }

  .segmented--large .segmented__button {
    padding-inline: 8px;
    font-size: 0.76rem;
  }

  .ambient-control__top {
    align-items: center;
    gap: 6px;
  }

  .stepper--ambient {
    gap: 4px;
  }

  .stepper--ambient .number-with-unit {
    min-width: 70px;
  }

  .number-with-unit input {
    width: 82px;
    font-size: 1.75rem;
  }

  .stepper--ambient .number-with-unit input {
    width: 54px;
  }

  .result-topline {
    align-items: flex-start;
  }

  .result-topline__badges {
    max-width: 52%;
  }

  .session-toast {
    right: 14px;
    bottom: 14px;
    left: 14px;
    max-width: none;
    justify-content: space-between;
  }

  .mobile-reference-peek {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-reference-peek button {
    grid-column: 1 / -1;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .instant-note {
    grid-column: 1 / -1;
    margin-left: 0;
    text-align: center;
  }

  .reference-strip {
    grid-template-columns: 1fr 1px 1fr;
    gap: 10px;
    padding: 11px;
  }

  .reference-strip .info-button {
    position: absolute;
    top: -13px;
    right: -8px;
  }

  .result-actions .button span[aria-hidden="true"] {
    display: none;
  }

  .trust-rail span {
    padding-inline: 8px;
  }

  .pattern-row {
    grid-template-columns: 94px 1fr;
  }

  .pattern-row__pair b {
    padding-inline: 4px;
    font-size: 0.58rem;
  }

  .pattern-row small {
    font-size: 0.68rem;
  }

  .pt-readout > strong {
    font-size: 2.6rem;
  }

  .curve-chart__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .pressure-table th,
  .pressure-table td {
    padding-inline: 11px;
  }

  .cycle-diagram {
    grid-template-rows: repeat(2, 112px);
    gap: 48px 18px;
    padding: 14px;
  }

  .cycle-node {
    padding: 12px 6px;
  }

  .cycle-node strong {
    font-size: 0.76rem;
  }

  .cycle-node small {
    font-size: 0.59rem;
  }

  .cycle-arrow {
    font-size: 0.52rem;
  }

  .cycle-arrow--top,
  .cycle-arrow--bottom {
    left: 35%;
  }

  .cycle-arrow--right {
    right: 16px;
  }

  .cycle-arrow--left {
    left: 16px;
  }

  .safety-panel {
    grid-template-columns: 42px 1fr;
    padding: 16px;
  }

  .safety-panel__signal {
    width: 42px;
    height: 42px;
  }

  .source-list article {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .legal-dialog__body {
    padding-inline: 18px;
  }
}

@media (max-width: 380px) {
  .ambient-control__top {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .stepper--ambient {
    flex: 1 1 100%;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .stepper--ambient .number-with-unit {
    justify-content: center;
  }

  .ambient-control__top .segmented {
    margin-left: auto;
  }

  .stepper--elevation {
    grid-template-columns: 44px minmax(62px, 1fr) 56px 44px;
    gap: 4px;
  }

  .result-topline {
    flex-direction: column;
    gap: 10px;
  }

  .result-topline__badges {
    max-width: none;
    justify-content: flex-start;
  }

  .session-toast {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  :root {
    color-scheme: light;
  }

  body {
    color: #000;
    background: #fff;
  }

  .site-header,
  .session-toast,
  .hero__backdrop,
  .hero__heading,
  .instrument__controls,
  .trust-rail,
  .pt-handoff,
  .result-actions,
  .action-status,
  .section:not(#pt-lookup):not(#method),
  .site-footer,
  .legal-dialog,
  .button,
  .curve-chart {
    display: none !important;
  }

  .hero,
  .section,
  .section--paper {
    padding: 0;
    color: #000;
    background: #fff;
    border: 0;
  }

  .instrument {
    display: block;
    min-height: auto;
    color: #000;
    background: #fff;
    border: 0;
    box-shadow: none;
  }

  .instrument__result {
    padding: 0 0 24px;
    background: #fff;
    border: 0;
  }

  .pt-tool {
    box-shadow: none;
  }

  .chart-details {
    display: block;
  }

  .chart-details > summary,
  .chart-details__toolbar,
  .pt-tool {
    display: none !important;
  }

  .table-scroll {
    max-height: none;
    overflow: visible;
  }

  .pressure-table thead th {
    position: static;
  }

  .gauge-wrap,
  .reference-strip,
  .diagnosis,
  .thermal-results > div {
    break-inside: avoid;
  }
}
