/* IDL Learn – design system (loaded last).
 * Principles: one calm neutral canvas, one accent colour, one typeface; weight and colour carry hierarchy, not bold everywhere.
 * Navigation lives in a persistent sidebar (staff and learners), with a slim top bar for the page title, search and account.
 * Learning screens stay quiet: no decoration behind a question or a game. */
:root {
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --head: 'Plus Jakarta Sans', system-ui, sans-serif;
    --kid: 'Nunito', 'Plus Jakarta Sans', system-ui, sans-serif;
    --brand: #163EC4; --brand-dark: #0E2CA0; --brand-soft: #EEF3FF; --brand-line: #C9D6FB;
    --ink: #101828; --text: #344054; --muted: #667085; --faint: #98A2B3;
    --line: #EAECF0; --line-2: #F2F4F7; --bg: #F8F9FB; --card: #FFFFFF;
    --ok: #079455; --ok-soft: #ECFDF3; --no: #D92D20; --no-soft: #FEF3F2; --warn: #DC6803; --warn-soft: #FFFAEB;
    --radius: 14px; --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .04);
    --shadow-lg: 0 20px 24px -6px rgba(16, 24, 40, .1), 0 8px 8px -4px rgba(16, 24, 40, .04);
    --grad: linear-gradient(135deg, #163EC4, #285CF0);
    --grad-soft: linear-gradient(135deg, #EEF3FF, #F3F6FF);
    --side: 256px; --top: 60px;
}

/* ---------- Base type ---------- */
body { background: var(--bg); color: var(--text); font: 400 15px/1.6 var(--font); letter-spacing: -0.003em; }
h1, h2, h3 { color: var(--ink); font-family: var(--head); letter-spacing: -0.02em; }
h1 { font-size: clamp(24px, 2.4vw, 30px); font-weight: 700; line-height: 1.2; }
h2 { font-size: 18px; font-weight: 600; } h3 { font-size: 16px; font-weight: 600; }
b, strong { font-weight: 600; }
.eyebrow { margin-bottom: 6px; color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.page-head[style*="--c"] .eyebrow { color: var(--c); }
.muted { color: var(--muted); }
a { color: var(--brand); } a:hover { text-decoration: none; color: var(--brand-dark); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
code { background: var(--line-2); color: var(--text); font-weight: 500; }

/* The old decorative background is retired: a plain canvas reads calmer */
.bgfx { display: none; }
#app > * { animation: shellIn .22s ease both; }
@keyframes shellIn { from { opacity: 0; transform: translateY(4px); } }

/* ---------- App shell ---------- */
.side { display: none; }
body.has-shell .side { position: fixed; inset: 0 auto 0 0; z-index: 60; display: flex; flex-direction: column; width: var(--side); background: #fff; border-right: 1px solid var(--line); transition: width .2s ease, transform .25s ease; }
.side__top { display: flex; align-items: center; height: var(--top); padding: 0 16px; border-bottom: 1px solid transparent; }
.side__brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none !important; }
.side__mark { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.side__name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.side__name b { overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.side__name small { color: var(--muted); font-size: 12px; }
.side__nav { flex: 1; overflow-y: auto; padding: 8px 12px 12px; scrollbar-width: thin; }
.side__sec + .side__sec { margin-top: 18px; }
.side__h { margin: 0 0 4px; padding: 0 10px; color: var(--faint); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.side__link { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: 500 14px/1 var(--font); text-align: left; text-decoration: none !important; cursor: pointer; }
.side__link .mi { width: 19px; height: 19px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side__link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__link:hover { background: var(--line-2); color: var(--ink); }
.side__link.is-on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.side__link.is-on .mi { stroke: var(--brand); }
.side__link em { margin-left: auto; padding: 1px 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 11px; font-style: normal; font-weight: 600; }
.side__link--ai .mi { stroke: var(--brand); }
.side__foot { padding: 10px 12px 14px; border-top: 1px solid var(--line); }
.side__collapse { color: var(--muted); }
/* collapsed: icons only */
body.side-mini { --side: 76px; }
body.side-mini .side__name, body.side-mini .side__h, body.side-mini .side__link em { display: none; }
body.side-mini .side__link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body.side-mini .side__link { justify-content: center; padding: 0; }
body.side-mini .side__top { justify-content: center; padding: 0; }
body.side-mini .side__sec + .side__sec { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
body.side-mini .side__collapse .mi { transform: scaleX(-1); }

/* top bar */
.header { position: sticky; top: 0; z-index: 50; background: #F8F9FB; -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); box-shadow: none; }
.header::after { display: none; }
body.has-shell .header, body.has-shell #app, body.has-shell .tabbar-wrap { margin-left: var(--side); transition: margin-left .2s ease; }
.top { display: flex; align-items: center; gap: 12px; height: var(--top); padding: 0 28px; }
.top--out { max-width: 1200px; margin: 0 auto; }
.top--out .top__link { margin-left: auto; color: var(--text); font-weight: 500; }
.top__menu { display: none; width: 38px; height: 38px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.top__menu .mi { width: 100%; height: 100%; fill: none; stroke: var(--text); stroke-width: 1.8; }
.top__title { flex: 1; min-width: 0; margin: 0; overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.top__search { display: inline-flex; align-items: center; gap: 10px; width: min(360px, 34vw); height: 38px; padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--faint); font: 400 14px var(--font); cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s ease; }
.top__search:hover { border-color: #D0D5DD; }
.top__search .mi { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; }
.top__search span { flex: 1; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
kbd { display: inline-flex; align-items: center; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: #fff; color: var(--muted); font: 500 11px/1.5 var(--font); }
.user { margin-left: 0; }
.user__btn { gap: 8px; padding: 3px 10px 3px 3px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 500; font-size: 14px; box-shadow: var(--shadow); }
.header .user__btn { background: #fff; color: var(--ink); }
.avatar { width: 30px; height: 30px; background: var(--brand); font-size: 13px; font-weight: 600; }
.avatar--lg { width: 40px; height: 40px; font-size: 16px; flex: none; }
.user__menu { min-width: 260px; padding: 6px; border-radius: 12px; box-shadow: var(--shadow-lg); }
.user__card { display: flex; gap: 12px; padding: 10px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.user__card p { margin: 0; display: flex; flex-direction: column; line-height: 1.35; } .user__card b { color: var(--ink); } .user__card small { color: var(--muted); font-size: 12.5px; }
.user__menu a, .user__menu button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; font-weight: 500; font-size: 14px; color: var(--text); }
.user__menu .mi { width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.save-state { font-size: 13px; font-weight: 500; }
.lic-warn { padding: 8px 28px; background: var(--warn-soft); border-top: 1px solid #FEDF89; color: #93370D; font-size: 13.5px; font-weight: 500; }
.lic-warn .wrap { max-width: none; padding: 0; }
.lic-warn.is-expired { background: var(--no-soft); border-top-color: #FECDCA; color: #912018; }

/* page frame */
.wrap { max-width: 1200px; padding: 0 28px; }
.page { padding-top: 28px; padding-bottom: 64px; }
.page-head { margin-bottom: 22px; } .page-head p.muted { margin-bottom: 0; }
.page-head h1 { margin-bottom: 4px; }

/* learner tab bar (phones) */
.tabbar { display: none; }

/* ---------- Jump to anything ---------- */
.cmdk { position: fixed; inset: 0; z-index: 400; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(16, 24, 40, .4); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: shellIn .15s ease; }
.cmdk__box { width: 100%; max-width: 620px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-lg); }
.cmdk__in { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.cmdk__in .mi { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; }
.cmdk__in input { flex: 1; height: 56px; border: 0; background: none; color: var(--ink); font: 400 16px var(--font); outline: none; }
.cmdk__list { max-height: min(56vh, 460px); overflow-y: auto; padding: 6px; }
.cmdk__it { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; }
.cmdk__it .mi { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.cmdk__it span { flex: 1; min-width: 0; display: flex; flex-direction: column; } .cmdk__it b { overflow: hidden; color: var(--ink); font-weight: 500; font-size: 14.5px; text-overflow: ellipsis; white-space: nowrap; } .cmdk__it small { overflow: hidden; color: var(--muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.cmdk__it em { color: var(--faint); font-size: 12px; font-style: normal; font-weight: 500; }
.cmdk__it.is-on, .cmdk__it:hover { background: var(--brand-soft); } .cmdk__it.is-on .mi { stroke: var(--brand); }
.cmdk__none { margin: 0; padding: 28px 16px; color: var(--muted); text-align: center; }
.cmdk__foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 12px; } .cmdk__foot kbd { margin-right: 4px; }

/* ---------- Components: quieter weights, consistent radii ---------- */
.btn { min-height: 40px; padding: 9px 16px; border-radius: var(--radius-sm); background: var(--brand); color: #fff; font: 600 14px/1.2 var(--font); box-shadow: var(--shadow); transition: background-color .15s ease, box-shadow .15s ease; }
.btn:hover { background: var(--brand-dark); background-size: auto; box-shadow: var(--shadow-md); }
.btn:hover, .btn:focus-visible { color: #fff; }   /* outranks the global a:hover colour, which made link-buttons unreadable */
.btn--ghost { background: #fff; color: var(--text); box-shadow: inset 0 0 0 1px #D0D5DD, var(--shadow); }
.btn--ghost:hover { background: var(--line-2); color: var(--ink); box-shadow: inset 0 0 0 1px #D0D5DD, var(--shadow); }
.btn--danger { background: #fff; color: var(--no); box-shadow: inset 0 0 0 1px #FDA29B, var(--shadow); } .btn--danger:hover { background: var(--no-soft); color: var(--no); }
.btn--green { background: var(--ok); } .btn--green:hover { background: #067647; }
.btn--amber { background: #fff; color: var(--text); box-shadow: inset 0 0 0 1px #D0D5DD, var(--shadow); } .btn--amber:hover { background: var(--line-2); color: var(--ink); }
.btn--ghost:focus-visible { color: var(--ink); } .btn--danger:focus-visible { color: var(--no); } .btn--amber:focus-visible { color: var(--text); }
.btn--sm { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn--big { min-height: 52px; padding: 12px 32px; font-size: 17px; border-radius: 14px; }
.link { font-weight: 600; }
.field > span { color: var(--ink); font-size: 14px; font-weight: 500; }
.field input, .field select, .field textarea, .search, .reg-search, .reg-tools select { min-height: 42px; border: 1px solid #D0D5DD; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 15px; }
.field input:focus, .field select:focus, .field textarea:focus, .search:focus { border-color: #A4BCFD; box-shadow: 0 0 0 4px #EEF3FF; }
.form-error { font-weight: 500; }
.panel, .empty, .topic, .kpis > div, .award-stats > div, .lic__card, .facts div, .acard, .asst-box, .asst-chat { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.panel { padding: 24px; } .panel__head h2 { font-size: 17px; }
.kpis b, .award-stats b { color: var(--ink); background: none; -webkit-text-fill-color: currentColor; font-weight: 700; font-size: 26px; letter-spacing: -0.02em; }
.kpis span, .award-stats span { color: var(--muted); font-weight: 500; font-size: 13px; }
.tabs { gap: 2px; box-shadow: inset 0 -1px 0 var(--line); }
.tab { padding: 10px 14px; border-bottom-width: 2px; color: var(--muted); font-weight: 500; font-size: 14.5px; }
.tab.is-on { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }
.chip { padding: 6px 12px; box-shadow: inset 0 0 0 1px #D0D5DD; font-weight: 500; font-size: 14px; color: var(--text); }
.chip.is-on, .seg__btn.is-on, .pillbtn.is-on { background: var(--ink); color: #fff; box-shadow: none; }
.table th { padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.table td { padding: 12px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.table tbody tr:hover td { background: #FCFCFD; }
.table-wrap { border: 1px solid var(--line); border-radius: 12px; }
.table-wrap .table th:first-child, .table-wrap .table td:first-child { padding-left: 16px; }
.panel .table-wrap { border: 0; border-radius: 0; }
.badge { padding: 2px 9px; background: var(--line-2); color: var(--text); font-weight: 500; font-size: 12.5px; }
.badge--cbe { background: var(--ok-soft); color: #067647; } .badge--cambridge { background: var(--brand-soft); color: var(--brand-dark); }
.pill { font-weight: 600; }
.empty h3 { font-size: 17px; } .empty { padding: 44px 24px; }
.modal { background: rgba(16, 24, 40, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal__box { border-radius: 16px; box-shadow: var(--shadow-lg); } .modal__head h2 { font-size: 18px; }
.toast { border-radius: 10px; font-weight: 500; box-shadow: var(--shadow-lg); }
.crumbs { font-weight: 500; }
.reg-head h1 { color: var(--ink); font-weight: 700; font-size: clamp(22px, 2.4vw, 28px); }
.acct-bar { border-bottom: 1px solid var(--line); background: #fff; }
.acct-tab { font-weight: 500; color: var(--muted); } .acct-tab.is-on { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }
.acct-sub a { font-weight: 500; } .acct-sub a.is-on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.ask-bar { margin: -6px 0 24px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.ask-bar__i { color: var(--brand); background: none; -webkit-text-fill-color: currentColor; }
.ai-fab { display: none !important; }   /* the sidebar link and the ask bar replace the floating button */
.gtag { font-weight: 600; }
.gcard b, .subject-card b, .rec-card b, .exam-card b { font-weight: 600; }
.gcard b { color: var(--ink); }
.class-card b { font-weight: 600; }
.skill-link__name { font-weight: 500; }
.topic h2 { font-weight: 600; }
.ycard__body b { font-weight: 600; }
.mpanel, .mnav, .burger { display: none !important; }

/* Learner home banner: refined, still joyful */
.hello { background: linear-gradient(135deg, #0B1842 0%, #0E2CA0 55%, #285CF0 100%); border-radius: 20px; box-shadow: none; }
.hello::before { opacity: .5; }
.hello h1 { font-weight: 700; }

/* ---------- Learner experience: friendlier shapes and type ---------- */
body.role-learner .side__link { min-height: 44px; font-size: 15px; border-radius: 12px; }
body.role-learner .side__link .mi { width: 21px; height: 21px; }
body.role-learner h1 { font-family: var(--kid); font-weight: 800; letter-spacing: -0.01em; }
.game, .kq, .gstart, .gend, .tf, .scr, .srt, .mgrid { font-family: var(--kid); }
.kq__text, .kq__opt { font-family: var(--kid); }

/* ---------- Assistant & report keep their structure; type follows the system ---------- */
.rp { font-family: var(--font); }
.rp-title { font-weight: 800; letter-spacing: -0.03em; }
.asst-msg--me { background: var(--brand); }
.asst-engine.is-ai { background: var(--brand-soft); }
.asst-sugs button { font-weight: 500; }
.asst-tpl b { font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    body.has-shell { --side: 272px; }
    body.has-shell .side { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    body.has-shell.nav-open .side { transform: none; }
    body.has-shell.nav-open::after { content: ''; position: fixed; inset: 0; z-index: 55; background: rgba(16, 24, 40, .35); }
    body.has-shell .header, body.has-shell #app, body.has-shell .tabbar-wrap { margin-left: 0; }
    body.side-mini .side__name, body.side-mini .side__h { display: revert; }
    .side__collapse { display: none; }
    .top__menu { display: inline-flex; }
    .top { padding: 0 16px; }
    .lic-warn { padding: 8px 16px; }
}
@media (max-width: 720px) {
    .wrap { padding: 0 16px; }
    .top__search { width: 40px; padding: 0; justify-content: center; } .top__search span, .top__search kbd { display: none; }
    .user__name { display: none; } .user__btn { padding: 3px; }
    .page { padding-top: 20px; }
    body.role-learner .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: flex; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
    body.role-learner #app { padding-bottom: 76px; }
    .tabbar__a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 10px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-decoration: none !important; }
    .tabbar__a .mi { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .tabbar__a.is-on { color: var(--brand); background: var(--brand-soft); }
}
@media print { .side, .header, .tabbar-wrap { display: none !important; } body.has-shell #app { margin: 0; } }

/* Table action cells stay table cells so row lines line up */
.table td.row-actions { display: table-cell; white-space: nowrap; text-align: right; }
.table td.row-actions > * + * { margin-left: 6px; }
.ask-bar input { font-weight: 400; color: var(--ink); } .ask-bar input::placeholder { color: var(--faint); }

/* ---------- Page-level harmonising: quieter labels, neutral controls ---------- */
.topic__skills a { font-weight: 500; color: var(--ink); } .topic__skills a:hover { background: var(--line-2); color: var(--ink); }
.topic__code { font-weight: 500; color: var(--faint); }
.topic { border-radius: var(--radius); }
.topic__letter { border-radius: 8px; font-weight: 600; font-size: 14px; width: 30px; height: 30px; }
.stage__name { font-size: 12px; font-weight: 500; letter-spacing: .02em; color: var(--muted); }
.seg { box-shadow: none; background: var(--line-2); border-radius: 10px; }
.seg__btn { font-weight: 500; font-size: 14px; } .seg__btn.is-on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.class-card { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow); }
.class-card:hover { transform: none; box-shadow: var(--shadow-md); }
.class-card b { font-size: 17px; } .class-card span, .class-card small { font-weight: 400; }
.check, label.check { font-weight: 400; color: var(--text); }
.reg-count { font-weight: 400; }
.checks legend { font-weight: 500; color: var(--ink); }
.checks label { font-weight: 400; }
.subject-card { border: 1px solid var(--line); border-bottom: 3px solid var(--c); box-shadow: var(--shadow); }
.subject-card span { font-weight: 400; }
.rec-card { border: 1px solid var(--line); border-top: 3px solid var(--c); box-shadow: var(--shadow); }
.rec-card__tag { font-weight: 600; letter-spacing: .02em; font-size: 12px; }
.rec-card__why { font-weight: 400; }
.exam-card { border-top-width: 3px; }
.gcard { border: 1px solid var(--line); box-shadow: var(--shadow); } .gcard span { font-weight: 400; }
.facts dt { font-weight: 500; } .facts dd { font-weight: 600; }
.hello__stats b { font-weight: 700; } .hello__stats span { font-weight: 500; }
.week__day { font-weight: 500; }

/* Analytics: neutral scope switch, quiet filters, calm headline */
.ascope { background: var(--line-2); border: 0; border-radius: 12px; }
.ascope__a { color: var(--muted); font-weight: 500; } .ascope__a.is-on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.ascope__pick { font-weight: 500; }
.atabs { border-bottom: 1px solid var(--line); } .atab { color: var(--muted); font-weight: 500; border-bottom-width: 2px; } .atab.is-on { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }
.afilters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.afilters__h { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.afilters label { font-weight: 400; }
.ahead h1 { color: var(--ink); font-weight: 700; text-transform: none; letter-spacing: -0.02em; font-size: clamp(22px, 2.4vw, 28px); }
.abanner { border-radius: var(--radius) var(--radius) 0 0; background: var(--brand-soft); color: var(--ink); font-size: 17px; font-weight: 500; }
.abanner::after { display: none; }
.acount b { background: var(--brand); border-radius: 6px; font-weight: 600; }
.awho { border: 1px solid var(--line); border-top: 0; box-shadow: var(--shadow); font-size: 15px; } .awho b { font-weight: 700; color: var(--ink); }
.asec { font-weight: 600; color: var(--ink); font-size: 17px; }
.acard { border-radius: var(--radius); } .acard h3 { font-weight: 600; color: var(--ink); font-size: 16px; } .acard .link { font-weight: 500; }
.hbar__l { font-weight: 500; } .hbar b { font-weight: 600; } .abig { font-weight: 700; color: var(--ink); }
.aleaders li { background: var(--bg); } .aleaders li:nth-child(1) { background: #FFFAEB; } .aleaders li:nth-child(2) { background: var(--line-2); } .aleaders li:nth-child(3) { background: #FEF6EE; }
.arank { font-weight: 600; color: var(--brand-dark); }

/* Practice screen: focused and calm */
.practice__code { border-radius: 8px; font-weight: 600; }
.qcard { border-radius: 18px; box-shadow: var(--shadow-md); }
.q-text { font-weight: 500; } .q-big { font-weight: 700; }
.choice { font-weight: 500; border-width: 1.5px; border-radius: 12px; }
.choice__key { font-weight: 600; }
.answer input { font-weight: 600; border-width: 1.5px; }
.side-box { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.side-box__label { font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.side-box b { font-weight: 700; } .side-box__level { font-weight: 600; }

/* Sidebar labels: room for descenders (g, p, y) so letters are never clipped */
.side__link { line-height: 1.35; }
.side__link span { padding: 2px 0; line-height: 1.35; }

/* ---------- Subject catalogue: calm header, segmented view switch, tidy level rows ---------- */
.cat-hero { gap: 20px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.cat-hero__icon { width: 60px; height: 60px; padding: 12px; border-radius: 14px; box-shadow: none; }
.cat-hero h1 { color: var(--ink); margin-bottom: 4px; font-size: clamp(22px, 2.4vw, 28px); }
.cat-hero p:not(.eyebrow) { color: var(--muted); max-width: 640px; }
.cat-hero__btns { gap: 0; padding: 4px; border-radius: 10px; background: var(--line-2); }
.pillbtn { padding: 7px 14px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-weight: 500; font-size: 14px; line-height: 1.3; }
.pillbtn:hover { background: rgba(255, 255, 255, .7); color: var(--ink); border: 0; }
.pillbtn.is-on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.ycards { gap: 10px; max-width: none; }
.ycard { grid-template-columns: 56px minmax(0, 1fr) auto; min-height: 76px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ycard:hover { transform: none; border-color: #D0D5DD; box-shadow: var(--shadow-md); }
.ycard.is-mine { box-shadow: 0 0 0 2px var(--c), var(--shadow); }
.ycard__badge { margin: 12px 0 12px 12px; border-radius: 10px; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); font-size: 20px; font-weight: 700; }
.ycard--topic { grid-template-columns: minmax(0, 1fr) auto; border-left: 4px solid var(--c); }   /* topic cards have no badge column */
.ycard__body { padding: 12px 16px; }
.ycard__body b { font-size: 16px; font-weight: 600; line-height: 1.35; }
.ycard--topic .ycard__body b { color: var(--ink); }
.ycard__body b em { background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); font-weight: 600; }
.ycard__inc { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.ycard__inc span { color: var(--faint); } .ycard__inc i { color: var(--line); }
.ycard__go { margin-right: 16px; padding: 7px 12px; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px #D0D5DD; color: var(--text); font-size: 13px; font-weight: 500; line-height: 1.3; }
.ycard:hover .ycard__go { background: var(--line-2); color: var(--ink); }
@media (max-width: 680px) { .ycard { grid-template-columns: 48px minmax(0, 1fr); } .ycard--topic { grid-template-columns: minmax(0, 1fr); } .ycard__go { grid-column: 1 / -1; justify-self: start; margin: 0 0 12px 16px; } }
@media (max-width: 680px) { .ycard { grid-template-columns: 48px minmax(0, 1fr); } .ycard__go { margin: 0 0 12px 16px; } }
.cat-hero > .cat-hero__btns { flex: 0 0 auto; min-width: 0; align-self: center; }

/* Matrices in questions: two stacked rows inside brackets */
.mx { display: inline-flex; flex-direction: column; justify-content: center; margin: 0 4px; padding: 2px 10px; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); border-radius: 8px; vertical-align: middle; font-variant-numeric: tabular-nums; line-height: 1.35; font-size: 0; }
.mx > span { font-size: 18px; font-weight: 600; text-align: center; color: var(--ink); white-space: nowrap; }
.q-table { width: auto; margin: 12px 0; } .q-table td, .q-table th { padding: 8px 14px; text-align: center; }
.multi__f { font-weight: 600; font-size: 17px; } .multi__f input { font-weight: 600; }

/* ---------- Themes: a soft tinted canvas with a quiet scene at the edges ---------- */
body { background: var(--tbg, var(--bg)); }
.bgfx { display: block !important; position: fixed; inset: 0; z-index: -1; pointer-events: none; transition: opacity .5s ease; }
.bgfx__scene { position: absolute; inset: 0; width: 100%; height: 100%; }
body.is-focus .bgfx { opacity: .35; }
.header { background: var(--tbg, #F8F9FB); }   /* solid: page content must not show through the top bar */
.side { background: rgba(255, 255, 255, .92) !important; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.side__link.is-on { background: var(--t-soft, var(--brand-soft)); color: var(--t-accent, var(--brand-dark)); }
.side__link.is-on .mi { stroke: var(--t-accent, var(--brand)); }
body.role-learner .side__mark, body.role-learner .avatar { background: var(--t-accent); }
body.role-learner .btn:not(.btn--ghost):not(.btn--danger) { background: var(--t-accent); }
body.role-learner .btn:not(.btn--ghost):not(.btn--danger):hover { filter: brightness(.92); }
body.role-learner .tabbar__a.is-on { color: var(--t-accent); background: var(--t-soft); }
.hello { background: var(--t-hero, linear-gradient(135deg, #0B1842, #163EC4)) !important; }
@media print { .bgfx { display: none !important; } }

/* ---------- Dashboards ---------- */
.dash-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; overflow: hidden; margin-bottom: 18px; padding: 28px 30px; border-radius: 20px; background: var(--t-hero); color: #fff; }
.dash-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 120% at 100% 0%, rgba(255, 255, 255, .18), transparent 60%); pointer-events: none; }
.dash-hero__txt { position: relative; max-width: 640px; }
.dash-hero .eyebrow { color: rgba(255, 255, 255, .8); }
.dash-hero h1 { margin: 2px 0 6px; color: #fff; }
.dash-hero p { margin: 0; color: rgba(255, 255, 255, .88); font-size: 15.5px; } .dash-hero p b { color: #fff; }
.dash-hero__art { position: relative; flex: none; width: 280px; height: auto; margin: -8px -6px -12px 0; filter: drop-shadow(0 14px 22px rgba(11, 24, 66, .18)); }
.dash-hero__badge { transform-box: fill-box; transform-origin: center; animation: dash-float 5s ease-in-out infinite; }
@keyframes dash-float { 50% { transform: translateY(-4px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .dash-hero__badge { animation: none; } }
@media (max-width: 1100px) { .dash-hero__art { width: 220px; } }
.dash-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dash-act { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; background: rgba(255, 255, 255, .16); color: #fff !important; font-size: 14px; font-weight: 500; text-decoration: none !important; transition: background .15s ease; }
.dash-act:hover { background: rgba(255, 255, 255, .26); }
.dash-act .mi { width: 17px; height: 17px; fill: none; stroke: #fff; stroke-width: 1.8; }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.dash-kpi { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.dash-kpi__i { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; margin-bottom: 6px; border-radius: 10px; background: var(--t-soft, var(--brand-soft)); }
.dash-kpi__i .mi { width: 18px; height: 18px; fill: none; stroke: var(--t-accent, var(--brand)); stroke-width: 1.8; }
.dash-kpi__l { color: var(--muted); font-size: 13px; font-weight: 500; }
.dash-kpi b { color: var(--ink); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; } .dash-kpi b small { color: var(--faint); font-size: 15px; font-weight: 500; }
.dash-d { color: var(--muted); font-size: 12.5px; font-style: normal; font-weight: 500; } .dash-d.is-up { color: var(--ok); } .dash-d.is-down { color: var(--no); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.dash-main, .dash-side { display: grid; gap: 18px; }
.dash-panel { margin: 0; }
.dash-bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.dash-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; }
.dash-bar i { display: block; width: 100%; max-width: 46px; border-radius: 8px 8px 4px 4px; background: color-mix(in srgb, var(--t-accent, var(--brand)) 30%, #fff); transition: height .4s ease; }
.dash-bar.is-today i { background: var(--t-accent, var(--brand)); }
.dash-bar em { color: var(--muted); font-size: 12px; font-style: normal; } .dash-bar__v { color: var(--text); font-size: 12px; font-weight: 600; min-height: 16px; }
.dash-classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.dash-list { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 4px; }
.dash-list li { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 10px; }
.dash-list li:hover { background: var(--line-2); }
.dash-list li > span:last-child { display: flex; flex-direction: column; min-width: 0; } .dash-list b { color: var(--ink); font-weight: 500; font-size: 14.5px; } .dash-list small { color: var(--muted); font-size: 12.5px; }
.avatar--sm { width: 30px; height: 30px; flex: none; background: var(--t-soft, var(--brand-soft)); color: var(--t-accent, var(--brand)); font-size: 13px; }
.dash-pct { flex: none; display: inline-flex; width: 46px; height: 30px; align-items: center; justify-content: center; border-radius: 8px; background: var(--warn-soft); color: #B54708; font-weight: 600; font-size: 13px; } .dash-pct.is-low { background: var(--no-soft); color: var(--no); }
.dash-count { padding: 1px 9px; border-radius: 999px; background: var(--no-soft); color: var(--no); font-size: 12.5px; font-weight: 600; }
.dash-ok { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ok); font-weight: 500; } .dash-ok .mi { width: 18px; height: 18px; fill: none; stroke: var(--ok); stroke-width: 1.8; }
.dash-top { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.dash-top li { display: flex; align-items: center; gap: 12px; padding: 8px 6px; }
.dash-top li > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; } .dash-top b { color: var(--ink); font-weight: 500; } .dash-top small { color: var(--muted); font-size: 12.5px; }
.dash-top em { color: var(--ink); font-style: normal; font-weight: 600; }
.dash-rank { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 50%; background: var(--line-2); color: var(--text); font-size: 12.5px; font-weight: 600; }
.dash-top li:first-child .dash-rank { background: #FEF0C7; color: #B54708; }
.dash-note { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; color: #B54708; font-size: 13.5px; font-weight: 500; } .dash-note .mi { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.dash .ask-bar { margin-top: 0; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .dash-hero { padding: 22px 20px; } .dash-hero__art { display: none; } }

/* Learner home: world label and "continue where you left off" */
.hello__world { display: inline-flex; margin: 0 0 6px; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; font-size: 13px; font-weight: 500; } .hello__world b { margin-left: 4px; font-weight: 700; }
.cont { display: flex; align-items: center; gap: 16px; margin: -8px 0 22px; padding: 14px 18px; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); color: var(--ink); text-decoration: none !important; transition: box-shadow .15s ease, transform .15s ease; }
.cont:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.cont__ring { flex: none; } .cont__ring svg { display: block; }
.cont__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; } .cont__txt small { color: var(--muted); font-size: 12.5px; font-weight: 500; } .cont__txt b { font-size: 17px; font-weight: 700; } .cont__txt em { color: var(--muted); font-size: 13px; font-style: normal; }
.cont__go { flex: none; padding: 9px 16px; border-radius: 10px; background: var(--t-accent, var(--brand)); color: #fff; font-weight: 600; font-size: 14px; }
@media (max-width: 560px) { .cont__go { display: none; } }
/* analytics tabs wrap onto a second line instead of being cut off at the edge */
.atabs { flex-wrap: wrap; overflow: visible; row-gap: 0; }
.atab { margin-bottom: -1px; }
.ach { max-width: 100%; height: auto; }
