.mock-exam-intro { width:min(1120px,100%); }
.mock-levels { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; margin:22px 0; }
.mock-levels button { min-height:46px; border:1px solid #d8b57f; background:#fffaf0; color:#782117; border-radius:11px; font-weight:800; }
.mock-levels button.active { background:#8c241a; color:#fff; }
.mock-exam-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; min-height:120px; }
.mock-exam-card { display:flex; flex-direction:column; gap:9px; padding:18px; border:1px solid #dfc49b; border-radius:15px; background:#fffaf0; box-shadow:0 8px 22px rgba(91,45,22,.08); }
.mock-exam-card h2 { margin:0; color:#782117; font-size:21px; }
.mock-exam-card p { flex:1; margin:0; color:#6f5b49; }
.mock-exam-card button { width:100%; }
.mock-workspace { width:min(1450px,100%); }
.mock-workspace-head { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; margin-bottom:15px; }
.mock-audio-list { display:grid; gap:8px; margin:14px 0; }
.mock-audio-item { display:grid; grid-template-columns:minmax(160px,260px) 1fr; gap:12px; align-items:center; padding:10px; border:1px solid #dfc49b; border-radius:12px; background:#fffaf0; }
.mock-audio-item audio { width:100%; }
.mock-speaking-panel { margin:14px 0; padding:16px; border:1px solid #dfc49b; border-radius:15px; background:#fffaf0; }
.mock-speaking-panel h2 { margin:0 0 6px; color:#782117; }
.mock-speaking-panel p { margin:5px 0 12px; }
.mock-recorder-actions { display:flex; flex-wrap:wrap; gap:8px; }
.mock-record-status { font-weight:700; color:#765f4c; }
#mock-record-playback { width:min(620px,100%); margin-top:8px; }
.mock-result-assessment { margin-top:8px; padding:10px 12px; border:1px solid #b9d8c2; border-radius:9px; background:#f4fbf6; }
.mock-document-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(340px,.75fr); gap:16px; }
.mock-document-grid > section { padding:14px; border:1px solid #dfc49b; border-radius:15px; background:#fffaf0; }
#mock-question-pdf { width:100%; height:72vh; border:1px solid #ead8b9; border-radius:10px; background:#fff; }
.mock-answer-sheet { display:grid; gap:9px; max-height:62vh; overflow:auto; margin-bottom:12px; }
.mock-answer-row { padding:10px; border:1px solid #ead8b9; border-radius:11px; background:#fff; }
.mock-answer-row p { margin:0 0 8px; }
.mock-answer-options { display:grid; grid-template-columns:repeat(4,1fr); gap:5px; }
.mock-answer-options label { display:flex; align-items:center; justify-content:center; gap:5px; margin:0; padding:7px; border:1px solid #d8c5a5; border-radius:8px; cursor:pointer; }
.mock-answer-options input { width:auto; min-height:0; }
.mock-result { margin-top:12px; padding:12px; border-radius:10px; }
.mock-result.success { background:#e6f2e9; color:#245f3d; }
@media (max-width:900px) {
  .mock-levels { grid-template-columns:repeat(3,1fr); }
  .mock-exam-list { grid-template-columns:1fr 1fr; }
  .mock-document-grid { grid-template-columns:1fr; }
  #mock-question-pdf { height:65vh; }
}
@media (max-width:600px) {
  .mock-exam-list { grid-template-columns:1fr; }
  .mock-workspace-head { flex-direction:column; }
  .mock-audio-item { grid-template-columns:1fr; }
}

.report-question,.mock-report-question{min-height:38px;padding:7px 12px;border:1px solid #d8bc8a;border-radius:10px;background:#fffaf0;color:#7b2018;font-weight:700;cursor:pointer}.mock-answer-row{position:relative}.mock-report-question{margin-top:8px}

/* V156: đồng bộ hiệu suất máy tính và điện thoại */
@media (max-width:760px){
  html{scroll-behavior:auto}
  body{-webkit-text-size-adjust:100%;text-size-adjust:100%}
  button,a,input,select,textarea{touch-action:manipulation}
  .guest-limit-overlay,.guest-gate-backdrop,.recruitment-topbar{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  .guest-limit-card,.writing-card,.mock-exam-card,.student-login-card,.student-dashboard-header{box-shadow:0 8px 24px rgba(60,28,13,.12)!important}
}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}


/* V158: cân bằng trạng thái hạn mức đề mô phỏng */
#mock-quota-status{
  display:block;
  width:100%;
  margin:16px 0 0;
  padding:12px 14px;
  min-height:46px;
  border:1px solid #e2c89d;
  border-radius:12px;
  background:#f7ead2;
  color:#732219;
  line-height:1.45;
  text-align:center;
}
.mock-levels>*{min-width:0}
@media(max-width:600px){#mock-quota-status{text-align:left}.mock-levels{gap:7px}}

/* V188: giao diện làm đề mô phỏng theo từng câu */
.mock-exam-commandbar{position:sticky;top:8px;z-index:20;display:grid;grid-template-columns:1fr 1fr auto;gap:10px;align-items:center;margin:12px 0;padding:11px 14px;border:1px solid #d8b57f;border-radius:14px;background:rgba(255,250,240,.96);box-shadow:0 8px 22px rgba(91,45,22,.12)}
.mock-exam-commandbar>div{display:flex;flex-direction:column}.mock-exam-commandbar span{font-size:13px;color:#765f4c}.mock-exam-commandbar strong{font-size:22px;color:#782117}
.mock-question-map{display:grid;grid-template-columns:repeat(10,minmax(38px,1fr));gap:7px;margin:12px 0;padding:12px;border:1px solid #dfc49b;border-radius:14px;background:#fffaf0}
.mock-question-map button{min-height:40px;border:1px solid #d8c5a5;border-radius:9px;background:#fff;color:#782117;font-weight:800}.mock-question-map button.answered{background:#e7f4ea;border-color:#9ec9a9}.mock-question-map button.current{outline:3px solid #dda441;background:#8c241a;color:#fff}
.mock-question-stage{margin:14px 0;padding:18px;border:1px solid #dfc49b;border-radius:17px;background:#fffaf0}.mock-section-label{display:inline-block;margin-bottom:10px;padding:5px 10px;border-radius:999px;background:#f3dfba;color:#782117;font-weight:800}
.mock-question-card{min-height:330px;padding:18px;border:1px solid #ead8b9;border-radius:14px;background:#fff}.mock-question-card header{display:flex;justify-content:space-between;align-items:center;gap:12px}.mock-question-card header>span{font-size:20px;font-weight:900;color:#782117}.mock-question-card h2{font-size:22px;line-height:1.55;color:#2e2219;white-space:pre-line}.mock-question-card figure{margin:16px auto;text-align:center}.mock-question-card figure img{width:auto;max-width:min(420px,100%);max-height:360px;object-fit:contain;border-radius:12px;border:1px solid #e5d1af;background:#fff}
.mock-choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:16px}.mock-choice{display:grid;grid-template-columns:42px auto 1fr;gap:10px;align-items:center;min-height:64px;padding:12px;border:2px solid #e2cfad;border-radius:13px;background:#fff;cursor:pointer}.mock-choice:hover{border-color:#b67b38}.mock-choice.selected{border-color:#8c241a;background:#fff3e8}.mock-choice input{position:absolute;opacity:0;pointer-events:none}.mock-choice-key{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#f4e4c5;color:#782117;font-weight:900}.mock-choice.selected .mock-choice-key{background:#8c241a;color:#fff}.mock-choice img{max-width:150px;max-height:110px;object-fit:contain;border-radius:8px}
.mock-question-actions{display:flex;justify-content:space-between;gap:10px;margin-top:14px}.mock-pdf-panel,.mock-submit-panel{margin:14px 0;padding:14px;border:1px solid #dfc49b;border-radius:15px;background:#fffaf0}.mock-submit-panel{text-align:center}.mock-submit-panel #mock-submit{min-width:260px}
.mock-pdf-panel iframe{width:100%;height:72vh;border:0;border-radius:12px;background:#fff}.mock-runner-error{margin:0;padding:22px;border:1px solid #d99b8e;border-radius:12px;background:#fff4f1;color:#7b2018;line-height:1.7}
.mock-question-meta-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:10px 0}.mock-question-image-admin{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:10px 0;padding:10px;border:1px dashed #d4b37e;border-radius:10px;background:#fffaf0}.mock-question-image-admin input{max-width:320px}.mock-question-editor [data-mock-explanation]{min-height:58px}
.mock-result-review{display:grid;gap:8px;margin-top:14px;text-align:left}.mock-result-review article{padding:10px;border-radius:10px;background:#fff;border:1px solid #cfdccb}.mock-result-review article.wrong{border-color:#e0aaa2;background:#fff5f3}.mock-result-review p{margin:4px 0}
@media(max-width:760px){.mock-exam-commandbar{grid-template-columns:1fr 1fr}.mock-question-map{grid-template-columns:repeat(5,1fr)}.mock-choice-grid{grid-template-columns:1fr}.mock-question-card{min-height:0;padding:13px}.mock-question-card h2{font-size:19px}.mock-question-actions{position:sticky;bottom:6px;background:#fffaf0;padding:8px;border-radius:12px}.mock-question-meta-grid{grid-template-columns:1fr}}

/* V192: nhập đề thông minh theo cấu trúc HSK */
.mock-smart-import-panel{margin:12px 0;padding:14px;border:1px solid #d7b87f;border-radius:14px;background:#fff7e8}.mock-smart-import-panel>div:first-child{margin-bottom:10px}.mock-smart-import-panel p{margin:5px 0;color:#634735}.mock-ai-meta{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:8px 0;padding:8px 10px;border-radius:9px;background:#f8ead0;color:#6e271d}.mock-ai-meta label{display:flex;align-items:center;gap:7px;margin:0}.mock-option-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.mock-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.mock-choice img{max-width:100%;max-height:220px;object-fit:contain}.mock-question-card figure img{background:white}.mock-question-editor[data-question-index] textarea{min-height:70px}@media(max-width:760px){.mock-smart-import-panel .form-actions{display:grid;grid-template-columns:1fr}.mock-ai-meta{align-items:flex-start;flex-direction:column}.mock-option-grid,.mock-choice-grid{grid-template-columns:1fr}}
.mock-bilingual-option{display:flex;flex-direction:column;gap:3px;line-height:1.25}.mock-bilingual-option small{font-size:.9em;color:#6f5142}.mock-bilingual-option strong{font-size:1.18em;color:#35160f}
.mock-reference-pair{display:flex;justify-content:center;align-items:center;gap:28px;flex-wrap:wrap;margin:16px auto}.mock-reference-pair figure{margin:0}.mock-reference-pair figure img{width:auto;max-width:360px;max-height:250px}.mock-reference-text{min-width:150px;padding:18px 24px;text-align:center;border:1px solid #ead8b9;border-radius:12px;background:#fffaf2}.mock-reference-text .mock-bilingual-option small{font-size:1.05rem}.mock-reference-text .mock-bilingual-option strong{font-size:1.65rem}.mock-prompt-after-bank{margin-top:18px;padding:12px 16px;border:1px solid #ead8b9;border-radius:12px;background:#fffaf2}.mock-prompt-after-bank h2{margin:0}.mock-three-image-bank,.mock-six-image-bank{grid-template-columns:repeat(3,minmax(0,1fr))}.mock-three-image-bank .mock-choice,.mock-six-image-bank .mock-choice{grid-template-columns:42px 1fr}.mock-three-image-bank .mock-choice img,.mock-six-image-bank .mock-choice img{width:100%;height:150px;max-width:none;max-height:none;object-fit:contain}
@media(max-width:760px){.mock-reference-pair{gap:12px}.mock-reference-pair figure img{max-width:100%;max-height:220px}.mock-three-image-bank,.mock-six-image-bank{grid-template-columns:repeat(2,minmax(0,1fr))}.mock-three-image-bank .mock-choice,.mock-six-image-bank .mock-choice{grid-template-columns:34px 1fr;padding:8px}.mock-three-image-bank .mock-choice img,.mock-six-image-bank .mock-choice img{height:110px}}

/* V217: ảnh PDF nguồn nhỏ được giữ ở kích thước vừa phải để tránh phóng vỡ */
.mock-question-card figure img{max-width:min(320px,100%);max-height:280px}.mock-choice img{width:auto!important;height:auto!important;max-width:100%!important;max-height:170px!important;margin:auto;image-rendering:auto}.mock-hq-image-import{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}.mock-hq-image-import>*{flex:1;min-width:220px}

/* V234 — Tệp nghe chỉ hoạt động cho câu 1–20. */
.mock-audio-item audio { width:100%; }
#mock-audio-list.mock-audio-inactive .mock-audio-item { opacity:.62; }
#mock-audio-list.mock-audio-inactive audio { pointer-events:none; filter:grayscale(.35); }
.mock-listening-note { margin:.55rem 0 0; padding:.55rem .75rem; border-radius:10px; background:rgba(128,70,31,.07); color:#70452e; font-size:.9rem; }
#mock-audio-list.mock-audio-inactive .mock-listening-note { background:rgba(96,111,125,.09); color:#4d5964; font-weight:650; }

/* V314 - ảnh đề thi không còn im lặng thành ô trắng khi R2/network lỗi tạm thời */
.mock-image-load-error{display:flex;align-items:center;justify-content:center;min-height:86px;width:100%;padding:12px;border:1px dashed #c78955;border-radius:10px;background:#fff9ef;color:#8a2b1c;font-weight:700;text-align:center;cursor:pointer;box-sizing:border-box}

/* V319: cụm ảnh 11-15/26-30 hiển thị lớn, rõ như một ngân hàng hình. */
.mock-six-image-bank{gap:14px}.mock-six-image-bank .mock-choice{min-height:190px;align-items:center}.mock-six-image-bank .mock-choice img{width:100%!important;height:165px!important;max-width:none!important;max-height:none!important;object-fit:contain!important}.mock-six-image-bank .mock-choice>span:not(.mock-choice-key){text-align:center}
@media(max-width:760px){.mock-six-image-bank .mock-choice{min-height:145px}.mock-six-image-bank .mock-choice img{height:120px!important}}

.mock-question-prompt-text{white-space:normal;line-height:1.55}.mock-question-prompt-text br{display:block;content:"";margin-top:2px}
.mock-shared-bank{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0 20px}.mock-bank-option{min-height:110px;border:1px solid #dfb879;border-radius:14px;background:#fffaf1;padding:10px;display:flex;align-items:center;gap:10px;justify-content:center;cursor:pointer;color:#43180f}.mock-bank-option img{display:block;max-width:100%;height:120px;object-fit:contain}.mock-shared-bank.matching .mock-bank-option,.mock-shared-bank.fill .mock-bank-option{min-height:76px}.mock-group-rows{display:grid;gap:9px}.mock-group-row{width:100%;display:grid;grid-template-columns:42px 1fr 46px;align-items:center;gap:10px;text-align:left;border:1px solid #e1c28f;background:#fff;border-radius:12px;padding:10px;color:#34140e;cursor:pointer}.mock-group-row.current{outline:3px solid #a53725}.mock-group-row.answered{background:#f4fbf6}.mock-group-content{display:flex;align-items:center;gap:12px;min-width:0}.mock-group-content img{width:90px;height:75px;object-fit:contain}.mock-answer-box{width:38px;height:38px;border:2px solid #7e2a1e;border-radius:4px;display:grid;place-items:center;font-weight:800;font-size:20px;background:#fff}@media(max-width:700px){.mock-shared-bank{grid-template-columns:repeat(2,minmax(0,1fr))}.mock-bank-option img{height:95px}.mock-group-row{grid-template-columns:34px 1fr 40px;padding:8px}.mock-group-content{align-items:flex-start;flex-direction:column}.mock-group-content img{width:76px;height:64px}}

/* V347: ngân hàng A–F luôn là 3x2 cân bằng; không phụ thuộc kích thước ảnh gốc. */
.mock-shared-bank.image{grid-template-columns:repeat(3,minmax(0,1fr))!important;align-items:stretch!important}
.mock-shared-bank.image .mock-bank-option{position:relative!important;display:grid!important;grid-template-columns:34px minmax(0,1fr)!important;align-items:center!important;width:100%!important;height:210px!important;min-height:210px!important;padding:10px!important;box-sizing:border-box!important;overflow:hidden!important}
.mock-shared-bank.image .mock-bank-option img{display:block!important;width:100%!important;height:184px!important;max-width:none!important;max-height:none!important;object-fit:contain!important;background:#fff!important}
.mock-preview-replace{position:absolute;right:8px;bottom:8px;z-index:3;display:inline-flex!important;align-items:center!important;width:auto!important;max-width:none!important;cursor:pointer}.mock-preview-replace input{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none}.mock-preview-replace span{display:inline-flex!important;align-items:center!important;min-height:30px!important;padding:5px 9px!important;border-radius:999px!important;background:#8f2419!important;color:#fff!important;font-size:12px!important;font-weight:800!important;line-height:1!important;box-shadow:0 2px 8px #0002}.mock-preview-replace:hover span{background:#68170f!important}.mock-group-content{position:relative}.mock-group-content>.mock-preview-replace{position:static!important;flex:0 0 auto!important;margin-left:8px!important}.mock-group-row:has(.mock-preview-replace){padding-bottom:9px!important}
.mock-group-rows{grid-template-columns:1fr!important}.mock-group-row{min-height:58px!important}.mock-group-content>img{width:auto!important;max-width:100%!important;height:76px!important;object-fit:contain!important}
.mock-pdf-text-image{text-align:left;margin:8px 0}.mock-pdf-text-image img{display:block;width:auto;max-width:100%;max-height:105px;object-fit:contain;margin:0;background:#fff}.mock-reference-text.pdf-image img{display:block;width:auto;max-width:100%;max-height:115px;object-fit:contain;margin:auto;background:#fff}.mock-choice img{object-fit:contain!important;background:#fff}
@media(max-width:700px){.mock-shared-bank.image{grid-template-columns:repeat(2,minmax(0,1fr))!important}.mock-shared-bank.image .mock-bank-option{height:155px!important;min-height:155px!important;grid-template-columns:30px minmax(0,1fr)!important}.mock-shared-bank.image .mock-bank-option img{height:135px!important}}
.mock-bank-option{position:relative}
.mock-preview-savebar{position:sticky;top:8px;z-index:12;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0;padding:10px 12px;border:1px solid #d7a25d;border-radius:12px;background:#fff8e9ee;box-shadow:0 4px 14px #4a1a1017}.mock-preview-savebar span{font-weight:700;color:#6f2418}.mock-preview-savebar button{border:0;border-radius:10px;background:#8f2419;color:#fff;padding:10px 16px;font-weight:900;cursor:pointer}.mock-preview-savebar button:disabled{opacity:.45;cursor:not-allowed}.mock-choice-wrap,.mock-preview-image-host{position:relative}.mock-choice-wrap>.mock-choice{height:100%;box-sizing:border-box}.mock-choice-wrap>.mock-preview-replace,.mock-preview-image-host>.mock-preview-replace{position:absolute!important;right:8px!important;bottom:8px!important;margin:0!important}.mock-pdf-text-image.mock-preview-image-host,.mock-reference-text.mock-preview-image-host{padding-bottom:42px}.mock-choice-grid>.mock-choice-wrap{min-width:0}
.mock-preview-savebar.frozen{position:static;justify-content:flex-start;background:#f4eee4;box-shadow:none}.mock-empty-image-slot{display:flex;align-items:center;justify-content:center;min-width:130px;min-height:96px;padding:12px 12px 42px;border:1px dashed #c99a62;border-radius:10px;background:#fffaf2;color:#8a5c46;font-weight:700;box-sizing:border-box}
@media(max-width:700px){.mock-preview-savebar{align-items:stretch;flex-direction:column}.mock-preview-savebar button{width:100%}}
/* V361: ảnh chữ giữ kích thước tự nhiên, không phóng lớn gây mờ/bể. */
.mock-group-content>img{width:auto!important;height:auto!important;max-width:100%!important;max-height:76px!important;object-fit:contain!important;image-rendering:auto!important}.mock-group-content{overflow:hidden}.mock-image-pending{min-width:90px!important;min-height:54px!important;background:linear-gradient(90deg,#f8efe2 25%,#fffaf1 50%,#f8efe2 75%)!important;background-size:200% 100%!important;animation:mockImageLoading 1.1s linear infinite!important;color:transparent!important}.mock-image-failed{min-width:90px;min-height:54px;border:1px dashed #c78955;background:#fff9ef}@keyframes mockImageLoading{to{background-position:-200% 0}}

/* V374: ảnh đơn và cặp ảnh + chữ dùng hai chuẩn kích thước riêng. */
.mock-question-card figure.mock-single-question-image img{width:auto;max-width:min(280px,72vw);max-height:270px;object-fit:contain}
.mock-reference-pair figure.mock-paired-question-image img{width:auto;max-width:min(250px,45vw);max-height:245px;object-fit:contain}
.mock-reference-pair .mock-reference-text.pdf-image{display:flex;align-items:center;justify-content:center;min-width:132px;min-height:84px;padding:10px 14px;box-sizing:border-box}
.mock-reference-pair .mock-reference-text.pdf-image img{width:auto;max-width:min(180px,34vw);max-height:105px;object-fit:contain}
@media(max-width:760px){.mock-question-card figure.mock-single-question-image img{max-width:min(250px,82vw);max-height:245px}.mock-reference-pair figure.mock-paired-question-image img{max-width:min(220px,70vw);max-height:215px}.mock-reference-pair .mock-reference-text.pdf-image img{max-width:min(165px,55vw)}}
/* V362: dòng câu ôm sát ảnh; nút thay ảnh nằm ngay sau ảnh. */
.mock-group-row{min-height:0!important;padding-top:6px!important;padding-bottom:6px!important}.mock-group-content{align-items:center!important;min-height:38px!important}.mock-group-content>img{display:block!important;flex:0 1 auto!important}.mock-group-content>.mock-preview-replace{margin-left:4px!important;margin-right:auto!important}.mock-group-content>.mock-preview-replace span{min-height:28px!important;padding:4px 8px!important}
@media(max-width:700px){.mock-group-content{flex-direction:row!important;align-items:center!important;flex-wrap:wrap!important}.mock-group-row{padding-top:5px!important;padding-bottom:5px!important}}
/* V363: xem trước và tự cắt nền trắng trước khi xếp ảnh vào hàng chờ lưu. */
.mock-autocrop-dialog{width:min(940px,calc(100vw - 28px));max-height:calc(100vh - 28px);padding:0;border:1px solid #d6a866;border-radius:16px;background:#fffaf1;color:#35160f;box-shadow:0 20px 60px #35160f55}.mock-autocrop-dialog::backdrop{background:#2d160d99}.mock-autocrop-dialog form{padding:20px}.mock-autocrop-dialog h2{margin:0 0 6px;color:#7e2117}.mock-autocrop-dialog p{margin:0 0 16px;line-height:1.5}.mock-autocrop-compare{display:grid;grid-template-columns:1fr 1fr;gap:14px}.mock-autocrop-compare article{display:grid;grid-template-columns:1fr auto;gap:6px;padding:12px;border:2px solid #e3c798;border-radius:13px;background:#fff}.mock-autocrop-compare article.recommended{border-color:#9a3022;background:#fff8ee}.mock-autocrop-compare article>span{color:#765f4c;font-size:13px}.mock-autocrop-compare article>div{grid-column:1/-1;display:grid;place-items:center;height:270px;padding:8px;overflow:hidden;background:#eee9df}.mock-autocrop-compare img{display:block;max-width:100%;max-height:100%;object-fit:contain}.mock-autocrop-compare button,.mock-autocrop-cancel{grid-column:1/-1;min-height:42px;border:0;border-radius:10px;background:#8f2419;color:#fff;font-weight:900;cursor:pointer}.mock-autocrop-cancel{display:block;width:180px;margin:14px auto 0;background:#eee2cf;color:#6f2418}@media(max-width:700px){.mock-autocrop-dialog form{padding:13px}.mock-autocrop-compare{grid-template-columns:1fr}.mock-autocrop-compare article>div{height:190px}}

/* V365: ảnh chữ đủ lớn để đọc, vừa khung; câu một dòng và hai dòng cùng độ cao. */
.mock-shared-bank.matching .mock-bank-option,.mock-shared-bank.fill .mock-bank-option{height:146px!important;min-height:146px!important;overflow:hidden!important}
.mock-shared-bank.matching .mock-bank-option img,.mock-shared-bank.fill .mock-bank-option img{display:block!important;width:auto!important;height:auto!important;max-width:calc(100% - 44px)!important;max-height:112px!important;object-fit:contain!important;image-rendering:auto!important;flex:0 1 auto!important}
.mock-group-content{width:100%!important;min-width:0!important;overflow:hidden!important}
.mock-group-content>img{display:block!important;width:auto!important;height:68px!important;max-width:calc(100% - 118px)!important;max-height:68px!important;object-fit:contain!important;object-position:left center!important;flex:0 1 auto!important;image-rendering:auto!important}
.mock-group-content>.mock-preview-replace{flex:0 0 auto!important}
@media(max-width:700px){.mock-shared-bank.matching .mock-bank-option,.mock-shared-bank.fill .mock-bank-option{height:125px!important;min-height:125px!important}.mock-shared-bank.matching .mock-bank-option img,.mock-shared-bank.fill .mock-bank-option img{max-height:94px!important}.mock-group-content>img{height:62px!important;max-height:62px!important;max-width:calc(100% - 104px)!important}}

/* V366: số câu nằm ngang; ảnh hội thoại dài dùng trọn một hàng để không bị thu nhỏ. */
.mock-group-row{grid-template-columns:64px minmax(0,1fr) 46px!important}
.mock-group-row>b{display:block!important;white-space:nowrap!important;word-break:keep-all!important;line-height:1.2!important}
.mock-group-content.mock-wide-text-content{display:grid!important;grid-template-columns:minmax(0,1fr)!important;justify-items:start!important;align-items:center!important;row-gap:4px!important;padding:4px 0!important}
.mock-group-content.mock-wide-text-content>img{grid-column:1!important;width:auto!important;height:76px!important;max-width:100%!important;max-height:76px!important;object-position:left center!important}
.mock-group-content.mock-wide-text-content>.mock-preview-replace{grid-column:1!important;margin:0!important;justify-self:start!important}
@media(max-width:700px){.mock-group-row{grid-template-columns:58px minmax(0,1fr) 40px!important}.mock-group-content.mock-wide-text-content>img{height:68px!important;max-height:68px!important}}

/* V385: chỉ tăng khoảng 6% cho ảnh câu nhiều đoạn; không thay đổi vùng cắt. */
.mock-group-content.mock-multiline-text-content>img{height:72px!important;max-height:72px!important;object-position:left center!important}
@media(max-width:700px){.mock-group-content.mock-multiline-text-content>img{height:66px!important;max-height:66px!important}}

/* V395: câu 34–35 thường ngắn hoặc có dòng phụ; hiển thị đủ lớn sau khi
   vùng cắt đã được giới hạn bởi ô trả lời thật của chính PDF. */
.mock-group-row[data-question-number="34"] .mock-group-content>img,
.mock-group-row[data-question-number="35"] .mock-group-content>img{height:80px!important;max-height:80px!important}
@media(max-width:700px){.mock-group-row[data-question-number="34"] .mock-group-content>img,.mock-group-row[data-question-number="35"] .mock-group-content>img{height:72px!important;max-height:72px!important}}

/* Ngân hàng chữ A-F luôn hiển thị trọn bitmap đã cắt, không zoom/crop mép phải. */
.mock-shared-bank.matching .mock-bank-option img,.mock-shared-bank.fill .mock-bank-option img{object-fit:contain!important;object-position:center!important;max-width:calc(100% - 38px)!important}

/* V399: giao diện đề gọn, không phóng quá khổ trên PC hoặc điện thoại. */
.mock-workspace{width:min(1120px,calc(100% - 20px))!important;margin-inline:auto!important}
.mock-question-stage{padding:12px!important;margin:10px 0!important}
.mock-question-card{min-height:0!important;padding:14px!important}
.mock-shared-bank{gap:10px!important;margin:10px 0 14px!important}
.mock-shared-bank.image .mock-bank-option{height:166px!important;min-height:166px!important;padding:8px!important}
.mock-shared-bank.image .mock-bank-option img{height:144px!important}
.mock-shared-bank.matching .mock-bank-option,.mock-shared-bank.fill .mock-bank-option{height:112px!important;min-height:112px!important;padding:8px!important}
.mock-shared-bank.matching .mock-bank-option img,.mock-shared-bank.fill .mock-bank-option img{max-height:88px!important}
.mock-group-rows{gap:7px!important}
.mock-group-row{grid-template-columns:58px minmax(0,1fr) 40px!important;gap:8px!important;padding:5px 8px!important}
.mock-group-content>img,.mock-group-content.mock-wide-text-content>img{height:58px!important;max-height:58px!important}
.mock-group-content.mock-multiline-text-content>img{height:62px!important;max-height:62px!important}
.mock-group-row[data-question-number="34"] .mock-group-content>img,.mock-group-row[data-question-number="35"] .mock-group-content>img{height:64px!important;max-height:64px!important}
.mock-answer-box{width:34px!important;height:34px!important;font-size:17px!important}
.mock-preview-replace span{min-height:25px!important;padding:4px 7px!important;font-size:11px!important}
@media(max-width:700px){
  .mock-workspace{width:calc(100% - 8px)!important}
  .mock-question-stage{padding:7px!important;border-radius:12px!important}
  .mock-question-card{padding:9px!important}
  .mock-question-card header>span{font-size:16px!important}
  .mock-shared-bank{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  .mock-shared-bank.image .mock-bank-option{height:124px!important;min-height:124px!important;grid-template-columns:26px minmax(0,1fr)!important}
  .mock-shared-bank.image .mock-bank-option img{height:106px!important}
  .mock-shared-bank.matching .mock-bank-option,.mock-shared-bank.fill .mock-bank-option{height:96px!important;min-height:96px!important}
  .mock-shared-bank.matching .mock-bank-option img,.mock-shared-bank.fill .mock-bank-option img{max-height:74px!important}
  .mock-group-row{grid-template-columns:48px minmax(0,1fr) 34px!important;gap:5px!important;padding:4px 6px!important}
  .mock-group-content>img,.mock-group-content.mock-wide-text-content>img{height:50px!important;max-height:50px!important;max-width:calc(100% - 78px)!important}
  .mock-group-content.mock-multiline-text-content>img,.mock-group-row[data-question-number="34"] .mock-group-content>img,.mock-group-row[data-question-number="35"] .mock-group-content>img{height:55px!important;max-height:55px!important}
  .mock-answer-box{width:30px!important;height:30px!important;font-size:15px!important}
  .mock-preview-replace span{font-size:10px!important;padding:3px 6px!important}
}

/* V402: ảnh đáp án chữ theo kích thước mẫu đã duyệt. Chỉ đổi cách hiển thị,
   không đổi bitmap, vùng cắt PDF hoặc dữ liệu đã lưu. */
.mock-text-option-bank .mock-choice,
.mock-shared-bank.matching .mock-bank-option,
.mock-shared-bank.fill .mock-bank-option{
  height:200px!important;
  min-height:200px!important;
  overflow:hidden!important;
}

/* V404: đặt sau chuẩn V402 để preset mới có hiệu lực. Chỉ ngân hàng 31–40
   vừa được quét và lưu bằng V404 mới mang class này. */
.mock-shared-bank.mock-bank-v404-compact .mock-bank-option{height:150px!important;min-height:150px!important}
.mock-shared-bank.mock-bank-v404-compact .mock-bank-option img{max-height:104px!important;max-width:calc(100% - 46px)!important}
@media(max-width:700px){
  .mock-shared-bank.mock-bank-v404-compact .mock-bank-option{height:124px!important;min-height:124px!important}
.mock-shared-bank.mock-bank-v404-compact .mock-bank-option img{max-height:82px!important;max-width:calc(100% - 40px)!important}
}

/* V405 final responsive overrides — luôn đặt cuối tệp. */
.mock-workspace{width:min(1040px,calc(100% - 18px))!important}
.mock-question-stage{padding:9px!important;margin:7px 0!important}
.mock-question-card{padding:10px!important}
.mock-preview-savebar{margin:6px 0!important;padding:7px 10px!important;min-height:36px!important}
.mock-shared-bank{gap:8px!important;margin:7px 0 10px!important}
.mock-shared-bank.matching .mock-bank-option,.mock-shared-bank.fill .mock-bank-option,.mock-shared-bank.mock-bank-v404-compact .mock-bank-option{height:112px!important;min-height:112px!important;padding:7px!important}
.mock-shared-bank.matching .mock-bank-option img,.mock-shared-bank.fill .mock-bank-option img,.mock-shared-bank.mock-bank-v404-compact .mock-bank-option img{width:auto!important;height:auto!important;max-width:calc(100% - 42px)!important;max-height:76px!important;object-position:center!important}
.mock-group-rows{gap:6px!important}
.mock-group-row{min-height:82px!important;grid-template-columns:64px minmax(0,1fr) 38px!important;padding:5px 8px!important}
.mock-group-content{min-height:68px!important}
.mock-group-content>img,.mock-group-content.mock-wide-text-content>img{width:auto!important;height:auto!important;max-width:calc(100% - 96px)!important;max-height:58px!important;object-fit:contain!important;object-position:left center!important}
.mock-group-content.mock-multiline-text-content>img,.mock-group-row[data-question-number="39"] .mock-group-content>img,.mock-group-row[data-question-number="40"] .mock-group-content>img{max-height:68px!important}
.mock-answer-box{width:32px!important;height:32px!important;font-size:16px!important}
.mock-preview-replace span{min-height:23px!important;padding:4px 7px!important;font-size:10px!important}
@media(max-width:700px){
  .mock-workspace{width:calc(100% - 4px)!important}
  .mock-question-stage{padding:5px!important;margin:5px 0!important;border-radius:10px!important}
  .mock-question-card{padding:7px!important}
  .mock-question-card header>span{font-size:15px!important}
  .mock-preview-savebar{padding:6px 7px!important;gap:6px!important}
  .mock-shared-bank{gap:5px!important;margin:5px 0 8px!important}
  .mock-shared-bank.matching .mock-bank-option,.mock-shared-bank.fill .mock-bank-option,.mock-shared-bank.mock-bank-v404-compact .mock-bank-option{height:92px!important;min-height:92px!important;padding:5px!important}
  .mock-shared-bank.matching .mock-bank-option img,.mock-shared-bank.fill .mock-bank-option img,.mock-shared-bank.mock-bank-v404-compact .mock-bank-option img{max-width:calc(100% - 32px)!important;max-height:60px!important}
  .mock-group-rows{gap:4px!important}
  .mock-group-row{min-height:68px!important;grid-template-columns:48px minmax(0,1fr) 30px!important;gap:4px!important;padding:4px 5px!important}
  .mock-group-content{min-height:56px!important}
  .mock-group-content>img,.mock-group-content.mock-wide-text-content>img{max-width:calc(100% - 70px)!important;max-height:48px!important}
  .mock-group-content.mock-multiline-text-content>img,.mock-group-row[data-question-number="39"] .mock-group-content>img,.mock-group-row[data-question-number="40"] .mock-group-content>img{max-height:56px!important}
  .mock-answer-box{width:27px!important;height:27px!important;font-size:14px!important}
  .mock-preview-replace span{min-height:21px!important;padding:3px 5px!important;font-size:9px!important}
}

/* V405: giao diện làm đề mô phỏng gọn và cân đối trên toàn màn hình. */
.mock-workspace{width:min(1040px,calc(100% - 18px))!important}
.mock-question-stage{padding:9px!important;margin:7px 0!important}
.mock-question-card{padding:10px!important}
.mock-question-card header{margin-bottom:6px!important}
.mock-preview-savebar{margin:6px 0!important;padding:7px 10px!important;min-height:36px!important}
.mock-shared-bank{gap:8px!important;margin:7px 0 10px!important}
.mock-shared-bank.matching .mock-bank-option,
.mock-shared-bank.fill .mock-bank-option,
.mock-shared-bank.mock-bank-v404-compact .mock-bank-option{
  height:112px!important;
  min-height:112px!important;
  padding:7px!important;
}
.mock-shared-bank.matching .mock-bank-option img,
.mock-shared-bank.fill .mock-bank-option img,
.mock-shared-bank.mock-bank-v404-compact .mock-bank-option img{
  width:auto!important;
  height:auto!important;
  max-width:calc(100% - 42px)!important;
  max-height:76px!important;
  object-position:center!important;
}
.mock-group-rows{gap:6px!important}
.mock-group-row{
  min-height:82px!important;
  grid-template-columns:64px minmax(0,1fr) 38px!important;
  padding:5px 8px!important;
}
.mock-group-content{min-height:68px!important;align-content:center!important}
.mock-group-content>img,
.mock-group-content.mock-wide-text-content>img{
  width:auto!important;
  height:auto!important;
  max-width:calc(100% - 96px)!important;
  max-height:58px!important;
  object-fit:contain!important;
  object-position:left center!important;
}
.mock-group-content.mock-multiline-text-content>img,
.mock-group-row[data-question-number="39"] .mock-group-content>img,
.mock-group-row[data-question-number="40"] .mock-group-content>img{
  max-height:68px!important;
}
.mock-answer-box{width:32px!important;height:32px!important;font-size:16px!important}
.mock-preview-replace span{min-height:23px!important;padding:4px 7px!important;font-size:10px!important}

@media(max-width:700px){
  .mock-workspace{width:calc(100% - 4px)!important}
  .mock-question-stage{padding:5px!important;margin:5px 0!important;border-radius:10px!important}
  .mock-question-card{padding:7px!important}
  .mock-question-card header>span{font-size:15px!important}
  .mock-preview-savebar{padding:6px 7px!important;gap:6px!important}
  .mock-shared-bank{gap:5px!important;margin:5px 0 8px!important}
  .mock-shared-bank.matching .mock-bank-option,
  .mock-shared-bank.fill .mock-bank-option,
  .mock-shared-bank.mock-bank-v404-compact .mock-bank-option{
    height:92px!important;
    min-height:92px!important;
    padding:5px!important;
  }
  .mock-shared-bank.matching .mock-bank-option img,
  .mock-shared-bank.fill .mock-bank-option img,
  .mock-shared-bank.mock-bank-v404-compact .mock-bank-option img{
    max-width:calc(100% - 32px)!important;
    max-height:60px!important;
  }
  .mock-group-rows{gap:4px!important}
  .mock-group-row{min-height:68px!important;grid-template-columns:48px minmax(0,1fr) 30px!important;gap:4px!important;padding:4px 5px!important}
  .mock-group-content{min-height:56px!important}
  .mock-group-content>img,.mock-group-content.mock-wide-text-content>img{max-width:calc(100% - 70px)!important;max-height:48px!important}
  .mock-group-content.mock-multiline-text-content>img,.mock-group-row[data-question-number="39"] .mock-group-content>img,.mock-group-row[data-question-number="40"] .mock-group-content>img{max-height:56px!important}
  .mock-answer-box{width:27px!important;height:27px!important;font-size:14px!important}
  .mock-preview-replace span{min-height:21px!important;padding:3px 5px!important;font-size:9px!important}
}
.mock-text-option-bank .mock-choice img,
.mock-shared-bank.matching .mock-bank-option img,
.mock-shared-bank.fill .mock-bank-option img{
  display:block!important;
  width:auto!important;
  height:auto!important;
  max-width:calc(100% - 46px)!important;
  max-height:154px!important;
  object-fit:contain!important;
  object-position:left center!important;
  image-rendering:auto!important;
}
@media(max-width:700px){
  .mock-text-option-bank .mock-choice,
  .mock-shared-bank.matching .mock-bank-option,
  .mock-shared-bank.fill .mock-bank-option{
    height:156px!important;
    min-height:156px!important;
  }
  .mock-text-option-bank .mock-choice img,
  .mock-shared-bank.matching .mock-bank-option img,
  .mock-shared-bank.fill .mock-bank-option img{
    max-width:calc(100% - 40px)!important;
    max-height:116px!important;
  }
}

/* V405 final override: ngân hàng A–F gọn và đồng đều. */
.mock-shared-bank.mock-bank-v404-compact .mock-bank-option{height:112px!important;min-height:112px!important;padding:7px!important}
.mock-shared-bank.mock-bank-v404-compact .mock-bank-option img{max-height:76px!important;max-width:calc(100% - 42px)!important;object-position:center!important}
@media(max-width:700px){
  .mock-shared-bank.mock-bank-v404-compact .mock-bank-option{height:92px!important;min-height:92px!important;padding:5px!important}
.mock-shared-bank.mock-bank-v404-compact .mock-bank-option img{max-height:60px!important;max-width:calc(100% - 32px)!important}
}

/* V406: riêng câu 16–20, giữ đủ A–B–C và thanh chuyển câu trong một màn hình. */
.mock-choice-grid.mock-text-option-bank{gap:8px!important;margin:7px 0!important}
.mock-text-option-bank .mock-choice-wrap{height:132px!important;min-height:132px!important}
.mock-text-option-bank .mock-choice{height:132px!important;min-height:132px!important;padding:7px!important}
.mock-text-option-bank .mock-choice img{width:auto!important;height:auto!important;max-width:calc(100% - 48px)!important;max-height:88px!important;object-fit:contain!important;object-position:center!important}
.mock-text-option-bank .mock-choice-wrap>.mock-preview-replace{right:6px!important;bottom:6px!important}
@media(max-width:700px){
  .mock-choice-grid.mock-text-option-bank{gap:5px!important;margin:5px 0!important}
  .mock-text-option-bank .mock-choice-wrap,.mock-text-option-bank .mock-choice{height:104px!important;min-height:104px!important;padding:5px!important}
  .mock-text-option-bank .mock-choice img{max-width:calc(100% - 36px)!important;max-height:68px!important}
  .mock-text-option-bank .mock-choice-wrap>.mock-preview-replace{right:4px!important;bottom:4px!important}
}
