/* The stylesheet the redesigned calculator pages share. The Musk net-worth page is the reference:
   a form beside a result, the answer read in five seconds, the detail behind disclosures, and the
   article underneath in the same panels as everywhere else. Every rule here is scoped to the
   .calc-page body class, so nothing in the file can reach a page that has not been given it, and
   nothing already in styles.css is redefined — only what these pages need on top of it.

   This file replaces the per-page copy the first two redesigned pages each carry (musk-net-worth.css
   and coffee-vs-investing.css). Those pages are deliberately left alone: neither is touched here, so
   the rules they already have are still the rules they use. */

.calc-page main > .page-title p { max-width: 68ch; }

/* The form is the narrower column and the result the wider one, as on the reference page: the
   answer carries a card, a set of figures and at least one disclosure. */
.calc-page .calc-calculator { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
.calc-page .calc-calculator .field input,
.calc-page .calc-calculator .field select { min-width: 0; }
.calc-page .calc-calculator .hint { font-size: 0.85rem; line-height: 1.5; }

/* A second heading inside a panel — "Your work" under "The purchase" — one step down from the
   panel's own h2 rather than a second heading of the same rank. */
.calc-page .calc-sub-heading { font-size: 0.95rem; margin: 20px 0 12px; }

/* What the calculation is and is not, on the foot of the form rather than in the article. */
.calc-page .calc-form-foot { font-size: 0.85rem; color: var(--muted); margin: 16px 0 0; }

/* The headline figure sits left rather than centred, so the label, the figure and the sentence it
   was worked out from read as one statement rather than three centred lines. */
.calc-page .calc-results .big-result { text-align: left; padding: 24px; }
.calc-page .calc-results .big-result .value { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.15; margin: 8px 0 12px; }
.calc-page .calc-results .big-result .sub { font-size: 0.95rem; line-height: 1.5; opacity: 1; }

/* The secondary figure shown at full size beside the answer, on one line under the card. */
.calc-page .calc-summary { margin: 0 0 12px; font-size: 1rem; }
.calc-page .calc-summary strong { font-size: 1.25rem; }
.calc-page .calc-summary span { color: var(--muted); }

/* "What this means", quieter than the figures it explains. */
.calc-page .calc-meaning { color: var(--muted); font-size: 0.9rem; margin: 0 0 18px; }
.calc-page .calc-meaning strong { color: var(--text); }

/* The one picture the page carries, with its reading underneath it. */
.calc-page .calc-timeline { margin: 24px 0; }
.calc-page .calc-timeline h3,
.calc-page .calc-disclosure-body h3 { margin: 0 0 8px; font-size: 1rem; }
.calc-page .calc-scale-key { font-size: 0.82rem; color: var(--muted); margin: 0 0 14px; }
.calc-page .calc-timeline .bar-caption { font-size: 0.9rem; margin: 12px 0 0; }

/* The detail figures, one closed row each: a visitor can stop at the answer and open only what
   they want. The same disclosure the reference page uses. */
.calc-page .calc-disclosure { border-top: 1px solid var(--border); }
.calc-page .calc-disclosure summary { cursor: pointer; font-weight: 600; padding: 14px 0; line-height: 1.5; min-height: 48px; }
.calc-page .calc-disclosure summary:focus-visible { outline: 2px solid var(--highlight); outline-offset: 3px; border-radius: 4px; }
.calc-page .calc-disclosure-body { padding: 0 0 12px; }
.calc-page .calc-support-text { font-size: 0.9rem; color: var(--muted); margin: 0 0 12px; }

/* The article below: its own headings one step down from the section heading, and the lines of
   prose held to a comfortable measure. */
.calc-page .calc-article h3 { font-size: 1.05rem; margin: 22px 0 8px; }
.calc-page .calc-article p { max-width: 78ch; }
.calc-page .calc-article caption { text-align: left; color: var(--muted); font-size: 0.85rem; padding-bottom: 10px; }
.calc-page .calc-article th[scope="row"] { text-align: left; font-weight: 600; }
/* The formula keeps the spacing it was written with, but a narrow column wraps it instead of
   scrolling it, because these are whole equations rather than fragments. */
.calc-page .calc-article .formula { white-space: normal; overflow-wrap: anywhere; }
.calc-page .scroll-x:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }

@media (max-width: 800px) {
  .calc-page .calc-calculator { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .calc-page .calc-results .big-result { padding: 18px; }
  .calc-page .calc-article th,
  .calc-page .calc-article td { min-width: 100px; }
}
