/* School tabs P2 (attendance, behaviour, inclusion, admissions, staff, finance, trust). Prefix sp2-. 15 Oct 2026 */
body.ux.cec .sp2-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 0.8rem; margin-bottom: 0.8rem; }
body.ux.cec .sp2-kpi { background: var(--c-pale); border-radius: 12px; padding: 0.8rem 0.9rem; min-width: 0; }
body.ux.cec .sp2-kpi .n { display: block; font-size: 1.7rem; font-weight: 300; color: var(--c-deep); line-height: 1.1; overflow-wrap: anywhere; }
body.ux.cec .sp2-kpi .l { display: block; font-size: 0.66rem; font-weight: 900; letter-spacing: 0.07em; text-transform: uppercase; color: var(--c-accent); margin-top: 0.25rem; }
body.ux.cec .sp2-kpi .e { display: block; font-size: 0.75rem; color: var(--ux-muted); margin-top: 0.2rem; line-height: 1.3; }
body.ux.cec .sp2-kpi .sp2-chip { margin: 0.4rem 0 0; }
body.ux.cec .sp2-src { margin-top: 0.8rem; }
body.ux.cec .sp2-trustline { font-size: 1.2rem; margin: 0 0 0.4rem; }
body.ux.cec .sp2-list { margin: 0; padding-left: 1.1rem; }
body.ux.cec .sp2-list li { margin: 0.35rem 0; line-height: 1.45; }
body.ux.cec .sp2-def dt { font-weight: 900; margin-top: 0.6rem; }
body.ux.cec .sp2-def dd { margin: 0.1rem 0 0; color: var(--ux-ink-2); line-height: 1.45; }
body.ux.cec .sp2-indent { padding-left: 1rem; color: var(--ux-muted); font-weight: 400; }

/* tables: sticky first column, own class (not .cec-table, which hides columns on phones) */
body.ux.cec .sp2-scrollhint { display: none; font-size: 0.74rem; color: var(--ux-muted); margin: 0.2rem 0 0.3rem; }
body.ux.cec .sp2-tablewrap { overflow-x: auto; max-width: 100%; margin: 0.6rem 0 0.2rem; -webkit-overflow-scrolling: touch; }
body.ux.cec .sp2-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
body.ux.cec .sp2-table th, body.ux.cec .sp2-table td { padding: 0.6rem 0.75rem; text-align: left; vertical-align: top; border-top: 1px solid var(--c-line); background: #fff; }
body.ux.cec .sp2-table thead th { font-size: 0.66rem; font-weight: 900; letter-spacing: 0.07em; text-transform: uppercase; color: var(--c-accent); border-top: 0; border-bottom: 1px solid var(--c-line-strong); white-space: normal; vertical-align: bottom; line-height: 1.25; }
body.ux.cec .sp2-table tbody th { font-size: 0.88rem; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--ux-ink); }
body.ux.cec .sp2-table th:first-child, body.ux.cec .sp2-table td:first-child { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--c-line); min-width: 8.2rem; max-width: 15rem; padding-left: 0.5rem; }
body.ux.cec .sp2-table thead th:first-child { z-index: 2; }
body.ux.cec .sp2-table .num { text-align: right; white-space: nowrap; }
body.ux.cec .sp2-table td:not(.num) { white-space: normal; min-width: 6.5rem; }
body.ux.cec .sp2-table td.wide, body.ux.cec .sp2-table th.wide { min-width: 15rem; }
body.ux.cec .sp2-table tr:hover td, body.ux.cec .sp2-table tr:hover th { background: #fafaf9; }
body.ux.cec .sp2-table tr.tot th, body.ux.cec .sp2-table tr.tot td { font-weight: 900; background: var(--c-pale); }

/* school vs England columns */
body.ux.cec .sp2-cc { margin: 0.6rem 0 0.4rem; }
body.ux.cec .sp2-leg { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.74rem; color: var(--ux-muted); margin-bottom: 0.4rem; }
body.ux.cec .sp2-leg .k { display: inline-block; vertical-align: middle; margin-right: 0.35rem; }
body.ux.cec .sp2-leg .k.s { width: 0.8rem; height: 0.8rem; background: var(--c-deep); border-radius: 3px; }
body.ux.cec .sp2-leg .k.e { width: 1.1rem; height: 0; border-top: 2px solid var(--c-accent); }
body.ux.cec .sp2-ccols { display: flex; align-items: flex-end; gap: 0.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--c-line); }
body.ux.cec .sp2-ccols .c { flex: 1 1 0; min-width: 0; position: relative; }
body.ux.cec .sp2-ccols .plot { position: relative; height: 160px; }
body.ux.cec .sp2-ccols .bar { position: absolute; left: 50%; bottom: 0; width: 70%; max-width: 44px; transform: translateX(-50%); background: var(--c-deep); border-radius: 6px 6px 0 0; opacity: 0.85; }
body.ux.cec .sp2-ccols .c:last-child .bar { background: var(--c-accent); opacity: 1; }
body.ux.cec .sp2-ccols .eng { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--c-accent); pointer-events: auto; }
body.ux.cec .sp2-ccols .c:last-child .eng { }
body.ux.cec .sp2-ccols .v { position: absolute; left: 0; right: 0; text-align: center; font-size: 0.68rem; font-weight: 700; color: var(--ux-ink); white-space: nowrap; }
body.ux.cec .sp2-ccols .y { position: absolute; bottom: -1.35rem; left: 0; right: 0; text-align: center; font-size: 0.64rem; color: var(--ux-muted); white-space: nowrap; }
body.ux.cec .sp2-ccols .nd { position: absolute; left: 0; right: 0; bottom: 0.1rem; text-align: center; font-size: 0.6rem; color: var(--ux-muted); }
body.ux.cec .sp2-cc h3, body.ux.cec .sp2-cc + h3 { margin-top: 1rem; }

@media (max-width: 620px) {
  body.ux.cec .sp2-scrollhint { display: block; }
  body.ux.cec .sp2-kpis { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  body.ux.cec .sp2-kpi { padding: 0.7rem 0.75rem; }
  body.ux.cec .sp2-kpi .n { font-size: 1.45rem; }
  body.ux.cec .sp2-ccols { gap: 0.25rem; }
  body.ux.cec .sp2-ccols .v { font-size: 0.58rem; }
  body.ux.cec .sp2-ccols .y { font-size: 0.54rem; letter-spacing: -0.02em; }
  body.ux.cec .sp2-ccols .plot { height: 140px; }
  body.ux.cec .sp2-table th:first-child, body.ux.cec .sp2-table td:first-child { min-width: 6.8rem; max-width: 8.5rem; }
  body.ux.cec .sp2-table td:not(.num) { min-width: 9rem; }
}
