body.math-page{background:#f9f5e9;color:#203b4f;font-family:system-ui,sans-serif;margin:0} .math-page main{max-width:900px;margin:auto;padding:16px;box-sizing:border-box}.math-head{display:flex;align-items:center;gap:14px}.math-head img{width:72px;height:72px;object-fit:contain}.math-page h1{font-size:clamp(1.65rem,5vw,2.4rem);line-height:1.15}.math-page h2{font-size:1.5rem}.math-page p{line-height:1.65}.math-page button,.math-page select,.math-page input{font:inherit;min-height:44px;box-sizing:border-box;border:1px solid #aeb9c4;border-radius:10px;padding:10px 14px;background:white;color:#203b4f;max-width:100%}.math-page button{cursor:pointer;font-weight:650}.math-page button:hover,.math-page button[aria-pressed=true]{background:#244884;color:white}.math-page button:disabled{opacity:.55;cursor:default}.math-page :focus-visible{outline:3px solid #a15a0e;outline-offset:3px}.math-page nav,.math-actions,.math-settings,.math-options{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:14px 0}.math-page nav a{padding:9px 0;color:#244884;font-weight:650}.math-settings label,.math-card label{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.math-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:12px}.math-grid button{min-height:80px;text-align:left;background:#fffdf7;border-color:#cbb78b}.math-grid button:hover{background:#244884}.math-card{padding:clamp(14px,4vw,25px);background:white;border:1px solid #d5c6a9;border-radius:16px;margin:14px 0}.math-card h3{line-height:1.4}.math-visual{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7;font-size:clamp(1.2rem,4vw,1.8rem);letter-spacing:.08em;background:#edf3f7;padding:15px;border-radius:12px;margin:12px 0;color:#244884}.math-note{background:#f5f0df;border-inline-start:4px solid #ad8c4c;padding:12px;line-height:1.6;border-radius:6px;overflow-wrap:anywhere}.math-note:empty{display:none}.math-kicker{font-weight:bold;color:#315b8c}.math-options button{min-width:76px}.math-page input[type=checkbox]{min-height:20px;min-width:20px}.math-page #math-paper{display:none}.math-page #math-content{scroll-margin-top:12px}.math-page footer{margin-top:24px}.math-page #math-paper article{break-inside:avoid}.math-page #math-paper h3{font-size:13pt}.math-page #math-paper .math-visual{font-size:13pt;line-height:1.3}@media print{@page{size:A4;margin:16mm}.math-page.math-printing main,.math-page.math-printing footer{display:none!important}.math-page.math-printing #math-paper{display:block;color:#111;background:white;font-size:11pt}.math-page.math-printing{background:white}.math-page #math-paper article{border-bottom:1px solid #ccc;padding:4mm 0}}

/* V21: question context, focus, mobile reflow and print. */
.vp-question-text{white-space:pre-line;overflow-wrap:anywhere;line-height:1.55}.vp-question-audio{font-size:.95rem;min-height:44px}.math-card,.math-options,.math-settings,.math-actions{min-width:0;max-width:100%;overflow-wrap:anywhere}.math-options button{min-height:48px;white-space:normal;overflow-wrap:anywhere}.math-settings select{min-width:0;max-width:100%}.speech-status:empty{display:none}@media(max-width:420px){.math-settings label{width:100%;align-items:flex-start;flex-direction:column}.math-options button{width:100%}}@media print{.vp-question-audio,.speech-status{display:none!important}}

/* V22: keyboard focus, reflow, explicit audio control. */
.vp-audio-controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center;min-width:0;margin-block:8px}.vp-audio-controls button{min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere}.vpgen-audio-status:empty,.speech-status:empty{display:none}.math-page :is(button,select,input,summary):focus-visible,.vpgen :is(button,select,input,summary):focus-visible{outline:3px solid #244884;outline-offset:3px}.math-visual,.vpgen-visual{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%;box-sizing:border-box}.vp-exact,.vp-act-instruction,.vp-act-choice{min-width:0;max-width:100%;overflow-wrap:anywhere;white-space:normal}.vp-act-choice,.vp-act-next,.vp-exact-next{min-height:44px}.vp-act-instruction{line-height:1.55}.math-grid button,.vpgen-controls>*{min-width:0;max-width:100%;overflow-wrap:anywhere}@media(max-width:360px){.vp-audio-controls button{flex:1 1 100%}.math-grid{grid-template-columns:1fr!important}.vpgen-controls{grid-template-columns:1fr!important}}@media(prefers-reduced-motion:reduce){.math-page *,.vpgen *{scroll-behavior:auto!important}}@media print{.vp-audio-controls,.vpgen-audio-status,.speech-status{display:none!important}}
