:root {
  color-scheme: light;
  --navy: #0f3d5e;
  --ink: #17394f;
  --muted: #486479;
  --blue: #0284c7;
  --blue-text: #006aa4;
  --teal: #086d76;
  --amber: #d97706;
  --amber-text: #864a09;
  --background: #f6fafd;
  --white: #fff;
  --line: #c9deea;
  --soft-line: #dceaf2;
  --soft-blue: #eef7fc;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 12px 36px rgba(15, 61, 94, .065);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font: 1rem/1.56 var(--font);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--blue-text); text-underline-offset: .21em; }
a:hover { color: var(--navy); }
p, h1, h2, h3, figure, dl { margin: 0; }
h1, h2, h3 { color: var(--navy); line-height: 1.13; }
button, input, select { font: inherit; min-width: 0; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.wrap { width: min(1200px, calc(100% - 5rem)); margin-inline: auto; }
.print-sheet { display: none; }

.skip-link {
  position: absolute;
  z-index: 10;
  inset: .75rem auto auto .75rem;
  padding: .75rem 1rem;
  transform: translateY(-150%);
  border-radius: .5rem;
  background: var(--navy);
  color: var(--white);
}

.skip-link:focus { transform: none; color: var(--white); }
.site-header { background: var(--white); border-bottom: 1px solid var(--soft-line); }
.header-layout, .footer-layout { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; flex-shrink: 0; color: var(--navy); text-decoration: none; font-size: 1.28rem; font-weight: 790; letter-spacing: -.048em; white-space: nowrap; }
.brand > svg { width: 36px; height: 36px; }
.brand span span { color: var(--blue-text); }
.site-header nav, .site-footer nav { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem 1.6rem; }
.site-header nav a, .site-footer nav a { color: var(--muted); font-size: .92rem; font-weight: 650; text-decoration: none; }
.site-header nav a:hover, .site-footer nav a:hover { color: var(--blue-text); text-decoration: underline; }
.site-footer { border-top: 1px solid var(--line); background: #eff7fb; }
.footer-layout { min-height: 100px; }

.home-hero { display: grid; grid-template-columns: 1.02fr 1fr; align-items: center; gap: clamp(2rem, 5vw, 5.5rem); padding-block: clamp(2.5rem, 5.3vw, 5.25rem); }
.eyebrow { display: flex; align-items: center; gap: .55rem; color: var(--teal); font-size: .73rem; font-weight: 780; letter-spacing: .12em; text-transform: uppercase; }
.status-dot { height: 8px; width: 8px; flex: none; border-radius: 50%; background: var(--amber); }
.hero-copy h1 { margin-block: .78rem 1.2rem; font-size: clamp(2.8rem, 5.35vw, 5.3rem); font-weight: 790; line-height: 1.005; letter-spacing: -.058em; }
.hero-copy h1 span { color: var(--blue-text); }
.hero-copy > p:not(.eyebrow, .privacy-tag) { max-width: 37ch; color: var(--muted); font-size: clamp(1.03rem, 1.65vw, 1.25rem); line-height: 1.55; }
.hero-actions { display: flex; gap: .6rem .8rem; flex-wrap: wrap; margin-top: 1.5rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 42px; max-width: 100%; padding: .62rem .94rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--white); color: var(--navy); text-align: center; text-decoration: none; font-size: .9rem; font-weight: 690; line-height: 1.22; }
.button svg, .tool-link svg, .back-link svg { width: 17px; height: 17px; flex: none; }
.button:hover, .button:focus-visible { border-color: var(--blue); color: var(--blue-text); }
.button.primary { min-height: 46px; border-color: var(--navy); background: var(--navy); color: var(--white); }
.button.primary:hover { border-color: #175b85; background: #175b85; }
.button.quiet { min-height: 46px; background: transparent; }
.button:disabled { opacity: .48; }
.privacy-tag { display: flex; align-items: center; flex-wrap: wrap; gap: .42rem; margin-top: 1.18rem; color: var(--teal); }
.privacy-tag svg { width: 16px; height: 16px; }
.privacy-tag a { color: var(--teal); font-size: .83rem; text-decoration: none; font-weight: 640; }
.privacy-tag a:hover { text-decoration: underline; }
.hero-figure { min-width: 0; overflow: hidden; border: 1px solid #accfde; border-radius: 17px; background: white; box-shadow: var(--shadow); }
.hero-figure img { width: 100%; height: auto; }
.hero-figure figcaption { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .82rem 1.1rem; border-top: 1px solid var(--line); }
.hero-figure figcaption div { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .85rem; }
.hero-figure figcaption span { font-size: .84rem; font-weight: 650; color: var(--muted); }
.hero-figure figcaption strong { color: var(--navy); font-size: 1.2rem; font-variant-numeric: tabular-nums; font-weight: 780; white-space: nowrap; }
.hero-figure figcaption small { font-size: .72em; }
.hero-figure figcaption a { flex: none; display: grid; width: 37px; height: 37px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--blue-text); }
.hero-figure figcaption a:hover { background: var(--soft-blue); border-color: var(--blue); }
.hero-figure figcaption svg { width: 19px; height: 19px; }

.tool-section { padding: 1.85rem 0 4.8rem; border-top: 1px solid var(--line); }
.section-header { margin-bottom: 1.3rem; }
.section-header h2 { margin-top: .42rem; font-size: clamp(1.8rem, 3.45vw, 3rem); font-weight: 760; letter-spacing: -.044em; }
.section-header p:not(.eyebrow) { margin-top: .48rem; color: var(--muted); }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .95rem; }
.tool-card { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 1.13rem; border: 1px solid var(--line); border-radius: .76rem; background: white; color: var(--ink); text-decoration: none; box-shadow: 0 2px 4px rgba(15, 61, 94, .045); }
.tool-card:hover { border-color: #72b7d9; color: var(--ink); box-shadow: var(--shadow); }
.tool-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 10px; background: #e7f5fb; color: var(--blue-text); }
.tool-icon svg { width: 28px; height: 28px; }
.tool-card h3 { margin-top: .86rem; font-size: 1.09rem; letter-spacing: -.024em; }
.tool-card p { margin: .42rem 0 .85rem; color: var(--muted); font-size: .9rem; }
.tool-link { display: inline-flex; align-items: center; gap: .32rem; margin-top: auto; color: var(--blue-text); font-size: .81rem; font-weight: 730; }

.example-section { padding: clamp(2rem, 5vw, 4.5rem) 0; border-top: 1px solid var(--line); background: #eaf5fb; }
.examples-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.filter-control { display: grid; gap: .3rem; color: var(--navy); font-size: .85rem; font-weight: 690; min-width: min(100%, 18rem); }
.filter-control input { width: 100%; padding: .6rem .7rem; }
.filter-status { margin-bottom: .75rem; color: var(--muted); font-size: .9rem; }
.filter-status:empty { display: none; }
.guide-grid { display: grid; align-items: start; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.guide-group { min-width: 0; border: 1px solid var(--line); border-radius: .72rem; background: white; padding: 1.05rem; }
.guide-group h3 { font-size: 1.01rem; margin-bottom: .5rem; }
.guide-group h3 a { color: var(--navy); text-decoration: none; }
.guide-group h3 a:hover { text-decoration: underline; }
.guide-group ul { list-style: none; margin: 0; padding: 0; }
.guide-group li { border-top: 1px solid var(--soft-line); }
.guide-group li a { display: flex; justify-content: space-between; align-items: center; gap: .54rem; padding: .62rem 0; font-size: .88rem; font-weight: 580; line-height: 1.34; text-decoration: none; }
.guide-group li a:hover { text-decoration: underline; }
.guide-group li svg { width: 15px; height: 15px; flex: none; }

.inner-page { padding-block: 1.35rem 4rem; }
.breadcrumbs { display: flex; align-items: baseline; flex-wrap: wrap; gap: .34rem .59rem; margin-bottom: 1.26rem; color: var(--muted); font-size: .83rem; }
.breadcrumbs a { font-weight: 620; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.page-heading { max-width: 920px; margin-bottom: 1.45rem; }
.page-heading h1, .missing-page h1 { margin: .45rem 0 .65rem; font-size: clamp(2.1rem, 4.35vw, 3.55rem); font-weight: 785; letter-spacing: -.044em; text-wrap: balance; }
.page-intro { max-width: 76ch; color: var(--muted); font-size: 1.02rem; }
.jump-to-result { display: none; }
.calculator-grid { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); align-items: start; gap: 1.15rem; }
.calculator-panel { min-width: 0; padding: clamp(1rem, 2vw, 1.5rem); border: 1px solid var(--line); border-radius: .85rem; background: var(--white); box-shadow: var(--shadow); }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: .45rem; padding-bottom: 1rem; }
.panel-title h2, .export-panel h2, .content-panel h2 { font-size: 1.21rem; font-weight: 760; letter-spacing: -.023em; }
.unit-toggle { display: inline-flex; flex: none; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: .55rem; background: var(--soft-blue); }
.unit-toggle button { border: 0; border-radius: .37rem; background: none; color: var(--navy); padding: .35rem .57rem; font-size: .78rem; font-weight: 720; }
.unit-toggle button[aria-pressed="true"] { color: white; background: var(--navy); }
.field-group { margin: 0; padding: .65rem 0 1.05rem; min-width: 0; border: 0; }
.field-group + .field-group { border-top: 1px solid var(--soft-line); }
.field-group legend { padding: 0 .48rem 0 0; color: var(--teal); font-size: .78rem; font-weight: 780; }
.field-grid { display: grid; gap: .78rem .82rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: .26rem; color: var(--ink); font-size: .82rem; font-weight: 690; line-height: 1.32; }
.input-wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); }
.input-wrap.has-unit { grid-template-columns: minmax(0, 1fr) auto; align-items: center; border: 1px solid var(--line); border-radius: .44rem; background: #fcfeff; }
.input-wrap.has-unit:focus-within { outline: 2px solid var(--blue); outline-offset: 1px; }
.input-wrap.has-unit input { outline: none; border: 0; background: transparent; }
.input-wrap.has-unit:has([aria-invalid="true"]), input[aria-invalid="true"] { border-color: #a8342d; }
input, select { min-height: 42px; border: 1px solid var(--line); border-radius: .44rem; background: #fcfeff; color: var(--ink); }
.input-wrap input, .input-wrap select { width: 100%; padding: .5rem .56rem; }
.input-wrap input { appearance: textfield; font-variant-numeric: tabular-nums; }
.input-wrap input::-webkit-inner-spin-button { appearance: none; }
.input-wrap select { padding-right: 1.25rem; text-overflow: ellipsis; }
.input-unit { padding-inline: .03rem .55rem; color: var(--muted); font-size: .72rem; font-weight: 670; line-height: 1.16; }
.field small { display: block; margin: .3rem 0 0; color: var(--muted); font-size: .73rem; line-height: 1.31; }
.form-actions { padding-top: .2rem; }
.reset-button { color: var(--muted); background: var(--background); font-size: .82rem; }
.estimate-label { padding: .23rem .49rem; border: 1px solid #c5dfef; border-radius: .3rem; background: #edf7fc; color: var(--blue-text); font-size: .7rem; font-weight: 740; }
.result-status:not(.error-message) { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.error-message { border: 1px solid #e8b9b4; border-radius: .5rem; padding: .7rem; background: #fff7f5; color: #8a2a23; font-size: .9rem; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .58rem; }
.metric { min-width: 0; padding: .6rem .72rem; background: var(--background); border: 1px solid var(--soft-line); border-radius: .55rem; }
.metric dt { font-size: .75rem; color: var(--muted); font-weight: 680; line-height: 1.24; }
.metric dd { margin: .21rem 0 0; color: var(--navy); font-size: 1.08rem; font-weight: 785; font-variant-numeric: tabular-nums; line-height: 1.16; overflow-wrap: anywhere; }
.metric .metric-unit { font-size: .69em; font-weight: 690; color: var(--muted); white-space: normal; }
.metric .metric-detail { color: var(--teal); font-size: .73rem; font-weight: 710; }
.metric-lead { grid-column: 1 / -1; padding: .69rem .86rem .79rem; border-color: #b4dbe9; background: linear-gradient(110deg, #e5f5fd, #f3fbff); }
.metric-lead dt { color: var(--navy); }
.metric-lead dd { font-size: clamp(1.8rem, 3.25vw, 2.72rem); letter-spacing: -.044em; }
.metric-lead .metric-unit { font-size: .47em; letter-spacing: -.025em; }
.metric-lead .metric-detail { margin-top: .34rem; font-size: .83rem; letter-spacing: 0; }
.diagram { margin-top: 1.02rem; }
.diagram figcaption, .result-table caption { margin: 0 0 .34rem; color: var(--navy); text-align: left; font-size: .78rem; font-weight: 740; }
.diagram svg { width: 100%; height: auto; border-radius: .65rem; }
.result-table { width: 100%; table-layout: fixed; margin-top: .95rem; border-collapse: collapse; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.result-table th, .result-table td { border-top: 1px solid var(--soft-line); padding: .36rem .23rem; text-align: right; overflow-wrap: anywhere; }
.result-table th:first-child { text-align: left; }
.result-table thead, .result-table tbody th { color: var(--navy); }
.export-panel { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 1rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--white); }
.export-panel h2 { font-size: 1rem; }
.output-actions { display: flex; flex-wrap: wrap; gap: .38rem; }
.output-button { min-height: 37px; padding: .47rem .67rem; font-size: .8rem; }
.action-status { color: var(--teal); font-size: .77rem; }
.share-field { display: grid; flex: 1 1 100%; gap: .26rem; color: var(--navy); font-size: .8rem; font-weight: 690; }
.share-field input { width: 100%; padding: .5rem .65rem; }
.noscript { margin-bottom: .8rem; padding: .7rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--white); color: var(--muted); }
.safety-callout { display: flex; gap: .68rem; margin: 1.2rem 0; padding: .9rem 1rem; border: 1px solid #e8c798; border-left: 4px solid var(--amber); border-radius: .59rem; background: #fff7e8; color: #64401b; }
.safety-icon { display: grid; flex: 0 0 22px; height: 22px; place-items: center; border: 1px solid #d6a36a; border-radius: 50%; color: var(--amber-text); font-size: .83rem; font-weight: 800; }
.safety-callout h2 { margin-bottom: .21rem; color: #744006; font-size: 1rem; }
.safety-callout p { font-size: .87rem; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; gap: 1.15rem; }
.article-main, .article-aside { display: grid; gap: 1rem; min-width: 0; }
.content-panel { min-width: 0; padding: 1.15rem; background: #fff; border: 1px solid var(--line); border-radius: .75rem; }
.content-panel h2 { margin-bottom: .57rem; }
.content-panel p { color: var(--muted); }
.formula-list, .formula-notes, .content-panel ul { margin: .62rem 0 0; padding-left: 1.32rem; }
.formula-list li, .formula-notes li, .content-panel ul li { padding-left: .1rem; margin: .33rem 0; overflow-wrap: anywhere; }
.formula-list li::marker { color: var(--blue-text); font-weight: 750; }
.formula-notes { color: var(--muted); font-size: .9rem; }
.faq-list details { border-top: 1px solid var(--soft-line); padding: .58rem 0; }
.faq-list summary { cursor: pointer; color: var(--navy); font-size: .93rem; font-weight: 710; }
.faq-list details p { padding-top: .41rem; font-size: .9rem; }
.references li, .related li { font-size: .88rem; }
.back-link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 730; font-size: .86rem; }
.info-page { width: min(920px, calc(100% - 5rem)); min-height: 65vh; }
.info-page .content-panel { padding: clamp(1.1rem, 3vw, 2.25rem); }
.info-page h2:not(:first-child) { margin-top: 1.25rem; }
.info-page .content-panel p + p { margin-top: .72rem; }
.info-page .back-link { margin-top: 1rem; }
.missing-page { min-height: 61vh; padding-top: 4rem; }

@media (max-width: 1100px) {
  .wrap { width: calc(100% - 3rem); }
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .home-hero { gap: 1.5rem; }
  .tool-grid, .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calculator-panel { padding: .95rem; }
  .field-grid { gap: .65rem; }
  .field label { font-size: .8rem; }
}
@media (max-width: 710px) {
  .wrap { width: calc(100% - 2rem); }
  .header-layout { min-height: 61px; }
  .site-header nav { gap: .74rem; }
  .site-header nav a { font-size: .84rem; }
  .brand { font-size: 1.13rem; }
  .brand > svg { width: 31px; height: 31px; }
  .home-hero, .calculator-grid, .article-layout { grid-template-columns: minmax(0, 1fr); }
  .home-hero { padding-top: 2.2rem; }
  .hero-copy h1 { max-width: 13ch; margin-bottom: .9rem; font-size: clamp(2.55rem, 9.4vw, 4.65rem); }
  .hero-copy > p:not(.eyebrow, .privacy-tag) { max-width: 37ch; }
  .hero-figure { width: 100%; max-width: 530px; }
  .examples-heading { align-items: stretch; flex-direction: column; }
  .tool-section { padding-bottom: 3rem; }
  .guide-grid { grid-template-columns: minmax(0, 1fr); }
  .calculator-grid, .article-layout { gap: .92rem; }
  .jump-to-result { display: inline-flex; align-items: center; gap: .32rem; margin: 0 0 .9rem; font-size: .88rem; font-weight: 700; }
  .jump-to-result svg { width: 15px; height: 15px; rotate: 90deg; }
  .export-panel { justify-content: flex-start; align-items: flex-start; }
  .export-title { width: 100%; }
  .footer-layout { align-items: flex-start; flex-direction: column; padding-block: 1rem; min-height: auto; }
  .site-footer nav { gap: .45rem 1rem; }
}
@media (max-width: 435px) {
  .header-about { display: none; }
  .header-layout { gap: .48rem; }
  .tool-grid { grid-template-columns: minmax(0, 1fr); }
  .button.quiet, .button.primary { padding-inline: .66rem; font-size: .83rem; }
  .input-unit { padding-right: .35rem; font-size: .65rem; }
  .calculator-panel, .content-panel { padding-inline: .81rem; }
}
@media (max-width: 330px) {
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .brand { gap: .42rem; }
}
@page { size: A4; margin: 12mm; }
@media print {
  body { background: #fff; color: #142f42; font-size: 9pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .do-not-print { display: none !important; }
  .print-sheet { display: block; max-width: 185mm; margin: 0 auto; line-height: 1.32; }
  .print-sheet .print-title { font-size: 18pt; margin: 0 0 2mm; }
  .print-sheet h2 { font-size: 11pt; margin: 2.5mm 0 1.25mm; }
  .print-brand { color: var(--navy); font-size: 11pt; font-weight: 720; margin-bottom: 2mm; }
  .print-url { margin-bottom: 2mm; color: var(--muted); overflow-wrap: anywhere; font-size: 8pt; }
  .print-columns { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 5mm; }
  .print-columns dl > div { display: flex; gap: 2mm; justify-content: space-between; border-bottom: 1px solid var(--soft-line); padding: .65mm 0; }
  .print-columns dd { margin: 0; text-align: right; font-weight: 680; }
  .print-diagram { width: 120mm; margin: 3mm auto 2mm; break-inside: avoid; }
  .print-diagram svg { width: 100%; }
  .print-sheet ol { padding-left: 5mm; margin: 1mm 0 2mm; }
  .print-sheet li { margin-bottom: 1mm; }
  .print-safety { padding: 2mm 2.5mm; border-left: 1mm solid var(--amber); background: #fff7e8; break-inside: avoid; font-size: 8pt; }
}
