.question-footer__tools .footer-btn:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.question-learning-result:empty {
    display: none;
}

.question-learning-result {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 28px;
    margin: 0 10px 0 2px;
    padding: 4px 10px;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.question-learning-result.is-correct {
    color: #008a4e;
    background: #edf9f3;
}

.question-learning-result.is-wrong {
    color: #d9363e;
    background: #fff1f2;
}

#answerbtn span {
    white-space: nowrap;
}

.question-info__badge .solve-count {
    display: flex;
    align-items: center;
    position: static !important;
    flex: 0 0 auto;
    gap: 8px;
    min-width: 0;
    max-width: none;
    overflow: visible;
    color: #4b5563;
    font-size: 12px;
}

.question-info__badge .bookmark-btn {
    position: static !important;
    flex: 0 0 auto;
    margin-left: 0 !important;
}

.solve-history-label {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    color: #344054;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.solve-history-summary {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.solve-history-item,
.solve-history-empty {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    justify-content: center;
    gap: 0;
    min-width: 25px;
    min-height: 25px;
    padding: 3px 6px;
    border-radius: 6px;
    background: #f3f6fb;
    line-height: 1;
}

.solve-history-item strong {
    font-size: 13px;
}

.solve-history-separator {
    color: #a3a9b2;
    font-weight: 700;
}

.solve-history-more {
    min-width: auto !important;
    height: 28px !important;
    padding: 0 9px !important;
    border: 1px solid #ccd5e1 !important;
    border-radius: 7px;
    background: #fff !important;
    color: #425168 !important;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.solve-history-more:hover,
.solve-history-more:focus-visible {
    border-color: #4d82e8 !important;
    color: #2563c9 !important;
}

.solve-history-data[hidden],
.solve-history-layer[hidden] {
    display: none !important;
}

.solve-history-item.is-correct {
    color: #087c4a;
    background: #eaf8f1;
}

.solve-history-item.is-wrong {
    color: #d6333c;
    background: #fff0f1;
}

.solve-history-layer {
    position: fixed;
    z-index: 10020;
    inset: 0;
    display: grid;
    place-items: center;
    box-sizing: border-box !important;
    width: 100%;
    min-height: 100%;
    overflow: auto;
    padding: 24px !important;
}

.solve-history-layer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.56);
}

.solve-history-layer__dialog {
    position: relative;
    box-sizing: border-box !important;
    width: 520px !important;
    max-width: 100% !important;
    max-height: min(680px, calc(100vh - 48px));
    overflow: auto;
    margin: auto !important;
    padding: 28px !important;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
    outline: none;
}

.solve-history-layer__dialog header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 14px !important;
    padding: 0 !important;
}

.solve-history-layer__dialog header > div {
    min-width: 0;
}

.solve-history-layer__dialog header span {
    color: #3575e7;
    font-size: 11px;
    font-weight: 800;
}

.solve-history-layer__dialog h2 {
    margin: 5px 0 0 !important;
    color: #1d2530;
    font-size: 22px;
    line-height: 1.35;
}

.solve-history-layer__x {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    border: 1px solid #dce1e8 !important;
    border-radius: 50%;
    background: #fff !important;
    color: #4a5565 !important;
    font-size: 22px;
    cursor: pointer;
}

.solve-history-layer__guide {
    margin: 0 0 20px !important;
    padding: 0 0 18px !important;
    border-bottom: 1px solid #edf0f4;
    color: #758093;
    font-size: 12px;
    line-height: 1.6;
}

.solve-history-layer__list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

.solve-history-layer__list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid #e4e8ee;
    border-radius: 10px;
    background: #f8fafc;
}

.solve-history-layer__list li span {
    color: #687386;
    font-size: 11px;
    font-weight: 700;
}

.solve-history-layer__list li strong {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    font-size: 13px;
}

.solve-history-layer__list li strong.is-correct {
    background: #e5f8ef;
    color: #087c4a;
}

.solve-history-layer__list li strong.is-wrong {
    background: #fff0f1;
    color: #d6333c;
}

.solve-history-layer__close {
    width: 100% !important;
    min-height: 42px;
    margin-top: 24px !important;
    border: 0 !important;
    border-radius: 10px;
    background: #222b37 !important;
    color: #fff !important;
    font-weight: 800;
    cursor: pointer;
}

body.solve-history-layer-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .question-info__badge {
        flex-wrap: wrap;
    }

    .question-info__badge .solve-count {
        margin-left: auto;
    }

    .solve-history-layer__list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .solve-history-layer {
        padding: 14px !important;
    }

    .solve-history-layer__dialog {
        max-height: calc(100vh - 28px);
        padding: 22px !important;
        border-radius: 15px;
    }

    .solve-history-layer__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.exam-result .score-average {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    margin-left: 4px;
    padding: 2px 6px;
    border-radius: 10px;
    background: #fff6cf;
    color: #6b5700;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}

.exam-result .score-average.is-frequency {
    background: #f4edff;
    color: #6d28a8;
}

/* Keep the set-average stars and their numeric value as one visual unit. */
.exam-result__header .star-side {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.exam-result__header .star-side .score-box {
    flex: 0 0 auto;
}

/* The status badge must not consume the narrow information column. */
.exam-card__top {
    position: relative;
}

.exam-card__top > .badge__tag {
    position: absolute;
    top: 0;
    right: 0;
}

.exam-card__top .info {
    min-width: 0;
}

.exam-card__top .info strong {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2px;
    padding: 0;
    white-space: nowrap;
}

.exam-card__top .info strong .score-box {
    flex: 0 0 auto;
}

.exam-card__top .info strong .score-average {
    flex: 0 0 auto;
    margin-left: 0;
    padding-right: 4px;
    padding-left: 4px;
}

.cbt-study-tool-toast {
    position: fixed;
    z-index: 10020;
    left: 50%;
    bottom: 88px;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    border-radius: 6px;
    background: #212529;
    color: #fff;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.cbt-study-tool-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}
