/* The annotated program of the IR chapter: the program's text, the drawing of its schedule and the stepper. The
   figures' palette: grays, and the accent only for what the reader highlights. The rows of the memory spaces darken
   from the root space toward the compute units. */
.ir-figure, .ir-stepper { --ir-ink: #0b0b0b; --ir-muted: #52514e; --ir-line: #898781; --ir-surface: #fcfcfb;
  --ir-accent: #2a78d6; --ir-highlight: rgba(42, 120, 214, 0.14);
  --ir-highlight-solid: color-mix(in srgb, #2a78d6 14%, #fcfcfb);
  --ir-tint-1: #f0efea; --ir-tint-2: #e4e3dd; --ir-tint-3: #d9d8d1; }
html[data-theme="dark"] :is(.ir-figure, .ir-stepper) { --ir-ink: #f0efec; --ir-muted: #c3c2b7; --ir-line: #898781;
  --ir-surface: #1a1a19; --ir-accent: #3987e5; --ir-highlight: rgba(57, 135, 229, 0.22);
  --ir-highlight-solid: color-mix(in srgb, #3987e5 22%, #1a1a19);
  --ir-tint-1: #222221; --ir-tint-2: #2c2c2a; --ir-tint-3: #353533; }
.ir-figure { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin: 1.5rem 0; }
.tnzr-ir-figure { text-align: left; }
.ir-program { text-align: left; font-family: var(--pst-font-family-monospace, monospace); font-size: 0.78rem; line-height: 1.45;
  background: var(--ir-surface); border: 1px solid rgba(127, 127, 127, 0.25); border-radius: 6px;
  padding: 0.75rem; overflow-x: auto; margin: 0; color: var(--ir-ink); }
.ir-program .ir-line { display: block; white-space: pre; border-radius: 3px; padding: 0 0.25rem; }
.ir-program .ir-part { border-radius: 3px; }
/* The stepper's program as a diff: the text of each run of lines that the transform removes is struck through, and
   each run of lines that it adds or changes carries one mark, with one bar along the whole run. */
.ir-program .ir-new, .ir-program .ir-gone { display: block; border-radius: 3px; }
.ir-program .ir-new { box-shadow: inset 3px 0 0 var(--ir-accent); background: var(--ir-highlight);
  text-decoration: none; }
.ir-program .ir-gone { color: var(--ir-muted); text-decoration: none; }
.ir-program .ir-strike { text-decoration: line-through; }
.ir-on { background: var(--ir-highlight); outline: 1px solid var(--ir-accent); }
/* The hand marks only what a click changes, such as the stepper's buttons. The lines of the program and the parts of
   the drawing react to hover, and the drawing's labels show the arrow, as they belong to the image. */
.ir-drawing { max-width: 100%; height: auto; background: var(--ir-surface); border-radius: 6px;
  border: 1px solid rgba(127, 127, 127, 0.25); font-family: system-ui, sans-serif; cursor: default; }
.ir-drawing text { font-size: 14px; fill: var(--ir-ink); }
.ir-drawing .ir-row { fill: none; stroke: var(--ir-line); stroke-width: 1; }
.ir-drawing .ir-row.ir-level-1 { fill: var(--ir-tint-1); }
.ir-drawing .ir-row.ir-level-2 { fill: var(--ir-tint-2); }
.ir-drawing .ir-row.ir-level-3 { fill: var(--ir-tint-3); }
.ir-drawing .ir-row-label { fill: var(--ir-muted); }
.ir-drawing .ir-box rect { fill: var(--ir-surface); stroke: var(--ir-muted); stroke-width: 1.5; }
.ir-drawing .ir-frame rect { fill: none; stroke: var(--ir-muted); stroke-width: 1.2; stroke-dasharray: 5 4; }
.ir-drawing .ir-frame text { fill: var(--ir-muted); font-size: 13px; }
.ir-drawing .ir-arrow { stroke: var(--ir-muted); stroke-width: 1.5; }
.ir-drawing .ir-arrowhead { fill: var(--ir-muted); }
.ir-drawing .ir-note { fill: var(--ir-muted); font-size: 13px; }
.ir-drawing .ir-note.ir-on { fill: var(--ir-accent); font-weight: 600; }
.ir-drawing .ir-link { outline: none; }
.ir-drawing .ir-link.ir-on rect { fill: var(--ir-highlight); stroke: var(--ir-accent); stroke-width: 2.5; }
/* A highlighted box looks the same in every row, while a highlighted frame lets the rows' tints show through. */
.ir-drawing .ir-box.ir-on rect { fill: var(--ir-highlight-solid); }
.ir-drawing .ir-link:focus-visible rect { stroke-width: 3; }
.ir-stepper { border: 1px solid rgba(127, 127, 127, 0.25); border-radius: 6px; padding: 0.75rem 1rem; }
.ir-stepper-controls { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.ir-stepper-controls button { font: inherit; font-size: 0.875rem; padding: 0.1rem 0.6rem; border-radius: 4px;
  cursor: pointer; border: 1px solid rgba(127, 127, 127, 0.5); background: transparent; color: inherit; }
.ir-stepper-controls button:disabled { opacity: 0.4; cursor: default; }
.ir-stepper-controls input[type="range"] { flex: 1 1 10rem; min-width: 8rem; }
.ir-step-count { font-size: 0.875rem; }
.ir-entry { font-family: var(--pst-font-family-monospace, monospace); font-size: 0.8rem; overflow-x: auto;
  white-space: pre; margin: 0.25rem 0; }
.ir-explanation { margin: 0.25rem 0 0.75rem; min-height: 3em; }
