/* teacher/tests */

.tst-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 0.75rem 0.875rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.tst-card:hover {
    border-color: #a5b4fc;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
}

.tst-card-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.tst-card-icon.is-academic { background: #eef2ff; color: #4f46e5; }
.tst-card-icon.is-inventory { background: #f3e8ff; color: #7c3aed; }

.tst-builder-steps {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.tst-builder-step {
    font-size: 0.625rem;
    font-weight: 800;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
}

.tst-builder-step.is-active {
    background: #eef2ff;
    color: #4338ca;
}

.tst-paste-area {
    width: 100%;
    min-height: 10rem;
    font-family: ui-monospace, monospace;
    font-size: 0.6875rem;
    line-height: 1.45;
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
    resize: vertical;
}

.tst-step2-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .tst-step2-grid {
        grid-template-columns: 1.15fr 0.85fr;
        align-items: start;
    }
}

.tst-step2-col {
    min-width: 0;
}

.tst-preview-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 26rem;
    overflow-y: auto;
}

.tst-preview-item {
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    padding: 0.75rem;
    background: #fff;
}

.tst-preview-q-body {
    margin-bottom: 0.55rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.625rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.tst-preview-q-label {
    font-size: 0.5625rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6366f1;
    margin-bottom: 0.3rem;
}

.tst-preview-q-text {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.tst-preview-q-missing {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #d97706;
    font-style: italic;
}

.tst-preview-opts-label {
    font-size: 0.5625rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.tst-preview-q-options {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.tst-preview-q-options.is-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
}
@media (max-width: 700px) {
    .tst-preview-q-options.is-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tst-preview-q-options li {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.6875rem;
    color: #475569;
    padding: 0.3rem 0.45rem;
    border-radius: 0.5rem;
    background: #f8fafc;
}

.tst-preview-q-options li.is-answer {
    background: #ecfdf5;
    color: #047857;
    font-weight: 700;
}

.tst-preview-opt-letter {
    flex-shrink: 0;
    font-weight: 900;
    color: #64748b;
}

.tst-preview-q-options li.is-answer .tst-preview-opt-letter {
    color: #059669;
}

.tst-preview-opt-text {
    min-width: 0;
}
.tst-cheat-box {
    margin: 0.65rem 0;
    padding: 0.7rem 0.85rem;
    border-radius: 0.85rem;
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #7f1d1d;
    font-size: 0.72rem;
}
.tst-cheat-box p { font-weight: 800; margin: 0 0 0.3rem; }
.tst-cheat-box ul { margin: 0; padding-left: 1.1rem; }
    flex: 1;
    line-height: 1.35;
    word-break: break-word;
}

.tst-optik-panel {
    border: 1px solid #c7d2fe;
    border-radius: 0.875rem;
    background: #f8fafc;
    padding: 0.65rem;
    max-height: 26rem;
    overflow-y: auto;
}

.tst-optik-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 0.35rem;
}

.tst-optik-meta {
    font-size: 0.5625rem;
    font-weight: 700;
    color: #64748b;
}

.tst-optik-hint {
    font-size: 0.5625rem;
    color: #64748b;
    margin: 0 0 0.5rem;
    line-height: 1.4;
}

.tst-optik-form {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.tst-optik-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0;
}

.tst-optik-no {
    width: 1.25rem;
    flex-shrink: 0;
    font-size: 0.625rem;
    font-weight: 900;
    color: #475569;
    text-align: right;
}

.tst-optik-bubbles {
    display: flex;
    gap: 0.2rem;
    flex: 1;
}

.tst-optik-bubble {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    border: 2px solid #cbd5e1;
    background: #fff;
    font-size: 0.5625rem;
    font-weight: 900;
    color: #64748b;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
    padding: 0;
    line-height: 1;
}

.tst-optik-bubble:hover {
    border-color: #818cf8;
    color: #4338ca;
}

.tst-optik-bubble.is-picked {
    border-color: #059669;
    background: #059669;
    color: #fff;
}

.tst-optik-src {
    width: 2.25rem;
    flex-shrink: 0;
    font-size: 0.5rem;
    font-weight: 700;
    color: #94a3b8;
    text-align: right;
}

.tst-optik-quick {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px dashed #cbd5e1;
}

.tst-optik-quick-row {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.tst-optik-bulk-input {
    flex: 1;
    font-family: ui-monospace, monospace;
    font-size: 0.6875rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.35rem 0.5rem;
    background: #fff;
    text-transform: uppercase;
}

.tst-optik-bulk-btn {
    font-size: 0.5625rem;
    font-weight: 800;
    padding: 0.35rem 0.65rem;
    border-radius: 0.5rem;
    background: #334155;
    color: #fff;
    border: none;
    cursor: pointer;
}

.tst-optik-empty {
    font-size: 0.6875rem;
    color: #94a3b8;
    font-style: italic;
    margin: 0;
}

.tst-paper-preview {
    border: 2px solid #cbd5e1;
    border-radius: 0.75rem;
    padding: 1rem;
    background: #fff;
    font-size: 0.6875rem;
    color: #334155;
    line-height: 1.5;
}

.tst-paper-preview h4 {
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 900;
    margin: 0 0 0.5rem;
}

.tst-paper-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #cbd5e1;
}

.tst-result-row:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 2px;
}

.tst-review-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.tst-review-summary-label {
    font-size: 0.5625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin: 0 0 0.15rem;
}

.tst-review-summary-value {
    font-size: 0.75rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.tst-review-summary-score {
    font-size: 0.875rem;
    font-weight: 900;
    margin: 0;
}

.tst-review-summary-score.is-good { color: #059669; }
.tst-review-summary-score.is-low { color: #e11d48; }

.tst-review-submitted {
    font-size: 0.5625rem;
    color: #94a3b8;
    margin: 0.35rem 0 0;
}

.tst-review-q {
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    padding: 0.65rem 0.75rem;
    background: #fff;
}

.tst-review-q.is-correct { border-color: #a7f3d0; background: #f0fdf4; }
.tst-review-q.is-wrong { border-color: #fecaca; background: #fff1f2; }
.tst-review-q.is-blank { border-color: #fde68a; background: #fffbeb; }

.tst-review-q-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.tst-review-q-no {
    font-size: 0.5625rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6366f1;
}

.tst-review-q-badge {
    font-size: 0.5625rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.tst-review-q.is-correct .tst-review-q-badge { color: #059669; }
.tst-review-q.is-wrong .tst-review-q-badge { color: #e11d48; }
.tst-review-q.is-blank .tst-review-q-badge { color: #d97706; }

.tst-review-q-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.45;
    margin: 0 0 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.tst-review-answers {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
}

@media (min-width: 480px) {
    .tst-review-answers {
        grid-template-columns: 1fr 1fr;
    }
}

.tst-review-answer {
    border-radius: 0.625rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    min-width: 0;
}

.tst-review-answer.is-key {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.tst-review-answer.is-student.is-correct {
    border-color: #6ee7b7;
    background: #d1fae5;
}

.tst-review-answer.is-student.is-wrong {
    border-color: #fca5a5;
    background: #fee2e2;
}

.tst-review-answer.is-student.is-blank {
    border-color: #fcd34d;
    background: #fef3c7;
}

.tst-review-answer-label {
    display: block;
    font-size: 0.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.tst-review-answer-value {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #334155;
    line-height: 1.35;
    word-break: break-word;
}
