@font-face { font-family: Barlow; font-weight: 400; font-display: swap; src: url(/fonts/Barlow-400.woff2) format('woff2'); }
@font-face { font-family: Barlow; font-weight: 500; font-display: swap; src: url(/fonts/Barlow-500.woff2) format('woff2'); }
@font-face { font-family: Barlow; font-weight: 600; font-display: swap; src: url(/fonts/Barlow-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 600; font-display: swap; src: url(/fonts/BarlowSemiCondensed-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 700; font-display: swap; src: url(/fonts/BarlowSemiCondensed-700.woff2) format('woff2'); }

:root {
  --zinc: #e4e9ec;      /* galvanized: the page */
  --sheet: #fbfcfc;     /* panels */
  --ink: #1e262d;
  --steel: #56636d;     /* secondary text */
  --rule: #c9d1d6;
  --tape: #f5c400;      /* fish tape yellow: the one accent */
  --tape-deep: #8a6d00;
  --ok: #17663a;
  --over: #b3301e;
  --focus: #2a5ba8;
  --cond: 'Barlow Semi Condensed', Barlow, system-ui, sans-serif;
  --body: Barlow, system-ui, sans-serif;
  --r: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--zinc); color: var(--ink); font: 400 17px/1.55 var(--body); font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration-color: var(--tape-deep); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--cond); font-weight: 700; line-height: 1.1; letter-spacing: -0.005em; margin: 0 0 .4em; }
h1 { font-size: clamp(30px, 4.4vw, 46px); }
h2 { font-size: clamp(23px, 2.6vw, 30px); margin-top: 1.6em; }
h3 { font-size: 20px; font-weight: 600; margin-top: 1.2em; }
p { margin: 0 0 .9em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.prose { max-width: 70ch; }
.muted { color: var(--steel); }
.small { font-size: 15px; }

/* header */
.top { background: var(--ink); color: #fff; }
.top .wrap { display: flex; align-items: center; gap: 18px; min-height: 58px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 22px/1 var(--cond); text-decoration: none; color: #fff; padding: 12px 0; }
.brand svg { width: 28px; height: 28px; flex: none; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: #d7dee3; text-decoration: none; font-weight: 500; padding: 8px 10px; border-radius: var(--r); font-size: 16px; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--tape); }
@media (max-width: 760px) {
  .top .wrap { gap: 0; }
  .nav { margin: 0 -10px 8px; width: calc(100% + 20px); overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .nav a { white-space: nowrap; font-size: 15px; }
}

main { padding: 26px 0 60px; }
.crumbs { font-size: 15px; color: var(--steel); margin-bottom: 10px; }
.crumbs a { color: var(--steel); }
.lead { font-size: 19px; max-width: 64ch; }

/* the tool: form beside its answer */
.tool { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 16px; }
@media (max-width: 880px) { .tool { grid-template-columns: 1fr; } }
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 20px; }
.answer { position: sticky; top: 14px; }
@media (max-width: 880px) { .answer { position: static; } }

/* controls: one style everywhere */
label, .label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .row3 { grid-template-columns: 1fr 1fr; } }
input[type=number], input[type=text], select {
  width: 100%; height: 46px; padding: 0 12px; border: 1px solid #9eaab2; border-radius: var(--r); background: #fff;
  font: 500 17px var(--body); color: var(--ink); font-variant-numeric: tabular-nums; appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--steel) 50%), linear-gradient(135deg, var(--steel) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input:focus, select:focus { border-color: var(--focus); outline: 2px solid rgba(42,91,168,.25); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; font-size: 16px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); margin: 0; }
.help { font-size: 14px; color: var(--steel); margin-top: 4px; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { height: 40px; padding: 0 12px; border: 1px solid #9eaab2; background: #fff; border-radius: var(--r); font: 600 15px var(--body); color: var(--ink); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: var(--r);
  border: 1px solid var(--ink); background: var(--tape); color: var(--ink); font: 600 16px var(--body); cursor: pointer; text-decoration: none; }
.btn.plain { background: #fff; border-color: #9eaab2; }
.btn:hover { filter: brightness(.96); }
.linkbtn { background: none; border: 0; padding: 6px 0; font: 600 15px var(--body); color: var(--ink); text-decoration: underline; text-decoration-color: var(--tape-deep); text-underline-offset: 3px; cursor: pointer; }

/* wire rows */
.wires { display: grid; gap: 8px; margin-bottom: 8px; }
.wire { display: grid; grid-template-columns: 74px minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, .9fr) 40px; gap: 8px; align-items: center; }
.wire .x { width: 40px; height: 46px; border: 0; background: none; font-size: 24px; color: var(--steel); cursor: pointer; border-radius: var(--r); }
.wire .x:hover { background: var(--zinc); color: var(--over); }
.wirehead { display: grid; grid-template-columns: 74px minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, .9fr) 40px; gap: 8px; font-size: 14px; font-weight: 600; color: var(--steel); }
@media (max-width: 520px) {
  .wire, .wirehead { grid-template-columns: 62px minmax(0, 1fr) minmax(0, 1fr) 40px; }
  .wire .color, .wirehead .color { display: none; }
}

/* the answer */
.verdict { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.big { font: 700 clamp(64px, 9vw, 104px)/.9 var(--cond); letter-spacing: -0.02em; }
.big small { font-size: .38em; font-weight: 600; letter-spacing: 0; }
.status { display: inline-block; font: 700 18px/1 var(--cond); padding: 7px 10px; border-radius: var(--r); }
.status.ok { background: #dcefe3; color: var(--ok); }
.status.over { background: #f6dcd6; color: var(--over); }
.status.none { background: var(--zinc); color: var(--steel); }
.meter { position: relative; height: 14px; background: var(--zinc); border-radius: 7px; margin: 14px 0 6px; overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--ink); border-radius: 7px; transition: width .2s; }
.meter i.over { background: var(--over); }
.meter b { position: absolute; top: -3px; bottom: -3px; width: 3px; background: var(--tape); box-shadow: 0 0 0 1px var(--tape-deep); }
.section-wrap { display: flex; justify-content: center; margin: 8px 0 4px; }
.section { width: min(100%, 360px); height: auto; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 14px 0 0; }
.facts div { border-top: 1px solid var(--rule); padding-top: 8px; }
.facts dt { font-size: 14px; color: var(--steel); }
.facts dd { margin: 0; font: 600 20px/1.2 var(--cond); }
.mathline { font-size: 15px; color: var(--steel); margin-top: 12px; }

/* the answer page hero */
.qa { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 26px; align-items: center; }
@media (max-width: 760px) { .qa { grid-template-columns: 1fr; } }
.qa .big { font-size: clamp(96px, 16vw, 168px); }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--sheet); margin: 10px 0 6px; }
table { border-collapse: collapse; width: 100%; font-size: 16px; }
th, td { padding: 9px 12px; text-align: right; border-bottom: 1px solid #e3e8eb; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { font: 600 15px var(--body); color: var(--steel); background: #f1f4f5; position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
td a { font-weight: 600; }
td.zero { color: #a9b2b8; }
tr.here td { background: #fff6cc; }

/* link grids */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 10px 0; }
.grid a { display: block; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 12px 14px; text-decoration: none; }
.grid a:hover { border-color: var(--ink); }
.grid a strong { display: block; font: 700 19px/1.2 var(--cond); }
.grid a span { font-size: 14px; color: var(--steel); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chips a, .chips span { display: inline-block; padding: 6px 10px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--sheet); text-decoration: none; font-weight: 500; font-size: 15px; }
.chips a:hover { border-color: var(--ink); }
.chips span { background: var(--ink); color: #fff; border-color: var(--ink); }

/* job list */
.runs { display: grid; gap: 14px; }
.run h2.sub, h2.sub { font-size: 21px; margin: 0; }
.answer h2.sub { margin: 18px 0 4px; }
.runhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid #e3e8eb; }
.list li:last-child { border-bottom: 0; }
.list .q { font: 700 20px/1.2 var(--cond); white-space: nowrap; }
.warn { background: #fdf0d2; border-left: 4px solid var(--tape); padding: 10px 12px; border-radius: 0 var(--r) var(--r) 0; font-size: 15px; margin: 10px 0 0; }
.warn.over { background: #f9e3de; border-color: var(--over); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.note { border-left: 4px solid var(--tape); padding: 4px 0 4px 14px; margin: 18px 0; }
.foot { border-top: 1px solid var(--rule); padding: 26px 0 40px; font-size: 15px; color: var(--steel); }
.foot .wrap { display: flex; gap: 26px; flex-wrap: wrap; justify-content: space-between; }
.foot a { color: var(--steel); }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.hide { display: none !important; }

@media print {
  .top, .foot, .nav, .no-print, form .actions { display: none !important; }
  body { background: #fff; }
  .panel { border: 0; padding: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
