:root {
  color-scheme: light;
  --ice: #edf4f8;
  --paper: #fff;
  --panel: #f5f9fc;
  --navy: #0d2437;
  --navy-deep: #091d2f;
  --ink: #132a3f;
  --muted: #435d71;
  --line: #ccdde8;
  --field-line: #9bb4c5;
  --signal: #067289;
  --signal-dark: #075c72;
  --signal-light: #96e7f1;
  --signal-soft: #dff3f7;
  --amber: #a35b15;
  --amber-soft: #fff2df;
  --body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --shadow: 0 14px 30px -23px #153b526e;
  font-family: var(--body);
  font-variant-numeric: tabular-nums;
  background: var(--ice);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1.2rem; }
body { margin: 0; font-size: 1rem; line-height: 1.55; }
a { color: var(--signal-dark); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .12em; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #00718b; outline-offset: 3px; }
.site-header :focus-visible, .hero :focus-visible { outline-color: var(--signal-light); }

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.13; letter-spacing: -.028em; }
h1 { font-size: clamp(2rem, 4vw, 3.55rem); }
h2 { font-size: clamp(1.45rem, 2.35vw, 2.12rem); }
h3 { font-size: 1.12rem; }
svg { display: block; }
.wrap { width: min(1192px, calc(100% - 64px)); margin-inline: auto; }

.skip-link {
  position: absolute;
  z-index: 2;
  top: .45rem;
  left: .45rem;
  transform: translateY(-150%);
  background: var(--paper);
  padding: .65rem 1rem;
  border-radius: .45rem;
}
.skip-link:focus { transform: translateY(0); }

.site-header { background: var(--navy); border-bottom: 1px solid #2c4e62; color: var(--paper); }
.nav-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav-inner { min-height: 68px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .62rem;
  color: #f1f9fd;
  font-size: 1.22rem;
  font-weight: 740;
  letter-spacing: -.04em;
  text-decoration: none;
  white-space: nowrap;
}
.brand span span { color: var(--signal-light); }
.brand svg { width: 38px; height: 38px; flex: 0 0 auto; }
.site-header nav, .site-footer nav { display: flex; flex-wrap: wrap; gap: .4rem 1.7rem; }
.site-header nav a, .site-footer nav a { color: #dbeef5; font-size: .9rem; font-weight: 610; text-decoration: none; }
.site-header nav a:hover, .site-footer nav a:hover, .site-header [aria-current="page"] {
  color: var(--signal-light);
  text-decoration: underline;
}

.hero {
  color: #f4fbff;
  background: radial-gradient(ellipse at 84% 35%, #18394f 0%, #0c2438 52%, #091e31 100%);
  border-bottom: 4px solid #347d91;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.6rem, 5vw, 4.6rem);
  padding-block: 3.4rem;
}
.eyebrow {
  font-family: var(--mono);
  color: var(--signal-dark);
  font-weight: 650;
  font-size: .73rem;
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.hero .eyebrow { color: #a1dce9; margin-bottom: .85rem; }
.hero h1 {
  color: #f4fbff;
  font-size: clamp(3rem, 5.05vw, 4.95rem);
  line-height: .98;
  letter-spacing: -.064em;
}
.hero h1 em { color: var(--signal-light); font-style: normal; }
.hero-copy { color: #c0d7e3; max-width: 43ch; font-size: 1.13rem; line-height: 1.55; margin-top: 1.45rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.button {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  border: 1px solid var(--field-line);
  border-radius: 7px;
  padding: .54rem .88rem;
  background: var(--paper);
  color: var(--ink);
  font-size: .88rem;
  font-weight: 680;
  text-decoration: none;
}
.button:hover { border-color: var(--signal); text-decoration: none; }
.button-bright { background: #9ae5ef; border-color: #9ae5ef; color: #0d2b3f; }
.button-bright:hover { background: #bef5fa; }
.button-dark { color: #eefaff; border-color: #59798c; background: #15374d; }
.button-dark:hover { border-color: var(--signal-light); }
.hero-detail { color: #b7d2de; margin-top: 1.2rem; font-size: .80rem; display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #7fe1ec; }
.hero-art { align-self: center; width: 100%; height: auto; filter: drop-shadow(0 24px 30px #060e1c70); }

.catalog { padding-block: 3rem 2.3rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-heading h2 { font-size: clamp(1.95rem, 4vw, 2.72rem); }
.section-heading p { margin-top: .45rem; color: var(--muted); }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.tool-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.13rem 1.15rem;
  text-decoration: none;
}
.tool-card:hover { border-color: #63a9ba; box-shadow: 0 12px 32px -22px #00718b8a; }
.tool-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.05rem; }
.tool-icon-box {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--signal-soft);
  border: 1px solid #cae6eb;
  color: var(--signal-dark);
}
.tool-icon { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.card-arrow { color: var(--signal-dark); font-size: 1.1rem; line-height: 1; flex: 0 0 auto; }
.tool-card .tool-category {
  color: var(--signal-dark);
  font: 650 .68rem/1.35 var(--mono);
  text-transform: uppercase;
  letter-spacing: .045em;
  margin-bottom: .45rem;
}
.tool-card h3 { font-size: 1.19rem; margin-bottom: .55rem; }
.tool-card p { color: var(--muted); font-size: .87rem; line-height: 1.46; }
.home-notes { padding-bottom: 3rem; }
.site-footer { background: var(--navy-deep); color: var(--paper); }
.footer-inner { min-height: 95px; padding-block: 1rem; }

.crumbs { margin-block: 1.28rem 1.35rem; color: var(--muted); font-size: .83rem; }
.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; gap: .3rem .55rem; margin: 0; padding: 0; }
.crumbs li + li::before { content: '/'; margin-right: .55rem; color: #5b7587; }
.crumbs a { color: var(--muted); }
.calc-intro {
  display: flex;
  gap: 1.3rem 1.9rem;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 1.45rem;
}
.calc-intro h1 { margin-block: .38rem .54rem; max-width: 24ch; }
.calc-intro p:not(.eyebrow), .document-heading p { color: var(--muted); max-width: 65ch; }
.calculator { padding-bottom: 3.6rem; }
.segment {
  display: inline-flex;
  flex: 0 0 auto;
  align-self: start;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #e1edf4;
  padding: .2rem;
  gap: .16rem;
}
.unit-switch { align-self: flex-end; }
.segment button {
  min-height: 36px;
  padding: .39rem .69rem;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #315269;
  background: transparent;
  font-size: .83rem;
  font-weight: 680;
  white-space: nowrap;
}
.segment button[aria-pressed="true"] { border-color: #b8d6e3; background: var(--paper); color: var(--signal-dark); box-shadow: 0 1px 2px #143d5612; }
.telemetry {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border: 1px solid #2d4c61;
  border-radius: 11px;
  background: #133149;
  color: var(--paper);
}
.telemetry > div { min-width: 0; padding: 1rem 1.1rem 1.05rem; }
.telemetry > div + div { border-left: 1px solid #3a566b; }
.telemetry dt {
  color: #c7e3ed;
  font: 650 .74rem/1.45 var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.telemetry dd { margin: .18rem 0 0; }
.telemetry [data-number] { display: block; color: #a9f0f5; font-size: clamp(1.48rem, 3.1vw, 2.45rem); font-weight: 720; line-height: 1.08; letter-spacing: -.04em; overflow-wrap: anywhere; }
.telemetry [data-unit] { display: block; min-height: 1em; color: #c2dbe8; font-size: .77rem; margin-top: .3rem; }
.action-bar { margin-block: .85rem; display: flex; flex-wrap: wrap; gap: .45rem; }
.action-bar button {
  min-height: 40px;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 660;
  padding: .38rem .72rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}
.action-bar button:not(:disabled):hover { color: var(--signal-dark); border-color: var(--signal); }
.action-bar [data-action="share"] { background: var(--signal-soft); border-color: #aaccd6; color: var(--signal-dark); }
.action-bar [data-action="reset"] { margin-left: auto; }
.mobile-inputs { display: none; }

.share-pane { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: .8rem; margin-bottom: .9rem; }
.share-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; }
.share-head label { font-weight: 670; font-size: .92rem; }
.share-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; margin-block: .55rem .3rem; }
.share-row input { width: 100%; min-width: 0; border: 1px solid var(--field-line); border-radius: 6px; padding: .4rem .55rem; color: var(--ink); background: var(--panel); font: .83rem var(--mono); }
.download-status { font-size: .83rem; color: var(--signal-dark); margin-bottom: .6rem; }
.download-status:empty { margin: 0; }

.calculation-grid { display: grid; grid-template-columns: minmax(0, .89fr) minmax(0, 1.25fr); gap: 1rem; align-items: start; }
.card, .info-block { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { font-size: 1.32rem; }
.input-panel { padding: 1.13rem; }
.panel-top { margin-bottom: 1.02rem; }
.panel-top p { color: var(--muted); font-size: .88rem; margin-top: .23rem; }
fieldset { min-width: 0; padding: .54rem 0 .05rem; margin: 0; border: 0; border-top: 1px solid var(--line); }
fieldset + fieldset { margin-top: 1.25rem; }
legend { padding: 0 .42rem 0 0; color: var(--signal-dark); font-size: .86rem; font-weight: 720; }
.helper { color: var(--muted); font-size: .79rem; line-height: 1.45; }
fieldset .helper { margin-bottom: .65rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem .7rem; }
.field { display: flex; min-width: 0; flex-direction: column; align-self: stretch; }
.field-select { grid-column: 1 / -1; }
.field label { display: block; margin: 0 0 .24rem; color: var(--ink); font-size: .78rem; font-weight: 640; line-height: 1.3; }
.quantity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-top: auto;
  min-height: 41px;
  background: var(--panel);
  border: 1px solid var(--field-line);
  border-radius: 6px;
}
.quantity:focus-within { outline: 2px solid var(--signal); outline-offset: 1px; }
.quantity:has([aria-invalid="true"]) { border-color: #a82422; }
.quantity input {
  width: 100%;
  min-width: 0;
  min-height: 39px;
  border: 0;
  border-radius: 6px;
  padding: .35rem .24rem .35rem .6rem;
  outline: none;
  color: var(--ink);
  background: transparent;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
}
.quantity input::-webkit-inner-spin-button, .quantity input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.quantity span { max-width: 6.2rem; padding-right: .46rem; color: #34536a; font-size: .69rem; line-height: 1.15; overflow-wrap: anywhere; }
.quantity span:empty { display: none; }
#unit-exchanges { max-width: none; white-space: nowrap; }
.field select {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  margin-top: auto;
  padding: .42rem 2.12rem .42rem .62rem;
  border: 1px solid var(--field-line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--panel);
  font-size: .9rem;
}
.results-stack { min-width: 0; display: grid; gap: 1rem; align-content: start; }
.calc-status, .noscript {
  border: 1px solid #e7c495;
  border-left: 4px solid #ba722a;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #67390e;
  padding: .72rem .82rem;
  font-size: .85rem;
  line-height: 1.45;
}
.calc-status p + p { margin-top: .45rem; }
.calc-status.is-error { border-color: #dda9a7; border-left-color: #b63b37; background: #fae9e8; color: #702623; }
.noscript { margin: 1rem 0; }
.diagram-card, .readouts { padding: 1.13rem; }
.diagram-card h2 { margin-bottom: .78rem; }
.diagram-svg { width: 100%; height: auto; }
.diagram-note { color: var(--muted); font-size: .82rem; margin-top: .68rem; line-height: 1.45; }
.readout-list { margin: .56rem 0 0; }
.readout-list > div { display: flex; justify-content: space-between; gap: .5rem 1.1rem; padding: .47rem 0; border-top: 1px solid #e1ebf0; }
.readout-list dt { color: var(--muted); font-size: .84rem; }
.readout-list dd { margin: 0; text-align: right; font-size: .86rem; font-weight: 680; max-width: 46%; overflow-wrap: anywhere; }
.readout-list [data-unit], .scenario-steps [data-unit] { font-weight: 500; color: var(--muted); padding-left: .32em; }

.info-block { margin-top: 1.2rem; padding: clamp(1.1rem, 2.4vw, 1.7rem); }
.info-block h2 { margin-bottom: .56rem; }
.info-block p { color: var(--muted); }
.info-block > p + p { margin-top: .7rem; }
.example-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem 1.4rem; }
.example-heading > a { align-self: center; font-weight: 650; font-size: .86rem; }
.example-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin-top: 1rem; }
.example-grid a {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: .65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: .78rem;
  color: var(--ink);
  text-decoration: none;
}
.example-grid a:hover { border-color: var(--signal); }
.example-grid strong { display: block; }
.example-grid p { font-size: .82rem; line-height: 1.4; margin-top: .23rem; }
.scenario-steps ol { padding-left: 1.35rem; margin: .75rem 0; }
.scenario-steps li { margin-bottom: .35rem; }
.scenario-steps li > [data-result] { color: var(--signal-dark); margin-left: .3em; }
.formula-grid, .method-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: .85rem; }
.formula-grid article, .method-list article { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: .9rem; min-width: 0; }
.formula-grid p, .method-list p { font-size: .89rem; line-height: 1.5; margin-top: .5rem; }
.formula-grid .equation { color: var(--signal-dark); font: 650 .86rem/1.45 var(--mono); overflow-wrap: anywhere; }
.reference-title { margin-top: 1rem; }
.references { margin: .4rem 0 0; padding-left: 1.18rem; font-size: .86rem; }
.references li + li { margin-top: .22rem; }
.method-list + p { margin-top: .9rem; }

.compliance {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  padding: 1rem 1.13rem;
  background: var(--amber-soft);
  border: 1px solid #edd1aa;
  border-left: 4px solid #b3712b;
  border-radius: 10px;
  margin-top: 1.2rem;
}
.compliance h2 { color: #624218; font-size: 1.03rem; margin-bottom: .3rem; }
.compliance p { color: #654b29; font-size: .88rem; line-height: 1.48; }
.notice-icon { background: #f5d5ac; color: #744315; width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.faq-list { margin-top: .77rem; }
.faq-list details { border-top: 1px solid var(--line); padding-top: .58rem; margin-top: .52rem; }
.faq-list summary { cursor: pointer; font-size: .94rem; font-weight: 650; padding: .22rem 0; }
.faq-list details p { margin-top: .25rem; padding-bottom: .25rem; font-size: .9rem; max-width: 82ch; }
.document-shell { max-width: 1024px; padding-bottom: 3.1rem; }
.document-heading { margin-bottom: 1.25rem; }
.document-heading p { margin-top: .5rem; }
.print-sheet { display: none; }

@media (max-width: 1040px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .wrap { width: min(1192px, calc(100% - 40px)); }
  .hero-grid { gap: 1.5rem; padding-block: 2.9rem; }
  .calc-intro { display: block; }
  .unit-switch { margin-top: 1rem; }
  .calculation-grid { grid-template-columns: minmax(0, 1fr); }
  .results-stack { display: contents; }
  .calc-status { grid-row: 1; }
  .diagram-card { grid-row: 2; }
  .input-panel { grid-row: 3; }
  .readouts { grid-row: 4; }
  .mobile-inputs { display: inline-flex; align-items: center; }
}
@media (max-width: 580px) {
  .wrap { width: calc(100% - 32px); }
  .nav-inner { min-height: 59px; }
  .brand { font-size: 1.03rem; gap: .4rem; }
  .brand svg { width: 32px; height: 32px; }
  .site-header nav { gap: .64rem; }
  .site-header nav a, .site-footer nav a { font-size: .77rem; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); padding-block: 2.45rem 1.7rem; gap: 1.55rem; }
  .hero h1 { max-width: 13ch; font-size: clamp(2.75rem, 11.2vw, 3.65rem); }
  .hero-copy { margin-top: .94rem; font-size: 1rem; }
  .hero-actions { margin-top: .95rem; gap: .48rem; }
  .hero-actions .button { font-size: .8rem; padding-inline: .6rem; }
  .hero-detail { margin-top: .96rem; font-size: .74rem; }
  .hero-art { max-width: 444px; justify-self: center; }
  .catalog { padding-block: 2.2rem 1.3rem; }
  .tool-grid, .example-grid, .formula-grid, .method-list { grid-template-columns: minmax(0, 1fr); }
  .tool-card { padding: .92rem; }
  .tool-card-top { margin-bottom: .63rem; }
  .footer-inner { flex-wrap: wrap; gap: .7rem; min-height: 0; padding-block: 1.2rem; }
  .site-footer nav { gap: .44rem .85rem; }
  .crumbs { margin-block: 1rem; }
  .calc-intro { margin-bottom: 1.05rem; }
  .calc-intro h1 { font-size: clamp(1.85rem, 7.5vw, 2.6rem); margin-bottom: .5rem; }
  .calc-intro p:not(.eyebrow) { font-size: .91rem; line-height: 1.45; }
  .telemetry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .telemetry > div { padding: .64rem .7rem .6rem; }
  .telemetry > div:nth-child(3) { border-left: 0; }
  .telemetry > div:nth-child(n+3) { border-top: 1px solid #3a566b; }
  .telemetry dt { font-size: .68rem; }
  .telemetry [data-number] { font-size: 1.63rem; }
  .telemetry [data-unit] { font-size: .72rem; }
  .action-bar { gap: .34rem; }
  .action-bar button { padding-inline: .48rem; font-size: .77rem; }
  .action-bar [data-action="reset"] { margin-left: 0; }
  .diagram-card, .readouts, .input-panel { padding: .82rem; }
  .field-grid { gap: .65rem .52rem; }
  .quantity span { max-width: 4.6rem; }
  .compliance { padding: .83rem .7rem; }
}
@media (max-width: 360px) {
  .wrap { width: calc(100% - 24px); }
  .nav-inner { gap: .48rem; }
  .site-header nav { gap: .48rem; }
  .brand svg { width: 28px; height: 28px; }
  .hero .eyebrow { font-size: .65rem; }
  .quantity span { max-width: 3.65rem; }
}

@page { size: letter; margin: 12mm; }
@media print {
  html, body { background: #fff; color: #122a3f; font-size: 9pt; }
  body:has(.print-sheet) > :not(main), .calculator > :not(.print-sheet) { display: none !important; }
  .wrap { width: 100%; padding: 0; margin: 0; }
  .print-sheet { display: block; }
  .print-sheet header { padding-bottom: 2mm; border-bottom: 1px solid #8fa8ba; }
  .print-sheet .print-title { font-size: 18pt; margin: 1.8mm 0; }
  .print-sheet header p { font-size: 7.7pt; color: #324f65; overflow-wrap: anywhere; }
  .print-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5mm; margin-top: 3mm; }
  .print-sheet h2 { font-size: 10pt; margin-bottom: 1.25mm; }
  .print-sheet dl { padding: 0; margin: 0; }
  .print-sheet dl > div { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2mm; padding: .55mm 0; border-top: 1px solid #e0e9ee; font-size: 7.7pt; line-height: 1.18; break-inside: avoid; }
  .print-sheet dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
  .print-sheet [data-unit] { padding-left: .3em; }
  .print-sheet [data-print-diagram] { margin: 3mm 0 1.8mm; width: 100mm; max-width: 100%; print-color-adjust: exact; }
  .print-status, .print-note { font-size: 7.3pt; line-height: 1.28; margin-top: 1.5mm; }
  .print-status { color: #6d421d; }
}
