/* =============================================================================
   EXAM LAYOUT — trình bày đề thi chuẩn (header hành chính, nhóm kỹ năng, đáp án)
   Tiền tố riêng .exam- / .ak- / .a4-cont- để không đụng CSS widget câu hỏi (.ex-*).
   ============================================================================= */

/* --- Header hành chính đề KTĐK: thay thế .ws-header khi ở chế độ đề thi Việt Nam --- */
.sheet.exam-official .ws-header {
    display: none;
}

.exam-official-header {
    margin-bottom: 6px;
    font-size: 12px;
    line-height: 1.38;
    color: #111;
}

.exam-oh-top {
    display: grid;
    grid-template-columns: 0.85fr 1.25fr auto;
    gap: 8px;
    align-items: start;
}

.exam-oh-left {
    text-align: center;
    text-transform: uppercase;
}

.exam-oh-pagecount {
    text-transform: none;
    font-size: 11px;
    margin-top: 2px;
    color: #1e293b;
}

.exam-oh-right {
    text-align: center;
}

.exam-oh-right b {
    text-transform: uppercase;
}

.exam-oh-code .ws-code-badge {
    margin-top: 2px;
}

.exam-oh-score {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
}

.exam-oh-score td {
    border: 1.2px solid #111;
    padding: 3px 8px;
    vertical-align: top;
}

.exam-oh-mark {
    width: 30%;
}

.exam-oh-mark div,
.exam-oh-comment div {
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
}

.exam-oh-student {
    margin-top: 5px;
    padding-bottom: 4px;
    border-bottom: 2px solid #111;
    font-weight: 600;
}

.exam-oh-student:has(+ .exam-oh-supervisors) {
    border-bottom: none;
    padding-bottom: 1px;
}

.exam-oh-supervisors {
    padding-bottom: 5px;
    border-bottom: 2px solid #111;
    font-size: 11.5px;
    color: #1e293b;
}

/* --- Running Header & Page Badge cho Đề Nhiều Trang (Trang 2, 3, 4...) --- */
.a4-cont-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1.5px solid #0f172a;
    padding-bottom: 4px;
    margin-bottom: 8px;
    font-size: 11.5px;
    font-weight: 700;
    color: #1e293b;
}

.a4-page-badge {
    font-weight: 800;
    font-size: 11.5px;
    color: #0f172a;
    padding: 2px 8px;
    border: 1px solid #94a3b8;
    border-radius: 4px;
    background: #f8fafc;
    white-space: nowrap;
}

/* --- Dạng thức Trắc nghiệm Đúng / Sai 4 ý a, b, c, d chuẩn CV 7991 --- */
.exam-tf-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    margin-top: 4px;
}

.exam-tf-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 12.3px;
    background: #ffffff;
    break-inside: avoid;
    page-break-inside: avoid;
}

.exam-tf-choices {
    font-weight: 700;
    font-size: 11.5px;
    color: #0f172a;
    white-space: nowrap;
    flex-shrink: 0;
}

/* --- Tiêu đề nhóm kỹ năng: "PART I. LISTENING (2.0 points)" --- */
.exam-group-heading {
    margin: 7px 0 4px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    break-after: avoid;
    page-break-after: avoid;
}

/* --- Dấu kết thúc đề --- */
.exam-end-mark {
    margin-top: 8px;
    text-align: center;
    font-weight: 800;
    font-size: 12.5px;
    letter-spacing: 1px;
    break-inside: avoid;
    page-break-inside: avoid;
}

.exam-end-note {
    margin-top: 2px;
    font-weight: 500;
    font-style: italic;
    font-size: 11px;
    letter-spacing: 0;
}

/* --- Ô điểm của đề quốc tế --- */
.exam-raw-score {
    margin-top: 6px;
    font-size: 13px;
}

.exam-raw-unit {
    font-size: 10px;
    font-weight: 500;
    color: #475569;
}

.exam-choice-box {
    display: inline-block;
    min-width: 24px;
    height: 22px;
    border: 1.5px solid #111;
    border-radius: 4px;
}

/* --- Tờ đáp án dựng lại --- */
.ak-guide {
    margin: 4px 0 8px;
    padding: 4px 8px;
    border: 1px dashed #64748b;
    border-radius: 4px;
    font-size: 11.5px;
    font-style: italic;
}

.ak-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 2px 0 4px;
    font-size: 12.5px;
}

.ak-list {
    margin: 2px 0 4px;
    padding-left: 0;
    list-style: none;
    font-size: 12px;
}

.ak-list li {
    margin-bottom: 2px;
}

.ak-explain {
    margin: 2px 0 0;
    padding-left: 18px;
    font-size: 11px;
    color: #374151;
}

@media print {
    .exam-official-header [contenteditable="true"]:hover {
        outline: none;
        background: transparent;
    }
}

.sheet.exam-intl-paper .ws-header .ws-title,
.sheet.exam-intl-paper #ws-meta-line,
.exam-intl-hide {
    display: none !important;
}

.sheet.exam-hide-gloss .trace-meaning-wrap,
.sheet.exam-hide-romaji .trace-phonetic {
    display: none !important;
}
