/* ═══════════════════════════════════════════════
   DL Plus home page
   Colours are taken straight from the DL logo.
   ═══════════════════════════════════════════════ */
:root {
    --navy:   #1f2d5c;
    --navy-2: #16214a;
    --orange: #f7941d;
    --blue:   #1b75bc;
    --green:  #8dc63f;
    --red:    #ed1c24;
    --ink:    #1f2d5c;
    --text:   #3d4766;
    --muted:  #6b7390;
    --line:   #e3e7f0;
    --bg:     #ffffff;
    --tint:   #f3f6fb;
    --radius: 14px;
    --font: 'Lexend', 'Segoe UI', Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
    margin: 0;
    font-family: var(--font);
    font-weight: 300;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .6em; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }

/* ─────────── Header ─────────── */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.94);
    backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s, box-shadow .2s;
}
.site-header.scrolled { border-color: var(--line); box-shadow: 0 6px 24px rgba(31,45,92,.06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 84px; }
.brand img { height: 62px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 30px; }
.site-nav a {
    color: var(--ink); text-decoration: none; font-weight: 400; font-size: .97rem;
    position: relative;
}
.site-nav a:not(.nav-login)::after {
    content: ''; position: absolute; left: 0; right: 100%; bottom: -6px; height: 2px;
    background: var(--orange); transition: right .2s;
}
.site-nav a:not(.nav-login):hover::after { right: 0; }
.nav-login {
    position: relative;
    background: var(--navy); color: #fff !important;
    padding: 10px 22px; border-radius: 999px; font-weight: 500 !important;
    transition: background .2s;
}
.nav-login:hover { background: var(--blue); }

.menu-toggle {
    display: none; width: 44px; height: 44px; border: 0; background: transparent;
    cursor: pointer; padding: 10px; flex-direction: column; justify-content: center; gap: 5px;
}
.menu-toggle span { display: block; height: 2px; background: var(--navy); border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─────────── Buttons ─────────── */
.btn {
    position: relative;
    display: inline-flex; align-items: center; gap: 10px;
    padding: 15px 28px; border-radius: 999px;
    font-family: inherit; font-size: 1rem; font-weight: 500;
    text-decoration: none; cursor: pointer; border: 2px solid transparent;
    transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { transform: translateY(-1px); }
.btn-solid   { background: var(--orange); color: var(--navy-2); }
.btn-solid:hover { background: #ffa53a; }
.btn-outline { border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-light   { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--tint); }
.btn-ghost-light { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); border-color: #fff; }

.btn-content { display: inline-flex; align-items: center; gap: 10px; }
.spinner {
    display: none; position: absolute; top: 50%; left: 50%;
    width: 22px; height: 22px; margin: -11px 0 0 -11px;
    border: 3px solid currentColor; border-right-color: transparent;
    border-radius: 50%; animation: spin .8s linear infinite;
}
.loading { pointer-events: none; }
.loading .btn-content { visibility: hidden; }
.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.text-link { font-weight: 500; text-decoration: none; color: var(--blue); }
.text-link::after { content: ' \2192'; }
.text-link:hover { text-decoration: underline; }

/* ─────────── Hero ─────────── */
.hero {
    padding: 64px 0 56px;
    background:
        radial-gradient(900px 500px at 85% 20%, rgba(27,117,188,.08), transparent 60%),
        radial-gradient(700px 400px at 10% 90%, rgba(247,148,29,.08), transparent 60%);
    overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero-tag { font-size: .9rem; font-weight: 500; color: var(--blue); margin-bottom: 18px; }
.hero h1 {
    font-size: clamp(2.3rem, 4.6vw, 3.9rem);
    font-weight: 700; letter-spacing: -.02em; line-height: 1.08;
    margin-bottom: 22px; max-width: 14ch;
}
.hero-lead { font-size: 1.15rem; max-width: 52ch; color: var(--text); margin-bottom: 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-art { position: relative; }
.pinwheel { width: 100%; height: auto; overflow: visible; }
.tri { stroke-width: 26; stroke-linejoin: round; }
.t-orange { fill: var(--orange); stroke: var(--orange); }
.t-blue   { fill: var(--blue);   stroke: var(--blue); }
.t-green  { fill: var(--green);  stroke: var(--green); }
.t-red    { fill: var(--red);    stroke: var(--red); }

/* one orchestrated entrance: the four pieces come together */
.tri { animation: gather .9s cubic-bezier(.2,.8,.2,1) both; }
.t-orange { --dx: -40px; --dy: -40px; animation-delay: .05s; }
.t-blue   { --dx:  40px; --dy: -40px; animation-delay: .15s; }
.t-green  { --dx: -40px; --dy:  40px; animation-delay: .25s; }
.t-red    { --dx:  40px; --dy:  40px; animation-delay: .35s; }
@keyframes gather {
    from { opacity: 0; transform: translate(var(--dx), var(--dy)); }
    to   { opacity: 1; transform: translate(0, 0); }
}

.hero-badge {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    background: #fff; border-radius: 18px; padding: 18px 24px; text-align: center;
    box-shadow: 0 18px 40px rgba(31,45,92,.18);
    animation: pop .5s .9s both;
}
.hero-badge strong { display: block; font-size: 1.6rem; color: var(--navy); font-weight: 700; line-height: 1.1; }
.hero-badge span { white-space: nowrap; font-size: .85rem; color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -40%); } to { opacity: 1; transform: translate(-50%, -50%); } }

.reach {
    list-style: none; margin: 56px 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
}
.reach li { padding: 22px 20px 0 0; border-top: 4px solid; margin-top: -2px; }
.reach strong { display: block; font-size: 1.75rem; font-weight: 600; color: var(--navy); line-height: 1.2; }
.reach span { font-size: .95rem; color: var(--muted); }
.r-orange { border-color: var(--orange) !important; }
.r-blue   { border-color: var(--blue) !important; }
.r-green  { border-color: var(--green) !important; }
.r-red    { border-color: var(--red) !important; }
.reach li + li { margin-left: 16px; }

/* ─────────── Sections ─────────── */
.section { padding: 88px 0; }
.section-tint { background: var(--tint); }
.section h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -.01em; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--muted); }

/* Notices */
.notices { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.notice {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 30px 32px; background: #fff;
}
.notice-urgent { border-left: 6px solid var(--red); }
.notice-label {
    display: inline-block; font-size: .8rem; font-weight: 500;
    padding: 4px 12px; border-radius: 999px;
    background: var(--tint); color: var(--navy); margin-bottom: 14px;
}
.notice-urgent .notice-label { background: rgba(237,28,36,.1); color: #b3141a; }
.notice h3 { font-size: 1.3rem; }
.notice p { color: var(--text); }

/* Data submission */
.split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: start; }
.submit-list { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.submit-list li { display: flex; align-items: center; gap: 18px; padding: 20px 26px; }
.submit-list li + li { border-top: 1px solid var(--line); }
.submit-list strong { display: block; color: var(--ink); font-weight: 500; }
.submit-list span { font-size: .93rem; color: var(--muted); }
.dot { flex: none; width: 14px; height: 14px; border-radius: 3px; transform: rotate(45deg); }
.d-orange { background: var(--orange); }
.d-blue   { background: var(--blue); }
.d-green  { background: var(--green); }
.d-red    { background: var(--red); }
.d-navy   { background: var(--navy); }

/* Support */
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.support-card { padding: 34px; border-radius: var(--radius); background: var(--tint); }
.support-card .icon {
    width: 46px; height: 46px; padding: 10px; border-radius: 12px;
    background: #fff; stroke: var(--blue); fill: none; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round; margin-bottom: 18px;
}
.support-card h3 { font-size: 1.25rem; }

/* Install band */
.install { background: var(--navy); color: #d7ddf0; padding: 64px 0; position: relative; overflow: hidden; }
.install::before {   /* echo of the pinwheel in the corner */
    content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
    background: var(--blue); opacity: .25; clip-path: polygon(0 0, 100% 0, 100% 100%); border-radius: 24px;
}
.install-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; position: relative; }
.install h2 { color: #fff; font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin-bottom: .3em; }
.install p { margin: 0; }
.install-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ─────────── Footer ─────────── */
.site-footer { background: var(--navy-2); color: #aeb6d3; padding: 64px 0 28px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand img { height: 60px; width: auto; margin-bottom: 18px; }
.footer-brand p { max-width: 34ch; }
.site-footer h4 { color: #fff; font-size: 1rem; font-weight: 500; margin-bottom: 14px; }
.site-footer a { display: block; color: #aeb6d3; text-decoration: none; padding: 4px 0; }
.site-footer a:hover { color: #fff; }
.footer-base { margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1); font-size: .87rem; }

/* ─────────── Responsive ─────────── */
@media (max-width: 960px) {
    .hero-grid, .split { grid-template-columns: 1fr; gap: 36px; }
    .hero-art { max-width: 420px; margin: 0 auto; }
    .hero h1 { max-width: none; }
    .reach { grid-template-columns: 1fr; row-gap: 22px; border-top: 0; }
    .reach li + li { margin-left: 0; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
    .menu-toggle { display: flex; }
    .site-nav {
        position: absolute; top: 84px; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: #fff; border-bottom: 1px solid var(--line);
        padding: 8px 24px 20px;
        box-shadow: 0 16px 30px rgba(31,45,92,.08);
        display: none;
    }
    .site-nav.open { display: flex; }
    .site-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
    .site-nav a::after { display: none; }
    .nav-login { margin-top: 14px; text-align: center; border-bottom: 0 !important; justify-content: center; display: flex; }
    .notices, .support-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .header-inner { height: 72px; }
    .brand img { height: 42px; }
    .site-nav { top: 72px; }
    .hero { padding-top: 40px; }
    .hero-art { max-width: 300px; }
    .reach { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .reach li + li { margin-left: 0; }
    .reach strong { font-size: 1.15rem; }
    .reach span { font-size: .8rem; }
    .hero-actions .btn { flex: 1 1 100%; justify-content: center; }
    .section { padding: 64px 0; }
    .notice, .support-card { padding: 24px; }
    .submit-list li { padding: 16px 18px; }
    .install-actions .btn { flex: 1 1 100%; justify-content: center; }
    .footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}

/* ═══════════════════════════════════════════════
   Learner progression (home chart + full table)
   Literacy = blue, Numeracy = orange
   ═══════════════════════════════════════════════ */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.progression { background: var(--tint); }
.prog-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.prog-head .section-head { margin-bottom: 0; }

.prog-term label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.prog-term select {
    font: inherit; font-size: .95rem; color: var(--ink);
    padding: 10px 40px 10px 14px; min-width: 220px;
    border: 1px solid var(--line); border-radius: 10px; background: #fff;
    appearance: none; -webkit-appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f2d5c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.prog-term select:disabled { cursor: default; opacity: 1; }

.prog-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.nat { background: #fff; border-radius: var(--radius); padding: 18px 22px; border: 1px solid var(--line); }
.nat span { display: block; font-size: .9rem; color: var(--muted); }
.nat strong { display: block; font-size: 2rem; font-weight: 600; color: var(--navy); line-height: 1.2; }
.nat-lit { border-top: 4px solid var(--blue); }
.nat-num { border-top: 4px solid var(--orange); }
.nat-learners { border-top: 4px solid var(--navy); }

.prog-legend { display: flex; gap: 22px; font-size: .9rem; margin-bottom: 14px; color: var(--text); }
.key::before { content: ''; display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: 1px; }
.key-lit::before { background: var(--blue); }
.key-num::before { background: var(--orange); }

#prog-chart { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 10px 26px; }
.prog-status { color: var(--muted); padding: 24px 0; margin: 0; text-align: center; }
.prog-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 48px; }
.prog-row {
    break-inside: avoid; display: grid; grid-template-columns: 160px 1fr; gap: 16px; align-items: center;
    padding: 12px 0; border-bottom: 1px solid var(--line);
}
.prog-region { color: var(--ink); font-weight: 400; font-size: .97rem; display: flex; align-items: center; gap: 10px; }
.prog-rank { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--tint); color: var(--muted); font-size: .75rem; display: grid; place-items: center; font-weight: 500; }
.prog-bars { display: grid; gap: 5px; }
.bar { position: relative; height: 14px; display: flex; align-items: center; }
.bar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; transition: width .7s cubic-bezier(.2,.8,.2,1); }
.bar-lit .bar-fill { background: var(--blue); }
.bar-num .bar-fill { background: var(--orange); }
.bar-value { font-style: normal; font-size: .8rem; font-weight: 500; color: var(--ink); margin-left: 8px; white-space: nowrap; }

.prog-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-top: 24px; flex-wrap: wrap; }
.lpr-note { max-width: 640px; color: var(--muted); font-size: .93rem; }
.lpr-note summary { cursor: pointer; color: var(--blue); font-weight: 400; }
.lpr-note p { margin: 10px 0 0; }


/* Full table page */
.page-head { padding: 48px 0 24px; }
.page-head h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); letter-spacing: -.01em; margin-bottom: 10px; }
.page-head .muted { max-width: 70ch; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--blue); text-decoration: none; font-size: .95rem; }
.back-link::before { content: '\2190  '; }
.table-controls { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-top: 24px; }
.filter-group { display: inline-flex; background: var(--tint); border-radius: 999px; padding: 4px; }
.filter-group button {
    font: inherit; font-size: .93rem; border: 0; background: transparent; color: var(--text);
    padding: 8px 18px; border-radius: 999px; cursor: pointer;
}
.filter-group button[aria-pressed="true"] { background: var(--navy); color: #fff; }

.table-section { padding: 8px 0 80px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.lpr-table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 1000px; }
.lpr-table th, .lpr-table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lpr-table thead th { position: sticky; top: 0; background: #fff; font-weight: 500; color: var(--ink); font-size: .85rem; }
.lpr-table .group-row th { font-size: .78rem; text-align: center; padding: 8px; }
.lpr-table th button {
    font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
}
.lpr-table th button::after { content: '\2195'; opacity: .3; font-size: .8em; }
.lpr-table th[aria-sort="ascending"] button::after  { content: '\2191'; opacity: 1; }
.lpr-table th[aria-sort="descending"] button::after { content: '\2193'; opacity: 1; }

.lpr-table th.g-up   { background: #00a64f; color: #fff; }
.lpr-table th.g-down { background: #ed1c24; color: #fff; }
.lpr-table th.g-stay { background: #ffb800; color: #3b2a00; }
.lpr-table th.g-prof { background: #0d6efd; color: #fff; }

.lpr-table td.g-up   { background: #c9ecd5; color: #0d4d24; }
.lpr-table td.g-down { background: #fbd0d2; color: #7a0e12; }
.lpr-table td.g-stay { background: #ffe8a8; color: #4d3800; }
.lpr-table td.g-prof { background: #cfe2ff; color: #084298; }

.c-num { text-align: right !important; font-variant-numeric: tabular-nums; }
.c-sn { color: var(--muted); width: 40px; }
.c-region { color: var(--ink); font-weight: 500; position: sticky; left: 0; background: #fff; z-index: 1; }
thead .c-region { z-index: 2; }
.c-total { font-weight: 500; color: var(--ink); }
.lpr-pill {
    display: inline-block; min-width: 52px; text-align: center;
    background: var(--navy); color: #fff; font-weight: 500; font-size: .85rem;
    padding: 4px 10px; border-radius: 999px;
}
.row-total td { font-weight: 600; color: var(--ink); background: var(--tint) !important; border-top: 2px solid var(--line); }
.row-total .c-region { background: var(--tint); }
#table-status[hidden] { display: none; }
.table-section .lpr-note { margin-top: 20px; }

@media (max-width: 960px) {
    .prog-list { columns: 1; }
}
@media (max-width: 640px) {
    .prog-summary { grid-template-columns: 1fr 1fr; }
    .nat-learners { grid-column: 1 / -1; }
    .nat strong { font-size: 1.6rem; }
    #prog-chart { padding: 6px 16px; }
    .prog-row { grid-template-columns: 112px 1fr; gap: 10px; }
    .prog-region { font-size: .88rem; gap: 6px; }
    .prog-rank { display: none; }
    .nat span { font-size: .8rem; }
    .prog-term, .prog-term select { width: 100%; }
    .prog-foot .btn { width: 100%; justify-content: center; }
}
.lpr-table th.g-up, .lpr-table th.g-down, .lpr-table th.g-stay, .lpr-table th[data-sort="total"] { text-align: right; }
.lpr-table .group-row th { text-align: center !important; }
.lpr-table th.g-up button, .lpr-table th.g-down button, .lpr-table th.g-stay button, .lpr-table th[data-sort="total"] button { justify-content: flex-end; }
.scroll-hint { display: none; font-size: .85rem; color: var(--muted); margin: 0 0 10px; }
@media (max-width: 820px) { .scroll-hint { display: block; } }

/* Publishing switched off */
.progression[hidden] { display: none; }
.is-unpublished .table-controls, .is-unpublished .table-scroll,
.is-unpublished .scroll-hint, .is-unpublished .lpr-note,
.is-unpublished .page-head .muted { display: none; }
.is-unpublished #table-status { padding: 48px 0; font-size: 1.05rem; }

/* group separators so the three colour bands read as blocks */
.lpr-table td.g-up:nth-child(4), .lpr-table th.g-up[data-sort="l1_l2"],
.lpr-table td.g-down:nth-child(7), .lpr-table th.g-down[data-sort="l2_l1"],
.lpr-table td.g-stay:nth-child(10), .lpr-table th.g-stay[data-sort="l1_l1"] { border-left: 3px solid #fff; }
.lpr-table .group-row th.g-up, .lpr-table .group-row th.g-down, .lpr-table .group-row th.g-stay {
    font-weight: 600; font-size: .82rem; border-left: 3px solid #fff; }
.lpr-table th.g-up button::after, .lpr-table th.g-down button::after, .lpr-table th.g-stay button::after { opacity: .6; }
.row-total td.g-up   { background: #a8dfbb !important; }
.row-total td.g-down { background: #f7b3b6 !important; }
.row-total td.g-stay { background: #ffd970 !important; }

/* ═══════════════════════════════════════════════
   Proficiency (Level 1 / Level 2 / Level 3 = proficient)
   ═══════════════════════════════════════════════ */
:root {
    --lvl1: #f6b9bb;   /* Level 1: soft red   */
    --lvl2: #ffd56b;   /* Level 2: amber      */
    --lvl3: #00a64f;   /* Level 3: green, proficient */
}
.proficiency[hidden] { display: none; }
.proficiency { background: #fff; }
.proficiency .nat { background: var(--tint); }

.prof-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.prof-legend { margin: 0; }
.key-l1::before { background: var(--lvl1); }
.key-l2::before { background: var(--lvl2); }
.key-l3::before { background: var(--lvl3); }

.prof-chart { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 26px; }
.prof-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 48px; }
.prof-row {
    break-inside: avoid; display: grid; grid-template-columns: 160px 1fr 58px; gap: 14px; align-items: center;
    padding: 11px 0; border-bottom: 1px solid var(--line);
}
.stack { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--tint); }
.seg {
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    font-size: .72rem; font-weight: 500; white-space: nowrap;
    transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.seg-l1 { background: var(--lvl1); color: #7a0e12; }
.seg-l2 { background: var(--lvl2); color: #4d3800; }
.seg-l3 { background: var(--lvl3); color: #fff; }

.prof-pill {
    display: inline-block; min-width: 52px; text-align: center;
    font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.band-high { background: #00a64f; color: #fff; }
.band-mid  { background: #ffc107; color: #3b2a00; }
.band-low  { background: #ed1c24; color: #fff; }
.band-none { background: var(--tint); color: var(--muted); }
.prof-legend-pills { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* full table colours */
.prof-table th.g-lit { background: var(--blue); color: #fff; }
.prof-table th.g-num { background: var(--orange); color: var(--navy-2); }
.prof-table td.g-lit { background: #e6f0f9; }
.prof-table td.g-num { background: #fef1e1; }
.prof-table th.g-lit, .prof-table th.g-num { text-align: right; }
.prof-table th.g-lit button, .prof-table th.g-num button { justify-content: flex-end; }
.prof-table th[data-sort="lit_l1"], .prof-table td.g-lit:nth-child(3),
.prof-table th[data-sort="num_l1"], .prof-table td.g-num:nth-child(6),
.prof-table .group-row th.g-lit, .prof-table .group-row th.g-num { border-left: 3px solid #fff; }
.prof-table .c-pill { text-align: right; }
.prof-table th.c-schools { text-align: right; }
.prof-table th.c-schools button { justify-content: flex-end; }
.prof-table { min-width: 820px; }
.row-total td.g-lit { background: #c9def1 !important; }
.row-total td.g-num { background: #fcdcb4 !important; }

@media (max-width: 960px) { .prof-list { columns: 1; } }
@media (max-width: 640px) {
    .prof-chart { padding: 6px 16px; }
    .prof-row { grid-template-columns: 96px 1fr 50px; gap: 8px; }
    .prof-row .prog-region { font-size: .85rem; }
    .prof-row .prog-rank { display: none; }
    .prof-legend { gap: 12px; font-size: .8rem; }
}
