/* schoolparity P1: results, disadvantage, destinations, trends, Ofsted card. Scoped to the CEC skin. Class prefix sp1-. */
body.ux.cec .sp1-card { min-width: 0; }
body.ux.cec .sp1-h3 { margin: 1.4rem 0 0.6rem; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-accent); }
body.ux.cec .sp1-note { margin: 0.6rem 0 0; }
body.ux.cec .sp1-sum { margin: 0.4rem 0 0.8rem; font-size: 1rem; color: var(--ux-ink); }
body.ux.cec .sp1-also { margin: 0 0 1rem; font-size: 0.86rem; color: var(--ux-muted); }
body.ux.cec .sp1-also a { font-weight: 700; }

/* KPI tiles: the demo's .cec-mini-kpis plus a reference line and a delta chip */
body.ux.cec .sp1-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
body.ux.cec .sp1-tiles .sp1-t { min-width: 0; }
body.ux.cec .sp1-t .n { overflow-wrap: anywhere; }
body.ux.cec .sp1-t .l { text-transform: uppercase; line-height: 1.3; }
body.ux.cec .sp1-chip { display: block; margin-top: 0.4rem; }
body.ux.cec .sp1-chip .kpi-delta { margin-right: 0; white-space: nowrap; }
body.ux.cec .sp1-ref { display: block; margin-top: 0.3rem; font-size: 0.75rem; line-height: 1.35; color: var(--ux-muted); font-weight: 500; }

/* Charts (HTML and CSS only) */
body.ux.cec .sp1-chart { margin: 0.6rem 0 0.4rem; }
body.ux.cec .sp1-key { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.74rem; color: var(--ux-muted); margin-bottom: 0.5rem; }
body.ux.cec .sp1-key i { display: inline-block; vertical-align: middle; margin-right: 0.35rem; }
body.ux.cec .sp1-key .ks { width: 12px; height: 12px; border-radius: 3px; background: var(--c-deep); }
body.ux.cec .sp1-key .ko { width: 12px; height: 12px; border-radius: 3px; background: var(--c-deep); opacity: .55; }
body.ux.cec .sp1-key .ke { width: 16px; height: 0; border-top: 2px solid var(--ux-ink); }
body.ux.cec .sp1-scroll { overflow-x: auto; scrollbar-width: thin; padding-bottom: 0.2rem; }
body.ux.cec .sp1-chart .cols { display: flex; align-items: stretch; gap: 0.5rem; border-bottom: 1px solid var(--c-line); min-width: min-content; }
body.ux.cec .sp1-chart .c { flex: 1 0 44px; display: flex; flex-direction: column; align-items: center; min-width: 44px; padding-bottom: 1.5rem; position: relative; }
body.ux.cec .sp1-chart .v { font-size: 0.72rem; font-weight: 700; color: var(--ux-ink); margin-bottom: 0.25rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
body.ux.cec .sp1-chart .plot { position: relative; width: 100%; height: 150px; display: flex; justify-content: center; }
body.ux.cec .sp1-chart.mini .plot { height: 92px; }
body.ux.cec .sp1-chart .plot .b { position: absolute; bottom: 0; width: 66%; max-width: 44px; background: var(--c-deep); opacity: .85; border-radius: 6px 6px 0 0; }
body.ux.cec .sp1-chart .c.hi .b { background: var(--c-accent); opacity: 1; }
body.ux.cec .sp1-chart .plot .e { position: absolute; left: 6%; right: 6%; height: 0; border-top: 2px solid var(--ux-ink); z-index: 2; }
body.ux.cec .sp1-chart .y { position: absolute; bottom: 0.15rem; font-size: 0.66rem; color: var(--ux-muted); white-space: nowrap; }
body.ux.cec .sp1-chart .c.na .plot { border: 1px dashed var(--c-line-strong); border-bottom: 0; border-radius: 6px 6px 0 0; opacity: .6; }
body.ux.cec .sp1-chart .c.na .v { color: var(--ux-muted); }
body.ux.cec .sp1-chart .nt { position: absolute; top: 40%; left: 50%; transform: translateX(-50%); font-size: 0.62rem; line-height: 1.2; text-align: center; color: var(--ux-muted); width: 60px; }
/* diverging */
body.ux.cec .sp1-chart .plot.dv .zero { position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--c-line-strong); }
body.ux.cec .sp1-chart .plot.dv .b.pos { bottom: 50%; border-radius: 6px 6px 0 0; }
body.ux.cec .sp1-chart .plot.dv .b.neg { bottom: auto; top: 50%; border-radius: 0 0 6px 6px; }
/* paired */
body.ux.cec .sp1-chart .c.pr { flex-basis: 78px; min-width: 78px; }
body.ux.cec .sp1-chart .c.pr .v { font-weight: 400; }
body.ux.cec .sp1-chart .c.pr .v b { color: var(--c-accent-ink); }
body.ux.cec .sp1-chart .c.pr .v em { font-style: normal; color: var(--ux-ink-2); }
body.ux.cec .sp1-chart .plot.two { gap: 4px; align-items: flex-end; }
body.ux.cec .sp1-chart .plot.two .b { position: static; width: 22px; max-width: none; align-self: flex-end; }
body.ux.cec .sp1-chart .plot.two .b.ad { background: var(--c-accent); opacity: 1; }
body.ux.cec .sp1-chart .plot.two .b.ot { background: var(--c-deep); opacity: .55; }
body.ux.cec .sp1-chart .plot.two .b.none { background: transparent; }

/* Tables with a sticky first column */
body.ux.cec .sp1-hint { display: none; margin: 0.4rem 0 0.3rem; font-size: 0.74rem; color: var(--ux-muted); }
body.ux.cec .sp1-tw { overflow-x: auto; margin: 0.8rem 0 0.4rem; border: 1px solid var(--c-line); border-radius: 12px; background: #fff; max-width: 100%; }
body.ux.cec .sp1-tw:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
body.ux.cec .sp1-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.86rem; }
body.ux.cec .sp1-table th, body.ux.cec .sp1-table td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top; background: #fff; }
body.ux.cec .sp1-table thead th { font-size: 0.66rem; font-weight: 900; letter-spacing: 0.07em; text-transform: uppercase; color: var(--c-accent); border-bottom: 1px solid var(--c-line-strong); white-space: normal; }
body.ux.cec .sp1-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.ux.cec .sp1-table thead th.num { white-space: normal; min-width: 5.2rem; }
body.ux.cec .sp1-table tbody tr:last-child th, body.ux.cec .sp1-table tbody tr:last-child td { border-bottom: 0; }
body.ux.cec .sp1-table th:first-child, body.ux.cec .sp1-table td:first-child { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--c-line); font-weight: 700; color: var(--ux-ink); min-width: 7.5rem; max-width: 14rem; }
body.ux.cec .sp1-table tbody th { font-size: 0.86rem; letter-spacing: 0; text-transform: none; color: var(--ux-ink); }
body.ux.cec .sp1-table tbody th:first-child { font-weight: 700; }
body.ux.cec .sp1-table tbody tr:hover th, body.ux.cec .sp1-table tbody tr:hover td { background: #fafaf8; }

/* Ofsted card */
body.ux.cec .sp1-of { display: flex; flex-direction: column; gap: 0.4rem; }
body.ux.cec .sp1-of .g { display: inline-block; align-self: flex-start; font-weight: 900; font-size: 1.05rem; padding: 0.35rem 0.9rem; border-radius: 999px; background: var(--c-pale); }
body.ux.cec .sp1-of .g1 { background: #e4f1e9; color: #0e5a38; } body.ux.cec .sp1-of .g2 { background: #e5edf6; color: #1b4c77; }
body.ux.cec .sp1-of .g3 { background: #faf0d3; color: #6f4e00; } body.ux.cec .sp1-of .g4 { background: #fbe7e5; color: #9a1b12; }
body.ux.cec .sp1-of .gnone { background: var(--c-pale); color: var(--ux-ink-2); }
body.ux.cec .sp1-last { margin: 0.6rem 0 0; font-size: 0.9rem; }
body.ux.cec .sp1-card .sp1-tw { margin-top: 0.7rem; }

/* Trends: small multiples */
body.ux.cec .sp1-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 980px) { body.ux.cec .sp1-grid { grid-template-columns: 1fr 1fr; } }
body.ux.cec .sp1-mm { border: 1px solid var(--c-line); border-radius: 14px; padding: 0.8rem 0.9rem 0.6rem; min-width: 0; background: #fff; }
body.ux.cec .sp1-mm .mh { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
body.ux.cec .sp1-mm .mt { font-weight: 700; font-size: 0.9rem; color: var(--ux-ink); }
body.ux.cec .sp1-mm .mv { font-size: 1.25rem; font-weight: 300; color: var(--c-deep); font-variant-numeric: tabular-nums; }
body.ux.cec .sp1-mm .mv small { font-size: 0.7rem; color: var(--ux-muted); }
body.ux.cec .sp1-mm .mu { display: block; font-size: 0.72rem; color: var(--ux-muted); margin-top: 0.1rem; }
body.ux.cec .sp1-mm .sp1-key { display: none; }
body.ux.cec .sp1-mm .sp1-chart { margin: 0.4rem 0 0.2rem; }
body.ux.cec .sp1-mm .sp1-chart .c { flex-basis: 36px; min-width: 36px; }
body.ux.cec .sp1-steps { margin: 0; padding-left: 1.1rem; font-size: 0.86rem; }
body.ux.cec .sp1-steps li { margin: 0 0 0.5rem; }

@media (max-width: 620px) {
  body.ux.cec .sp1-hint { display: block; }
  body.ux.cec .sp1-tiles { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  body.ux.cec .sp1-t .n { font-size: 1.45rem; }
  body.ux.cec .sp1-chart .plot { height: 120px; }
  body.ux.cec .sp1-table { font-size: 0.82rem; }
  body.ux.cec .sp1-table th:first-child, body.ux.cec .sp1-table td:first-child { min-width: 6.2rem; max-width: 8rem; }
}

/* verify V (15 Oct 2026): on phones, charts open at the latest year (right end) and year labels no longer clip or collide */
@media (max-width: 620px) {
  body.ux.cec .sp1-scroll { direction: rtl; }
  body.ux.cec .sp1-scroll > .cols { direction: ltr; }
  body.ux.cec .sp1-mm .sp1-chart .c { flex-basis: 48px; min-width: 48px; }
}
