:root {
  color-scheme: light;
  --ground: #f2efe8;
  --paper: #fffdfa;
  --raised: #eae6dd;
  --ink: #192a38;
  --slate: #465664;
  --line: #cbc9be;
  --hairline: #e2e0d7;
  --cobalt: #1943ba;
  --cobalt-dark: #142e80;
  --cobalt-wash: #e8edfc;
  --rust: #9b3e2a;
  --rust-wash: #f5e6dd;
  --green: #17634c;
  --heading: "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --gutter: clamp(1.125rem, 4.2vw, 3.4rem);
  --page-width: 1330px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--ground);
  scroll-padding-top: 1.3rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font: 1rem/1.6 var(--body);
}

a { color: var(--cobalt-dark); text-underline-offset: 0.22em; }
a:hover { color: var(--cobalt); }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--heading); }
h1, h2 { letter-spacing: -0.045em; }
h3 { letter-spacing: -0.022em; }
h1 { font-size: clamp(2.25rem, 4.65vw, 4.5rem); line-height: 1.02; font-weight: 720; }
h2 { font-size: clamp(1.6rem, 3vw, 2.7rem); line-height: 1.1; }
h3 { font-size: 1.15rem; line-height: 1.25; }
ol, ul { padding-inline-start: 1.35rem; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 4px; }

.wrap {
  width: min(100%, var(--page-width));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.6rem 0.9rem;
  transform: translateY(-200%);
  background: var(--paper);
}
.skip:focus { transform: none; }

.site-head {
  color: var(--ink);
  background: var(--paper);
  border-top: 5px solid var(--cobalt);
  border-bottom: 1px solid var(--line);
}

.head-row {
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 2rem;
}

.brand, .foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  width: fit-content;
  font: 765 1.19rem/1 var(--heading);
  letter-spacing: -0.05em;
  text-decoration: none;
  color: var(--ink);
}

.brand-sigil {
  display: grid;
  place-content: center;
  width: 30px;
  height: 29px;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  color: var(--cobalt-dark);
  border-radius: 3px;
  background: var(--cobalt-wash);
}
.brand-sigil::before {
  content: "";
  display: block;
  width: 13px;
  height: 4px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 0 -5px 0 -0.5px currentColor, 0 5px 0 -0.5px currentColor;
}

.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem clamp(1rem, 3vw, 2.1rem); }
.site-nav a {
  color: var(--slate);
  font-size: 0.875rem;
  font-weight: 650;
  text-decoration: none;
  padding-block: 0.65rem;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--cobalt); text-decoration: underline; }

.hero {
  padding-block: clamp(2.65rem, 7vw, 6.3rem) clamp(2.5rem, 6vw, 5.4rem);
  background:
    linear-gradient(90deg, transparent 0 96%, rgb(25 42 56 / 4%) 96%),
    var(--ground);
  background-size: 64px 100%;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.09fr) minmax(0, 0.91fr);
  align-items: center;
  gap: clamp(1.8rem, 5.7vw, 6rem);
}

.kicker, .entry-type {
  display: block;
  color: var(--cobalt-dark);
  font: 700 0.74rem/1.35 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.082em;
}

.hero h1 {
  font-size: clamp(3.15rem, 6.9vw, 7.25rem);
  letter-spacing: -0.052em;
  margin-block: 0.72rem 1.15rem;
  line-height: 0.95;
}
.hero h1 span { color: var(--cobalt-dark); display: block; }
.hero .lead, .page-heading .lead { max-width: 63ch; }
.lead { color: var(--slate); font-size: clamp(1rem, 1.65vw, 1.19rem); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 1.65rem; }
.button, .settings-link {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.46rem 0.78rem;
  font-weight: 650;
  line-height: 1.2;
  font-size: 0.84rem;
  white-space: nowrap;
  text-decoration: none;
}
.button:hover { border-color: var(--cobalt); color: var(--cobalt-dark); }
.button:disabled { opacity: 0.46; cursor: default; }
.button-primary {
  background: var(--cobalt-dark);
  color: #fff;
  border-color: var(--cobalt-dark);
  min-height: 46px;
  padding-inline: 1.13rem;
}
.button-primary:hover { background: var(--cobalt); color: #fff; }
.text-link { font-weight: 690; font-size: 0.92rem; }
.arrow { margin-inline-start: 0.55rem; line-height: 1; }

.manifest {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 6px solid var(--cobalt-dark);
  border-radius: 6px;
  box-shadow: 8px 9px 0 #ddd8cb;
  min-width: 0;
}
.manifest-top, .manifest-ledger, .manifest-footer { padding-inline: clamp(1rem, 2.57vw, 2rem); }
.manifest-top { padding-block: 1.1rem 0.95rem; display: flex; justify-content: space-between; gap: 0.7rem; align-items: flex-start; }
.manifest-top h2 { font-size: clamp(1.26rem, 2.2vw, 1.78rem); margin-top: 0.28rem; }
.manifest-currency { border: 1px solid var(--line); padding: 0.26rem 0.42rem; font: 700 0.72rem/1.2 var(--mono); }
.manifest-ledger { margin: 0; padding-block: 0.05rem 1rem; }
.manifest-ledger div { display: flex; gap: 0.5rem; justify-content: space-between; border-top: 1px solid var(--hairline); padding-block: 0.46rem; }
.manifest-ledger dt { color: var(--slate); font-size: 0.86rem; line-height: 1.45; }
.manifest-ledger dd { margin: 0; font: 650 0.88rem/1.45 var(--mono); }
.manifest-ledger .deduction { color: var(--rust); }
.manifest-footer {
  position: relative;
  border-top: 1px dashed var(--line);
  background: #f2f5eb;
  padding-block: 0.8rem 0.9rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-auto-flow: row;
  align-items: end;
  gap: 0.12rem 0.9rem;
}
.manifest-footer strong { grid-column: 1; color: var(--green); font: 750 clamp(1.5rem, 3.5vw, 2.9rem)/1.02 var(--mono); letter-spacing: -0.06em; }
.manifest-footer small { grid-column: 2; grid-row: 2; color: var(--green); font: 650 0.79rem/1.25 var(--mono); text-align: right; }
.manifest-footer span { grid-column: 1 / -1; font-weight: 650; font-size: 0.8rem; }

.disclaimer {
  background: #ebe8df;
  color: var(--slate);
  border-left: 3px solid var(--rust);
  padding: 0.76rem 0.9rem;
  font-size: 0.86rem;
  line-height: 1.5;
}
.disclaimer strong { color: var(--ink); margin-inline-end: 0.3rem; }
.home-disclaimer { margin-top: 1.45rem; }

.home-section { padding-block: clamp(2.9rem, 6vw, 5.2rem); }
.section-tint { background: var(--raised); border-block: 1px solid var(--line); }
.section-heading { margin-bottom: 1.4rem; }
.section-heading p { color: var(--slate); margin-top: 0.4rem; max-width: 66ch; }
.section-heading h2 + p { margin-top: 0.65rem; }
.tool-index { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; }
.tool-index li { min-width: 0; }
.tool-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.46rem;
  height: 100%;
  min-height: 177px;
  padding: 1rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
}
.tool-card:hover { border-color: var(--cobalt); color: var(--ink); }
.tool-card h3 { margin-top: 0.14rem; font-size: 1.18rem; }
.tool-card p { color: var(--slate); font-size: 0.88rem; line-height: 1.45; }
.card-action { font-weight: 720; color: var(--cobalt-dark); font-size: 0.79rem; }
.card-action .arrow { margin-inline-start: 0.24rem; }

.guide-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 0.7rem; }
.guide-group { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; }
.guide-group summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.75rem; align-items: center; padding: 0.9rem 1rem; font-weight: 700; line-height: 1.3; }
.guide-group summary::-webkit-details-marker, .faq details summary::-webkit-details-marker { display: none; }
.guide-group summary::after, .faq summary::after { content: "+"; color: var(--cobalt-dark); font: 700 1rem/1 var(--mono); }
.guide-group[open] summary::after, .faq details[open] summary::after { content: "−"; }
.guide-group:not([open]) summary:hover { color: var(--cobalt); }
.guide-group small { font: 500 0.78rem/1.3 var(--mono); color: var(--slate); }
.guide-group ul { list-style: none; margin: 0; padding: 0 1rem 1rem; }
.guide-group li { border-top: 1px solid var(--hairline); padding: 0.43rem 0; }
.guide-group li a { font-size: 0.88rem; line-height: 1.45; }

.site-foot { border-top: 1px solid var(--line); background: var(--paper); }
.foot-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.65rem 1.75rem; padding-block: 1.6rem; }
.foot-brand { font-size: 1rem; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; }
.foot-nav a { color: var(--slate); font-size: 0.82rem; text-decoration: none; }
.foot-nav a:hover { color: var(--cobalt); text-decoration: underline; }

.crumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.52rem;
  margin: 0 0 1.32rem;
  padding: 0;
  color: var(--slate);
  font-size: 0.78rem;
  line-height: 1.5;
}
.crumb-list li + li::before { content: "/"; margin-right: 0.52rem; color: var(--slate); }
.crumb-list a { color: var(--slate); }

.page-heading { padding-block: 1.3rem 1.8rem; }
.page-heading h1 { max-width: 22ch; margin: 0.44rem 0 0.75rem; }
.page-heading .disclaimer { margin-top: 1.25rem; }
.page-heading .lead { max-width: 70ch; }
.tool-heading h1 { max-width: 26ch; }
.guide-note {
  max-width: 76ch;
  margin-top: 0.85rem;
  padding-inline-start: 0.75rem;
  border-inline-start: 2px solid var(--cobalt);
  color: var(--slate);
  font-size: 0.9rem;
}
.guide-note strong { color: var(--ink); padding-inline-end: 0.25rem; }

.workbench { margin-bottom: clamp(3.2rem, 7.5vw, 6rem); }
.workbench-top { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem 1.2rem; margin-bottom: 0.75rem; }
.workbench-top h2 { font-size: clamp(1.38rem, 2.7vw, 2rem); }
.settings { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: end; }
.setting label { display: block; font-size: 0.7rem; font-weight: 700; margin-bottom: 0.14rem; color: var(--slate); line-height: 1.3; }
.setting select, .control select {
  display: block;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: var(--paper);
  padding: 0.4rem 0.3rem;
  font-size: 0.87rem;
}
.setting select { max-width: 9.5rem; }
.settings-link { display: none; }
.print-value, .print-setting { display: none; }

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.13fr);
  align-items: start;
  gap: clamp(0.9rem, 2.1vw, 1.6rem);
}
.inputs, .results { min-width: 0; }
.inputs {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 7px;
  padding: 0 clamp(0.85rem, 2vw, 1.25rem) 1rem;
}
.panel-title { font-size: 1.19rem; margin: 1rem 0 0.1rem; letter-spacing: -0.025em; }
.input-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem 0.47rem;
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 0.96rem 0 0.94rem;
  border: 0;
  border-bottom: 1px solid var(--hairline);
}
.input-group legend { float: left; width: 100%; padding: 0; margin-bottom: -0.06rem; color: var(--cobalt-dark); font-size: 0.76rem; font-weight: 760; grid-column: 1 / -1; }
.input-group:has(+ .input-group[hidden]:last-of-type), .input-group:last-of-type { border-bottom: 0; }
.control { display: flex; flex-direction: column; justify-content: end; min-width: 0; }
.control-wide { grid-column: 1 / -1; }
.control label { display: block; color: var(--slate); font-weight: 660; font-size: 0.78rem; line-height: 1.33; margin-bottom: 0.24rem; }
.amount-wrap {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
}
.amount-wrap:has(input:focus-visible) { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.amount-wrap input {
  width: 100%;
  min-width: 0;
  border: none;
  border-radius: 4px;
  padding: 0.41rem 0.45rem;
  min-height: 36px;
  background: transparent;
  color: var(--ink);
  font: 610 0.88rem/1.3 var(--mono);
  appearance: textfield;
}
.amount-wrap input:focus-visible { outline: none; }
.amount-wrap input::-webkit-inner-spin-button, .amount-wrap input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.amount-wrap:has([aria-invalid="true"]), select[aria-invalid="true"] { border-color: var(--rust); box-shadow: 0 0 0 1px var(--rust); }
.field-unit { flex: 0 0 auto; padding-inline-end: 0.46rem; color: var(--slate); font: 550 0.72rem/1 var(--mono); }
.field-help { color: var(--slate); font-size: 0.68rem; line-height: 1.35; margin-top: 0.2rem; }
.field-error { color: var(--rust); font-size: 0.7rem; line-height: 1.35; margin-top: 0.22rem; }

.result-head {
  background: var(--ink);
  color: #fbfaf6;
  border-top: 5px solid var(--cobalt);
  border-radius: 7px 7px 0 0;
  padding: clamp(0.9rem, 2.7vw, 1.5rem);
}
.result-eyebrow { font: 700 0.7rem/1.15 var(--mono); color: #bfccdc; letter-spacing: 0.07em; text-transform: uppercase; }
.metric-feature,.minor-metrics { margin: 0; }
.metric-feature dt, .minor-metrics dt { color: #e3e8ed; font-size: 0.82rem; font-weight: 640; line-height: 1.32; }
.metric-feature { margin-block: 0.65rem 0.78rem; }
.metric-feature dd {
  margin: 0.12rem 0 0;
  font: 760 clamp(2.4rem, 5.8vw, 4.7rem)/1.04 var(--mono);
  letter-spacing: -0.07em;
  color: #f6fcf6;
  overflow-wrap: anywhere;
}
.minor-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; border-top: 1px solid #536371; padding-top: 0.75rem; }
.minor-metrics dd { margin: 0.16rem 0 0; font: 720 clamp(1.05rem, 2.4vw, 1.55rem)/1.2 var(--mono); overflow-wrap: anywhere; }
.result-head [data-negative] { color: #ffc8b9; }
.result-body {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 7px 7px;
  padding: 0.85rem clamp(0.8rem, 2vw, 1.25rem) 1rem;
}
.validation, .notices {
  color: #78301f;
  border-left: 3px solid var(--rust);
  background: var(--rust-wash);
  padding: 0.45rem 0.64rem;
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 0 0 0.7rem;
}
.notices { padding-inline-start: 1.5rem; }
.notices li + li { margin-top: 0.3rem; }
.chart { margin: 0 0 0.8rem; }
.chart figcaption { font: 760 1rem/1.25 var(--heading); letter-spacing: -0.018em; margin-bottom: 0.45rem; }
.plot-box { border: 1px solid var(--hairline); border-radius: 4px; background: #fbfaf6; }
.plot-box svg { width: 100%; margin: 0 auto; max-width: 625px; }
.ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
}
.ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.44rem 0.36rem;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.77rem;
  line-height: 1.4;
}
.ledger-row:nth-child(odd) { border-right: 1px solid var(--hairline); padding-left: 0; padding-right: 0.62rem; }
.ledger-row:nth-child(even) { padding-right: 0; padding-left: 0.62rem; }
.ledger-row dt { color: var(--slate); min-width: 0; overflow-wrap: anywhere; }
.ledger-row dd { margin: 0; max-width: 55%; text-align: right; font: 680 0.79rem/1.4 var(--mono); overflow-wrap: anywhere; }
.ledger-row dd[data-negative] { color: var(--rust); }
.report-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.85rem; }
.report-actions .button { min-height: 38px; }
.share-pane { border-top: 1px solid var(--hairline); margin-top: 0.8rem; padding-top: 0.7rem; }
.share-pane label { display: block; color: var(--slate); font-size: 0.78rem; font-weight: 670; }
.share-controls { display: flex; gap: 0.42rem; margin-top: 0.35rem; }
.share-controls input { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); padding: 0.35rem; background: var(--ground); font: 0.78rem var(--mono); }
.share-status { margin-top: 0.2rem; color: var(--green); font-size: 0.78rem; }
.share-status:empty { display: none; }

.tool-notes { margin-bottom: clamp(3rem, 6vw, 5rem); }
.note-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.65rem 4rem; align-items: start; }
.prose { min-width: 0; color: var(--slate); }
.prose > * + * { margin-top: 0.8rem; }
.prose h2, .prose h3 { color: var(--ink); }
.prose p, .prose li { max-width: 77ch; overflow-wrap: anywhere; }
.related h2, .tool-notes h2 { font-size: clamp(1.4rem, 2.8vw, 2.2rem); }
.related ul { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.related li { border-top: 1px solid var(--line); padding: 0.48rem 0; font-size: 0.9rem; }
.faq-wrap { border-top: 1px solid var(--line); }
.faq .section-heading { margin-bottom: 1rem; }
.faq details { border-bottom: 1px solid var(--line); max-width: 56rem; }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.82rem 0.55rem 0.82rem 0;
  font-weight: 675;
  line-height: 1.35;
}
.faq details p { margin: 0 1.3rem 0.85rem 0; color: var(--slate); font-size: 0.93rem; max-width: 72ch; }

.article-layout { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 2rem 3rem; padding-bottom: 3rem; }
.article-toc { background: var(--paper); border: 1px solid var(--line); border-radius: 5px; padding: 0.95rem; height: fit-content; }
.article-toc ul { list-style: none; margin: 0.52rem 0 0; padding: 0; }
.article-toc li { margin-top: 0.4rem; line-height: 1.42; font-size: 0.88rem; }
.article-sections { min-width: 0; }
.article-sections > section { padding: 1.4rem 0; border-top: 1px solid var(--line); }
.article-sections > section:first-child { border-top: 0; padding-top: 0; }
.article-sections h2 { font-size: clamp(1.38rem, 3.3vw, 2.3rem); }
.equations { list-style: none; padding: 0.55rem 0.8rem; border-left: 3px solid var(--cobalt); background: var(--paper); font: 0.89rem/1.5 var(--mono); }
.equations li { margin: 0.35rem 0; }
.section-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; font-size: 0.88rem; font-weight: 650; }
.source-list { font-size: 0.9rem; }
.source-list li { margin-top: 0.35rem; }
.simple-article { max-width: 55rem; padding-bottom: 3.8rem; }
.simple-article section + section { margin-top: 1.6rem; }
.simple-article h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); }
.missing { min-height: 63vh; }
.missing .tool-index { margin: 1.8rem 0 2.4rem; }

@media (max-width: 1060px) {
  .tool-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ledger { grid-template-columns: minmax(0, 1fr); }
  .ledger .ledger-row { border-right: 0; padding-inline: 0; }
}

@media (max-width: 820px) {
  .hero-inner { gap: 1.75rem; }
  .work-grid { grid-template-columns: minmax(0, 0.86fr) minmax(0, 1fr); }
  .note-grid { gap: 1.5rem; }
}

@media (max-width: 680px) {
  .head-row { min-height: auto; flex-wrap: wrap; padding-block: 0.78rem 0.5rem; gap: 0.26rem 0.7rem; }
  .site-nav { width: 100%; justify-content: space-between; }
  .site-nav a { padding-block: 0.45rem; }
  .hero { padding-block: 2.45rem 2.1rem; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 1.8rem; }
  .hero h1 { font-size: clamp(2.9rem, 11.8vw, 5.1rem); }
  .hero-actions { margin-top: 1.15rem; }
  .manifest { margin-right: 6px; box-shadow: 5px 6px 0 #ddd8cb; }
  .tool-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-card { min-height: 142px; padding: 0.76rem; }
  .tool-card p { font-size: 0.81rem; }
  .tool-card h3 { font-size: 1.03rem; }
  .guide-index { grid-template-columns: minmax(0, 1fr); }
  .work-grid, .note-grid, .article-layout { grid-template-columns: minmax(0, 1fr); }
  .workbench-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .settings { width: 100%; grid-column: 1 / -1; }
  .settings-link { display: inline-flex; min-height: 38px; margin-left: auto; }
  .result-head { border-top-width: 4px; }
  .metric-feature dd { font-size: clamp(2.15rem, 10.1vw, 3.5rem); }
  .ledger-row { font-size: 0.84rem; }
  .ledger-row dd { font-size: 0.84rem; }
  .foot-row { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 375px) {
  .settings-link { display: none; }
  .minor-metrics { gap: 0.45rem; }
  .result-body { padding-inline: 0.55rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .button, .tool-card { transition: border-color 140ms, background-color 140ms; }
}

@page { size: A4; margin: 12mm; }
@media print {
  :root { --gutter: 0; --ground: white; --paper: white; }
  html, body { margin: 0; background: white; font-size: 9pt; line-height: 1.35; }
  .site-head, .site-foot, .skip, .crumb-list, .tool-heading .lead, .tool-heading .entry-type, .guide-note,
  .tool-notes, .faq-wrap, .report-actions, .share-pane, .settings-link, .settings .button, .settings select,
  .setting label, .field-unit, .amount-wrap, .control select, .field-help, .validation { display: none !important; }
  .wrap { max-width: none; width: 100%; padding: 0; }
  .page-heading { padding: 0; }
  .tool-heading h1 { font-size: 22pt; max-width: none; margin: 0 0 4pt; }
  .tool-heading .disclaimer { font-size: 8.1pt; margin: 0 0 8pt; padding: 4pt 6pt; }
  .workbench { margin: 0; }
  .workbench-top { display: flex; flex-wrap: nowrap; justify-content: space-between; margin-bottom: 4pt; gap: 5pt; }
  .workbench-top h2 { font-size: 13pt; flex-basis: auto; }
  .settings { width: auto; gap: 7pt; }
  .print-setting, .print-value { display: block; color: var(--ink); font: 700 8.4pt/1.25 var(--mono); overflow-wrap: anywhere; }
  .work-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 7pt; }
  .inputs, .result-body { padding: 5pt 6pt; border-radius: 0; }
  .panel-title { font-size: 10.5pt; margin: 0 0 2pt; }
  .input-group { padding: 4pt 0; gap: 2pt 4pt; }
  .input-group legend { margin: 0; font-size: 8.3pt; }
  .control label { margin: 0; line-height: 1.2; font-size: 7.8pt; }
  .control { justify-content: start; }
  .result-head { color: var(--ink); background: white; padding: 5pt 6pt; border: 1px solid var(--line); border-top: 3pt solid var(--cobalt); border-radius: 0; }
  .result-eyebrow, .metric-feature dt, .minor-metrics dt { color: var(--ink); }
  .result-eyebrow { font-size: 7.2pt; }
  .metric-feature { margin-block: 3pt; }
  .metric-feature dd { color: var(--green); font-size: 24pt; }
  .result-head [data-negative] { color: var(--rust); }
  .metric-feature dt, .minor-metrics dt { font-size: 7.7pt; }
  .minor-metrics { gap: 4pt; padding-top: 4pt; border-color: var(--line); }
  .minor-metrics dd { font-size: 10pt; }
  .chart { margin: 3pt 0; }
  .chart figcaption { font-size: 9pt; margin-bottom: 2pt; }
  .plot-box { border: 0; }
  .chart svg { max-height: 138pt; }
  .ledger { grid-template-columns: minmax(0, 1fr); }
  .ledger .ledger-row { border-right: 0; padding: 2.3pt 0; font-size: 7.4pt; }
  .ledger-row dd { font-size: 7.8pt; }
  .notices { font-size: 7.7pt; padding-block: 2pt; margin: 0 0 3pt; }
  .inputs, .results, .chart, .result-head { break-inside: avoid; }
  .hero { padding: 0; border: 0; background: white; }
}
