/* CPA/tax answer controls only. Native paper typography remains unchanged. */
@media screen {
  #screen-study#screen-study.short-study-mode #probText input.sa-inline-input:not(.short-input-typing) { caret-color:transparent !important; }
  #screen-study#screen-study.short-study-mode #probText input.sa-inline-input.short-input-typing { caret-color:#315f9f !important; }
  #screen-study#screen-study.short-study-mode #probText .sa-inline-answer:has(input.sa-inline-input:not([readonly])):not(:has(.short-input-typing))::before,
  #screen-study#screen-study.short-study-mode #probText .sa-inline-answer:has(input.sa-inline-input:not([readonly])):not(:has(.short-input-typing))::after { animation:none !important; opacity:0 !important; }
  #screen-study#screen-study :is(.short-ui-sr-only,.short-choice-hint) { position:absolute !important; width:1px !important; height:1px !important; min-height:0 !important; padding:0 !important; margin:-1px !important; border:0 !important; overflow:hidden !important; clip-path:inset(50%) !important; white-space:nowrap !important; }
  #screen-study#screen-study.short-study-mode #feedbackArea .sa-result-title-row .sa-section-label:focus { outline:none !important; box-shadow:none !important; }
  #screen-study#screen-study.short-study-mode #probMeta.short-meta-hidden { display:block !important; position:absolute !important; width:1px !important; height:1px !important; min-height:0 !important; padding:0 !important; margin:-1px !important; border:0 !important; overflow:hidden !important; clip-path:inset(50%) !important; white-space:nowrap !important; }
  #screen-study #shortRepeatNote { margin:12px 24px 0; }
  #screen-study .short-choice-controls { box-sizing:border-box; max-width:780px; margin:16px auto 0; padding:16px 0 0; border-top:1px solid #dce1e7; color:#202a36; font:400 14px/1.5 "Pretendard Variable",Pretendard,"Noto Sans KR",system-ui,sans-serif; }
  /* Existing tax paper zoom is .74; compensate only these app controls. */
  #screen-study.semusa-short-study-mode .short-choice-controls { zoom:calc(1 / .74); }
  #screen-study#screen-study.short-study-mode .sa-result-area:has(> .short-ui-sr-only):not(:has(.sa-result-corrections,.sa-extra-result-area)) { margin-top:0 !important; padding-top:0 !important; border-top:0 !important; }
  #screen-study#screen-study.short-study-mode .sa-result-area:has(> .short-ui-sr-only):not(:has(.sa-result-corrections,.sa-extra-result-area)) > .sa-explanation { margin-top:0 !important; padding-top:0 !important; border-top:0 !important; }
  #screen-study#screen-study.short-study-mode #feedbackArea:not(:has(.sa-result-corrections,.sa-extra-result-area,.sa-explanation)),
  #screen-study#screen-study.short-study-mode #feedbackArea .sa-result-area:not(:has(.sa-result-corrections,.sa-extra-result-area,.sa-explanation)) { margin:0 !important; padding:0 !important; border:0 !important; min-height:0 !important; }
  #screen-study#screen-study.short-study-mode #feedbackArea .sa-result-corrections > .sa-result-correction-row:last-child { border-bottom:0 !important; }
  #screen-study .short-choice-group + .short-choice-group { margin-top:16px; }
  #screen-study .short-choice-label { margin-bottom:8px; font-weight:700; }
  #screen-study .short-choice-context { margin:-2px 0 8px; color:#606b78; font-size:13px; overflow-wrap:anywhere; }
  #screen-study .short-choice-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  #screen-study .short-choice-button { box-sizing:border-box; min-height:44px; padding:10px 14px; border:1px solid #aeb8c6; border-radius:4px; background:#fff; color:#202a36; font:600 15px/1.5 "Pretendard Variable",Pretendard,"Noto Sans KR",system-ui,sans-serif; white-space:normal; word-break:keep-all; overflow-wrap:break-word; cursor:pointer; }
  #screen-study .short-choice-button[aria-pressed="true"] { color:#2451bf; border-color:#2451bf; background:#edf2ff; }
  #screen-study .short-choice-key { display:inline-block; margin-right:8px; color:#606b78; font-size:12px; font-weight:500; font-variant-numeric:tabular-nums; }
  #screen-study .short-choice-button:focus-visible { outline:2px solid #2451bf; outline-offset:3px; }
  #screen-study .short-choice-hint { margin-top:10px; color:#606b78; font-size:12px; }
  #screen-study .sa-order-tray :is(.sa-order-chip,.sa-order-reset) { min-height:44px; }
  #screen-study#screen-study .short-order-controls .sa-order-tray { display:block; margin:0; padding:0; border:0; border-radius:0; background:transparent; font:inherit; }
  #screen-study#screen-study .sa-order-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:4px 16px; margin-bottom:12px; }
  #screen-study#screen-study .sa-order-target-label { font-size:15px; font-weight:700; color:#202a36; }
  #screen-study#screen-study .sa-order-heading { display:flex; flex-wrap:wrap; align-items:center; gap:4px 12px; }
  #screen-study#screen-study .sa-order-fixed-count { color:#697586; font-size:12px; }
  #screen-study#screen-study .sa-order-fixed-count:empty { display:none; }
  #screen-study#screen-study .sa-order-actions { display:flex; gap:8px; margin-left:auto; }
  #screen-study#screen-study .sa-order-actions button { box-sizing:border-box; min-height:44px; margin:0; padding:8px; border:0; background:transparent; color:#536172; font:500 13px/1.4 "Pretendard Variable",Pretendard,"Noto Sans KR",system-ui,sans-serif; text-decoration:none; cursor:pointer; }
  #screen-study#screen-study .sa-order-actions button:disabled { color:#8c96a3; cursor:default; }
  #screen-study#screen-study .sa-order-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  #screen-study#screen-study .short-order-controls .sa-order-chip { display:grid; grid-template-columns:18px minmax(0,1fr); align-items:center; align-content:center; gap:3px 8px; min-width:0; min-height:56px; padding:10px 12px; border:1px solid #aeb8c6; border-radius:4px; background:#fff; color:#202a36; font:600 14px/1.5 "Pretendard Variable",Pretendard,"Noto Sans KR",system-ui,sans-serif; text-align:left; white-space:normal; word-break:keep-all; overflow-wrap:break-word; opacity:1; }
  #screen-study#screen-study .short-order-controls .sa-order-key { min-width:0; width:auto; height:auto; border:0; border-radius:0; background:none; color:#697586; font-size:12px; font-weight:500; }
  #screen-study#screen-study .sa-order-state { grid-column:2; color:#657184; font-size:11px; font-weight:400; }
  #screen-study#screen-study .sa-order-state:empty { display:none; }
  #screen-study#screen-study .short-order-controls .sa-order-chip.is-used { background:#eef3fc; border-color:#92a9d0; cursor:grab; opacity:1; }
  #screen-study#screen-study .short-order-controls .sa-order-chip.is-fixed { background:#f1f3f5; border-color:#d8dee6; color:#687384; cursor:default; opacity:1; }
  #screen-study#screen-study .short-order-controls .sa-order-chip[hidden] { display:none !important; }
  #screen-study#screen-study .sa-order-tray[data-available-count="1"] .sa-order-options { grid-template-columns:minmax(0,1fr); }
  #screen-study#screen-study .short-order-controls .sa-order-chip.is-dragging { opacity:.4; }
  #screen-study#screen-study.short-study-mode #probText .sa-order-game .sa-choice-answer { outline:none !important; box-shadow:none !important; }
  #screen-study#screen-study.short-study-mode #probText .sa-order-game select.sa-choice-input { appearance:none !important; -webkit-appearance:none !important; background-image:none !important; pointer-events:none !important; outline:none !important; box-shadow:none !important; }
  #screen-study#screen-study.short-study-mode #probText .sa-order-game select.sa-choice-input:has(option[value=""]:checked) { color:transparent !important; text-shadow:none !important; }
  #screen-study#screen-study.short-study-mode #probText .sa-order-game .sa-order-target select.sa-choice-input { border-color:#2451bf !important; box-shadow:0 0 0 1px #2451bf !important; }
  #screen-study#screen-study .sa-order-actions button:focus-visible { outline:2px solid #2451bf; outline-offset:2px; }
  #screen-study .cpa-repeat-note { display:inline-flex; flex-wrap:wrap; align-items:center; gap:6px 10px; margin-left:12px; font:400 13px/1.5 "Pretendard Variable",Pretendard,"Noto Sans KR",system-ui,sans-serif; color:#606b78; }
  #screen-study .cpa-repeat-label { font-weight:700; }
  @media (max-width:640px) {
    #screen-study .short-choice-button { min-height:48px; }
    #screen-study .cpa-repeat-note { display:flex; margin:6px 0 0; }
    #screen-study#screen-study .sa-order-options { grid-template-columns:repeat(2,minmax(0,1fr)); }
    #screen-study#screen-study .sa-order-actions button { min-height:48px; }
    #screen-study#screen-study .short-order-controls .sa-order-chip { min-height:56px; padding:10px; }
  }
}
@media print { #screen-study .short-choice-controls, #screen-study .cpa-repeat-note, #screen-study .short-ui-sr-only { display:none !important; } }

/* v7: public-choice dimensions are measured once for all visible answer states. */
@media screen {
  #screen-study#screen-study#screen-study #probText .sa-stable-choice-slot > .sa-stable-original { display:none !important; }
  #screen-study#screen-study#screen-study #probText .sa-preserved-free-result { display:inline-flex !important; box-sizing:border-box !important; width:var(--preserved-answer-width) !important; min-width:var(--preserved-answer-width) !important; height:var(--preserved-answer-height) !important; min-height:0 !important; align-items:center !important; justify-content:center !important; vertical-align:var(--preserved-answer-align) !important; }
  #screen-study#screen-study #probText .sa-stable-choice-slot { display:inline-grid !important; grid-template-columns:var(--stable-slot-w) var(--stable-mark-w); width:calc(var(--stable-slot-w) + var(--stable-mark-w)); height:var(--stable-slot-h); box-sizing:border-box; vertical-align:middle; margin:0; padding:0; border:0; background:none; color:inherit; }
  #screen-study#screen-study #probText .sa-stable-choice-control { appearance:none !important; display:flex !important; align-items:center; justify-content:center; box-sizing:border-box; width:var(--stable-slot-w) !important; min-width:0 !important; max-width:none !important; height:var(--stable-slot-h) !important; min-height:0 !important; margin:0 !important; padding:4px 9px !important; border:0 !important; border-radius:0 !important; box-shadow:inset 0 -1px #8a94a1 !important; background:#f6f7f9 !important; color:#202a35 !important; font-family:var(--stable-paper-font) !important; font-size:var(--stable-paper-size) !important; font-weight:var(--stable-paper-weight) !important; line-height:var(--stable-paper-line) !important; letter-spacing:inherit !important; white-space:normal !important; text-align:center; cursor:pointer; scroll-margin-bottom:80px; }
  #screen-study#screen-study #probText .sa-stable-choice-text { font:inherit !important; color:inherit !important; white-space:normal !important; word-break:keep-all; overflow-wrap:anywhere; }
  #screen-study#screen-study #probText .sa-stable-choice-control[aria-current="true"] { background:#e8effc !important; box-shadow:inset 0 -2px #2451bf !important; }
  #screen-study#screen-study #probText button.sa-stable-choice-control:focus-visible { outline:2px solid #2451bf !important; outline-offset:2px !important; }
  #screen-study#screen-study #probText .sa-stable-choice-slot[data-fixed="true"] .sa-stable-choice-control { background:transparent !important; box-shadow:none !important; cursor:default; }
  #screen-study#screen-study #probText .sa-stable-choice-slot[data-graded="true"] .sa-stable-choice-control { background:#fff !important; box-shadow:inset 0 -1px #c3cad3 !important; cursor:default; }
  #screen-study#screen-study #probText .sa-stable-choice-slot[data-result="wrong"] .sa-stable-choice-control { box-shadow:none !important; background-image:linear-gradient(to right,#b91c1c 55%,transparent 0%) !important; background-size:6px 1px !important; background-position:left bottom !important; background-repeat:repeat-x !important; }
  #screen-study#screen-study .sa-stable-choice-mark { display:flex; align-items:center; justify-content:center; font:600 16px/1 system-ui,sans-serif; color:#1a6b3c; }
  #screen-study#screen-study .sa-stable-choice-slot[data-result="wrong"] .sa-stable-choice-mark { color:#b91c1c; }
  #screen-study#screen-study .sa-order-options,
  #screen-study#screen-study .sa-order-tray[data-available-count="1"] .sa-order-options { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  #screen-study#screen-study .short-order-controls .sa-order-chip { min-height:44px; padding:8px 12px; font-size:15px; font-weight:500; line-height:1.45; gap:4px 10px; }
  #screen-study#screen-study .short-order-controls .sa-order-chip.is-used { background:#f5f6f8; border-color:#dce1e7; color:#4b5868; }
  #screen-study#screen-study .short-order-controls .sa-order-key,#screen-study#screen-study .sa-order-state { color:#4b5868; font-size:13px; }
  #screen-study#screen-study .sa-order-state { min-height:19px; }
  #screen-study#screen-study .sa-order-state:empty { display:block; }
  #screen-study#screen-study .sa-order-actions button { color:#2451bf; font-size:14px; }
  #screen-study#screen-study .sa-order-actions button:disabled { color:#606b78; }
  #screen-study#screen-study .sa-order-fixed-count { color:#4b5868; font-size:13px; }
  #screen-study#screen-study .sa-order-heading #shortRepeatNote { margin:0; font-size:13px; }
  #screen-study#screen-study.stable-short-flow { min-height:0 !important; padding-bottom:24px !important; }
  #screen-study#screen-study.stable-short-flow #studyQuestionCard,
  #screen-study#screen-study.stable-short-flow #studyPaperBox { background:#fff !important; border-color:transparent !important; box-shadow:none !important; }
  #screen-study#screen-study.stable-short-flow #shortChoiceOutcome { display:flow-root; box-sizing:border-box; margin:0; padding:0; }
  #screen-study#screen-study#screen-study.stable-short-flow #shortChoiceOutcome :is(#feedbackArea,#expArea):not(:empty) { width:var(--short-paper-width) !important; max-width:none !important; margin-left:var(--short-paper-left) !important; margin-right:0 !important; box-sizing:border-box; }
  #screen-study#screen-study#screen-study.stable-short-flow #shortChoiceOutcome :is(.sa-result-area,.sa-explanation,.sa-explanation-text,.exp-inner,.sa-result-corrections) { padding-left:0 !important; padding-right:0 !important; }
  #screen-study#screen-study.stable-short-flow #feedbackArea :is(.sa-result-area,.sa-explanation) { max-width:none !important; }
  #screen-study#screen-study.stable-short-flow .study-mini-nav.stable-short-actions { position:static !important; inset:auto !important; transform:none !important; display:flex !important; justify-content:flex-end !important; align-items:center !important; gap:12px !important; margin:12px auto 0 !important; padding:0 !important; width:min(920px,calc(100vw - 32px)) !important; border:0 !important; background:transparent !important; box-shadow:none !important; pointer-events:auto !important; }
  #screen-study#screen-study.stable-short-flow .stable-short-actions .study-mini-nav-btn { position:static !important; transform:none !important; inset:auto !important; box-sizing:border-box !important; width:auto !important; min-width:96px !important; height:44px !important; min-height:44px !important; margin:0 !important; padding:0 20px !important; border:1px solid #cbd3dd !important; border-radius:4px !important; background:#fff !important; color:#202a36 !important; box-shadow:none !important; font:600 15px/1.4 "Pretendard Variable",Pretendard,"Noto Sans KR",system-ui,sans-serif !important; }
  #screen-study#screen-study.stable-short-flow .stable-short-actions #nextBtn { color:#fff !important; background:#2451bf !important; border-color:#2451bf !important; }
  #screen-study#screen-study.stable-short-flow .stable-short-actions .study-mini-nav-btn::after { content:none !important; }
  #screen-study#screen-study.stable-short-flow .stable-short-actions .study-mini-nav-btn:focus-visible { outline:2px solid #2451bf !important; outline-offset:2px !important; }
  #screen-study#screen-study.semusa-short-study-mode .stable-short-actions { zoom:calc(1 / .74); max-width:calc(920px * .74); }
  @media(max-width:640px){
    #screen-study#screen-study .sa-order-options,
    #screen-study#screen-study .sa-order-tray[data-available-count="1"] .sa-order-options { grid-template-columns:minmax(0,1fr); }
    #screen-study#screen-study .short-order-controls .sa-order-chip { min-height:48px; }
    #screen-study#screen-study.stable-short-flow { padding-bottom:0 !important; }
    #screen-study#screen-study.stable-short-flow .study-mini-nav.stable-short-actions { position:sticky !important; bottom:0 !important; display:grid !important; grid-template-columns:1fr 2fr !important; width:100% !important; max-width:none !important; gap:8px !important; padding:8px 12px calc(8px + env(safe-area-inset-bottom)) !important; margin:12px 0 0 !important; background:#eef1f4 !important; border-top:1px solid #dce1e7 !important; z-index:40 !important; box-sizing:border-box !important; }
    #screen-study#screen-study.stable-short-flow .stable-short-actions .study-mini-nav-btn { min-width:0 !important; width:100% !important; min-height:48px !important; height:48px !important; padding:0 12px !important; }
  }
}
@media print {
  #screen-study .sa-stable-choice-slot { display:contents !important; }
  #screen-study .sa-stable-choice-control,#screen-study .sa-stable-choice-mark { display:none !important; }
  #screen-study #shortChoiceOutcome { display:contents !important; min-height:0 !important; }
  #screen-study .stable-short-actions { display:none !important; }
}

@media screen {
  #screen-study#screen-study#screen-study #probText .sa-preserved-free-result {
    margin-left:var(--preserved-answer-margin-left,0)!important;
    margin-right:var(--preserved-answer-margin-right,0)!important;
    overflow-x:auto; overflow-y:hidden; justify-content:safe center !important;
  }
  #screen-study #probText .sa-preserved-free-result > .sa-inline-result-text { flex:0 0 auto; }
  /* Finish the existing blur-fit immediately before grading a mixed choice prompt. */
  #screen-study#screen-study#screen-study #probText:has(.sa-stable-choice-slot) input.sa-inline-input {
    transition-property:border-color,background-color !important;
  }
  /* The short-answer CTA now has its own flow/sticky row; empty MCQ padding is not needed. */
  #screen-study#screen-study#screen-study.stable-short-flow #choicesArea:empty {
    padding:0 !important; min-height:0 !important; margin:0 !important;
  }
}

/* CPA free-answer numbers precede the field and never occupy its typing area. */
@media screen {
  #screen-study#screen-study#screen-study#screen-study.short-study-mode #probText .sa-inline-number {
    display:inline-block !important; margin:0 .3em 0 0 !important;
    padding:0 !important; color:#6b7480 !important; font-size:.75em !important;
    font-weight:400 !important; line-height:1 !important; vertical-align:baseline !important;
    border:0 !important; background:none !important; user-select:none;
  }
  #screen-study#screen-study#screen-study#screen-study.short-study-mode #probText .sa-inline-answer:not(.sa-stable-original) {
    white-space:nowrap !important;
  }
}
