:root {
  --paper: #F4F6F5;
  --sheet: #FFFFFF;
  --ink: #15233A;
  --slate: #4A5869;
  --rule: #D3DBDD;
  --haem: #6D28D9;
  --haem-dark: #5B21B6;
  --haem-tint: #F0EAFC;
  --ok: #1E7748;  --ok-bg: #E6F2EB;
  --pre: #9A5800; --pre-bg: #FBF0DD;
  --dm: #B3261E;  --dm-bg: #FBE7E5;
  --serif: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
  --sans: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
  --measure: 68ch;
  --radius-s: 6px;
  --radius-l: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.1875rem/1.6 var(--sans);
  font-variant-numeric: tabular-nums;
}
img, svg { max-width: 100%; }
a { color: var(--haem); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--haem-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #1B5FD6; outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }

.site-head { background: var(--sheet); border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 72px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; font: 700 1.25rem/1 var(--serif); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.site-nav ul { list-style: none; display: flex; gap: .3rem 1.4rem; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.02rem; padding: .35rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--haem); color: var(--ink); }

h1, h2, h3 { font-family: var(--serif); color: var(--ink); line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.3rem); margin: 0 0 .9rem; letter-spacing: -0.02em; max-width: 20ch; line-height: 1.08; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin: 0 0 .8rem; }
h3 { font-size: 1.3rem; margin: 1.6rem 0 .5rem; }
p, li { max-width: var(--measure); }
.intro { font-size: 1.25rem; color: var(--slate); max-width: 60ch; margin: 0 0 2rem; }
.crumbs { font-size: .98rem; color: var(--slate); margin: 0 0 1.25rem; }
.crumbs a { color: var(--slate); }

.hero { padding: 2.75rem 0 3.25rem; }
.tool {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius-l);
  overflow: hidden;
}
.tool-form { padding: 2rem; border-right: 1px solid var(--rule); }
.tool-out { padding: 2rem; display: flex; flex-direction: column; gap: 1.1rem; min-height: 100%; }
.result { display: flex; flex-direction: column; gap: 1.1rem; }
.result:focus { outline: none; }
.field { margin: 0 0 1.4rem; border: 0; padding: 0; }
.field > label, .field > legend { display: block; font-weight: 700; margin: 0 0 .45rem; padding: 0; font-size: 1.05rem; }
.hint { display: block; color: var(--slate); font-size: .98rem; margin: -.2rem 0 .55rem; }
.input-row { display: flex; align-items: stretch; border: 2px solid #8796A6; border-radius: var(--radius-s); background: #fff; max-width: 22rem; }
.input-row:focus-within { border-color: #1B5FD6; box-shadow: 0 0 0 3px rgba(27,95,214,.18); }
.input-row input { flex: 1; min-width: 0; border: 0; background: transparent; font: 700 1.6rem/1 var(--sans); padding: .8rem .9rem; color: var(--ink); }
.input-row input:focus { outline: none; }
.input-row .unit { display: flex; align-items: center; padding: 0 1rem; color: var(--slate); font-weight: 700; border-left: 1px solid var(--rule); background: var(--paper); }
select { font: 400 1.1rem var(--sans); padding: .75rem .8rem; border: 2px solid #8796A6; border-radius: var(--radius-s); background: #fff; color: var(--ink); min-width: 16rem; }
.seg { display: inline-flex; border: 2px solid #8796A6; border-radius: var(--radius-s); overflow: hidden; margin-bottom: .6rem; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: .5rem 1rem; font-weight: 700; font-size: 1rem; color: var(--ink); background: #fff; }
.seg label + label span { border-left: 1px solid #8796A6; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid #1B5FD6; outline-offset: -3px; }
.choices { display: grid; gap: .55rem; }
.choice { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem .9rem; border: 1px solid var(--rule); border-radius: var(--radius-s); cursor: pointer; background: #fff; }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input { width: 1.3rem; height: 1.3rem; margin-top: .25rem; accent-color: var(--ink); flex: none; }
.choice b { display: block; }
.choice small { color: var(--slate); font-size: .95rem; display: block; }
.btn {
  appearance: none; border: 0; cursor: pointer; border-radius: var(--radius-s);
  background: var(--haem); color: #fff; font: 700 1.2rem/1 var(--sans);
  padding: 1.05rem 2rem; min-height: 56px; min-width: 12rem;
}
.btn:hover { background: var(--haem-dark); }
.btn-quiet { background: transparent; color: var(--ink); border: 2px solid var(--ink); font-size: 1rem; padding: .7rem 1.1rem; min-height: 0; min-width: 0; }
.btn-quiet:hover { background: var(--ink); color: #fff; }

.out-empty { color: var(--slate); margin: 0; }
.tool-out h2 { font-size: 1.15rem; font-family: var(--sans); margin: 0; color: var(--slate); }
.lead { font-size: 1.3rem; margin: 0; }
.lead b { color: var(--haem); }
.readout { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0; margin: 0; border-top: 1px solid var(--rule); }
.readout div { padding: .8rem 0; border-bottom: 1px solid var(--rule); }
.readout div:nth-child(odd) { padding-right: 1rem; }
.readout dt { color: var(--slate); font-size: .95rem; }
.readout dd { margin: 0; display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.readout dd b { font: 700 2.1rem/1.1 var(--sans); }
.readout dd span { color: var(--slate); font-weight: 700; }
.badge { display: inline-flex; align-items: center; gap: .55rem; margin: 0; padding: .45rem .9rem .45rem .5rem; border-radius: 999px; font-weight: 700; width: fit-content; }
.badge-icon { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; color: #fff; font-size: .95rem; }
.badge-normal { background: var(--ok-bg); color: var(--ok); } .badge-normal .badge-icon { background: var(--ok); }
.badge-pre { background: var(--pre-bg); color: var(--pre); } .badge-pre .badge-icon { background: var(--pre); }
.badge-dm { background: var(--dm-bg); color: var(--dm); } .badge-dm .badge-icon { background: var(--dm); }
.badge-note { margin: -.5rem 0 0; color: var(--slate); font-size: 1rem; }
.fine { font-size: 1rem; color: var(--slate); margin: 0; }
.warn { border-left: 4px solid var(--pre); padding-left: .8rem; color: var(--ink); }
.error { color: var(--dm); font-weight: 700; margin: 0; }

.ruler { padding: 2.6rem .7rem 0; }
.ruler-cap { font-size: .85rem; color: var(--slate); margin: .2rem 0 0; }
.ruler-band { position: relative; height: 20px; border-radius: 4px; }
.ruler-band .z { position: absolute; top: 0; bottom: 0; }
.z-g { background: #BFDDCB; } .z-y { background: #F3E0A8; } .z-o { background: #F0C98E; } .z-r { background: #EBA59C; } .z-rr { background: #D9776D; }
.z-first { border-radius: 4px 0 0 4px; } .z-last { border-radius: 0 4px 4px 0; }
.marker { position: absolute; left: 0; top: -12px; bottom: -12px; width: 3px; background: var(--haem); transform: translateX(-1.5px); transition: left .9s cubic-bezier(.2,.8,.2,1); }
.marker-label { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--haem); color: #fff; font-weight: 700; font-size: .9rem; padding: .15rem .45rem; border-radius: 4px; white-space: nowrap; }
.ruler-scale { position: relative; height: 1.6rem; font-size: .85rem; color: var(--slate); }
.ruler-scale span { position: absolute; transform: translateX(-50%); top: .25rem; }
.ruler-scale span::before { content: ""; position: absolute; left: 50%; top: -.45rem; height: .35rem; border-left: 1px solid #8796A6; }
.ruler-pct span:first-child { transform: none; } .ruler-pct span:last-child { transform: translateX(-100%); }
.ruler-key { padding-left: .7rem !important; display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .9rem; color: var(--slate); margin: .2rem 0 0; padding: 0; list-style: none; }
.ruler-key li::before { content: ""; display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; margin-right: .4rem; vertical-align: -1px; }
.ruler-key .k-normal::before { background: #BFDDCB; } .ruler-key .k-pre::before { background: #F0D29E; } .ruler-key .k-dm::before { background: #E28D85; }

main section.block { padding: 3rem 0; border-top: 1px solid var(--rule); }
.cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 3.5rem; align-items: start; }
.aside-box { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius-l); padding: 1.5rem; }
.aside-box h2 { font-size: 1.25rem; }
.aside-box ul { padding-left: 1.1rem; margin: 0; }
.aside-box li { margin: .35rem 0; }
.formula { font: 700 1.15rem/1.5 var(--sans); background: var(--sheet); border: 1px solid var(--rule); border-left: 4px solid var(--haem); padding: .9rem 1.1rem; border-radius: var(--radius-s); max-width: 40rem; }
.steps { padding-left: 1.4rem; } .steps li { margin: .5rem 0; }
.ref-table, table.conv { border-collapse: collapse; width: 100%; max-width: 46rem; background: var(--sheet); border: 1px solid var(--rule); font-size: 1.05rem; }
.ref-table th, .ref-table td, table.conv th, table.conv td { padding: .65rem .9rem; text-align: left; border-bottom: 1px solid var(--rule); }
.ref-table thead th, table.conv thead th { background: var(--ink); color: #fff; font-weight: 700; position: sticky; top: 0; }
table.conv td, table.conv th { text-align: right; } table.conv td:first-child, table.conv th:first-child { text-align: left; } table.conv td:first-child { font-weight: 700; }
table.conv tr.band-pre td:first-child { box-shadow: inset 4px 0 0 #E0A63E; }
table.conv tr.band-dm td:first-child { box-shadow: inset 4px 0 0 #D2665C; }
table.conv tr.band-normal td:first-child { box-shadow: inset 4px 0 0 #5FAE80; }
table.conv tr.hit td { background: var(--haem-tint); font-weight: 700; }
.table-tools { display: flex; gap: .8rem; flex-wrap: wrap; margin: 0 0 1rem; }
.table-scroll { max-height: 34rem; overflow: auto; border-radius: var(--radius-s); max-width: 46rem; }
.faq details { border-bottom: 1px solid var(--rule); max-width: 50rem; }
.faq summary { cursor: pointer; font-weight: 700; padding: 1rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; font-size: 1.12rem; }
.faq summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--haem); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 1.1rem; }

.index-groups { columns: 3 18rem; column-gap: 3rem; }
.index-group { break-inside: avoid; margin: 0 0 2rem; }
.index-group h3 { margin-top: 0; font-size: 1.15rem; border-bottom: 2px solid var(--ink); padding-bottom: .4rem; }
.index-group ul { list-style: none; padding: 0; margin: 0; }
.index-group li { padding: .32rem 0; border-bottom: 1px solid var(--rule); }
.index-group a { text-decoration: none; }
.index-group a:hover { text-decoration: underline; }
.related { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0 2rem; }
.related li { border-bottom: 1px solid var(--rule); padding: .55rem 0; }
.related a { text-decoration: none; font-weight: 700; }
.related a:hover { text-decoration: underline; }

.site-foot { background: var(--ink); color: #DCE3EA; padding: 2.5rem 0 3rem; margin-top: 2rem; font-size: 1rem; }
.site-foot a { color: #fff; }
.site-foot .wrap { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
.site-foot p { margin: 0 0 .8rem; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin: .3rem 0; }

@media (max-width: 860px) {
  body { font-size: 1.125rem; }
  .tool { grid-template-columns: 1fr; }
  .tool-form { border-right: 0; border-bottom: 1px solid var(--rule); padding: 1.4rem; }
  .tool-out { padding: 1.4rem; }
  .cols, .site-foot .wrap { grid-template-columns: 1fr; gap: 2rem; }
  .hero { padding-top: 1.75rem; }
  .btn { width: 100%; }
  .readout dd b { font-size: 1.75rem; }
  .site-nav ul { gap: .2rem 1rem; }
  .site-nav a { font-size: .98rem; }
}
@media (max-width: 600px) { .ruler-pct span.odd { visibility: hidden; } }
@media (min-width: 861px) { .tool-out > h2, .tool-out .result { position: sticky; top: 1rem; } }
@media (prefers-reduced-motion: reduce) { .marker { transition: none; } html { scroll-behavior: auto; } }
@media print {
  .site-head, .site-foot, .tool, .table-tools, .faq, .related-block, .crumbs { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .table-scroll { max-height: none; overflow: visible; }
  table.conv tr[hidden] { display: table-row; }
  table.conv thead th { background: #fff; color: #000; border-bottom: 2px solid #000; }
}

[hidden] { display: none !important; }
.row-items { display: grid; gap: .5rem; margin-bottom: .8rem; }
.row-item { display: flex; align-items: center; gap: .5rem; }
.row-item input { width: 6rem; font: 700 1.3rem var(--sans); padding: .55rem .6rem; border: 2px solid #8796A6; border-radius: var(--radius-s); }
.row-n { width: 1.6rem; color: var(--slate); font-weight: 700; }

@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

.zone-table { font-size: 1rem; } .zone-table td, .zone-table th { padding: .45rem .7rem; }

@media (max-width: 860px) {
  .tool { grid-template-columns: minmax(0, 1fr) !important; box-shadow: none; }
  .tool-form, .tool-out, .result, fieldset, .field { min-width: 0; max-width: 100%; }
  .tool-form, .tool-out { order: initial !important; border-right: 0 !important; border-left: 0 !important; padding: 1.3rem !important; }
  .tool-form { display: block !important; border-bottom: 1px solid var(--rule) !important; }
  .tool-out { border-top: 0; }
  .hero .wrap { padding-left: 0; border-left: 0; }
  .site-head .wrap { flex-direction: row; justify-content: space-between; padding: .6rem 0; }
  .site-nav ul { justify-content: flex-start; }
  select { min-width: 0; width: 100%; max-width: 100%; }
  .input-row { max-width: 100%; min-width: 0; }
  .input-row input { width: 0; min-width: 0; flex: 1 1 auto; }
  .tool-form > *, .tool-form fieldset > *, [data-show-if] { max-width: 100%; min-width: 0; }
  .seg { display: flex; flex-wrap: wrap; max-width: 100%; }
  .seg label { flex: 1 1 auto; } .seg span { text-align: center; padding: .55rem .7rem; }
  .readout { grid-template-columns: 1fr 1fr; gap: 0 1rem; }
  .readout div, .readout div:nth-child(odd) { padding-right: 0; }
  .readout dd b { font-size: 1.5rem; }
  .ruler { padding-left: .4rem; padding-right: .4rem; }
  .cols { grid-template-columns: 1fr !important; }
  .ref-table, table.conv { display: block; overflow-x: auto; }
  .zone-table { display: table; }
  .pair .input-row { max-width: none; flex: 1; }
}
@media (max-width: 480px) {
  h1 { font-size: 1.9rem; }
  .readout { grid-template-columns: 1fr; }
  .t-utility .readout div { flex-wrap: wrap; }
  .choice { padding: .6rem .7rem; }
}

@media (max-width: 480px) { .ruler-scale { font-size: .72rem; letter-spacing: -.02em; } }
