/* Aktuari group pages: cohort tables, findings, the top-100 fate bars, downloads. Tokens: base.css. */

.eyebrow {
  margin: 0 0 0.5rem;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}
.eyebrow a {
  color: inherit;
}

.page > section + section {
  margin-top: 2.2rem;
}

/* Group tables: label column left, figures right, tabular serif numerals. */
.groups,
.fate {
  border-top: 2px solid var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
}
.groups thead th,
.fate thead th {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  font-weight: 600;
  vertical-align: bottom;
}
.groups td,
.fate td,
.groups thead th + th,
.fate thead th + th {
  text-align: right;
}
.groups th[scope="row"],
.fate th[scope="row"] {
  font-weight: 400;
}
.groups td,
.fate td,
.fate th[scope="row"] {
  white-space: nowrap;
}
/* Table notes sit below the scrolling box so they wrap to the column, never scroll out of view. */
.scroll + .caption {
  margin: 0;
  max-width: var(--wide);
}
.groups small {
  color: var(--ink-3);
  font-size: 0.85em;
  margin-left: 0.25em;
}
.muted {
  color: var(--ink-3);
  font-style: italic;
}
.test,
.downloads {
  font-size: 0.92rem;
  color: var(--ink-2);
}
.scroll + .test,
.caption + .test {
  margin-top: 0.6rem;
}
@media (max-width: 560px) {
  .groups,
  .fate {
    font-size: 0.88rem;
  }
  .groups th,
  .groups td,
  .fate th,
  .fate td {
    padding-right: 0.55rem;
  }
  .groups small {
    display: block;
    margin-left: 0;
  }
  /* The inactive count stays on each group page; phones keep the four columns that fit. */
  .groups .opt {
    display: none;
  }
  .groups th[scope="row"] {
    white-space: nowrap;
  }
}

/* Sibling groups: a quiet index of links. */
.siblings {
  margin-top: 2.4rem;
  border-top: 1px solid var(--rule);
  padding-top: 0.8rem;
  max-width: var(--wide);
}
.siblings h2 {
  font-size: 1.05rem;
}
.siblings ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: none;
  font-variant-numeric: tabular-nums;
}
.siblings a {
  display: inline-block;
  padding: 0.3rem 0;
}
.siblings a[aria-current="page"] {
  font-weight: 600;
  text-decoration: none;
}

/* Findings: numbered cards with a hairline each. */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: finding;
  border-top: 2px solid var(--ink);
}
.card {
  counter-increment: finding;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  column-gap: 0.4rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}
.card::before {
  content: counter(finding, upper-roman) ".";
  grid-row: span 2;
  color: var(--ink-3);
  font-variant-caps: all-small-caps;
}
.card > a {
  font-weight: 600;
}
.card p {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-2);
}

/* Two small plates side by side on a finding page. */
.multiples {
  display: grid;
  gap: 0 2.5rem;
  max-width: var(--wide);
  margin-bottom: 1.6rem;
}
@media (min-width: 720px) {
  .multiples {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.plate.small .km-narrow {
  display: block;
}
.plate.small figcaption a {
  color: inherit;
}

/* Fate bars: active and inactive keep their semantic colours; everything else is grey. */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.4rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: var(--ink-2);
  max-width: none !important;
}
.swatch {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 0.45em;
  vertical-align: -0.05em;
}
.swatch-active,
.bars-active {
  background: var(--active);
  fill: var(--active);
}
.swatch-inactive,
.bars-inactive {
  background: var(--inactive);
  fill: var(--inactive);
}
.swatch-other,
.bars-other {
  background: var(--rule);
  fill: var(--rule);
}
.bars {
  display: block;
  width: 100%;
  height: auto;
  font-variant-numeric: tabular-nums lining-nums;
}
.bars-narrow {
  display: none;
}
@media (max-width: 560px) {
  .bars-wide {
    display: none;
  }
  .bars-narrow {
    display: block;
  }
}
.bars-grid {
  stroke: var(--rule);
  stroke-width: 1;
}
.bars-tick,
.bars-label {
  fill: var(--ink-3);
}
.bars-label {
  fill: var(--ink-2);
}
.bars rect {
  stroke: var(--paper);
  stroke-width: 1;
}

.feedback pre {
  overflow-x: auto;
  max-width: var(--measure);
  padding: 0.6rem 0.8rem;
  background: var(--paper-2);
  border-left: 2px solid var(--ink-3);
  font-size: 0.85rem;
}
.feedback h3 {
  font-size: 1.05rem;
  margin: 1.4rem 0 0.4rem;
}
