:root {
  color-scheme: light;
  --page: #f2f8f6;
  --surface: #fffefd;
  --well: #eaf5f1;
  --ink: #203743;
  --muted: #45616b;
  --line: #cadfdd;
  --edge: #a8c2c3;
  --accent: #0a6e95;
  --accent-dark: #075475;
  --accent-wash: #e6f4f8;
  --green: #12674f;
  --green-wash: #e5f3ec;
  --amber: #814310;
  --amber-wash: #fbf0df;
  --focus: #0977a5;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.13; }
h1 { font-size: clamp(2rem, 4.35vw, 3.7rem); letter-spacing: -.045em; text-wrap: balance; }
h2 { font-size: 1.4rem; letter-spacing: -.025em; }
h3 { font-size: 1.06rem; letter-spacing: -.012em; }
p + p { margin-top: .65rem; }
a { color: var(--accent-dark); text-underline-offset: .19em; }
a:hover { color: var(--accent); }
button, input, select { font: inherit; }
button, .button { cursor: pointer; }
button:disabled { cursor: default; opacity: .54; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
svg { display: block; max-width: 100%; }
.shell { width: min(100% - 64px, 1232px); margin-inline: auto; }
.skip { position: absolute; left: .6rem; top: -5rem; z-index: 2; padding: .55rem .9rem; background: var(--surface); }
.skip:focus { top: .6rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.site-header { background: #fafdfb; border-bottom: 1px solid var(--line); }
.site-nav, .footer-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem 1.75rem; }
.site-nav { min-height: 66px; }
.site-nav nav, .site-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.65rem; }
.site-nav nav a, .site-footer a { color: var(--muted); font-weight: 650; text-decoration: none; font-size: .91rem; }
.site-nav nav a:hover, .site-footer a:hover, .site-nav nav a[aria-current] { color: var(--accent-dark); text-decoration: underline; }
.site-nav nav a { display: inline-flex; min-height: 42px; align-items: center; }
.brand { display: flex; min-height: 44px; gap: .65rem; align-items: center; color: var(--ink); font-weight: 760; letter-spacing: -.022em; text-decoration: none; white-space: nowrap; }
.brand svg { flex: none; }
.site-footer { border-top: 1px solid var(--line); margin-top: 4.75rem; color: var(--muted); }
.footer-row { padding-block: 1.4rem; font-size: .88rem; }
.footer-row > span { font-weight: 720; }
.footer-row nav { gap: .5rem 1.4rem; }

.hero { display: grid; grid-template-columns: 1.12fr 1fr; align-items: center; gap: clamp(1.7rem, 5vw, 5.2rem); padding: 4.75rem 0 4.1rem; }
.hero-copy h1 { max-width: 17ch; font-size: clamp(2.8rem, 5.1vw, 4.45rem); letter-spacing: -.048em; text-wrap: initial; }
.hero-copy p { max-width: 50ch; margin-top: 1.1rem; font-size: 1.12rem; color: var(--muted); }
.hero-links { margin-top: 1.55rem; display: flex; flex-wrap: wrap; gap: .65rem 1.35rem; align-items: center; }
.button { display: inline-flex; align-items: center; min-height: 46px; padding: .58rem .95rem; border: 1px solid transparent; border-radius: .4rem; text-decoration: none; font-weight: 700; }
.primary { color: white; background: var(--accent-dark); }
.primary:hover { color: white; background: var(--accent); }
.text-link { min-height: 42px; display: inline-flex; align-items: center; gap: .3rem; font-weight: 660; }
.hero-figure { border: 1px solid var(--edge); border-radius: .85rem; background: #e8f5f1; box-shadow: 0 18px 30px -22px #234e4960; }
.hero-figure svg { height: auto; width: 100%; }
.catalog { display: grid; gap: 2rem; scroll-margin-top: 1rem; }
.tool-group h2 { display: flex; gap: .85rem; margin-bottom: .85rem; align-items: center; }
.tool-group h2::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.tool-card { padding: 1.05rem 1.15rem; min-height: 148px; display: grid; grid-template-rows: auto 1fr auto; gap: .55rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); }
.tool-card:hover { border-color: var(--edge); }
.tool-card-head { display: flex; justify-content: space-between; gap: .65rem; align-items: baseline; }
.tool-card h3 { line-height: 1.24; font-size: 1.12rem; }
.tool-card h3 a { color: var(--ink); text-decoration: none; }
.tool-card h3 a:hover { color: var(--accent-dark); text-decoration: underline; }
.tool-card-head > span { color: var(--accent); }
.tool-card p { color: var(--muted); font-size: .94rem; }
.mini-link { align-self: end; justify-self: start; font-size: .88rem; font-weight: 660; }
.scope-note { margin-top: 1.45rem; padding: .92rem 1rem; border: 1px solid #d9c6aa; border-inline-start: 3px solid #c28d51; border-radius: .3rem; background: #fcf7ef; color: #5f4836; }
.scope-note h2 { font-size: 1rem; margin-bottom: .33rem; }
.scope-note p { font-size: .88rem; max-width: 107ch; }

.crumb { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .52rem; margin-top: 1.8rem; color: var(--muted); font-size: .88rem; }
.crumb a { font-weight: 650; }
.calc-header { margin: .8rem 0 1.28rem; }
.calc-header h1 { text-wrap: initial; max-width: 34ch; font-size: clamp(2rem, 4.15vw, 3.5rem); }
.calc-header p { color: var(--muted); font-size: 1.05rem; margin-top: .65rem; max-width: 75ch; }
.page-jumps { display: flex; align-items: center; gap: .5rem 1.15rem; flex-wrap: wrap; margin-top: .38rem; }
.page-jumps a { display: inline-flex; align-items: center; min-height: 39px; font-size: .88rem; font-weight: 680; }
.workspace { display: grid; grid-template-columns: minmax(320px, 382px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.workspace > * { min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: .7rem; box-shadow: 0 10px 26px -22px #153b3a6a; }
.inputs { padding: 1rem 1.05rem 1.15rem; }
.inputs-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .65rem; }
.plain-button { min-height: 40px; border-radius: .35rem; padding: .2rem .68rem; background: var(--surface); border: 1px solid var(--line); color: var(--accent-dark); font-size: .85rem; font-weight: 690; }
.plain-button:hover { border-color: var(--edge); background: var(--well); }
.unit-switch { display: flex; border: 1px solid var(--line); border-radius: .48rem; padding: .2rem; gap: .24rem; background: var(--well); }
.unit-switch button { min-width: 0; flex: 1; min-height: 40px; padding: .35rem .2rem; border: 1px solid transparent; border-radius: .32rem; color: var(--muted); background: transparent; font-size: .89rem; font-weight: 690; }
.unit-switch button[aria-pressed="true"] { background: var(--surface); color: var(--accent-dark); border-color: var(--edge); }
fieldset { margin: .95rem 0 0; padding: .32rem 0 0; min-inline-size: 0; border: 0; border-top: 1px solid var(--line); }
legend { padding: 0 .5rem 0 0; font-size: .89rem; color: var(--accent-dark); font-weight: 740; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .72rem .7rem; align-items: start; }
.field { display: grid; align-content: start; gap: .24rem; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label, .share-panel label { color: var(--ink); font-size: .83rem; line-height: 1.25; font-weight: 670; }
.field label.small-label { font-size: .76rem; margin-top: .32rem; }
.field small { font-size: .75rem; color: var(--muted); line-height: 1.36; }
.input-shell { min-width: 0; display: flex; align-items: center; padding-inline-end: .45rem; border: 1px solid var(--edge); border-radius: .35rem; background: white; }
.input-shell:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.input-shell input { flex: 1; width: 100%; min-width: 0; min-height: 40px; padding: .3rem .45rem; border: 0; background: transparent; border-radius: .35rem; color: var(--ink); font-family: var(--mono); font-size: .875rem; appearance: textfield; outline: none; }
.input-shell input::-webkit-inner-spin-button, .input-shell input::-webkit-outer-spin-button { appearance: none; }
.input-shell input:focus-visible { outline: none; }
.input-shell span { color: var(--muted); font-size: .74rem; white-space: nowrap; }
.input-shell:has([aria-invalid="true"]) { border-color: var(--amber); background: var(--amber-wash); }
.field select { display: block; width: 100%; min-width: 0; min-height: 42px; padding: .3rem .55rem; border-radius: .35rem; border: 1px solid var(--edge); background: white; color: var(--ink); font-size: .875rem; }
.output { padding: 1rem; scroll-margin-top: .75rem; }
.output-head { display: flex; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; margin-bottom: .65rem; }
.output-head p { color: var(--muted); font-size: .86rem; }
.anatomy { border: 1px solid var(--line); border-radius: .46rem; overflow: hidden; background: #f5fbfa; }
.anatomy > svg, .print-diagram > svg { width: 100%; height: auto; }
.diagram-message { display: grid; min-height: 170px; place-items: center; padding: 1rem; color: var(--muted); text-align: center; }
figcaption { color: var(--muted); margin: .38rem .1rem 0; font-size: .83rem; }
.output-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .45rem .65rem; margin-top: .85rem; }
.exports, .output-actions { display: flex; flex-wrap: wrap; gap: .33rem; }
.output-toolbar button, .share-panel button { min-height: 41px; padding: .35rem .65rem; border: 1px solid var(--edge); border-radius: .35rem; background: #f7fcfa; color: var(--accent-dark); font-size: .8rem; font-weight: 700; }
.output-actions button { background: var(--accent-wash); }
.output-toolbar button:hover:not(:disabled), .share-panel button:hover:not(:disabled) { background: var(--well); color: var(--accent-dark); border-color: var(--accent); }
.share-panel { padding: .6rem .7rem; margin-top: .5rem; border-radius: .35rem; background: var(--well); }
.share-panel div { display: flex; gap: .4rem; margin-top: .3rem; }
.share-panel input { min-width: 0; flex: 1; padding: .35rem .5rem; border: 1px solid var(--edge); border-radius: .35rem; color: var(--ink); font-family: var(--mono); font-size: .8rem; }
.action-status { color: var(--muted); font-size: .83rem; margin-top: .35rem; }
.action-status:empty { display: none; }
.notices, [data-message] { margin-top: .7rem; }
.notices:empty { display: none; }
.notice { border-radius: .3rem; padding: .5rem .65rem; color: var(--accent-dark); background: var(--accent-wash); font-size: .85rem; }
.notice.ok { color: var(--green); background: var(--green-wash); }
.notice.warn { color: var(--amber); background: var(--amber-wash); }
.readout { margin-top: .85rem; }
.details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1.15rem; }
.details-grid > section:only-child { grid-column: 1 / -1; }
.details-grid h3, .particle-section h3 { margin: .08rem 0 .32rem; }
.result-list { font-size: .87rem; }
.result-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; padding: .38rem 0; border-bottom: 1px solid var(--line); }
.result-list dt { color: var(--muted); overflow-wrap: anywhere; }
.result-list dd { color: var(--ink); font-family: var(--mono); font-weight: 650; text-align: end; }
.result-unit { color: var(--muted); white-space: nowrap; font-size: .9em; }
.particle-section { margin-top: .8rem; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { padding: .36rem .46rem; border-bottom: 1px solid var(--line); }
th { text-align: start; }
thead th { background: var(--well); font-weight: 700; }
td { font-family: var(--mono); text-align: end; }
thead th:not(:first-child) { text-align: end; }
tbody tr:nth-child(2n) { background: #f8fcfa; }
.fine, .muted { color: var(--muted); }
.fine { margin-top: .45rem; font-size: .815rem; }
.reference-stack { display: grid; gap: 1rem; margin-top: 1rem; }
.doc { max-width: 900px; margin-top: 2.7rem; }
.doc h1 { text-align: start; text-wrap: initial; }
.lead { font-size: 1.12rem; color: var(--muted); margin: .7rem 0 1.3rem; max-width: 65ch; }
.doc > .doc-panel + .doc-panel { margin-top: .9rem; }
.doc-panel { border: 1px solid var(--line); border-radius: .58rem; background: var(--surface); padding: 1.1rem 1.25rem; scroll-margin-top: .75rem; }
.doc-panel > h2 { margin-bottom: .65rem; }
.doc-panel > h3 { margin-top: .9rem; }
.doc-panel p, .doc-panel li { color: var(--muted); }
.doc-panel ol { padding-inline-start: 1.35rem; }
.doc-panel li { padding: .12rem 0; }
.formula-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.25rem; }
.formula-grid section { border-top: 1px solid var(--line); padding-top: .72rem; }
.formula-grid h3 { margin-bottom: .42rem; }
.formula-grid p { font-size: .91rem; }
.formula-grid p.equation { overflow-wrap: anywhere; padding: .55rem .6rem; border-left: 2px solid var(--edge); margin-bottom: .48rem; background: var(--well); color: var(--ink); font-family: var(--mono); font-size: .86rem; }
.source-list { padding-inline-start: 1.2rem; margin: .35rem 0 .15rem; }
.source-list li { padding-block: .25rem; font-size: .89rem; }
.example-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem .6rem; }
.example-grid a { display: flex; justify-content: space-between; align-items: center; gap: .4rem; min-height: 42px; padding: .35rem .62rem; border: 1px solid var(--line); background: #f5faf8; border-radius: .32rem; font-size: .88rem; font-weight: 630; text-decoration: none; }
.example-grid a:hover { border-color: var(--edge); text-decoration: underline; }
.example-grid + p { margin-top: .65rem; font-size: .88rem; }
details summary { color: var(--accent-dark); cursor: pointer; font-size: .88rem; font-weight: 650; }
details .result-list { margin-top: .35rem; max-width: 30rem; }
.print-sheet { display: none; }

@media (max-width: 1060px) {
  .shell { width: calc(100% - 48px); }
  .workspace { grid-template-columns: minmax(278px, .8fr) minmax(0, 1.5fr); }
  .details-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 32px); }
  .site-nav nav { gap: .18rem .85rem; }
  .hero { grid-template-columns: 1fr; padding: 2.6rem 0 2.1rem; gap: 1.25rem; }
  .hero-copy h1 { max-width: 19ch; }
  .hero-copy p { margin-top: .8rem; font-size: 1rem; }
  .hero-links { margin-top: 1rem; }
  .hero-figure { max-width: 550px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .calc-header h1 { max-width: 22ch; }
  .output, .inputs { padding: .8rem; }
  .formula-grid, .example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer { margin-top: 2.85rem; }
}
@media (max-width: 510px) {
  .shell { width: calc(100% - 24px); }
  .site-nav { display: block; padding-top: .32rem; }
  .site-nav nav { justify-content: space-between; gap: .1rem .6rem; }
  .site-nav nav a { min-height: 40px; }
  .brand { width: fit-content; }
  .hero { padding-top: 1.65rem; }
  .hero-copy h1 { font-size: clamp(2.45rem, 9.5vw, 3.1rem); }
  .hero-links { gap: .45rem .8rem; }
  .tool-grid, .formula-grid, .example-grid { grid-template-columns: minmax(0, 1fr); }
  .tool-card { min-height: 129px; }
  .crumb { margin-top: .75rem; }
  .calc-header { margin-bottom: .75rem; }
  .calc-header p { font-size: .94rem; }
  .output-head { gap: .22rem; }
  .output-head p { width: 100%; }
  .output-toolbar button { padding-inline: .58rem; }
  .doc { margin-top: 1.65rem; }
  .doc-panel { padding: .85rem .92rem; }
  .footer-row { flex-direction: column; align-items: flex-start; gap: .4rem; }
}
@page { size: A4 portrait; margin: 12mm; }
@media print {
  :root { background: #fff; color: #182d36; font-size: 10pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  body.has-print > :not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; break-inside: avoid; }
  .print-title { font-size: 23pt; font-weight: 740; line-height: 1.12; margin: 1mm 0 3mm; }
  .print-brand { font-size: 9pt; color: var(--muted); font-weight: 720; }
  .print-diagram { width: 148mm; max-width: 100%; margin-inline: auto; margin-bottom: 3mm; }
  .print-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm; }
  .print-columns h2 { font-size: 12pt; margin: 0 0 1mm; }
  .print-columns h3 { font-size: 9.5pt; }
  .print-columns .result-list { font-size: 8pt; line-height: 1.16; }
  .print-columns .result-list > div { gap: 2mm; padding: 1mm 0; }
  .print-columns table { font-size: 7.6pt; }
  .print-columns td, .print-columns th { padding: .6mm 1mm; }
  .print-columns .fine { font-size: 7pt; }
  .print-note, .print-url { font-size: 8pt; margin-top: 2mm; line-height: 1.3; }
  .print-url { overflow-wrap: anywhere; color: var(--muted); }
}
