/* Two questions through the adaptive graph (lesson 15.4). Built on the style board's graph player (theme.css:
   .graph-box, .g-node, .g-edge, .packet, .state-box). Colours: blue = nodes that call a model, green = retrieval
   and web search, gray = START and the edges, amber = the state, rose = END. A lit node glows; nothing changes hue.
   The graph sits above the state, which needs the width for its answers and printed lines. */
.ar-code { margin: 0 0 14px; }
.ar .controls .seg, .ar .btns { flex-wrap: wrap; }
.ar-stage { grid-template-columns: minmax(0, 1fr); }
.ar-stage .graph-box svg { max-width: 560px; margin: 0 auto; }
.ar .g-label { font-size: 10px; }

/* The state panel: keys on the left, the call count and the printed lines on the right */
.ar-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 10px; padding: 12px; }
.ar-keys, .ar-side { display: grid; gap: 9px; align-content: start; }
.ar-title { display: block; margin-bottom: 4px; font: 600 10.5px var(--font-sans); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.ar-kv {
  display: grid; gap: 3px; padding: 7px 10px;
  border: 1.5px solid var(--data-line); border-radius: 10px; background: #fff;
  transition: box-shadow var(--dur) var(--ease);
}
.ar-key { justify-self: start; padding: 0; border: 0; background: none; font: 600 12px var(--font-mono); color: var(--data-ink); }
.ar-val { max-height: 7.6em; overflow-y: auto; overflow-wrap: anywhere; font: 500 12.5px/1.5 var(--font-sans); color: var(--ink); }
.ar-val.is-empty { color: var(--faint); }
.ar-kv:has(.ar-val.is-new) { box-shadow: 0 0 0 4px var(--data-tint), 0 0 0 5px var(--data-line); }
.ar-calls { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 6px 10px; border: 1px solid var(--model-line); border-radius: 10px; background: var(--model-tint); }
.ar-calls .ar-title { margin: 0; color: var(--model-ink); }
.ar-count { font: 600 16px var(--font-mono); color: var(--model-ink); }
.ar-printed pre {
  min-height: 3.4em; max-height: 15em; margin: 0; padding: 8px 10px; overflow: auto;
  border: 1px solid var(--line); border-radius: 8px; background: var(--soft);
  font: 500 11.5px/1.6 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2);
}

@media (prefers-reduced-motion: reduce) {
  .ar-kv { transition: none; }
}
@media (max-width: 640px) {
  .ar-body { grid-template-columns: minmax(0, 1fr); }
}
