/* BondWorth: all styles. Spirit (team/01-discovery.md): warm, calm, plain; paper-certificate feel with no
   government look; built for older eyes (18px+ body, 48px targets, AA+ contrast, native controls). */
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
/* Digits everywhere come from Source Serif (plain zero): Atkinson Hyperlegible draws 0 with a slash, which older
   readers took for a glitch or an 8 in amounts and years (team/02-audience-review.md). */
@font-face { font-family: "BW Digits"; src: url("/fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0030-0039; }
@font-face { font-family: "BW Digits"; src: url("/fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0030-0039; }

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --paper: #FBF8F1; --card: #FFFDF8; --ink: #1F2328; --ink-2: #4A4F57; --line: #E2DCCB; --line-2: #8F866E;
  --accent: #1E5B45; --on-accent: #FFFFFF; --accent-wash: #E6F0EA;
  --ok: #1E5B45; --ok-wash: #E6F0EA; --warn: #7A4B00; --warn-wash: #FBF0D9; --stop: #8A3B00; --stop-wash: #FCE9D8;
  --focus: #B8860B;
  --sans: "BW Digits", "Atkinson Hyperlegible", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --gutter: 20px; --narrow: 720px;
}
/* Light by default for this audience (team/02-audience-review.md); dark only when the visitor picks it. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #16181B; --card: #1F2226; --ink: #F2EFE8; --ink-2: #C3BFB5; --line: #33373D; --line-2: #7A808A;
  --accent: #7CC4A2; --on-accent: #0F1A15; --accent-wash: #1C2E26;
  --ok: #7CC4A2; --ok-wash: #1C2E26; --warn: #F0C36B; --warn-wash: #33291A; --stop: #F5A66B; --stop-wash: #36241A;
  --focus: #F0C36B;
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 19px/1.55 var(--sans); }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1.5px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }
[hidden] { display: none !important; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--card); color: var(--ink); padding: 10px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 8px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(32px, 6vw, 46px); margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-size: 28px; margin: 48px 0 12px; }
h3 { font-size: 21px; margin: 28px 0 6px; }
.num { font-family: var(--serif); font-variant-numeric: lining-nums tabular-nums; }

/* ------------------------------------------------------------------ top */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 23px var(--serif); }
.brand svg { width: 28px; height: 20px; color: var(--accent); }
.indep { font-size: 15px; color: var(--ink-2); }
.hero { padding-top: 24px; }
.lead { font-size: 21px; color: var(--ink-2); margin: 0 0 24px; }

/* ------------------------------------------------------------------ cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; margin: 0 0 20px;
  box-shadow: 0 1px 0 var(--line); }
@media (max-width: 480px) { .card { padding: 18px; } }

/* ------------------------------------------------------------------ form */
.q { border: 0; margin: 0 0 24px; padding: 0; min-width: 0; }
.q legend, .q > label { display: block; font-weight: 700; font-size: 20px; margin: 0 0 4px; padding: 0; }
.hint { color: var(--ink-2); font-size: 17px; margin: 0 0 10px; }
.serial { margin: -8px 0 0; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .choices { grid-template-columns: 1fr; } }
.choice { position: relative; display: block; cursor: pointer; }
.choice input, .seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: block; min-height: 64px; padding: 12px 14px 12px 46px; border: 2px solid var(--line-2); border-radius: 12px; background: var(--paper); }
.choice span::before { content: ""; position: absolute; left: 14px; top: 16px; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--ink-2); background: var(--card); }
.choice b { display: block; font-size: 19px; }
.choice small { display: block; font-size: 16px; color: var(--ink-2); line-height: 1.35; }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-wash); }
.choice input:checked + span::before { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 45%, var(--card) 50%); }
.choice input:focus-visible + span, .seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.seg { display: flex; flex-wrap: wrap; gap: 10px; }
.seg label { position: relative; flex: 1 1 200px; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px 14px; text-align: center;
  border: 2px solid var(--line-2); border-radius: 12px; background: var(--paper); font-weight: 700; }
.seg input:checked + span { border-color: var(--accent); background: var(--accent-wash); }
select, .money input { min-height: 52px; font: 400 19px var(--sans); color: var(--ink); background: var(--paper);
  border: 2px solid var(--line-2); border-radius: 10px; padding: 0 12px; }
select { width: 100%; max-width: 320px; }
.date { display: flex; gap: 10px; flex-wrap: wrap; }
.date label { flex: 1 1 140px; max-width: 220px; }
.date select { max-width: none; }
.money { display: flex; align-items: center; gap: 8px; max-width: 320px; }
.money span { font-size: 22px; font-weight: 700; }
.money input { flex: 1; min-width: 0; }

/* ------------------------------------------------------------------ result */
.result { border: 2px solid var(--accent); box-shadow: inset 0 0 0 4px var(--card), inset 0 0 0 5px var(--line); }
.what { margin: 0; font-size: 20px; }
.worth { margin: 0 0 16px; font-size: 20px; }
.worth b { display: block; font-size: clamp(44px, 11vw, 64px); line-height: 1.1; font-weight: 600; }
.msg { margin: 0; font-size: 20px; }
.status { border-radius: 10px; padding: 12px 16px; margin: 0 0 16px; }
.status p { margin: 0; }
.status-h { font-weight: 700; }
.status.ok { background: var(--ok-wash); color: var(--ok); }
.status.warn { background: var(--warn-wash); color: var(--warn); }
.status.stop { background: var(--stop-wash); color: var(--stop); }
.status p + p { color: var(--ink); margin-top: 4px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; margin: 0 0 16px; }
.facts div { border-top: 1px solid var(--line); padding-top: 8px; }
.facts dt { font-size: 16px; color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 700; }
.tip { background: var(--accent-wash); border-radius: 10px; padding: 10px 14px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn, .btn-sec { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px;
  border-radius: 999px; font: 700 19px var(--sans); cursor: pointer; }
.btn { border: 0; background: var(--accent); color: var(--on-accent); }
.btn:disabled { opacity: .7; cursor: default; }
.btn-sec { border: 2px solid var(--accent); background: transparent; color: var(--accent); }
.btn-link { min-height: 52px; border: 0; background: none; color: var(--ink-2); font: 400 18px var(--sans); text-decoration: underline; cursor: pointer; }

/* ------------------------------------------------------------------ list */
.list-head h2 { margin: 0 0 4px; }
.total { margin: 0 0 12px; font-size: 20px; }
.total .num { font-size: 30px; font-weight: 600; }
#list-items { list-style: none; margin: 0 0 16px; padding: 0; }
#list-items li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.li-what { margin: 0; }
.li-val { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.rm { min-height: 48px; min-width: 48px; border: 0; background: none; color: var(--ink-2); font: 400 16px var(--sans); text-decoration: underline; cursor: pointer; }
.tag { display: inline-block; font-size: 15px; font-weight: 700; border-radius: 999px; padding: 1px 10px; }
.tag.ok { background: var(--ok-wash); color: var(--ok); }
.tag.warn { background: var(--warn-wash); color: var(--warn); }
.tag.stop { background: var(--stop-wash); color: var(--stop); }
.list-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
@media (max-width: 480px) { #list-items li { grid-template-columns: 1fr auto; } .rm { grid-column: 1 / -1; justify-self: start; min-height: 48px; padding: 0; } }

/* ------------------------------------------------------------------ prose */
.prose { padding-bottom: 32px; }
.prose p { max-width: 68ch; }
.faq { border-top: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 700; }
.faq p { margin: 0 0 12px; }
.notice { background: var(--warn-wash); color: var(--warn); padding: 12px; border-radius: 10px; }
.lost { padding: 48px var(--gutter); }

/* ------------------------------------------------------------------ footer */
.foot { border-top: 1px solid var(--line); padding: 24px 0 48px; color: var(--ink-2); font-size: 16px; }
.foot p { max-width: 80ch; }

/* ------------------------------------------------------------------ print: the bond list (and result) only */
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .top .indep, .calc, .prose, .actions, .list-actions, .rm, .skip, .hero .lead { display: none !important; }
  .card { border: 1px solid #999; box-shadow: none; break-inside: avoid; }
  .result { border: 1px solid #999; background: #fff; }
  .foot { border: 0; padding: 0; }
  a { color: #000; }
}
.asof { display: block; font-size: 14px; font-weight: 400; color: var(--ink-2); text-align: right; }
.hint.unsaved { color: var(--warn); background: var(--warn-wash); padding: 10px 12px; border-radius: 10px; }

/* ------------------------------------------------------------------ content pages */
.crumb { margin: 0 0 8px; font-size: 17px; }
.answer { font-size: 21px; }
.answer p { margin: 0; }
.tbl { overflow-x: auto; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 18px; }
caption { text-align: left; padding: 12px 14px 4px; font-weight: 700; }
th, td { padding: 9px 14px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { font-size: 16px; color: var(--ink-2); font-weight: 700; border-top: 0; }
tbody th { font-weight: 700; }
.prose ul { padding-left: 22px; max-width: 68ch; }
.prose li { margin: 0 0 6px; }
.more { columns: 2; column-gap: 32px; }
@media (max-width: 560px) { .more { columns: 1; } }
.foot-nav { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot-nav a { display: inline-flex; min-height: 44px; align-items: center; }
@media print { .foot-nav, .more, .crumb { display: none !important; } }
@media (max-width: 560px) {
  table { font-size: 16px; }
  th, td { white-space: normal; padding: 8px 10px; }
  td { text-align: right; }
}
.more-rows summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 700; color: var(--accent); }

/* ------------------------------------------------------------------ audience review fixes (team/02-audience-review.md) */
.bar .theme { min-height: 44px; padding: 0 14px; border: 2px solid var(--line-2); border-radius: 999px; background: var(--card);
  color: var(--ink); font: 700 16px var(--sans); cursor: pointer; }
.bar .theme[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.trust { margin-top: 0; margin-bottom: 8px; font-size: 16px; color: var(--ink-2); }
.example { display: inline-block; margin: 0 0 10px; padding: 2px 10px; border-radius: 999px; background: var(--warn-wash);
  color: var(--warn); font-size: 16px; font-weight: 700; }
.dd-note { display: block; font-size: 15px; font-weight: 400; color: var(--ink-2); }
a.btn { text-decoration: none; }
@media (max-width: 560px) {
  .choices { grid-template-columns: 1fr 1fr; gap: 8px; }
  .choice span { min-height: 56px; padding: 10px 10px 10px 40px; }
  .choice span::before { left: 12px; top: 13px; }
  .choice b { font-size: 18px; }
  .choice small { font-size: 14px; }
  #list-items li { grid-template-columns: 1fr auto auto; gap: 6px 10px; }
  .rm { grid-column: auto; justify-self: end; min-height: 48px; padding: 0 4px; }
}
@media print {
  :root, :root[data-theme="dark"] { color-scheme: light; --paper: #fff; --card: #fff; --ink: #000; --ink-2: #333; --line: #999;
    --line-2: #666; --accent: #1E5B45; --ok: #1E5B45; --ok-wash: #fff; --warn: #000; --warn-wash: #fff; --stop: #000; --stop-wash: #fff; }
  .theme, .trust, .example { display: none !important; }
}
