/* Gráfico interactivo «Curva de los hijos» (assets/curva-hijos.js).
   Tokens y tamaños de la guía de estilo: nada de letra por debajo de 14 px, una sola
   columna, la forma del trazo distingue las series, un acento y el resto tinta y grises. */
#curva-hijos {
  display: grid;
  gap: var(--space-6);
  min-width: 0;
}
.ch-controls {
  display: grid;
  gap: var(--space-5);
}
.ch-ctl {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}
.ch-lbl {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.ch-seg {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.ch-seg button {
  font: inherit;
  font-weight: 500;
  min-width: 48px;
  min-height: 44px;
  padding: 6px 14px;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-strong);
  cursor: pointer;
}
.ch-seg button[aria-checked="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.ch-rng {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  align-items: center;
}
.ch-rng output {
  font-weight: 600;
  min-width: 4.5ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ch-rng input[type="range"] {
  width: 100%;
  min-height: 44px;
  accent-color: var(--accent-vivid);
}
.ch-hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--fg-faint);
  line-height: 1.45;
}
#curva-hijos button:focus-visible,
#curva-hijos input:focus-visible,
.ch-plot:focus-visible {
  outline: 3px solid var(--accent-vivid);
  outline-offset: 2px;
}
.ch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.ch-legend button {
  font: inherit;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 12px;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-strong);
  cursor: pointer;
}
.ch-legend button[aria-pressed="false"] {
  opacity: 0.45;
  text-decoration: line-through;
}
.ch-legend svg {
  width: 34px;
  height: 10px;
  flex: none;
}
.ch-legend-note {
  font-size: 0.875rem;
  color: var(--fg-faint);
}
.ch-plot {
  width: 100%;
  min-width: 0;
  cursor: crosshair;
  touch-action: pan-y;
}
.ch-plot svg {
  display: block;
}
.ch-plot svg + svg {
  margin-top: var(--space-3);
}
.ch-plot text {
  font-family: var(--font-display);
  font-size: 0.875rem;
  fill: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.ch-readout {
  border-top: 1px solid var(--line-strong);
}
.ch-hd {
  padding: var(--space-3) 0 var(--space-2);
  font-weight: 500;
}
.ch-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 4px var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.ch-n {
  font-weight: 600;
}
.ch-v {
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.ch-off {
  opacity: 0.4;
}
.ch-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}
.ch-facts b {
  font-weight: 600;
}
@media (max-width: 480px) {
  .ch-row {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .ch-seg button,
  .ch-legend button {
    transition:
      background 0.15s,
      opacity 0.15s;
  }
}
