.dtlx-quiz-app {
    max-width: 80%;
    margin: 0 auto;
    padding: 30px 20px 60px;
}
.dtlx-quiz-narrow { max-width: 100%; margin: 0 auto; }

.dtlx-quiz-info-form { display: flex; flex-direction: column; gap: 16px; max-width: 380px; margin: 0 auto; }
.dtlx-quiz-field { display: flex; flex-direction: column; gap: 6px; }
.dtlx-quiz-field label { font-size: 13px; font-weight: 700; color: #333; }
.dtlx-quiz-field input {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}
.dtlx-quiz-field input:focus { border-color: #1e4fd8; outline: none; }
.dtlx-quiz-info-form .dtlx-quiz-btn-primary { margin: 6px auto 0; }

.dtlx-quiz-title {
    text-align: center;
    font-size: 26px;
    font-weight: 600;
    color: #123a9e;
    /* margin: 0 0 8px; */
}
.dtlx-quiz-subtitle { text-align: center; color: #666; font-size: 14px; margin: 0 0 30px; }
.dtlx-quiz-empty { text-align: center; color: #999; }

.dtlx-quiz-hang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.dtlx-quiz-hang-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 12px;
    border: 2px solid #e7e9ee;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
}
.dtlx-quiz-hang-btn:hover { border-color: #1e4fd8; background: #f5f8ff; }
.dtlx-quiz-hang-ten { font-size: 18px; font-weight: 800; color: #123a9e; }
.dtlx-quiz-hang-meta { font-size: 12px; color: #888; }

.dtlx-quiz-loading { text-align: center; color: #666; padding: 60px 0; font-size: 15px; }

.dtlx-quiz-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-weight: 700;
    color: #123a9e;
    font-size: 14px;
}
.dtlx-quiz-timer { color: #b32d2e; }

.dtlx-quiz-question { background: #f7f8fa; border-radius: 10px; padding: 22px; margin-bottom: 16px; }
.dtlx-quiz-q-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.dtlx-quiz-q-text { flex: 1 1 auto; min-width: 0; font-size: 15px; line-height: 1.6; margin: 0 0 14px; color: #222; }
.dtlx-quiz-q-img { max-width: 100%; border-radius: 6px; margin-bottom: 14px; display: block; }
.dtlx-quiz-flag-btn {
    flex-shrink: 0;
    border: 1px solid #e0a800;
    background: #fff;
    color: #a06c00;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.dtlx-quiz-flag-btn:hover { background: #fff8e6; }
.dtlx-quiz-flag-btn.is-flagged { background: #ffc107; border-color: #e0a800; color: #4a3600; }

.dtlx-quiz-options { display: flex; flex-direction: column; gap: 10px; }
.dtlx-quiz-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e2e5ec;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}
.dtlx-quiz-option:hover { border-color: #1e4fd8; }
.dtlx-quiz-option input { flex-shrink: 0; }
.dtlx-quiz-option-label { font-weight: 700; color: #1e4fd8; }

.dtlx-quiz-nav { display: flex; gap: 10px; margin-top: 16px; }
.dtlx-quiz-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #f2f4f7;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}
.dtlx-quiz-btn:disabled { opacity: .4; cursor: not-allowed; }
.dtlx-quiz-btn-primary { background: #1e4fd8; color: #fff; border-color: #1e4fd8; margin-left: auto; }
.dtlx-quiz-btn-primary:hover { background: #123a9e; }

.dtlx-quiz-screen[hidden] { display: none !important; }

.dtlx-quiz-lambai-grid {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 30px;
    align-items: start;
}
.dtlx-quiz-lambai-side {
    background: #f7f8fa;
    border-radius: 10px;
    padding: 18px 20px;
    position: sticky;
    top: 20px;
}
.dtlx-quiz-lambai-side-title {
    font-size: 14px;
    font-weight: 800;
    color: #123a9e;
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e7e9ee;
}

.dtlx-quiz-dots { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) {
    .dtlx-quiz-lambai-grid { grid-template-columns: 1fr; }
    .dtlx-quiz-lambai-side { position: static; }
}
.dtlx-quiz-dot {
    border: 1px solid #ddd;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: #666;
}
.dtlx-quiz-dot.is-answered { background: #1e7e34; border-color: #1e7e34; color: #fff; }
.dtlx-quiz-dot.is-active { background: #1e4fd8; border-color: #1e4fd8; color: #fff; }
.dtlx-quiz-dot.is-flagged { box-shadow: 0 0 0 2px #ffc107 inset; }
.dtlx-quiz-dot.is-flagged.is-active { box-shadow: 0 0 0 2px #ffc107; }

.dtlx-quiz-result-badge {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 10px;
}
.dtlx-quiz-pass { background: #e5f6ea; color: #1e7e34; }
.dtlx-quiz-fail { background: #fbe7e7; color: #b32d2e; }
.dtlx-quiz-result-score { font-size: 15px; color: #333; margin: 0 0 6px; }
.dtlx-quiz-result-diemliet { color: #b32d2e; font-weight: 600; font-size: 14px; }

.dtlx-quiz-stat-table { margin-top: 16px; border-collapse: collapse; width: 100%; max-width: 380px; }
.dtlx-quiz-stat-table td { padding: 9px 4px; border-bottom: 1px solid #eceef2; font-size: 14px; color: #333; }
.dtlx-quiz-stat-table td:first-child { color: #666; }
.dtlx-quiz-stat-table td:last-child { text-align: right; font-weight: 700; }
.dtlx-quiz-stat-table tr:last-child td { border-bottom: none; }
.dtlx-quiz-stat-ok { color: #1e7e34 !important; }
.dtlx-quiz-stat-bad { color: #b32d2e !important; }

.dtlx-quiz-result-toggle { margin-top: 18px; background: #f2f4f7; }
.dtlx-quiz-result-detail { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.dtlx-quiz-result-detail[hidden] { display: none; }
.dtlx-quiz-review-item { border-radius: 8px; padding: 16px 18px; background: #f7f8fa; }
/* .dtlx-quiz-review-ok { border-left-color: #1e7e34; }
.dtlx-quiz-review-bad { border-left-color: #b32d2e; }
.dtlx-quiz-review-skip { border-left-color: #999; } */

.dtlx-quiz-review-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dtlx-quiz-review-status { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.dtlx-quiz-status-ok { background: #e5f6ea; color: #1e7e34; }
.dtlx-quiz-status-bad { background: #fbe7e7; color: #b32d2e; }
.dtlx-quiz-status-skip { background: #eceef0; color: #666; }
.dtlx-quiz-status-liet { background: #fff3cd; color: #8a6500; }
.dtlx-quiz-review-item p { margin: 0 0 6px; font-size: 14px; }
.dtlx-quiz-review-img { max-width: 100%; max-height: 220px; display: block; border-radius: 6px; margin-bottom: 10px; }
.dtlx-quiz-review-opt { color: #555; padding: 4px 8px; border-radius: 4px; }
.dtlx-quiz-review-opt.dtlx-quiz-opt-correct { background: #e5f6ea; color: #1e7e34; font-weight: 700; }
.dtlx-quiz-review-opt.dtlx-quiz-opt-wrong { background: #fbe7e7; color: #b32d2e; font-weight: 700; }
.dtlx-quiz-review-giaithich { color: #888; }

.dtlx-quiz-restart { margin-top: 24px; }

.dtlx-quiz-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}
.dtlx-quiz-modal-overlay[hidden] { display: none !important; }
.dtlx-quiz-modal {
    background: #fff;
    border-radius: 10px;
    padding: 26px 24px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.dtlx-quiz-modal-message { font-size: 15px; color: #222; margin: 0 0 20px; line-height: 1.6; }
.dtlx-quiz-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 560px) {
    .dtlx-quiz-hang-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile: KHONG an header/menu cua site nua (da thu che do toan man hinh
   truoc do nhung gay loi nghiem trong: rule "luon hien thi !important" vo
   tinh de len ca luc man hinh dang o trang khac - VD man hinh nhap ten/SDT
   hay chon hang - khien 2 man hinh do bi che mat hoan toan tren mobile).
   Gio chi gon lai font/khoang cach + ghim RIENG thanh nut dieu huong bang
   position:sticky (khong dung fixed/inset toan man hinh nua) - header van
   hien binh thuong nhu moi trang khac. */
@media (max-width: 600px) {
    .dtlx-quiz-app { padding: 16px 12px 20px; }
    .dtlx-quiz-title { font-size: 20px; }
    .dtlx-quiz-subtitle { font-size: 13px; margin-bottom: 20px; }

    .dtlx-quiz-bar { font-size: 13px; margin-bottom: 10px; }
    .dtlx-quiz-question { padding: 14px; border-radius: 8px; }
    .dtlx-quiz-q-head { position: relative; }
    .dtlx-quiz-q-text { padding-right: 38px; font-size: 13.5px; line-height: 1.5; margin-bottom: 10px; }
    .dtlx-quiz-q-img { margin-bottom: 10px; max-height: 220px; object-fit: contain; }

    /* Nut Danh dau: thu gon thanh 1 icon tron nho o goc tren-phai the cau
       hoi (khong con nam chung hang voi chu cau hoi, khong con ep chu hep
       lai nua) - position:absolute NEN CUON THEO NOI DUNG trang binh thuong
       (khong phai fixed ghim cung 1 cho tren man hinh). */
    .dtlx-quiz-flag-btn {
        position: absolute;
        top: 0;
        right: 0;
        width: 28px;
        height: 28px;
        padding: 0;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .dtlx-quiz-flag-label { display: none; }
    .dtlx-quiz-flag-icon { font-size: 15px; line-height: 1; }

    .dtlx-quiz-options { gap: 8px; }
    .dtlx-quiz-option { padding: 9px 10px; font-size: 12.5px; gap: 8px; }

    /* Ghim thanh nut Cau truoc/Cau sau/Nop bai o day MAN HINH (khong phai
       day trang) bang position:sticky - trang van cuon binh thuong, header
       van hien, chi rieng thanh nut nay "dinh" lai khi cuon toi no. */
    .dtlx-quiz-nav {
        position: sticky;
        bottom: 0;
        margin: 12px -12px -20px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        background: #fff;
        box-shadow: 0 -4px 12px rgba(0,0,0,.08);
        gap: 8px;
        z-index: 20;
    }
    .dtlx-quiz-nav .dtlx-quiz-btn { padding: 10px 12px; font-size: 13px; flex: 1 1 0; text-align: center; }
    .dtlx-quiz-nav .dtlx-quiz-btn-primary { flex: 1 1 0; margin-left: 0; }

    .dtlx-quiz-lambai-side { padding: 12px 14px; }
    .dtlx-quiz-lambai-side-title { font-size: 13px; margin-bottom: 10px; padding-bottom: 8px; }
    .dtlx-quiz-dot { width: 32px; height: 32px; padding: 0; border-radius: 6px; font-size: 11px; }

    .dtlx-quiz-result-badge { font-size: 17px; padding: 8px 18px; }
    .dtlx-quiz-result-score { font-size: 13px; }
    .dtlx-quiz-stat-table td { font-size: 13px; padding: 7px 4px; }
    .dtlx-quiz-review-item { padding: 12px 14px; }
    .dtlx-quiz-review-item p { font-size: 13px; }
}
