:root {
  color-scheme: light;
  --ink: #16191d;
  --blue: #1d4ed8;
  --gold: #ca8a04;
  --gold-text: #795100;
  --chalk: #f7f8fa;
  --paper: #fff;
  --muted: #465464;
  --line: #d9e0e8;
  --display: 'Avenir Next Condensed', 'Franklin Gothic Medium', 'Arial Narrow', 'Helvetica Neue', system-ui, sans-serif;
  --sans: 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-family: var(--sans);
  background: var(--chalk);
  color: var(--ink);
  line-height: 1.55;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1.25rem; }
body { margin: 0; }
main { min-height: 65vh; }
button, input, select { font: inherit; }
a { color: var(--blue); text-underline-offset: .19em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .53; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.06; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -.024em; }
h3 { font-weight: 750; }
svg { display: block; }
.container { width: min(1250px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 10; top: 12px; left: 12px; padding: 10px 15px; background: var(--paper); transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 73px; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 850; font-size: 29px; letter-spacing: -.035em; line-height: 1; white-space: nowrap; }
.brand > span > span { color: var(--blue); }
.header-inner nav, .footer-inner nav { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.header-inner nav a, .footer-inner nav a { color: var(--ink); font-size: .935rem; font-weight: 650; text-decoration: none; }
.header-inner nav a:hover, .header-inner nav a[aria-current], .footer-inner nav a:hover { color: var(--blue); text-decoration: underline; }
.site-footer { border-top: 1px solid var(--line); background: var(--paper); }
.footer-inner { display: flex; align-items: center; gap: 28px; min-height: 104px; padding-block: 20px; flex-wrap: wrap; }
.footer-inner p { margin-right: auto; color: var(--muted); font-size: .93rem; }
.footer-brand { font-size: 24px; }
.footer-brand svg { width: 32px; height: 32px; }
.footer-inner nav { gap: 22px; }

.kicker { color: var(--blue); font: 700 .8rem/1.4 var(--mono); letter-spacing: .052em; text-transform: uppercase; display: flex; align-items: center; gap: 9px; }
.kicker span { inline-size: 18px; block-size: 3px; background: var(--gold); }
.home-hero { background: var(--ink); color: var(--chalk); border-bottom: 4px solid var(--blue); }
.hero-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4.2vw, 66px); padding-block: clamp(40px, 5.5vw, 83px); }
.hero-copy h1 { font-size: clamp(3rem, 5.75vw, 5.85rem); line-height: .94; margin-block: 17px 23px; }
.hero-copy .kicker { color: #adc5e8; }
.hero-copy > p:not(.kicker) { color: #d3deec; font-size: clamp(1.01rem, 1.5vw, 1.21rem); max-width: 42ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px 23px; align-items: center; margin-top: 25px; }
.button { border: 1px solid transparent; border-radius: 7px; min-height: 42px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 9px 14px; line-height: 1.2; font-size: .9rem; font-weight: 750; text-decoration: none; }
.button.solid { background: var(--blue); color: var(--paper); }
.button.solid:hover { background: #183daa; }
.button.subtle { border-color: #bfccd9; background: var(--paper); color: var(--ink); }
.button.subtle:hover { border-color: var(--blue); color: var(--blue); }
.hero-actions .button { min-height: 46px; padding-inline: 17px; }
.home-hero .button.solid { background: #e0eaff; color: #15408a; }
.home-hero .button.solid:hover { background: #fff; }
.home-hero :focus-visible { outline-color: #afcbff; }
.hero-link { color: #e0eaff; font-size: .94rem; font-weight: 700; }
.hero-figure { border: 1px solid #455369; border-radius: 10px; overflow: hidden; background: #1b212b; }
.hero-figure > svg { width: 100%; height: auto; }
.hero-figure figcaption { border-top: 1px solid #455369; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px 12px; padding: 10px 16px; color: #cdd9ea; font-size: .82rem; }
.hero-figure figcaption a { color: #d3e5ff; font-weight: 700; }
.link-arrow { flex: 0 0 auto; font-family: var(--sans); }
.home-section { padding-block: 44px 52px; }
.section-top { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 21px; }
.section-top h2 { font-size: clamp(2.1rem, 3.2vw, 3.2rem); }
.section-top p { color: var(--muted); margin-top: 6px; }
.section-count { color: var(--muted); font: 700 .8rem var(--mono); white-space: nowrap; }
.tools-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.tool-card { display: flex; flex-direction: column; gap: 15px; min-height: 153px; padding: 17px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; text-decoration: none; color: var(--ink); }
.tool-card:hover { border-color: var(--blue); box-shadow: inset 0 3px var(--blue); }
.tool-card h3 { font-size: 1.15rem; line-height: 1.15; margin: 0 0 5px; }
.tool-card p { color: var(--muted); font-size: .89rem; }
.tool-card-top { display: flex; justify-content: space-between; align-items: center; color: var(--blue); }
.tool-card-top > .link-arrow { font-weight: 800; font-size: 1.14rem; }
.tool-icon { padding: 5px; border-radius: 7px; background: #edf3ff; }
.tool-icon svg { width: 30px; height: 30px; }
.example-band { background: #eaf0f9; border-top: 1px solid var(--line); }
.example-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
.example-group { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.example-group summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 11px 16px; font-weight: 750; cursor: pointer; }
.example-group summary > span:first-child { display: flex; align-items: center; gap: 8px; }
.example-group summary svg { color: var(--blue); width: 24px; height: 24px; }
.example-group summary::after { content: '+'; color: var(--blue); font: 800 1.2rem var(--mono); }
.example-group[open] summary::after { content: '−'; }
.example-count { margin-left: auto; color: var(--muted); font: 600 .82rem var(--mono); }
.example-group ul, .related ul, .references { padding: 0; margin: 0; list-style: none; }
.example-group ul { padding: 0 16px 9px; }
.example-group li a, .related li a { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; text-decoration: none; border-top: 1px solid var(--line); font-size: .92rem; font-weight: 650; }
.example-group li a:hover, .related li a:hover { text-decoration: underline; }

.sheet-page { padding-bottom: 45px; }
.breadcrumbs { color: var(--muted); padding-block: 16px 20px; font-size: .86rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 5px 8px; padding: 0; margin: 0; list-style: none; }
.breadcrumbs li:not(:last-child)::after { content: '/'; color: #66778d; padding-left: 8px; }
.breadcrumbs a { color: var(--muted); }
.page-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.page-intro h1 { font-size: clamp(2.65rem, 5.1vw, 4.6rem); line-height: .99; max-width: 24ch; }
.page-intro p:not(.kicker) { margin-top: 12px; color: var(--muted); font-size: clamp(1rem, 1.55vw, 1.16rem); max-width: 65ch; }
.page-intro .kicker { margin-bottom: 8px; }
.title-icon { display: grid; place-items: center; align-self: center; width: 84px; height: 84px; flex: 0 0 auto; border: 1px solid #cbd9f2; border-radius: 12px; background: #eaf1ff; color: var(--blue); }
.title-icon svg { width: 48px; height: 48px; }
.page-jumps { display: flex; flex-wrap: wrap; gap: 5px 18px; padding-block: 14px 20px; font-weight: 700; font-size: .91rem; }
.page-jumps a { text-decoration: none; }
.page-jumps a:hover { text-decoration: underline; }
.worksheet { border: 1px solid #cbd5e2; border-radius: 12px; background: var(--paper); box-shadow: 0 5px 15px #1226450b; }
.worksheet-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.worksheet-header h2 { font-size: 1.75rem; }
.worksheet-header p { margin-top: 3px; color: var(--muted); font-size: .88rem; }
.units { display: flex; padding: 4px; background: #ebf0f6; border-radius: 7px; gap: 2px; }
.units button { border: 0; border-radius: 5px; background: transparent; color: var(--muted); padding: 6px 11px; font-size: .83rem; font-weight: 750; }
.units button[aria-pressed='true'] { background: var(--blue); color: var(--paper); }
html:not(.interactive) .js-actions { display: none; }
.work-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.input-panel { min-width: 0; padding: 18px 22px; border-right: 1px solid var(--line); border-radius: 0 0 0 12px; background: #fbfcfe; }
.input-heading, .export-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.input-heading h3, .export-title h3 { font-size: 1.03rem; }
.input-actions { display: flex; align-items: center; gap: 12px; }
.jump-results { display: none; font-weight: 750; font-size: .83rem; }
.text-button { color: var(--blue); background: transparent; border: 0; padding: 5px 0; font-weight: 750; font-size: .86rem; text-decoration: underline; text-underline-offset: .15em; }
.compare-button { display: inline-flex; margin-bottom: 13px; min-height: 36px; }
fieldset { min-inline-size: 0; border: 0; padding: 0 0 15px; margin: 0 0 12px; border-bottom: 1px solid var(--line); }
fieldset:last-child { border: 0; padding-bottom: 0; margin-bottom: 0; }
legend { padding: 0; margin-bottom: 8px; color: var(--muted); font: 750 .73rem/1.25 var(--mono); letter-spacing: .027em; text-transform: uppercase; }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 13px; }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { display: block; font-weight: 700; font-size: .835rem; line-height: 1.25; margin-bottom: 5px; }
.field-entry { position: relative; }
.field-unit { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); font: 550 .73rem var(--mono); pointer-events: none; }
.field-entry:has(.field-unit:not([hidden])) input { padding-right: 4.05rem; }
.field-entry:has([data-field-unit='ringLarge'], [data-field-unit='ringSmall'], [data-field-unit='bigRing'], [data-field-unit='smallRing'], [data-field-unit='bigCog'], [data-field-unit='smallCog'], [data-field-unit='capacity'], [data-field-unit='maxCog'], [data-field-unit='frontPct'], [data-field-unit='hta'], [data-field-unit='angleA'], [data-field-unit='angleB']) input { padding-right: 1.8rem; }
.field input, .field select, .field textarea, .manual-share input { min-height: 42px; width: 100%; min-width: 0; padding: 7px 9px; color: var(--ink); border: 1px solid #b9c6d6; border-radius: 6px; background: var(--paper); font-size: 1rem; }
.field input, .field textarea { font-family: var(--mono); }
.field textarea { display: block; field-sizing: content; overflow-wrap: anywhere; resize: vertical; }
.field input[type='number'] { appearance: textfield; }
.field input::-webkit-inner-spin-button, .field input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.field select { text-overflow: ellipsis; padding-right: 4px; font-size: .91rem; }
.field :is(input, textarea)[aria-invalid='true'] { border-color: #a8271c; background: #fff8f6; }
.field small { display: block; margin-top: 4px; color: var(--muted); font-size: .75rem; line-height: 1.32; }
.result-panel { padding: 18px 20px 16px; min-width: 0; }
.readout { background: var(--ink); color: var(--paper); border-radius: 8px; padding: 14px 15px 12px; }
.readout h3 { color: #c5d5e9; font: 700 .77rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 10px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px 10px; }
.metric { border-top: 1px solid #536174; padding: 8px 0 2px; min-width: 0; }
.metric dt { color: #d0dcec; font-size: .74rem; line-height: 1.2; min-height: 1.3em; }
.metric dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 5px; margin-top: 4px; }
.metric-number { font: 800 clamp(1.3rem, 2.2vw, 2.05rem)/1.09 var(--display); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.metric-unit { color: #cbdaf0; font: 650 .72rem var(--mono); overflow-wrap: anywhere; }
.result-notes:empty { display: none; }
.result-note, .safety-note, .result-error { border-radius: 6px; background: #edf3fe; border-left: 3px solid #7d9ae1; padding: 9px 11px; margin-top: 9px; color: #213658; font-size: .855rem; line-height: 1.4; }
.result-note.warning, .safety-note { background: #fffaee; color: #563a05; border-left-color: var(--gold); }
.result-error { background: #fff1ee; color: #86241b; border-left-color: #a8271c; margin-top: 0; }
.diagram { border-radius: 8px; border: 1px solid var(--line); background: var(--chalk); margin-top: 13px; min-width: 0; }
.figure-title { font-weight: 750; font-size: .9rem; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.diagram-body svg { width: 100%; max-width: 760px; height: auto; margin-inline: auto; }
.diagram figcaption { padding: 6px 12px 10px; color: var(--muted); font-size: .78rem; line-height: 1.37; }
.gear-detail { padding: 4px 12px 3px; min-height: 22px; font: 700 .82rem/1.35 var(--mono); color: var(--blue); }
.gear-point { cursor: pointer; }
.gear-point[aria-pressed='true'] > circle:nth-of-type(2), .gear-point:focus-visible > circle:nth-of-type(2) { stroke: var(--ink); stroke-width: 4; }
.results-tables { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 12px; }
.results-tables summary { font-size: .9rem; font-weight: 750; padding: 9px 0; cursor: pointer; }
.table-stack { display: grid; gap: 10px; padding-bottom: 8px; min-width: 0; }
.table-wrap { overflow: auto; width: 100%; border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-spacing: 0; font-size: .765rem; text-align: left; }
caption { text-align: left; font-weight: 750; font-size: .84rem; padding: 7px 9px; }
th, td { padding: 6px 8px; border-bottom: 1px solid #e8edf4; }
th { font-weight: 740; }
thead { background: #eef2f8; }
tbody td { font-variant-numeric: tabular-nums; }
tbody tr:last-child > * { border-bottom: 0; }
.export-panel { margin-top: 12px; }
.export-title { margin-bottom: 7px; }
.export-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.export-buttons .button { min-height: 38px; padding-inline: 11px; }
.action-status { margin-top: 5px; font-size: .83rem; color: var(--muted); }
.action-status:empty { display: none; }
.manual-share { padding-top: 7px; }
.manual-share label { display: block; font-size: .86rem; }
.print-only { display: none; }

.reading-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 20px; }
.reading-main { display: grid; gap: 16px; min-width: 0; }
.article-panel, .guide-safety { background: var(--paper); border: 1px solid var(--line); border-radius: 9px; padding: 19px 21px; }
.article-panel h2, .guide-safety h2, .info-content h2 { font-size: 1.78rem; margin-bottom: 8px; }
.article-panel p, .guide-safety p { color: var(--muted); font-size: .945rem; margin-bottom: 9px; }
.article-panel p:last-child, .guide-safety p:last-child { margin-bottom: 0; }
.related h2 { font-size: 1.56rem; }
.math-steps { display: grid; list-style-position: outside; margin: 15px 0 3px; padding-left: 26px; gap: 11px; }
.math-steps li { padding-left: 5px; }
.math-steps li::marker { font: 750 .83rem var(--mono); color: var(--blue); }
.math-steps h3 { font-size: .95rem; margin-bottom: 3px; }
.math-steps p { font: 550 .8rem/1.5 var(--mono); overflow-wrap: anywhere; }
.references { margin-top: 12px; font-size: .87rem; display: grid; gap: 5px; }
.references a { font-weight: 650; }
.faq-list details, .comparison-math { border-top: 1px solid var(--line); }
.faq-list summary, .comparison-math summary { padding: 9px 0; cursor: pointer; font-weight: 700; font-size: .91rem; }
.faq-list details p { padding-bottom: 9px; }
.comparison-math { margin-top: 12px; }
.guide-safety { margin-top: 16px; border-left: 3px solid var(--gold); }
.guide-safety h2 { font-size: 1.36rem; }
.info-page { padding-bottom: 48px; }
.info-content { max-width: 76ch; display: grid; gap: 20px; margin-top: 24px; }
.info-content section { border-top: 1px solid var(--line); padding-top: 16px; }
.info-content p { color: var(--muted); margin-bottom: 7px; }
.not-found { display: grid; min-height: 61vh; align-items: center; }

@media (max-width: 1080px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-copy h1 { font-size: clamp(3rem, 6.2vw, 5.15rem); }
}
@media (max-width: 850px) {
  .container { width: calc(100% - 42px); }
  .header-inner nav { gap: 17px; }
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .input-panel, .result-panel, .worksheet-header { padding-inline: 14px; }
  .work-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .field-entry:has(.field-unit:not([hidden])) input { padding-right: 3.1rem; }
  .field-unit { right: 6px; font-size: .64rem; }
}
@media (max-width: 670px) {
  .container { width: calc(100% - 32px); }
  .header-inner { flex-wrap: wrap; gap: 4px 15px; padding-block: 9px; min-height: 63px; }
  .header-inner nav { gap: 8px 17px; }
  .header-inner nav a { font-size: .83rem; }
  .brand { font-size: 25px; }
  .brand svg { width: 31px; height: 31px; }
  .hero-layout { grid-template-columns: minmax(0, 1fr); gap: 21px; padding-block: 29px 26px; }
  .hero-copy h1 { font-size: clamp(2.65rem, 10vw, 4.25rem); margin-block: 12px 13px; }
  .hero-actions { margin-top: 16px; }
  .hero-figure { width: min(100%, 510px); }
  .hero-figure figcaption { font-size: .73rem; }
  .home-section { padding-block: 30px; }
  .section-top { align-items: start; margin-bottom: 13px; }
  .section-count { margin-top: 8px; font-size: .7rem; }
  .tool-card { padding: 13px; gap: 11px; }
  .tool-card h3 { font-size: 1.01rem; }
  .tool-card p { font-size: .82rem; }
  .example-grid, .reading-grid, .work-grid { grid-template-columns: minmax(0, 1fr); }
  .page-intro { gap: 8px; }
  .page-intro h1 { font-size: clamp(2.35rem, 8.75vw, 3.4rem); }
  .title-icon { display: none; }
  .breadcrumbs { padding-block: 11px 14px; font-size: .77rem; }
  .page-jumps { padding-block: 12px 15px; font-size: .84rem; }
  .input-panel { border-right: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .jump-results { display: inline; }
  .input-panel, .result-panel { padding-block: 13px; }
  .field:has(select:is([name="mode"], [name="slack"])) { grid-column: 1 / -1; }
  .worksheet-header { padding-block: 12px; }
  .article-panel, .guide-safety { padding: 14px; }
  .footer-inner { gap: 10px 22px; }
  .footer-inner p { flex-basis: 100%; }
  .footer-inner nav { gap: 10px 18px; }
}
@media (prefers-reduced-motion: no-preference) {
  .button, .tool-card { transition: color .13s, background-color .13s, border-color .13s; }
}
@page { margin: 13mm; size: auto; }
@media print {
  :root, body, .worksheet { background: #fff; color: #16191d; }
  * { print-color-adjust: exact; }
  .site-header, .site-footer, .breadcrumbs, .page-jumps, .skip-link, .title-icon, .worksheet-header, .input-panel,
  .export-panel, .reading-grid, .guide-safety, .page-intro .kicker { display: none !important; }
  .container { width: 100%; }
  .sheet-page { padding: 0; }
  .page-intro { margin-bottom: 4mm; }
  .page-intro h1 { max-width: none; font-size: 24pt; }
  .page-intro p:not(.kicker) { font-size: 10pt; margin-top: 2mm; }
  .worksheet { border: none; box-shadow: none; }
  .work-grid { display: block; }
  .result-panel { padding: 0; }
  .print-only { display: block; }
  .print-inputs { break-inside: avoid; margin-bottom: 4mm; }
  .print-inputs h3 { font-size: 11pt; margin-bottom: 2mm; }
  .print-inputs dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1mm 4mm; }
  .print-inputs dl div { border-bottom: 1px solid #d9e0e8; padding-bottom: 1mm; min-width: 0; }
  .print-inputs dt { font-size: 8pt; }
  .print-inputs dd { font: 600 8pt var(--mono); overflow-wrap: anywhere; }
  .readout { break-inside: avoid; padding: 3mm; }
  .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metric-number { font-size: 16pt; }
  .diagram { break-inside: avoid; margin-top: 3mm; }
  .diagram-body svg { max-height: 72mm; }
  .table-wrap { overflow: visible; }
  .results-tables::details-content { content-visibility: visible; }
  .results-tables summary { display: none; }
  table { font-size: 8pt; }
  th, td { padding: 1mm 1.5mm; }
  tr { break-inside: avoid; }
  thead { display: table-header-group; }
}
