/* Chapter-local diagrams; the reading theme, callouts and controls are shared. */
.lecture-six .source-illustration { display:block; max-width:100%; height:auto; margin:14px auto; }
.lecture-six .source-output pre { max-height:300px; overflow:auto; background:#f4f6f8; }
.lecture-six pre.python-code { padding:12px 15px; overflow:auto; white-space:pre; font:14px/1.55 Consolas,monospace; }
.lecture-six .katex-display { overflow-x:auto; overflow-y:hidden; }
.l6-form,.l6-route-controls { display:flex; align-items:end; flex-wrap:wrap; gap:8px; margin:0 0 8px; font:13px/1.5 var(--ui); }
.l6-form label,.l6-route-controls label,.l6-bucket-label { display:flex; flex-direction:column; gap:4px; }
.l6-form input,.l6-form textarea { width:90px; min-height:32px; padding:5px 7px; border:1px solid #bec5ce; background:white; color:var(--ink); font:14px/1.5 Consolas,monospace; }
.l6-form textarea { resize:vertical; }
.l6-wide { flex:1; min-width:250px; }
.l6-wide input,.l6-wide textarea { width:100%; }
.l6-form button,.l6-route-controls button,.l6-neighbors button { border:1px solid #bec5ce; background:#fff; color:var(--accent-dark); padding:6px 9px; min-height:32px; border-radius:2px; font:13px var(--ui); }
.l6-form button:hover,.l6-route-controls button:hover:not(:disabled),.l6-neighbors button:hover { background:#e9eff9; }
.l6-route-controls { align-items:center; margin:8px 0 4px; }
.l6-route-controls label { flex-direction:row; align-items:center; }
.l6-route-controls button:disabled { opacity:.45; cursor:default; }
.l6-heading { height:60px; padding-top:7px; }
.l6-heading h3 { font:600 17px/1.4 var(--ui); margin:0; }
.lecture-six .demo-explanation { height:82px; block-size:82px; margin:8px 0 10px; }
.l6-metrics { display:flex; flex-wrap:wrap; gap:6px 20px; font:13px/1.6 var(--ui); margin:9px 0; }
.l6-metrics strong { font:14px Consolas,monospace; margin-left:5px; }
.l6-columns { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; align-items:start; }
.l6-columns > div { min-width:0; }
.l6-graph { height:292px; overflow:auto; background:#fff; border-bottom:1px solid var(--line); }
.l6-graph svg { display:block; }
.l6-graph text { fill:var(--ink); font:14px Consolas,monospace; text-anchor:middle; }
.l6-graph .g-edge { fill:none; stroke:#9baec5; stroke-width:1.5; }
.l6-graph .g-edge.active { stroke:#b26c20; stroke-width:3; }
.l6-graph .g-edge.route { stroke:#2c65a4; stroke-width:3; }
.l6-graph .g-arrow { fill:context-stroke; }
.l6-graph .g-weight { fill:#425873; font:12px Consolas,monospace; paint-order:stroke; stroke:white; stroke-width:5px; stroke-linejoin:round; }
.l6-graph .g-node circle { fill:white; stroke:#8fa6c3; stroke-width:1.5; }
.l6-graph .g-node.gray circle { fill:#e5eaf1; stroke:#728196; }
.l6-graph .g-node.black circle { fill:#334860; stroke:#334860; }
.l6-graph .g-node.black .g-id { fill:white; }
.l6-graph .g-node.active circle { stroke:#b26c20; stroke-width:3; }
.l6-graph .g-meta { fill:var(--muted); font:12px var(--ui); }
.l6-legend { margin:6px 0 10px !important; font:12px/1.6 var(--ui); color:var(--muted); }
.l6-strip { display:flex; gap:5px; flex-wrap:wrap; align-content:start; min-height:42px; padding:5px 0; font:14px Consolas,monospace; }
.l6-chip { border:1px solid #9fb3cd; background:white; padding:4px 7px; height:max-content; }
.l6-chip.active { border:2px solid #b26c20; padding:3px 6px; }
.l6-table-scroll { overflow:auto; margin-bottom:10px; }
.l6-table { width:100%; border-collapse:collapse; font:13px/1.5 var(--ui); text-align:left; }
.l6-table caption { text-align:left; color:var(--muted); font:12px/1.5 var(--ui); margin-bottom:6px; }
.l6-table th,.l6-table td { border-bottom:1px solid var(--line); padding:6px 7px; white-space:nowrap; }
.l6-table th { background:#edf1f7; font-weight:600; }
.l6-table td { font:13px/1.5 Consolas,monospace; }
.l6-table .active { background:#e6edf8; }
.l6-matrix td,.l6-matrix th { text-align:center; padding:4px; }
.l6-matrix button { width:100%; min-width:44px; border:1px solid transparent; background:white; color:var(--ink); padding:7px 3px; font:13px Consolas,monospace; }
.l6-matrix button[aria-pressed="true"] { border-color:#b26c20; background:#fff2df; }
.l6-matrix button.absent { color:#7a8594; background:#f4f6f9; }
.l6-program { padding-left:25px; font:13px/1.6 var(--ui); }
.l6-program li { padding:4px 6px; }
.l6-program .active { background:#dfebfc; box-shadow:-3px 0 #457bb8; }
.l6-result { font:13px/1.6 var(--ui); min-height:38px; margin:8px 0 !important; }
.l6-sets { padding:8px 12px; margin-bottom:10px; background:#eef3fa; border-left:2px solid #8da8ca; font:14px/1.7 Consolas,monospace; }
.l6-sets p { margin:6px 0; }
.l6-layer-data { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:16px; margin-top:10px; }
.l6-layer-data .l6-sets { overflow-wrap:anywhere; }
[data-lecture6="layers"] .l6-graph { height:432px; }
.l6-bucket-label { font:13px/1.5 var(--ui); }
.l6-bucket-label select { max-width:170px; font-family:Consolas,monospace; }
.l6-bucket-table { max-height:380px; }
.l6-bucket-table th { position:sticky; top:0; }
.l6-bucket-table button { background:none; border:0; padding:0; color:var(--accent-dark); font:14px Consolas,monospace; }
.l6-bucket-table td:last-child { white-space:normal; }
.l6-ladder,.l6-neighbors { display:flex; flex-wrap:wrap; gap:7px; align-items:center; padding:7px 0; min-height:46px; }
.l6-ladder .l6-word { padding:6px 9px; background:white; border:1px solid #a7b9ce; font:15px Consolas,monospace; }
.l6-word u,.l6-neighbors u { text-decoration-thickness:2px; text-underline-offset:3px; color:#915310; font-weight:700; }
.l6-neighbors button { font:15px Consolas,monospace; }
.l6-solution { margin:10px 0; padding:10px; border-left:2px solid #7b9bc4; background:#edf3fc; }
.lecture-six .example-code { max-height:190px; overflow:auto; }
@media(max-width:1000px) { .l6-columns { grid-template-columns:minmax(0,1fr); gap:12px; } }
@media(max-width:900px) { .lecture-six .demo-controls { gap:6px; } .lecture-six .step-buttons { gap:4px; } }
