/* Quant Sprint — minimal, mobile-first, anti-procrastination styling */

.qs-container {
    max-width: 760px;
    margin: 60px auto 80px;
    padding: 0 20px;
    font-family: 'Inter', system-ui, sans-serif;
    color: #1F2933;
}

.qs-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 24px;
}

.qs-header h1 { margin: 0 0 4px; font-size: 1.85em; }
/* WCAG fix: #6B7280 on #F2F2F2 bg = 4.32:1, fails 4.5. Use #4B5563 = 5.76:1. */
.qs-subtitle { margin: 0; color: #4B5563; font-size: 0.95em; }

.qs-timer:empty { display: none; }
.qs-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 1.6em;
    color: #2563EB;
    padding: 6px 14px;
    background: #EFF6FF;
    border-radius: 10px;
    min-width: 90px;
    text-align: center;
}

.qs-timer.warning { color: #B91C1C; background: #FEE2E2; }

.qs-tutorial-link {
    color: #2563EB;
    text-decoration: none;
    font-weight: 600;
}
.qs-tutorial-link:hover { text-decoration: underline; }

.qs-panel {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.qs-panel.hidden { display: none; }

.qs-instructions ul {
    margin: 8px 0 16px;
    padding-left: 20px;
    color: #374151;
}

.qs-instructions li { margin: 4px 0; }

.qs-mode-toggle {
    margin: 16px 0;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.qs-mode-toggle label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #374151;
}

/* Radio-card group — Batch 7 of AI-review punch-list. Replaces flat radios+checkbox
   with three card rows that make the "compete vs competition" distinction obvious. */
.qs-mode-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0 18px;
}
.qs-mode-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    cursor: pointer;
    background: #FFFFFF;
    transition: border-color 0.12s, background 0.12s;
}
.qs-mode-card:hover {
    border-color: #93C5FD;
    background: #F8FAFC;
}
.qs-mode-card input { margin-top: 3px; flex-shrink: 0; }
.qs-mode-card:has(input:checked) {
    border-color: #2563EB;
    background: #EFF6FF;
}
.qs-mode-card-body { display: flex; flex-direction: column; gap: 2px; }
.qs-mode-card-title { font-weight: 700; color: #111827; font-size: 1em; }
.qs-mode-card-desc { color: #4B5563; font-size: 0.86em; line-height: 1.4; }

/* Promoted Start button — Batch 7 of AI-review punch-list, 4-star "tiny default-styled
   button no padding no color no weight; looks like a placeholder". */
.qs-start-btn.primary {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: #2563EB;
    color: #FFFFFF;
    border: 0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1.05em;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.12s, transform 0.05s;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}
.qs-start-btn.primary:hover { background: #1D4ED8; transform: translateY(-1px); }
.qs-start-btn.primary:active { transform: translateY(0); }
.qs-load-error {
    margin-top: 12px;
    color: #B91C1C;
    font-size: 0.88em;
    text-align: center;
}

@media (prefers-color-scheme: dark) {
    .qs-panel {
        background: #1e293b !important;
        border-color: #334155 !important;
        color: #f1f5f9;
    }
    .qs-instructions ul { color: #cbd5e1; }
    .qs-mode-card {
        background: #0f172a;
        border-color: #334155;
    }
    .qs-mode-card:hover {
        background: #1e293b;
        border-color: #475569;
    }
    .qs-mode-card:has(input:checked) {
        background: #1e3a8a;
        border-color: #60a5fa;
    }
    .qs-mode-card-title { color: #F1F5F9; }
    .qs-mode-card-desc { color: #cbd5e1; }
}

.qs-hud {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #F3F4F6;
    margin-bottom: 16px;
    font-size: 0.95em;
    color: #4B5563;
    flex-wrap: wrap;
}

.qs-hud strong { color: #1F2933; margin-right: 4px; }

.qs-meta {
    display: flex;
    gap: 10px;
    font-size: 0.8em;
    color: #6B7280;
    margin-bottom: 12px;
}

.qs-difficulty {
    background: #F3F4F6;
    padding: 3px 10px;
    border-radius: 12px;
}

.qs-tags { font-style: italic; }

.qs-prompt {
    font-size: 1.15em;
    line-height: 1.55;
    margin: 12px 0 18px;
    color: #1F2933;
}

.qs-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.qs-option-button {
    text-align: left;
    padding: 14px 18px;
    border: 2px solid #E5E7EB;
    background: #F9FAFB;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-size: 1em;
    color: #1F2933;
    transition: border-color 0.12s, background 0.12s;
}

.qs-option-button:hover:not(:disabled) {
    border-color: #2563EB;
    background: #EFF6FF;
}

.qs-option-button:disabled { cursor: default; opacity: 0.95; }

.qs-option-button.correct {
    border-color: #16A34A;
    background: #DCFCE7;
    color: #14532D;
    font-weight: 600;
}

.qs-option-button.incorrect {
    border-color: #DC2626;
    background: #FEE2E2;
    color: #7F1D1D;
}

.qs-feedback {
    min-height: 24px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.95em;
    line-height: 1.5;
    color: #374151;
    background: #F9FAFB;
    margin-bottom: 14px;
    display: none;
}

.qs-feedback.show { display: block; }
.qs-feedback.correct { background: #ECFDF5; color: #065F46; }
.qs-feedback.incorrect { background: #FEF2F2; color: #7F1D1D; }

.qs-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.qs-actions .primary,
.qs-actions .secondary,
.qs-actions .qs-link {
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.95em;
}

.qs-actions .primary { background: #2563EB; color: #fff; }
.qs-actions .primary:hover { background: #1D4ED8; }
.qs-actions .secondary { background: #F3F4F6; color: #1F2933; }
.qs-actions .secondary:hover { background: #E5E7EB; }
.qs-actions .qs-link { color: #2563EB; }

.qs-actions .hidden { display: none; }

.qs-score-line { font-size: 2em; font-weight: 700; color: #2563EB; margin: 8px 0 6px; }

.qs-pb-badge {
    display: inline-block;
    background: #FEF3C7;
    color: #92400E;
    padding: 6px 14px;
    border-radius: 12px;
    font-weight: 600;
    margin: 4px 0 12px;
}

.qs-pb-badge.hidden { display: none; }

.qs-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin: 16px 0 24px;
}

.qs-result-grid > div {
    background: #F9FAFB;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.95em;
    color: #4B5563;
}

.qs-result-grid > div span { font-size: 1.3em; font-weight: 700; color: #1F2933; }

.qs-method-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 0.92em;
}

.qs-method-table th, .qs-method-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #F3F4F6;
}

.qs-method-table th { color: #6B7280; font-weight: 600; }

.qs-review {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 6px;
}

.qs-review-item {
    border-left: 4px solid #E5E7EB;
    padding: 10px 14px;
    background: #F9FAFB;
    border-radius: 6px;
    font-size: 0.92em;
    line-height: 1.45;
}

.qs-review-item.correct { border-left-color: #16A34A; }
.qs-review-item.incorrect { border-left-color: #DC2626; }

.qs-review-prompt { color: #1F2933; margin-bottom: 4px; }
.qs-review-meta { color: #6B7280; font-size: 0.9em; margin-bottom: 4px; }
.qs-review-notes { color: #4B5563; font-style: italic; margin-top: 4px; }

.qs-hints { margin: 12px 0 0; }
.qs-hints.hidden { display: none; }
.qs-hint-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.qs-hint-btn {
    padding: 6px 12px;
    border: 1px solid #D1D5DB;
    background: #fff;
    color: #4B5563;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}
.qs-hint-btn:hover:not(:disabled) { background: #F3F4F6; border-color: #9CA3AF; }
.qs-hint-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.qs-hint-btn.used { background: #EEF2FF; border-color: #6366F1; color: #4338CA; }
.qs-hint-text { margin-top: 8px; }
.qs-hint-line {
    background: #F9FAFB;
    border-left: 3px solid #6366F1;
    padding: 8px 12px;
    margin-top: 6px;
    font-size: 0.92em;
    line-height: 1.45;
    color: #1F2933;
    border-radius: 0 6px 6px 0;
}

@media (max-width: 480px) {
    .qs-container { margin-top: 36px; padding: 0 14px; }
    .qs-header { flex-wrap: wrap; }
    .qs-prompt { font-size: 1.05em; }
    .qs-option-button { padding: 12px 14px; font-size: 0.95em; }
}
