/* IDL Learn – screens: sign-in, home, skills, practice, diagnostic, awards, teacher tools, reports, print. */

/* ---------- Sign in / setup ---------- */
.auth { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 64px); padding: 40px 16px; background: radial-gradient(60% 60% at 80% 10%, #DCE5FF 0, transparent 70%), radial-gradient(50% 50% at 10% 90%, #FFF0D6 0, transparent 70%); }
.auth__card { width: 100%; max-width: 420px; padding: 36px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.auth__card form { margin-top: 22px; text-align: left; }

/* ---------- Student home ---------- */
.hello { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; padding: 30px; border-radius: 22px; background: linear-gradient(135deg, var(--brand) 0%, #0E2CA0 100%); color: #fff; box-shadow: var(--shadow); }
.hello h1, .hello .eyebrow { color: #fff; }
.hello .muted { color: rgba(255, 255, 255, .8); margin: 0; }
.hello__stats { display: flex; flex-wrap: wrap; gap: 12px; }
.hello__stats div { min-width: 130px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .14); }
.hello__stats b { display: block; font-size: 24px; font-weight: 900; }
.hello__stats span { font-size: 13px; opacity: .85; font-weight: 700; }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.rec-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line); border-top: 5px solid var(--c); color: var(--ink); text-decoration: none !important; transition: transform .15s ease, box-shadow .15s ease; }
.rec-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.rec-card__tag { font-size: 12.5px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: var(--c); }
.rec-card b { font-size: 16.5px; line-height: 1.3; padding-right: 40px; }
.rec-card__why { font-size: 14px; color: var(--muted); font-weight: 600; }
.rec-card__score { position: absolute; top: 14px; right: 14px; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 22px; }
.subject-card { display: flex; flex-direction: column; gap: 4px; padding: 22px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); color: var(--ink); text-decoration: none !important; border-bottom: 5px solid var(--c); transition: transform .15s ease; }
.subject-card:hover { transform: translateY(-3px); }
.subject-card__icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 10px; border-radius: 14px; background: var(--c); color: #fff; font-size: 22px; font-weight: 900; }
.subject-card b { font-size: 19px; }
.subject-card span { color: var(--muted); font-weight: 700; font-size: 14px; }
.subject-card .subject-card__icon { color: #fff; font-size: 22px; font-weight: 900; }
.subject-card__done { color: var(--c) !important; }
.skill-list { display: grid; gap: 8px; }
.skill-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg); color: var(--ink); text-decoration: none !important; }
.skill-link:hover { background: var(--brand-soft); }
.skill-link__code { flex: none; min-width: 42px; padding: 4px 8px; border-radius: 8px; background: var(--c); color: #fff; font-weight: 900; font-size: 13px; text-align: center; }
.skill-link__name { flex: 1; font-weight: 800; }
.skill-link__name small { display: block; font-weight: 600; color: var(--muted); font-size: 13px; }

/* ---------- Skill lists ---------- */
.page-head[style*="--c"] .eyebrow { color: var(--c); }
.topics { columns: 2 440px; column-gap: 22px; }
.topic { break-inside: avoid; margin-bottom: 22px; padding: 22px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.topic h2 { display: flex; align-items: center; gap: 12px; font-size: 19px; }
.topic__letter { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--c); color: #fff; font-size: 16px; }
.topic__skills { margin: 0; padding: 0; list-style: none; }
.topic__skills li { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.topic__skills a { display: flex; align-items: center; gap: 12px; flex: 1; padding: 11px 6px; color: var(--ink); font-weight: 700; text-decoration: none !important; border-radius: 8px; }
.topic__skills a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.topic__code { flex: none; min-width: 34px; color: var(--muted); font-weight: 900; font-size: 14px; }
.topic__name { flex: 1; }
.medal { font-size: 18px; }

/* ---------- Practice ---------- */
.practice__head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.practice__head h1 { margin: 0; font-size: clamp(22px, 2.8vw, 30px); }
.practice__code { padding: 6px 12px; border-radius: 10px; background: var(--c); color: #fff; font-weight: 900; }
.practice__grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 22px; align-items: start; }
.qcard { min-height: 380px; padding: clamp(22px, 4vw, 44px); border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.q { margin-bottom: 26px; }
.q-text { font-size: clamp(18px, 2.2vw, 22px); font-weight: 700; color: var(--ink); }
.q-sub { color: var(--muted); font-weight: 700; }
.q-big { margin: 14px 0; font-size: clamp(26px, 4vw, 40px); font-weight: 900; color: var(--ink); letter-spacing: .01em; }
.q-passage { margin: 12px 0 16px; padding: 16px 20px; border-left: 4px solid var(--c, var(--brand)); border-radius: 0 14px 14px 0; background: var(--bg); font-size: 17px; line-height: 1.7; color: var(--ink); }
.q-formula { display: inline-block; margin: 10px 0; padding: 8px 16px; border-radius: 12px; background: var(--bg); font-size: 19px; font-weight: 800; color: var(--ink); }
.q-formula .gap { display: inline-block; min-width: 1.6em; padding: 0 6px; border-bottom: 3px solid var(--c, var(--brand)); color: var(--c, var(--brand)); text-align: center; }
.q-sentence { margin: 14px 0; padding: 16px 20px; border-radius: 14px; background: var(--bg); font-size: 20px; font-weight: 700; color: var(--ink); }
.q-sentence u { text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.q-blank { display: inline-block; min-width: 46px; padding: 0 8px; border-bottom: 3px solid var(--c, var(--brand)); color: var(--c, var(--brand)); text-align: center; }
.q-svg { display: block; margin: 14px 0; height: auto; }
.answer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.answer input { flex: 0 1 260px; min-height: 54px; padding: 10px 16px; border: 2px solid var(--line); border-radius: 14px; font-size: 22px; font-weight: 800; color: var(--ink); }
.answer input:focus { outline: none; border-color: var(--c, var(--brand)); box-shadow: 0 0 0 4px rgba(22, 62, 196, .14); }
.answer .btn { min-height: 54px; padding: 10px 28px; font-size: 17px; border-radius: 14px; }
.answer__affix { font-size: 20px; font-weight: 800; color: var(--muted); }
.multi { display: flex; flex-wrap: wrap; gap: 12px; }
.multi__f { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 900; color: var(--ink); }
.multi__f input { width: 120px; flex: none; }
.choices { display: grid; gap: 10px; }
.choices--row { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; text-align: left; font-size: 17px; font-weight: 800; color: var(--ink); cursor: pointer; transition: border-color .12s ease, background-color .12s ease; }
.choice:hover:not(:disabled) { border-color: var(--c, var(--brand)); background: var(--brand-soft); }
.choice.is-picked { border-color: var(--c, var(--brand)); background: var(--brand-soft); }
.choice:disabled { cursor: default; }
.choice__key { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 13px; }
.fb { margin-top: 22px; padding: 18px 20px; border-radius: 16px; animation: pop .2s ease; }
.fb--ok { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: var(--ok-soft); color: var(--ok); font-size: 20px; }
.fb--ok span { font-size: 15px; font-weight: 700; color: #163EC4; }
.fb--info { background: #FFF4DE; color: #7A4A00; }
.fb--no { background: #FFF8F1; border: 2px solid #FBD5B5; }
.fb--no h2 { color: #B45309; font-size: 20px; }
.fb__cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 16px; }
.fb__cmp div { padding: 12px 14px; border-radius: 12px; background: #fff; }
.fb__cmp span { display: block; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fb__cmp div:first-child b { color: var(--no); }
.fb__cmp div:last-child b { color: var(--ok); }
.fb__cmp b { font-size: 19px; }
.fb__explain { margin-bottom: 16px; padding: 16px 18px; border-radius: 12px; background: #fff; }
.fb__explain h3 { margin-bottom: 8px; }
.steps { margin: 0; padding-left: 22px; }
.steps li { margin-bottom: 6px; }
.practice__side { position: sticky; top: 84px; display: grid; gap: 12px; }
.side-box { padding: 16px 18px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.side-box__label { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.side-box b { display: block; font-size: 30px; font-weight: 900; color: var(--ink); }
.side-box--score #s-ring { margin: 8px auto 4px; }
.side-box__level { display: block; font-weight: 900; }
.info-btn { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: var(--line); color: var(--ink); font-size: 12px; font-weight: 900; cursor: pointer; }
.ring__bar { transition: stroke-dashoffset .6s cubic-bezier(.2, .8, .2, 1), stroke .3s ease; }
.zones { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); font-weight: 800; }
.zones__bar { position: relative; flex: 1; height: 8px; border-radius: 99px; background: var(--line); overflow: visible; }
.zones__bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; transition: width .6s ease; }
.zones__bar em { position: absolute; top: -3px; width: 2px; height: 14px; background: #0E2CA0; }
.mastered { padding: 30px 10px; text-align: center; }
.mastered__medal { font-size: 80px; animation: bounce 1s ease; }
.mastered .row-actions { justify-content: center; }
@keyframes bounce { 0% { transform: scale(.3); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.skip { display: block; margin-top: 18px; }

/* ---------- Diagnostic ---------- */
.progressbar { height: 10px; margin-bottom: 18px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progressbar i { display: block; height: 100%; width: 0; background: var(--c, var(--brand)); transition: width .4s ease; }
.diag-overall { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.diag-overall b { font-size: 44px; font-weight: 900; color: var(--c); }
.diag-overall span { font-weight: 800; color: var(--muted); }
.diag-bars { display: grid; gap: 10px; margin-bottom: 18px; }
.diag-bar { display: grid; grid-template-columns: 220px 1fr 56px 70px; align-items: center; gap: 12px; font-weight: 700; }
.diag-bar__track { height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; }
.diag-bar__track i { display: block; height: 100%; border-radius: 99px; background: var(--c); }
.diag-bar b { color: var(--ink); }
.diag-bar small { color: var(--muted); }
.mini-diag { margin-bottom: 10px; }
.mini-diag b { display: block; }
.mini-diag span { display: inline-block; margin: 2px 10px 0 0; font-size: 13.5px; color: var(--muted); }

/* ---------- Awards ---------- */
.award-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }
.award-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.award { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 14px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); text-align: center; opacity: .55; filter: grayscale(1); }
.award.is-on { opacity: 1; filter: none; background: linear-gradient(180deg, #FFF8EA, #fff); box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.award__icon { font-size: 44px; line-height: 1.2; }
.award b { color: var(--ink); }
.award span { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.award-row span { font-size: 26px; margin-right: 4px; }

/* ---------- Teacher ---------- */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.class-card { display: flex; flex-direction: column; gap: 4px; padding: 22px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); border-left: 6px solid var(--brand); color: var(--ink); text-decoration: none !important; transition: transform .15s ease; }
.class-card:hover { transform: translateY(-3px); }
.class-card b { font-size: 19px; }
.class-card span, .class-card small { color: var(--muted); font-weight: 700; }
.grid { border-collapse: separate; border-spacing: 3px; font-size: 13px; }
.grid th { padding: 4px 8px; text-align: left; font-weight: 800; white-space: nowrap; }
.grid thead th { vertical-align: bottom; }
.grid__sk span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12px; color: var(--muted); }
.cell { display: flex; align-items: center; justify-content: center; width: 38px; height: 30px; border-radius: 6px; color: #fff; font-weight: 900; font-size: 12px; }
.trouble { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.trouble__item { padding: 18px; border-radius: 14px; border: 1.5px solid var(--line); border-top: 5px solid var(--no); }
.trouble__head b { display: block; color: var(--ink); }
.trouble__head span { font-size: 13.5px; }
.trouble__count { margin: 10px 0 6px; font-weight: 900; color: var(--no); }
.trouble__group { margin: 0; padding-left: 18px; font-size: 14.5px; }

/* ---------- Learner report ---------- */
.report__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.report__head h2 { font-size: clamp(24px, 3vw, 32px); }
.report__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bars__col i { display: block; width: 100%; min-height: 2px; border-radius: 6px 6px 2px 2px; background: var(--brand); }
.bars__col span { font-size: 11px; font-weight: 800; color: var(--muted); }

/* ---------- Login cards ---------- */
/* An ID-card style login card: a coloured band with the school, the learner's initials and name, the sign-in details
 * in a clear panel, and a QR code of the sign-in address. Six colour themes rotate through a class set. */
.login-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; margin: 14px 0 18px; }
.card-login { --c1: #163EC4; --c2: #0E2CA0; --c3: #EEF3FF; --ci: #0E2CA0;
    position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: #fff; color: #0F172A;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--c1) 22%, #fff), 0 18px 36px -24px color-mix(in srgb, var(--c1) 70%, #000);
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.card-login--1 { --c1: #0EA5E9; --c2: #2563EB; --c3: #EFF8FF; --ci: #075985; }
.card-login--2 { --c1: #10B981; --c2: #0D9488; --c3: #ECFDF5; --ci: #065F46; }
.card-login--3 { --c1: #F97316; --c2: #E11D48; --c3: #FFF4ED; --ci: #9A3412; }
.card-login--4 { --c1: #D946EF; --c2: #0E2CA0; --c3: #FDF4FF; --ci: #86198F; }
.card-login--5 { --c1: #F59E0B; --c2: #EA580C; --c3: #FFFBEB; --ci: #92400E; }
.card-login__band { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 18px 30px; overflow: hidden;
    background: radial-gradient(circle at 92% -30%, rgba(255, 255, 255, .35) 0 60px, transparent 61px), radial-gradient(circle at 70% 160%, rgba(255, 255, 255, .18) 0 70px, transparent 71px), linear-gradient(120deg, var(--c1), var(--c2)); color: #fff; }
.card-login__mark { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; background: #fff; color: var(--c2); font: 900 13px/1 var(--head, inherit); letter-spacing: -.02em; box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .5); }
.card-login__org { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.card-login__org small { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.card-login__org b { overflow: hidden; font-size: 15.5px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.card-login__body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 14px; margin-top: -20px; padding: 0 18px 12px; }
.card-login__who { grid-column: 1 / -1; display: flex; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.card-login__av { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 54px; height: 54px; border: 4px solid #fff; border-radius: 50%; background: linear-gradient(135deg, var(--c2), var(--c1)); color: #fff; font-size: 19px; font-weight: 900; letter-spacing: .02em; box-shadow: 0 8px 16px -10px rgba(0, 0, 0, .55); }
.card-login__name { padding-bottom: 4px; color: #0F172A; font-size: 19px; font-weight: 900; line-height: 1.15; letter-spacing: -.01em; }
.card-login__creds { display: grid; gap: 8px; margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--c3); }
.card-login__creds > div { display: grid; grid-template-columns: 86px minmax(0, 1fr); align-items: baseline; gap: 8px; }
.card-login__creds dt { color: var(--ci); font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.card-login__creds dd { margin: 0; color: #0F172A; font-size: 14.5px; font-weight: 700; overflow-wrap: break-word; }
.card-login__url dd { font-size: 12.5px; font-weight: 600; color: #334155; }
.card-login__pw { justify-self: start; white-space: nowrap; padding: 2px 10px; border: 1.5px dashed var(--c1); border-radius: 8px; background: #fff; font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 16px !important; letter-spacing: .06em; }
.card-login__qr { display: none; align-self: end; width: 74px; height: 74px; padding: 6px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--c3); }
.card-login__qr.is-on { display: block; } .card-login__qr svg { display: block; width: 100%; height: 100%; }
.card-login__qr svg path, .card-login__qr svg rect[fill="black"], .card-login__qr svg rect:not([fill="white"]) { fill: #0F172A; }
.card-login__foot { margin: auto 0 0; padding: 8px 18px; border-top: 1px dashed color-mix(in srgb, var(--c1) 30%, #fff); background: linear-gradient(90deg, var(--c3), #fff); color: var(--ci); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
@media (max-width: 420px) { .login-cards { grid-template-columns: 1fr; } .card-login__qr { display: none !important; } }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
    .practice__grid, .report__grid { grid-template-columns: 1fr; }
    .practice__side { position: static; grid-template-columns: repeat(3, 1fr); order: -1; }
    .side-box b { font-size: 22px; }
    .side-box--score #s-ring svg { width: 84px; height: 84px; }
    .diag-bar { grid-template-columns: 1fr 50px; }
    .diag-bar__track { grid-column: 1 / -1; grid-row: 2; }
    .diag-bar small { display: none; }
}
@media (max-width: 560px) {
    .practice__side { grid-template-columns: 1fr 1fr; }
    .side-box--score { grid-column: 1 / -1; }
    .fb__cmp { grid-template-columns: 1fr; }
    .hello { padding: 22px; }
    .panel { padding: 18px; }
}

/* ---------- Print: login cards or a learner report only ---------- */
@media print {
    html, body { background: #fff !important; }
    .table-wrap { overflow: visible !important; } .table-wrap > table { width: 100%; }
    .header, .toasts, .no-print, .tabs, .crumbs { display: none !important; }
    .panel, .kpis > div { box-shadow: none; border: 1px solid #ddd; }
    body.printing-cards > *:not(.modal) { display: none !important; }
    body.printing-cards .modal { position: static; padding: 0; background: none; }
    body.printing-cards .modal__head, body.printing-cards .modal__body > *:not(#login-cards) { display: none !important; }
    body.printing-cards .modal__box { box-shadow: none; max-width: none; border: 0; animation: none; }
    body.printing-cards .modal__body { max-height: none; overflow: visible; padding: 0; }
    body.printing-cards .login-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8mm 6mm; margin: 0; }
    body.printing-cards, body.printing-cards .modal, body.printing-cards .modal__box { background: #fff !important; min-height: 0; }
    body.printing-cards .card-login { break-inside: avoid; box-shadow: 0 0 0 1px #CBD5E1; }
    body.printing-cards .card-login__creds > div { grid-template-columns: 74px minmax(0, 1fr); }
    body.printing-cards .card-login__url dd { font-size: 11.5px; }
    body.printing-cards .card-login__qr { display: none !important; } body.printing-cards .card-login__qr.is-on { display: block !important; }
    body.printing-report .modal { display: none; }
    /* a learner's progress report: one clean document */
    body.printing-report .side, body.printing-report .bgfx, body.printing-report .ai-fab { display: none !important; }
    body.printing-report #app { margin: 0 !important; }
    body.printing-report .wrap.page { max-width: none; padding: 0; }
    body.printing-report .report .panel, body.printing-report .report .kpis > div { break-inside: avoid; }
    body.printing-report .report .table-wrap { overflow: visible; }
    body.printing-report .report tr { break-inside: avoid; }
    body.printing-report .report__grid { grid-template-columns: 1fr 1fr; }
    @page { size: A4; margin: 12mm; }
}

/* ---------- Two curricula: badges, switch, stage groups, exam-frequency marker ---------- */
.badge--cbe { background: #E7F8F1; color: #047857; }
.badge--cambridge { background: #EEF3FF; color: #0E2CA0; }
.seg { display: inline-flex; gap: 4px; margin-bottom: 16px; padding: 4px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); }
.seg__btn { padding: 7px 16px; border-radius: 9px; font-weight: 800; color: var(--muted); text-decoration: none !important; }
.seg__btn.is-on { background: var(--brand); color: #fff; }
.stages { display: grid; gap: 10px; margin-bottom: 24px; }
.stage { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stage__name { min-width: 150px; font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hot { font-size: 15px; }
.q-table { margin: 12px 0; border-collapse: collapse; font-size: 16px; }
.q-table th, .q-table td { padding: 8px 14px; border: 1.5px solid var(--line); text-align: center; }
.q-table th { background: var(--bg); text-align: left; }
.checks { margin: 0 0 14px; padding: 0; border: 0; }
.checks legend { margin-bottom: 8px; font-weight: 800; color: var(--ink); }
.checks label, .check { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-weight: 700; }
.checks input, .check input { width: 20px; height: 20px; accent-color: var(--brand); }
.checks small { color: var(--muted); }

/* ---------- Exam revision ---------- */
.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.exam-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); border-top: 6px solid #E8590C; color: var(--ink); text-decoration: none !important; transition: transform .15s ease; }
.exam-card:hover { transform: translateY(-3px); }
.exam-card.is-mine { box-shadow: 0 0 0 3px #E8590C, var(--shadow); }
.exam-card b { font-size: 21px; }
.exam-card__level { font-size: 12.5px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: #E8590C; }
.exam-card__meta { font-size: 14px; color: var(--muted); font-weight: 700; }
.exam-subject h2 { display: flex; align-items: center; gap: 10px; }
.subject-card__icon--sm { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--c); color: #fff; font-size: 16px; }
.exam-last { padding: 10px 14px; border-radius: 10px; background: var(--bg); font-weight: 700; }
.mock__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.mock__head h1 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); }
.mock__timer { padding: 10px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.mock__timer.is-low { background: var(--no); }
.mock__grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 22px; align-items: start; }
.mock__side { position: sticky; top: 84px; padding: 18px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.mock__map { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 10px 0 14px; }
.mock__dot { height: 34px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; font-weight: 800; cursor: pointer; }
.mock__dot.is-done { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.mock__dot.is-on { box-shadow: 0 0 0 3px var(--accent); }
.mock__topic { margin: 0 0 8px; font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--c); }
.mock__nav { margin-top: 18px; }
.review { margin: 0; padding-left: 22px; }
.review__item { margin-bottom: 14px; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--line); }
.review__item.is-ok { border-left: 5px solid var(--ok); }
.review__item.is-no { border-left: 5px solid var(--no); }
.review__q .q-big { font-size: 22px; margin: 6px 0; }
.review__q .q-svg { max-width: 220px; }
.review__tag { font-weight: 900; margin-right: 6px; }
.review__item.is-ok .review__tag { color: var(--ok); }
.review__item.is-no .review__tag { color: var(--no); }
.review details { margin-top: 8px; padding: 10px 14px; border-radius: 10px; background: #FFF8F1; }
.review summary { font-weight: 800; cursor: pointer; }
@media (max-width: 900px) {
    .mock__grid { grid-template-columns: 1fr; }
    .mock__side { position: static; order: -1; }
    .mock__map { grid-template-columns: repeat(10, 1fr); }
    .stage__name { min-width: 100%; }
}

/* ---------- Diagrams in questions ---------- */
.q-fig { max-width: min(100%, 460px); height: auto; margin: 14px 0; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 3px; line-height: 1; font-weight: 900; }
.frac sup, .frac sub { font-size: .8em; top: 0; bottom: 0; }
.frac sup { padding: 0 4px 2px; border-bottom: 2.5px solid currentColor; }
.frac sub { padding-top: 2px; }

/* ---------- Interactive answers ---------- */
.answer--widget { display: block; }
.answer--widget > .btn { margin-top: 6px; }
.widget { margin: 4px 0 6px; }
.widget__hint { margin: 6px 0 12px; font-size: 14px; font-weight: 700; color: var(--muted); }
.widget__hint::before { content: '☝ '; }
.wsvg { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; border-radius: 14px; }
.wsvg:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.wsvg--nl { max-width: 680px; background: linear-gradient(180deg, #F8F9FF, #fff); border: 2px solid var(--line); }
.wsvg--plot { max-width: 380px; border: 2px solid var(--line); }
.wsvg--clock { max-width: 260px; }
.wsvg--bars { max-width: 560px; border: 2px solid var(--line); background: #fff; }
.wsvg--shade { max-width: 600px; }
.wsvg--circle { max-width: 250px; }
.wsvg--grid { max-width: 420px; }
.w-part { transition: fill .12s ease; }
.w-part:hover { opacity: .85; }
.w-pin { transition: transform .08s ease-out; }
.widget__count { margin: 8px 0 0; font-weight: 700; color: var(--muted); }
.widget__count b { color: var(--brand); font-size: 18px; }
.is-locked .wsvg, .is-locked .tile, .is-locked .bk__chip, .is-locked .bk__bin { cursor: default; pointer-events: none; }
/* ordering */
.order { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px; border-radius: 16px; background: var(--bg); }
.order__list { display: flex; flex-wrap: wrap; gap: 10px; flex: 1; min-width: 0; }
.order--v { flex-direction: column; align-items: stretch; }
.order--v .order__list { flex-direction: column; }
.order__end { font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tile { min-width: 54px; min-height: 52px; padding: 10px 16px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; background: #fff; font-size: 18px; font-weight: 800; color: var(--ink); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; text-align: left; transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
.tile:hover { border-color: var(--c, var(--brand)); }
.tile.is-sel { border-color: var(--accent); background: #FFF8EA; transform: translateY(-3px); box-shadow: 0 8px 18px -10px rgba(0,0,0,.4); }
.tile.is-drag { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.06) rotate(-1.5deg); box-shadow: 0 14px 26px -14px rgba(22, 62, 196,.8); cursor: grabbing; }
/* sorting into groups */
.bk__tray { display: flex; flex-wrap: wrap; gap: 8px; min-height: 62px; padding: 12px; margin-bottom: 12px; border: 2px dashed var(--line); border-radius: 16px; background: var(--bg); }
.bk__done { align-self: center; font-weight: 800; color: var(--ok); }
.bk__bins { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; }
.bk__bin { min-height: 130px; padding: 10px; border: 2px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; transition: border-color .12s ease, background-color .12s ease, transform .12s ease; }
.bk__bin h4 { margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--line); font-size: 14px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: var(--c, var(--brand)); text-align: center; }
.bk__in { display: flex; flex-wrap: wrap; gap: 6px; }
.has-sel .bk__bin, .bk__bin.is-over { border-color: var(--accent); background: #FFFBF2; }
.bk__bin.is-over { transform: scale(1.02); }
.bk__chip { padding: 8px 12px; border: 2px solid var(--line); border-bottom-width: 3px; border-radius: 12px; background: #fff; font-weight: 800; font-size: 15px; color: var(--ink); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.bk__chip.is-sel { border-color: var(--accent); background: #FFF8EA; box-shadow: 0 0 0 3px rgba(245,165,36,.3); }
.bk__chip.is-drag { opacity: .35; }
.bk__ghost { position: fixed; z-index: 300; pointer-events: none; transform: translate(-50%, -60%) rotate(-3deg); border-color: var(--brand); box-shadow: 0 14px 26px -12px rgba(23,32,54,.5); }
@media (max-width: 560px) { .bk__bins { grid-template-columns: 1fr; } .bk__bin { min-height: 80px; } .tile { font-size: 16px; padding: 8px 12px; } }

/* ---------- Practice: motion and feedback ---------- */
.qcard { position: relative; }
.qcard__top { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-height: 30px; margin: -8px 0 6px; }
.streak { margin-right: auto; padding: 5px 12px; border-radius: 999px; background: #FFF1E6; color: #C2410C; font-weight: 800; font-size: 14px; }
.streak b { font-size: 16px; }
.streak.is-pop { animation: popIn .45s cubic-bezier(.2, 1.6, .4, 1); }
.sound-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 800; color: var(--muted); cursor: pointer; }
.sound-btn:hover { border-color: var(--brand); color: var(--brand); }
.q--in { animation: slideIn .35s ease both; }
.qcard.is-shake { animation: shake .45s ease; }
.choice.is-right { border-color: var(--ok); background: var(--ok-soft); }
.choice.is-right .choice__key { background: var(--ok); color: #fff; }
.choice.is-wrong { border-color: var(--no); background: var(--no-soft); }
.choice.is-wrong .choice__key { background: var(--no); color: #fff; }
.fb__check { display: inline-flex; width: 40px; height: 40px; }
.fb__check svg { width: 100%; height: 100%; }
.fb__check circle { fill: var(--ok); stroke: none; transform-origin: center; animation: popIn .35s ease both; }
.fb__check path { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .35s .15s ease forwards; }
.fb__streak { color: #C2410C !important; }
.mastered__medal svg { filter: drop-shadow(0 12px 18px rgba(224, 142, 11, .35)); }
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 400; pointer-events: none; }
.fx-float { position: absolute; z-index: 401; transform: translateX(-50%); font-size: 22px; font-weight: 900; color: var(--ok); pointer-events: none; animation: floatUp 1.2s ease-out forwards; text-shadow: 0 2px 0 #fff; }
.fx-float--no { color: var(--no); }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 20% { opacity: 1; transform: translate(-50%, -6px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -60px) scale(1); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- Illustrations and home banner ---------- */
.hello { position: relative; overflow: hidden; flex-wrap: nowrap; }
.hello__main { position: relative; z-index: 1; flex: 1; min-width: 0; }
.hello__main .hello__stats { margin-top: 16px; }
.hello__art { flex: none; width: 260px; height: auto; margin: -10px -6px -30px 0; }
.hello__kid { animation: bob 3.2s ease-in-out infinite; transform-origin: 130px 120px; }
.hello__star { animation: spinStar 6s ease-in-out infinite; transform-origin: 178px 38px; }
.twinkle { animation: twinkle 2.4s ease-in-out infinite; }
.hello__row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 14px; }
.goal { display: flex; align-items: center; gap: 12px; }
.goal span { font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, .85); }
.goal b { display: block; font-size: 16px; color: #fff; }
.goal__bar { transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); }
.week { display: flex; gap: 6px; }
.week__day { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; color: rgba(255, 255, 255, .75); }
.week__day i { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .14); font-style: normal; font-size: 15px; }
.week__day.is-on i { background: #fff; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .35); }
.week__day.is-today { color: #fff; }
.week__day.is-today i { outline: 2px solid #FFD27A; outline-offset: 2px; }
.subject-card__icon svg { color: var(--c); }
.subject-card__icon { padding: 10px; transition: transform .2s cubic-bezier(.2, 1.6, .4, 1); }
.subject-card:hover .subject-card__icon { transform: rotate(-6deg) scale(1.08); }
.subject-card__icon--sm { padding: 6px; }
.subject-card__bar { display: block; height: 8px; margin-top: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.subject-card__bar i { display: block; height: 100%; border-radius: 99px; background: var(--c); }
.page-head--subject { display: flex; align-items: center; justify-content: flex-start; gap: 18px; }
.page-head__icon { flex: none; width: 64px; height: 64px; margin: 0; border-radius: 18px; background: var(--c); }
.auth__art { display: block; width: 100%; max-width: 300px; height: auto; margin: -8px auto 6px; }
.float1 { animation: bob 3s ease-in-out infinite; }
.float2 { animation: bob 3.4s .4s ease-in-out infinite; }
.float3 { animation: bob 2.8s .8s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes spinStar { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(18deg) scale(1.12); } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (max-width: 900px) { .hello__art { width: 180px; margin-bottom: -20px; } }
@media (max-width: 680px) { .hello { flex-wrap: wrap; } .hello__art { display: none; } .page-head__icon { width: 48px; height: 48px; border-radius: 14px; } }
