/* "Why 32 couriers beat one" (concepts/couriers.md): its inline diagrams, the schematic
   and the measured sweeps (assets/javascripts/couriers.js). Colours are roles, light by
   default and stepped for the dark scheme (slate); the lanes' hues are bench.css's
   series slots. */
.cr-root,
.cr-fig {
  --cr-ink: var(--md-default-fg-color--light);
  --cr-rule: #e1e0d9;
  --cr-paper: #0f6e74;
  --cr-wait: #cde4e5;
  --cr-queue: #eb6834;
  --cr-l1: #2a78d6;
  --cr-l2: #eb6834;
  --cr-l3: #1baf7a;
  --cr-l4: #eda100;
  --cr-ghost: #e9e8e3;
  --cr-book: #a3a29b;
}
[data-md-color-scheme="slate"] .cr-root,
[data-md-color-scheme="slate"] .cr-fig {
  --cr-rule: #2c2c2a;
  --cr-paper: #f2b544;
  --cr-wait: #4b4232;
  --cr-queue: #3987e5;
  --cr-l1: #3987e5;
  --cr-l2: #d95926;
  --cr-l3: #199e70;
  --cr-l4: #c98500;
  --cr-ghost: #2f2f2c;
  --cr-book: #6d6c67;
}

/* The static diagrams: inline SVG in a figure */
.md-typeset .cr-fig {
  margin: 1.2rem 0;
}
.md-typeset .cr-fig svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 44rem;
  margin: 0 auto;
  overflow: visible;
  font-family: var(--md-text-font-family);
}
.md-typeset .cr-fig figcaption {
  max-width: 40rem;
  margin: 0.5rem auto 0;
  color: var(--md-default-fg-color--light);
  font-size: 0.7rem;
}
.cr-fig .cr-t,
.cr-root .cr-tick {
  fill: var(--cr-ink);
  font-size: 11px;
}
.cr-fig .cr-t-strong {
  fill: var(--md-default-fg-color);
  font-size: 11px;
  font-weight: 600;
}
.cr-fig .cr-axis {
  stroke: var(--cr-rule);
  stroke-width: 1;
}
.cr-fig .cr-mark {
  stroke: var(--cr-ink);
  stroke-width: 1;
  fill: none;
}
.cr-fig .cr-work,
.cr-root .cr-paper {
  fill: var(--cr-paper);
}
.cr-fig .cr-wait,
.cr-root .cr-wait {
  fill: var(--cr-wait);
}
.cr-root .cr-queue {
  fill: var(--cr-queue);
}
.cr-fig .cr-idle,
.cr-root .cr-idle {
  fill: none;
  stroke: var(--cr-rule);
  stroke-width: 1;
}
.cr-fig .cr-ghost {
  fill: var(--cr-ghost);
}
.cr-fig .cr-book {
  fill: var(--cr-book);
}
.cr-fig .cr-l1 { fill: var(--cr-l1); }
.cr-fig .cr-l2 { fill: var(--cr-l2); }
.cr-fig .cr-l3 { fill: var(--cr-l3); }
.cr-fig .cr-l4 { fill: var(--cr-l4); }
.cr-fig .cr-s1 { stroke: var(--cr-l1); }
.cr-fig .cr-s2 { stroke: var(--cr-l2); }
.cr-fig .cr-s3 { stroke: var(--cr-l3); }
.cr-fig .cr-s4 { stroke: var(--cr-l4); }
.cr-fig .cr-seg {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
}
.cr-fig .cr-start {
  fill: var(--md-default-fg-color);
}

/* The schematic (#courier-schematic) */
.md-typeset #courier-schematic {
  margin: 1rem 0 1.4rem;
  padding: 0.7rem 0.9rem 0.6rem;
  border: 1px solid var(--cr-rule);
  border-radius: 8px;
}
.cr-root .cr-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.4rem;
  font-size: 0.75rem;
}
.cr-root .cr-slider {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cr-root .cr-slider output {
  min-width: 1.6em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cr-root .cr-slider input {
  width: min(14rem, 50vw);
  accent-color: var(--md-primary-fg-color);
}
.cr-root .cr-seg button,
.cr-root .cr-replay {
  font: inherit;
  color: inherit;
  background: none;
  border: 1px solid var(--cr-rule);
  border-radius: 4px;
  padding: 0.05rem 0.5rem;
  margin-left: 0.2rem;
  cursor: pointer;
}
.cr-root .cr-seg button[aria-checked="true"] {
  border-color: var(--md-primary-fg-color);
  color: var(--md-primary-fg-color);
  font-weight: 600;
}
.cr-root button:focus-visible,
.cr-root .cr-pt:focus-visible {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 2px;
}
.cr-root .cr-chart {
  margin: 0.5rem 0 0.2rem;
  min-width: 0;
}
.cr-root .cr-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.md-typeset .cr-root .cr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.2rem;
  list-style: none;
  margin: 0.3rem 0;
  padding: 0;
  font-size: 0.7rem;
}
.md-typeset .cr-root .cr-legend li {
  margin: 0;
  color: var(--cr-ink);
}
.cr-root .cr-swatch {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  border-radius: 2px;
  margin-right: 0.4em;
  vertical-align: -0.1em;
}
.cr-root .cr-swatch.cr-paper { background: var(--cr-paper); }
.cr-root .cr-swatch.cr-wait { background: var(--cr-wait); }
.cr-root .cr-swatch.cr-queue { background: var(--cr-queue); }
.md-typeset .cr-root .cr-status {
  margin: 0.3rem 0 0;
  font-size: 0.75rem;
  color: var(--md-default-fg-color);
}

/* The measured sweeps (#lane-sweeps): one figure a panel */
.md-typeset .cr-root .cr-panel {
  display: block;
  margin: 0.6rem 0 1.4rem;
  text-align: left;
}
.md-typeset .cr-root .cr-panel figcaption {
  margin: 0 0 0.1rem;
  font-weight: 600;
  text-align: left;
  max-width: none;
}
.md-typeset .cr-root .cr-note,
.md-typeset .cr-root .cr-source {
  margin: 0.1rem 0 0.3rem;
  font-size: 0.7rem;
  color: var(--cr-ink);
}
.md-typeset .cr-root .cr-panel .bh-legend {
  display: flex;
  flex-flow: row wrap;
  font-size: 0.7rem;
}
.cr-root .cr-direct {
  font-size: 11px;
}
.md-typeset .cr-root .cr-table {
  font-size: 0.7rem;
}
