/* The context diagram's own look, wherever it is mounted: the experiment
   page or a lesson. Scoped to its root, at the specificity it had as page rules. */
:where(.context-view) { overflow-wrap:anywhere; }
:where(.context-view) a,:where(.context-view) button { color:var(--focus); }
:where(.context-view) button { font:inherit; background:var(--cream); border:1px solid var(--rule); padding:10px 12px; min-height:44px; cursor:pointer; }
:where(.context-view) button { text-align:left; overflow-wrap:anywhere; }
:where(.context-view) button:hover { background:var(--cream-raised); }
:where(.context-view) :focus-visible { outline:3px solid var(--focus); outline-offset:4px; }
:where(.context-view) .presentation-controls { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
:where(.context-view) .presentation-controls [aria-pressed="true"] { border:2px solid var(--focus); background:var(--signal-bg); }
:where(.context-view) .presentation-choice p { margin:8px 0; max-width:90ch; }
:where(.context-view) [hidden] { display:none!important; }
:where(.context-view) .presentation-reason { border-top:0; padding:0; }
:where(.context-view) .legend,:where(.context-view) .muted { color:var(--ink-muted); }
:where(.context-view) .legend { max-width:110ch; }
:where(.context-view) .context-diagram { border-top:1px solid var(--rule); border-bottom:1px solid var(--rule); padding:16px 0; }
:where(.context-view) .context-canvas { position:relative; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) minmax(0,1fr); column-gap:144px; align-items:center; padding:24px 0; }
:where(.context-view) .context-callers,:where(.context-view) .context-resources { display:grid; gap:40px; min-width:0; }
:where(.context-view) .context-node { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; width:100%; min-width:0; min-height:108px; padding:16px; text-align:center; color:var(--ink-strong); position:relative; z-index:1; }
:where(.context-view) .context-node strong { font-size:1.15rem; }
:where(.context-view) .node-kind { font-size:14px; color:var(--ink-muted); }
:where(.context-view) .node-summary { font-size:14px; }
:where(.context-view) .source-boundary { border:2px solid var(--focus); background:var(--signal-bg); }
:where(.context-view) .context-program { display:grid; gap:10px; padding:10px; border:2px solid var(--focus); min-width:0; position:relative; z-index:1; background:var(--cream); }
:where(.context-view) .context-program .source-boundary { border:0; min-height:0; padding:8px; }
:where(.context-view) .context-groups { display:grid; gap:10px; }
:where(.context-view) .context-group { min-height:calc(56px + 4px * var(--routes)); border:1px solid var(--rule); background:var(--cream-raised); }
:where(.context-view) .context-pure { margin:0; padding:8px; border:1px dashed var(--rule); text-align:center; font-size:14px; color:var(--ink-muted); }
:where(.context-view) .context-arrows { position:absolute; inset:0; width:100%; height:100%; overflow:visible; z-index:2; pointer-events:none; }
:where(.context-view) .context-arrows [role="button"] { pointer-events:auto; cursor:pointer; }
:where(.context-view) .context-edge-hit { pointer-events:stroke; }
:where(.context-view) .edge-label { font-family:var(--mono); fill:var(--ink-strong); }
:where(.context-view) .context-arrows [role="button"]:hover .edge-label-background,:where(.context-view) .context-arrows [role="button"]:focus-visible .edge-label-background { stroke:var(--focus); stroke-width:2px; }
:where(.context-view) .authored { font-style:italic; border-left:2px dashed var(--violet); padding-left:12px; color:var(--violet); }
:where(.context-view) .authored h2,:where(.context-view) .authored h3 { color:var(--violet); font-size:1.1rem; }
:where(.context-view) .authored button { font-style:normal; }
:where(.context-view) details { border-top:1px solid var(--rule); padding:14px 0; }
:where(.context-view) summary { cursor:pointer; min-height:44px; overflow-wrap:anywhere; }
:where(.context-view) .route-list { list-style:none; padding:0; margin:0; display:flex; flex-wrap:wrap; gap:8px; }
:where(.context-view) .route-list button { font-size:1rem; }
:where(.context-view) .context-focus ol { display:flex; flex-wrap:wrap; gap:12px 24px; padding:0; list-style:none; }
:where(.context-view) .context-focus li { flex:1 1 240px; min-width:0; display:grid; gap:6px; }
:where(.context-view) .context-focus li>span { font-size:14px; }
:where(.context-view) .context-inspector { border:2px solid var(--focus); padding:20px; margin:16px 0; }
:where(.context-view) .context-inspector>button { margin:8px; }
:where(.context-view) pre { white-space:pre-wrap; overflow-wrap:anywhere; font:14px/1.6 var(--mono); }
:where(.context-view) .detail-drawing,:where(.context-view) .baseline-drawing { overflow:auto; background:#f8fafc; margin:20px 0; }
:where(.context-view) .baseline-drawing { max-width:1100px; }
:where(.context-view) .detail-drawing svg,:where(.context-view) .baseline-drawing svg { max-width:none; }
:where(.context-view)>details p { overflow-wrap:anywhere; }
@media(max-width:800px) {
 :where(.context-view) .context-canvas { grid-template-columns:1fr; gap:160px; padding:16px 0; }
 :where(.context-view) .context-callers,:where(.context-view) .context-resources { grid-template-columns:repeat(var(--nodes),minmax(0,1fr)); gap:12px; }
 :where(.context-view) .context-node { padding:10px; min-height:108px; }
 :where(.context-view) .context-groups { grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); align-items:end; }
 :where(.context-view) .context-focus ol { display:grid; gap:14px; }
}
@media print { :where(.context-view) button { cursor:default; } :where(.context-view) details { display:block; } :where(.context-view) .authored { color:#493c83; } }
