/* Scoped to the OTP/PRG/PRF lesson. Small figures, full-size controls. */
.otp-figure { margin:18px 0; padding:12px 0; border-block:1px solid #dce3e8; }
.otp-figure figcaption { font-weight:600; margin:0 0 8px; }
.otp-toolbar { position:sticky; top:0; z-index:3; display:flex; flex-wrap:wrap; gap:5px; align-items:center; padding:5px 0; background:#fff; }
.academic-site .otp-toolbar button { display:inline-flex; align-items:center; gap:5px; min-height:32px; padding:5px 8px; border:1px solid #d6dfe4; border-radius:4px; background:#fafcfd; color:#24465c; font:inherit; cursor:pointer; box-shadow:none; }
.academic-site .otp-toolbar button:hover { background:#edf3f6; box-shadow:0 1px 2px #162e3b18; }
.academic-site .otp-toolbar button:focus-visible { outline:1px solid #506d7e; outline-offset:2px; }
.academic-site .otp-toolbar button:disabled { opacity:.45; cursor:default; }
.otp-toolbar button svg { width:14px; height:14px; min-width:14px; }
.otp-toolbar button[aria-pressed=true] { border-color:#638ba6; background:#edf3f8; }
.otp-scroll { max-width:100%; overflow:auto; margin:8px 0; position:relative; }
.academic-site .otp-svg { display:block; width:640px; min-width:640px; max-width:none; height:auto; margin-inline:auto; }
.otp-svg text { font-family:inherit; font-size:11px; fill:#294452; letter-spacing:0; }
.otp-box { fill:#f9fbfc; stroke:#b3c4ce; stroke-width:1; }
.otp-arrow { fill:none; stroke:#536f80; stroke-width:1.3; }
.otp-formula { display:flex; justify-content:center; align-items:center; height:32px; font-size:11px; line-height:1.4; color:#204d78; }
.otp-formula math { font-size:1em!important; }
.otp-svg [data-otp-active] .otp-box { stroke:#225c91; stroke-width:2; fill:#edf5fc; }
.otp-figure[data-otp-fit=true] .otp-scroll { overflow:hidden; }
.academic-site .otp-figure[data-otp-fit=true] .otp-svg { width:min(100%,640px,var(--otp-fit-width,640px))!important; min-width:0!important; max-width:100%; }
.otp-choices { display:flex; flex-wrap:wrap; gap:6px 14px; padding:5px 0 9px; border:0; margin:0; font-size:inherit; }
.otp-choices legend { font:inherit; font-weight:600; padding:0; margin-bottom:4px; }
.otp-choices label { display:inline-flex; gap:5px; align-items:center; margin:0; font:inherit; }
.otp-choices input { margin:0; accent-color:#2c648b; }
.otp-table-scroll { max-width:100%; overflow:auto; margin:9px 0; }
.academic-site .otp-table { width:max-content; min-width:0; max-width:none; margin:0 auto; font-size:inherit; border-collapse:collapse; font-variant-numeric:tabular-nums; }
.academic-site .otp-table th,.academic-site .otp-table td { padding:5px 12px; text-align:right; white-space:nowrap; border-bottom:2px solid #edf0f2; }
.academic-site .otp-table th { font-weight:600; background:#f7f9fa; }
.academic-site code.otp-bits { font-size:1em; background:none; padding:0; color:inherit; }
.otp-static { margin:12px 0; }
.otp-table .otp-picked { background:#eaf3fa; box-shadow:inset 0 -2px #28618b; }
.otp-table tr.otp-current td,.otp-table tr.otp-current th { background:#eef5fa; }
.otp-table tr.otp-input-collision td { border-bottom:2px solid #9b5d21; }
.otp-table tr.otp-output-collision td { border-bottom:2px dashed #3d799c; }
.otp-table tr.otp-future { visibility:hidden; }
.otp-status { display:block; min-height:3.8em; padding:8px 0; line-height:1.55; color:#28495f; }
.otp-hidden-value { display:none; font-size:.95em; color:#566875; }
.otp-figure:is([data-otp-view=g1],[data-otp-view=g2]) [data-otp-secret] { display:none; }
.otp-figure:is([data-otp-view=g1],[data-otp-view=g2]) .otp-hidden-value { display:inline; }
.otp-figure[data-otp-view=g1] [data-otp-trace] tr > :nth-child(7),.otp-figure[data-otp-view=g2] [data-otp-trace] tr > :nth-child(6) { display:none; }
.otp-figure[data-otp-fit=true] .otp-table-scroll { overflow-x:hidden; }
.otp-bound-values { display:flex; flex-wrap:wrap; gap:12px 36px; }
.otp-bound-values output { font-variant-numeric:tabular-nums; font-weight:600; }
.otp-figure input[type=number] { width:160px; font:inherit; }
@media(max-width:600px) {
  .otp-toolbar { gap:4px; }
  .academic-site .otp-toolbar button { min-height:36px; padding:6px; }
  .academic-site .otp-toolbar button span { display:none; }
  .academic-site .otp-toolbar button[data-otp-action=next] span,.academic-site .otp-toolbar button[data-otp-action=fit] span { display:inline; }
  .academic-site .otp-table th,.academic-site .otp-table td { padding:5px 7px; }
  .otp-status { min-height:6em; }
}
@media print { .otp-toolbar,.otp-choices { display:none; } .otp-scroll,.otp-table-scroll { overflow:visible; } .academic-site .otp-svg { min-width:0; max-width:100%; } }
