/* Styles that only the offset account page needs.

   The shared shell, panels, hero (.rp-hero), stat tiles (.rp-tiles), result actions,
   disclosures, related cards and Cozy's pick come from styles.css and results.css. This file
   adds the fact strips, the three-tile row, the two-row interest comparison, the scrollable
   tables and the method lists. Everything is scoped to .offset-page, so no rule here can reach
   another calculator. */

/* ---------------------------------------------------------------- The fun facts */

/* Four full-width strips, one under the other at every width. */
.offset-page .calc-info .fact-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.offset-page .calc-info .fact {
  min-width: 0;
  padding: 14px 16px;
  border-left: 3px solid var(--highlight);
  border-radius: 0 12px 12px 0;
  background: var(--accent);
}
.offset-page .calc-info .fact h3 { margin: 0 0 6px; font-size: 0.95rem; line-height: 1.4; }
.offset-page .calc-info .fact p { margin: 0; font-size: 0.9rem; line-height: 1.55; }

/* ---------------------------------------------------------------- Three tiles */

/* The hero carries the interest saved, so the supporting row is exactly three figures. */
.offset-page .offset-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 760px) {
  .offset-page .offset-tiles { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- Interest comparison */

/* Two lines instead of a stacked bar: the same interest measured with and without the offset.
   The shorter bar is the saving, and both figures are written beside their bars so colour is
   never the only signal. */
.offset-page .offset-compare { display: grid; gap: 10px; margin: 14px 0 0; }
.offset-page .offset-compare-row {
  display: grid;
  grid-template-columns: minmax(88px, 132px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.offset-page .offset-compare-label { font-size: 0.85rem; color: var(--muted); }
.offset-page .offset-compare-track {
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  overflow: hidden;
}
.offset-page .offset-compare-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--rest);
  transition: width 220ms ease;
}
.offset-page .offset-compare-fill.is-offset { background: var(--highlight); }
.offset-page .offset-compare-value {
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .offset-page .offset-compare-row { grid-template-columns: minmax(0, 1fr) auto; }
  .offset-page .offset-compare-label { grid-column: 1 / -1; }
  .offset-page .offset-compare-value { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  .offset-page .offset-compare-fill { transition: none; }
}

/* ---------------------------------------------------------------- The tables */

/* Each table scrolls inside its own wrapper, so the page itself never overflows sideways on a
   phone. The wrapper is focusable in the markup, which makes the scroll keyboard-reachable, and
   the header sticks while a long schedule scrolls under it. */
.offset-page .offset-table-wrap {
  max-width: 100%;
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.offset-page .offset-table-wrap:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }
.offset-page .offset-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}
.offset-page .offset-table th,
.offset-page .offset-table td { padding: 8px; text-align: right; white-space: nowrap; }
.offset-page .offset-table th { white-space: normal; }
.offset-page .offset-table th:first-child,
.offset-page .offset-table td:first-child { min-width: 3.5rem; text-align: left; }
.offset-page .offset-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.offset-page .offset-table tbody tr + tr td { border-top: 1px solid var(--border); }
.offset-page .offset-caption {
  caption-side: top;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
}

/* ---------------------------------------------------------------- The method */

.offset-page .offset-assumptions,
.offset-page .offset-sources { margin: 12px 0 0; padding-left: 20px; }
.offset-page .offset-assumptions li,
.offset-page .offset-sources li { margin-bottom: 8px; line-height: 1.55; }
.offset-page .offset-sources a { color: var(--primary); }
.offset-page .offset-sources a:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 3px;
  border-radius: 4px;
}
