/* Affordability and refinance break-even calculators (site-src/tools.py, assets/js/tools.js).
   Builds on .calc, .form-card, .calc-out and .calc-lines from site.css. */
.tool .calc-out .small { color: var(--muted-dark); }
.tool .calc-out > .eyebrow:not(:first-child) { margin-top: 0.5rem; }
.tool .calc-lines dt { min-width: 0; }
.tool .calc-lines dd { white-space: nowrap; text-align: right; }
.tool-scenario { display: grid; gap: 0.75rem; min-width: 0; }
.tool-scenario + .tool-scenario { border-top: 1px solid var(--line-dark); padding-top: 1.25rem; }
.tool-scenario .calc-total { font-size: var(--step-3); }
.tool-rule { color: var(--muted-dark); font-weight: 400; }
.tool-sum dt, .tool-sum dd { color: #fff; font-weight: 600; }
.tool-note { margin: 0; color: #fff; font-size: var(--step--1); line-height: 1.45; }
.tool .calc-out .btn { max-width: 100%; white-space: normal; }
@media (max-width: 420px) {
  .tool .calc-lines div { gap: 0.75rem; }
  .tool .calc-out .btn { width: 100%; }
}

/* Buying power by town, transfer tax and MA vs NH (session 2) */
.tool .calc-out a:not(.btn) { color: var(--teal); }
.calc.tool-wide { grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); }
@media (max-width: 1000px) { .calc.tool-wide { grid-template-columns: minmax(0, 1fr); } }
.bp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.bp-out .table-scroll { border: 1px solid var(--line-dark); border-radius: 12px; }
.bp-table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: 0.95rem; }
.bp-table th, .bp-table td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--line-dark); color: #fff; }
.bp-table thead th { font-weight: 500; font-size: 0.85rem; color: var(--muted-dark); vertical-align: bottom; }
.bp-table td.num { text-align: right; white-space: nowrap; }
.bp-table thead th:not(:first-child) { text-align: right; }
.bp-table tbody tr:last-child th, .bp-table tbody tr:last-child td { border-bottom: 0; }
.bp-table td[data-out="price"] { font-weight: 600; }
.bp-out .chip { background: transparent; color: #fff; border-color: var(--line-dark); }
.bp-out .chip[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: var(--ink); }
.bp-out .table-scroll { background: transparent; }

/* Payoff calculator (session 5, Build S5-6) */
.po-out .tool-note { font-weight: 600; }
.po-sched { border: 1px solid var(--line-dark); border-radius: 12px; }
.po-sched summary { cursor: pointer; padding: 0.7rem 0.9rem; color: #fff; font-weight: 600; }
.po-sched .table-scroll { border: 0; border-top: 1px solid var(--line-dark); border-radius: 0 0 12px 12px; max-height: 22rem; overflow: auto; }
.po-sched .bp-table { min-width: 24rem; }
.po-sched .bp-table td { text-align: right; }
/* Tables on a light background (NH property tax calculator town table): dark text, light lines. */
.table-scroll:not(.bp-out .table-scroll) > .bp-table th, .table-scroll:not(.bp-out .table-scroll) > .bp-table td { color: var(--text); border-bottom-color: var(--line); }
.table-scroll:not(.bp-out .table-scroll) > .bp-table thead th { color: var(--muted); }

/* Session 6: digits don't jump as inputs change */
.calc-out, .tool table td, .bp-table td { font-variant-numeric: tabular-nums; }

/* Every NH town's tax rate table (property tax page, session 8) */
.nhr-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: end; margin-bottom: 1rem; }
.nhr-filters .nhr-count { grid-column: 1 / -1; margin: 0; }
@media (max-width: 760px) { .nhr-filters { grid-template-columns: minmax(0, 1fr); } }
.nhr-scroll { max-height: 36rem; overflow: auto; }
.nhr-scroll thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
