:root {
  color-scheme: light;
  --paper: #f4f2e9;
  --surface: #fdfcf7;
  --ink: #192e30;
  --muted: #4b615e;
  --rule: #c8cec2;
  --accent: #873919;
  --accent-inverse: #f5a66f;
  --sage: #dce8db;
  --alert: #f7e3cc;
  --display: Georgia, 'Times New Roman', serif;
  --body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --width: 1190px;
  --gutter: clamp(16px, 4.2vw, 55px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 18px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.58 var(--body);
}
img, svg { max-width: 100%; }
svg { display: block; height: auto; }
p, h1, h2, h3, ol, ul, figure, dl { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; }
h1 { font-size: clamp(2.25rem, 5vw, 4.55rem); line-height: 1.02; letter-spacing: -.046em; }
h2 { font-size: clamp(1.45rem, 2.5vw, 2.15rem); line-height: 1.15; letter-spacing: -.025em; }
h3 { font-size: 1.2rem; line-height: 1.25; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--ink); }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: auto; opacity: .58; }
:focus-visible { outline: 3px solid #9b4a26; outline-offset: 3px; }
.shell { width: min(var(--width), calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.skip-link { position: absolute; top: .5rem; left: 1rem; translate: 0 -166%; padding: .5rem .9rem; background: var(--surface); z-index: 3; }
.skip-link:focus { translate: 0; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--rule); }
.header-row { min-height: 69px; display: flex; align-items: center; gap: 12px 24px; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; color: var(--ink); font-size: 1.25rem; font-weight: 760; letter-spacing: -.05em; text-decoration: none; }
.brand-accent { color: var(--accent); }
.brand-mark {
  background: var(--ink);
  color: var(--accent-inverse);
  width: 29px;
  height: 29px;
  border-radius: 6px;
  margin-right: 9px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.brand-mark i { display: block; width: 15px; height: 1.5px; background: currentColor; border-radius: 1px; }
.brand-mark i:first-child { width: 8px; }
.brand-mark i:nth-child(2) { width: 11px; }
.site-header nav, .site-footer nav { display: flex; flex-wrap: wrap; gap: .25rem 1.55rem; align-items: center; }
.site-header nav a, .site-footer nav a { font-size: .92rem; font-weight: 620; color: var(--muted); text-decoration: none; }
.site-header nav a:hover, .site-footer nav a:hover, nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }
.site-footer { margin-top: clamp(46px, 7vw, 80px); border-top: 1px solid var(--rule); }
.footer-row { min-height: 105px; display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem; flex-wrap: wrap; padding-block: 20px; }
.footer-row p { display: flex; gap: .45rem 1.25rem; flex-wrap: wrap; align-items: baseline; }
.footer-row span { color: var(--muted); font-size: .9rem; }

.hero { border-bottom: 1px solid var(--rule); background: #edeedf; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(26px, 4.7vw, 74px);
  align-items: center;
  padding-block: clamp(38px, 6.6vw, 99px);
}
.hero h1 { font-size: clamp(2.95rem, 6vw, 5.6rem); margin-block: .55rem 1.15rem; }
.hero h1 em { color: var(--accent); font-style: italic; display: block; }
.eyebrow { font: 670 .74rem/1.45 var(--mono); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.lede { max-width: 64ch; color: var(--muted); font-size: clamp(1rem, 1.7vw, 1.16rem); }
.hero-actions, .result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hero-actions { margin-top: 1.5rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .52rem .82rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 650;
  font-size: .87rem;
  line-height: 1.3;
  text-decoration: none;
}
.primary { color: #fffaf3; background: var(--accent); }
.primary:hover { color: #fffaf3; background: #733015; }
.quiet { background: var(--surface); color: var(--ink); border-color: var(--rule); }
.quiet:hover:not(:disabled) { background: var(--sage); }
.hero-instrument {
  padding: 12px 13px 11px;
  border-radius: 10px;
  background: var(--ink);
  color: #eaf0e8;
  border: 1px solid #304744;
  box-shadow: 0 11px 20px #192e3015;
}
.hero-instrument svg { width: 100%; }
.instrument-top, .hero-instrument figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  justify-content: space-between;
  align-items: baseline;
  padding: .43rem .52rem;
  font-size: .84rem;
}
.instrument-top { border-bottom: 1px solid #46605a; }
.instrument-top span:first-child { font-weight: 670; }
.instrument-top span:last-child { font-family: var(--mono); color: #b4c8c4; }
.hero-instrument figcaption { border-top: 1px solid #46605a; color: #b4c8c4; }
.hero-instrument figcaption a { color: var(--accent-inverse); }

.content-section { margin-top: clamp(32px, 5vw, 64px); }
.content-section > h2 { margin-bottom: .85rem; }
.content-section > h3 { margin: 1.1rem 0 .5rem; }
.section-intro { color: var(--muted); margin-bottom: 1.15rem; }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.tool-card { position: relative; padding: 17px 17px 23px; background: var(--surface); border: 1px solid var(--rule); border-radius: 7px; }
.tool-card:hover, .tool-card:focus-within { border-color: var(--accent); }
.tool-card h3 { margin: .42rem 1.12rem .46rem 0; font-size: clamp(1.13rem, 2vw, 1.4rem); }
.tool-card h3 a { color: var(--ink); text-decoration: none; }
.tool-card h3 a:hover { color: var(--accent); text-decoration: underline; }
.tool-card h3 a::after { content: ''; position: absolute; inset: 0; border-radius: 7px; }
.tool-card p:not(.eyebrow) { color: var(--muted); font-size: .91rem; }
.card-arrow { position: absolute; top: 13px; right: 14px; font-size: 1rem; color: var(--accent); }
.example-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 29px; }
.example-group { padding-block: 15px 19px; border-top: 1px solid var(--rule); }
.example-group h3 { margin: 0 0 .6rem; }
.example-group h3 a { color: var(--ink); }
.example-group ul, .related ul { padding-left: 1.2rem; }
.example-group li, .related li { padding-block: .23rem; }

.page-intro { max-width: 920px; padding: clamp(22px, 4vw, 44px) 0 1.5rem; }
.page-intro h1 { margin-bottom: .85rem; }
.breadcrumb { margin-bottom: .95rem; font-size: .87rem; color: var(--muted); }
.breadcrumb ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .15rem .46rem; }
.breadcrumb li + li::before { content: '/'; margin-right: .46rem; color: var(--muted); }
.safety-note, .scenario {
  max-width: 920px;
  margin-bottom: 1rem;
  padding: .72rem .9rem;
  border-left: 3px solid #687e6d;
  background: #e3e9db;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .4rem .8rem;
  align-items: baseline;
  font-size: .92rem;
}
.scenario { border-color: #c0774b; background: #f1e6d5; }
.scenario h2 { font: inherit; font-weight: 720; }

.workbench { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: clamp(13px, 2.2vw, 28px); align-items: start; }
.input-panel, .result-panel { min-width: 0; padding: clamp(13px, 2vw, 23px); background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; }
.panel-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .45rem .8rem; align-items: center; margin-bottom: 1rem; }
.panel-heading h2 { font-size: 1.54rem; }
.unit-choice { display: inline-flex; border: 1px solid var(--rule); background: var(--paper); border-radius: 6px; padding: 2px; }
.unit-choice button { border: 0; border-radius: 4px; min-height: 36px; padding: .18rem .55rem; font: 650 .85rem var(--body); background: transparent; }
.unit-choice button[aria-pressed="true"] { color: #fffaf3; background: var(--ink); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: .8rem .65rem; }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label, .share-field label { display: block; font-size: .86rem; font-weight: 675; line-height: 1.36; margin: 0 0 .34rem; }
.field [data-field-unit] { color: var(--muted); font-weight: 540; }
.field input, .field select, .share-field input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 41px;
  border: 1px solid #a6b3a8;
  border-radius: 5px;
  color: var(--ink);
  background: #fffefa;
  padding: .35rem .44rem;
  font-size: 1rem;
}
.field input[type="time"] { min-inline-size: 0; }
.field-help, .field-error { font-size: .77rem; line-height: 1.38; color: var(--muted); margin-top: .3rem; overflow-wrap: anywhere; }
.field-error, .invalid-summary { font-weight: 650; color: #882816; }
.field [aria-invalid="true"] { border-color: #a43d23; }
.form-note { margin-top: .85rem; color: var(--accent); font-size: .84rem; }
.input-footer { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: 1.15rem; }
.result-jump { display: none; }
.result-primary { padding: .85rem .95rem; border-left: 3px solid #688272; background: var(--sage); }
.result-value { font: 650 clamp(1.45rem, 2.55vw, 2.18rem)/1.13 var(--display); margin-block: .26rem .2rem; overflow-wrap: anywhere; }
.result-detail { color: var(--muted); font-size: .91rem; }
.invalid-summary { padding: .75rem; border-radius: 6px; background: var(--alert); }
.result-notice { font-size: .875rem; padding: .6rem .7rem; margin-top: .65rem; background: #ebefe3; border-left: 3px solid #76917a; }
.result-notice.warning { background: var(--alert); border-left-color: #a95026; }
.result-figure { margin-top: .85rem; border: 1px solid #304744; border-radius: 7px; background: var(--ink); color: #eaf0e8; overflow: hidden; }
.result-figure svg { width: 100%; }
.chart-title { padding: .48rem .73rem .4rem; border-bottom: 1px solid #46605a; font-size: .86rem; font-weight: 665; }
.result-figure figcaption { padding: .44rem .73rem .55rem; border-top: 1px solid #46605a; font-size: .76rem; color: #c3d3cb; }
.result-table { width: 100%; table-layout: fixed; border-collapse: collapse; margin: .65rem 0 0; font-size: .87rem; overflow-wrap: anywhere; }
.result-table th, .result-table td { padding: .43rem .34rem; text-align: left; vertical-align: baseline; border-bottom: 1px solid var(--rule); }
.result-table thead th { font: 675 .76rem/1.35 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .045em; }
.result-table thead th:first-child { width: 45%; }
.result-table tbody th { font-weight: 600; }
.result-table td { font-variant-numeric: tabular-nums; }
.result-actions { padding-top: .85rem; }
.export-buttons { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.export-buttons .button { font: 650 .8rem/1.25 var(--mono); }
.share-field { margin-top: .65rem; padding-top: .65rem; border-top: 1px solid var(--rule); }
.share-field > div { display: flex; align-items: stretch; gap: .35rem; }
.share-field [role="status"] { font-size: .79rem; margin-top: .3rem; color: var(--muted); }
.print-inputs { display: none; }

.reading { max-width: 830px; }
.reading .content-section { margin-top: 2.45rem; }
.reading p + p, .reading ul { margin-top: .6rem; }
.reading ul { padding-left: 1.2rem; }
.reading li + li { margin-top: .35rem; }
.experiment { border-left: 3px solid #687e6d; padding-left: .85rem; }
.formula { padding: .65rem .82rem; background: #e6e9dc; border-radius: 4px; font: 600 .88rem/1.55 var(--mono); overflow-wrap: anywhere; }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: .74rem .15rem; font-weight: 650; }
.faq details p { max-width: 77ch; color: var(--muted); padding: 0 .3rem .85rem 1.3rem; }
.related > a { display: inline-block; margin-top: .65rem; }
.core-page .page-intro { padding-bottom: .35rem; }
.missing-page { min-height: 58vh; }
.missing-page .page-intro > a { margin-top: 1rem; }

@media (max-width: 969px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 735px) {
  .hero-grid, .workbench { grid-template-columns: minmax(0, 1fr); }
  .hero-instrument { max-width: 560px; }
  .result-jump { display: inline; color: var(--accent); font-size: .89rem; font-weight: 650; }
}
@media (max-width: 475px) {
  .header-row { align-items: flex-start; flex-direction: column; justify-content: center; gap: .5rem; padding-block: .65rem; }
  .site-header nav { gap: .25rem 1rem; }
  .site-header nav a { font-size: .86rem; }
  .tool-grid { gap: 9px; }
  .tool-card { padding: 12px 11px 15px; }
  .tool-card .eyebrow { font-size: .65rem; }
  .tool-card p:not(.eyebrow) { font-size: .8rem; }
  .card-arrow { top: 8px; right: 7px; }
  .example-grid { grid-template-columns: minmax(0, 1fr); }
  .safety-note, .scenario { grid-template-columns: minmax(0, 1fr); gap: .13rem; }
  .field label { font-size: .82rem; }
}
@media print {
  @page { margin: 14mm; }
  body { color: #141b18; background: #fff; font-size: 10.5pt; }
  a { color: inherit; }
  .shell { width: 100%; }
  .site-header, .site-footer, .skip-link, .breadcrumb, .input-panel, .result-actions, .share-field,
  .hero-actions, body[data-interactive] .reading, body[data-interactive] .scenario { display: none !important; }
  .page-intro { padding: 0 0 6mm; }
  h1 { font-size: 23pt; }
  h2 { font-size: 17pt; }
  .workbench { display: flex; flex-direction: column; gap: 6mm; }
  .result-panel { width: 100%; border: 0; padding: 0; }
  .result-primary, .result-figure, .result-notice { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .result-figure { width: min(100%, 122mm); }
  .result-table tr, .result-figure, .result-primary, .print-inputs dl div { break-inside: avoid; }
  .print-inputs { display: block; width: 100%; }
  .print-inputs dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem 1.2rem; margin-top: .5rem; }
  .print-inputs dt { font-weight: 680; }
  .print-inputs dd { margin: 0; }
}
