/* Page-specific presentation for the flatmate vs living alone calculator.
 *
 * Everything here is scoped to .flatmate-page and leans on the shared tokens and result pieces
 * in styles.css and results.css. The rule that must never be softened is the fact list: a single
 * column of full-width rows at every width, including desktop, as the page's plan requires.
 */

/* ---------------------------------------------------------------- The five approved facts */

/* One fact under the other, each reading right across the panel: a long horizontal row rather
   than a crowded grid or a sideways rail. The orange edge is the site's own accent, and the tint
   is the same quiet accent the rest of the prose sections use. */
.flatmate-page #facts .fact-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.flatmate-page #facts .fact {
  width: 100%;
  min-width: 0;
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--highlight);
  border-radius: 0 12px 12px 0;
  background: var(--accent);
}

.flatmate-page #facts .fact h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  line-height: 1.45;
}

.flatmate-page #facts .fact p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

/* ---------------------------------------------------------------- The result hero and tiles */

.flatmate-page .flat-live .sub {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Four supporting figures under the hero. A long currency amount or the break-even sentence
   wraps inside its tile instead of pushing the row wider than the panel. */
.flatmate-page .flat-tiles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flatmate-page .flat-tiles .stat .label,
.flatmate-page .flat-tiles .stat .value {
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- The two comparison tables */

/* The tables keep their real numbers rather than hiding a column on a phone: they scroll
   sideways inside .scroll-x, which is focusable so the keyboard can reach the whole table. */
.flatmate-page .scroll-x .fee-table {
  min-width: 420px;
}

.flatmate-page .scroll-x .fee-table th,
.flatmate-page .scroll-x .fee-table td {
  white-space: nowrap;
}

.flatmate-page .scroll-x:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- The method and sources */

.flatmate-page .sources-heading {
  margin-top: 20px;
}

.flatmate-page .source-list {
  margin: 10px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  font-size: 0.88rem;
  line-height: 1.55;
}

.flatmate-page .source-list li {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

/* The Reset button sits under the last input, at the width of the form it resets. */
.flatmate-page .flat-reset {
  width: 100%;
  margin-top: 14px;
}

/* ---------------------------------------------------------------- Narrow screens */

@media (max-width: 900px) {
  .flatmate-page .flat-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .flatmate-page .flat-tiles {
    grid-template-columns: minmax(0, 1fr);
  }
}
