/* Lifetime sleep — page-specific presentation.

   The shell, panels, hero, wordmark, tiles, result actions, related cards and Cozy's pick come from
   styles.css, calc-page.css and results.css. This file only adds what the sleep page needs: a
   single-column fact stack that fills its card, the formula block in words rather than an
   ornamental equation, the source list and the six-tile results grid. Everything is scoped to
   .sleep-page so no other calculator inherits it. */

.sleep-page .sleep-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sleep-page .sleep-tiles .stat .hint {
  margin-top: 4px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
}
.sleep-page .sleep-tiles .stat .label,
.sleep-page .sleep-tiles .stat .value { overflow-wrap: anywhere; }

/* The bar already comes from styles.css; the caption under it carries the same split in words. */
.sleep-page .calc-timeline { margin: 24px 0 0; }
.sleep-page .calc-timeline .bar-caption { margin: 12px 0 0; }

/* One fact per full-width horizontal row at every width: a single column, the standard quiet
   orange edge and the page's normal card, never a multi-column grid or a sideways rail. */
.sleep-page .calc-info .fact-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.sleep-page .calc-info .fact {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border-left: 3px solid var(--highlight);
  border-radius: 12px;
  background: var(--accent);
}
.sleep-page .calc-info .fact h3 { margin: 0 0 6px; font-size: 0.95rem; line-height: 1.45; }
.sleep-page .calc-info .fact p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: normal;
  overflow-wrap: break-word;
}

/* The formulas are whole sentences rather than fragments, so they wrap inside the card instead of
   scrolling sideways on a phone. */
.sleep-page .formula {
  display: block;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-left: 3px solid var(--highlight);
  border-radius: 0 10px 10px 0;
  background: var(--accent);
  font-size: 0.84rem;
  line-height: 1.9;
  white-space: normal;
  overflow-wrap: anywhere;
}
.sleep-page .formula code { font: inherit; }

.sleep-page .sleep-sources { padding-left: 20px; }
.sleep-page .sleep-sources li { margin-bottom: 8px; overflow-wrap: break-word; }
.sleep-page .sleep-sources a { color: var(--primary); font-weight: 600; }

/* The page's tables read as tables rather than as columns of figures: the label starts at the
   left edge, and only a numeric last column is right-aligned. */
.sleep-page table th,
.sleep-page table td { text-align: left; }
.sleep-page table th:last-child,
.sleep-page table td:last-child { text-align: right; }
.sleep-page table caption { text-align: left; }

@media (max-width: 760px) {
  .sleep-page .sleep-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 430px) {
  .sleep-page .calc-info .fact { padding: 12px 14px; }
}
