/* 03a teaching figures. They use the lesson palette and remain readable without JavaScript. */
.lr-data-figure {
  margin: 1.15em 0;
  padding: .55em 0;
  border-block: 1px solid var(--border);
}

.lr-data-figure > figcaption {
  margin: 0 0 .55em;
  color: var(--fg);
  font-weight: 700;
}

.lr-score-parts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6em;
  margin: 0;
}

.lr-score-parts > div {
  border-inline-start: 2px solid var(--border);
  padding-inline-start: .55em;
}

.lr-score-parts dt { font-weight: 700; }
.lr-score-parts dd { margin: 0; }
.lr-data-figure .lr-score-total { margin: .65em 0 0; }

.lr-bar-rows {
  display: grid;
  gap: .55em;
  margin: 0;
}

.lr-bar-rows > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.4em;
  align-items: center;
  gap: .1em .6em;
}

.lr-bar-rows dt { font-weight: 650; }
.lr-bar-rows dd { display: contents; }

.lr-bar-track {
  position: relative;
  grid-column: 1;
  grid-row: 2;
  height: .55em;
  border: 1px solid var(--muted);
  border-radius: 4px;
  background: var(--card);
}

.lr-bar-track::before {
  display: block;
  width: var(--lr-share);
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  content: "";
}

.lr-bar-track::after {
  position: absolute;
  top: -.2em;
  bottom: -.2em;
  left: 50%;
  border-inline-start: 1px dashed var(--fg);
  content: "";
}

.lr-bar-value {
  grid-column: 2;
  grid-row: 2;
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.lr-data-figure .lr-bar-key { margin: .45em 0 0; color: var(--muted); font-size: .92em; }

body.ml-reader main figure.lr-readable-chart > svg {
  width: min(100%, 520px);
  min-width: 0;
  max-width: 100%;
}

.lr-chart text {
  fill: var(--fg);
  font-size: 14px;
}

.lr-chart .lr-chart-label { font-weight: 700; }
.lr-chart-axis { fill: none; stroke: var(--fg); stroke-width: 1.5; }
.lr-chart-grid { fill: none; stroke: var(--border); stroke-width: 1; }
.lr-chart-guide { fill: none; stroke: var(--muted); stroke-width: 1.25; stroke-dasharray: 3 3; }
.lr-chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.lr-chart-threshold { fill: none; stroke: var(--fg); stroke-width: 1.5; }
.lr-chart-dash { stroke-dasharray: 5 4; }
.lr-chart-point { fill: var(--accent); stroke: var(--fg); stroke-width: 1.25; }
.lr-chart-point-open { fill: var(--card); stroke: var(--fg); stroke-width: 1.7; }
.lr-chart-node { fill: var(--card); stroke: var(--muted); stroke-width: 1; }

.lr-trial-table :is(th, td),
.lr-matrix-table :is(th, td) { min-width: 0; overflow-wrap: anywhere; }
.lr-matrix-table td { font-variant-numeric: tabular-nums; }
.lr-matrix-table tr:last-child :is(th,td) { font-weight: 700; }

body[data-magazine-page="03a"] .lr-data-figure > .lr-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lr-data-figure .lr-flow code { white-space: normal; overflow-wrap: anywhere; }

@media (max-width: 600px) {
  body[data-magazine-page="03a"] .lr-data-figure > .lr-flow {
    grid-template-columns: minmax(0, 1fr);
  }
}
