/* PracticePilot — AI Preparation Dashboard (Phase 7), mounted into the
   EXISTING [practicepilot_dashboard] page as a separate, self-contained
   section below the Student Dashboard 2.0 module. Strongly scoped under
   .ppilot-prep-*; reuses the SAME --ppilot-* color tokens as
   admin/ppilot-shared.css / student-dashboard.css — no new color system
   invented. Mobile-first discipline: no fixed widths beyond the host
   container, cards stack to a single column before anything can overflow
   horizontally, buttons stay >=44px tall as touch targets. */

.ppilot-prep-wrap {
	max-width: 1080px; width: 100%; margin: 28px auto 0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: var(--ppilot-ink);
}
.ppilot-prep-wrap, .ppilot-prep-wrap * { box-sizing: border-box; min-width: 0; }

.ppilot-prep-heading {
	font-size: 20px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.01em; color: var(--ppilot-navy);
}
.ppilot-prep-subheading { font-size: 13px; color: var(--ppilot-muted); margin: 0 0 18px; }

.ppilot-prep-loading, .ppilot-prep-error, .ppilot-prep-onboarding {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
	padding: 40px 20px; text-align: center; background: #fff;
	border: 1px solid var(--ppilot-border); border-radius: 20px; margin-bottom: 20px;
}

.ppilot-prep-exam-banner {
	display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
	background: var(--ppilot-bg); border: 1px solid var(--ppilot-border); border-radius: 14px;
	padding: 12px 16px; margin-bottom: 18px; font-size: 13px;
}

/* --- Snapshot KPI strip ---------------------------------------------- */
.ppilot-prep-kpi-strip {
	display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px;
}
.ppilot-prep-kpi {
	background: #fff; border: 1px solid var(--ppilot-border); border-radius: 16px;
	padding: 14px 10px; text-align: center; box-shadow: 0 1px 2px rgba(30, 27, 75, 0.04);
}
.ppilot-prep-kpi-value { display: block; font-size: 19px; font-weight: 800; line-height: 1.15; }
.ppilot-prep-kpi-label { display: block; font-size: 11px; color: var(--ppilot-muted); margin-top: 4px; }

/* --- Readiness card ---------------------------------------------------- */
.ppilot-prep-readiness-card {
	background: linear-gradient(135deg, var(--ppilot-navy) 0%, var(--ppilot-navy-light) 100%);
	border-radius: 20px; padding: 22px; margin-bottom: 20px; color: #fff;
}
.ppilot-prep-readiness-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ppilot-prep-readiness-score { font-size: 40px; font-weight: 800; line-height: 1; }
.ppilot-prep-readiness-max { font-size: 16px; opacity: 0.8; }
.ppilot-prep-readiness-level { font-size: 14px; font-weight: 700; margin-top: 4px; }
.ppilot-prep-readiness-disclaimer { font-size: 11px; opacity: 0.85; margin-top: 10px; line-height: 1.5; }
.ppilot-prep-readiness-breakdown { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.ppilot-prep-readiness-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.ppilot-prep-readiness-row-label { width: 110px; flex-shrink: 0; opacity: 0.9; }
.ppilot-prep-readiness-bar-track { flex: 1; height: 6px; background: rgba(255,255,255,0.25); border-radius: 4px; overflow: hidden; }
.ppilot-prep-readiness-bar-fill { height: 100%; background: #fff; border-radius: 4px; }
.ppilot-prep-readiness-row-value { width: 32px; text-align: right; flex-shrink: 0; font-weight: 700; }

/* --- Generic section card ---------------------------------------------- */
.ppilot-prep-card {
	background: #fff; border: 1px solid var(--ppilot-border); border-radius: 18px;
	padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(30, 27, 75, 0.04);
}
.ppilot-prep-card-title { font-size: 14px; font-weight: 700; margin: 0 0 10px; color: var(--ppilot-navy); }
.ppilot-prep-card-cta {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 44px; padding: 0 18px; margin-top: 10px; text-decoration: none; width: 100%;
}

/* --- Subject / topic performance table-as-cards ------------------------ */
.ppilot-prep-perf-row {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	padding: 10px 0; border-bottom: 1px solid var(--ppilot-border); font-size: 12px; flex-wrap: wrap;
}
.ppilot-prep-perf-row:last-child { border-bottom: none; }
.ppilot-prep-perf-name { font-weight: 600; flex: 1 1 140px; min-width: 0; }
.ppilot-prep-perf-accuracy { font-weight: 700; }
.ppilot-prep-status { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; }
.ppilot-prep-status-needs_practice { background: rgba(220, 38, 38, 0.12); color: var(--ppilot-danger); }
.ppilot-prep-status-developing { background: rgba(217, 119, 6, 0.14); color: #a15c00; }
.ppilot-prep-status-strong { background: rgba(5, 150, 105, 0.12); color: var(--ppilot-success); }
.ppilot-prep-status-insufficient_data { background: var(--ppilot-bg); color: var(--ppilot-muted); }

/* --- Trend chart (inline SVG, no chart library dependency) ------------- */
.ppilot-prep-trend-chart { width: 100%; height: 72px; display: block; }

/* --- Recommendations ----------------------------------------------------- */
.ppilot-prep-rec-item { padding: 12px 0; border-bottom: 1px solid var(--ppilot-border); }
.ppilot-prep-rec-item:last-child { border-bottom: none; }
.ppilot-prep-rec-title { font-size: 13px; font-weight: 700; margin: 0 0 2px; }
.ppilot-prep-rec-reason { font-size: 12px; color: var(--ppilot-muted); margin: 0 0 6px; }
.ppilot-prep-rec-link { font-size: 12px; font-weight: 700; text-decoration: none; }

/* --- Continue preparation hero ------------------------------------------- */
.ppilot-prep-continue-card { display: flex; flex-direction: column; gap: 6px; }
.ppilot-prep-continue-title { font-size: 16px; font-weight: 800; margin: 0; }
.ppilot-prep-continue-reason { font-size: 12px; color: var(--ppilot-muted); margin: 0 0 6px; }

/* --- Daily target progress bar ------------------------------------------- */
.ppilot-prep-daily-bar-track { height: 10px; background: var(--ppilot-bg); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.ppilot-prep-daily-bar-fill { height: 100%; background: var(--ppilot-success); border-radius: 6px; }

.ppilot-prep-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ppilot-muted { color: var(--ppilot-muted); font-size: 13px; }

@media ( max-width: 900px ) {
	.ppilot-prep-kpi-strip { grid-template-columns: repeat(2, 1fr); }
	.ppilot-prep-grid { grid-template-columns: 1fr; }
}
@media ( max-width: 480px ) {
	.ppilot-prep-wrap { margin-top: 20px; }
	.ppilot-prep-kpi-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
	.ppilot-prep-readiness-score { font-size: 32px; }
	.ppilot-prep-card { padding: 14px 14px; }
	.ppilot-prep-readiness-row-label { width: 86px; font-size: 11px; }
}
