:root {
  --ink: #0b0b0a;
  --muted: #454541;
  --line: #c9c9c3;
  --soft: #efefe9;
  --paper: #f7f7f2;
  --blue: #0047ff;
  --green: #08744b;
  --red: #b42318;
  --amber: #856300;
  --font-sans: Inter, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-display: Inter, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--paper); }
button, input, select { font: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.flow-enter-forward { animation: flow-enter-forward .42s cubic-bezier(.22, 1, .36, 1) both; }
.flow-enter-back { animation: flow-enter-back .42s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes flow-enter-forward { from { opacity: 0; transform: translateX(34px); } to { opacity: 1; transform: translateX(0); } }
@keyframes flow-enter-back { from { opacity: 0; transform: translateX(-34px); } to { opacity: 1; transform: translateX(0); } }

h1,
h2,
h3,
.brand,
.paper-link,
.eyebrow,
.plain-rule,
.start-link,
.section-number,
.primitive-list > li > span,
.intro-rule > span,
.calculation-time b,
.step-nav,
.primary-button,
.back-button,
.status-tag,
.mode-switch button,
.number-box input,
.number-box > span,
.target-result strong,
.calibration-result strong,
.result-line strong,
.coverage-label strong,
.coverage-legend b,
.text-button,
.small-button,
.comparison-grid dd,
.recommendation-row > strong,
.status-icon {
  font-family: var(--font-sans);
}

.topbar {
  max-width: 1120px;
  min-height: 60px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
}
.brand, .paper-link { text-decoration: none; }
.brand { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand-mark { display: none; }
.paper-link { font-size: 13px; }
.paper-link:hover { color: var(--blue); }

main { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }

.intro { display: none; min-height: calc(100vh - 60px); padding: 64px 0; flex-direction: column; justify-content: center; }
.intro.active { display: flex; }
.intro h1 { max-width: 1080px; margin-bottom: 24px; font-family: var(--font-display); font-size: clamp(42px, 5.4vw, 68px); font-weight: 700; line-height: 1; letter-spacing: -0.05em; }
.inline-paper-link { color: var(--ink); font-weight: 700; text-decoration-color: var(--blue); text-underline-offset: 3px; }
.inline-paper-link:hover { color: var(--blue); }
.intro .intro-lead { max-width: 920px; margin-bottom: 48px; color: var(--muted); font-size: 18px; line-height: 1.68; }
.intro .intro-lead b { color: var(--ink); font-weight: 700; }
.plain-rule { width: fit-content; margin: 0 0 20px; padding: 12px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); font-size: 12px; line-height: 1.5; }
.plain-rule span { font-weight: 700; }
.primitive-intro { display: grid; grid-template-columns: 190px 1fr; gap: 30px; }
.primitive-heading h2 { margin: 0; font-size: 15px; line-height: 1.35; }
.primitive-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.primitive-list li { padding: 14px 0; display: grid; grid-template-columns: 36px 110px 1fr; gap: 10px; border-bottom: 1px solid var(--line); }
.primitive-list > li > span { color: var(--blue); font-size: 9px; font-weight: 700; }
.primitive-list li > div { display: contents; }
.primitive-list b { font-family: var(--font-display); font-size: 11px; letter-spacing: -.01em; }
.primitive-list p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.intro-rule { margin: 28px 0 14px 220px; padding: 15px 0; display: grid; grid-template-columns: 110px 1fr; gap: 10px; border-top: 2px solid var(--blue); border-bottom: 1px solid var(--line); }
.intro-rule > span { color: var(--blue); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.intro-rule p { margin: 0; font-size: 12px; line-height: 1.55; }
.intro-note { max-width: 610px; margin: 0 0 24px 220px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.intro-path { margin: 0 0 18px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.intro-path > div { min-width: 0; padding: 24px; border-left: 1px solid var(--line); }
.intro-path > div:first-child { padding-left: 0; border-left: 0; }
.intro-path span { display: block; margin-bottom: 16px; color: var(--blue); font-size: 11px; font-weight: 700; }
.intro-path b { display: block; margin-bottom: 8px; font-size: 14px; }
.intro-path p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.intro .intro-note { margin-left: 0; }
.intro .intro-note { max-width: 760px; font-size: 12px; }
.current-example { max-width: 920px; margin: 20px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.current-example b { color: var(--ink); }
.start-link { width: fit-content; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--blue); font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; }
.start-link:hover { text-decoration: underline; }

.calculation-intro { display: none; scroll-margin-top: 16px; padding: 38px 0 0; }
.calculation-intro.active { display: block; }
.calculation-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.calculation-toolbar h2 { margin: 0; font-family: var(--font-display); font-size: 24px; letter-spacing: -.025em; }
.calculation-toolbar .back-button { padding-right: 0; }
.calculation-heading { display: grid; grid-template-columns: 1fr 180px; align-items: start; gap: 40px; }
.calculation-heading h2 { margin-bottom: 10px; font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.18; letter-spacing: -0.035em; }
.calculation-heading > div > p { max-width: 590px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.calculation-time { margin: 5px 0 0; display: flex; flex-direction: column; gap: 5px; }
.calculation-time b { font-size: 10px; }
.calculation-time span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.step-nav { margin-top: 28px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.step-nav button { min-width: 0; padding: 17px 18px; display: grid; grid-template-columns: 30px 1fr; gap: 3px 10px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--muted); text-align: left; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.step-nav button:first-child { border-left: 0; }
.step-nav button:hover { background: var(--soft); color: var(--ink); }
.step-nav button.active { background: var(--ink); color: white; }
.step-nav span { grid-row: span 2; color: var(--blue); font-size: 11px; font-weight: 700; }
.step-nav button.active span { color: #8eadff; }
.step-nav b { font-size: 13px; }
.step-nav small { opacity: .78; font-family: var(--font-sans); font-size: 10px; }

.estimator { display: none; min-height: 640px; padding-bottom: 64px; }
.estimator.active { display: block; }
.estimator-section { display: none; min-height: calc(100vh - 250px); scroll-margin-top: 16px; padding: 44px 0; align-items: center; }
.estimator-section.active { display: flex; }
.section-number { display: none; }
.section-number::before { content: "0"; }
.section-body { width: 100%; padding-bottom: 46px; border-bottom: 1px solid var(--ink); }
.estimator-section:last-child .section-body { border-bottom: 0; padding-bottom: 0; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.section-heading h2 { max-width: 850px; margin: 0; font-family: var(--font-display); font-size: 34px; font-weight: 700; line-height: 1.18; letter-spacing: -0.035em; }
.section-copy { max-width: 900px; margin: 16px 0 34px; color: var(--muted); font-size: 15px; line-height: 1.65; }

.status-tag { flex: 0 0 auto; color: var(--green); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.status-tag.fail { color: var(--red); }
.status-tag.warn { color: var(--amber); }
.status-tag.plan { color: var(--blue); }

.setup-grid { padding: 24px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.setup-grid .number-box { max-width: none; }
.setup-note { margin: 12px 0 24px; color: var(--muted); font-size: 12px; line-height: 1.5; }

.mode-switch { width: fit-content; margin-bottom: 22px; display: flex; border: 1px solid var(--ink); }
.mode-switch button { min-height: 42px; padding: 0 16px; border: 0; border-left: 1px solid var(--ink); background: var(--paper); color: var(--ink); font-size: 12px; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.mode-switch button:first-child { border-left: 0; }
.mode-switch button.active { background: var(--ink); color: white; }

.planning-panel, .calibration-tool { margin-bottom: 20px; }
.panel-intro { max-width: 900px; margin-bottom: 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.planning-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.planning-inputs .number-box { max-width: none; }
.target-result { margin-top: 20px; padding: 18px 0; display: grid; grid-template-columns: 250px 1fr; align-items: center; gap: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.target-result > div { display: flex; flex-direction: column; gap: 5px; }
.target-result span { color: var(--muted); font-size: 12px; }
.target-result strong { font-size: 30px; }
.target-result p, .target-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.target-result.fail strong { color: var(--red); }
.target-note { margin-top: 12px; }

.regime-select { display: grid; grid-template-columns: 1fr minmax(260px, 340px); align-items: center; gap: 20px; }
.regime-select > span { display: flex; flex-direction: column; gap: 4px; }
.regime-select > span b { font-size: 14px; }
.regime-select > span small { max-width: 560px; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.5; }
#regimeDescription { max-width: 900px; margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.regime-panel { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.calibration-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.calibration-inputs.two-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calibration-inputs .number-box { max-width: none; }
.calibration-inputs .span-two { grid-column: span 2; }
.panel-note { max-width: 900px; margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.extra-benefit { max-width: 520px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.scenario-count { padding-bottom: 16px; display: grid; grid-template-columns: 1fr minmax(220px, 300px); align-items: center; gap: 20px; }
.scenario-count > span { display: flex; flex-direction: column; gap: 4px; }
.scenario-count b { font-size: 13px; }
.scenario-count small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.scenario-row { padding: 16px 0; display: grid; grid-template-columns: 100px repeat(2, minmax(0, 1fr)); align-items: end; gap: 16px; border-top: 1px solid var(--line); }
.scenario-row > b { align-self: start; padding-top: 2px; font-size: 12px; }
.scenario-row .number-box { max-width: none; }
.scenario-row .simple-input > small { min-height: 34px; }

select { width: 100%; min-width: 0; height: 44px; padding: 0 34px 0 12px; border: 1px solid #999; border-radius: 0; background: white; color: var(--ink); font-size: 13px; }
.simple-input { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.simple-input > span { min-height: 18px; font-size: 13px; font-weight: 700; line-height: 1.4; }
.simple-input > small { min-height: 36px; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.5; }
.simple-input > .number-box { max-width: 220px; }

.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.control { min-width: 0; min-height: 196px; padding: 24px 24px 24px 0; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.control + .control { padding-left: 18px; border-left: 1px solid var(--line); }
.control > span { font-size: 14px; font-weight: 700; line-height: 1.4; }
.control > small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.control > small b { color: var(--ink); }
.reward-level-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.reward-level-grid .simple-input { display: grid; grid-template-rows: auto 1fr 44px; align-content: end; }
.reward-level-grid .simple-input > span { font-size: 11px; }
.reward-level-grid .simple-input > small { min-height: 0; }
.reward-level-grid .number-box { max-width: none; }
.stake-level-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(130px, .55fr); align-items: end; gap: 12px; }
.stake-level-grid .simple-input { display: grid; grid-template-rows: auto 1fr auto; align-self: stretch; }
.stake-level-grid .simple-input > span { font-size: 11px; }
.stake-level-grid .simple-input > small { min-height: 0; }
.stake-level-grid .number-box { max-width: none; }
.stake-level-grid .range-row { grid-template-columns: minmax(50px, 1fr) 92px; }

.range-row { min-width: 0; display: grid; grid-template-columns: minmax(60px, 1fr) 92px; align-items: center; gap: 12px; }
input[type="range"] { width: 100%; min-width: 0; height: 3px; accent-color: var(--blue); }
.number-box { min-width: 0; height: 44px; display: flex; align-items: center; border: 1px solid #999; background: white; overflow: hidden; }
.number-box input { width: 100%; min-width: 0; height: 42px; padding: 0 10px; border: 0; background: transparent; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.number-box > span { flex: 0 0 auto; padding: 0 9px; color: var(--muted); font-size: 11px; }
.number-box.prefix > span { border-right: 1px solid var(--line); }
.number-box.suffix > span { border-left: 1px solid var(--line); }
.number-box:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.number-box input:focus { outline: 0; }

.audit-rate { min-height: 72px; padding: 15px 0; display: grid; grid-template-columns: 1fr minmax(280px, 390px); align-items: center; gap: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.audit-rate > span { display: flex; flex-direction: column; gap: 4px; }
.audit-rate b { font-size: 14px; }
.audit-rate small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.audit-rate > .number-box { width: 120px; justify-self: end; }

.discount-input { margin-top: 12px; padding-top: 12px; display: grid; grid-template-columns: 1fr 100px; align-items: center; gap: 14px; border-top: 1px solid var(--line); }
.discount-input > span { display: flex; flex-direction: column; gap: 3px; }
.discount-input b { font-size: 11px; line-height: 1.4; }
.discount-input small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.discount-input .number-box { max-width: none; }

.result-line { margin-top: 16px; padding: 18px 0; display: grid; grid-template-columns: 230px 1fr; align-items: center; gap: 24px; border-top: 2px solid var(--blue); border-bottom: 1px solid var(--line); }
.result-line > div { display: flex; flex-direction: column; gap: 5px; }
.result-line span { color: var(--muted); font-size: 12px; }
.result-line strong { color: var(--ink); font-size: 30px; }
.result-line p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.result-line.fail { border-top-color: var(--red); }

.coverage { margin-top: 16px; padding-top: 16px; }
.coverage-label { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; }
.coverage-label strong { color: var(--ink); }
.coverage-track { position: relative; height: 7px; margin: 11px 0 9px; display: flex; background: #eee; overflow: hidden; }
.coverage-track > span { height: 100%; }
.coverage-track > span:first-child { background: var(--blue); }
.coverage-track > span:nth-child(2) { background: #111; }
.coverage-track > i { position: absolute; inset: 0 0 0 auto; width: 1px; background: var(--ink); }
.coverage-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 11px; }
.coverage-legend span { display: inline-flex; align-items: center; gap: 5px; }
.coverage-legend i { width: 6px; height: 6px; }
.immediate-key { background: var(--blue); }
.future-key { background: var(--ink); }
.coverage-legend b { color: var(--ink); }
.coverage-legend > strong { margin-left: auto; color: var(--green); }
.coverage-legend > strong.fail { color: var(--red); }

.text-button, .small-button { border: 1px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); font-size: 11px; font-weight: 700; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.text-button { min-height: 34px; padding: 0 10px; }
.small-button { min-height: 28px; padding: 0 8px; }
.text-button:hover, .small-button:hover { background: var(--ink); color: white; }
button:disabled { opacity: .4; cursor: not-allowed; }

.step-actions { margin-top: 28px; padding-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--ink); }
.step-actions > span { max-width: 430px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.step-actions > span b { color: var(--ink); }
.primary-button, .back-button { min-height: 44px; padding: 0 16px; border-radius: 0; font-size: 12px; font-weight: 700; cursor: pointer; transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease; }
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: white; }
.primary-button:hover { background: var(--blue); border-color: var(--blue); transform: translateX(2px); }
.back-button { border: 0; background: transparent; color: var(--muted); }
.back-button:hover { color: var(--blue); transform: translateX(-2px); }
.final-actions a { color: var(--blue); font-family: var(--font-sans); font-size: 9px; font-weight: 700; text-decoration: none; }
.final-actions a:hover { text-decoration: underline; }

.details-panel { margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.details-panel summary { min-height: 60px; padding: 11px 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; list-style: none; cursor: pointer; }
.details-panel summary::-webkit-details-marker { display: none; }
.details-panel summary > span { display: flex; flex-direction: column; gap: 3px; }
.details-panel summary b { font-size: 13px; }
.details-panel summary small { color: var(--muted); font-size: 11px; }
.details-panel summary > i { color: var(--blue); font-style: normal; font-size: 16px; }
.details-panel[open] summary > i { transform: rotate(45deg); }
.details-content { padding: 18px 0; border-top: 1px solid var(--line); }
.details-content > p { margin-bottom: 14px; color: var(--muted); font-size: 12px; line-height: 1.6; }

.audit-diagnostics label { padding: 14px 0 6px; display: grid; grid-template-columns: 1fr 190px; align-items: center; gap: 20px; border-top: 1px solid var(--line); }
.audit-diagnostics label:first-child { border-top: 0; }
.audit-diagnostics label > span { display: flex; flex-direction: column; gap: 4px; }
.audit-diagnostics label b { font-size: 13px; line-height: 1.4; }
.audit-diagnostics label small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.audit-diagnostics > p { margin: 0; padding: 0 210px 13px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.calibration-result { padding-top: 16px; display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 22px; border-top: 1px solid var(--line); }
.calibration-result > div { display: flex; flex-direction: column; gap: 4px; }
.calibration-result span { color: var(--muted); font-size: 11px; }
.calibration-result strong { font-size: 24px; }
.calibration-result p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.comparison-grid, .guardrail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.comparison-grid > div, .guardrail-block { padding-top: 14px; border-top: 1px solid var(--ink); }
.comparison-grid > div > span { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.comparison-grid dl { margin: 0; }
.comparison-grid dl > div { min-height: 27px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
.comparison-grid dt, .comparison-grid dd { font-size: 11px; }
.comparison-grid dd { margin: 0; font-weight: 700; }
.comparison-action { margin-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.comparison-action p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.guardrail-heading { min-height: 42px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.guardrail-heading h3 { margin: 0; font-size: 17px; line-height: 1.35; }
.reward-summary { min-height: 112px; padding: 14px; display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 6px 16px; background: var(--soft); }
.reward-summary > span { color: var(--muted); font-size: 11px; }
.reward-summary > strong { font-size: 20px; }
.reward-summary > strong .unit-symbol { margin-right: 3px; color: var(--muted); font-size: 12px; }
.reward-summary > small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; line-height: 1.5; }
.simple-input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.simple-input-grid .simple-input { display: grid; grid-template-rows: auto 1fr auto; align-self: stretch; }
.simple-input-grid .number-box { max-width: none; }
.recommendation-row { min-height: 40px; margin-top: 12px; padding: 6px 0; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 9px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.recommendation-row > span, .guardrail-block > p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.recommendation-row > strong { font-size: 11px; }
.guardrail-block > p { margin: 9px 0 0; }
.assumptions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.assumptions-grid .number-box { max-width: none; }

.final-status { margin-top: 32px; padding: 28px; background: #fff; border: 1px solid var(--ink); border-top: 5px solid var(--green); box-shadow: 0 12px 30px rgba(11, 11, 10, .08); }
.final-status.fail { border-top-color: var(--red); }
.final-status.warn { border-top-color: var(--amber); }
.final-status.plan { border-top-color: var(--blue); }
.result-header { display: flex; align-items: flex-start; gap: 16px; }
.status-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid currentColor; color: var(--green); font-size: 14px; font-weight: 700; }
.final-status.fail .status-icon { color: var(--red); }
.final-status.warn .status-icon { color: var(--amber); }
.final-status.plan .status-icon { color: var(--blue); }
.result-header > div { min-width: 0; flex: 1; }
.final-status h2 { max-width: 780px; margin: 0 0 8px; font-size: 26px; line-height: 1.24; }
.result-header div > p:last-child { max-width: 780px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.result-checks { margin-top: 26px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result-checks > div { min-width: 0; padding: 16px; border-left: 1px solid var(--line); }
.result-checks > div:first-child { padding-left: 0; border-left: 0; }
.result-checks span { min-height: 30px; display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.result-checks strong { display: block; font-size: 15px; line-height: 1.3; }
.result-checks strong.pass { color: var(--green); }
.result-checks strong.warn { color: var(--amber); }
.result-checks strong.fail { color: var(--red); }
.input-error { margin-top: 10px; padding: 10px 0; border-top: 1px solid var(--red); color: var(--red); font-size: 12px; line-height: 1.5; }

.scope-note { padding: 28px 0; display: none; grid-template-columns: 180px 1fr; gap: 24px; border-top: 1px solid var(--ink); }
.scope-note.active { display: grid; }
.scope-note h2 { margin: 0; font-size: 14px; }
.scope-note p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
footer { max-width: 1120px; margin: 0 auto; padding: 20px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.5; }
footer a { color: var(--ink); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flow-enter-forward, .flow-enter-back { animation: none; }
  .primary-button, .back-button, .step-nav button { transition: none; }
}

@media (max-width: 640px) {
  .topbar, main, footer { padding-right: 16px; padding-left: 16px; }
  .paper-link { font-size: 0; }
  .paper-link::before { content: "Paper ↗"; font-size: 9px; }
  .intro { padding: 38px 0 34px; }
  .intro h1 { font-size: 42px; }
  .intro .intro-lead { font-size: 16px; }
  .intro .intro-lead { margin-bottom: 30px; }
  .intro-path { grid-template-columns: 1fr; }
  .intro-path > div { padding: 14px 0; border-top: 1px solid var(--line); border-left: 0; }
  .intro-path > div:first-child { border-top: 0; }
  .intro-path span { margin-bottom: 7px; }
  .calculation-toolbar { align-items: center; }
  .primitive-intro { grid-template-columns: 1fr; gap: 14px; }
  .primitive-list li { grid-template-columns: 28px 86px 1fr; }
  .intro-rule { margin-left: 0; grid-template-columns: 86px 1fr; }
  .intro-note { margin-left: 0; }
  .calculation-heading { grid-template-columns: 1fr; gap: 12px; }
  .calculation-time { flex-direction: row; justify-content: space-between; }
  .step-nav button { padding: 11px 7px; grid-template-columns: 1fr; }
  .step-nav span { grid-row: auto; }
  .step-nav small { display: none; }
  .step-nav b { font-size: 10px; }
  .section-heading { flex-direction: column; }
  .section-heading h2 { font-size: 28px; }
  .setup-grid, .regime-select, .target-result, .audit-rate, .result-line, .audit-diagnostics label, .calibration-result, .scenario-count, .discount-input { grid-template-columns: 1fr; gap: 10px; }
  .audit-rate > .number-box { width: 100%; justify-self: stretch; }
  .mode-switch { width: 100%; }
  .mode-switch button { min-width: 0; flex: 1; padding: 0 7px; }
  .control-grid, .calibration-inputs, .calibration-inputs.two-inputs, .comparison-grid, .guardrail-grid, .simple-input-grid, .assumptions-grid { grid-template-columns: 1fr; }
  .reward-level-grid { grid-template-columns: 1fr; }
  .stake-level-grid { grid-template-columns: 1fr; }
  .scenario-row { grid-template-columns: 1fr; }
  .scenario-row > b { padding-top: 0; }
  .calibration-inputs .span-two { grid-column: auto; }
  .control { min-height: 160px; padding: 16px 0; }
  .control + .control { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .audit-diagnostics > p { padding-right: 0; }
  .coverage-label { flex-direction: column; }
  .coverage-legend > strong { width: 100%; margin-left: 0; }
  .comparison-action { align-items: flex-start; flex-direction: column; }
  .step-actions { align-items: stretch; flex-direction: column; }
  .step-actions .primary-button { width: 100%; }
  .step-actions .back-button { align-self: flex-start; padding-left: 0; }
  .final-actions a { align-self: flex-start; }
  .recommendation-row { grid-template-columns: 1fr auto; }
  .recommendation-row .small-button { grid-column: 1 / -1; }
  .final-status { padding: 22px; }
  .result-header { flex-wrap: wrap; }
  .result-header > .status-tag { margin-left: 50px; }
  .result-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-checks > div:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .result-checks > div:nth-child(4) { border-top: 1px solid var(--line); }
  .scope-note { grid-template-columns: 1fr; gap: 8px; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 420px) {
  .brand { font-size: 11px; }
  .primitive-list li { grid-template-columns: 28px 1fr; }
  .primitive-list p { grid-column: 2; }
  .intro-rule { grid-template-columns: 1fr; gap: 7px; }
  .calculation-heading h2 { font-size: 25px; }
  .range-row { grid-template-columns: minmax(50px, 1fr) 88px; gap: 9px; }
  .result-checks { grid-template-columns: 1fr; }
  .result-checks > div { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .result-checks > div:first-child { border-top: 0; }
}
