* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --purple: #9333ea;
    --purple-light: #faf5ff;
    --orange: #ea580c;
    --orange-light: #fff7ed;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #2563eb;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

/* --- Layout --- */
.app-layout {
    display: flex;
    height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f8fafc;
}

.badge {
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border: none;
    background: none;
    color: var(--sidebar-text);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s;
    text-align: left;
    width: 100%;
}

.nav-item:hover { background: rgba(255,255,255,0.06); color: #e2e8f0; }
.nav-item.active { background: var(--sidebar-active); color: white; }

.sidebar-classes {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: auto;
    flex-shrink: 0;
}

.sidebar-classes h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
    padding: 0.5rem 0.85rem;
}

.sidebar-class-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.sidebar-class-item:hover { background: rgba(255,255,255,0.06); }

.sidebar-class-count {
    font-size: 0.75rem;
    background: rgba(255,255,255,0.1);
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    box-shadow: var(--shadow);
}

/* --- Views --- */
.view { display: none; max-width: 1000px; margin: 0 auto; }
.view.active { display: block; }

.view-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.view-header h2 { font-size: 1.5rem; font-weight: 700; }
.view-subtitle { color: var(--text-muted); font-size: 0.9rem; flex-basis: 100%; }
.header-actions { display: flex; gap: 0.5rem; margin-left: auto; }

/* --- Buttons --- */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: #fee2e2; }
.btn-back { background: none; color: var(--text-muted); padding: 0.5rem 0; }
.btn-back:hover { color: var(--text); }
.btn-large { padding: 0.75rem 2rem; font-size: 1rem; width: 100%; justify-content: center; margin-top: 1rem; }

/* --- Options Bar --- */
.options-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 180px;
}

.option-group.full-width { min-width: 100%; }

.option-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.option-group select,
.option-group input,
.option-group textarea {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--card);
    color: var(--text);
    font-family: inherit;
}

.option-group textarea { resize: vertical; }

/* --- Upload Area --- */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card);
}

.upload-area:hover, .upload-area.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon { color: var(--text-muted); margin-bottom: 0.75rem; }
.upload-area:hover .upload-icon { color: var(--primary); }
.upload-text { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
.upload-hint { color: var(--text-muted); font-size: 0.85rem; }

/* Multi upload */
.multi-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card);
    margin-top: 1rem;
}

.multi-upload-area:hover { border-color: var(--primary); background: var(--primary-light); }

.multi-upload-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--card);
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.page-preview-list {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.page-preview {
    position: relative;
    width: 120px;
    height: 160px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--card);
}

.page-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-preview .page-number {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.page-preview .page-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-page-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

/* --- Progress --- */
.upload-progress { margin-top: 1.5rem; text-align: center; }

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s;
    animation: progress-pulse 2s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.progress-text { color: var(--text-muted); font-size: 0.9rem; }

/* --- Result Section --- */
.result-section { margin-top: 1.5rem; }

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.result-overview {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.grade-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    border: 1px solid var(--border);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.grade-card .grade-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.grade-card .grade-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

.error-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
}

.error-stat {
    background: var(--card);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    border: 1px solid var(--border);
}

.error-stat .count {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
}

.error-stat .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.error-stat.total .count { color: var(--danger); }
.error-stat.spelling .count { color: var(--purple); }
.error-stat.grammar .count { color: var(--orange); }
.error-stat.punctuation .count { color: var(--warning); }
.error-stat.tense .count { color: #0891b2; }
.error-stat.word_choice .count { color: var(--primary); }

/* Strengths & Weaknesses */
.sw-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sw-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border);
}

.sw-card h4 {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.sw-card ul {
    list-style: none;
    padding: 0;
}

.sw-card li {
    font-size: 0.85rem;
    padding: 0.25rem 0;
    color: var(--text-muted);
}

.sw-card.strengths h4 { color: var(--success); }
.sw-card.weaknesses h4 { color: var(--danger); }

/* Collapsible images */
.result-images-collapsible {
    margin-bottom: 1rem;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card);
}
.result-images-collapsible summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
    user-select: none;
    list-style: none;
}
.result-images-collapsible summary::before {
    content: "▶ ";
    font-size: 0.7rem;
    margin-right: 0.3rem;
}
.result-images-collapsible[open] summary::before {
    content: "▼ ";
}
.result-images-collapsible[open] summary {
    border-bottom: 1px solid var(--border);
}
.result-images-collapsible .result-pages,
.result-images-collapsible .result-image-large {
    margin: 0.75rem;
}

/* Result pages */
.result-pages {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.result-page-thumb {
    width: 80px;
    height: 100px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s;
}

.result-page-thumb.active { border-color: var(--primary); }
.result-page-thumb img { width: 100%; height: 100%; object-fit: cover; }

.result-image-large {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.result-image-large img {
    max-width: 100%;
    max-height: 500px;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 0;
    background: var(--card);
    border-radius: var(--radius) var(--radius) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    overflow: hidden;
}

.tab {
    flex: 1;
    padding: 0.7rem;
    border: none;
    background: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.tab:hover { background: #f8fafc; }
.tab.active { background: var(--primary); color: white; }

.tab-content {
    display: none;
    background: var(--card);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--border);
    max-height: 500px;
    overflow-y: auto;
}

.tab-content.active { display: block; }

.text-box {
    font-size: 0.95rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

/* --- Error List --- */
.error-item {
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border-left: 3px solid;
}

.error-item.spelling { background: var(--purple-light); border-color: var(--purple); }
.error-item.grammar { background: var(--orange-light); border-color: var(--orange); }
.error-item.punctuation { background: var(--warning-light); border-color: var(--warning); }
.error-item.word_choice { background: var(--primary-light); border-color: var(--primary); }
.error-item.sentence_structure { background: var(--success-light); border-color: var(--success); }
.error-item.tense { background: #ecfeff; border-color: #0891b2; }
.error-item.article { background: #fdf4ff; border-color: #a855f7; }
.error-item.preposition { background: #fff1f2; border-color: #f43f5e; }
.error-item.capitalization { background: #f0fdf4; border-color: #22c55e; }

.error-original { text-decoration: line-through; color: var(--danger); font-weight: 500; }
.error-arrow { margin: 0 0.5rem; color: var(--text-muted); }
.error-correction { color: var(--success); font-weight: 600; }

.error-type {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: rgba(0,0,0,0.06);
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.error-explanation {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Classes Grid --- */
.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.class-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
}

.class-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }

.class-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.class-card h3 { font-size: 1.1rem; }

.class-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.class-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* --- Students List --- */
.students-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card);
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
}

.student-item:hover { border-color: var(--primary); }

.student-name { font-weight: 500; font-size: 0.95rem; }

.student-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.student-meta .papers-count {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

/* --- Student Stats --- */
.student-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border);
    text-align: center;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* --- History --- */
.history-filters {
    margin-bottom: 1rem;
}

.history-filters select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--card);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 3rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card);
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
}

.history-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }

.history-item-info { display: flex; flex-direction: column; gap: 0.15rem; }

.history-item-title { font-weight: 500; font-size: 0.95rem; }
.history-item-meta { font-size: 0.8rem; color: var(--text-muted); }

.history-item-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.history-grade {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.history-errors {
    color: var(--danger);
    font-size: 0.85rem;
}

.task-type-badge {
    font-size: 0.7rem;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 500;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal {
    background: var(--card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 1.1rem; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0.25rem;
}

.modal-body { padding: 1.25rem; }

.modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-body .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.modal-body input[type="text"],
.modal-body textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
}

.modal-body .btn {
    margin-top: 0.5rem;
}

/* --- Feedback box --- */
.feedback-box {
    background: var(--primary-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid #bfdbfe;
    margin-bottom: 1rem;
}

.feedback-box p {
    font-size: 0.95rem;
    line-height: 1.7;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s;
    }
    .sidebar.open { left: 0; }
    .menu-toggle { display: block; }
    .main-content { padding: 1rem; padding-top: 3.5rem; }
    .result-overview { grid-template-columns: 1fr; }
    .error-stats { grid-template-columns: repeat(3, 1fr); }
    .sw-grid { grid-template-columns: 1fr; }
    .options-bar { flex-direction: column; }
    .option-group { min-width: 100%; }
    .view-header { flex-direction: column; align-items: flex-start; }
    .header-actions { margin-left: 0; }
}

@media (max-width: 480px) {
    .error-stats { grid-template-columns: repeat(2, 1fr); }
    .classes-grid { grid-template-columns: 1fr; }
}

/* --- Task-by-Task Analysis --- */
.tasks-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-block {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.task-block.collapsed .task-body {
    display: none;
}

.task-block.collapsed .task-toggle {
    transform: rotate(-90deg);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    user-select: none;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.task-header:hover {
    background: #f1f5f9;
}

.task-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.task-number {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
    white-space: nowrap;
}

.task-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.task-error-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--danger);
    background: var(--danger-light);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.task-error-count.no-errors {
    color: var(--success);
    background: var(--success-light);
}

.task-toggle {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.task-body {
    padding: 1rem 1.25rem;
}

.task-instruction {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
    padding: 0.75rem 1rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.task-instruction strong {
    color: var(--text);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.subtask-block {
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
}

.subtask-block.subtask-correct {
    border-left: 3px solid var(--success);
    background: var(--success-light);
}

.subtask-block.subtask-incorrect {
    border-left: 3px solid var(--danger);
    background: var(--danger-light);
}

.subtask-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 0.35rem;
}

.subtask-question {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px dashed var(--border);
}

.subtask-answer-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.subtask-student,
.subtask-corrected {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    font-size: 0.9rem;
}

.subtask-answer-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 65px;
}

.subtask-student .subtask-answer-text {
    color: var(--text);
}

.subtask-incorrect .subtask-student .subtask-answer-text {
    text-decoration: line-through;
    color: var(--danger);
}

.subtask-corrected .subtask-answer-text {
    color: var(--success);
    font-weight: 500;
}

.subtask-errors {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
}

.subtask-errors .error-item {
    margin-bottom: 0.35rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.85rem;
}

.task-feedback {
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: var(--primary-light);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .task-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }
    .task-title {
        white-space: normal;
    }
    .subtask-student,
    .subtask-corrected {
        flex-direction: column;
        gap: 0.15rem;
    }
    .subtask-answer-label {
        min-width: auto;
    }
}
