:root {
  --ink: #22372e;
  --muted: #65776e;
  --green: #145d40;
  --lime: #d7f097;
  --purple: #7961aa;
  --border: #dce5dd;
  --paper: #f6f8f2;
  --white: #fff;
  --orange: #bd8146;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
.table-wrap:focus-visible {
  outline: 3px solid #9272c4;
  outline-offset: 3px;
}
.topbar {
  min-height: 89px;
  padding: 18px max(24px, calc((100vw - 1220px) / 2));
  display: flex;
  gap: 22px;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  gap: 10px;
  text-decoration: none;
  font-size: 25px;
  font-weight: 750;
  line-height: 1;
}
.mark {
  display: block;
  flex: 0 0 37px;
  height: 37px;
  width: 37px;
}
.brand-sub {
  display: block;
  font-size: 9px;
  letter-spacing: 2.5px;
  margin-top: 6px;
}
.preview,
.state {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 5px 9px;
  border-radius: 5px;
  background: #eee9f5;
  color: #675184;
}
.top-note {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
main {
  max-width: 1220px;
  margin: auto;
  padding: 0 24px;
}
.intro {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: center;
  padding: 49px 0 34px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.6px;
  color: var(--green);
  margin: 0 0 12px;
}
h1 {
  font-size: clamp(30px, 3.4vw, 45px);
  line-height: 1.17;
  letter-spacing: -1.5px;
  margin: 0 0 16px;
  font-weight: 650;
}
h1 span {
  color: var(--green);
}
.intro-text {
  font-size: 15px;
  color: var(--muted);
  max-width: 540px;
  margin: 0;
}
.intro-note {
  max-width: 260px;
  font-size: 12px;
  padding: 20px;
  border-left: 1px solid var(--border);
}
.intro-note strong {
  font-size: 12px;
}
.intro-note p {
  margin: 8px 0 0;
  color: var(--muted);
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 7px;
}
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 24px;
  align-items: start;
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 27px;
  box-shadow: 0 3px 10px #173e2410;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 23px;
}
.section-title .eyebrow {
  margin-bottom: 8px;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  margin: 0;
  font-weight: 650;
}
h3 {
  font-size: 15px;
  margin: 0 0 8px;
}
.currency {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 8px;
  white-space: nowrap;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 19px 16px;
}
.fields label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 600;
  gap: 7px;
}
.full {
  grid-column: 1/-1;
}
input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid #ccd9d0;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fafcf8;
  min-height: 46px;
  font-size: 16px;
  font-weight: 500;
}
small {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.45;
}
.fee-details {
  margin: 23px 0;
}
summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  padding: 5px 0;
}
.fee-details .fields {
  padding-top: 16px;
}
.primary {
  border: 0;
  border-radius: 9px;
  background: var(--green);
  color: white;
  width: 100%;
  padding: 15px 19px;
  font-weight: 650;
  text-align: left;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.primary:hover {
  background: #0b4530;
}
.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 10px;
  color: var(--muted);
}
.text-button {
  border: 0;
  padding: 8px 0;
  background: transparent;
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.result-card {
  background: #e9f1e4;
  border-color: #d6e2cd;
  padding: 28px;
}
.payment-label {
  font-size: 13px;
  color: #455c4d;
  margin-top: 15px;
}
.payment {
  font-size: clamp(40px, 4.5vw, 60px);
  letter-spacing: -2px;
  font-weight: 650;
  line-height: 1.25;
  margin: 6px 0;
}
.payment-detail {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 28px;
  min-height: 18px;
}
.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px 18px;
  border-top: 1px solid #cddbc6;
  padding-top: 25px;
}
.metrics span {
  display: block;
  font-size: 11px;
  color: #506958;
  margin-bottom: 5px;
}
.metrics strong {
  font-size: 21px;
  letter-spacing: -0.4px;
}
.outlay-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 20px;
}
.cost-bar {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  height: 9px;
  margin-top: 23px;
}
.cost-bar span:first-child {
  background: var(--green);
}
.cost-bar span:nth-child(2) {
  background: var(--purple);
}
.cost-bar span:nth-child(3) {
  background: var(--orange);
}
.legend {
  display: flex;
  gap: 18px;
  font-size: 10px;
  margin-top: 9px;
  color: var(--muted);
}
.legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
}
.capital {
  background: var(--green);
}
.interest {
  background: var(--purple);
}
.fees {
  background: var(--orange);
}
.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 25px;
}
.secondary {
  border: 1px solid #bacdbb;
  background: #fff;
  border-radius: 7px;
  padding: 10px 13px;
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  min-height: 40px;
}
.secondary:hover {
  background: #f0f5e9;
}
.draft-card {
  margin-top: 18px;
  padding: 22px 25px;
}
.draft-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.draft-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
  flex-wrap: wrap;
}
.draft-card .status {
  margin-top: 10px;
  color: var(--green);
}
.education-note {
  display: flex;
  gap: 12px;
  padding: 17px 5px;
  font-size: 11px;
  color: var(--muted);
}
.education-note > span {
  font-size: 22px;
  color: var(--purple);
}
.education-note p {
  margin: 0;
}
.comparison,
.schedule {
  margin-top: 24px;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}
.scenario {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 18px;
  background: #fbfcf8;
}
.scenario h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.scenario h3 button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 4px;
}
.scenario .scenario-payment {
  font-size: 27px;
  font-weight: 650;
  margin: 12px 0;
}
.scenario dl {
  font-size: 12px;
  margin-bottom: 0;
}
.scenario dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-top: 1px solid #e6ece2;
}
.scenario dt {
  color: var(--muted);
}
.scenario dd {
  margin: 0;
  text-align: right;
}
.table-wrap {
  overflow: auto;
  max-height: 430px;
  margin-top: 16px;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 12px;
  text-align: right;
}
th {
  background: #f1f5ee;
  position: sticky;
  top: 0;
  font-size: 11px;
}
th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
th:first-child,
td:first-child {
  text-align: left;
}
.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
.method-grid .card {
  padding: 20px 25px;
  box-shadow: none;
}
.method-grid p {
  font-size: 12px;
  color: var(--muted);
}
footer {
  padding: 30px 0 35px;
  color: var(--muted);
  font-size: 11px;
  max-width: 900px;
}
footer strong {
  color: var(--ink);
}
.release-note {
  font-size: 10px;
}
.notice,
.error {
  border-radius: 7px;
  padding: 12px;
  font-size: 12px;
  background: #fff2d5;
  color: #72510c;
  margin-bottom: 20px;
}
.error {
  background: #fff0ed;
  color: #9d3022;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
/* A visible first link works for pointer, touch and keyboard users. */
.skip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0 20px;
  padding: 8px 12px;
  color: var(--green);
  background: #fff;
  font-weight: 600;
}
.skip:focus-visible, .intro-jump a:focus-visible, .legal-links a:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}
#inputs-heading { scroll-margin-top: 20px; }
#inputs-heading:focus { outline: 3px solid var(--green); outline-offset: 5px; }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.legal-links a { display: inline-flex; align-items: center; min-height: 44px; }
.legal-page { max-width: 800px; }
.legal-page h2 { margin-top: 28px; }
.legal-page p { line-height: 1.65; }
[hidden] {
  display: none !important;
}
.print-only {
  display: none;
}
@media (max-width: 800px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .intro-note {
    display: none;
  }
  .intro {
    padding-top: 33px;
  }
  .top-note {
    display: none;
  }
  .topbar {
    padding: 16px 22px;
    justify-content: space-between;
  }
  .comparison-grid {
    grid-template-columns: 1fr;
  }
  .method-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .card {
    padding: 22px;
  }
  .payment {
    font-size: 48px;
  }
  main {
    padding: 0 18px;
  }
  .section-title {
    gap: 8px;
  }
  .state {
    font-size: 8px;
  }
  .form-footer {
    font-size: 9px;
  }
}
@media (max-width: 380px) {
  .fields {
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: auto;
  }
  .result-actions {
    flex-wrap: wrap;
  }
  .metrics strong {
    font-size: 19px;
  }
  .preview {
    font-size: 8px;
  }
  .legend {
    gap: 12px;
  }
  .section-title h2 {
    font-size: 17px;
  }
}
@media print {
  body {
    background: white;
    font-size: 10pt;
    color: #111;
  }
  .topbar {
    padding: 0 0 15px;
    min-height: 0;
  }
  .preview,
  .top-note,
  .intro,
  .inputs,
  .draft-card,
  .result-actions,
  .fee-details,
  .secondary,
  button,
  .education-note,
  .method-grid,
  .release-note,
  .skip {
    display: none !important;
  }
  main {
    max-width: none;
    padding: 0;
  }
  .workspace-grid {
    display: block;
  }
  .card {
    border: 1px solid #bbb;
    box-shadow: none;
    padding: 15px;
    border-radius: 0;
    break-inside: avoid;
  }
  .result-card {
    margin-top: 20px;
    background: white;
  }
  .payment {
    font-size: 36pt;
  }
  .comparison {
    margin-top: 16px;
  }
  .comparison-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .scenario {
    padding: 10px;
  }
  .scenario-payment {
    font-size: 18px !important;
  }
  .schedule {
    display: none;
  }
  .print-only {
    display: block;
    margin-top: 20px;
    font-size: 10pt;
  }
  .print-only p {
    margin: 6px 0;
  }
  footer {
    padding: 15px 0;
  }
  .brand {
    font-size: 20px;
  }
  .section-title {
    margin-bottom: 10px;
  }
  .metrics {
    gap: 12px;
    padding-top: 12px;
  }
  .payment-detail {
    margin-bottom: 12px;
  }
  .cost-bar,
  .legend {
    display: none;
  }
}

/* Reliability pass: a field with an error is visibly marked, not only announced. */
#scenario-form [aria-invalid="true"] { border-color: #b42318; box-shadow: 0 0 0 1px #b42318; }
#compare-heading:focus { outline: none; }
#compare-heading:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
#compare-message { margin: 0 0 16px; }

/* A result that no longer matches the inputs is shown as out of date, never as current. */
body.is-stale #result-content,
body.is-stale #schedule-note,
body.is-stale #schedule-details { opacity: 0.45; }
body.is-stale #payment { text-decoration: line-through; text-decoration-thickness: 2px; }
.print-stale { display: none; }
@media print {
  /* The print shortcut still works while stale: print the warning, not the old figures. */
  body.is-stale .result-card,
  body.is-stale .schedule,
  body.is-stale #print-context { display: none !important; }
  body.is-stale .print-stale {
    display: block; margin: 20px 0; padding: 14px; border: 2px solid #111;
    font-size: 12pt; font-weight: 700; color: #111;
  }
}

/* The input error can sit directly under its field inside the fields grid. */
.fields > #error { grid-column: 1 / -1; margin: 0; }

/* Round 2 applies to the screen only: the print stylesheet above is unchanged. */
@media screen {
/* =========================================================
   Round 2 — layout, touch and readability (no theme system)
   ========================================================= */

/* Money never forces the page wider than the screen. Grid and flex children may
   shrink, amounts use tabular figures, scale with the available width, and wrap
   between groups as a last resort. Nothing is clipped. */
.workspace-grid > *, .fields > *, .metrics > *, .comparison-grid > *, .section-title > * { min-width: 0; }
.payment, .metrics strong, .scenario dd, .scenario .scenario-payment, td, #payment-detail {
  font-variant-numeric: tabular-nums;
}
.payment, .metrics strong, .scenario dd, .scenario .scenario-payment { overflow-wrap: normal; white-space: nowrap; }
/* Figures are sized by the card they sit in (container units), so they fit a
   narrow column at any viewport width. The vw line is the fallback for
   browsers without container queries. */
.result-card, .scenario { container-type: inline-size; }
.payment { font-size: clamp(26px, 9.4vw, 56px); font-size: clamp(26px, 12cqi, 56px); line-height: 1.1; }
.metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr)); }
.metrics strong { display: block; font-size: clamp(15px, 4.6vw, 22px); font-size: clamp(15px, 5.6cqi, 22px); line-height: 1.25; }
.scenario .scenario-payment { font-size: clamp(18px, 6.4vw, 30px); font-size: clamp(18px, 11cqi, 30px); line-height: 1.15; }
.scenario dd { font-size: clamp(12px, 5.6cqi, 14px); }
.scenario dl div { flex-wrap: wrap; column-gap: 12px; }
.scenario dd { margin-left: auto; text-align: right; }
.scenario h3 { align-items: center; gap: 8px; }

/* Touch targets: at least 44px for every button, summary and the brand link. */
.primary, .secondary, .text-button, .scenario h3 button, summary, .brand, select,
#scenario-form input, #guide-months {
  min-height: 44px;
}
.secondary, .text-button, .scenario h3 button { display: inline-flex; align-items: center; justify-content: center; }
.text-button, .scenario h3 button { padding-inline: 10px; }
summary { display: flex; align-items: center; gap: 8px; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "▸"; flex: none; }
details[open] > summary::before { content: "▾"; }
.brand { display: inline-flex; align-items: center; }

/* Readable type: body 15px, supporting text never below 12px (11px for
   upper-case labels with letter-spacing). */
body { font-size: 15px; }
small, .outlay-note, .muted, .education-note p, .draft-card p, .legend, th, footer p, .payment-detail, .status { font-size: 13px; }
.form-footer, .release-note, .scenario dt { font-size: 12px; }
.eyebrow, .state, .preview, .brand-sub, .currency, th { font-size: 11px; }
.intro-note p, .intro-note strong { font-size: 13px; }

/* Calmer hierarchy: one modest page title, less empty space before the form. */
h1 { font-size: clamp(26px, 4.2vw, 40px); line-height: 1.12; margin: 6px 0 10px; }
.intro { padding-top: 28px; padding-bottom: 20px; }
.intro-text { margin: 0; }
.intro-jump { display: block; margin: 12px 0 0; }
.intro-jump a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--green); }
h2.eyebrow { margin: 0; font-weight: 700; }
/* The plain :focus reset comes first: :focus-visible has the same specificity,
   so it must come later to win for keyboard focus. */
h2.eyebrow:focus, #inputs-heading:focus { outline: none; }
h2.eyebrow:focus-visible, #inputs-heading:focus-visible { outline: 3px solid #9272c4; outline-offset: 4px; }
.card-title { font-size: 16px; margin: 0 0 4px; }
.tm { font-size: 0.75em; vertical-align: super; line-height: 0; }
footer strong { font-size: 13px; }
/* The state label stays on one line; it drops under the heading when there is no room. */
.state { white-space: nowrap; }
.result-card .section-title { flex-wrap: wrap; row-gap: 8px; }
#result-heading, #inputs-heading, .result-card { scroll-margin-top: 12px; }

@media (max-width: 800px) {
  .intro { padding-top: 18px; padding-bottom: 14px; }
  .intro .eyebrow { display: none; }
  .intro-text { display: none; }
  .intro-jump { display: block; }
  .card { padding: 18px; }
  main { padding: 0 14px; }
  .state { font-size: 11px; }
  .form-footer { font-size: 12px; }
  .section-title h2 { font-size: 18px; }
}
@media (max-width: 380px) {
  .preview { font-size: 11px; }
  .topbar { gap: 8px; }
}

/* Motion: the only movement is the scroll to the result, and it is instant when
   the user asks for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Round 2 refinements after visual check. */
.section-title h2.eyebrow, h2.eyebrow { font-size: 11px; line-height: 1.5; letter-spacing: 0.14em; }
.metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 420px) {
  /* One metric per row, label left and amount right, so long amounts keep a full line. */
  .metrics { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .metrics > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
  .metrics > div:first-child { border-top: 0; }
  .metrics strong { text-align: right; margin-left: auto; }
}

  /* Persona round 1 (first-time buyer): scope, cost of borrowing, next steps. */
  .scope-note { margin: 10px 0 0; max-width: 62ch; font-size: 14px; line-height: 1.5; color: var(--ink); }
  .scope-note strong { font-weight: 650; }
  .scope-private { max-width: 62ch; }
  .scope-private summary { font-weight: 600; color: var(--green); font-size: 14px; }
  .scope-private p { margin: 0 0 6px; font-size: 14px; line-height: 1.5; }
  .intro-jump { margin-top: 0; }
  .scope-private summary { min-height: 44px; }
  @media (max-width: 800px) { .scope-note { margin-top: 4px; } .intro h1 { margin-bottom: 6px; } }
  .metric-key { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid #cddbc6; }
  .metric-key em { font-style: normal; color: var(--muted); font-weight: 400; }
  .summary-hint { font-weight: 400; color: var(--muted); font-size: 13px; }
  .next-steps { margin-top: 16px; }
  .next-steps p { margin: 0 0 8px; font-size: 14px; }
  .next-steps ul { margin: 0; padding-left: 20px; font-size: 14px; }
  .next-steps li { margin: 4px 0; }
  @media (max-width: 800px) {
    .scope-note { font-size: 13px; }
  }
  @media (max-width: 420px) {
    .metric-key { padding-top: 8px; }
  }
  /* A field brought into view for an error keeps its label on screen. */
  #scenario-form input, #scenario-form select { scroll-margin-top: 56px; scroll-margin-bottom: 16px; }

  /* Persona round 2 (returning comparison buyer). */
  .scenario-label { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
  .scenario-changed { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink); }
  .scenario dt { max-width: 62%; }
  .scenario-diff { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
  .scenario-diff h4 { margin: 0 0 6px; font-size: 13px; font-weight: 650; }
  .scenario-diff ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; }
  .add-status { margin: 10px 0 0; font-size: 13px; color: var(--ink); }

  /* Persona round 3 (broker handoff). */
  .scenario-source { margin: 6px 0 0; padding: 4px 8px; display: inline-block; border-radius: 6px; font-size: 12px; font-weight: 600; background: #efe9f8; color: #4f3c7c; }
  .handoff-note { margin: 0 0 12px; max-width: 78ch; }
  .handoff-note summary { font-weight: 600; font-size: 14px; }
  .handoff-note p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
  .csv-note { margin-top: 6px; }
  /* Free beta fixed-example report. */
  .proposal { margin-top: 24px; border-style: dashed; border-color: #b9a7dc; }
  .proposal-flag, .report-flag { display: inline-block; margin: 0 0 12px; padding: 6px 10px; border-radius: 6px; background: #efe9f8; color: #4f3c7c; font-size: 13px; font-weight: 650; line-height: 1.4; }
  .report-flag { font-size: 12px; letter-spacing: 0.04em; }
  .full-report { margin-top: 22px; padding-top: 18px; border-top: 2px dashed #b9a7dc; }
  .report-head h3 { margin: 0 0 8px; font-size: 22px; }
  .report-head p { max-width: 70ch; }
  .report-head button { margin: 10px 0 4px; }
  #report-stale { margin: 14px 0 0; }
  .report-section { margin-top: 22px; }
  .report-section h4 { margin: 0 0 8px; font-size: 16px; }
  .report-section p, .report-section li { font-size: 14px; line-height: 1.5; max-width: 80ch; }
  .report-section ul { margin: 0 0 8px; padding-left: 20px; }
  .report-checklist { list-style: none; padding-left: 0 !important; }
  .report-checklist li { position: relative; padding: 4px 0 4px 30px; }
  .report-checklist li::before { content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border: 2px solid var(--ink); border-radius: 3px; }
  .report-dl { margin: 0 0 10px; max-width: 640px; }
  .report-dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
  .report-dl dt { color: var(--muted); }
  .report-dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .report-table-wrap { max-height: none; margin: 8px 0; }
  .report-table { font-size: 13px; font-variant-numeric: tabular-nums; }
  .report-table th { position: static; font-size: 13px; }
  .report-table tbody th { background: none; font-weight: 600; }
  .glance-subject { margin: 0 0 8px !important; }
  /* Out-of-date and error notices are the most important text on the page when they show. */
  .notice, .error { font-size: 14px; line-height: 1.45; }
  @media (max-width: 420px) {
    .report-dl > div { flex-direction: column; gap: 2px; }
    .report-dl dd { text-align: left; }
  }
  /* Refinement v1: sample report, first-page summary, pointer from the results. */
  .report-pointer { margin: 12px 0 0; font-size: 14px; }
  .report-pointer a { color: var(--green); font-weight: 600; display: inline-block; padding: 12px 0; min-height: 44px; }
  .sample-panel { margin: 16px 0 4px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--paper); }
  .sample-panel .primary { width: auto; text-align: center; }
  .sample-panel h3 { margin: 0 0 6px; font-size: 17px; }
  .sample-panel p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; max-width: 70ch; }
  .sample-report { margin-bottom: 22px; padding-bottom: 6px; border-bottom: 2px dashed #b9a7dc; }
  #sample-body > p, #sample-body > ul { font-size: 14px; line-height: 1.5; max-width: 80ch; }
  #sample-body > ul { margin: 0 0 8px; padding-left: 20px; }
  #sample-report-heading:focus { outline: none; }
  #sample-report-heading:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
  .full-report h3 { scroll-margin-top: 64px; }
  .report-glance { margin-top: 18px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--paper); }
  .report-glance h4 { margin: 0 0 10px; font-size: 16px; }
  .report-glance p, .report-glance li { font-size: 14px; line-height: 1.5; max-width: 80ch; margin: 0 0 6px; }
  .report-glance ul { margin: 0 0 10px; padding-left: 20px; }
  .glance-label { font-weight: 650; margin-top: 10px !important; }
  .glance-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
  .glance-grid > div { padding: 12px; border-radius: 8px; background: var(--white); border: 1px solid var(--border); min-width: 0; }
  .glance-grid dt { font-size: 13px; color: var(--muted); }
  .glance-grid dd { margin: 4px 0 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .glance-grid dd.glance-detail { font-size: 13px; font-weight: 400; line-height: 1.4; color: var(--ink); }
  @media (max-width: 900px) { .glance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 420px) { .glance-grid { grid-template-columns: 1fr; } .sample-panel button { width: 100%; } }
  /* Refinement v3: one card per scenario in part 5 (no wide table), readable at 320px. */
  .report-scenarios { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 10px; }
  .report-scenario { padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); min-width: 0; }
  .report-scenario h5 { margin: 0 0 6px; font-size: 16px; }
  .report-differs { margin: 0 0 10px !important; font-size: 14px; }
  .report-scenario-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; }
  .report-sub { margin: 0 0 2px !important; font-size: 13px !important; font-weight: 650; letter-spacing: 0.03em; color: var(--muted); }
  .report-scenario .report-dl { max-width: none; margin: 0; }
  .report-dl > div.has-note { flex-wrap: wrap; }
  .report-dl dd.report-dd-note { flex-basis: 100%; white-space: normal; font-size: 13px; color: var(--ink); }
  @media (max-width: 720px) { .report-scenario-columns { grid-template-columns: 1fr; } }
  @media (max-width: 420px) {
    .report-scenario { padding: 12px; }
    /* In a scenario card the label and its short value stay on one line, so a card is half the height. */
    .report-scenario .report-dl > div { flex-direction: row; flex-wrap: wrap; gap: 2px 12px; }
    .report-scenario .report-dl dt { flex: 1 1 auto; }
    .report-scenario .report-dl dd { text-align: right; }
    .report-scenario .report-dl dd.report-dd-note { text-align: right; }
  }
  /* =========================================================
     Feedback round A — align with the current Oney main site
     (tokens and gradient treatment read from oney-website
     index.html and assets/css/oney-v2-shell.css, Nov 2026).
     Screen only; the print stylesheet keeps its own colours.
     ========================================================= */
  :root {
    --ink: #18201d; --muted: #4c5853; --green: #117a50; --purple: #6d5ef5; --border: #d8deda; --paper: #f2f4f3; --white: #fafbfa;
    --g-green: #e1f3ea; --g-purple: #ece8fc; --g-line-a: #22b978; --g-line-b: #6d5ef5; --g-edge-a: #a9ddc4; --g-edge-b: #bdb5f8; --band-purple: #3a2a6b;
  }
  /* The main site's type is Inter Tight. It is named first and used where installed;
     no font file is requested, so the page still makes no external request. */
  body {
    font-family: "Inter Tight", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    background:
      radial-gradient(70% 520px at 88% 0%, var(--g-purple) 0%, transparent 62%) no-repeat,
      radial-gradient(55% 460px at 0% 420px, var(--g-green) 0%, transparent 60%) no-repeat,
      var(--paper);
  }
  .topbar { position: relative; background: var(--white); }
  .topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none; background: linear-gradient(90deg, transparent, var(--g-line-a) 28%, var(--g-line-b) 72%, transparent); opacity: 0.6; }
  h1 { font-weight: 600; letter-spacing: -0.04em; }
  h2 { letter-spacing: -0.02em; }
  .card { border-radius: 16px; background: var(--white); box-shadow: 0 1px 2px rgba(17, 20, 24, 0.04); }
  /* Gradients are for surfaces, hairlines and frames only, never for text. */
  .result-card { border: 1px solid transparent; background: linear-gradient(var(--white), var(--white)) padding-box, linear-gradient(135deg, var(--g-edge-a), var(--g-edge-b)) border-box; box-shadow: 0 18px 42px rgba(17, 20, 24, 0.07); }
  .primary { background: #111815; border-radius: 12px; }
  .primary:hover { background: #26302c; }
  .secondary { border-radius: 12px; }
  .preview, .state, .proposal-flag, .report-flag, .scenario-source { background: var(--g-purple); color: var(--band-purple); }
  .proposal { border-color: var(--g-edge-b); }
  .full-report, .sample-report { border-color: var(--g-edge-b); }
  .sample-panel, .report-glance { border-radius: 12px; }
  /* One focus ring. On a text field it sits against the field's own border, so the
     field reads as one box with a thicker edge, not a box inside a box. */
  button:focus-visible, a:focus-visible, summary:focus-visible, select:focus-visible, .table-wrap:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
  input:focus-visible, select:focus-visible { outline: 2px solid var(--purple); outline-offset: 0; border-color: var(--purple); }
  #scenario-form [aria-invalid="true"]:focus-visible { outline-color: #b42318; border-color: #b42318; }

  /* Hero: title, short intro, one visible boundary line; the rest in disclosures; brand image beside it. */
  .intro { align-items: center; gap: 48px; }
  .intro > div:first-child { flex: 1 1 0; min-width: 0; }
  .hero-visual { flex: 0 0 420px; margin: 0; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid transparent; background: linear-gradient(var(--white), var(--white)) padding-box, linear-gradient(135deg, var(--g-line-a), var(--g-line-b)) border-box; box-shadow: 0 34px 80px -36px rgba(109, 94, 245, 0.45), 0 18px 50px -30px rgba(34, 185, 120, 0.35); }
  .hero-visual img { display: block; width: 100%; height: 100%; object-fit: cover; }
  /* The two disclosures share a row on wide screens; on a phone the second shares a row with the jump link. Either way the form starts no lower than before. */
  .intro-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 20px; }
  .intro-row > details { flex: 0 1 auto; min-width: 0; }
  .intro-row > details[open] { flex-basis: 100%; order: 2; }
  .intro-row .intro-jump { margin: 0; }
  /* On a phone the private-use disclosure keeps a row of its own, as before. */
  @media (max-width: 800px) { .intro-row > details:not(.scope-about) { flex-basis: 100%; } }
  @media (max-width: 1000px) { .hero-visual { flex-basis: 320px; } }
  /* On a phone the same image becomes a shallow ribbon above the title: imagery without pushing
     the form far down. No text sits on it, so there is no contrast to lose. */
  @media (max-width: 800px) {
    .intro { flex-direction: column; align-items: stretch; gap: 12px; }
    .hero-visual { order: -1; flex: none; width: 100%; height: 60px; aspect-ratio: auto; border-radius: 14px; box-shadow: 0 14px 30px -22px rgba(109, 94, 245, 0.5); }
    .hero-visual img { object-position: 60% 62%; }
  }

  /* Balloon: an information note and an optional reference. Neither is an error. */
  .field-note p { margin: 0; }
  .field-note p + p { margin-top: 4px; color: var(--muted); }
  #balloon-figure { font-weight: 600; }
  .field-note { margin: 0; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--g-edge-b); background: var(--g-purple); color: var(--ink); font-size: 14px; line-height: 1.45; }
  .field-ref { margin: 0; }
  .field-ref summary { font-weight: 600; font-size: 14px; }
  .field-ref p { margin: 6px 0 8px; font-size: 14px; line-height: 1.5; color: var(--ink); max-width: 70ch; }
  .field-ref a { color: var(--green); font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
} /* end @media screen (round 2) */

@media print {
  .scope-note, .scope-private, .next-steps { display: none !important; }
}

/* Printed handoff: scope first, no interactive reference widget, no on-screen status notes. */
@media print {
  .topbar { padding-top: 10px !important; }
  section[aria-labelledby="residual-heading"], .handoff-note, .add-status, .compare-note, .csv-note, #compare-message { display: none !important; }
  .scenario-source { display: block; font-weight: 700; border: 1px solid #111; padding: 3px 6px; margin: 4px 0; }
  #print-context h2, #print-scope h2 { font-size: 12pt; margin: 14px 0 6px; break-after: avoid; }
  #print-scope, #print-context { break-inside: avoid; }
  .scenario-diff { break-inside: avoid; }
}


/* The existing Print / PDF sheet is unchanged: the proposal, the simulation and the report preview are not on it. */
@media print {
  .proposal { display: none !important; }
}
/* "Print this report preview" prints the report preview alone, labelled as a simulation. */
@media print {
  body.print-sample > :not(main), body.print-sample main > :not(#report-proposal) { display: none !important; }
  body.print-sample .proposal { display: block !important; border: 0; padding: 0; }
  body.print-sample #report-proposal > :not(#sample-report) { display: none !important; }
  body.print-sample .full-report { display: block; }
  body.print-sample .report-flag { display: block; border: 2px solid #111; padding: 6px 8px; font-weight: 700; font-size: 10pt; margin-bottom: 8px; }
  body.print-sample .report-head h3 { font-size: 16pt; margin: 0 0 6px; }
  body.print-sample .report-section { margin-top: 14px; }
  body.print-sample .report-section h4 { font-size: 12pt; margin: 0 0 6px; break-after: avoid; }
  body.print-sample .report-section p, body.print-sample .report-section li { font-size: 10pt; margin: 3px 0; }
  body.print-sample .table-wrap { overflow: visible; max-height: none; }
  body.print-sample table { white-space: normal; font-size: 9pt; }
  body.print-sample th { position: static; }
  body.print-sample .report-dl > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #ccc; padding: 3px 0; }
  body.print-sample .report-dl dd { margin: 0; }
  body.print-sample .report-checklist { list-style: none; padding-left: 0; }
  body.print-sample .report-checklist li::before { content: "\2610  "; }
  body.print-sample .report-section:not(.report-part-scenarios) { break-inside: avoid; }
}


/* Refinement v1: the pointer to the proposal is not on the printed sheet; the summary prints with the report. */
@media print {
  .report-pointer { display: none !important; }
  body.print-sample .sample-report { border: 0; margin: 0; padding: 0; }
  body.print-sample .report-glance { border: 1px solid #111; padding: 8px; margin-bottom: 10px; break-inside: avoid; }
  body.print-sample .report-glance h4 { font-size: 12pt; margin: 0 0 6px; }
  body.print-sample .glance-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 0 0 6px; }
  body.print-sample .glance-grid dd { margin: 0; font-weight: 700; }
  body.print-sample .glance-grid dd.glance-detail { font-weight: 400; font-size: 9pt; }
  body.print-sample .report-glance p, body.print-sample .report-glance li { font-size: 10pt; margin: 2px 0; }
}

/* Refinement v3: scenario cards and the sample on paper. Each card stays whole; part 5 may run over pages. */
@media print {
  body.print-sample .report-scenarios { display: block; }
  /* The short introduction to part 5 stays in one piece and with its heading and first card. */
  body.print-sample .report-part-scenarios > p { break-after: avoid; break-inside: avoid; }
  body.print-sample .report-part-scenarios > h4 { break-after: avoid; }
  body.print-sample p, body.print-sample li { orphans: 2; widows: 2; }
  body.print-sample .report-scenario { break-inside: avoid; border: 1px solid #777; padding: 8px; margin: 8px 0; }
  body.print-sample .report-scenario h5 { font-size: 11pt; margin: 0 0 4px; }
  body.print-sample .report-scenario-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
  body.print-sample .report-sub { font-weight: 700; font-size: 9pt !important; margin: 2px 0 !important; }
  body.print-sample .report-dl > div { font-size: 9.5pt; }
  body.print-sample .report-dl > div.has-note { flex-wrap: wrap; }
  body.print-sample .report-dl dd.report-dd-note { flex-basis: 100%; text-align: right; font-size: 8.5pt; }
  body.print-sample #sample-body > p, body.print-sample #sample-body > ul { font-size: 10pt; margin: 3px 0; }
  body.print-sample tr { break-inside: avoid; }
  /* Every part of a printed sample says what it is, so no page can be mistaken for a real report. */
  body.print-sample .report-glance::before,
  body.print-sample .report-section::before,
  body.print-sample .report-scenario::before {
    content: "SAMPLE / NOT YOUR FIGURES / NOT A QUOTE"; display: block; margin: 0 0 4px; font-size: 8pt; font-weight: 700; letter-spacing: 0.06em;
  }
  body.print-sample .report-head .report-flag::after { content: "  —  SAMPLE / NOT YOUR FIGURES / NOT A QUOTE"; }
}

/* Feedback round A: the hero image and the balloon note and reference are screen furniture, not part of any printed sheet. */
@media print {
  .hero-visual, .field-note, .field-ref { display: none !important; }
}


/* Optional self-hosted demo: no autoplay and no initial video download. */
.demo { margin: 0 0 24px; }
.demo h2 { margin-top: 0; }
.demo-player { max-width: 640px; margin: 16px auto; }
.demo-load { display: block; position: relative; width: 100%; padding: 0; overflow: hidden; border-radius: 12px; border: 1px solid var(--line, #d7ddda); background: #183e32; color: #fff; cursor: pointer; }
.demo-load img, .demo-player video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 12px; }
.demo-load span { display: block; padding: 12px; font-weight: 700; }
.demo-load:focus-visible { outline: 3px solid #8b63c7; outline-offset: 4px; }
.demo-note { font-size: .875rem; }
@media print { .demo { display: none !important; } }

/* Optional beta feedback: collapsed by default, mail-draft only, never printed. */
.beta-feedback { margin-top: 16px; padding: 14px 22px; }
.beta-feedback summary { color: var(--green); font-size: 14px; }
.beta-feedback form { display: grid; gap: 8px; padding-top: 10px; }
.beta-feedback label { font-weight: 600; font-size: 14px; }
.beta-feedback p { margin: 0; }
.feedback-useful { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.feedback-useful legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 4px; width: 100%; }
.feedback-useful label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; }
.feedback-useful input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--green); }
.beta-feedback textarea { width: 100%; min-width: 0; border: 1px solid #ccd9d0; border-radius: 8px; padding: 11px 12px; color: var(--ink); background: #fafcf8; font: inherit; font-size: 16px; resize: vertical; }
.beta-feedback input[type="email"] { min-height: 44px; }
.beta-feedback [aria-invalid="true"] { border-color: #b42318; }
.beta-feedback textarea:focus-visible { outline: 2px solid var(--purple); outline-offset: 0; border-color: var(--purple); }
.feedback-count { text-align: right; }
.feedback-warning { background: #fff2d5; color: #72510c; border-radius: 7px; padding: 10px 12px; font-size: 13px; }
.beta-feedback .error { margin: 0; }
.beta-feedback .draft-actions { margin-top: 4px; }
#feedback-send { text-decoration: none; }
@media print { .beta-feedback { display: none !important; } }
