/* Phase 4: student-only, responsive individual learning analytics. */
.sp-insights{margin-top:24px;padding:18px;background:#fff;border:1px solid #fbcfe8;border-radius:26px;box-shadow:0 8px 26px rgba(153,27,72,.04);color:#334155;min-width:0}
.sp-insights *{box-sizing:border-box;min-width:0}
.sp-insights-header,.sp-insights-panel-heading,.sp-insights-subject-heading,.sp-insights-unit-line,.sp-insights-unit-header{display:flex;align-items:center;justify-content:space-between;gap:12px}
.sp-insights-header{align-items:flex-start;flex-wrap:wrap;margin-bottom:17px}
.sp-insights-kicker{color:#be185d;font-weight:900;letter-spacing:.14em;font-size:10px}
.sp-insights h3{font-size:clamp(1.24rem,3.8vw,1.65rem);font-weight:900;color:#881337;line-height:1.3;margin:4px 0 3px}
.sp-insights h4{font-size:1rem;font-weight:900;color:#334155;margin:0}
.sp-insights-header p,.sp-insights-unit-header p{font-weight:600;color:#64748b;font-size:12px;line-height:1.55;margin:4px 0 0}
.sp-insights button,.sp-insights select{font:inherit;cursor:pointer}
.sp-insights button:focus-visible,.sp-insights select:focus-visible{outline:3px solid #0f766e;outline-offset:3px}
.sp-insights-outline{border:1px solid #f9a8d4;border-radius:12px;background:#fff1f2;color:#9d174d;padding:10px 13px;font-size:12px;font-weight:800;min-height:42px}
.sp-insights-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.sp-insights-stat{display:flex;flex-direction:column;gap:4px;border-radius:17px;padding:13px;border:1px solid #e2e8f0;min-height:130px}
.sp-insights-stat--rose{background:#fff1f2;border-color:#fecdd3}.sp-insights-stat--green{background:#ecfdf5;border-color:#a7f3d0}.sp-insights-stat--amber{background:#fffbeb;border-color:#fde68a}.sp-insights-stat--blue{background:#eff6ff;border-color:#bfdbfe}
.sp-insights-stat-icon{font-size:19px}.sp-insights-stat-label{font-size:11px;font-weight:800;color:#475569;line-height:1.35}
.sp-insights-stat-value{font-size:clamp(1.6rem,5vw,2.2rem);font-weight:900;line-height:1.2;color:#0f172a;font-variant-numeric:tabular-nums}
.sp-insights-stat-detail{font-size:10px;color:#475569;font-weight:700;line-height:1.4;overflow-wrap:anywhere}
.sp-insights-columns{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;margin-top:16px}
.sp-insights-panel{border:1px solid #e2e8f0;border-radius:19px;padding:15px;background:#fff;min-width:0}
.sp-insights-panel-heading{align-items:flex-start;flex-wrap:wrap;padding-bottom:12px;border-bottom:1px solid #f1f5f9;margin-bottom:7px}
.sp-insights-panel-heading small{font-size:10px;font-weight:700;color:#64748b}
.sp-insights-subject{padding:13px 0;border-bottom:1px solid #f1f5f9}.sp-insights-subject:last-child{border-bottom:none;padding-bottom:0}
.sp-insights-subject-heading{align-items:flex-end}.sp-insights-subject-name{display:flex;flex-direction:column;gap:1px}.sp-insights-subject-name strong{font-size:13px;font-weight:900;line-height:1.35;overflow-wrap:anywhere}.sp-insights-subject-name small{font-size:10px;font-weight:800;color:#64748b}
.sp-insights-percent,.sp-insights-unit-line b{color:#0f766e;font-weight:900;font-size:17px;white-space:nowrap}
.sp-insights-track{height:11px;background:#e2e8f0;border-radius:99px;overflow:hidden;margin-top:9px}
.sp-insights-fill{display:block;height:100%;background:linear-gradient(90deg,#14b8a6,#0f766e);border-radius:inherit;transition:width .2s ease}
.sp-insights-progress-empty{font-size:11px;font-weight:700;color:#94a3b8;margin-top:7px}
.sp-insights-meta,.sp-insights-attendance{display:flex;gap:7px 12px;align-items:center;flex-wrap:wrap;font-size:11px;color:#64748b;font-weight:700;margin-top:8px}
.sp-insights-attendance{background:#f8fafc;border-radius:9px;padding:8px;color:#334155;gap:7px}
.sp-insights-attention{color:#9a3412;background:#ffedd5;border-radius:6px;padding:2px 5px;font-size:10px}
.sp-insights-advice{display:flex;flex-direction:column;gap:9px;margin-top:13px}
.sp-insights-advice-item{border:1px solid #e2e8f0;background:#f8fafc;border-radius:12px;padding:13px 10px;display:flex;gap:9px;align-items:center;text-align:left;width:100%;color:#334155;font-size:12px;line-height:1.65;font-weight:700;min-height:56px}
.sp-insights-advice-item:hover{border-color:#f9a8d4;background:#fff7fa}
.sp-insights-advice-icon{font-size:18px;flex:0 0 auto}.sp-insights-advice-arrow{margin-left:auto;color:#be185d;font-size:24px;font-weight:900}
.sp-insights-note{background:#fff7ed;color:#92400e;border-radius:12px;padding:12px;margin-top:16px;line-height:1.55;font-size:11px;font-weight:700}
.sp-insights-unit-panel{margin-top:14px;background:#fdfdff}.sp-insights-unit-header{align-items:flex-start;flex-wrap:wrap;padding-bottom:12px;border-bottom:1px solid #e2e8f0}
.sp-insights-unit-header select{max-width:100%;padding:10px 12px;border-radius:11px;background:#fff;border:1px solid #cbd5e1;color:#334155;font-size:12px;font-weight:800;min-height:42px}
.sp-insights-unit-header select:disabled{cursor:default;opacity:.6}
.sp-insights-units{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;padding-top:13px}
.sp-insights-unit{background:#fff;padding:12px;border:1px solid #e2e8f0;border-radius:13px;min-width:0}
.sp-insights-unit-line{align-items:flex-start}.sp-insights-unit-line strong{font-size:12px;font-weight:800;overflow-wrap:anywhere}
.sp-insights-unit small{display:block;font-size:10px;font-weight:700;color:#64748b;margin-top:8px;line-height:1.5}
.sp-insights-text-link{display:inline-block;margin-top:15px;color:#9d174d;font-size:12px;font-weight:900;border:none;background:transparent;padding:10px 2px;min-height:42px;text-align:left}
.sp-insights-disclaimer{font-size:11px;font-weight:600;line-height:1.65;color:#64748b;margin:14px 3px 0}
.sp-insights-empty{padding:18px 8px;text-align:center;color:#64748b;font-size:12px;font-weight:700}
@media(min-width:680px){.sp-insights{padding:24px}.sp-insights-stats{grid-template-columns:repeat(4,minmax(0,1fr))}.sp-insights-stat{min-height:139px}.sp-insights-units{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:1024px){.sp-insights-columns{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr)}}
@media(max-width:380px){.sp-insights{padding:13px;border-radius:18px}.sp-insights-panel{padding:12px}.sp-insights-stat{padding:10px}.sp-insights-stat-label{font-size:10px}}
@media(prefers-reduced-motion:reduce){.sp-insights-fill{transition:none}}
