/*
 * Dosing Arithmetic. Slate on light grey, one indigo accent, a two-column worksheet.
 *
 * The layout carries a decision rather than a preference: the caveat rail sits beside the answer
 * on a wide screen so the disclosure is visible at the moment the figure is. On a narrow screen
 * it moves above the supporting prose, which preserves the ordering - figure, limits, then
 * explanation - rather than pushing the limits to the bottom where nobody reads them.
 *
 * No cards, no shadows, no gradients, no rounded panels, no animation. Rules and spacing do the
 * work. Nothing here is shared with any other site in the network.
 */

:root {
  --slate: #1a1e27;
  --slate-2: #4a5160;
  --slate-3: #777f8e;
  --page: #f4f5f8;
  --panel: #ffffff;
  --hair: #dcdfe7;
  --hair-2: #b5bbc8;
  --indigo: #3b4a9c;
  --indigo-2: #2b3878;
  --caution: #6d4b00;

  --u: 1rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--slate);
  font: 400 16.5px/1.62 "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

.da-skip { position: absolute; left: -9999px; }
.da-skip:focus {
  left: 0.5rem; top: 0.5rem; z-index: 6;
  background: var(--panel); border: 2px solid var(--indigo); padding: 0.3rem 0.6rem;
}

a { color: var(--indigo-2); }
a:hover { color: var(--indigo); }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }

.da-shell { width: 100%; max-width: 62rem; margin: 0 auto; padding: 0 1.1rem; }

/* ---------------------------------------------------------------- the band */

.da-band { background: var(--slate); color: #eef0f5; }
.da-band-inner {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  align-items: baseline;
  justify-content: space-between;
}
.da-brand {
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.da-brand span {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: #a9b1c4;
  letter-spacing: 0;
}
.da-brand:hover { color: #fff; text-decoration: underline; }
.da-sections { display: flex; flex-wrap: wrap; gap: 0 1.1rem; font-size: 0.9rem; }
.da-sections a { color: #c8cedd; text-decoration: none; padding: 0.15rem 0; }
.da-sections a:hover { color: #fff; text-decoration: underline; }
.da-sections a[aria-current="page"] { color: #fff; font-weight: 600; border-bottom: 2px solid var(--indigo); }

/* ---------------------------------------------------------------- headings */

main { padding: 2rem 0 2.6rem; }

h1 {
  margin: 0 0 0.45rem;
  font-size: 1.8rem;
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.012em;
}
.da-opening { margin: 0 0 0.5rem; font-size: 1.05rem; color: var(--slate-2); max-width: 44rem; }
.da-oneline {
  margin: 0 0 1.6rem;
  font-size: 0.86rem;
  color: var(--caution);
}

/* ---------------------------------------------------------------- the split */

.da-split { display: grid; gap: 1.6rem; align-items: start; }
@media (min-width: 58rem) {
  .da-split { grid-template-columns: minmax(0, 1fr) 18rem; gap: 2.2rem; }
}
.da-work { min-width: 0; }
.da-rail { min-width: 0; }

.da-after { margin-top: 2.2rem; max-width: 44rem; }
.da-part { margin: 0 0 1.9rem; }
.da-part h2 { margin: 0 0 0.5rem; font-size: 1.15rem; font-weight: 600; }
.da-part h3 { margin: 1.1rem 0 0.3rem; font-size: 0.98rem; font-weight: 600; }
.da-part p, .da-derivation p { margin: 0 0 var(--u); }
code { font-family: inherit; font-weight: 600; background: #e8eaf1; padding: 0 0.2em; }

/* ---------------------------------------------------------------- the worksheet */

/*
 * NOT A CARD. An independent design pass on the sibling site in this network flagged a form and
 * its answer packaged as a bordered two-part panel, which the design standard rules out by
 * default. The enclosure is gone here for the same reason: the indigo rule down the left of the
 * inputs marks the worksheet, and a single hairline separates the answer from them.
 */
.da-sheet { margin: 0 0 1.6rem; }
.da-cells { padding: 0.9rem 0 0.9rem 0.9rem; display: grid; gap: 0.7rem; border-left: 4px solid var(--indigo); }
@media (min-width: 40rem) { .da-cells { grid-template-columns: 1fr 1fr; gap: 0.7rem 1.1rem; } }
.da-cell { min-width: 0; }
.da-cell > label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.2rem; }
.da-pairing { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem; }
.da-aside { margin: 0.2rem 0 0; font-size: 0.78rem; color: var(--slate-3); }

.da-sheet input, .da-sheet select {
  width: 100%;
  min-width: 0;
  font: 400 1rem/1.3 inherit;
  padding: 0.42rem 0.5rem;
  border: 1px solid var(--hair-2);
  background: var(--panel);
  color: var(--slate);
  border-radius: 2px;
}
.da-sheet input:focus, .da-sheet select:focus { border-color: var(--indigo); }
.da-pairing select { width: auto; }

.da-readout { padding: 1rem 0 0.6rem; border-top: 1px solid var(--hair-2); }
.da-pending { margin: 0; color: var(--slate-3); font-size: 0.92rem; }
.da-declined { margin: 0; font-weight: 600; color: #93301a; }
.da-nojs { margin: 0; padding: 0.9rem 0; border-top: 1px solid var(--hair); font-size: 0.9rem; }

.da-figures { display: grid; gap: 1rem; }
@media (min-width: 46rem) { .da-figures { grid-template-columns: 3fr 2fr; gap: 1.6rem; } }
.da-figure-label { margin: 0; font-size: 0.8rem; color: var(--slate-2); }
/*
 * ONE LEAD FIGURE, AND THE QUALIFIER IS PART OF IT. Both are fixes an independent design pass
 * confirmed on the sibling site: equally emphasised figures compete for the reader's attention
 * when the page is about one of them, and an "about" set small beside a large number can be
 * lifted out of the reading without being noticed, which is precisely what the qualifier exists
 * to prevent.
 */
.da-figure-value {
  margin: 0.1rem 0 0;
  font-size: 1.2rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.da-figure-lead .da-figure-value { font-size: 2.1rem; }
.da-approx { font-size: 0.85rem; font-weight: 600; color: var(--caution); letter-spacing: 0; }
.da-figure-lead .da-approx { font-size: 1.35rem; }
.da-figure-unit { font-size: 0.85rem; font-weight: 400; color: var(--slate-2); margin-left: 0.3rem; }
.da-figure-note { margin: 0.2rem 0 0; font-size: 0.84rem; color: var(--slate-2); }

.da-curve { display: block; width: 100%; height: auto; margin: 1rem 0 0; }
.da-curve .da-axis { stroke: var(--hair-2); stroke-width: 1; }
.da-curve .da-plot { fill: none; stroke: var(--indigo); stroke-width: 2; }
.da-curve text { font-size: 10px; fill: var(--slate-3); }

.da-series { margin-top: 1rem; }
.da-assumptions { margin: 1rem 0 0; font-size: 0.84rem; color: var(--caution); }
.da-assumptions p { margin: 0 0 0.2rem; font-weight: 600; }
.da-assumptions ol { margin: 0; padding-left: 1.3rem; }
.da-assumptions li { margin-bottom: 0.25rem; }

/* ---------------------------------------------------------------- derivation */

.da-derivation {
  margin: 0 0 1.6rem;
  padding: 1rem 0 0.2rem;
  border-top: 1px solid var(--hair-2);
}
.da-derivation h2 { margin: 0 0 0.5rem; font-size: 1.05rem; font-weight: 600; }
.da-derivation ol { margin: 0; padding-left: 1.3rem; }
.da-derivation li { margin-bottom: 0.5rem; }

/* ---------------------------------------------------------------- the rail */

/*
 * The caveat block, in the rail. Set smaller than the body text but not greyed out: a disclosure
 * in a lighter colour than the content it qualifies has been decorated into the background, which
 * is the opposite of the intention.
 */
.da-limits {
  background: var(--panel);
  border-left: 4px solid var(--caution);
  padding: 0.9rem 1rem;
  font-size: 0.86rem;
}
.da-limits h2 { margin: 0 0 0.45rem; font-size: 0.95rem; font-weight: 600; }
.da-limits p { margin: 0 0 0.55rem; color: var(--slate-2); }
.da-limits p:last-child { margin-bottom: 0; }
.caveat-links { color: var(--slate-3); }

/* ---------------------------------------------------------------- rows and tables */

.da-rows { margin: 0 0 1.6rem; padding: 0; list-style: none; }
.da-rows li {
  display: grid;
  gap: 0.1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--hair);
}
@media (min-width: 44rem) {
  .da-rows li { grid-template-columns: 15rem minmax(0, 1fr); gap: 1rem; align-items: baseline; }
}
.da-rows a { font-weight: 600; text-decoration: none; }
.da-rows a:hover { text-decoration: underline; }
.da-rows span { font-size: 0.88rem; color: var(--slate-2); }

.da-grid { overflow-x: auto; margin: 0 0 1.6rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.87rem; background: var(--panel); }
caption { text-align: left; padding: 0 0 0.45rem; font-size: 0.83rem; color: var(--slate-2); }
th, td { padding: 0.33rem 0.5rem; text-align: right; border-bottom: 1px solid var(--hair); }
th[scope="col"] { border-bottom: 2px solid var(--slate); font-weight: 600; }
th[scope="row"] { text-align: left; font-weight: 600; white-space: nowrap; }
thead th:first-child { text-align: left; }

/* ---------------------------------------------------------------- notices */

.da-notice { max-width: 40rem; }
.da-notice h2 { margin: 1.8rem 0 0.5rem; font-size: 1.1rem; font-weight: 600; }
.da-notice h2:first-child { margin-top: 0; }
.da-notice p { margin: 0 0 var(--u); line-height: 1.72; }

/* ---------------------------------------------------------------- footer */

.da-foot {
  background: var(--slate);
  color: #b9c0d0;
  padding: 1.8rem 0 2.6rem;
  font-size: 0.84rem;
}
.da-foot a { color: #dfe4ef; }
.da-stamp p { margin: 0 0 0.6rem; max-width: 50rem; }
.da-foot-nav { margin-top: 1.3rem; display: grid; gap: 1rem; }
@media (min-width: 40rem) { .da-foot-nav { grid-template-columns: 1fr 1fr; } }
.da-foot-nav ul { margin: 0; padding: 0; list-style: none; }
.da-foot-nav li { margin-bottom: 0.2rem; }
