@layer stage {
  /* ---- the route as a row of stops ---- */
  .strip, .checks { display: grid; gap: 0.4rem; justify-items: center; }
  .strip-caption { color: var(--ink-2); font-size: 0.875rem; }
  .strip-row { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.6rem; }
  .chip {
    position: relative; min-inline-size: 3rem; padding: 0.3rem 0.6rem; text-align: center;
    border: 0.12rem solid var(--ink); border-radius: 1.2rem; background: var(--sheet);
    font-family: var(--font-num); font-weight: 700; font-size: 1.125rem;
  }
  .chip.is-depot { border-radius: 0.35rem; background: var(--ink); color: var(--sheet); font-family: var(--font-body); font-size: 1rem; }
  .chip.is-middle { background: var(--signal); color: var(--on-signal); }
  /* the leg after each stop */
  .chip:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 100%; inset-block-start: 50%; inline-size: 1.6rem; border-block-start: 0.2rem solid var(--ink-3); margin-inline-start: 0.12rem; }
  .chip.is-cut-after::after { border-block-start: 0.2rem dashed var(--bad); }

  /* ---- the list of moves that were checked ---- */
  .checks-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.35rem; inline-size: 100%; counter-reset: check; }
  .check { counter-increment: check; display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) auto; gap: 0.6rem; align-items: baseline; padding: 0.35rem 0.6rem; border-radius: 0.4rem; background: var(--paper); font-size: 0.9375rem; }
  .check::before { content: counter(check); font-family: var(--font-num); color: var(--ink-3); }
  .check b { font-family: var(--font-num); font-size: 1.15em; }
  .check-verdict { font-weight: 700; white-space: nowrap; }
  .check.is-yes .check-verdict { color: var(--good); }
  .check.is-no .check-verdict { color: var(--ink-2); }
}
@layer stage {
  /* ---- the Held-Karp table filled by hand ---- */
  .hk-panel { max-block-size: 44dvh; overflow-y: auto; }
  table.hk { border-collapse: collapse; margin-inline: auto; font-size: 0.9375rem; }
  table.hk caption { color: var(--ink-2); font-size: 0.875rem; padding-block-end: 0.3rem; }
  table.hk th, table.hk td { border: 0.07rem solid var(--rule); padding: 0.25rem 0.7rem; text-align: center; }
  table.hk thead th { background: var(--paper); position: sticky; inset-block-start: 0; }
  table.hk .hk-layer { text-align: start; background: var(--paper); color: var(--ink-2); font-weight: 400; font-size: 0.875rem; }
  table.hk .hk-how { text-align: start; font-family: var(--font-num); }
  table.hk .hk-how s { color: var(--ink-3); }
  table.hk .hk-best { font-family: var(--font-num); font-size: 1.25rem; font-weight: 700; }
  table.hk tr.is-now td { background: var(--signal); color: var(--on-signal); }
  table.hk tr.is-now .hk-how s { color: var(--on-signal); }
  table.hk tr.is-source td { background: var(--wash); }
  table.hk tr.is-chain td, table.hk tr.is-best td { outline: 0.18rem solid var(--route-hk); outline-offset: -0.18rem; }

  /* ---- a set written as a binary number ---- */
  .bits { display: grid; gap: 0.6rem; justify-items: center; padding-block: 0.75rem; }
  .bits-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: center; }
  .bits-label { color: var(--ink-2); font-size: 0.9375rem; }
  button.bit { font-family: var(--font-num); font-size: 1.0625rem; min-inline-size: 6.5rem; }
  button.bit.is-stop { min-inline-size: 3rem; }
  button.bit[aria-pressed="true"] { background: var(--signal); color: var(--on-signal); border-color: var(--ink); font-weight: 700; }
  .bits-line { font-family: var(--font-num); font-size: 1.1875rem; }
  .bits-line b { font-size: 1.3em; }
  .bits-note { color: var(--ink-2); font-size: 0.875rem; min-block-size: 1.5em; text-align: center; }

  /* ---- a small table of counts ---- */
  table.counts { border-collapse: collapse; margin-inline: auto; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
  table.counts th, table.counts td { border-block-end: 0.07rem solid var(--rule); padding: 0.4rem 0.9rem; text-align: end; font-size: 1.0625rem; }
  table.counts th { font-family: var(--font-body); font-size: 0.9375rem; color: var(--ink-2); font-weight: 400; }
  table.counts td:first-child, table.counts th:first-child { text-align: start; font-family: var(--font-body); }
  table.counts tr.is-new td { background: var(--wash); }

  /* ---- bars for comparing a few lengths ---- */
  .bars { display: grid; gap: 0.5rem; padding-block: 0.75rem; }
  .bar-row { display: grid; grid-template-columns: 9rem minmax(0, 1fr) 5rem; gap: 0.7rem; align-items: center; font-size: 0.9375rem; }
  .bar-track { block-size: 1.4rem; background: var(--paper); border-radius: 0.3rem; overflow: clip; position: relative; }
  .bar-fill { display: block; block-size: 100%; inline-size: 0; background: var(--c, var(--ink-3)); }
  .bar-value { font-family: var(--font-num); font-size: 1.125rem; font-weight: 700; }
  .bar-mark { position: absolute; inset-block: 0; inline-size: 0.15rem; background: var(--ink); }
}
