/* ENT Test — Result Page (edutest.kz style) */

.enttest-result {
    max-width: 1350px;
    margin: 0 auto;
    padding: 24px 16px;
}

.enttest-result-title {
    font-size: 24px;
    font-weight: 400;
    color: #000;
    margin: 0 0 24px;
}

/* ── Score Cards (4 pills) ── */
.enttest-score-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.enttest-score-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 16px;
    background: #fff;
    box-shadow: rgba(145, 158, 171, 0.12) 0px 1px 2px;
}

.enttest-score-label {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.enttest-score-value {
    font-size: 28px;
    font-weight: 700;
    margin-left: auto;
}

.enttest-score-card--score .enttest-score-label { color: #8C40EC; }
.enttest-score-card--score .enttest-score-value { color: #8C40EC; }

.enttest-score-card--pct .enttest-score-label { color: #34A5CF; }
.enttest-score-card--pct .enttest-score-value { color: #34A5CF; }

.enttest-score-card--correct .enttest-score-label { color: #5EB03D; }
.enttest-score-card--correct .enttest-score-value { color: #5EB03D; }

.enttest-score-card--wrong .enttest-score-label { color: #C54451; }
.enttest-score-card--wrong .enttest-score-value { color: #C54451; }

/* ── Info Grid (3 columns) ── */
.enttest-info-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.enttest-info-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: rgba(145, 158, 171, 0.12) 0px 1px 2px;
}

.enttest-info-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin: 0 0 16px;
}

/* General info table */
.enttest-info-table {
    width: 100%;
    font-size: 14px;
}

.enttest-info-table td {
    padding: 5px 0;
    vertical-align: top;
}

.enttest-info-table td:first-child {
    color: #808080;
    white-space: nowrap;
    padding-right: 12px;
}

.enttest-info-table td:last-child {
    text-align: right;
    font-weight: 500;
    color: #000;
}

/* Subject progress bars */
.enttest-subject-bar {
    margin-bottom: 12px;
}

.enttest-subject-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 14px;
}

.enttest-subject-bar-name {
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.enttest-subject-bar-value {
    color: #637381;
    font-weight: 500;
    white-space: nowrap;
}

.enttest-bar-track {
    height: 8px;
    background: #e0e4ea;
    border-radius: 4px;
    overflow: hidden;
}

.enttest-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.enttest-bar-fill--high { background: #5EB03D; }
.enttest-bar-fill--mid { background: #34A5CF; }
.enttest-bar-fill--low { background: #C54451; }

/* Subject grades table */
.enttest-grades-table {
    width: 100%;
    font-size: 14px;
}

.enttest-grades-table td {
    padding: 5px 0;
    border-bottom: 1px solid #ededed;
}

.enttest-grades-table tr:last-child td {
    border-bottom: none;
}

.enttest-grades-table td:first-child {
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

.enttest-grades-table td:last-child {
    text-align: right;
    font-weight: 700;
    color: #000;
}

/* ── Error Work (Работа над ошибками) ── */
.enttest-errorwork {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: rgba(145, 158, 171, 0.12) 0px 1px 2px;
}

.enttest-errorwork h3 {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin: 0 0 20px;
}

.enttest-errorwork-subject {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.enttest-errorwork-subject:last-child {
    margin-bottom: 0;
}

.enttest-errorwork-name {
    width: 200px;
    flex-shrink: 0;
    font-size: 14px;
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.enttest-errorwork-squares {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.enttest-sq {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    user-select: none;
}

.enttest-sq:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.enttest-sq--correct {
    background: #D5FEC7;
    color: #008000;
}

.enttest-sq--wrong {
    background: #FAD6CE;
    color: #C54451;
}

.enttest-sq--unanswered {
    background: #EFF2F8;
    color: #A2A6B8;
}

/* ── Topic Analysis (collapsible tree) ── */
.enttest-topics {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: rgba(145, 158, 171, 0.12) 0px 1px 2px;
}

.enttest-topics h3 {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin: 0 0 16px;
}

.enttest-topics-header {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #ededed;
    font-size: 13px;
    color: #637381;
    font-weight: 500;
}

.enttest-topic-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f5;
    cursor: pointer;
    transition: background 0.15s;
}

.enttest-topic-row:hover {
    background: #f9fafb;
}

.enttest-topic-row-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #000;
}

.enttest-topic-toggle {
    display: inline-flex;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    color: #637381;
    transition: transform 0.2s;
}

.enttest-topic-toggle.open {
    transform: rotate(90deg);
}

.enttest-topic-pct {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.enttest-topic-score-text {
    color: #888;
    font-weight: 500;
    font-size: 13px;
}

.enttest-topic-pct-text {
    min-width: 38px;
    text-align: right;
}

body.theme-dark .enttest-topic-score-text { color: #999; }

.enttest-topic-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.enttest-topic-dot--high { background: #5EB03D; }
.enttest-topic-dot--mid { background: #34A5CF; }
.enttest-topic-dot--low { background: #C54451; }

/* ── Two-column layout: Topics + Leaderboard ── */
.enttest-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

/* ── Leaderboard (Top 10) ── */
.enttest-leaderboard {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: rgba(145, 158, 171, 0.12) 0px 1px 2px;
}

.enttest-leaderboard h3 {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin: 0 0 16px;
}

.enttest-lb-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f5;
}

.enttest-lb-row:last-child {
    border-bottom: none;
}

.enttest-lb-rank {
    width: 30px;
    font-weight: 600;
    color: #637381;
}

.enttest-lb-name {
    flex: 1;
    color: #000;
}

.enttest-lb-score {
    font-weight: 700;
    color: #000;
}

.enttest-lb-row--me {
    background: #3750AC;
    color: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 8px;
}

.enttest-lb-row--me .enttest-lb-rank,
.enttest-lb-row--me .enttest-lb-name,
.enttest-lb-row--me .enttest-lb-score {
    color: #fff;
}

/* ── AI Chatbot ── */
.enttest-ai-chat {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: rgba(145, 158, 171, 0.12) 0px 1px 2px;
    text-align: center;
}

.enttest-ai-title {
    font-size: 20px;
    font-weight: 700;
    font-style: italic;
    color: #000;
    margin: 0 0 20px;
}

.enttest-ai-messages {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 16px;
    text-align: left;
}

.enttest-ai-msg {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
    max-width: 85%;
}

.enttest-ai-msg--bot {
    background: #e8f5e9;
    color: #000;
    border-bottom-left-radius: 4px;
}

.enttest-ai-msg--user {
    background: #e3f2fd;
    color: #000;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.enttest-ai-msg--loading {
    background: #f5f5f5;
    color: #888;
    padding: 14px 18px;
}

.enttest-ai-typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
}

.enttest-ai-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3750AC;
    opacity: 0.4;
    animation: enttest-ai-bounce 1.2s infinite ease-in-out;
}

.enttest-ai-typing-dot:nth-child(1) { animation-delay: 0s; }
.enttest-ai-typing-dot:nth-child(2) { animation-delay: 0.18s; }
.enttest-ai-typing-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes enttest-ai-bounce {
    0%, 60%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px) scale(1.15);
        opacity: 1;
    }
}

body.theme-dark .enttest-ai-msg--loading {
    background: #1f2547;
}

body.theme-dark .enttest-ai-typing-dot {
    background: #6c8dff;
}

.enttest-ai-quick-btns {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.enttest-ai-quick-btn {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    color: #000;
}

.enttest-ai-quick-btn:hover {
    border-color: #3750AC;
    color: #3750AC;
    background: #f0f2ff;
}

.enttest-ai-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.enttest-ai-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.enttest-ai-input:focus {
    border-color: #3750AC;
}

.enttest-ai-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #3750AC;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.enttest-ai-send:hover {
    background: #25377B;
}

.enttest-ai-disclaimer {
    font-size: 12px;
    color: #808080;
    margin-top: 12px;
}

/* ── Rating Form ── */
.enttest-rating-form {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: rgba(145, 158, 171, 0.12) 0px 1px 2px;
    text-align: center;
}

.enttest-rating-form h3 {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin: 0 0 8px;
}

.enttest-rating-form p {
    font-size: 14px;
    color: #637381;
    margin: 0 0 20px;
}

.enttest-rating-emojis {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.enttest-rating-emoji {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.15s;
    font-size: 12px;
    color: #637381;
}

.enttest-rating-emoji:hover {
    transform: scale(1.15);
}

.enttest-rating-emoji span:first-child {
    font-size: 36px;
}

.enttest-rating-emoji.selected span:first-child {
    transform: scale(1.2);
}

.enttest-rating-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.enttest-rating-skip {
    background: none;
    border: none;
    color: #3750AC;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
}

.enttest-rating-submit {
    background: #25377B;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.enttest-rating-submit:hover {
    background: #3750AC;
}

/* Back button */
.enttest-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #3750AC;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    transition: color 0.15s;
}

.enttest-back-btn:hover {
    color: #25377B;
    text-decoration: none;
}

/* ── Question Modal ── */
.enttest-qmodal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 40px 16px;
}

.enttest-qmodal-overlay.open {
    display: flex;
}

.enttest-qmodal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    min-height: 400px;
    position: relative;
    animation: enttest-modal-in 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes enttest-modal-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header: nav buttons + close — one row, no overlap */
.enttest-qmodal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.enttest-qmodal-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
}

.enttest-qmodal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 20px;
    color: #637381;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.enttest-qmodal-close:hover {
    background: #e8e8e8;
    color: #000;
}

.enttest-qmodal-prev,
.enttest-qmodal-next {
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.enttest-qmodal-prev:disabled,
.enttest-qmodal-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.enttest-qmodal-prev {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
}

.enttest-qmodal-prev:hover:not(:disabled) {
    border-color: #aaa;
}

.enttest-qmodal-next {
    background: #4FC3A3;
    color: #fff;
}

.enttest-qmodal-next:hover:not(:disabled) {
    background: #3da88b;
}

.enttest-qmodal-body {
    padding: 24px 28px 28px;
    overflow-y: auto;
    flex: 1;
}

/* Meta: question number, subject, topic */
.enttest-qmodal-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.enttest-qmodal-qnum {
    font-size: 14px;
    font-weight: 600;
    color: #4052B5;
    background: rgba(64,82,181,0.08);
    padding: 4px 10px;
    border-radius: 6px;
}

.enttest-qmodal-subject-name {
    font-size: 13px;
    font-weight: 500;
    color: #637381;
    background: #f5f7fa;
    padding: 4px 10px;
    border-radius: 6px;
}

.enttest-qmodal-topic-name {
    font-size: 12px;
    color: #999;
}

.enttest-qmodal-context {
    font-size: 14px;
    line-height: 1.7;
    color: #000;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ededed;
}

.enttest-qmodal-text {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: #000;
    margin-bottom: 20px;
}

.enttest-qmodal-answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.enttest-qmodal-answer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    font-size: 14px;
    line-height: 1.5;
}

.enttest-qmodal-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.enttest-qmodal-icon--correct { color: #008000; }
.enttest-qmodal-icon--wrong { color: #C54451; }

.enttest-qmodal-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.enttest-qmodal-letter--correct {
    background: #D5FEC7;
    color: #008000;
    border: 2px solid #008000;
}

.enttest-qmodal-letter--wrong {
    background: #FAD6CE;
    color: #C54451;
    border: 2px solid #C54451;
}

.enttest-qmodal-letter--neutral {
    background: #EFF2F8;
    color: #A2A6B8;
    border: 2px solid #e0e4ea;
}

.enttest-qmodal-answer-text {
    padding-top: 4px;
    color: #000;
}

/* ── Explanation (AI-powered) ── */
.enttest-explanation {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.enttest-explanation-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #4052B5;
    background: rgba(64,82,181,0.06);
    border: 1px solid rgba(64,82,181,0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.enttest-explanation-toggle:hover {
    background: rgba(64,82,181,0.12);
    border-color: rgba(64,82,181,0.35);
}

.enttest-explanation-toggle--open {
    background: rgba(64,82,181,0.12);
    border-color: #4052B5;
}

.enttest-explanation-icon { font-size: 16px; }
.enttest-explanation-arrow { font-size: 11px; color: #999; }

.enttest-explanation-content {
    margin-top: 12px;
    padding: 20px;
    background: #f8f9fb;
    border-radius: 12px;
    border: 1px solid #e8ecf0;
}

.enttest-expl-static {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #ddd;
}

/* AI explanation rich content */
.enttest-expl-ai-content {
    font-size: 14px;
    line-height: 1.7;
    color: #1a1a2e;
}

.enttest-expl-ai-content h1,
.enttest-expl-ai-content h2,
.enttest-expl-ai-content h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 16px 0 8px;
}

.enttest-expl-ai-content h1:first-child,
.enttest-expl-ai-content h2:first-child,
.enttest-expl-ai-content h3:first-child {
    margin-top: 0;
}

.enttest-expl-ai-content p {
    margin: 8px 0;
}

.enttest-expl-ai-content ul,
.enttest-expl-ai-content ol {
    padding-left: 20px;
    margin: 8px 0;
}

.enttest-expl-ai-content li {
    margin-bottom: 4px;
}

.enttest-expl-ai-content strong {
    color: #4052B5;
}

.enttest-expl-ai-content code {
    background: rgba(64,82,181,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.enttest-expl-ai-content pre {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 12px 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
    margin: 12px 0;
}

.enttest-expl-ai-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.enttest-expl-ai-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}

.enttest-expl-ai-content th,
.enttest-expl-ai-content td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.enttest-expl-ai-content th {
    background: #f0f2f5;
    font-weight: 600;
}

.enttest-expl-ai-content blockquote {
    border-left: 3px solid #4052B5;
    margin: 12px 0;
    padding: 8px 16px;
    background: rgba(64,82,181,0.04);
    color: #555;
}

/* Loading spinner for AI */
.enttest-expl-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
    color: #637381;
    font-size: 14px;
}

.enttest-expl-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e4ea;
    border-top-color: #4052B5;
    border-radius: 50%;
    animation: enttest-spin 0.8s linear infinite;
}

@keyframes enttest-spin {
    to { transform: rotate(360deg); }
}

.enttest-expl-ai-error {
    color: #C54451;
    font-size: 13px;
    padding: 8px 0;
}

/* Video explanation */
.enttest-explanation-video {
    margin-top: 12px;
}

.enttest-explanation-video a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(140,64,236,0.08);
    color: #8C40EC;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}

.enttest-explanation-video a:hover {
    background: rgba(140,64,236,0.15);
    text-decoration: none;
}

/* Dark theme for modal */
body.theme-dark .enttest-qmodal { background: #1a1f35; }
body.theme-dark .enttest-qmodal-header { border-bottom-color: #2a2d4a; }
body.theme-dark .enttest-qmodal-close { background: #2a2d4a; color: #999; }
body.theme-dark .enttest-qmodal-close:hover { background: #3a3d5a; color: #fff; }
body.theme-dark .enttest-qmodal-prev { background: #2a2d4a; color: #ccc; border-color: #3a3d5a; }
body.theme-dark .enttest-qmodal-prev:hover:not(:disabled) { border-color: #666; }
body.theme-dark .enttest-qmodal-qnum { color: #8B8ECC; background: rgba(139,142,204,0.1); }
body.theme-dark .enttest-qmodal-subject-name { color: #999; background: #2a2d4a; }
body.theme-dark .enttest-qmodal-topic-name { color: #666; }
body.theme-dark .enttest-qmodal-context { color: #ccc; border-bottom-color: #2a2d4a; }
body.theme-dark .enttest-qmodal-text { color: #e0e0e0; }
body.theme-dark .enttest-qmodal-answer-text { color: #ccc; }
body.theme-dark .enttest-qmodal-letter--neutral { background: #2a2d4a; color: #666; border-color: #3a3d5a; }
body.theme-dark .enttest-qmodal-letter--correct { background: rgba(0,128,0,0.15); }
body.theme-dark .enttest-qmodal-letter--wrong { background: rgba(197,68,81,0.15); }

/* Dark theme: explanation */
body.theme-dark .enttest-explanation { border-top-color: #2a2d4a; }
body.theme-dark .enttest-explanation-toggle { color: #8B8ECC; background: rgba(139,142,204,0.08); border-color: rgba(139,142,204,0.2); }
body.theme-dark .enttest-explanation-toggle:hover { background: rgba(139,142,204,0.15); }
body.theme-dark .enttest-explanation-toggle--open { border-color: #8B8ECC; }
body.theme-dark .enttest-explanation-content { background: #16213e; border-color: #2a2d4a; }
body.theme-dark .enttest-expl-static { color: #ccc; border-bottom-color: #2a2d4a; }
body.theme-dark .enttest-expl-ai-content { color: #ddd; }
body.theme-dark .enttest-expl-ai-content h1,
body.theme-dark .enttest-expl-ai-content h2,
body.theme-dark .enttest-expl-ai-content h3 { color: #e0e0e0; }
body.theme-dark .enttest-expl-ai-content strong { color: #8B8ECC; }
body.theme-dark .enttest-expl-ai-content code { background: rgba(139,142,204,0.12); }
body.theme-dark .enttest-expl-ai-content th { background: #2a2d4a; color: #ccc; }
body.theme-dark .enttest-expl-ai-content td { border-color: #2a2d4a; }
body.theme-dark .enttest-expl-ai-content blockquote { border-left-color: #8B8ECC; background: rgba(139,142,204,0.05); color: #aaa; }
body.theme-dark .enttest-expl-spinner { border-color: #2a2d4a; border-top-color: #8B8ECC; }
body.theme-dark .enttest-expl-loading { color: #999; }
body.theme-dark .enttest-explanation-video a { color: #b388ff; background: rgba(179,136,255,0.1); }
body.theme-dark .enttest-explanation-video a:hover { background: rgba(179,136,255,0.2); }

/* ── Results List ── */
.enttest-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.enttest-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: 16px;
    padding: 16px 24px;
    box-shadow: rgba(145, 158, 171, 0.12) 0px 1px 2px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
}

.enttest-result-item:hover {
    box-shadow: rgba(145, 158, 171, 0.2) 0px 4px 12px;
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
}

.enttest-result-item-name {
    font-size: 15px;
    font-weight: 600;
    color: #000;
    margin-bottom: 4px;
}

.enttest-result-item-meta {
    font-size: 13px;
    color: #637381;
}

.enttest-result-item-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.enttest-result-item-score {
    font-size: 18px;
    font-weight: 700;
    color: #000;
}

.enttest-result-item-pct {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.enttest-result-item-pct--high { background: #5EB03D; }
.enttest-result-item-pct--mid { background: #34A5CF; }
.enttest-result-item-pct--low { background: #C54451; }

/* ── Progress Chart ── */
.enttest-progress-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: rgba(145, 158, 171, 0.12) 0px 1px 2px;
}

.enttest-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.enttest-progress-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin: 0;
}

.enttest-progress-link {
    font-size: 13px;
    color: #3750AC;
    text-decoration: none;
    font-weight: 500;
}

.enttest-progress-link:hover {
    color: #25377B;
    text-decoration: none;
}

.enttest-progress-card--hint {
    text-align: center;
}

.enttest-progress-card--hint p {
    color: #637381;
    font-size: 14px;
    margin: 0;
}

#enttest-progress-canvas {
    max-height: 220px;
}

/* ── Topic Children (expandable) ── */
.enttest-topic-subject .enttest-topic-row {
    cursor: pointer;
}

.enttest-topic-children {
    display: none;
    padding-left: 28px;
    border-left: 2px solid #e0e4ea;
    margin-left: 10px;
    margin-bottom: 4px;
}

.enttest-topic-subject--open > .enttest-topic-children {
    display: block;
}

.enttest-topic-child-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    font-size: 13px;
    border-bottom: 1px solid #f5f5f5;
}

.enttest-topic-child-row:last-child {
    border-bottom: none;
}

.enttest-topic-child-name {
    color: #444;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.enttest-topic-child-bar {
    width: 80px;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.enttest-topic-child-bar .enttest-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.enttest-topic-child-score {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    min-width: 36px;
    text-align: right;
    margin-right: 4px;
}

.enttest-topic-child-pct {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    color: #333;
    min-width: 40px;
    text-align: right;
    padding-left: 4px;
    border-left: 1px solid #e0e0e0;
}

.enttest-topic-play {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #8C40EC;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.15s;
    line-height: 1;
}

.enttest-topic-play:hover {
    background: #7330CC;
    transform: scale(1.1);
}

/* ── Video Modal ── */
.enttest-vmodal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
}

.enttest-vmodal-overlay.open {
    display: flex;
}

.enttest-vmodal {
    position: relative;
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.enttest-vmodal-close {
    position: absolute;
    top: -36px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
    opacity: 0.8;
}

.enttest-vmodal-close:hover {
    opacity: 1;
}

.enttest-vmodal-body {
    width: 100%;
    height: 100%;
}

.enttest-vmodal-body iframe,
.enttest-vmodal-body video {
    width: 100%;
    height: 100%;
    border: none;
}

/* ── Leaderboard Footer ── */
.enttest-lb-footer {
    text-align: center;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid #f3f4f5;
}

.enttest-lb-footer a {
    font-size: 13px;
    color: #3750AC;
    text-decoration: none;
    font-weight: 500;
}

.enttest-lb-footer a:hover {
    color: #25377B;
    text-decoration: none;
}

/* ── Dark Theme ── */
body.theme-dark .enttest-result { color: #e0e0e0; }
body.theme-dark .enttest-result-title { color: #e0e0e0; }

body.theme-dark .enttest-score-card { background: #16213e; }

body.theme-dark .enttest-info-card { background: #16213e; }
body.theme-dark .enttest-info-card h3 { color: #e0e0e0; }
body.theme-dark .enttest-info-table td:first-child { color: #999; }
body.theme-dark .enttest-info-table td:last-child { color: #e0e0e0; }
body.theme-dark .enttest-subject-bar-name { color: #e0e0e0; }
body.theme-dark .enttest-subject-bar-value { color: #aaa; }
body.theme-dark .enttest-bar-track { background: #2a2d4a; }
body.theme-dark .enttest-grades-table td { border-color: #2a2d4a; color: #e0e0e0; }

body.theme-dark .enttest-errorwork { background: #16213e; }
body.theme-dark .enttest-errorwork h3 { color: #e0e0e0; }
body.theme-dark .enttest-errorwork-name { color: #ccc; }
body.theme-dark .enttest-sq--unanswered { background: #2a2d4a; color: #666; }

body.theme-dark .enttest-progress-card { background: #16213e; }
body.theme-dark .enttest-progress-header h3 { color: #e0e0e0; }
body.theme-dark .enttest-progress-card--hint p { color: #888; }

body.theme-dark .enttest-topics { background: #16213e; }
body.theme-dark .enttest-topics h3 { color: #e0e0e0; }
body.theme-dark .enttest-topics-header { color: #888; border-color: #2a2d4a; }
body.theme-dark .enttest-topic-row { border-color: #1e2545; }
body.theme-dark .enttest-topic-row:hover { background: #1e2545; }
body.theme-dark .enttest-topic-row-name { color: #e0e0e0; }
body.theme-dark .enttest-topic-children { border-color: #2a2d4a; }
body.theme-dark .enttest-topic-child-row { border-color: #1e2545; }
body.theme-dark .enttest-topic-child-name { color: #bbb; }
body.theme-dark .enttest-topic-child-bar { background: #2a2d4a; }
body.theme-dark .enttest-topic-child-score { color: #777; }
body.theme-dark .enttest-topic-child-pct { color: #ccc; border-color: #2a2d4a; }
body.theme-dark .enttest-topic-play { background: #9B59B6; }
body.theme-dark .enttest-topic-play:hover { background: #8E44AD; }

body.theme-dark .enttest-leaderboard { background: #16213e; }
body.theme-dark .enttest-leaderboard h3 { color: #e0e0e0; }
body.theme-dark .enttest-lb-row { border-color: #1e2545; }
body.theme-dark .enttest-lb-name,
body.theme-dark .enttest-lb-score { color: #e0e0e0; }
body.theme-dark .enttest-lb-footer { border-color: #1e2545; }

body.theme-dark .enttest-ai-chat { background: #16213e; }
body.theme-dark .enttest-ai-title { color: #e0e0e0; }
body.theme-dark .enttest-ai-msg--bot { background: #1a4a1a; color: #ccc; }
body.theme-dark .enttest-ai-msg--user { background: #1e2545; color: #ccc; }
body.theme-dark .enttest-ai-quick-btn { background: #1e2545; border-color: #3a3d5a; color: #ccc; }
body.theme-dark .enttest-ai-quick-btn:hover { border-color: #5B5EA6; color: #7B7ECC; background: #252850; }
body.theme-dark .enttest-ai-input { background: #2a2d4a; border-color: #3a3d5a; color: #e0e0e0; }

body.theme-dark .enttest-rating-form { background: #16213e; }
body.theme-dark .enttest-rating-form h3 { color: #e0e0e0; }
body.theme-dark .enttest-rating-form p { color: #999; }
body.theme-dark .enttest-rating-emoji { color: #999; }

body.theme-dark .enttest-result-item { background: #16213e; }
body.theme-dark .enttest-result-item-name { color: #e0e0e0; }
body.theme-dark .enttest-result-item-meta { color: #888; }
body.theme-dark .enttest-result-item-score { color: #e0e0e0; }

body.theme-dark .enttest-qmodal { background: #16213e; color: #e0e0e0; }
body.theme-dark .enttest-qmodal-close { color: #888; }
body.theme-dark .enttest-qmodal-prev { background: #2a2d4a; border-color: #3a3d5a; color: #ccc; }
body.theme-dark .enttest-qmodal-context { border-color: #2a2d4a; color: #ccc; }
body.theme-dark .enttest-qmodal-text { color: #e0e0e0; }
body.theme-dark .enttest-qmodal-answer-text { color: #ccc; }
body.theme-dark .enttest-qmodal-letter--neutral { background: #2a2d4a; color: #666; border-color: #3a3d5a; }

/* ── Explanation ── */
.enttest-explanation {
    margin-top: 20px;
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}
.enttest-explanation-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #4A90D9;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    width: 100%;
    text-align: left;
}
.enttest-explanation-toggle:hover {
    background: #f0f7ff;
    border-color: #4A90D9;
}
.enttest-explanation-icon { font-size: 16px; }
.enttest-explanation-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s;
}
.enttest-explanation-content {
    margin-top: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}
.enttest-explanation-content img {
    max-width: 100%;
    border-radius: 6px;
}
.enttest-explanation-video {
    margin-top: 12px;
}
.enttest-explanation-video a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4A90D9;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    padding: 8px 14px;
    border: 1px solid #4A90D9;
    border-radius: 8px;
    transition: background 0.2s;
}
.enttest-explanation-video a:hover {
    background: #f0f7ff;
}

body.theme-dark .enttest-explanation { border-top-color: #2a2d4a; }
body.theme-dark .enttest-explanation-toggle {
    border-color: #3a3d5a;
    color: #6cb4ee;
}
body.theme-dark .enttest-explanation-toggle:hover {
    background: #1e2a4a;
    border-color: #6cb4ee;
}
body.theme-dark .enttest-explanation-content {
    background: #1a1f35;
    color: #ccc;
}
body.theme-dark .enttest-explanation-video a {
    color: #6cb4ee;
    border-color: #6cb4ee;
}
body.theme-dark .enttest-explanation-video a:hover {
    background: #1e2a4a;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .enttest-info-grid {
        grid-template-columns: 1fr 1fr;
    }
    .enttest-info-grid > :last-child {
        grid-column: 1 / -1;
    }
    .enttest-two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .enttest-result {
        padding: 16px 12px;
    }
    .enttest-result-title {
        font-size: 20px;
    }
    .enttest-score-cards {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .enttest-score-card {
        flex-direction: column;
        text-align: center;
        gap: 4px;
        padding: 12px;
    }
    .enttest-score-value {
        margin-left: 0;
        font-size: 24px;
    }
    .enttest-score-label {
        font-size: 12px;
    }
    .enttest-info-grid {
        grid-template-columns: 1fr;
    }
    .enttest-info-grid > :last-child {
        grid-column: auto;
    }
    .enttest-errorwork-subject {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .enttest-errorwork-name {
        width: auto;
    }
    .enttest-sq {
        width: 34px;
        height: 34px;
        font-size: 11px;
    }
    .enttest-qmodal-overlay {
        padding: 0;
    }
    .enttest-qmodal {
        border-radius: 0;
        min-height: 100vh;
    }
    .enttest-qmodal-nav {
        flex-direction: column;
        align-items: stretch;
    }
    .enttest-qmodal-prev,
    .enttest-qmodal-next {
        justify-content: center;
    }
    .enttest-qmodal-body {
        padding: 0 16px 24px;
    }
    .enttest-ai-quick-btns {
        flex-direction: column;
    }
    .enttest-ai-quick-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .enttest-score-cards { grid-template-columns: 1fr 1fr; }
    .enttest-score-card { padding: 10px; gap: 2px; }
    .enttest-score-value { font-size: 20px; }
    .enttest-score-label { font-size: 11px; }
    .enttest-result { padding: 12px 10px; }
    .enttest-result-title { font-size: 18px; margin-bottom: 16px; }
    .enttest-info-card { padding: 16px; }
    .enttest-info-card h3 { font-size: 14px; margin-bottom: 12px; }
    .enttest-results-page { padding: 16px 10px; }
    .enttest-results-page-title { font-size: 18px; }
    .enttest-sq { width: 30px; height: 30px; font-size: 10px; }
    .enttest-review-block { padding: 16px; margin-top: 20px; }
    .enttest-review-block h3 { font-size: 16px; }
}

/* ══════════════════════════════════════
   Results List Page (edutest.kz style)
   ══════════════════════════════════════ */

.enttest-results-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 16px;
}

.enttest-results-page-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 20px;
}

/* Empty state */
.enttest-results-empty {
    text-align: center;
    padding: 60px 24px;
    background: #fff;
    border-radius: 12px;
}
.enttest-results-empty p {
    font-size: 16px;
    color: #637381;
    margin: 16px 0;
}
.enttest-results-empty-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #4052B5;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}
.enttest-results-empty-btn:hover {
    background: #2a3a9f;
    color: #fff;
    text-decoration: none;
}

/* Cards grid */
.enttest-results-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Single result card */
.enttest-rcard {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}
.enttest-rcard:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.enttest-rcard-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px;
}

.enttest-rcard-divider {
    height: 2px;
    background: #4052B5;
    border-radius: 1px;
    margin-bottom: 16px;
    opacity: 0.2;
}

.enttest-rcard-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    margin-bottom: 16px;
}

.enttest-rcard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.enttest-rcard-label {
    color: #637381;
}

.enttest-rcard-value {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: #1a1a2e;
}

.enttest-rcard-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: #5c6bc0;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s;
}
.enttest-rcard-btn:hover {
    background: #3f4fa0;
    color: #fff;
    text-decoration: none;
}

/* Dark theme */
body.theme-dark .enttest-results-page-title { color: #e0e0e0; }
body.theme-dark .enttest-results-empty { background: #16213e; }
body.theme-dark .enttest-results-empty p { color: #999; }
body.theme-dark .enttest-rcard { background: #16213e; }
body.theme-dark .enttest-rcard-title { color: #e0e0e0; }
body.theme-dark .enttest-rcard-label { color: #8e9aaf; }
body.theme-dark .enttest-rcard-value { color: #ccc; }

/* ═══ Fill-in-the-blank result ═══ */
.enttest-fill-result {
    margin: 12px 0;
}
.enttest-fill-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}
.enttest-fill-label {
    font-weight: 600;
    font-size: 14px;
    color: #555;
}
.enttest-fill-value {
    font-size: 15px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
}
.enttest-fill-value--correct {
    color: #1a7a1a;
    background: rgba(0,128,0,0.08);
}
.enttest-fill-value--wrong {
    color: #C54451;
    text-decoration: line-through;
    background: rgba(197,68,81,0.08);
}
.enttest-fill-value--empty {
    color: #999;
    font-style: italic;
}
body.theme-dark .enttest-fill-label { color: #aaa; }
body.theme-dark .enttest-fill-value--correct { color: #4caf50; background: rgba(76,175,80,0.12); }
body.theme-dark .enttest-fill-value--wrong { color: #ef5350; background: rgba(239,83,80,0.12); }
body.theme-dark .enttest-fill-value--empty { color: #666; }

/* ── Comparison Analysis v2 ── */
.enttest-cmp-section {
    margin-bottom: 32px;
}
.enttest-cmp-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 16px;
}
.enttest-cmp-grid {
    display: grid;
    grid-template-columns: 240px 1fr 1fr;
    gap: 16px;
}
.enttest-cmp-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: rgba(145, 158, 171, 0.12) 0px 1px 2px;
}
.enttest-cmp-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 16px;
}

/* Ring */
.enttest-cmp-percentile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.enttest-cmp-ring-wrap {
    position: relative;
    width: 130px;
    height: 130px;
    margin-bottom: 12px;
}
.enttest-cmp-ring {
    width: 100%;
    height: 100%;
}
.enttest-cmp-ring-bg { stroke: #e5e7eb; }
.enttest-cmp-ring-fill {
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.enttest-cmp-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.enttest-cmp-ring-value {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
}
.enttest-cmp-ring-desc {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}
.enttest-cmp-ring-total {
    font-size: 12px;
    color: #999;
}

/* Horizontal bars */
.enttest-cmp-bars-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.enttest-cmp-bar-item {
    display: grid;
    grid-template-columns: 130px 1fr 50px;
    align-items: center;
    gap: 10px;
}
.enttest-cmp-bar-item--you .enttest-cmp-bar-label {
    font-weight: 700;
    color: #8C40EC;
}
.enttest-cmp-bar-label {
    font-size: 13px;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.enttest-cmp-bar-track {
    height: 10px;
    background: #f0f2f5;
    border-radius: 5px;
    overflow: hidden;
}
.enttest-cmp-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.enttest-cmp-bar-value {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    text-align: right;
}

/* Rank cards */
.enttest-cmp-ranks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.enttest-cmp-rank-card {
    background: #f8f9fb;
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    transition: transform 0.15s;
}
.enttest-cmp-rank-card:hover {
    transform: translateY(-2px);
}
.enttest-cmp-rank-num {
    font-size: 24px;
    font-weight: 800;
    color: #5B5EA6;
}
.enttest-cmp-rank-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin: 2px 0;
}
.enttest-cmp-rank-total {
    font-size: 11px;
    color: #999;
}
.enttest-cmp-rank-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    font-size: 13px;
    padding: 20px;
}

/* Dark mode */
body.theme-dark .enttest-cmp-title { color: #e0e0e0; }
body.theme-dark .enttest-cmp-card { background: #16213e; }
body.theme-dark .enttest-cmp-card-title { color: #888; }
body.theme-dark .enttest-cmp-ring-bg { stroke: #2a2d4a; }
body.theme-dark .enttest-cmp-ring-value { color: #e0e0e0; }
body.theme-dark .enttest-cmp-ring-desc { color: #ccc; }
body.theme-dark .enttest-cmp-ring-total { color: #777; }
body.theme-dark .enttest-cmp-bar-label { color: #aaa; }
body.theme-dark .enttest-cmp-bar-item--you .enttest-cmp-bar-label { color: #a78bfa; }
body.theme-dark .enttest-cmp-bar-track { background: #2a2d4a; }
body.theme-dark .enttest-cmp-bar-value { color: #ccc; }
body.theme-dark .enttest-cmp-rank-card { background: #1e2545; }
body.theme-dark .enttest-cmp-rank-num { color: #7B7ECC; }
body.theme-dark .enttest-cmp-rank-label { color: #aaa; }
body.theme-dark .enttest-cmp-rank-total { color: #666; }

/* Mobile */
@media (max-width: 1024px) {
    .enttest-cmp-grid {
        grid-template-columns: 1fr 1fr;
    }
    .enttest-cmp-percentile {
        grid-column: 1 / -1;
    }
}
@media (max-width: 600px) {
    .enttest-cmp-grid {
        grid-template-columns: 1fr;
    }
    .enttest-cmp-percentile {
        grid-column: auto;
    }
    .enttest-cmp-bar-item {
        grid-template-columns: 100px 1fr 40px;
        gap: 6px;
    }
    .enttest-cmp-bar-label { font-size: 11px; }
    .enttest-cmp-bar-value { font-size: 12px; }
    .enttest-cmp-ring-wrap { width: 110px; height: 110px; }
    .enttest-cmp-ring-value { font-size: 24px; }
}

/* ── Appeals ── */
.enttest-appeal {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}
.enttest-appeal-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #e67e22;
    background: rgba(230,126,34,0.08);
    border: 1px solid rgba(230,126,34,0.25);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.enttest-appeal-btn:hover {
    background: rgba(230,126,34,0.15);
    border-color: rgba(230,126,34,0.4);
}
.enttest-appeal-form {
    margin-top: 10px;
}
.enttest-appeal-textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    resize: vertical;
    min-height: 70px;
    font-family: inherit;
}
.enttest-appeal-textarea:focus {
    outline: none;
    border-color: #4A90D9;
}
.enttest-appeal-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
}
.enttest-appeal-form-actions .enttest-btn {
    padding: 6px 16px;
    font-size: 13px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}
.enttest-appeal-form-actions .enttest-btn-primary {
    background: #4A90D9;
    color: #fff;
}
.enttest-appeal-form-actions .enttest-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.enttest-appeal-form-actions .enttest-btn-secondary {
    background: #eee;
    color: #333;
}
.enttest-appeal-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
}
.enttest-appeal-status--pending {
    color: #e67e22;
    background: rgba(230,126,34,0.08);
    border: 1px solid rgba(230,126,34,0.2);
}
.enttest-appeal-status--approved {
    color: #27ae60;
    background: rgba(39,174,96,0.08);
    border: 1px solid rgba(39,174,96,0.2);
}
.enttest-appeal-status--rejected {
    color: #C54451;
    background: rgba(197,68,81,0.08);
    border: 1px solid rgba(197,68,81,0.2);
}
.enttest-appeal-response {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}
.enttest-appeal-icon {
    font-size: 14px;
}
body.theme-dark .enttest-appeal { border-top-color: #333; }
body.theme-dark .enttest-appeal-btn { color: #f0a500; background: rgba(240,165,0,0.1); border-color: rgba(240,165,0,0.25); }
body.theme-dark .enttest-appeal-textarea { background: #1e1e1e; color: #ddd; border-color: #444; }
body.theme-dark .enttest-appeal-textarea:focus { border-color: #5c9ce6; }
body.theme-dark .enttest-appeal-form-actions .enttest-btn-secondary { background: #333; color: #ccc; }
body.theme-dark .enttest-appeal-status--pending { color: #f0a500; background: rgba(240,165,0,0.1); border-color: rgba(240,165,0,0.2); }
body.theme-dark .enttest-appeal-status--approved { color: #4caf50; background: rgba(76,175,80,0.1); border-color: rgba(76,175,80,0.2); }
body.theme-dark .enttest-appeal-status--rejected { color: #ef5350; background: rgba(239,83,80,0.1); border-color: rgba(239,83,80,0.2); }

/* Mobile */
@media (max-width: 600px) {
    .enttest-results-cards {
        grid-template-columns: 1fr;
    }
}

/* ── Modal mobile (375px+) ── */
@media (max-width: 768px) {
    .enttest-qmodal-overlay {
        padding: 0;
        align-items: stretch;
    }
    .enttest-qmodal {
        border-radius: 0;
        min-height: 100vh;
        max-width: 100%;
    }
    .enttest-qmodal-header {
        padding: 12px 14px;
        gap: 8px;
    }
    .enttest-qmodal-nav {
        gap: 6px;
    }
    .enttest-qmodal-prev,
    .enttest-qmodal-next {
        padding: 7px 10px;
        font-size: 12px;
    }
    .enttest-qmodal-close {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    .enttest-qmodal-body {
        padding: 16px 14px 24px;
    }
    .enttest-qmodal-meta {
        gap: 6px;
    }
    .enttest-qmodal-qnum {
        font-size: 12px;
        padding: 3px 8px;
    }
    .enttest-qmodal-subject-name {
        font-size: 11px;
        padding: 3px 8px;
    }
    .enttest-explanation-toggle {
        padding: 8px 14px;
        font-size: 13px;
    }
    .enttest-explanation-content {
        padding: 14px;
    }
    .enttest-expl-ai-content table {
        font-size: 12px;
    }
    .enttest-expl-ai-content th,
    .enttest-expl-ai-content td {
        padding: 6px 8px;
    }
    .enttest-appeal-btn {
        font-size: 12px;
        padding: 7px 12px;
    }
}

/* ── Topic child mobile ── */
@media (max-width: 600px) {
    .enttest-topic-child-bar { width: 50px; }
    .enttest-topic-child-score { display: none; }
    .enttest-topic-play { width: 24px; height: 24px; font-size: 10px; }
    .enttest-vmodal { width: 96%; max-width: 100%; }
    .enttest-vmodal-close { top: -32px; font-size: 24px; }
}

/* ═══════════════════════════════════════════════
   REVIEWS
   ═══════════════════════════════════════════════ */

.enttest-review-block {
    margin-top: 32px;
    padding: 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.enttest-review-block h3 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
}
.enttest-review-desc {
    color: #666;
    font-size: 14px;
    margin: 0 0 16px;
}

/* Stars */
.enttest-star {
    font-size: 28px;
    color: #d0d0d0;
    cursor: pointer;
    transition: color 0.15s, transform 0.15s;
    user-select: none;
}
.enttest-star:hover { transform: scale(1.15); }
.enttest-star.filled { color: #f5a623; }
#enttest-review-stars { display: flex; gap: 6px; margin-bottom: 14px; }
.enttest-review-stars-display { display: flex; gap: 4px; margin-bottom: 8px; }
.enttest-review-stars-display .enttest-star { cursor: default; font-size: 22px; }

/* Textarea */
.enttest-review-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    background: #fafafa;
    color: #333;
    box-sizing: border-box;
}
.enttest-review-textarea:focus {
    outline: none;
    border-color: #7c4dff;
    background: #fff;
}
.enttest-review-actions { margin-top: 12px; }
.enttest-review-submit {
    padding: 10px 28px;
    background: linear-gradient(135deg, #7c4dff, #651fff);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.enttest-review-submit:hover { opacity: 0.9; }
.enttest-review-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* Done state */
.enttest-review-done { text-align: center; padding: 16px 0; }
.enttest-review-thanks { color: #4caf50; font-weight: 600; margin-top: 8px; }
.enttest-review-user-comment {
    color: #555;
    font-size: 14px;
    font-style: italic;
    margin: 8px 0 0;
}

/* Reviews list */
.enttest-reviews-list { margin-top: 20px; }
.enttest-review-item {
    padding: 14px 0;
    border-top: 1px solid #f0f0f0;
}
.enttest-review-item:first-child { border-top: none; }
.enttest-review-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.enttest-review-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.enttest-review-author {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a2e;
}
.enttest-review-date {
    font-size: 12px;
    color: #999;
    margin-left: auto;
}
.enttest-review-item-stars { margin-bottom: 4px; }
.enttest-review-item-stars .enttest-star {
    font-size: 16px;
    cursor: default;
}
.enttest-review-item-text {
    font-size: 14px;
    color: #444;
    margin: 4px 0 0;
    line-height: 1.5;
}

/* Load more */
.enttest-reviews-load-more {
    margin-top: 12px;
    padding: 8px 20px;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
.enttest-reviews-load-more:hover {
    background: #f5f5f5;
}

/* ── Dark theme ── */
body.theme-dark .enttest-review-block {
    background: #1e1e2f;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
body.theme-dark .enttest-review-block h3 { color: #e0e0e0; }
body.theme-dark .enttest-review-desc { color: #aaa; }
body.theme-dark .enttest-star { color: #555; }
body.theme-dark .enttest-star.filled { color: #f5a623; }
body.theme-dark .enttest-review-textarea {
    background: #2a2a3d;
    border-color: #3a3a4d;
    color: #e0e0e0;
}
body.theme-dark .enttest-review-textarea:focus {
    border-color: #7c4dff;
    background: #2e2e42;
}
body.theme-dark .enttest-review-user-comment { color: #bbb; }
body.theme-dark .enttest-review-item { border-top-color: #2a2a3d; }
body.theme-dark .enttest-review-author { color: #e0e0e0; }
body.theme-dark .enttest-review-date { color: #777; }
body.theme-dark .enttest-review-item-text { color: #ccc; }
body.theme-dark .enttest-reviews-load-more {
    border-color: #3a3a4d;
    color: #aaa;
}
body.theme-dark .enttest-reviews-load-more:hover {
    background: #2a2a3d;
}

/* ── Dark Theme — additional gaps ── */
body.theme-dark .enttest-back-btn { color: #7b8efc; }
body.theme-dark .enttest-back-btn:hover { color: #a0b4fc; }
body.theme-dark .enttest-ai-disclaimer { color: #64748b; }
body.theme-dark .enttest-sq--correct { background: #1a4a2a; color: #5EB03D; }
body.theme-dark .enttest-sq--wrong { background: #4a1a1a; color: #e06060; }
body.theme-dark .enttest-lb-rank { color: #888; }
body.theme-dark .enttest-lb-footer a { color: #7b8efc; }
body.theme-dark .enttest-lb-footer a:hover { color: #a0b4fc; }
body.theme-dark .enttest-lb-footer { border-color: #2a2d4a; }
body.theme-dark .enttest-progress-link { color: #7b8efc; }
body.theme-dark .enttest-progress-link:hover { color: #a0b4fc; }
body.theme-dark .enttest-rating-skip { color: #7b8efc; }
body.theme-dark .enttest-rating-form p { color: #94a3b8; }
body.theme-dark .enttest-result-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
body.theme-dark .enttest-topic-toggle { color: #94a3b8; }
body.theme-dark .enttest-grades-table td:first-child { color: #94a3b8; }
body.theme-dark .enttest-results-empty-btn { background: #4f46e5; color: #fff; }
body.theme-dark .enttest-results-empty-btn:hover { background: #6366f1; color: #fff; }
body.theme-dark .enttest-appeal-form-actions .enttest-btn-primary { background: #4f46e5; color: #fff; }

/* ── Mobile ── */
@media (max-width: 600px) {
    .enttest-review-block { padding: 16px; margin-top: 20px; }
    .enttest-star { font-size: 24px; }
    .enttest-review-textarea { min-height: 60px; }
}
