/* =====================================================================
   Diagnostic Summary UI
   ===================================================================== */
#diagnostic-summary-section {
    border-color: rgba(76, 175, 255, 0.22);
}
.diagnostic-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.diag-metric {
    padding: 11px 12px;
    border-radius: 14px;
    background: rgba(76, 175, 255, 0.07);
    border: 1px solid rgba(76, 175, 255, 0.18);
}
.diag-metric b {
    display: block;
    font-size: 1.05rem;
    color: var(--primary);
    word-break: break-word;
}
.diag-metric span {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.76rem;
}
.diagnostic-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.diagnostic-block h4 {
    margin: 0 0 9px;
    font-size: 0.92rem;
    color: var(--text-color);
}
.diag-skill-card,
.diag-rank-row,
.diagnostic-empty-card,
.diagnostic-recommend-box {
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.055);
    padding: 10px 12px;
    margin-bottom: 8px;
}
.diag-skill-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}
.diag-skill-top b { font-size: 0.86rem; }
.diag-skill-top span {
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}
.diag-skill-sub,
.diag-advice,
.diagnostic-empty-card p {
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.45;
    margin-top: 5px;
}
.diag-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}
.diag-chip {
    border-radius: 999px;
    padding: 3px 7px;
    font-size: 0.68rem;
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.11);
    background: rgba(0,0,0,0.08);
}
.diag-rank-row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 9px;
    align-items: center;
}
.diag-rank-no {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    background: rgba(255, 193, 7, 0.16);
    color: #ffca28;
}
.diag-rank-main b { display: block; font-size: 0.82rem; }
.diag-rank-main span,
.diag-rank-main small {
    display: block;
    color: var(--text-muted);
    font-size: 0.7rem;
    line-height: 1.45;
}
.diag-trend {
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 900;
    background: rgba(0,0,0,0.12);
}
.diag-trend-veryHigh,
.diag-trend-high { color: #ff6b6b; }
.diag-trend-medium { color: #ffca28; }
.diag-trend-low { color: #64b5f6; }

/* v2.0 Scope grouping */
.diag-scope-section {
    margin-top: 10px;
    padding: 8px 10px 6px;
    border-left: 3px solid rgba(255,255,255,0.10);
    border-radius: 6px;
    background: rgba(255,255,255,0.02);
}
.diag-scope-section:first-child { margin-top: 0; }
.diag-scope-section h5 {
    margin: 0 0 6px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.diag-scope-section-chapter { border-left-color: #ff6b6b; }
.diag-scope-section-subject { border-left-color: #ffca28; }
.diag-scope-section-global  { border-left-color: #64b5f6; }
.diag-scope-section-unknown { border-left-color: #888;    }

.diag-scope-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}
.diag-scope-badge-chapter { background: rgba(255,107,107,0.16); color: #ff8e8e; }
.diag-scope-badge-subject { background: rgba(255,202,40,0.18); color: #ffd366; }
.diag-scope-badge-global  { background: rgba(100,181,246,0.18); color: #8ec5ff; }
.diag-scope-synthetic {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 700;
    background: rgba(255,255,255,0.08);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.diagnostic-recommend-box {
    margin-top: 10px;
    background: rgba(0, 200, 83, 0.06);
    border-color: rgba(0, 200, 83, 0.18);
}
.diagnostic-recommend-box b { display: block; margin-bottom: 5px; }
.diagnostic-recommend-box ul { margin: 6px 0 0 18px; padding: 0; }
.diagnostic-recommend-box li,
.diagnostic-recommend-box p {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.5;
}

/* Phase 6c: Diagnostic metadata warning */
.diagnostic-warning-box{
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255,152,0,.35);
  background: linear-gradient(135deg, rgba(255,248,225,.95), rgba(255,255,255,.9));
  border-radius: 14px;
  color: #5d4037;
}
.diagnostic-warning-box b{display:block;margin-bottom:6px;color:#e65100;}
.diagnostic-warning-box ul{margin:0;padding-left:18px;}
.diagnostic-warning-box li{margin:3px 0;}
.diagnostic-warning-box .diag-warn-critical{color:#c62828;font-weight:700;}

/* =====================================================================
   Phase 7: Reliability / Prerequisite / Assisted Analysis
   ===================================================================== */
.diag-phase7-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin: 12px 0 16px;
}
.diag-phase7-box {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;
    padding: 14px;
    background: rgba(15, 23, 42, 0.42);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}
body.light .diag-phase7-box, body[data-theme="light"] .diag-phase7-box {
    background: rgba(255,255,255,0.84);
    border-color: rgba(15, 23, 42, 0.12);
}
.diag-phase7-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.diag-phase7-head h4 {
    margin: 0 0 4px;
    font-size: 1rem;
}
.diag-phase7-head p {
    margin: 0;
    color: var(--muted-text, #94a3b8);
    font-size: 0.88rem;
    line-height: 1.45;
}
.diag-reliability-score {
    min-width: 72px;
    border-radius: 14px;
    padding: 8px 10px;
    text-align: center;
    background: rgba(99, 102, 241, 0.14);
}
.diag-reliability-score b,
.diag-reliability-score span {
    display: block;
}
.diag-reliability-score span {
    font-size: 0.86rem;
    color: var(--muted-text, #94a3b8);
}
.diag-reliability-high .diag-reliability-score { background: rgba(34,197,94,0.14); }
.diag-reliability-medium .diag-reliability-score { background: rgba(234,179,8,0.16); }
.diag-reliability-low .diag-reliability-score,
.diag-reliability-critical .diag-reliability-score { background: rgba(239,68,68,0.14); }
.diag-reliability-factors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 8px;
}
.diag-factor {
    border-radius: 12px;
    padding: 9px 10px;
    background: rgba(148, 163, 184, 0.12);
}
.diag-factor b,
.diag-factor span {
    display: block;
}
.diag-factor b {
    font-size: 0.84rem;
}
.diag-factor span {
    margin-top: 3px;
    font-size: 0.78rem;
    color: var(--muted-text, #94a3b8);
}
.diag-phase7-notes {
    margin: 10px 0 0;
    padding-left: 18px;
    color: #fbbf24;
    font-size: 0.86rem;
    line-height: 1.45;
}
.diag-assisted-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0 10px;
}
.diag-assisted-grid > div {
    border-radius: 12px;
    padding: 10px;
    background: rgba(148, 163, 184, 0.12);
}
.diag-assisted-grid b,
.diag-assisted-grid span {
    display: block;
}
.diag-assisted-grid b { font-size: 1.15rem; }
.diag-assisted-grid span {
    font-size: 0.78rem;
    color: var(--muted-text, #94a3b8);
}
.diag-prereq-list {
    display: grid;
    gap: 8px;
    margin: 8px 0 10px;
}
.diag-prereq-row {
    border-radius: 12px;
    padding: 9px 10px;
    background: rgba(148, 163, 184, 0.12);
    border-left: 4px solid rgba(148, 163, 184, 0.55);
}
.diag-prereq-high { border-left-color: #f97316; }
.diag-prereq-medium { border-left-color: #eab308; }
.diag-prereq-low { border-left-color: #38bdf8; }
.diag-prereq-row b,
.diag-prereq-row span {
    display: block;
}
.diag-prereq-row span {
    font-size: 0.8rem;
    color: var(--muted-text, #94a3b8);
    margin-top: 3px;
}
.diag-prereq-box small {
    display: block;
    color: var(--muted-text, #94a3b8);
    line-height: 1.45;
}
@media (max-width: 640px) {
    .diag-phase7-head { flex-direction: column; }
    .diag-reliability-score { width: 100%; }
    .diag-assisted-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   Phase 8: Time Behavior + Answer Revision
   ===================================================================== */
.diag-phase8-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin: 14px 0;
}
.diag-phase8-box {
    border: 1px solid rgba(99, 102, 241, 0.18);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(14, 165, 233, 0.06));
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.diag-phase8-box h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
}
.diag-phase8-box p {
    margin: 0;
    opacity: 0.82;
    line-height: 1.45;
}
.diag-time-grid,
.diag-revision-grid {
    margin-top: 12px;
}
.diag-phase8-signal-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}
.diag-phase8-signal {
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.22);
}
body.dark .diag-phase8-signal, body[data-theme="dark"] .diag-phase8-signal {
    background: rgba(15, 23, 42, 0.58);
}
.diag-phase8-signal b {
    display: block;
    font-size: 0.92rem;
}
.diag-phase8-signal span {
    display: block;
    margin-top: 3px;
    opacity: 0.8;
    font-size: 0.86rem;
}
.diag-time-fast_wrong,
.diag-revision-changed_to_wrong {
    border-color: rgba(239, 68, 68, 0.30);
    background: rgba(239, 68, 68, 0.08);
}
.diag-time-slow_wrong,
.diag-revision-reviewed_still_wrong {
    border-color: rgba(245, 158, 11, 0.32);
    background: rgba(245, 158, 11, 0.08);
}
.diag-time-slow_correct,
.diag-time-slow,
.diag-revision-reviewed {
    border-color: rgba(59, 130, 246, 0.28);
    background: rgba(59, 130, 246, 0.07);
}
.diag-time-fast_correct,
.diag-revision-changed_to_correct {
    border-color: rgba(34, 197, 94, 0.30);
    background: rgba(34, 197, 94, 0.08);
}

/* =====================================================================
   Phase 9B: Time per question chart + answer history visualization
   ===================================================================== */
.diag-phase9b-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 14px 0;
}
.diag-phase9b-wide {
    border: 1px solid rgba(14, 165, 233, 0.20);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.07), rgba(168, 85, 247, 0.05));
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.diag-phase9b-head h4 {
    margin: 0 0 4px;
    font-size: 1rem;
}
.diag-phase9b-head p {
    margin: 0 0 10px;
    line-height: 1.45;
    opacity: 0.82;
}
.diag-time-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    font-size: 0.82rem;
    color: var(--muted-text, #64748b);
    margin: 4px 0 10px;
}
.diag-mini-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: -6px;
}
.diag-mini-dot.correct { background: #22c55e; }
.diag-mini-dot.wrong { background: #ef4444; }
.diag-mini-dot.slow { background: #f59e0b; }
.diag-mini-dot.fast { background: #38bdf8; }
.diag-time-chart-list,
.diag-answer-history-list {
    display: grid;
    gap: 8px;
}
.diag-time-row {
    display: grid;
    grid-template-columns: 46px minmax(120px, 1fr) minmax(145px, 220px);
    gap: 10px;
    align-items: center;
    border-radius: 12px;
    padding: 9px 10px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(148, 163, 184, 0.20);
}
body.dark .diag-time-row,
body.dark .diag-answer-row,
body[data-theme="dark"] .diag-time-row,
body[data-theme="dark"] .diag-answer-row {
    background: rgba(15, 23, 42, 0.58);
}
.diag-time-row.wrong,
.diag-time-row.timeout,
.diag-time-row.unanswered {
    border-left: 4px solid rgba(239, 68, 68, 0.78);
}
.diag-time-row.correct {
    border-left: 4px solid rgba(34, 197, 94, 0.72);
}
.diag-time-row.slow,
.diag-time-row.very_slow {
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.22);
}
.diag-time-row.fast,
.diag-time-row.very_fast {
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.20);
}
.diag-time-qno,
.diag-answer-qno {
    font-weight: 800;
    font-size: 0.9rem;
}
.diag-time-bar-wrap {
    position: relative;
    height: 14px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    overflow: hidden;
}
.diag-time-expected {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.25), rgba(148, 163, 184, 0.25) 5px, rgba(148, 163, 184, 0.11) 5px, rgba(148, 163, 184, 0.11) 10px);
}
.diag-time-used {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #38bdf8, #6366f1);
}
.diag-time-row.wrong .diag-time-used,
.diag-time-row.timeout .diag-time-used,
.diag-time-row.unanswered .diag-time-used {
    background: linear-gradient(90deg, #fb7185, #ef4444);
}
.diag-time-row.slow .diag-time-used,
.diag-time-row.very_slow .diag-time-used {
    background: linear-gradient(90deg, #fbbf24, #f97316);
}
.diag-time-row.correct .diag-time-used {
    background: linear-gradient(90deg, #86efac, #22c55e);
}
.diag-time-meta b,
.diag-time-meta span {
    display: block;
}
.diag-time-meta b {
    font-size: 0.88rem;
}
.diag-time-meta span {
    margin-top: 2px;
    font-size: 0.76rem;
    opacity: 0.72;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.diag-answer-row {
    display: grid;
    grid-template-columns: 46px minmax(160px, 1fr) minmax(135px, 200px);
    gap: 10px;
    align-items: center;
    border-radius: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(148, 163, 184, 0.20);
}
.diag-answer-row.wrong_to_correct {
    border-left: 4px solid rgba(34, 197, 94, 0.78);
}
.diag-answer-row.correct_to_wrong,
.diag-answer-row.wrong_to_wrong {
    border-left: 4px solid rgba(239, 68, 68, 0.78);
}
.diag-answer-row.correct_to_correct,
.diag-answer-row.marked_only {
    border-left: 4px solid rgba(59, 130, 246, 0.72);
}
.diag-answer-row.is-marked {
    box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.24);
}
.diag-answer-route {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.diag-answer-route i {
    opacity: 0.55;
    font-style: normal;
}
.diag-answer-pill {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    border-radius: 999px;
    padding: 5px 8px;
    background: rgba(148, 163, 184, 0.18);
    font-weight: 800;
}
.diag-answer-pill.final {
    background: rgba(99, 102, 241, 0.16);
    color: #4338ca;
}
body.dark .diag-answer-pill.final, body[data-theme="dark"] .diag-answer-pill.final {
    color: #c4b5fd;
}
.diag-answer-pill small {
    font-size: 0.68rem;
    opacity: 0.72;
    font-weight: 600;
}
.diag-answer-skill {
    margin-top: 4px;
    font-size: 0.78rem;
    opacity: 0.72;
}
.diag-answer-status b,
.diag-answer-status span {
    display: block;
}
.diag-answer-status b {
    font-size: 0.85rem;
}
.diag-answer-status span {
    margin-top: 2px;
    font-size: 0.76rem;
    opacity: 0.75;
}
@media (max-width: 720px) {
    .diag-time-row,
    .diag-answer-row {
        grid-template-columns: 42px 1fr;
    }
    .diag-time-meta,
    .diag-answer-status {
        grid-column: 2 / -1;
    }
}

/* =====================================================================
   Phase 10: Adaptive Recommendation
   ===================================================================== */
.diag-phase10-box {
    margin: 14px 0;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(138, 91, 255, 0.12), rgba(76, 175, 255, 0.07));
    border: 1px solid rgba(138, 91, 255, 0.25);
}
.diag-phase10-head h4 {
    margin: 0 0 5px;
    font-size: 1rem;
}
.diag-phase10-head p {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 0.86rem;
}
.diag-adaptive-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.8fr);
    gap: 12px;
}
.diag-adaptive-actions {
    display: grid;
    gap: 9px;
}
.diag-adaptive-action {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 11px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.065);
    border: 1px solid rgba(255, 255, 255, 0.13);
}
.diag-adaptive-no {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: rgba(138, 91, 255, 0.18);
    color: var(--primary);
}
.diag-adaptive-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.diag-adaptive-title b {
    font-size: 0.92rem;
}
.diag-adaptive-title span,
.diag-next-exam-card span {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 193, 7, 0.14);
    border: 1px solid rgba(255, 193, 7, 0.28);
    font-size: 0.72rem;
    white-space: nowrap;
}
.diag-adaptive-target {
    margin-top: 3px;
    font-weight: 700;
    color: var(--text-color);
}
.diag-adaptive-action p {
    margin: 6px 0 4px;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.diag-adaptive-action small {
    color: var(--text-color);
    font-size: 0.78rem;
}
.diag-adaptive-plan {
    padding: 12px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.diag-adaptive-plan > b {
    display: block;
    margin-bottom: 6px;
}
.diag-adaptive-plan p,
.diag-adaptive-plan li span,
.diag-adaptive-caveat {
    color: var(--text-muted);
    font-size: 0.82rem;
}
.diag-adaptive-plan ol {
    margin: 10px 0;
    padding-left: 20px;
}
.diag-adaptive-plan li {
    margin: 6px 0;
}
.diag-next-exam-card {
    display: grid;
    gap: 6px;
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(76, 175, 255, 0.09);
    border: 1px solid rgba(76, 175, 255, 0.18);
}
.diag-next-exam-card small {
    color: var(--text-muted);
}
@media (max-width: 820px) {
    .diag-adaptive-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================================
   Patch: Diagnostic summary readability (light/dark theme safe)
   - Fix low-contrast text in analysis blocks
   - Support body[data-theme="light|dark"] in addition to body.light/body.dark
   ===================================================================== */
body[data-theme="light"] #diagnostic-summary-section {
    color: var(--text-color, #1f2937);
}
body[data-theme="light"] #diagnostic-summary-section h3,
body[data-theme="light"] #diagnostic-summary-section h4,
body[data-theme="light"] #diagnostic-summary-section h5,
body[data-theme="light"] #diagnostic-summary-section b,
body[data-theme="light"] #diagnostic-summary-section strong {
    color: var(--text-color, #1f2937);
}
body[data-theme="light"] #diagnostic-summary-section p,
body[data-theme="light"] #diagnostic-summary-section span,
body[data-theme="light"] #diagnostic-summary-section small,
body[data-theme="light"] #diagnostic-summary-section li {
    color: var(--text-muted, #475569);
}
body[data-theme="light"] .diag-phase7-box {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
    border-color: rgba(148, 163, 184, 0.34);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
body[data-theme="light"] .diag-phase8-box,
body[data-theme="light"] .diag-phase9b-wide,
body[data-theme="light"] .diag-phase10-box {
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
body[data-theme="light"] .diag-phase8-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(14, 165, 233, 0.05), rgba(255,255,255,0.96));
}
body[data-theme="light"] .diag-phase9b-wide {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05), rgba(168, 85, 247, 0.04), rgba(255,255,255,0.96));
}
body[data-theme="light"] .diag-phase10-box {
    background: linear-gradient(135deg, rgba(138, 91, 255, 0.08), rgba(76, 175, 255, 0.05), rgba(255,255,255,0.96));
}
body[data-theme="light"] .diag-phase7-head p,
body[data-theme="light"] .diag-phase8-box p,
body[data-theme="light"] .diag-phase9b-head p,
body[data-theme="light"] .diag-phase10-head p,
body[data-theme="light"] .diag-factor span,
body[data-theme="light"] .diag-assisted-grid span,
body[data-theme="light"] .diag-prereq-row span,
body[data-theme="light"] .diag-prereq-box small,
body[data-theme="light"] .diag-time-chart-legend,
body[data-theme="light"] .diag-time-meta span,
body[data-theme="light"] .diag-answer-status span,
body[data-theme="light"] .diag-answer-skill,
body[data-theme="light"] .diag-phase7-notes,
body[data-theme="light"] .diag-adaptive-action p,
body[data-theme="light"] .diag-adaptive-plan p,
body[data-theme="light"] .diag-adaptive-plan li span,
body[data-theme="light"] .diag-adaptive-caveat,
body[data-theme="light"] .diag-next-exam-card small {
    color: #475569;
}
body[data-theme="light"] .diag-factor,
body[data-theme="light"] .diag-assisted-grid > div,
body[data-theme="light"] .diag-prereq-row,
body[data-theme="light"] .diag-phase8-signal,
body[data-theme="light"] .diag-time-row,
body[data-theme="light"] .diag-answer-row,
body[data-theme="light"] .diag-adaptive-action,
body[data-theme="light"] .diag-adaptive-plan {
    background: rgba(255,255,255,0.88);
    border-color: rgba(148, 163, 184, 0.24);
}
body[data-theme="light"] .diag-reliability-score {
    background: rgba(99, 102, 241, 0.10);
}
body[data-theme="light"] .diag-reliability-score span {
    color: #475569;
}
body[data-theme="light"] .diag-chip {
    color: #475569;
    background: rgba(241, 245, 249, 0.95);
    border-color: rgba(148, 163, 184, 0.28);
}
body[data-theme="light"] .diagnostic-empty-card {
    background: rgba(255,255,255,0.92);
    border-color: rgba(148, 163, 184, 0.24);
}
body[data-theme="light"] .diag-answer-pill {
    background: rgba(226, 232, 240, 0.75);
    color: #1f2937;
}
body[data-theme="light"] .diag-answer-pill.final {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
}
body[data-theme="light"] .diag-time-bar-wrap {
    background: rgba(203, 213, 225, 0.42);
}
body[data-theme="light"] .diag-rank-main span,
body[data-theme="light"] .diag-rank-main small,
body[data-theme="light"] .diag-skill-sub,
body[data-theme="light"] .diag-advice,
body[data-theme="light"] .diag-phase7-notes li {
    color: #475569;
}

/* dark mode parity for pages that use data-theme instead of body.dark */
body[data-theme="dark"] .diag-phase8-signal {
    background: rgba(15, 23, 42, 0.58);
}
body[data-theme="dark"] .diag-time-row,
body[data-theme="dark"] .diag-answer-row {
    background: rgba(15, 23, 42, 0.58);
}
body[data-theme="dark"] .diag-answer-pill.final {
    color: #c4b5fd;
}
