/* Compiled from this post's former theme.scss (Quarto's dart-sass, expanded style)
   and then edited by hand, because a document-level `theme:` would replace the
   site's light/dark pair and `css:` takes plain CSS only.

   The seven mechanism diagrams and the route widget encode meaning in hue and
   sit on a white or paper card in BOTH colour schemes, so every colour in the
   `.dia`, `.aav-fig`, widget-chrome and widget-internal rules stays a fixed hex
   value, mirrored in widgets.js (`var C`). Change one, change both. The prose
   chrome around them (`.aav-cards`, `.aav-metrics`, `.aav-eyebrow`) reads the
   site tokens (`--w-*`, theme/light.scss and theme/dark.scss) and follows the
   reader's choice. The `.widget-*` rules here deliberately override the shared
   widget-kit/chrome.scss for this post, to keep its widget on the light card. */

/*-- scss:defaults --*/
/*-- scss:rules --*/
:root {
  --aav-ink: #16202B;
  --aav-muted: #5C6B7A;
  --aav-rule: #D5DCE3;
  --aav-paper: #F7F9FB;
  --aav-vector: #4A3AA7;
  --aav-innate: #E69F00;
  --aav-antibody: #0072B2;
  --aav-tcell: #A8437A;
  --aav-complement: #009E73;
  --aav-alarm: #D55E00;
  --aav-traffic: #9AA6B2;
  --aav-blood: #FDEEF0;
  --aav-blood-edge: #E4B4BC;
  --aav-nucleoplasm: #EFEAFB;
}

.dia {
  margin: 2rem 0;
  padding: 1.15rem 1.1rem 0.95rem;
  border: 1px solid #D5DCE3;
  border-radius: 10px;
  background: #FFFFFF;
}
.dia > figure, .dia figure.quarto-float {
  margin: 0;
}
.dia svg.aav-fig {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--bs-body-font-family, system-ui, -apple-system, "Segoe UI", sans-serif);
}
.dia figcaption, .dia .quarto-float-caption, .dia .figure-caption {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid #D5DCE3;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #5C6B7A;
  text-align: left;
}

.aav-fig text {
  fill: #16202B;
}
.aav-fig .aav-fig-letter {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.aav-fig .aav-fig-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  fill: #5C6B7A;
}
.aav-fig .aav-fig-lead {
  font-size: 13px;
  font-weight: 700;
}
.aav-fig .aav-fig-note {
  font-size: 11px;
  fill: #5C6B7A;
}
.aav-fig .aav-fig-chip {
  font-size: 12px;
  font-weight: 700;
  fill: #D55E00;
}
.aav-fig .aav-fig-mid {
  text-anchor: middle;
}
.aav-fig .aav-fig-end {
  text-anchor: end;
}
.aav-fig text.fill-vector {
  fill: #4A3AA7;
}
.aav-fig text.fill-innate {
  fill: #E69F00;
}
.aav-fig text.fill-antibody {
  fill: #0072B2;
}
.aav-fig text.fill-tcell {
  fill: #A8437A;
}
.aav-fig text.fill-complement {
  fill: #009E73;
}
.aav-fig text.fill-alarm {
  fill: #D55E00;
}
.aav-fig text.fill-white {
  fill: #FFFFFF;
}
.aav-fig .aav-fig-cyto rect {
  fill: #FDF0E4;
  stroke: #D55E00;
  stroke-width: 1.5;
}
.aav-fig .aav-fig-badge circle {
  fill: #FFFFFF;
  stroke: #16202B;
  stroke-width: 2.5;
}
.aav-fig .aav-fig-badge-num text {
  font-size: 13px;
  font-weight: 800;
  text-anchor: middle;
}
.aav-fig .aav-fig-card rect {
  fill: #F7F9FB;
  stroke: #D5DCE3;
  stroke-width: 1.5;
}
.aav-fig .aav-fig-card-n {
  font-size: 12px;
  font-weight: 800;
  fill: #5C6B7A;
}
.aav-fig .aav-fig-card-t {
  font-size: 13px;
  font-weight: 700;
}
.aav-fig .aav-fig-card-b {
  font-size: 11.5px;
  fill: #5C6B7A;
}
.aav-fig .aav-fig-card-k {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  fill: #5C6B7A;
}

.aav-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
  margin: 1.6rem 0;
}

.aav-card {
  position: relative;
  padding: 0.85rem 0.95rem 0.9rem 1.1rem;
  border: 1px solid var(--w-rule);
  border-radius: 9px;
  background: var(--w-surface);
  overflow: hidden;
}
.aav-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--aav-card-arm, var(--w-muted));
}
.aav-card.arm-innate {
  --aav-card-arm: #E69F00;
}
.aav-card.arm-antibody {
  --aav-card-arm: #0072B2;
}
.aav-card.arm-tcell {
  --aav-card-arm: #A8437A;
}
.aav-card.arm-complement {
  --aav-card-arm: #009E73;
}
.aav-card p {
  margin: 0 0 0.35rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--w-muted);
}
.aav-card p:last-child {
  margin-bottom: 0;
}

.aav-card-h {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--aav-card-arm, var(--w-ink));
}

.aav-card-k {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--w-muted);
}

.aav-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.7rem;
  margin: 1.6rem 0;
}

.aav-metric {
  border: 1px solid var(--w-rule);
  border-radius: 8px;
  background: var(--w-paper);
  padding: 0.7rem 0.85rem;
}
.aav-metric p {
  margin: 0;
}

.aav-metric-v {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--w-accent);
  font-variant-numeric: tabular-nums;
}

.aav-metric-l {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--w-ink);
}

.aav-metric-h {
  display: block;
  font-size: 0.74rem;
  color: var(--w-muted);
  margin-top: 0.1rem;
}

.aav-eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--w-muted);
}
.aav-eyebrow p {
  margin: 0;
}
.aav-eyebrow::after {
  content: "";
  display: block;
  width: 34px;
  margin-top: 0.35rem;
  border-top: 2px solid var(--w-rule);
}

.widget-container {
  border: 1px solid #D5DCE3;
  border-radius: 10px;
  background: #FFFFFF;
  padding: 1.5rem 1.4rem 1.3rem;
  margin: 2rem 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #D5DCE3;
}

.widget-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: #16202B;
}

.widget-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  background: #4A3AA7;
  color: #FFFFFF;
  white-space: nowrap;
}

.widget-note {
  margin-top: 0.9rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #5C6B7A;
}

.aav-arms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.aav-arm {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.5rem 0.8rem;
  border: 2px solid #D5DCE3;
  border-radius: 999px;
  background: #FFFFFF;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  color: #16202B;
  transition: border-color 0.15s, background 0.15s;
}
.aav-arm:hover {
  border-color: #5C6B7A;
}
.aav-arm:focus-visible {
  outline: 3px solid rgba(74, 58, 167, 0.4);
  outline-offset: 2px;
}

.aav-arm-label {
  font-weight: 700;
}

.aav-arm-note {
  font-size: 0.76rem;
  color: #5C6B7A;
}

.aav-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  align-self: center;
}

.aav-sliders {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-bottom: 1.1rem;
}

.aav-slider {
  flex: 1 1 240px;
  transition: opacity 0.15s;
}
.aav-slider.is-muted {
  opacity: 0.42;
}

.aav-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: #5C6B7A;
  margin-bottom: 0.25rem;
}

.aav-slider-value {
  font-weight: 700;
  color: #16202B;
  font-variant-numeric: tabular-nums;
}

.aav-range {
  width: 100%;
  accent-color: #4A3AA7;
}

.aav-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.aav-stat {
  flex: 1 1 170px;
  border: 1px solid #D5DCE3;
  border-radius: 8px;
  background: #F7F9FB;
  padding: 0.6rem 0.8rem;
}

.aav-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #4A3AA7;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.aav-stat-value sup {
  font-size: 0.62em;
}

.aav-stat-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #16202B;
}

.aav-stat-hint {
  font-size: 0.74rem;
  color: #5C6B7A;
  margin-top: 0.1rem;
}

.aav-lamps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.3rem;
  margin-bottom: 1rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid #D5DCE3;
  border-radius: 8px;
}

.aav-lamp {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.aav-led {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #D5DCE3;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  flex: 0 0 auto;
}

.aav-led-label {
  font-size: 0.82rem;
  color: #5C6B7A;
}

.aav-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin: 0.7rem 0 0.2rem;
  font-size: 0.82rem;
  color: #5C6B7A;
}

.aav-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.aav-panel {
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid #D5DCE3;
  border-left: 4px solid #4A3AA7;
  border-radius: 6px;
  background: #F7F9FB;
}

.aav-panel-title {
  font-weight: 700;
  font-size: 1rem;
  color: #16202B;
}

.aav-panel-sub {
  font-size: 0.8rem;
  color: #5C6B7A;
  margin-bottom: 0.5rem;
}

.aav-panel-body {
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #16202B;
}

.aav-panel-arm {
  color: #5C6B7A;
}

.aav-panel-num {
  font-size: 0.86rem;
  color: #16202B;
  font-variant-numeric: tabular-nums;
}

.aav-clear {
  margin-top: 0.6rem;
  padding: 0.28rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  border: 1px solid #D5DCE3;
  border-radius: 6px;
  background: #FFFFFF;
  color: #5C6B7A;
  cursor: pointer;
}
.aav-clear:hover {
  border-color: #5C6B7A;
  color: #16202B;
}

.aav-station:focus-visible {
  outline: 3px solid rgba(74, 58, 167, 0.45);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .aav-arm {
    font-size: 0.82rem;
    padding: 0.42rem 0.65rem;
  }
  .aav-stat-value {
    font-size: 1.25rem;
  }
}
.dia figure > div, .dia .quarto-float > div {
  overflow-x: auto;
}
.dia svg.aav-fig {
  min-width: 900px;
}

#fig-route svg.aav-fig {
  min-width: 1130px;
}

#fig-timeline svg.aav-fig {
  min-width: 980px;
}

@media (max-width: 720px) {
  .dia {
    padding: 0.9rem 0.75rem 0.75rem;
  }
}
