:root {
  --ground: #faf9f6; --ground-2: #f0eee8; --paper: #fff; --ink: #101010; --muted: #5b5b56;
  --rule: #d8d6ce; --blue: #0000ff; --blue-tint: #ebebff; --on-blue-2: #d4d4ff;
  --bad: #c4221c; --bad-tint: #fbeceb; --ok-tint: #ebebff;
  --sans: Helvetica, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pad: clamp(16px, 4vw, 48px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--blue); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
[hidden] { display: none !important; }
.plus { color: var(--blue); }
.fine { color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ── Header ── */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 var(--pad); background: var(--ground); border-bottom: 1px solid var(--rule); }
.brand { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; font-size: 22px; letter-spacing: -.03em; text-decoration: none; color: var(--ink); }
/* Way back to the site: logo → home, crumb → tools index. */
.crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; }
.crumbs .sep { color: var(--rule); }
.crumb { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.crumb:hover { color: var(--blue); }
.langs { display: flex; }
.langs button { min-width: 44px; min-height: 44px; border: 0; background: none; cursor: pointer; color: var(--muted);
  font: 13px var(--sans); letter-spacing: .04em; }
.langs button:hover { color: var(--ink); }
.langs button[aria-current="true"] { color: var(--blue); text-decoration: underline; text-underline-offset: 6px; }

main { max-width: 1180px; margin: 0 auto; padding: 56px var(--pad) 120px; }

/* ── Intro ── */
.intro { max-width: 820px; }
.intro h1 { font-size: clamp(36px, 5.4vw, 64px); line-height: 1.02; letter-spacing: -.035em; }
.lead { margin-top: 24px; font-size: 20px; line-height: 1.5; color: var(--muted); max-width: 62ch; }
.levers3 { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 40px; border-top: 1px solid var(--ink); }
.levers3 > div { padding: 18px 20px 0 0; }
.levers3 > div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.levers3 h2 { font-size: 18px; letter-spacing: -.01em; }
.levers3 p { margin-top: 6px; font-size: 15px; color: var(--muted); line-height: 1.5; }
@media (max-width: 720px) {
  .levers3 { grid-template-columns: 1fr; }
  .levers3 > div, .levers3 > div + div { padding: 14px 0; border-left: 0; border-bottom: 1px solid var(--rule); }
}

/* ── Layout ── */
.sim { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 56px; margin-top: 72px; align-items: start; }
@media (max-width: 960px) { .sim { grid-template-columns: 1fr; gap: 40px; } }

.block { padding: 36px 0 44px; border-top: 1px solid var(--ink); }
.block + .block { margin-top: 8px; }
.block > h2 { font-size: 30px; letter-spacing: -.025em; line-height: 1.1; }
.block > p { margin-top: 10px; color: var(--muted); max-width: 60ch; }

/* ── Quick start ── */
.quick { margin-top: 24px; padding: 20px; background: var(--paper); border: 1px solid var(--rule); }
.quick-q { font-weight: 700; margin-bottom: 12px; }
.qrow { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; padding: 6px 0; }
.qlab { font-size: 14px; color: var(--muted); }
.quick .fine { margin-top: 12px; }
.qrow.all { margin-top: 20px; grid-template-columns: auto 1fr; }
@media (max-width: 520px) { .qrow, .qrow.all { grid-template-columns: 1fr; gap: 6px; } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; flex-direction: column; justify-content: center; align-items: flex-start; min-height: 44px; padding: 6px 14px;
  border: 1px solid var(--rule); background: var(--ground); color: var(--ink); font: 15px/1.2 var(--sans); cursor: pointer; text-align: left;
  transition: border-color .15s ease-out, background-color .15s ease-out; }
.chip small { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 2px; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-pressed="true"] small { color: #c9c9c4; }

/* ── Fields ── */
.field { padding: 22px 0 18px; border-bottom: 1px solid var(--ground-2); }
.field:last-child { border-bottom: 0; }
.f-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.f-head label { font-weight: 700; font-size: 16px; line-height: 1.35; }
.num { width: 9.5em; flex: none; height: 44px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 0; background: var(--paper);
  font: 17px var(--mono); font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); }
.num:hover { border-color: var(--muted); }
.num:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-tint); }
.lever .num { color: var(--blue); }
.hint { margin-top: 6px; font-size: 14px; color: var(--muted); line-height: 1.5; max-width: 62ch; }

input[type=range] { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 36px; margin: 8px 0 0; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: var(--rule); }
input[type=range]::-moz-range-track { height: 4px; background: var(--rule); }
input[type=range]::-moz-range-progress { height: 4px; background: var(--ink); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -10px; border: 2px solid var(--ground);
  border-radius: 50%; background: var(--ink); box-shadow: 0 1px 4px rgba(16,16,16,.25); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border: 2px solid var(--ground); border-radius: 50%; background: var(--ink); box-shadow: 0 1px 4px rgba(16,16,16,.25); }
.lever input[type=range]::-webkit-slider-thumb { background: var(--blue); }
.lever input[type=range]::-moz-range-thumb { background: var(--blue); }
.lever input[type=range]::-moz-range-progress { background: var(--blue); }
input[type=range]:focus-visible { outline-offset: 0; }

/* Break-even marker on each lever */
.track { position: relative; }
.need { position: absolute; top: 8px; width: 2px; height: 20px; margin-left: -1px; background: var(--ink); pointer-events: none; }
.need::after { content: ""; position: absolute; top: -5px; left: -4px; border: 5px solid transparent; border-top-color: var(--ink); }
.need-t { margin-top: 4px; font-size: 14px; line-height: 1.45; }
.need-t b { font-family: var(--mono); font-weight: 400; font-variant-numeric: tabular-nums; }
.need-t.ok { color: var(--ink); }
.need-t .yes { color: var(--blue); font-weight: 700; }
.need-t.off { color: var(--muted); }

.lever details { margin-top: 8px; font-size: 14px; }
.lever summary { display: inline-flex; align-items: center; min-height: 32px; cursor: pointer; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); }
.lever summary:hover { text-decoration-color: var(--ink); }
.lever details p { margin-top: 6px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--rule); color: var(--ink); line-height: 1.55; max-width: 62ch; }

.toggle { display: flex; gap: 12px; align-items: flex-start; margin-top: 24px; min-height: 44px; font-size: 15px; cursor: pointer; }
.toggle input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--blue); }

/* ── Results ── */
.results { position: sticky; top: 88px; background: var(--paper); border: 1px solid var(--ink); }
@media (max-width: 960px) { .results { position: static; } }
.res-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--rule); }
.res-head h2 { font-size: 15px; letter-spacing: 0; }
.res-head .fine { margin-top: 2px; font-size: 13px; }

.verdict { padding: 22px; background: var(--blue); color: #fff; }
.verdict .big { font-size: clamp(34px, 3.6vw, 44px); font-weight: 700; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.verdict p { margin-top: 10px; font-size: 15px; line-height: 1.45; }
.verdict .sub { color: var(--on-blue-2); font-size: 14px; margin-top: 6px; }
.verdict.neg { background: var(--bad-tint); color: var(--ink); }
.verdict.neg .big { color: var(--bad); }
.verdict.neg .sub { color: var(--muted); }

.be { padding: 18px 22px; border-bottom: 1px solid var(--rule); }
.be h3, .breakdown h3, .chart h3 { font-size: 14px; line-height: 1.4; }
.be table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 14px; }
.be th { text-align: right; font-weight: 400; color: var(--muted); font-size: 12px; padding: 0 0 6px 8px; }
.be th:first-child { text-align: left; padding-left: 0; }
.be td { padding: 8px 0 8px 8px; border-top: 1px solid var(--ground-2); text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.be td:first-child { text-align: left; padding-left: 0; font-family: var(--sans); white-space: normal; }
.be td.yes { color: var(--blue); font-weight: 700; }
.be p { margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.45; }

.stage { padding: 16px 22px; border-bottom: 1px solid var(--rule); }
.stage .lab { font-size: 14px; color: var(--muted); }
.stage .val { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stage .rng { font-family: var(--mono); font-size: 13px; color: var(--ink); margin-top: 4px; }
.stage p { margin-top: 4px; font-size: 13px; color: var(--muted); line-height: 1.45; }

.chart { padding: 16px 22px; border-bottom: 1px solid var(--rule); }
.chart svg { display: block; width: 100%; height: auto; margin-top: 10px; }
.chart svg text { font-family: var(--mono); font-size: 10px; fill: var(--muted); }
.legend2 { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 13px; }
.legend2 span { display: inline-flex; align-items: center; gap: 8px; }
.legend2 span::before { content: ""; width: 16px; height: 0; border-top: 2px solid var(--blue); }
.legend2 .a::before { border-top: 2px dashed var(--muted); }

.breakdown { padding: 16px 22px; border-bottom: 1px solid var(--rule); }
.brow { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; margin-top: 10px; font-size: 14px; }
.brow b { font-family: var(--mono); font-weight: 400; font-variant-numeric: tabular-nums; }
.brow .t { grid-column: 1 / -1; height: 6px; background: var(--ground-2); }
.brow .t i { display: block; height: 100%; background: var(--blue); }
.breakdown p { margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.45; }

.res-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 16px 22px; }
.btn { min-height: 44px; padding: 10px 18px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); font: 700 15px var(--sans); cursor: pointer;
  transition: background-color .15s ease-out, color .15s ease-out; }
.btn:hover { background: var(--ink); color: #fff; }
.link { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--ink); font: 15px var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); }
.link:hover { color: var(--blue); text-decoration-color: var(--blue); }

/* ── Method, footer ── */
.sources { margin-top: 64px; max-width: 760px; border-top: 1px solid var(--ink); }
.sources summary { min-height: 52px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.sources p { margin-top: 12px; font-size: 15px; color: var(--muted); line-height: 1.6; }
.foot { margin-top: 36px; max-width: 70ch; }

/* ── Mobile results peek ── */
.peek { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 60px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--blue); color: #fff; text-decoration: none;
  font-size: 15px; line-height: 1.3; box-shadow: 0 -4px 16px rgba(16,16,16,.14); }
.peek.neg { background: var(--ink); }
.peek b { font-variant-numeric: tabular-nums; }
.peek-cta { flex: none; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.peek:hover { color: #fff; }
@media (min-width: 961px) { .peek { display: none !important; } }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 8px); padding: 12px 16px; background: var(--ink); color: #fff; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease-out, transform .2s ease-out; z-index: 30; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
