/* Unit-local screen and A4 physical worksheet contracts (approved v1.3). */
#page-quiz[data-unit=area_enclose_subtract4_5] .quiz-page{min-height:0!important;padding-bottom:8px!important}
#page-quiz[data-unit=area_enclose_subtract4_5] #question-text{font-size:clamp(18px,3.2vw,24px);line-height:1.5;white-space:normal;overflow-wrap:anywhere}
#page-quiz[data-unit=area_enclose_subtract4_5] #answer-zone{box-sizing:border-box;width:100%;max-width:100%;min-width:0;padding:4px 8px}
.aes-figure-wrap{max-width:100%;margin:0 auto;text-align:center}
.aes-figure{display:block;width:378px;max-width:100%;height:auto;margin:0 auto}
.aes-figure-pair{display:flex;justify-content:center;align-items:flex-start;gap:12px;max-width:100%;margin:auto}
.aes-original{width:308px;max-width:100%;flex:none}
.aes-moved{width:126px;flex:none}
.aes-figure-name{font-weight:700;font-size:16px;line-height:1.5;text-align:center}
.aes-alt{font-size:16px;line-height:1.45;text-align:left;white-space:normal;overflow-wrap:anywhere;margin:4px auto 8px;max-width:700px}
.aes-input-row{display:flex;justify-content:center;align-items:center;gap:6px;font-size:22px}
#page-quiz[data-unit=area_enclose_subtract4_5] #answer-input{display:block;box-sizing:border-box;width:min(65%,230px);min-width:44px;min-height:48px;resize:none;padding:6px;border:2px solid #526575;border-radius:6px;font:24px 'Atkinson Hyperlegible','BIZ UDPGothic',sans-serif;text-align:center;background:#fff;color:#152230}
#page-quiz[data-unit=area_enclose_subtract4_5] #answer-input:focus{outline:3px solid #5880c5;outline-offset:2px}
#page-quiz[data-unit=area_enclose_subtract4_5] #answer-input[aria-invalid=true]{border-color:#b3261e}
#page-quiz[data-unit="area_enclose_subtract4_5"] #aes-guide{font-size:16px;line-height:1.5;white-space:normal;margin:6px auto}
#page-quiz[data-unit=area_enclose_subtract4_5] #numpad-zone{position:static!important;max-width:100%;padding:4px 0!important;margin:0!important}
#page-quiz[data-unit=area_enclose_subtract4_5] #numpad-inner{max-width:300px;margin:auto}
#page-quiz[data-unit=area_enclose_subtract4_5] .num-btn{min-width:44px;min-height:44px}
#page-quiz[data-unit=area_enclose_subtract4_5] #submit-bar{position:static!important;inset:auto!important;width:auto!important;max-width:100%!important;margin:4px 12px!important;padding:8px 0!important;background:transparent!important;box-shadow:none!important;transform:none!important}
#page-quiz[data-unit=area_enclose_subtract4_5] #quit-btn,#page-quiz[data-unit=area_enclose_subtract4_5] #hint-btn,#page-quiz[data-unit=area_enclose_subtract4_5] #submit-btn,#page-quiz[data-unit=area_enclose_subtract4_5] .next-hint-btn{min-height:44px}
#page-quiz[data-unit=area_enclose_subtract4_5] #feedback{display:flex!important;flex-direction:column!important;gap:4px;align-items:center;justify-content:center;text-align:center;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;line-height:1.5;white-space:normal;overflow-wrap:anywhere;font-size:17px}
#page-quiz[data-unit=area_enclose_subtract4_5] #feedback>p{margin:0;max-width:100%}
#page-quiz[data-unit=area_enclose_subtract4_5] #quiz-expl{height:auto!important;max-height:none!important;overflow:visible!important;font-size:17px;line-height:1.6;white-space:normal;overflow-wrap:anywhere;text-align:left}
#page-quiz[data-unit=area_enclose_subtract4_5] #quiz-expl p{margin:4px 0}
#page-quiz[data-unit=area_enclose_subtract4_5] #numpad-handoff-spacer{display:none!important}
#result-details .result-row-top:has(.aes-history-prompt){flex-wrap:wrap;gap:8px;align-items:flex-start}
#result-details .q-text:has(.aes-history-prompt),#result-details .result-row-top:has(.aes-history-prompt)>span:last-child{flex:1 1 100%;min-width:0;overflow-wrap:anywhere}
@media(max-width:640px){.aes-figure-pair{flex-direction:column;align-items:center}.aes-original{width:264px}.aes-moved{width:144px}.aes-figure{width:324px}body.quiz-focus:has(#page-quiz.active[data-unit=area_enclose_subtract4_5])>header{display:flex}}

#pr-sheet[data-unit=area_enclose_subtract4_5]>:not(#pr-problems){display:none!important}
#pr-sheet[data-unit=area_enclose_subtract4_5]{box-sizing:border-box;width:210mm!important;min-width:210mm!important;max-width:none!important;height:297mm!important;min-height:297mm!important;padding:10mm!important;margin:16px auto!important;transform:none!important;background:#fff!important;color:#000!important;overflow:hidden!important}
#pr-sheet[data-unit=area_enclose_subtract4_5] #pr-problems{display:block!important;box-sizing:border-box;width:190mm!important;height:277mm!important;min-height:277mm!important;padding:0!important;margin:0!important;column-count:1!important;transform:none!important}
#page-print:has(#pr-sheet[data-unit=area_enclose_subtract4_5]){max-width:100%;overflow-x:auto;padding:0 12px 16px;box-sizing:border-box}
#page-print:has(#pr-sheet[data-unit=area_enclose_subtract4_5]) .pr-toolbar{position:sticky;left:0;width:100%;min-width:0;box-sizing:border-box;gap:6px;flex-wrap:wrap}
.aes-print-page{box-sizing:border-box;width:190mm;height:277mm;background:#fff;color:#000;font-family:'Atkinson Hyperlegible','BIZ UDPGothic',sans-serif;text-align:left;line-height:1.2;transform:none!important}
.aes-print-page *{box-sizing:border-box;color:#000}
.aes-print-head{height:46mm;position:static;display:block;padding:0;margin:0;background:#fff;box-shadow:none}
.aes-print-head h1{font-size:14.2pt!important;line-height:calc(7mm - 3pt)!important;height:7mm;text-align:center;margin:0!important;padding:0!important;font-weight:700;white-space:nowrap;border:1.5pt solid #666;border-radius:0;background:#ffffcc;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.aes-print-page .pp-fields{width:186mm;height:8mm;margin:1mm 0 0;font-size:12.5pt!important;gap:4mm}
.aes-print-page .pp-fields-group{gap:2mm}
.aes-print-page .pp-field{gap:1mm}
.aes-print-page .pp-field-line{width:14.1mm;height:6.1mm}
.aes-print-page .pp-field-name .pp-field-line{min-width:40mm}
.aes-print-page hr.pp-fields-solid{margin:1mm 0!important;width:186mm;border:0;border-top:.3mm solid #555}
.aes-print-instruction{font-size:12.6pt!important;line-height:5.5mm!important;width:186mm;height:22mm;max-height:22mm;margin:0!important;padding:0;white-space:normal;overflow-wrap:normal}
.aes-print-columns{display:grid;grid-template-columns:90mm 90mm;column-gap:6mm;width:186mm;height:195mm;margin:0;padding:0}
.aes-print-column{display:flex;flex-direction:column;width:90mm;height:195mm}
.aes-print-question{display:flex;align-items:flex-start;width:90mm;height:39mm;min-height:39mm;max-height:39mm;margin:0;padding:0;break-inside:avoid;page-break-inside:avoid}
.aes-print-entry{width:19mm;flex:none;margin:0 2mm 0 0}
.aes-print-number{font-size:12.6pt!important;line-height:6mm;height:6mm;margin:0}
.aes-print-boxrow{display:flex;align-items:center;gap:1mm;font-size:10.2pt!important;line-height:7mm;white-space:nowrap}
.aes-writing-box{display:block;width:12.1mm;height:7.1mm;border:.25mm solid #111;border-radius:0;flex:none}
.aes-print-figure{width:64mm;height:34mm;flex:none;margin:0;padding:0}
.aes-print-page .aes-figure-wrap{width:64mm;height:34mm;margin:0;padding:0;text-align:left}
.aes-print-page .aes-figure{display:block;width:54mm!important;height:34mm!important;max-width:none!important;margin:0!important}
.aes-print-page .aes-figure-pair{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;gap:2mm;width:64mm;height:34mm}
.aes-print-page .aes-original{width:44mm;max-width:none}
.aes-print-page .aes-moved{width:18mm}
.aes-print-page .aes-original .aes-figure{width:44mm!important;height:30mm!important}
.aes-print-page .aes-moved .aes-figure{width:18mm!important;height:15mm!important}
.aes-print-page .aes-figure-name{width:100%;height:4mm;font-size:9.2pt!important;font-weight:400;line-height:4mm!important;white-space:nowrap}
.aes-print-page .aes-alt{display:none!important}
.aes-print-answers{width:186mm;height:31mm;border-top:.45mm dashed #aaa;margin:0;padding:0}
.aes-print-answers h2{font-size:12.6pt!important;height:6mm;line-height:6mm!important;margin:0!important;padding:0;text-align:left}
.aes-print-answer-grid{display:grid;grid-template-columns:90mm 90mm;column-gap:6mm}
.aes-print-answer{font-size:10.2pt!important;height:4.5mm;line-height:4.5mm!important;margin:0!important;padding:0;white-space:nowrap}
.aes-app-host{position:absolute;left:0;top:0;width:190mm;height:277mm;z-index:-100;background:#fff;pointer-events:none}
.aes-app-capture{position:absolute;left:0;top:0;margin:0!important}
@media print{
 #page-print:has(#pr-sheet[data-unit=area_enclose_subtract4_5]){padding:0!important;margin:0!important;overflow:visible!important}
 #pr-sheet[data-unit=area_enclose_subtract4_5]{width:190mm!important;min-width:190mm!important;height:277mm!important;min-height:277mm!important;margin:0!important;padding:0!important;box-shadow:none!important;transform:none!important;overflow:visible!important}
 #pr-sheet[data-unit=area_enclose_subtract4_5] #pr-problems{height:277mm!important;min-height:277mm!important;display:block!important}
 .aes-print-page{margin:0!important;padding:0!important;break-after:auto;page-break-after:auto}
}
