/* ===== 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: 14px;
    -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;
}

/* ===== 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: 1280px;
    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-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-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: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.phase-status.approved { color: var(--success); }
.phase-status.awaiting { color: var(--warning); }
.phase-status.generating { color: var(--primary); }

/* Question content display */
.question-stem {
    font-size: 14px;
    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: 14px;
    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;
}

/* Explanation display (HTML output from Claude) */
.explanation-content {
    font-size: 14px;
    line-height: 1.7;
}
.explanation-content p { margin-bottom: 0.5em; margin-top: 0; }
.explanation-content p:has(br:only-child) { margin-bottom: 0.3em; line-height: 0.5; }
.explanation-content ul { padding-left: 20px; margin-bottom: 0.6em; }
.explanation-content li { margin-bottom: 0.3em; line-height: 1.5; }
.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; }

/* 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: 240px;
    max-height: 500px;
    overflow-y: auto;
    outline: none;
    background: var(--bg-card);
}
.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);
}

/* 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); }
.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);
}
.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;
    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);
}
.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-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);
}
.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-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-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;
}
.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-original .eval-diff-text { color: var(--danger); }
.eval-diff-suggested .eval-diff-text { color: var(--success); }

/* Eval accept/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-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.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;
}

/* ===== 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; }

/* ===== 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);
}

/* 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;
}

/* 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%; }
}
