body.exam-toan-room .tsa-question-body,
body.exam-reading-room .tsa-question-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

body.exam-toan-room .tsa-question-body--offset {
    padding-left: 56px;
}

body.exam-reading-room .tsa-question-body--offset {
    padding-left: 0;
}

body.exam-toan-room .bookmark-btn,
body.exam-reading-room .btn-bookmark {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e7ee;
    border-radius: 999px;
    background: #fbfcfe;
    color: #aeb8c6;
    cursor: pointer;
    font-size: 17px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

body.exam-toan-room .bookmark-btn:hover,
body.exam-reading-room .btn-bookmark:hover {
    border-color: #ccd5e1;
    background: #f6f8fb;
    color: #8997a8;
    transform: translateY(-1px);
}

body.exam-toan-room .bookmark-btn.active,
body.exam-reading-room .btn-bookmark:has(.marked),
body.exam-reading-room .btn-bookmark .marked,
body.exam-reading-room .btn-bookmark.marked {
    border-color: #f7d59b;
    background: #fff6eb;
    color: #f39a18;
    box-shadow: 0 8px 18px rgba(243, 154, 24, 0.18);
}

body.exam-toan-room .bookmark-btn i,
body.exam-reading-room .btn-bookmark i {
    color: inherit;
}

body.exam-toan-room .tsa-choice-list,
body.exam-reading-room .tsa-choice-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
    width: 100%;
}

body.exam-toan-room .tsa-choice-list.is-compact-grid,
body.exam-reading-room .tsa-choice-list.is-compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 54px;
    row-gap: 10px;
}

body.exam-toan-room .tsa-choice-option,
body.exam-reading-room .tsa-choice-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
    color: #343a46;
    font-size: 15px;
    line-height: 1.45;
}

body.exam-toan-room .tsa-choice-option input,
body.exam-reading-room .tsa-choice-option input,
body.exam-toan-room .tsa-binary-option input,
body.exam-reading-room .tsa-binary-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

body.exam-toan-room .tsa-choice-control,
body.exam-reading-room .tsa-choice-control {
    width: 24px;
    height: 24px;
    margin-top: 1px;
    flex-shrink: 0;
    background: #e9ecef;
    border: 1px solid #e3e7ec;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body.exam-toan-room .tsa-choice-option.is-circle .tsa-choice-control,
body.exam-reading-room .tsa-choice-option.is-circle .tsa-choice-control,
body.exam-toan-room .tsa-binary-option .tsa-choice-control,
body.exam-reading-room .tsa-binary-option .tsa-choice-control {
    border-radius: 999px;
}

body.exam-toan-room .tsa-choice-option.is-square .tsa-choice-control,
body.exam-reading-room .tsa-choice-option.is-square .tsa-choice-control {
    border-radius: 4px;
}

body.exam-toan-room .tsa-choice-option.is-checked .tsa-choice-control,
body.exam-reading-room .tsa-choice-option.is-checked .tsa-choice-control,
body.exam-toan-room .tsa-choice-option input:checked + .tsa-choice-control,
body.exam-reading-room .tsa-choice-option input:checked + .tsa-choice-control,
body.exam-toan-room .tsa-binary-option.is-checked .tsa-choice-control,
body.exam-reading-room .tsa-binary-option.is-checked .tsa-choice-control,
body.exam-toan-room .tsa-binary-option input:checked + .tsa-choice-control,
body.exam-reading-room .tsa-binary-option input:checked + .tsa-choice-control {
    border-color: #4d8ed8;
    background: #5a92d9;
    box-shadow: none;
}

body.exam-toan-room .tsa-choice-option.is-checked,
body.exam-reading-room .tsa-choice-option.is-checked {
    color: #18324f;
    font-weight: 500;
}

body.exam-toan-room .tsa-choice-option input:checked ~ .tsa-choice-text-wrap,
body.exam-reading-room .tsa-choice-option input:checked ~ .tsa-choice-text-wrap {
    color: #18324f;
    font-weight: 500;
}

body.exam-toan-room .tsa-choice-option.is-review-correct,
body.exam-reading-room .tsa-choice-option.is-review-correct {
    color: #18324f;
}

body.exam-toan-room .tsa-choice-option.is-review-wrong,
body.exam-reading-room .tsa-choice-option.is-review-wrong {
    color: #4b5563;
}

body.exam-toan-room .tsa-choice-text-wrap,
body.exam-reading-room .tsa-choice-text-wrap {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

body.exam-toan-room .tsa-choice-text,
body.exam-reading-room .tsa-choice-text {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 1px;
}

body.exam-toan-room .tsa-choice-text img,
body.exam-reading-room .tsa-choice-text img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

body.exam-toan-room .tsa-choice-note,
body.exam-reading-room .tsa-choice-note {
    flex-shrink: 0;
    padding-top: 2px;
    font-size: 13px;
    font-weight: 700;
}

body.exam-toan-room .tsa-choice-note.is-correct,
body.exam-reading-room .tsa-choice-note.is-correct {
    color: #34a853;
}

body.exam-toan-room .tsa-choice-note.is-wrong,
body.exam-reading-room .tsa-choice-note.is-wrong {
    color: #ea4335;
}

body.exam-toan-room .tsa-true-false-table,
body.exam-reading-room .tsa-true-false-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e6e9ee;
    border-radius: 0;
    background: #ffffff;
}

body.exam-toan-room .tsa-true-false-table th,
body.exam-toan-room .tsa-true-false-table td,
body.exam-reading-room .tsa-true-false-table th,
body.exam-reading-room .tsa-true-false-table td {
    border: 1px solid #e6e9ee;
    padding: 8px 9px;
    font-size: 15px;
}

body.exam-toan-room .tsa-true-false-table th,
body.exam-reading-room .tsa-true-false-table th {
    background: #ffffff;
    color: #334155;
    font-weight: 500;
    text-align: center;
}

body.exam-toan-room .tsa-tf-text,
body.exam-reading-room .tsa-tf-text {
    width: auto;
    color: #343a46;
    text-align: left;
    font-size: 15px;
    line-height: 1.42;
}

body.exam-toan-room .tsa-tf-cell,
body.exam-reading-room .tsa-tf-cell {
    width: 76px;
    text-align: center;
    vertical-align: middle;
}

body.exam-toan-room .tsa-tf-cell.is-selected,
body.exam-reading-room .tsa-tf-cell.is-selected {
    background: transparent;
}

body.exam-toan-room .tsa-tf-cell.is-review-correct,
body.exam-reading-room .tsa-tf-cell.is-review-correct {
    background: #e6f4ea;
}

body.exam-toan-room .tsa-tf-cell.is-review-wrong,
body.exam-reading-room .tsa-tf-cell.is-review-wrong {
    background: #fce8e6;
}

body.exam-toan-room .tsa-binary-option,
body.exam-reading-room .tsa-binary-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.exam-toan-room .tsa-fill-stack,
body.exam-reading-room .tsa-fill-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.exam-toan-room .tsa-fill-row,
body.exam-reading-room .tsa-fill-row {
    min-height: 42px;
}

body.exam-toan-room .input-dien-khuyet.tsa-blank-input,
body.exam-reading-room .input-dien-khuyet.tsa-blank-input {
    width: min(var(--blank-width, 120px), 100%);
    min-width: 72px;
    max-width: min(300px, 100%);
    padding: 1px 6px 3px;
    margin: 0 3px 2px;
    border: none;
    border-bottom: 2px solid #9fc7ff;
    border-radius: 0;
    outline: none;
    background: transparent;
    color: #163b74;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    text-align: center;
    vertical-align: baseline;
    transition: width 0.12s ease, border-color 0.2s ease, background-color 0.2s ease;
}

body.exam-toan-room .input-dien-khuyet.tsa-blank-input:focus,
body.exam-reading-room .input-dien-khuyet.tsa-blank-input:focus {
    border-bottom-color: #2d8cff;
}

body.exam-toan-room .input-dien-khuyet.tsa-blank-input.input-dung,
body.exam-reading-room .input-dien-khuyet.tsa-blank-input.input-dung {
    border: 1px solid #34a853 !important;
    border-bottom-width: 2px !important;
    border-radius: 8px;
    background: #e6f4ea !important;
}

body.exam-toan-room .input-dien-khuyet.tsa-blank-input.input-sai,
body.exam-reading-room .input-dien-khuyet.tsa-blank-input.input-sai {
    border: 1px solid #ea4335 !important;
    border-bottom-width: 2px !important;
    border-radius: 8px;
    background: #fce8e6 !important;
}

body.exam-toan-room .tsa-fill-feedback,
body.exam-reading-room .tsa-fill-feedback {
    font-size: 14px;
    line-height: 1.55;
}

body.exam-toan-room .tsa-fill-feedback .dung,
body.exam-reading-room .tsa-fill-feedback .dung {
    color: #34a853;
    font-weight: 700;
}

body.exam-toan-room .tsa-fill-feedback .sai,
body.exam-reading-room .tsa-fill-feedback .sai {
    color: #ea4335;
    font-weight: 700;
}

body.exam-toan-room .tsa-drag-layout,
body.exam-reading-room .tsa-drag-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.exam-toan-room .tsa-drag-layout.is-inline-fill,
body.exam-reading-room .tsa-drag-layout.is-inline-fill {
    gap: 12px;
}

body.exam-toan-room .tsa-drag-bank-label,
body.exam-reading-room .tsa-drag-bank-label {
    color: #343a46;
    font-size: 15px;
    font-weight: 500;
}

body.exam-toan-room .tsa-drag-bank,
body.exam-reading-room .tsa-drag-bank {
    min-height: 38px;
    padding: 5px 8px;
    border: 1px solid #dfe5ed;
    border-radius: 4px;
    background: #ffffff;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
}

body.exam-toan-room .tsa-drag-chip,
body.exam-reading-room .tsa-drag-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 3px 10px;
    border: 1px solid #dce3eb;
    border-radius: 4px;
    background: #f4f6f8;
    color: #343a46;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    user-select: none;
    cursor: grab;
    white-space: nowrap;
}

body.exam-toan-room .tsa-drag-slot-list,
body.exam-reading-room .tsa-drag-slot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.exam-toan-room .tsa-drag-slot-row,
body.exam-reading-room .tsa-drag-slot-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

body.exam-toan-room .tsa-drag-slot-prompt,
body.exam-reading-room .tsa-drag-slot-prompt {
    flex: 0 1 auto;
    min-width: 0;
    color: #343a46;
    font-size: 15px;
    line-height: 1.42;
}

body.exam-toan-room .tsa-drag-slot-wrap,
body.exam-reading-room .tsa-drag-slot-wrap {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

body.exam-toan-room .tsa-drag-slot,
body.exam-reading-room .tsa-drag-slot {
    min-width: 96px;
    min-height: 28px;
    padding: 1px 6px;
    border: 1px dashed #bfd0e3;
    border-radius: 4px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.exam-toan-room .tsa-drag-slot.is-inline,
body.exam-reading-room .tsa-drag-slot.is-inline {
    min-width: 88px;
    max-width: min(320px, 100%);
    min-height: 31px;
    padding: 1px 6px 3px;
    margin: 0 3px 2px;
    border: none;
    border-bottom: 2px solid #9fc7ff;
    border-radius: 0;
    background: transparent;
    vertical-align: baseline;
}

body.exam-toan-room .tsa-drag-slot.is-filled,
body.exam-reading-room .tsa-drag-slot.is-filled {
    border-style: solid;
    border-width: 1px;
    border-color: #15397f;
    background: #eef4ff;
}

body.exam-toan-room .tsa-drag-slot.is-inline.is-filled,
body.exam-reading-room .tsa-drag-slot.is-inline.is-filled {
    border: 1px solid #15397f;
    border-bottom-width: 2px;
    border-radius: 8px;
    background: #eef4ff;
}

body.exam-toan-room .tsa-drag-slot.is-review-correct,
body.exam-reading-room .tsa-drag-slot.is-review-correct {
    border-color: #34a853;
    background: #e6f4ea;
}

body.exam-toan-room .tsa-drag-slot.is-inline.is-review-correct,
body.exam-reading-room .tsa-drag-slot.is-inline.is-review-correct {
    border: 1px solid #34a853;
    border-bottom-width: 2px;
    border-radius: 8px;
    background: #e6f4ea;
}

body.exam-toan-room .tsa-drag-slot.is-review-wrong,
body.exam-reading-room .tsa-drag-slot.is-review-wrong {
    border-color: #ea4335;
    background: #fce8e6;
}

body.exam-toan-room .tsa-drag-slot.is-inline.is-review-wrong,
body.exam-reading-room .tsa-drag-slot.is-inline.is-review-wrong {
    border: 1px solid #ea4335;
    border-bottom-width: 2px;
    border-radius: 8px;
    background: #fce8e6;
}

body.exam-toan-room .tsa-drag-slot .tsa-drag-chip,
body.exam-reading-room .tsa-drag-slot .tsa-drag-chip {
    width: 100%;
}

body.exam-toan-room .tsa-drag-slot.is-inline .tsa-drag-chip,
body.exam-reading-room .tsa-drag-slot.is-inline .tsa-drag-chip {
    width: 100%;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #f4f7ff;
    text-align: center;
}

body.exam-toan-room .tsa-drag-feedback,
body.exam-reading-room .tsa-drag-feedback {
    font-size: 13px;
    line-height: 1.45;
}

body.exam-toan-room .tsa-drag-feedback.is-correct,
body.exam-reading-room .tsa-drag-feedback.is-correct {
    color: #34a853;
    font-weight: 700;
}

body.exam-toan-room .tsa-drag-feedback.is-wrong,
body.exam-reading-room .tsa-drag-feedback.is-wrong {
    color: #ea4335;
}

body.exam-toan-room .tsa-drag-slot.is-inline + .tsa-drag-feedback,
body.exam-reading-room .tsa-drag-slot.is-inline + .tsa-drag-feedback {
    display: inline-flex;
    margin: 0 8px 0 4px;
    vertical-align: middle;
}

@media (max-width: 1100px) {
    body.exam-toan-room .tsa-question-body--offset,
    body.exam-reading-room .tsa-question-body--offset {
        padding-left: 0;
    }

    body.exam-toan-room .tsa-choice-list.is-compact-grid,
    body.exam-reading-room .tsa-choice-list.is-compact-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body.exam-toan-room .tsa-drag-slot-row,
    body.exam-reading-room .tsa-drag-slot-row {
        flex-direction: column;
        gap: 8px;
    }
}
