/* Identity comes from the dev. mark: its slate, and the green dot, which is
   the one accent that recurs on every page. The four design-cycle colours
   (A blue, B green, C yellow, D red) are kept for status only. */
:root {
  --ink: #16222e;
  --ink-2: #24384a;
  --dot: #72dc5f;
  --head: var(--ink);
  --text: #24324d;
  --muted: #5d6b85;
  --paper: #f3f5f9;
  --surface: #ffffff;
  --line: #d8dee9;
  --a: #2f74b5;
  --a-dark: #245d94;
  --b: #23915f;
  --c: #f2c230;
  --d: #dc4f2a;
  --display: 'Urbanist', 'Segoe UI', sans-serif;
  --body: 'Onest', 'Segoe UI', sans-serif;
  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 16px/1.55 var(--body);
}
h1, h2, h3 { font-family: var(--display); color: var(--head); margin: 0; line-height: 1.12; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 650; }
h3 { font-size: 1.1rem; font-weight: 650; letter-spacing: -0.005em; }
p { margin: 0; }
a { color: var(--a-dark); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--c); outline-offset: 2px; border-radius: 4px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 0.95rem/1 var(--body);
  padding: 12px 18px; border-radius: var(--r-s);
  border: 1.5px solid var(--ink); background: var(--ink); color: #fff;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.quiet { background: transparent; color: var(--head); border-color: var(--line); }
.btn.quiet:hover { border-color: var(--head); background: transparent; }
.btn.go { background: var(--b); border-color: var(--b); }
.btn.go:hover { background: #1c7a50; border-color: #1c7a50; }
.btn.danger { background: transparent; color: var(--d); border-color: #f0c4b7; }
.btn.danger:hover, .btn.danger.armed { background: var(--d); border-color: var(--d); color: #fff; }
.btn.small { padding: 8px 12px; font-size: .85rem; }
.btn.wide { width: 100%; padding: 14px 18px; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--a-dark); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.field { display: grid; gap: 6px; }
.field > span { font-size: .875rem; font-weight: 600; color: var(--head); }
.field small { color: var(--muted); font-size: .8rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select {
  width: 100%; font: 400 1rem var(--body); color: var(--head);
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-s); background: var(--surface);
}
input:focus-visible, select:focus-visible { outline: none; border-color: var(--a); box-shadow: 0 0 0 3px rgba(47, 116, 181, .2); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--a); margin: 0; flex: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 600; line-height: 1;
  padding: 5px 9px; border-radius: 99px; background: #e8ecf3; color: var(--ink-2); white-space: nowrap;
}
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.plain::before { display: none; }
.chip.active, .chip.approved { background: #dff2e8; color: #156241; }
.chip.pending, .chip.unverified { background: #fdf1c7; color: #7a5a00; }
.chip.suspended, .chip.rejected, .chip.paused, .chip.ended { background: #fbe2da; color: #a23412; }
.chip.teacher { background: #e1ecf7; color: var(--a-dark); }

.notice { padding: 12px 14px; border-radius: var(--r-s); font-size: .92rem; background: #e1ecf7; color: #16222e; border-left: 4px solid var(--a); }
.notice.error { background: #fbe2da; border-color: var(--d); }
.notice.ok { background: #dff2e8; border-color: var(--b); }
.notice.wait { background: #fdf1c7; border-color: var(--c); }

.toasts { position: fixed; inset: auto 16px 16px auto; display: grid; gap: 8px; z-index: 90; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-s); font-size: .92rem; box-shadow: 0 12px 30px rgba(22, 34, 46, .28); border-left: 4px solid var(--b); }
.toast.error { border-color: var(--d); }

/* The wordmark: the dev. logo image, then "Academy" set on its baseline. */
.brand { display: inline-flex; align-items: baseline; gap: .42em; font: 500 1.3rem var(--display); color: var(--head); text-decoration: none; letter-spacing: -0.01em; }
.brand img { height: 1.02em; width: auto; display: block; }
/* Page titles end on the green dot, the same full stop as in the logo. */
.dot::after { content: '.'; color: var(--dot); }

/* ---------- sign-in ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-form { display: flex; flex-direction: column; padding: 32px clamp(20px, 6vw, 88px) 40px; background: var(--surface); }
.auth-form .view { margin: auto 0; padding: 40px 0; max-width: 420px; width: 100%; display: grid; gap: 22px; }
.auth-form .view > p { color: var(--muted); }
.auth-form form { display: grid; gap: 16px; }
.auth-form .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .92rem; }
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.roles label { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-s); cursor: pointer; font-weight: 600; color: var(--head); }
.roles label:has(input:checked) { border-color: var(--a); background: #eef4fb; }
.class-card { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--r-m); background: var(--ink); color: #fff; }
.class-card strong { font: 650 1.15rem var(--display); }
.class-card span { color: #b9c6dc; font-size: .9rem; }

.auth-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.brand.big { font-size: clamp(1.9rem, 3vw, 2.5rem); }
/* fixed partner logos: small, quiet, top right of the white side */
.partners { display: flex; align-items: center; gap: 18px; }
.partners img { height: 30px; width: auto; display: block; }
.partners img + img { padding-left: 18px; border-left: 1px solid var(--line); box-sizing: content-box; }
.terms { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--text); line-height: 1.45; }
.terms input { margin-top: 2px; }
.sub-links { display: grid; gap: 8px; justify-items: start; font-size: .95rem; color: var(--muted); }

.auth-foot { display: grid; gap: 18px; max-width: 420px; }
.publisher { display: grid; gap: 2px; padding-top: 18px; border-top: 1px solid var(--line); }
.publisher span:first-child { font-size: .75rem; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.publisher strong { font: 700 1.15rem var(--display); color: var(--head); letter-spacing: -0.005em; }
.publisher span:last-child { font: 500 .9rem var(--display); color: var(--muted); }
.legal-line { font-size: .74rem; color: #8590a3; }
.legal-line a { color: inherit; }

.auth-art { position: relative; overflow: hidden; background: var(--ink); color: #fff; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 720px; }
.auth-art::before, .auth-art::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.auth-art::before { width: 520px; height: 520px; left: -330px; top: -330px; background: rgba(114, 220, 95, .18); }
.auth-art::after { width: 520px; height: 520px; left: -250px; top: -390px; background: rgba(114, 220, 95, .11); }
.auth-art > * { position: relative; }
.slogan-block { padding: clamp(40px, 6vw, 84px) clamp(28px, 5vw, 72px) 0; display: grid; gap: 22px; z-index: 1; }
.slogan { font: 800 clamp(3rem, 6.6vw, 6.2rem)/.98 var(--display); letter-spacing: -0.035em; color: #fff; display: grid; }
/* each line rises out of its own mask, one after the other */
.slogan span { display: block; overflow: hidden; padding-bottom: .08em; }
.slogan span b { display: block; font-weight: inherit; transform: translateY(110%); }
.slogan i { font-style: normal; color: var(--dot); }
.slogan-sub { font: 500 clamp(1.05rem, 1.5vw, 1.35rem)/1.4 var(--display); color: #b4c2cf; max-width: 24ch; opacity: 0; }
body.ready .slogan span b { animation: rise .8s cubic-bezier(.2, .8, .2, 1) forwards; }
body.ready .slogan span:nth-child(2) b { animation-delay: .16s; }
body.ready .slogan span:nth-child(3) b { animation-delay: .32s; }
body.ready .slogan-sub { animation: fade .8s .75s forwards; }
@keyframes rise { to { transform: none; } }
@keyframes fade { to { opacity: 1; } }

.gears { position: absolute; right: -90px; bottom: 170px; width: min(48%, 400px); opacity: .9; }
.gears svg { width: 100%; height: auto; display: block; overflow: visible; }
.gears .spin { transform-box: fill-box; transform-origin: center; animation: turn 80s linear infinite; }
.gears .spin.fast { animation-duration: 40s; animation-direction: reverse; }
@keyframes turn { to { transform: rotate(360deg); } }

/* Programme logos travel round a ring; the pointer steers its speed and direction. */
.orbit { grid-row: 3; height: 150px; position: relative; perspective: 900px; border-top: 1px solid rgba(255, 255, 255, .08); background: linear-gradient(rgba(22, 34, 46, .2), rgba(11, 18, 25, .85)); cursor: ew-resize; }
.orbit img { position: absolute; left: 50%; top: 50%; height: 44px; width: auto; will-change: transform, opacity; pointer-events: none; }

/* ---------- opening sequence (about six seconds, once per visit) ---------- */
.opening { position: fixed; inset: 0; z-index: 100; background: var(--ink); color: #fff; display: grid; place-items: center; overflow: hidden; }
.opening::before { content: ''; position: absolute; width: 140vmax; height: 140vmax; border-radius: 50%; left: -95vmax; top: -95vmax; background: rgba(114, 220, 95, .12); animation: drift 6s ease-out forwards; }
@keyframes drift { to { transform: translate(8vmax, 8vmax); } }
.intro-logo { position: absolute; width: min(46vw, 420px); height: auto; animation: logoIn 1.3s cubic-bezier(.2, .8, .2, 1) both, logoUp .7s 1.35s cubic-bezier(.6, 0, .2, 1) forwards; }
@keyframes logoIn { from { opacity: 0; transform: scale(.82); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes logoUp { to { transform: translateY(calc(-50vh + 56px)) scale(.3); } }
.intro-lines { display: grid; gap: clamp(6px, 2.2vh, 26px); padding: 0 24px; width: min(880px, 100%); margin-top: 40px; }
.intro-lines p { display: flex; align-items: center; gap: clamp(14px, 3vw, 40px); flex-wrap: wrap; overflow: hidden; }
.intro-lines b { font: 800 clamp(2.4rem, min(8vw, 13vh), 6rem)/1 var(--display); letter-spacing: -0.035em; transform: translateY(115%); animation: rise .7s cubic-bezier(.2, .8, .2, 1) forwards; }
.intro-lines b i { font-style: normal; color: var(--dot); }
.intro-lines span { display: flex; align-items: center; gap: 18px; font: 500 clamp(.95rem, 1.5vw, 1.25rem) var(--display); color: #b4c2cf; opacity: 0; animation: fade .5s forwards; }
.intro-lines span img { height: clamp(24px, 3.4vw, 38px); width: auto; }
.intro-lines p:nth-child(1) b { animation-delay: 1.9s; } .intro-lines p:nth-child(1) span { animation-delay: 2.3s; }
.intro-lines p:nth-child(2) b { animation-delay: 2.9s; } .intro-lines p:nth-child(2) span { animation-delay: 3.3s; }
.intro-lines p:nth-child(3) b { animation-delay: 3.9s; } .intro-lines p:nth-child(3) span { animation-delay: 4.3s; }
.intro-end { position: absolute; bottom: 12vh; font: 500 clamp(1rem, 1.6vw, 1.3rem) var(--display); color: #fff; opacity: 0; animation: fade .6s 4.8s forwards; }
.intro-skip { position: absolute; right: 22px; bottom: 20px; background: none; border: 1px solid rgba(255, 255, 255, .25); color: #c9d4de; font: 500 .82rem var(--body); padding: 8px 12px; border-radius: var(--r-s); cursor: pointer; }
.intro-skip:hover { color: #fff; border-color: #fff; }
.opening.out { animation: curtain .65s cubic-bezier(.7, 0, .2, 1) forwards; }
@keyframes curtain { to { transform: translateY(-100%); } }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 0; }
  .gears { display: none; }
  .slogan-block { padding-bottom: 28px; }
  .orbit { height: 110px; }
  .orbit img { height: 32px; }
  .auth-form .view { padding: 28px 0; }
}

/* ---------- shared bits ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.logo { display: block; width: auto; }
.file-pick { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .88rem; color: var(--muted); min-width: 0; }
.file-pick:focus-within .btn { outline: 3px solid var(--c); outline-offset: 2px; }
.date-field { display: inline-flex; gap: 6px; }
.date-field select { width: auto; padding: 8px 8px; font-size: .86rem; }
textarea { width: 100%; font: 400 .95rem/1.5 var(--body); color: var(--head); padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r-s); background: var(--surface); resize: vertical; min-height: 84px; }
textarea:focus-visible { outline: none; border-color: var(--a); box-shadow: 0 0 0 3px rgba(47, 116, 181, .2); }

.bell-wrap { position: relative; }
.bell { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--head); cursor: pointer; }
.bell:hover { border-color: var(--head); }
.bell b { position: absolute; top: -4px; right: -4px; min-width: 18px; padding: 2px 4px; border-radius: 99px; background: var(--d); color: #fff; font-size: .68rem; line-height: 1.2; text-align: center; }
.notes { position: absolute; right: 0; top: 48px; width: min(360px, calc(100vw - 32px)); max-height: 440px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: 0 24px 50px -18px rgba(22, 34, 46, .4); padding: 14px; display: grid; gap: 4px; z-index: 30; color: var(--text); }
.notes > strong { font: 700 1rem var(--display); color: var(--head); padding: 2px 6px 8px; }
.notes > p { color: var(--muted); font-size: .9rem; padding: 6px; }
.note { display: grid; gap: 2px; padding: 10px; border-radius: var(--r-s); font-size: .88rem; color: var(--text); text-decoration: none; white-space: normal; }
a.note:hover { background: var(--paper); }
.note.new { background: #eefbea; box-shadow: inset 3px 0 0 var(--dot); }
.note-title { font-weight: 600; color: var(--head); }
.note small { color: var(--muted); }
.me { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; min-width: 0; }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font: 700 .95rem var(--display); box-shadow: inset 0 -3px 0 var(--dot); }
@media (max-width: 640px) { .me strong { display: none; } }

/* ---------- profile ---------- */
.profile { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.profile form, .profile .card { display: grid; gap: 16px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: .93rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--head); font-weight: 600; overflow-wrap: anywhere; }



/* ---------- programmes ---------- */
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.doors { perspective: 1200px; }
.door { --tone: var(--ink); position: relative; transform-style: preserve-3d; will-change: transform; animation: doorIn .7s cubic-bezier(.2, .8, .2, 1) backwards; display: grid; gap: 14px; align-content: start; padding: 18px 18px 20px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--tone); color: inherit; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.door:hover, .door:focus-visible { box-shadow: 0 26px 44px -22px rgba(22, 34, 46, .55); }
.door:nth-child(2) { animation-delay: .08s; } .door:nth-child(3) { animation-delay: .16s; } .door:nth-child(4) { animation-delay: .24s; }
@keyframes doorIn { from { opacity: 0; transform: translateY(40px) rotateX(-18deg); } }

.door .logo { height: 48px; max-width: 100%; object-fit: contain; object-position: left center; }
.door p { color: var(--muted); font-size: .92rem; }
.door .count { font-size: .86rem; font-weight: 600; color: var(--head); }
[data-programme=myp] { --tone: #e1251b; }
[data-programme=pyp] { --tone: #f5a800; }
[data-programme=vex-iq] { --tone: #0077c8; }
[data-programme=vex-v5] { --tone: #d22630; }

.hero { position: relative; overflow: hidden; background: var(--hero-bg, #fff); color: var(--hero-text, var(--ink)); border-bottom: 1px solid var(--line); }
.hero-in { position: relative; max-width: 1180px; margin: 0 auto; padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 40px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; min-height: 440px; }
.hero-text { display: grid; gap: 18px; justify-items: start; }
.hero-text h1 { color: inherit; font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 800; }
.hero-text p { color: var(--hero-soft, var(--muted)); font-size: 1.1rem; max-width: 46ch; }
.hero-logos { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-logos { align-items: center; gap: 22px; }
.hero-logos .logo { height: 54px; }
/* the grey VEX lettering needs a lift on the dark V5 page */
body[data-programme=vex-v5] .hero-logos .logo, body[data-programme=vex-iq] .hero-logos .logo { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .55)) brightness(1.25); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-facts span { font-size: .86rem; font-weight: 600; padding: 7px 12px; border-radius: 99px; background: var(--hero-chip, #eef1f6); color: var(--hero-text, var(--ink)); }
.hero-visual { position: relative; height: 400px; min-width: 0; }
.hero-visual canvas, .hero-visual svg { width: 100%; height: 100%; display: block; }
.hero-visual canvas { cursor: grab; touch-action: pan-y; }
.hero-visual .hint { position: absolute; right: 8px; bottom: 0; font-size: .8rem; color: var(--hero-soft, var(--muted)); }

body[data-programme=myp] { --hero-bg: linear-gradient(120deg, #ffffff 40%, #e6f1fb); }
body[data-programme=pyp] { --hero-bg: linear-gradient(120deg, #fffdf5 40%, #ffeeb8); }
/* VEX IQ: bright plastic blue, with the round pin holes of an IQ beam */
body[data-programme=vex-iq] { --hero-text: #fff; --hero-soft: #d5e9f8; --hero-chip: rgba(255, 255, 255, .16);
  --hero-bg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34'%3E%3Ccircle cx='17' cy='17' r='6' fill='%23ffffff' fill-opacity='.07'/%3E%3C/svg%3E"), linear-gradient(135deg, #0a8ae0, #005a9e); }
/* VEX V5: dark machined metal, with the square holes of a C-channel */
body[data-programme=vex-v5] { --hero-text: #fff; --hero-soft: #b9bec6; --hero-chip: rgba(255, 255, 255, .1);
  --hero-bg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Crect x='10' y='10' width='10' height='10' fill='%23ffffff' fill-opacity='.05'/%3E%3C/svg%3E"), linear-gradient(135deg, #1b1e23, #0d0f12 70%, #3a0d11); }
body[data-programme=vex-v5] .hero { border-bottom: 4px solid #d22630; }
.blocks rect { transform-box: fill-box; transform-origin: center; }
@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; min-height: 0; }
  .hero-visual { height: 300px; }
}

/* ---------- legal ---------- */
.legal { max-width: 1080px; margin: 0 auto; padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 40px) 96px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; }
.legal nav { position: sticky; top: 92px; display: grid; gap: 8px; font-size: .9rem; }
.legal nav a { color: var(--muted); text-decoration: none; }
.legal nav a:hover { color: var(--head); text-decoration: underline; }
.legal article { display: grid; gap: 34px; max-width: 68ch; }
.legal article header { display: grid; gap: 12px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.legal article header p { color: var(--muted); }
.legal section { display: grid; gap: 12px; scroll-margin-top: 90px; }
.legal section p, .legal section li { line-height: 1.7; }
.legal ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.legal .copyright { padding: 20px 22px; border-radius: var(--r-m); background: var(--ink); color: #dfe7ee; display: grid; gap: 6px; }
.legal .copyright strong { color: #fff; font: 700 1.2rem var(--display); }
@media (max-width: 800px) { .legal { grid-template-columns: 1fr; gap: 28px; } .legal nav { position: static; } }
.site-foot { border-top: 1px solid var(--line); padding: 18px clamp(16px, 4vw, 40px); display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; font-size: .76rem; color: #8590a3; }
.site-foot a { color: var(--muted); }

.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.logo-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; display: grid; gap: 12px; }
.logo-card .logo { height: 60px; max-width: 100%; object-fit: contain; margin: 6px auto; }
.logo-card select { padding: 9px 10px; font-size: .9rem; }


/* ---------- signed-in shell ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 14px clamp(16px, 4vw, 40px); background: rgba(243, 245, 249, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: .9rem; color: var(--muted); min-width: 0; }
.top .who strong { color: var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrap { max-width: 1180px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 40px) 80px; display: grid; gap: 56px; }
.intro { display: grid; gap: 10px; max-width: 62ch; }
.intro p { color: var(--muted); font-size: 1.05rem; }
.section { display: grid; gap: 22px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head p { color: var(--muted); }
.empty { padding: 28px; border: 1.5px dashed var(--line); border-radius: var(--r-m); color: var(--muted); max-width: 60ch; }
.empty strong { display: block; color: var(--head); font: 650 1.1rem var(--display); margin-bottom: 4px; }

/* ---------- the shelf ---------- */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 44px 36px; }
.book { display: grid; gap: 18px; text-decoration: none; color: inherit; align-content: start; }
.book-stage { perspective: 1400px; padding: 0 14px 0 0; }
.book-3d { position: relative; aspect-ratio: 210 / 297; transform-style: preserve-3d; transform: rotateY(-22deg); transform-origin: left center; transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.book:hover .book-3d, .book:focus-visible .book-3d { transform: rotateY(-6deg); }
.book-3d img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 3px 6px 6px 3px; background: #e6eaf1; box-shadow: inset 5px 0 8px -4px rgba(0, 0, 0, .35); display: block; }
/* page block and back cover give the cover real thickness */
.book-3d::before { content: ''; position: absolute; top: 1.2%; bottom: 1.2%; right: 0; width: 26px; transform: translateX(13px) rotateY(90deg) translateX(13px); transform-origin: right center; background: repeating-linear-gradient(90deg, #fff 0 2px, #d9dde5 2px 3px); }
.book-3d::after { content: ''; position: absolute; inset: 0; transform: translateZ(-26px); background: var(--ink); border-radius: 3px 6px 6px 3px; box-shadow: 18px 22px 34px -10px rgba(22, 34, 46, .45); }
.book-3d img { transform: translateZ(0); }
.book.teacher .book-3d::after { background: var(--a-dark); }
.book-info { display: grid; gap: 8px; }
.book-info .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.book-info .until { font-size: .86rem; color: var(--muted); }
.meter { height: 5px; border-radius: 99px; background: #dfe4ed; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--b); border-radius: inherit; }

/* ---------- classes (teacher) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; display: grid; gap: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.card .sub { color: var(--muted); font-size: .9rem; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-size: .85rem; padding: 9px 10px; min-width: 0; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.people li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid #edf0f5; font-size: .9rem; }
.people li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people small { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.new-class { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; display: grid; gap: 16px; max-width: 560px; }
.checks { display: grid; gap: 8px; }
.checks label { display: flex; gap: 10px; align-items: center; font-size: .95rem; }

/* ---------- admin ---------- */
.admin { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100dvh; }
.side { background: var(--ink); color: #c6d2e6; padding: 24px 14px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.side .brand { color: #fff; padding: 0 10px; }
.side nav { display: grid; gap: 2px; }
.side nav button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; background: none; border: 0; color: inherit; font: 500 .96rem var(--body); padding: 10px 12px; border-radius: var(--r-s); cursor: pointer; }
.side nav button:hover { color: #fff; }
.side nav button[aria-current=page] { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; }
.side nav b { background: var(--c); color: var(--head); font-size: .75rem; min-width: 22px; text-align: center; padding: 2px 6px; border-radius: 99px; }
.side .foot { margin-top: auto; display: grid; gap: 8px; padding: 0 10px; font-size: .85rem; }
.side .foot a, .side .foot button { color: #c6d2e6; text-align: left; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.main { padding: clamp(20px, 4vw, 44px); display: grid; gap: 28px; align-content: start; min-width: 0; }
.main > header { display: grid; gap: 6px; }
.main > header p { color: var(--muted); max-width: 70ch; }
.stats { display: flex; flex-wrap: wrap; gap: 10px 36px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.stats div { display: flex; align-items: baseline; gap: 8px; }
.stats b { font: 700 1.6rem var(--display); color: var(--head); }
.stats span { color: var(--muted); font-size: .9rem; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .82rem; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .name { font-weight: 600; color: var(--head); }
td small { color: var(--muted); display: block; }
td .actions { justify-content: flex-end; flex-wrap: nowrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; padding: 9px 12px; font-size: .92rem; }
.inline-date { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); }
.inline-date input { width: auto; padding: 7px 9px; font-size: .88rem; }
.book-row { display: flex; gap: 14px; align-items: center; }
.book-row img { width: 44px; aspect-ratio: 210 / 297; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); background: #e6eaf1; }
.upload { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.upload h3, .upload .full { grid-column: 1 / -1; }
.switch { display: flex; gap: 12px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px 20px; max-width: 640px; }
.switch p { color: var(--muted); font-size: .92rem; }
.switch strong { color: var(--head); }

dialog { border: 0; border-radius: var(--r-l); padding: 0; width: min(560px, calc(100vw - 32px)); color: var(--text); box-shadow: 0 30px 80px rgba(22, 34, 46, .35); }
dialog::backdrop { background: rgba(22, 34, 46, .55); }
dialog form { display: grid; gap: 18px; padding: 26px; }
dialog .grant { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid #edf0f5; }
dialog .grant small { color: var(--muted); display: block; }
dialog .grant input[type=date] { width: auto; padding: 8px 10px; font-size: .88rem; }
dialog .actions { justify-content: flex-end; }

@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 14px; gap: 12px; }
  .side nav { grid-auto-flow: column; overflow-x: auto; justify-content: start; }
  .side nav button { white-space: nowrap; }
  .side .foot { margin: 0; display: flex; gap: 16px; }
}

/* ---------- reader ---------- */
.reader { background: #0f1820; color: #dbe3f0; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.reader .bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #16222e; border-bottom: 1px solid rgba(255, 255, 255, .08); min-width: 0; }
.reader .bar .title { font: 650 1rem var(--display); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.reader .bar .spacer { flex: 1; }
.tool { background: transparent; border: 1px solid rgba(255, 255, 255, .16); color: #dbe3f0; font: 500 .86rem var(--body); padding: 8px 11px; border-radius: var(--r-s); cursor: pointer; white-space: nowrap; text-decoration: none; }
.tool:hover { border-color: rgba(255, 255, 255, .5); color: #fff; }
.tool[aria-pressed=true] { background: #fff; color: var(--head); border-color: #fff; }
.tool:disabled { opacity: .4; cursor: default; }
.zoom { display: flex; align-items: center; gap: 4px; }
.zoom output { min-width: 46px; text-align: center; font-size: .86rem; }
.body { position: relative; display: flex; min-height: 0; }
.viewport { position: relative; flex: 1; min-width: 0; display: grid; }
.rail { flex: none; width: 148px; overflow-y: auto; padding: 14px 12px; background: #121c26; border-right: 1px solid rgba(255, 255, 255, .08); display: grid; gap: 12px; align-content: start; }
.rail button { background: none; border: 2px solid transparent; border-radius: 6px; padding: 3px; cursor: pointer; display: grid; gap: 4px; color: #93a3bf; font: 500 .75rem var(--body); }
.rail canvas { width: 100%; aspect-ratio: 210 / 297; background: #1f2e3c; border-radius: 3px; display: block; }
.rail button[aria-current=true] { border-color: var(--c); color: #fff; }
.stage { overflow: auto; min-height: 0; display: grid; place-items: safe center; padding: 18px; }
.sheet { display: flex; box-shadow: 0 24px 70px rgba(0, 0, 0, .5); background: #fff; transition: opacity .12s; }
.sheet.turning { opacity: .25; }
.sheet canvas { display: block; height: calc(var(--fit, 600px) * var(--zoom, 1)); width: auto; pointer-events: none; }
.sheet canvas + canvas { border-left: 1px solid #cfd5e0; }
.nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 46px; height: 76px; border: 0; border-radius: var(--r-s); background: rgba(22, 34, 46, .78); color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer; }
.nav:hover { background: var(--a); }
.nav:disabled { opacity: 0; pointer-events: none; }
.nav.prev { left: 14px; } .nav.next { right: 14px; }
.scrub { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: #16222e; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .86rem; }
.scrub input[type=range] { flex: 1; accent-color: var(--c); min-width: 0; }
.scrub .count { white-space: nowrap; min-width: 90px; text-align: right; }
.shield { position: fixed; inset: 0; z-index: 50; background: #0f1820; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 24px; }
.shield h2 { color: #fff; }
.shield p { color: #93a3bf; max-width: 46ch; }
.shield .btn { background: #fff; color: var(--head); border-color: #fff; }
@media (max-width: 760px) {
  .rail { position: absolute; z-index: 5; top: 0; bottom: 0; left: 0; }
  .reader .bar .title, .tool.wide-only, .zoom output { display: none; }
  .nav { width: 38px; height: 60px; }
}
@media print { body { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- motion between pages ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .28s cubic-bezier(.6, 0, .8, .4) both; }
::view-transition-new(root) { animation: vtIn .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes vtOut { to { opacity: 0; transform: scale(.975); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(26px) scale(1.015); } }
.list-rows { display: grid; gap: 8px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); text-decoration: none; color: inherit; font-size: .93rem; }
a.list-row:hover { border-color: var(--head); }
.list-row div { min-width: 0; display: grid; gap: 2px; }
.list-row small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: .88rem; cursor: pointer; }
.code { font: 700 1.5rem var(--display); letter-spacing: .14em; color: var(--head); }

/* ---------- questions in the reader ---------- */
.pg { position: relative; display: block; line-height: 0; }
.pg + .pg { border-left: 1px solid #cfd5e0; }
.pg .mark { position: absolute; border: 2px solid var(--c); background: rgba(242, 194, 48, .22); border-radius: 4px; cursor: pointer; padding: 0; }
.pg .mark.teacher { border-color: var(--b); background: rgba(35, 145, 95, .2); }
.pg .mark.on { box-shadow: 0 0 0 4px rgba(114, 220, 95, .55); }
.pg .mark.draft { border-style: dashed; border-color: var(--a); background: rgba(47, 116, 181, .18); pointer-events: none; }
.sheet.marking .pg { cursor: crosshair; }
.sheet.marking .mark { pointer-events: none; }
.qa { flex: none; width: min(360px, 100vw); background: #121c26; border-left: 1px solid rgba(255, 255, 255, .08); display: flex; flex-direction: column; min-height: 0; user-select: text; -webkit-user-select: text; }
.qa header { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.qa h2 { color: #fff; font-size: 1.05rem; }
.qa-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: grid; gap: 10px; align-content: start; font-size: .9rem; line-height: 1.5; }
.qa-item { text-align: left; background: #1a2733; border: 1px solid transparent; color: #dbe3f0; border-radius: var(--r-s); padding: 10px 12px; cursor: pointer; display: grid; gap: 2px; font: inherit; }
.qa-item:hover { border-color: rgba(255, 255, 255, .3); }
.qa-item small, .msg small { color: #93a3bf; }
.msg { background: #1a2733; border-radius: var(--r-s); padding: 10px 12px; display: grid; gap: 6px; }
.msg.mine { background: #22384a; }
.msg p { white-space: pre-wrap; overflow-wrap: anywhere; color: #eef3f8; }
.msg a { color: #9fd4ff; overflow-wrap: anywhere; }
.msg img { max-width: 100%; border-radius: 6px; display: block; }
.qa-form { padding: 12px 16px 16px; border-top: 1px solid rgba(255, 255, 255, .08); display: grid; gap: 10px; }
.qa-form textarea { background: #0f1820; border-color: rgba(255, 255, 255, .16); color: #fff; min-height: 76px; }
.qa-form .file-pick { color: #93a3bf; }
.qa-form .btn { background: #fff; color: var(--head); border-color: #fff; }
.qa-form .btn.quiet, .qa .file-pick .btn { background: transparent; color: #dbe3f0; border-color: rgba(255, 255, 255, .2); }
.qa-note { color: #93a3bf; }
.tool b { background: var(--c); color: var(--head); border-radius: 99px; padding: 1px 6px; font-size: .72rem; margin-left: 4px; }
@media (max-width: 760px) { .qa { position: absolute; z-index: 6; top: 0; bottom: 0; right: 0; } }
/* ---------- dark theme ---------- */
:root[data-theme=dark] {
  color-scheme: dark;
  --head: #eef3f8;
  --text: #c6d1dc;
  --muted: #8fa0b2;
  --paper: #0f1820;
  --surface: #18242f;
  --line: #2c3c4b;
}
[data-theme=dark] .brand img[src$='dev-dark.png'] { content: url(/brand/dev-light.png); }
[data-theme=dark] .btn:not(.go):not(.danger):not(.quiet) { background: #eef3f8; border-color: #eef3f8; color: #16222e; }
[data-theme=dark] .top { background: rgba(15, 24, 32, .9); }
[data-theme=dark] .chip { background: rgba(255, 255, 255, .09); color: #c6d1dc; }
[data-theme=dark] .chip.active, [data-theme=dark] .chip.approved { background: rgba(35, 145, 95, .25); color: #8fe3b9; }
[data-theme=dark] .chip.pending, [data-theme=dark] .chip.unverified { background: rgba(242, 194, 48, .2); color: #f6d981; }
[data-theme=dark] .chip.suspended, [data-theme=dark] .chip.rejected, [data-theme=dark] .chip.paused, [data-theme=dark] .chip.ended { background: rgba(220, 79, 42, .25); color: #ffb39e; }
[data-theme=dark] .chip.teacher { background: rgba(47, 116, 181, .28); color: #a9d0f5; }
[data-theme=dark] .roles label:has(input:checked) { background: rgba(47, 116, 181, .2); }
[data-theme=dark] .note.new { background: rgba(114, 220, 95, .12); }
[data-theme=dark] td, [data-theme=dark] .people li, [data-theme=dark] dialog .grant { border-color: var(--line); }
[data-theme=dark] .meter { background: #2c3c4b; }
[data-theme=dark] body[data-programme=myp] { --hero-bg: linear-gradient(120deg, #18242f 40%, #17324d); --hero-text: #eef3f8; --hero-soft: #a9b8c6; --hero-chip: rgba(255, 255, 255, .1); }
[data-theme=dark] body[data-programme=pyp] { --hero-bg: linear-gradient(120deg, #18242f 40%, #4a3a0c); --hero-text: #eef3f8; --hero-soft: #a9b8c6; --hero-chip: rgba(255, 255, 255, .1); }
dialog { background: var(--surface); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--head); cursor: pointer; flex: none; }
.icon-btn:hover { border-color: var(--head); }
.theme-float { position: absolute; top: 18px; right: 18px; z-index: 3; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: #fff; }

/* ---------- sign-in: everything on one screen ---------- */
.auth { height: 100dvh; min-height: 0; overflow: hidden; }
.auth-form { padding: 20px clamp(20px, 5vw, 72px) 16px; overflow-y: auto; min-height: 0; }
.auth-form .view { padding: 14px 0; gap: 14px; max-width: 440px; }
.auth-form .view h1 { font-size: clamp(1.6rem, 3.4vh, 2.1rem); }
.auth-form form { gap: 12px; }
.auth-form input[type=text], .auth-form input[type=email], .auth-form input[type=password] { padding: 10px 12px; }
.auth-form .btn.wide { padding: 12px 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brand.big { font-size: 1.5rem; }
.partners img { height: 24px; }
.auth-foot { gap: 8px; max-width: 440px; }
.publisher { padding-top: 12px; }
.publisher strong { font-size: 1.02rem; }
.publisher span:last-child { font-size: .84rem; }
.sub-links { gap: 5px; font-size: .92rem; }

.auth-art { min-height: 0; height: 100%; grid-template-rows: auto minmax(0, 1fr) auto; }
.slogan-block { padding: clamp(24px, 7vh, 80px) clamp(28px, 5vw, 72px) 0; gap: 2.4vh; }
.slogan { font-size: clamp(2.4rem, min(6.4vw, 12.5vh), 6.2rem); }
.gears { right: -30px; bottom: calc(18vh + 20px); width: min(44%, 42vh); }
.orbit { height: 18vh; min-height: 96px; max-height: 150px; }
.orbit img { height: clamp(28px, 5.5vh, 44px); }
@media (max-width: 900px) {
  .auth { height: auto; overflow: visible; }
  .auth-art { height: auto; }
}

/* opening sequence: the wordmark, then the three lines, nothing else */
.opening { place-items: center start; padding-left: clamp(28px, 14vw, 240px); }
.intro-stack { position: relative; display: grid; gap: clamp(14px, 4vh, 40px); }
.intro-brand { display: flex; align-items: baseline; gap: .3em; font: 300 clamp(2.2rem, min(5vw, 9vh), 4rem)/1 var(--display); letter-spacing: -0.02em; color: #fff; animation: logoIn 1.1s cubic-bezier(.2, .8, .2, 1) both; }
.intro-brand img { height: .98em; width: auto; display: block; }
.intro-lines { margin: 0; padding: 0; width: auto; gap: 0; }
.intro-lines p { overflow: hidden; padding-bottom: .08em; }
.intro-lines b { font-size: clamp(2.8rem, min(9vw, 17vh), 7.5rem); line-height: .98; display: block; }
.intro-lines p:nth-child(1) b { animation-delay: 1.2s; }
.intro-lines p:nth-child(2) b { animation-delay: 2.1s; }
.intro-lines p:nth-child(3) b { animation-delay: 3s; }

/* ---------- calm backdrop: the two green arcs from the brand artwork ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.backdrop::before, .backdrop::after { content: ''; position: absolute; border-radius: 50%; right: -260px; top: -300px; width: 640px; height: 640px; background: rgba(114, 220, 95, .09); animation: breathe 14s ease-in-out infinite alternate; }
.backdrop::after { right: -140px; top: -400px; background: rgba(114, 220, 95, .06); animation-delay: -7s; }
@keyframes breathe { to { transform: scale(1.07) translate(-14px, 10px); } }

/* ---------- top navigation ---------- */
.tabs { display: flex; gap: 4px; margin-left: 12px; }
.tabs a { padding: 8px 14px; border-radius: 99px; font-size: .92rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.tabs a:hover { color: var(--head); }
.tabs a[aria-current=page] { background: var(--head); color: var(--paper); }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- switches ---------- */
.sw { appearance: none; -webkit-appearance: none; width: 38px !important; height: 22px !important; border-radius: 99px; background: #c3ccd8; position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.sw:checked { background: var(--b); }
.sw:checked::after { transform: translateX(16px); }

/* ---------- questions list ---------- */
.q-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.q-filters select { width: auto; padding: 9px 12px; font-size: .9rem; }
.pills { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.pills button { border: 0; background: none; font: 600 .86rem var(--body); color: var(--muted); padding: 7px 14px; border-radius: 99px; cursor: pointer; }
.pills button[aria-pressed=true] { background: var(--head); color: var(--paper); }
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.q-card { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--b); border-radius: var(--r-m); text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.q-card.waiting { border-left-color: var(--c); }
.q-card:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -20px rgba(22, 34, 46, .5); }
.q-card .avatar { grid-row: span 3; }
.q-card .q-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.q-card .q-top strong { color: var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-card p { color: var(--text); font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.q-card .q-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .8rem; color: var(--muted); align-items: center; }

/* ---------- classes ---------- */
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.klass { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.klass-head { display: flex; align-items: center; gap: 16px; padding: 20px 24px; border-left: 6px solid var(--muted); flex-wrap: wrap; }
.klass.open .klass-head { border-left-color: var(--b); }
.klass.waiting .klass-head { border-left-color: var(--c); }
.klass.closed .klass-head { border-left-color: var(--d); }
.klass-head h2 { font-size: 1.35rem; }
.klass-head .grow { flex: 1; min-width: 180px; display: grid; gap: 2px; }
.klass-head .grow span { color: var(--muted); font-size: .9rem; }
.klass-stats { display: flex; gap: 22px; }
.klass-stats div { display: grid; text-align: center; }
.klass-stats b { font: 700 1.3rem var(--display); color: var(--head); }
.klass-stats span { font-size: .76rem; color: var(--muted); }
.klass-body { padding: 0 24px 22px; display: grid; gap: 18px; }
.klass-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.klass-row input[type=text] { flex: 1; min-width: 200px; padding: 10px 12px; font-size: .9rem; }
.callout { background: #fdf1c7; color: #5c4400; border-radius: var(--r-s); padding: 12px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: .92rem; }
.callout .code { color: #16222e; }
.roster { width: 100%; border-collapse: collapse; font-size: .92rem; }
.roster th { padding: 8px 10px; }
.roster td { padding: 10px; border-bottom: 1px solid var(--line); }
.roster tr:last-child td { border-bottom: 0; }
.pin { font: 700 .95rem var(--display); letter-spacing: .12em; background: #fdf1c7; color: #5c4400; padding: 3px 8px; border-radius: 6px; }
.ghost-x { border: 0; background: none; color: var(--muted); font: 600 .84rem var(--body); cursor: pointer; padding: 6px 8px; border-radius: 6px; }
.ghost-x:hover, .ghost-x.armed { color: #fff; background: var(--d); }
.klass-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- profile ---------- */
.profile-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.id-card { background: var(--ink); color: #fff; border-radius: var(--r-l); padding: 28px 24px; display: grid; gap: 14px; justify-items: center; text-align: center; position: sticky; top: 92px; overflow: hidden; }
.id-card::before { content: ''; position: absolute; width: 300px; height: 300px; border-radius: 50%; left: -190px; top: -200px; background: rgba(114, 220, 95, .2); }
.id-card > * { position: relative; }
.id-card .photo { width: 128px; height: 128px; border-radius: 50%; background: #24384a; display: grid; place-items: center; font: 700 3rem var(--display); overflow: hidden; box-shadow: 0 0 0 4px rgba(255, 255, 255, .12), 0 6px 0 0 var(--dot); }
.id-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.id-card h2 { color: #fff; font-size: 1.35rem; }
.id-card .mail { color: #a9b8c6; font-size: .88rem; overflow-wrap: anywhere; }
.id-card .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.id-card .btn:hover { border-color: #fff; }
.panels { display: grid; gap: 20px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 22px 24px; display: grid; gap: 16px; }
.panel h2 { font-size: 1.2rem; }
.panel .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: start; }
.phone-row { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 8px; }
.locked { background: var(--paper) !important; color: var(--muted) !important; cursor: not-allowed; }
.teach { display: grid; gap: 12px; }
.teach div { display: grid; gap: 4px; }
.teach span { color: var(--muted); font-size: .9rem; }
@media (max-width: 860px) { .profile-grid { grid-template-columns: 1fr; } .id-card { position: static; } }

/* ---------- programme pages: motion ---------- */
.cycle-svg .ring { transform-box: fill-box; transform-origin: center; animation: turn 90s linear infinite; }
.cycle-svg .seg { stroke-dasharray: 270; stroke-dashoffset: 270; animation: draw 1s cubic-bezier(.3, .7, .2, 1) forwards; transition: stroke-width .2s; cursor: pointer; }
.cycle-svg .seg:nth-of-type(2) { animation-delay: .18s; } .cycle-svg .seg:nth-of-type(3) { animation-delay: .36s; } .cycle-svg .seg:nth-of-type(4) { animation-delay: .54s; }
.cycle-svg .seg:hover, .cycle-svg .seg.on { stroke-width: 56; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.cycle-svg .centre { transition: opacity .25s; }
.blocks .blk { transform-box: fill-box; transform-origin: left center; animation: drop .6s cubic-bezier(.2, 1.4, .4, 1) backwards; }
.blocks .blk.run rect { filter: brightness(1.18) drop-shadow(0 0 10px rgba(114, 220, 95, .9)); }
.blocks .sprite { transition: transform .6s cubic-bezier(.4, 0, .2, 1); }
@keyframes drop { from { opacity: 0; transform: translateY(-46px) rotate(-4deg); } }
.hero-text > * { animation: heroIn .7s cubic-bezier(.2, .8, .2, 1) backwards; }
.hero-text > :nth-child(2) { animation-delay: .08s; } .hero-text > :nth-child(3) { animation-delay: .16s; } .hero-text > :nth-child(4) { animation-delay: .24s; } .hero-text > :nth-child(5) { animation-delay: .32s; }
@keyframes heroIn { from { opacity: 0; transform: translateY(22px); } }

/* VEX IQ: text and logos on a light side, the blue plastic panel behind the robot */
body[data-programme=vex-iq] { --hero-bg: #fff; --hero-text: var(--ink); --hero-soft: var(--muted); --hero-chip: #e6f1fa; }
body[data-programme=vex-iq] .hero::after { content: ''; position: absolute; top: 0; bottom: 0; right: 0; width: 56%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34'%3E%3Ccircle cx='17' cy='17' r='6' fill='%23ffffff' fill-opacity='.08'/%3E%3C/svg%3E"), linear-gradient(135deg, #0a8ae0, #005a9e);
  clip-path: polygon(16% 0, 100% 0, 100% 100%, 0 100%); }
body[data-programme=vex-iq] .hero-in { z-index: 1; }
body[data-programme=vex-iq] .hero-logos .logo { filter: none; }
body[data-programme=vex-iq] .hero-visual .hint, body[data-programme=vex-iq] .build-step { color: #fff; }
[data-theme=dark] body[data-programme=vex-iq] { --hero-bg: #18242f; --hero-text: #eef3f8; --hero-soft: #a9b8c6; --hero-chip: rgba(255, 255, 255, .1); }
@media (max-width: 860px) { body[data-programme=vex-iq] .hero::after { width: 100%; top: 52%; clip-path: none; } }
.build-step { position: absolute; left: 8px; bottom: 0; font: 600 .86rem var(--display); color: var(--hero-soft, var(--muted)); }
.hero-visual .hint { display: flex; gap: 12px; align-items: center; }
.hero-visual .hint button { background: none; border: 1px solid currentColor; color: inherit; font: 600 .78rem var(--body); padding: 5px 10px; border-radius: 99px; cursor: pointer; }
.hero-link { font-size: .86rem; color: var(--hero-soft, var(--muted)); max-width: 40ch; }
.hero-link a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .cycle-svg .seg { stroke-dashoffset: 0; }
}

/* ---------- sign-in, third pass: tighter form, larger slogan, gears beside it ---------- */
.auth-form .view { max-width: 350px; gap: 12px; }
.auth-form .view h1 { font-size: clamp(1.45rem, 3vh, 1.8rem); }
.auth-form .field > span { font-size: .8rem; }
.auth-form input[type=text], .auth-form input[type=email], .auth-form input[type=password] { padding: 9px 12px; font-size: .94rem; }
.auth-form .btn.wide { padding: 11px 16px; font-size: .92rem; }
.auth-form .view > p, .sub-links { font-size: .88rem; }
.auth-foot { max-width: 350px; }
#view-register, #view-class-register { max-width: 440px; }

.auth-art { grid-template-rows: minmax(0, 1fr) auto; }
.art-main { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 1vw; padding-left: clamp(36px, 7vw, 120px); min-height: 0; overflow: hidden; }
.slogan-block { padding: 0; gap: 2.6vh; }
.slogan { font-size: clamp(2.8rem, min(7vw, 14.5vh), 7.4rem); }
.slogan-sub { font-size: clamp(1.1rem, min(1.7vw, 3.2vh), 1.6rem); max-width: 22ch; }
.gears { position: static; width: auto; margin-right: -9%; opacity: 1; align-self: center; }
.gears svg { width: 100%; height: auto; max-height: 62vh; }
.orbit { grid-row: 2; }
@media (max-width: 900px) { .art-main { grid-template-columns: 1fr; padding: 28px 24px; } }

/* feedback on the sign-in form */
.shake { animation: shake .5s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
.shake input:not([type=checkbox]):not([type=radio]) { border-color: var(--d); box-shadow: 0 0 0 3px rgba(220, 79, 42, .18); transition: border-color .2s, box-shadow .2s; }
.notice:not([hidden]) { animation: noticeIn .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes noticeIn { from { opacity: 0; transform: translateY(-8px); } }
.btn.ok { background: var(--b) !important; border-color: var(--b) !important; color: #fff !important; transition: background .25s, border-color .25s; }
.btn.ok svg { width: 22px; height: 22px; }
.btn.ok path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .4s .1s ease-out forwards; }
/* the green dot grows from a point until it covers the screen */
.wipe { position: fixed; z-index: 200; border-radius: 50%; background: var(--dot); transform: translate(-50%, -50%) scale(1); transition: transform .6s cubic-bezier(.7, 0, .2, 1); pointer-events: none; }

/* ---------- opening sequence, second version ---------- */
.opening { place-items: center; padding: 0; transition: opacity .45s; }
.opening::before { display: none; }
.opening.gone { opacity: 0; }
.intro-stack { gap: clamp(10px, 3vh, 30px); justify-items: start; }
.intro-brand { font-size: clamp(1.4rem, min(3vw, 5.5vh), 2.4rem); color: #8fa3b5; animation: introBrand .9s cubic-bezier(.2, .8, .2, 1) both; padding-left: .06em; }
@keyframes introBrand { from { opacity: 0; transform: translateY(-18px); } }
.iline { position: relative; display: block; width: max-content; font: 800 clamp(3rem, min(12.5vw, 23vh), 12rem)/.98 var(--display); letter-spacing: -0.04em; margin: 0; }
.iline .base { color: rgba(255, 255, 255, .13); opacity: 0; animation: fade .6s forwards; }
.iline .fill { position: absolute; inset: 0; color: var(--dot); clip-path: inset(0 100% 0 0); animation: sweep 1s linear forwards; white-space: nowrap; }
/* the dot crosses the word, painting it green; the word then settles to white and the dot becomes its full stop */
.iline .idot { position: absolute; left: 0; top: .36em; width: .17em; height: .17em; margin-left: -.085em; border-radius: 50%; background: var(--dot); box-shadow: 0 0 .5em rgba(114, 220, 95, .8); opacity: 0; animation: travel 1s linear forwards; }
@keyframes sweep { 0% { clip-path: inset(0 100% 0 0); color: var(--dot); } 72% { clip-path: inset(0 0 0 0); color: var(--dot); } 100% { clip-path: inset(0 0 0 0); color: #fff; } }
@keyframes travel { 0% { left: 0; top: .36em; opacity: 1; } 72% { left: 100%; top: .36em; opacity: 1; } 86% { left: calc(100% + .12em); top: .2em; } 100% { left: calc(100% + .12em); top: .615em; opacity: 1; box-shadow: none; } }
.iline:nth-child(1) .base { animation-delay: .5s; } .iline:nth-child(2) .base { animation-delay: .62s; } .iline:nth-child(3) .base { animation-delay: .74s; }
.iline:nth-child(1) .fill, .iline:nth-child(1) .idot { animation-delay: 1.2s; }
.iline:nth-child(2) .fill, .iline:nth-child(2) .idot { animation-delay: 2.3s; }
.iline:nth-child(3) .fill, .iline:nth-child(3) .idot { animation-delay: 3.4s; }

/* ---------- programme hero, second pass ---------- */
.hero-in { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; }
.hero-text { gap: 14px; }
.hero-logos { gap: 0; margin-bottom: 14px; align-items: center; }
.hero-logos .logo { height: 30px; filter: none !important; }
.hero-logos .logo + .logo { margin-left: 16px; padding-left: 16px; border-left: 1px solid rgba(128, 140, 155, .4); box-sizing: content-box; }
.hero-text h1 .ch { display: inline-block; animation: chIn .7s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i) * 38ms + .1s); white-space: pre; }
@keyframes chIn { from { opacity: 0; transform: translateY(.55em) rotate(6deg); } }
/* robotics pages get a squarer, engineered headline face */
body[data-programme^=vex] .hero-text h1 { font-family: 'Chakra Petch', var(--display); font-weight: 700; letter-spacing: -0.01em; font-size: clamp(2.2rem, 4.4vw, 3.5rem); }
body[data-programme=vex-iq] .hero-text h1 { color: #0077c8; }
[data-theme=dark] body[data-programme=vex-iq] .hero-text h1 { color: #4fb4f5; }
/* the blue panel now belongs to the robot's column, so it can never run under the text */
body[data-programme=vex-iq] .hero::after { display: none; }
body[data-programme=vex-iq] .hero-visual::before { content: ''; position: absolute; top: -300px; bottom: -300px; left: -4%; right: -60vw;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34'%3E%3Ccircle cx='17' cy='17' r='6' fill='%23ffffff' fill-opacity='.08'/%3E%3C/svg%3E"), linear-gradient(135deg, #0a8ae0, #005a9e);
  clip-path: polygon(9% 0, 100% 0, 100% 100%, 0 100%); }
.hero-visual canvas { position: relative; }
.robot-controls { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; justify-content: center; align-items: center; gap: 14px; font: 600 .82rem var(--body); color: #fff; }
.robot-controls span { display: inline-flex; align-items: center; gap: 8px; opacity: .9; }
.robot-controls span::before { content: '↔'; display: inline-block; font-size: 1.1rem; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(6px); } }
.robot-controls button { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .55); color: #fff; font: inherit; padding: 7px 14px; border-radius: 99px; cursor: pointer; animation: pulse 2.6s ease-in-out infinite; }
.robot-controls button:hover { background: #fff; color: #16222e; animation: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(255, 255, 255, .12); } }
@media (max-width: 860px) { body[data-programme=vex-iq] .hero-visual::before { left: -50vw; clip-path: none; } }

.phone-row { grid-template-columns: 118px 1fr; }

/* ---------- demo account card ---------- */
.demo-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 24px; display: grid; gap: 20px; }
.demo-card header { display: grid; gap: 6px; }
.demo-card header p { color: var(--muted); font-size: .92rem; max-width: 72ch; }
/* one row, every control the same height, labels on one line */
.demo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .75fr) minmax(0, 1.6fr); gap: 16px; align-items: end; }
.demo-grid .field > span { line-height: 1.2; }
.demo-grid input, .demo-grid select { height: 46px; padding: 0 14px; font-size: .95rem; min-width: 0; width: 100%; }
.demo-grid .date-field { display: grid; grid-template-columns: .75fr 1.35fr .95fr; gap: 8px; width: 100%; }
.demo-foot { display: flex; justify-content: flex-end; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 1100px) { .demo-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .demo-grid { grid-template-columns: 1fr; } }

/* ---------- sign-in doors: who are you? ---------- */
.auth-form .view:not([hidden]) { animation: viewIn .4s cubic-bezier(.2, .8, .2, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateX(14px); } }
.doors-auth { display: grid; gap: 10px; }
.pick { --tone: var(--a); display: grid; gap: 2px; text-align: left; padding: 14px 44px 14px 18px; border-radius: var(--r-m); border: 1.5px solid var(--line); border-left: 5px solid var(--tone); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; position: relative; transition: transform .15s, border-color .15s, box-shadow .15s; }
.pick strong { font: 700 1.08rem var(--display); color: var(--head); }
.pick span { font-size: .84rem; color: var(--muted); }
.pick::after { content: ''; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: translateY(-50%) rotate(45deg); transition: right .15s, border-color .15s; }
.pick:hover, .pick:focus-visible { transform: translateX(4px); border-color: var(--tone); box-shadow: 0 12px 24px -18px rgba(22, 34, 46, .6); }
.pick:hover::after { right: 14px; border-color: var(--tone); }
.pick[data-tone=student] { --tone: var(--a); }
.pick[data-tone=teacher] { --tone: var(--ink-2); }
.pick[data-tone=new] { --tone: var(--dot); }
[data-theme=dark] .pick[data-tone=teacher] { --tone: #8fa3b5; }
.code-input { font: 700 1.25rem var(--display) !important; letter-spacing: .32em; text-transform: uppercase; text-align: center; }

/* ---------- the class code, shown large to the teacher ---------- */
.class-code { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 16px 20px; border-radius: var(--r-m); background: var(--paper); border: 1.5px dashed var(--line); }
.class-code .label { display: grid; gap: 2px; font-size: .84rem; color: var(--muted); flex: 1; min-width: 200px; }
.class-code .label strong { font: 700 .95rem var(--display); color: var(--head); }
.class-code .digits { display: flex; gap: 6px; }
.class-code .digits b { width: 44px; height: 56px; display: grid; place-items: center; border-radius: 10px; background: var(--ink); color: #fff; font: 800 1.7rem var(--display); box-shadow: inset 0 -4px 0 var(--dot); }
.klass.waiting .class-code .digits b, .klass.closed .class-code .digits b { opacity: .45; }
@media (max-width: 520px) { .class-code .digits b { width: 36px; height: 48px; font-size: 1.35rem; } }
