:root {
  color-scheme: light;
  --navy: #0B2239;
  --navy-deep: #081B2D;
  --teal: #0E7490;
  --teal-deep: #07586E;
  --gold: #B7791F;
  --gold-light: #EDB75F;
  --paper: #F7F9FB;
  --white: #FFFFFF;
  --wash: #EDF4F5;
  --ink: #1D384B;
  --muted: #496272;
  --line: #D3E0E5;
  --line-dark: #B7C9D1;
  --warning: #74430B;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, monospace;
  font: 100%/1.55 var(--sans);
  color: var(--navy);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
[hidden] { display: none !important; }
main, section, article, aside, div, fieldset { min-width: 0; }
svg { display: block; max-width: 100%; }
p { margin: 0 0 1rem; }
h1, h2, h3 { margin: 0; }
ul, ol, dl, figure { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .54; cursor: default; }
a { color: var(--teal-deep); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.home-hero :focus-visible, .site-footer :focus-visible { outline-color: var(--gold-light); }
::selection { color: var(--navy); background: #CFE8EB; }
[id] { scroll-margin-top: 1.25rem; }

.container { width: min(100% - 5rem, 74rem); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  z-index: 10;
  left: 1rem;
  top: 1rem;
  padding: .6rem 1rem;
  background: var(--white);
}

.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 4.45rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand-lockup { display: inline-flex; align-items: center; gap: .6rem; color: var(--navy); font-weight: 780; font-size: 1.18rem; letter-spacing: -.045em; text-decoration: none; white-space: nowrap; }
.brand-lockup > span:last-child > span { color: var(--teal-deep); }
.brand-icon { width: 2.15rem; height: 2.15rem; display: grid; place-items: center; background: var(--navy); color: #ECC07A; border-radius: 50%; flex: none; }
.brand-icon svg { width: 1.6rem; height: 1.6rem; }
.site-nav { display: flex; gap: 1.85rem; align-items: center; }
.site-nav a { color: var(--ink); font-size: .92rem; font-weight: 650; text-decoration: none; }
.site-nav a:hover { color: var(--teal-deep); text-decoration: underline; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .6rem .95rem;
  border: 1px solid transparent;
  border-radius: .3rem;
  font-weight: 710;
  font-size: .88rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.button-gold { background: var(--gold-light); color: var(--navy-deep); padding: .85rem 1.17rem; }
.button-gold:hover { background: #FFD18A; }
.button-navy { background: var(--navy); color: var(--white); }
.button-navy:hover { color: var(--white); background: var(--teal-deep); }
.button-outline { color: var(--navy); background: var(--white); border-color: var(--line-dark); }
.button-outline:hover:not(:disabled) { background: var(--wash); border-color: var(--teal); }

.home-hero { color: var(--paper); background: var(--navy); border-bottom: 3px solid var(--gold); }
.home-hero-layout { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); align-items: center; gap: clamp(1.2rem, 4vw, 4rem); min-height: 32rem; }
.hero-copy { padding-block: 3.6rem; }
.hero-kicker, .category {
  font-size: .77rem;
  line-height: 1.35;
  font-weight: 750;
  letter-spacing: .115em;
  text-transform: uppercase;
}
.hero-kicker { color: #A5CED6; margin: 0 0 1.08rem; }
.hero-copy h1, .page-heading h1, .section-heading h2, .article-section h2, .related-card h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.048em;
}
.hero-copy h1 { font-size: clamp(3.1rem, 5.2vw, 5.05rem); line-height: .99; max-width: 13ch; }
.hero-copy h1 em { color: #EEC384; font-weight: inherit; }
.hero-summary { max-width: 40ch; margin: 1.35rem 0 1.5rem; color: #D7E5EE; font-size: clamp(1rem, 1.45vw, 1.18rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem 1.35rem; align-items: center; }
.hero-link { color: #E1EEF3; font-weight: 700; font-size: .92rem; }
.hero-link:hover { color: #F4CF94; }
.hero-chart { align-self: center; }
.hero-chart-svg { width: 100%; height: auto; }

.section-block { padding-block: 3.75rem; }
.section-heading { margin-bottom: 1.4rem; }
.section-heading h2 { font-size: clamp(2.1rem, 3.5vw, 3.06rem); line-height: 1.07; }
.section-heading p { color: var(--muted); margin: .55rem 0 0; max-width: 56ch; }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; }
.tool-card {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: 1.1rem 1.2rem 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 2px solid #79A7AE;
  border-radius: .22rem;
  text-decoration: none;
  color: var(--navy);
  min-height: 13rem;
  transition: background-color .15s ease, border-color .15s ease;
}
.tool-card:hover { border-color: var(--teal); background: #F4F9F9; }
.tool-card h3 { font-size: 1.05rem; font-weight: 760; letter-spacing: -.025em; }
.tool-card p { color: var(--muted); font-size: .875rem; line-height: 1.48; margin: 0 0 .55rem; }
.tool-icon { width: 2.05rem; height: 2.05rem; display: grid; place-items: center; background: var(--wash); color: var(--teal-deep); border-radius: .15rem; }
.tool-icon svg { width: 1.2rem; height: 1.2rem; }
.tool-card-action { margin-top: auto; color: var(--teal-deep); font-size: .82rem; font-weight: 750; }
.tool-card:hover .tool-card-action { text-decoration: underline; }

.examples-section { background: var(--wash); border-block: 1px solid var(--line); }
.guide-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; align-items: start; }
.guide-family { background: var(--white); border: 1px solid var(--line); border-radius: .2rem; }
.guide-family summary { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .86rem 1.04rem; font-weight: 730; cursor: pointer; }
.guide-family summary::-webkit-details-marker { display: none; }
.guide-family summary::after, .advanced-fields summary::after, .question-list summary::after {
  content: "";
  width: .43rem;
  height: .43rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  flex: none;
  margin: -.18rem .15rem 0 .25rem;
}
.guide-family[open] > summary::after, .advanced-fields[open] > summary::after, .question-list details[open] summary::after {
  transform: rotate(225deg);
  margin-top: .17rem;
}
.guide-family summary > span:first-child { display: flex; align-items: center; gap: .55rem; }
.guide-family svg { width: 1.15rem; height: 1.15rem; color: var(--teal-deep); flex: none; }
.family-count { font-size: .79rem; font-weight: 600; margin-left: auto; color: var(--muted); white-space: nowrap; }
.guide-family ul { padding: .2rem 1.15rem 1rem 2.55rem; font-size: .93rem; }
.guide-family li { margin: .37rem 0; padding-left: .12rem; }
.home-note { padding-block: 2rem; }

.tool-main, .info-main { padding-block: 1.4rem 3.4rem; }
.breadcrumbs { margin-block: 0 1.4rem; color: var(--muted); font-size: .82rem; }
.breadcrumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .33rem .15rem; }
.breadcrumbs li { display: flex; align-items: center; gap: .3rem; min-width: 0; overflow-wrap: anywhere; }
.breadcrumbs svg { width: .82rem; height: .82rem; flex: none; color: #607A8B; }
.breadcrumbs a { color: var(--teal-deep); }
.page-heading { max-width: 64rem; margin-bottom: 1.85rem; }
.category { color: var(--teal-deep); display: flex; align-items: center; gap: .4rem; margin-bottom: .65rem; }
.category svg { width: 1.1rem; height: 1.1rem; flex: none; }
.page-heading h1 { font-size: clamp(2.22rem, 4.4vw, 4.07rem); line-height: 1.04; overflow-wrap: anywhere; }
.page-lede { font-size: 1.06rem; max-width: 69ch; color: var(--muted); margin: .85rem 0 0; }
.quick-answer { display: flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .5rem; margin: .9rem 0 0; color: var(--muted); }
.quick-answer > span { font-size: .79rem; font-weight: 760; text-transform: uppercase; letter-spacing: .065em; color: var(--teal-deep); }
.quick-answer strong { color: var(--navy); font-size: 1.14rem; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); align-items: start; gap: 1.1rem; }
.workspace-input, .result-card, .export-panel { background: var(--white); border: 1px solid var(--line); border-radius: .37rem; }
.workspace-input { padding: 1.1rem 1.2rem 1.18rem; }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; margin-bottom: 1.1rem; }
.workspace-heading h2 { font-family: var(--serif); font-size: 1.6rem; font-weight: 400; letter-spacing: -.03em; }
.unit-toggle { display: inline-flex; flex-wrap: wrap; gap: .14rem; background: var(--wash); border: 1px solid var(--line); padding: .19rem; border-radius: .35rem; }
.unit-toggle button { padding: .44rem .62rem; border: 0; background: transparent; border-radius: .23rem; line-height: 1.2; font-size: .82rem; font-weight: 710; }
.unit-toggle button[aria-pressed="true"] { color: var(--white); background: var(--teal-deep); }
.unit-toggle button:not([aria-pressed="true"]):hover { background: #DBE9ED; }
.field-group { border: 0; margin: 0 0 1.12rem; padding: 0; }
.field-group legend { padding: 0 0 .42rem; font-size: .82rem; font-weight: 770; color: var(--teal-deep); letter-spacing: .022em; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .83rem .68rem; }
.field label, .share-box label { display: block; margin: 0 0 .22rem; font-size: .875rem; font-weight: 690; line-height: 1.25; }
.field input, .field select, .share-box input {
  width: 100%;
  min-width: 0;
  min-height: 2.63rem;
  border: 1px solid #B6C8D0;
  background-color: #FCFDFE;
  border-radius: .24rem;
  padding: .48rem .56rem;
  font-size: 1rem;
}
.field input { font-variant-numeric: tabular-nums; }
.number-input { display: flex; align-items: stretch; }
.number-input input { appearance: textfield; -moz-appearance: textfield; }
.number-input input::-webkit-inner-spin-button, .number-input input::-webkit-outer-spin-button { appearance: none; }
.number-input:has(.field-unit:not([hidden])) input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.field-unit {
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid #B6C8D0;
  border-left: 0;
  border-top-right-radius: .24rem;
  border-bottom-right-radius: .24rem;
  background: var(--wash);
  padding: 0 .42rem;
  color: var(--muted);
  font-size: .74rem;
  white-space: nowrap;
}
.field select {
  appearance: none;
  padding-right: 1.55rem;
  background-image: linear-gradient(45deg, transparent 52%, var(--teal-deep) 53%), linear-gradient(135deg, var(--teal-deep) 49%, transparent 50%);
  background-position: right .75rem center, right .46rem center;
  background-repeat: no-repeat;
  background-size: .31rem .31rem;
  text-overflow: ellipsis;
}
.field-help, .field-error { display: block; margin-top: .25rem; line-height: 1.35; font-size: .77rem; color: var(--muted); }
.field-error { color: #9A311D; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: #B54732; }
.advanced-fields { margin-bottom: .55rem; border-top: 1px solid var(--line); }
.advanced-fields summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: .48rem .1rem; font-size: .9rem; font-weight: 680; color: var(--teal-deep); }
.advanced-fields summary::-webkit-details-marker { display: none; }
.advanced-fields .field-group { margin: .32rem 0 .86rem; }
.input-actions { display: flex; flex-wrap: wrap; gap: .52rem; margin-top: .45rem; }
.share-box { margin-top: .85rem; }
.share-box input { font-family: var(--mono); font-size: .81rem; }

.result-card { overflow: hidden; }
.result-lead { padding: .86rem 1.17rem 1rem; color: var(--white); background: var(--navy); border-bottom: 2px solid var(--gold); }
.result-label { color: #CAE1E8; margin: 0 0 .18rem; font-size: .87rem; font-weight: 700; }
.result-value { display: block; font-family: var(--serif); font-variant-numeric: lining-nums tabular-nums; font-size: clamp(2rem, 3.85vw, 3.54rem); line-height: 1.02; letter-spacing: -.045em; overflow-wrap: anywhere; }
.invalid-lead h2 { font-size: 1.25rem; }
.invalid-lead p { margin-bottom: 0; color: #DDE9F0; }
.diagram-figure { padding: .8rem .92rem .46rem; }
.diagram-svg { width: 100%; height: auto; border: 1px solid var(--line); border-radius: .15rem; }
.diagram-figure figcaption { color: var(--muted); font-size: .75rem; margin-top: .15rem; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .25rem .92rem 0; gap: 0 1rem; }
.metric-grid > div { padding: .52rem .04rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.metric-grid dt { color: var(--muted); font-size: .81rem; line-height: 1.23; }
.metric-grid dd { margin: .16rem 0 0; font-weight: 730; line-height: 1.24; font-size: .95rem; }
.result-note { margin: .65rem .92rem .8rem; padding: .59rem .7rem; border-left: 2px solid var(--teal); color: var(--ink); background: var(--wash); font-size: .83rem; }
.export-panel { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .46rem .8rem; margin-top: .63rem; padding: .61rem .81rem; }
.export-label { color: var(--muted); font-size: .83rem; font-weight: 710; }
.export-buttons { display: flex; flex-wrap: wrap; gap: .36rem; }
.export-buttons button { min-height: 2.26rem; padding: .41rem .57rem; font-size: .8rem; }
.safety-note {
  display: flex;
  align-items: flex-start;
  gap: .63rem;
  margin: 1rem 0 0;
  padding: .76rem .88rem;
  border: 1px solid #E4CEA8;
  border-left: 3px solid var(--gold);
  border-radius: .19rem;
  background: #FFF9EE;
  color: var(--warning);
}
.safety-note svg { flex: none; width: 1.14rem; height: 1.14rem; margin-top: .08rem; }
.safety-note p { margin: 0; font-size: .88rem; }

.article-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); align-items: start; gap: 2rem; margin-top: 2rem; }
.article-section { margin: 0 0 1.6rem; padding-bottom: 1.35rem; border-bottom: 1px solid var(--line); }
.article-section h2, .related-card h2 { font-size: clamp(1.58rem, 2.35vw, 2rem); line-height: 1.12; margin: 0 0 .63rem; }
.article-section p { color: var(--muted); margin: 0 0 .64rem; }
.article-section p:last-child { margin-bottom: 0; }
.formula-list > div { margin: .6rem 0; }
.formula-list dt { font-weight: 740; margin-bottom: .25rem; }
.formula-list dd { margin: 0; }
.formula-list dd p { margin-top: .25rem; }
.worked-steps { padding-left: 1.65rem; }
.worked-steps li { margin: .72rem 0; padding-left: .13rem; }
.worked-steps li::marker { color: var(--teal-deep); font-weight: 740; }
.worked-steps strong { display: block; margin-bottom: .22rem; }
.formula-list code, .worked-steps code {
  display: block;
  font: 400 .87rem/1.55 var(--mono);
  color: var(--navy);
  background: #EDF3F6;
  border: 1px solid #E0EAEE;
  border-radius: .2rem;
  padding: .34rem .55rem;
  overflow-wrap: anywhere;
}
p.takeaway { margin: .9rem 0 .55rem; color: var(--ink); font-weight: 640; }
.reference-list { padding-left: 1.2rem; overflow-wrap: anywhere; }
.reference-list li { margin-bottom: .28rem; }
.question-list details { border-top: 1px solid var(--line); }
.question-list summary { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem .1rem; font-weight: 710; cursor: pointer; }
.question-list summary::-webkit-details-marker { display: none; }
.question-list details p { margin: 0 0 .63rem; }
.related-card { background: var(--white); border: 1px solid var(--line); border-top: 2px solid var(--teal); border-radius: .22rem; padding: 1rem 1.2rem; }
.related-card ul { list-style: none; padding: 0; margin-bottom: .7rem; }
.related-card li { border-top: 1px solid var(--line); padding: .52rem 0; font-size: .93rem; }
.related-card > a { font-size: .87rem; font-weight: 710; }
.info-copy { max-width: 49rem; }
.missing-main { min-height: 56vh; padding-block: clamp(3rem, 10vw, 7rem); }
.missing-main .button { margin-top: 1rem; }

.site-footer { background: var(--navy); color: #DAE7EF; border-top: 2px solid #396474; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8rem 1.5rem; padding-block: 1.7rem; }
.footer-brand { color: var(--white); font-weight: 790; font-size: 1.07rem; text-decoration: none; }
.footer-inner p { margin: .23rem 0 0; font-size: .87rem; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: .6rem 1.1rem; }
.footer-inner a { color: var(--white); }
.footer-inner a:hover { color: #F2C57E; }
.print-sheet { display: none; }

@media (max-width: 65rem) {
  .container { width: min(100% - 3.25rem, 74rem); }
  .tool-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tool-card { padding-inline: .9rem; }
  .home-hero-layout { min-height: 28rem; }
  .workspace-input { padding-inline: .95rem; }
}
@media (max-width: 55rem) {
  .home-hero-layout { gap: .8rem; min-height: 25rem; }
  .hero-copy { padding-block: 2.8rem; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-card { min-height: 10.25rem; padding-inline: 1.05rem; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .field-grid { gap: .8rem 1rem; }
  .article-grid { gap: 1.25rem; }
}
@media (max-width: 40rem) {
  .container { width: calc(100% - 2rem); }
  .header-inner { min-height: 3.75rem; gap: .45rem; }
  .site-nav { gap: .78rem; }
  .site-nav a { font-size: .8rem; }
  .site-nav .nav-about { display: none; }
  .brand-lockup { font-size: 1.06rem; gap: .38rem; }
  .brand-icon { width: 1.78rem; height: 1.78rem; }
  .brand-icon svg { width: 1.34rem; height: 1.34rem; }
  .home-hero-layout { grid-template-columns: minmax(0, 1fr); gap: 0; min-height: 0; }
  .hero-copy { padding: 2.05rem 0 1.03rem; }
  .hero-copy h1 { font-size: clamp(2.84rem, 11vw, 4rem); }
  .hero-kicker { margin-bottom: .8rem; }
  .hero-summary { margin-block: .85rem 1rem; }
  .hero-chart { margin: 0 -.4rem .9rem; max-width: 32rem; }
  .section-block { padding-block: 2.3rem; }
  .guide-index, .article-grid { grid-template-columns: minmax(0, 1fr); }
  .article-grid { margin-top: 1.4rem; }
  .tool-grid { gap: .61rem; }
  .tool-card { min-height: 0; padding: .7rem .72rem; }
  .tool-card h3 { font-size: .99rem; line-height: 1.23; }
  .tool-card p { font-size: .82rem; }
  .tool-main, .info-main { padding-top: .9rem; }
  .breadcrumbs { margin-bottom: .94rem; }
  .page-heading { margin-bottom: 1.14rem; }
  .page-lede { font-size: .97rem; }
  .workspace { gap: .76rem; }
  .field:has(> select) { grid-column: 1 / -1; }
  .result-value { font-size: 2.45rem; }
}
@media (max-width: 24rem) {
  .site-nav { gap: .54rem; }
  .site-nav a { font-size: .73rem; }
  .field-grid { gap: .65rem .5rem; }
  .workspace-input { padding-inline: .73rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

@media print {
  @page { size: A4 portrait; margin: 12mm; }
  :root { background: #fff; }
  body { background: #fff; color: #0B2239; font-size: 9pt; line-height: 1.35; }
  body:has(.print-sheet) > :not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; }
  .sheet-header { border-bottom: 1.7pt solid #0B2239; padding-bottom: 7pt; margin-bottom: 7pt; }
  .sheet-header > div { font-size: 11pt; font-weight: 750; }
  .sheet-header span { font-weight: 450; }
  .sheet-title { font-family: var(--serif); font-size: 17pt; font-weight: 400; margin: 4pt 0 2pt; }
  .sheet-header p { margin: 0; font-size: 8pt; overflow-wrap: anywhere; }
  .sheet-block { margin: 0 0 7pt; break-inside: avoid; }
  .sheet-block h2 { font-size: 10.5pt; margin-bottom: 2pt; }
  .sheet-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2pt 7pt; }
  .sheet-metrics > div { border-bottom: .5pt solid #D3E0E5; padding-bottom: 2pt; overflow-wrap: anywhere; }
  .sheet-metrics dt { color: #496272; font-size: 7.4pt; }
  .sheet-metrics dd { margin: 0; font-weight: 700; }
  .sheet-diagram { width: 78%; margin: 6pt 0; break-inside: avoid; }
  .sheet-notes { color: #243D50; font-size: 8pt; }
  .sheet-notes p { margin: 0 0 3pt; }
}
