/* Statement of Means: charcoal and paper, like the grey numbered boxes of a court form, one amber accent. */
:root {
  --bg: #f4f2ec;
  --surface: #ffffff;
  --panel: #e9e6dd;
  --ink: #1f1e1b;
  --muted: #5a5750;
  --line: #cfcabd;
  --bar: #34322d;
  --bar-ink: #f4f2ec;
  --accent: #8a4b08;
  --amber: #e5a83b;
  --good: #1f6b3a;
  --bad: #a3271b;
  --focus: #c27c0e;
  --r: 6px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151413;
    --surface: #1f1e1c;
    --panel: #2a2825;
    --ink: #ecebe6;
    --muted: #b3afa5;
    --line: #47443e;
    --bar: #0d0c0b;
    --bar-ink: #ecebe6;
    --accent: #f0b85a;
    --good: #7fcf98;
    --bad: #ff9a8c;
    --focus: #f0b85a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* top bar */
.top { background: var(--bar); color: var(--bar-ink); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--bar-ink); text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.top nav { display: flex; gap: 4px; }
.top nav a { color: var(--bar-ink); text-decoration: none; padding: 10px 10px; border-radius: var(--r); font-size: 15px; }
.top nav a[aria-current=page] { box-shadow: inset 0 -3px 0 var(--amber); }
.top nav a:hover { background: rgba(255,255,255,.08); }
.crumbs { font-size: 14px; color: var(--muted); padding-top: 12px; }
.crumbs a { color: var(--muted); }

/* hero */
.hero { padding-top: 14px; padding-bottom: 6px; }
h1 { font-size: clamp(26px, 5vw, 38px); line-height: 1.15; margin: 8px 0 10px; letter-spacing: -.01em; max-width: 26ch; }
.lede { font-size: 18px; margin: 0 0 12px; max-width: 64ch; }
.advice { margin: 0 0 10px; padding: 10px 14px; background: var(--surface); border-left: 5px solid var(--amber); border-radius: 0 var(--r) var(--r) 0; max-width: 72ch; }
.aside { font-size: 15px; color: var(--muted); margin: 0 0 8px; max-width: 72ch; }
.urgent { border: 2px solid var(--line); border-radius: var(--r); padding: 4px 14px; max-width: 72ch; margin-bottom: 8px; font-size: 16px; }
.urgent p { margin: 8px 0; }

/* home picks */
.picks { display: grid; gap: 12px; padding-bottom: 14px; }
@media (min-width: 720px) { .picks { grid-template-columns: 1fr 1fr; } }
.pick { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; padding: 16px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); }
.pick:hover { border-color: var(--accent); }
.pick-code { grid-row: span 2; align-self: start; font-weight: 800; font-size: 20px; background: var(--bar); color: var(--amber); padding: 8px 10px; border-radius: 4px; }
.pick-t { font-weight: 700; font-size: 18px; }
.pick-d { color: var(--muted); font-size: 15px; }

/* tool */
.tool { padding-top: 6px; padding-bottom: 20px; }
.banner, .note { background: var(--panel); padding: 10px 12px; border-radius: var(--r); margin: 8px 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 6px 0 10px; }
.toolbar .hint { margin: 0; flex: 1 1 260px; }
.period { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
#per-l { font-weight: 600; }
.seg2 { display: inline-flex; }
.period label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; }
.period label:first-child { border-radius: var(--r) 0 0 var(--r); }
.period label:last-child { border-radius: 0 var(--r) var(--r) 0; border-left: 0; }
.period label:has(input:checked) { border-color: var(--bar); background: var(--bar); color: var(--bar-ink); }
.period input { accent-color: var(--amber); margin: 0; }

.bno { display: inline-block; min-width: 1.7em; padding: 0 .35em; text-align: center; background: var(--bar); color: var(--amber); font-weight: 800; border-radius: 3px; font-variant-numeric: tabular-nums; }
.strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin: 0 0 12px; }
@media (min-width: 820px) { .strip { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.strip > div { background: var(--surface); padding: 8px 10px; min-width: 0; }
.strip dt { font-size: 13px; color: var(--muted); line-height: 1.3; }
.strip dt .bno { font-size: 12px; }
.strip dd { margin: 2px 0 0; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.strip .st-left { background: var(--panel); }
.strip dd.zero { color: var(--muted); font-weight: 500; }
.strip dd.neg { color: var(--bad); }
.strip dd.pos { color: var(--good); }
.st-per { white-space: nowrap; }

.tabs { display: flex; gap: 4px; border-bottom: 3px solid var(--bar); overflow-x: auto; scrollbar-width: thin; }
.tabs [role=tab] { flex: 1 0 auto; min-height: 46px; padding: 6px 12px; border: 2px solid var(--line); border-bottom: 0; border-radius: var(--r) var(--r) 0 0; background: var(--panel); color: var(--ink); font: inherit; font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.tabs [role=tab][aria-selected=true] { background: var(--bar); color: var(--bar-ink); border-color: var(--bar); font-weight: 700; }
.tabs .bno { background: transparent; color: var(--amber); padding: 0; min-width: 0; }
.tabs [role=tab][aria-selected=false] .bno { color: var(--accent); }
.panel { padding-top: 6px; }

.box { margin: 14px 0 18px; }
.boxh { display: flex; align-items: center; gap: 10px; font-size: 21px; margin: 0 0 6px; }
.boxh .bno { font-size: 18px; padding: 2px 8px; }
.hint { color: var(--muted); font-size: 15px; margin: 2px 0 8px; }
.small { color: var(--muted); font-size: 14px; font-weight: 400; }
.ln { background: var(--surface); border: 1px solid var(--line); border-top: 0; padding: 10px 12px; }
.box > .ln:first-of-type, .box > .hint + .ln, .box > .ln.grp:first-of-type { border-top: 1px solid var(--line); }
.ln-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 10px; }
.ln-h label, .ln-h .lbl { font-weight: 600; }
.mo { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.ln .hint { margin: 0 0 4px; }
.amtrow { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; max-width: 30em; }
.cur { font-weight: 700; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 17px; color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); min-height: 44px; padding: 6px 10px; max-width: 100%; }
input:focus, select:focus { border-color: var(--focus); }
input[aria-invalid=true] { border-color: var(--bad); }
.amtrow .amt { flex: 1 1 6em; width: auto; min-width: 0; font-variant-numeric: tabular-nums; }
.amtrow .frq { flex: 1 1 8em; width: auto; min-width: 0; }
label { display: block; }
label > input:not([type=checkbox]):not([type=radio]) { display: block; width: 100%; margin-top: 4px; }
label .amtrow { margin-top: 4px; }
label .amtrow input { display: inline-block; margin: 0; max-width: 12em; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--bar); margin: 0; }
.rm { min-height: 44px; padding: 0 10px; background: none; border: 0; color: var(--accent); text-decoration: underline; font: inherit; font-size: 15px; cursor: pointer; }
.work { font-size: 14px; color: var(--muted); margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.work:empty { display: none; }
.work.err { color: var(--bad); font-weight: 600; }
.link { background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--accent); text-decoration: underline; font: inherit; font-size: 15px; cursor: pointer; }
.grp > .ln-h { margin-bottom: 4px; }
.item { border-top: 1px dashed var(--line); padding: 8px 0 6px; }
.grp > .ln-h + .item, .grp > .item:first-child { border-top: 0; }
.item-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; font-size: 14px; color: var(--muted); }
.two { display: grid; gap: 8px 14px; margin-top: 6px; }
@media (min-width: 640px) { .two { grid-template-columns: 1fr 1fr; align-items: end; } }
.desc-l { margin-top: 4px; }
.tot { background: var(--panel); border-top: 1px solid var(--line); }
.tot .lbl { font-weight: 700; }
.next { margin: 12px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border-radius: var(--r); border: 2px solid var(--bar); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--panel); }
.btn.primary { background: var(--bar); color: var(--bar-ink); }
.btn.primary:hover { background: #4a4740; }
.btn.small { min-height: 40px; padding: 4px 12px; font-size: 15px; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.file { position: relative; overflow: hidden; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }

fieldset.seg { border: 0; padding: 0; margin: 0 0 10px; }
fieldset.seg legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
fieldset.seg label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
fieldset.seg input { width: 22px; height: 22px; accent-color: var(--bar); margin: 0; }
.subh { font-size: 18px; margin: 18px 0 6px; }
#claim, #left-box, #offer-box { background: var(--surface); border: 1px solid var(--line); padding: 10px 12px; }
#offer-box { border-top: 0; }
table { border-collapse: collapse; }
.sum { width: 100%; max-width: 560px; font-variant-numeric: tabular-nums; }
.sum th { text-align: left; font-weight: 400; padding: 4px 8px 4px 0; }
.sum td { text-align: right; padding: 4px 0; white-space: nowrap; }
.sum tr.res th, .sum tr.res td { font-weight: 800; border-top: 2px solid var(--ink); padding-top: 6px; font-size: 19px; }
.src { font-size: 15px; color: var(--muted); }
.calm { background: var(--panel); padding: 8px 12px; border-radius: var(--r); }
.suggest { background: var(--panel); border: 1px solid var(--line); border-top: 0; padding: 10px 12px; }
.suggest .subh { margin-top: 4px; }
.pr { width: 100%; max-width: 560px; font-variant-numeric: tabular-nums; margin: 6px 0; }
.pr th, .pr td { padding: 5px 8px 5px 0; text-align: right; border-bottom: 1px solid var(--line); }
.pr th[scope=row], .pr thead th:first-child { text-align: left; font-weight: 400; overflow-wrap: anywhere; }
.pr thead th { font-size: 14px; color: var(--muted); font-weight: 600; }
.pr tr.self th, .pr tr.self td { font-weight: 800; }
.pr tfoot th, .pr tfoot td { border-bottom: 0; font-weight: 600; }
.out-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 8px; }
.out-bar .boxh { margin: 0; }

/* answer sheet on screen: only on the Offer tab */
.sheet { display: none; }
body.on-sheet .sheet { display: block; background: var(--surface); border: 1px solid var(--line); padding: 14px; border-radius: var(--r); }
.sh-head h2 { font-size: 20px; margin: 4px 0 6px; }
.sh-kicker { margin: 0; font-weight: 700; color: var(--accent); }
.sh-head p { margin: 4px 0; font-size: 15px; }
.sh-box { margin: 14px 0; }
.sh-box h3 { font-size: 17px; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.lines-t { width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; table-layout: fixed; }
.lines-t th, .lines-t td { border-bottom: 1px solid var(--line); padding: 5px 6px; vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.lines-t thead th { font-size: 13px; color: var(--muted); }
.lines-t .c-lb { width: 40%; }
.lines-t .c-am { width: 16%; text-align: right; font-weight: 700; white-space: nowrap; }
.lines-t .c-per { width: 9%; }
.lines-t .c-wk { width: 35%; font-size: 13px; color: var(--muted); }
.lines-t tr.sub td { font-weight: 600; padding-top: 8px; }
.lines-t tr.trow td { font-weight: 800; border-top: 2px solid var(--ink); border-bottom: 0; }
.lines-t .rno { display: inline-block; width: 1.4em; color: var(--muted); }
.lines-t .cc { display: inline-block; min-width: 40%; padding-right: 8px; }
.sum-t .c-lb { width: 70%; }
.sum-t .c-am { width: 30%; }
.muted { color: var(--muted); font-weight: 400; }
.bad { color: var(--bad); font-weight: 600; }
.fn, .behind { font-size: 14px; }
.todo { padding-left: 20px; margin: 4px 0; }
.todo li { margin: 4px 0; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .lines-t .c-wk { display: none; }
  .lines-t .c-lb { width: 58%; }
  .lines-t .c-am { width: 27%; white-space: normal; }
  .lines-t .c-per { width: 15%; }
}

/* keep panel */
.keep { margin-top: 26px; padding-top: 12px; border-top: 3px solid var(--bar); }
.keep h2 { font-size: 19px; margin: 0 0 4px; }
.hint.warn { color: var(--bad); font-weight: 600; }
.ask { margin-top: 10px; padding: 12px; background: var(--panel); border-radius: var(--r); border: 2px solid var(--bar); }
.ask p { margin: 0 0 8px; }
.kept { margin-top: 10px; }
.kept summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.klist { padding-left: 20px; }
.klist li { margin: 6px 0; }
.undo { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 20; background: var(--bar); color: var(--bar-ink); padding: 8px 10px 8px 16px; border-radius: var(--r); display: flex; gap: 10px; align-items: center; max-width: calc(100% - 32px); box-shadow: 0 4px 18px rgba(0,0,0,.25); }
.undo .btn { background: var(--surface); color: var(--ink); }

/* prose */
.prose { max-width: 980px; padding-top: 8px; padding-bottom: 8px; }
.prose h2 { font-size: 22px; margin: 22px 0 8px; }
.prose p { max-width: 70ch; }
.faq details { border-bottom: 1px solid var(--line); max-width: 74ch; }
.faq summary { cursor: pointer; padding: 10px 0; font-weight: 600; min-height: 44px; }
.faq details p { margin: 0 0 12px; }

/* footer */
.foot { margin-top: 30px; padding: 18px 0 28px; background: var(--panel); font-size: 14px; color: var(--muted); }
.sb-footer p { margin: 6px 0; }
.sb-more a, .sb-credit a { color: var(--muted); }
.sb-more { line-height: 1.8; }

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

/* paper: only the answer sheet */
@page { size: auto; margin: 14mm 13mm; }
@media print {
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .top, .crumbs, .hero, .prose, .foot, .skip, .toolbar, .strip, .tabs, .panel, .keep, .banner, .note, .undo, noscript { display: none !important; }
  .wrap, .tool { max-width: none; padding: 0; margin: 0; }
  .sheet, body.on-sheet .sheet { display: block !important; border: 0; padding: 0; background: #fff; color: #000; }
  .sh-head h2 { font-size: 14pt; }
  .sh-kicker { color: #000; font-size: 10pt; }
  .sh-head p { font-size: 9.5pt; }
  .sh-box { margin: 9pt 0; }
  .sh-box h3 { font-size: 11.5pt; break-after: avoid; }
  .bno { background: none; color: #000; border: 1.5pt solid #000; }
  .lines-t { font-size: 9.5pt; }
  .lines-t thead { display: table-header-group; }
  .lines-t tr { break-inside: avoid; }
  .lines-t th, .lines-t td { border-bottom: .6pt solid #999; padding: 2.5pt 4pt; color: #000; }
  .lines-t .c-wk { display: table-cell !important; font-size: 8.5pt; color: #333; }
  .lines-t .c-lb { width: 40%; } .lines-t .c-am { width: 14%; } .lines-t .c-per { width: 8%; } .lines-t .c-wk { width: 38%; }
  .lines-t tr.trow td { border-top: 1.2pt solid #000; }
  .tots { break-before: avoid; }
  .sh-keep { break-inside: avoid; }
  .muted, .lines-t thead th { color: #444; }
  .bad { color: #000; text-decoration: underline; }
  a { color: #000; }
}
@media (max-width: 540px) {
  .tabs { gap: 2px; }
  .tabs [role=tab] { flex: 1 1 0; min-width: 0; flex-direction: column; padding: 4px 2px; font-size: 14px; line-height: 1.2; gap: 0; }
}

.lines-t tr.bhrow th { font-size: 17px; font-weight: 700; color: var(--ink); border-bottom: 0; padding: 0 0 6px; }
.more-info summary { cursor: pointer; display: list-item; padding: 10px 0; font-weight: 600; color: var(--accent); }
.more-info[open] summary { padding-bottom: 2px; }
@media print {
  .lines-t tr.bhrow th { font-size: 11.5pt; color: #000; border-bottom: 0; padding: 0 0 4pt; }
  .lines-t .c-lb { width: 37%; } .lines-t .c-am { width: 18%; } .lines-t .c-per { width: 8%; } .lines-t .c-wk { width: 37%; }
  .lines-t .c-per { padding-left: 6pt; }
}
@media print { .sum-t .c-lb { width: 75%; } .sum-t .c-am { width: 25%; } }
@media (max-width: 540px) {
  .top nav a[href="#help"] { display: none; }
  .top-in { flex-wrap: nowrap; }
  .brand { font-size: 16px; gap: 8px; }
  .top nav a { padding: 10px 8px; }
  .crumbs { padding-top: 8px; }
  .toolbar { margin: 4px 0 8px; }
  .toolbar .hint { display: none; }
  .strip > div { padding: 5px 8px; }
  .strip dt { font-size: 12px; }
  .strip dd { font-size: 16px; margin: 0; }
  .panel > .box:first-child { margin-top: 8px; }
  #p-6 > .box:first-child > .boxh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (max-width: 540px) {
  h1 { margin: 4px 0 8px; }
  .lede { font-size: 17px; margin-bottom: 10px; }
  .advice { padding: 8px 12px; }
}
/* column widths for the box tables (the first header row spans all columns, so widths live on the cols) */
.lines-t col.k-lb { width: 40%; } .lines-t col.k-am { width: 16%; } .lines-t col.k-per { width: 9%; } .lines-t col.k-wk { width: 35%; }
@media (max-width: 560px) { .lines-t col.k-lb { width: 58%; } .lines-t col.k-am { width: 27%; } .lines-t col.k-per { width: 15%; } .lines-t col.k-wk { width: 0; } }
@media print { .lines-t col.k-lb { width: 37%; } .lines-t col.k-am { width: 18%; } .lines-t col.k-per { width: 8%; } .lines-t col.k-wk { width: 37%; } }
