.cayley-hamilton-demo{margin:2rem 0;padding:1.25rem;border:1px solid var(--line);background:var(--surface,#10252e)}
.cayley-hamilton-demo h3{margin-top:0}.ch-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem;align-items:end;margin:1.2rem 0}.ch-controls label{display:block;font-family:var(--sans,system-ui);font-size:.85rem}.ch-controls label:nth-child(4){grid-column:1/-1}.ch-controls select,.ch-controls button{display:block;width:100%;min-height:2.6rem;margin-top:.3rem;padding:.5rem;border:1px solid var(--line);background:var(--paper,#08141b);color:var(--ink,#e7e8df);font:inherit;max-width:100%}.ch-controls button{grid-column:1/-1;cursor:pointer}.ch-controls select:focus-visible,.ch-controls button:focus-visible,.ch-table-scroll button:focus-visible{outline:2px solid #cbbf96;outline-offset:3px}.ch-pair-view{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.ch-object{min-width:0;border:1px solid var(--line);padding:.7rem}.ch-object h4{font:600 .9rem var(--sans,system-ui);margin:.2rem 0 .7rem}.ch-object p{font-size:.85rem;line-height:1.65}.ch-graph{width:100%;height:auto;overflow:visible}.ch-edge{fill:none;stroke-width:2.7}.ch-edge-walk{stroke:#9ecfc6}.ch-edge-reserve{stroke:#e4bf75;stroke-dasharray:6 3}.ch-arrow-walk{fill:#9ecfc6}.ch-arrow-reserve{fill:#e4bf75}.ch-edge-label{font:16px system-ui;text-anchor:middle}.ch-edge-label-walk{fill:#c0e7df}.ch-edge-label-reserve{fill:#f1d296}.ch-vertex{fill:#10252e;stroke:#b9c5c9;stroke-width:2}.ch-vertex-label{fill:#f3f0e1;font:20px system-ui;text-anchor:middle}.ch-weight{overflow-wrap:anywhere;font-family:var(--sans,system-ui);font-size:1rem!important}.ch-status{font-family:var(--sans,system-ui);font-size:.85rem!important;line-height:1.7}.ch-table-scroll{overflow-x:auto;margin-top:1rem}.ch-table-scroll table{font-size:.8rem;min-width:34rem}.ch-table-scroll button{color:inherit;background:var(--paper,#08141b);border:1px solid var(--line);padding:.3rem .5rem;cursor:pointer;white-space:nowrap}.ch-table-scroll caption{margin-bottom:.7rem}.cayley-hamilton-demo summary{cursor:pointer;font-family:var(--sans,system-ui);font-size:.85rem}
@media(max-width:650px){.cayley-hamilton-demo{padding:.75rem}.ch-pair-view{grid-template-columns:1fr}.ch-controls{grid-template-columns:1fr}.ch-controls label:nth-child(4),.ch-controls button{grid-column:auto}}

.ch-scroll-hint{display:none}.ch-table-scroll:focus-visible{outline:2px solid #cbbf96;outline-offset:3px}
@media(max-width:650px){.ch-scroll-hint{display:block;font: .8rem/1.5 var(--sans,system-ui);color:var(--muted)}}
