/* ===== Self-hosted Inter font (eliminates Google Fonts external dependency) ===== */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/static/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===== AI Disclaimer Banner ===== */
.ai-disclaimer {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 160, 160, 0.3);
    border-radius: 8px;
    padding: 6px 18px;
    font-size: 13px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 500;
    color: rgba(255, 220, 220, 0.9);
    white-space: nowrap;
    line-height: 1;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    letter-spacing: -0.1px;
}

/* ===== Reset & Variables ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #f5f3fa;
    --bg-card: #ffffff;
    --bg-hover: #f0edf7;
    --bg-inset: #ede9f5;
    --border: #d8d0e8;
    --border-light: #e8e2f2;
    --border-focus: rgba(124, 58, 237, 0.35);
    --text: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-light: #f3e8ff;
    --success: #059669;
    --success-light: #ecfdf5;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --danger: #dc2626;
    --danger-light: #fef2f2;

    /* Gradient (navbar, hero elements) — vibrant blue-to-purple matching Bootcamp slide headers */
    --gradient-start: #3040c8;
    --gradient-mid: #4e34d0;
    --gradient-end: #6d28d9;
    --gradient: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));

    /* Subject colors */
    --subject-bio: #3b82f6;
    --subject-bio-light: #eff6ff;
    --subject-genchem: #10b981;
    --subject-genchem-light: #ecfdf5;
    --subject-ochem: #f59e0b;
    --subject-ochem-light: #fffbeb;
    --subject-pa: #8b5cf6;
    --subject-pa-light: #f5f3ff;
    --subject-rc: #ec4899;
    --subject-rc-light: #fdf2f8;
    --subject-qr: #6366f1;
    --subject-qr-light: #eef2ff;

    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px -1px rgba(0,0,0,0.03);
    --shadow: 0 2px 6px -1px rgba(0,0,0,0.06), 0 1px 4px -2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px -2px rgba(0,0,0,0.08), 0 2px 6px -2px rgba(0,0,0,0.04);
    --transition: 0.18s cubic-bezier(0.25, 0.1, 0.25, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
html { scroll-behavior: smooth; }

/* ===== Navbar ===== */
.navbar {
    background: var(--gradient);
    border-bottom: none;
    box-shadow: 0 2px 8px rgba(48, 64, 200, 0.35);
    padding: 0 32px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-brand a {
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.navbar-logo { flex-shrink: 0; }
.navbar-links { display: flex; gap: 2px; align-items: center; }
.navbar-links > a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all var(--transition);
}
.navbar-links > a:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.nav-user {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    font-weight: 500;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    margin-left: 4px;
}
.nav-logout {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 12px !important;
}

/* ===== Super Admin Dropdown ===== */
.admin-dropdown { position: relative; }
.navbar .admin-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.navbar .admin-dropdown-btn:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}
.navbar .admin-dropdown.open .admin-dropdown-btn {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}
.admin-chevron {
    transition: transform 0.2s ease;
}
.admin-dropdown.open .admin-chevron {
    transform: rotate(180deg);
}
.admin-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 4px;
    z-index: 200;
}
.admin-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px !important;
    color: var(--text) !important;
    font-size: 13px !important;
    font-weight: 500;
    border-radius: 5px;
    text-decoration: none;
    transition: background var(--transition);
}
.admin-dropdown-menu a:hover {
    background: var(--bg-hover) !important;
    color: var(--primary) !important;
}
.admin-dropdown-menu a svg {
    color: var(--text-muted);
    flex-shrink: 0;
}
.admin-dropdown-menu a:hover svg {
    color: var(--primary);
}

/* ===== Notification Bell (Basecamp-style) ===== */
.notif-wrapper { position: relative; }
.notif-bell {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.85);
    position: relative;
    transition: all var(--transition);
}
.notif-bell:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.notif-badge {
    position: absolute;
    top: 2px;
    right: 0;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
.notif-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 24px -4px rgba(0,0,0,0.1), 0 4px 8px -2px rgba(0,0,0,0.04);
    width: 380px;
    z-index: 200;
    margin-top: 4px;
}
.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
}
.notif-dropdown-header strong { font-size: 14px; }
.notif-mark-all {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-scroll { max-height: 420px; overflow-y: auto; }
.notif-section { border-bottom: 1px solid var(--border-light); }
.notif-section:last-child { border-bottom: none; }
.notif-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 10px 16px 4px;
}
.notif-section-pinned-label { color: var(--warning); }
.notif-section-previous-label { color: var(--text-muted); }
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition);
}
.notif-item:hover { background: var(--bg-hover); }
.notif-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    flex-shrink: 0;
    margin-top: 5px;
}
.notif-pin-icon {
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 2px;
}
.notif-content { flex: 1; min-width: 0; }
.notif-message { line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.notif-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--transition);
}
.notif-item:hover .notif-actions { opacity: 1; }
.notif-action-btn {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.notif-action-btn:hover { background: var(--bg-inset); color: var(--text); }
.notif-dismiss:hover { color: var(--danger); }
.notif-item-previous { opacity: 0.7; }
.notif-item-previous:hover { opacity: 1; }
.notif-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== Container ===== */
.container {
    max-width: 1520px;
    margin: 0 auto;
    padding: 24px 32px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { background: var(--bg-hover); box-shadow: var(--shadow-sm); }
.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover { background: #047857; }
.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover { background: #b91c1c; }
.btn-warn {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}
.btn-warn:hover { background: #fde68a; }
.btn-danger-soft {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}
.btn-danger-soft:hover { background: #fecaca; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; }
.btn-create {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
    font-weight: 600;
    padding: 8px 20px;
}
.btn-create:hover { background: #15803d; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    font-family: inherit;
    transition: border-color var(--transition);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== Alerts ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
}
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #a7f3d0; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fde68a; }

/* ===== Login ===== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-md);
}
.login-card h1 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 12px;
}
.login-divider hr { flex: 1; border: none; border-top: 1px solid #ddd; }
.login-divider span { color: #888; font-size: 13px; }

/* ===== Dashboard ===== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}
.dashboard-header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.6px;
}
.dashboard-actions { display: flex; gap: 10px; }

/* Action Buttons (Anthony-style) */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}
.btn-action-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.btn-action-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.btn-action-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.btn-action-secondary:hover {
    background: var(--bg-hover);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* Stats Cards (left-border accent like Anthony's) */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stat-card.stat-blue { border-left: 3px solid var(--primary); }
.stat-card.stat-yellow { border-left: 3px solid var(--warning); }
.stat-card.stat-green { border-left: 3px solid var(--success); }
.stat-number {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.stat-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Filter Bar (Anthony-style dropdown filters) */
.filter-bar {
    margin-bottom: 16px;
}
.filter-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.filter-group { position: relative; }
.filter-group .form-select {
    padding: 7px 32px 7px 10px;
    font-size: 13px;
    min-width: 130px;
    border-radius: 6px;
}
.filter-search {
    position: relative;
    flex: 1;
    min-width: 160px;
    max-width: 280px;
}
.filter-search .form-input {
    padding: 7px 10px 7px 32px;
    font-size: 13px;
    border-radius: 6px;
}
.filter-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Question Cards (3-column grid like Anthony's) */
.question-cards { display: flex; flex-direction: column; gap: 8px; }
.question-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 24px;
    align-items: center;
    padding: 18px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
}
.question-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--border);
    transform: translateY(-1px);
}

/* Card main content */
.qcard-main { min-width: 0; }
.qcard-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.qcard-exam-tag {
    display: inline-flex;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.qcard-topic {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.qcard-subtopic {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Step Progress Dots */
.qcard-progress {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}
.qcard-step {
    display: flex;
    align-items: center;
}
.qcard-step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    border: 2px solid var(--border);
    color: var(--text-muted);
    background: var(--bg-card);
    flex-shrink: 0;
    transition: all var(--transition);
}
.step-done .qcard-step-dot {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.step-current .qcard-step-dot {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
.qcard-step-line {
    width: 12px;
    height: 2px;
    background: var(--border);
    transition: background var(--transition);
}
.qcard-step-line.line-done { background: var(--success); }

/* Spinner for generating steps */
.spinner-xs {
    width: 10px;
    height: 10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Card score & meta */
.qcard-right {
    text-align: right;
    flex-shrink: 0;
    min-width: 60px;
}
.qcard-score {
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}
.qcard-score.score-good { color: var(--success); }
.qcard-score.score-ok { color: var(--warning); }
.qcard-score.score-low { color: var(--danger); }
.qcard-score-empty { color: var(--border); }
.qcard-score-max { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.qcard-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    margin-top: 4px;
}
.qcard-author { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.qcard-time { font-size: 11px; color: var(--text-muted); }

/* Badges (Anthony-style) */
.badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.badge-gray { background: #f3f4f6; color: #6b7280; }
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-green { background: #d1fae5; color: #065f46; }

/* Empty State Card */
.empty-state-card {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: 16px;
}
.empty-state-icon { color: var(--text-muted); margin-bottom: 16px; }
.empty-state-card h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state-card p { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

/* Form section title */
.form-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

/* Status badge (used in detail page) */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.status-gray { background: #f3f4f6; color: #6b7280; }
.status-blue { background: var(--primary-light); color: var(--primary); }
.status-yellow { background: #fef3c7; color: #92400e; }
.status-green { background: #d1fae5; color: #065f46; }

/* ===== Question Detail ===== */
.detail-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}

/* Sidebar */
.detail-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 76px;
}
.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.3;
}
.sidebar-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.sidebar-meta { margin-bottom: 20px; }
.sidebar-meta-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}
.sidebar-meta-row:last-child { border-bottom: none; }
.sidebar-meta-label { color: var(--text-muted); font-weight: 500; }
.sidebar-meta-value { color: var(--text); font-weight: 500; }

/* Workflow Stepper */
.stepper { margin-top: 20px; border-top: 1px solid var(--border-light); padding-top: 16px; }
.stepper-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-muted);
}
.stepper-item.active { color: var(--primary); font-weight: 600; }
.stepper-item.completed { color: var(--success); }
.stepper-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.stepper-item.completed .stepper-icon {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.stepper-item.active .stepper-icon {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Stepper label & comment badge */
.stepper-label { flex: 1; }
.stepper-comment-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 7px;
    border-radius: 10px;
    text-decoration: none;
    transition: background var(--transition);
}
.stepper-comment-badge:hover { background: var(--primary-light); }

/* Clickable stepper items */
.stepper-clickable {
    cursor: pointer;
    border-radius: 6px;
    padding: 8px 6px;
    margin: 0 -6px;
    transition: background var(--transition);
}
.stepper-clickable:hover {
    background: var(--bg-hover);
}

/* Phase comment group highlight animation */
.phase-highlight {
    animation: phase-flash 2s ease;
}
@keyframes phase-flash {
    0% { background-color: var(--primary-light); }
    100% { background-color: transparent; }
}
.stepper-comment-badge svg { opacity: 0.7; }

/* Quality Score */
.quality-score {
    margin-top: 20px;
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
    text-align: center;
}
.quality-score-label { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; }
.quality-score-value { font-size: 36px; font-weight: 800; color: var(--success); }
.quality-score-max { font-size: 16px; color: var(--text-muted); font-weight: 500; }

/* Main content */
.detail-main { min-width: 0; }

/* Phase sections */
.phase-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.phase-section.generating-phase {
    background: var(--primary-light);
    border-color: #c4b5fd;
    animation: pulse-bg 2s ease-in-out infinite;
}
@keyframes pulse-bg {
    0%, 100% { background: var(--primary-light); }
    50% { background: #ede9fe; }
}
.phase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.phase-title { font-size: 16px; font-weight: 700; }
.phase-status {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 12px;
    line-height: 1;
}
.phase-status.approved { color: var(--success); background: var(--success-light); }
.phase-status.awaiting { color: var(--warning); background: var(--warning-light); }
.phase-status.generating { color: var(--primary); background: var(--primary-light); }

/* Question content display */
.question-stem {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 20px;
    white-space: pre-wrap;
}
.answer-choices { list-style: none; margin-bottom: 20px; }
.answer-choice {
    padding: 10px 14px;
    margin-bottom: 6px;
    border-radius: var(--radius);
    font-size: 16px;
    border: 1px solid var(--border-light);
}
.answer-choice.correct {
    background: var(--success-light);
    border-color: #a7f3d0;
    font-weight: 600;
}
.answer-choice .choice-letter {
    font-weight: 700;
    margin-right: 8px;
}
.answer-choice img {
    max-width: 200px;
    height: auto;
    vertical-align: middle;
}

/* Explanation display (HTML output from Claude) */
.explanation-content {
    font-size: 16px;
    line-height: 1.7;
}
.explanation-content p { margin-bottom: 0.5em; margin-top: 0; }
.explanation-content:not([contenteditable]) p:has(br:only-child) { margin-bottom: 0.3em; line-height: 0.5; }
.explanation-content ul, .explanation-content ol { padding-left: 20px; margin-bottom: 0.6em; }
.explanation-content li { margin-bottom: 0.3em; line-height: 1.5; }
.explanation-content ul ul, .explanation-content ol ol,
.explanation-content ul ol, .explanation-content ol ul { margin-bottom: 0.2em; padding-left: 22px; }
.explanation-content ul { list-style-type: disc; }
.explanation-content ul ul { list-style-type: circle; }
.explanation-content ul ul ul { list-style-type: square; }
.explanation-content strong { font-weight: 700; }
.explanation-content em { font-style: italic; }
.explanation-content sub { font-size: 0.8em; }
.explanation-content sup { font-size: 0.8em; }
.explanation-content img { max-width: min(500px, 100%) !important; width: auto !important; height: auto !important; border-radius: 4px; margin: 8px 0; display: block; }

/* Rich text editor */
.rich-editor-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.rich-editor-wrap:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
}
.rich-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    background: var(--bg-inset);
    border-bottom: 1px solid var(--border);
}
.toolbar-group {
    display: flex;
    gap: 1px;
}
.toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 6px;
    flex-shrink: 0;
}
.rich-editor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
}
.rich-editor-btn:hover {
    background: rgba(124, 58, 237, 0.08);
    color: var(--primary);
}
.rich-editor-btn:active {
    background: rgba(124, 58, 237, 0.14);
}
.rich-editor-btn sub, .rich-editor-btn sup {
    font-size: 9px;
}
.rich-editor-btn svg {
    flex-shrink: 0;
}
.rich-editor-content[contenteditable] {
    padding: 14px 16px;
    min-height: 500px;
    max-height: 80vh;
    overflow-y: auto;
    outline: none;
    background: var(--bg-card);
}
.rich-editor-content[contenteditable] p {
    margin: 0 0 0.8em 0;
}
.rich-editor-content[contenteditable] p:last-child {
    margin-bottom: 0;
}
.rich-editor-footer {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 6px 16px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-inset);
    font-size: 11px;
    color: var(--text-muted);
    user-select: none;
}
.rich-editor-footer .footer-sep {
    margin: 0 8px;
    color: var(--border);
}

/* Eval scores grid */
.eval-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 20px 0;
}
.eval-card {
    background: var(--bg-inset);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}
.eval-card-score {
    font-size: 28px;
    font-weight: 800;
    color: var(--success);
}
.eval-card-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 4px;
}
.eval-summary-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: var(--success);
    margin: 0 auto 8px;
}
.eval-summary-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--success);
    text-align: center;
}

/* Actions */
.phase-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

/* Review action list (numbered text items) */
.review-action-list {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
}
.review-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-primary);
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    text-align: left;
}
.review-action-item:hover .review-action-label {
    text-decoration: underline;
}
.review-action-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-secondary, #f0f0f0);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.review-action-label {
    font-weight: 500;
}
.review-action-btn {
    cursor: pointer;
}

/* CD Review actions (Explanation Draft stage) */
.cd-review-guidance {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
    margin-bottom: 8px;
    line-height: 1.5;
}
.cd-review-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cd-review-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
}
.cd-review-submit-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.4;
}

/* Feedback form */
.feedback-form { margin-top: 16px; }
.feedback-toggle {
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.feedback-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    margin-top: 8px;
}

/* Comments section */
.comments-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.comments-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}
.comment-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}
.comment-item:last-child { border-bottom: none; }
.comment-header {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.comment-header .avatar-sm { margin-right: -2px; }
.comment-author { font-size: 13px; font-weight: 600; }
.comment-time { font-size: 11px; color: var(--text-muted); }
.comment-phase { font-size: 11px; color: var(--primary); background: var(--primary-light); padding: 2px 8px; border-radius: 10px; }
.comment-body { font-size: 13px; line-height: 1.5; color: var(--text-secondary); white-space: pre-wrap; }
.comment-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-light); }

/* @mention autocomplete */
.mention-wrapper { position: relative; }
.mention-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 100;
    margin-bottom: 4px;
}
.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
}
.mention-item:hover, .mention-item-active {
    background: var(--primary-light);
}
.mention-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.mention-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-inset);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}
.mention-info { display: flex; flex-direction: column; }
.mention-name { font-size: 13px; font-weight: 600; color: var(--text); }
.mention-email { font-size: 11px; color: var(--text-muted); }

/* Phase-grouped comments */
.phase-comment-group {
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
}
.phase-comment-group:last-of-type { margin-bottom: 0; }
.phase-comment-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--bg-inset);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}
.phase-comment-header svg { opacity: 0.5; }
.phase-comment-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 1px 7px;
    border-radius: 10px;
}
.phase-comment-group .comment-item {
    padding: 12px 14px;
}

/* Generating animation */
.generating-banner {
    background: var(--primary-light);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 16px 20px;
    text-align: center;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}
.generating-dots::after {
    content: '';
    animation: dots 1.5s steps(4) infinite;
}
@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* Empty state (legacy) */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 16px; }

/* Complete banner */
.error-banner {
    background: var(--danger-light);
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--danger);
    font-size: 13px;
    line-height: 1.5;
}

.complete-banner {
    background: var(--success-light);
    border: 1px solid #a7f3d0;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    color: var(--success);
    font-weight: 600;
    font-size: 15px;
}

/* Inline editing */
.edit-choice-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.choice-letter-label {
    font-weight: 700;
    font-size: 14px;
    min-width: 20px;
}
.edit-choice-input { flex: 1; }
.edit-correct-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
}

/* Revision history */
.revision-history {
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
}
.revision-history-title {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-inset);
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.revision-history-title:hover { background: var(--bg-hover); }
.history-entry {
    padding: 10px 14px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
    line-height: 1.5;
}
.history-reviewer { background: #fffbeb; }
.history-ai { background: #eff6ff; }
.history-role {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.history-content { color: var(--text-secondary); white-space: pre-wrap; }

/* Phase completion badges */
.phase-badge-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.phase-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}
.phase-badge.approved {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid #a7f3d0;
}

/* ===== Workshop & Duplicate Check ===== */
.workshop-idea {
    background: var(--bg-inset);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}
.workshop-idea-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.workshop-idea-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    white-space: pre-wrap;
}

/* Hero question idea — bigger, more prominent */
.workshop-idea-hero {
    padding: 20px 24px;
    margin-bottom: 4px;
}
.workshop-idea-hero-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.workshop-idea-hero-text {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text);
    font-weight: 500;
    white-space: pre-wrap;
}

/* Dupe check — card container */
.dupe-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}
.dupe-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 16px;
    background: var(--bg-inset);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}
.dupe-card-header-warn {
    background: var(--warning-light);
    border-bottom-color: #fde68a;
    color: #92400e;
}
.dupe-card-header-clear {
    background: var(--success-light);
    border-bottom-color: #a7f3d0;
    color: var(--success);
}
.dupe-card-body {
    padding: 12px 16px;
}
.dupe-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    padding: 4px 0;
}
.dupe-loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: dupe-pulse 1.2s ease-in-out infinite;
}
@keyframes dupe-pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

/* Individual matched question card — compact, expandable */
.dupe-match-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 8px;
    transition: box-shadow var(--transition);
}
.dupe-match-card:last-child { margin-bottom: 0; }
.dupe-match-card:hover { box-shadow: var(--shadow-sm); }
.dupe-match-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.dupe-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.dupe-source-bank {
    background: var(--primary-light);
    color: var(--primary);
}
.dupe-source-local {
    background: #f3e8ff;
    color: #7c3aed;
}
.dupe-match-reason {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.4;
    font-style: italic;
}
.dupe-match-stem {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    white-space: pre-wrap;
}

/* Answer choices — collapsed by default, expand on hover */
.dupe-match-expand {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.2s ease;
    margin-top: 0;
}
.dupe-match-card:hover .dupe-match-expand {
    max-height: 400px;
    opacity: 1;
    margin-top: 10px;
}
.dupe-match-answers {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dupe-match-answer {
    padding: 6px 10px;
    margin-bottom: 3px;
    border-radius: 5px;
    font-size: 12px;
    background: var(--bg-inset);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}
.dupe-match-answer:last-child { margin-bottom: 0; }
.dupe-answer-letter {
    font-weight: 700;
    margin-right: 5px;
    color: var(--text);
}

.tag-joel-btn {
    background: var(--success);
    color: #fff;
    border: none;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
}
.tag-joel-btn:hover {
    background: #047857;
}

/* ===== Draft Form (Phase 3) ===== */
.draft-reference {
    background: var(--bg-inset);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}
.draft-reference-label {
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 6px;
}
.draft-section-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}
.draft-stem-section {
    margin-bottom: 24px;
}
.draft-stem-input {
    width: 100%;
    min-height: 100px;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    resize: vertical;
    line-height: 1.6;
    transition: border-color var(--transition);
}
.draft-stem-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
/* Rich stem editor (contenteditable with sub/sup toolbar) */
.stem-editor-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.stem-editor-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.stem-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 10px;
    background: var(--bg-inset);
    border-bottom: 1px solid var(--border);
}
.stem-editor-content[contenteditable] {
    width: 100%;
    min-height: 80px;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    background: var(--bg-card);
}
.stem-editor-content[contenteditable]:empty:before {
    content: attr(data-placeholder);
    color: var(--text-muted);
}
/* Choice contenteditable (inline, replaces input) */
.draft-choice-input[contenteditable] {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    padding: 4px 0;
    outline: none;
    min-height: 1.4em;
}
.draft-choice-input[contenteditable]:empty:before {
    content: attr(data-placeholder);
    color: var(--text-muted);
}
/* Mini toolbar for choices area */
.choices-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 10px;
    margin-bottom: 8px;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 11px;
    color: var(--text-muted);
}
.choices-toolbar-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-right: 6px;
}
.draft-meta-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}
.draft-char-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}
.draft-choices-section {
    margin-bottom: 24px;
}
.draft-choices-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.draft-choice-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition), opacity var(--transition), transform var(--transition);
}
.draft-choice-card:hover {
    border-color: var(--border);
}
.draft-choice-card:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.draft-choice-card.dragging {
    opacity: 0.5;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.draft-choice-card.drop-target-above {
    box-shadow: 0 -2px 0 0 var(--primary);
}
.draft-choice-card.drop-target-below {
    box-shadow: 0 2px 0 0 var(--primary);
}
.draft-choice-drag {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: grab;
    padding: 2px;
    margin: -2px -4px -2px 0;
    opacity: 0.35;
    flex-shrink: 0;
    transition: opacity var(--transition);
    user-select: none;
    touch-action: none;
}
.draft-choice-card:hover .draft-choice-drag { opacity: 0.85; }
.draft-choice-drag:hover { opacity: 1 !important; color: var(--text-secondary); }
.draft-choice-drag:active { cursor: grabbing; }
.draft-choice-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-inset);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.draft-correct-toggle {
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.draft-correct-toggle input[type="radio"] {
    display: none;
}
.draft-correct-mark {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all var(--transition);
}
.draft-correct-toggle input[type="radio"]:checked + .draft-correct-mark {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.draft-correct-toggle:hover .draft-correct-mark {
    border-color: var(--success);
}
.draft-choice-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    padding: 4px 0;
    outline: none;
}
.draft-choice-input::placeholder { color: var(--text-muted); }
.draft-remove-choice {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    opacity: 0;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.draft-choice-card:hover .draft-remove-choice { opacity: 0.5; }
.draft-remove-choice:hover { opacity: 1 !important; color: var(--danger); }
.draft-add-choice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    background: none;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 4px;
}
.draft-add-choice:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

/* Image upload + width slider for stem and answer choices */
.qimg-area {
    flex: 0 0 100%;
    width: 100%;
    margin-top: 4px;
}
.qimg-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    background: none;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}
.qimg-add-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}
.qimg-preview-wrap {
    margin-top: 6px;
    padding: 10px;
    background: var(--bg-inset);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}
.qimg-preview {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0 auto 8px;
    background: #fff;
}
.qimg-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-secondary);
}
.qimg-controls input[type="range"] {
    flex: 1;
    min-width: 120px;
    max-width: 240px;
}
.qimg-width-label {
    font-variant-numeric: tabular-nums;
    min-width: 36px;
}
.qimg-remove-btn {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
}
.qimg-remove-btn:hover { text-decoration: underline; }
.qimg-uploading { color: var(--text-muted); font-size: 12px; padding: 4px 0; }
.qimg-error { color: var(--danger); font-size: 12px; padding: 4px 0; }

/* Read-only display: rendered question/choice images */
.question-stem-image,
.answer-choice-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 8px 0;
}
.answer-choice-image { margin: 4px 0 0; }
.draft-submit-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}
.draft-submit-hint {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ===== Evaluation Results (Phase 4) — Card Design ===== */
.eval-summary-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}
.eval-summary-clean {
    background: var(--success-light);
    border: 1px solid #a7f3d0;
    color: var(--success);
}
.eval-summary-critical {
    background: var(--danger-light);
    border: 1px solid #fca5a5;
    color: var(--danger);
}
.eval-summary-moderate {
    background: var(--warning-light);
    border: 1px solid #fde68a;
    color: var(--warning);
}
.eval-summary-minor {
    background: var(--bg-inset);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.eval-summary-icon { flex-shrink: 0; }
.eval-summary-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}
.eval-summary-counts {
    display: flex;
    gap: 8px;
}
.eval-count-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.eval-count-critical { background: rgba(239,68,68,0.1); color: #ef4444; }
.eval-count-moderate { background: rgba(249,115,22,0.1); color: #f97316; }
.eval-count-minor { background: rgba(234,179,8,0.1); color: #ca8a04; }

.eval-issues-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.eval-issue-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow var(--transition);
}
.eval-issue-card:hover { box-shadow: var(--shadow); }
.eval-issue-card-critical { border-left: 4px solid #ef4444; }
.eval-issue-card-moderate { border-left: 4px solid #f97316; }
.eval-issue-card-minor { border-left: 4px solid #eab308; }
.eval-issue-card-revision { border-left: 4px solid #6366f1; }

.eval-issue-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-inset);
    border-bottom: 1px solid var(--border-light);
}
.eval-severity-pill {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 100px;
}
.eval-severity-critical { background: #ef4444; color: #fff; }
.eval-severity-moderate { background: #f97316; color: #fff; }
.eval-severity-minor { background: #eab308; color: #fff; }
.eval-severity-revision { background: #6366f1; color: #fff; }

.eval-issue-card-domain {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.eval-issue-card-body { padding: 14px 16px; }
.eval-issue-card-problem {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 10px;
    white-space: pre-line;
}
.eval-issue-card-problem:last-child { margin-bottom: 0; }
.eval-issue-diff {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
}
.eval-diff-row {
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.5;
}
.eval-diff-row + .eval-diff-row { border-top: 1px solid var(--border-light); }
.eval-diff-original { background: #fef2f2; }
.eval-diff-suggested { background: #ecfdf5; }
.eval-diff-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    min-width: 65px;
    flex-shrink: 0;
    padding-top: 1px;
}
.eval-diff-text { flex: 1; min-width: 0; white-space: pre-line; }
.eval-diff-original .eval-diff-text { color: var(--danger); }
.eval-diff-suggested .eval-diff-text { color: var(--success); }
.eval-diff-no-change { background: #f9fafb; }
.eval-diff-custom { background: #eff6ff; align-items: flex-start; }
.eval-diff-custom .eval-diff-label { color: #2563eb; }
.eval-custom-input {
    flex: 1;
    border: 1px solid #93c5fd;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.5;
    background: #fff;
    color: var(--text-primary);
    outline: none;
    resize: vertical;
    min-height: 38px;
    field-sizing: content;
}
.eval-custom-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }

/* Eval accept/edit/deny action buttons */
.eval-issue-actions { display: flex; gap: 6px; flex-shrink: 0; }
.eval-action-btn {
    width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid; background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s; padding: 0;
}
.eval-action-btn svg { pointer-events: none; }
.eval-accept-btn { border-color: #22c55e; color: #22c55e; }
.eval-accept-btn:hover { background: rgba(34,197,94,0.15); }
.eval-accept-btn.active { background: #22c55e; color: #fff; border-color: #22c55e; }
.eval-edit-btn { border-color: #3b82f6; color: #3b82f6; }
.eval-edit-btn:hover { background: rgba(59,130,246,0.15); }
.eval-edit-btn.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.eval-deny-btn { border-color: #ef4444; color: #ef4444; }
.eval-deny-btn:hover { background: rgba(239,68,68,0.15); }
.eval-deny-btn.active { background: #ef4444; color: #fff; border-color: #ef4444; }
.eval-issue-card.accepted { opacity: 0.75; }
.eval-issue-card.accepted .eval-issue-card-header { background: #f0fdf4; }
.eval-issue-card.edited .eval-issue-card-header { background: #eff6ff; }
.eval-issue-card.denied { opacity: 0.6; }
.eval-issue-card.denied .eval-issue-card-header { background: #fef2f2; }
.eval-issue-card.denied .eval-issue-card-body { text-decoration: line-through; color: var(--text-muted); }
/* Dupe action pills */
.dupe-action-pills { display: flex; gap: 8px; }
.dupe-pill {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600; padding: 5px 14px;
    border-radius: 100px; border: 1.5px solid; cursor: pointer;
    transition: all 0.15s; white-space: nowrap; background: transparent;
}
.dupe-pill svg { pointer-events: none; flex-shrink: 0; }
.dupe-pill-ok { border-color: #22c55e; color: #22c55e; }
.dupe-pill-ok:hover { background: rgba(34,197,94,0.08); }
.dupe-pill-ok.active { background: #22c55e; color: #fff; border-color: #22c55e; }
.dupe-pill-edit { border-color: #f97316; color: #f97316; }
.dupe-pill-edit:hover { background: rgba(249,115,22,0.08); }

/* Eval summary meta (models, checks) */
.eval-summary-meta {
    display: flex; flex-direction: column; gap: 2px; margin-top: 6px;
}
.eval-meta-line {
    font-size: 11px; color: inherit; opacity: 0.8;
}
.eval-meta-tag {
    display: inline-block; font-size: 10px; font-weight: 600;
    padding: 1px 6px; border-radius: 4px;
    background: rgba(255,255,255,0.2); margin: 0 1px;
}

/* Stepper return button (admin) */
.stepper-return-btn {
    display: none; width: 20px; height: 20px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--bg-card);
    color: var(--text-muted); cursor: pointer; margin-left: auto;
    align-items: center; justify-content: center; padding: 0;
    transition: all 0.15s; flex-shrink: 0;
}
.stepper-item.completed:hover .stepper-return-btn { display: flex; }
.stepper-return-btn:hover { color: var(--warning); border-color: var(--warning); background: var(--warning-light); }

/* Activity feed */
.activity-feed {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}
.activity-feed-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}
.activity-feed-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    position: relative;
}
.activity-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 20px;
    bottom: -8px;
    width: 1px;
    background: var(--border-light);
}
.activity-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    margin-top: 4px;
}
.activity-content {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}
.activity-action {
    font-weight: 600;
    color: var(--text);
}
.activity-actor {
    color: var(--text-secondary);
}
.activity-details {
    color: var(--text-muted);
    font-size: 12px;
}
.activity-time {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.submitted-question-preview {
    background: var(--bg-inset);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
}

/* ===== Explanation Preview (HTML from DynamoDB) ===== */
.explanation-preview p { margin-bottom: 0.75em; }
.explanation-preview p:last-child { margin-bottom: 0; }
.explanation-preview img { max-width: 100% !important; width: auto !important; height: auto !important; border-radius: 4px; margin: 8px 0; }
.explanation-preview ul, .explanation-preview ol { margin: 0.5em 0 0.5em 1.5em; }
.explanation-preview li { margin-bottom: 0.3em; }

/* ===== Avatars ===== */
.avatar-xs {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-inset);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
}
.avatar-sm.avatar-initials { font-size: 11px; }
.sidebar-user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ===== Return Button ===== */
.btn-return {
    color: var(--text-muted);
    border-color: var(--border-light);
    font-size: 12px;
    padding: 5px 10px;
}
.btn-return:hover {
    color: var(--text-secondary);
    border-color: var(--border);
}
.return-form { display: inline; }

/* ===== Notification Improvements ===== */
.notif-actions-visible { opacity: 1 !important; }
.notif-mark-unread-btn { opacity: 0.4; }
.notif-mark-unread-btn:hover { opacity: 1; }
.notif-pin-btn:hover { color: var(--warning); }

/* ===== Kanban Board ===== */
.kanban-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 400px;
    -webkit-overflow-scrolling: touch;
}
.kanban-column {
    min-width: 180px;
    max-width: 200px;
    flex-shrink: 0;
    background: var(--bg-inset);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}
.kanban-column-complete { opacity: 0.7; }
.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
}
.kanban-column-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}
.kanban-column-count {
    font-size: 10px;
    font-weight: 700;
    background: var(--border-light);
    color: var(--text-muted);
    padding: 1px 6px;
    border-radius: 10px;
}
.kanban-column-body {
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 600px;
}
.kanban-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}
.kanban-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
    border-color: var(--border);
}
.kanban-card-title {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
    color: var(--text);
}
.kanban-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.kanban-card-subject {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 1px 5px;
    border-radius: 3px;
}
.kanban-card-date {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}
.kanban-card-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
}
.kanban-empty {
    text-align: center;
    padding: 20px 8px;
    color: var(--text-muted);
    font-size: 11px;
}

/* Subject-tinted kanban cards */
.kanban-card-bio    { background: var(--subject-bio-light); border-left-color: var(--subject-bio); }
.kanban-card-genchem { background: var(--subject-genchem-light); border-left-color: var(--subject-genchem); }
.kanban-card-ochem  { background: var(--subject-ochem-light); border-left-color: var(--subject-ochem); }
.kanban-card-pa     { background: var(--subject-pa-light); border-left-color: var(--subject-pa); }
.kanban-card-rc     { background: var(--subject-rc-light); border-left-color: var(--subject-rc); }
.kanban-card-qr     { background: var(--subject-qr-light); border-left-color: var(--subject-qr); }

/* Subject badge colors */
.kanban-subject-bio    { background: #dbeafe; color: #1d4ed8; }
.kanban-subject-genchem { background: #d1fae5; color: #065f46; }
.kanban-subject-ochem  { background: #fef3c7; color: #92400e; }
.kanban-subject-pa     { background: #ede9fe; color: #5b21b6; }
.kanban-subject-rc     { background: #fce7f3; color: #9d174d; }
.kanban-subject-qr     { background: #e0e7ff; color: #3730a3; }

/* ===== Idea Bank Triage Section ===== */
.triage-section {
    margin-bottom: 20px;
    background: var(--bg-inset);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}
.triage-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}
.triage-toggle:hover { color: var(--text); }
.triage-chevron { transition: transform 0.2s; }
.triage-open .triage-chevron { transform: rotate(90deg); }
.triage-count {
    font-size: 10px;
    font-weight: 700;
    color: var(--text);
    background: transparent;
    border: 1.5px solid var(--text-muted);
    padding: 0 6px;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.triage-body { padding: 0 12px 12px; }
.triage-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.triage-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 10px 14px;
    gap: 16px;
}
.triage-card-content { flex: 1; min-width: 0; }
.triage-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.triage-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}
.triage-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.btn-promote {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
}
.btn-promote:hover { opacity: 0.9; }
.btn-triage-view {
    padding: 5px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    white-space: nowrap;
}
.btn-triage-view:hover { border-color: var(--border); color: var(--text); }

/* ===== My Assignments ===== */
.my-assignments {
    margin-top: 32px;
}
.my-assignments-header {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
}
.my-assignments-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.assignment-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}
.assignment-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--border);
    transform: translateY(-1px);
}
.assignment-card-content {
    flex: 1;
    min-width: 0;
}
.assignment-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.assignment-card-stage {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.assignment-notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 0 6px;
    flex-shrink: 0;
}
.assignment-stage-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Assignment card column tints — match kanban columns */
.assignment-col-workshop        { border-left: 3px solid #c4b5fd; background: #f8f7ff; }
.assignment-col-workshop_eval   { border-left: 3px solid #a78bfa; background: #f5f2ff; }
.assignment-col-question_draft  { border-left: 3px solid #8b5cf6; background: #f2eeff; }
.assignment-col-question_review { border-left: 3px solid #7c3aed; background: #efebff; }
.assignment-col-explanation_draft  { border-left: 3px solid #8b5cf6; background: #f2eeff; }
.assignment-col-explanation_review { border-left: 3px solid #7c3aed; background: #efebff; }
.assignment-col-post_to_lms     { border-left: 3px solid #6366f1; background: #eef2ff; }
.assignment-col-copy_editing    { border-left: 3px solid #a78bfa; background: #f5f2ff; }
.assignment-col-complete         { border-left: 3px solid #059669; background: #f0fdf4; }

/* ===== Wait Badge (clock icon + hours) ===== */
.wait-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--bg-inset);
    white-space: nowrap;
}
.wait-badge svg {
    opacity: 0.6;
}
/* Global JS tooltip (position: fixed, appended to body — immune to overflow clipping) */
.global-tooltip {
    position: fixed;
    background: rgba(17, 24, 39, 0.9);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.15s;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    letter-spacing: 0.01em;
}
.global-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: rgba(17, 24, 39, 0.9);
}
.wait-badge-overdue {
    background: var(--danger);
    color: #fff;
}
.wait-badge-overdue svg {
    opacity: 1;
    stroke: #fff;
}

/* Overdue kanban card (72h+) — bright red border */
.kanban-card-overdue {
    border-color: var(--danger) !important;
    border-left-color: var(--danger) !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2), var(--shadow-sm);
}
.kanban-card-overdue .kanban-card-title {
    color: var(--danger);
}

/* Overdue assignment card (72h+) */
.assignment-card-overdue {
    border-color: var(--danger) !important;
    border-left-color: var(--danger) !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2), var(--shadow-sm);
}
.assignment-card-overdue .assignment-card-title {
    color: var(--danger);
}

/* ===== Overdue Assignments Section (admin only) ===== */
.overdue-assignments {
    margin-top: 32px;
}
.overdue-assignments-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--danger);
    margin-bottom: 14px;
}
.overdue-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    background: var(--danger);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 0 6px;
}
.overdue-assignments-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ===== Post to LMS Copy Format ===== */
.lms-copy-container {
    background: var(--bg-inset);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    font-family: inherit;
}
.lms-copy-section {
    margin-bottom: 16px;
}
.lms-copy-section:last-child { margin-bottom: 0; }
.lms-copy-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.lms-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
}
.lms-copy-btn:hover {
    background: var(--bg-hover);
    box-shadow: var(--shadow-sm);
}
.lms-copy-btn.copied {
    background: var(--success-light);
    border-color: #a7f3d0;
    color: var(--success);
}
.lms-copy-box {
    background: var(--bg-inset);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    overflow: hidden;
}
.lms-copy-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary, #f8f9fa);
}
.lms-copy-box-content {
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.7;
}
.lms-copy-btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}
.lms-copy-btn-sm:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.lms-copy-btn-sm.copied {
    background: var(--success-light);
    border-color: #a7f3d0;
    color: var(--success);
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--bg-inset);
    border-radius: var(--radius);
    padding: 3px;
    width: fit-content;
}
.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}
.view-toggle-btn.active {
    background: var(--bg-card);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

/* Disabled proceed button */
.btn-proceed-disabled {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; font-size: 13px; font-weight: 600;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-inset); color: var(--text-muted);
    cursor: not-allowed; position: relative;
}
.btn-proceed-disabled .tooltip-text {
    visibility: hidden; opacity: 0;
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%);
    background: var(--text); color: var(--bg-card);
    font-size: 12px; font-weight: 500; white-space: nowrap;
    padding: 6px 12px; border-radius: 6px;
    transition: opacity 0.15s;
    pointer-events: none;
    z-index: 10;
}
.btn-proceed-disabled .tooltip-text::after {
    content: ''; position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: var(--text);
}
.btn-proceed-disabled:hover .tooltip-text { visibility: visible; opacity: 1; }

/* Two-column diff view */
.diff-view {
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; margin: 16px 0;
}
.diff-header {
    display: grid; grid-template-columns: 1fr 1fr;
    background: var(--bg-inset); border-bottom: 1px solid var(--border);
}
.diff-header-col {
    padding: 10px 16px; font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-muted);
}
.diff-header-col:first-child { border-right: 1px solid var(--border); }
.diff-header-before { color: #ef4444; }
.diff-header-after { color: #22c55e; }
.diff-body {
    display: grid; grid-template-columns: 1fr 1fr;
}
.diff-col {
    padding: 14px 16px; font-size: 13px; line-height: 1.6;
    color: var(--text);
}
.diff-col:first-child { border-right: 1px solid var(--border); }
.diff-col-before { background: var(--bg-card); }
.diff-col-after { background: var(--bg-card); }
.diff-col .diff-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted);
    margin-bottom: 4px; margin-top: 12px;
}
.diff-col .diff-label:first-child { margin-top: 0; }
.diff-section-title {
    font-size: 13px; font-weight: 600; color: var(--text);
    margin-bottom: 12px;
}
.diff-text { white-space: pre-wrap; }
.diff-choice { font-size: 13px; margin: 2px 0; }
/* Inline diff highlights — word-level */
.diff-del {
    background: rgba(239, 68, 68, 0.18);
    color: #b91c1c;
    text-decoration: line-through;
    padding: 1px 2px;
    border-radius: 2px;
}
.diff-add {
    background: rgba(34, 197, 94, 0.18);
    color: #15803d;
    padding: 1px 2px;
    border-radius: 2px;
}

/* Explanation diff — paragraph-level blocks */
.expl-diff-block {
    padding: 10px 14px;
    margin: 6px 0;
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.6;
}
.expl-diff-block.expl-diff-del {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
}
.expl-diff-block.expl-diff-add {
    background: #ecfdf5;
    border-left: 3px solid #22c55e;
}
.expl-diff-block.expl-diff-unchanged {
    background: var(--bg-card);
    border-left: 3px solid var(--border-light);
    color: var(--text-muted);
}

/* Rendered markdown (explanation content) */
.rendered-markdown h1, .rendered-markdown h2, .rendered-markdown h3 {
    margin-top: 1em; margin-bottom: 0.4em; font-weight: 700; color: var(--text);
}
.rendered-markdown h1 { font-size: 18px; }
.rendered-markdown h2 { font-size: 16px; }
.rendered-markdown h3 { font-size: 14px; }
.rendered-markdown p { margin-bottom: 0.6em; line-height: 1.6; }
.rendered-markdown ul, .rendered-markdown ol { padding-left: 20px; margin-bottom: 0.6em; }
.rendered-markdown li { margin-bottom: 0.3em; line-height: 1.5; }
.rendered-markdown strong { font-weight: 700; }
.rendered-markdown em { font-style: italic; }
.rendered-markdown code { background: var(--bg-inset); padding: 1px 4px; border-radius: 3px; font-size: 0.9em; }
.rendered-markdown pre { background: var(--bg-inset); padding: 12px; border-radius: var(--radius); overflow-x: auto; margin-bottom: 0.6em; }
.rendered-markdown pre code { background: none; padding: 0; }

/* Review eval styles (Phase 4/6 Claude check) */
.review-eval-section {
    margin-top: 20px; padding-top: 20px;
    border-top: 1px solid var(--border-light);
}
.review-eval-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.review-eval-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 100px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}
.review-eval-model {
    font-size: 12px; color: var(--text-muted); font-weight: 500;
}
.review-eval-clean {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 18px; border-radius: var(--radius);
    background: #f0fdf4; border: 1px solid #bbf7d0;
    color: #15803d; font-size: 14px; font-weight: 600;
}

/* ── Final Review Rubric Scorecard ── */
.rubric-card {
    border: 1px solid var(--border);
    border-left: 4px solid #7c3aed;
    border-radius: var(--radius);
    padding: 20px;
    background: var(--bg-card);
    margin-top: 16px;
}
.rubric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.rubric-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #7c3aed;
}
.rubric-composite {
    display: flex;
    align-items: center;
    gap: 10px;
}
.rubric-composite-score {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}
.rubric-verdict-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.rubric-verdict-approve {
    background: #dcfce7;
    color: #15803d;
}
.rubric-verdict-minor_revisions {
    background: #fef9c3;
    color: #a16207;
}
.rubric-verdict-major_revisions {
    background: #fee2e2;
    color: #b91c1c;
}
.rubric-verdict-unknown {
    background: #f3f4f6;
    color: #6b7280;
}
.rubric-model-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.rubric-dimensions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rubric-dimension-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.rubric-dim-label {
    width: 220px;
    flex-shrink: 0;
    font-size: 13px;
    color: var(--text-secondary);
}
.rubric-bar {
    flex: 1;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}
.rubric-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}
.rubric-bar-excellent { background: #22c55e; }
.rubric-bar-good { background: #eab308; }
.rubric-bar-needs-work { background: #ef4444; }
.rubric-dim-score {
    width: 36px;
    text-align: right;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.rubric-score-excellent { color: #15803d; }
.rubric-score-good { color: #a16207; }
.rubric-score-needs-work { color: #b91c1c; }

.contested-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}
.issue-target-question {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}
.issue-target-explanation {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    background: #f3e8ff;
    color: #6b21a8;
    border: 1px solid #c4b5fd;
}
.eval-severity-polish {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.eval-issue-card-polish {
    border-left-color: #22c55e;
}
.eval-count-polish {
    background: #f0fdf4;
    color: #15803d;
}

/* ===== Analytics Dashboard ===== */
.analytics-header { margin-bottom: 24px; }
.analytics-header h1 { font-size: 1.75rem; font-weight: 700; color: var(--text); }
.analytics-subtitle { color: var(--text-secondary); font-size: 0.95rem; margin-top: 4px; }

.analytics-empty {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}
.analytics-empty svg { margin: 0 auto 16px; opacity: 0.4; }
.analytics-empty h3 { color: var(--text-secondary); margin-bottom: 8px; }

.analytics-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.analytics-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.analytics-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}
.analytics-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.analytics-grid-full {
    grid-column: 1 / -1;
}
.analytics-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
}
.analytics-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.analytics-section-title svg { color: var(--text-muted); flex-shrink: 0; }
.analytics-no-data {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    padding: 12px 0;
}

/* Bar chart rows */
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.bar-label {
    width: 140px;
    flex-shrink: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bar-track {
    flex: 1;
    height: 20px;
    background: var(--bg-inset);
    border-radius: 4px;
    overflow: hidden;
    min-width: 80px;
}
.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 2px;
}
.bar-fill-success { background: var(--success); }
.bar-fill-primary { background: var(--primary); }
.bar-fill-warning { background: var(--warning); }
.bar-fill-danger { background: var(--danger); }
.bar-fill-muted { background: #94a3b8; }
.bar-value {
    width: 42px;
    flex-shrink: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    text-align: right;
}
.bar-count {
    width: 60px;
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.score-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

/* Backlog grid */
.backlog-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.backlog-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 64px;
}
.backlog-count {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-muted);
    line-height: 1;
}
.backlog-count.backlog-active { color: var(--primary); }
.backlog-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
}
.analytics-divider {
    height: 1px;
    background: var(--border-light);
    margin: 16px 0;
}
.analytics-stat-mini-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}
.analytics-stat-mini-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Responsive */
@media (max-width: 768px) {
    .detail-layout { grid-template-columns: 1fr; }
    .detail-sidebar { position: static; }
    .navbar { padding: 0 16px; }
    .container { padding: 16px; }
    .edit-choice-row { flex-wrap: wrap; }
    .dashboard-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .dashboard-actions { width: 100%; }
    .question-card { grid-template-columns: 1fr; gap: 12px; }
    .qcard-right { text-align: left; }
    .qcard-progress { justify-content: flex-start; }
    .filter-form { flex-direction: column; }
    .filter-search { max-width: 100%; }
}

/* ── Brainstorm Page ── */
.bs-page { max-width: 880px; margin: 0 auto; }
.bs-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
}
.bs-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.bs-desc { color: var(--text-muted); font-size: 13px; margin-top: 4px; line-height: 1.5; max-width: 520px; }

/* Controls bar (legacy) */
.bs-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}


.bs-control-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.bs-subject-select { min-width: 180px; }
.bs-count-pill {
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
    background: var(--success-light);
    padding: 4px 12px;
    border-radius: 12px;
    white-space: nowrap;
}

/* Progress bar */
.bs-progress {
    margin-bottom: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(243,232,255,0.7), rgba(237,233,245,0.5));
    border: 1px solid rgba(124, 58, 237, 0.1);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 14px;
}
.bs-progress-bar {
    flex: 1;
    height: 5px;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 3px;
    overflow: hidden;
}
.bs-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}
.bs-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: bsShimmer 1.8s ease infinite;
}
@keyframes bsShimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}
.bs-progress-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* List header */
.bs-list-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 4px;
}
.bs-list-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Idea list container */
.bs-idea-list {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Individual idea row */
.bs-idea-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.12s ease;
}
.bs-idea-card:last-child { border-bottom: none; }
.bs-idea-card:hover { background: var(--bg-hover); }
.bs-idea-card:active { background: var(--bg-inset); }
.bs-idea-content { flex: 1; min-width: 0; }
.bs-idea-top-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 3px;
}
.bs-idea-topic {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.bs-idea-subtopic {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}
.bs-idea-stem {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bs-idea-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.bs-idea-answer {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--success);
    background: var(--success-light);
    border-radius: 8px;
}
.bs-idea-chevron {
    color: var(--border);
    transition: color 0.15s, transform 0.15s;
}
.bs-idea-card:hover .bs-idea-chevron {
    color: var(--text-muted);
    transform: translateX(2px);
}

/* ===== Gap Section ===== */
.bs-gaps-section {
    margin-bottom: 20px;
}
.bs-gaps-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.bs-gaps-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.2px;
}
.bs-gaps-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.bs-gaps-generating {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary-light);
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--primary);
    margin-bottom: 10px;
}
.bs-gap-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    border-radius: var(--radius) var(--radius) 0 0;
}
.bs-gap-select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}
.bs-gap-select-all input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.bs-gap-list {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.bs-gap-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.12s ease;
    position: relative;
}
.bs-gap-card:last-of-type { border-bottom: none; }
.bs-gap-card:hover { background: var(--bg-hover); }
.bs-gap-checkbox {
    flex-shrink: 0;
    padding-top: 2px;
}
.bs-gap-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.bs-gap-content {
    flex: 1;
    min-width: 0;
}
.bs-gap-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.bs-gap-topic {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.bs-gap-priority {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 7px;
    border-radius: 4px;
    flex-shrink: 0;
}
.bs-gap-priority-high {
    color: var(--danger);
    background: var(--danger-light);
}
.bs-gap-priority-medium {
    color: var(--warning-dark, #92400e);
    background: var(--warning-light, rgba(251,191,36,0.12));
}
.bs-gap-subtopic {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 3px;
}
.bs-gap-reason {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}
.bs-gap-inspiration {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(124, 58, 237, 0.04);
    border-left: 3px solid var(--primary);
    border-radius: 0 6px 6px 0;
}
.bs-gap-inspiration-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--primary);
    margin-bottom: 4px;
}
.bs-gap-inspiration-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-line;
}
.bs-gap-related-panel {
    padding: 12px 18px 12px 18px;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border-light);
}
.bs-gap-related-panel .related-question-item {
    padding: 8px 10px;
    margin-bottom: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 6px;
}
.bs-gap-related-panel .related-question-stem {
    font-size: 12px;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 4px;
}
.bs-gap-related-panel .related-question-answers {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}
.bs-gap-send-btn:hover {
    color: var(--success, #059669);
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.15);
}
.bs-gap-related-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
    border-color: rgba(124, 58, 237, 0.15);
}
.bs-gap-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    padding-top: 2px;
}
.bs-gap-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.12s;
}
.bs-gap-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    color: var(--text-secondary);
}
.bs-gap-exclude-btn:hover {
    color: var(--danger);
    background: var(--danger-light);
    border-color: rgba(220,38,38,0.15);
}
.bs-gap-btn.has-tooltip {
    position: relative;
}
.bs-gap-btn.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: var(--text-primary, #1a1a2e);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.08s;
    z-index: 10;
}
.bs-gap-btn.has-tooltip:hover::after {
    opacity: 1;
}

/* Pipeline status chips */
.bs-pipeline-status {
    display: flex;
    gap: 6px;
    align-items: center;
}
.bs-pipeline-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    white-space: nowrap;
}
.bs-pipeline-chip-ok {
    color: var(--success);
    background: var(--success-light, rgba(34, 197, 94, 0.08));
}

/* Gap Coverage Indicators (v2 concept-based gaps) */
.bs-gap-coverage-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-hover);
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: 6px;
}
.bs-gap-clickable {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
}
.bs-gap-clickable:hover {
    background: var(--border-light);
    color: var(--text-secondary);
}

/* Related Questions Popover */
.bs-related-popover {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 20;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 8px 10px;
    min-width: 350px;
    max-width: 500px;
}
.bs-related-q {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}
.bs-related-q:last-child { border-bottom: none; }
.bs-related-stem {
    font-size: 12px;
    color: var(--text);
    line-height: 1.45;
}
.bs-related-meta {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 3px;
}

.bs-gap-coverage-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}
.bs-gap-coverage-bar-bg {
    flex: 1;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
    max-width: 180px;
}
.bs-gap-coverage-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Topic group (collapsible sections for gap browsing) */
.bs-topic-group {
    margin-bottom: 8px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}
.bs-topic-group[open] {
    margin-bottom: 12px;
}
.bs-topic-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
    background: var(--bg-hover);
    border-bottom: 1px solid transparent;
    transition: background 0.12s ease;
}
.bs-topic-group[open] > .bs-topic-summary {
    border-bottom-color: var(--border-light);
}
.bs-topic-summary:hover {
    background: var(--bg-secondary);
}
.bs-topic-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.1px;
}
.bs-topic-counts {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}
.bs-topic-breakdown {
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.7;
}
.bs-topic-group .bs-gap-list {
    border: none;
    border-radius: 0;
    box-shadow: none;
}
.bs-topic-group .bs-gap-card:last-of-type {
    border-bottom: none;
}
/* Dismiss button */
.bs-gap-dismiss-btn:hover {
    color: var(--warning-dark, #92400e);
    background: var(--warning-light, rgba(251,191,36,0.12));
    border-color: rgba(251,191,36,0.2);
}

/* Excluded Topics */
.bs-excluded-section {
    margin-bottom: 20px;
    padding: 10px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}
.bs-excluded-summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    user-select: none;
}
.bs-excluded-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 10px;
}
.bs-excluded-chip {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-secondary);
}
.bs-excluded-chip:last-child {
    border-bottom: none;
}
.bs-excluded-topic {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
}
.bs-excluded-restore {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 0;
    flex-shrink: 0;
}
.bs-excluded-restore:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Gap edit modal — smaller */
.modal-content-sm {
    max-width: 520px;
}

/* Empty state */
.bs-empty {
    text-align: center;
    padding: 64px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.bs-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--border);
}
.bs-empty-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.bs-empty-desc { font-size: 13px; color: var(--text-muted); }

/* Errors */
.bs-errors {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--danger-light);
    border: 1px solid rgba(220,38,38,0.12);
    border-radius: var(--radius);
    font-size: 13px;
}
.bs-errors summary { cursor: pointer; font-weight: 600; color: var(--danger); font-size: 12px; }
.bs-error-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 12px;
    border-bottom: 1px solid rgba(220,38,38,0.08);
}
.bs-error-row:last-child { border-bottom: none; }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 20px;
    overflow-y: auto;
}
.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.04);
    width: 100%;
    max-width: 720px;
    padding: 32px;
    position: relative;
    animation: modalIn 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.12s;
}
.modal-close:hover { color: var(--text); background: var(--bg-hover); }
.modal-header { margin-bottom: 24px; }
.modal-title { font-size: 20px; font-weight: 700; letter-spacing: -0.2px; margin-bottom: 4px; }
.modal-subtitle { color: var(--text-muted); font-size: 14px; line-height: 1.4; }
.modal-gap {
    margin-top: 10px;
    padding: 10px 14px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    border-left: 3px solid var(--primary);
}
.modal-rationale-box {
    margin-top: 16px;
    padding: 10px 14px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    border-left: 3px solid var(--success);
}
.modal-actions-row { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions-primary {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}
.modal-regen-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

/* Related Questions in Modal */
.modal-related {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}
.modal-related-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.modal-related-list { display: flex; flex-direction: column; gap: 6px; }
.related-question-item {
    padding: 10px 14px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    font-size: 12px;
    line-height: 1.5;
    border: 1px solid transparent;
    transition: border-color 0.12s;
}
.related-question-item:hover { border-color: var(--border-light); }
.related-question-stem { color: var(--text); margin-bottom: 3px; }
.related-question-answers { color: var(--text-muted); font-size: 11px; }
.related-question-source {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light, #f0ebff);
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}
/* Match strength color accents */
.related-match-strong { border-left: 3px solid #22c55e; }
.related-match-moderate { border-left: 3px solid #3b82f6; }
.related-match-tangential { border-left: 3px solid #94a3b8; }
/* AI relevance explanation */
.related-question-relevance {
    font-size: 11px;
    font-style: italic;
    color: var(--text-secondary, #6b7280);
    margin-top: 4px;
    line-height: 1.4;
}

.btn-sm { font-size: 12px; padding: 8px 14px; }

@media (max-width: 640px) {
    .bs-controls { flex-wrap: wrap; }
    .bs-idea-card { padding: 12px 14px; }
    .bs-idea-stem { display: none; }
    .modal-content { padding: 20px; border-radius: 12px; }
    .modal-overlay { padding: 20px 12px; }
}

/* ===== Variant Panel ===== */
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
}
.btn-outline:hover { background: var(--primary-light); }
.btn-xs { font-size: 11px; padding: 4px 10px; border-radius: 6px; }
.spinner-sm {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.spinner-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.ai-revision-section {
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
}
.variant-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.variant-panel-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px;
    font-weight: 700; font-size: 14px; color: var(--text);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-inset);
}
.variant-stem-card {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-light);
}
.variant-stem-card:last-child { border-bottom: none; }
.variant-stem-label {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-weight: 700; font-size: 13px; color: var(--primary);
    margin-bottom: 8px;
}
.variant-stem-text {
    font-size: 14px; line-height: 1.6; color: var(--text);
    padding: 10px 14px;
    background: var(--bg-inset);
    border-radius: var(--radius);
    margin-bottom: 12px;
}
.variant-box {
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 8px;
}
.variant-correct-box {
    background: var(--success-light);
    border: 1px solid #a7f3d0;
}
.variant-distractor-box {
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
}
.variant-box-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted);
    margin-bottom: 8px;
}
.variant-choice-item {
    display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap;
    padding: 5px 0; font-size: 13px; color: var(--text);
    cursor: pointer;
}
.variant-choice-item input[type="checkbox"] {
    accent-color: var(--primary);
    width: 15px; height: 15px; margin-top: 2px;
    cursor: pointer; flex-shrink: 0;
}

/* Score badges & pills */
.variant-score-badge {
    font-size: 12px; font-weight: 700;
    padding: 2px 10px; border-radius: 12px;
    white-space: nowrap;
}
.score-excellent { background: #d1fae5; color: #065f46; }
.score-good { background: #fef3c7; color: #92400e; }
.score-fair { background: #fee2e2; color: #991b1b; }
.variant-score-details {
    display: flex; flex-wrap: wrap; gap: 5px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-light);
}
.score-pill {
    font-size: 10px; font-weight: 600;
    padding: 2px 7px; border-radius: 8px;
    background: var(--bg-inset); color: var(--text-muted);
}
.score-pill.score-excellent { background: #d1fae5; color: #065f46; }
.score-pill.score-good { background: #fef3c7; color: #92400e; }
.score-pill.score-fair { background: #fee2e2; color: #991b1b; }
.choice-score {
    font-size: 11px; font-weight: 700;
    padding: 1px 6px; border-radius: 6px;
    background: var(--bg-inset); white-space: nowrap; flex-shrink: 0;
}
.choice-misconception {
    display: block; width: 100%;
    font-size: 11px; color: var(--text-muted);
    margin-left: 23px; font-style: italic; line-height: 1.4;
}
.variant-ranking-notes {
    font-size: 12px; color: var(--text-muted);
    padding: 8px 14px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-inset);
}
.variant-gaps-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-hover);
}
.variant-gaps-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted);
}
.variant-gap-chip {
    font-size: 11px; padding: 3px 8px;
    border-radius: 12px; background: var(--primary-light);
    color: var(--primary); border: 1px solid rgba(124,58,237,0.15);
}

/* Variant Summary Cards (clickable → modal) */
.variant-card-list {
    display: flex;
    flex-direction: column;
}
.variant-summary-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.12s ease;
}
.variant-summary-card:last-child { border-bottom: none; }
.variant-summary-card:hover { background: var(--bg-hover); }
.variant-summary-card:active { background: var(--bg-inset); }
.variant-summary-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.variant-summary-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}
.variant-summary-stem {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.variant-summary-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* Joel's Suggestion Card */
.joel-suggestion-card {
    border: 2px solid var(--primary);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(124,58,237,0.04), rgba(124,58,237,0.08));
    margin-bottom: 16px;
    overflow: hidden;
}
.joel-suggestion-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px;
    background: rgba(124,58,237,0.08);
    border-bottom: 1px solid rgba(124,58,237,0.15);
    font-weight: 600; font-size: 14px;
    color: var(--primary);
}
.joel-suggestion-stem {
    padding: 12px 14px;
    font-size: 14px; line-height: 1.5;
    color: var(--text-primary);
}
.joel-suggestion-choices {
    padding: 6px 14px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.joel-suggestion-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted);
    margin-right: 4px;
}
.joel-suggestion-choice {
    font-size: 12px; padding: 3px 10px;
    border-radius: 6px;
}
.joel-suggestion-choice.correct {
    background: rgba(16,185,129,0.1);
    color: #059669; border: 1px solid rgba(16,185,129,0.2);
}
.joel-suggestion-choice.distractor {
    background: var(--bg-inset);
    color: var(--text-secondary); border: 1px solid var(--border-light);
}

/* Model Attribution */
.variant-model-attribution {
    font-size: 11px; color: var(--text-muted);
    padding: 4px 14px 6px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-inset);
}

/* Submit Page Tabs */
.submit-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.submit-tab:hover { color: var(--text); }
.submit-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ── Revision History ── */
.revision-history {
    margin-top: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}
.revision-history-title {
    font-size: 14px;
    font-weight: 700;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.revision-count {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-inset);
    padding: 2px 8px;
    border-radius: 10px;
}
.revision-list {
    padding: 8px 0;
}
.revision-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.revision-item:last-child {
    border-bottom: none;
}
.revision-number {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    min-width: 48px;
}
.revision-info {
    flex: 1;
}
.revision-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    display: block;
}
.revision-meta {
    font-size: 11px;
    color: var(--text-muted);
}
.revision-compare-btn {
    font-size: 11px;
    padding: 4px 10px;
}
.revision-compare-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-inset);
}
.revision-select {
    font-size: 12px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    flex: 1;
}
.revision-diff-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-inset);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
}
#revision-diff-container {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
#revision-diff-content {
    padding: 0;
}
#revision-diff-content .diff-view {
    margin: 0;
    border: none;
    border-radius: 0;
}

/* ===== Section Count Badge (circled number) ===== */
.section-count-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
    background: transparent;
    border: 1.5px solid var(--text-muted);
    padding: 0 6px;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-left: 6px;
}

/* ===== Existing Analyzed Questions ===== */
.analyzed-questions-scroll {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
}
.analyzed-questions-scroll::-webkit-scrollbar {
    width: 6px;
}
.analyzed-questions-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.analyzed-questions-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
.analyzed-question-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.analyzed-question-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}
.analyzed-question-content {
    flex: 1;
    min-width: 0;
}
.analyzed-question-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.analyzed-question-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}
.analyzed-question-status {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 1px 6px;
    border-radius: 4px;
}
.analyzed-status-done {
    background: #d1fae5;
    color: #065f46;
}
.analyzed-status-error {
    background: #fee2e2;
    color: #991b1b;
}
.analyzed-status-fetching,
.analyzed-status-analyzing,
.analyzed-status-pending {
    background: #dbeafe;
    color: #1e40af;
}
.analyzed-question-score {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}
.analyzed-question-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.btn-reanalyze {
    background: none;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 5px 7px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color 0.15s, border-color 0.15s;
}
.btn-reanalyze:hover {
    color: var(--primary);
    border-color: var(--primary);
}
