/* Styles for the personal loan calculator only.

   Everything is scoped to .loan-page, the body class the page carries, so no rule here can reach
   another calculator. Colours, radii and spacing are the tokens from styles.css, and the result
   hero, tiles, explorer and disclosure surfaces come from results.css — this file adds the parts
   that are specific to this page: the stacked facts, the source list, and the few narrow-screen
   guards the loan figures need. */

/* ---------------------------------------------------------------- Fun facts */

/* One wide reading card per row at every width. The grid is explicitly a single column rather than
   an auto-fit one, so a visitor never gets two facts side by side on a tablet or four narrow
   columns on a desktop. Each card keeps the quiet orange edge the reference pages use. */
.loan-page .calc-info .fact-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.loan-page .calc-info .fact {
  min-width: 0;
  padding: 14px 16px;
  border-left: 3px solid var(--highlight);
  border-radius: 12px;
  background: var(--accent);
  overflow-wrap: break-word;
}
.loan-page .calc-info .fact h3 { margin: 0 0 6px; font-size: 0.95rem; line-height: 1.45; }
.loan-page .calc-info .fact p { margin: 0; font-size: 0.88rem; line-height: 1.6; }

/* ---------------------------------------------------------------- Method */

/* The old #how deep link still lands on the method section. */
.loan-page .loan-anchor { display: block; height: 0; overflow: hidden; }

.loan-page .loan-sources { margin: 12px 0 0; padding-left: 20px; }
.loan-page .loan-sources li { margin-bottom: 8px; line-height: 1.55; }
.loan-page .loan-sources a { color: var(--primary); }
.loan-page .loan-sources a:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- Narrow screens */

/* Three legend entries sit side by side on a desktop; on a phone they wrap instead of forcing the
   text to a character a line. */
.loan-page .legend { flex-wrap: wrap; gap: 6px 14px; }
.loan-page .legend span { min-width: 0; }

/* "Today / Paid off in 3 yrs 11 mos / 5 years" is wider than a 320px phone allows, so the three
   marks stack rather than pushing the page sideways. */
.loan-page .rp-ruler-marks { flex-wrap: wrap; }
.loan-page .rp-ruler-marks span { min-width: 0; overflow-wrap: break-word; }

/* A long fee label ("Account keeping (60 months × $10.00)") wraps inside its cell. */
.loan-page .fee-table td { overflow-wrap: anywhere; }

/* The yearly table is the one wide element on the page: it scrolls inside its own box rather than
   pushing the whole page sideways. The wrapper is focusable in the markup so it can be scrolled
   with the keyboard. */
.loan-page .table-wrap { max-width: 100%; overflow-x: auto; }
.loan-page .table-wrap:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }
.loan-page .table-wrap table { min-width: 320px; }

/* The three derived figures under the repayment wrap onto their own lines before any digit breaks. */
.loan-page .rp-hero-split > span { min-width: 0; }
.loan-page .rp-tiles .stat { min-width: 0; }

/* Three tiles read as one row wherever there is room for it, rather than two and a stray third. */
@media (min-width: 641px) {
  .loan-page .rp-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
