.abi-page{padding-block:24px 64px;max-width:1120px}.abi-nav,.abi-actions,.abi-filters{display:flex;flex-wrap:wrap;gap:12px;margin:18px 0}.abi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:16px}.abi-panel,.abi-topic{padding:24px;border:1px solid var(--line);border-radius:20px;background:var(--surface);margin:20px 0;min-width:0}.abi-topic{display:block;color:var(--ink);text-decoration:none;margin:0;transition:box-shadow .2s}.abi-topic:hover{box-shadow:var(--shadow)}.abi-topic small{color:var(--ink-2)}.abi-panel h3{margin-top:24px;font-size:1.12em}.abi-panel p{line-height:1.85;max-width:80ch}.abi-panel .katex-display{overflow-x:auto;overflow-y:hidden;padding:8px 0}.abi-filters input[type=search],.abi-filters select{max-width:100%;min-width:0;flex:1;padding:14px;border-radius:12px;border:1px solid var(--line);background:var(--surface);color:var(--ink);font:inherit}.abi-filters label{display:flex;align-items:center;gap:8px}.abi-terms{padding:16px;background:var(--surface-2);border-radius:12px}.abi-work{padding-left:1.4em}.abi-work li{padding:8px 0}.abi-work p{margin-bottom:4px}.abi-title-link{color:var(--brand);text-decoration:none}.abi-result{max-width:100%;min-width:0}.abi-panel svg.art{max-width:100%;height:auto}.abi-nav .btn,.abi-actions .btn{white-space:normal}.abi-entry{background:var(--surface);border:2px solid #0e8b83;border-radius:24px;padding:28px;margin-block:24px}.abi-entry p{max-width:75ch}@media(max-width:480px){.abi-panel{padding:16px}.abi-nav{gap:8px}.abi-nav .btn{font-size:.85em}.abi-page h1{font-size:1.8em}}@media print{.abi-nav,.abi-filters,.abi-panel button,.topbar,.zoom-controls,.notes-launcher,.sitefoot{display:none!important}.abi-panel{break-inside:avoid}.abi-page{max-width:none}}
.abi-panel .formula-display,.abi-work .formula-display{min-width:0;width:auto;max-width:100%;overflow-x:auto;overflow-y:hidden}

/* Syllabus, rule tables and accessible four-choice question book. */
.abi-rule-table{width:100%;border-collapse:collapse;margin:1rem 0}
.abi-rule-table th,.abi-rule-table td{padding:.7rem;border:1px solid var(--border);text-align:left;vertical-align:top}
.abi-rule-table caption{text-align:left;font-weight:700;margin-bottom:.5rem}
.abi-encouragement{border-inline-start:4px solid #0e8b83;padding:.7rem 1rem;background:var(--surface)}
.abi-book-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem;margin:1rem 0}
.abi-book-option{display:flex;gap:.5rem;align-items:center;min-width:0;padding:.8rem;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:inherit;cursor:pointer;text-align:left;font:inherit}
.abi-book-option>span{min-width:0;overflow-x:auto}
.abi-book-option[aria-pressed=true]{outline:3px solid #0e8b83;outline-offset:-3px}
.abi-question-visual{max-width:440px;margin:1rem auto}
.abi-book-solution[hidden]{display:none}
.abi-page figure{margin:1rem auto;max-width:520px}
.abi-page figcaption{font-size:.88rem;line-height:1.5}
.abi-filters select{max-width:100%;min-width:0}
@media(max-width:520px){.abi-book-options{grid-template-columns:1fr}.abi-rule-table th,.abi-rule-table td{padding:.45rem;overflow-wrap:anywhere}}
@media print{.abi-no-print{display:none!important}.abi-book-option{break-inside:avoid}.abi-book-question{break-inside:auto}.abi-book-question h2{break-after:avoid}.abi-page figure{break-inside:avoid}}

/* Diagram dimensions are bounded without clipping labels or changing shape proportions. */
.abi-page figure{max-width:360px}
.abi-page svg.art,.abi-page figure>div>svg,.abi-question-visual>svg,
.abi-result svg.art{display:block;max-width:100%;max-height:250px;width:auto;height:auto;margin-inline:auto}
.abi-page .readable-diagram>svg.art{width:100%;max-width:360px;max-height:250px}
.abi-page .solution-figure{overflow:visible}
.abi-question-visual{max-width:360px}
.q-visual:has(.bounded-plot),.solution-figure:has(.bounded-plot){max-width:360px;margin-inline:auto}
svg.bounded-plot{width:360px!important;max-width:100%;height:auto;max-height:250px}

.abi-type-label{font-weight:600;color:var(--muted);font-size:.9em}
.abi-panel[hidden]{display:none!important}

.abi-player .q-visual,.abi-player .solution-figure{max-width:360px;margin-inline:auto}
.abi-player svg.art,.abi-player .q-visual>svg{max-width:100%;max-height:250px;width:auto;height:auto}
.abi-player .readable-diagram>svg.art{width:100%;max-width:360px;max-height:250px}

/* Give grid figures a definite width: auto-sized flex children can collapse to zero. */
.abi-page figure.figure{width:100%;min-width:0}
.abi-page .figure .fig-art{width:100%;min-width:0;box-sizing:border-box}
.abi-page .figure svg.art,.abi-player .figure svg.art{width:100%;height:auto;max-height:250px}
