/* SoloSplit. A split statement: olive for the S-corp side, plum for the sole proprietor side.
   Serif headings, sans body, mono figures. Light is the designed default. */

:root {
  --bg: #ecefd9;
  --surface: #f9faed;
  --ink: #22251a;
  --muted: #50543d;
  --hair: #cfd3b0;
  --border: #85876e;
  --band: #4a5216;
  --band-ink: #f6f5e0;
  --band-soft: #dfe3b4;
  --accent: #56600f;
  --accent-ink: #f9faed;
  --result: #dce2ae;
  --result-rule: #a9b06e;
  --olive: #6f7a1c;
  --plum: #8c3f83;
  --olive-wash: rgba(111, 122, 28, 0.18);
  --plum-wash: rgba(140, 63, 131, 0.11);
  --warn: #7a3d10;
  --focus: #8c3f83;
  --serif: "Iowan Old Style", Charter, Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16180c;
    --surface: #1c1e13;
    --ink: #ecebd6;
    --muted: #b3b59b;
    --hair: #383b27;
    --border: #8a8d70;
    --band: #262b0f;
    --band-ink: #eef0cf;
    --band-soft: #b8bf7c;
    --accent: #c5cd7c;
    --accent-ink: #16180c;
    --result: #272b14;
    --result-rule: #4c5324;
    --olive: #929c3a;
    --plum: #b877b3;
    --olive-wash: rgba(146, 156, 58, 0.24);
    --plum-wash: rgba(184, 119, 179, 0.16);
    --warn: #f0c592;
    --focus: #d9a5d5;
  }
}

:root[data-theme="dark"] {
  --bg: #16180c;
  --surface: #1c1e13;
  --ink: #ecebd6;
  --muted: #b3b59b;
  --hair: #383b27;
  --border: #8a8d70;
  --band: #262b0f;
  --band-ink: #eef0cf;
  --band-soft: #b8bf7c;
  --accent: #c5cd7c;
  --accent-ink: #16180c;
  --result: #272b14;
  --result-rule: #4c5324;
  --olive: #929c3a;
  --plum: #b877b3;
  --olive-wash: rgba(146, 156, 58, 0.24);
  --plum-wash: rgba(184, 119, 179, 0.16);
  --warn: #f0c592;
  --focus: #d9a5d5;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
[id] { scroll-margin-top: 16px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
}

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.1rem); letter-spacing: -0.015em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.85rem); letter-spacing: -0.005em; }
h3 { font-size: 1.2rem; }

.nb { white-space: nowrap; }

a { color: var(--accent); text-underline-offset: 2px; }
p { margin: 0 0 16px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 20;
  background: var(--surface); color: var(--ink); padding: 10px 14px; border-radius: 4px;
}
.skip:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.band :focus-visible { outline-color: var(--band-ink); }

/* Header band */
.band { background: var(--band); color: var(--band-ink); }
.band-in { display: flex; align-items: center; gap: 8px 24px; flex-wrap: wrap; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--band-ink); text-decoration: none; min-height: 44px; }
.mark { display: block; }
.wordmark { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.wordmark i { font-weight: 400; color: var(--band-soft); }
.nav { display: flex; flex-wrap: wrap; gap: 0 4px; margin-left: auto; }
.nav a { color: var(--band-ink); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; font-size: 0.95rem; border-radius: 4px; }
.nav a:hover { text-decoration: underline; }
.theme-btn {
  font: inherit; font-size: 0.9rem; color: var(--band-ink); background: transparent;
  border: 1px solid var(--band-soft); border-radius: 4px; min-height: 44px; min-width: 44px; padding: 6px 12px; cursor: pointer;
}

/* Hero */
.hero { padding-top: 32px; padding-bottom: 24px; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 44em; margin: 16px 0 0; }
.noscript { margin-top: 16px; padding: 12px 16px; border-left: 4px solid var(--plum); background: var(--surface); }

/* Calculator: inputs left, result right */
.calc { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); padding-bottom: 16px; }

.inputs { min-width: 0; background: var(--surface); border: 1px solid var(--hair); border-radius: 6px; padding: 24px 20px 16px; }
.inputs h2 { font-size: 1.35rem; margin-bottom: 8px; }

.field { padding: 14px 0 10px; border-top: 1px solid var(--hair); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; }
.inputs h2 + .field { border-top: 0; }
.field > label { font-weight: 600; grid-column: 1; }
.field > .help { grid-column: 1 / -1; grid-row: 2; }
.field > .pair { grid-column: 2; grid-row: 1; }
.field > input[type="range"] { grid-column: 1 / -1; }
.field > .msg { grid-column: 1 / -1; }
.help { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.msg { margin: 0; color: var(--warn); font-size: 0.9rem; font-weight: 600; }
.msg:empty { display: none; }

.pair { display: inline-flex; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 0 10px; min-height: 44px; }
.pair:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.pair input { font-family: var(--mono); font-size: 1rem; font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); background: transparent; border: 0; width: 7.2em; min-height: 44px; padding: 0 4px; outline: 0; -moz-appearance: textfield; appearance: textfield; }
.pair input::-webkit-outer-spin-button, .pair input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.unit { font-family: var(--mono); color: var(--muted); }

input[type="range"] { width: 100%; min-height: 44px; margin: 0; accent-color: var(--olive); }

.profit-line { margin: 0; padding: 12px 0; border-top: 1px solid var(--hair); display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); }
.profit-line output { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.05rem; font-weight: 700; color: var(--ink); padding-right: 14px; }

.field-key { background: var(--result); margin: 0 -20px; padding: 16px 20px 12px; border-top: 2px solid var(--olive); border-bottom: 1px solid var(--result-rule); }
.field-key .pair { background: var(--surface); }

.costs { border: 0; margin: 16px 0 0; padding: 0; min-width: 0; }
.costs legend { padding: 0; font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.costs .field:first-of-type { border-top: 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding-top: 16px; border-top: 1px solid var(--hair); }
.toolbar label { font-weight: 600; font-size: 0.95rem; }
select { font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; min-height: 44px; max-width: 100%; }
.toolbar select { flex: 1 1 200px; min-width: 0; }

.btn { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 4px; padding: 10px 18px; min-height: 44px; cursor: pointer; transition: transform 150ms ease; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-quiet { font: inherit; font-size: 0.92rem; background: transparent; color: var(--muted); border: 0; padding: 10px 6px; min-height: 44px; min-width: 44px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.btn-quiet:hover { color: var(--ink); }

.small { font-size: 0.9rem; color: var(--muted); margin: 8px 0; }
.status { font-size: 0.92rem; color: var(--ink); margin: 4px 0 0; min-height: 1.4em; }

/* Result */
.result { min-width: 0; }
.verdict { background: var(--result); border: 1px solid var(--result-rule); border-left: 8px solid var(--olive); border-radius: 6px; padding: 24px 24px 16px; transition: border-color 200ms ease; }
.result[data-winner="sole"] .verdict { border-left-color: var(--plum); }
.result[data-winner="even"] .verdict { border-left-color: var(--border); }
.verdict-label { font-family: var(--sans); font-size: 1.05rem; font-weight: 600; letter-spacing: 0; }
.figure { margin: 0 0 12px; line-height: 1.05; min-height: 3.6rem; }
#figValue { font-family: var(--serif); font-size: clamp(2.8rem, 6vw, 4rem); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums lining-nums; }
.figure-unit { font-size: 1.1rem; color: var(--muted); }
.headline { font-size: 1.06rem; margin: 0 0 16px; max-width: 40em; min-height: 4.6em; }
.hint { margin: 16px 0 8px; font-weight: 600; max-width: 40em; }
.meta-line { font-size: 0.9rem; color: var(--muted); margin: 12px 0 0; }

.warnings p { margin: 0 0 8px; padding: 8px 12px; border-left: 4px solid var(--plum); background: var(--surface); font-size: 0.95rem; border-radius: 0 4px 4px 0; }

.bars { min-height: 96px; }
.bar-row { display: grid; grid-template-columns: 8.2em minmax(0, 1fr) 5.6em; gap: 12px; align-items: center; padding: 4px 0; }
.bar-name { font-size: 0.95rem; }
.bar-track { display: flex; gap: 2px; height: 18px; }
.seg { display: block; height: 100%; min-width: 2px; border-radius: 0 3px 3px 0; transition: width 220ms ease; }
.seg-sole { background: var(--plum); }
.seg-scorp { background: var(--olive); }
.seg-cost { background: var(--olive-wash); border: 2px solid var(--olive); }
.bar-val { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; font-weight: 700; }
.bar-key { font-size: 0.82rem; color: var(--muted); margin: 4px 0 0; padding-left: calc(8.2em + 12px); }
.bar-key .seg { display: inline-block; width: 14px; height: 10px; margin: 0 4px 0 0; vertical-align: -1px; border-radius: 0; }
.bar-key .seg + .seg, .bar-key i:nth-of-type(2) { margin-left: 12px; }

/* Chart */
.chart-wrap { margin: 24px 0 0; background: var(--surface); border: 1px solid var(--hair); border-radius: 6px; padding: 20px 16px 16px; }
.chart-title { font-size: 1.2rem; }
.chart-sub { font-size: 0.92rem; color: var(--muted); margin: 4px 0 8px; }
.chart-box { position: relative; min-height: 300px; }
#chart { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: pan-y; }
#chart .c-grid { stroke: var(--hair); stroke-width: 1; }
#chart .c-axis { stroke: var(--border); stroke-width: 1; }
#chart .c-tick, #chart .c-axis-title, #chart .c-note { fill: var(--muted); font-family: var(--sans); font-size: 12px; font-variant-numeric: tabular-nums; }
#chart .c-empty { fill: var(--muted); font-family: var(--sans); font-size: 15px; }
#chart .c-wedge-good { fill: var(--olive-wash); }
#chart .c-wedge-bad { fill: var(--plum-wash); }
#chart .c-sole { stroke: var(--plum); stroke-width: 2; }
#chart .c-scorp { stroke: var(--olive); stroke-width: 2.5; fill: none; stroke-linejoin: round; stroke-linecap: round; }
#chart .c-kink { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
#chart .c-lbl { fill: var(--ink); font-family: var(--sans); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
#chart .c-strong { font-weight: 700; }
#chart .c-lbl, #chart .c-note { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
#chart .c-be { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 4 4; }
#chart .c-be-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
#chart .c-you-line { stroke: var(--olive); stroke-width: 1; }
#chart .c-you { fill: var(--olive); stroke: var(--surface); stroke-width: 2; }
#chart .c-cross { stroke: var(--muted); stroke-width: 1; }
#chart .c-hover-dot { fill: var(--surface); stroke: var(--olive); stroke-width: 2; }
#chart .c-hit { fill: transparent; }

.tip { position: absolute; top: 8px; z-index: 2; pointer-events: none; background: var(--ink); color: var(--bg); border-radius: 4px; padding: 8px 12px; font-size: 0.85rem; line-height: 1.5; white-space: nowrap; }
.tip strong, .tip span { display: block; font-variant-numeric: tabular-nums; }
.tip .sw { border: 1px solid var(--bg); }

.legend { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 8px 0 0; font-size: 0.88rem; color: var(--muted); }
.sw { display: inline-block; width: 14px; height: 4px; margin-right: 8px; vertical-align: 3px; border-radius: 2px; }
.sw-sole { background: var(--plum); }
.sw-scorp { background: var(--olive); }

/* Sections */
.section { padding-top: 56px; }
.section > h2, .guide > h2 { padding-top: 16px; border-top: 3px solid var(--olive); margin-bottom: 12px; }
.section-intro { color: var(--muted); max-width: 44em; }

/* Breakdown table */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border: 1px solid var(--hair); border-radius: 6px; }
table.breakdown { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
table.breakdown th, table.breakdown td { padding: 10px 16px; border-bottom: 1px solid var(--hair); text-align: left; vertical-align: baseline; }
table.breakdown thead th { font-family: var(--serif); font-size: 1.05rem; border-bottom: 2px solid var(--ink); position: sticky; top: 0; background: var(--surface); }
table.breakdown thead th.n { text-align: right; }
table.breakdown thead th:nth-child(2) { box-shadow: inset 0 -4px 0 var(--plum); }
table.breakdown thead th:nth-child(3) { box-shadow: inset 0 -4px 0 var(--olive); }
table.breakdown tbody th { font-weight: 400; }
table.breakdown td { text-align: right; white-space: nowrap; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.breakdown td.none { color: var(--muted); font-family: var(--sans); font-size: 0.85rem; }
table.breakdown tr.group th { font-weight: 700; font-size: 0.9rem; color: var(--muted); background: var(--bg); padding-top: 14px; }
table.breakdown tr.total th, table.breakdown tr.total td { font-weight: 700; border-top: 2px solid var(--ink); font-size: 1.05rem; }
table.breakdown tr.diff th, table.breakdown tr.diff td { font-weight: 700; background: var(--result); border-bottom: 0; }
table.breakdown tr.diff td { font-family: var(--sans); }

.formulas { margin-top: 24px; border: 1px solid var(--hair); border-radius: 6px; background: var(--surface); }
.formulas-body { padding: 0 16px 8px; }
pre { font-family: var(--mono); font-size: 0.86rem; line-height: 1.6; background: var(--bg); border-radius: 4px; padding: 12px 16px; overflow-x: auto; margin: 0 0 16px; }

details > summary { cursor: pointer; font-weight: 600; padding: 14px 16px; min-height: 44px; }
details > summary:hover { color: var(--accent); }

.actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.actions .status { margin: 0; flex: 1 1 220px; }
.share-row { margin: 12px 0 0; display: grid; gap: 4px; max-width: 44em; }
.share-row label { font-size: 0.9rem; font-weight: 600; }
.share-row input { font-family: var(--mono); font-size: 1rem; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; min-height: 44px; width: 100%; }

/* Assumptions */
.assume-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 8px; }
.assume-head label { font-weight: 600; }
.assume-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 32px; margin-top: 16px; background: var(--surface); border: 1px solid var(--hair); border-radius: 6px; padding: 4px 20px; }
.afield { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--hair); }
.afield > label { font-weight: 600; grid-column: 1; }
.afield > .pair { grid-column: 2; grid-row: 1 / span 2; }
.afield > .help, .afield > .msg { grid-column: 1; }
.afield.changed > label::after { content: " (edited)"; color: var(--plum); font-weight: 600; font-size: 0.85rem; }
.afield .pair input { width: 6.2em; }
.yr { font-weight: 400; color: var(--muted); }

.confirm { margin: 12px 0 4px; padding: 10px 14px; border-left: 4px solid var(--plum); background: var(--surface); max-width: 44em; border-radius: 0 4px 4px 0; }

/* Guide */
.guide p, .guide ul, .guide dl, .faq details { max-width: 68ch; }
.guide h3 { margin: 32px 0 8px; }
.guide ul { padding-left: 20px; margin: 0 0 16px; }
.guide li { margin-bottom: 6px; }
.glossary { margin: 0; }
.glossary dt { font-weight: 700; margin-top: 12px; }
.glossary dd { margin: 0; color: var(--muted); }

.faq details { border-bottom: 1px solid var(--hair); }
.faq details > summary { padding-left: 0; font-family: var(--serif); font-size: 1.12rem; }
.faq details p { margin: 0 0 16px; }

/* Phone-only collapsing of long blocks. The buttons are added by the script. */
.more-btn { display: none; }
.to-top { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 600px) {
  input[type="range"] { min-height: 44px; }
  .more-btn { display: block; width: 100%; margin-top: 12px; font: inherit; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; min-height: 48px; padding: 10px 16px; cursor: pointer; }
  .table-scroll.is-collapsed tr.more { display: none; }
  .assume-grid.is-collapsed .afield:nth-child(n+2):not(.changed) { display: none; }
}

/* Text pages: privacy, about, contact, not found */
.page { padding-top: 40px; padding-bottom: 24px; }
.page > * { max-width: 68ch; }
.page h1 { margin-bottom: 16px; }
.page .lede { margin: 0 0 8px; }
.page section { margin-top: 40px; }
.page h2 { padding-top: 16px; border-top: 3px solid var(--olive); margin-bottom: 12px; font-size: 1.45rem; }
.page ul { padding-left: 20px; margin: 0 0 16px; }
.page li { margin-bottom: 6px; }
.page a.btn { display: inline-flex; align-items: center; text-decoration: none; }

.page .byline { font-size: 0.92rem; color: var(--muted); }
.page ol { padding-left: 22px; margin: 0 0 16px; }
.page ol li { margin-bottom: 8px; }
.article > * { max-width: 68ch; }
.article .ad-slot { max-width: none; }

/* Salary helper under the salary input */
.salary-tip { grid-column: 1 / -1; margin-top: 4px; border-top: 1px solid var(--result-rule); }
.salary-tip > summary { padding: 10px 0; font-size: 0.95rem; color: var(--accent); }
.salary-tip-body { font-size: 0.92rem; padding-bottom: 4px; }
.salary-tip-body p { margin: 0 0 8px; }
.salary-tip-body ul { margin: 0 0 8px; padding-left: 20px; }

/* Filing status select spans the row */
.field-select select { grid-column: 1 / -1; width: 100%; }
.field-select > .help { grid-row: auto; }

/* Optional income tax section */
.itax { margin: 24px 0 0; background: var(--surface); border: 1px solid var(--hair); border-radius: 6px; padding: 20px 16px 16px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--olive); flex: none; }
.itax .field { border-top: 1px solid var(--hair); margin-top: 8px; }
.it-warn { margin: 12px 0 0; padding: 10px 14px; border-left: 4px solid var(--plum); background: var(--plum-wash); border-radius: 0 4px 4px 0; max-width: 44em; }
.it-sentence { font-weight: 600; margin: 12px 0; max-width: 44em; }
.it-scroll { margin-bottom: 8px; }

/* Bundle siblings */
.more-tools { margin-top: 56px; }
.more-tools h2 { font-size: 1.3rem; padding-top: 16px; border-top: 1px solid var(--hair); margin-bottom: 8px; }
.more-tools ul { list-style: none; margin: 0; padding: 0; max-width: 68ch; }
.more-tools li { padding: 10px 0; border-bottom: 1px solid var(--hair); }
.more-tools a { font-weight: 600; }

/* Ad slots: hidden until ads are switched on */
.ad-slot { margin-top: 56px; }
.ad-label { margin: 0 0 4px; font-size: 0.75rem; color: var(--muted); }
.ad-box { min-height: 120px; max-width: 100%; overflow: hidden; background: var(--surface); border: 1px solid var(--hair); border-radius: 6px; }
@media (max-width: 600px) { .ad-box { min-height: 280px; } }
/* While an ad is on screen the result bar docks at the top instead of sitting over the ad. */

.foot-nav { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 8px 0; }
.foot-nav a { display: inline-flex; align-items: center; min-height: 44px; }

/* Footer */
.footer { margin-top: 64px; background: var(--band); color: var(--band-ink); padding: 32px 0 40px; }
.footer .disclaimer { font-family: var(--serif); font-size: 1.1rem; margin: 0 0 8px; max-width: 60ch; }
.footer .small { color: var(--band-soft); max-width: 75ch; }
.footer a { color: var(--band-ink); }

/* Mobile result bar */
.mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; justify-content: space-between; align-items: center; gap: 12px; height: 64px; height: calc(64px + env(safe-area-inset-bottom, 0px)); background: var(--band); color: var(--band-ink); padding: 0 16px env(safe-area-inset-bottom, 0px); font-size: 0.95rem; transition: transform 200ms ease; }
.mb-text { margin: 0; min-width: 0; line-height: 1.2; font-weight: 600; }
.mb-text strong { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums lining-nums; color: var(--band-ink); }
.mobile-bar a { color: var(--band-ink); white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 4px; font-weight: 600; }
.mobile-bar.off { transform: translateY(110%); }
.mobile-bar.typing, .mobile-bar.ad-near { top: 0; bottom: auto; height: 64px; padding-bottom: 0; transform: none; border-bottom: 2px solid var(--olive); }
html.bar-top { scroll-padding-top: 80px; }
@media (max-width: 600px) {
  .mb-text { font-size: 0.85rem; line-height: 1.15; }
  #mbLead { display: block; }
}
#result { scroll-margin-top: 16px; }
#results-h:focus, [tabindex="-1"]:focus { outline: none; }
.footer { padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
.doc .footer { padding-bottom: 40px; }

@media (max-width: 919px) {
  .nav { order: 3; width: 100%; margin-left: -10px; gap: 0 4px; }
  .nav a { white-space: nowrap; }
  .lede { font-size: 1.02rem; }
  .theme-btn { margin-left: auto; }
}

@media (max-width: 520px) {
  .verdict { padding: 20px 16px 12px; }
  .bar-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding: 6px 0; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .bars { min-height: 132px; }
  .bar-key { padding-left: 0; }
  .chart-wrap { padding: 16px 8px 12px; }
  table.breakdown { font-size: 0.86rem; }
  table.breakdown th, table.breakdown td { padding: 9px 8px; }
  .afield { grid-template-columns: minmax(0, 1fr); }
  .afield > .pair { grid-column: 1; grid-row: auto; justify-self: start; }
  .headline { min-height: 0; }
}

@media (max-width: 360px) {
  .inputs { padding-left: 16px; padding-right: 16px; }
  .field-key { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .pair input { width: 6em; }
}

@media (min-width: 700px) {
  .assume-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (min-width: 920px) {
  .wrap { padding-left: 32px; padding-right: 32px; }
  .hero { padding-top: 40px; padding-bottom: 28px; }
  .calc { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 40px; align-items: start; }
}

@media (min-width: 920px) and (min-height: 880px) {
  .inputs { position: sticky; top: 16px; }
}

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

@media print {
  .band, .mobile-bar, .toolbar, .actions, .share-row, .theme-btn, .skip, input[type="range"], .chart-sub, .assume-head button, .tip { display: none !important; }
  body { background: #fff; padding-bottom: 0; font-size: 11pt; }
  .calc { grid-template-columns: minmax(0, 1fr); }
  .inputs { position: static; }
  .section { padding-top: 24px; }
  .verdict, .chart-wrap, tr, .afield, .field { break-inside: avoid; }
  h2, h3, .section-intro { break-after: avoid; }
  table.breakdown thead th { position: static; }
  .table-scroll { overflow: visible; }
  .footer { background: none; color: #000; margin-top: 24px; padding: 12px 0; border-top: 1px solid #000; }
  .footer .small, .footer a { color: #000; }
  a { color: inherit; }
}
