/* Scoped GEMM diagrams and derivation layout. */
/* Long derivations scroll within the article rather than widening the page. */
.article-body .katex-display { max-width:100%; overflow-x:auto; overflow-y:hidden; padding-block:.25rem; }
.article-body .katex-display > .katex { min-width:max-content; }
.gemm-figure { margin:2rem 0; color:var(--text); }
.gemm-figure__panels { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,18rem),1fr)); gap:1rem; }
.gemm-figure__panel { min-width:0; padding:.75rem; border:1px solid var(--line); border-radius:10px; background:var(--surface); }
.gemm-figure__panel-title { font-weight:600; line-height:1.45; margin:0 0 .5rem; }
.gemm-figure svg { display:block; width:100%; height:auto; color:var(--text); font-family:inherit; font-size:18px; }
.gemm-figure .gf-box { fill:var(--soft); stroke:currentColor; stroke-width:1.5; }
.gemm-figure .gf-accent { fill:var(--soft); stroke:var(--accent); stroke-width:3; }
.gemm-figure .gf-solid { fill:var(--accent); stroke:var(--accent); stroke-width:1.5; }
.gemm-figure .gf-inverse { fill:var(--on-button); }
.gemm-figure .gf-text { fill:currentColor; }
.gemm-figure .gf-small { font-size:16px; }
.gemm-figure .gf-math { font-family:ui-monospace,monospace; font-size:16px; }
.gemm-figure .gf-grid { fill:none; stroke:var(--muted); stroke-width:1; }
.gemm-figure .gf-flow { fill:none; stroke:currentColor; stroke-width:2; }
.gemm-figure .gf-bound { fill:none; stroke:var(--accent); stroke-width:4; }
.gemm-figure .gf-dashed { stroke-dasharray:7 5; }
.gemm-figure .gf-guide { fill:none; stroke:var(--muted); stroke-width:1.5; stroke-dasharray:3 5; }
.gemm-figure figcaption { margin-top:.8rem; font-size:.95rem; line-height:1.7; color:var(--muted); }
.gemm-figure__single { max-width:26rem; margin-inline:auto; }
