.calc { display: grid; grid-template-columns: 1.05fr 1fr; gap: 18px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumb-link { color: var(--accent-strong); text-decoration: none; font-weight: 600; }
.crumb-link:hover { text-decoration: underline; }
.crumb-sep { color: var(--muted); }
.calc-title { font-size: 24px; font-weight: 800; margin: 0 0 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; box-shadow: var(--shadow); }
.field { margin-bottom: 11px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input { width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 9px; padding: 10px 12px; font-size: 16px; font-weight: 600; color: var(--text); }
[data-theme="dark"] .field input { background: rgba(255,255,255,.06); }
.field select { width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 9px; padding: 10px 12px; font-size: 16px; font-weight: 600; color: var(--text); }
[data-theme="dark"] .field select { background: rgba(255,255,255,.06); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.adv { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.adv summary { font-size: 14px; font-weight: 700; color: var(--accent-strong); cursor: pointer; }
.btn-calc { width: 100%; margin-top: 16px; background: var(--accent); color: #fff; border: none;
  border-radius: 10px; padding: 14px; font-size: 16px; font-weight: 800; cursor: pointer; }
.result .big-label { font-size: 13px; color: var(--muted); }
.result .big { font-size: 40px; font-weight: 800; color: var(--accent-strong); margin: 4px 0 14px; }
.breakdown-bar { width: 100%; height: 16px; border-radius: 8px; overflow: hidden; display: block; margin-bottom: 12px; }
.legend .row { display: flex; justify-content: space-between; padding: 7px 0;
  border-bottom: 1px solid var(--border); font-size: 14px; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }
.actions { display: flex; gap: 10px; margin-top: 12px; }
.actions button { flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 10px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.ad-slot { border: 1px dashed var(--border); border-radius: 10px; color: var(--muted);
  text-align: center; padding: 16px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; margin-top: 14px; }
.explain { margin-top: 18px; }
.explain h3 { font-size: 16px; margin: 0 0 8px; }
.explain p { color: var(--muted); line-height: 1.6; font-size: 14px; }
.explain-block { margin-top: 16px; }
.explain-block h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin: 0 0 8px; }
.formula { font-family: "Cambria Math", Georgia, "Times New Roman", serif; font-size: 17px;
  color: var(--text); background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px;
  line-height: 1.5; overflow-x: auto; }
.example { font-size: 14px; line-height: 1.8; color: var(--muted); }
.example b { color: var(--text); font-weight: 700; }
.example .step { font-family: "Cambria Math", Georgia, serif; }
.conv-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.conv-table td { padding: 5px 10px; border-bottom: 1px solid var(--border); }
.conv-table td:first-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.conv-table td:last-child { color: var(--muted); width: 60%; }
.pair-related { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.pair-related a { color: var(--accent-strong); text-decoration: none; font-size: 14px; font-weight: 600; }
.pair-related a:hover { text-decoration: underline; }
.conv-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.conv-chips a { display: inline-block; padding: 9px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--accent-strong);
  font-size: 14px; font-weight: 600; text-decoration: none; box-shadow: var(--shadow); }
.conv-chips a:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }

@media (max-width: 720px) {
  .calc { grid-template-columns: 1fr; }
  .result .big { font-size: 34px; }
}

.schedule { margin-top: 14px; }
.schedule summary { font-size: 13px; font-weight: 700; color: var(--accent-strong); cursor: pointer; }
.schedule-scroll { max-height: 320px; overflow: auto; margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; }
.schedule-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.schedule-table th, .schedule-table td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--border); }
.schedule-table th:first-child, .schedule-table td:first-child { text-align: left; }
.schedule-table thead th { position: sticky; top: 0; background: var(--surface); }
.payoff-callout { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.payoff-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.payoff-value { font-size: 26px; font-weight: 800; color: var(--accent-strong); margin: 2px 0; }
.payoff-value span { font-size: 14px; font-weight: 600; color: var(--muted); }
.payoff-sub { font-size: 13px; color: var(--text); }

/* The print report is a document-style summary, hidden on screen, shown only on print. */
#print-report { display: none; }

@media print {
  @page { margin: 12mm; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; background: #fff !important; }
  .shell { max-width: none; padding: 0; }
  /* Always hide pure site chrome. */
  .search, .nav-pills, .nav-dropdown, .theme-toggle, .actions, .ad-slot, footer { display: none !important; }
  /* Report pages (config-driven calculators): hide the interactive calc, show the document. */
  .has-print-report .header, .has-print-report .crumb, .has-print-report .calc-title,
  .has-print-report .calc, .has-print-report .explain, .has-print-report .schedule { display: none !important; }
  .has-print-report #print-report { display: block; color: #1a1a1a;
    font-family: -apple-system, 'Segoe UI', Arial, sans-serif; }
  /* Bespoke pages (no report): keep the result, just clean it up so print isn't blank. */
  body:not(.has-print-report) .btn-calc { display: none !important; }
  body:not(.has-print-report) .card { box-shadow: none !important; border: 1px solid #ccc; }

  .pr-head { display: flex; justify-content: space-between; align-items: center;
    background: #12314f; color: #fff; padding: 16px 22px; border-radius: 6px; }
  .pr-brand { font-size: 21px; font-weight: 800; letter-spacing: .3px; }
  .pr-brand span { color: #7fd0f0; }
  .pr-doc { text-align: right; }
  .pr-title { font-size: 14px; font-weight: 600; }
  .pr-date { font-size: 11px; opacity: .85; margin-top: 2px; }

  .pr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 26px; }
  .pr-section h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
    color: #12314f; border-bottom: 2px solid #12314f; padding-bottom: 6px; margin: 0 0 12px; }
  .pr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .pr-table td { padding: 8px 0; border-bottom: 1px solid #e4e4e4; }
  .pr-table td:first-child { color: #555; }
  .pr-table td:last-child { text-align: right; font-weight: 700; color: #111; }
  .pr-headline { font-size: 36px; font-weight: 800; color: #0284c7; margin: 2px 0 14px; }
  .pr-note { font-size: 11px; color: #555; margin-top: 12px; line-height: 1.55; }

  .pr-foot { margin-top: 30px; padding-top: 10px; border-top: 1px solid #ccc;
    display: flex; justify-content: space-between; gap: 20px; font-size: 10px; color: #777; }
  .pr-block { margin-top: 24px; break-inside: avoid; }

  /* Debt Payoff report tables. */
  .pr-debts { width: 100%; border-collapse: collapse; font-size: 12px; }
  .pr-debts th, .pr-debts td { padding: 6px 8px; border-bottom: 1px solid #e4e4e4; text-align: right; }
  .pr-debts th:first-child, .pr-debts td:first-child { text-align: left; }
  .pr-debts thead th { color: #12314f; border-bottom: 1.3px solid #12314f; }
  .pr-compare { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
  .pr-compare th, .pr-compare td { padding: 8px; border-bottom: 1px solid #e4e4e4; text-align: right; }
  .pr-compare th:first-child, .pr-compare td:first-child { text-align: left; color: #555; }
  .pr-compare thead th { color: #12314f; border-bottom: 1.5px solid #12314f;
    font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
  .pr-compare tbody td { font-weight: 700; color: #111; }

  /* Amortization appendix: hidden unless the user ticked "include schedule". */
  .pr-schedule { display: none; }
  .print-schedule .pr-schedule { display: block; break-before: page; }
  .pr-schedule h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
    color: #12314f; border-bottom: 2px solid #12314f; padding-bottom: 6px; margin: 0 0 12px; }
  .pr-sched-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 22px; }
  .pr-sched-table { width: 100%; border-collapse: collapse; font-size: 10.5px; break-inside: avoid; }
  /* 6 mini-tables (2 bands × 3 cols = 120 months) per page → a 30-yr loan spans 3 pages. */
  .pr-sched-table:nth-child(6n+1):not(:first-child) { break-before: page; }
  .pr-sched-table th { text-align: right; border-bottom: 1.3px solid #12314f; padding: 4px 5px; color: #12314f; }
  .pr-sched-table th:first-child { text-align: left; }
  .pr-sched-table td { text-align: right; padding: 3px 5px; border-bottom: 1px solid #eee; }
  .pr-sched-table td:first-child { text-align: left; color: #555; }
}

.sched-opt { display: flex; align-items: center; gap: 8px; margin-top: 10px;
  font-size: 13px; color: var(--muted); cursor: pointer; }
.sched-opt[hidden] { display: none; }

/* Debt Payoff: the two strategies stack vertically in the result column. */
.dp-compare { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 6px; }
/* Compact debt-row controls so values fit the narrower entry column. */
.debt-row label { font-size: 11px; margin-bottom: 3px; }
.debt-row input { font-size: 14px; padding: 8px 9px; }
.debt-row .removeRowBtn { padding: 8px 10px; font-size: 13px; align-self: end; }
.dp-col { position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 15px; }
.dp-col.dp-win { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.dp-badge { position: absolute; top: -10px; right: 12px; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.dp-strat { font-size: 14px; font-weight: 700; }
.dp-free { font-size: 30px; font-weight: 800; color: var(--accent-strong); margin: 2px 0; }
.dp-note { font-size: 12px; color: var(--muted); }
.dp-int { font-size: 13px; margin-top: 10px; }
.dp-order { margin-top: 10px; }
.dp-orow { display: flex; justify-content: space-between; font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.dp-verdict { margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--accent-strong); line-height: 1.5; }
