:root {
  color-scheme: light;
  --ink: #1c263e;
  --muted: #66718a;
  --blue: #3c54d9;
  --line: #e0e4ef;
  --paper: #f5f6fa;
  --navy: #202b54;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, Helvetica, sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a, summary, input { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid #d48f15; outline-offset: 4px; }
[hidden] { display: none !important; }
.wrap { width: min(1160px, calc(100% - 72px)); margin-inline: auto; }
.site-header { height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.brand-dot { color: var(--blue); }
.brand small { display: block; color: var(--muted); font-size: 9px; font-weight: 400; letter-spacing: .5px; margin-top: 3px; }
.brand-mark { color: #fff; width: 40px; height: 42px; border-radius: 12px; background: var(--blue); display: grid; place-items: center; }
.brand-mark svg { width: 31px; height: 31px; }
.site-header nav { display: flex; align-items: center; gap: 26px; font-size: 12px; font-weight: 500; }
.site-header nav a { padding: 12px 0; color: var(--muted); }
.site-header nav .nav-active { color: var(--blue); }
.site-header nav a:hover, .site-footer a:hover { color: var(--blue); }
.header-note { display: flex; align-items: center; gap: 7px; padding: 11px 15px; font-size: 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.header-note:hover { border-color: #a8b4f1; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 35px; padding-top: 48px; padding-bottom: 40px; }
.hero-copy { min-width: 0; }
.eyebrow { font-size: 9px; font-weight: 600; letter-spacing: 1.4px; color: var(--muted); display: flex; align-items: center; gap: 7px; margin: 0 0 18px; }
.tiny-square { width: 6px; height: 6px; border-radius: 2px; background: var(--blue); }
h1 { font-size: clamp(36px, 4.4vw, 57px); font-weight: 600; line-height: 1.08; letter-spacing: -2.5px; margin: 0; }
h1 span { color: var(--blue); }
.hero-description { font-size: 14px; line-height: 1.7; color: var(--muted); margin: 19px 0 0; }
.hero-tags { display: flex; gap: 8px; margin-top: 19px; flex-wrap: wrap; }
.hero-tags span { font-size: 10px; padding: 6px 9px; color: #596584; border: 1px solid #e0e4ee; border-radius: 5px; background: #fff9; }
.hero-annotation { flex-shrink: 0; width: 305px; min-height: 215px; margin-right: 19px; padding: 26px 22px 21px 40px; position: relative; transform: rotate(3deg); border: 1px solid #e0e3ed; border-radius: 7px; background: repeating-linear-gradient(0deg, transparent 0, transparent 28px, #dce4f8 28px, #dce4f8 29px), #fff; box-shadow: 8px 10px 0 #e7eaf5; }
.hero-annotation::before { content: ''; position: absolute; left: 27px; top: 0; bottom: 0; width: 1px; background: #efc6c2; }
.notebook-holes { position: absolute; inset: 35px auto 30px 9px; display: flex; flex-direction: column; justify-content: space-between; }
.notebook-holes i { display: block; width: 7px; height: 7px; background: #e9ecf4; border-radius: 50%; border: 1px solid #d4d9e8; }
.notebook-label { font-size: 8px; letter-spacing: 1.3px; color: #7b849a; background: #fff; }
.notebook-title { font-family: Georgia, serif; font-size: 23px; font-style: italic; color: #38497b; margin: 15px 0 14px; }
.notebook-equation { font-family: 'Courier New', monospace; font-size: 14px; white-space: nowrap; margin: 0; color: #526285; }
.notebook-equation span { display: inline-block; border: 1px solid #e4c357; border-radius: 50%; background: #fff3b6; padding: 5px 3px; }
.notebook-answer { font-family: Georgia, serif; font-style: italic; color: var(--blue); font-size: 29px; margin: 8px 0 0; display: flex; align-items: center; gap: 18px; }
.notebook-answer svg { width: 27px; height: 27px; color: #548369; }
.notebook-sticker { position: absolute; right: -21px; bottom: 8px; color: #6b5522; background: #f6dd87; padding: 10px 14px; border-radius: 4px; font-size: 10px; transform: rotate(-9deg); box-shadow: 0 3px 7px #2831580b; }
.calculator { display: grid; grid-template-columns: 1.12fr 1fr; gap: 18px; align-items: stretch; }
.input-panel { background: #fff; padding: 27px 31px 28px; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 4px 14px #2b366404; min-width: 0; }
.panel-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-title { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; margin: 0; letter-spacing: -.2px; }
.step-number { border-radius: 50%; background: #eff2fd; color: var(--blue); width: 24px; height: 24px; display: grid; place-items: center; font-size: 11px; flex-shrink: 0; }
.scale-label { color: #738098; font-size: 10px; }
.mode-switch { display: flex; padding: 4px; gap: 3px; background: #f2f4fa; border-radius: 8px; margin: 23px 0; }
.mode-switch button { flex: 1; padding: 12px 6px; border: 0; background: transparent; border-radius: 5px; font-size: 11px; color: #66708a; }
.mode-switch button[aria-pressed=true] { background: #fff; color: var(--blue); box-shadow: 0 2px 6px #2537750d; font-weight: 600; }
.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.field { min-width: 0; }
.field label, .weights legend { font-size: 12px; font-weight: 500; }
.number-shell { border: 1px solid #dce1ed; border-radius: 8px; margin-top: 9px; display: flex; align-items: baseline; padding: 12px 14px; min-width: 0; background: #fcfcfe; }
.number-shell:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px #3c54d91a; }
.number-shell input { padding: 0; width: 100%; min-width: 0; font-size: 34px; letter-spacing: -1px; font-weight: 500; color: var(--ink); border: 0; outline: 0; background: transparent; }
.number-shell span { color: #7f8aa1; font-size: 11px; white-space: nowrap; margin-left: 3px; }
.number-shell input[aria-invalid=true] { color: #a13235; }
.field-hint { font-size: 10px; line-height: 1.5; color: var(--muted); margin: 7px 0 0; }
.weights { border: 0; padding: 0; margin: 23px 0 0; min-width: 0; }
.weights legend { padding: 0; margin: 0 0 10px; }
.preset-row { display: flex; gap: 8px; }
.preset { border: 1px solid #e0e4ef; background: #fff; padding: 12px 6px; border-radius: 6px; flex: 1; font-size: 12px; color: #66718a; white-space: nowrap; }
.preset span { margin-inline: 6px; color: #98a2bc; }
.preset[aria-pressed=true] { color: var(--blue); border-color: #9bacef; background: #f0f3ff; }
.settings { margin-top: 14px; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
.settings summary { display: flex; justify-content: space-between; align-items: center; font-size: 11px; padding: 9px 0; min-height: 38px; color: var(--muted); gap: 8px; }
summary > span { flex-shrink: 0; transition: transform .15s; font-size: 18px; font-weight: 400; line-height: 1; }
details[open] > summary > span { transform: rotate(45deg); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; padding: 10px 0; }
.small-input { display: block; width: 100%; margin-top: 9px; border: 1px solid var(--line); border-radius: 6px; padding: 10px; color: var(--ink); background: #fcfcfe; }
.small-input[aria-invalid=true] { border-color: #a13235; }
.rounding-option { display: flex; align-items: center; gap: 8px; font-size: 11px; margin: 13px 0 21px; color: var(--muted); cursor: pointer; line-height: 1.5; }
.rounding-option input { width: 14px; height: 14px; accent-color: var(--blue); margin: 0; flex-shrink: 0; }
.calculate-button { width: 100%; display: flex; align-items: center; justify-content: space-between; color: #fff; background: var(--blue); border: 0; padding: 16px 18px; border-radius: 7px; font-size: 13px; box-shadow: 0 4px 10px #3c54d918; transition: background .15s; }
.calculate-button:hover { background: #2c42bf; }
.form-error { color: #9a282b; font-size: 12px; line-height: 1.5; }
.result-panel { background: var(--navy); color: #fff; padding: 27px 35px 26px; border: 1px solid var(--navy); border-radius: 15px; position: relative; display: flex; flex-direction: column; min-width: 0; }
.result-panel .panel-title { color: #edf0ff; }
.result-panel .step-number { color: #d0d9ff; background: #ffffff12; }
.result-label { font-size: 8px; letter-spacing: 1.3px; color: #a6b2df; }
.result-heading { font-size: 13px; color: #bfc9e8; margin: 35px 0 8px; }
.result-number { display: flex; align-items: baseline; gap: 14px; line-height: 1; }
#result-value { font-size: clamp(80px, 7.5vw, 106px); font-weight: 500; letter-spacing: -6px; font-variant-numeric: tabular-nums; }
#result-value.compact { font-size: clamp(52px, 5.6vw, 76px); letter-spacing: -3px; }
.result-unit { color: #aebce6; font-size: 16px; white-space: nowrap; }
.result-exact { font-size: 11px; color: #abb9df; margin: 10px 0 18px; min-height: 14px; }
.result-status { font-size: 10px; width: fit-content; display: flex; align-items: center; gap: 7px; background: #a8dab01c; border: 1px solid #acd6b533; border-radius: 5px; padding: 7px 9px; color: #c3ecc9; line-height: 1.4; }
.result-status.warning { background: #f3d88b20; border-color: #f3d88b50; color: #f9df98; }
.result-status.error { background: #f3b3b320; border-color: #f3b3b340; color: #ffc3c3; }
.progress-track { height: 7px; border-radius: 6px; background: #ffffff14; margin-top: 24px; position: relative; overflow: hidden; }
#progress-fill { height: 100%; background: #97acf9; border-radius: 6px; transition: width .25s; }
.meter-tick { position: absolute; height: 7px; width: 2px; background: var(--navy); top: 0; left: 50%; }
.progress-labels { display: flex; justify-content: space-between; font-size: 9px; color: #a3b1da; margin-top: 7px; }
.result-calculation { border-top: 1px solid #ffffff1a; margin-top: 27px; padding-top: 19px; }
.result-calculation > span { color: #acb9e2; font-size: 8px; letter-spacing: 1.3px; }
.result-calculation p { font-size: 19px; margin: 12px 0 0; letter-spacing: -.3px; line-height: 1.5; overflow-wrap: anywhere; }
.result-calculation strong { font-weight: 500; color: #f8df91; }
.result-note { font-size: 11px; line-height: 1.6; color: #b8c4e7; margin: 9px 0 0; }
.calculator-note { font-size: 10px; line-height: 1.7; color: var(--muted); margin-top: 14px; display: flex; gap: 8px; }
.calculator-note svg { flex-shrink: 0; }
.how-to { display: grid; grid-template-columns: 230px 1fr; gap: 30px; margin-top: 45px; padding: 27px 0 30px; border-block: 1px solid var(--line); }
.how-to-heading .eyebrow { margin-bottom: 10px; }
.how-to h2 { font-size: 20px; line-height: 1.2; letter-spacing: -.5px; max-width: 160px; }
.instruction-list { display: grid; grid-template-columns: repeat(3,1fr); gap: 25px; padding: 0; margin: 0; list-style: none; }
.instruction-list li { display: flex; align-items: flex-start; gap: 10px; }
.instruction-list li > span { color: var(--blue); background: #e9edfc; font-size: 9px; font-weight: 600; padding: 7px; border-radius: 5px; }
h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; }
.instruction-list h3 { margin-top: 5px; font-size: 11px; }
.instruction-list p { color: var(--muted); font-size: 10px; line-height: 1.7; margin: 0; }
.explanation { display: grid; grid-template-columns: .78fr 1.25fr; gap: 65px; margin-top: 57px; }
.section-intro .eyebrow { font-size: 9px; margin-bottom: 16px; }
h2 { font-size: 31px; font-weight: 500; letter-spacing: -1px; line-height: 1.2; margin: 0; }
.section-intro > p:not(.eyebrow) { font-size: 13px; color: var(--muted); line-height: 1.8; margin-top: 18px; max-width: 290px; }
.text-link { display: inline-flex; gap: 15px; align-items: center; font-size: 12px; color: var(--blue); margin-top: 10px; }
.text-link:hover { text-decoration: underline; }
.formula-content { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.formula-box { border: 1px solid #dce2f3; border-radius: 10px; padding: 23px 22px; background: #eef1fb; }
.formula-label { font-size: 8px; color: #6877a1; letter-spacing: .8px; line-height: 1.6; display: block; }
.formula-box h3 { font-size: 13px; margin: 16px 0 10px; }
.formula-box > p { font-size: 16px; line-height: 1.65; margin: 0 0 14px; letter-spacing: -.35px; }
.formula-box > p > span { color: var(--blue); }
.formula-footnote { font-size: 10px; color: #606e90; line-height: 1.7; display: block; }
.reverse-formula { background: #fffaf0; border-color: #eee5cb; }
.reverse-formula .formula-label { color: #826f43; }
.examples-section { margin-top: 58px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.section-heading .eyebrow { margin-bottom: 12px; }
.section-heading h2 { font-size: 27px; }
.section-aside { font-size: 10px; color: var(--muted); margin-bottom: 5px; }
.example-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.example-card { padding: 25px 23px; background: #fff; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.example-tag { display: inline-block; font-size: 8px; letter-spacing: .5px; padding: 6px 7px; color: #4b60ab; background: #eff2fe; border-radius: 4px; }
.tag-yellow { background: #fcf1d3; color: #82682b; }
.tag-grey { background: #f0f2f6; color: #707a8e; }
.example-card h3 { font-size: 14px; line-height: 1.5; margin: 17px 0 9px; }
.example-card p { font-size: 11px; line-height: 1.8; color: var(--muted); margin: 8px 0 0; }
.example-card strong { font-weight: 600; color: var(--ink); }
.example-equation { font-size: 14px; line-height: 1.6; padding: 15px 0; border-block: 1px dashed #e0e5f0; margin-top: 17px; letter-spacing: -.2px; }
.example-equation strong { color: var(--blue); }
.faq-section { display: grid; grid-template-columns: .78fr 1.25fr; gap: 65px; margin-top: 60px; padding-top: 36px; border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; font-size: 12px; line-height: 1.6; padding: 20px 0; }
.faq-list details:first-child summary { padding-top: 0; }
.faq-list details p { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 0 20px 20px 0; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); margin-top: 65px; padding: 30px 0 35px; }
.site-footer .brand { font-size: 24px; }
.site-footer p { color: var(--muted); font-size: 10px; margin: 9px 0 0; }
.footer-links { display: flex; gap: 23px; font-size: 10px; }
.review-date { font-size: 9px; color: #74809b; line-height: 1.7; text-align: right; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 12px; background: #fff; }
.skip-link:focus { top: 12px; }
.noscript-note { border: 1px solid #d5b570; background: #fff2d1; padding: 16px; }
@media (max-width: 1000px) {
  .wrap { width: calc(100% - 48px); }
  .header-note { display: none; }
  .hero-annotation { width: 270px; margin-right: 10px; padding-left: 36px; }
  h1 { font-size: 47px; }
  .input-panel { padding-inline: 25px; }
  .result-panel { padding-inline: 28px; }
  .how-to { grid-template-columns: 180px 1fr; gap: 20px; }
  .instruction-list { gap: 15px; }
  .explanation, .faq-section { gap: 30px; grid-template-columns: .65fr 1fr; }
  .formula-content { grid-template-columns: 1fr; }
  .formula-box > p br { display: none; }
}
@media (max-width: 760px) {
  .hero-annotation { width: 235px; padding-left: 34px; margin-right: 5px; }
  .notebook-title { font-size: 20px; }
  .notebook-equation { font-size: 12px; }
  h1 { font-size: 39px; letter-spacing: -1.7px; }
  .hero-description { font-size: 13px; }
  .hero-tags { gap: 5px; }
  .hero-tags span { font-size: 9px; padding-inline: 6px; }
  .mode-switch button { font-size: 10px; }
  .scale-label { max-width: 90px; text-align: right; font-size: 9px; line-height: 1.4; }
  .input-panel, .result-panel { padding-inline: 20px; }
  .score-grid { gap: 12px; }
  .number-shell { padding-inline: 10px; }
  .number-shell input { font-size: 30px; }
  .number-shell span { font-size: 9px; }
  .preset { font-size: 10px; }
  .preset span { margin-inline: 2px; }
  .result-number { gap: 9px; }
  #result-value { font-size: 80px; }
  #result-value.compact { font-size: 53px; }
  .result-unit { font-size: 13px; }
  .result-calculation p { font-size: 16px; }
  .how-to { grid-template-columns: 1fr; }
  .how-to h2 { max-width: none; }
  .example-cards { gap: 10px; }
  .example-card { padding: 20px 16px; }
  .section-aside { display: none; }
  .footer-links { gap: 12px; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .site-header { height: 80px; gap: 12px; }
  .brand { font-size: 25px; gap: 8px; }
  .brand-mark { width: 33px; height: 36px; border-radius: 10px; }
  .brand-mark svg { width: 26px; height: 26px; }
  .brand small { font-size: 8px; letter-spacing: .1px; }
  .site-header nav { gap: 16px; font-size: 10px; }
  .site-header nav a:first-child { display: none; }
  .site-header nav a:nth-child(2) { max-width: 65px; line-height: 1.5; }
  .hero { padding-top: 29px; padding-bottom: 26px; }
  h1 { font-size: clamp(29px, 7.2vw, 46px); letter-spacing: -1.3px; line-height: 1.13; }
  .hero .eyebrow { font-size: 8px; letter-spacing: 1px; margin-bottom: 16px; }
  .hero-description { font-size: 12px; margin-top: 15px; }
  .desktop-break, .hero-annotation { display: none; }
  .hero-tags { margin-top: 15px; gap: 6px; }
  .hero-tags span { font-size: 9px; padding: 6px 8px; }
  .calculator { grid-template-columns: 1fr; gap: 13px; }
  .input-panel { padding: 22px 21px 23px; border-radius: 12px; }
  .panel-title { font-size: 14px; }
  .scale-label { max-width: none; font-size: 9px; }
  .mode-switch { margin-block: 21px; }
  .mode-switch button { min-height: 41px; font-size: 10px; padding-inline: 4px; line-height: 1.4; }
  .score-grid { gap: 13px; }
  .field label, .weights legend { font-size: 11px; }
  .number-shell { padding: 12px 11px; }
  .number-shell input { font-size: 33px; }
  .number-shell span { font-size: 10px; }
  .preset { font-size: 11px; min-height: 43px; }
  .preset span { margin-inline: 3px; }
  .settings summary { font-size: 10px; }
  .rounding-option { font-size: 10px; margin-top: 11px; margin-bottom: 18px; }
  .result-panel { padding: 24px 25px; border-radius: 12px; }
  .result-heading { margin-top: 28px; font-size: 13px; }
  #result-value { font-size: 88px; }
  #result-value.compact { font-size: clamp(48px, 15vw, 65px); letter-spacing: -2px; }
  .result-unit { font-size: 14px; }
  .result-calculation p { font-size: 18px; }
  .calculator-note { font-size: 9px; margin-top: 13px; }
  .how-to { margin-top: 31px; padding-block: 25px; gap: 21px; }
  .instruction-list { grid-template-columns: 1fr; gap: 17px; }
  .instruction-list li { gap: 12px; }
  .instruction-list h3 { font-size: 12px; margin-top: 4px; margin-bottom: 4px; }
  .instruction-list p { font-size: 11px; }
  .explanation, .faq-section { grid-template-columns: 1fr; gap: 24px; margin-top: 37px; }
  h2 { font-size: 27px; letter-spacing: -.7px; }
  .section-intro h2 br { display: none; }
  .section-intro > p:not(.eyebrow) { max-width: none; font-size: 12px; margin-top: 13px; }
  .section-intro .eyebrow { margin-bottom: 13px; }
  .formula-content { grid-template-columns: 1fr; gap: 12px; }
  .formula-box { padding: 22px; }
  .formula-box > p br { display: initial; }
  .examples-section { margin-top: 37px; }
  .section-heading h2 { font-size: 25px; }
  .section-heading { margin-bottom: 19px; }
  .example-cards { grid-template-columns: 1fr; gap: 12px; }
  .example-card { padding: 23px; }
  .example-card h3 { font-size: 15px; margin-top: 14px; }
  .example-equation { padding-block: 12px; }
  .faq-section { padding-top: 28px; }
  .faq-list summary { font-size: 12px; min-height: 57px; padding-block: 17px; }
  .faq-list details p { font-size: 11px; }
  .site-footer { align-items: flex-start; flex-wrap: wrap; margin-top: 39px; gap: 24px; padding-block: 25px; }
  .site-footer > div:first-child { width: 100%; }
  .footer-links { flex-direction: column; gap: 13px; font-size: 11px; }
  .review-date { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
