/* The rent-or-buy page: it borrows the calculator's styles, so only a few touches live here (the audience switch is in base.css). */
.rb-table th[scope="row"] { font-weight: 400; text-align: left; }
.rb-table tr.total th, .rb-table tr.total td { font-weight: 700; }
.rb-table tr.info th, .rb-table tr.info td { color: var(--ink-muted); }
.house-name h3 { margin: 0; padding: 2px 0; border-bottom: 1px dotted var(--baseline); }

/* "Your deal" as a fork: one person, one pool of cash, two paths. Each lane shows where the money goes and where it ends up. */
.fork { display: grid; gap: 6px; }
.fork-you { display: grid; grid-template-columns: minmax(170px, 300px) minmax(0, 1fr); gap: 20px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; }
.fork-you .figure.photo { width: 100%; max-width: 300px; height: 150px; object-fit: contain; display: block; margin: 0 auto; }
.fork-you h3 { margin: 0 0 2px; font-size: 0.98rem; font-weight: 700; }
.fork-you .sub-copy { margin: 2px 0 12px; }
.fork-you .input-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); text-align: left; }
/* the two lanes share three rows (arrow, card, result), so the cards and the results line up whatever the text in each */
.fork-lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto 1fr auto; column-gap: 16px; row-gap: 6px; }
.fork-lane { display: contents; }
.fork-lane > .flow-arrow { grid-row: 1; } .fork-lane > .flow-house { grid-row: 2; } .fork-lane > .lane-end { grid-row: 3; }
.fork-lane.buy > * { grid-column: 1; } .fork-lane.rent > * { grid-column: 2; }
.fork .sub-copy { color: var(--ink-2); font-size: 0.8rem; }
.fork h3 { font-size: 0.98rem; font-weight: 700; }
.fork-lane .flow-arrow { display: flex; flex-direction: column; align-items: center; row-gap: 0; align-self: auto; }
.fork-lane .flow-arrow .entries { flex-direction: row; flex-wrap: wrap; justify-content: center; align-self: auto; gap: 6px 18px; }
.fork-lane .flow-arrow svg { width: 70px; max-width: 70px; transform: rotate(90deg); margin-block: 21px; }       /* the same arrow, turned to point down into the lane */
.fork-lane .flow-house { flex: 1; }
.fork-lane .flow-house .sub-copy { margin: 2px 0 10px; }
.fork-lane .flow-house .input-grid.compact { grid-template-columns: 1fr; max-width: 220px; margin: 0 auto; text-align: left; }
.fork-lane.buy .flow-house { border-top: 4px solid var(--accent-property); } .fork-lane.rent .flow-house { border-top: 4px solid var(--accent-market); }
.fork-lane .flow-house .net { margin-block: 12px 0; }
.lane-end { text-align: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.lane-end .lbl { font-size: 0.78rem; color: var(--ink-muted); }
.lane-end strong { display: block; font-size: 1.45rem; font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.lane-end.buy strong { color: var(--accent-property); } .lane-end.rent strong { color: var(--accent-market); }
.lane-end .sub { font-size: 0.8rem; color: var(--ink-2); }
.lane-end .lead { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 99px; font-size: 0.78rem; font-weight: 600; color: #fff; }
.lane-end.buy .lead { background: var(--accent-property); } .lane-end.rent .lead { background: var(--accent-market); }
.lane-end.ahead { box-shadow: 0 0 0 2px currentColor inset; }
.lane-end.buy.ahead { color: var(--accent-property); } .lane-end.rent.ahead { color: var(--accent-market); }
.lane-end.ahead .lbl, .lane-end.ahead .sub { color: var(--ink-2); }
.fork .entry[hidden] { display: none; }
@media (max-width: 860px) {
  .fork-you { grid-template-columns: 1fr; gap: 10px; }
  .fork-lane { display: flex; flex-direction: column; gap: 6px; }
  .fork-you .figure.photo { height: 110px; }
  .fork-you .input-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fork-lanes { display: grid; grid-template-columns: 1fr; grid-template-rows: none; gap: 18px; }
}
@media (max-width: 560px) { .fork-you .figure.photo { height: 72px; } .fork-lane .flow-house .figure.photo { height: 72px; } }
/* growth, the market and the stay sit under the deal, because the two lanes' results depend on them */
.mkt-row .input-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: none; }
@media (max-width: 860px) { .mkt-row .input-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .mkt-row .input-grid { grid-template-columns: 1fr; } }
.band { scroll-margin-top: 58px; }                                  /* a header link lands with the section's heading just below the sticky header */
/* the two checkboxes under the growth row: the field sits beside the box while it is ticked */
.rb-toggles { margin-top: 16px; gap: 12px 36px; }
.rb-toggles .toggle-item { flex-direction: row; align-items: flex-end; flex-wrap: wrap; gap: 8px 16px; }
.rb-toggles .toggle-item .field { width: 150px; }
.rb-toggles .toggle-item .toggle { padding-bottom: 8px; }
/* part three: the budget card, the break-even table, the rate strip and the points card */
.app .rb-note { margin: 14px 0 0; padding-left: 12px; border-left: 3px solid var(--border); max-width: 80ch; font-size: 0.86rem; line-height: 1.55; color: var(--ink-2); }
.app .rb-note:empty { display: none; }
.afford-card { padding: 16px 18px; }
.afford-top { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 8px 22px; align-items: end; }
.afford-top .input-grid.compact { grid-template-columns: 1fr; }
.afford-top .sub-copy { color: var(--ink-2); font-size: 0.8rem; margin: 0; }
.afford-help { margin-top: 14px; border-top: 1px solid var(--grid); }
.afford-help > summary { cursor: pointer; padding: 12px 0 4px; font-size: 0.88rem; font-weight: 600; color: var(--brand); }
.afford-help-body { display: grid; gap: 12px; padding-top: 8px; }
.afford-help-body .input-grid.compact { grid-template-columns: repeat(2, minmax(0, 220px)); }
.afford-help-body .note { font-size: 0.8rem; color: var(--ink-muted); line-height: 1.5; max-width: 80ch; }
.afford-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.afford-row { margin-top: 14px; }
#rbPointsFields, #finPointsFields { grid-template-columns: repeat(2, minmax(0, 200px)); }
.rb-break td.words { font-size: 0.84rem; color: var(--ink-2); line-height: 1.45; min-width: 230px; }
.rb-strip tr.now th, .rb-strip tr.now td { font-weight: 700; background: var(--surface); }
.rb-break th[scope="row"], .rb-strip th[scope="row"] { white-space: nowrap; }
@media (max-width: 700px) { .afford-top { grid-template-columns: 1fr; } .afford-help-body .input-grid.compact, #rbPointsFields { grid-template-columns: 1fr; } }
.app .afford-row + .snapshot-take, .app .afford-card .snapshot-take { margin-top: 14px; }
.app .stat-row + .snapshot-take { margin-top: 20px; }                                              /* the usual gap between the cards and the sentence under them */
.rb-break thead th:first-child, .rb-break thead th:last-child, .rb-strip thead th:first-child { text-align: left; }
/* on a phone the tables keep the columns that matter, so nothing hides off to the side: the break-even words carry the numbers, the strip keeps rate, cost and result */
@media (max-width: 600px) {
  .rb-break th:nth-child(2), .rb-break td:nth-child(2), .rb-break th:nth-child(3), .rb-break td:nth-child(3) { display: none; }
  .rb-break td.words { min-width: 0; }
  .rb-strip th:nth-child(3), .rb-strip td:nth-child(3), .rb-strip th:nth-child(4), .rb-strip td:nth-child(4) { display: none; }
}
.app .afford-guide { margin: 12px 0 0; font-size: 0.86rem; color: var(--ink-2); }
/* the paid part: a fixed example, blurred, under the unlock card (the card is taller than the table when there is no loan, so the block keeps a minimum height) */
/* the box is as tall as the unlock card (and its padding), no taller: the blurred example fills that box and is cut off at its edge, so a locked block does not push the page down by the height of a whole table */
.rb-paid.paywall { display: grid; }
.rb-paid.paywall > .paywall-content, .rb-paid.paywall > .paywall-overlay { grid-area: 1 / 1; min-width: 0; }
.rb-paid.paywall > .paywall-content { contain: size; overflow: hidden; }          /* it takes no part in the box's height, so the card alone sets it */
.rb-paid.paywall > .paywall-overlay { position: relative; padding-top: 38px; }          /* room above the card for the "Example" tag */
.rb-paid-content .section:last-child { margin-bottom: 0; }
.app .rb-paid-status { margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rb-paid-status[hidden], .rb-paid-status .btn[hidden] { display: none; }
/* loan choices: two offers side by side, each with its own fields */
.offers-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin-bottom: 14px; }
.offers-grid .input-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.offers-grid h4 { margin: 0 0 6px; }
.rb-terms tr.now th, .rb-terms tr.now td { font-weight: 700; background: var(--surface); }
@media (max-width: 700px) { .offers-grid { grid-template-columns: 1fr; } .offers-grid .input-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 460px) { .offers-grid .input-grid.compact { grid-template-columns: 1fr; } }
/* compare homes: the save row and the saved chips */
.cmp-save { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.cmp-save .input-grid.compact { grid-template-columns: minmax(200px, 320px); }
.cmp-saved { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cmp-saved:empty { display: none; }
.cmp-chip { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 99px; font-size: 0.82rem; background: var(--surface); }
.cmp-chip span { color: var(--ink-muted); }
.cmp-chip .linklike { font-size: 0.8rem; }
.rb-cmp tr.now th, .rb-cmp tr.now td { font-weight: 700; background: var(--surface); }
.rb-cmp th[scope="row"] { white-space: nowrap; }
/* the first column, the home's name, stays in view while the other columns scroll sideways, so a figure is never separated from the home it belongs to (the rental calculator's comparison table does the same) */
.rb-cmp thead th:first-child, .rb-cmp tbody th[scope="row"], table.cmp thead th:first-child, table.cmp tbody th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--surface-raised); box-shadow: 1px 0 0 var(--grid); }
.rb-cmp thead th:first-child, table.cmp thead th:first-child { z-index: 2; }
.rb-cmp tbody th[scope="row"], table.cmp tbody th[scope="row"] { min-width: 11.5rem; max-width: 14rem; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }   /* a name of about 20 characters fits on one line; a longer one wraps instead of being cut off */
@media (max-width: 600px) { .rb-cmp tbody th[scope="row"], table.cmp tbody th[scope="row"] { min-width: 0; max-width: 6.5rem; } }        /* on a phone the name leaves room for the widest figure beside it */
#rbCmpPaid .chart-wrap { margin-bottom: 14px; }
@media (max-width: 600px) { .rb-cmp th:nth-child(3), .rb-cmp td:nth-child(3), .rb-cmp th:nth-child(5), .rb-cmp td:nth-child(5), .rb-cmp th:nth-child(7), .rb-cmp td:nth-child(7), .rb-cmp th:nth-child(8), .rb-cmp td:nth-child(8) { display: none; } }
.app .afford-card .note { margin-top: 10px; font-size: 0.8rem; line-height: 1.5; color: var(--ink-muted); max-width: 80ch; }
.rb-cmp { font-size: 0.82rem; }
.rb-cmp thead th { white-space: normal; vertical-align: bottom; }
.rb-cmp th, .rb-cmp td { padding: 9px 6px; }
/* tabs: the loan choices, and the break-evens with the rate strip */
.rb-tabs { display: flex; flex-wrap: wrap; gap: 2px 20px; border-bottom: 1px solid var(--grid); margin: 0 0 18px; }
.rb-tabs button { font: inherit; font-size: 0.9rem; font-weight: 600; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 9px 1px; color: var(--ink-2); cursor: pointer; }
.rb-tabs button:hover { color: var(--ink); }
@media (max-width: 640px) {                                                                         /* the tabs stay on one line and slide sideways, with a fade where there is more */
  .rb-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 2px 22px; scrollbar-width: none; -webkit-overflow-scrolling: touch; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 28px; }
  .rb-tabs::-webkit-scrollbar { display: none; }
  .rb-tabs button { flex: none; white-space: nowrap; padding: 13px 1px; }
}
.rb-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.rb-tabs button:focus-visible { outline: 2px solid var(--accent-property); outline-offset: 2px; border-radius: 4px; }
.rb-tabs button[hidden] { display: none; }
.rb-panel.is-off { display: none; }
.rb-panel > .section-head:first-child { margin-top: 0; }
.cta-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.section[id] { scroll-margin-top: 70px; }                         /* a link such as #loans lands with the heading just below the sticky header */
/* the unlock cards over the two blurred blocks are the short version: what it is, the price and the button (the full list of what one purchase includes is on the report and rental cards) */
.rb-paid .paywall-card .upsell { display: none; }
/* the card over a blurred example is the short version: the title, the price and the button, with tighter spacing */
.rb-paid .paywall-card { padding: 18px 22px; }
.rb-paid .paywall-card h3 { margin-bottom: 4px; }
.rb-paid .paywall-card > p { margin-bottom: 8px; }
.rb-paid .paywall-card ul.inside { margin-bottom: 8px; gap: 4px; }
.rb-paid .paywall-card .price-tag { margin: 6px 0 0; }
.rb-paid .paywall-card .included { margin-top: 8px; }
.rb-paid .paywall-card .unlock-btn { margin-top: 8px; }
.rb-paid .paywall-card .fine-print { margin-top: 8px; font-size: 0.75rem; }
.rb-paid .paywall-card .restore { margin-top: 6px; }
/* the one-line version of a locked block: what it is, what unlocks it, and a link to the full example */
.locked-line { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; color: var(--ink-2); font-size: 0.88rem; line-height: 1.4; }
.locked-line[hidden] { display: none; }
.locked-line svg { flex: none; width: 14px; height: 14px; color: var(--ink-muted); }
.locked-line .locked-text { flex: 1; min-width: 0; }
.locked-line .linklike { flex: none; font-weight: 600; }
.app .afford-guide a { color: var(--accent-property); font-weight: 600; text-decoration: none; }
#rbAdvPanel .note a { color: var(--accent-property); font-weight: 600; text-decoration: none; }
#rbAdvPanel .note a:hover { text-decoration: underline; }
.app .afford-guide a:hover { text-decoration: underline; }
#rbSaveFold { border-top: none; margin-top: 0; }
#rbSaveFold > summary { padding-top: 2px; }
.fork-you .name-field { margin-top: 12px; max-width: 360px; text-align: left; }
.fork-you .name-field input { width: 100%; }

.afford-row + .card { margin-top: 14px; }
.fork-you .state-field { margin-top: 12px; max-width: 420px; text-align: left; }
.state-row { display: flex; gap: 8px; }
.state-row select { flex: 1 1 auto; min-width: 0; }
.state-row input[type="text"] { flex: 0 0 8.5em; width: 8.5em; font: inherit; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background-color: var(--surface); color: var(--ink); }
.state-row input[hidden] { display: none; }
.fork-you .state-field select, #advancedPanel .state-field select, #rbAdvPanel .state-field select { width: 100%; font: inherit; padding: 11px 34px 11px 12px; border: 1px solid var(--border); border-radius: 10px; background-color: var(--surface); color: var(--ink); }
.app .fork-you .state-field .note, .app #advancedPanel .state-field .note, .app #rbAdvPanel .state-field .note { margin-top: 6px; font-size: 0.78rem; line-height: 1.5; color: var(--ink-muted); }
.app .fork-you .state-field .note:empty, .app #advancedPanel .state-field .note:empty, .app #rbAdvPanel .state-field .note:empty { display: none; }
#advancedPanel .state-field, #rbAdvPanel .state-field { grid-column: span 2; }                       /* in the property tax group, beside the tax rate */
.cmp-pick { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; color: var(--ink-muted); }
.fin-deal-head { margin-top: 26px; }
.fin-strip { margin-top: 14px; }
details.detail-fold { border: none; margin: 12px 0 0; }
details.detail-fold:last-of-type { border-bottom: none; }
details.detail-fold > summary { justify-content: flex-start; gap: 8px; padding: 6px 2px; font-family: inherit; font-size: 0.88rem; font-weight: 600; color: var(--ink-2); }
details.detail-fold > summary::after { margin-left: 2px; }
.detail-body { padding: 2px 0 6px; }
.detail-body > .card, .detail-body > .snapshot-take { margin-top: 10px; }
.detail-body > .snapshot-take:first-child, .detail-body > .card:first-child { margin-top: 4px; }
.note-more { font: inherit; background: none; border: none; padding: 0; color: var(--accent-property); text-decoration: underline; cursor: pointer; }
.note-more:focus-visible { outline: 2px solid var(--accent-property); outline-offset: 2px; }
.advanced-panel .mkt-row { margin-top: 0; padding-top: 0; border-top: none; margin-bottom: 16px; }
.afford-card > .afford-help:first-child { margin-top: 0; border-top: none; }

/* the "i" beside the heading of a locked section: what the unlock would add there, on hover, focus or tap (only for a visitor without an unlock) */
.head-info { display: none; position: relative; margin-left: 6px; vertical-align: 1px; }
.is-free .head-info { display: inline-block; }
.head-i { width: 17px; height: 17px; padding: 0; border-radius: 50%; border: 1px solid var(--baseline); background: transparent; color: var(--ink-muted); font: italic 600 0.68rem/1 Georgia, serif; text-transform: none; letter-spacing: normal; cursor: help; }
.head-i:hover, .head-i:focus-visible, .head-info.open .head-i { color: var(--page); background: var(--ink-2); border-color: var(--ink-2); }
.head-i:focus-visible { outline: 2px solid var(--accent-property); outline-offset: 2px; }
.head-bubble { position: absolute; z-index: 6; left: -8px; top: calc(100% + 8px); width: min(340px, 78vw); padding: 10px 12px; border-radius: 8px; background: var(--ink); color: var(--page); font-size: 0.78rem; line-height: 1.45; font-weight: 400; text-transform: none; letter-spacing: normal; text-align: left;
  box-shadow: 0 6px 20px rgba(0,0,0,.18); opacity: 0; visibility: hidden; transform: translateY(-3px); transition: opacity .12s, transform .12s, visibility .12s; pointer-events: none; }
.head-info:hover .head-bubble, .head-info:focus-within .head-bubble, .head-info.open .head-bubble { opacity: 1; visibility: visible; transform: none; }
@media (max-width: 640px) { .head-bubble { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; z-index: 30; font-size: 0.84rem; padding: 12px 14px; } }

/* a softer edge: the blurred example fades out at the bottom of its box, so the cut looks intended */
.rb-paid.paywall > .paywall-content { -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%); mask-image: linear-gradient(to bottom, #000 62%, transparent 100%); }
.head-info.rate-i { display: inline-block; }                  /* the rate's own "i" is for everyone, not only for a visitor without an unlock */
.rate-note { margin-left: 8px; font-size: 0.78rem; font-weight: 500; color: var(--ink-muted); }              /* "Updated to today's average: 7.40%" beside the rate field */
/* the one-line locked version answers a hover, and "See an example" looks like something to press */
.locked-line { transition: background .12s, border-color .12s; }
.locked-line:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); border-style: solid; }
.locked-line .linklike { padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-raised); text-decoration: none; white-space: nowrap; }
.locked-line .linklike:hover { border-color: var(--ink-2); }
/* keyboard focus is visible on everything small in an unlock card and in the one-line version */
.locked-line .linklike:focus-visible, .paywall-card .included summary:focus-visible, .paywall-card .linklike:focus-visible, .paywall-card a:focus-visible { outline: 2px solid var(--accent-property); outline-offset: 2px; border-radius: 6px; }
/* phones: the unlock button fills the card, and the tag is a little smaller */
@media (max-width: 560px) { .rb-paid .paywall-card .unlock-btn { width: 100%; } .paywall::before { font-size: 0.64rem; padding: 1px 7px; } }
.fin-deal-head h3 { font-size: 0.7rem; }
