/* Scoped enhancement styles. Existing layout and themes remain authoritative. */
.ap-banner{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:22px 26px;margin:18px 0;background:linear-gradient(115deg,#0e454d,#116a70);color:#fff;border-radius:18px}.ap-banner h2{margin:0 0 7px;font-size:22px}.ap-banner p{margin:0;line-height:1.7;color:#e0f1ee}.ap-banner a,body.at .ap-banner a{background:#fff;color:#10484c;padding:12px 18px;border-radius:10px;white-space:nowrap;font-weight:700;text-decoration:none}.ap-root{--ap-ink:#17394d;--ap-muted:#536b78;--ap-line:#cedde1;--ap-card:#fff;color:var(--ap-ink);font-family:system-ui,sans-serif;width:100%}.ap-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px;background:#f0f7f7;border-bottom:1px solid #c9dfe1}.ap-root button,.ap-root select,.ap-root input,.ap-root textarea{font:inherit}.ap-root button,.ap-root select{min-height:42px;border:1px solid #b6cccf;border-radius:9px;background:white;color:#163a4b;padding:8px 12px;cursor:pointer}.ap-root button[aria-pressed=true]{background:#126f70;color:white;border-color:#126f70}.ap-root button:focus-visible,.ap-root input:focus-visible,.ap-root select:focus-visible,.ap-root textarea:focus-visible{outline:3px solid #bf6226;outline-offset:2px}.ap-root button:hover{border-color:#157b79}.ap-root button:disabled{opacity:.5;cursor:default}.ap-canvas-wrap{position:relative;background:#f8fbfd;border-radius:12px;overflow:hidden;border:1px solid #d3e3e7;margin-top:12px}.ap-svg{display:block;width:100%;height:auto;min-height:270px;max-height:75vh;touch-action:none;user-select:none}.ap-ink{position:absolute;inset:0;width:100%;height:100%;touch-action:none;pointer-events:none}.ap-ink.enabled{pointer-events:auto}.ap-inspector{padding:14px 16px;background:#edf7f6;border:1px solid #c6dfdd;border-radius:12px;margin:12px 0;line-height:1.8;overflow-wrap:anywhere;font-size:16px}.ap-metric-row{display:flex;gap:8px;flex-wrap:wrap}.ap-metric{flex:1;min-width:110px;padding:10px;border:1px solid #c9dedf;background:#fff;border-radius:10px}.ap-metric small{display:block;color:#516b78}.ap-metric b{display:block;font-size:23px}.ap-control{display:block;margin:15px 0;color:#17394d;font-size:16px;line-height:1.7}.ap-control>span{display:flex;justify-content:space-between;gap:10px}.ap-control input[type=range]{display:block;width:100%;min-height:36px;accent-color:#116f70}.ap-control select{width:100%}.ap-ctlbox{padding:4px 10px}.ap-controls-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}.ap-root textarea{width:100%;min-height:90px;padding:12px;border-radius:9px;border:1px solid #b7cdcf;background:white;color:#17394d;resize:vertical;line-height:1.7}.ap-source{font-size:13px;color:#526e77;line-height:1.7}.ap-question{border:1px solid #c7dadd;border-radius:14px;padding:16px;margin-top:15px;background:#fff}.ap-question h3{margin-top:0;font-size:18px;color:#124e5c}.ap-question p{line-height:1.8}.ap-question .ap-answer{padding:12px;background:#e8f5f1;border-radius:9px;margin-top:12px}.ap-question [hidden]{display:none!important}.ap-status{font-size:14px;min-height:24px;padding:7px 0;color:#295b68}.ap-records{padding-left:20px;max-height:170px;overflow:auto;font-size:14px;line-height:1.9}.ap-root .ap-tools{display:flex;gap:7px;flex-wrap:wrap}.ap-root .ap-tools label{display:flex;gap:5px;align-items:center;font-size:13px}.ap-root input[type=color]{width:38px;height:36px;border:0;padding:0}.ap-root input[type=number]{width:64px}.ap-equation{overflow-x:auto;padding:6px 0;min-height:35px}.ap-root .ap-note{font-size:14px;color:#4e6571;line-height:1.7}.ap-standalone{max-width:1500px;margin:auto;padding:24px}.ap-standalone h1{font-size:clamp(26px,4vw,40px)}.ap-shell{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:20px}.ap-side{background:#fff;padding:16px;border-radius:16px;border:1px solid #c9dcdf}.ap-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:15px;margin:24px 0}.ap-gallery a{display:block;padding:24px;background:white;border:1px solid #cbdde1;border-radius:16px;text-decoration:none;color:#133c4c;line-height:1.8}.ap-gallery strong{font-size:20px;display:block}.ap-big{font-size:19px}.ap-big button,.ap-big select{font-size:18px}.ap-root .ap-net-cell{cursor:pointer}.ap-root .ap-net-cell:focus-visible{outline:3px solid #bc672b}.ap-root .ap-live-number{font-variant-numeric:tabular-nums}.ap-print-heading{display:none}@media(max-width:900px){.ap-shell{grid-template-columns:1fr}.ap-standalone{padding:12px}.ap-banner{align-items:start;flex-direction:column}.ap-controls-pair{grid-template-columns:1fr}.ap-svg{min-height:230px}.ap-top{padding:9px}.ap-root button{min-height:44px}.ap-metric b{font-size:20px}}@media print{body:has(>#ap-print-root)>*:not(#ap-print-root){display:none!important}.ap-print-heading{display:block}#ap-print-root{display:block!important;color:#132f42;background:white}#ap-print-root svg{width:100%;max-height:135mm}#ap-print-root canvas{display:none}#ap-print-root .ap-toolbar,#ap-print-root .ap-top,#ap-print-root input,#ap-print-root button{display:none!important}}
/* Override fixed-height legacy stages only while an enhancement is mounted. */
body.at .stage.ap-host-stage{height:auto!important;min-height:0!important;max-height:none!important;aspect-ratio:auto!important;padding:12px;overflow:visible;touch-action:auto;user-select:auto}
body.at .ap-host-panel{position:static!important;overflow:hidden}
body.at .ap-host-stage .ap-svg{position:static;width:100%;height:auto!important;max-width:100%;max-height:75vh;overflow:hidden}
body.at .ap-host-stage .ap-root{background:#f8fbfd;color:#17394d}
body.at .ap-host-stage .ap-question{color:#17394d}
body.at .ap-host-panel .metrics>.ap-metric-row{display:flex;flex:1;max-width:none;padding:0}
body.at .control-panel .ap-root{background:#fff;color:#17394d;padding:12px;border-radius:12px}
body.at .ap-host-stage .ap-root .ap-svg text{font-family:system-ui,sans-serif}
@media(max-width:600px){body.at .ap-host-stage .ap-svg{min-height:0}.ap-root .ap-tools{gap:5px}.ap-root button{font-size:14px;padding:8px}.ap-top .ap-tools label{font-size:12px}}
/* A stable aspect ratio keeps exported ink aligned with the mathematical view. */
.ap-root .ap-svg,body.at .ap-host-stage .ap-svg{min-height:0!important;max-height:none!important;aspect-ratio:900/550}
.ap-canvas-wrap.ap-zoom{overflow:auto}
.ap-canvas-wrap.ap-zoom .ap-svg{width:1350px!important;min-width:1350px;max-width:none!important}
.ap-canvas-wrap.ap-zoom .ap-ink{width:1350px!important}
@media(max-width:700px){.ap-canvas-wrap{overflow:auto}.ap-root .ap-svg,body.at .ap-host-stage .ap-svg{min-width:680px}.ap-root .ap-ink{width:max(100%,680px)!important}}
.ap-root .ap-equation svg{position:static!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important}
.ap-root [data-ap=pan][aria-pressed=true]{background:#126f70;color:white}
